From 235cf590b8ac4c77d0a9a715d026bc591d9df133 Mon Sep 17 00:00:00 2001
From: 陈昶聿 <chychen@nbjetron.com>
Date: 星期二, 15 九月 2026 15:31:33 +0800
Subject: [PATCH] 【丽水】采集处理只有诊断名称没有诊断码的数据
---
ruoyi-admin/src/main/java/com/ruoyi/web/component/RedisMqReceiver.java | 89 ++++++++++++++++++++++++++++++++------------
1 files changed, 64 insertions(+), 25 deletions(-)
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/component/RedisMqReceiver.java b/ruoyi-admin/src/main/java/com/ruoyi/web/component/RedisMqReceiver.java
index b9a4adb..06955a7 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/component/RedisMqReceiver.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/component/RedisMqReceiver.java
@@ -13,10 +13,7 @@
import com.ruoyi.common.enums.ServiceFromEnum;
import com.ruoyi.common.enums.WxGZHEnum;
import com.ruoyi.common.exception.base.BaseException;
-import com.ruoyi.common.utils.HttpUtil;
-import com.ruoyi.common.utils.OkHttpExample;
-import com.ruoyi.common.utils.RSAPublicKeyExample;
-import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.common.utils.*;
import com.ruoyi.common.utils.http.HttpUtils;
import com.ruoyi.common.utils.sign.Md5Utils;
import com.ruoyi.common.utils.sms.smsUtils;
@@ -393,15 +390,14 @@
serviceOutPath.setDeptName(serviceSubtask.getDeptname());
serviceOutPath.setWardName(serviceSubtask.getLeavehospitaldistrictname());
iServiceOutPathService.insertServiceOutPath(serviceOutPath);
+ String url = "";
String format = String.format("%03X", serviceOutPath.getId());
- serviceOutPath.setRadix(format);
- serviceOutPath.setUpdateTime(new Date());
- iServiceOutPathService.updateServiceOutPath(serviceOutPath);
//闇�瑕侀�氳繃妯℃澘ID鍘诲垽鏂鍙戠殑鍐呭鏄鏁欒繕鏄�氱煡
HeLibrary heLibrary = heLibraryMapper.selectHeLibraryById(serviceSubtask.getLibtemplateid());
if (heLibrary.getHetype().equals("1")) {
sendMagParam.setPhone(serviceSubtask.getPhone());
- sendMagParam.setUrl(StringUtils.isNotEmpty(req_path) ? ip + ":" + req_path + "/xj?p=" + format : ip + "/xj?p=" + format);
+ url = StringUtils.isNotEmpty(req_path) ? ip + ":" + req_path + "/xj?p=" + format : ip + "/xj?p=" + format;
+ sendMagParam.setUrl(url);
SysConfig sysConfig = sysConfigMapper.checkConfigKeyUnique("xj.sms.template");
@@ -424,6 +420,10 @@
sendMagParam.setPhone(serviceSubtask.getPhone());
sendMagParam.setContent(sc);
}
+ serviceOutPath.setRadix(format);
+ serviceOutPath.setUpdateTime(new Date());
+ serviceOutPath.setUrl(url);
+ iServiceOutPathService.updateServiceOutPath(serviceOutPath);
}
//鐭俊杩橀渶瑕佹ā鏉�
@@ -493,16 +493,18 @@
if (active.equals("sltd")) {
data = MessageSend.sendMsg(sendMagParam.getContent(), "6", sendMagParam.getPhone(), LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss")));
if (StringUtils.isNotEmpty(data)) {
- ObjectMapper mapper = new ObjectMapper();
- JsonNode root = mapper.readTree(data);
- String status = root.get("result").get(0).get("status").asText();
- if (status.equals("00000")) {
- s = "true";
- } else {
- setFailPreachForm(serviceSubtask, sendPreachform, "鐭俊鍙戦�佸け璐�: " + data, "5");
- throw new BaseException("鐭俊鍙戦�佸け璐�");
+ String[] pairs = data.split("&");
+ String resultVal = null;
+ for (String pair : pairs) {
+ String[] kv = pair.split("=", 2);
+ if ("result".equals(kv[0])) {
+ resultVal = kv.length > 1 ? kv[1] : null;
+ break;
+ }
}
-
+ if ("0".equals(resultVal)) {
+ s = "true";
+ }
} else {
setFailPreachForm(serviceSubtask, sendPreachform, "鐭俊鍙戦�佸け璐�: " + data, "5");
throw new BaseException("鐭俊鍙戦�佸け璐�");
@@ -599,8 +601,9 @@
String format = String.format("%03X", serviceOutPath.getId());
serviceOutPath.setRadix(format);
serviceOutPath.setUpdateTime(new Date());
- iServiceOutPathService.updateServiceOutPath(serviceOutPath);
url = ip + ":" + req_path + "/sf?p=" + format;
+ serviceOutPath.setUrl(url);
+ iServiceOutPathService.updateServiceOutPath(serviceOutPath);
} else if (type == 2) {
//闂埜
ServiceOutPath serviceOutPath = new ServiceOutPath();
@@ -616,13 +619,16 @@
serviceOutPath.setWardName(serviceSubtask.getLeavehospitaldistrictname());
iServiceOutPathService.insertServiceOutPath(serviceOutPath);
String format = String.format("%03X", serviceOutPath.getId());
- serviceOutPath.setRadix(format);
- serviceOutPath.setUpdateTime(new Date());
- iServiceOutPathService.updateServiceOutPath(serviceOutPath);
+
url = StringUtils.isNotEmpty(req_path) ? ip + ":" + req_path + "/wt?p=" + format : ip + "/wt?p=" + format;
//濡傛灉type鏄闊抽殢璁跨殑璇濓紙璇存槑琛ュ伩鍙戦�佹柟寮忎腑鏈夌數璇濋殢璁跨殑鏂瑰紡锛岃繖閲岀殑澶栭摼灏卞湴鍧�鍙兘鐢�/sf锛�
if (serviceSubtask.getType().equals("1"))
sendMagParam.setUrl(ip + ":" + req_path + "/sf?p=" + format);
+
+ serviceOutPath.setRadix(format);
+ serviceOutPath.setUrl(url);
+ serviceOutPath.setUpdateTime(new Date());
+ iServiceOutPathService.updateServiceOutPath(serviceOutPath);
} else if (type == 3) {
//瀹f暀
ServiceOutPath serviceOutPath = new ServiceOutPath();
@@ -638,9 +644,6 @@
serviceOutPath.setOrgid(serviceSubtask.getOrgid());
iServiceOutPathService.insertServiceOutPath(serviceOutPath);
String format = String.format("%03X", serviceOutPath.getId());
- serviceOutPath.setRadix(format);
- serviceOutPath.setUpdateTime(new Date());
- iServiceOutPathService.updateServiceOutPath(serviceOutPath);
//闇�瑕侀�氳繃妯℃澘ID鍘诲垽鏂鍙戠殑鍐呭鏄鏁欒繕鏄�氱煡
// HeLibrary heLibrary = heLibraryMapper.selectHeLibraryById(serviceSubtask.getLibtemplateid());
@@ -660,6 +663,10 @@
// }
url = ip + ":" + req_path + "/xj?p=" + format;
+ serviceOutPath.setRadix(format);
+ serviceOutPath.setUpdateTime(new Date());
+ serviceOutPath.setUrl(url);
+ iServiceOutPathService.updateServiceOutPath(serviceOutPath);
}
if (StringUtils.isEmpty(patArchive.getPatidHis())) {
serviceSubtask.setCurrentPreachform(sendPreachform);
@@ -935,7 +942,8 @@
serviceSubtaskPreachform1.setRemark(remark);
serviceSubtaskPreachformMapper.updateServiceSubtaskPreachform(serviceSubtaskPreachform1);
//濡傛灉褰撳墠鐨刾reachform宸茬粡鏄渶鍚庝竴涓簡,骞朵笖鏈杩樻槸鍙戦�佸け璐ワ紝閭g洿鎺ュ皢serviceSubtask鐨剆endstate鐘舵�佹敼鎴�5灏辫浜�(鍏ㄥけ璐ヤ簡)
- if (CollectionUtils.isNotEmpty(spSize) && serviceSubtaskPreachform1.getSort() == spSize.size()) {
+ if (CollectionUtils.isNotEmpty(spSize) && serviceSubtaskPreachform1.getSort() == spSize.size()
+ && isSubtaskDeadline(serviceSubtask, serviceSubtaskPreachforms)) {
if (serviceSubtaskPreachform1.getSort() == spSize.size()) {
if (failSendstate.equals("4") || failSendstate.equals("5")) {
serviceSubtask.setCurrentPreachform(preachform);
@@ -1087,4 +1095,35 @@
}
return toHex(md5.digest());
}
+
+ /**
+ * 闅忚浠诲姟鏄惁瓒呮椂
+ * @param serviceSubtask
+ * @param serviceSubtaskPreachforms
+ * @return
+ */
+ public boolean isSubtaskDeadline(ServiceSubtask serviceSubtask, List<ServiceSubtaskPreachform> serviceSubtaskPreachforms){
+ if (ObjectUtils.isNotEmpty(serviceSubtask)) {
+ //鍙湁鍑洪櫌闅忚鍜屼笓鐥呴殢璁挎湁瓒呮椂
+ if(StringUtils.isNotEmpty(serviceSubtask.getServiceType()) &&
+ !serviceSubtask.getServiceType().equals("2") && !serviceSubtask.getServiceType().equals("13")){
+ return true;
+ }
+ }
+ if (Objects.isNull(serviceSubtask) || CollectionUtils.isEmpty(serviceSubtaskPreachforms)) {
+ return false;
+ }
+ // 鍩哄噯鏃跺埢锛氬嚭闄㈡椂闂� + 鍙戦�佹棩锛坰endDay 缂虹渷鎸� 1锛夛紝骞跺厹搴曢伩鍏� NPE/鑴忔暟鎹�
+ ServiceTask serviceTask = serviceTaskMapper.selectServiceTaskByTaskid(serviceSubtask.getTaskid());
+ int sendDay = serviceTask != null && serviceTask.getSendDay() != null ? serviceTask.getSendDay().intValue() : 1;
+ Date deadline = DateUtils.addDays(serviceSubtask.getEndtime(), sendDay);
+ int sumCompensateTime = CollectionUtils.isEmpty(serviceSubtaskPreachforms) ? 0 : serviceSubtaskPreachforms.stream()
+ .mapToInt(x -> x.getCompensateTime() == null ? 0 : Integer.parseInt(x.getCompensateTime()))
+ .sum();
+ sumCompensateTime = sumCompensateTime + 1;
+ // 鍙ˉ鍋挎渶鍚庝竴姝ヨ嚜韬殑琛ュ伩鏃堕棿锛堝ぉ锛夛紝鑴忓�间竴寰嬫寜 0 鍏滃簳
+ deadline = DateUtils.addDays(deadline, sumCompensateTime);
+ // 鍑洪櫌(鍙戦��)鏃堕棿 + 鏈琛ュ伩鏃堕棿 灏忎簬褰撳墠鏃堕棿 -> 瓒呮椂
+ return deadline.getTime() < new Date().getTime();
+ }
}
--
Gitblit v1.9.3