|
@@ -35,6 +35,7 @@ namespace LisPacsDataUpload
|
|
|
private string DicLis = AppDomain.CurrentDomain.BaseDirectory + "Lis\\";
|
|
|
|
|
|
private int zlhr = 0;// 是否为临生免
|
|
|
+ private int open_multiple_upload_flag = 0;// 开启多个线程上传
|
|
|
private delegate void SetTextCallback(string text);
|
|
|
//在给textBox1.text赋值的地方调用以下方法即可
|
|
|
public Form1()
|
|
@@ -65,7 +66,7 @@ namespace LisPacsDataUpload
|
|
|
}
|
|
|
private void ShowCheckBox1()
|
|
|
{
|
|
|
- string sql_lis = @"select 互认,zlhr from 互认配置表";
|
|
|
+ string sql_lis = @"select 互认,zlhr,open_multiple_upload from 互认配置表";
|
|
|
DataTable dt_lis = OracleHelper<object>.RunQueryDS(sql_lis);
|
|
|
int total = int.Parse(dt_lis.Rows[0]["互认"].ToString());
|
|
|
if (total == 1)
|
|
@@ -81,6 +82,8 @@ namespace LisPacsDataUpload
|
|
|
{
|
|
|
zlhr= zlhrValue;
|
|
|
}
|
|
|
+ open_multiple_upload_flag = int.Parse(dt_lis.Rows[0]["open_multiple_upload"].ToString());
|
|
|
+
|
|
|
}
|
|
|
private void ShowCheckBox2()
|
|
|
{
|
|
@@ -258,12 +261,16 @@ namespace LisPacsDataUpload
|
|
|
th2.Name = name2;
|
|
|
th2.Start(name2);
|
|
|
|
|
|
- /* System.Threading.Thread.Sleep(5000);
|
|
|
- string name3 = "LIS3" + Tools.GuidTo16String();
|
|
|
- Thread th3 = new Thread(new ParameterizedThreadStart(LisUpload2));
|
|
|
- th3.IsBackground = true;
|
|
|
- th3.Name = name3;
|
|
|
- th3.Start(name3);*/
|
|
|
+ // 开启第二个上传
|
|
|
+ if (1== open_multiple_upload_flag)
|
|
|
+ {
|
|
|
+ System.Threading.Thread.Sleep(5000);
|
|
|
+ string name3 = "LIS3" + Tools.GuidTo16String();
|
|
|
+ Thread th3 = new Thread(new ParameterizedThreadStart(LisUpload2));
|
|
|
+ th3.IsBackground = true;
|
|
|
+ th3.Name = name3;
|
|
|
+ th3.Start(name3);
|
|
|
+ }
|
|
|
|
|
|
if (UploadPacs == 1)//没传影像云的需要上传检查
|
|
|
{
|
|
@@ -951,27 +958,29 @@ namespace LisPacsDataUpload
|
|
|
t.attachmentId Is Null
|
|
|
Order By to_date(t.AUDITTIME,'yyyy-mm-dd hh24:mi:ss')
|
|
|
) b
|
|
|
- ) where rn <30";
|
|
|
+ ) where rn <300 and rn >150 ";
|
|
|
+
|
|
|
DataTable dt = new DataTable();
|
|
|
if (zlhr == zlhrConstant_true)
|
|
|
{
|
|
|
/*limit 100 offset 100*/
|
|
|
lis_sql = @"Select t.* from lis_upload t Where t.attachmentId Is Null
|
|
|
- Order By to_date(t.AUDITTIME,'yyyy-mm-dd hh24:mi:ss') limit 30 offset 30";
|
|
|
+ Order By to_date(t.AUDITTIME,'yyyy-mm-dd hh24:mi:ss') limit 100 offset 100";
|
|
|
dt = OracleHelper<object>.PgQueryDS(lis_sql);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
dt = OracleHelper<object>.RunQueryDS(lis_sql);
|
|
|
}
|
|
|
+ LogHelper.Info("thread2 " + lis_sql);
|
|
|
if (dt.Rows.Count < 1)
|
|
|
{
|
|
|
- LogHelper.Info(Thread_name + "本次[LIS]无数据,等待下一次轮询。");
|
|
|
- LogHelper.Info("执行sql:" + lis_sql);
|
|
|
+ LogHelper.Info(Thread_name + " thread2 本次[LIS]无数据,等待下一次轮询。");
|
|
|
+ LogHelper.Info("thread2 执行sql:" + lis_sql);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- ShowLog = Thread_name + "本次需上传[LIS]数据总条数为[" + dt.Rows.Count + "]条,逐条上传中,请耐心等待。";
|
|
|
+ ShowLog = Thread_name + "thread2 本次需上传[LIS]数据总条数为[" + dt.Rows.Count + "]条,逐条上传中,请耐心等待。";
|
|
|
this.SetText(ShowLog);
|
|
|
LogHelper.Info(ShowLog);
|
|
|
int pdfcountAll = 0;
|
|
@@ -1015,7 +1024,7 @@ namespace LisPacsDataUpload
|
|
|
baseInfo = string.Format(baseInfo, name, sex, age, type, ch, zyh, mzh, dep);
|
|
|
string reportId = dt.Rows[i]["reportId"].ToString();
|
|
|
string dt_sql = @"Select * From lis_upload_items t Where t.groupItemCode = '" + reportId + "'";
|
|
|
- LogHelper.Info("LIS 2 项目指标执行sql:" + dt_sql);
|
|
|
+ LogHelper.Info("thread2 项目指标执行sql:" + dt_sql);
|
|
|
DataTable items = new DataTable();
|
|
|
if (zlhr==zlhrConstant_true)
|
|
|
{
|
|
@@ -1025,7 +1034,7 @@ namespace LisPacsDataUpload
|
|
|
{
|
|
|
items = OracleHelper<object>.RunQueryDS(dt_sql);
|
|
|
}
|
|
|
- LogHelper.Info("LIS 2 项目指标执行sql 条数:" + items.Rows.Count);
|
|
|
+ LogHelper.Info("thread2 项目指标执行sql 条数:" + items.Rows.Count);
|
|
|
if (items.Rows.Count < 1)
|
|
|
{
|
|
|
LogHelper.Info("查询LIS项目指标数据为空,生成PDF失败,跳过本条数据生成下一条PDF。");
|
|
@@ -1055,7 +1064,7 @@ namespace LisPacsDataUpload
|
|
|
ResFile resfile = Tools.JsonToObject<ResFile>(Tools.FormatStr(file_res_aes), Encoding.UTF8);
|
|
|
if (resfile.statusCode != "1")
|
|
|
{
|
|
|
- LogHelper.Info(resfile.message + ",[LIS]PDF文件上传失败!跳过本条数据上传下一条。");
|
|
|
+ LogHelper.Info(resfile.message + ",[LIS]PDF文件上传失败!跳过本条数据上传下一条。thread2 ");
|
|
|
LogHelper.Info("入参:" + file_json);
|
|
|
LogHelper.Info("出参:" + file_res_aes);
|
|
|
ShowLog = "入参:" + file_json + ",出参:" + file_res_aes + ",[LIS]PDF文件上传失败!跳过本条数据上传下一条。";
|
|
@@ -1075,9 +1084,9 @@ namespace LisPacsDataUpload
|
|
|
}
|
|
|
if (file_count < 1)
|
|
|
{
|
|
|
- LogHelper.Info("[LIS]新增表【已上传PDF】失败,跳过本条数据上传下一条!");
|
|
|
- LogHelper.Info("执行sql:" + sql);
|
|
|
- ShowLog = "[LIS]新增表【已上传PDF】失败,跳过本条数据上传下一条!执行sql:" + sql;
|
|
|
+ LogHelper.Info("thread2 [LIS]新增表【已上传PDF】失败,跳过本条数据上传下一条!");
|
|
|
+ LogHelper.Info("thread2 执行sql:" + sql);
|
|
|
+ ShowLog = "thread2 [LIS]新增表【已上传PDF】失败,跳过本条数据上传下一条!执行sql:" + sql;
|
|
|
this.SetText(ShowLog);
|
|
|
continue;
|
|
|
}
|
|
@@ -1146,7 +1155,18 @@ namespace LisPacsDataUpload
|
|
|
a.reportorName,
|
|
|
a.sampleNotes,
|
|
|
a.checkPrice,
|
|
|
- a.attachmentId
|
|
|
+ a.attachmentId,
|
|
|
+ a.patientId ,
|
|
|
+ a.healthNo ,
|
|
|
+ a.medicareNo ,
|
|
|
+ a.socialNo ,
|
|
|
+ a.inpatientAreaCode ,
|
|
|
+ a.sampleName ,
|
|
|
+ a.execHospitalCode ,
|
|
|
+ a.execHospitalName,
|
|
|
+ a.sameHospital,
|
|
|
+ a.projectCode,
|
|
|
+ a.projectName
|
|
|
from lis_upload a ,已上传PDF b
|
|
|
where b.businessnumber = a.BUSINESSNUMBER
|
|
|
and b.reportid = a.REPORTID
|
|
@@ -1167,8 +1187,8 @@ namespace LisPacsDataUpload
|
|
|
}
|
|
|
if (list.Count < 1)
|
|
|
{
|
|
|
- LogHelper.Info("查询LIS数据为空,跳过本条数据上传下一条。");
|
|
|
- LogHelper.Info("执行sql:" + item_sql);
|
|
|
+ LogHelper.Info("thread2 查询LIS数据为空,跳过本条数据上传下一条。");
|
|
|
+ LogHelper.Info("thread2 执行sql:" + item_sql);
|
|
|
continue;
|
|
|
}
|
|
|
List<Dictionary<string, object>> plist = new List<Dictionary<string, object>>();
|
|
@@ -1194,8 +1214,12 @@ namespace LisPacsDataUpload
|
|
|
LogHelper.Info("执行sql:" + lisitems_sql);
|
|
|
continue;
|
|
|
}
|
|
|
- //处理 互认编码的数据
|
|
|
- HandleLisItemData(lisitems);
|
|
|
+ if(zlhr == zlhrConstant_true)
|
|
|
+ {
|
|
|
+ //处理 互认编码的数据
|
|
|
+ HandleLisItemData(lisitems);
|
|
|
+ }
|
|
|
+
|
|
|
dic.Add("DETAILLIST", lisitems);
|
|
|
plist.Add(dic);
|
|
|
//是否授权
|
|
@@ -1213,11 +1237,11 @@ namespace LisPacsDataUpload
|
|
|
ResPacs respacs = Tools.JsonToObject<ResPacs>(Tools.FormatStr(res_aes_pacs), Encoding.UTF8);
|
|
|
if (respacs.statusCode != "1")
|
|
|
{
|
|
|
- ShowLog = respacs.message + ",[LIS]数据上传异常!跳过本条数据上传下一条,偏移量为:" + vi_pacs;
|
|
|
+ ShowLog = respacs.message + ",thread2 ,[LIS]数据上传异常!跳过本条数据上传下一条,偏移量为:" + vi_pacs;
|
|
|
this.SetText(ShowLog);
|
|
|
LogHelper.Info(ShowLog);
|
|
|
- LogHelper.Info("[LIS]出错入参:" + json_pacs_log);
|
|
|
- LogHelper.Info("[LIS]出错出参:" + res_aes_pacs);
|
|
|
+ LogHelper.Info("thread2 [LIS]出错入参:" + json_pacs_log);
|
|
|
+ LogHelper.Info("thread2 [LIS]出错出参:" + res_aes_pacs);
|
|
|
continue;
|
|
|
}
|
|
|
else
|
|
@@ -1239,9 +1263,9 @@ namespace LisPacsDataUpload
|
|
|
}
|
|
|
if (upload_count < 1)
|
|
|
{
|
|
|
- LogHelper.Info("[LIS]更新表【已上传PDF】失败,跳过本条数据上传下一条!");
|
|
|
- LogHelper.Info("执行sql:" + sql_upload);
|
|
|
- ShowLog = "[LIS]新增表【已上传PDF】失败,跳过本条数据上传下一条!执行sql:" + sql_upload;
|
|
|
+ LogHelper.Info("thread2 [LIS]更新表【已上传PDF】失败,跳过本条数据上传下一条!");
|
|
|
+ LogHelper.Info("thread2 执行sql:" + sql_upload);
|
|
|
+ ShowLog = "thread2 [LIS]新增表【已上传PDF】失败,跳过本条数据上传下一条!执行sql:" + sql_upload;
|
|
|
this.SetText(ShowLog);
|
|
|
continue;
|
|
|
}
|
|
@@ -1250,13 +1274,12 @@ namespace LisPacsDataUpload
|
|
|
|
|
|
}
|
|
|
|
|
|
- ShowLog = Thread_name + "本次已生成、上传[LIS]PDF文件总条数为[" + pdfcountAll + "]条,上传[LIS]总条数为[" + uploaded + "]条。";
|
|
|
+ ShowLog = Thread_name + "thread2 本次已生成、上传[LIS]PDF文件总条数为[" + pdfcountAll + "]条,上传[LIS]总条数为[" + uploaded + "]条。";
|
|
|
this.SetText(ShowLog);
|
|
|
LogHelper.Info(ShowLog);
|
|
|
GetLisDefault();
|
|
|
}
|
|
|
|
|
|
-
|
|
|
#endregion
|
|
|
|
|
|
|