刘韬 5 年之前
父节点
当前提交
20d1230815
共有 1 个文件被更改,包括 36 次插入30 次删除
  1. 36 30
      DataFusion/src/com/zskk/task/DataTask.java

+ 36 - 30
DataFusion/src/com/zskk/task/DataTask.java

@@ -24,38 +24,44 @@ public class DataTask implements ITask {
 		try {
 			List<Exams> exams = Exams.dao.use("zskk").find("SELECT * FROM pacsonline.exams where exam_status=3 and institution_id=81069902 order by createdAt desc limit 30");
 			for (Exams exams2 : exams) {
-				Studies studies = Studies.dao.use("zskk").findById(exams2.getStudyId());
-				Record record = Db.use("connected").findFirst("select * from PACSONLINE_Interface where STUDYUID=?",studies.getStudyuid());
-				if (record == null) {
+				try {
+					Studies studies = Studies.dao.use("zskk").findById(exams2.getStudyId());
+					Record record = Db.use("connected").findFirst("select * from PACSONLINE_Interface where STUDYUID=?",studies.getStudyuid());
+					if (record == null) {
+						continue;
+					}
+					Report report = new Report().use("zskk");
+					report.setId(creatId());
+					report.setReportDatetime(parseStringToDate(record.getStr("REPORTDATE")));
+					if (record.getStr("IMPRESSION") == null && record.getStr("DESCRIPTION") == null) {
+						continue;
+					}
+					report.setImpression(record.getStr("IMPRESSION"));
+					report.setDescription(record.getStr("DESCRIPTION"));
+					report.setExamId(exams2.getId());
+					report.setCreatedAt(new Date());
+					report.setReportDoctorId(getDoctorIdByName(record.getStr("REPORTDOCTOR")));
+					report.setReviewDoctorId(getDoctorIdByName(record.getStr("REVIEWDOCTOR")));
+					report.setReviewDatetime(parseStringToDate(record.getStr("REPORTDATE")));
+					report.setConfirmDoctorId(getDoctorIdByName(record.getStr("REVIEWDOCTOR")));
+					report.setConfirmDatetime(parseStringToDate(record.getStr("REPORTDATE")));
+					report.save();
+					PatientInfos patientInfos = PatientInfos.dao.use("zskk").findById(exams2.getPatientId());
+					patientInfos.setName(record.getStr("PATIENTNAME"));
+//					patientInfos.setPhone(record.getStr("telephone"));
+					patientInfos.setCardNum(record.getStr("IDCARD"));
+					patientInfos.update();
+					exams2.setExamStatus(9);
+					exams2.setApplicationDepartment(record.getStr("DEPARTMENT"));
+					exams2.setApplicationDoctor(record.getStr("CLINICALDOCTOR"));
+					exams2.update();
+					WeixinService wService = ServiceFactory.getService(WeixinService.class);
+					wService.requestWeixinQrcode(report.getId());
+					
+				} catch (Exception e) {
+					// TODO: handle exception
 					continue;
 				}
-				Report report = new Report().use("zskk");
-				report.setId(creatId());
-				report.setReportDatetime(parseStringToDate(record.getStr("REPORTDATE")));
-				if (record.getStr("IMPRESSION") == null && record.getStr("DESCRIPTION") == null) {
-					continue;
-				}
-				report.setImpression(record.getStr("IMPRESSION"));
-				report.setDescription(record.getStr("DESCRIPTION"));
-				report.setExamId(exams2.getId());
-				report.setCreatedAt(new Date());
-				report.setReportDoctorId(getDoctorIdByName(record.getStr("REPORTDOCTOR")));
-				report.setReviewDoctorId(getDoctorIdByName(record.getStr("REVIEWDOCTOR")));
-				report.setReviewDatetime(parseStringToDate(record.getStr("REPORTDATE")));
-				report.setConfirmDoctorId(getDoctorIdByName(record.getStr("REVIEWDOCTOR")));
-				report.setConfirmDatetime(parseStringToDate(record.getStr("REPORTDATE")));
-				report.save();
-				PatientInfos patientInfos = PatientInfos.dao.use("zskk").findById(exams2.getPatientId());
-				patientInfos.setName(record.getStr("PATIENTNAME"));
-//				patientInfos.setPhone(record.getStr("telephone"));
-//				patientInfos.setCardNum(record.getStr("IDCARD"));
-				patientInfos.update();
-				exams2.setExamStatus(9);
-				exams2.setApplicationDepartment(record.getStr("DEPARTMENT"));
-				exams2.setApplicationDoctor(record.getStr("CLINICALDOCTOR"));
-				exams2.update();
-				WeixinService wService = ServiceFactory.getService(WeixinService.class);
-				wService.requestWeixinQrcode(report.getId());
 			}
 
 		} catch (Exception e) {