From 6d51501ca93f5bf46759f851988650477cf32e6c Mon Sep 17 00:00:00 2001 From: liusheng <337615773@qq.com> Date: 星期三, 12 六月 2024 18:02:45 +0800 Subject: [PATCH] 代码提交 --- smartor/src/main/java/com/smartor/service/impl/IvrTaskServiceImpl.java | 17 ++++++++++------- 1 files changed, 10 insertions(+), 7 deletions(-) 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 de011f5..5764701 100644 --- a/smartor/src/main/java/com/smartor/service/impl/IvrTaskServiceImpl.java +++ b/smartor/src/main/java/com/smartor/service/impl/IvrTaskServiceImpl.java @@ -2,16 +2,17 @@ import java.text.SimpleDateFormat; import java.util.*; +import java.util.concurrent.TimeUnit; import com.alibaba.fastjson2.JSON; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; +import com.ruoyi.common.core.redis.RedisCache; import com.ruoyi.common.exception.base.BaseException; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DtoConversionUtils; -import com.ruoyi.common.utils.StringUtils; -import com.smartor.config.RabbitMqCallPhoneConfig; +import org.apache.commons.lang3.StringUtils; import com.smartor.domain.*; import com.smartor.mapper.*; import lombok.extern.slf4j.Slf4j; @@ -46,7 +47,7 @@ private IvrLibaTemplateTargetoptionMapper ivrLibaTemplateTargetOptionMapper; @Autowired - private RabbitMqCallPhoneConfig rabbitMqCallPhoneConfig; + private RedisCache redisCache; /** * 鏌ヨ璇煶浠诲姟 @@ -209,7 +210,7 @@ sendTaskVO.setSendType(ivrTask.getSendType().toString()); } //鍒ゆ柇浠诲姟鏄惁鏄珛鍗冲彂閫� - if (org.apache.commons.lang3.StringUtils.isNotEmpty(sendTaskVO.getSendType()) && sendTaskVO.getSendType().equals("2")) { + if (StringUtils.isNotEmpty(sendTaskVO.getSendType()) && sendTaskVO.getSendType().equals("2")) { IvrTaskcallMQ ivrTaskcallMQ = new IvrTaskcallMQ(); ivrTaskcallMQ.setTaskid(sendTaskVO.getTaskId()); ivrTaskcallMQ.setSendType(sendTaskVO.getSendType()); @@ -221,14 +222,15 @@ ivrTaskcallMQJson = ivrTaskcallMQJson.substring(1, ivrTaskcallMQJson.length() - 1); //绔嬪嵆鍙戦�� - rabbitMqCallPhoneConfig.sendMessage("phone_exchange", "phone.123", ivrTaskcallMQJson, 0L); +// rabbitMqCallPhoneConfig.sendMessage("phone_exchange", "phone.123", ivrTaskcallMQJson, 0L); + redisCache.setCacheObject(ivrTaskcallMQJson, ivrTaskcallMQJson, 1, TimeUnit.SECONDS); //灏嗕换鍔$姸鎬佷慨鏀规垚鎵ц涓� IvrTask ivrTask2 = new IvrTask(); ivrTask2.setTaskid(ivrTask.getTaskid()); ivrTask2.setSendState(2); updateIvrTask(ivrTask2); - } else if (org.apache.commons.lang3.StringUtils.isNotEmpty(sendTaskVO.getSendType()) && sendTaskVO.getSendType().equals("1")) { + } else if (StringUtils.isNotEmpty(sendTaskVO.getSendType()) && sendTaskVO.getSendType().equals("1") || StringUtils.isNotEmpty(sendTaskVO.getSendType()) && sendTaskVO.getSendType().equals("3")) { //鏃堕棿娈靛彂閫� ObjectMapper objectMapper = new ObjectMapper(); if (org.apache.commons.lang3.StringUtils.isNotEmpty(ivrTask.getSendTimeSlot())) { @@ -267,7 +269,8 @@ Long finalMilliseconds = milliseconds; String ivrTaskcallMQJson = JSON.toJSONString(ivrTaskcallMQ); ivrTaskcallMQJson = ivrTaskcallMQJson.substring(1, ivrTaskcallMQJson.length() - 1); - rabbitMqCallPhoneConfig.sendMessage("phone_exchange", "phone.123", ivrTaskcallMQJson, milliseconds); +// rabbitMqCallPhoneConfig.sendMessage("phone_exchange", "phone.123", ivrTaskcallMQJson, milliseconds); + redisCache.setCacheObject(ivrTaskcallMQJson, ivrTaskcallMQJson, milliseconds / 1000, TimeUnit.SECONDS); } //灏嗕换鍔$姸鎬佷慨鏀规垚鎵ц涓� IvrTask ivrTask2 = new IvrTask(); -- Gitblit v1.9.3