|
@@ -1,28 +1,25 @@
|
|
|
package com.zskk.task;
|
|
|
|
|
|
-import java.text.ParseException;
|
|
|
-import java.text.SimpleDateFormat;
|
|
|
-import java.util.Date;
|
|
|
-import java.util.List;
|
|
|
-import java.util.UUID;
|
|
|
import com.jfinal.plugin.activerecord.Db;
|
|
|
import com.jfinal.plugin.activerecord.Record;
|
|
|
import com.jfinal.plugin.cron4j.ITask;
|
|
|
+import com.zskk.model.*;
|
|
|
import com.zskk.service.ServiceFactory;
|
|
|
-import com.zskk.model.Doctors;
|
|
|
-import com.zskk.model.Exams;
|
|
|
-import com.zskk.model.PatientInfos;
|
|
|
-import com.zskk.model.Report;
|
|
|
-import com.zskk.model.Studies;
|
|
|
import com.zskk.service.WeixinService;
|
|
|
|
|
|
+import java.text.ParseException;
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
+import java.util.Date;
|
|
|
+import java.util.List;
|
|
|
+import java.util.UUID;
|
|
|
+
|
|
|
public class DataTask implements ITask {
|
|
|
|
|
|
@Override
|
|
|
public void run() {
|
|
|
// 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=47300001 order by createdAt desc limit 30");
|
|
|
+ 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 30");
|
|
|
for (Exams exams2 : exams) {
|
|
|
Studies studies = Studies.dao.use("zskk").findById(exams2.getStudyId());
|
|
|
Record record = Db.use("connected").findFirst("select * from zskk where studyuid=?",studies.getStudyuid());
|
|
@@ -47,8 +44,8 @@ public class DataTask implements ITask {
|
|
|
report.save();
|
|
|
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.setPhone(record.getStr("phone"));
|
|
|
+ patientInfos.setCardNum(record.getStr("IDCARD"));
|
|
|
patientInfos.update();
|
|
|
exams2.setExamStatus(9);
|
|
|
exams2.update();
|
|
@@ -78,14 +75,14 @@ public class DataTask implements ITask {
|
|
|
if (name == null) {
|
|
|
return null;
|
|
|
}
|
|
|
- Doctors doctors = Doctors.dao.use("zskk").findFirst("SELECT * FROM doctors where instr(?,realname) and institution_id=47300001 and realname<>null",name);
|
|
|
+ Doctors doctors = Doctors.dao.use("zskk").findFirst("SELECT * FROM doctors where instr(?,realname) and institution_id=15700002 and realname<>null",name);
|
|
|
if (doctors == null) {
|
|
|
Doctors newDoctors = new Doctors().use("zskk");
|
|
|
newDoctors.setId(creatId());
|
|
|
newDoctors.setUsername("none");
|
|
|
newDoctors.setRealname(name);
|
|
|
newDoctors.setPassword("123456");
|
|
|
- newDoctors.setInstitutionId("47300001");
|
|
|
+ newDoctors.setInstitutionId("15700002");
|
|
|
newDoctors.setCreatedAt(new Date());
|
|
|
newDoctors.setUpdatedAt(new Date());
|
|
|
newDoctors.save();
|