liusheng
2024-07-16 17a443d510a0aa4c545df0d11467ff17a24cfa6a
代码提交
已修改39个文件
516 ■■■■ 文件已修改
ruoyi-admin/src/main/java/com/ruoyi/web/component/RedisMqReceiver.java 114 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/hanler/ChatWebSocketHandler.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/IvrLibaScriptController.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/tools/WeChatController.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/task/PhoneTask.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/test/WeChatService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/resources/application-druid.yml 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/common/SendService.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/CommonTaskcallMQ.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/IvrLibaScript.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/IvrLibaTarget.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/IvrLibaTargetVO.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/IvrLibaTemplateScriptVO.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/IvrTaskTemplate.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/IvrTaskTemplateScript.java 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/IvrTaskTemplateScriptVO.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/IvrTaskTemplateVO.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/PatTaskRelevance.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/SendMagParam.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/SendTaskVO.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/ServiceSubtask.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/ServiceTaskVO.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/SvyLibScript.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/SvyLibTemplateScript.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/WeChatSendVo.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/CommonTaskServiceImpl.java 39 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/IvrTaskTemplateServiceImpl.java 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/ServiceTaskServiceImpl.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/SvyLibScriptServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/SvyLibTemplateServiceImpl.java 39 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/WeChatServiceImpl.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/IvrLibaTargetMapper.xml 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/IvrLibaTemplateScriptMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/IvrTaskTemplateMapper.xml 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/IvrTaskTemplateScriptMapper.xml 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/SvyLibScriptMapper.xml 25 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/SvyLibTemplateScriptMapper.xml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/component/RedisMqReceiver.java
@@ -4,7 +4,6 @@
import com.fasterxml.jackson.databind.ObjectMapper;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.enums.ServiceFromEnum;
import com.ruoyi.common.utils.IPUtils;
import com.ruoyi.common.utils.RSAPublicKeyExample;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.web.task.PhoneTask;
@@ -25,9 +24,14 @@
import org.springframework.data.redis.connection.Message;
import org.springframework.data.redis.listener.KeyExpirationEventMessageListener;
import org.springframework.data.redis.listener.RedisMessageListenerContainer;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
import java.util.*;
import javax.annotation.Syntax;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
@@ -42,20 +46,29 @@
    @Value("${pub_key}")
    private String pub_key;
    @Value("${localIP}")
    private String localIP;
    @Value("${req_path}")
    private String req_path;
    private static IIvrTaskTemplateService ivrTaskTemplateService;
    @Autowired
    private IIvrTaskTemplateService ivrTaskTemplateService;
    private static ServiceSubtaskMapper ivrTaskcallMapper;
    @Autowired
    private ServiceSubtaskMapper ivrTaskcallMapper;
    private static ServiceTaskMapper ivrTaskMapper;
    @Autowired
    private ServiceTaskMapper ivrTaskMapper;
    private static SendService sendService;
    @Autowired
    private SendService sendService;
    private static RedisCache redisCache;
    @Autowired
    private RedisCache redisCache;
    private static RobotPhoneUtils robotPhoneUtils;
    @Autowired
    private RobotPhoneUtils robotPhoneUtils;
    @Autowired
    private SvyTaskMapper svyTaskMapper;
