From ef81a5cbfbb98974ed1ba54d0e47b7e74a9b96b9 Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期四, 06 六月 2024 15:33:55 +0800
Subject: [PATCH] 代码提交

---
 smartor/src/main/java/com/smartor/service/impl/IvrTaskServiceImpl.java         |    7 +++----
 ruoyi-admin/src/main/resources/application-druid.yml                           |    4 ++--
 smartor/src/main/java/com/smartor/service/impl/IvrTaskTemplateServiceImpl.java |    7 +++++--
 smartor/src/main/java/com/smartor/service/impl/IvrTaskSingleServiceImpl.java   |    6 +++---
 ruoyi-admin/src/main/java/com/ruoyi/web/component/RabbitMqReceiver.java        |    4 ++--
 smartor/src/main/java/com/smartor/domain/IvrTaskTemplateScript.java            |    7 +++++++
 6 files changed, 22 insertions(+), 13 deletions(-)

diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/component/RabbitMqReceiver.java b/ruoyi-admin/src/main/java/com/ruoyi/web/component/RabbitMqReceiver.java
index a179d19..58c5b8c 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/component/RabbitMqReceiver.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/component/RabbitMqReceiver.java
@@ -108,7 +108,7 @@
      */
     @RabbitListener(queues = "task_queue", concurrency = "50")
     public void phoneVisit(String content, Message message, Channel channel) throws IOException {
-        log.error("娑堟伅杩涙潵浜�--------------");
+        System.out.println("娑堟伅杩涙潵浜�----------------");
         IvrTaskcallMQ ivrTaskcallMQ = null;
         try {
             ObjectMapper mapper = new ObjectMapper();
@@ -171,7 +171,7 @@
                             String patid = rsaPublicKeyExample.encryptedData(ivrTaskSingle.getPatid().toString(), pub_key);
                             SendMagParam sendMagParam = new SendMagParam();
                             sendMagParam.setType("4");
-                            sendMagParam.setUrl("192.168.2.10:8099/followvisit/particty?param1=" + taskId + "&param2=" + patid);
+                            sendMagParam.setUrl(req_path + "/followvisit/particty?param1=" + taskId + "&param2=" + patid);
                             sendService.sendMsg(sendMagParam);
                         }
                     } else if (descByCode.equals("鍏紬鍙�")) {
diff --git a/ruoyi-admin/src/main/resources/application-druid.yml b/ruoyi-admin/src/main/resources/application-druid.yml
index c0a2118..b03af05 100644
--- a/ruoyi-admin/src/main/resources/application-druid.yml
+++ b/ruoyi-admin/src/main/resources/application-druid.yml
@@ -1,8 +1,8 @@
 # 鏁版嵁婧愰厤缃�
 spring:
   rabbitmq:
-    host: 116.62.18.175
-    #    host: 192.168.2.8
+    #    host: 116.62.18.175
+    host: 192.168.2.8
     password: guest
     port: 5672
     username: guest
diff --git a/smartor/src/main/java/com/smartor/domain/IvrTaskTemplateScript.java b/smartor/src/main/java/com/smartor/domain/IvrTaskTemplateScript.java
index 2f45668..06d433b 100644
--- a/smartor/src/main/java/com/smartor/domain/IvrTaskTemplateScript.java
+++ b/smartor/src/main/java/com/smartor/domain/IvrTaskTemplateScript.java
@@ -265,4 +265,11 @@
     @ApiModelProperty(value = "闂缁撴灉锛堢粰鈥滃�肩被鍨嬧�濇槸鏂囨湰鎴栬�呮暟鍊肩敤鐨勶級")
     private String questionResult;
 
+    /**
+     * 鏄惁瀛樺湪鎿嶄綔锛�1 鏂板 2淇敼 3鍒犻櫎
+     */
+
+    @ApiModelProperty(value = "鏄惁瀛樺湪鎿嶄綔锛�1 鏂板 2淇敼 3鍒犻櫎")
+    private Integer isoperation;
+
 }
diff --git a/smartor/src/main/java/com/smartor/service/impl/IvrTaskServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/IvrTaskServiceImpl.java
index 8f9b2aa..de011f5 100644
--- a/smartor/src/main/java/com/smartor/service/impl/IvrTaskServiceImpl.java
+++ b/smartor/src/main/java/com/smartor/service/impl/IvrTaskServiceImpl.java
@@ -208,18 +208,18 @@
         if (org.apache.commons.lang3.StringUtils.isEmpty(sendTaskVO.getSendType())) {
             sendTaskVO.setSendType(ivrTask.getSendType().toString());
         }
