From 24166f2d9ae0bb72f061a38b96a113b1b6e44fbc Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期一, 02 二月 2026 17:17:52 +0800
Subject: [PATCH] 代码提交
---
ruoyi-admin/src/main/java/com/ruoyi/web/component/RedisMqReceiver.java | 167 ++-----------------------------------------------------
1 files changed, 7 insertions(+), 160 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 6e2e9fe..376be54 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
@@ -11,7 +11,7 @@
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.http.HttpUtils;
import com.ruoyi.common.utils.sign.Md5Utils;
-import com.ruoyi.quartz.util.RandomStringGenerator;
+import com.smartor.common.RandomStringGenerator;
import com.smartor.common.SendService;
import com.smartor.config.RobotPhoneUtils;
import com.smartor.domain.*;
@@ -73,16 +73,10 @@
private RedisCache redisCache;
@Autowired
- private RobotPhoneUtils robotPhoneUtils;
-
- @Autowired
private ServiceTaskMapper svyTaskMapper;
@Autowired
private ServiceSubtaskMapper serviceSubtaskMapper;
-
- @Autowired
- private ISvyTaskTemplateService iSvyTaskTemplateService;
@Autowired
private IServiceSubtaskRecordService serviceSubtaskRecordService;
@@ -194,7 +188,6 @@
//濡傛灉contains涓嶄负true,璇存槑褰撳墠鐨勬偅鑰呭凡缁忓彂閫佹垚鍔燂紝鐩存帴寰幆涓嬩竴涓汉灏辫
if (!contains) continue;
}
-
try {
ServiceTask ivrTask = ivrTaskMapper.selectServiceTaskByTaskid(serviceSubtask.getTaskid());
if (ivrTask.getSendState() != null && ivrTask.getSendState() == 3 || ivrTask.getSendState() != null && ivrTask.getSendState() == 4) {
@@ -291,7 +284,6 @@
//鐭俊
//瀵箄rl涓袱涓弬鏁板姞瀵�
RSAPublicKeyExample rsaPublicKeyExample = new RSAPublicKeyExample();
- String taskId = rsaPublicKeyExample.encryptedData(ivrTask1.getTaskid().toString(), pub_key);
for (ServiceSubtask serviceSubtask : selectServiceSubtaskList) {
//鍏堝垽鏂竴涓嬶紝subIds鏄惁涓虹┖锛屽鏋滀笉涓虹┖锛屽彧鎵цsubIds閲岀殑鎮h��
@@ -303,74 +295,23 @@
}
try {
- String patid = rsaPublicKeyExample.encryptedData(serviceSubtask.getPatid().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());
- iServiceOutPathService.insertServiceOutPath(serviceOutPath);
-// sendMagParam.setUrl(ip + ":" + req_path + "/followvisit/particty?param1=" + taskId + "¶m2=" + patid + "¶m5=false");
- //杞垚16杩涘埗
- String format = String.format("%03X", serviceOutPath.getId()) + RandomStringGenerator.generateRandomString();
- serviceOutPath.setRadix(format);
- serviceOutPath.setUpdateTime(new Date());
- iServiceOutPathService.updateServiceOutPath(serviceOutPath);
- sendMagParam.setPhone(serviceSubtask.getPhone());
- sendMagParam.setUrl(ip + ":" + req_path + "/sf?p=" + format);
- sendMagParam.setContent("鎮ㄥソ锛岄個璇锋偍濉啓鍑洪櫌闅忚璋冩煡琛紝璇风偣鍑�" + sendMagParam.getUrl() + " 濉啓銆傛劅璋㈡偍閰嶅悎锛�");
- log.info("888888888888:{}", sendMagParam);
+ sendMagParam.setContent("鎮ㄥソ锛岄個璇锋偍濉啓鍑洪櫌闅忚璋冩煡琛紝璇风偣鍑�" + serviceSubtask.getOutPath() + " 濉啓銆傛劅璋㈡偍閰嶅悎锛�");
} else if (type == 2) {
//闂埜锛堥棶棰橈級
- ServiceOutPath serviceOutPath = new ServiceOutPath();
- serviceOutPath.setParam1(taskId);
- serviceOutPath.setParam2(patid);
-// serviceOutPath.setParam3(URLEncoder.encode(ivrTask1.getTaskName(), StandardCharsets.UTF_8.toString()));
- serviceOutPath.setParam3(ivrTask1.getTaskName());
- serviceOutPath.setCreateTime(new Date());
- iServiceOutPathService.insertServiceOutPath(serviceOutPath);
- String format = String.format("%03X", serviceOutPath.getId()) + RandomStringGenerator.generateRandomString();
- serviceOutPath.setRadix(format);
- serviceOutPath.setUpdateTime(new Date());
- 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(serviceSubtask.getPhone());
- sendMagParam.setUrl(ip + ":" + req_path + "/wt?p=" + format);
- sendMagParam.setContent("鎮ㄥソ锛岄個璇锋偍濉啓鍑洪櫌璋冩煡琛紝璇风偣鍑�" + sendMagParam.getUrl() + " 濉啓銆傛劅璋㈡偍閰嶅悎锛�");
- log.info("鎮ㄥソ锛岄個璇锋偍濉啓鍑洪櫌璋冩煡琛紝璇风偣鍑�,{}", sendMagParam.getUrl());
+ sendMagParam.setContent("鎮ㄥソ锛岄個璇锋偍濉啓鍑洪櫌璋冩煡琛紝璇风偣鍑�" + serviceSubtask.getOutPath() + " 濉啓銆傛劅璋㈡偍閰嶅悎锛�");
} else if (type == 3) {
//瀹f暀
- ServiceOutPath serviceOutPath = new ServiceOutPath();
- serviceOutPath.setParam1(taskId);
- serviceOutPath.setParam2(patid);
-// serviceOutPath.setParam3(URLEncoder.encode(ivrTask1.getTaskName(), StandardCharsets.UTF_8.toString()));
- serviceOutPath.setParam3(ivrTask1.getTaskName());
- serviceOutPath.setCreateTime(new Date());
- iServiceOutPathService.insertServiceOutPath(serviceOutPath);
- String format = String.format("%03X", serviceOutPath.getId()) + RandomStringGenerator.generateRandomString();
- serviceOutPath.setRadix(format);
- serviceOutPath.setUpdateTime(new Date());
- iServiceOutPathService.updateServiceOutPath(serviceOutPath);
-// sendMagParam.setUrl(ip + ":" + req_path + "/outsideChainxj?param1=" + taskId + "¶m2=" + patid + "¶m3=" + URLEncoder.encode(ivrTask1.getTaskName(), StandardCharsets.UTF_8.toString()) + "¶m5=false");
- sendMagParam.setPhone(serviceSubtask.getPhone());
- sendMagParam.setUrl(ip + ":" + req_path + "/xj?p=" + format);
- sendMagParam.setContent("鎮ㄥソ锛岄個璇锋偍濉啓鍑洪櫌瀹f暀璋冩煡琛紝璇风偣鍑�" + sendMagParam.getUrl() + "鏌ョ湅銆傛劅璋㈡偍閰嶅悎锛�");
- log.info("-----------sendMagParam鐨勫�间负锛歿}", sendMagParam);
+ sendMagParam.setContent("鎮ㄥソ锛岄個璇锋偍濉啓鍑洪櫌瀹f暀璋冩煡琛紝璇风偣鍑�" + serviceSubtask.getOutPath() + "鏌ョ湅銆傛劅璋㈡偍閰嶅悎锛�");
}
- //鐭俊杩橀渶瑕佹ā鏉�
-// Map<String, String> req = new HashMap<>();
-// req.put("phone", sendMagParam.getPhone());
-// req.put("content", sendMagParam.getContent());
-// String s = HttpUtil.postJsonRequest(xhsmsPath, new Gson().toJson(req));
- //send_mac锛氱鍚嶅�硷紝=md5(send_source+send_to_mobiles+send_text+绛惧悕缂栫爜)锛�32浣嶅皬鍐�
- String mac = "shuifang" + sendMagParam.getPhone() + sendMagParam.getContent() + "ShuiFang_jjty_20250106";
+
+ String mac = "shuifang" + serviceSubtask.getPhone() + sendMagParam.getContent() + "ShuiFang_jjty_20250106";
StringBuilder strb = new StringBuilder();
- strb.append("send_source=shuifang&send_to_mobiles=" + sendMagParam.getPhone());
+ strb.append("send_source=shuifang&send_to_mobiles=" + serviceSubtask.getPhone());
strb.append("&send_text=" + sendMagParam.getContent());
strb.append("&send_mac=" + Md5Utils.hash(mac));
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddhhmmsszzz"); // 杈撳嚭鏃ユ湡鏍煎紡
@@ -414,7 +355,6 @@
serviceSubtask.setRemark("鐭俊鍙戦�佹垚鍔�");
serviceSubtask.setGuid(uuid);
serviceSubtask.setSendstate(3L);
-// serviceSubtask.setFinishtime(new Date());
serviceSubtaskMapper.updateServiceSubtask(serviceSubtask);
//浠诲姟鍙戦�佽褰�
@@ -455,62 +395,6 @@
sendMagParam.setContent(JSON.toJSONString(map));
sendMagParam.setOpenid(serviceSubtask.getOpenid());
Boolean aBoolean = sendService.sendMsg(sendMagParam);
- String url = null;
-
-//// if (type == 1) {
-//// url = ip + ":" + req_path + "/outsideChain?param1=" + taskId + "¶m2=" + patid + "¶m3=" + URLEncoder.encode(ivrTask1.getTaskName(), StandardCharsets.UTF_8.toString()) + "¶m5=false";
-//// } else if (type == 2) {
-//// url = ip + ":" + req_path + "/outsideChainwt?param1=" + taskId + "¶m2=" + patid + "¶m3=" + URLEncoder.encode(ivrTask1.getTaskName(), StandardCharsets.UTF_8.toString()) + "¶m5=false";
-//// } else if (type == 3) {
-//// url = ip + ":" + req_path + "/outsideChainxj?param1=" + taskId + "¶m2=" + patid + "¶m3=" + URLEncoder.encode(ivrTask1.getTaskName(), StandardCharsets.UTF_8.toString()) + "¶m5=false";
-//// }
-// if (type == 1) {
-// //闅忚
-// ServiceOutPath serviceOutPath = new ServiceOutPath();
-// serviceOutPath.setParam1(taskId);
-// serviceOutPath.setParam2(patid);
-// serviceOutPath.setCreateTime(new Date());
-// iServiceOutPathService.insertServiceOutPath(serviceOutPath);
-// String format = String.format("%03X", serviceOutPath.getId());
-// serviceOutPath.setRadix(format);
-// serviceOutPath.setUpdateTime(new Date());
-// iServiceOutPathService.updateServiceOutPath(serviceOutPath);
-//// sendMagParam.setUrl(ip + ":" + req_path + "/followvisit/particty?param1=" + taskId + "¶m2=" + patid + "¶m5=false");
-// url = ip + ":" + req_path + "/sf?p=" + format;
-// } else if (type == 2) {
-// //闂埜
-// ServiceOutPath serviceOutPath = new ServiceOutPath();
-// serviceOutPath.setParam1(taskId);
-// serviceOutPath.setParam2(patid);
-//// serviceOutPath.setParam3(URLEncoder.encode(ivrTask1.getTaskName(), StandardCharsets.UTF_8.toString()));
-// serviceOutPath.setParam3(ivrTask1.getTaskName());
-// serviceOutPath.setCreateTime(new Date());
-// iServiceOutPathService.insertServiceOutPath(serviceOutPath);
-// String format = String.format("%03X", serviceOutPath.getId());
-// serviceOutPath.setRadix(format);
-// serviceOutPath.setUpdateTime(new Date());
-// iServiceOutPathService.updateServiceOutPath(serviceOutPath);
-//// sendMagParam.setUrl(ip + ":" + req_path + "/outsideChainwt?param1=" + taskId + "¶m2=" + patid + "¶m3=" + URLEncoder.encode(ivrTask1.getTaskName(), StandardCharsets.UTF_8.toString()) + "¶m5=false");
-// url = ip + ":" + req_path + "/wt?p=" + format;
-// } else if (type == 3) {
-// //瀹f暀
-// ServiceOutPath serviceOutPath = new ServiceOutPath();
-// serviceOutPath.setParam1(taskId);
-// serviceOutPath.setParam2(patid);
-//// serviceOutPath.setParam3(URLEncoder.encode(ivrTask1.getTaskName(), StandardCharsets.UTF_8.toString()));
-// serviceOutPath.setParam3(ivrTask1.getTaskName());
-// serviceOutPath.setCreateTime(new Date());
-// iServiceOutPathService.insertServiceOutPath(serviceOutPath);
-// String format = String.format("%03X", serviceOutPath.getId());
-// serviceOutPath.setRadix(format);
-// serviceOutPath.setUpdateTime(new Date());
-// iServiceOutPathService.updateServiceOutPath(serviceOutPath);
-// url = ip + ":" + req_path + "/xj?p=" + format;
-// }
-//
-// String wxCode = getWXCode(serviceSubtask.getSfzh(), url, serviceSubtask.getTaskName(), serviceSubtask.getTaskDesc(), "鏃�");
-// Map<String, Object> map = JSONObject.parseObject(wxCode, Map.class);
-// if (!map.isEmpty()) {
serviceSubtask.setResult("success");
serviceSubtask.setSendstate(3L);
if (aBoolean == false) {
@@ -526,7 +410,6 @@
serviceSubtaskRecordService.insertServiceSubtaskRecord(serviceSubtaskRecord);
continue;
}
-// }
} catch (Exception e) {
ServiceSubtaskRecord serviceSubtaskRecord = new ServiceSubtaskRecord();
serviceSubtaskRecord.setTaskid(serviceSubtask.getTaskid().toString());
@@ -581,7 +464,6 @@
serviceSubtask.setRemark("鍙戦�佸け璐�");
serviceSubtask.setSendstate(5L);
serviceSubtask.setId(id);
-// serviceSubtask.setFinishtime(new Date());
serviceSubtaskMapper.updateServiceSubtask(serviceSubtask);
}
}
@@ -589,41 +471,6 @@
}
- // /**
-// * 鏈哄櫒浜虹涓�鍙ヨ瘽璇煶
-// * concurrency = "50" 骞跺彂鏁颁负50
-// */
-// @RabbitListener(queues = "ob_queue", concurrency = "50")
-// public void obVisit(String content, Message message, Channel channel) throws IOException {
-// try {
-// IvrTaskcallPhoneMQ commonTaskcallMQ = null;
-// ObjectMapper mapper = new ObjectMapper();
-// commonTaskcallMQ = mapper.readValue(content, IvrTaskcallPhoneMQ.class);
-// //鍒ゆ柇鎮h�呮槸鍚﹀凡缁忔帴鐢佃瘽
-// String str = redisCache.getCacheObject(commonTaskcallMQ.getUuid() + "state_id");
-// System.out.println("-----------------" + str);
-// if (StringUtils.isNotEmpty(str) && str.equals("0")) {
-// //鎮h�呭凡缁忔帴鍚簡鐢佃瘽
-// new PhoneUtils().ttsPlayback(commonTaskcallMQ.getScript(), commonTaskcallMQ.getUuid());
-// } else if (StringUtils.isNotEmpty(str) && str.equals("-10")) {
-// //杩欎釜璇存槑,宸茬粡鎵撲簡鎸囧畾閬嶆暟杩樻槸娌℃湁浜烘帴锛屽彲浠ュ皢娑堟伅浠庨槦鍒椾腑绉婚櫎浜�
-// channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
-// return;
-// } else {
-// //杩涜闃熷垪灏鹃儴锛岃繘琛屼笅涓�娆℃牎楠�
-//// channel.basicRecover(false);
-// channel.basicReject(message.getMessageProperties().getDeliveryTag(), true);
-// System.out.println("++++++++++++++++++++++" + str);
-// return;
-// }
-// //閫氱煡 MQ 娑堟伅宸茶鎺ユ敹,鍙互ACK(浠庨槦鍒椾腑鍒犻櫎)浜� 锛堣繖涓渶瑕佹牴鎹笟鍔″啀鍘诲鐞咥CK锛�
-// channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
-// } catch (Exception e) {
-// log.error("============娑堣垂澶辫触,灏濊瘯娑堟伅琛ュ彂鍐嶆娑堣垂!==============");
-// log.error(e.getMessage());
-// channel.basicReject(message.getMessageProperties().getDeliveryTag(), true);
-// }
-// }
private String getKey() {
Map<String, String> map = new HashMap<>();
for (int i = 0; i < 6; i++) {
--
Gitblit v1.9.3