@@ -79,41 +92,11 @@
        super(listenerContainer);
    }
    @Autowired
    public void setIIvrTaskTemplateService(IIvrTaskTemplateService ivrTaskTemplateService) {
        RedisMqReceiver.ivrTaskTemplateService = ivrTaskTemplateService;
    }
    @Autowired
    public void setRobotPhoneUtilsService(RobotPhoneUtils robotPhoneUtils) {
        RedisMqReceiver.robotPhoneUtils = robotPhoneUtils;
    }
    @Autowired
    public void setSendService(SendService sendService) {
        RedisMqReceiver.sendService = sendService;
    }
    @Autowired
    public void setIvrTaskcallMapper(ServiceSubtaskMapper ivrTaskcallMapper) {
        RedisMqReceiver.ivrTaskcallMapper = ivrTaskcallMapper;
    }
    @Autowired
    public void setIvrTaskMapper(ServiceTaskMapper ivrTaskMapper) {
        RedisMqReceiver.ivrTaskMapper = ivrTaskMapper;
    }
    @Autowired
    public void setRedisCache(RedisCache redisCache) {
        RedisMqReceiver.redisCache = redisCache;
    }
    @Override
    public void onMessage(Message message, byte[] pattern) {
        log.info("监听Redis key过期,key:{},channel:{}", message.toString(), new String(pattern));
        String ip = "116.62.18.175";
        synchronized (RedisMqReceiver.class) {
            String ip = localIP;
        log.error("本机的网络IP为:{}", ip);
        String content = message.toString();
        //判断是不是任务信息,如果不是,直接返回,不需要执行
@@ -129,7 +112,13 @@
            } else {
                commonTaskcallMQ = mapper.readValue(content, CommonTaskcallMQ.class);
            }
                //这里之所以这样做一下,是搞不懂,为啥会进来两遍
                Boolean aBoolean = redisCache.hasKey(commonTaskcallMQ.getTaskid().toString());
                if (aBoolean) {
                    return;
                } else {
                    redisCache.setCacheObject(commonTaskcallMQ.getTaskid().toString(), commonTaskcallMQ.getTaskid().toString(), 60, TimeUnit.SECONDS);
                }
            if (commonTaskcallMQ.getTaskType() == 1) {
                //随访
                sfHandle(commonTaskcallMQ, ip);
@@ -140,7 +129,8 @@
                //宣教
                xjHandle(commonTaskcallMQ, ip);
            }
                //处理完成,移除redis
                redisCache.deleteObject(message.toString());
        } catch (Exception e) {
            Integer integer = redisCache.getCacheObject(commonTaskcallMQ.getTaskid().toString());
@@ -155,7 +145,7 @@
            log.error("============消费失败,尝试消息补发再次消费!==============  {}", e.getMessage());
            redisCache.setCacheObject(message.toString(), message.toString(), 60, TimeUnit.SECONDS);
        }
        }
    }
    /**
@@ -181,16 +171,16 @@
                //通过模板ID获取模板问题
                IvrTaskTemplateVO ivrTaskTemplateVO = new IvrTaskTemplateVO();
                ivrTaskTemplateVO.setID(Long.valueOf(commonTaskcallMQ.getTemplateid()));
                ivrTaskTemplateVO.setId(Long.valueOf(commonTaskcallMQ.getTemplateid()));
                IvrTaskTemplateVO ivrTaskTemplateVO1 = ivrTaskTemplateService.selectInfoByCondition(ivrTaskTemplateVO);
                //通过任务ID拿到患者信息
                ServiceSubtask ivrTaskcall = new ServiceSubtask();
                ivrTaskcall.setTaskid(commonTaskcallMQ.getTaskid());
                List<ServiceSubtask> ivrTaskcalls = ivrTaskcallMapper.selectServiceSubtaskList(ivrTaskcall);
                List<ServiceSubtask> selectServiceSubtaskList = ivrTaskcallMapper.selectServiceSubtaskList(ivrTaskcall);
                if (descByCode.equals("电话")) {
                    for (ServiceSubtask ivrTaskcall1 : ivrTaskcalls) {
                        ServiceTask ivrTask = ivrTaskMapper.selectServiceTaskByTaskid(ivrTaskcall1.getTaskid());
                    for (ServiceSubtask serviceSubtask : selectServiceSubtaskList) {
                        ServiceTask ivrTask = ivrTaskMapper.selectServiceTaskByTaskid(serviceSubtask.getTaskid());
                        if (ivrTask.getSendState() != null && ivrTask.getSendState() == 3 || ivrTask.getSendState() != null && ivrTask.getSendState() == 4) {
                            //如何任务被“暂停”或“终止”
                            break;
@@ -198,20 +188,22 @@
                        //任务发送记录(这个代码应该写在phoneTask中,先写在这,后面再改)
                        ServiceSubtaskRecord serviceSubtaskRecord = new ServiceSubtaskRecord();
                        serviceSubtaskRecord.setTaskid(ivrTaskcall1.getTaskid().toString());
                        serviceSubtaskRecord.setTaskid(serviceSubtask.getTaskid().toString());
                        serviceSubtaskRecord.setUuid(UUID.randomUUID().toString());
                        serviceSubtaskRecord.setTasktype(ivrTaskcall1.getType());
                        serviceSubtaskRecord.setTasktype(serviceSubtask.getType());
                        serviceSubtaskRecord.setPreachform("3");
                        serviceSubtaskRecord.setStartTime(System.currentTimeMillis());
                        serviceSubtaskRecordService.insertServiceSubtaskRecord(serviceSubtaskRecord);
                        //通过多线程的方式去打电话
                        executorService.submit(new PhoneTask(ivrTaskcall1, ivrTaskTemplateVO1, redisCache, sendService, phonePath, robotPhoneUtils));
                        executorService.submit(new PhoneTask(serviceSubtask, ivrTaskTemplateVO1, redisCache, sendService, phonePath, robotPhoneUtils));
                    }
                } else if (descByCode.equals("多媒体")) {
                    //多媒体
                    return;
                } else if (descByCode.equals("纸质")) {
                    //纸质
                    return;
                } else if (descByCode.equals("短信")) {
                    //短信
//                        http://localhost:8099/followvisit/particty?param1=3&param2=348
@@ -219,8 +211,8 @@
                    RSAPublicKeyExample rsaPublicKeyExample = new RSAPublicKeyExample();
                    String taskId = rsaPublicKeyExample.encryptedData(ivrTask1.getTaskid().toString(), pub_key);
                    for (ServiceSubtask ivrTaskSingle : ivrTaskcalls) {
                        String patid = rsaPublicKeyExample.encryptedData(ivrTaskSingle.getPatid().toString(), pub_key);
                    for (ServiceSubtask serviceSubtask : selectServiceSubtaskList) {
                        String patid = rsaPublicKeyExample.encryptedData(serviceSubtask.getPatid().toString(), pub_key);
                        SendMagParam sendMagParam = new SendMagParam();
                        sendMagParam.setType("4");
                        sendMagParam.setUrl(ip + ":" + req_path + "/followvisit/particty?param1=" + taskId + "&param2=" + patid);
@@ -229,9 +221,9 @@
                        //任务发送记录
                        ServiceSubtaskRecord serviceSubtaskRecord = new ServiceSubtaskRecord();
                        serviceSubtaskRecord.setTaskid(ivrTaskSingle.getTaskid().toString());
                        serviceSubtaskRecord.setTaskid(serviceSubtask.getTaskid().toString());
                        serviceSubtaskRecord.setUuid(UUID.randomUUID().toString());
                        serviceSubtaskRecord.setTasktype(ivrTaskSingle.getType());
                        serviceSubtaskRecord.setTasktype(serviceSubtask.getType());
                        serviceSubtaskRecord.setPreachform("4");
                        serviceSubtaskRecord.setStartTime(System.currentTimeMillis());
                        serviceSubtaskRecord.setResult(aBoolean == true ? "成功" : "失败");
@@ -242,24 +234,26 @@
                    //公众号
                    RSAPublicKeyExample rsaPublicKeyExample = new RSAPublicKeyExample();
                    String taskId = rsaPublicKeyExample.encryptedData(ivrTask1.getTaskid().toString(), pub_key);
                    for (ServiceSubtask ivrTaskSingle : ivrTaskcalls) {
                        String patid = rsaPublicKeyExample.encryptedData(ivrTaskSingle.getPatid().toString(), pub_key);
                    for (ServiceSubtask serviceSubtask : selectServiceSubtaskList) {
                        String patid = rsaPublicKeyExample.encryptedData(serviceSubtask.getPatid().toString(), pub_key);
                        SendMagParam sendMagParam = new SendMagParam();
                        sendMagParam.setType("5");
                        sendMagParam.setUrl(ip + ":" + req_path + "/outsideChain?param1=" + ivrTask1.getTaskid().toString() + "&param2=" + ivrTaskSingle.getPatid().toString() + "&param3=" + ivrTask1.getTaskName());
                        sendMagParam.setUrl(ip + ":" + req_path + "/outsideChain?param1=" + ivrTask1.getTaskid().toString() + "&param2=" + serviceSubtask.getPatid().toString() + "&param3=" + ivrTask1.getTaskName());
                        log.info("链接完整路径:{}", req_path + "/outsideChain?param1=" + taskId + "&param2=" + patid + "&param3=" + ivrTask1.getTaskName());
                        //这个模板ID先写死,后面做成可选
                        sendMagParam.setTmpCode("oG3pJHPVWpE81DmZsua_2tKwgJ97r0qz37z56ns7NB4");
                        Map map = new HashMap();
                        map.put("first", ivrTask1.getTaskName());
                        sendMagParam.setContent(JSON.toJSONString(map));
                        sendMagParam.setOpenid(serviceSubtask.getOpenid());
                        Boolean aBoolean = sendService.sendMsg(sendMagParam);
                        //任务发送记录
                        ServiceSubtaskRecord serviceSubtaskRecord = new ServiceSubtaskRecord();
                        serviceSubtaskRecord.setTaskid(ivrTaskSingle.getTaskid().toString());
                        serviceSubtaskRecord.setTaskid(serviceSubtask.getTaskid().toString());
                        serviceSubtaskRecord.setUuid(UUID.randomUUID().toString());
                        serviceSubtaskRecord.setTasktype(ivrTaskSingle.getType());
                        serviceSubtaskRecord.setTasktype(serviceSubtask.getType());
                        serviceSubtaskRecord.setPreachform("4");
                        serviceSubtaskRecord.setStartTime(System.currentTimeMillis());
                        serviceSubtaskRecord.setResult(aBoolean == true ? "成功" : "失败");
@@ -294,7 +288,7 @@
                //通过模板ID获取模板问题
                IvrTaskTemplateVO ivrTaskTemplateVO = new IvrTaskTemplateVO();
                ivrTaskTemplateVO.setID(Long.valueOf(commonTaskcallMQ.getTemplateid()));
                ivrTaskTemplateVO.setId(Long.valueOf(commonTaskcallMQ.getTemplateid()));
                IvrTaskTemplateVO ivrTaskTemplateVO1 = ivrTaskTemplateService.selectInfoByCondition(ivrTaskTemplateVO);
                //通过任务ID拿到患者信息
ruoyi-admin/src/main/java/com/ruoyi/web/controller/hanler/ChatWebSocketHandler.java
@@ -117,7 +117,7 @@
            if (socketMessage.getTemplateId() != null) {
                //通过模板ID获取模板问题
                IvrTaskTemplateVO ivrTaskTemplateVO = new IvrTaskTemplateVO();
                ivrTaskTemplateVO.setID(socketMessage.getTemplateId());
                ivrTaskTemplateVO.setId(socketMessage.getTemplateId());
                IvrTaskTemplateVO ivrTaskTemplateVO1 = ivrTaskTemplateService.selectInfoByCondition(ivrTaskTemplateVO);
                redisCache.setCacheObject(userId + "ivrTaskTemplateVO1", ivrTaskTemplateVO1, 120, TimeUnit.MINUTES);
                //将查出来的问题,放到全局变量中去
@@ -352,8 +352,8 @@
                                if (ivrLibaExtemplatescript.getIsEnd() == 1) {
                                    //将问题置空
                                    IvrTaskTemplateScriptVO nowQuestion1 = returnQues.getNowQuestion();
                                    nowQuestion1.setQuestionText(null);
                                    nowQuestion1.setQuestionVoice(null);
                                    nowQuestion1.setScriptContent(null);
                                    nowQuestion1.setScriptVoice(null);
                                    returnQues.setNowQuestion(nowQuestion1);
                                    redisCache.setCacheObject(userId + "returnQues", returnQues, 120, TimeUnit.MINUTES);
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/IvrLibaScriptController.java
@@ -6,6 +6,7 @@
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.exception.base.BaseException;
import com.ruoyi.common.utils.PageUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.smartor.domain.IvrLibaScript;
import com.smartor.domain.IvrLibaScriptVO;
@@ -40,7 +41,7 @@
    @PreAuthorize("@ss.hasPermi('system:script:list')")
    @PostMapping("/list")
    public TableDataInfo list(@RequestBody IvrLibaScript ivrLibaScript) {
        startPage();
        PageUtils.startPageByPost(ivrLibaScript.getPageNum(),ivrLibaScript.getPageSize());
        List<IvrLibaScript> list = ivrLibaScriptService.selectIvrLibaScriptList(ivrLibaScript);
        return getDataTable(list);
    }
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/tools/WeChatController.java
@@ -76,11 +76,11 @@
     * @param weChatSendVo
     * @return
     */
    @ApiOperation("微信公众号信息发送")
    @PostMapping("/sendMessageToFollowers")
    public AjaxResult sendMessageToFollowers(@RequestBody WeChatSendVo weChatSendVo) {
        return toAjax(weChatService.sendMessageToFollowers(weChatSendVo));
    }
