From bb60b5747d5f4b85655a541d4990ec7464497b1b Mon Sep 17 00:00:00 2001 From: liusheng <337615773@qq.com> Date: 星期五, 10 五月 2024 18:18:02 +0800 Subject: [PATCH] 代码提交 --- smartor/src/main/java/com/smartor/mapper/PatWildcardMapper.java | 63 ++ smartor/src/main/java/com/smartor/domain/PatWildcard.java | 48 + smartor/src/main/java/com/smartor/domain/IvrTaskSingle.java | 9 smartor/src/main/java/com/smartor/service/impl/IvrLibaTargetServiceImpl.java | 2 smartor/src/main/java/com/smartor/domain/PatArchive.java | 6 ruoyi-admin/src/main/java/com/ruoyi/web/task/PhoneTask.java | 63 + smartor/src/main/resources/mapper/smartor/SvyLibTopicMapper.xml | 3 ruoyi-ui/src/api/system/dict/type.js | 12 smartor/src/main/java/com/smartor/service/impl/IvrTaskSingleServiceImpl.java | 407 ++++++++------- smartor/src/main/java/com/smartor/domain/IvrTask.java | 13 smartor/src/main/java/com/smartor/domain/PatArchiveVO.java | 6 smartor/src/main/java/com/smartor/config/PhoneUtils.java | 1 smartor/src/main/java/com/smartor/service/impl/PatWildcardServiceImpl.java | 90 +++ smartor/src/main/resources/mapper/smartor/IvrTaskSingleMapper.xml | 29 smartor/src/main/java/com/smartor/domain/PatTaskRelevance.java | 7 smartor/src/main/resources/mapper/smartor/PatWildcardMapper.xml | 92 +++ smartor/src/main/java/com/smartor/common/SendService.java | 36 + smartor/src/main/resources/mapper/smartor/IvrTaskMapper.xml | 25 ruoyi-admin/src/main/java/com/ruoyi/web/task/PhoneTask2.java | 86 +++ smartor/src/main/java/com/smartor/domain/IvrTaskSingleVO.java | 202 +++---- smartor/src/main/java/com/smartor/mapper/IvrTaskMapper.java | 2 ruoyi-ui/src/api/system/config.js | 10 smartor/src/main/resources/mapper/smartor/PatArchiveMapper.xml | 42 ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/IvrTaskSingleController.java | 10 ruoyi-admin/src/main/java/com/ruoyi/web/test/MQTest.java | 27 smartor/src/main/java/com/smartor/domain/IvrTaskVO.java | 9 ruoyi-admin/src/main/java/com/ruoyi/web/component/RabbitMqReceiver.java | 29 + smartor/src/main/java/com/smartor/service/IPatWildcardService.java | 62 ++ ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatWildcardController.java | 98 +++ 29 files changed, 1,057 insertions(+), 432 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 fa8a7ec..13df8de 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 @@ -3,11 +3,16 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import com.ruoyi.common.core.redis.RedisCache; +import com.ruoyi.common.utils.StringUtils; import com.ruoyi.web.task.PhoneTask; +import com.ruoyi.web.task.PhoneTask2; +import com.smartor.common.SendService; import com.smartor.config.RabbitMqConfig; import com.smartor.domain.IvrLibaTemplateVO; +import com.smartor.domain.IvrTask; import com.smartor.domain.IvrTaskSingle; import com.smartor.domain.IvrTaskcallMQ; +import com.smartor.mapper.IvrTaskMapper; import com.smartor.mapper.IvrTaskSingleMapper; import com.smartor.service.IIvrLibaTemplateService; import lombok.extern.slf4j.Slf4j; @@ -34,6 +39,10 @@ private static IvrTaskSingleMapper ivrTaskcallMapper; + private static IvrTaskMapper ivrTaskMapper; + + private static SendService sendService; + private static RedisCache redisCache; // 鍒涘缓鍥哄畾澶у皬鐨勭嚎绋嬫睜 @@ -46,8 +55,18 @@ } @Autowired + public void setSendService(SendService sendService) { + RabbitMqReceiver.sendService = sendService; + } + + @Autowired public void setIvrTaskcallMapper(IvrTaskSingleMapper ivrTaskcallMapper) { RabbitMqReceiver.ivrTaskcallMapper = ivrTaskcallMapper; + } + + @Autowired + public void setIvrTaskMapper(IvrTaskMapper ivrTaskMapper) { + RabbitMqReceiver.ivrTaskMapper = ivrTaskMapper; } @Autowired @@ -100,8 +119,14 @@ List<IvrTaskSingle> ivrTaskcalls = ivrTaskcallMapper.selectIvrTaskcallList(ivrTaskcall); for (IvrTaskSingle ivrTaskcall1 : ivrTaskcalls) { - //閫氳繃澶氱嚎绋嬬殑鏂瑰紡鍘绘墦鐢佃瘽 - executorService.submit(new PhoneTask(ivrTaskcall1, ivrLibaTemplateVO1, redisCache, channel, message)); + IvrTask ivrTask = ivrTaskMapper.selectIvrTaskByTaskid(ivrTaskcall1.getTaskid()); + if (StringUtils.isNotEmpty(ivrTask.getSendState()) && ivrTask.getSendState().equals(3) || StringUtils.isNotEmpty(ivrTask.getSendState()) && ivrTask.getSendState().equals(4)) { + //濡備綍浠诲姟琚�滄殏鍋溾�濇垨鈥滅粓姝⑩�� + break; + } +// //閫氳繃澶氱嚎绋嬬殑鏂瑰紡鍘绘墦鐢佃瘽 +// executorService.submit(new PhoneTask(ivrTaskcall1, ivrLibaTemplateVO1, redisCache, channel, message, sendService)); + new PhoneTask2().runPhone(ivrTaskcall1, ivrLibaTemplateVO1, redisCache, channel, message, sendService); } //閫氱煡 MQ 娑堟伅宸茶鎺ユ敹,鍙互ACK(浠庨槦鍒椾腑鍒犻櫎)浜� 锛堣繖涓渶瑕佹牴鎹笟鍔″啀鍘诲鐞咥CK锛� channel.basicAck(message.getMessageProperties().getDeliveryTag(), false); diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/IvrTaskSingleController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/IvrTaskSingleController.java index f42d2d6..d201967 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/IvrTaskSingleController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/IvrTaskSingleController.java @@ -3,6 +3,8 @@ import com.ruoyi.common.annotation.Log; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.domain.entity.SysUser; +import com.ruoyi.common.core.domain.model.LoginUser; import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.utils.DtoConversionUtils; @@ -76,6 +78,10 @@ @Log(title = "鍗曚竴浠诲姟锛堥殢璁匡級", businessType = BusinessType.INSERT) @PostMapping("/insertOrUpdateTask") public AjaxResult insertOrUpdateHeTask(@RequestBody IvrTaskSingleVO ivrTaskcallVO) { + + LoginUser loginUser = getLoginUser(); + SysUser user = loginUser.getUser(); + ivrTaskcallVO.setCreateBy(user.getNickName()); return toAjax(ivrTaskcallService.insertOrUpdateTask(ivrTaskcallVO)); } @@ -95,7 +101,7 @@ * 浠诲姟鍙戦�佹墽琛� */ @ApiOperation("浠诲姟鍙戦�佹墽琛�") - @PostMapping("/heTaskSend") + @PostMapping("/taskSend") public AjaxResult heTaskSend(@RequestBody IvrTaskSingleVO ivrTaskcallVO) { return toAjax(ivrTaskcallService.heTaskSend(ivrTaskcallVO)); } @@ -106,7 +112,7 @@ @ApiOperation("鐢佃瘽鍥炶皟浠诲姟") @PostMapping("/phoneCallBack") public AjaxResult phoneCallBack(@RequestBody PhoneCallBackVO phoneCallBackVO) { - log.error("鐢佃瘽鍥炶皟浠诲姟鎴愬姛浜嗕笉锛焮}", phoneCallBackVO); +// log.error("鐢佃瘽鍥炶皟浠诲姟鎴愬姛浜嗕笉锛焮}", phoneCallBackVO); ivrTaskcallService.phoneCallBack(phoneCallBackVO); return success(); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatWildcardController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatWildcardController.java new file mode 100644 index 0000000..0a8b6d6 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatWildcardController.java @@ -0,0 +1,98 @@ +package com.ruoyi.web.controller.smartor; + +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.smartor.domain.PatWildcard; +import com.smartor.service.IPatWildcardService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; + +/** + * 鎮h�呬俊鎭�氶厤绗ontroller + * + * @author ruoyi + * @date 2024-05-09 + */ +@RestController +@RequestMapping("/smartor/wildcard") +public class PatWildcardController extends BaseController +{ + @Autowired + private IPatWildcardService patWildcardService; + + /** + * 鏌ヨ鎮h�呬俊鎭�氶厤绗﹀垪琛� + */ + @PreAuthorize("@ss.hasPermi('system:wildcard:list')") + @GetMapping("/list") + public TableDataInfo list(PatWildcard patWildcard) + { + startPage(); + List<PatWildcard> list = patWildcardService.selectPatWildcardList(patWildcard); + return getDataTable(list); + } + + /** + * 瀵煎嚭鎮h�呬俊鎭�氶厤绗﹀垪琛� + */ + @PreAuthorize("@ss.hasPermi('system:wildcard:export')") + @Log(title = "鎮h�呬俊鎭�氶厤绗�", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, PatWildcard patWildcard) + { + List<PatWildcard> list = patWildcardService.selectPatWildcardList(patWildcard); + ExcelUtil<PatWildcard> util = new ExcelUtil<PatWildcard>(PatWildcard.class); + util.exportExcel(response, list, "鎮h�呬俊鎭�氶厤绗︽暟鎹�"); + } + + /** + * 鑾峰彇鎮h�呬俊鎭�氶厤绗﹁缁嗕俊鎭� + */ + @PreAuthorize("@ss.hasPermi('system:wildcard:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(patWildcardService.selectPatWildcardById(id)); + } + + /** + * 鏂板鎮h�呬俊鎭�氶厤绗� + */ + @PreAuthorize("@ss.hasPermi('system:wildcard:add')") + @Log(title = "鎮h�呬俊鎭�氶厤绗�", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody PatWildcard patWildcard) + { + return toAjax(patWildcardService.insertPatWildcard(patWildcard)); + } + + /** + * 淇敼鎮h�呬俊鎭�氶厤绗� + */ + @PreAuthorize("@ss.hasPermi('system:wildcard:edit')") + @Log(title = "鎮h�呬俊鎭�氶厤绗�", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody PatWildcard patWildcard) + { + return toAjax(patWildcardService.updatePatWildcard(patWildcard)); + } + + /** + * 鍒犻櫎鎮h�呬俊鎭�氶厤绗� + */ + @PreAuthorize("@ss.hasPermi('system:wildcard:remove')") + @Log(title = "鎮h�呬俊鎭�氶厤绗�", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(patWildcardService.deletePatWildcardByIds(ids)); + } +} 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 babadc5..d719abf 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 @@ -1,39 +1,37 @@ package com.ruoyi.web.task; -import com.alibaba.fastjson2.JSON; import com.fasterxml.jackson.databind.ObjectMapper; import com.rabbitmq.client.Channel; import com.ruoyi.common.core.redis.RedisCache; +import com.ruoyi.common.utils.DtoConversionUtils; import com.ruoyi.common.utils.uuid.IdUtils; +import com.smartor.common.SendService; import com.smartor.config.PhoneUtils; -import com.smartor.domain.IvrLibaTemplateScriptVO; -import com.smartor.domain.IvrLibaTemplateVO; -import com.smartor.domain.IvrTaskSingle; -import com.smartor.domain.QuestionMessage; -import com.smartor.mapper.IvrTaskSingleMapper; +import com.smartor.domain.*; import org.springframework.amqp.core.Message; +import org.springframework.data.convert.Jsr310Converters; -import java.io.IOException; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.concurrent.TimeUnit; public class PhoneTask implements Runnable { - private IvrTaskSingle ivrTaskcall; + private IvrTaskSingle ivrTaskSingle; private List<IvrLibaTemplateScriptVO> ivrLibaTemplateScriptVO; private RedisCache redisCache; private IvrLibaTemplateVO ivrLibaTemplateVO; private Channel channel; private Message message; + private SendService sendService; - public PhoneTask(IvrTaskSingle ivrTaskcall, IvrLibaTemplateVO ivrLibaTemplateVO, RedisCache redisCache, Channel channel, Message message) { - this.ivrTaskcall = ivrTaskcall; - this.ivrLibaTemplateScriptVO = ivrLibaTemplateVO.getIvrLibaTemplateScriptVOList(); - this.ivrLibaTemplateVO = ivrLibaTemplateVO; + + public PhoneTask(IvrTaskSingle ivrTaskSingle, IvrLibaTemplateVO ivrLibaTemplateVO, RedisCache redisCache, Channel channel, Message message, SendService sendService) { + this.ivrTaskSingle = DtoConversionUtils.sourceToTarget(ivrTaskSingle, IvrTaskSingle.class); + this.ivrLibaTemplateScriptVO = DtoConversionUtils.sourceToTarget(ivrLibaTemplateVO.getIvrLibaTemplateScriptVOList(), IvrLibaTemplateScriptVO.class); + this.ivrLibaTemplateVO = DtoConversionUtils.sourceToTarget(ivrLibaTemplateVO, IvrLibaTemplateVO.class); this.redisCache = redisCache; this.channel = channel; this.message = message; + this.sendService = sendService; } @Override @@ -42,9 +40,26 @@ try { //鑾峰彇鐢佃瘽缁勶紝鏌ョ湅鍝簺鐢佃瘽鍙互浣跨敤 PhoneUtils phoneUtils = new PhoneUtils(); - String uuid = IdUtils.randomUUID(); + final String uuid = IdUtils.randomUUID(); + //鑾峰彇鎵�鏈夌殑鈥滈�氶厤绗︹�濋敭鍊煎 + ObjectMapper objectMapper = new ObjectMapper(); + Map<String, Map<String, String>> ivrTaskSingleMmap = objectMapper.readValue(ivrTaskSingle.getTextParam(), Map.class); + List<Map<String, String>> mapList = new ArrayList<>(); + if (!Objects.isNull(ivrTaskSingleMmap)) { + for (Map<String, String> map : ivrTaskSingleMmap.values()) { + mapList.add(map); + } + //灏嗘ā鏉块棶棰樿瘽鏈噷鐨勯�氶厤绗︽浛鎹� + for (IvrLibaTemplateScriptVO ivrLibaTemplateScriptVO : ivrLibaTemplateScriptVO) { + for (Map<String, String> map : mapList) { + for (String key : map.keySet()) { + ivrLibaTemplateScriptVO.setQuestionText(ivrLibaTemplateScriptVO.getQuestionText().replace(key, map.get(key))); + } + } + } + } Map<String, Object> objectMap = new HashMap<>(); - objectMap.put("ivrTaskcall", ivrTaskcall); + objectMap.put("ivrTaskSingle", ivrTaskSingle); objectMap.put("ivrLibaTemplateScriptVO", ivrLibaTemplateScriptVO); //灏嗘暟鎹斁鍒皉edis涓紝鏂逛究鍦ㄥ洖璋冩柟娉曢噷鑾峰彇 redisCache.setCacheObject(uuid, objectMap, 120, TimeUnit.MINUTES); @@ -62,16 +77,18 @@ redisCache.setCacheObject(uuid + "returnQues", returnQues, 120, TimeUnit.MINUTES); redisCache.setCacheObject(uuid + "ivrLibaTemplateVO", ivrLibaTemplateVO, 120, TimeUnit.MINUTES); + System.out.println("----------------uuID涓� 锛�" + uuid + " " + ivrTaskSingle.getSendname() + " " + returnQues.getNowQuestion().getQuestionText() + " " + ivrTaskSingle.getPhone()); + //璋冪敤鏈哄櫒浜虹數璇濓紝寮�濮嬬數璇濓紙闇�瑕佸皢鍥炶皟鏂规硶浼犲叆锛岃繖涓瓑鈥濈數璇濇柟鈥滃憡璇夋�庝箞浼狅紝鐜板湪鍏堢┖鐫�,杩樻湁绗竴鍙ラ棶棰樿瘽鏈級 - String ob = phoneUtils.ob("", "", "", "", "", "", "", ivrTaskcall.getPhone(), uuid, true); + String ob = phoneUtils.ob("", "", "", "", "", "", "", ivrTaskSingle.getPhone(), uuid, true); System.out.println("OB鐨勫�间负锛�" + ob); //閫氫簡涔嬪悗锛岀珛椹幓璋冨紑鍦虹櫧 - phoneUtils.ttsPlayback(ivrLibaTemplateVO.getRevisitBefore()+returnQues.getNowQuestion().getQuestionText(), uuid); + System.out.println("闂鐨勫�间负锛�" + returnQues.getNowQuestion().getQuestionText() + " " + uuid); + phoneUtils.ttsPlayback(ivrLibaTemplateVO.getRevisitBefore() + returnQues.getNowQuestion().getQuestionText(), uuid); - //閫氱煡 MQ 娑堟伅宸茶鎺ユ敹,鍙互ACK(浠庨槦鍒椾腑鍒犻櫎)浜� 锛堣繖涓渶瑕佹牴鎹笟鍔″啀鍘诲鐞咥CK锛� - - channel.basicAck(message.getMessageProperties().getDeliveryTag(), false); - } catch (IOException e) { +// //閫氱煡 MQ 娑堟伅宸茶鎺ユ敹,鍙互ACK(浠庨槦鍒椾腑鍒犻櫎)浜� 锛堣繖涓渶瑕佹牴鎹笟鍔″啀鍘诲鐞咥CK锛� +// channel.basicAck(message.getMessageProperties().getDeliveryTag(), false); + } catch (Exception e) { e.printStackTrace(); } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/task/PhoneTask2.java b/ruoyi-admin/src/main/java/com/ruoyi/web/task/PhoneTask2.java new file mode 100644 index 0000000..1daa520 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/task/PhoneTask2.java @@ -0,0 +1,86 @@ +package com.ruoyi.web.task; + +import com.fasterxml.jackson.databind.ObjectMapper; +import com.rabbitmq.client.Channel; +import com.ruoyi.common.core.redis.RedisCache; +import com.ruoyi.common.utils.uuid.IdUtils; +import com.smartor.common.SendService; +import com.smartor.config.PhoneUtils; +import com.smartor.domain.IvrLibaTemplateScriptVO; +import com.smartor.domain.IvrLibaTemplateVO; +import com.smartor.domain.IvrTaskSingle; +import com.smartor.domain.QuestionMessage; +import org.springframework.amqp.core.Message; + +import java.util.*; +import java.util.concurrent.TimeUnit; + +public class PhoneTask2 { +// private IvrTaskSingle ivrTaskSingle; +// private List<IvrLibaTemplateScriptVO> ivrLibaTemplateScriptVO; +// private RedisCache redisCache; +// private IvrLibaTemplateVO ivrLibaTemplateVO; +// private Channel channel; +// private Message message; +// private SendService sendService; + + + public void runPhone(IvrTaskSingle ivrTaskSingle, IvrLibaTemplateVO ivrLibaTemplateVO, RedisCache redisCache, Channel channel, Message message, SendService sendService) { + + try { + //鑾峰彇鐢佃瘽缁勶紝鏌ョ湅鍝簺鐢佃瘽鍙互浣跨敤 + PhoneUtils phoneUtils = new PhoneUtils(); + String uuid = IdUtils.randomUUID(); + //鑾峰彇鎵�鏈夌殑鈥滈�氶厤绗︹�濋敭鍊煎 + ObjectMapper objectMapper = new ObjectMapper(); + Map<String, Map<String, String>> ivrTaskSingleMmap = objectMapper.readValue(ivrTaskSingle.getTextParam(), Map.class); + List<Map<String, String>> mapList = new ArrayList<>(); + if (!Objects.isNull(ivrTaskSingleMmap)) { + for (Map<String, String> map : ivrTaskSingleMmap.values()) { + mapList.add(map); + } + //灏嗘ā鏉块棶棰樿瘽鏈噷鐨勯�氶厤绗︽浛鎹� + for (IvrLibaTemplateScriptVO ivrLibaTemplateScriptVO : ivrLibaTemplateVO.getIvrLibaTemplateScriptVOList()) { + for (Map<String, String> map : mapList) { + for (String key : map.keySet()) { + ivrLibaTemplateScriptVO.setQuestionText(ivrLibaTemplateScriptVO.getQuestionText().replace(key, map.get(key))); + } + } + } + } + Map<String, Object> objectMap = new HashMap<>(); + objectMap.put("ivrTaskSingle", ivrTaskSingle); + objectMap.put("ivrLibaTemplateScriptVO", ivrLibaTemplateVO.getIvrLibaTemplateScriptVOList()); + //灏嗘暟鎹斁鍒皉edis涓紝鏂逛究鍦ㄥ洖璋冩柟娉曢噷鑾峰彇 + redisCache.setCacheObject(uuid, objectMap, 120, TimeUnit.MINUTES); + + //璁板綍棣栨闂 + QuestionMessage returnQues = new QuestionMessage(); + returnQues.setKcb(ivrLibaTemplateVO.getRevisitBefore()); + for (IvrLibaTemplateScriptVO ivrLibaTemplateScriptVO : ivrLibaTemplateVO.getIvrLibaTemplateScriptVOList()) { + if (ivrLibaTemplateScriptVO.getTargetid() == ivrLibaTemplateVO.getFirstQuestionNum().intValue()) { + returnQues.setNowQuestion(ivrLibaTemplateScriptVO); + } + } + returnQues.setQuestionList(ivrLibaTemplateVO.getIvrLibaTemplateScriptVOList()); + //灏嗛棶棰橈紝鍜屾ā鏉夸俊鎭斁鍒皉edis涓� + redisCache.setCacheObject(uuid + "returnQues", returnQues, 120, TimeUnit.MINUTES); + redisCache.setCacheObject(uuid + "ivrLibaTemplateVO", ivrLibaTemplateVO, 120, TimeUnit.MINUTES); + + System.out.println("----------------uuID涓� 锛�" + uuid + " " + ivrTaskSingle.getSendname() + " " + returnQues.getNowQuestion().getQuestionText() + " " + ivrTaskSingle.getPhone()); + + //璋冪敤鏈哄櫒浜虹數璇濓紝寮�濮嬬數璇濓紙闇�瑕佸皢鍥炶皟鏂规硶浼犲叆锛岃繖涓瓑鈥濈數璇濇柟鈥滃憡璇夋�庝箞浼狅紝鐜板湪鍏堢┖鐫�,杩樻湁绗竴鍙ラ棶棰樿瘽鏈級 + String ob = phoneUtils.ob("", "", "", "", "", "", "", ivrTaskSingle.getPhone(), uuid, true); + System.out.println("OB鐨勫�间负锛�" + ob); + //閫氫簡涔嬪悗锛岀珛椹幓璋冨紑鍦虹櫧 + System.out.println("闂鐨勫�间负锛�" + returnQues.getNowQuestion().getQuestionText() + " " + uuid); + phoneUtils.ttsPlayback(ivrLibaTemplateVO.getRevisitBefore() + returnQues.getNowQuestion().getQuestionText(), uuid); + +// //閫氱煡 MQ 娑堟伅宸茶鎺ユ敹,鍙互ACK(浠庨槦鍒椾腑鍒犻櫎)浜� 锛堣繖涓渶瑕佹牴鎹笟鍔″啀鍘诲鐞咥CK锛� +// channel.basicAck(message.getMessageProperties().getDeliveryTag(), false); + } catch (Exception e) { + e.printStackTrace(); + } + + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/test/MQTest.java b/ruoyi-admin/src/main/java/com/ruoyi/web/test/MQTest.java index 07f6726..0bc2d96 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/test/MQTest.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/test/MQTest.java @@ -1,13 +1,12 @@ package com.ruoyi.web.test; -import com.smartor.config.RabbitMqConfig; +import com.ruoyi.web.task.PhoneTask; import org.junit.Test; import org.springframework.amqp.rabbit.core.RabbitTemplate; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.core.SpringVersion; -import java.util.regex.Matcher; -import java.util.regex.Pattern; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; //@SpringBootTest //@RunWith(SpringRunner.class) @@ -17,14 +16,16 @@ @Test public void testSend() { - - - Pattern pattern = Pattern.compile("(?=.*(?:杩樿|鎸哄ソ|鍙互|涓嶉敊)).*$"); - Matcher matcher = pattern.matcher("杩樿鍚э紝灏辨槸杩樻湁鐐圭柤"); - System.out.println(matcher.matches()); - System.out.println("Spring Framework鐗堟湰锛�" + SpringVersion.getVersion()); -// rabbitTemplate.convertAndSend(RabbitMqConfig.EXCHANGE_NAME, "phone.001", "娴嬭瘯鏁版嵁001"); -// rabbitTemplate.convertAndSend(RabbitMqConfig.EXCHANGE_NAME, "phone.002", "娴嬭瘯鏁版嵁002"); -// rabbitTemplate.convertAndSend(RabbitMqConfig.EXCHANGE_NAME, "phone.003", "娴嬭瘯鏁版嵁003"); + String str = "absdf"; + String c = Character.toUpperCase(str.charAt(0)) + str.substring(1); + System.out.println(c); + "鎮ㄥソ锛屾垜鏄禉浜屽尰闄㈠紶鍖荤敓锛屾偍鏄�${name}鍚楋紵杩樻槸瀹跺睘?".replaceAll("$$*variable", "AA"); +// Pattern pattern = Pattern.compile("^(?!.*(濂絴澶ソ)).*$"); +// Matcher matcher = pattern.matcher("鐫$湢涓嶅ソ"); +// System.out.println(matcher.matches()); + // 鍒涘缓鍥哄畾澶у皬鐨勭嚎绋嬫睜 +// ExecutorService executorService = Executors.newFixedThreadPool(10); +// +// executorService.submit(new PhoneTask()); } } diff --git a/ruoyi-ui/src/api/system/config.js b/ruoyi-ui/src/api/system/config.js index a404d82..9d651fe 100644 --- a/ruoyi-ui/src/api/system/config.js +++ b/ruoyi-ui/src/api/system/config.js @@ -28,7 +28,7 @@ // 鏂板鍙傛暟閰嶇疆 export function addConfig(data) { return request({ - url: '/system/config', + url: '/system/config/add', method: 'post', data: data }) @@ -37,8 +37,8 @@ // 淇敼鍙傛暟閰嶇疆 export function updateConfig(data) { return request({ - url: '/system/config', - method: 'put', + url: '/system/config/edit', + method: 'post', data: data }) } @@ -47,7 +47,7 @@ export function delConfig(configId) { return request({ url: '/system/config/' + configId, - method: 'delete' + method: 'get' }) } @@ -55,6 +55,6 @@ export function refreshCache() { return request({ url: '/system/config/refreshCache', - method: 'delete' + method: 'get' }) } diff --git a/ruoyi-ui/src/api/system/dict/type.js b/ruoyi-ui/src/api/system/dict/type.js index a7a6e01..14ab7b8 100644 --- a/ruoyi-ui/src/api/system/dict/type.js +++ b/ruoyi-ui/src/api/system/dict/type.js @@ -20,7 +20,7 @@ // 鏂板瀛楀吀绫诲瀷 export function addType(data) { return request({ - url: '/system/dict/type', + url: '/system/dict/type/add', method: 'post', data: data }) @@ -29,8 +29,8 @@ // 淇敼瀛楀吀绫诲瀷 export function updateType(data) { return request({ - url: '/system/dict/type', - method: 'put', + url: '/system/dict/type/edit', + method: 'post', data: data }) } @@ -39,7 +39,7 @@ export function delType(dictId) { return request({ url: '/system/dict/type/' + dictId, - method: 'delete' + method: 'get' }) } @@ -47,7 +47,7 @@ export function refreshCache() { return request({ url: '/system/dict/type/refreshCache', - method: 'delete' + method: 'get' }) } @@ -57,4 +57,4 @@ url: '/system/dict/type/optionselect', method: 'get' }) -} \ No newline at end of file +} diff --git a/smartor/src/main/java/com/smartor/common/SendService.java b/smartor/src/main/java/com/smartor/common/SendService.java index 7645456..ebd853b 100644 --- a/smartor/src/main/java/com/smartor/common/SendService.java +++ b/smartor/src/main/java/com/smartor/common/SendService.java @@ -1,13 +1,15 @@ package com.smartor.common; import com.aliyun.dysmsapi20170525.models.SendSmsResponseBody; -import com.smartor.domain.BaseSmsRequest; -import com.smartor.domain.DingTalkReqVo; -import com.smartor.domain.SendMagParam; +import com.smartor.domain.*; +import com.smartor.mapper.PatWildcardMapper; import com.smartor.service.DingTalkService; import com.smartor.service.impl.BaseSmsaccountServiceImpl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; + +import java.lang.reflect.Field; +import java.util.List; /** * 鍙戦�佹湇鍔″伐鍏风被 @@ -19,6 +21,9 @@ @Autowired private DingTalkService dingTalkService; + + @Autowired + private PatWildcardMapper patWildcardMapper; public Boolean sendMsg(SendMagParam sendMagParam) { switch (sendMagParam.getType()) { @@ -57,4 +62,29 @@ } } + + /** + * 瀵归棶棰樹腑鐨勯�氶厤绗﹁繘琛屽尮閰� + * + * @param script + * @param patArchive + * @return + */ + public String patWildcard(String script, PatArchive patArchive) { + List<PatWildcard> patWildcards = patWildcardMapper.selectPatWildcardList(new PatWildcard()); + for (PatWildcard patWildcard : patWildcards) { + try { + //鑾峰彇鎮h�呭搴旂殑瀛楁鐨勫�� + Field field = patArchive.getClass().getField(patWildcard.getPatField()); + field.setAccessible(true); + String value = field.get(patArchive).toString(); + //灏嗛棶棰樹腑鐨勯�氶厤绗﹁繘琛屾浛鎹� + script.replaceAll(patWildcard.getWildcard(), value); + } catch (Exception e) { + e.printStackTrace(); + } + } + + return script; + } } diff --git a/smartor/src/main/java/com/smartor/config/PhoneUtils.java b/smartor/src/main/java/com/smartor/config/PhoneUtils.java index f9ae78a..07a7497 100644 --- a/smartor/src/main/java/com/smartor/config/PhoneUtils.java +++ b/smartor/src/main/java/com/smartor/config/PhoneUtils.java @@ -202,6 +202,7 @@ * @return */ public String ttsPlayback(String fileText, String uuid) { + System.out.println("=====================闂鍐呭锛�" + fileText + "UUID ; " + uuid); Map<String, Object> map = new HashMap<>(); map.put("text", fileText); map.put("uuid", uuid); diff --git a/smartor/src/main/java/com/smartor/domain/IvrTask.java b/smartor/src/main/java/com/smartor/domain/IvrTask.java index 5d2a6e8..9f014bb 100644 --- a/smartor/src/main/java/com/smartor/domain/IvrTask.java +++ b/smartor/src/main/java/com/smartor/domain/IvrTask.java @@ -229,13 +229,13 @@ */ @Excel(name = " 鏄惁鍙戦�� 锛� 0 鏆傚仠鍙戦�� 1 瀹氭椂鍙戦�� 2 绔嬪嵆鍙戦�� ") @ApiModelProperty(value = "鏄惁鍙戦�� 锛� 0 鏆傚仠鍙戦�� 1 瀹氭椂鍙戦�� 2 绔嬪嵆鍙戦�� ") - private Integer isSend; + private Integer sendType; /** * 鍙戦�佺姸鎬侊細 0 澶辫触 1鎴愬姛 */ - @Excel(name = " 鍙戦�佺姸鎬侊細 0 澶辫触 1鎴愬姛 ") - @ApiModelProperty(value = "鍙戦�佺姸鎬侊細 0 澶辫触 1鎴愬姛 ") + @Excel(name = " 鍙戦�佺姸鎬侊細 1鍒涘缓 2鎵ц涓� 3 鏆傚仠 4缁堟 5瀹屾垚 ") + @ApiModelProperty(value = "鍙戦�佺姸鎬侊細 1鍒涘缓 2鎵ц涓� 3 鏆傚仠 4缁堟 5瀹屾垚 ") private String sendState; /** @@ -271,5 +271,10 @@ @ApiModelProperty(value = "灏辫瘖缂栧彿锛堝搴旂殑outhospno銆乮nhospno锛�") private String hospno; - + /** + * 浠诲姟鎻忚堪 + */ + @Excel(name = "浠诲姟鎻忚堪") + @ApiModelProperty(value = "浠诲姟鎻忚堪") + private String taskDesc; } diff --git a/smartor/src/main/java/com/smartor/domain/IvrTaskSingle.java b/smartor/src/main/java/com/smartor/domain/IvrTaskSingle.java index 3ef97f7..586d06c 100644 --- a/smartor/src/main/java/com/smartor/domain/IvrTaskSingle.java +++ b/smartor/src/main/java/com/smartor/domain/IvrTaskSingle.java @@ -196,13 +196,6 @@ private String username; /** - * - */ - @Excel(name = " outbounduuid ") - @ApiModelProperty(value = "outbounduuid") - private String outbounduuid; - - /** * 灏辫瘖璁板綍缂栧彿 */ @Excel(name = " 灏辫瘖璁板綍缂栧彿 ") @@ -320,7 +313,7 @@ */ @Excel(name = "搴婂彿") @ApiModelProperty(value = "搴婂彿") - private String badNo; + private String bedNo; /** * 鐤剧梾鍚嶇О diff --git a/smartor/src/main/java/com/smartor/domain/IvrTaskSingleVO.java b/smartor/src/main/java/com/smartor/domain/IvrTaskSingleVO.java index adf02c7..8801654 100644 --- a/smartor/src/main/java/com/smartor/domain/IvrTaskSingleVO.java +++ b/smartor/src/main/java/com/smartor/domain/IvrTaskSingleVO.java @@ -5,8 +5,6 @@ import com.ruoyi.common.core.domain.BaseEntity; import io.swagger.annotations.ApiModelProperty; import lombok.Data; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; import java.util.Date; import java.util.List; @@ -204,12 +202,6 @@ @ApiModelProperty(value = "鐢ㄦ埛鍚�") private String username; - /** - * outbounduuid - */ - @Excel(name = " outbounduuid ") - @ApiModelProperty(value = "outbounduuid") - private String outbounduuid; /** * 灏辫瘖璁板綍缂栧彿 @@ -352,35 +344,35 @@ @ApiModelProperty(value = "鎮h�呬笌鍗曚竴浠诲姟鍏宠仈琛ㄩ泦鍚�") private List<PatTaskRelevance> patTaskRelevances; - /** - * 搴婂彿 - */ - @Excel(name = "搴婂彿") - @ApiModelProperty(value = "搴婂彿") - private Long badNo; - - /** - * 鐤剧梾鍚嶇О - */ - @Excel(name = "鐤剧梾鍚嶇О") - @ApiModelProperty(value = "鐤剧梾鍚嶇О") - private String icdName; - - /** - * 鐥呭巻鍙� - */ - @Excel(name = "鐥呭巻鍙�") - @ApiModelProperty(value = "鐥呭巻鍙�") - private String medicalRecordNo; - - /** - * 瀹f暀鍐呭 - */ - @Excel(name = "瀹f暀鍐呭") - @ApiModelProperty(value = "瀹f暀鍐呭") - private String preachcontent; - - +// /** +// * 搴婂彿 +// */ +// @Excel(name = "搴婂彿") +// @ApiModelProperty(value = "搴婂彿") +// private Long bedNo; +// +// /** +// * 鐤剧梾鍚嶇О +// */ +// @Excel(name = "鐤剧梾鍚嶇О") +// @ApiModelProperty(value = "鐤剧梾鍚嶇О") +// private String icdName; +// +// /** +// * 鐥呭巻鍙� +// */ +// @Excel(name = "鐥呭巻鍙�") +// @ApiModelProperty(value = "鐥呭巻鍙�") +// private String medicalRecordNo; +// +// /** +// * 瀹f暀鍐呭 +// */ +// @Excel(name = "瀹f暀鍐呭") +// @ApiModelProperty(value = "瀹f暀鍐呭") +// private String preachcontent; +// +// /** * 鍙戦�佹椂闂存 */ @@ -401,75 +393,69 @@ @ApiModelProperty(value = "浠诲姟鎻忚堪") private String taskDesc; - - /** - * 闅忚浜� - */ - @Excel(name = " 闅忚浜� ") - @ApiModelProperty(value = "闅忚浜�") - private String operator; - - /** - * 闅忚浜� - */ - @Excel(name = " 闅忚浜虹紪鍙� ") - @ApiModelProperty(value = "闅忚浜虹紪鍙�") - private String operatorNo; - - - /** - * 灏辫瘖缂栧彿锛堝搴旂殑outhospno銆乮nhospno锛� - */ - @Excel(name = " 灏辫瘖缂栧彿锛堝搴旂殑outhospno銆乮nhospno锛� ") - @ApiModelProperty(value = "灏辫瘖缂栧彿锛堝搴旂殑outhospno銆乮nhospno锛�") - private String hospno; - - /** - * 灏辫瘖绫诲瀷锛�1闂ㄨ瘖 2鍑洪櫌锛� - */ - @Excel(name = " 灏辫瘖绫诲瀷锛�1闂ㄨ瘖 2鍑洪櫌 3.涓撶梾锛�") - @ApiModelProperty(value = "灏辫瘖绫诲瀷锛�1闂ㄨ瘖 2鍑洪櫌 3.涓撶梾锛�") - private String hospType; - - /** - * 寰俊 - */ - @Excel(name = " 寰俊") - @ApiModelProperty(value = "寰俊") - private String wechat; - - - /** - * 璇婃柇鍚嶇О - */ - @Excel(name = " 璇婃柇鍚嶇О") - @ApiModelProperty(value = "璇婃柇鍚嶇О") - private String diagname; - - /** - * 绉戝鍚嶇О - */ - @Excel(name = "绉戝鍚嶇О") - @ApiModelProperty(value = "绉戝鍚嶇О") - private String deptname; - - /** - * 灏辫瘖鏃ユ湡 - */ - @Excel(name = " 灏辫瘖鏃ユ湡") - @ApiModelProperty(value = "灏辫瘖鏃ユ湡") - private Date admindate; - - /** - * 鐥呮埧鍙� - */ - @Excel(name = " 鐥呮埧鍙�") - @ApiModelProperty(value = "鐥呮埧鍙�") - private String roomno; - - - @Override - public String toString() { - return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).append("id", getId()).append("sendname", getSendname()).append("phone", getPhone()).append("sex", getSex()).append("age", getAge()).append("sfzh", getSfzh()).append("addr", getAddr()).append("senderdetail", getSenderdetail()).append("type", getType()).append("taskid", getTaskid()).append("templateid", getTemplateid()).append("templatename", getTemplatename()).append("senddate", getSenddate()).append("sendlimitabegin", getSendlimitabegin()).append("sendlimitaend", getSendlimitaend()).append("sendlimitpbegin", getSendlimitpbegin()).append("sendlimitpend", getSendlimitpend()).append("sendlimitnbegin", getSendlimitnbegin()).append("sendlimitnend", getSendlimitnend()).append("sendstate", getSendstate()).append("senduuid", getSenduuid()).append("result", getResult()).append("finishtime", getFinishtime()).append("userid", getUserid()).append("username", getUsername()).append("outbounduuid", getOutbounduuid()).append("recordid", getRecordid()).append("recallcount", getRecallcount()).append("exrecallcount", getExrecallcount()).append("pulltime", getPulltime()).append("bqsms", getBqsms()).append("bhsms", getBhsms()).append("deptcode", getDeptcode()).append("labelstatus", getLabelstatus()).append("delFlag", getDelFlag()).append("updateBy", getUpdateBy()).append("updateTime", getUpdateTime()).append("createBy", getCreateBy()).append("createTime", getCreateTime()).append("isupload", getIsupload()).append("uploadTime", getUploadTime()).append("orgid", getOrgid()).append("pid", getPid()).append("guid", getGuid()).append("textParam", getTextParam()).toString(); - } +// +// /** +// * 闅忚浜� +// */ +// @Excel(name = " 闅忚浜� ") +// @ApiModelProperty(value = "闅忚浜�") +// private String operator; +// +// /** +// * 闅忚浜� +// */ +// @Excel(name = " 闅忚浜虹紪鍙� ") +// @ApiModelProperty(value = "闅忚浜虹紪鍙�") +// private String operatorNo; +// +// +// /** +// * 灏辫瘖缂栧彿锛堝搴旂殑outhospno銆乮nhospno锛� +// */ +// @Excel(name = " 灏辫瘖缂栧彿锛堝搴旂殑outhospno銆乮nhospno锛� ") +// @ApiModelProperty(value = "灏辫瘖缂栧彿锛堝搴旂殑outhospno銆乮nhospno锛�") +// private String hospno; +// +// /** +// * 灏辫瘖绫诲瀷锛�1闂ㄨ瘖 2鍑洪櫌锛� +// */ +// @Excel(name = " 灏辫瘖绫诲瀷锛�1闂ㄨ瘖 2鍑洪櫌 3.涓撶梾锛�") +// @ApiModelProperty(value = "灏辫瘖绫诲瀷锛�1闂ㄨ瘖 2鍑洪櫌 3.涓撶梾锛�") +// private String hospType; +// +// /** +// * 寰俊 +// */ +// @Excel(name = " 寰俊") +// @ApiModelProperty(value = "寰俊") +// private String wechat; +// +// +// /** +// * 璇婃柇鍚嶇О +// */ +// @Excel(name = " 璇婃柇鍚嶇О") +// @ApiModelProperty(value = "璇婃柇鍚嶇О") +// private String diagname; +// +// /** +// * 绉戝鍚嶇О +// */ +// @Excel(name = "绉戝鍚嶇О") +// @ApiModelProperty(value = "绉戝鍚嶇О") +// private String deptname; +// +// /** +// * 灏辫瘖鏃ユ湡 +// */ +// @Excel(name = " 灏辫瘖鏃ユ湡") +// @ApiModelProperty(value = "灏辫瘖鏃ユ湡") +// private Date admindate; +// +// /** +// * 鐥呮埧鍙� +// */ +// @Excel(name = " 鐥呮埧鍙�") +// @ApiModelProperty(value = "鐥呮埧鍙�") +// private String roomno; } diff --git a/smartor/src/main/java/com/smartor/domain/IvrTaskVO.java b/smartor/src/main/java/com/smartor/domain/IvrTaskVO.java index 4a90bd2..385927d 100644 --- a/smartor/src/main/java/com/smartor/domain/IvrTaskVO.java +++ b/smartor/src/main/java/com/smartor/domain/IvrTaskVO.java @@ -21,6 +21,13 @@ private static final long serialVersionUID = 1L; /** + * 浠诲姟鎻忚堪 + */ + @Excel(name = "浠诲姟鎻忚堪") + @ApiModelProperty(value = "浠诲姟鎻忚堪") + private String taskDesc; + + /** * */ private Long taskid; @@ -29,7 +36,7 @@ * */ @Excel(name = " ") - private String taskname; + private String taskName; /** * diff --git a/smartor/src/main/java/com/smartor/domain/PatArchive.java b/smartor/src/main/java/com/smartor/domain/PatArchive.java index d169c2c..fbfa3e8 100644 --- a/smartor/src/main/java/com/smartor/domain/PatArchive.java +++ b/smartor/src/main/java/com/smartor/domain/PatArchive.java @@ -111,7 +111,7 @@ */ @ApiModelProperty("鏉ユ簮") @Excel(name = " 鏉ユ簮 ") - private Long source; + private Long sourcefrom; /** * 寤烘。鏃堕棿 @@ -232,10 +232,10 @@ */ @ApiModelProperty("浼氬憳灞炴��:0闈炰細鍛橈紝1涓�鑸細鍛樸��2閲嶈浼氬憳") @Excel(name = " 浼氬憳灞炴��:0闈炰細鍛橈紝1涓�鑸細鍛樸��2閲嶈浼氬憳 ") - private String membertype; + private String viptype; @Override public String toString() { - return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).append("patid", getPatid()).append("name", getName()).append("sex", getSex()).append("idcardno", getIdcardno()).append("birthdate", getBirthdate()).append("age", getAge()).append("source", getSource()).append("archivetime", getArchivetime()).append("archiveby", getArchiveby()).append("telcode", getTelcode()).append("relativetelcode", getRelativetelcode()).append("idcardtype", getIdcardtype()).append("orgid", getOrgid()).append("openid", getOpenid()).append("delFlag", getDelFlag()).append("updateBy", getUpdateBy()).append("updateTime", getUpdateTime()).append("createBy", getCreateBy()).append("createTime", getCreateTime()).append("isupload", getIsupload()).append("uploadTime", getUploadTime()).toString(); + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).append("patid", getPatid()).append("name", getName()).append("sex", getSex()).append("idcardno", getIdcardno()).append("birthdate", getBirthdate()).append("age", getAge()).append("sourcefrom", getSourcefrom()).append("archivetime", getArchivetime()).append("archiveby", getArchiveby()).append("telcode", getTelcode()).append("relativetelcode", getRelativetelcode()).append("idcardtype", getIdcardtype()).append("orgid", getOrgid()).append("openid", getOpenid()).append("delFlag", getDelFlag()).append("updateBy", getUpdateBy()).append("updateTime", getUpdateTime()).append("createBy", getCreateBy()).append("createTime", getCreateTime()).append("isupload", getIsupload()).append("uploadTime", getUploadTime()).toString(); } } diff --git a/smartor/src/main/java/com/smartor/domain/PatArchiveVO.java b/smartor/src/main/java/com/smartor/domain/PatArchiveVO.java index ce3fbff..b6e8c91 100644 --- a/smartor/src/main/java/com/smartor/domain/PatArchiveVO.java +++ b/smartor/src/main/java/com/smartor/domain/PatArchiveVO.java @@ -71,7 +71,7 @@ */ @ApiModelProperty("鏉ユ簮") @Excel(name = " 鏉ユ簮 ") - private Long source; + private Long sourcefrom; /** * 寤烘。鏃堕棿 @@ -147,8 +147,4 @@ @ApiModelProperty(value = "鏄惁瀛樺湪鎿嶄綔锛�1 鏂板 2淇敼 3鍒犻櫎") private Integer isoperation; - @Override - public String toString() { - return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).append("patid", getPatid()).append("name", getName()).append("sex", getSex()).append("iccardno", getIdcardno()).append("birthdate", getBirthdate()).append("age", getAge()).append("source", getSource()).append("archivetime", getArchivetime()).append("archiveby", getArchiveby()).append("telcode", getTelcode()).append("relativetelcode", getRelativetelcode()).append("iccardtype", getIdcardtype()).append("orgid", getOrgid()).append("openid", getOpenid()).append("delFlag", getDelFlag()).append("updateBy", getUpdateBy()).append("updateTime", getUpdateTime()).append("createBy", getCreateBy()).append("createTime", getCreateTime()).append("isupload", getIsupload()).append("uploadTime", getUploadTime()).toString(); - } } diff --git a/smartor/src/main/java/com/smartor/domain/PatTaskRelevance.java b/smartor/src/main/java/com/smartor/domain/PatTaskRelevance.java index 40a3c2e..e60f263 100644 --- a/smartor/src/main/java/com/smartor/domain/PatTaskRelevance.java +++ b/smartor/src/main/java/com/smartor/domain/PatTaskRelevance.java @@ -183,4 +183,11 @@ @ApiModelProperty(value = "鐥呮埧鍙�") private String roomno; + /** + * 鏂囨湰鍙橀噺鍙傛暟 + */ + @Excel(name = "鏂囨湰鍙橀噺鍙傛暟") + @ApiModelProperty(value = "鏂囨湰鍙橀噺鍙傛暟") + private String textParam; + } diff --git a/smartor/src/main/java/com/smartor/domain/PatWildcard.java b/smartor/src/main/java/com/smartor/domain/PatWildcard.java new file mode 100644 index 0000000..0a73253 --- /dev/null +++ b/smartor/src/main/java/com/smartor/domain/PatWildcard.java @@ -0,0 +1,48 @@ +package com.smartor.domain; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 鎮h�呬俊鎭�氶厤绗﹀璞� pat_wildcard + * + * @author ruoyi + * @date 2024-05-09 + */ +@ApiModel(value = "PatWildcard", description = "鎮h�呬俊鎭�氶厤绗﹀璞�") +@Data +public class PatWildcard extends BaseEntity { + + /** + * 鑷ID + */ + @ApiModelProperty(value = "鑷ID") + private Long id; + + /** + * 閫氶厤绗� + */ + @Excel(name = "閫氶厤绗�") + @ApiModelProperty(value = "閫氶厤绗�") + private String wildcard; + + /** + * 鎮h�呭搴旂殑瀛楁 + */ + @Excel(name = "鎮h�呭搴旂殑瀛楁") + @ApiModelProperty(value = "鎮h�呭搴旂殑瀛楁") + private String patField; + + /** + * 鍒犻櫎鏍囪 + */ + @ApiModelProperty(value = "鍒犻櫎鏍囪") + private String delFlag; + + +} diff --git a/smartor/src/main/java/com/smartor/mapper/IvrTaskMapper.java b/smartor/src/main/java/com/smartor/mapper/IvrTaskMapper.java index 32ab20e..8320b14 100644 --- a/smartor/src/main/java/com/smartor/mapper/IvrTaskMapper.java +++ b/smartor/src/main/java/com/smartor/mapper/IvrTaskMapper.java @@ -2,6 +2,7 @@ import java.util.List; import com.smartor.domain.IvrTask; +import org.apache.ibatis.annotations.Mapper; /** * 璇煶浠诲姟Mapper鎺ュ彛 @@ -9,6 +10,7 @@ * @author smartor * @date 2023-03-24 */ +@Mapper public interface IvrTaskMapper { /** diff --git a/smartor/src/main/java/com/smartor/mapper/PatWildcardMapper.java b/smartor/src/main/java/com/smartor/mapper/PatWildcardMapper.java new file mode 100644 index 0000000..8475ec6 --- /dev/null +++ b/smartor/src/main/java/com/smartor/mapper/PatWildcardMapper.java @@ -0,0 +1,63 @@ +package com.smartor.mapper; + +import com.smartor.domain.PatWildcard; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 鎮h�呬俊鎭�氶厤绗apper鎺ュ彛 + * + * @author ruoyi + * @date 2024-05-09 + */ +@Mapper +public interface PatWildcardMapper { + /** + * 鏌ヨ鎮h�呬俊鎭�氶厤绗� + * + * @param id 鎮h�呬俊鎭�氶厤绗︿富閿� + * @return 鎮h�呬俊鎭�氶厤绗� + */ + public PatWildcard selectPatWildcardById(Long id); + + /** + * 鏌ヨ鎮h�呬俊鎭�氶厤绗﹀垪琛� + * + * @param patWildcard 鎮h�呬俊鎭�氶厤绗� + * @return 鎮h�呬俊鎭�氶厤绗﹂泦鍚� + */ + public List<PatWildcard> selectPatWildcardList(PatWildcard patWildcard); + + /** + * 鏂板鎮h�呬俊鎭�氶厤绗� + * + * @param patWildcard 鎮h�呬俊鎭�氶厤绗� + * @return 缁撴灉 + */ + public int insertPatWildcard(PatWildcard patWildcard); + + /** + * 淇敼鎮h�呬俊鎭�氶厤绗� + * + * @param patWildcard 鎮h�呬俊鎭�氶厤绗� + * @return 缁撴灉 + */ + public int updatePatWildcard(PatWildcard patWildcard); + + /** + * 鍒犻櫎鎮h�呬俊鎭�氶厤绗� + * + * @param id 鎮h�呬俊鎭�氶厤绗︿富閿� + * @return 缁撴灉 + */ + public int deletePatWildcardById(Long id); + + /** + * 鎵归噺鍒犻櫎鎮h�呬俊鎭�氶厤绗� + * + * @param ids 闇�瑕佸垹闄ょ殑鏁版嵁涓婚敭闆嗗悎 + * @return 缁撴灉 + */ + public int deletePatWildcardByIds(Long[] ids); +} diff --git a/smartor/src/main/java/com/smartor/service/IPatWildcardService.java b/smartor/src/main/java/com/smartor/service/IPatWildcardService.java new file mode 100644 index 0000000..210660f --- /dev/null +++ b/smartor/src/main/java/com/smartor/service/IPatWildcardService.java @@ -0,0 +1,62 @@ +package com.smartor.service; + +import com.smartor.domain.PatWildcard; + +import java.util.List; + +/** + * 鎮h�呬俊鎭�氶厤绗ervice鎺ュ彛 + * + * @author ruoyi + * @date 2024-05-09 + */ +public interface IPatWildcardService +{ + /** + * 鏌ヨ鎮h�呬俊鎭�氶厤绗� + * + * @param id 鎮h�呬俊鎭�氶厤绗︿富閿� + * @return 鎮h�呬俊鎭�氶厤绗� + */ + public PatWildcard selectPatWildcardById(Long id); + + /** + * 鏌ヨ鎮h�呬俊鎭�氶厤绗﹀垪琛� + * + * @param patWildcard 鎮h�呬俊鎭�氶厤绗� + * @return 鎮h�呬俊鎭�氶厤绗﹂泦鍚� + */ + public List<PatWildcard> selectPatWildcardList(PatWildcard patWildcard); + + /** + * 鏂板鎮h�呬俊鎭�氶厤绗� + * + * @param patWildcard 鎮h�呬俊鎭�氶厤绗� + * @return 缁撴灉 + */ + public int insertPatWildcard(PatWildcard patWildcard); + + /** + * 淇敼鎮h�呬俊鎭�氶厤绗� + * + * @param patWildcard 鎮h�呬俊鎭�氶厤绗� + * @return 缁撴灉 + */ + public int updatePatWildcard(PatWildcard patWildcard); + + /** + * 鎵归噺鍒犻櫎鎮h�呬俊鎭�氶厤绗� + * + * @param ids 闇�瑕佸垹闄ょ殑鎮h�呬俊鎭�氶厤绗︿富閿泦鍚� + * @return 缁撴灉 + */ + public int deletePatWildcardByIds(Long[] ids); + + /** + * 鍒犻櫎鎮h�呬俊鎭�氶厤绗︿俊鎭� + * + * @param id 鎮h�呬俊鎭�氶厤绗︿富閿� + * @return 缁撴灉 + */ + public int deletePatWildcardById(Long id); +} diff --git a/smartor/src/main/java/com/smartor/service/impl/IvrLibaTargetServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/IvrLibaTargetServiceImpl.java index d851abe..8262bf3 100644 --- a/smartor/src/main/java/com/smartor/service/impl/IvrLibaTargetServiceImpl.java +++ b/smartor/src/main/java/com/smartor/service/impl/IvrLibaTargetServiceImpl.java @@ -237,7 +237,7 @@ matcher2 = pattern2.matcher(ivrLibaTargetVO.getContent()); } if (StringUtils.isNotEmpty(ivrLibaTargetoption.getTargetregex2()) && matcher2.matches() && StringUtils.isNotEmpty(ivrLibaTargetoption.getTargetregex()) && matcher.matches() || StringUtils.isEmpty(ivrLibaTargetoption.getTargetregex2()) && StringUtils.isNotEmpty(ivrLibaTargetoption.getTargetregex()) && matcher.matches()) { - return ivrLibaTargetoption.getOptiondesc(); + return ivrLibaTargetoption.getTargetvalue(); } } 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 1d5c720..5a9142d 100644 --- a/smartor/src/main/java/com/smartor/service/impl/IvrTaskSingleServiceImpl.java +++ b/smartor/src/main/java/com/smartor/service/impl/IvrTaskSingleServiceImpl.java @@ -4,6 +4,8 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import com.google.gson.Gson; +import com.ruoyi.common.core.domain.entity.SysUser; +import com.ruoyi.common.core.domain.model.LoginUser; import com.ruoyi.common.core.redis.RedisCache; import com.ruoyi.common.exception.base.BaseException; import com.ruoyi.common.utils.DateUtils; @@ -49,6 +51,9 @@ private IvrLibaTemplateTargetoptionMapper ivrLibaScriptTargetoptionMapper; @Autowired + private IvrLibaTemplateScriptMapper ivrLibaTemplateScriptMapper; + + @Autowired private IvrTaskVisitResultMapper ivrTaskVisitResultMapper; @Autowired @@ -59,13 +64,6 @@ @Autowired private RabbitTemplate rabbitTemplate; - - - @Autowired - private PatMedOuthospMapper patMedOuthospMapper; - - @Autowired - private PatMedInhospMapper patMedInhospMapper; /** @@ -138,7 +136,7 @@ patTaskRelevance.setPhone(ivrTaskcall1.getPhone()); patTaskRelevance.setAddr(ivrTaskcall1.getAddr()); patTaskRelevance.setDeptName(ivrTaskcall1.getDeptname()); - patTaskRelevance.setBedNo(ivrTaskcall1.getBadNo()); + patTaskRelevance.setBedNo(ivrTaskcall1.getBedNo()); patTaskRelevance.setDiagname(ivrTaskcall1.getDiagname()); patTaskRelevances.add(patTaskRelevance); } @@ -209,7 +207,7 @@ if (ivrTaskcallVO.getIsoperation() != null && ivrTaskcallVO.getIsoperation() == 1) { //寰�浠诲姟琛ㄤ腑锛屾柊澧炰换鍔� IvrTask ivrTask = DtoConversionUtils.sourceToTarget(ivrTaskcallVO, IvrTask.class); - Integer taskId = ivrTaskService.insertIvrTask(ivrTask); + ivrTaskService.insertIvrTask(ivrTask); ivrTaskcallVO.setTaskid(ivrTask.getTaskid().longValue()); //鏂板 @@ -223,7 +221,7 @@ ivrTaskcall.setPhone(patTaskRelevance.getPhone()); ivrTaskcall.setAddr(patTaskRelevance.getAddr()); ivrTaskcall.setCreateTime(DateUtils.getNowDate()); - ivrTaskcall.setTextParam(new Gson().toJson(ivrTaskcallVO.getTextParam())); + ivrTaskcall.setTextParam(new Gson().toJson(patTaskRelevance.getTextParam())); if (CollectionUtils.isNotEmpty(ivrTaskcallVO.getSendTimeslot())) { ivrTaskcall.setSendTimeSlot(ivrTaskcallVO.getSendTimeslot().toString()); } @@ -273,7 +271,7 @@ @Override public int heTaskSend(IvrTaskSingleVO ivrTaskcallVO) { //鍒ゆ柇浠诲姟鏄惁鏄珛鍗冲彂閫� - if (ivrTaskcallVO.getSendType().equals("2") && ivrTaskcallVO.getSendstate() == 1) { + if (ivrTaskcallVO.getSendType().equals("2")) { IvrTaskcallMQ ivrTaskcallMQ = new IvrTaskcallMQ(); ivrTaskcallMQ.setTaskid(ivrTaskcallVO.getTaskid()); ivrTaskcallMQ.setSendType("1"); @@ -287,7 +285,7 @@ message.getMessageProperties().setHeader("x-delay", 0); return message; }); - } else if (ivrTaskcallVO.getSendType().equals("1") && ivrTaskcallVO.getSendstate() == 1) { + } else if (ivrTaskcallVO.getSendType().equals("1")) { //鏃堕棿娈靛彂閫� if (CollectionUtils.isNotEmpty(ivrTaskcallVO.getSendTimeslot())) { for (TaskSendTimeVO taskSendTimeVO : ivrTaskcallVO.getSendTimeslot()) { @@ -322,6 +320,11 @@ return message; }); } + //灏嗕换鍔$姸鎬佷慨鏀规垚鎵ц涓� + IvrTask ivrTask = new IvrTask(); + ivrTask.setTaskid(ivrTaskcallVO.getTaskid()); + ivrTask.setSendState("2"); + ivrTaskService.updateIvrTask(ivrTask); } } @@ -330,120 +333,168 @@ @Override public void phoneCallBack(PhoneCallBackVO phoneCallBackVO) { - phoneCallBackVO.setTextResult(phoneCallBackVO.getTextResult().substring(0, phoneCallBackVO.getTextResult().length() - 1)); + synchronized (new IvrTaskSingleServiceImpl()) { + phoneCallBackVO.setTextResult(phoneCallBackVO.getTextResult().substring(0, phoneCallBackVO.getTextResult().length() - 1)); + SimpleDateFormat simpleDateFormat1 = new SimpleDateFormat("YYYY-MM-dd HH:mm:ss"); - //鑾峰彇鏁版嵁 - Boolean aBoolean = redisCache.hasKey(phoneCallBackVO.getUuid()); - if (!aBoolean) { - throw new BaseException("璇uid涓嶅瓨鍦�"); - } - Integer hangupValue = redisCache.getCacheObject(phoneCallBackVO.getUuid() + "hangup"); - PhoneUtils phoneUtils = new PhoneUtils(); - if (hangupValue != null && hangupValue == 1) { - log.info("鐢佃瘽瑕佹寕鏂簡"); - //hangupValue == 1 闅忚缁撴潫锛岀洿鎺ュ彲浠ユ寕鐢佃瘽 - phoneUtils.hangup("", "", "", "", "", "", "", phoneCallBackVO.getUuid()); - return; - } - - Map<String, Object> map = redisCache.getCacheObject(phoneCallBackVO.getUuid()); - IvrTaskSingle ivrTaskcall = (IvrTaskSingle) map.get("ivrTaskcall"); - List<IvrLibaTemplateScriptVO> ivrLibaTemplateScriptVOs = (List<IvrLibaTemplateScriptVO>) map.get("ivrLibaTemplateScriptVO"); - //灏唘uid鏇存柊鍒版暟鎹簱涓� - ivrTaskcall.setSenduuid(phoneCallBackVO.getUuid()); - ivrTaskSingleMapper.updateIvrTaskcall(ivrTaskcall); - - //鑾峰彇妯℃澘淇℃伅 - IvrLibaTemplateVO ivrLibaTemplateVO = redisCache.getCacheObject(phoneCallBackVO.getUuid() + "ivrLibaTemplateVO"); - - //璇煶璇嗗埆缁撴灉涓婃姤鎺ュ彛: 3 - Integer noVoice = redisCache.getCacheObject(phoneCallBackVO.getUuid() + "noVoice"); - QuestionMessage returnQues = redisCache.getCacheObject(phoneCallBackVO.getUuid() + "returnQues"); - //灏嗕紶鍥炵殑缁撴灉鏀惧埌鍥炲瀵硅薄涓� - returnQues.setContent(phoneCallBackVO.getTextResult()); - - IvrLibaTemplateScriptVO nowQuestion = returnQues.getNowQuestion(); - - if (StringUtils.isEmpty(returnQues.getContent())) { - //鏃犲洖璇� - //鍒ゆ柇noVoice鏄惁宸茬粡鍒颁簡鏈�澶у�� - if (noVoice == ivrLibaTemplateVO.getNoVoiceNum().intValue()) { - //宸茬粡闂簡瀵瑰簲鐨勯亶鏁帮紝灏卞垽鏂槸鍚﹁繕鏈変笅涓�棰� - if (nowQuestion.getTargetid() == ivrLibaTemplateScriptVOs.size()) { - //娌℃湁涓嬩竴棰樹簡锛屽氨鎸傛柇鐢佃瘽锛屾挱鏀剧粨鏉熻 - redisCache.setCacheObject(phoneCallBackVO.getUuid() + "hangup", 1, 120, TimeUnit.MINUTES); - phoneUtils.ttsPlayback(ivrLibaTemplateVO.getRevisitAfter(), phoneCallBackVO.getUuid()); - return; - } else { - //鏈変笅涓�棰� - redisCache.setCacheObject(phoneCallBackVO.getUuid() + "noVoice", 0, 120, TimeUnit.MINUTES); - IvrLibaTemplateScriptVO nextQuestion = getNextQuestion(ivrLibaTemplateScriptVOs, nowQuestion); - // 闂锛� 鍘昏皟鐢ㄢ�渢ts鍚堟垚鍜屾挱鏀锯�濇帴鍙� - phoneUtils.ttsPlayback(nowQuestion.getQuestionText(), phoneCallBackVO.getUuid()); - } - } else { - redisCache.setCacheObject(phoneCallBackVO.getUuid() + "noVoice", noVoice + 1, 120, TimeUnit.MINUTES); - //璋冪敤ivrLibaTemplateScriptVO涓殑slienceText(闈欓粯璇濇湳) - String slienceText = nowQuestion.getSlienceText(); - //闈欓粯璇濇湳 + 闂锛� 鍘昏皟鐢ㄢ�渢ts鍚堟垚鍜屾挱鏀锯�濇帴鍙� - phoneUtils.ttsPlayback(slienceText + nowQuestion.getQuestionText(), phoneCallBackVO.getUuid()); + //鑾峰彇鏁版嵁 + Boolean aBoolean = redisCache.hasKey(phoneCallBackVO.getUuid()); + if (!aBoolean) { + throw new BaseException("璇uid涓嶅瓨鍦�"); + } + Integer hangupValue = redisCache.getCacheObject(phoneCallBackVO.getUuid() + "hangup"); + PhoneUtils phoneUtils = new PhoneUtils(); + if (hangupValue != null && hangupValue == 1) { + String date = simpleDateFormat1.format(new Date()); + log.info("鐢佃瘽瑕佹寕鏂簡: {}", date); + //hangupValue == 1 闅忚缁撴潫锛岀洿鎺ュ彲浠ユ寕鐢佃瘽 + phoneUtils.hangup("", "", "", "", "", "", "", phoneCallBackVO.getUuid()); return; } - } else { - //isppd鐢ㄦ潵璁板綍鏄惁鍖归厤鍒� - Boolean isppd = false; - //鏈夊洖璇濓紝瀵瑰洖绛旂殑闂,杩涜姝e垯鍖归厤锛堣繖閲屽彧閽堝閫夋嫨棰橈紝鍏跺畠棰樺瀷涓嶈锛� - for (int j = 0; j < nowQuestion.getIvrLibaScriptTargetoptionList().size(); j++) { - //鍖呭惈 - Matcher matcher = null; - if (StringUtils.isNotEmpty(nowQuestion.getIvrLibaScriptTargetoptionList().get(j).getTargetregex())) { - Pattern pattern = Pattern.compile(nowQuestion.getIvrLibaScriptTargetoptionList().get(j).getTargetregex()); - matcher = pattern.matcher(phoneCallBackVO.getTextResult()); + Map<String, Object> map = redisCache.getCacheObject(phoneCallBackVO.getUuid()); + IvrTaskSingle ivrTaskcall = (IvrTaskSingle) map.get("ivrTaskSingle"); + List<IvrLibaTemplateScriptVO> ivrLibaTemplateScriptVOs = (List<IvrLibaTemplateScriptVO>) map.get("ivrLibaTemplateScriptVO"); + //灏唘uid鏇存柊鍒版暟鎹簱涓� + ivrTaskcall.setSenduuid(phoneCallBackVO.getUuid()); + ivrTaskSingleMapper.updateIvrTaskcall(ivrTaskcall); + + //鑾峰彇妯℃澘淇℃伅 + IvrLibaTemplateVO ivrLibaTemplateVO = redisCache.getCacheObject(phoneCallBackVO.getUuid() + "ivrLibaTemplateVO"); + + //璇煶璇嗗埆缁撴灉涓婃姤鎺ュ彛: 3 + Integer noVoice = redisCache.getCacheObject(phoneCallBackVO.getUuid() + "noVoice"); + QuestionMessage returnQues = redisCache.getCacheObject(phoneCallBackVO.getUuid() + "returnQues"); + //灏嗕紶鍥炵殑缁撴灉鏀惧埌鍥炲瀵硅薄涓� + returnQues.setContent(phoneCallBackVO.getTextResult()); + + IvrLibaTemplateScriptVO nowQuestion = returnQues.getNowQuestion(); + + if (StringUtils.isEmpty(returnQues.getContent())) { + //鏃犲洖璇� + //鍒ゆ柇noVoice鏄惁宸茬粡鍒颁簡鏈�澶у�� + if (noVoice == ivrLibaTemplateVO.getNoVoiceNum().intValue()) { + //宸茬粡闂簡瀵瑰簲鐨勯亶鏁帮紝灏卞垽鏂槸鍚﹁繕鏈変笅涓�棰� + if (nowQuestion.getTargetid() == ivrLibaTemplateScriptVOs.size()) { + //娌℃湁涓嬩竴棰樹簡锛屽氨鎸傛柇鐢佃瘽锛屾挱鏀剧粨鏉熻 + redisCache.setCacheObject(phoneCallBackVO.getUuid() + "hangup", 1, 120, TimeUnit.MINUTES); + phoneUtils.ttsPlayback(ivrLibaTemplateVO.getRevisitAfter(), phoneCallBackVO.getUuid()); + return; + } else { + //鏈変笅涓�棰� + redisCache.setCacheObject(phoneCallBackVO.getUuid() + "noVoice", 0, 120, TimeUnit.MINUTES); + IvrLibaTemplateScriptVO nextQuestion = getNextQuestion(ivrLibaTemplateScriptVOs, nowQuestion); + // 闂锛� 鍘昏皟鐢ㄢ�渢ts鍚堟垚鍜屾挱鏀锯�濇帴鍙� + String date = simpleDateFormat1.format(new Date()); + log.info("鍘昏皟鐢╰ts鍚堟垚鍜屾挱鏀炬帴鍙�: {},uuid涓猴細{}", date, phoneCallBackVO.getUuid()); + phoneUtils.ttsPlayback(nowQuestion.getQuestionText(), phoneCallBackVO.getUuid()); + } + } else { + redisCache.setCacheObject(phoneCallBackVO.getUuid() + "noVoice", noVoice + 1, 120, TimeUnit.MINUTES); + //璋冪敤ivrLibaTemplateScriptVO涓殑slienceText(闈欓粯璇濇湳) + String slienceText = nowQuestion.getSlienceText(); + //闈欓粯璇濇湳 + 闂锛� 鍘昏皟鐢ㄢ�渢ts鍚堟垚鍜屾挱鏀锯�濇帴鍙� + String date = simpleDateFormat1.format(new Date()); + log.info("闈欓粯璇濇湳 + 闂,鍘昏皟鐢╰ts鍚堟垚鍜屾挱鏀炬帴鍙�: {},uuid涓猴細{}", date, phoneCallBackVO.getUuid()); + phoneUtils.ttsPlayback(slienceText + nowQuestion.getQuestionText(), phoneCallBackVO.getUuid()); + return; } - //涓嶅寘鍚� - Matcher matcher2 = null; - if (StringUtils.isNotEmpty(nowQuestion.getIvrLibaScriptTargetoptionList().get(j).getTargetregex2())) { - Pattern pattern2 = Pattern.compile(nowQuestion.getIvrLibaScriptTargetoptionList().get(j).getTargetregex2()); - matcher2 = pattern2.matcher(phoneCallBackVO.getTextResult()); + + } else { + //isppd鐢ㄦ潵璁板綍鏄惁鍖归厤鍒� + Boolean isppd = false; + //鏈夊洖璇濓紝瀵瑰洖绛旂殑闂,杩涜姝e垯鍖归厤锛堣繖閲屽彧閽堝閫夋嫨棰橈紝鍏跺畠棰樺瀷涓嶈锛� + for (int j = 0; j < nowQuestion.getIvrLibaScriptTargetoptionList().size(); j++) { + //鍖呭惈 + Matcher matcher = null; + if (StringUtils.isNotEmpty(nowQuestion.getIvrLibaScriptTargetoptionList().get(j).getTargetregex())) { + Pattern pattern = Pattern.compile(nowQuestion.getIvrLibaScriptTargetoptionList().get(j).getTargetregex()); + matcher = pattern.matcher(phoneCallBackVO.getTextResult()); + } + //涓嶅寘鍚� + Matcher matcher2 = null; + if (StringUtils.isNotEmpty(nowQuestion.getIvrLibaScriptTargetoptionList().get(j).getTargetregex2())) { + Pattern pattern2 = Pattern.compile(nowQuestion.getIvrLibaScriptTargetoptionList().get(j).getTargetregex2()); + matcher2 = pattern2.matcher(phoneCallBackVO.getTextResult()); + } + log.error("PCB--getQuestionText闂涓猴細{},UUID锛歿}", nowQuestion.getQuestionText(), phoneCallBackVO.getUuid()); + if (StringUtils.isNotEmpty(nowQuestion.getIvrLibaScriptTargetoptionList().get(j).getTargetregex2()) && matcher2.matches() && StringUtils.isNotEmpty(nowQuestion.getIvrLibaScriptTargetoptionList().get(j).getTargetregex()) && matcher.matches() || StringUtils.isEmpty(nowQuestion.getIvrLibaScriptTargetoptionList().get(j).getTargetregex()) && StringUtils.isNotEmpty(nowQuestion.getIvrLibaScriptTargetoptionList().get(j).getTargetregex2()) && matcher2.matches() || StringUtils.isEmpty(nowQuestion.getIvrLibaScriptTargetoptionList().get(j).getTargetregex2()) && StringUtils.isNotEmpty(nowQuestion.getIvrLibaScriptTargetoptionList().get(j).getTargetregex()) && matcher.matches()) { + //璇存槑鍖归厤姝g‘浜� + //杩欓噷搴旇鍏堝垽鏂被鍨嬶紝鍘诲啀淇敼锛岃缃甀sUserOperation鏄崟閫夐鐨勬敼娉� + nowQuestion.getIvrLibaScriptTargetoptionList().get(j).setIsUserOperation(true); + ivrLibaScriptTargetoptionMapper.updateIvrLibaTemplateTargetoption(nowQuestion.getIvrLibaScriptTargetoptionList().get(j)); + + //灏嗛潤榛樼疆涓�0 + redisCache.setCacheObject(phoneCallBackVO.getUuid() + "noVoice", 0, 120, TimeUnit.MINUTES); + redisCache.setCacheObject(phoneCallBackVO.getUuid() + "mateNum", 0, 120, TimeUnit.MINUTES); + + //灏嗘偅鑰呯殑鍥炵鍐欒繘琛ㄩ噷 + IvrTaskVisitResult ivrTaskVisitResult = DtoConversionUtils.sourceToTarget(ivrTaskcall, IvrTaskVisitResult.class); + ivrTaskVisitResult.setId(null); + ivrTaskVisitResult.setQuestion(nowQuestion.getQuestionText()); + ivrTaskVisitResult.setPatientAnswer(phoneCallBackVO.getTextResult()); + ivrTaskVisitResult.setCreateTime(new Date()); + ivrTaskVisitResult.setOptionResult(nowQuestion.getIvrLibaScriptTargetoptionList().get(j).getTargetvalue()); + ivrTaskVisitResultMapper.insertIvrTaskVisitResult(ivrTaskVisitResult); + + //灏嗗尮閰嶅埌鐨勬爣璇嗘敼鎴恡rue + isppd = true; + + //鑾峰彇涓嬩竴棰� + Integer nextQuestion = nowQuestion.getIvrLibaScriptTargetoptionList().get(j).getNextQuestion(); + for (IvrLibaTemplateScriptVO script : ivrLibaTemplateScriptVOs) { + if (script.getTargetid() == nextQuestion) { + QuestionMessage questionMessage = new QuestionMessage(); + questionMessage.setNowQuestion(script); + questionMessage.setQuestionList(ivrLibaTemplateScriptVOs); + redisCache.setCacheObject(phoneCallBackVO.getUuid() + "returnQues", questionMessage, 120, TimeUnit.MINUTES); + phoneUtils.ttsPlayback(script.getQuestionText(), phoneCallBackVO.getUuid()); + return; + } else if (nextQuestion > ivrLibaTemplateScriptVOs.size()) { + //娌℃湁涓嬩竴棰樹簡锛屽氨缁撴潫浜� + String date = simpleDateFormat1.format(new Date()); + log.error("娌℃湁涓嬩竴棰樹簡锛屽氨缁撴潫浜�: {},uuid涓猴細{}", date, phoneCallBackVO.getUuid()); + redisCache.setCacheObject(phoneCallBackVO.getUuid() + "hangup", 1, 120, TimeUnit.MINUTES); + phoneUtils.ttsPlayback(ivrLibaTemplateVO.getRevisitAfter(), phoneCallBackVO.getUuid()); + try { + Thread.sleep(3000); + } catch (InterruptedException e) { + e.printStackTrace(); + } + phoneUtils.hangup("", "", ivrLibaTemplateVO.getRevisitAfter(), "", "", "", "", phoneCallBackVO.getUuid()); + return; + } + } + return; + } else { + //娌℃湁鍖归厤涓婂綋鍓峯ption + //Targetregex2 涓篺alse锛岃〃绀哄湪Targetregex2涓瓨鍦� 璇彞涓殑鍏抽敭瀛楋紝杩欎釜option灏变笉鐢ㄥ啀缁х画鍖归厤浜嗭紝鐩存帴鍖归厤涓嬩竴涓猳ption + continue; + } } - log.info("phoneCallBack--Targetregex鐨勫�间负锛歿}, phoneCallBack--Targetregex2鐨勫�间负锛歿}", nowQuestion.getIvrLibaScriptTargetoptionList().get(j).getTargetregex(), nowQuestion.getIvrLibaScriptTargetoptionList().get(j).getTargetregex2()); - if (StringUtils.isNotEmpty(nowQuestion.getIvrLibaScriptTargetoptionList().get(j).getTargetregex2()) && matcher2.matches() && StringUtils.isNotEmpty(nowQuestion.getIvrLibaScriptTargetoptionList().get(j).getTargetregex()) && matcher.matches() - || StringUtils.isEmpty(nowQuestion.getIvrLibaScriptTargetoptionList().get(j).getTargetregex()) && StringUtils.isNotEmpty(nowQuestion.getIvrLibaScriptTargetoptionList().get(j).getTargetregex2()) && matcher2.matches() - || StringUtils.isEmpty(nowQuestion.getIvrLibaScriptTargetoptionList().get(j).getTargetregex2()) && StringUtils.isNotEmpty(nowQuestion.getIvrLibaScriptTargetoptionList().get(j).getTargetregex()) && matcher.matches()) { - //璇存槑鍖归厤姝g‘浜� - //杩欓噷搴旇鍏堝垽鏂被鍨嬶紝鍘诲啀淇敼锛岃缃甀sUserOperation鏄崟閫夐鐨勬敼娉� - nowQuestion.getIvrLibaScriptTargetoptionList().get(j).setIsUserOperation(true); - ivrLibaScriptTargetoptionMapper.updateIvrLibaTemplateTargetoption(nowQuestion.getIvrLibaScriptTargetoptionList().get(j)); - //灏嗛潤榛樼疆涓�0 - redisCache.setCacheObject(phoneCallBackVO.getUuid() + "noVoice", 0, 120, TimeUnit.MINUTES); - redisCache.setCacheObject(phoneCallBackVO.getUuid() + "mateNum", 0, 120, TimeUnit.MINUTES); - - //灏嗘偅鑰呯殑鍥炵鍐欒繘琛ㄩ噷 - IvrTaskVisitResult ivrTaskVisitResult = DtoConversionUtils.sourceToTarget(ivrTaskcall, IvrTaskVisitResult.class); - ivrTaskVisitResult.setId(null); - ivrTaskVisitResult.setQuestion(nowQuestion.getQuestionText()); - ivrTaskVisitResult.setPatientAnswer(phoneCallBackVO.getTextResult()); - ivrTaskVisitResult.setCreateTime(new Date()); - ivrTaskVisitResult.setOptionResult(nowQuestion.getIvrLibaScriptTargetoptionList().get(j).getTargetvalue()); - ivrTaskVisitResultMapper.insertIvrTaskVisitResult(ivrTaskVisitResult); - - //灏嗗尮閰嶅埌鐨勬爣璇嗘敼鎴恡rue - isppd = true; - - //鑾峰彇涓嬩竴棰� - Integer nextQuestion = nowQuestion.getIvrLibaScriptTargetoptionList().get(j).getNextQuestion(); - for (IvrLibaTemplateScriptVO script : ivrLibaTemplateScriptVOs) { - if (script.getTargetid() == nextQuestion) { + if (isppd != true) { + //娌℃湁鍖归厤鍒� + Integer mateNum = redisCache.getCacheObject(phoneCallBackVO.getUuid() + "mateNum"); + if (mateNum == null) mateNum = 0; + //鏃犲尮閰嶆鏁板幓鍒ゆ柇鏄惁鍒版渶澶ц闂鏁帮紝骞朵笖鎵�鏈夌殑閫夐」閮藉尮閰嶅畬浜� + if (mateNum == ivrLibaTemplateVO.getMateNum().intValue()) { + //濡傛灉涓嬩竴棰樹负绌�.鍒欐柊鐨勬暟鎹繑鍥�,骞跺姞涓婃劅璋㈣ + if (nowQuestion.getTargetid() < ivrLibaTemplateScriptVOs.size()) { QuestionMessage questionMessage = new QuestionMessage(); - questionMessage.setNowQuestion(script); + IvrLibaTemplateScriptVO nextQuestion = getNextQuestion(ivrLibaTemplateScriptVOs, nowQuestion); questionMessage.setQuestionList(ivrLibaTemplateScriptVOs); + questionMessage.setNowQuestion(nextQuestion); redisCache.setCacheObject(phoneCallBackVO.getUuid() + "returnQues", questionMessage, 120, TimeUnit.MINUTES); - phoneUtils.ttsPlayback(script.getQuestionText(), phoneCallBackVO.getUuid()); + redisCache.setCacheObject(phoneCallBackVO.getUuid() + "mateNum", 0, 120, TimeUnit.MINUTES); + String date = simpleDateFormat1.format(new Date()); + log.info("濡傛灉涓嬩竴棰樹负绌�.鍒欐柊鐨勬暟鎹繑鍥�,骞跺姞涓婃劅璋㈣: {},uuid涓猴細{}", date, phoneCallBackVO.getUuid()); + phoneUtils.ttsPlayback(nextQuestion.getQuestionText(), phoneCallBackVO.getUuid()); return; - } else if (nextQuestion > ivrLibaTemplateScriptVOs.size()) { - //娌℃湁涓嬩竴棰樹簡锛屽氨缁撴潫浜� + } else { + //灏卞彲浠ユ寕鏂數璇濅簡 + String date = simpleDateFormat1.format(new Date()); + log.info("灏卞彲浠ユ寕鏂數璇濅簡------: {},uuid涓猴細{}", date, phoneCallBackVO.getUuid()); redisCache.setCacheObject(phoneCallBackVO.getUuid() + "hangup", 1, 120, TimeUnit.MINUTES); phoneUtils.ttsPlayback(ivrLibaTemplateVO.getRevisitAfter(), phoneCallBackVO.getUuid()); try { @@ -454,94 +505,62 @@ phoneUtils.hangup("", "", ivrLibaTemplateVO.getRevisitAfter(), "", "", "", "", phoneCallBackVO.getUuid()); return; } + } else if (mateNum < ivrLibaTemplateVO.getMateNum().intValue()) { + //娌℃湁闂埌瑙勫畾娆℃暟 + mateNum = mateNum + 1; + redisCache.setCacheObject(phoneCallBackVO.getUuid() + "mateNum", mateNum, 120, TimeUnit.MINUTES); } - return; - } else { - //娌℃湁鍖归厤涓婂綋鍓峯ption - //Targetregex2 涓篺alse锛岃〃绀哄湪Targetregex2涓瓨鍦� 璇彞涓殑鍏抽敭瀛楋紝杩欎釜option灏变笉鐢ㄥ啀缁х画鍖归厤浜嗭紝鐩存帴鍖归厤涓嬩竴涓猳ption - continue; } - } - - if (isppd != true) { - //娌℃湁鍖归厤鍒� - Integer mateNum = redisCache.getCacheObject(phoneCallBackVO.getUuid() + "mateNum"); - if (mateNum == null) mateNum = 0; - //鏃犲尮閰嶆鏁板幓鍒ゆ柇鏄惁鍒版渶澶ц闂鏁帮紝骞朵笖鎵�鏈夌殑閫夐」閮藉尮閰嶅畬浜� - if (mateNum == ivrLibaTemplateVO.getMateNum().intValue()) { - //濡傛灉涓嬩竴棰樹负绌�.鍒欐柊鐨勬暟鎹繑鍥�,骞跺姞涓婃劅璋㈣ - if (nowQuestion.getTargetid() < ivrLibaTemplateScriptVOs.size()) { - QuestionMessage questionMessage = new QuestionMessage(); - IvrLibaTemplateScriptVO nextQuestion = getNextQuestion(ivrLibaTemplateScriptVOs, nowQuestion); - questionMessage.setQuestionList(ivrLibaTemplateScriptVOs); - questionMessage.setNowQuestion(nextQuestion); - redisCache.setCacheObject(phoneCallBackVO.getUuid() + "returnQues", questionMessage, 120, TimeUnit.MINUTES); - redisCache.setCacheObject(phoneCallBackVO.getUuid() + "mateNum", 0, 120, TimeUnit.MINUTES); - phoneUtils.ttsPlayback(nextQuestion.getQuestionText(), phoneCallBackVO.getUuid()); - return; - } else { - //灏卞彲浠ユ寕鏂數璇濅簡 - redisCache.setCacheObject(phoneCallBackVO.getUuid() + "hangup", 1, 120, TimeUnit.MINUTES); - phoneUtils.ttsPlayback(ivrLibaTemplateVO.getRevisitAfter(), phoneCallBackVO.getUuid()); - try { - Thread.sleep(3000); - } catch (InterruptedException e) { - e.printStackTrace(); + //閫夐」鍖归厤瀹屾垚鍚庯紝闇�瑕佸啀鍘婚�氳繃搴撳啀杩涜鍖归厤涓�娆� + String extemplateID = ivrLibaTemplateVO.getSubmoduleID(); + String[] split = extemplateID.split(","); + List<String> list = Arrays.asList(split); + List<Long> list1 = new ArrayList<>(); + if (StringUtils.isNotEmpty(extemplateID)) { + for (String str : list) { + list1.add(Long.valueOf(str)); + } + List<IvrLibaExtemplatescript> ivrLibaExtemplatescripts = ivrLibaExtemplatescriptMapper.queryIvrLibaExtemplatescriptList(list1); + for (IvrLibaExtemplatescript ivrLibaExtemplatescript : ivrLibaExtemplatescripts) { + Matcher matcher = null; + if (StringUtils.isNotEmpty(ivrLibaExtemplatescript.getSelfRegex())) { + Pattern pattern = Pattern.compile(ivrLibaExtemplatescript.getSelfRegex()); + matcher = pattern.matcher(returnQues.getContent()); } - phoneUtils.hangup("", "", ivrLibaTemplateVO.getRevisitAfter(), "", "", "", "", phoneCallBackVO.getUuid()); - return; - } - } else if (mateNum < ivrLibaTemplateVO.getMateNum().intValue()) { - //娌℃湁闂埌瑙勫畾娆℃暟 - mateNum = mateNum + 1; - redisCache.setCacheObject(phoneCallBackVO.getUuid() + "mateNum", mateNum, 120, TimeUnit.MINUTES); - } - } - //閫夐」鍖归厤瀹屾垚鍚庯紝闇�瑕佸啀鍘婚�氳繃搴撳啀杩涜鍖归厤涓�娆� - String extemplateID = ivrLibaTemplateVO.getSubmoduleID(); - String[] split = extemplateID.split(","); - List<String> list = Arrays.asList(split); - List<Long> list1 = new ArrayList<>(); - if (StringUtils.isNotEmpty(extemplateID)) { - for (String str : list) { - list1.add(Long.valueOf(str)); - } - List<IvrLibaExtemplatescript> ivrLibaExtemplatescripts = ivrLibaExtemplatescriptMapper.queryIvrLibaExtemplatescriptList(list1); - for (IvrLibaExtemplatescript ivrLibaExtemplatescript : ivrLibaExtemplatescripts) { - Matcher matcher = null; - if (StringUtils.isNotEmpty(ivrLibaExtemplatescript.getSelfRegex())) { - Pattern pattern = Pattern.compile(ivrLibaExtemplatescript.getSelfRegex()); - matcher = pattern.matcher(returnQues.getContent()); - } - Matcher matcher2 = null; - if (StringUtils.isNotEmpty(ivrLibaExtemplatescript.getSelfRegex2())) { - Pattern pattern2 = Pattern.compile(ivrLibaExtemplatescript.getSelfRegex2()); - matcher2 = pattern2.matcher(returnQues.getContent()); - } - log.info("++++++++++++++++++++++++++閫氱敤搴撴槸鍚︿负绌猴細selfRegex : {} , selfRegex2 : {}", ivrLibaExtemplatescript.getSelfRegex(), ivrLibaExtemplatescript.getSelfRegex2()); - if (StringUtils.isNotEmpty(ivrLibaExtemplatescript.getSelfRegex()) && matcher.matches() && StringUtils.isNotEmpty(ivrLibaExtemplatescript.getSelfRegex2()) && matcher2.matches() || StringUtils.isEmpty(ivrLibaExtemplatescript.getSelfRegex()) && StringUtils.isNotEmpty(ivrLibaExtemplatescript.getSelfRegex2()) && matcher2.matches() || StringUtils.isEmpty(ivrLibaExtemplatescript.getSelfRegex2()) && StringUtils.isNotEmpty(ivrLibaExtemplatescript.getSelfRegex()) && matcher.matches()) { - QuestionMessage questionMessage = redisCache.getCacheObject(phoneCallBackVO.getUuid() + "returnQues"); - IvrLibaTemplateScriptVO ivrLibaTemplateScriptVO = returnQues.getNowQuestion(); - ivrLibaTemplateScriptVO.setSubmoduleText(ivrLibaExtemplatescript.getSwitchText()); - ivrLibaTemplateScriptVO.setSubmoduleVoice(ivrLibaExtemplatescript.getSwitchWav()); - redisCache.setCacheObject(phoneCallBackVO.getUuid() + "returnQues", questionMessage, 120, TimeUnit.MINUTES); - if (ivrLibaExtemplatescript.getIsEnd() == 1) { - //灏嗛棶棰樼疆绌� - IvrLibaTemplateScriptVO nowQuestion1 = questionMessage.getNowQuestion(); - nowQuestion1.setQuestionText(null); - nowQuestion1.setQuestionVoice(null); - questionMessage.setNowQuestion(nowQuestion1); + Matcher matcher2 = null; + if (StringUtils.isNotEmpty(ivrLibaExtemplatescript.getSelfRegex2())) { + Pattern pattern2 = Pattern.compile(ivrLibaExtemplatescript.getSelfRegex2()); + matcher2 = pattern2.matcher(returnQues.getContent()); + } + log.info("++++++++++++++++++++++++++閫氱敤搴撴槸鍚︿负绌猴細selfRegex : {} , selfRegex2 : {}", ivrLibaExtemplatescript.getSelfRegex(), ivrLibaExtemplatescript.getSelfRegex2()); + if (StringUtils.isNotEmpty(ivrLibaExtemplatescript.getSelfRegex()) && matcher.matches() && StringUtils.isNotEmpty(ivrLibaExtemplatescript.getSelfRegex2()) && matcher2.matches() || StringUtils.isEmpty(ivrLibaExtemplatescript.getSelfRegex()) && StringUtils.isNotEmpty(ivrLibaExtemplatescript.getSelfRegex2()) && matcher2.matches() || StringUtils.isEmpty(ivrLibaExtemplatescript.getSelfRegex2()) && StringUtils.isNotEmpty(ivrLibaExtemplatescript.getSelfRegex()) && matcher.matches()) { + QuestionMessage questionMessage = redisCache.getCacheObject(phoneCallBackVO.getUuid() + "returnQues"); + IvrLibaTemplateScriptVO ivrLibaTemplateScriptVO = returnQues.getNowQuestion(); + ivrLibaTemplateScriptVO.setSubmoduleText(ivrLibaExtemplatescript.getSwitchText()); + ivrLibaTemplateScriptVO.setSubmoduleVoice(ivrLibaExtemplatescript.getSwitchWav()); redisCache.setCacheObject(phoneCallBackVO.getUuid() + "returnQues", questionMessage, 120, TimeUnit.MINUTES); + if (ivrLibaExtemplatescript.getIsEnd() == 1) { + //灏嗛棶棰樼疆绌� + IvrLibaTemplateScriptVO nowQuestion1 = questionMessage.getNowQuestion(); + nowQuestion1.setQuestionText(null); + nowQuestion1.setQuestionVoice(null); + questionMessage.setNowQuestion(nowQuestion1); + redisCache.setCacheObject(phoneCallBackVO.getUuid() + "returnQues", questionMessage, 120, TimeUnit.MINUTES); - redisCache.setCacheObject(phoneCallBackVO.getUuid() + "isOver", 1, 120, TimeUnit.MINUTES); + redisCache.setCacheObject(phoneCallBackVO.getUuid() + "isOver", 1, 120, TimeUnit.MINUTES); + } + //璋冪敤鈥�15銆乼ts鍚堟垚鍜屾挱鏀撅紝 tts_playback鈥濆皢缁撴灉浼犲洖 + String date = simpleDateFormat1.format(new Date()); + log.info("璋冪敤鈥�15銆乼ts鍚堟垚鍜屾挱鏀�------: {},uuid涓猴細{}", date, phoneCallBackVO.getUuid()); + phoneUtils.ttsPlayback(nowQuestion.getQuestionText() + ivrLibaTemplateScriptVO.getSubmoduleText(), phoneCallBackVO.getUuid()); } - //璋冪敤鈥�15銆乼ts鍚堟垚鍜屾挱鏀撅紝 tts_playback鈥濆皢缁撴灉浼犲洖 - phoneUtils.ttsPlayback(nowQuestion.getQuestionText() + ivrLibaTemplateScriptVO.getSubmoduleText(), phoneCallBackVO.getUuid()); + break; } - break; + String date = simpleDateFormat1.format(new Date()); + log.info("鏈�鍚庣殑淇℃伅鍥炲-: {},uuid涓猴細{}", date, phoneCallBackVO.getUuid()); + phoneUtils.ttsPlayback(nowQuestion.getQuestionText(), phoneCallBackVO.getUuid()); } - phoneUtils.ttsPlayback(nowQuestion.getQuestionText(), phoneCallBackVO.getUuid()); } } } diff --git a/smartor/src/main/java/com/smartor/service/impl/PatWildcardServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/PatWildcardServiceImpl.java new file mode 100644 index 0000000..0893d06 --- /dev/null +++ b/smartor/src/main/java/com/smartor/service/impl/PatWildcardServiceImpl.java @@ -0,0 +1,90 @@ +package com.smartor.service.impl; + +import com.ruoyi.common.utils.DateUtils; +import com.smartor.domain.PatWildcard; +import com.smartor.mapper.PatWildcardMapper; +import com.smartor.service.IPatWildcardService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 鎮h�呬俊鎭�氶厤绗ervice涓氬姟灞傚鐞� + * + * @author ruoyi + * @date 2024-05-09 + */ +@Service +public class PatWildcardServiceImpl implements IPatWildcardService { + @Autowired + private PatWildcardMapper patWildcardMapper; + + /** + * 鏌ヨ鎮h�呬俊鎭�氶厤绗� + * + * @param id 鎮h�呬俊鎭�氶厤绗︿富閿� + * @return 鎮h�呬俊鎭�氶厤绗� + */ + @Override + public PatWildcard selectPatWildcardById(Long id) { + return patWildcardMapper.selectPatWildcardById(id); + } + + /** + * 鏌ヨ鎮h�呬俊鎭�氶厤绗﹀垪琛� + * + * @param patWildcard 鎮h�呬俊鎭�氶厤绗� + * @return 鎮h�呬俊鎭�氶厤绗� + */ + @Override + public List<PatWildcard> selectPatWildcardList(PatWildcard patWildcard) { + return patWildcardMapper.selectPatWildcardList(patWildcard); + } + + /** + * 鏂板鎮h�呬俊鎭�氶厤绗� + * + * @param patWildcard 鎮h�呬俊鎭�氶厤绗� + * @return 缁撴灉 + */ + @Override + public int insertPatWildcard(PatWildcard patWildcard) { + patWildcard.setCreateTime(DateUtils.getNowDate()); + return patWildcardMapper.insertPatWildcard(patWildcard); + } + + /** + * 淇敼鎮h�呬俊鎭�氶厤绗� + * + * @param patWildcard 鎮h�呬俊鎭�氶厤绗� + * @return 缁撴灉 + */ + @Override + public int updatePatWildcard(PatWildcard patWildcard) { + patWildcard.setUpdateTime(DateUtils.getNowDate()); + return patWildcardMapper.updatePatWildcard(patWildcard); + } + + /** + * 鎵归噺鍒犻櫎鎮h�呬俊鎭�氶厤绗� + * + * @param ids 闇�瑕佸垹闄ょ殑鎮h�呬俊鎭�氶厤绗︿富閿� + * @return 缁撴灉 + */ + @Override + public int deletePatWildcardByIds(Long[] ids) { + return patWildcardMapper.deletePatWildcardByIds(ids); + } + + /** + * 鍒犻櫎鎮h�呬俊鎭�氶厤绗︿俊鎭� + * + * @param id 鎮h�呬俊鎭�氶厤绗︿富閿� + * @return 缁撴灉 + */ + @Override + public int deletePatWildcardById(Long id) { + return patWildcardMapper.deletePatWildcardById(id); + } +} diff --git a/smartor/src/main/resources/mapper/smartor/IvrTaskMapper.xml b/smartor/src/main/resources/mapper/smartor/IvrTaskMapper.xml index a2729d0..c43c0a3 100644 --- a/smartor/src/main/resources/mapper/smartor/IvrTaskMapper.xml +++ b/smartor/src/main/resources/mapper/smartor/IvrTaskMapper.xml @@ -6,7 +6,7 @@ <resultMap type="com.smartor.domain.IvrTask" id="IvrTaskResult"> <result property="taskid" column="taskid"/> - <result property="taskName" column="taskname"/> + <result property="taskName" column="task_name"/> <result property="templateid" column="templateid"/> <result property="templatename" column="templatename"/> <result property="labelinfo" column="labelinfo"/> @@ -36,16 +36,17 @@ <result property="pid" column="pid"/> <result property="guid" column="guid"/> <result property="preachform" column="preachform"/> - <result property="isSend" column="is_send"/> + <result property="sendType" column="send_type"/> <result property="sendState" column="send_state"/> <result property="param" column="param"/> <result property="hospType" column="hosp_type"/> <result property="hospno" column="hospno"/> + <result property="taskDesc" column="task_desc"/> </resultMap> <sql id="selectIvrTaskVo"> select taskid, - taskname, + task_name, templateid, templatename, labelinfo, @@ -59,6 +60,7 @@ checkusername, checktime, type, + task_desc, hosp_type, hospno, typename, @@ -76,7 +78,7 @@ pid, guid, preachform, - is_send, + send_type, send_state, param, orgid @@ -86,7 +88,7 @@ <select id="selectIvrTaskList" parameterType="com.smartor.domain.IvrTask" resultMap="IvrTaskResult"> <include refid="selectIvrTaskVo"/> <where> - <if test="taskName != null and taskName != ''">and taskname like concat('%', #{taskName}, '%')</if> + <if test="taskName != null and taskName != ''">and task_name like concat('%', #{taskName}, '%')</if> <if test="templateid != null and templateid != ''">and templateid = #{templateid}</if> <if test="templatename != null and templatename != ''">and templatename like concat('%', #{templatename}, '%') @@ -127,7 +129,7 @@ keyProperty="taskid"> insert into ivr_task <trim prefix="(" suffix=")" suffixOverrides=","> - <if test="taskName != null">taskname,</if> + <if test="taskName != null">task_name,</if> <if test="templateid != null">templateid,</if> <if test="templatename != null">templatename,</if> <if test="labelinfo != null">labelinfo,</if> @@ -157,11 +159,12 @@ <if test="pid != null">pid,</if> <if test="guid != null">guid,</if> <if test="preachform != null">preachform,</if> - <if test="isSend != null">is_send,</if> + <if test="sendType != null">send_type,</if> <if test="sendState != null">send_state,</if> <if test="param != null">param,</if> <if test="hospType != null and hospType != ''">hosp_type,</if> <if test="hospno != null and hospno != ''">hospno,</if> + <if test="taskDesc != null and taskDesc != ''">task_desc,</if> </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> <if test="taskName != null">#{taskName},</if> @@ -194,18 +197,19 @@ <if test="pid != null">#{pid},</if> <if test="guid != null">#{guid},</if> <if test="preachform != null">#{preachform},</if> - <if test="isSend != null">#{isSend},</if> + <if test="sendType != null">#{sendType},</if> <if test="sendState != null">#{sendState},</if> <if test="param != null">#{param},</if> <if test="hospType != null and hospType != ''">#{hospType},</if> <if test="hospno != null and hospno != ''">#{hospno},</if> + <if test="taskDesc != null and taskDesc != ''">#{taskDesc},</if> </trim> </insert> <update id="updateIvrTask" parameterType="com.smartor.domain.IvrTask"> update ivr_task <trim prefix="SET" suffixOverrides=","> - <if test="taskName != null">taskname = #{taskName},</if> + <if test="taskName != null">task_name = #{taskName},</if> <if test="templateid != null">templateid = #{templateid},</if> <if test="templatename != null">templatename = #{templatename},</if> <if test="labelinfo != null">labelinfo = #{labelinfo},</if> @@ -235,11 +239,12 @@ <if test="pid != null">pid = #{pid},</if> <if test="guid != null">guid = #{guid},</if> <if test="preachform != null">preachform = #{preachform},</if> - <if test="isSend != null">is_send = #{isSend},</if> + <if test="sendType != null">send_type = #{sendType},</if> <if test="sendState != null">send_state = #{sendState},</if> <if test="param != null">param = #{param},</if> <if test="hospType != null and hospType != ''">hosp_type = #{hospType},</if> <if test="hospno != null and hospno != ''">hospno = #{hospno},</if> + <if test="taskDesc != null and taskDesc != ''">task_desc= #{taskDesc},</if> </trim> where taskid = #{taskid} </update> diff --git a/smartor/src/main/resources/mapper/smartor/IvrTaskSingleMapper.xml b/smartor/src/main/resources/mapper/smartor/IvrTaskSingleMapper.xml index f680203..e4e8855 100644 --- a/smartor/src/main/resources/mapper/smartor/IvrTaskSingleMapper.xml +++ b/smartor/src/main/resources/mapper/smartor/IvrTaskSingleMapper.xml @@ -24,13 +24,11 @@ <result property="sendlimitpend" column="sendlimitpend"/> <result property="sendlimitnbegin" column="sendlimitnbegin"/> <result property="sendlimitnend" column="sendlimitnend"/> - <result property="sendstate" column="sendstate"/> <result property="senduuid" column="senduuid"/> <result property="result" column="result"/> <result property="finishtime" column="finishtime"/> <result property="userid" column="userid"/> <result property="username" column="username"/> - <result property="outbounduuid" column="outbounduuid"/> <result property="recordid" column="recordid"/> <result property="recallcount" column="recallcount"/> <result property="exrecallcount" column="exrecallcount"/> @@ -51,7 +49,7 @@ <result property="guid" column="guid"/> <result property="textParam" column="text_param"/> <result property="serviceform" column="serviceform"/> - <result property="badNo" column="bad_no"/> + <result property="bedNo" column="bed_no"/> <result property="icdName" column="icd_name"/> <result property="medicalRecordNo" column="medical_record_no"/> <result property="preachcontent" column="preachcontent"/> @@ -91,13 +89,11 @@ sendlimitpend, sendlimitnbegin, sendlimitnend, - sendstate, senduuid, result, finishtime, userid, username, - outbounduuid, recordid, recallcount, exrecallcount, @@ -118,7 +114,7 @@ guid, text_param, serviceform, - bad_no, + bed_no, icd_name, send_type, medical_record_no, @@ -161,13 +157,11 @@ <if test="sendlimitpend != null and sendlimitpend != ''">and sendlimitpend = #{sendlimitpend}</if> <if test="sendlimitnbegin != null and sendlimitnbegin != ''">and sendlimitnbegin = #{sendlimitnbegin}</if> <if test="sendlimitnend != null and sendlimitnend != ''">and sendlimitnend = #{sendlimitnend}</if> - <if test="sendstate != null ">and sendstate = #{sendstate}</if> <if test="senduuid != null and senduuid != ''">and senduuid = #{senduuid}</if> <if test="result != null and result != ''">and result = #{result}</if> <if test="finishtime != null ">and finishtime = #{finishtime}</if> <if test="userid != null and userid != ''">and userid = #{userid}</if> <if test="username != null and username != ''">and username like concat('%', #{username}, '%')</if> - <if test="outbounduuid != null and outbounduuid != ''">and outbounduuid = #{outbounduuid}</if> <if test="recordid != null ">and recordid = #{recordid}</if> <if test="recallcount != null ">and recallcount = #{recallcount}</if> <if test="exrecallcount != null ">and exrecallcount = #{exrecallcount}</if> @@ -183,7 +177,7 @@ <if test="serviceform != null ">and serviceform = #{serviceform}</if> <if test="guid != null and guid != ''">and guid = #{guid}</if> <if test="textParam != null and textParam != ''">and text_param = #{textParam}</if> - <if test="badNo != null">and bad_no = #{badNo}</if> + <if test="bedNo != null">and bed_no = #{bedNo}</if> <if test="icdName != null and icdName != ''">and icd_name = #{icdName}</if> <if test="medicalRecordNo != null and medicalRecordNo != ''">and medical_record_no = #{medicalRecordNo} </if> @@ -224,13 +218,11 @@ <if test="sendlimitpend != null">sendlimitpend,</if> <if test="sendlimitnbegin != null">sendlimitnbegin,</if> <if test="sendlimitnend != null">sendlimitnend,</if> - <if test="sendstate != null">sendstate,</if> <if test="senduuid != null">senduuid,</if> <if test="result != null">result,</if> <if test="finishtime != null">finishtime,</if> <if test="userid != null">userid,</if> <if test="username != null">username,</if> - <if test="outbounduuid != null">outbounduuid,</if> <if test="recordid != null">recordid,</if> <if test="recallcount != null">recallcount,</if> <if test="exrecallcount != null">exrecallcount,</if> @@ -251,7 +243,7 @@ <if test="guid != null">guid,</if> <if test="textParam != null">text_param,</if> <if test="serviceform != null">serviceform,</if> - <if test="badNo != null">bad_no,</if> + <if test="bedNo != null">bed_no,</if> <if test="icdName != null and icdName != ''">icd_name,</if> <if test="medicalRecordNo != null and medicalRecordNo != ''">medical_record_no,</if> <if test="preachcontent != null and preachcontent != ''">preachcontent,</if> @@ -287,13 +279,11 @@ <if test="sendlimitpend != null">#{sendlimitpend},</if> <if test="sendlimitnbegin != null">#{sendlimitnbegin},</if> <if test="sendlimitnend != null">#{sendlimitnend},</if> - <if test="sendstate != null">#{sendstate},</if> <if test="senduuid != null">#{senduuid},</if> <if test="result != null">#{result},</if> <if test="finishtime != null">#{finishtime},</if> <if test="userid != null">#{userid},</if> <if test="username != null">#{username},</if> - <if test="outbounduuid != null">#{outbounduuid},</if> <if test="recordid != null">#{recordid},</if> <if test="recallcount != null">#{recallcount},</if> <if test="exrecallcount != null">#{exrecallcount},</if> @@ -314,7 +304,7 @@ <if test="guid != null">#{guid},</if> <if test="textParam != null">#{textParam},</if> <if test="serviceform != null">#{serviceform},</if> - <if test="badNo != null">#{badNo},</if> + <if test="bedNo != null">#{bedNo},</if> <if test="icdName != null and icdName != ''">#{icdName},</if> <if test="medicalRecordNo != null and medicalRecordNo != ''">#{medicalRecordNo},</if> <if test="preachcontent != null and preachcontent != ''">#{preachcontent},</if> @@ -354,13 +344,11 @@ <if test="sendlimitpend != null">sendlimitpend = #{sendlimitpend},</if> <if test="sendlimitnbegin != null">sendlimitnbegin = #{sendlimitnbegin},</if> <if test="sendlimitnend != null">sendlimitnend = #{sendlimitnend},</if> - <if test="sendstate != null">sendstate = #{sendstate},</if> <if test="senduuid != null">senduuid = #{senduuid},</if> <if test="result != null">result = #{result},</if> <if test="finishtime != null">finishtime = #{finishtime},</if> <if test="userid != null">userid = #{userid},</if> <if test="username != null">username = #{username},</if> - <if test="outbounduuid != null">outbounduuid = #{outbounduuid},</if> <if test="recordid != null">recordid = #{recordid},</if> <if test="recallcount != null">recallcount = #{recallcount},</if> <if test="exrecallcount != null">exrecallcount = #{exrecallcount},</if> @@ -381,7 +369,7 @@ <if test="guid != null">guid = #{guid},</if> <if test="textParam != null">text_param = #{textParam},</if> <if test="serviceform != null">serviceform = #{serviceform},</if> - <if test="badNo != null">bad_no = #{badNo},</if> + <if test="bedNo != null">bed_no = #{bedNo},</if> <if test="icdName != null and icdName != ''">icd_name = #{icdName},</if> <if test="medicalRecordNo != null and medicalRecordNo != ''">medical_record_no = #{medicalRecordNo},</if> <if test="preachcontent != null and preachcontent != ''">preachcontent = #{preachcontent},</if> @@ -430,13 +418,11 @@ sendlimitpend, sendlimitnbegin, sendlimitnend, - sendstate, senduuid, result, finishtime, userid, username, - outbounduuid, recordid, recallcount, exrecallcount, @@ -457,7 +443,7 @@ guid, text_param, serviceform, - bad_no, + bed_no, icd_name, send_type, medical_record_no, @@ -481,7 +467,6 @@ )) AS jt WHERE jt.begantime > #{beganTime} AND jt.begantime <= #{endTime} - AND sendstate IS NULL AND del_flag = 0 </select> diff --git a/smartor/src/main/resources/mapper/smartor/PatArchiveMapper.xml b/smartor/src/main/resources/mapper/smartor/PatArchiveMapper.xml index e0e31bd..de5e23a 100644 --- a/smartor/src/main/resources/mapper/smartor/PatArchiveMapper.xml +++ b/smartor/src/main/resources/mapper/smartor/PatArchiveMapper.xml @@ -15,7 +15,7 @@ <result property="idcardno" column="idcardno"/> <result property="birthdate" column="birthdate"/> <result property="age" column="age"/> - <result property="source" column="source"/> + <result property="sourcefrom" column="sourcefrom"/> <result property="archivetime" column="archivetime"/> <result property="archiveby" column="archiveby"/> <result property="telcode" column="telcode"/> @@ -35,7 +35,7 @@ <result property="pattype" column="pattype"/> <result property="bedNo" column="bedno"/> <result property="inhosptime" column="inhosptime"/> - <result property="membertype" column="membertype"/> + <result property="viptype" column="viptype"/> </resultMap> <sql id="selectPatArchiveVo"> @@ -49,7 +49,7 @@ native_place, place_of_residence, birthplace, - source, + sourcefrom, archivetime, archiveby, telcode, @@ -64,7 +64,7 @@ create_time, isupload, pattype, - membertype, + viptype, upload_time from pat_archive </sql> @@ -74,13 +74,13 @@ <where> <if test="name != null and name != ''">and name like concat('%', #{name}, '%')</if> <if test="idcardno != null and idcardno != ''">and idcardno = #{idcardno}</if> - <if test="source != null ">and source = #{source}</if> + <if test="sourcefrom != null ">and sourcefrom = #{sourcefrom}</if> <if test="telcode != null and telcode != ''">and telcode = #{telcode}</if> <if test="orgid != null and orgid != ''">and orgid = #{orgid}</if> <if test="patid != null and patid != ''">and patid = #{patid}</if> <if test="isupload != null ">and isupload = #{isupload}</if> <if test="uploadTime != null ">and upload_time = #{uploadTime}</if> - <if test="membertype != null ">and membertype = #{membertype}</if> + <if test="viptype != null ">and viptype = #{viptype}</if> </where> </select> @@ -97,7 +97,7 @@ a.telcode, a.create_time, a.update_time, - a.membertype, + a.viptype, a.birthdate from pat_archive a,pat_archivetag b ,base_tag c <where> @@ -127,7 +127,7 @@ <!-- iccardno--> <!--<!– <if test="birthdate != null">birthdate,</if>–>--> <!--<!– <if test="age != null">age,</if>–>--> - <!--<!– <if test="source != null">source,</if>–>--> + <!--<!– <if test="sourcefrom != null">sourcefrom,</if>–>--> <!--<!– <if test="archivetime != null">archivetime,</if>–>--> <!--<!– <if test="archiveby != null">archiveby,</if>–>--> <!--<!– <if test="telcode != null">telcode,</if>–>--> @@ -150,7 +150,7 @@ <!-- <if test="iccardno != null">#{item.iccardno},</if>--> <!--<!– <if test="birthdate != null">#{birthdate},</if>–>--> <!--<!– <if test="age != null">#{item.age},</if>–>--> - <!--<!– <if test="source != null">#{item.source},</if>–>--> + <!--<!– <if test="sourcefrom != null">#{item.sourcefrom},</if>–>--> <!--<!– <if test="archivetime != null">#{item.archivetime},</if>–>--> <!--<!– <if test="archiveby != null">#{item.archiveby},</if>–>--> <!--<!– <if test="telcode != null">#{item.telcode},</if>–>--> @@ -169,10 +169,10 @@ <!-- </trim>--> insert into - pat_archive(name,membertype,sex,idcardno,birthdate,age,source,archivetime,archiveby,telcode,relativetelcode,idcardtype,orgid,openid,dduserid,update_by,update_time + pat_archive(name,viptype,sex,idcardno,birthdate,age,sourcefrom,archivetime,archiveby,telcode,relativetelcode,idcardtype,orgid,openid,dduserid,update_by,update_time ,create_by,create_time,isupload,upload_time,pattype,place_of_residence,nation,birthplace,native_place) values <foreach item="item" index="index" collection="list" separator=","> - (#{item.name},#{item.membertype},#{item.sex},#{item.idcardno},#{item.birthdate},#{item.age},#{item.source},#{item.archivetime},#{item.archiveby} + (#{item.name},#{item.viptype},#{item.sex},#{item.idcardno},#{item.birthdate},#{item.age},#{item.sourcefrom},#{item.archivetime},#{item.archiveby} ,#{item.telcode},#{item.archiveby},#{item.idcardtype},#{item.orgid},#{item.openid},#{item.dduserid},#{item.updateBy}, #{item.updateTime},#{item.createBy},#{item.createTime},#{item.isupload},#{item.uploadTime},#{item.pattype},#{item.placeOfResidence},#{item.nation},#{item.birthplace},#{item.nativePlace} ) @@ -187,7 +187,7 @@ <if test="idcardno != null">idcardno = #{idcardno},</if> <if test="birthdate != null">birthdate = #{birthdate},</if> <if test="age != null">age = #{age},</if> - <if test="source != null">source = #{source},</if> + <if test="sourcefrom != null">sourcefrom = #{sourcefrom},</if> <if test="archivetime != null">archivetime = #{archivetime},</if> <if test="archiveby != null">archiveby = #{archiveby},</if> <if test="telcode != null">telcode = #{telcode},</if> @@ -202,7 +202,7 @@ <if test="createTime != null">create_time = #{createTime},</if> <if test="isupload != null">isupload = #{isupload},</if> <if test="uploadTime != null">upload_time = #{uploadTime},</if> - <if test="membertype != null">membertype = #{membertype},</if> + <if test="viptype != null">viptype = #{viptype},</if> </trim> where patid = #{patid} </update> @@ -236,7 +236,7 @@ a.idcardno, a.birthdate, a.age, - a.source, + a.sourcefrom, a.archivetime, a.archiveby, a.telcode, @@ -251,7 +251,7 @@ a.create_time, a.isupload, a.upload_time, - a.membertype, + a.viptype, a.pattype from pat_archive a,pat_archivetag b ,base_tag c <where> @@ -287,14 +287,14 @@ a.idcardno, a.birthdate, a.age, - a.source, + a.sourcefrom, a.archivetime, a.archiveby, a.telcode, a.relativetelcode, a.idcardtype, a.orgid, - a.membertype, + a.viptype, a.openid, a.del_flag, a.update_by, @@ -364,8 +364,8 @@ a.idcardno, a.birthdate, a.age, - a.membertype, - a.source, + a.viptype, + a.sourcefrom, a.archivetime, a.archiveby, a.telcode, @@ -434,11 +434,11 @@ a.native_place, a.place_of_residence, a.birthplace, - a.membertype, + a.viptype, a.idcardno, a.birthdate, a.age, - a.source, + a.sourcefrom, a.archivetime, a.archiveby, a.telcode, diff --git a/smartor/src/main/resources/mapper/smartor/PatWildcardMapper.xml b/smartor/src/main/resources/mapper/smartor/PatWildcardMapper.xml new file mode 100644 index 0000000..c026ed5 --- /dev/null +++ b/smartor/src/main/resources/mapper/smartor/PatWildcardMapper.xml @@ -0,0 +1,92 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> +<mapper namespace="com.smartor.mapper.PatWildcardMapper"> + + <resultMap type="com.smartor.domain.PatWildcard" id="PatWildcardResult"> + <result property="id" column="id"/> + <result property="wildcard" column="wildcard"/> + <result property="patField" column="pat_field"/> + <result property="delFlag" column="del_flag"/> + <result property="updateBy" column="update_by"/> + <result property="updateTime" column="update_time"/> + <result property="createBy" column="create_by"/> + <result property="createTime" column="create_time"/> + </resultMap> + + <sql id="selectPatWildcardVo"> + select id, + wildcard, + pat_field, + del_flag, + update_by, + update_time, + create_by, + create_time + from pat_wildcard + </sql> + + <select id="selectPatWildcardList" parameterType="com.smartor.domain.PatWildcard" resultMap="PatWildcardResult"> + <include refid="selectPatWildcardVo"/> + <where> + <if test="wildcard != null and wildcard != ''">and wildcard = #{wildcard}</if> + <if test="patField != null and patField != ''">and pat_field = #{patField}</if> + </where> + </select> + + <select id="selectPatWildcardById" parameterType="Long" resultMap="PatWildcardResult"> + <include refid="selectPatWildcardVo"/> + where id = #{id} + </select> + + <insert id="insertPatWildcard" parameterType="com.smartor.domain.PatWildcard" useGeneratedKeys="true" + keyProperty="id"> + insert into pat_wildcard + <trim prefix="(" suffix=")" suffixOverrides=","> + <if test="wildcard != null">wildcard,</if> + <if test="patField != null">pat_field,</if> + <if test="delFlag != null and delFlag != ''">del_flag,</if> + <if test="updateBy != null">update_by,</if> + <if test="updateTime != null">update_time,</if> + <if test="createBy != null">create_by,</if> + <if test="createTime != null">create_time,</if> + </trim> + <trim prefix="values (" suffix=")" suffixOverrides=","> + <if test="wildcard != null">#{wildcard},</if> + <if test="patField != null">#{patField},</if> + <if test="delFlag != null and delFlag != ''">#{delFlag},</if> + <if test="updateBy != null">#{updateBy},</if> + <if test="updateTime != null">#{updateTime},</if> + <if test="createBy != null">#{createBy},</if> + <if test="createTime != null">#{createTime},</if> + </trim> + </insert> + + <update id="updatePatWildcard" parameterType="com.smartor.domain.PatWildcard"> + update pat_wildcard + <trim prefix="SET" suffixOverrides=","> + <if test="wildcard != null">wildcard = #{wildcard},</if> + <if test="patField != null">pat_field = #{patField},</if> + <if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if> + <if test="updateBy != null">update_by = #{updateBy},</if> + <if test="updateTime != null">update_time = #{updateTime},</if> + <if test="createBy != null">create_by = #{createBy},</if> + <if test="createTime != null">create_time = #{createTime},</if> + </trim> + where id = #{id} + </update> + + <delete id="deletePatWildcardById" parameterType="Long"> + delete + from pat_wildcard + where id = #{id} + </delete> + + <delete id="deletePatWildcardByIds" parameterType="String"> + delete from pat_wildcard where id in + <foreach item="id" collection="array" open="(" separator="," close=")"> + #{id} + </foreach> + </delete> +</mapper> diff --git a/smartor/src/main/resources/mapper/smartor/SvyLibTopicMapper.xml b/smartor/src/main/resources/mapper/smartor/SvyLibTopicMapper.xml index 2f4bf1e..ce6c640 100644 --- a/smartor/src/main/resources/mapper/smartor/SvyLibTopicMapper.xml +++ b/smartor/src/main/resources/mapper/smartor/SvyLibTopicMapper.xml @@ -72,7 +72,8 @@ <if test="oldid != null ">and oldid = #{oldid}</if> <if test="topictype != null and topictype != ''">and topictype = #{topictype}</if> <if test="categoryid != null ">and categoryid = #{categoryid}</if> - <if test="topic != null and topic != ''">and topic = #{topic}</if> + <if test="topic != null and topic != ''">and topic like concat('%', #{topic}, '%')</if> + <if test="ishide != null ">and ishide = #{ishide}</if> <if test="orgid != null and orgid != ''">and orgid = #{orgid}</if> <if test="svyid != null and svyid != ''">and svyid = #{svyid}</if> -- Gitblit v1.9.3