LAPTOP-5NTQJPUS\LT 4 days ago
parent
commit
221e533c2e

+ 8 - 7
DataFusion/src/com/zskk/config/ZskkConfig.java

@@ -20,6 +20,7 @@ import com.zskk.service.ServiceFactory;
 import com.zskk.task.BindTask;
 import com.zskk.task.CheckTask;
 import com.zskk.task.DataTask;
+import com.zskk.task.JCTask;
 import com.zskk.task.PrintNumTask;
 import com.zskk.task.PrintTask;
 import com.zskk.task.UpdateTask;
@@ -92,14 +93,14 @@ public class ZskkConfig extends JFinalConfig {
 //		me.add(arpPrint);
 //
 		//匹配报告
-		Cron4jPlugin cpData = new Cron4jPlugin();
-		cpData.addTask("*/5 * * * *", new DataTask());
-		me.add(cpData);
+//		Cron4jPlugin cpData = new Cron4jPlugin();
+//		cpData.addTask("*/5 * * * *", new DataTask());
+//		me.add(cpData);
 		
-//		//更新审核后报告
-//		Cron4jPlugin upData = new Cron4jPlugin();
-//		upData.addTask("*/5 * * * *", new CheckTask());
-//		me.add(upData);
+//		//上传检查信息
+		Cron4jPlugin upData = new Cron4jPlugin();
+		upData.addTask("*/5 * * * *", new JCTask());
+		me.add(upData);
 //		
 //		//更新患者信息
 //		Cron4jPlugin pifData = new Cron4jPlugin();

+ 13 - 59
DataFusion/src/com/zskk/control/ViewController.java

@@ -309,48 +309,7 @@ public class ViewController extends Controller {
 		renderText(records.toString());
 	}
 	
-	public void infonum500() {
-		DataService dService = ServiceFactory.getService(DataService.class);
-        JSONArray jsonArray = dService.getExamList(500);
-        for (Object object : jsonArray) {
-        	try {
-			JSONObject jsonObject = JSON.parseObject(object.toString());
-			Record record = Db.use("connected").findFirst("select * from examinfo where studyuid=?", jsonObject.getString("studyuid"));
-			if (record == null) {
-				continue;
-			}
-			Map<String, String> params = new HashMap<>();
-			params.put("exam_id", jsonObject.getString("id"));
-			//exams表
-			//申请科室
-			params.put("application_department", record.getStr("department") == null ? "" : record.getStr("department"));
-			//申请医生
-			params.put("application_doctor", record.getStr("clinicaldoctor") == null ? "" : record.getStr("clinicaldoctor"));
-			//临床诊断
-			params.put("clin_diag", record.getStr("diagnosis") == null ? "" : record.getStr("diagnosis"));
-			//症状
-			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"));
-			//门诊号住院号
-			params.put("hopitalized_no", "");
-			ThreadPoolService tService = ServiceFactory.getService(ThreadPoolService.class);
-			tService.execute(() -> {
-				dService.updatePatientInfo(params);
-			});	
-        	} catch (Exception e) {
-				// TODO: handle exception
-        		continue;
-			}
-        }
-		renderText(jsonArray.toString());
-
-	}
+	
 	/**
 	 * 日期字符串格式转换
 	 * @param dateStr
@@ -374,23 +333,18 @@ public class ViewController extends Controller {
 		}
         return timeString;
 	}
-	
-	/**
-	 * 日期字符串格式转换
-	 * 
-	 * @param dateStr
-	 * @return
-	 */
-	private String parseStringToDate1() {
-		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-		Date date = new Date();
-		String timeString = null;
-		Long i = date.getTime();
-		Long j = i - 3600000;
-		Date newdate = new Date(j);
-		timeString = sdf.format(newdate);
-		return timeString;
-	}
+
+      private Date parseStringToDate1() {
+              SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+              Date date = new Date();
+              String timeString = null;
+              Long i = date.getTime();
+              Long j = i - 600000;
+              Date newdate = new Date(j);
+//            timeString = sdf.format(newdate);
+              return newdate;
+      }
+
 	
 	/**
 	 * 日期字符串格式转换

+ 133 - 70
DataFusion/src/com/zskk/service/DataService.java

@@ -48,85 +48,159 @@ public class DataService {
 	
 	private static String SAVE_PRINT_URL = "https://risserver3.pacsonline.cn/butt/savePrint";
 
-//	private static String SAVE_EXAMINFO_URL = "http://10.200.199.136:9605/api/postExamInfo";
-	private static String SAVE_EXAMINFO_URL = "http://111.53.165.106:9605/api/postExamInfo";
+	private static String SAVE_EXAMINFO_URL = "http://10.200.199.136:9605/api/postExamInfo";
+//	private static String SAVE_EXAMINFO_URL = "http://111.53.165.106:9605/api/postExamInfo";
 
 
 	private static final OkHttpClient OKHTTP_CLIENT = new OkHttpClient();
 	
 	
 	
+//	/**
+//	 * 互认-检查信息
+//	 * 
+//	 * @param instutionId
+//	 * @param number
+//	 */
+//	public static String postExamInfo(com.jfinal.plugin.activerecord.Record record) {
+//		Map<String, String> params = new HashMap<>();
+//		params.put("request_time", "1");
+//		params.put("request_no", "2");
+//		
+//		JSONObject jsonObject = new JSONObject();
+//		JSONObject jsonObjectA = new JSONObject();
+//		jsonObjectA.put("AA", "张治勤");
+//		jsonObjectA.put("AB", "01");
+//		jsonObjectA.put("AC", "140302194905040815");
+//		jsonObjectA.put("AD", "1");
+//		jsonObjectA.put("AE", "1949-05-04 00:00:00");
+//		jsonObjectA.put("AF", "15333038893");
+//		jsonObjectA.put("AG", "");
+//		
+//
+//		JSONObject jsonObjectB = new JSONObject();
+//		jsonObjectB.put("BA", "");
+//		jsonObjectB.put("BB", "1810151251");
+//		jsonObjectB.put("BC", "382346");
+//		jsonObjectB.put("BD", "CT-926658");
+//		jsonObjectB.put("BE", "2025-05-27 17:57:00");
+//		jsonObjectB.put("BF", "急诊科");
+//		jsonObjectB.put("BG", "郭占杰");
+//		jsonObjectB.put("BH", "636");
+//		jsonObjectB.put("BI", "");
+//		jsonObjectB.put("BJ", "76岁");
+//		jsonObjectB.put("BK", "121403004061412685");
+//		jsonObjectB.put("BL", "阳泉市第一人民医院");
+//		jsonObjectB.put("BM", "");
+//		jsonObjectB.put("BN", "");
+//
+//
+//		JSONObject jsonObjectC = new JSONObject();
+//		jsonObjectC.put("CA", "84090050");
+//		jsonObjectC.put("CB", "25004415784");
+//		jsonObjectC.put("CC", "CT");
+//		jsonObjectC.put("CD", "CT检查(首部位)");
+//		jsonObjectC.put("CE", "228929");
+//		jsonObjectC.put("CF", "");
+//		jsonObjectC.put("CG", "头颅CT平扫");
+//		jsonObjectC.put("CH", "B020ZYZZZ-00");
+//		jsonObjectC.put("CI", "2025-05-27 18:04:00");
+//		jsonObjectC.put("CJ", "1");
+//		jsonObjectC.put("CK", "");
+//		jsonObjectC.put("CL", "");
+//		jsonObjectC.put("CM", "84090050");
+//		jsonObjectC.put("CN", "CT-926658");
+//		jsonObjectC.put("CO", "3");
+//
+//		jsonObject.put("A", jsonObjectA);
+//		jsonObject.put("B", jsonObjectB);
+//		jsonObject.put("C", jsonObjectC);
+//		try {
+//			String bbString= jsonObject.toJSONString();
+//	        String encodedString = Base64.getEncoder().encodeToString(jsonObject.toJSONString().getBytes());
+//
+//			String aaString= SM4Utils.sm4Encrypt("zLxapoeqWYpoeqWY",encodedString);
+//			System.out.println(bbString);
+//            System.out.println(aaString);
+//			
+//
+//		} catch (CryptoException e) {
+//			// TODO Auto-generated catch block
+//			e.printStackTrace();
+//		}
+//		try {
+//	        String encodedString = Base64.getEncoder().encodeToString(jsonObject.toJSONString().getBytes());
+//
+//			params.put("data", SM4Utils.sm4Encrypt("zLxapoeqWYpoeqWY",encodedString));
+//		} catch (CryptoException e) {
+//			// TODO Auto-generated catch block
+//			e.printStackTrace();
+//		}
+//
+//		String content = postWithParameters(SAVE_EXAMINFO_URL, params);
+//		return content;
+//
+//	}
+	
 	/**
 	 * 互认-检查信息
 	 * 
 	 * @param instutionId
 	 * @param number
 	 */
-	public static String postExamInfo(com.jfinal.plugin.activerecord.Record record) {
+	public String postExamInfo(com.jfinal.plugin.activerecord.Record record) {
 		Map<String, String> params = new HashMap<>();
 		params.put("request_time", "1");
-		params.put("request_no", "12");
+		params.put("request_no", "2");
 		
 		JSONObject jsonObject = new JSONObject();
 		JSONObject jsonObjectA = new JSONObject();
-		jsonObjectA.put("AA", "张治勤");
-		jsonObjectA.put("AB", "01");
-		jsonObjectA.put("AC", "140302194905040815");
-		jsonObjectA.put("AD", "1");
-		jsonObjectA.put("AE", "1949-05-04");
-		jsonObjectA.put("AF", "15333038893");
-		jsonObjectA.put("AG", "");
+		jsonObjectA.put("AA", checkStr(record.getStr("姓名")));
+		jsonObjectA.put("AB", checkStr(record.getStr("证件类型编码")));
+		jsonObjectA.put("AC", checkStr(record.getStr("证件号码")));
+		jsonObjectA.put("AD", checkStr(record.getStr("性别编码")));
+		jsonObjectA.put("AE", checkStr(record.getStr("出生日期")));
+		jsonObjectA.put("AF", checkStr(record.getStr("联系电话")));
+		jsonObjectA.put("AG", checkStr(record.getStr("电子健康卡号")));
 		
 
 		JSONObject jsonObjectB = new JSONObject();
-		jsonObjectB.put("BA", "1");
-		jsonObjectB.put("BB", "1810151251");
-		jsonObjectB.put("BC", "382346");
-		jsonObjectB.put("BD", "CT-926658");
-		jsonObjectB.put("BE", "2025-05-27 17:57:00");
-		jsonObjectB.put("BF", "急诊科");
-		jsonObjectB.put("BG", "郭占杰");
-		jsonObjectB.put("BH", "636");
-		jsonObjectB.put("BI", "");
-		jsonObjectB.put("BJ", "");
+		jsonObjectB.put("BA", checkStr(record.getStr("就诊类型编码")));
+		jsonObjectB.put("BB", checkStr(record.getStr("就诊卡号")));
+		jsonObjectB.put("BC", checkStr(record.getStr("患者编号")));
+		jsonObjectB.put("BD", checkStr(record.getStr("影像号")));
+		jsonObjectB.put("BE", checkStr(record.getStr("就诊申请时间")));
+		jsonObjectB.put("BF", checkStr(record.getStr("就诊科室名称")));
+		jsonObjectB.put("BG", checkStr(record.getStr("申请医师名称")));
+		jsonObjectB.put("BH", checkStr(record.getStr("申请医生编码")));
+		jsonObjectB.put("BI", checkStr(record.getStr("主诉")));
+		jsonObjectB.put("BJ", checkStr(record.getStr("年龄")));
 		jsonObjectB.put("BK", "121403004061412685");
 		jsonObjectB.put("BL", "阳泉市第一人民医院");
-		jsonObjectB.put("BM", "");
-		jsonObjectB.put("BN", "");
+		jsonObjectB.put("BM", checkStr(record.getStr("临床诊断名称")));
+		jsonObjectB.put("BN", checkStr(record.getStr("临床诊断代码")));
 
 
 		JSONObject jsonObjectC = new JSONObject();
-		jsonObjectC.put("CA", "84090050");
-		jsonObjectC.put("CB", "25004415784");
-		jsonObjectC.put("CC", "CT");
-		jsonObjectC.put("CD", "CT检查(首部位)");
-		jsonObjectC.put("CE", "228929");
-		jsonObjectC.put("CF", "");
-		jsonObjectC.put("CG", "-");
-		jsonObjectC.put("CH", "-");
-		jsonObjectC.put("CI", "2025-05-27 18:04:00");
-		jsonObjectC.put("CJ", "1");
-		jsonObjectC.put("CK", "");
-		jsonObjectC.put("CL", "");
-		jsonObjectC.put("CM", "84090050");
-		jsonObjectC.put("CN", "CT-926658");
-		jsonObjectC.put("CO", "3");
+		jsonObjectC.put("CA", checkStr(record.getStr("医嘱编号")));
+		jsonObjectC.put("CB", checkStr(record.getStr("申请单编号")));
+		jsonObjectC.put("CC", checkStr(record.getStr("检查类型")));
+		jsonObjectC.put("CD", checkStr(record.getStr("检查项目名称")));
+		jsonObjectC.put("CE", checkStr(record.getStr("检查项目编码")));
+		jsonObjectC.put("CF", checkStr(record.getStr("标本部位")));
+		jsonObjectC.put("CG", checkStr(record.getStr("互认项目名称")));
+		jsonObjectC.put("CH", checkStr(record.getStr("互认项目编码")));
+		jsonObjectC.put("CI", checkStr(record.getStr("检查时间")));
+		jsonObjectC.put("CJ", checkStr(record.getStr("胶片类型")));
+		jsonObjectC.put("CK", checkStr(record.getStr("操作技师")));
+		jsonObjectC.put("CL", checkStr(record.getStr("操作技师编码")));
+		jsonObjectC.put("CM", checkStr(record.getStr("检查UID")));
+		jsonObjectC.put("CN", checkStr(record.getStr("检查号")));
+		jsonObjectC.put("CO", checkStr(record.getStr("检查状态")));
 
 		jsonObject.put("A", jsonObjectA);
 		jsonObject.put("B", jsonObjectB);
 		jsonObject.put("C", jsonObjectC);
-		try {
-			String bbString= jsonObject.toJSONString();
-
-			String aaString= SM4Utils.sm4Encrypt("zLxapoeqWYpoeqWY",jsonObject.toJSONString());
-			System.out.println(bbString);
-            System.out.println(aaString);
-			
-
-		} catch (CryptoException e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-		}
 		try {
 	        String encodedString = Base64.getEncoder().encodeToString(jsonObject.toJSONString().getBytes());
 
@@ -141,31 +215,20 @@ public class DataService {
 
 	}
 
+	
+	
 	/**
-	 * 获取未出报告的检查列表
-	 * 
-	 * @param instutionId
-	 * @param number
+	 * 校验字符串
 	 */
-	public JSONArray getExamList(Integer number) {
-		Map<String, String> map = new HashMap<String, String>();
-		map.put("institution_id", PropKit.get("institution_id"));
-		map.put("num", number.toString());
-		String content = postWithParameters(GET_EXAM_URL, map);
-		JSONObject jsonObject = JSON.parseObject(content);
-		if (!jsonObject.getString("msg").equals("success")) {
-			return null;
-		}
-		JSONArray jsonArray = JSON.parseArray(jsonObject.getString("data"));
-		return jsonArray;
-
+	public String checkStr(String string) {
+		return string==null?"":string;
 	}
 
-	public JSONArray getExamListConfirmed(Integer number) {
+	public JSONArray getExamList(Integer number) {
 		Map<String, String> map = new HashMap<String, String>();
 		map.put("institution_id", PropKit.get("institution_id"));
 		map.put("num", number.toString());
-		String content = postWithParameters(GET_CONFIRM_EXAM_URL, map);
+		String content = postWithParameters(GET_EXAM_URL, map);
 		JSONObject jsonObject = JSON.parseObject(content);
 		if (!jsonObject.getString("msg").equals("success")) {
 			return null;
@@ -349,8 +412,8 @@ public class DataService {
 //		map.put("institution_id", "06300006");
 //		map.put("start", "2022-02-01");
 //		map.put("finish", "2022-03-01");
-		String content = postExamInfo(null);
-		System.out.println(content);
+//		String content = postExamInfo(null);
+//		System.out.println(content);
 		
 
 		

+ 10 - 82
DataFusion/src/com/zskk/task/JCTask.java

@@ -28,78 +28,6 @@ public class JCTask implements ITask {
 		for (Record record : records) {
 			dService.postExamInfo(record);
 		}
-		
-		
-        JSONArray jsonArray = dService.getExamList(200);	
-        for (Object object : jsonArray) {
-        	try {
-			JSONObject jsonObject = JSON.parseObject(object.toString());
-			Record record1 = Db.use("connected").findFirst("select * from V_EXAM_INFO where 检查号=? and 检查状态=4", jsonObject.getString("patient_num"));
-			if (record1 == null) {
-				continue;
-			}
-			Record record2 = Db.use("connected").findFirst("select * from V_EXAM_REPORT where 检查号=?", jsonObject.getString("patient_num"));
-
-//			if (parseStringToDate(record.getStr("checktime"))==Boolean.FALSE) {
-//				continue;
-//			}
-			if (record2.getStr("检查所见").isBlank() || record2.getStr("影像诊断").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", record2.getStr("报告医生姓名"));
-			//报告时间
-			params.put("report_datetime", record2.getStr("报告时间"));
-			//审核医生姓名
-			params.put("review_doctor_name", record2.getStr("审核医生姓名")==null?"":record2.getStr("审核医生姓名"));
-			//审核时间
-			params.put("review_datetime", record2.getStr("审核时间"));
-			//确认医生姓名
-			params.put("confirm_doctor_name", record2.getStr("审核医生姓名")==null?"":record2.getStr("审核医生姓名"));
-			//确认时间
-			params.put("confirm_datetime", record2.getStr("审核时间"));
-			//意见建议
-			params.put("impression", record2.getStr("影像诊断"));
-			//影像所见
-			params.put("description", record2.getStr("检查所见"));
-			//exams表
-			//申请科室
-			params.put("application_department", record1.getStr("就诊科室名称")==null?"":record1.getStr("就诊科室名称"));
-			//申请医生
-			params.put("application_doctor", record1.getStr("申请医师名称")==null?"":record1.getStr("申请医师名称"));
-			//临床诊断
-			params.put("clin_diag", "");
-			//症状
-			params.put("clin_symp", record1.getStr("主诉")==null?"":record1.getStr("主诉"));
-			//patient_infos表
-			//患者姓名
-			params.put("name", record1.getStr("姓名"));
-			//患者手机号
-			params.put("phone", record1.getStr("联系电话")==null?"":record1.getStr("联系电话"));
-			//患者身份证号
-			params.put("card_num", record1.getStr("证件号码")==null?"":record1.getStr("证件号码"));
-			//检查结果1阴2阳
-			params.put("report_result", "0");
-			//门诊号住院号
-			params.put("hopitalized_no", "");
-			params.put("exam_project", record1.getStr("标本部位") == null ? "" : record1.getStr("标本部位"));
-//			params.put("exam_method", record.getStr("JianchaFangfa") == null ? "" : record.getStr("JianchaFangfa"));
-			ThreadPoolService tService = ServiceFactory.getService(ThreadPoolService.class);
-			tService.execute(() -> {
-				dService.saveReport(params);
-			});	
-        	} catch (Exception e) {
-				// TODO: handle exception
-        		continue;
-			}
-        }
 	}
 
 	@Override
@@ -113,15 +41,15 @@ public class JCTask implements ITask {
 	 * @param dateStr
 	 * @return
 	 */
-	private String parseStringToDate1() {
-		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-		Date date = new Date();
-		String timeString = null;
-		Long i = date.getTime();
-		Long j = i - 3600000;
-		Date newdate = new Date(j);
-		timeString = sdf.format(newdate);
-		return timeString;
-	}
+    private Date parseStringToDate1() {
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Date date = new Date();
+        String timeString = null;
+        Long i = date.getTime();
+        Long j = i - 600000;
+        Date newdate = new Date(j);
+//      timeString = sdf.format(newdate);
+        return newdate;
+}
 
 }

+ 485 - 0
ViewController.java

@@ -0,0 +1,485 @@
+package com.zskk.control;
+
+import java.io.BufferedOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+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.aliyun.oss.OSS;
+import com.aliyun.oss.OSSClientBuilder;
+import com.jfinal.core.Controller;
+import com.jfinal.kit.PropKit;
+import com.jfinal.plugin.activerecord.ActiveRecordPlugin;
+import com.jfinal.plugin.activerecord.Db;
+import com.jfinal.plugin.activerecord.Record;
+import com.jfinal.plugin.activerecord.dialect.OracleDialect;
+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;
+import okhttp3.OkHttpClient;
+import okhttp3.Request;
+import okhttp3.RequestBody;
+import okhttp3.Response;
+
+public class ViewController extends Controller {
+
+	private static final MediaType JSON_CODE = MediaType.get("application/json; charset=utf-8");
+
+	private static final OkHttpClient OKHTTP_CLIENT = new OkHttpClient();
+
+	/**
+	 * 在被连接数据库执行sql语句
+	 */
+	public void executeSql() {
+		try {
+			List<Record> d = Db.use("connected").find(this.getPara("sqlstr"));
+			this.renderJson(d);
+		} catch (Exception e) {
+			// TODO: handle exception
+			this.renderText(e.toString());
+		}
+		
+	}
+	
+	/**
+	 * 在被连接数据库执行sql语句
+	 */
+	public void executeSqlprint() {
+		try {
+			List<Record> d = Db.use("print").find(this.getPara("sqlstr"));
+			this.renderJson(d);
+		} catch (Exception e) {
+			// TODO: handle exception
+			this.renderText(e.toString());
+		}
+		
+	}
+	
+	/**
+	 * 在被连接数据库执行sql语句
+	 */
+	public void executeSqlUpdate() {
+		try {
+			Integer d = Db.use("connected").update(this.getPara("sqlstr"));
+			this.renderText(d.toString());
+		} catch (Exception e) {
+			// TODO: handle exception
+			this.renderText(e.toString());
+		}
+		
+	}
+
+	public void testConn() {
+		try {
+			DruidPlugin druidPluginConnected = createConnectedDruidPlugin();
+            druidPluginConnected.start();
+			// 配置ActiveRecord插件
+			ActiveRecordPlugin arpConnected = new ActiveRecordPlugin("connected", druidPluginConnected);
+			arpConnected.setDialect(new OracleDialect());
+			arpConnected.start();
+
+		} catch (Exception e) {
+			// TODO: handle exception
+			this.renderText(e.toString());
+		}
+	}
+	//调阅记录
+	public void dyjl2pacs() {
+		try {
+			DataService dService = ServiceFactory.getService(DataService.class);
+	        JSONArray jsonArray = dService.getBindList(this.getPara("sdate"),this.getPara("edate"));
+	        for (Object object : jsonArray) {
+	        	try {
+				JSONObject jsonObject = JSON.parseObject(object.toString());
+				String source = "";
+				String[] sources = jsonObject.getString("source").split(",");
+				for (int i = 0; i < sources.length; i++) {
+					switch (sources[i]) {
+					case "1":
+						String sp1 = i==0?"":",";
+						source = source + sp1+ "数字影像云公众号";
+						break;
+
+					case "2":
+						String sp2 = i==0?"":",";
+						source = source +sp2+ "集成链接";
+						break;
+
+					case "3":
+						String sp3 = i==0?"":",";
+						source = source +sp3+ "推送短信";
+						break;
+
+					default:
+						break;
+					}
+				}
+				Record recordei = Db.use("connected").findFirst("select * from examinfo where studyuid=?", jsonObject.getString("studyuid"));
+				Record recordrc = Db.use("connected").findFirst("select * from reportcheck where studyuid=?", jsonObject.getString("studyuid"));
+				Record recordri = Db.use("connected").findFirst("select * from reportinfo where studyuid=?", jsonObject.getString("studyuid"));
+				if (recordei==null && recordrc==null && recordri==null) {
+					continue;
+				}
+				if (recordei!=null) {
+					Db.use("connected").update("update examinfo set ViewFlag='1',ViewTime=?,ViewName=? where studyuid=?",jsonObject.getString("createdAt"),source,jsonObject.getString("studyuid"));
+				}
+				if (recordrc!=null) {
+					Db.use("connected").update("update reportcheck set ViewFlag='1',ViewTime=?,ViewName=? where studyuid=?",jsonObject.getString("createdAt"),source,jsonObject.getString("studyuid"));
+				}
+				if (recordri!=null) {
+				
+					Db.use("connected").update("update reportinfo set ViewFlag='1',ViewTime=?,ViewName=? where studyuid=?",jsonObject.getString("createdAt"),source,jsonObject.getString("studyuid"));
+				}
+	        	} catch (Exception e) {
+					// TODO: handle exception
+	        		continue;
+				}
+	        }
+    		renderJson(jsonArray);
+
+		} catch (Exception e) {
+			// TODO: handle exception
+    		renderText(e.toString());
+
+		}
+
+		
+	}
+	public void sdtb() {
+		try {
+		
+		List<Record> records = Db.use("connected").find("select * from V_EXAM_INFO where 最后更新时间 > ?",parseStringToDate1());
+
+
+		renderJson(records);
+
+		
+		} catch (Exception e) {
+			// TODO: handle exception
+			renderText(e.toString());
+		}
+
+	}
+	
+	//胶片匹配
+	public void jppp() {
+		DataService dService = ServiceFactory.getService(DataService.class);
+		List<Record> records = Db.use("print").find("select * from IMAGEVIEW where ADDTIME >? order by ADDTIME asc",this.getPara("time"));
+		for (Record record : records) {
+			try {
+				if (record == null) {
+					continue;
+				}
+				Map<String, String> annex_params = new HashMap<>();
+				annex_params.put("institution_id", PropKit.get("institution_id"));
+				annex_params.put("type", "2");
+				annex_params.put("code", record.getStr("CHECKID"));
+				//附件类型1.mp4 2.pdf 3.jpeg 4.png
+				annex_params.put("annex_class_code", "4");
+				annex_params.put("exam_datetime", parseStringToDate2(record.getStr("ADDTIME")));
+	      		dService.saveAnnex(annex_params, record.getStr("IMGURL"));
+			} catch (Exception e) {
+				// TODO: handle exception
+				continue;
+			}
+
+		}
+		renderText(records.toString());
+	}
+	
+	//报告匹配
+	public void bgpp() {
+		DataService dService = ServiceFactory.getService(DataService.class);
+		List<Record> records = Db.use("connected").find("select * from reportcheck where checktime >? order by checktime asc",this.getPara("time"));
+		for (Record record : records) {
+			try {
+				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", "4");
+
+				params.put("institution_id", PropKit.get("institution_id"));
+
+				params.put("code", record.getStr("studyuid"));
+				// 报告医生姓名
+				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("checktime"));
+				// 确认医生姓名
+				params.put("confirm_doctor_name",
+						record.getStr("reviewdoctor") == null ? "" : record.getStr("reviewdoctor"));
+				// 确认时间
+				params.put("confirm_datetime", record.getStr("checktime"));
+				// 意见建议
+				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("clinicaldoctor") == null ? "" : record.getStr("clinicaldoctor"));
+				// 临床诊断
+				params.put("clin_diag", record.getStr("diagnosis") == null ? "" : record.getStr("diagnosis"));
+				// 症状
+				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", "0");
+				// 门诊号住院号
+				params.put("hopitalized_no", "");
+				params.put("exam_project", record.getStr("JianchaMingcheng") == null ? "" : record.getStr("JianchaMingcheng"));
+				params.put("exam_method", record.getStr("JianchaFangfa") == null ? "" : record.getStr("JianchaFangfa"));
+				ThreadPoolService tService = ServiceFactory.getService(ThreadPoolService.class);
+				tService.execute(() -> {
+					dService.saveReport(params);
+				});
+				Map<String, String> annex_params = new HashMap<>();
+				annex_params.put("institution_id", PropKit.get("institution_id"));
+				annex_params.put("type", "4");
+				annex_params.put("code", record.getStr("studyuid"));
+				//附件类型1.mp4 2.pdf 3.jpeg
+				annex_params.put("annex_class_code", "3");
+	      		dService.saveAnnex(annex_params, record.getStr("reportpath"));
+			} catch (Exception e) {
+				// TODO: handle exception
+				continue;
+			}
+			}		
+		renderText(records.toString());
+	}
+	
+	//打印数量匹配
+	public void dypp() {
+		DataService dService = ServiceFactory.getService(DataService.class);
+		List<Record> records = Db.use("print").find("select * from IMAGEVIEW where PRINTED=? and PRINTTIME >?","true",this.getPara("time"));
+		for (Record record : records) {
+			try {
+				if (record == null) {
+					continue;
+				}
+				//2ct 3ct 4mr
+				if (record.getStr("IAET").equals("4")) {
+					continue;
+				}
+				Map<String, String> annex_params = new HashMap<>();
+				annex_params.put("institution_id", PropKit.get("institution_id"));
+				annex_params.put("type", "2");
+				annex_params.put("code", record.getStr("CHECKID"));
+				annex_params.put("print_time", record.getStr("PRINTTIME"));
+				dService.savePrint(annex_params);
+			} catch (Exception e) {
+				// TODO: handle exception
+				continue;
+			}
+
+		}
+		renderText(records.toString());
+	}
+	
+	
+	/**
+	 * 日期字符串格式转换
+	 * @param dateStr
+	 * @return
+	 */
+	private String parseStringToDate3(String dateStr) {
+		if (dateStr == null) {
+			return "";
+		}
+		SimpleDateFormat sdf= new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
+	    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;
+	}
+	
+	/**
+	 * 日期字符串格式转换
+	 * 
+	 * @param dateStr
+	 * @return
+	 */
+	private String parseStringToDate1() {
+		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+		Date date = new Date();
+		String timeString = null;
+		Long i = date.getTime();
+		Long j = i - 600000;
+		Date newdate = new Date(j);
+		timeString = sdf.format(newdate);
+		return timeString;
+	}
+	
+	/**
+	 * 日期字符串格式转换
+	 * @param dateStr
+	 * @return
+	 */
+	private String parseStringToDate2(String dateStr) {
+		if (dateStr == null) {
+			return "";
+		}
+		SimpleDateFormat sdf= new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
+	    Date date = null;
+	    String timeString = null;
+		try {
+			date = sdf.parse(dateStr);
+			SimpleDateFormat sdf2= new SimpleDateFormat("yyyyMMdd");
+
+			timeString = sdf2.format(date);
+		} catch (ParseException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+        return timeString;
+	}
+	
+	
+	public static String getFileWithUrl(String url, String filename) {
+
+		Request request = new Request.Builder().url(url).build();
+		try (Response response = OKHTTP_CLIENT.newCall(request).execute()) {
+			if (!response.isSuccessful())
+				throw new IOException("Unexpected code " + response);
+			InputStream inputStream = response.body().source().inputStream();
+			// 本地文件夹目录(下载位置)
+			String folder = PropKit.get("oss_localPath");
+			// 下载文件保存位置
+			String savepath = folder + "/" + filename;
+			BufferedOutputStream bufferedOutputStream = new BufferedOutputStream(new FileOutputStream(new File(savepath)));
+			byte[] data = new byte[1024];
+			int len;
+			int available = inputStream.available();
+			while ((len = inputStream.read(data)) != -1) {
+				bufferedOutputStream.write(data, 0, len);
+			}
+			bufferedOutputStream.flush();
+			bufferedOutputStream.close();
+			inputStream.close();
+
+			return savepath;
+
+		} catch (IOException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+			return e.toString();
+
+		}
+	}
+	
+	public void testdld() {
+		try {
+			String filePath = "http://200.200.200.163:8090/X-0-202208261038400267000310351.PNG";
+			String fileNameStr[] = filePath.split("/");
+			String fileName = fileNameStr[fileNameStr.length - 1];
+			String fileStorePath = getFileWithUrl(filePath, fileName);
+			renderText(fileStorePath);
+
+		} catch (Exception e) {
+			// TODO: handle exception
+			renderText(e.toString());
+		}
+		
+	}
+	
+	public static DruidPlugin createConnectedDruidPlugin() {
+
+		return new DruidPlugin(PropKit.get("jdbcUrl_connected"), PropKit.get("user_connected"),PropKit.get("password_connected").trim());
+	}
+	
+	/**
+	 * post请求
+	 * @param url-请求地址
+	 * @param map-参数集合
+	 * @return
+	 */
+	private static String doPost(String url, Map<String, String> map) {
+		FormBody.Builder builder = new FormBody.Builder();
+		for (String key : map.keySet()) {
+			builder.add(key, map.get(key));
+		}
+
+		RequestBody formBody = builder.build();
+
+		Request request = new Request.Builder().url(url).post(formBody).build();
+		
+		try (Response response = OKHTTP_CLIENT.newCall(request).execute()) {
+			if (!response.isSuccessful()) throw new IOException("Unexpected code " + response);
+			String content = response.body().string();
+			return content;
+		} catch (IOException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+			return null;
+		}
+	}
+	
+	/**
+	 * 日期字符串格式转换
+	 * @param dateStr
+	 * @return
+	 */
+	private Date parseStringToDate(String dateStr) {
+		if (dateStr == null) {
+			return new Date();
+		}
+		SimpleDateFormat sdf= new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+	    Date date = null;
+		try {
+			date = sdf.parse(dateStr);
+		} catch (ParseException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+        return date;
+	}
+	
+	private String parseStringToDate() {
+		SimpleDateFormat sdf= new SimpleDateFormat("yyyy-MM-dd");
+	    Date date = new Date();
+	    String timeString = sdf.format(date);
+	    return timeString;
+	}
+
+}