//    @ApiOperation("微信公众号信息发送")
//    @PostMapping("/sendMessageToFollowers")
//    public AjaxResult sendMessageToFollowers(@RequestBody WeChatSendVo weChatSendVo) {
//        return toAjax(weChatService.sendMessageToFollowers(weChatSendVo));
//    }
    /**
ruoyi-admin/src/main/java/com/ruoyi/web/task/PhoneTask.java
@@ -57,7 +57,7 @@
                    for (IvrTaskTemplateScriptVO ivrTaskTemplateScriptVO : ivrTaskTemplateScriptVO) {
                        for (Map<String, String> map : mapList) {
                            for (String key : map.keySet()) {
                                ivrTaskTemplateScriptVO.setQuestionText(ivrTaskTemplateScriptVO.getQuestionText().replace(key, map.get(key)));
                                ivrTaskTemplateScriptVO.setScriptContent(ivrTaskTemplateScriptVO.getScriptContent().replace(key, map.get(key)));
                            }
                        }
                    }
@@ -81,11 +81,11 @@
                redisCache.setCacheObject(uuid + "returnQues", returnQues, 120, TimeUnit.MINUTES);
                redisCache.setCacheObject(uuid + "ivrTaskTemplateVO", ivrTaskTemplateVO, 120, TimeUnit.MINUTES);
                System.out.println("----------------uuID为 :" + uuid + "       " + ivrTaskSingle.getSendname() + "       " + returnQues.getNowQuestion().getQuestionText() + "     " + ivrTaskSingle.getPhone());
                System.out.println("----------------uuID为 :" + uuid + "       " + ivrTaskSingle.getSendname() + "       " + returnQues.getNowQuestion().getScriptContent() + "     " + ivrTaskSingle.getPhone());
                //先将话术放到ob_queue队列中
                IvrTaskcallPhoneMQ ivrTaskcallPhoneMQ = new IvrTaskcallPhoneMQ();
                ivrTaskcallPhoneMQ.setScript(ivrTaskTemplateVO.getRevisitBefore() + returnQues.getNowQuestion().getQuestionText());
                ivrTaskcallPhoneMQ.setScript(ivrTaskTemplateVO.getRevisitBefore() + returnQues.getNowQuestion().getScriptContent());
                ivrTaskcallPhoneMQ.setType("1");
                ivrTaskcallPhoneMQ.setUuid(uuid);
                String data = JSON.toJSONString(ivrTaskcallPhoneMQ);
@@ -93,7 +93,7 @@
                //调用机器人电话,开始电话
                String ob = phoneUtils.ob("", "", "", "", "", "", "", ivrTaskSingle.getPhone(), uuid, true);
                System.out.println("----------------uuID为 :" + uuid + "       " + ivrTaskSingle.getSendname() + "       " + returnQues.getNowQuestion().getQuestionText() + "     " + ivrTaskSingle.getPhone() + "----------已经拨打");
                System.out.println("----------------uuID为 :" + uuid + "       " + ivrTaskSingle.getSendname() + "       " + returnQues.getNowQuestion().getScriptContent() + "     " + ivrTaskSingle.getPhone() + "----------已经拨打");
                Map<String, String> obMap = objectMapper.readValue(ob, Map.class);
                Thread.sleep(1000);
                redisCache.setCacheObject(uuid + "state_id", "0", 10, TimeUnit.MINUTES);
ruoyi-admin/src/main/java/com/ruoyi/web/test/WeChatService.java
@@ -81,7 +81,7 @@
            map.put("keyword2", "12657698798797");
            map.put("remark", "啊啊撒啊啊啊");
            weChatSendVo.setContent(map);
            weChatController.sendMessageToFollowers(weChatSendVo);
//            weChatController.sendMessageToFollowers(weChatSendVo);
        }
    }
ruoyi-admin/src/main/resources/application-druid.yml
@@ -135,3 +135,5 @@
#二维码路径
qrpath: D:\qrcode
localIP: 192.168.2.8
smartor/src/main/java/com/smartor/common/SendService.java
@@ -74,6 +74,7 @@
                    e.printStackTrace();
                }
                weChatSendVo.setContent(map);
                weChatSendVo.setOpenid(sendMagParam.getOpenid());
                Boolean aBoolean1 = weChatService.sendMessageToFollowers(weChatSendVo);
                return aBoolean1;
            case ("6"):
smartor/src/main/java/com/smartor/domain/CommonTaskcallMQ.java
@@ -63,6 +63,6 @@
     * 发送时间段
     */
    @ApiModelProperty(value = "发送时间段 ")
    private List<TaskSendTimeVO> sendTimeslot;
    private TaskSendTimeVO sendTimeslot;
}
smartor/src/main/java/com/smartor/domain/IvrLibaScript.java
@@ -316,5 +316,18 @@
    @ApiModelProperty(value = "标签")
    private String tag;
    /**
     * pageNum
     */
    @ApiModelProperty(value = "pageNum")
    @Excel(name = "pageNum")
    private Integer pageNum;
    /**
     * pageSize
     */
    @ApiModelProperty(value = "pageSize")
    @Excel(name = "pageSize")
    private Integer pageSize;
}
smartor/src/main/java/com/smartor/domain/IvrLibaTarget.java
@@ -34,6 +34,13 @@
    @Excel(name = "分组ID")
    @ApiModelProperty(value = "分组ID")
    private String groupid;
    /**
     * 适用题型(单选、多选、埴空、组合)
     */
    @Excel(name = "适用题型(单选、多选、埴空、组合)")
    @ApiModelProperty(value = "适用题型(单选、多选、埴空、组合)")
    private String scriptType;
    /**
     * 指标类型
smartor/src/main/java/com/smartor/domain/IvrLibaTargetVO.java
@@ -39,6 +39,13 @@
    private String groupid;
    /**
     * 适用题型(单选、多选、埴空、组合)
     */
    @Excel(name = "适用题型(单选、多选、埴空、组合)")
    @ApiModelProperty(value = "适用题型(单选、多选、埴空、组合)")
    private String scriptType;
    /**
     * 指标类型
     */
    @Excel(name = "指标类型")
smartor/src/main/java/com/smartor/domain/IvrLibaTemplateScriptVO.java
@@ -60,7 +60,7 @@
     */
    @Excel(name = "话术内容")
    @ApiModelProperty(value = "话术内容")
    private String scriptConten;
    private String scriptContent;
    /**
     * 话术描述
smartor/src/main/java/com/smartor/domain/IvrTaskTemplate.java
@@ -24,7 +24,7 @@
     * 主键
     */
    @ApiModelProperty(value = "主键")
    private Long ID;
    private Long id;
    /**
     * 任务id
smartor/src/main/java/com/smartor/domain/IvrTaskTemplateScript.java
@@ -34,12 +34,6 @@
    @ApiModelProperty(value = "任务id")
    private Long taskid;
    /**
     * 模板话术编号
     */
    @Excel(name = "模板话术编号")
    @ApiModelProperty(value = "模板话术编号")
    private Long templateQuestionNum;
    /**
     * 模板ID
@@ -48,12 +42,6 @@
    @ApiModelProperty(value = "模板ID")
    private Long templateID;
    /**
     * 话术ID
     */
    @Excel(name = "话术ID")
    @ApiModelProperty(value = "话术ID")
    private Long scriptID;
    /**
     * 问题点
@@ -61,20 +49,6 @@
    @Excel(name = "问题点")
    @ApiModelProperty(value = "问题点")
    private String questionPoint;
    /**
     * 话术内容
     */
    @Excel(name = "话术内容")
    @ApiModelProperty(value = "话术内容")
    private String questionText;
    /**
     * 话术语音
     */
    @Excel(name = "话术语音")
    @ApiModelProperty(value = "话术语音")
    private String questionVoice;
    /**
     * 无匹配话术
@@ -229,20 +203,6 @@
    @Excel(name = "基础指标值")
    @ApiModelProperty(value = "基础指标值")
    private String targetvalue;
    /**
     * 标题
     */
    @Excel(name = "标题")
    @ApiModelProperty(value = "标题")
    private String questiontitle;
    /**
     * 下一题
     */
    @Excel(name = "下一题")
    @ApiModelProperty(value = "下一题")
    private Long nextQuestion;
    /**
     * 其它数据(存储变量)
smartor/src/main/java/com/smartor/domain/IvrTaskTemplateScriptVO.java
@@ -41,7 +41,7 @@
     */
    @Excel(name = "模板话术编号")
    @ApiModelProperty(value = "模板话术编号")
    private Long templateQuestionNum;
    private Long scriptno;
    /**
     * 模板ID
@@ -69,14 +69,14 @@
     */
    @Excel(name = "话术内容")
    @ApiModelProperty(value = "话术内容")
    private String questionText;
    private String scriptContent;
    /**
     * 话术语音
     */
    @Excel(name = "话术语音")
    @ApiModelProperty(value = "话术语音")
    private String questionVoice;
    private String scriptVoice;
    /**
     * 无匹配话术
@@ -237,14 +237,14 @@
     */
    @Excel(name = "标题")
    @ApiModelProperty(value = "标题")
    private String questiontitle;
    private String scriptTopic;
    /**
     * 下一题
     */
    @Excel(name = "下一题")
    @ApiModelProperty(value = "下一题")
    private Long nextQuestion;
    private Long nextScriptno;
    /**
     * 其它数据(存储变量)
smartor/src/main/java/com/smartor/domain/IvrTaskTemplateVO.java
@@ -26,7 +26,7 @@
     * 主键
     */
    @ApiModelProperty(value = "主键")
    private Long ID;
    private Long id;
    /**
     * 任务id
smartor/src/main/java/com/smartor/domain/PatTaskRelevance.java
@@ -34,6 +34,13 @@
    private Long patid;
    /**
     * 微信公众号患者ID
     */
    @Excel(name = "微信公众号患者ID")
    @ApiModelProperty("微信公众号患者ID")
    private String openid;
    /**
     * 宣教任务ID
     */
    @Excel(name = "宣教任务ID")
smartor/src/main/java/com/smartor/domain/SendMagParam.java
@@ -17,4 +17,6 @@
    private String tmpCode;
    private String url;
    private String openid;
}
smartor/src/main/java/com/smartor/domain/SendTaskVO.java
@@ -31,7 +31,7 @@
     */
    @Excel(name = " 任务类型:  1  随访   2 问卷    3 宣教 ")
    @ApiModelProperty(value = "任务类型:  1  随访   2 问卷    3 宣教 ")
    private Integer taskType = 1;
    private Integer taskType;
}
smartor/src/main/java/com/smartor/domain/ServiceSubtask.java
@@ -47,6 +47,13 @@
    private String phone;
    /**
     * 手机号
     */
    @Excel(name = " 手机号 ")
    @ApiModelProperty(value = "手机号")
    private String openid;
    /**
     * 性别
     */
    @Excel(name = "  性别")
