刘韬 il y a 1 an
Parent
commit
f6183384d6

+ 0 - 1
DataFusion/res/config.properties

@@ -8,6 +8,5 @@ institution_id     = 06300009
 nw_key             = 2c1db8e7eee65eeeebacb0afbec37096
 #DB-local partners
 jdbcUrl_local  = jdbc:mysql://127.0.0.1:3306/pacsonline?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&serverTimezone=Asia/Shanghai
-#jdbcUrl_local  = jdbc:mysql://127.0.0.1:3306/lisdb?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&serverTimezone=Asia/Shanghai
 user_local	   = root
 password_local = Zskk_2023

+ 1 - 1
DataFusion/src/com/zskk/config/ZskkConfig.java

@@ -88,7 +88,7 @@ public class ZskkConfig extends JFinalConfig {
 
 		//获取待匹配列表
 		Cron4jPlugin upData = new Cron4jPlugin();
-		upData.addTask("*/1 * * * *", new UpdateTask());
+		upData.addTask("*/2 * * * *", new UpdateTask());
 		me.add(upData);
 		
 		//获取报告

+ 179 - 1
DataFusion/src/com/zskk/control/ViewController.java

@@ -150,7 +150,7 @@ public class ViewController extends Controller {
 	
 	public void testWeb3() {
 		DataService dService = ServiceFactory.getService(DataService.class);
-		JSONObject jsonObjectback =dService.getPatientInfoFromHis("MZ2874417");
+		JSONObject jsonObjectback =dService.getPatientInfoFromHis(this.getPara("hpid"));
         this.renderJson(jsonObjectback);
 
 	}
@@ -213,6 +213,184 @@ public class ViewController extends Controller {
 
 	}
 	
+	public void sdtb() {
+		DataService dService = ServiceFactory.getService(DataService.class);
+		List<Record> studyidfinds = Db.use("local").find("select * from study where reportstatus between 0 and 9 order by updateAt asc limit 200");
+		if (studyidfinds == null) {
+			return;
+		}
+		for (Record record : studyidfinds) {
+			try {
+				Record pacsRecord = Db.use("connected").findFirst("select * from examinfo where STUDYUID=?",record.getStr("studyuid"));
+				if (pacsRecord == null) {
+					int status = record.getInt("reportstatus") + 1;
+					if (status ==2) {
+						status = 10;
+					}
+					Record user = Db.use("local").findById("study", record.getStr("id")).set("reportstatus", status);
+					Db.use("local").update("study", user);
+					continue;
+				}
+				Map <String,Object> params = new HashMap<String,Object>();
+		    	params.put("type", "1");
+		    	
+				params.put("code", record.getStr("id"));
+				//报告医生姓名
+				params.put("report_doctor_name", pacsRecord.getStr("REPORTDOCTOR")==null?"":pacsRecord.getStr("REPORTDOCTOR"));
+				//报告时间
+				params.put("report_datetime", pacsRecord.getStr("REVIEWDATE")==null?"":pacsRecord.getStr("REVIEWDATE"));
+				//审核医生姓名
+				params.put("review_doctor_name", pacsRecord.getStr("REVIEWDOCTOR")==null?"":pacsRecord.getStr("REVIEWDOCTOR"));
+				//审核时间
+				params.put("review_datetime", pacsRecord.getStr("REVIEWDATE")==null?"":pacsRecord.getStr("REVIEWDATE"));
+				//确认医生姓名
+				params.put("confirm_doctor_name", pacsRecord.getStr("REVIEWDOCTOR")==null?"":pacsRecord.getStr("REVIEWDOCTOR"));
+				//确认时间
+				params.put("confirm_datetime", pacsRecord.getStr("REVIEWDATE")==null?"":pacsRecord.getStr("REVIEWDATE"));
+				//意见建议
+				params.put("description", pacsRecord.getStr("DESCRIPTION")==null?"":pacsRecord.getStr("DESCRIPTION"));
+				//影像所见
+				params.put("impression", pacsRecord.getStr("IMPRESSION")==null?"":pacsRecord.getStr("IMPRESSION"));
+				//exams表
+				//申请科室
+				params.put("application_department", pacsRecord.getStr("DEPARTMENT")==null?"":pacsRecord.getStr("DEPARTMENT"));
+				//申请医生
+				params.put("application_doctor", pacsRecord.getStr("CLINICALDOCTOR")==null?"":pacsRecord.getStr("CLINICALDOCTOR"));
+				//临床诊断
+				params.put("clin_diag", pacsRecord.getStr("DIAGNOSIS")==null?"":pacsRecord.getStr("DIAGNOSIS"));
+				//症状
+				params.put("clin_symp", "");
+				//patient_infos表
+				//患者姓名
+				params.put("name", pacsRecord.getStr("PATIENTNAME")==null?"":pacsRecord.getStr("PATIENTNAME"));
+//				JSONObject jsonObjectback = dService.getPatientInfoFromHis(pacsRecord.getStr("OUTPATIENTNUM"));
+				//患者手机号
+//				params.put("phone", jsonObjectback.getString("PHONENO"));
+				//患者身份证号
+//				params.put("card_num", jsonObjectback.getString("ID_NO"));
+				//患者手机号
+				params.put("phone", "");
+				//患者身份证号
+				params.put("card_num","");
+				//检查结果1阴2阳
+				if (pacsRecord.getStr("PATIENTNAME")==null) {
+					params.put("report_result", "0");
+				}else {
+					params.put("report_result", pacsRecord.getStr("PATIENTNAME").contains("2")?"2":"1");
+				}				
+				//住院号
+//				params.put("hopitalized_no", record.getStr("patientNumber"));
+				//门诊号
+//				params.put("out_patient", record.getStr("patientNumber"));
+				//病人ID
+//				params.put("his_patient_id", record.getStr("patientNumber"));
+				//检查方法
+				params.put("exam_project", pacsRecord.getStr("PROJECT")==null?"":pacsRecord.getStr("PROJECT"));  
+		        String content =  dService.saveReport(params);
+				JSONObject jsonObject = JSON.parseObject(content);
+				if (jsonObject.getString("msg").equals("success")) {
+					Record user = Db.use("local").findById("study", record.getStr("id")).set("reportstatus", 100);
+					Db.use("local").update("study", user);
+				}
+			} catch (Exception e) {
+				// TODO: handle exception
+//				continue;
+				this.renderText(e.toString());
+
+			}
+	}
+        this.renderJson(studyidfinds);
+
+	}
+	
+	public void sdtb2() {
+		DataService dService = ServiceFactory.getService(DataService.class);
+		List<Record> studyidfinds = Db.use("local").find("select * from study where reportstatus between 0 and 9 order by updateAt asc limit 200");
+		if (studyidfinds == null) {
+			return;
+		}
+		for (Record record : studyidfinds) {
+			try {
+				Record pacsRecord = Db.use("connected").findFirst("select * from examinfo where STUDYUID=?",record.getStr("studyuid"));
+				if (pacsRecord == null) {
+					int status = record.getInt("reportstatus") +1;
+					if (status ==2) {
+						status = 10;
+					}
+					Record user = Db.use("local").findById("study", record.getStr("id")).set("reportstatus", status);
+					Db.use("local").update("study", user);
+					continue;
+				}
+				Map <String,Object> params = new HashMap<String,Object>();
+		    	params.put("type", "1");
+		    	
+				params.put("code", record.getStr("id"));
+				//报告医生姓名
+				params.put("report_doctor_name", pacsRecord.getStr("REPORTDOCTOR")==null?"":pacsRecord.getStr("REPORTDOCTOR"));
+				//报告时间
+				params.put("report_datetime", pacsRecord.getStr("REVIEWDATE")==null?"":pacsRecord.getStr("REVIEWDATE"));
+				//审核医生姓名
+				params.put("review_doctor_name", pacsRecord.getStr("REVIEWDOCTOR")==null?"":pacsRecord.getStr("REVIEWDOCTOR"));
+				//审核时间
+				params.put("review_datetime", pacsRecord.getStr("REVIEWDATE")==null?"":pacsRecord.getStr("REVIEWDATE"));
+				//确认医生姓名
+				params.put("confirm_doctor_name", pacsRecord.getStr("REVIEWDOCTOR")==null?"":pacsRecord.getStr("REVIEWDOCTOR"));
+				//确认时间
+				params.put("confirm_datetime", pacsRecord.getStr("REVIEWDATE")==null?"":pacsRecord.getStr("REVIEWDATE"));
+				//意见建议
+				params.put("description", pacsRecord.getStr("DESCRIPTION")==null?"":pacsRecord.getStr("DESCRIPTION"));
+				//影像所见
+				params.put("impression", pacsRecord.getStr("IMPRESSION")==null?"":pacsRecord.getStr("IMPRESSION"));
+				//exams表
+				//申请科室
+				params.put("application_department", pacsRecord.getStr("DEPARTMENT")==null?"":pacsRecord.getStr("DEPARTMENT"));
+				//申请医生
+				params.put("application_doctor", pacsRecord.getStr("CLINICALDOCTOR")==null?"":pacsRecord.getStr("CLINICALDOCTOR"));
+				//临床诊断
+				params.put("clin_diag", pacsRecord.getStr("DIAGNOSIS")==null?"":pacsRecord.getStr("DIAGNOSIS"));
+				//症状
+				params.put("clin_symp", "");
+				//patient_infos表
+				//患者姓名
+				params.put("name", pacsRecord.getStr("PATIENTNAME")==null?"":pacsRecord.getStr("PATIENTNAME"));
+				JSONObject jsonObjectback = dService.getPatientInfoFromHis(pacsRecord.getStr("OUTPATIENTNUM"));
+				//患者手机号
+				params.put("phone", jsonObjectback.getString("PHONENO"));
+				//患者身份证号
+				params.put("card_num", jsonObjectback.getString("ID_NO"));
+				//患者手机号
+				params.put("phone", "");
+				//患者身份证号
+				params.put("card_num","");
+				//检查结果1阴2阳
+				if (pacsRecord.getStr("PATIENTNAME")==null) {
+					params.put("report_result", "0");
+				}else {
+					params.put("report_result", pacsRecord.getStr("PATIENTNAME").contains("2")?"2":"1");
+				}				//住院号
+//				params.put("hopitalized_no", record.getStr("patientNumber"));
+				//门诊号
+//				params.put("out_patient", record.getStr("patientNumber"));
+				//病人ID
+//				params.put("his_patient_id", record.getStr("patientNumber"));
+				//检查方法
+				params.put("exam_project", pacsRecord.getStr("PROJECT")==null?"":pacsRecord.getStr("PROJECT"));  
+		        String content =  dService.saveReport(params);
+				JSONObject jsonObject = JSON.parseObject(content);
+				if (jsonObject.getString("msg").equals("success")) {
+					Record user = Db.findById("study", record.getStr("id")).set("reportstatus", 100);
+					Db.update("study", user);
+				}
+			} catch (Exception e) {
+				// TODO: handle exception
+//				continue;
+				this.renderText(e.toString());
+			}
+	}
+        this.renderJson(studyidfinds);
+
+	}
+	
 	public String postWithJson(String url, JSONObject jsonObject) {
 
 		RequestBody requestBody = RequestBody.create(JSON_CODE, jsonObject.toJSONString());

+ 18 - 9
DataFusion/src/com/zskk/service/DataService.java

@@ -11,6 +11,8 @@ import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.jfinal.kit.PropKit;
+import com.jfinal.plugin.activerecord.Db;
+import com.jfinal.plugin.activerecord.Record;
 import com.zskk.tools.AESUtils;
 
 import okhttp3.FormBody;
@@ -175,15 +177,22 @@ public class DataService {
 //	}
     
     public static void main(String[] args) {
-    	String IV = "0000000000000000";
-    	Map <String,String> map = new HashMap<String,String>();
-    	map.put("exam_status","3");
-    	map.put("createAt", "2023-06-01 00:00:00,2023-06-15 12:00:00");
-    	map.put("num", "30");
-    	String aesEncryptStr = AESUtils.aesEncryptStr(JSON.toJSONString(map), "2c1db8e7eee65eeeebacb0afbec37096",IV);
-//    	Map <String,String> mapaes = new HashMap<String,String>();
-//    	map.put("data",aesEncryptStr);
-		System.out.println(aesEncryptStr);
+//    	String IV = "0000000000000000";
+//    	Map <String,String> map = new HashMap<String,String>();
+//    	map.put("exam_status","3");
+//    	map.put("createAt", "2023-06-01 00:00:00,2023-06-15 12:00:00");
+//    	map.put("num", "30");
+//    	String aesEncryptStr = AESUtils.aesEncryptStr(JSON.toJSONString(map), "2c1db8e7eee65eeeebacb0afbec37096",IV);
+////    	Map <String,String> mapaes = new HashMap<String,String>();
+////    	map.put("data",aesEncryptStr);
+//		System.out.println(aesEncryptStr);
+    	
+    	JSONObject jsonObject = JSON.parseObject("{\"code\":\"200\",\"data\":\"7EnkFEapeVmtaE4N40sVfKo5tNbtBx22rUzC9xeqDDs=\",\"msg\":\"success\"}");
+		if (jsonObject.getString("msg").equals("success")) {
+//			Record user = Db.findById("study", record.getStr("id")).set("reportstatus", 100);
+//			Db.update("study", user);
+			System.out.println(jsonObject.getString("msg"));
+		}
 
 	}
 

+ 32 - 22
DataFusion/src/com/zskk/task/DataTask.java

@@ -23,7 +23,7 @@ public class DataTask implements ITask {
 	public void run() {
 		// TODO Auto-generated method stub
 		DataService dService = ServiceFactory.getService(DataService.class);
-		List<Record> studyidfinds = Db.use("local").find("select * from study where reportstatus =0 or reportstatus =1 order by updateAt desc limit 200");
+		List<Record> studyidfinds = Db.use("local").find("select * from study where reportstatus between 0 and 9 order by updateAt asc limit 200");
 		if (studyidfinds == null) {
 			return;
 		}
@@ -31,6 +31,12 @@ public class DataTask implements ITask {
 			try {
 				Record pacsRecord = Db.use("connected").findFirst("select * from examinfo where STUDYUID=?",record.getStr("studyuid"));
 				if (pacsRecord == null) {
+					int status = record.getInt("reportstatus") +1;
+					if (status ==2) {
+						status = 10;
+					}
+					Record user = Db.use("local").findById("study", record.getStr("id")).set("reportstatus", status);
+					Db.use("local").update("study", user);
 					continue;
 				}
 				Map <String,Object> params = new HashMap<String,Object>();
@@ -38,44 +44,48 @@ public class DataTask implements ITask {
 		    	
 				params.put("code", record.getStr("id"));
 				//报告医生姓名
-				params.put("report_doctor_name", pacsRecord.getStr("REPORTDOCTOR")==null?"":record.getStr("REPORTDOCTOR"));
+				params.put("report_doctor_name", pacsRecord.getStr("REPORTDOCTOR")==null?"":pacsRecord.getStr("REPORTDOCTOR"));
 				//报告时间
-				params.put("report_datetime", pacsRecord.getStr("REVIEWDATE")==null?"":record.getStr("REVIEWDATE"));
+				params.put("report_datetime", pacsRecord.getStr("REVIEWDATE")==null?"":pacsRecord.getStr("REVIEWDATE"));
 				//审核医生姓名
-				params.put("review_doctor_name", pacsRecord.getStr("REVIEWDOCTOR")==null?"":record.getStr("REVIEWDOCTOR"));
+				params.put("review_doctor_name", pacsRecord.getStr("REVIEWDOCTOR")==null?"":pacsRecord.getStr("REVIEWDOCTOR"));
 				//审核时间
-				params.put("review_datetime", pacsRecord.getStr("REVIEWDATE")==null?"":record.getStr("REVIEWDATE"));
+				params.put("review_datetime", pacsRecord.getStr("REVIEWDATE")==null?"":pacsRecord.getStr("REVIEWDATE"));
 				//确认医生姓名
-				params.put("confirm_doctor_name", pacsRecord.getStr("REVIEWDOCTOR")==null?"":record.getStr("REVIEWDOCTOR"));
+				params.put("confirm_doctor_name", pacsRecord.getStr("REVIEWDOCTOR")==null?"":pacsRecord.getStr("REVIEWDOCTOR"));
 				//确认时间
-				params.put("confirm_datetime", pacsRecord.getStr("REVIEWDATE")==null?"":record.getStr("REVIEWDATE"));
+				params.put("confirm_datetime", pacsRecord.getStr("REVIEWDATE")==null?"":pacsRecord.getStr("REVIEWDATE"));
 				//意见建议
-				params.put("description", pacsRecord.getStr("DESCRIPTION")==null?"":record.getStr("DESCRIPTION"));
+				params.put("description", pacsRecord.getStr("DESCRIPTION")==null?"":pacsRecord.getStr("DESCRIPTION"));
 				//影像所见
-				params.put("impression", pacsRecord.getStr("IMPRESSION")==null?"":record.getStr("IMPRESSION"));
+				params.put("impression", pacsRecord.getStr("IMPRESSION")==null?"":pacsRecord.getStr("IMPRESSION"));
 				//exams表
 				//申请科室
-				params.put("application_department", pacsRecord.getStr("DEPARTMENT")==null?"":record.getStr("DEPARTMENT"));
+				params.put("application_department", pacsRecord.getStr("DEPARTMENT")==null?"":pacsRecord.getStr("DEPARTMENT"));
 				//申请医生
-				params.put("application_doctor", pacsRecord.getStr("CLINICALDOCTOR")==null?"":record.getStr("CLINICALDOCTOR"));
+				params.put("application_doctor", pacsRecord.getStr("CLINICALDOCTOR")==null?"":pacsRecord.getStr("CLINICALDOCTOR"));
 				//临床诊断
-				params.put("clin_diag", pacsRecord.getStr("DIAGNOSIS")==null?"":record.getStr("DIAGNOSIS"));
+				params.put("clin_diag", pacsRecord.getStr("DIAGNOSIS")==null?"":pacsRecord.getStr("DIAGNOSIS"));
 				//症状
 				params.put("clin_symp", "");
 				//patient_infos表
 				//患者姓名
-				params.put("name", pacsRecord.getStr("PATIENTNAME")==null?"":record.getStr("PATIENTNAME"));
-//				JSONObject jsonObjectback = dService.getPatientInfoFromHis(pacsRecord.getStr("OUTPATIENTNUM"));
+				params.put("name", pacsRecord.getStr("PATIENTNAME")==null?"":pacsRecord.getStr("PATIENTNAME"));
+				JSONObject jsonObjectback = dService.getPatientInfoFromHis(pacsRecord.getStr("OUTPATIENTNUM"));
 				//患者手机号
-//				params.put("phone", jsonObjectback.getString("PHONENO"));
+				params.put("phone", jsonObjectback.getString("PHONENO")==null?"":jsonObjectback.getString("PHONENO"));
 				//患者身份证号
-//				params.put("card_num", jsonObjectback.getString("ID_NO"));
+				params.put("card_num", jsonObjectback.getString("ID_NO")==null?"":jsonObjectback.getString("ID_NO"));
 				//患者手机号
-				params.put("phone", "");
+//				params.put("phone", "");
 				//患者身份证号
-				params.put("card_num","");
+//				params.put("card_num","");
 				//检查结果1阴2阳
-				params.put("report_result", "0");
+				if (pacsRecord.getStr("PATIENTNAME")==null) {
+					params.put("report_result", "0");
+				}else {
+					params.put("report_result", pacsRecord.getStr("PATIENTNAME").contains("2")?"2":"1");
+				}
 				//住院号
 //				params.put("hopitalized_no", record.getStr("patientNumber"));
 				//门诊号
@@ -83,12 +93,12 @@ public class DataTask implements ITask {
 				//病人ID
 //				params.put("his_patient_id", record.getStr("patientNumber"));
 				//检查方法
-				params.put("exam_project", pacsRecord.getStr("PROJECT")==null?"":record.getStr("PROJECT"));  
+				params.put("exam_project", pacsRecord.getStr("PROJECT")==null?"":pacsRecord.getStr("PROJECT"));  
 		        String content =  dService.saveReport(params);
 				JSONObject jsonObject = JSON.parseObject(content);
 				if (jsonObject.getString("msg").equals("success")) {
-					Record user = Db.findById("study", record.getStr("id")).set("reportstatus", 100);
-					Db.update("study", user);
+					Record user = Db.use("local").findById("study", record.getStr("id")).set("reportstatus", 100);
+					Db.use("local").update("study", user);
 				}
 			} catch (Exception e) {
 				// TODO: handle exception

+ 213 - 0
DataFusion/src/com/zskk/task/DataTask2s.java

@@ -0,0 +1,213 @@
+package com.zskk.task;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.jfinal.kit.PropKit;
+import com.jfinal.plugin.activerecord.Db;
+import com.jfinal.plugin.activerecord.Record;
+import com.jfinal.plugin.cron4j.ITask;
+import com.zskk.service.DataService;
+import com.zskk.service.ServiceFactory;
+import com.zskk.service.ThreadPoolService;
+
+public class DataTask2s implements ITask {
+
+	@Override
+	public void run() {
+		// TODO Auto-generated method stub
+		DataService dService = ServiceFactory.getService(DataService.class);
+		List<Record> studyidfinds = Db.use("local").find("select * from study where reportstatus between 10 and 99 order by updateAt asc limit 200");
+		if (studyidfinds == null) {
+			return;
+		}
+		for (Record record : studyidfinds) {
+			try {
+				Record pacsRecord = Db.use("connected").findFirst("select * from examinfo where STUDYUID=?",record.getStr("studyuid"));
+				if (pacsRecord == null) {
+					int status = record.getInt("reportstatus") +1;
+					if (status ==99) {
+						status = -1;
+					}
+					Record user = Db.use("local").findById("study", record.getStr("id")).set("reportstatus", status);
+					Db.use("local").update("study", user);
+					continue;
+				}
+				Map <String,Object> params = new HashMap<String,Object>();
+		    	params.put("type", "1");
+		    	
+				params.put("code", record.getStr("id"));
+				//报告医生姓名
+				params.put("report_doctor_name", pacsRecord.getStr("REPORTDOCTOR")==null?"":pacsRecord.getStr("REPORTDOCTOR"));
+				//报告时间
+				params.put("report_datetime", pacsRecord.getStr("REVIEWDATE")==null?"":pacsRecord.getStr("REVIEWDATE"));
+				//审核医生姓名
+				params.put("review_doctor_name", pacsRecord.getStr("REVIEWDOCTOR")==null?"":pacsRecord.getStr("REVIEWDOCTOR"));
+				//审核时间
+				params.put("review_datetime", pacsRecord.getStr("REVIEWDATE")==null?"":pacsRecord.getStr("REVIEWDATE"));
+				//确认医生姓名
+				params.put("confirm_doctor_name", pacsRecord.getStr("REVIEWDOCTOR")==null?"":pacsRecord.getStr("REVIEWDOCTOR"));
+				//确认时间
+				params.put("confirm_datetime", pacsRecord.getStr("REVIEWDATE")==null?"":pacsRecord.getStr("REVIEWDATE"));
+				//意见建议
+				params.put("description", pacsRecord.getStr("DESCRIPTION")==null?"":pacsRecord.getStr("DESCRIPTION"));
+				//影像所见
+				params.put("impression", pacsRecord.getStr("IMPRESSION")==null?"":pacsRecord.getStr("IMPRESSION"));
+				//exams表
+				//申请科室
+				params.put("application_department", pacsRecord.getStr("DEPARTMENT")==null?"":pacsRecord.getStr("DEPARTMENT"));
+				//申请医生
+				params.put("application_doctor", pacsRecord.getStr("CLINICALDOCTOR")==null?"":pacsRecord.getStr("CLINICALDOCTOR"));
+				//临床诊断
+				params.put("clin_diag", pacsRecord.getStr("DIAGNOSIS")==null?"":pacsRecord.getStr("DIAGNOSIS"));
+				//症状
+				params.put("clin_symp", "");
+				//patient_infos表
+				//患者姓名
+				params.put("name", pacsRecord.getStr("PATIENTNAME")==null?"":pacsRecord.getStr("PATIENTNAME"));
+				JSONObject jsonObjectback = dService.getPatientInfoFromHis(pacsRecord.getStr("OUTPATIENTNUM"));
+				//患者手机号
+				params.put("phone", jsonObjectback.getString("PHONENO")==null?"":jsonObjectback.getString("PHONENO"));
+				//患者身份证号
+				params.put("card_num", jsonObjectback.getString("ID_NO")==null?"":jsonObjectback.getString("ID_NO"));
+				//患者手机号
+//				params.put("phone", "");
+				//患者身份证号
+//				params.put("card_num","");
+				//检查结果1阴2阳
+				if (pacsRecord.getStr("PATIENTNAME")==null) {
+					params.put("report_result", "0");
+				}else {
+					params.put("report_result", pacsRecord.getStr("PATIENTNAME").contains("2")?"2":"1");
+				}
+				//住院号
+//				params.put("hopitalized_no", record.getStr("patientNumber"));
+				//门诊号
+//				params.put("out_patient", record.getStr("patientNumber"));
+				//病人ID
+//				params.put("his_patient_id", record.getStr("patientNumber"));
+				//检查方法
+				params.put("exam_project", pacsRecord.getStr("PROJECT")==null?"":pacsRecord.getStr("PROJECT"));  
+		        String content =  dService.saveReport(params);
+				JSONObject jsonObject = JSON.parseObject(content);
+				if (jsonObject.getString("msg").equals("success")) {
+					Record user = Db.use("local").findById("study", record.getStr("id")).set("reportstatus", 100);
+					Db.use("local").update("study", user);
+				}
+			} catch (Exception e) {
+				// TODO: handle exception
+				continue;
+			}
+			
+
+		}
+		  			
+//        JSONArray jsonArray = dService.getExamList(50);	
+//        for (Object object : jsonArray) {
+//        	try {
+//			JSONObject jsonObject = JSON.parseObject(object.toString());
+//			Record record = Db.use("local").findFirst("select * from study where studyuid=?", jsonObject.getString("studyuid"));
+//			if (record == null) {
+//				continue;
+//			}
+//			if (record.getStr("IMPRESSION").isBlank() && record.getStr("DESCRIPTION").isBlank()) {
+//				continue;
+//			}
+//			Map<String, String> params = new HashMap<>();
+//			//1:exam_id 2:patient_num 3:accession_num 4:study_uid
+//			params.put("type", "1");
+//			
+//			params.put("institution_id", PropKit.get("institution_id"));
+//
+//			params.put("code", jsonObject.getString("id"));
+//			//报告医生姓名
+//			params.put("report_doctor_name", record.getStr("REPORTDOCTOR"));
+//			//报告时间
+//			params.put("report_datetime", record.getStr("REPORTDATE"));
+//			//审核医生姓名
+//			params.put("review_doctor_name", record.getStr("REVIEWDOCTOR")==null?"":record.getStr("REVIEWDOCTOR"));
+//			//审核时间
+//			params.put("review_datetime", record.getStr("REPORTDATE"));
+//			//确认医生姓名
+//			params.put("confirm_doctor_name", record.getStr("REVIEWDOCTOR")==null?"":record.getStr("REVIEWDOCTOR"));
+//			//确认时间
+//			params.put("confirm_datetime", record.getStr("REPORTDATE"));
+//			//意见建议
+//			params.put("impression", record.getStr("IMPRESSION"));
+//			//影像所见
+//			params.put("description", record.getStr("DESCRIPTION"));
+//			//exams表
+//			//申请科室
+//			params.put("application_department", record.getStr("DEPARTMENT"));
+//			//申请医生
+//			params.put("application_doctor", record.getStr("CLINICALDOCTOR"));
+//			//临床诊断
+//			params.put("clin_diag", record.getStr("clin_diag")==null?"":record.getStr("clin_diag"));
+//			//症状
+//			params.put("clin_symp", record.getStr("clin_symp")==null?"":record.getStr("clin_symp"));
+//			//patient_infos表
+//			//患者姓名
+//			params.put("name", record.getStr("PATIENTNAME"));
+//			//患者手机号
+//			params.put("phone", record.getStr("phone")==null?"":record.getStr("phone"));
+//			//患者身份证号
+//			params.put("card_num", record.getStr("IDCARD"));
+//			//检查结果1阴2阳
+//			params.put("report_result", record.getStr("result").contains("阳")?"2":"1");
+//			//住院号
+////			params.put("hopitalized_no", record.getStr("patientNumber"));
+//			//门诊号
+////			params.put("out_patient", record.getStr("patientNumber"));
+//			//病人ID
+////			params.put("his_patient_id", record.getStr("patientNumber"));
+//			//检查方法
+//			params.put("exam_project", record.getStr("patientNumber"));
+//
+//			ThreadPoolService tService = ServiceFactory.getService(ThreadPoolService.class);
+//			tService.execute(() -> {
+//				dService.saveReport(params);
+//			});	
+//        	} catch (Exception e) {
+//				// TODO: handle exception
+//        		continue;
+//			}
+//        }
+	}
+
+	@Override
+	public void stop() {
+		// TODO Auto-generated method stub
+
+	}
+	
+	/**
+	 * 日期字符串格式转换
+	 * @param dateStr
+	 * @return
+	 */
+	private String parseStringToDate(String dateStr) {
+		if (dateStr == null) {
+			return "";
+		}
+		SimpleDateFormat sdf= new SimpleDateFormat("yyyy.MM.dd HH:mm:ss");
+	    Date date = null;
+	    String timeString = null;
+		try {
+			date = sdf.parse(dateStr);
+			SimpleDateFormat sdf2= new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+
+			timeString = sdf2.format(date);
+		} catch (ParseException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+        return timeString;
+	}
+
+}

+ 209 - 0
DataFusion/src/com/zskk/task/DataTask3s.java

@@ -0,0 +1,209 @@
+package com.zskk.task;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.jfinal.kit.PropKit;
+import com.jfinal.plugin.activerecord.Db;
+import com.jfinal.plugin.activerecord.Record;
+import com.jfinal.plugin.cron4j.ITask;
+import com.zskk.service.DataService;
+import com.zskk.service.ServiceFactory;
+import com.zskk.service.ThreadPoolService;
+
+public class DataTask3s implements ITask {
+
+	@Override
+	public void run() {
+		// TODO Auto-generated method stub
+		DataService dService = ServiceFactory.getService(DataService.class);
+		List<Record> studyidfinds = Db.use("local").find("select * from study where reportstatus between 0 and 9 order by updateAt asc limit 200");
+		if (studyidfinds == null) {
+			return;
+		}
+		for (Record record : studyidfinds) {
+			try {
+				Record pacsRecord = Db.use("connected").findFirst("select * from examinfo where STUDYUID=?",record.getStr("studyuid"));
+				if (pacsRecord == null) {
+					int status = record.getInt("reportstatus") +1;
+					if (status ==2) {
+						status = 10;
+					}
+					Record user = Db.findById("study", record.getStr("id")).set("reportstatus", status);
+					Db.update("study", user);
+					continue;
+				}
+				Map <String,Object> params = new HashMap<String,Object>();
+		    	params.put("type", "1");
+		    	
+				params.put("code", record.getStr("id"));
+				//报告医生姓名
+				params.put("report_doctor_name", pacsRecord.getStr("REPORTDOCTOR")==null?"":record.getStr("REPORTDOCTOR"));
+				//报告时间
+				params.put("report_datetime", pacsRecord.getStr("REVIEWDATE")==null?"":record.getStr("REVIEWDATE"));
+				//审核医生姓名
+				params.put("review_doctor_name", pacsRecord.getStr("REVIEWDOCTOR")==null?"":record.getStr("REVIEWDOCTOR"));
+				//审核时间
+				params.put("review_datetime", pacsRecord.getStr("REVIEWDATE")==null?"":record.getStr("REVIEWDATE"));
+				//确认医生姓名
+				params.put("confirm_doctor_name", pacsRecord.getStr("REVIEWDOCTOR")==null?"":record.getStr("REVIEWDOCTOR"));
+				//确认时间
+				params.put("confirm_datetime", pacsRecord.getStr("REVIEWDATE")==null?"":record.getStr("REVIEWDATE"));
+				//意见建议
+				params.put("description", pacsRecord.getStr("DESCRIPTION")==null?"":record.getStr("DESCRIPTION"));
+				//影像所见
+				params.put("impression", pacsRecord.getStr("IMPRESSION")==null?"":record.getStr("IMPRESSION"));
+				//exams表
+				//申请科室
+				params.put("application_department", pacsRecord.getStr("DEPARTMENT")==null?"":record.getStr("DEPARTMENT"));
+				//申请医生
+				params.put("application_doctor", pacsRecord.getStr("CLINICALDOCTOR")==null?"":record.getStr("CLINICALDOCTOR"));
+				//临床诊断
+				params.put("clin_diag", pacsRecord.getStr("DIAGNOSIS")==null?"":record.getStr("DIAGNOSIS"));
+				//症状
+				params.put("clin_symp", "");
+				//patient_infos表
+				//患者姓名
+				params.put("name", pacsRecord.getStr("PATIENTNAME")==null?"":record.getStr("PATIENTNAME"));
+//				JSONObject jsonObjectback = dService.getPatientInfoFromHis(pacsRecord.getStr("OUTPATIENTNUM"));
+				//患者手机号
+//				params.put("phone", jsonObjectback.getString("PHONENO"));
+				//患者身份证号
+//				params.put("card_num", jsonObjectback.getString("ID_NO"));
+				//患者手机号
+				params.put("phone", "");
+				//患者身份证号
+				params.put("card_num","");
+				//检查结果1阴2阳
+				params.put("report_result", "0");
+				//住院号
+//				params.put("hopitalized_no", record.getStr("patientNumber"));
+				//门诊号
+//				params.put("out_patient", record.getStr("patientNumber"));
+				//病人ID
+//				params.put("his_patient_id", record.getStr("patientNumber"));
+				//检查方法
+				params.put("exam_project", pacsRecord.getStr("PROJECT")==null?"":record.getStr("PROJECT"));  
+		        String content =  dService.saveReport(params);
+				JSONObject jsonObject = JSON.parseObject(content);
+				if (jsonObject.getString("msg").equals("success")) {
+					Record user = Db.findById("study", record.getStr("id")).set("reportstatus", 100);
+					Db.update("study", user);
+				}
+			} catch (Exception e) {
+				// TODO: handle exception
+				continue;
+			}
+			
+
+		}
+		  			
+//        JSONArray jsonArray = dService.getExamList(50);	
+//        for (Object object : jsonArray) {
+//        	try {
+//			JSONObject jsonObject = JSON.parseObject(object.toString());
+//			Record record = Db.use("local").findFirst("select * from study where studyuid=?", jsonObject.getString("studyuid"));
+//			if (record == null) {
+//				continue;
+//			}
+//			if (record.getStr("IMPRESSION").isBlank() && record.getStr("DESCRIPTION").isBlank()) {
+//				continue;
+//			}
+//			Map<String, String> params = new HashMap<>();
+//			//1:exam_id 2:patient_num 3:accession_num 4:study_uid
+//			params.put("type", "1");
+//			
+//			params.put("institution_id", PropKit.get("institution_id"));
+//
+//			params.put("code", jsonObject.getString("id"));
+//			//报告医生姓名
+//			params.put("report_doctor_name", record.getStr("REPORTDOCTOR"));
+//			//报告时间
+//			params.put("report_datetime", record.getStr("REPORTDATE"));
+//			//审核医生姓名
+//			params.put("review_doctor_name", record.getStr("REVIEWDOCTOR")==null?"":record.getStr("REVIEWDOCTOR"));
+//			//审核时间
+//			params.put("review_datetime", record.getStr("REPORTDATE"));
+//			//确认医生姓名
+//			params.put("confirm_doctor_name", record.getStr("REVIEWDOCTOR")==null?"":record.getStr("REVIEWDOCTOR"));
+//			//确认时间
+//			params.put("confirm_datetime", record.getStr("REPORTDATE"));
+//			//意见建议
+//			params.put("impression", record.getStr("IMPRESSION"));
+//			//影像所见
+//			params.put("description", record.getStr("DESCRIPTION"));
+//			//exams表
+//			//申请科室
+//			params.put("application_department", record.getStr("DEPARTMENT"));
+//			//申请医生
+//			params.put("application_doctor", record.getStr("CLINICALDOCTOR"));
+//			//临床诊断
+//			params.put("clin_diag", record.getStr("clin_diag")==null?"":record.getStr("clin_diag"));
+//			//症状
+//			params.put("clin_symp", record.getStr("clin_symp")==null?"":record.getStr("clin_symp"));
+//			//patient_infos表
+//			//患者姓名
+//			params.put("name", record.getStr("PATIENTNAME"));
+//			//患者手机号
+//			params.put("phone", record.getStr("phone")==null?"":record.getStr("phone"));
+//			//患者身份证号
+//			params.put("card_num", record.getStr("IDCARD"));
+//			//检查结果1阴2阳
+//			params.put("report_result", record.getStr("result").contains("阳")?"2":"1");
+//			//住院号
+////			params.put("hopitalized_no", record.getStr("patientNumber"));
+//			//门诊号
+////			params.put("out_patient", record.getStr("patientNumber"));
+//			//病人ID
+////			params.put("his_patient_id", record.getStr("patientNumber"));
+//			//检查方法
+//			params.put("exam_project", record.getStr("patientNumber"));
+//
+//			ThreadPoolService tService = ServiceFactory.getService(ThreadPoolService.class);
+//			tService.execute(() -> {
+//				dService.saveReport(params);
+//			});	
+//        	} catch (Exception e) {
+//				// TODO: handle exception
+//        		continue;
+//			}
+//        }
+	}
+
+	@Override
+	public void stop() {
+		// TODO Auto-generated method stub
+
+	}
+	
+	/**
+	 * 日期字符串格式转换
+	 * @param dateStr
+	 * @return
+	 */
+	private String parseStringToDate(String dateStr) {
+		if (dateStr == null) {
+			return "";
+		}
+		SimpleDateFormat sdf= new SimpleDateFormat("yyyy.MM.dd HH:mm:ss");
+	    Date date = null;
+	    String timeString = null;
+		try {
+			date = sdf.parse(dateStr);
+			SimpleDateFormat sdf2= new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+
+			timeString = sdf2.format(date);
+		} catch (ParseException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+        return timeString;
+	}
+
+}

+ 209 - 0
DataFusion/src/com/zskk/task/DataTask4s.java

@@ -0,0 +1,209 @@
+package com.zskk.task;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.jfinal.kit.PropKit;
+import com.jfinal.plugin.activerecord.Db;
+import com.jfinal.plugin.activerecord.Record;
+import com.jfinal.plugin.cron4j.ITask;
+import com.zskk.service.DataService;
+import com.zskk.service.ServiceFactory;
+import com.zskk.service.ThreadPoolService;
+
+public class DataTask4s implements ITask {
+
+	@Override
+	public void run() {
+		// TODO Auto-generated method stub
+		DataService dService = ServiceFactory.getService(DataService.class);
+		List<Record> studyidfinds = Db.use("local").find("select * from study where reportstatus between 0 and 9 order by updateAt asc limit 200");
+		if (studyidfinds == null) {
+			return;
+		}
+		for (Record record : studyidfinds) {
+			try {
+				Record pacsRecord = Db.use("connected").findFirst("select * from examinfo where STUDYUID=?",record.getStr("studyuid"));
+				if (pacsRecord == null) {
+					int status = record.getInt("reportstatus") +1;
+					if (status ==2) {
+						status = 10;
+					}
+					Record user = Db.findById("study", record.getStr("id")).set("reportstatus", status);
+					Db.update("study", user);
+					continue;
+				}
+				Map <String,Object> params = new HashMap<String,Object>();
+		    	params.put("type", "1");
+		    	
+				params.put("code", record.getStr("id"));
+				//报告医生姓名
+				params.put("report_doctor_name", pacsRecord.getStr("REPORTDOCTOR")==null?"":record.getStr("REPORTDOCTOR"));
+				//报告时间
+				params.put("report_datetime", pacsRecord.getStr("REVIEWDATE")==null?"":record.getStr("REVIEWDATE"));
+				//审核医生姓名
+				params.put("review_doctor_name", pacsRecord.getStr("REVIEWDOCTOR")==null?"":record.getStr("REVIEWDOCTOR"));
+				//审核时间
+				params.put("review_datetime", pacsRecord.getStr("REVIEWDATE")==null?"":record.getStr("REVIEWDATE"));
+				//确认医生姓名
+				params.put("confirm_doctor_name", pacsRecord.getStr("REVIEWDOCTOR")==null?"":record.getStr("REVIEWDOCTOR"));
+				//确认时间
+				params.put("confirm_datetime", pacsRecord.getStr("REVIEWDATE")==null?"":record.getStr("REVIEWDATE"));
+				//意见建议
+				params.put("description", pacsRecord.getStr("DESCRIPTION")==null?"":record.getStr("DESCRIPTION"));
+				//影像所见
+				params.put("impression", pacsRecord.getStr("IMPRESSION")==null?"":record.getStr("IMPRESSION"));
+				//exams表
+				//申请科室
+				params.put("application_department", pacsRecord.getStr("DEPARTMENT")==null?"":record.getStr("DEPARTMENT"));
+				//申请医生
+				params.put("application_doctor", pacsRecord.getStr("CLINICALDOCTOR")==null?"":record.getStr("CLINICALDOCTOR"));
+				//临床诊断
+				params.put("clin_diag", pacsRecord.getStr("DIAGNOSIS")==null?"":record.getStr("DIAGNOSIS"));
+				//症状
+				params.put("clin_symp", "");
+				//patient_infos表
+				//患者姓名
+				params.put("name", pacsRecord.getStr("PATIENTNAME")==null?"":record.getStr("PATIENTNAME"));
+//				JSONObject jsonObjectback = dService.getPatientInfoFromHis(pacsRecord.getStr("OUTPATIENTNUM"));
+				//患者手机号
+//				params.put("phone", jsonObjectback.getString("PHONENO"));
+				//患者身份证号
+//				params.put("card_num", jsonObjectback.getString("ID_NO"));
+				//患者手机号
+				params.put("phone", "");
+				//患者身份证号
+				params.put("card_num","");
+				//检查结果1阴2阳
+				params.put("report_result", "0");
+				//住院号
+//				params.put("hopitalized_no", record.getStr("patientNumber"));
+				//门诊号
+//				params.put("out_patient", record.getStr("patientNumber"));
+				//病人ID
+//				params.put("his_patient_id", record.getStr("patientNumber"));
+				//检查方法
+				params.put("exam_project", pacsRecord.getStr("PROJECT")==null?"":record.getStr("PROJECT"));  
+		        String content =  dService.saveReport(params);
+				JSONObject jsonObject = JSON.parseObject(content);
+				if (jsonObject.getString("msg").equals("success")) {
+					Record user = Db.findById("study", record.getStr("id")).set("reportstatus", 100);
+					Db.update("study", user);
+				}
+			} catch (Exception e) {
+				// TODO: handle exception
+				continue;
+			}
+			
+
+		}
+		  			
+//        JSONArray jsonArray = dService.getExamList(50);	
+//        for (Object object : jsonArray) {
+//        	try {
+//			JSONObject jsonObject = JSON.parseObject(object.toString());
+//			Record record = Db.use("local").findFirst("select * from study where studyuid=?", jsonObject.getString("studyuid"));
+//			if (record == null) {
+//				continue;
+//			}
+//			if (record.getStr("IMPRESSION").isBlank() && record.getStr("DESCRIPTION").isBlank()) {
+//				continue;
+//			}
+//			Map<String, String> params = new HashMap<>();
+//			//1:exam_id 2:patient_num 3:accession_num 4:study_uid
+//			params.put("type", "1");
+//			
+//			params.put("institution_id", PropKit.get("institution_id"));
+//
+//			params.put("code", jsonObject.getString("id"));
+//			//报告医生姓名
+//			params.put("report_doctor_name", record.getStr("REPORTDOCTOR"));
+//			//报告时间
+//			params.put("report_datetime", record.getStr("REPORTDATE"));
+//			//审核医生姓名
+//			params.put("review_doctor_name", record.getStr("REVIEWDOCTOR")==null?"":record.getStr("REVIEWDOCTOR"));
+//			//审核时间
+//			params.put("review_datetime", record.getStr("REPORTDATE"));
+//			//确认医生姓名
+//			params.put("confirm_doctor_name", record.getStr("REVIEWDOCTOR")==null?"":record.getStr("REVIEWDOCTOR"));
+//			//确认时间
+//			params.put("confirm_datetime", record.getStr("REPORTDATE"));
+//			//意见建议
+//			params.put("impression", record.getStr("IMPRESSION"));
+//			//影像所见
+//			params.put("description", record.getStr("DESCRIPTION"));
+//			//exams表
+//			//申请科室
+//			params.put("application_department", record.getStr("DEPARTMENT"));
+//			//申请医生
+//			params.put("application_doctor", record.getStr("CLINICALDOCTOR"));
+//			//临床诊断
+//			params.put("clin_diag", record.getStr("clin_diag")==null?"":record.getStr("clin_diag"));
+//			//症状
+//			params.put("clin_symp", record.getStr("clin_symp")==null?"":record.getStr("clin_symp"));
+//			//patient_infos表
+//			//患者姓名
+//			params.put("name", record.getStr("PATIENTNAME"));
+//			//患者手机号
+//			params.put("phone", record.getStr("phone")==null?"":record.getStr("phone"));
+//			//患者身份证号
+//			params.put("card_num", record.getStr("IDCARD"));
+//			//检查结果1阴2阳
+//			params.put("report_result", record.getStr("result").contains("阳")?"2":"1");
+//			//住院号
+////			params.put("hopitalized_no", record.getStr("patientNumber"));
+//			//门诊号
+////			params.put("out_patient", record.getStr("patientNumber"));
+//			//病人ID
+////			params.put("his_patient_id", record.getStr("patientNumber"));
+//			//检查方法
+//			params.put("exam_project", record.getStr("patientNumber"));
+//
+//			ThreadPoolService tService = ServiceFactory.getService(ThreadPoolService.class);
+//			tService.execute(() -> {
+//				dService.saveReport(params);
+//			});	
+//        	} catch (Exception e) {
+//				// TODO: handle exception
+//        		continue;
+//			}
+//        }
+	}
+
+	@Override
+	public void stop() {
+		// TODO Auto-generated method stub
+
+	}
+	
+	/**
+	 * 日期字符串格式转换
+	 * @param dateStr
+	 * @return
+	 */
+	private String parseStringToDate(String dateStr) {
+		if (dateStr == null) {
+			return "";
+		}
+		SimpleDateFormat sdf= new SimpleDateFormat("yyyy.MM.dd HH:mm:ss");
+	    Date date = null;
+	    String timeString = null;
+		try {
+			date = sdf.parse(dateStr);
+			SimpleDateFormat sdf2= new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+
+			timeString = sdf2.format(date);
+		} catch (ParseException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+        return timeString;
+	}
+
+}

+ 209 - 0
DataFusion/src/com/zskk/task/DataTask5s.java

@@ -0,0 +1,209 @@
+package com.zskk.task;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.jfinal.kit.PropKit;
+import com.jfinal.plugin.activerecord.Db;
+import com.jfinal.plugin.activerecord.Record;
+import com.jfinal.plugin.cron4j.ITask;
+import com.zskk.service.DataService;
+import com.zskk.service.ServiceFactory;
+import com.zskk.service.ThreadPoolService;
+
+public class DataTask5s implements ITask {
+
+	@Override
+	public void run() {
+		// TODO Auto-generated method stub
+		DataService dService = ServiceFactory.getService(DataService.class);
+		List<Record> studyidfinds = Db.use("local").find("select * from study where reportstatus between 0 and 9 order by updateAt asc limit 200");
+		if (studyidfinds == null) {
+			return;
+		}
+		for (Record record : studyidfinds) {
+			try {
+				Record pacsRecord = Db.use("connected").findFirst("select * from examinfo where STUDYUID=?",record.getStr("studyuid"));
+				if (pacsRecord == null) {
+					int status = record.getInt("reportstatus") +1;
+					if (status ==2) {
+						status = 10;
+					}
+					Record user = Db.findById("study", record.getStr("id")).set("reportstatus", status);
+					Db.update("study", user);
+					continue;
+				}
+				Map <String,Object> params = new HashMap<String,Object>();
+		    	params.put("type", "1");
+		    	
+				params.put("code", record.getStr("id"));
+				//报告医生姓名
+				params.put("report_doctor_name", pacsRecord.getStr("REPORTDOCTOR")==null?"":record.getStr("REPORTDOCTOR"));
+				//报告时间
+				params.put("report_datetime", pacsRecord.getStr("REVIEWDATE")==null?"":record.getStr("REVIEWDATE"));
+				//审核医生姓名
+				params.put("review_doctor_name", pacsRecord.getStr("REVIEWDOCTOR")==null?"":record.getStr("REVIEWDOCTOR"));
+				//审核时间
+				params.put("review_datetime", pacsRecord.getStr("REVIEWDATE")==null?"":record.getStr("REVIEWDATE"));
+				//确认医生姓名
+				params.put("confirm_doctor_name", pacsRecord.getStr("REVIEWDOCTOR")==null?"":record.getStr("REVIEWDOCTOR"));
+				//确认时间
+				params.put("confirm_datetime", pacsRecord.getStr("REVIEWDATE")==null?"":record.getStr("REVIEWDATE"));
+				//意见建议
+				params.put("description", pacsRecord.getStr("DESCRIPTION")==null?"":record.getStr("DESCRIPTION"));
+				//影像所见
+				params.put("impression", pacsRecord.getStr("IMPRESSION")==null?"":record.getStr("IMPRESSION"));
+				//exams表
+				//申请科室
+				params.put("application_department", pacsRecord.getStr("DEPARTMENT")==null?"":record.getStr("DEPARTMENT"));
+				//申请医生
+				params.put("application_doctor", pacsRecord.getStr("CLINICALDOCTOR")==null?"":record.getStr("CLINICALDOCTOR"));
+				//临床诊断
+				params.put("clin_diag", pacsRecord.getStr("DIAGNOSIS")==null?"":record.getStr("DIAGNOSIS"));
+				//症状
+				params.put("clin_symp", "");
+				//patient_infos表
+				//患者姓名
+				params.put("name", pacsRecord.getStr("PATIENTNAME")==null?"":record.getStr("PATIENTNAME"));
+//				JSONObject jsonObjectback = dService.getPatientInfoFromHis(pacsRecord.getStr("OUTPATIENTNUM"));
+				//患者手机号
+//				params.put("phone", jsonObjectback.getString("PHONENO"));
+				//患者身份证号
+//				params.put("card_num", jsonObjectback.getString("ID_NO"));
+				//患者手机号
+				params.put("phone", "");
+				//患者身份证号
+				params.put("card_num","");
+				//检查结果1阴2阳
+				params.put("report_result", "0");
+				//住院号
+//				params.put("hopitalized_no", record.getStr("patientNumber"));
+				//门诊号
+//				params.put("out_patient", record.getStr("patientNumber"));
+				//病人ID
+//				params.put("his_patient_id", record.getStr("patientNumber"));
+				//检查方法
+				params.put("exam_project", pacsRecord.getStr("PROJECT")==null?"":record.getStr("PROJECT"));  
+		        String content =  dService.saveReport(params);
+				JSONObject jsonObject = JSON.parseObject(content);
+				if (jsonObject.getString("msg").equals("success")) {
+					Record user = Db.findById("study", record.getStr("id")).set("reportstatus", 100);
+					Db.update("study", user);
+				}
+			} catch (Exception e) {
+				// TODO: handle exception
+				continue;
+			}
+			
+
+		}
+		  			
+//        JSONArray jsonArray = dService.getExamList(50);	
+//        for (Object object : jsonArray) {
+//        	try {
+//			JSONObject jsonObject = JSON.parseObject(object.toString());
+//			Record record = Db.use("local").findFirst("select * from study where studyuid=?", jsonObject.getString("studyuid"));
+//			if (record == null) {
+//				continue;
+//			}
+//			if (record.getStr("IMPRESSION").isBlank() && record.getStr("DESCRIPTION").isBlank()) {
+//				continue;
+//			}
+//			Map<String, String> params = new HashMap<>();
+//			//1:exam_id 2:patient_num 3:accession_num 4:study_uid
+//			params.put("type", "1");
+//			
+//			params.put("institution_id", PropKit.get("institution_id"));
+//
+//			params.put("code", jsonObject.getString("id"));
+//			//报告医生姓名
+//			params.put("report_doctor_name", record.getStr("REPORTDOCTOR"));
+//			//报告时间
+//			params.put("report_datetime", record.getStr("REPORTDATE"));
+//			//审核医生姓名
+//			params.put("review_doctor_name", record.getStr("REVIEWDOCTOR")==null?"":record.getStr("REVIEWDOCTOR"));
+//			//审核时间
+//			params.put("review_datetime", record.getStr("REPORTDATE"));
+//			//确认医生姓名
+//			params.put("confirm_doctor_name", record.getStr("REVIEWDOCTOR")==null?"":record.getStr("REVIEWDOCTOR"));
+//			//确认时间
+//			params.put("confirm_datetime", record.getStr("REPORTDATE"));
+//			//意见建议
+//			params.put("impression", record.getStr("IMPRESSION"));
+//			//影像所见
+//			params.put("description", record.getStr("DESCRIPTION"));
+//			//exams表
+//			//申请科室
+//			params.put("application_department", record.getStr("DEPARTMENT"));
+//			//申请医生
+//			params.put("application_doctor", record.getStr("CLINICALDOCTOR"));
+//			//临床诊断
+//			params.put("clin_diag", record.getStr("clin_diag")==null?"":record.getStr("clin_diag"));
+//			//症状
+//			params.put("clin_symp", record.getStr("clin_symp")==null?"":record.getStr("clin_symp"));
+//			//patient_infos表
+//			//患者姓名
+//			params.put("name", record.getStr("PATIENTNAME"));
+//			//患者手机号
+//			params.put("phone", record.getStr("phone")==null?"":record.getStr("phone"));
+//			//患者身份证号
+//			params.put("card_num", record.getStr("IDCARD"));
+//			//检查结果1阴2阳
+//			params.put("report_result", record.getStr("result").contains("阳")?"2":"1");
+//			//住院号
+////			params.put("hopitalized_no", record.getStr("patientNumber"));
+//			//门诊号
+////			params.put("out_patient", record.getStr("patientNumber"));
+//			//病人ID
+////			params.put("his_patient_id", record.getStr("patientNumber"));
+//			//检查方法
+//			params.put("exam_project", record.getStr("patientNumber"));
+//
+//			ThreadPoolService tService = ServiceFactory.getService(ThreadPoolService.class);
+//			tService.execute(() -> {
+//				dService.saveReport(params);
+//			});	
+//        	} catch (Exception e) {
+//				// TODO: handle exception
+//        		continue;
+//			}
+//        }
+	}
+
+	@Override
+	public void stop() {
+		// TODO Auto-generated method stub
+
+	}
+	
+	/**
+	 * 日期字符串格式转换
+	 * @param dateStr
+	 * @return
+	 */
+	private String parseStringToDate(String dateStr) {
+		if (dateStr == null) {
+			return "";
+		}
+		SimpleDateFormat sdf= new SimpleDateFormat("yyyy.MM.dd HH:mm:ss");
+	    Date date = null;
+	    String timeString = null;
+		try {
+			date = sdf.parse(dateStr);
+			SimpleDateFormat sdf2= new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+
+			timeString = sdf2.format(date);
+		} catch (ParseException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+        return timeString;
+	}
+
+}