From 24166f2d9ae0bb72f061a38b96a113b1b6e44fbc Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期一, 02 二月 2026 17:17:52 +0800
Subject: [PATCH] 代码提交
---
smartor/src/main/java/com/smartor/service/impl/PatMedInhospServiceImpl.java | 102 ++++++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 96 insertions(+), 6 deletions(-)
diff --git a/smartor/src/main/java/com/smartor/service/impl/PatMedInhospServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/PatMedInhospServiceImpl.java
index 79115c7..ff4bd37 100644
--- a/smartor/src/main/java/com/smartor/service/impl/PatMedInhospServiceImpl.java
+++ b/smartor/src/main/java/com/smartor/service/impl/PatMedInhospServiceImpl.java
@@ -8,12 +8,11 @@
import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.LoginUser;
-import com.ruoyi.common.utils.DateUtils;
-import com.ruoyi.common.utils.DtoConversionUtils;
-import com.ruoyi.common.utils.SecurityUtils;
-import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.common.utils.*;
+import com.smartor.common.RandomStringGenerator;
import com.smartor.domain.*;
import com.smartor.mapper.*;
+import com.smartor.service.IServiceOutPathService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
@@ -49,11 +48,21 @@
@Autowired
private ServiceSubtaskMapper serviceSubtaskMapper;
+
@Autowired
- private SysUserDeptMapper sysUserDeptMapper;
+ private IServiceOutPathService iServiceOutPathService;
@Value("${createTaskServiceType}")
private List<String> createTaskServiceType;
+
+ @Value("${localIP}")
+ private String localIP;
+
+ @Value("${req_path}")
+ private String req_path;
+
+ @Value("${pub_key}")
+ private String pub_key;
//璁板綍闀挎湡浠诲姟鍩虹淇℃伅
List<IvrLibaTemplate> libaTemplates = new ArrayList<>();
@@ -352,7 +361,6 @@
serviceSubtask1.setSendstate(4L);
serviceSubtask1.setRemark("鎮h�呭啀鍏ラ櫌");
serviceSubtask1.setResult("error");
-// serviceSubtask1.setFinishtime(new Date());
Boolean aBoolean = serviceSubtaskMapper.updateServiceSubtask(serviceSubtask1);
if (aBoolean) i = 1;
} else {
@@ -364,6 +372,16 @@
}
}
}
+ //鐢熸垚澶栭摼鍦板潃
+ String outPath = null;
+ if (serviceTask.getType().equals("1"))
+ outPath = getOutPath(serviceSubtask.getPhone(), serviceSubtask.getTaskid(), serviceSubtask.getTaskName(), serviceSubtask.getPatid(), 1);
+ else if (serviceTask.getType().equals("2"))
+ outPath = getOutPath(serviceSubtask.getPhone(), serviceSubtask.getTaskid(), serviceSubtask.getTaskName(), serviceSubtask.getPatid(), 2);
+ else if (serviceTask.getType().equals("3"))
+ outPath = getOutPath(serviceSubtask.getPhone(), serviceSubtask.getTaskid(), serviceSubtask.getTaskName(), serviceSubtask.getPatid(), 3);
+ serviceSubtask.setOutPath(outPath);
+
i = serviceSubtaskMapper.insertServiceSubtask(serviceSubtask);
if (i == 1) {
//灏哻heck_flag鏀规垚1锛堝凡澶勭悊锛�
@@ -479,4 +497,76 @@
return calendar.getTime();
}
+
+ private String getOutPath(String phone, Long tid, String taskName, Long pId, Integer type) {
+ //瀵箄rl涓袱涓弬鏁板姞瀵�
+ RSAPublicKeyExample rsaPublicKeyExample = new RSAPublicKeyExample();
+ String taskId = rsaPublicKeyExample.encryptedData(tid.toString(), pub_key);
+ String outpath = null;
+ try {
+ String patid = rsaPublicKeyExample.encryptedData(pId.toString(), pub_key);
+ SendMagParam sendMagParam = new SendMagParam();
+ sendMagParam.setType("4");
+ if (type == 1) {
+ //闅忚
+ ServiceOutPath serviceOutPath = new ServiceOutPath();
+ serviceOutPath.setParam1(taskId);
+ serviceOutPath.setParam2(patid);
+ serviceOutPath.setCreateTime(new Date());
+ serviceOutPath.setType(1);
+ iServiceOutPathService.insertServiceOutPath(serviceOutPath);
+ //杞垚16杩涘埗
+ String format = String.format("%03X", serviceOutPath.getId()) + RandomStringGenerator.generateRandomString();
+ serviceOutPath.setRadix(format);
+ outpath = localIP + ":" + req_path + "/sf?p=" + format;
+ serviceOutPath.setUpdateTime(new Date());
+ iServiceOutPathService.updateServiceOutPath(serviceOutPath);
+ sendMagParam.setPhone(phone);
+ sendMagParam.setUrl(outpath);
+ sendMagParam.setContent("鎮ㄥソ锛岄個璇锋偍濉啓鍑洪櫌闅忚璋冩煡琛紝璇风偣鍑�" + sendMagParam.getUrl() + " 濉啓銆傛劅璋㈡偍閰嶅悎锛�");
+ } else if (type == 2) {
+ //闂埜锛堥棶棰橈級
+ ServiceOutPath serviceOutPath = new ServiceOutPath();
+ serviceOutPath.setParam1(taskId);
+ serviceOutPath.setParam2(patid);
+ serviceOutPath.setParam3(taskName);
+ serviceOutPath.setCreateTime(new Date());
+ serviceOutPath.setType(2);
+ iServiceOutPathService.insertServiceOutPath(serviceOutPath);
+ String format = String.format("%03X", serviceOutPath.getId()) + RandomStringGenerator.generateRandomString();
+ serviceOutPath.setRadix(format);
+ serviceOutPath.setUpdateTime(new Date());
+ outpath = localIP + ":" + req_path + "/wt?p=" + format;
+ iServiceOutPathService.updateServiceOutPath(serviceOutPath);
+
+// sendMagParam.setUrl(ip + ":" + req_path + "/outsideChainwt?param1=" + taskId + "¶m2=" + patid + "¶m3=" + URLEncoder.encode(ivrTask1.getTaskName(), StandardCharsets.UTF_8.toString()) + "¶m5=false");
+ sendMagParam.setPhone(phone);
+ sendMagParam.setUrl(outpath);
+ sendMagParam.setContent("鎮ㄥソ锛岄個璇锋偍濉啓鍑洪櫌璋冩煡琛紝璇风偣鍑�" + sendMagParam.getUrl() + " 濉啓銆傛劅璋㈡偍閰嶅悎锛�");
+ log.info("鎮ㄥソ锛岄個璇锋偍濉啓鍑洪櫌璋冩煡琛紝璇风偣鍑�,{}", sendMagParam.getUrl());
+ } else if (type == 3) {
+ //瀹f暀
+ ServiceOutPath serviceOutPath = new ServiceOutPath();
+ serviceOutPath.setParam1(taskId);
+ serviceOutPath.setParam2(patid);
+ serviceOutPath.setParam3(taskName);
+ serviceOutPath.setCreateTime(new Date());
+ serviceOutPath.setType(3);
+ iServiceOutPathService.insertServiceOutPath(serviceOutPath);
+ String format = String.format("%03X", serviceOutPath.getId()) + RandomStringGenerator.generateRandomString();
+ serviceOutPath.setRadix(format);
+ serviceOutPath.setUpdateTime(new Date());
+ outpath = localIP + ":" + req_path + "/xj?p=" + format;
+ iServiceOutPathService.updateServiceOutPath(serviceOutPath);
+ sendMagParam.setPhone(phone);
+ sendMagParam.setUrl(outpath);
+ sendMagParam.setContent("鎮ㄥソ锛岄個璇锋偍濉啓鍑洪櫌瀹f暀璋冩煡琛紝璇风偣鍑�" + sendMagParam.getUrl() + "鏌ョ湅銆傛劅璋㈡偍閰嶅悎锛�");
+ log.info("-----------sendMagParam鐨勫�间负锛歿}", sendMagParam);
+ }
+ } catch (Exception e) {
+ log.error("鐢熸垚澶辫触浜嗭細{}", e.getMessage());
+ }
+ return outpath;
+ }
+
}
--
Gitblit v1.9.3