using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; using ShenTun.Ecg.Common; namespace ShenTun.Ecg.Pdf { public class EcgByPdf { public async Task ConvertPdfToImg(RequestInterface req) { Task task = Task.Factory.StartNew(() => { Response res = new Response() { code = -1 }; try { if (string.IsNullOrEmpty(req.FtpPath)) { res.message = "取心电图异常:本地FTP未设置,请到客户端参数-心电图中设置"; return res; } if (!Directory.Exists((req.FtpPath))) { res.message = string.Format("取心电图异常:{0}不存在", req.FtpPath); return res; } if (string.IsNullOrEmpty(req.BarCode)) { res.message = "取心电图异常:检查条形码不能为空"; return res; } string pattern = string.Format("{0}\\*{1}.pdf", req.FtpPath, req.BarCode); foreach (var st in FileHelper.GetAllMatchingPaths(pattern)) { } } catch (Exception ex) { res.message = string.Format("获取心电图异常:{0}", ex.Message); } return res; }); Response taskResult = await task; return taskResult; } } }