|
@@ -13,7 +13,7 @@ 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.model.Studies;
|
|
|
import com.zskk.service.WeixinService;
|
|
|
|
|
|
public class DataTask implements ITask {
|
|
@@ -22,9 +22,9 @@ public class DataTask implements ITask {
|
|
|
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=01000001 order by createdAt desc limit 50");
|
|
|
+ List<Exams> exams = Exams.dao.use("zskk").find("SELECT * FROM pacsonline.exams where exam_status=3 and institution_id=33600001 order by createdAt desc limit 50");
|
|
|
for (Exams exams2 : exams) {
|
|
|
-// Studies studies = Studies.dao.use("zskk").findById(exams2.getStudyId());
|
|
|
+ Studies studies = Studies.dao.use("zskk").findById(exams2.getStudyId());
|
|
|
Record record = Db.use("connected").findFirst("select * from reportinfo where accessionNumber=?",exams2.getAccessionNum());
|
|
|
if (record == null) {
|
|
|
continue;
|
|
@@ -78,9 +78,18 @@ 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=01000001",name);
|
|
|
+ Doctors doctors = Doctors.dao.use("zskk").findFirst("SELECT * FROM doctors where instr(?,realname) and institution_id=81069902 and realname<>''", name);
|
|
|
if (doctors == null) {
|
|
|
- return null;
|
|
|
+ Doctors newDoctors = new Doctors().use("zskk");
|
|
|
+ newDoctors.setId(creatId());
|
|
|
+ newDoctors.setUsername("none");
|
|
|
+ newDoctors.setRealname(name);
|
|
|
+ newDoctors.setPassword("123456");
|
|
|
+ newDoctors.setInstitutionId("33600001");
|
|
|
+ newDoctors.setCreatedAt(new Date());
|
|
|
+ newDoctors.setUpdatedAt(new Date());
|
|
|
+ newDoctors.save();
|
|
|
+ return newDoctors.getId();
|
|
|
}
|
|
|
return doctors.getId();
|
|
|
}
|