liusheng
2024-05-10 bb60b5747d5f4b85655a541d4990ec7464497b1b
代码提交
已添加7个文件
已修改22个文件
1133 ■■■■ 文件已修改
ruoyi-admin/src/main/java/com/ruoyi/web/component/RabbitMqReceiver.java 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/IvrTaskSingleController.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatWildcardController.java 98 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/task/PhoneTask.java 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/task/PhoneTask2.java 86 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/test/MQTest.java 27 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-ui/src/api/system/config.js 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-ui/src/api/system/dict/type.js 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/common/SendService.java 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/config/PhoneUtils.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/IvrTask.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/IvrTaskSingle.java 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/IvrTaskSingleVO.java 202 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/IvrTaskVO.java 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/PatArchive.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/PatArchiveVO.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/PatTaskRelevance.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/PatWildcard.java 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/mapper/IvrTaskMapper.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/mapper/PatWildcardMapper.java 63 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/IPatWildcardService.java 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/IvrLibaTargetServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/IvrTaskSingleServiceImpl.java 55 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/PatWildcardServiceImpl.java 90 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/IvrTaskMapper.xml 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/IvrTaskSingleMapper.xml 29 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/PatArchiveMapper.xml 42 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/PatWildcardMapper.xml 92 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/SvyLibTopicMapper.xml 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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(从队列中删除)了   ï¼ˆè¿™ä¸ªéœ€è¦æ ¹æ®ä¸šåŠ¡å†åŽ»å¤„ç†ACK)
            channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
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();
    }
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;
/**
 * æ‚£è€…信息通配符Controller
 *
 * @author ruoyi
 * @date 2024-05-09
 */
@RestController
@RequestMapping("/smartor/wildcard")
public class PatWildcardController extends BaseController
{
    @Autowired
    private IPatWildcardService patWildcardService;
    /**
     * æŸ¥è¯¢æ‚£è€…信息通配符列表
     */
    @PreAuthorize("@ss.hasPermi('system:wildcard:list')")
    @GetMapping("/list")
    public TableDataInfo list(PatWildcard patWildcard)
    {
        startPage();
        List<PatWildcard> list = patWildcardService.selectPatWildcardList(patWildcard);
        return getDataTable(list);
    }
    /**
     * å¯¼å‡ºæ‚£è€…信息通配符列表
     */
    @PreAuthorize("@ss.hasPermi('system:wildcard:export')")
    @Log(title = "患者信息通配符", 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, "患者信息通配符数据");
    }
    /**
     * èŽ·å–æ‚£è€…ä¿¡æ¯é€šé…ç¬¦è¯¦ç»†ä¿¡æ¯
     */
    @PreAuthorize("@ss.hasPermi('system:wildcard:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return success(patWildcardService.selectPatWildcardById(id));
    }
    /**
     * æ–°å¢žæ‚£è€…信息通配符
     */
    @PreAuthorize("@ss.hasPermi('system:wildcard:add')")
    @Log(title = "患者信息通配符", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody PatWildcard patWildcard)
    {
        return toAjax(patWildcardService.insertPatWildcard(patWildcard));
    }
    /**
     * ä¿®æ”¹æ‚£è€…信息通配符
     */
    @PreAuthorize("@ss.hasPermi('system:wildcard:edit')")
    @Log(title = "患者信息通配符", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody PatWildcard patWildcard)
    {
        return toAjax(patWildcardService.updatePatWildcard(patWildcard));
    }
    /**
     * åˆ é™¤æ‚£è€…信息通配符
     */
    @PreAuthorize("@ss.hasPermi('system:wildcard:remove')")
    @Log(title = "患者信息通配符", businessType = BusinessType.DELETE)
    @DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(patWildcardService.deletePatWildcardByIds(ids));
    }
}
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);
                //将数据放到redis中,方便在回调方法里获取
                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);
                //通了之后,立马去调开场白
                System.out.println("问题的值为:" + returnQues.getNowQuestion().getQuestionText() + "       " + uuid);
                phoneUtils.ttsPlayback(ivrLibaTemplateVO.getRevisitBefore()+returnQues.getNowQuestion().getQuestionText(), uuid);
                //通知 MQ æ¶ˆæ¯å·²è¢«æŽ¥æ”¶,可以ACK(从队列中删除)了   ï¼ˆè¿™ä¸ªéœ€è¦æ ¹æ®ä¸šåŠ¡å†åŽ»å¤„ç†ACK)
                channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
            } catch (IOException e) {
//                //通知 MQ æ¶ˆæ¯å·²è¢«æŽ¥æ”¶,可以ACK(从队列中删除)了   ï¼ˆè¿™ä¸ªéœ€è¦æ ¹æ®ä¸šåŠ¡å†åŽ»å¤„ç†ACK)
//                channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
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());
            //将数据放到redis中,方便在回调方法里获取
            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());
            //将问题,和模板信息放到redis中
            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(从队列中删除)了   ï¼ˆè¿™ä¸ªéœ€è¦æ ¹æ®ä¸šåŠ¡å†åŽ»å¤„ç†ACK)