-        Long ss = ivrTask.getStopState() + 1;
         //鍒ゆ柇浠诲姟鏄惁鏄珛鍗冲彂閫�
         if (org.apache.commons.lang3.StringUtils.isNotEmpty(sendTaskVO.getSendType()) && sendTaskVO.getSendType().equals("2")) {
             IvrTaskcallMQ ivrTaskcallMQ = new IvrTaskcallMQ();
             ivrTaskcallMQ.setTaskid(sendTaskVO.getTaskId());
             ivrTaskcallMQ.setSendType(sendTaskVO.getSendType());
             ivrTaskcallMQ.setTemplateid(ivrTask.getTemplateid().toString());
-            ivrTaskcallMQ.setStopState(ss);
             ivrTaskcallMQ.setPreachform(ivrTask.getPreachform());
+            ivrTaskcallMQ.setStopState(ivrTask.getStopState());
 
             String ivrTaskcallMQJson = JSON.toJSONString(ivrTaskcallMQ);
             ivrTaskcallMQJson = ivrTaskcallMQJson.substring(1, ivrTaskcallMQJson.length() - 1);
+
             //绔嬪嵆鍙戦��
             rabbitMqCallPhoneConfig.sendMessage("phone_exchange", "phone.123", ivrTaskcallMQJson, 0L);
 
@@ -227,7 +227,6 @@
             IvrTask ivrTask2 = new IvrTask();
             ivrTask2.setTaskid(ivrTask.getTaskid());
             ivrTask2.setSendState(2);
-            ivrTask2.setStopState(ss);
             updateIvrTask(ivrTask2);
         } else if (org.apache.commons.lang3.StringUtils.isNotEmpty(sendTaskVO.getSendType()) && sendTaskVO.getSendType().equals("1")) {
             //鏃堕棿娈靛彂閫�
@@ -263,6 +262,7 @@
                     ivrTaskcallMQ.setTemplateid(ivrTask.getTemplateid().toString());
                     ivrTaskcallMQ.setSendTimeslot(list);
                     ivrTaskcallMQ.setStopState(ivrTask.getStopState());
+                    ivrTaskcallMQ.setPreachform(ivrTask.getPreachform());
 
                     Long finalMilliseconds = milliseconds;
                     String ivrTaskcallMQJson = JSON.toJSONString(ivrTaskcallMQ);
@@ -273,7 +273,6 @@
                 IvrTask ivrTask2 = new IvrTask();
                 ivrTask2.setTaskid(ivrTask.getTaskid());
                 ivrTask2.setSendState(2);
-                ivrTask2.setStopState(ss);
                 updateIvrTask(ivrTask2);
             }
         }
diff --git a/smartor/src/main/java/com/smartor/service/impl/IvrTaskSingleServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/IvrTaskSingleServiceImpl.java
index 5718bd1..158c85a 100644
--- a/smartor/src/main/java/com/smartor/service/impl/IvrTaskSingleServiceImpl.java
+++ b/smartor/src/main/java/com/smartor/service/impl/IvrTaskSingleServiceImpl.java
@@ -58,8 +58,6 @@
     private IvrLibaExtemplatescriptMapper ivrLibaExtemplatescriptMapper;
 
 
