刘韬 2 rokov pred
rodič
commit
8d2888d46f

+ 72 - 4
DataFusion/src/com/zskk/control/ViewController.java

@@ -9,6 +9,8 @@ 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.core.Controller;
 import com.jfinal.kit.PropKit;
 import com.jfinal.plugin.activerecord.ActiveRecordPlugin;
@@ -16,6 +18,9 @@ import com.jfinal.plugin.activerecord.Db;
 import com.jfinal.plugin.activerecord.Record;
 import com.jfinal.plugin.activerecord.dialect.SqlServerDialect;
 import com.jfinal.plugin.druid.DruidPlugin;
+import com.zskk.service.DataService;
+import com.zskk.service.ServiceFactory;
+import com.zskk.service.ThreadPoolService;
 
 import okhttp3.FormBody;
 import okhttp3.MediaType;
@@ -53,6 +58,65 @@ public class ViewController extends Controller {
 		}
 	}
 	
+	public void cs() {
+		DataService dService = ServiceFactory.getService(DataService.class);
+        JSONArray jsonArray = dService.getExamList(500);	
+        for (Object object : jsonArray) {
+			JSONObject jsonObject = JSON.parseObject(object.toString());
+			Record record = Db.use("connected").findFirst("select * from reportinfo where ACCESSIONNUMBER=?", jsonObject.getString("accession_num")==null?jsonObject.getString("patient_num"):jsonObject.getString("accession_num"));
+			if (record == null) {
+				continue;
+			}
+			if (record.getStr("IMPRESSION") == null && record.getStr("DESCRIPTION") == null) {
+				continue;
+			}
+			Map<String, String> params = new HashMap<>();
+			params.put("exam_id", jsonObject.getString("id"));
+			//报告医生姓名
+			params.put("report_doctor_name", record.getStr("REPORTDOCTOR"));
+			//报告时间
+			params.put("report_datetime", parseStringToDate(record.getStr("REPORTDATE")));
+			//审核医生姓名
+			params.put("review_doctor_name", record.getStr("REVIEWDOCTOR")==null?"":record.getStr("REVIEWDOCTOR"));
+			//审核时间
+			params.put("review_datetime", parseStringToDate(record.getStr("REPORTDATE")));
+			//确认医生姓名
+			params.put("confirm_doctor_name", record.getStr("REVIEWDOCTOR")==null?"":record.getStr("REVIEWDOCTOR"));
+			//确认时间
+			params.put("confirm_datetime", parseStringToDate(record.getStr("REPORTDATE")));
+			//意见建议
+			params.put("impression", record.getStr("IMPRESSION"));
+			//影像所见
+			params.put("description", record.getStr("DESCRIPTION"));
+			//exams表
+			//申请科室
+			params.put("application_department", record.getStr("DEPARTMENT")==null?"":record.getStr("DEPARTMENT"));
+			//申请医生
+			params.put("application_doctor", record.getStr("CLINICALDOCTOCR")==null?"":record.getStr("CLINICALDOCTOCR"));
+			//临床诊断
+			params.put("clin_diag", "");
+			//症状
+			params.put("clin_symp", record.getStr("SYMPTOM")==null?"":record.getStr("SYMPTOM"));
+			//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")==null?"":record.getStr("IDCARD"));
+			//检查结果1阴2阳
+			params.put("report_result", record.getStr("RESULT").contains("阳")?"2":"1");
+			//门诊号住院号
+			params.put("hopitalized_no", jsonObject.getString("accession_num")==null?jsonObject.getString("patient_num"):jsonObject.getString("accession_num"));
+//			ThreadPoolService tService = ServiceFactory.getService(ThreadPoolService.class);
+//			tService.execute(() -> {
+				dService.saveReport(params);
+//			});	
+        }
+        renderNull();
+		
+	}
+	
 	public static DruidPlugin createConnectedDruidPlugin() {
 
 		return new DruidPlugin(PropKit.get("jdbcUrl_connected"), PropKit.get("user_connected"),PropKit.get("password_connected").trim());
@@ -90,19 +154,23 @@ public class ViewController extends Controller {
 	 * @param dateStr
 	 * @return
 	 */
-	private Date parseStringToDate(String dateStr) {
+	private String parseStringToDate(String dateStr) {
 		if (dateStr == null) {
-			return new Date();
+			return "";
 		}
-		SimpleDateFormat sdf= new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+		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 date;
+        return timeString;
 	}
 
 	public static void main(String[] args) {

+ 1 - 1
DataFusion/src/com/zskk/task/DataTask.java

@@ -21,7 +21,7 @@ public class DataTask implements ITask {
 	public void run() {
 		// TODO Auto-generated method stub
 		DataService dService = ServiceFactory.getService(DataService.class);
-        JSONArray jsonArray = dService.getExamList(60);	
+        JSONArray jsonArray = dService.getExamList(80);	
         for (Object object : jsonArray) {
 			JSONObject jsonObject = JSON.parseObject(object.toString());
 			Record record = Db.use("connected").findFirst("select * from reportinfo where ACCESSIONNUMBER=?", jsonObject.getString("accession_num")==null?jsonObject.getString("patient_num"):jsonObject.getString("accession_num"));