//                channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
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());
    }
}
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'
  })
}
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'
  })
}
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 {
                //获取患者对应的字段的值
                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;
    }
}
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);
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、inhospno)")
    private String hospno;
    /**
     * ä»»åŠ¡æè¿°
     */
    @Excel(name = "任务描述")
    @ApiModelProperty(value = "任务描述")
    private String taskDesc;
}
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;
    /**
     * ç–¾ç—…名称
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 = "患者与单一任务关联表集合")
    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;
    /**
     * å®£æ•™å†…容
     */
    @Excel(name = "宣教内容")
    @ApiModelProperty(value = "宣教内容")
    private String preachcontent;
//    /**
//     * åºŠå·
//     */
//    @Excel(name = "床号")
//    @ApiModelProperty(value = "床号")
//    private Long bedNo;
//
//    /**
//     * ç–¾ç—…名称
//     */
//    @Excel(name = "疾病名称")
//    @ApiModelProperty(value = "疾病名称")
//    private String icdName;
//
//    /**
//     * ç—…历号
//     */
//    @Excel(name = "病历号")
//    @ApiModelProperty(value = "病历号")
//    private String medicalRecordNo;
//
//    /**
//     * å®£æ•™å†…容
//     */
//    @Excel(name = "宣教内容")
//    @ApiModelProperty(value = "宣教内容")
//    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、inhospno)
     */
    @Excel(name = "  å°±è¯Šç¼–号(对应的outhospno、inhospno)  ")
    @ApiModelProperty(value = "就诊编号(对应的outhospno、inhospno)")
    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、inhospno)
//     */
//    @Excel(name = "  å°±è¯Šç¼–号(对应的outhospno、inhospno)  ")
//    @ApiModelProperty(value = "就诊编号(对应的outhospno、inhospno)")
//    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;
}
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;
    /**
     *
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();
    }
}
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();
    }
}
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;
}
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;
/**
 * æ‚£è€…信息通配符对象 pat_wildcard
 *
 * @author ruoyi
 * @date 2024-05-09
 */