smartor/src/main/java/com/smartor/domain/ServiceTaskVO.java
@@ -152,7 +152,7 @@
    /**
     *
     */
    @Excel(name = "  ")
    @Excel(name = "类型名称")
    private String typename;
    /**
smartor/src/main/java/com/smartor/domain/SvyLibScript.java
@@ -28,30 +28,17 @@
    private Long id;
    /**
     * 老版本ID
     */
    @ApiModelProperty("老版本ID")
    private Long oldid;
    /**
     * 问券题目分类ID
     */
    @ApiModelProperty("分类ID")
    private Long categoryid;
    /**
     * 问卷ID
     */
    @Excel(name = " 问卷ID ")
    @ApiModelProperty("问卷ID")
    private Long svyid;
    /**
     * 题目类型;枚举 1.单选 2多选 3填空
     */
    @Excel(name = " 题目类型;枚举 1.单选 2多选 3填空 ")
    @ApiModelProperty("题目类型;枚举 1.单选 2多选 3填空")
    private String scripttype = "";
    private String scriptType = "";
    /**
     * 题目Code
smartor/src/main/java/com/smartor/domain/SvyLibTemplateScript.java
@@ -29,6 +29,14 @@
    @ApiModelProperty("自增ID")
    private Long id;
    /**
     * 问卷ID
     */
    @Excel(name = " 问卷模板ID ")
    @ApiModelProperty("问卷模板ID")
    private Long svyid;
    /**
     * 题目类型;枚举 1.单选 2多选 3填空 4其它
smartor/src/main/java/com/smartor/domain/WeChatSendVo.java
@@ -33,4 +33,10 @@
    @ApiModelProperty(value = "跳转URL")
    String url;
    /**
     * 用户微信ID
     */
    @ApiModelProperty(value = "用户微信ID")
    String openid;
}
smartor/src/main/java/com/smartor/service/impl/CommonTaskServiceImpl.java
@@ -67,8 +67,8 @@
            serviceTask.setTaskid(sendTaskVO.getTaskId());
            serviceTask.setStopState(ivrTask.getStopState() + 1);
            serviceTask.setSendState(sendTaskVO.getSendState());
            ivrTaskService.updateServiceTask(serviceTask);
            return 0;
            int i = ivrTaskService.updateServiceTask(serviceTask);
            return i;
        }
        //判断发送状态是否为空
@@ -86,6 +86,7 @@
            serviceTask.setTaskid(ivrTask.getTaskid());
            serviceTask.setSendState(2);
            ivrTaskService.updateServiceTask(serviceTask);
            log.error("消息发送成功");
        } else if (StringUtils.isNotEmpty(sendTaskVO.getSendType()) && sendTaskVO.getSendType().equals("1") || StringUtils.isNotEmpty(sendTaskVO.getSendType()) && sendTaskVO.getSendType().equals("3")) {
            //时间段发送
            ObjectMapper objectMapper = new ObjectMapper();
@@ -98,9 +99,9 @@
                    log.error("JsonProcessingException报错了:{}", e.getMessage());
                }
                for (TaskSendTimeVO taskSendTimeVO : taskSendTimeVOList) {
                    //去SendTimeslot中,获取所有的时间段
                    List<TaskSendTimeVO> list = new ArrayList<>();
                    list.add(taskSendTimeVO);
//                    //去SendTimeslot中,获取所有的时间段
//                    List<TaskSendTimeVO> list = new ArrayList<>();
//                    list.add(taskSendTimeVO);
                    //获取开始发送时间
                    String begantime = taskSendTimeVO.getBegantime();
@@ -111,14 +112,15 @@
                        Date date = sdf.parse(begantime);
                        milliseconds = date.getTime() - System.currentTimeMillis();
                        System.out.println("日期毫秒数:" + milliseconds);
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                    SendTaskVO sendTaskVO1 = DtoConversionUtils.sourceToTarget(sendTaskVO, SendTaskVO.class);
                    sendTaskVO1.setSendType("1");
                    String content = sendMQContent(sendTaskVO1, ivrTask.getTemplateid().toString(), ivrTask.getPreachform(), ivrTask.getStopState(), list);
                        String content = sendMQContent(sendTaskVO1, ivrTask.getTemplateid().toString(), ivrTask.getPreachform(), ivrTask.getStopState(), taskSendTimeVO);
                    redisCache.setCacheObject(content, content, milliseconds / 1000, TimeUnit.SECONDS);
                    } catch (Exception e) {
                        e.printStackTrace();
                        if (milliseconds < 0)
                            throw new BaseException("请检查任务开始时间,不能小于当前时间");
                    }
                }
                //将任务状态修改成执行中
                ServiceTask serviceTask = new ServiceTask();
@@ -126,8 +128,7 @@
                serviceTask.setSendState(2);
                ivrTaskService.updateServiceTask(serviceTask);
            }
        }
        return 1;
        } return 1;
    }
    public int wjSend(SendTaskVO sendTaskVO) {
@@ -171,8 +172,8 @@
                }
                for (TaskSendTimeVO taskSendTimeVO : taskSendTimeVOList) {
                    //去SendTimeslot中,获取所有的时间段
                    List<TaskSendTimeVO> list = new ArrayList<>();
                    list.add(taskSendTimeVO);
//                    List<TaskSendTimeVO> list = new ArrayList<>();
//                    list.add(taskSendTimeVO);
                    //获取开始发送时间
                    String begantime = taskSendTimeVO.getBegantime();
@@ -189,7 +190,7 @@
                    SendTaskVO sendTaskVO1 = DtoConversionUtils.sourceToTarget(sendTaskVO, SendTaskVO.class);
                    sendTaskVO1.setSendType("1");
                    String content = sendMQContent(sendTaskVO1, serviceTask1.getTemplateid().toString(), serviceTask1.getPreachform(), serviceTask1.getStopState(), list);
                    String content = sendMQContent(sendTaskVO1, serviceTask1.getTemplateid().toString(), serviceTask1.getPreachform(), serviceTask1.getStopState(), taskSendTimeVO);
                    redisCache.setCacheObject(content, content, milliseconds / 1000, TimeUnit.SECONDS);
                }
                //将任务状态修改成执行中
@@ -243,8 +244,8 @@
                }
                for (TaskSendTimeVO taskSendTimeVO : taskSendTimeVOList) {
                    //去SendTimeslot中,获取所有的时间段
                    List<TaskSendTimeVO> list = new ArrayList<>();
                    list.add(taskSendTimeVO);
//                    List<TaskSendTimeVO> list = new ArrayList<>();
//                    list.add(taskSendTimeVO);
                    //获取开始发送时间
                    String begantime = taskSendTimeVO.getBegantime();
@@ -261,7 +262,7 @@
                    SendTaskVO sendTaskVO1 = DtoConversionUtils.sourceToTarget(sendTaskVO, SendTaskVO.class);
                    sendTaskVO1.setSendType("1");
                    String content = sendMQContent(sendTaskVO1, serviceTask1.getTemplateid().toString(), serviceTask1.getPreachform(), serviceTask1.getStopState(), list);
                    String content = sendMQContent(sendTaskVO1, serviceTask1.getTemplateid().toString(), serviceTask1.getPreachform(), serviceTask1.getStopState(), taskSendTimeVO);
                    redisCache.setCacheObject(content, content, milliseconds / 1000, TimeUnit.SECONDS);
                }
                //将任务状态修改成执行中
@@ -284,7 +285,7 @@
     * @param sendTimeslot
     * @return
     */
    private String sendMQContent(SendTaskVO sendTaskVO, String templateid, String preachform, Long stopState, List<TaskSendTimeVO> sendTimeslot) {
    private String sendMQContent(SendTaskVO sendTaskVO, String templateid, String preachform, Long stopState, TaskSendTimeVO sendTimeslot) {
        CommonTaskcallMQ commonTaskcallMQ = new CommonTaskcallMQ();
        commonTaskcallMQ.setTaskid(sendTaskVO.getTaskId());
        commonTaskcallMQ.setSendType(sendTaskVO.getSendType());
smartor/src/main/java/com/smartor/service/impl/IvrTaskTemplateServiceImpl.java
@@ -82,14 +82,14 @@
            //新增
            ivrTaskTemplate.setCreateTime(new Date());
            insertIvrTaskTemplate(ivrTaskTemplate);
            i = ivrTaskTemplate.getID().intValue();
            i = ivrTaskTemplate.getId().intValue();
        } else if (ivrTaskTemplateVO.getIsoperation() != null && ivrTaskTemplateVO.getIsoperation() == 2) {
            //修改
            ivrTaskTemplate.setUpdateTime(new Date());
            updateIvrTaskTemplate(ivrTaskTemplate);
            i = ivrTaskTemplate.getID().intValue();
            i = ivrTaskTemplate.getId().intValue();
        }
        log.info("新增随访任务随访模板的id为:{}", ivrTaskTemplate.getID());
        log.info("新增随访任务随访模板的id为:{}", ivrTaskTemplate.getId());
        //对模板话术和选项进行处理(话术表与指标表进行合并了,)
        if (CollectionUtils.isNotEmpty(ivrTaskTemplateVO.getIvrTaskTemplateScriptVOList())) {
@@ -97,14 +97,14 @@
            for (IvrTaskTemplateScriptVO ivrTaskTemplateScriptVO : ivrTaskTemplateVO.getIvrTaskTemplateScriptVOList()) {
                if (ivrTaskTemplateScriptVO.getIsoperation() != null) {
                    IvrTaskTemplateScript ivrTaskTemplateScript = scriptHandle(ivrTaskTemplate, ivrTaskTemplateScriptVO, ivrTaskTemplateScriptVO.getIsoperation());
                    dealOption(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList(), ivrTaskTemplateScript, ivrTaskTemplate.getID(), ivrTaskTemplateScriptVO.getIsoperation());
                    dealOption(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList(), ivrTaskTemplateScript, ivrTaskTemplate.getId(), ivrTaskTemplateScriptVO.getIsoperation());
                } else {
                    IvrTaskTemplateScript ivrTaskTemplateScript = scriptHandle(ivrTaskTemplate, ivrTaskTemplateScriptVO, ivrTaskTemplateVO.getIsoperation());
                    dealOption(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList(), ivrTaskTemplateScript, ivrTaskTemplate.getID(), ivrTaskTemplateVO.getIsoperation());
                    dealOption(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList(), ivrTaskTemplateScript, ivrTaskTemplate.getId(), ivrTaskTemplateVO.getIsoperation());
                }
            }
        }
        return ivrTaskTemplate.getID().intValue();
        return ivrTaskTemplate.getId().intValue();
    }