-
-
     /**
      * 鏌ヨ鍗曚竴浠诲姟锛堥殢璁匡級
      *
@@ -97,6 +95,7 @@
         ivrTaskVO.setShowTimeMorn(ivrTask.getShowTimeMorn());
         ivrTaskVO.setShowTimeNoon(ivrTask.getShowTimeNoon());
         ivrTaskVO.setShowTimeNight(ivrTask.getShowTimeNight());
+        ivrTaskVO.setPreachform(ivrTask.getPreachform());
         String sendTimeSlot = ivrTask.getSendTimeSlot();
         ObjectMapper objectMapper = new ObjectMapper();
         try {
@@ -241,7 +240,9 @@
             //浠诲姟淇敼
             if (ObjectUtils.isNotEmpty(ivrTaskVO.getSendTimeslot()))
                 ivrTask.setSendTimeSlot(JSON.toJSONString(ivrTaskVO.getSendTimeslot()));
+            //淇敼鎿嶄綔锛岄渶瑕佸皢stopState鐘舵��+1
             IvrTask ivrTask1 = ivrTaskService.selectIvrTaskByTaskid(ivrTask.getTaskid());
+            ivrTask.setStopState(ivrTask1.getStopState() + 1);
             ivrTask.setTemplateid(ivrTaskVO.getLibtemplateid());
             ivrTaskService.updateIvrTask(ivrTask);
 
@@ -274,7 +275,6 @@
 
         return integer;
     }
-
 
 
     @Override
diff --git a/smartor/src/main/java/com/smartor/service/impl/IvrTaskTemplateServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/IvrTaskTemplateServiceImpl.java
index bafffe3..a4ca342 100644
--- a/smartor/src/main/java/com/smartor/service/impl/IvrTaskTemplateServiceImpl.java
+++ b/smartor/src/main/java/com/smartor/service/impl/IvrTaskTemplateServiceImpl.java
@@ -94,13 +94,15 @@
 
         //瀵规ā鏉胯瘽鏈拰閫夐」杩涜澶勭悊锛堣瘽鏈〃涓庢寚鏍囪〃杩涜鍚堝苟浜嗭紝锛�
         if (CollectionUtils.isNotEmpty(ivrTaskTemplateVO.getIvrTaskTemplateScriptVOList())) {
+            log.error("ivrTaskTemplateVO.getIvrTaskTemplateScriptVOList()鏄惁鏈夋暟鎹搱锛歿}", ivrTaskTemplateVO.getIvrTaskTemplateScriptVOList());
             for (IvrTaskTemplateScriptVO ivrTaskTemplateScriptVO : ivrTaskTemplateVO.getIvrTaskTemplateScriptVOList()) {
-                if (ivrTaskTemplateScriptVO.getIsoperation() != null && ivrTaskTemplateScriptVO.getIsoperation() == 1) {
+                if (ivrTaskTemplateScriptVO.getIsoperation() != null && ivrTaskTemplateScriptVO.getIsoperation() == 1 || ivrTaskTemplateScriptVO.getIsoperation() == null && ivrTaskTemplateVO.getIsoperation() == 1) {
                     //鏂板
                     IvrTaskTemplateScript ivrTaskTemplateScript = DtoConversionUtils.sourceToTarget(ivrTaskTemplateScriptVO, IvrTaskTemplateScript.class);
                     ivrTaskTemplateScript.setTemplateID(ivrTaskTemplate.getID());
                     ivrTaskTemplateScript.setCreateTime(new Date());
                     ivrTaskTemplateScriptMapper.insertIvrTaskTemplateScript(ivrTaskTemplateScript);
+                    ivrTaskTemplateScript.setIsoperation(1);
                     //瀵归�夐」鐩繘琛屽鐞�
                     dealOption(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList(), ivrTaskTemplateScript, ivrTaskTemplate.getID());
 
@@ -110,6 +112,7 @@
                     ivrTaskTemplateScript.setTemplateID(ivrTaskTemplate.getID());
                     ivrTaskTemplateScript.setUpdateTime(new Date());
                     ivrTaskTemplateScriptMapper.updateIvrTaskTemplateScript(ivrTaskTemplateScript);
+                    ivrTaskTemplateScript.setIsoperation(2);
                     //瀵归�夐」鐩繘琛屽鐞�
                     dealOption(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList(), ivrTaskTemplateScript, ivrTaskTemplate.getID());
 
@@ -232,7 +235,7 @@
         //瀵规ā鏉挎寚鏍囬�夐」杩涜澶勭悊
         if (CollectionUtils.isNotEmpty(ivrTaskTemplateTargetoptionList)) {
             for (IvrTaskTemplateTargetoption ivrTaskTemplateTargetoption : ivrTaskTemplateTargetoptionList) {
-                if (ivrTaskTemplateTargetoption.getIsoperation() != null && ivrTaskTemplateTargetoption.getIsoperation() == 1) {
+                if (ivrTaskTemplateTargetoption.getIsoperation() != null && ivrTaskTemplateTargetoption.getIsoperation() == 1 || ivrTaskTemplateTargetoption.getIsoperation() == null && ivrTaskTemplateScript.getIsoperation() == 1) {
                     //鏂板
                     ivrTaskTemplateTargetoption.setTemplateID(tmpID);
                     ivrTaskTemplateTargetoption.setScriptid(ivrTaskTemplateScript.getID());

--
Gitblit v1.9.3