刘韬 5 năm trước cách đây
mục cha
commit
a7d8b71e33

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

@@ -80,9 +80,9 @@ public class ZskkConfig extends JFinalConfig {
 		arpConnected.setDialect(new SqlServerDialect());
 		me.add(arpConnected);
 
-//		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 cp2 = new Cron4jPlugin();
 //		cp2.addTask("*/15 * * * *", new UpdateTask());

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

@@ -35,24 +35,24 @@ public class DataTask implements ITask {
 		// TODO Auto-generated method stub
 		try {
 			List<Exams> exams = Exams.dao.use("zskk").find(
-					"SELECT * FROM pacsonline.exams where exam_status=3 and institution_id='15700002' order by createdAt desc limit 50");
+					"SELECT * FROM pacsonline.exams where exam_status=3 and institution_id='25660003' order by createdAt desc limit 50");
 			for (Exams exams2 : exams) {
 				try {
 					// Studies studies = Studies.dao.use("zskk").findById(exams2.getStudyId());
-					Record record = Db.use("connected").findFirst("select * from zskk where accessionNumber=?",
-							exams2.getPatientNum());
+					Record record = Db.use("connected").findFirst("select * from V_zskk where accessionNumber=?",
+							exams2.getAccessionNum());
 					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
-							|| record.getStr("impression").isBlank() || record.getStr("DESCRIPTION").isBlank()) {
+					if (record.getStr("impression") == null || record.getStr("description") == null
+							|| record.getStr("impression").isBlank() || record.getStr("description").isBlank()) {
 						continue;
 					}
 					report.setImpression(record.getStr("impression"));
-					report.setDescription(record.getStr("DESCRIPTION"));
+					report.setDescription(record.getStr("description"));
 					report.setExamId(exams2.getId());
 					report.setCreatedAt(new Date());
 					report.setReportDoctorId(getDoctorIdByName(record.getStr("reportdoctor")));
@@ -64,14 +64,14 @@ public class DataTask implements ITask {
 					PatientInfos patientInfos = PatientInfos.dao.use("zskk").findById(exams2.getPatientId());
 					patientInfos.setName(record.getStr("patientname"));
 					patientInfos.setPhone(record.getStr("phone"));
-					patientInfos.setCardNum(record.getStr("idcard"));
+					patientInfos.setCardNum("");
 					patientInfos.update();
 					exams2.setExamStatus(9);
-					String patString = record.getStr("patientid");
-					Integer length = patString.length();
-					patString = String.format("%0"+length+"d",Long.valueOf(patString));
-					exams2.setHopitalizedNo(patString);
-					exams2.setClinDoctors(record.getStr("clinicaldoctor"));
+//					String patString = record.getStr("patientid");
+//					Integer length = patString.length();
+//					patString = String.format("%0"+length+"d",Long.valueOf(patString));
+//					exams2.setHopitalizedNo(patString);
+//					exams2.setClinDoctors(record.getStr("clinicaldoctor"));
 					exams2.setApplicationDepartment(record.getStr("department"));
 					exams2.setApplicationDoctor(record.getStr("clinicaldoctor"));
 					exams2.setClinDiag(record.getStr("diagnosis"));
@@ -80,9 +80,9 @@ public class DataTask implements ITask {
 					Map<String, String> data = new HashMap<String, String>();
 					// 获取data数据
 					// 医院id
-					data.put("hospital_id", "15700002");
+					data.put("hospital_id", "25660003");
 					// 影像所见
-					data.put("description", record.getStr("DESCRIPTION"));
+					data.put("description", record.getStr("description"));
 					// 意见建议
 					data.put("impression", record.getStr("impression"));
 					// 检查id
@@ -93,7 +93,7 @@ public class DataTask implements ITask {
 					// 患者姓名
 					data.put("patient_name", record.getStr("patientname"));
 					// 患者性别
-					data.put("patient_sex", record.getStr("patientsex").equals("女") ? "F" : "M");
+					data.put("patient_sex", patientInfos.getSex());
 					// 身份证号
 					data.put("card_num", patientInfos.getCardNum());
 					// 手机号
@@ -122,7 +122,7 @@ public class DataTask implements ITask {
 					data.put("confirm_doctor_id", record.getStr("reviewdoctor"));
 					// 确认医生姓名
 					data.put("confirm_doctor_name", record.getStr("reviewdoctor"));
-					data.put("patient_no", patString);
+					data.put("patient_no", "");
 
 
 					ThreadPoolService tService = new com.zskk.service.ThreadPoolService();
@@ -246,7 +246,7 @@ public class DataTask implements ITask {
 	 * @date: 2019/12/26 18:26
 	 */
 	public String returnSecondTimestamp(String data) throws ParseException {
-		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+		SimpleDateFormat sdf = new SimpleDateFormat("yyyy.MM.dd HH:mm:ss");
 
 		return String.valueOf(sdf.parse(data).getTime() / 1000);
 	}
@@ -269,14 +269,14 @@ public class DataTask implements ITask {
 		}
 		name = name.replace(" ", "");
 		Doctors doctors = Doctors.dao.use("zskk").findFirst(
-				"SELECT * FROM doctors where instr(?,realname) and institution_id='15700002' and realname <>''", name);
+				"SELECT * FROM doctors where instr(?,realname) and institution_id='25660003' and realname <>''", name);
 		if (doctors == null) {
 			Doctors newDoctors = new Doctors().use("zskk");
 			newDoctors.setId(creatId());
 			newDoctors.setUsername("none");
 			newDoctors.setRealname(name);
 			newDoctors.setPassword("123456");
-			newDoctors.setInstitutionId("15700002");
+			newDoctors.setInstitutionId("25660003");
 			newDoctors.setCreatedAt(new Date());
 			newDoctors.setUpdatedAt(new Date());
 			newDoctors.save();
@@ -289,7 +289,7 @@ public class DataTask implements ITask {
 		if (dateStr == null) {
 			return new Date();
 		}
-		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+		SimpleDateFormat sdf = new SimpleDateFormat("yyyy.MM.dd HH:mm:ss");
 		Date date = null;
 		try {
 			date = sdf.parse(dateStr);