@ApiModel(value = "PatWildcard", description = "患者信息通配符对象")
@Data
public class PatWildcard extends BaseEntity {
    /**
     * è‡ªå¢žID
     */
    @ApiModelProperty(value = "自增ID")
    private Long id;
    /**
     * é€šé…ç¬¦
     */
    @Excel(name = "通配符")
    @ApiModelProperty(value = "通配符")
    private String wildcard;
    /**
     * æ‚£è€…对应的字段
     */
    @Excel(name = "患者对应的字段")
    @ApiModelProperty(value = "患者对应的字段")
    private String patField;
    /**
     * åˆ é™¤æ ‡è®°
     */
    @ApiModelProperty(value = "删除标记")
    private String delFlag;
}
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
{
    /**
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;
/**
 * æ‚£è€…信息通配符Mapper接口
 *
 * @author ruoyi
 * @date 2024-05-09
 */
@Mapper
public interface PatWildcardMapper {
    /**
     * æŸ¥è¯¢æ‚£è€…信息通配符
     *
     * @param id æ‚£è€…信息通配符主键
     * @return æ‚£è€…信息通配符
     */
    public PatWildcard selectPatWildcardById(Long id);
    /**
     * æŸ¥è¯¢æ‚£è€…信息通配符列表
     *
     * @param patWildcard æ‚£è€…信息通配符
     * @return æ‚£è€…信息通配符集合
     */
    public List<PatWildcard> selectPatWildcardList(PatWildcard patWildcard);
    /**
     * æ–°å¢žæ‚£è€…信息通配符
     *
     * @param patWildcard æ‚£è€…信息通配符
     * @return ç»“æžœ
     */
    public int insertPatWildcard(PatWildcard patWildcard);
    /**
     * ä¿®æ”¹æ‚£è€…信息通配符
     *
     * @param patWildcard æ‚£è€…信息通配符
     * @return ç»“æžœ
     */
    public int updatePatWildcard(PatWildcard patWildcard);
    /**
     * åˆ é™¤æ‚£è€…信息通配符
     *
     * @param id æ‚£è€…信息通配符主键
     * @return ç»“æžœ
     */
    public int deletePatWildcardById(Long id);
    /**
     * æ‰¹é‡åˆ é™¤æ‚£è€…信息通配符
     *
     * @param ids éœ€è¦åˆ é™¤çš„æ•°æ®ä¸»é”®é›†åˆ
     * @return ç»“æžœ
     */
    public int deletePatWildcardByIds(Long[] ids);
}
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;
/**
 * æ‚£è€…信息通配符Service接口
 *
 * @author ruoyi
 * @date 2024-05-09
 */
public interface IPatWildcardService
{
    /**
     * æŸ¥è¯¢æ‚£è€…信息通配符
     *
     * @param id æ‚£è€…信息通配符主键
     * @return æ‚£è€…信息通配符
     */
    public PatWildcard selectPatWildcardById(Long id);
    /**
     * æŸ¥è¯¢æ‚£è€…信息通配符列表
     *
     * @param patWildcard æ‚£è€…信息通配符
     * @return æ‚£è€…信息通配符集合
     */
    public List<PatWildcard> selectPatWildcardList(PatWildcard patWildcard);
    /**
     * æ–°å¢žæ‚£è€…信息通配符
     *
     * @param patWildcard æ‚£è€…信息通配符
     * @return ç»“æžœ
     */
    public int insertPatWildcard(PatWildcard patWildcard);
    /**
     * ä¿®æ”¹æ‚£è€…信息通配符
     *
     * @param patWildcard æ‚£è€…信息通配符
     * @return ç»“æžœ
     */
    public int updatePatWildcard(PatWildcard patWildcard);
    /**
     * æ‰¹é‡åˆ é™¤æ‚£è€…信息通配符
     *
     * @param ids éœ€è¦åˆ é™¤çš„æ‚£è€…信息通配符主键集合
     * @return ç»“æžœ
     */
    public int deletePatWildcardByIds(Long[] ids);
    /**
     * åˆ é™¤æ‚£è€…信息通配符信息
     *
     * @param id æ‚£è€…信息通配符主键
     * @return ç»“æžœ
     */
    public int deletePatWildcardById(Long id);
}
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();
            }
        }
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,7 +333,9 @@
    @Override
    public void phoneCallBack(PhoneCallBackVO phoneCallBackVO) {
        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());
@@ -340,14 +345,15 @@
        Integer hangupValue = redisCache.getCacheObject(phoneCallBackVO.getUuid() + "hangup");
        PhoneUtils phoneUtils = new PhoneUtils();
        if (hangupValue != null && hangupValue == 1) {
            log.info("电话要挂断了");
                String date = simpleDateFormat1.format(new Date());
                log.info("电话要挂断了: {}", date);
            //hangupValue == 1  éšè®¿ç»“束,直接可以挂电话
            phoneUtils.hangup("", "", "", "", "", "", "", phoneCallBackVO.getUuid());
            return;
        }
        Map<String, Object> map = redisCache.getCacheObject(phoneCallBackVO.getUuid());
        IvrTaskSingle ivrTaskcall = (IvrTaskSingle) map.get("ivrTaskcall");
            IvrTaskSingle ivrTaskcall = (IvrTaskSingle) map.get("ivrTaskSingle");
        List<IvrLibaTemplateScriptVO> ivrLibaTemplateScriptVOs = (List<IvrLibaTemplateScriptVO>) map.get("ivrLibaTemplateScriptVO");
        //将uuid更新到数据库中
        ivrTaskcall.setSenduuid(phoneCallBackVO.getUuid());
