刘韬 2 лет назад
Родитель
Сommit
fb3557fb7a
1 измененных файлов с 71 добавлено и 65 удалено
  1. 71 65
      DataFusion/src/com/zskk/control/ViewController.java

+ 71 - 65
DataFusion/src/com/zskk/control/ViewController.java

@@ -55,80 +55,86 @@ public class ViewController extends Controller {
 		
 	}
 	public void sdtb() {
-		DataService dService = ServiceFactory.getService(DataService.class);
-		JSONArray jsonArray = dService.getExamList2(this.getParaToInt("num"),this.getPara("time"));
-		for (Object object : jsonArray) {
-			try {
-				JSONObject jsonObject = JSON.parseObject(object.toString());
-				Record record = Db.use("connected").findFirst("select * from v_Yyx where accnum=?",
-						jsonObject.getString("patient_num"));
-				if (record == null) {
-					List<Record> lists = Db.use("connected").find(
-							"select * from v_Yyx where name=? and examdatetime>? and examdatetime<?",
-							jsonObject.getString("name"),
-							parseStringToDateg(jsonObject.getString("exam_datetime")) + " 00:00:00",
-							parseStringToDateg(jsonObject.getString("exam_datetime")) + " 23:59:59");
-					if (lists.size() != 0) {
-						for (Record list : lists) {
-							if (!list.getStr("project").contains("心电图")) {
-								record = list;
+		try {
+			DataService dService = ServiceFactory.getService(DataService.class);
+			JSONArray jsonArray = dService.getExamList2(this.getParaToInt("num"),this.getPara("time"));
+			for (Object object : jsonArray) {
+				try {
+					JSONObject jsonObject = JSON.parseObject(object.toString());
+					Record record = Db.use("connected").findFirst("select * from v_Yyx where accnum=?",
+							jsonObject.getString("patient_num"));
+					if (record == null) {
+						List<Record> lists = Db.use("connected").find(
+								"select * from v_Yyx where name=? and examdatetime>? and examdatetime<?",
+								jsonObject.getString("name"),
+								parseStringToDateg(jsonObject.getString("exam_datetime")) + " 00:00:00",
+								parseStringToDateg(jsonObject.getString("exam_datetime")) + " 23:59:59");
+						if (lists.size() != 0) {
+							for (Record list : lists) {
+								if (!list.getStr("project").contains("心电图")) {
+									record = list;
+								}
 							}
 						}
 					}
-				}
-				if (record == null) {
-					List<Record> lists = Db.use("connected").find(
-							"select * from v_Yyx where examdatetime>? and examdatetime<?",
-							parseStringToDateg(jsonObject.getString("exam_datetime")) + " 00:00:00",
-							parseStringToDateg(jsonObject.getString("exam_datetime")) + " 23:59:59");
-					if (lists.size() != 0) {
-						for (Record list : lists) {
-							if (list.getStr("project").contains("心电图")) {
-								continue;
-							}
-							if (getAllPinyin(list.getStr("name")).equals(jsonObject.getString("name")) || getAllPinyin2(list.getStr("name")).equals(jsonObject.getString("name"))) {
-								record = list;
+					if (record == null) {
+						List<Record> lists = Db.use("connected").find(
+								"select * from v_Yyx where examdatetime>? and examdatetime<?",
+								parseStringToDateg(jsonObject.getString("exam_datetime")) + " 00:00:00",
+								parseStringToDateg(jsonObject.getString("exam_datetime")) + " 23:59:59");
+						if (lists.size() != 0) {
+							for (Record list : lists) {
+								if (list.getStr("project").contains("心电图")) {
+									continue;
+								}
+								if (getAllPinyin(list.getStr("name")).equals(jsonObject.getString("name")) || getAllPinyin2(list.getStr("name")).equals(jsonObject.getString("name"))) {
+									record = list;
+								}
 							}
 						}
 					}
-				}
-				if (record == null) {
-					 continue;
-				}
-				
-				Map<String, String> params = new HashMap<>();
-				params.put("exam_id", jsonObject.getString("id"));
-				// exams表
-				// 申请科室
-				params.put("application_department", "");
-				// 申请医生
-				params.put("application_doctor", "");
-				// 临床诊断
-				params.put("clin_diag", "");
-				// 症状
-				params.put("clin_symp", "");
-				// patient_infos表
-				// 患者姓名
-				params.put("name", record.getStr("name"));
-				// 患者手机号
-				params.put("phone", "");
-				// 患者身份证号
-				params.put("card_num", "");
-				// 门诊号住院号
-				params.put("hopitalized_no", "");
-				params.put("exam_project", record.getStr("project"));
+					if (record == null) {
+						 continue;
+					}
+					
+					Map<String, String> params = new HashMap<>();
+					params.put("exam_id", jsonObject.getString("id"));
+					// exams表
+					// 申请科室
+					params.put("application_department", "");
+					// 申请医生
+					params.put("application_doctor", "");
+					// 临床诊断
+					params.put("clin_diag", "");
+					// 症状
+					params.put("clin_symp", "");
+					// patient_infos表
+					// 患者姓名
+					params.put("name", record.getStr("name"));
+					// 患者手机号
+					params.put("phone", "");
+					// 患者身份证号
+					params.put("card_num", "");
+					// 门诊号住院号
+					params.put("hopitalized_no", "");
+					params.put("exam_project", record.getStr("project"));
 
-//				ThreadPoolService tService = ServiceFactory.getService(ThreadPoolService.class);
-//				tService.execute(() -> {
-					dService.updatePatientInfo(params);
-//				});
-			} catch (Exception e) {
-				// TODO: handle exception
-//				continue;
-				renderText(e.toString());
+//					ThreadPoolService tService = ServiceFactory.getService(ThreadPoolService.class);
+//					tService.execute(() -> {
+						dService.updatePatientInfo(params);
+//					});
+				} catch (Exception e) {
+					// TODO: handle exception
+//					continue;
+					renderText(e.toString());
+				}
 			}
+			renderJson(jsonArray);
+		} catch (Exception e) {
+			// TODO: handle exception
+			renderText(e.toString());
 		}
-		renderJson(jsonArray);
+		
 	}
 
 	public void testConn() {