From 524918761cf05d26d998d80b8f2f098d745c1987 Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期四, 04 七月 2024 23:57:22 +0800
Subject: [PATCH] 代码提交
---
ruoyi-admin/src/main/resources/application-druid.yml | 2
ruoyi-admin/src/main/java/com/ruoyi/web/component/RedisMqReceiver.java | 25 +++++++-----
ruoyi-common/src/main/java/com/ruoyi/common/utils/IPUtils.java | 52 ++++++++++++++++++++++++++
smartor/src/main/java/com/smartor/service/impl/ServiceTaskServiceImpl.java | 13 ++++++
ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java | 2
ruoyi-admin/src/main/resources/application.yml | 2
smartor/src/main/java/com/smartor/common/SendService.java | 5 ++
7 files changed, 87 insertions(+), 14 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 3530a37..ec3d344 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
@@ -4,6 +4,7 @@
import com.fasterxml.jackson.databind.ObjectMapper;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.enums.ServiceFromEnum;
+import com.ruoyi.common.utils.IPUtils;
import com.ruoyi.common.utils.RSAPublicKeyExample;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.web.task.PhoneTask;
@@ -112,6 +113,8 @@
@Override
public void onMessage(Message message, byte[] pattern) {
log.info("鐩戝惉Redis key杩囨湡锛宬ey锛歿}锛宑hannel锛歿}", message.toString(), new String(pattern));
+ String ip = "116.62.18.175";
+ log.error("鏈満鐨勭綉缁淚P涓�:{}", ip);
String content = message.toString();
//鍒ゆ柇鏄笉鏄换鍔′俊鎭紝濡傛灉涓嶆槸锛岀洿鎺ヨ繑鍥烇紝涓嶉渶瑕佹墽琛�
if (!content.contains("taskid")) {
@@ -129,12 +132,13 @@
if (commonTaskcallMQ.getTaskType() == 1) {
//闅忚
- sfHandle((commonTaskcallMQ));
+ sfHandle(commonTaskcallMQ, ip);
} else if (commonTaskcallMQ.getTaskType() == 2) {
//闂嵎
- wjHandle(commonTaskcallMQ);
+ wjHandle(commonTaskcallMQ, ip);
} else if (commonTaskcallMQ.getTaskType() == 3) {
//瀹f暀
+ xjHandle(commonTaskcallMQ, ip);
}
@@ -159,7 +163,7 @@
*
* @param commonTaskcallMQ
*/
- private void sfHandle(CommonTaskcallMQ commonTaskcallMQ) {
+ private void sfHandle(CommonTaskcallMQ commonTaskcallMQ, String ip) {
//鍒ゆ柇涓�涓媍ommonTaskcallMQ涓殑stopstate鏄惁涓巌vr_task涓殑涓�鑷达紝涓嶄竴鑷达紝鍒欒鏄庢槸鏆傚仠浜�
ServiceTask ivrTask1 = ivrTaskMapper.selectServiceTaskByTaskid(commonTaskcallMQ.getTaskid());
if (ivrTask1.getStopState() != commonTaskcallMQ.getStopState()) {
@@ -219,7 +223,7 @@
String patid = rsaPublicKeyExample.encryptedData(ivrTaskSingle.getPatid().toString(), pub_key);
SendMagParam sendMagParam = new SendMagParam();
sendMagParam.setType("4");
- sendMagParam.setUrl(req_path + "/followvisit/particty?param1=" + taskId + "¶m2=" + patid);
+ sendMagParam.setUrl(ip + ":" + req_path + "/followvisit/particty?param1=" + taskId + "¶m2=" + patid);
Boolean aBoolean = sendService.sendMsg(sendMagParam);
@@ -234,6 +238,7 @@
serviceSubtaskRecordService.insertServiceSubtaskRecord(serviceSubtaskRecord);
}
} else if (descByCode.equals("鍏紬鍙�")) {
+
//鍏紬鍙�
RSAPublicKeyExample rsaPublicKeyExample = new RSAPublicKeyExample();
String taskId = rsaPublicKeyExample.encryptedData(ivrTask1.getTaskid().toString(), pub_key);
@@ -241,7 +246,7 @@
String patid = rsaPublicKeyExample.encryptedData(ivrTaskSingle.getPatid().toString(), pub_key);
SendMagParam sendMagParam = new SendMagParam();
sendMagParam.setType("5");
- sendMagParam.setUrl(req_path + "/outsideChain?param1=" + taskId + "¶m2=" + patid + "¶m3=" + ivrTask1.getTaskName());
+ sendMagParam.setUrl(ip + ":" + req_path + "/outsideChain?param1=" + ivrTask1.getTaskid().toString() + "¶m2=" + ivrTaskSingle.getPatid().toString() + "¶m3=" + ivrTask1.getTaskName());
log.info("閾炬帴瀹屾暣璺緞锛歿}", req_path + "/outsideChain?param1=" + taskId + "¶m2=" + patid + "¶m3=" + ivrTask1.getTaskName());
//杩欎釜妯℃澘ID鍏堝啓姝伙紝鍚庨潰鍋氭垚鍙��
sendMagParam.setTmpCode("oG3pJHPVWpE81DmZsua_2tKwgJ97r0qz37z56ns7NB4");
@@ -271,7 +276,7 @@
*
* @param commonTaskcallMQ
*/
- private void xjHandle(CommonTaskcallMQ commonTaskcallMQ) {
+ private void xjHandle(CommonTaskcallMQ commonTaskcallMQ, String ip) {
//鍒ゆ柇涓�涓媍ommonTaskcallMQ涓殑stopstate鏄惁涓巌vr_task涓殑涓�鑷达紝涓嶄竴鑷达紝鍒欒鏄庢槸鏆傚仠浜�
ServiceTask ivrTask1 = ivrTaskMapper.selectServiceTaskByTaskid(commonTaskcallMQ.getTaskid());
if (ivrTask1.getStopState() != commonTaskcallMQ.getStopState()) {
@@ -332,7 +337,7 @@
String patid = rsaPublicKeyExample.encryptedData(ivrTaskSingle.getPatid().toString(), pub_key);
SendMagParam sendMagParam = new SendMagParam();
sendMagParam.setType("4");
- sendMagParam.setUrl(req_path + "/followvisit/particty?param1=" + taskId + "¶m2=" + patid);
+ sendMagParam.setUrl(ip + ":" + req_path + "/followvisit/particty?param1=" + taskId + "¶m2=" + patid);
Boolean aBoolean = sendService.sendMsg(sendMagParam);
//浠诲姟鍙戦�佽褰�
@@ -353,7 +358,7 @@
String patid = rsaPublicKeyExample.encryptedData(ivrTaskSingle.getPatid().toString(), pub_key);
SendMagParam sendMagParam = new SendMagParam();
sendMagParam.setType("5");
- sendMagParam.setUrl(req_path + "/outsideChain?param1=" + taskId + "¶m2=" + patid + "¶m3=" + ivrTask1.getTaskName());
+ sendMagParam.setUrl(ip + ":" + req_path + "/outsideChain?param1=" + taskId + "¶m2=" + patid + "¶m3=" + ivrTask1.getTaskName());
log.info("閾炬帴瀹屾暣璺緞锛歿}", req_path + "/outsideChain?param1=" + taskId + "¶m2=" + patid + "¶m3=" + ivrTask1.getTaskName());
//杩欎釜妯℃澘ID鍏堝啓姝伙紝鍚庨潰鍋氭垚鍙��
sendMagParam.setTmpCode("oG3pJHPVWpE81DmZsua_2tKwgJ97r0qz37z56ns7NB4");
@@ -383,7 +388,7 @@
*
* @param commonTaskcallMQ
*/
- private void wjHandle(CommonTaskcallMQ commonTaskcallMQ) {
+ private void wjHandle(CommonTaskcallMQ commonTaskcallMQ, String ip) {
//鍒ゆ柇涓�涓媍ommonTaskcallMQ涓殑stopstate鏄惁涓巌vr_task涓殑涓�鑷达紝涓嶄竴鑷达紝鍒欒鏄庢槸鏆傚仠浜�
SvyTask svyTask = svyTaskMapper.selectSvyTaskByTaskid(commonTaskcallMQ.getTaskid());
if (svyTask.getStopState() != commonTaskcallMQ.getStopState()) {
@@ -441,7 +446,7 @@
String patid = rsaPublicKeyExample.encryptedData(svyTaskSingle1.getPatid().toString(), pub_key);
SendMagParam sendMagParam = new SendMagParam();
sendMagParam.setType("5");
- sendMagParam.setUrl(req_path + "/outsideChain?param1=" + taskId + "¶m2=" + patid + "¶m3=" + svyTask.getTaskName());
+ sendMagParam.setUrl(ip + ":" + req_path + "/outsideChain?param1=" + taskId + "¶m2=" + patid + "¶m3=" + svyTask.getTaskName());
log.info("閾炬帴瀹屾暣璺緞锛歿}", req_path + "/outsideChain?param1=" + taskId + "¶m2=" + patid + "¶m3=" + svyTask.getTaskName());
//杩欎釜妯℃澘ID鍏堝啓姝伙紝鍚庨潰鍋氭垚鍙��
sendMagParam.setTmpCode("oG3pJHPVWpE81DmZsua_2tKwgJ97r0qz37z56ns7NB4");
diff --git a/ruoyi-admin/src/main/resources/application-druid.yml b/ruoyi-admin/src/main/resources/application-druid.yml
index 2a83095..954cd06 100644
--- a/ruoyi-admin/src/main/resources/application-druid.yml
+++ b/ruoyi-admin/src/main/resources/application-druid.yml
@@ -131,7 +131,7 @@
pri_key: MIIBVQIBADANBgkqhkiG9w0BAQEFAASCAT8wggE7AgEAAkEApHTIe/StslZAT5Jzv8XClbrqox32pfaTrP5IOCRJ3FaH/UZsGgA/tsNBBEXq9eagqwPbJrjYfpdEtINcChrK4wIDAQABAkEAilDujdKshGGmlUZHs/NQRT6AOdDpsYxBiC4V76IVvQpw0IW6c4HGEvH4T+xRufika7/48L0eu0f06H+YtL5lgQIhANUd0a6oSsVxWifAjtKwMZcXD3OaIxQIQSCN4NT4VFY3AiEAxYxYrIhkIyg+UVw3WOSvBpXKxM4/WL9HRzkxDLvp2rUCIQCK23P8tgCJ5xJT5l3onw6goFDcBKkoazxsBqVgfjENPwIgWbuTd+OIYPPhwsE5ntZZrosSDO2GlsBkFzUiU59z7VUCIA0LL+9IFb+FWCl3DGTwIQ9SZYbv61T83LKjebUcSOfe
#璇锋眰IP鍜岀鍙e彿
-req_path: 192.168.2.10:8099
+req_path: 8096
#浜岀淮鐮佽矾寰�
qrpath: D:\qrcode
diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml
index 58c43e9..7c51a51 100644
--- a/ruoyi-admin/src/main/resources/application.yml
+++ b/ruoyi-admin/src/main/resources/application.yml
@@ -18,7 +18,7 @@
# 寮�鍙戠幆澧冮厤缃�
server:
# 鏈嶅姟鍣ㄧ殑HTTP绔彛锛岄粯璁や负8080
- port: 8089
+ port: 8095
servlet:
# 搴旂敤鐨勮闂矾寰�
context-path: /
diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/IPUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/IPUtils.java
new file mode 100644
index 0000000..2eb1f5b
--- /dev/null
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/IPUtils.java
@@ -0,0 +1,52 @@
+package com.ruoyi.common.utils;
+
+import java.net.InetAddress;
+import java.net.NetworkInterface;
+import java.net.SocketException;
+import java.net.UnknownHostException;
+import java.util.Enumeration;
+
+public class IPUtils {
+
+ public static String getIp() {
+ try {
+ // 鑾峰彇鎵�鏈夌綉缁滄帴鍙�
+ Enumeration<NetworkInterface> networkInterfaces = NetworkInterface.getNetworkInterfaces();
+
+ while (networkInterfaces.hasMoreElements()) {
+ NetworkInterface networkInterface = networkInterfaces.nextElement();
+ // 鑾峰彇姣忎釜缃戠粶鎺ュ彛鐨勬墍鏈塈P鍦板潃
+ Enumeration<InetAddress> inetAddresses = networkInterface.getInetAddresses();
+ while (inetAddresses.hasMoreElements()) {
+ InetAddress inetAddress = inetAddresses.nextElement();
+ // 鎵撳嵃IP鍦板潃
+ System.out.println("IP address: " + inetAddress.getHostAddress());
+ return inetAddress.getHostAddress();
+ }
+ }
+ } catch (SocketException e) {
+ e.printStackTrace();
+
+ }
+ return null;
+ }
+
+ public static String getIp2() {
+ try {
+ // 鑾峰彇鏈湴涓绘満
+ InetAddress localhost = InetAddress.getLocalHost();
+ System.out.println("鏈満鍚嶇О: " + localhost.getHostName());
+ System.out.println("鏈満 IP 鍦板潃: " + localhost.getHostAddress());
+
+ // 鑾峰彇鎵�鏈変笌鏈湴涓绘満鍏宠仈鐨� IP 鍦板潃
+ InetAddress[] allLocalAddresses = InetAddress.getAllByName(localhost.getHostName());
+ for (InetAddress address : allLocalAddresses) {
+ System.out.println("鏈満鎵�鏈� IP 鍦板潃: " + address.getHostAddress());
+ return address.getHostAddress();
+ }
+ } catch (UnknownHostException e) {
+ e.printStackTrace();
+ }
+ return null;
+ }
+}
diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java
index 4606dd6..1992b25 100644
--- a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java
+++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java
@@ -108,7 +108,7 @@
// 杩囨护璇锋眰
.authorizeRequests()
// 瀵逛簬鐧诲綍login 娉ㄥ唽register 楠岃瘉鐮乧aptchaImage 鍏佽鍖垮悕璁块棶
- .antMatchers("/login", "/register", "/captchaImage", "/qrcode/generateStaticHtml", "/qrcode/getQRcode", "/qrcode/getFormDate", "/chat", "/system/file/admin/uploadFile", "/smartor/dingtalk/sendNotification", "/patient/read/patientInfo", "/socket", "/API_ESB_Service", "/API_ESB_Service/Run", "/magic/web/**", "/smartor/tasksingle/phoneCallBack", "/smartor/robot/callstatus", "/smartor/robot/aidialog", "/smartor/robot/cdrinfo", "/getToken", "/smartor/serviceTask/getScriptInfoByCondition", "/smartor/serviceSubtask/saveQuestionAnswer").permitAll()
+ .antMatchers("/login", "/register", "/captchaImage", "/qrcode/generateStaticHtml", "/qrcode/getQRcode", "/qrcode/getFormDate", "/chat", "/system/file/admin/uploadFile", "/smartor/dingtalk/sendNotification", "/patient/read/patientInfo", "/socket", "/API_ESB_Service", "/API_ESB_Service/Run", "/magic/web/**", "/smartor/tasksingle/phoneCallBack", "/smartor/robot/callstatus", "/smartor/robot/aidialog", "/smartor/robot/cdrinfo", "/getToken", "/smartor/servicetask/getScriptInfoByCondition", "/smartor/serviceSubtask/saveQuestionAnswer").permitAll()
// 闈欐�佽祫婧愶紝鍙尶鍚嶈闂�
.antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll().antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll()
// 闄や笂闈㈠鐨勬墍鏈夎姹傚叏閮ㄩ渶瑕侀壌鏉冭璇�
diff --git a/smartor/src/main/java/com/smartor/common/SendService.java b/smartor/src/main/java/com/smartor/common/SendService.java
index f052206..777f2ee 100644
--- a/smartor/src/main/java/com/smartor/common/SendService.java
+++ b/smartor/src/main/java/com/smartor/common/SendService.java
@@ -8,6 +8,7 @@
import com.smartor.service.DingTalkService;
import com.smartor.service.WeChatService;
import com.smartor.service.impl.BaseSmsaccountServiceImpl;
+import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@@ -20,6 +21,7 @@
/**
* 鍙戦�佹湇鍔″伐鍏风被
*/
+@Slf4j
@Component
public class SendService {
@Autowired
@@ -51,10 +53,11 @@
//涓嬮潰鐨勭煭淇″彂閫侊紝浠呮祴璇�
BaseSmsRequest baseSmsRequest = new BaseSmsRequest();
- baseSmsRequest.setPhoneNumber("13634195431");
+ baseSmsRequest.setPhoneNumber("19157806063");
baseSmsRequest.setTemplateCode("SMS_279456451");
baseSmsRequest.setTemplateParam("{'code':'58965'}");
SendSmsResponseBody sendSmsResponseBody = baseSmsaccountService.sendMsg(baseSmsRequest);
+ log.error(sendSmsResponseBody.message);
if (sendSmsResponseBody.getCode().equals("OK")) {
return true;
}
diff --git a/smartor/src/main/java/com/smartor/service/impl/ServiceTaskServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/ServiceTaskServiceImpl.java
index 12c60fd..b4ca1a8 100644
--- a/smartor/src/main/java/com/smartor/service/impl/ServiceTaskServiceImpl.java
+++ b/smartor/src/main/java/com/smartor/service/impl/ServiceTaskServiceImpl.java
@@ -43,6 +43,10 @@
private PatArchiveMapper patArchiveMapper;
@Autowired
+ private HeLibraryMapper heLibraryMapper;
+
+
+ @Autowired
private IvrLibaTemplateTargetoptionMapper ivrLibaTemplateTargetOptionMapper;
@Autowired
@@ -143,6 +147,7 @@
info = wjInfo(serviceTask, patid);
} else {
//瀹f暀
+ info = xjInfo(serviceTask.getTemplateid());
}
//鍙鎵撳紑浜嗛〉闈紝灏辩畻鎴愬姛
@@ -275,4 +280,12 @@
}
return svyLibTemplateScriptVOS;
}
+
+ private List xjInfo(Long templateId) {
+ HeLibrary heLibrary = heLibraryMapper.selectHeLibraryById(Long.valueOf(templateId));
+ List list = new ArrayList();
+ list.add(heLibrary);
+ return list;
+
+ }
}
--
Gitblit v1.9.3