@@ -379,6 +385,8 @@
                    redisCache.setCacheObject(phoneCallBackVO.getUuid() + "noVoice", 0, 120, TimeUnit.MINUTES);
                    IvrLibaTemplateScriptVO nextQuestion = getNextQuestion(ivrLibaTemplateScriptVOs, nowQuestion);
                    // é—®é¢˜ï¼Œ  åŽ»è°ƒç”¨â€œtts合成和播放”接口
                        String date = simpleDateFormat1.format(new Date());
                        log.info("去调用tts合成和播放接口: {},uuid为:{}", date, phoneCallBackVO.getUuid());
                    phoneUtils.ttsPlayback(nowQuestion.getQuestionText(), phoneCallBackVO.getUuid());
                }
            } else {
@@ -386,6 +394,8 @@
                //调用ivrLibaTemplateScriptVO中的slienceText(静默话术)
                String slienceText = nowQuestion.getSlienceText();
                //静默话术  + é—®é¢˜ï¼Œ  åŽ»è°ƒç”¨â€œtts合成和播放”接口
                    String date = simpleDateFormat1.format(new Date());
                    log.info("静默话术  + é—®é¢˜,去调用tts合成和播放接口: {},uuid为:{}", date, phoneCallBackVO.getUuid());
                phoneUtils.ttsPlayback(slienceText + nowQuestion.getQuestionText(), phoneCallBackVO.getUuid());
                return;
            }
@@ -407,10 +417,8 @@
                    Pattern pattern2 = Pattern.compile(nowQuestion.getIvrLibaScriptTargetoptionList().get(j).getTargetregex2());
                    matcher2 = pattern2.matcher(phoneCallBackVO.getTextResult());
                }
                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()) {
                    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()) {
                    //说明匹配正确了
                    //这里应该先判断类型,去再修改,设置IsUserOperation是单选题的改法
                    nowQuestion.getIvrLibaScriptTargetoptionList().get(j).setIsUserOperation(true);
@@ -444,6 +452,8 @@
                            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 {
@@ -477,10 +487,14 @@
                        questionMessage.setNowQuestion(nextQuestion);
                        redisCache.setCacheObject(phoneCallBackVO.getUuid() + "returnQues", questionMessage, 120, TimeUnit.MINUTES);
                        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 {
                        //就可以挂断电话了
                            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 {
@@ -537,14 +551,19 @@
                            redisCache.setCacheObject(phoneCallBackVO.getUuid() + "isOver", 1, 120, TimeUnit.MINUTES);
                        }
                        //调用“15、tts合成和播放, tts_playback”将结果传回
                            String date = simpleDateFormat1.format(new Date());
                            log.info("调用“15、tts合成和播放------: {},uuid为:{}", date, phoneCallBackVO.getUuid());
                        phoneUtils.ttsPlayback(nowQuestion.getQuestionText() + ivrLibaTemplateScriptVO.getSubmoduleText(), phoneCallBackVO.getUuid());
                    }
                    break;
                }
                    String date = simpleDateFormat1.format(new Date());
                    log.info("最后的信息回复-: {},uuid为:{}", date, phoneCallBackVO.getUuid());
                phoneUtils.ttsPlayback(nowQuestion.getQuestionText(), phoneCallBackVO.getUuid());
            }
        }
    }
    }
    //下面的代码不能删除,上面的方法只是配合电话端联调用的,
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;
/**
 * æ‚£è€…信息通配符Service业务层处理
 *
 * @author ruoyi
 * @date 2024-05-09
 */