@@ -168,7 +168,7 @@
        //查询话术
        IvrTaskTemplateScript ivrTaskTemplateScript = new IvrTaskTemplateScript();
        ivrTaskTemplateScript.setTemplateID(ivrTaskTemplates.get(0).getID());
        ivrTaskTemplateScript.setTemplateID(ivrTaskTemplates.get(0).getId());
        List<IvrTaskTemplateScript> ivrTaskTemplateScripts = ivrTaskTemplateScriptMapper.selectIvrTaskTemplateScriptList(ivrTaskTemplateScript);
        List<IvrTaskTemplateScriptVO> ivrTaskTemplateScriptVOS = DtoConversionUtils.sourceToTarget(ivrTaskTemplateScripts, IvrTaskTemplateScriptVO.class);
@@ -211,13 +211,13 @@
        if (isoperation == 1) {
            //新增
            ivrTaskTemplateScript.setTemplateID(ivrTaskTemplate.getID());
            ivrTaskTemplateScript.setTemplateID(ivrTaskTemplate.getId());
            ivrTaskTemplateScript.setCreateTime(new Date());
            ivrTaskTemplateScriptMapper.insertIvrTaskTemplateScript(ivrTaskTemplateScript);
            ivrTaskTemplateScript.setIsoperation(1);
        } else if (isoperation == 2) {
            //修改
            ivrTaskTemplateScript.setTemplateID(ivrTaskTemplate.getID());
            ivrTaskTemplateScript.setTemplateID(ivrTaskTemplate.getId());
            ivrTaskTemplateScript.setUpdateTime(new Date());
            ivrTaskTemplateScriptMapper.updateIvrTaskTemplateScript(ivrTaskTemplateScript);
            ivrTaskTemplateScript.setIsoperation(2);
smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java
@@ -245,6 +245,7 @@
                    serviceSubtask.setSendstate(1L);
                    serviceSubtask.setType(serviceTaskVO.getHospType());
                    serviceSubtask.setHospType(patTaskRelevance.getHospType());
                    serviceSubtask.setOpenid(patTaskRelevance.getOpenid());
                    serviceSubtaskMapper.insertServiceSubtask(serviceSubtask);
                    integer = serviceSubtask.getId().intValue();
                }
@@ -270,6 +271,7 @@
                    serviceSubtask.setPhone(patTaskRelevance.getPhone());
                    serviceSubtask.setAddr(patTaskRelevance.getAddr());
                    serviceSubtask.setPatid(patTaskRelevance.getPatid());
                    serviceSubtask.setOpenid(patTaskRelevance.getOpenid());
                    serviceSubtask.setType(serviceTaskVO.getHospType());
                    serviceSubtask.setCreateTime(DateUtils.getNowDate());
                    serviceSubtask.setHospType(patTaskRelevance.getHospType());
@@ -349,7 +351,7 @@
                    // 问题,  去调用“tts合成和播放”接口
                    String date = simpleDateFormat1.format(new Date());
                    log.info("去调用tts合成和播放接口: {},uuid为:{}", date, phoneCallBackVO.getUuid());
                    phoneUtils.ttsPlayback(nowQuestion.getQuestionText(), phoneCallBackVO.getUuid());
                    phoneUtils.ttsPlayback(nowQuestion.getScriptContent(), phoneCallBackVO.getUuid());
                }
            } else {
                redisCache.setCacheObject(phoneCallBackVO.getUuid() + "noVoice", noVoice + 1, 120, TimeUnit.MINUTES);
@@ -358,7 +360,7 @@
                //静默话术  + 问题,  去调用“tts合成和播放”接口
                String date = simpleDateFormat1.format(new Date());
                log.info("静默话术  + 问题,去调用tts合成和播放接口: {},uuid为:{}", date, phoneCallBackVO.getUuid());
                phoneUtils.ttsPlayback(slienceText + nowQuestion.getQuestionText(), phoneCallBackVO.getUuid());
                phoneUtils.ttsPlayback(slienceText + nowQuestion.getScriptContent(), phoneCallBackVO.getUuid());
                return;
            }
@@ -379,7 +381,7 @@
                    Pattern pattern2 = Pattern.compile(nowQuestion.getIvrTaskScriptTargetoptionList().get(j).getTargetregex2());
                    matcher2 = pattern2.matcher(phoneCallBackVO.getTextResult());
                }
                log.error("PCB--getQuestionText问题为:{},UUID:{}", nowQuestion.getQuestionText(), phoneCallBackVO.getUuid());
                log.error("PCB--getQuestionText问题为:{},UUID:{}", nowQuestion.getScriptContent(), phoneCallBackVO.getUuid());
                if (StringUtils.isNotEmpty(nowQuestion.getIvrTaskScriptTargetoptionList().get(j).getTargetregex2()) && matcher2.matches() && StringUtils.isNotEmpty(nowQuestion.getIvrTaskScriptTargetoptionList().get(j).getTargetregex()) && matcher.matches() || StringUtils.isEmpty(nowQuestion.getIvrTaskScriptTargetoptionList().get(j).getTargetregex()) && StringUtils.isNotEmpty(nowQuestion.getIvrTaskScriptTargetoptionList().get(j).getTargetregex2()) && matcher2.matches() || StringUtils.isEmpty(nowQuestion.getIvrTaskScriptTargetoptionList().get(j).getTargetregex2()) && StringUtils.isNotEmpty(nowQuestion.getIvrTaskScriptTargetoptionList().get(j).getTargetregex()) && matcher.matches()) {
                    //说明匹配正确了
                    //这里应该先判断类型,去再修改,设置IsUserOperation是单选题的改法
@@ -393,7 +395,7 @@
                    //将患者的回签写进表里
                    IvrTaskVisitResult serviceTaskVisitResult = DtoConversionUtils.sourceToTarget(serviceSubtask, IvrTaskVisitResult.class);
                    serviceTaskVisitResult.setId(null);
                    serviceTaskVisitResult.setQuestion(nowQuestion.getQuestionText());
                    serviceTaskVisitResult.setQuestion(nowQuestion.getScriptContent());
                    serviceTaskVisitResult.setPatientAnswer(phoneCallBackVO.getTextResult());
                    serviceTaskVisitResult.setCreateTime(new Date());
                    serviceTaskVisitResult.setOptionResult(nowQuestion.getIvrTaskScriptTargetoptionList().get(j).getTargetvalue());
@@ -410,7 +412,7 @@
                            questionMessage.setNowQuestion(script);
                            questionMessage.setQuestionList(IvrTaskTemplateScriptVOs);
                            redisCache.setCacheObject(phoneCallBackVO.getUuid() + "returnQues", questionMessage, 120, TimeUnit.MINUTES);
                            phoneUtils.ttsPlayback(script.getQuestionText(), phoneCallBackVO.getUuid());
                            phoneUtils.ttsPlayback(script.getScriptContent(), phoneCallBackVO.getUuid());
                            return;
                        } else if (nextQuestion > IvrTaskTemplateScriptVOs.size()) {
                            //没有下一题了,就结束了
@@ -451,7 +453,7 @@
                        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());
                        phoneUtils.ttsPlayback(nextQuestion.getScriptContent(), phoneCallBackVO.getUuid());
                        return;
                    } else {
                        //就可以挂断电话了
@@ -505,8 +507,8 @@
                        if (ivrLibaExtemplatescript.getIsEnd() == 1) {
                            //将问题置空
                            IvrTaskTemplateScriptVO nowQuestion1 = questionMessage.getNowQuestion();
                            nowQuestion1.setQuestionText(null);
                            nowQuestion1.setQuestionVoice(null);
                            nowQuestion1.setScriptContent(null);
                            nowQuestion1.setScriptVoice(null);
                            questionMessage.setNowQuestion(nowQuestion1);
                            redisCache.setCacheObject(phoneCallBackVO.getUuid() + "returnQues", questionMessage, 120, TimeUnit.MINUTES);
@@ -515,13 +517,13 @@
                        //调用“15、tts合成和播放, tts_playback”将结果传回
                        String date = simpleDateFormat1.format(new Date());
                        log.info("调用“15、tts合成和播放------: {},uuid为:{}", date, phoneCallBackVO.getUuid());
                        phoneUtils.ttsPlayback(nowQuestion.getQuestionText() + ivrTaskTemplateScriptVO.getSubmoduleText(), phoneCallBackVO.getUuid());
                        phoneUtils.ttsPlayback(nowQuestion.getScriptContent() + ivrTaskTemplateScriptVO.getSubmoduleText(), phoneCallBackVO.getUuid());
                    }
                    break;
                }
                String date = simpleDateFormat1.format(new Date());
                log.info("最后的信息回复-: {},uuid为:{}", date, phoneCallBackVO.getUuid());
                phoneUtils.ttsPlayback(nowQuestion.getQuestionText(), phoneCallBackVO.getUuid());
                phoneUtils.ttsPlayback(nowQuestion.getScriptContent(), phoneCallBackVO.getUuid());
            }
        }
    }
