|
@@ -1,14 +1,17 @@
|
|
|
package com.zskk.control;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import com.jfinal.core.Controller;
|
|
|
import com.jfinal.kit.HashKit;
|
|
|
import com.jfinal.kit.PropKit;
|
|
|
import com.jfinal.plugin.activerecord.ActiveRecordPlugin;
|
|
|
import com.jfinal.plugin.activerecord.Db;
|
|
|
import com.jfinal.plugin.activerecord.Record;
|
|
|
+import com.jfinal.plugin.activerecord.dialect.MysqlDialect;
|
|
|
import com.jfinal.plugin.activerecord.dialect.SqlServerDialect;
|
|
|
import com.jfinal.plugin.druid.DruidPlugin;
|
|
|
+import com.jfinal.plugin.redis.RedisPlugin;
|
|
|
import com.zskk.model.*;
|
|
|
import org.apache.commons.codec.digest.DigestUtils;
|
|
|
|
|
@@ -24,6 +27,18 @@ import java.util.*;
|
|
|
|
|
|
public class ViewController extends Controller {
|
|
|
|
|
|
+// static{
|
|
|
+// DruidPlugin druidPluginZskk = createZskkDruidPlugin();
|
|
|
+// druidPluginZskk.start();
|
|
|
+//
|
|
|
+// // 配置ActiveRecord插件
|
|
|
+// ActiveRecordPlugin arpZskk = new ActiveRecordPlugin("zskk", druidPluginZskk);
|
|
|
+// arpZskk.setDialect(new MysqlDialect());
|
|
|
+// arpZskk.start();
|
|
|
+// _MappingKit.mapping(arpZskk);
|
|
|
+//
|
|
|
+// }
|
|
|
+
|
|
|
/**
|
|
|
* 在被连接数据库执行sql语句
|
|
|
*/
|
|
@@ -67,13 +82,21 @@ public class ViewController extends Controller {
|
|
|
|
|
|
return new DruidPlugin(PropKit.get("jdbcUrl_connected"), PropKit.get("user_connected"),PropKit.get("password_connected").trim());
|
|
|
}
|
|
|
- public void testTask() {
|
|
|
+ public static DruidPlugin createZskkDruidPlugin() {
|
|
|
+
|
|
|
+ return new DruidPlugin("jdbc:mysql://47.104.6.21:3306/pacsonline?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false", "pacs","ZSKK@2017~!@#");
|
|
|
+ }
|
|
|
+ public static void testTask() {
|
|
|
+
|
|
|
try {
|
|
|
String string = "here";
|
|
|
+// String jString = "{\"birthdate\":\"1940-04-19 00:00:00\",\"modality\":\"CR\",\"patientid\":\"030449823\",\"patientsex\":\"男\",\"reportPaperNum\":736952,\"reportdate\":\"2019-12-29 16:35:13\",\"diagnosis\":\"直肠癌\",\"accessionNumber\":\"141238\",\"patientname\":\"赵清标\",\"symptom\":\"直肠癌病史3年,腹痛1天。\",\"clinicaldoctor\":\"孙明\",\"phone\":\"13766662589\",\"DESCRIPTION\":\"所示胸腰椎及骨盆未见骨质异常;\\r\\n双侧膈下见气体密度影;\\r\\n腹部肠管内积气伴局部扩张;\\r\\n腰大肌影清晰;腹壁软组织影未见异常;\\r\\n胆囊区、肾区、输尿管区、膀胱区未见阳性结石影;\\r\\n双肾轮廓显影欠清;隐约可见;未见明显形态改变;\\r\\n腹部未见异常软组织团块影,未见异常钙化影。\\r\\n\",\"printreport\":false,\"idcard\":\"231011194004191512\",\"patientage\":\"79岁\",\"impression\":\"1、膈下游离气体,考虑气腹,请结合临床\\r\\n2、腹部肠管扩张、积气,请结合临床。\\r\\n\",\"regPaperNum\":\"890261\",\"reviewdoctor\":\"王宪\",\"department\":\"康复科\",\"studyuid\":\"141238\",\"printfilm\":true,\"reportdoctor\":\"王宪\"}";
|
|
|
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 accessionNumber=?",exams2.getAccessionNum());
|
|
|
+// Record record = JSON.parseObject(jString, Record.class);
|
|
|
+// JSONObject record = JSON.parseObject(jString);
|
|
|
if (record == null) {
|
|
|
continue;
|
|
|
}
|
|
@@ -128,7 +151,7 @@ public class ViewController extends Controller {
|
|
|
//手机号
|
|
|
data.put("phone","");
|
|
|
//患者生日
|
|
|
- data.put("birthday",returnSecondTimestamp(record.getStr("2019-11-11 08:09:09")));
|
|
|
+ data.put("birthday",returnSecondTimestamp(record.getStr("birthdate")));
|
|
|
//患者检查时年龄
|
|
|
data.put("patient_age",patientInfos.getAge());
|
|
|
//阴阳性 1阴性 2阳性
|
|
@@ -162,10 +185,13 @@ public class ViewController extends Controller {
|
|
|
String string2 = sendPost("http://39.106.136.96/pacs/zskk/writePatientReport", params);
|
|
|
string = string + string2 + "*******";
|
|
|
}
|
|
|
- this.renderText(string);
|
|
|
+ System.out.println(string);
|
|
|
+// this.renderText(string);
|
|
|
} catch (Exception e) {
|
|
|
// TODO: handle exception
|
|
|
- this.renderText(e.toString());
|
|
|
+// this.renderText(e.toString());
|
|
|
+ System.out.println(e.toString());
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -186,13 +212,13 @@ public class ViewController extends Controller {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private String creatId() {
|
|
|
+ private static String creatId() {
|
|
|
UUID id = UUID.randomUUID();
|
|
|
String[] idd= id.toString().split("-");
|
|
|
return idd[0]+idd[1]+idd[2];
|
|
|
}
|
|
|
|
|
|
- private String getDoctorIdByName(String name) {
|
|
|
+ private static String getDoctorIdByName(String name) {
|
|
|
if (name == null) {
|
|
|
return "1";
|
|
|
}
|
|
@@ -203,7 +229,7 @@ public class ViewController extends Controller {
|
|
|
return doctors.getId();
|
|
|
}
|
|
|
|
|
|
- private Date parseStringToDate(String dateStr) {
|
|
|
+ private static Date parseStringToDate(String dateStr) {
|
|
|
if (dateStr == null) {
|
|
|
return new Date();
|
|
|
}
|
|
@@ -314,9 +340,13 @@ public class ViewController extends Controller {
|
|
|
return resultString;
|
|
|
}
|
|
|
|
|
|
- public String returnSecondTimestamp(String data) throws ParseException {
|
|
|
+ public static String returnSecondTimestamp(String data) throws ParseException {
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
|
return String.valueOf(sdf.parse(data).getTime()/1000);
|
|
|
}
|
|
|
+
|
|
|
+ public static void main(String[] args) {
|
|
|
+ testTask();
|
|
|
+ }
|
|
|
}
|