From 10aaa035f5be0312304d20f022bdb714a8f4900a Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期三, 11 十二月 2024 22:16:23 +0800
Subject: [PATCH] 代码提交
---
ruoyi-admin/src/main/java/com/ruoyi/web/task/PhoneTask.java | 24 ++++++++----------------
1 files changed, 8 insertions(+), 16 deletions(-)
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/task/PhoneTask.java b/ruoyi-admin/src/main/java/com/ruoyi/web/task/PhoneTask.java
index f95bb97..25be19e 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/task/PhoneTask.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/task/PhoneTask.java
@@ -7,39 +7,31 @@
import com.ruoyi.common.utils.uuid.IdUtils;
import com.smartor.common.SendService;
import com.smartor.config.PhoneUtils;
-import com.smartor.config.RabbitMqCallPhoneConfig;
import com.smartor.config.RobotPhoneUtils;
import com.smartor.domain.*;
import com.smartor.domain.robot.RobotData;
import com.smartor.domain.robot.RobotDataConfig;
import com.smartor.domain.robot.RobotIdlenumVO;
import com.smartor.domain.robot.RobotScritpTemplateVO;
-import org.springframework.amqp.core.Message;
-import org.springframework.context.support.ClassPathXmlApplicationContext;
-import org.springframework.stereotype.Component;
import java.util.*;
import java.util.concurrent.TimeUnit;
public class PhoneTask implements Runnable {
- private IvrTaskSingle ivrTaskSingle;
+ private ServiceSubtask ivrTaskSingle;
private List<IvrTaskTemplateScriptVO> ivrTaskTemplateScriptVO;
private RedisCache redisCache;
private IvrTaskTemplateVO ivrTaskTemplateVO;
- private RabbitMqCallPhoneConfig rabbitMqCallPhoneConfig;
- private Message message;
private SendService sendService;
private String phonePath;
private RobotPhoneUtils robotPhoneUtils;
- public PhoneTask(IvrTaskSingle ivrTaskSingle, IvrTaskTemplateVO ivrTaskTemplateVO, RedisCache redisCache, RabbitMqCallPhoneConfig rabbitMqCallPhoneConfig, Message message, SendService sendService, String phonePath, RobotPhoneUtils robotPhoneUtils) {
- this.ivrTaskSingle = DtoConversionUtils.sourceToTarget(ivrTaskSingle, IvrTaskSingle.class);
+ public PhoneTask(ServiceSubtask ivrTaskSingle, IvrTaskTemplateVO ivrTaskTemplateVO, RedisCache redisCache, SendService sendService, String phonePath, RobotPhoneUtils robotPhoneUtils) {
+ this.ivrTaskSingle = DtoConversionUtils.sourceToTarget(ivrTaskSingle, ServiceSubtask.class);
this.ivrTaskTemplateScriptVO = DtoConversionUtils.sourceToTarget(ivrTaskTemplateVO.getIvrTaskTemplateScriptVOList(), IvrTaskTemplateScriptVO.class);
this.ivrTaskTemplateVO = DtoConversionUtils.sourceToTarget(ivrTaskTemplateVO, IvrTaskTemplateVO.class);
this.redisCache = redisCache;
- this.rabbitMqCallPhoneConfig = rabbitMqCallPhoneConfig;
- this.message = message;
this.sendService = sendService;
this.phonePath = phonePath;
this.robotPhoneUtils = robotPhoneUtils;
@@ -65,7 +57,7 @@
for (IvrTaskTemplateScriptVO ivrTaskTemplateScriptVO : ivrTaskTemplateScriptVO) {
for (Map<String, String> map : mapList) {
for (String key : map.keySet()) {
- ivrTaskTemplateScriptVO.setQuestionText(ivrTaskTemplateScriptVO.getQuestionText().replace(key, map.get(key)));
+ ivrTaskTemplateScriptVO.setScriptContent(ivrTaskTemplateScriptVO.getScriptContent().replace(key, map.get(key)));
}
}
}
@@ -89,11 +81,11 @@
redisCache.setCacheObject(uuid + "returnQues", returnQues, 120, TimeUnit.MINUTES);
redisCache.setCacheObject(uuid + "ivrTaskTemplateVO", ivrTaskTemplateVO, 120, TimeUnit.MINUTES);
- System.out.println("----------------uuID涓� 锛�" + uuid + " " + ivrTaskSingle.getSendname() + " " + returnQues.getNowQuestion().getQuestionText() + " " + ivrTaskSingle.getPhone());
+ System.out.println("----------------uuID涓� 锛�" + uuid + " " + ivrTaskSingle.getSendname() + " " + returnQues.getNowQuestion().getScriptContent() + " " + ivrTaskSingle.getPhone());
//鍏堝皢璇濇湳鏀惧埌ob_queue闃熷垪涓�
IvrTaskcallPhoneMQ ivrTaskcallPhoneMQ = new IvrTaskcallPhoneMQ();
- ivrTaskcallPhoneMQ.setScript(ivrTaskTemplateVO.getRevisitBefore() + returnQues.getNowQuestion().getQuestionText());
+ ivrTaskcallPhoneMQ.setScript(ivrTaskTemplateVO.getRevisitBefore() + returnQues.getNowQuestion().getScriptContent());
ivrTaskcallPhoneMQ.setType("1");
ivrTaskcallPhoneMQ.setUuid(uuid);
String data = JSON.toJSONString(ivrTaskcallPhoneMQ);
@@ -101,11 +93,11 @@
//璋冪敤鏈哄櫒浜虹數璇濓紝寮�濮嬬數璇�
String ob = phoneUtils.ob("", "", "", "", "", "", "", ivrTaskSingle.getPhone(), uuid, true);
- System.out.println("----------------uuID涓� 锛�" + uuid + " " + ivrTaskSingle.getSendname() + " " + returnQues.getNowQuestion().getQuestionText() + " " + ivrTaskSingle.getPhone() + "----------宸茬粡鎷ㄦ墦");
+ System.out.println("----------------uuID涓� 锛�" + uuid + " " + ivrTaskSingle.getSendname() + " " + returnQues.getNowQuestion().getScriptContent() + " " + ivrTaskSingle.getPhone() + "----------宸茬粡鎷ㄦ墦");
Map<String, String> obMap = objectMapper.readValue(ob, Map.class);
Thread.sleep(1000);
redisCache.setCacheObject(uuid + "state_id", "0", 10, TimeUnit.MINUTES);
- rabbitMqCallPhoneConfig.sendMessage("phone_exchange", "phone.ob1", data, 0L);
+// rabbitMqCallPhoneConfig.sendMessage("phone_exchange", "phone.ob1", data, 0L);
//杩欓噷鍏堟敞閲婏紝state_id,鐢佃瘽閭h竟锛屽彧鑳借繑鍥�6锛屼笉鑳借繑鍥�0锛岃繕闇�瑕佺數璇濋偅杈硅繘琛屼慨鏀癸紝閭h竟淇敼涔嬪悗锛屼笂闈袱琛屽彲鍒犻櫎锛屽皢涓嬮潰鐨勮В寮�娉ㄩ噴
// if (obMap.get("state_id").equals("0")) {
// // 璇存槑鎵撻�氫簡
--
Gitblit v1.9.3