smartor/src/main/java/com/smartor/service/impl/ServiceTaskServiceImpl.java
@@ -199,17 +199,17 @@
        //将模板问题话术里的通配符替换
        for (IvrLibaTemplateScriptVO ivrLibaTemplateScriptVO : ivrLibaTemplateScriptVOS) {
            if (StringUtils.isNotEmpty(ivrLibaTemplateScriptVO.getScriptConten())) {
            if (StringUtils.isNotEmpty(ivrLibaTemplateScriptVO.getScriptContent())) {
                for (Map<String, String> map : mapList) {
                    for (String key : map.keySet()) {
                        ivrLibaTemplateScriptVO.setScriptConten(ivrLibaTemplateScriptVO.getScriptConten().replace(key, StringUtils.isNotEmpty(map.get(key)) ? map.get(key) : ""));
                        ivrLibaTemplateScriptVO.setScriptContent(ivrLibaTemplateScriptVO.getScriptContent().replace(key, StringUtils.isNotEmpty(map.get(key)) ? map.get(key) : ""));
                    }
                }
                //替换患者个人信息数据
                ivrLibaTemplateScriptVO.setScriptConten(ivrLibaTemplateScriptVO.getScriptConten().replace("${name}", StringUtils.isNotEmpty(patArchive.getName()) ? patArchive.getName() : ""));
                ivrLibaTemplateScriptVO.setScriptConten(ivrLibaTemplateScriptVO.getScriptConten().replace("${dzz}", StringUtils.isNotEmpty(patArchive.getPlaceOfResidence()) ? patArchive.getPlaceOfResidence() : ""));
                ivrLibaTemplateScriptVO.setScriptConten(ivrLibaTemplateScriptVO.getScriptConten().replace("${dhh}", StringUtils.isNotEmpty(patArchive.getTelcode()) ? patArchive.getTelcode() : ""));
                ivrLibaTemplateScriptVO.setScriptContent(ivrLibaTemplateScriptVO.getScriptContent().replace("${name}", StringUtils.isNotEmpty(patArchive.getName()) ? patArchive.getName() : ""));
                ivrLibaTemplateScriptVO.setScriptContent(ivrLibaTemplateScriptVO.getScriptContent().replace("${dzz}", StringUtils.isNotEmpty(patArchive.getPlaceOfResidence()) ? patArchive.getPlaceOfResidence() : ""));
                ivrLibaTemplateScriptVO.setScriptContent(ivrLibaTemplateScriptVO.getScriptContent().replace("${dhh}", StringUtils.isNotEmpty(patArchive.getTelcode()) ? patArchive.getTelcode() : ""));
                //获取问题选项
                IvrLibaTemplateTargetoption ivrLibaTemplateTargetoption = new IvrLibaTemplateTargetoption();
smartor/src/main/java/com/smartor/service/impl/SvyLibScriptServiceImpl.java
@@ -61,7 +61,7 @@
            if (StringUtils.isNotEmpty(svyLibScripts.get(j).getIcd10Name()))
                svyLibScripts.get(j).setIcd10NameList(JSONArray.parseArray(svyLibScripts.get(j).getIcd10Name(), String.class));
            if (StringUtils.isNotEmpty(svyLibScripts.get(j).getScripttype()) && svyLibScripts.get(j).getScripttype().equals("3") || svyLibScripts.get(j).getId() == null) {
            if (StringUtils.isNotEmpty(svyLibScripts.get(j).getScriptType()) && svyLibScripts.get(j).getScriptType().equals("3") || svyLibScripts.get(j).getId() == null) {
                //作答题,不需要选项
                continue;
            } else {
smartor/src/main/java/com/smartor/service/impl/SvyLibTemplateServiceImpl.java
@@ -12,6 +12,7 @@
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Date;
@@ -60,11 +61,8 @@
        List<SvyLibTemplate> svyLibTemplates = svyLibTemplateMapper.selectSvyLibTemplateList(svyLibTemplateReq);
        //添加题目
        for (int i = 0; i < svyLibTemplates.size(); i++) {
//            SvyLibScript svyLibScript = new SvyLibScript();
//            svyLibScript.setSvyid(svyLibTemplates.get(i).getSvyid());
//            List<SvyLibScript> svyLibTopics = svyLibScriptMapper.selectSvyLibScriptList(svyLibScript);
            SvyLibTemplateScript svyLibTemplateScript = new SvyLibTemplateScript();
            svyLibTemplateScript.setId(svyLibTemplates.get(i).getSvyid());
            svyLibTemplateScript.setSvyid(svyLibTemplates.get(i).getSvyid());
            List<SvyLibTemplateScript> svyLibTemplateScripts = svyLibTemplateScriptMapper.selectSvyLibTemplateScriptList(svyLibTemplateScript);
            //获取题目选项
            a:
@@ -109,40 +107,13 @@
        return libTemplates;
    }
//    /**
//     * 新增问卷
//     *
//     * @param svyLibTemplate 问卷
//     * @return 结果
//     */
//    @Transactional
//    @Override
//    public int insertSvyLibTemplate(SvyLibTemplate svyLibTemplate) {
//        svyLibTemplate.setCreateTime(DateUtils.getNowDate());
//        svyLibTemplateMapper.insertSvyLibTemplate(svyLibTemplate);
//        //关联问卷疾病
//        for (String icdId : svyLibTemplate.getIcdID()) {
//            Icd10Association icd10Association = new Icd10Association();
//            icd10Association.setIcd10code(icdId);
//            icd10Association.setSvyid(svyLibTemplate.getSvyid());
//            icd10AssociationMapper.insertIcd10Association(icd10Association);
//        }
//        //新增问题题目
//        for (int i = 0; i < svyLibTemplate.getSvyLibScripts().size(); i++) {
//            SvyLibScript svyLibScript = svyLibTemplate.getSvyLibScripts().get(i);
//            svyLibScript.setSvyid(svyLibTemplate.getSvyid());
//            //题目的选项目,直接用svy_topicoption表,用svyTopicidf去关联
//            svyLibScriptMapper.insertSvyLibScript(svyLibScript);
//        }
//        return 1;
//    }
    /**
     * 新增或修改问卷模板信息
     *
     * @param svyLibTemplate
     * @return
     */
    @Transactional(rollbackFor = Exception.class)
    @Override
    public Integer saveOrUpdateTemplate(SvyLibTemplate svyLibTemplate) {
        Integer i = null;
@@ -242,14 +213,14 @@
    private void scriptHandle(Long svyid, SvyLibTemplateScript svyLibScript, Integer isoperation) {
        if (isoperation == 1) {
            //新增
            svyLibScript.setId(svyid);
            svyLibScript.setSvyid(svyid);
            svyLibScript.setId(null);
            svyLibScript.setCreateTime(new Date());
            svyLibTemplateScriptMapper.insertSvyLibTemplateScript(svyLibScript);
        } else if (isoperation == 2) {
            //修改
            svyLibScript.setId(svyid);
            svyLibScript.setSvyid(svyid);
            svyLibScript.setUpdateTime(new Date());
            svyLibTemplateScriptMapper.updateSvyLibTemplateScript(svyLibScript);
        } else if (isoperation == 3) {
smartor/src/main/java/com/smartor/service/impl/WeChatServiceImpl.java
@@ -32,13 +32,13 @@
        wxMpConfigStorage.setSecret(appSecret);
        try {
            List<String> openIdList = wxMpService.getUserService().userList(null).getOpenids();
            for (String openId : openIdList) {
                WxMpTemplateMessage templateMessage = WxMpTemplateMessage.builder().toUser(openId).templateId(weChatSendVo.getTemplateId()).url(weChatSendVo.getUrl()).build();
//            for (String openId : openIdList) {
            WxMpTemplateMessage templateMessage = WxMpTemplateMessage.builder().toUser(weChatSendVo.getOpenid()).templateId(weChatSendVo.getTemplateId()).url(weChatSendVo.getUrl()).build();
                for (String key : weChatSendVo.getContent().keySet()) {
                    templateMessage.addData(new WxMpTemplateData(key, weChatSendVo.getContent().get(key).toString()));
                }
                wxMpService.getTemplateMsgService().sendTemplateMsg(templateMessage);
            }
//            }
        } catch (WxErrorException e) {
            e.printStackTrace();
        }
smartor/src/main/resources/mapper/smartor/IvrLibaTargetMapper.xml
@@ -32,11 +32,13 @@
        <result property="suitWay" column="suitWay"/>
        <result property="parameter" column="parameter"/>
        <result property="reply" column="reply"/>
        <result property="scriptType" column="script_type"/>
    </resultMap>
    <resultMap type="com.smartor.domain.IvrLibaTargetVO" id="IvrLibaTargetVOResult">
        <result property="id" column="id"/>
        <result property="groupid" column="groupid"/>
        <result property="scriptType" column="script_type"/>
        <result property="targettype" column="targettype"/>
        <result property="targetname" column="targetname"/>
        <result property="targetdesc" column="targetdesc"/>
@@ -90,6 +92,7 @@
    <sql id="selectIvrLibaTargetVo">
        select id,
               groupid,
               script_type,
               targettype,
               targetname,
               reply,
@@ -107,6 +110,7 @@
            <if test="groupid != null  and groupid != ''">and groupid = #{groupid}</if>
            <if test="targettype != null  and targettype != ''">and targettype = #{targettype}</if>
            <if test="targetname != null  and targetname != ''">and targetname like concat('%', #{targetname}, '%')</if>
            <if test="scriptType != null  and scriptType != ''">and script_type like concat('%', #{scriptType}, '%')</if>
            <if test="targetdesc != null  and targetdesc != ''">and targetdesc = #{targetdesc}</if>
            <if test="language != null  and language != ''">and language = #{language}</if>
            <if test="version != null ">and version = #{version}</if>
@@ -133,6 +137,7 @@
        a.groupid,
        a.targettype,
        a.targetname,
        a.script_type,
        a.targetdesc,
        a.language,
        a.version,
@@ -220,6 +225,7 @@
            <if test="suitWay != null and suitWay != ''">suitWay,</if>
            <if test="parameter != null and parameter != ''">parameter,</if>
            <if test="reply != null and reply != ''">reply,</if>
            <if test="scriptType != null and scriptType != ''">script_type,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="groupid != null">#{groupid},</if>
@@ -250,6 +256,7 @@
            <if test="suitWay != null and suitWay != ''">#{suitWay},</if>
            <if test="parameter != null and parameter != ''">#{parameter},</if>
            <if test="reply != null and reply != ''">#{reply},</if>
            <if test="scriptType != null and scriptType != ''">#{scriptType},</if>
        </trim>
    </insert>
@@ -282,6 +289,7 @@
            <if test="isAvailable != null and isAvailable != ''">isAvailable = #{isAvailable},</if>
            <if test="parameter != null and parameter != ''">parameter = #{parameter},</if>
            <if test="reply != null and reply != ''">reply = #{reply},</if>
            <if test="scriptType != null and scriptType != ''">script_type = #{scriptType},</if>
        </trim>
        where id = #{id}
    </update>
smartor/src/main/resources/mapper/smartor/IvrLibaTemplateScriptMapper.xml
@@ -49,7 +49,7 @@
               templateID,
               scriptID,
               script_point,
               scrpt_content,
               script_content,
               script_desc,
               script_voice,
               noMatchText,
smartor/src/main/resources/mapper/smartor/IvrTaskTemplateMapper.xml
@@ -5,7 +5,7 @@
<mapper namespace="com.smartor.mapper.IvrTaskTemplateMapper">
    <resultMap type="com.smartor.domain.IvrTaskTemplate" id="IvrTaskTemplateResult">
        <result property="ID" column="ID"/>
        <result property="id" column="id"/>
        <result property="taskid" column="taskid"/>
        <result property="taskname" column="taskname"/>
        <result property="targetid" column="targetid"/>
@@ -63,7 +63,7 @@
    </resultMap>
    <sql id="selectIvrTaskTemplateVo">
        select ID,
        select id,
               taskid,
               recallcount,
               instruction,
@@ -86,6 +86,7 @@
        <include refid="selectIvrTaskTemplateVo"/>
        <where>
            <if test="taskid != null ">and taskid = #{taskid}</if>
            <if test="id != null ">and id = #{id}</if>
            <if test="taskname != null  and taskname != ''">and taskname like concat('%', #{taskname}, '%')</if>
            <if test="targetid != null ">and targetid = #{targetid}</if>
            <if test="targetname != null  and targetname != ''">and targetname like concat('%', #{targetname}, '%')</if>
@@ -143,11 +144,11 @@
    <select id="selectIvrTaskTemplateByID" parameterType="Long" resultMap="IvrTaskTemplateResult">
        <include refid="selectIvrTaskTemplateVo"/>
        where ID = #{ID}
        where id = #{id}
    </select>
    <insert id="insertIvrTaskTemplate" parameterType="com.smartor.domain.IvrTaskTemplate" useGeneratedKeys="true"
            keyProperty="ID">
            keyProperty="id">
        insert into ivr_task_template
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="taskid != null">taskid,</if>
@@ -321,19 +322,19 @@
            <if test="libtemplatename != null ">libtemplatename = #{libtemplatename},</if>
            <if test="instruction != null ">instruction = #{instruction},</if>
        </trim>
        where ID = #{ID}
        where id = #{id}
    </update>
    <delete id="deleteIvrTaskTemplateByID" parameterType="Long">
        delete
        from ivr_task_template
        where ID = #{ID}
        where id = #{id}
    </delete>
    <delete id="deleteIvrTaskTemplateByIDs" parameterType="String">
        delete from ivr_task_template where ID in
        <foreach item="ID" collection="array" open="(" separator="," close=")">
            #{ID}
        delete from ivr_task_template where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
</mapper>
smartor/src/main/resources/mapper/smartor/IvrTaskTemplateScriptMapper.xml
@@ -7,12 +7,8 @@
    <resultMap type="com.smartor.domain.IvrTaskTemplateScript" id="IvrTaskTemplateScriptResult">
        <result property="ID"    column="ID"    />
        <result property="taskid"    column="taskid"    />
        <result property="templateQuestionNum"    column="templateQuestionNum"    />
        <result property="templateID"    column="templateID"    />
        <result property="scriptID"    column="scriptID"    />
        <result property="questionPoint"    column="questionPoint"    />
        <result property="questionText"    column="questionText"    />
        <result property="questionVoice"    column="questionVoice"    />
        <result property="noMatchText"    column="noMatchText"    />
        <result property="noMatchVoice"    column="noMatchVoice"    />
        <result property="slienceText"    column="slienceText"    />
@@ -39,27 +35,21 @@
        <result property="targettype"    column="targettype"    />
        <result property="targetid"    column="targetid"    />
        <result property="targetvalue"    column="targetvalue"    />
        <result property="questiontitle"    column="questiontitle"    />
        <result property="nextQuestion"    column="next_question"    />
        <result property="otherdata"    column="otherdata"    />
        <result property="isMust"    column="is_must"    />
        <result property="questionResult"    column="question_result"    />
    </resultMap>
    <sql id="selectIvrTaskTemplateScriptVo">
        select ID, taskid, templateQuestionNum, templateID, scriptID, questionPoint, questionText, questionVoice, noMatchText, noMatchVoice, slienceText, slienceVoice, submoduleText, submoduleVoice, noClearlyText, noClearlyVoice, categoryName, targetOptions, language, playWavOnly, value_type, del_flag, update_by, update_time, create_by, create_time, isupload, upload_time, orgid, pid, guid, targettype, targetid, targetvalue, questiontitle, next_question, otherdata, is_must, question_result from ivr_task_template_script
        select ID, taskid,  templateID, questionPoint,  noMatchText, noMatchVoice, slienceText, slienceVoice, submoduleText, submoduleVoice, noClearlyText, noClearlyVoice, categoryName, targetOptions, language, playWavOnly, value_type, del_flag, update_by, update_time, create_by, create_time, isupload, upload_time, orgid, pid, guid, targettype, targetid, targetvalue,  otherdata, is_must, question_result from ivr_task_template_script
    </sql>
    <select id="selectIvrTaskTemplateScriptList" parameterType="com.smartor.domain.IvrTaskTemplateScript" resultMap="IvrTaskTemplateScriptResult">
        <include refid="selectIvrTaskTemplateScriptVo"/>
        <where>
            <if test="taskid != null "> and taskid = #{taskid}</if>
            <if test="templateQuestionNum != null "> and templateQuestionNum = #{templateQuestionNum}</if>
            <if test="templateID != null "> and templateID = #{templateID}</if>
            <if test="scriptID != null "> and scriptID = #{scriptID}</if>
            <if test="questionPoint != null  and questionPoint != ''"> and questionPoint = #{questionPoint}</if>
            <if test="questionText != null  and questionText != ''"> and questionText = #{questionText}</if>
            <if test="questionVoice != null  and questionVoice != ''"> and questionVoice = #{questionVoice}</if>
            <if test="noMatchText != null  and noMatchText != ''"> and noMatchText = #{noMatchText}</if>
            <if test="noMatchVoice != null  and noMatchVoice != ''"> and noMatchVoice = #{noMatchVoice}</if>
            <if test="slienceText != null  and slienceText != ''"> and slienceText = #{slienceText}</if>
@@ -81,8 +71,6 @@
            <if test="targettype != null  and targettype != ''"> and targettype = #{targettype}</if>
            <if test="targetid != null "> and targetid = #{targetid}</if>
            <if test="targetvalue != null  and targetvalue != ''"> and targetvalue = #{targetvalue}</if>
            <if test="questiontitle != null  and questiontitle != ''"> and questiontitle = #{questiontitle}</if>
            <if test="nextQuestion != null "> and next_question = #{nextQuestion}</if>
            <if test="otherdata != null  and otherdata != ''"> and otherdata = #{otherdata}</if>
            <if test="isMust != null  and isMust != ''"> and is_must = #{isMust}</if>
            <if test="questionResult != null  and questionResult != ''"> and question_result = #{questionResult}</if>
@@ -98,12 +86,8 @@
        insert into ivr_task_template_script
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="taskid != null">taskid,</if>
            <if test="templateQuestionNum != null">templateQuestionNum,</if>
            <if test="templateID != null">templateID,</if>
            <if test="scriptID != null">scriptID,</if>
            <if test="questionPoint != null">questionPoint,</if>
            <if test="questionText != null">questionText,</if>
            <if test="questionVoice != null">questionVoice,</if>
            <if test="noMatchText != null">noMatchText,</if>
            <if test="noMatchVoice != null">noMatchVoice,</if>
            <if test="slienceText != null">slienceText,</if>
@@ -130,20 +114,14 @@
            <if test="targettype != null">targettype,</if>
            <if test="targetid != null">targetid,</if>
            <if test="targetvalue != null">targetvalue,</if>
            <if test="questiontitle != null">questiontitle,</if>
            <if test="nextQuestion != null">next_question,</if>
            <if test="otherdata != null">otherdata,</if>
            <if test="isMust != null">is_must,</if>
            <if test="questionResult != null">question_result,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="taskid != null">#{taskid},</if>
            <if test="templateQuestionNum != null">#{templateQuestionNum},</if>
            <if test="templateID != null">#{templateID},</if>
            <if test="scriptID != null">#{scriptID},</if>
            <if test="questionPoint != null">#{questionPoint},</if>
            <if test="questionText != null">#{questionText},</if>
            <if test="questionVoice != null">#{questionVoice},</if>
            <if test="noMatchText != null">#{noMatchText},</if>
            <if test="noMatchVoice != null">#{noMatchVoice},</if>
            <if test="slienceText != null">#{slienceText},</if>
@@ -170,8 +148,6 @@
            <if test="targettype != null">#{targettype},</if>
            <if test="targetid != null">#{targetid},</if>
            <if test="targetvalue != null">#{targetvalue},</if>
            <if test="questiontitle != null">#{questiontitle},</if>
            <if test="nextQuestion != null">#{nextQuestion},</if>
            <if test="otherdata != null">#{otherdata},</if>
            <if test="isMust != null">#{isMust},</if>
            <if test="questionResult != null">#{questionResult},</if>
@@ -182,12 +158,8 @@
        update ivr_task_template_script
        <trim prefix="SET" suffixOverrides=",">
            <if test="taskid != null">taskid = #{taskid},</if>
            <if test="templateQuestionNum != null">templateQuestionNum = #{templateQuestionNum},</if>
            <if test="templateID != null">templateID = #{templateID},</if>
            <if test="scriptID != null">scriptID = #{scriptID},</if>
            <if test="questionPoint != null">questionPoint = #{questionPoint},</if>
            <if test="questionText != null">questionText = #{questionText},</if>
            <if test="questionVoice != null">questionVoice = #{questionVoice},</if>
            <if test="noMatchText != null">noMatchText = #{noMatchText},</if>
            <if test="noMatchVoice != null">noMatchVoice = #{noMatchVoice},</if>
            <if test="slienceText != null">slienceText = #{slienceText},</if>
@@ -214,8 +186,6 @@
            <if test="targettype != null">targettype = #{targettype},</if>
            <if test="targetid != null">targetid = #{targetid},</if>
            <if test="targetvalue != null">targetvalue = #{targetvalue},</if>
            <if test="questiontitle != null">questiontitle = #{questiontitle},</if>
            <if test="nextQuestion != null">next_question = #{nextQuestion},</if>
            <if test="otherdata != null">otherdata = #{otherdata},</if>
            <if test="isMust != null">is_must = #{isMust},</if>
            <if test="questionResult != null">question_result = #{questionResult},</if>
smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
@@ -54,11 +54,13 @@
        <result property="patid" column="patid"/>
        <result property="libtemplatename" column="libtemplatename"/>
        <result property="libtemplateid" column="libtemplateid"/>
        <result property="openid" column="openid"/>
    </resultMap>
    <sql id="selectServiceSubtaskVo">
        select id,
               hosp_type,
               openid,
               libtemplateid,
               libtemplatename,
               hospno,
@@ -152,6 +154,7 @@
            <if test="hospType != null  and hospType != ''">and hosp_type = #{hospType}</if>
            <if test="libtemplateid != null ">and libtemplateid = #{libtemplateid},</if>
            <if test="libtemplatename != null ">and libtemplatename = #{libtemplatename},</if>
            <if test="openid != null ">and openid = #{openid},</if>
        </where>
        order by update_time desc,id desc
    </select>
@@ -213,6 +216,7 @@
            <if test="libtemplateid != null ">libtemplateid,</if>
            <if test="libtemplatename != null ">libtemplatename,</if>
            <if test="patid != null ">patid,</if>
            <if test="openid != null ">openid,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="sendname != null">#{sendname},</if>
@@ -263,6 +267,7 @@
            <if test="libtemplateid != null ">#{libtemplateid},</if>
            <if test="libtemplatename != null ">#{libtemplatename},</if>
            <if test="patid != null ">#{patid},</if>
            <if test="openid != null ">#{openid},</if>
        </trim>
    </insert>
@@ -317,6 +322,7 @@
            <if test="libtemplateid != null ">libtemplateid = #{libtemplateid},</if>
            <if test="libtemplatename != null ">libtemplatename = #{libtemplatename},</if>
            <if test="patid != null ">patid = #{patid},</if>
            <if test="openid != null ">openid = #{openid},</if>
        </trim>
        where id = #{id}
    </update>
@@ -372,6 +378,7 @@
            <if test="libtemplateid != null ">libtemplateid = #{libtemplateid},</if>
            <if test="libtemplatename != null ">libtemplatename = #{libtemplatename},</if>
            <if test="patid != null ">patid = #{patid},</if>
            <if test="openid != null ">openid = #{openid},</if>
        </trim>
        where patid = #{patid} and taskid = #{taskid}
    </update>
@@ -399,6 +406,7 @@
               phone,
               sex,
               age,
               openid,
               sfzh,
               addr,
               senderdetail,
smartor/src/main/resources/mapper/smartor/SvyLibScriptMapper.xml
@@ -6,9 +6,7 @@
    <resultMap type="com.smartor.domain.SvyLibScript" id="SvyLibScriptResult">
        <result property="id" column="id"/>
        <result property="oldid" column="oldid"/>
        <result property="svyid" column="svyid"/>
        <result property="scripttype" column="script_type"/>
        <result property="scriptType" column="script_type"/>
        <result property="scriptcode" column="script_code"/>
        <result property="scriptDesc" column="script_desc"/>
        <result property="scriptPicture" column="script_picture"/>
@@ -40,12 +38,10 @@
    <sql id="selectSvyLibScriptVo">
        select id,
               oldid,
               scoretype,
               score,
               value_type,
               reply,
               svyid,
               script_type,
               script_code,
               script_desc,
@@ -78,16 +74,13 @@
        <where>
            del_flag=0
            <if test="id != null ">and id = #{id}</if>
            <if test="oldid != null ">and oldid = #{oldid}</if>
            <if test="scripttype != null and scripttype != ''">and script_type = #{scripttype}</if>
            <if test="scriptType != null and scriptType != ''">and script_type = #{scriptType}</if>
            <if test="categoryid != null ">and categoryid = #{categoryid}</if>
            <if test="script != null  and script != ''">and script like concat('%', #{script}, '%')</if>
            <if test="scriptContent != null  and scriptContent != ''">and script_content like concat('%', #{scriptContent}, '%')</if>
            <if test="icd10Name != null  and icd10Name != ''">and icd10_name like concat('%', #{icd10Name}, '%')</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>
            <if test="scriptContent != null  and scriptContent != ''">and script_content = #{scriptContent}</if>
            <if test="suitway != null  and suitway != ''">and suitway = #{suitway}</if>
            <if test="isavailable != null  and isavailable != ''">and isavailable = #{isavailable}</if>
            <if test="language != null  and language != ''">and language = #{language}</if>
@@ -107,9 +100,7 @@
            keyProperty="id">
        insert into svy_lib_script
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="oldid != null">oldid,</if>
            <if test="svyid != null">svyid,</if>
            <if test="scripttype != null">script_type,</if>
            <if test="scriptType != null">script_type,</if>
            <if test="scriptcode != null">script_code,</if>
            <if test="scriptDesc != null">script_desc,</if>
            <if test="sort != null">sort,</if>
@@ -139,9 +130,7 @@
            <if test="scriptTopic != null  and scriptTopic != ''">script_topic,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="oldid != null">#{oldid},</if>
            <if test="svyid != null">#{svyid},</if>
            <if test="scripttype != null">#{scripttype},</if>
            <if test="scriptType != null">#{scriptType},</if>
            <if test="scriptcode != null">#{scriptcode},</if>
            <if test="scriptDesc != null">#{scriptDesc},</if>
            <if test="sort != null">#{sort},</if>
@@ -175,9 +164,7 @@
    <update id="updateSvyLibScript" parameterType="com.smartor.domain.SvyLibScript">
        update svy_lib_script
        <trim prefix="SET" suffixOverrides=",">
            <if test="oldid != null">oldid = #{oldid},</if>
            <if test="svyid != null">svyid = #{svyid},</if>
            <if test="scripttype != null">script_type = #{scripttype},</if>
            <if test="scriptType != null">script_type = #{scriptType},</if>
            <if test="scriptcode != null">script_code = #{scriptcode},</if>
            <if test="scriptDesc != null">script_desc = #{scriptDesc},</if>
            <if test="sort != null">sort = #{sort},</if>
smartor/src/main/resources/mapper/smartor/SvyLibTemplateScriptMapper.xml
@@ -10,6 +10,7 @@
        <result property="nextScriptno" column="next_scriptno"/>
        <result property="scriptno" column="scriptno"/>
        <result property="scriptDesc" column="script_desc"/>
        <result property="svyid" column="svyid"/>
        <result property="tag" column="tag"/>
        <result property="sort" column="sort"/>
        <result property="ismandatory" column="ismandatory"/>
@@ -43,6 +44,7 @@
        select id,
               script_type,
               scriptid,
               svyid,
               scriptno,
               next_scriptno,
               script_desc,
@@ -100,6 +102,7 @@
            <if test="scoretype != null  and scoretype != ''">and scoretype = #{scoretype}</if>
            <if test="score != null  and score != ''">and score = #{score}</if>
            <if test="scriptTopic != null  and scriptTopic != ''">and script_topic = #{scriptTopic}</if>
            <if test="svyid != null  ">and svyid = #{svyid}</if>
        </where>
    </select>
@@ -143,6 +146,7 @@
            <if test="score != null">score,</if>
            <if test="scriptPicture != null">script_picture,</if>
            <if test="scriptTopic != null">script_topic,</if>
            <if test="svyid != null">svyid,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="nextScriptno != null">#{nextScriptno},</if>
@@ -176,6 +180,7 @@
            <if test="score != null">#{score},</if>
            <if test="scriptPicture != null">#{scriptPicture},</if>
            <if test="scriptTopic != null">#{scriptTopic},</if>
            <if test="svyid != null">#{svyid},</if>
        </trim>
    </insert>
@@ -213,6 +218,7 @@
            <if test="score != null">score = #{score},</if>
            <if test="scriptPicture != null">script_picture = #{scriptPicture},</if>
            <if test="scriptTopic != null">script_topic = #{scriptTopic},</if>
            <if test="svyid != null">svyid = #{svyid},</if>
        </trim>
        where id = #{id}
    </update>