@Service
public class PatWildcardServiceImpl implements IPatWildcardService {
    @Autowired
    private PatWildcardMapper patWildcardMapper;
    /**
     * æŸ¥è¯¢æ‚£è€…信息通配符
     *
     * @param id æ‚£è€…信息通配符主键
     * @return æ‚£è€…信息通配符
     */
    @Override
    public PatWildcard selectPatWildcardById(Long id) {
        return patWildcardMapper.selectPatWildcardById(id);
    }
    /**
     * æŸ¥è¯¢æ‚£è€…信息通配符列表
     *
     * @param patWildcard æ‚£è€…信息通配符
     * @return æ‚£è€…信息通配符
     */
    @Override
    public List<PatWildcard> selectPatWildcardList(PatWildcard patWildcard) {
        return patWildcardMapper.selectPatWildcardList(patWildcard);
    }
    /**
     * æ–°å¢žæ‚£è€…信息通配符
     *
     * @param patWildcard æ‚£è€…信息通配符
     * @return ç»“æžœ
     */
    @Override
    public int insertPatWildcard(PatWildcard patWildcard) {
        patWildcard.setCreateTime(DateUtils.getNowDate());
        return patWildcardMapper.insertPatWildcard(patWildcard);
    }
    /**
     * ä¿®æ”¹æ‚£è€…信息通配符
     *
     * @param patWildcard æ‚£è€…信息通配符
     * @return ç»“æžœ
     */
    @Override
    public int updatePatWildcard(PatWildcard patWildcard) {
        patWildcard.setUpdateTime(DateUtils.getNowDate());
        return patWildcardMapper.updatePatWildcard(patWildcard);
    }
    /**
     * æ‰¹é‡åˆ é™¤æ‚£è€…信息通配符
     *
     * @param ids éœ€è¦åˆ é™¤çš„æ‚£è€…信息通配符主键
     * @return ç»“æžœ
     */
    @Override
    public int deletePatWildcardByIds(Long[] ids) {
        return patWildcardMapper.deletePatWildcardByIds(ids);
    }
    /**
     * åˆ é™¤æ‚£è€…信息通配符信息
     *
     * @param id æ‚£è€…信息通配符主键
     * @return ç»“æžœ
     */
    @Override
    public int deletePatWildcardById(Long id) {
        return patWildcardMapper.deletePatWildcardById(id);
    }
}
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>
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 &lt;= #{endTime}
          AND sendstate IS NULL
          AND del_flag = 0
    </select>
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-->
        <!--&lt;!&ndash;            <if test="birthdate != null">birthdate,</if>&ndash;&gt;-->
        <!--&lt;!&ndash;            <if test="age != null">age,</if>&ndash;&gt;-->
        <!--&lt;!&ndash;            <if test="source != null">source,</if>&ndash;&gt;-->
        <!--&lt;!&ndash;            <if test="sourcefrom != null">sourcefrom,</if>&ndash;&gt;-->
        <!--&lt;!&ndash;            <if test="archivetime != null">archivetime,</if>&ndash;&gt;-->
        <!--&lt;!&ndash;            <if test="archiveby != null">archiveby,</if>&ndash;&gt;-->
        <!--&lt;!&ndash;            <if test="telcode != null">telcode,</if>&ndash;&gt;-->
@@ -150,7 +150,7 @@
        <!--                <if test="iccardno != null">#{item.iccardno},</if>-->
        <!--&lt;!&ndash;                <if test="birthdate != null">#{birthdate},</if>&ndash;&gt;-->
        <!--&lt;!&ndash;                <if test="age != null">#{item.age},</if>&ndash;&gt;-->
        <!--&lt;!&ndash;                <if test="source != null">#{item.source},</if>&ndash;&gt;-->
        <!--&lt;!&ndash;                <if test="sourcefrom != null">#{item.sourcefrom},</if>&ndash;&gt;-->
        <!--&lt;!&ndash;                <if test="archivetime != null">#{item.archivetime},</if>&ndash;&gt;-->
        <!--&lt;!&ndash;                <if test="archiveby != null">#{item.archiveby},</if>&ndash;&gt;-->
        <!--&lt;!&ndash;                <if test="telcode != null">#{item.telcode},</if>&ndash;&gt;-->
@@ -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,
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>
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>