|
@@ -1,11 +1,10 @@
|
|
|
package com.zskk.task;
|
|
|
|
|
|
import java.util.HashMap;
|
|
|
+import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
-import com.alibaba.fastjson.JSON;
|
|
|
-import com.alibaba.fastjson.JSONArray;
|
|
|
-import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.jfinal.kit.PropKit;
|
|
|
import com.jfinal.plugin.activerecord.Db;
|
|
|
import com.jfinal.plugin.activerecord.Record;
|
|
|
import com.jfinal.plugin.cron4j.ITask;
|
|
@@ -19,12 +18,12 @@ public class UpdateTask implements ITask {
|
|
|
public void run() {
|
|
|
// TODO Auto-generated method stub
|
|
|
DataService dService = ServiceFactory.getService(DataService.class);
|
|
|
- JSONArray jsonArray = dService.getExamList(150);
|
|
|
- for (Object object : jsonArray) {
|
|
|
+ List<Record> records = Db.use("connected").find("select top 10 * from reportinfo order by reportdate desc");
|
|
|
+ if (records == null) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ for (Record record : records) {
|
|
|
try {
|
|
|
- JSONObject jsonObject = JSON.parseObject(object.toString());
|
|
|
- Record record = Db.use("connected").findFirst("select * from reportinfo where studyuid=?",
|
|
|
- jsonObject.getString("studyuid"));
|
|
|
if (record == null) {
|
|
|
continue;
|
|
|
}
|
|
@@ -32,7 +31,9 @@ public class UpdateTask implements ITask {
|
|
|
continue;
|
|
|
}
|
|
|
Map<String, String> params = new HashMap<>();
|
|
|
- params.put("exam_id", jsonObject.getString("id"));
|
|
|
+ params.put("type", "4");
|
|
|
+ params.put("institution_id", PropKit.get("institution_id"));
|
|
|
+ params.put("code", record.getStr("studyuid"));
|
|
|
// 报告医生姓名
|
|
|
params.put("report_doctor_name", record.getStr("reportdoctor"));
|
|
|
// 报告时间
|
|
@@ -72,14 +73,14 @@ public class UpdateTask implements ITask {
|
|
|
// 门诊号住院号
|
|
|
params.put("hopitalized_no", record.getStr("InPatNo"));
|
|
|
params.put("out_patient", record.getStr("PatientID"));
|
|
|
-
|
|
|
// 检查方法
|
|
|
-// params.put("exam_project", record.getStr("patientNumber"));
|
|
|
+// params.put("exam_project", record.getStr("patientNumber"));
|
|
|
|
|
|
ThreadPoolService tService = ServiceFactory.getService(ThreadPoolService.class);
|
|
|
tService.execute(() -> {
|
|
|
dService.saveReport(params);
|
|
|
});
|
|
|
+
|
|
|
} catch (Exception e) {
|
|
|
// TODO: handle exception
|
|
|
continue;
|