liusheng
2024-08-28 bedd0a1cef215538df64470df6b8d4a022189136
代码提交
已添加6个文件
已修改89个文件
3723 ■■■■ 文件已修改
ruoyi-admin/src/main/java/com/ruoyi/web/component/RedisMqReceiver.java 98 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/hanler/ChatWebSocketHandler.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/BaseUserInfoController.java 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/CommonTaskController.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/EquipmentinfoController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatArchiveController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatMedRegistrationController.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskController.java 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/SmsParamController.java 32 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/SvyLibScriptCategoryController.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/test/MQTest.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/resources/application-druid.yml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/resources/application.yml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-common/src/main/java/com/ruoyi/common/core/redis/RedisCache.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUtils.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-framework/src/main/java/com/ruoyi/framework/config/ServerConfig.java 37 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java 286 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/RouterVo.java 73 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/mapper/BaseUserInfoMapper.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/mapper/EquipmentinfoMapper.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java 31 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDictDataMapper.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDictTypeMapper.java 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysLogininforMapper.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysMenuMapper.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysNoticeMapper.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysOperLogMapper.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysPostMapper.java 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleDeptMapper.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleMapper.java 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleMenuMapper.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserPostMapper.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserRoleMapper.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java 260 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/pom.xml 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/common/SendService.java 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/IvrLibaTemplate.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/IvrLibaTemplateTargetoption.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/IvrTaskTemplate.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/IvrTaskTemplateScript.java 38 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/IvrTaskTemplateScriptVO.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/IvrTaskTemplateTargetoption.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/PatArchiveVO.java 125 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/PatMedInhosp.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/PhoneCallBackYQVO.java 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/PhoneCallReqYQVO.java 131 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/PhoneRecordAccept.java 84 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/PullTaskVO.java 71 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/SendMagParam.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/ServiceSubTaskAnswerReq.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/ServiceSubtask.java 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/ServiceSubtaskDetail.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/ServiceSubtaskDetailVO.java 165 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/ServiceTask.java 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/ServiceTaskVO.java 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/SvyTaskTemplate.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/SvyTaskTemplateScriptVO.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/SvyTaskTemplateVO.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/VisitPlan.java 82 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/robot/RobotScritpTemplateVO.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/mapper/SmsParamMapper.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/IIvrTaskTemplateScriptService.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/IPatArchiveService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/IPatMedInhospService.java 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/IServiceSubtaskAnswerService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/IServiceSubtaskService.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/ISmsParamService.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/CommonTaskServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/IvrLibaTemplateServiceImpl.java 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/IvrTaskTemplateScriptServiceImpl.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/IvrTaskTemplateServiceImpl.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/PatArchiveServiceImpl.java 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/PatMedInhospServiceImpl.java 155 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/PatMedInspectionServiceImpl.java 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/PatMedRegistrationServiceImpl.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskAnswerServiceImpl.java 203 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java 825 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/ServiceTaskServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/SmsParamServiceImpl.java 68 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/SvyLibTemplateServiceImpl.java 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/IvrLibaScriptMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/IvrLibaTemplateMapper.xml 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/IvrTaskTemplateMapper.xml 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/IvrTaskTemplateScriptMapper.xml 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/IvrTaskTemplateTargetoptionMapper.xml 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/PatArchiveMapper.xml 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/PatMedInhospMapper.xml 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/PatMedInspectionMapper.xml 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/PatMedRegistrationMapper.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/ServiceSubtaskDetailMapper.xml 40 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/ServiceTaskMapper.xml 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/component/RedisMqReceiver.java
@@ -14,10 +14,7 @@
import com.smartor.mapper.ServiceTaskMapper;
import com.smartor.mapper.SvyTaskMapper;
import com.smartor.mapper.SvyTaskSingleMapper;
import com.smartor.service.IBaseSmsaccountService;
import com.smartor.service.IIvrTaskTemplateService;
import com.smartor.service.IServiceSubtaskRecordService;
import com.smartor.service.ISvyTaskTemplateService;
import com.smartor.service.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
@@ -26,10 +23,7 @@
import org.springframework.data.redis.listener.RedisMessageListenerContainer;
import org.springframework.stereotype.Component;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.*;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
@@ -143,7 +137,7 @@
     *
     * @param commonTaskcallMQ
     */
    private void sfHandle(CommonTaskcallMQ commonTaskcallMQ, String ip) {
    public void sfHandle(CommonTaskcallMQ commonTaskcallMQ, String ip) {
        //判断一下commonTaskcallMQ中的stopstate是否与ivr_task中的一致,不一致,则说明是暂停了
        ServiceTask ivrTask1 = ivrTaskMapper.selectServiceTaskByTaskid(commonTaskcallMQ.getTaskid());
        if (ivrTask1.getStopState() != commonTaskcallMQ.getStopState()) {
@@ -159,10 +153,10 @@
                String descByCode = ServiceFromEnum.getDescByCode(Integer.valueOf(serviceFrom));
                //这里可以考虑用策略模式优化一下,不然太难看了
                //通过模板ID获取模板问题
                IvrTaskTemplateVO ivrTaskTemplateVO = new IvrTaskTemplateVO();
                ivrTaskTemplateVO.setId(Long.valueOf(commonTaskcallMQ.getTemplateid()));
                IvrTaskTemplateVO ivrTaskTemplateVO1 = ivrTaskTemplateService.selectInfoByCondition(ivrTaskTemplateVO);
//                //通过模板ID获取模板问题
//                IvrTaskTemplateVO ivrTaskTemplateVO = new IvrTaskTemplateVO();
//                ivrTaskTemplateVO.setId(Long.valueOf(commonTaskcallMQ.getTemplateid()));
//                IvrTaskTemplateVO ivrTaskTemplateVO1 = ivrTaskTemplateService.selectInfoByCondition(ivrTaskTemplateVO);
                //通过任务ID拿到患者信息
                ServiceSubtask ivrTaskcall = new ServiceSubtask();
@@ -175,6 +169,37 @@
                            //如何任务被“暂停”或“终止”
                            break;
                        }
                        //获取到value值最少的key
                        String key = getKey();
                        if (commonTaskcallMQ.getSendType().equals("2")) {
                            //说明是立即发送
                            String value = redisCache.getCacheObject("cache-0");
                            ServiceSubtask serviceSubtask1 = new ServiceSubtask();
                            serviceSubtask1.setTaskid(commonTaskcallMQ.getTaskid());
                            List<ServiceSubtask> selectServiceSubtaskList1 = ivrTaskcallMapper.selectServiceSubtaskList(serviceSubtask1);
                            for (ServiceSubtask serviceSubtask2 : selectServiceSubtaskList1) {
                                if (StringUtils.isEmpty(value)) {
                                    value = "," + serviceSubtask2.getId().toString() + ",";
                                } else {
                                    value = value + "," + serviceSubtask2.getId().toString() + ",";
                                }
                            }
                            redisCache.setCacheObject("cache-0", value);
                        } else {
                            //非立即发送
                            String value = redisCache.getCacheObject(key);
                            ServiceSubtask serviceSubtask1 = new ServiceSubtask();
                            serviceSubtask1.setTaskid(commonTaskcallMQ.getTaskid());
                            List<ServiceSubtask> selectServiceSubtaskList1 = ivrTaskcallMapper.selectServiceSubtaskList(serviceSubtask1);
                            for (ServiceSubtask serviceSubtask2 : selectServiceSubtaskList1) {
                                if (StringUtils.isEmpty(value)) {
                                    value = "," + serviceSubtask2.getId().toString() + ",";
                                } else {
                                    value = value + "," + serviceSubtask2.getId().toString() + ",";
                                }
                            }
                            redisCache.setCacheObject(key, value);
                        }
                        //任务发送记录(这个代码应该写在phoneTask中,先写在这,后面再改)
                        ServiceSubtaskRecord serviceSubtaskRecord = new ServiceSubtaskRecord();
@@ -185,8 +210,8 @@
                        serviceSubtaskRecord.setStartTime(System.currentTimeMillis());
                        serviceSubtaskRecordService.insertServiceSubtaskRecord(serviceSubtaskRecord);
                        //通过多线程的方式去打电话
                        executorService.submit(new PhoneTask(serviceSubtask, ivrTaskTemplateVO1, redisCache, sendService, phonePath, robotPhoneUtils));
//                        //通过多线程的方式去打电话
//                        executorService.submit(new PhoneTask(serviceSubtask, ivrTaskTemplateVO1, redisCache, sendService, phonePath, robotPhoneUtils));
                    }
                } else if (descByCode.equals("多媒体")) {
                    //多媒体
@@ -227,7 +252,7 @@
                        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=" + serviceSubtask.getPatid().toString() + "&param3=" + ivrTask1.getTaskName() + "&param5=false");
                        sendMagParam.setUrl(ip + ":" + req_path + "/outsideChain?param1=" + taskId + "&param2=" + patid + "&param3=" + ivrTask1.getTaskName() + "&param5=false");
                        log.info("链接完整路径:{}", ip + ":" + req_path + "/outsideChain?param1=" + taskId + "&param2=" + patid + "&param3=" + ivrTask1.getTaskName() + "&param5=false");
                        //这个模板ID先写死,后面做成可选
                        sendMagParam.setTmpCode("oG3pJHPVWpE81DmZsua_2tKwgJ97r0qz37z56ns7NB4");
@@ -235,7 +260,6 @@
                        map.put("first", ivrTask1.getTaskName());
                        sendMagParam.setContent(JSON.toJSONString(map));
                        sendMagParam.setOpenid(serviceSubtask.getOpenid());
                        Boolean aBoolean = sendService.sendMsg(sendMagParam);
                        //任务发送记录
@@ -276,10 +300,12 @@
                //这里可以考虑用策略模式优化一下,不然太难看了
                //通过模板ID获取模板问题
                IvrTaskTemplateVO ivrTaskTemplateVO = new IvrTaskTemplateVO();
                ivrTaskTemplateVO.setId(Long.valueOf(commonTaskcallMQ.getTemplateid()));
                IvrTaskTemplateVO ivrTaskTemplateVO1 = ivrTaskTemplateService.selectInfoByCondition(ivrTaskTemplateVO);
                IvrTaskTemplateVO ivrTaskTemplateVO1 = null;
                if (commonTaskcallMQ.getTaskType().equals("1")) {
                    IvrTaskTemplateVO ivrTaskTemplateVO = new IvrTaskTemplateVO();
                    ivrTaskTemplateVO.setId(Long.valueOf(commonTaskcallMQ.getTemplateid()));
                    ivrTaskTemplateVO1 = ivrTaskTemplateService.selectInfoByCondition(ivrTaskTemplateVO);
                }
                //通过任务ID拿到患者信息
                ServiceSubtask ivrTaskcall = new ServiceSubtask();
                ivrTaskcall.setTaskid(commonTaskcallMQ.getTaskid());
@@ -348,6 +374,7 @@
                        Map map = new HashMap();
                        map.put("first", ivrTask1.getTaskName());
                        sendMagParam.setContent(JSON.toJSONString(map));
                        sendMagParam.setOpenid(ivrTaskSingle.getOpenid());
                        Boolean aBoolean = sendService.sendMsg(sendMagParam);
                        //任务发送记录
@@ -455,7 +482,7 @@
    }
//    /**
    //    /**
//     * æœºå™¨äººç¬¬ä¸€å¥è¯è¯­éŸ³
//     * concurrency = "50"  å¹¶å‘数为50
//     */
@@ -490,5 +517,32 @@
//            channel.basicReject(message.getMessageProperties().getDeliveryTag(), true);
//        }
//    }
    private String getKey() {
        Map<String, String> map = new HashMap<>();
        for (int i = 0; i < 6; i++) {
            Boolean aBoolean = redisCache.hasKey("cache-" + i);
            if (!aBoolean) {
                redisCache.setCacheObject("cache-" + i, "");
                map.put("cache-" + i, "");
            } else {
                map.put("cache-" + i, redisCache.getCacheObject("cache-" + i));
            }
        }
        String key = null;
        String value = "";
        for (Map.Entry<String, String> entry : map.entrySet()) {
            if (StringUtils.isEmpty(value)) {
                value = entry.getValue();
                key = entry.getKey();
            } else {
                if (entry.getValue().split(",").length < value.split(",").length) {
                    value = entry.getValue();
                    key = entry.getKey();
                }
            }
        }
        return key;
    }
}
ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java
@@ -222,6 +222,7 @@
    public AjaxResult htmlContent(@RequestBody HtmlContentVO htmlContentVO) {
        // èŽ·å–æ–‡ä»¶çš„åŽŸå§‹åç§°
        String fileName = htmlContentVO.getFileName();
        FileUtils.createFile(RuoYiConfig.getUploadPath() + "/show/" + fileName.split("\\.", 2)[0]);
        // å°†æ–‡ä»¶ä¿å­˜åˆ°æŒ‡å®šç›®å½•
        File outputFile = new File(RuoYiConfig.getUploadPath() + "/show/" + fileName.split("\\.", 2)[0] + "/" + fileName);
        try (BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outputFile), "UTF-8"))) {
ruoyi-admin/src/main/java/com/ruoyi/web/controller/hanler/ChatWebSocketHandler.java
@@ -257,7 +257,7 @@
                            if (StringUtils.isNotEmpty(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).getTargetregex2()) && matcher2.matches() && StringUtils.isNotEmpty(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).getTargetregex()) && matcher.matches() || StringUtils.isEmpty(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).getTargetregex2()) && StringUtils.isNotEmpty(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).getTargetregex()) && matcher.matches()) {
                                //说明匹配正确了
                                ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).setIsUserOperation(true);
                                ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).setIsUserOperation(1);
                                List<IvrTaskTemplateScriptVO> backQuset = redisCache.getCacheObject(userId + "backQuset");
                                //匹配完成后,将结果保存到新的数组
                                backQuset.add(ivrTaskTemplateScriptVO);
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/BaseUserInfoController.java
@@ -4,6 +4,8 @@
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.common.utils.StringUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -22,6 +24,7 @@
 * @author ruoyi
 * @date 2023-05-25
 */
@Api(description = "标签分类")
@RestController
@RequestMapping("/system/info")
public class BaseUserInfoController extends BaseController {
@@ -31,8 +34,9 @@
    /**
     * æŸ¥è¯¢ç”¨æˆ·åˆ—表
     */
    @ApiOperation("查询用户列表")
    @PreAuthorize("@ss.hasPermi('system:info:list')")
   @PostMapping("/list")
    @PostMapping("/list")
    public TableDataInfo list(@RequestBody BaseUserInfo baseUserInfo) {
        startPage();
        List<BaseUserInfo> list = baseUserInfoService.selectBaseUserInfoList(baseUserInfo);
@@ -42,8 +46,9 @@
    /**
     * å¯¼å‡ºç”¨æˆ·åˆ—表
     */
    @ApiOperation("导出用户列表")
    @PreAuthorize("@ss.hasPermi('system:info:export')")
    @Log(title = "用户", businessType = BusinessType.EXPORT)
    @Log(title = "用户" , businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, BaseUserInfo baseUserInfo) {
        List<BaseUserInfo> list = baseUserInfoService.selectBaseUserInfoList(baseUserInfo);
@@ -54,6 +59,7 @@
    /**
     * èŽ·å–ç”¨æˆ·è¯¦ç»†ä¿¡æ¯
     */
    @ApiOperation("获取用户详细信息")
    @PreAuthorize("@ss.hasPermi('system:info:query')")
    @GetMapping(value = "/{userid}")
    public AjaxResult getInfo(@PathVariable("userid") Long userid) {
@@ -63,8 +69,9 @@
    /**
     * æ–°å¢žç”¨æˆ·
     */
    @ApiOperation("新增用户")
    @PreAuthorize("@ss.hasPermi('system:info:add')")
    @Log(title = "用户", businessType = BusinessType.INSERT)
    @Log(title = "用户" , businessType = BusinessType.INSERT)
    @PostMapping("/add")
    public AjaxResult add(@RequestBody BaseUserInfo baseUserInfo) {
        return toAjax(baseUserInfoService.insertBaseUserInfo(baseUserInfo));
@@ -73,8 +80,9 @@
    /**
     * ä¿®æ”¹ç”¨æˆ·
     */
    @ApiOperation("修改用户")
    @PreAuthorize("@ss.hasPermi('system:info:edit')")
    @Log(title = "用户", businessType = BusinessType.UPDATE)
    @Log(title = "用户" , businessType = BusinessType.UPDATE)
    @PostMapping("/edit")
    public AjaxResult edit(@RequestBody BaseUserInfo baseUserInfo) {
        return toAjax(baseUserInfoService.updateBaseUserInfo(baseUserInfo));
@@ -83,8 +91,9 @@
    /**
     * åˆ é™¤ç”¨æˆ·
     */
    @ApiOperation("删除用户")
    @PreAuthorize("@ss.hasPermi('system:info:remove')")
    @Log(title = "用户", businessType = BusinessType.DELETE)
    @Log(title = "用户" , businessType = BusinessType.DELETE)
    @GetMapping("/remove/{userids}")
    public AjaxResult remove(@PathVariable Long[] userids) {
        return toAjax(baseUserInfoService.deleteBaseUserInfoByUserids(userids));
@@ -93,10 +102,11 @@
    /**
     * èŽ·å–äººå‘˜çš„è”ç³»æ–¹å¼
     *
     * @param personCode  äººå‘˜ç¼–号
     * @param noticeWay é€šçŸ¥æ–¹å¼
     * @param personCode äººå‘˜ç¼–号
     * @param noticeWay  é€šçŸ¥æ–¹å¼
     * @return
     */
    @ApiOperation("获取人员的联系方式")
    @GetMapping("/reportContent")
    public AjaxResult getContact(@RequestParam("personCode") String personCode, @RequestParam("noticeWay") String noticeWay) {
        if (StringUtils.isEmpty(personCode) || StringUtils.isEmpty(noticeWay)) {
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/CommonTaskController.java
@@ -36,6 +36,7 @@
    /**
     * æŸ¥è¯¢é¢˜ç›®åˆ—表(义乌的his数据获取情况)
     */
    @ApiOperation(" æŸ¥è¯¢é¢˜ç›®åˆ—表(义乌的his数据获取情况)")
    @PostMapping("/list")
    public TableDataInfo list(@RequestBody ServiceThirdData serviceThirdData) {
        List<ServiceThirdData> list = iServiceThirdDataService.queryList(serviceThirdData);
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/EquipmentinfoController.java
@@ -106,7 +106,7 @@
    /**
     * é—®é¢˜ä¸ŠæŠ¥
     */
    @RequestMapping("/reportContent")
    @PostMapping("/reportContent")
    public AjaxResult reportContent(@RequestBody ReportReqVo reportReqVo) {
        if (StringUtils.isEmpty(reportReqVo.getDealDept()) && StringUtils.isEmpty(reportReqVo.getDealPersionNO())) {
            return error("处理人和处理部门不能同时为空!");
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatArchiveController.java
@@ -207,7 +207,7 @@
    @PostMapping("/getPatientInfo")
    public TableDataInfo getPatientInfo(@RequestBody PatArchiveReq patArchiveReq) {
        PageUtils.startPageByPost(patArchiveReq.getPageNum(), patArchiveReq.getPageSize());
        List<PatTaskRelevance> patientInfo = patArchiveService.getPatientInfo(patArchiveReq);
        List<ServiceSubtask> patientInfo = patArchiveService.getPatientInfo(patArchiveReq);
        long count = PageUtils.count(new ISelect() {
            @Override
            public void doSelect() {
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatMedRegistrationController.java
@@ -8,6 +8,8 @@
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.smartor.domain.PatMedRegistration;
import com.smartor.service.IPatMedRegistrationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
@@ -21,6 +23,7 @@
 * @author ruoyi
 * @date 2024-08-01
 */
@Api(description = " æ‚£è€…挂号记录")
@RestController
@RequestMapping("/smartor/registration")
public class PatMedRegistrationController extends BaseController {
@@ -30,6 +33,7 @@
    /**
     * æŸ¥è¯¢æ‚£è€…挂号记录列表
     */
    @ApiOperation("查询患者挂号记录列表")
    @PreAuthorize("@ss.hasPermi('system:registration:list')")
    @GetMapping("/list")
    public TableDataInfo list(PatMedRegistration patMedRegistration) {
@@ -41,6 +45,7 @@
    /**
     * å¯¼å‡ºæ‚£è€…挂号记录列表
     */
    @ApiOperation("导出患者挂号记录列表")
    @PreAuthorize("@ss.hasPermi('system:registration:export')")
    @Log(title = "患者挂号记录", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
@@ -53,6 +58,7 @@
    /**
     * èŽ·å–æ‚£è€…æŒ‚å·è®°å½•è¯¦ç»†ä¿¡æ¯
     */
    @ApiOperation("获取患者挂号记录详细信息")
    @PreAuthorize("@ss.hasPermi('system:registration:query')")
    @GetMapping(value = "/getInfo/{registid}")
    public AjaxResult getInfo(@PathVariable("registid") Long registid) {
@@ -62,6 +68,7 @@
    /**
     * æ–°å¢žæ‚£è€…挂号记录
     */
    @ApiOperation("新增患者挂号记录")
    @PreAuthorize("@ss.hasPermi('system:registration:add')")
    @Log(title = "患者挂号记录", businessType = BusinessType.INSERT)
    @PostMapping("/add")
@@ -72,6 +79,7 @@
    /**
     * ä¿®æ”¹æ‚£è€…挂号记录
     */
    @ApiOperation("修改患者挂号记录")
    @PreAuthorize("@ss.hasPermi('system:registration:edit')")
    @Log(title = "患者挂号记录", businessType = BusinessType.UPDATE)
    @PostMapping("/edit")
@@ -82,6 +90,7 @@
    /**
     * åˆ é™¤æ‚£è€…挂号记录
     */
    @ApiOperation("删除患者挂号记录")
    @PreAuthorize("@ss.hasPermi('system:registration:remove')")
    @Log(title = "患者挂号记录", businessType = BusinessType.DELETE)
    @GetMapping("/remove/{registids}")
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskController.java
@@ -20,6 +20,9 @@
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.List;
/**
@@ -101,9 +104,28 @@
    @ApiOperation("电话回调任务")
    @PostMapping("/phoneCallBack")
    public AjaxResult phoneCallBack(@RequestBody PhoneCallBackVO phoneCallBackVO) {
//        log.error("电话回调任务成功了不?{}", phoneCallBackVO);
        serviceSubtaskService.phoneCallBack(phoneCallBackVO);
        return success();
    }
    @ApiOperation("电话ASR通话回调(雨绮)")
    @PostMapping("/phoneCallBackYQ")
    public PhoneCallBackYQVO phoneCallBackYQ(@RequestBody PhoneCallReqYQVO phoneCallReqYQVO) {
        log.error("电话ASR通话回调(雨绮) ï¼Ÿ{}", phoneCallReqYQVO);
        PhoneCallBackYQVO phoneCallBackYQVO = serviceSubtaskService.phoneCallBackYQ(phoneCallReqYQVO);
        return phoneCallBackYQVO;
    }
    /**
     * ç”µè¯å›žè°ƒä»»åŠ¡(雨绮)
     */
    @ApiOperation("电话回调任务(雨绮)")
    @PostMapping("/taskPull")
    public List<PullTaskVO> taskPull() {
        log.error("电话回调任务(雨绮)");
        List<PullTaskVO> pullTaskVOList = serviceSubtaskService.taskPull();
        log.error("电话回调任务(雨绮):{}", pullTaskVOList);
        return pullTaskVOList;
    }
    /**
@@ -115,4 +137,13 @@
        return toAjax(serviceSubtaskService.saveQuestionAnswerPhone(serviceSubTaskDetailReq));
    }
    /**
     * é€šè¯è®°å½•回调
     */
    @ApiOperation("通话记录回调")
    @PostMapping("/recordAccept")
    public AjaxResult recordAccept(@RequestBody ServiceSubTaskDetailReq serviceSubTaskDetailReq) {
        return toAjax(serviceSubtaskService.saveQuestionAnswerPhone(serviceSubTaskDetailReq));
    }
}
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/SmsParamController.java
@@ -2,6 +2,7 @@
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
@@ -23,14 +24,13 @@
/**
 * çŸ­ä¿¡å‚æ•°Controller
 *
 *
 * @author smartor
 * @date 2023-03-06
 */
@RestController
@RequestMapping("/smartor/smsparam")
public class SmsParamController extends BaseController
{
public class SmsParamController extends BaseController {
    @Autowired
    private ISmsParamService smsParamService;
@@ -38,9 +38,8 @@
     * æŸ¥è¯¢çŸ­ä¿¡å‚数列表
     */
    @PreAuthorize("@ss.hasPermi('smartor:smsparam:list')")
   @PostMapping("/list")
    public TableDataInfo list(@RequestBody SmsParam smsParam)
    {
    @PostMapping("/list")
    public TableDataInfo list(@RequestBody SmsParam smsParam) {
        startPage();
        List<SmsParam> list = smsParamService.selectSmsParamList(smsParam);
        return getDataTable(list);
@@ -52,8 +51,7 @@
    @PreAuthorize("@ss.hasPermi('smartor:smsparam:export')")
    @Log(title = "短信参数", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, SmsParam smsParam)
    {
    public void export(HttpServletResponse response, SmsParam smsParam) {
        List<SmsParam> list = smsParamService.selectSmsParamList(smsParam);
        ExcelUtil<SmsParam> util = new ExcelUtil<SmsParam>(SmsParam.class);
        util.exportExcel(response, list, "短信参数数据");
@@ -64,8 +62,7 @@
     */
    @PreAuthorize("@ss.hasPermi('smartor:smsparam:query')")
    @GetMapping(value = "/{paramid}")
    public AjaxResult getInfo(@PathVariable("paramid") Long paramid)
    {
    public AjaxResult getInfo(@PathVariable("paramid") Long paramid) {
        return success(smsParamService.selectSmsParamByParamid(paramid));
    }
@@ -75,8 +72,7 @@
    @PreAuthorize("@ss.hasPermi('smartor:smsparam:add')")
    @Log(title = "短信参数", businessType = BusinessType.INSERT)
    @PostMapping("/add")
    public AjaxResult add(@RequestBody SmsParam smsParam)
    {
    public AjaxResult add(@RequestBody SmsParam smsParam) {
        return toAjax(smsParamService.insertSmsParam(smsParam));
    }
@@ -86,8 +82,7 @@
    @PreAuthorize("@ss.hasPermi('smartor:smsparam:edit')")
    @Log(title = "短信参数", businessType = BusinessType.UPDATE)
    @PostMapping("/edit")
    public AjaxResult edit(@RequestBody SmsParam smsParam)
    {
    public AjaxResult edit(@RequestBody SmsParam smsParam) {
        return toAjax(smsParamService.updateSmsParam(smsParam));
    }
@@ -96,9 +91,12 @@
     */
    @PreAuthorize("@ss.hasPermi('smartor:smsparam:remove')")
    @Log(title = "短信参数", businessType = BusinessType.DELETE)
    @GetMapping("/remove/{paramids}")
    public AjaxResult remove(@PathVariable Long[] paramids)
    {
    @GetMapping("/remove/{paramids}")
    public AjaxResult remove(@PathVariable Long[] paramids) {
        return toAjax(smsParamService.deleteSmsParamByParamids(paramids));
    }
    public AjaxResult sendSmsInfo() {
        return null;
    }
}
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/SvyLibScriptCategoryController.java
@@ -11,11 +11,13 @@
import com.smartor.service.ISvyLibScriptCategoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.beanutils.ConvertUtils;
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.Arrays;
import java.util.List;
/**
@@ -92,8 +94,9 @@
    @PreAuthorize("@ss.hasPermi('smartor:category:remove')")
    @Log(title = "问卷题目分类", businessType = BusinessType.DELETE)
    @GetMapping("/remove/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids) {
        return toAjax(svyLibScriptCategoryService.deleteSvyLibScriptCategoryByIds(ids));
    public AjaxResult remove(@PathVariable String ids) {
        Long[] idArray = (Long[]) ConvertUtils.convert(ids.split(","), Long.class);
        return toAjax(svyLibScriptCategoryService.deleteSvyLibScriptCategoryByIds(idArray));
    }
    /**
ruoyi-admin/src/main/java/com/ruoyi/web/test/MQTest.java
@@ -2,6 +2,9 @@
import org.junit.Test;
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;
//@SpringBootTest
//@RunWith(SpringRunner.class)
public class MQTest {
@@ -9,7 +12,12 @@
    @Test
    public void testSend22() {
        LocalTime now = LocalTime.now();
        System.out.println("当前时分: " + now.format(DateTimeFormatter.ofPattern("hh:mm")));
        // èŽ·å–ä¸‹ä¸€åˆ†é’Ÿçš„æ—¶åˆ†
        LocalTime nextMinute = now.plusMinutes(1);
        System.out.println("下一分钟的时分: " + nextMinute.format(DateTimeFormatter.ofPattern("hh:mm")));
    }
ruoyi-admin/src/main/resources/application-druid.yml
@@ -1,4 +1,4 @@
# æ•°æ®æºé…ç½®
  # æ•°æ®æºé…ç½®
spring:
  datasource:
    type: com.alibaba.druid.pool.DruidDataSource
@@ -135,4 +135,4 @@
#外链请求IP和端口号
req_path: 8096
localIP: 192.168.2.10
localIP: 192.168.1.10
ruoyi-admin/src/main/resources/application.yml
@@ -76,7 +76,8 @@
    #    port: 6020
    # åœ°å€ï¼ˆå…¬å¸ï¼‰
    host: 116.62.18.175
    #    host: 116.62.18.175
    host: 192.168.1.10
    port: 6020
    # æ•°æ®åº“索引
    database: 0
@@ -94,7 +95,6 @@
        max-active: 8
        # #连接池最大阻塞等待时间(使用负值表示没有限制)
        max-wait: -1ms
# minio文件管理连接
minio:
  endpoint: http://192.168.1.4
ruoyi-common/src/main/java/com/ruoyi/common/core/redis/RedisCache.java
@@ -19,7 +19,7 @@
 *
 * @author ruoyi
 **/
@SuppressWarnings(value = {"unchecked", "rawtypes"})
@SuppressWarnings(value = {"unchecked" , "rawtypes"})
@Component
public class RedisCache {
    @Autowired
ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUtils.java
@@ -241,4 +241,11 @@
        String baseName = FilenameUtils.getBaseName(fileName);
        return baseName;
    }
    public static void createFile(String path) {
        File file = new File(path);
        if (!file.exists()) {
            file.mkdirs();
        }
    }
}
ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java
@@ -108,7 +108,7 @@
                // è¿‡æ»¤è¯·æ±‚
                .authorizeRequests()
                // å¯¹äºŽç™»å½•login æ³¨å†Œregister éªŒè¯ç captchaImage å…è®¸åŒ¿åè®¿é—®
                .antMatchers("/login", "/register", "/captchaImage", "/qrcode/generateStaticHtml", "/qrcode/getQRcode", "/qrcode/getFormDate", "/chat", "/system/file/admin/uploadFile", "/smartor/dingtalk/sendNotification", "/patient/read/patientInfo", "/socket", "/API_ESB_Service", "/API_ESB_Service/Run", "/magic/web/**", "/smartor/tasksingle/phoneCallBack", "/smartor/robot/callstatus", "/smartor/robot/aidialog", "/smartor/robot/cdrinfo", "/getToken", "/smartor/servicetask/getScriptInfoByCondition", "/smartor/serviceSubtask/saveQuestionAnswer").permitAll()
                .antMatchers("/login", "/register", "/captchaImage", "/qrcode/generateStaticHtml", "/qrcode/getQRcode", "/qrcode/getFormDate", "/chat", "/system/file/admin/uploadFile", "/smartor/dingtalk/sendNotification", "/patient/read/patientInfo", "/socket", "/API_ESB_Service", "/API_ESB_Service/Run", "/magic/web/**", "/smartor/serviceSubtask/phoneCallBack", "/smartor/serviceSubtask/taskPull", "/smartor/serviceSubtask//phoneCallBackYQ", "/smartor/robot/callstatus", "/smartor/robot/aidialog", "/smartor/robot/cdrinfo", "/getToken", "/smartor/servicetask/getScriptInfoByCondition", "/smartor/serviceSubtask/saveQuestionAnswer").permitAll()
                // é™æ€èµ„源,可匿名访问
                .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll().antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll()
                // é™¤ä¸Šé¢å¤–的所有请求全部需要鉴权认证
ruoyi-framework/src/main/java/com/ruoyi/framework/config/ServerConfig.java
@@ -1,32 +1,51 @@
package com.ruoyi.framework.config;
import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import com.ruoyi.common.utils.ServletUtils;
/**
 * æœåŠ¡ç›¸å…³é…ç½®
 *
 *
 * @author ruoyi
 */
@Component
public class ServerConfig
{
public class ServerConfig {
    @Value("${server.port}")
    private String port;
    /**
     * èŽ·å–å®Œæ•´çš„è¯·æ±‚è·¯å¾„ï¼ŒåŒ…æ‹¬ï¼šåŸŸåï¼Œç«¯å£ï¼Œä¸Šä¸‹æ–‡è®¿é—®è·¯å¾„
     *
     *
     * @return æœåŠ¡åœ°å€
     */
    public String getUrl()
    {
    public String getUrl() {
        HttpServletRequest request = ServletUtils.getRequest();
        return getDomain(request);
        String domain = getDomain(request);
        //修改一个端口
        domain = replaceAfterSecondColon(domain, port);
        return domain;
    }
    public static String getDomain(HttpServletRequest request)
    {
    public static String getDomain(HttpServletRequest request) {
        StringBuffer url = request.getRequestURL();
        String contextPath = request.getServletContext().getContextPath();
        return url.delete(url.length() - request.getRequestURI().length(), url.length()).append(contextPath).toString();
    }
    public static String replaceAfterSecondColon(String str, String replacement) {
        int firstColonIndex = str.indexOf(":");
        if (firstColonIndex != -1) {
            int secondColonIndex = str.indexOf(":", firstColonIndex + 1);
            if (secondColonIndex != -1 && secondColonIndex + 1 < str.length()) {
                // èŽ·å–ç¬¬äºŒä¸ªâ€œï¼šâ€å‰çš„éƒ¨åˆ†
                String beforeSecondColon = str.substring(0, secondColonIndex + 1);
                // è¿”回替换后的字符串
                return beforeSecondColon + replacement;
            }
        }
        return str;
    }
}
ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java
@@ -1,25 +1,68 @@
package com.ruoyi.quartz.task;
import com.smartor.domain.ServiceThirdData;
import com.smartor.service.IServiceSubtaskAnswerService;
import com.smartor.service.IServiceThirdDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.alibaba.fastjson2.JSON;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.enums.ServiceFromEnum;
import com.ruoyi.common.utils.RSAPublicKeyExample;
import com.ruoyi.common.utils.StringUtils;
import com.smartor.common.SendService;
import com.smartor.domain.*;
import com.smartor.mapper.ServiceSubtaskMapper;
import com.smartor.mapper.ServiceTaskMapper;
import com.smartor.service.*;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import java.util.Date;
import java.util.*;
/**
 * å®šæ—¶ä»»åŠ¡è°ƒåº¦æµ‹è¯•
 *
 * @author ruoyi
 */
@Slf4j
@Component("ryTask")
public class RyTask {
    @Autowired
    private IServiceThirdDataService iServiceThirdDataService;
    @Autowired
    private IServiceSubtaskAnswerService serviceSubtaskAnswerService;
    @Autowired
    private IPatMedInhospService iPatMedInhospService;
    @Autowired
    private IServiceSubtaskService iServiceSubtaskService;
    @Value("${localIP}")
    private String localIP;
    @Value("${pub_key}")
    private String pub_key;
    @Value("${req_path}")
    private String req_path;
    @Autowired
    private ServiceTaskMapper serviceTaskMapper;
    @Autowired
    private SendService sendService;
    @Autowired
    private RedisCache redisCache;
    @Autowired
    private IServiceSubtaskRecordService serviceSubtaskRecordService;
    @Autowired
    IBaseSmsaccountService baseSmsaccountService;
    public void ryMultipleParams(String s, Boolean b, Long l, Double d, Integer i) {
        System.out.println(StringUtils.format("执行多参方法: å­—符串类型{},布尔类型{},长整型{},浮点型{},整形{}", s, b, l, d, i));
@@ -50,4 +93,235 @@
    public void runServiceSubTaskAnswer() {
        serviceSubtaskAnswerService.saveQuestionAnswer(null);
    }
    /**
     * å¤„理his数据
     */
    public void dealHisData() {
        //将患者信息、出院、门诊数据全部采集
        //调用dealOupHospInfo数据处理方法,处理完后,将“出院表的check_flag=1”
        //获取当前日期 ï¼ˆç²¾ç¡®åˆ°å¤©ï¼‰å¾€å‰æŽ¨ç›¸åº”天数(在指定的基础模板中找对应的天数),
        //循环患者信息,根据患者"出院诊断ICD值”获取到相当的模板(获取取相应的天数);
        //根据查询出来的模板,去固定任务(固定任务,已经将模板也固定了)去匹配模板
        //根据匹配出来的模板和任务与患者信息,将数据插入到子任务表中
        iPatMedInhospService.dealOupHospInfo();
    }
    /**
     * é•¿æœŸä»»åŠ¡æ‰§è¡Œ
     */
    public void longTaskSend() {
        //获取任务信息
        ServiceTask st =new ServiceTask();
        st.setDelFlag("0");
        st.setLongTask(1);
        List<ServiceTask> serviceTasks = serviceTaskMapper.selectServiceTaskList(st);
        for (ServiceTask serviceTask : serviceTasks) {
            //通过taskId,获取未执行的子任务信息
            ServiceSubtask serviceSubtask = new ServiceSubtask();
            serviceSubtask.setTaskid(serviceTask.getTaskid());
            serviceSubtask.setSendstate(2L);
            List<ServiceSubtask> selectServiceSubtaskList = iServiceSubtaskService.selectServiceSubtaskList(serviceSubtask);
            if (CollectionUtils.isNotEmpty(selectServiceSubtaskList)) {
                for (ServiceSubtask serviceSubtask1 : selectServiceSubtaskList) {
                    //如果患者的发送日期是今天,则进行发送
                    boolean dateToday = isDateToday(serviceSubtask1.getLongSendTime());
                    if (dateToday) {
                        CommonTaskcallMQ commonTaskcallMQ = new CommonTaskcallMQ();
                        commonTaskcallMQ.setTaskid(serviceTask.getTaskid());
                        commonTaskcallMQ.setPreachform(serviceSubtask1.getServiceform());
                        sfHandle(commonTaskcallMQ, localIP);
                        //发送完成后,修改状态
                        serviceSubtask1.setSendstate(3L);
                        iServiceSubtaskService.updateServiceSubtask(serviceSubtask1);
                    }
                }
            }
        }
    }
    /**
     * åˆ¤æ–­æ—¥æœŸæ˜¯å¦æ˜¯ä»Šå¤©
     *
     * @param date
     * @return
     */
    public boolean isDateToday(Date date) {
        // èŽ·å–å½“å‰æ—¥æœŸ
        Calendar calendarNow = Calendar.getInstance();
        int todayYear = calendarNow.get(Calendar.YEAR);
        int todayMonth = calendarNow.get(Calendar.MONTH);
        int todayDay = calendarNow.get(Calendar.DAY_OF_MONTH);
        // åˆ›å»ºä¸€ä¸ª Calendar å®žä¾‹ç”¨äºŽæ£€æŸ¥çš„æ—¥æœŸ
        Calendar calendarToCheck = Calendar.getInstance();
        calendarToCheck.setTime(date);
        // æ¯”较年、月和日
        return (calendarToCheck.get(Calendar.YEAR) == todayYear && calendarToCheck.get(Calendar.MONTH) == todayMonth && calendarToCheck.get(Calendar.DAY_OF_MONTH) == todayDay);
    }
    public void sfHandle(CommonTaskcallMQ commonTaskcallMQ, String ip) {
        //判断一下commonTaskcallMQ中的stopstate是否与ivr_task中的一致,不一致,则说明是暂停了
        ServiceTask ivrTask1 = serviceTaskMapper.selectServiceTaskByTaskid(commonTaskcallMQ.getTaskid());
        if (StringUtils.isNotEmpty(commonTaskcallMQ.getPreachform())) {
            //如何任务发送方式不为空
            String[] split = commonTaskcallMQ.getPreachform().split(",");
            System.out.println("split的值为:" + split);
            for (String serviceFrom : split) {
                String descByCode = ServiceFromEnum.getDescByCode(Integer.valueOf(serviceFrom));
                //这里可以考虑用策略模式优化一下,不然太难看了
                //通过任务ID拿到患者信息
                ServiceSubtask ivrTaskcall = new ServiceSubtask();
                ivrTaskcall.setTaskid(commonTaskcallMQ.getTaskid());
                List<ServiceSubtask> selectServiceSubtaskList = iServiceSubtaskService.selectServiceSubtaskList(ivrTaskcall);
                if (descByCode.equals("电话")) {
                    for (ServiceSubtask serviceSubtask : selectServiceSubtaskList) {
                        ServiceTask ivrTask = serviceTaskMapper.selectServiceTaskByTaskid(serviceSubtask.getTaskid());
                        if (ivrTask.getSendState() != null && ivrTask.getSendState() == 3 || ivrTask.getSendState() != null && ivrTask.getSendState() == 4) {
                            //如何任务被“暂停”或“终止”
                            break;
                        }
                        //获取到value值最少的key
                        String key = getKey();
                        if (commonTaskcallMQ.getSendType().equals("2")) {
                            //说明是立即发送
                            String value = redisCache.getCacheObject("cache-0");
                            ServiceSubtask serviceSubtask1 = new ServiceSubtask();
                            serviceSubtask1.setTaskid(commonTaskcallMQ.getTaskid());
                            List<ServiceSubtask> selectServiceSubtaskList1 = iServiceSubtaskService.selectServiceSubtaskList(serviceSubtask1);
                            for (ServiceSubtask serviceSubtask2 : selectServiceSubtaskList1) {
                                if (StringUtils.isEmpty(value)) {
                                    value = "," + serviceSubtask2.getId().toString() + ",";
                                } else {
                                    value = value + "," + serviceSubtask2.getId().toString() + ",";
                                }
                            }
                            redisCache.setCacheObject("cache-0", value);
                        } else {
                            //非立即发送
                            String value = redisCache.getCacheObject(key);
                            ServiceSubtask serviceSubtask1 = new ServiceSubtask();
                            serviceSubtask1.setTaskid(commonTaskcallMQ.getTaskid());
                            List<ServiceSubtask> selectServiceSubtaskList1 = iServiceSubtaskService.selectServiceSubtaskList(serviceSubtask1);
                            for (ServiceSubtask serviceSubtask2 : selectServiceSubtaskList1) {
                                if (StringUtils.isEmpty(value)) {
                                    value = "," + serviceSubtask2.getId().toString() + ",";
                                } else {
                                    value = value + "," + serviceSubtask2.getId().toString() + ",";
                                }
                            }
                            redisCache.setCacheObject(key, value);
                        }
                        //任务发送记录(这个代码应该写在phoneTask中,先写在这,后面再改)
                        ServiceSubtaskRecord serviceSubtaskRecord = new ServiceSubtaskRecord();
                        serviceSubtaskRecord.setTaskid(serviceSubtask.getTaskid().toString());
                        serviceSubtaskRecord.setUuid(UUID.randomUUID().toString());
                        serviceSubtaskRecord.setTasktype(serviceSubtask.getType());
                        serviceSubtaskRecord.setPreachform("3");
                        serviceSubtaskRecord.setStartTime(System.currentTimeMillis());
                        serviceSubtaskRecordService.insertServiceSubtaskRecord(serviceSubtaskRecord);
//                        //通过多线程的方式去打电话
//                        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
                    //对url中两个参数加密
                    RSAPublicKeyExample rsaPublicKeyExample = new RSAPublicKeyExample();
                    String taskId = rsaPublicKeyExample.encryptedData(ivrTask1.getTaskid().toString(), pub_key);
                    for (ServiceSubtask serviceSubtask : selectServiceSubtaskList) {
                        String patid = rsaPublicKeyExample.encryptedData(serviceSubtask.getPatid().toString(), pub_key);
                        SendMagParam sendMagParam = new SendMagParam();
                        sendMagParam.setType("4");
                        sendMagParam.setPhone(serviceSubtask.getPhone());
                        sendMagParam.setUrl(ip + ":" + req_path + "/followvisit/particty?param1=" + taskId + "&param2=" + patid + "&param5=false");
                        Boolean aBoolean = sendService.sendMsg(sendMagParam);
                        //任务发送记录
                        ServiceSubtaskRecord serviceSubtaskRecord = new ServiceSubtaskRecord();
                        serviceSubtaskRecord.setTaskid(serviceSubtask.getTaskid().toString());
                        serviceSubtaskRecord.setUuid(UUID.randomUUID().toString());
                        serviceSubtaskRecord.setTasktype(serviceSubtask.getType());
                        serviceSubtaskRecord.setPreachform("4");
                        serviceSubtaskRecord.setStartTime(System.currentTimeMillis());
                        serviceSubtaskRecord.setResult(aBoolean == true ? "成功" : "失败");
                        serviceSubtaskRecordService.insertServiceSubtaskRecord(serviceSubtaskRecord);
                    }
                } else if (descByCode.equals("公众号")) {
                    //公众号
                    RSAPublicKeyExample rsaPublicKeyExample = new RSAPublicKeyExample();
                    String taskId = rsaPublicKeyExample.encryptedData(ivrTask1.getTaskid().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=" + taskId + "&param2=" + patid + "&param3=" + ivrTask1.getTaskName() + "&param5=false");
                        log.info("链接完整路径:{}", ip + ":" + req_path + "/outsideChain?param1=" + taskId + "&param2=" + patid + "&param3=" + ivrTask1.getTaskName() + "&param5=false");
                        //这个模板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(serviceSubtask.getTaskid().toString());
                        serviceSubtaskRecord.setUuid(UUID.randomUUID().toString());
                        serviceSubtaskRecord.setTasktype(serviceSubtask.getType());
                        serviceSubtaskRecord.setPreachform("4");
                        serviceSubtaskRecord.setStartTime(System.currentTimeMillis());
                        serviceSubtaskRecord.setResult(aBoolean == true ? "成功" : "失败");
                        serviceSubtaskRecordService.insertServiceSubtaskRecord(serviceSubtaskRecord);
                    }
                }
                //通知 MQ æ¶ˆæ¯å·²è¢«æŽ¥æ”¶,可以ACK(从队列中删除)了   ï¼ˆè¿™ä¸ªéœ€è¦æ ¹æ®ä¸šåŠ¡å†åŽ»å¤„ç†ACK)
            }
        }
    }
    private String getKey() {
        Map<String, String> map = new HashMap<>();
        for (int i = 0; i < 6; i++) {
            Boolean aBoolean = redisCache.hasKey("cache-" + i);
            if (!aBoolean) {
                redisCache.setCacheObject("cache-" + i, "");
                map.put("cache-" + i, "");
            } else {
                map.put("cache-" + i, redisCache.getCacheObject("cache-" + i));
            }
        }
        String key = null;
        String value = "";
        for (Map.Entry<String, String> entry : map.entrySet()) {
            if (StringUtils.isEmpty(value)) {
                value = entry.getValue();
                key = entry.getKey();
            } else {
                if (entry.getValue().split(",").length < value.split(",").length) {
                    value = entry.getValue();
                    key = entry.getKey();
                }
            }
        }
        return key;
    }
}
ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/RouterVo.java
@@ -1,16 +1,16 @@
package com.ruoyi.system.domain.vo;
import com.fasterxml.jackson.annotation.JsonInclude;
import java.util.List;
/**
 * è·¯ç”±é…ç½®ä¿¡æ¯
 *
 *
 * @author ruoyi
 */
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class RouterVo
{
public class RouterVo {
    /**
     * è·¯ç”±åå­—
     */
@@ -56,93 +56,88 @@
     */
    private List<RouterVo> children;
    public String getName()
    {
    /**
     * å­èœå•名集合
     */
    private List<String> childName;
    public List<String> getChildName() {
        return childName;
    }
    public void setChildName(List<String> childName) {
        this.childName = childName;
    }
    public String getName() {
        return name;
    }
    public void setName(String name)
    {
    public void setName(String name) {
        this.name = name;
    }
    public String getPath()
    {
    public String getPath() {
        return path;
    }
    public void setPath(String path)
    {
    public void setPath(String path) {
        this.path = path;
    }
    public boolean getHidden()
    {
    public boolean getHidden() {
        return hidden;
    }
    public void setHidden(boolean hidden)
    {
    public void setHidden(boolean hidden) {
        this.hidden = hidden;
    }
    public String getRedirect()
    {
    public String getRedirect() {
        return redirect;
    }
    public void setRedirect(String redirect)
    {
    public void setRedirect(String redirect) {
        this.redirect = redirect;
    }
    public String getComponent()
    {
    public String getComponent() {
        return component;
    }
    public void setComponent(String component)
    {
    public void setComponent(String component) {
        this.component = component;
    }
    public String getQuery()
    {
    public String getQuery() {
        return query;
    }
    public void setQuery(String query)
    {
    public void setQuery(String query) {
        this.query = query;
    }
    public Boolean getAlwaysShow()
    {
    public Boolean getAlwaysShow() {
        return alwaysShow;
    }
    public void setAlwaysShow(Boolean alwaysShow)
    {
    public void setAlwaysShow(Boolean alwaysShow) {
        this.alwaysShow = alwaysShow;
    }
    public MetaVo getMeta()
    {
    public MetaVo getMeta() {
        return meta;
    }
    public void setMeta(MetaVo meta)
    {
    public void setMeta(MetaVo meta) {
        this.meta = meta;
    }
    public List<RouterVo> getChildren()
    {
    public List<RouterVo> getChildren() {
        return children;
    }
    public void setChildren(List<RouterVo> children)
    {
    public void setChildren(List<RouterVo> children) {
        this.children = children;
    }
}
ruoyi-system/src/main/java/com/ruoyi/system/mapper/BaseUserInfoMapper.java
@@ -2,18 +2,20 @@
import java.util.List;
import com.ruoyi.system.domain.BaseUserInfo;
import org.apache.ibatis.annotations.Mapper;
/**
 * ç”¨æˆ·Mapper接口
 *
 *
 * @author ruoyi
 * @date 2023-05-25
 */
public interface BaseUserInfoMapper
@Mapper
public interface BaseUserInfoMapper
{
    /**
     * æŸ¥è¯¢ç”¨æˆ·
     *
     *
     * @param userid ç”¨æˆ·ä¸»é”®
     * @return ç”¨æˆ·
     */
@@ -21,7 +23,7 @@
    /**
     * æŸ¥è¯¢ç”¨æˆ·åˆ—表
     *
     *
     * @param baseUserInfo ç”¨æˆ·
     * @return ç”¨æˆ·é›†åˆ
     */
@@ -29,7 +31,7 @@
    /**
     * æ–°å¢žç”¨æˆ·
     *
     *
     * @param baseUserInfo ç”¨æˆ·
     * @return ç»“æžœ
     */
@@ -37,7 +39,7 @@
    /**
     * ä¿®æ”¹ç”¨æˆ·
     *
     *
     * @param baseUserInfo ç”¨æˆ·
     * @return ç»“æžœ
     */
@@ -45,7 +47,7 @@
    /**
     * åˆ é™¤ç”¨æˆ·
     *
     *
     * @param userid ç”¨æˆ·ä¸»é”®
     * @return ç»“æžœ
     */
@@ -53,7 +55,7 @@
    /**
     * æ‰¹é‡åˆ é™¤ç”¨æˆ·
     *
     *
     * @param userids éœ€è¦åˆ é™¤çš„æ•°æ®ä¸»é”®é›†åˆ
     * @return ç»“æžœ
     */
ruoyi-system/src/main/java/com/ruoyi/system/mapper/EquipmentinfoMapper.java
@@ -2,18 +2,20 @@
import java.util.List;
import com.ruoyi.system.domain.Equipmentinfo;
import org.apache.ibatis.annotations.Mapper;
/**
 * ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘Mapper接口
 *
 *
 * @author ruoyi
 * @date 2023-05-25
 */
public interface EquipmentinfoMapper
@Mapper
public interface EquipmentinfoMapper
{
    /**
     * æŸ¥è¯¢ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘
     *
     *
     * @param id ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘ä¸»é”®
     * @return ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘
     */
@@ -21,7 +23,7 @@
    /**
     * æŸ¥è¯¢ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘åˆ—è¡¨
     *
     *
     * @param equipmentinfo ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘
     * @return ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘é›†åˆ
     */
@@ -29,7 +31,7 @@
    /**
     * æ–°å¢žã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘
     *
     *
     * @param equipmentinfo ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘
     * @return ç»“æžœ
     */
@@ -37,7 +39,7 @@
    /**
     * ä¿®æ”¹ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘
     *
     *
     * @param equipmentinfo ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘
     * @return ç»“æžœ
     */
@@ -45,7 +47,7 @@
    /**
     * åˆ é™¤ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘
     *
     *
     * @param id ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘ä¸»é”®
     * @return ç»“æžœ
     */
@@ -53,7 +55,7 @@
    /**
     * æ‰¹é‡åˆ é™¤ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘
     *
     *
     * @param ids éœ€è¦åˆ é™¤çš„æ•°æ®ä¸»é”®é›†åˆ
     * @return ç»“æžœ
     */
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java
@@ -1,19 +1,22 @@
package com.ruoyi.system.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import com.ruoyi.common.core.domain.entity.SysDept;
/**
 * éƒ¨é—¨ç®¡ç† æ•°æ®å±‚
 *
 *
 * @author ruoyi
 */
@Mapper
public interface SysDeptMapper
{
    /**
     * æŸ¥è¯¢éƒ¨é—¨ç®¡ç†æ•°æ®
     *
     *
     * @param dept éƒ¨é—¨ä¿¡æ¯
     * @return éƒ¨é—¨ä¿¡æ¯é›†åˆ
     */
@@ -21,7 +24,7 @@
    /**
     * æ ¹æ®è§’色ID查询部门树信息
     *
     *
     * @param roleId è§’色ID
     * @param deptCheckStrictly éƒ¨é—¨æ ‘选择项是否关联显示
     * @return é€‰ä¸­éƒ¨é—¨åˆ—表
@@ -30,7 +33,7 @@
    /**
     * æ ¹æ®éƒ¨é—¨ID查询信息
     *
     *
     * @param deptId éƒ¨é—¨ID
     * @return éƒ¨é—¨ä¿¡æ¯
     */
@@ -38,7 +41,7 @@
    /**
     * æ ¹æ®ID查询所有子部门
     *
     *
     * @param deptId éƒ¨é—¨ID
     * @return éƒ¨é—¨åˆ—表
     */
@@ -46,7 +49,7 @@
    /**
     * æ ¹æ®ID查询所有子部门(正常状态)
     *
     *
     * @param deptId éƒ¨é—¨ID
     * @return å­éƒ¨é—¨æ•°
     */
@@ -54,7 +57,7 @@
    /**
     * æ˜¯å¦å­˜åœ¨å­èŠ‚ç‚¹
     *
     *
     * @param deptId éƒ¨é—¨ID
     * @return ç»“æžœ
     */
@@ -62,7 +65,7 @@
    /**
     * æŸ¥è¯¢éƒ¨é—¨æ˜¯å¦å­˜åœ¨ç”¨æˆ·
     *
     *
     * @param deptId éƒ¨é—¨ID
     * @return ç»“æžœ
     */
@@ -70,7 +73,7 @@
    /**
     * æ ¡éªŒéƒ¨é—¨åç§°æ˜¯å¦å”¯ä¸€
     *
     *
     * @param deptName éƒ¨é—¨åç§°
     * @param parentId çˆ¶éƒ¨é—¨ID
     * @return ç»“æžœ
@@ -79,7 +82,7 @@
    /**
     * æ–°å¢žéƒ¨é—¨ä¿¡æ¯
     *
     *
     * @param dept éƒ¨é—¨ä¿¡æ¯
     * @return ç»“æžœ
     */
@@ -87,7 +90,7 @@
    /**
     * ä¿®æ”¹éƒ¨é—¨ä¿¡æ¯
     *
     *
     * @param dept éƒ¨é—¨ä¿¡æ¯
     * @return ç»“æžœ
     */
@@ -95,14 +98,14 @@
    /**
     * ä¿®æ”¹æ‰€åœ¨éƒ¨é—¨æ­£å¸¸çŠ¶æ€
     *
     *
     * @param deptIds éƒ¨é—¨ID组
     */
    public void updateDeptStatusNormal(Long[] deptIds);
    /**
     * ä¿®æ”¹å­å…ƒç´ å…³ç³»
     *
     *
     * @param depts å­å…ƒç´ 
     * @return ç»“æžœ
     */
@@ -110,7 +113,7 @@
    /**
     * åˆ é™¤éƒ¨é—¨ç®¡ç†ä¿¡æ¯
     *
     *
     * @param deptId éƒ¨é—¨ID
     * @return ç»“æžœ
     */
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDictDataMapper.java
@@ -1,19 +1,22 @@
package com.ruoyi.system.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import com.ruoyi.common.core.domain.entity.SysDictData;
/**
 * å­—典表 æ•°æ®å±‚
 *
 *
 * @author ruoyi
 */
@Mapper
public interface SysDictDataMapper
{
    /**
     * æ ¹æ®æ¡ä»¶åˆ†é¡µæŸ¥è¯¢å­—典数据
     *
     *
     * @param dictData å­—典数据信息
     * @return å­—典数据集合信息
     */
@@ -21,7 +24,7 @@
    /**
     * æ ¹æ®å­—典类型查询字典数据
     *
     *
     * @param dictType å­—典类型
     * @return å­—典数据集合信息
     */
@@ -29,7 +32,7 @@
    /**
     * æ ¹æ®å­—典类型和字典键值查询字典数据信息
     *
     *
     * @param dictType å­—典类型
     * @param dictValue å­—典键值
     * @return å­—典标签
@@ -38,7 +41,7 @@
    /**
     * æ ¹æ®å­—典数据ID查询信息
     *
     *
     * @param dictCode å­—典数据ID
     * @return å­—典数据
     */
@@ -46,7 +49,7 @@
    /**
     * æŸ¥è¯¢å­—典数据
     *
     *
     * @param dictType å­—典类型
     * @return å­—典数据
     */
@@ -54,7 +57,7 @@
    /**
     * é€šè¿‡å­—å…¸ID删除字典数据信息
     *
     *
     * @param dictCode å­—典数据ID
     * @return ç»“æžœ
     */
@@ -62,7 +65,7 @@
    /**
     * æ‰¹é‡åˆ é™¤å­—典数据信息
     *
     *
     * @param dictCodes éœ€è¦åˆ é™¤çš„字典数据ID
     * @return ç»“æžœ
     */
@@ -70,7 +73,7 @@
    /**
     * æ–°å¢žå­—典数据信息
     *
     *
     * @param dictData å­—典数据信息
     * @return ç»“æžœ
     */
@@ -78,7 +81,7 @@
    /**
     * ä¿®æ”¹å­—典数据信息
     *
     *
     * @param dictData å­—典数据信息
     * @return ç»“æžœ
     */
@@ -86,7 +89,7 @@
    /**
     * åŒæ­¥ä¿®æ”¹å­—典类型
     *
     *
     * @param oldDictType æ—§å­—典类型
     * @param newDictType æ–°æ—§å­—典类型
     * @return ç»“æžœ
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDictTypeMapper.java
@@ -2,17 +2,19 @@
import java.util.List;
import com.ruoyi.common.core.domain.entity.SysDictType;
import org.apache.ibatis.annotations.Mapper;
/**
 * å­—典表 æ•°æ®å±‚
 *
 *
 * @author ruoyi
 */
@Mapper
public interface SysDictTypeMapper
{
    /**
     * æ ¹æ®æ¡ä»¶åˆ†é¡µæŸ¥è¯¢å­—典类型
     *
     *
     * @param dictType å­—典类型信息
     * @return å­—典类型集合信息
     */
@@ -20,14 +22,14 @@
    /**
     * æ ¹æ®æ‰€æœ‰å­—典类型
     *
     *
     * @return å­—典类型集合信息
     */
    public List<SysDictType> selectDictTypeAll();
    /**
     * æ ¹æ®å­—典类型ID查询信息
     *
     *
     * @param dictId å­—典类型ID
     * @return å­—典类型
     */
@@ -35,7 +37,7 @@
    /**
     * æ ¹æ®å­—典类型查询信息
     *
     *
     * @param dictType å­—典类型
     * @return å­—典类型
     */
@@ -43,7 +45,7 @@
    /**
     * é€šè¿‡å­—å…¸ID删除字典信息
     *
     *
     * @param dictId å­—å…¸ID
     * @return ç»“æžœ
     */
@@ -51,7 +53,7 @@
    /**
     * æ‰¹é‡åˆ é™¤å­—典类型信息
     *
     *
     * @param dictIds éœ€è¦åˆ é™¤çš„å­—å…¸ID
     * @return ç»“æžœ
     */
@@ -59,7 +61,7 @@
    /**
     * æ–°å¢žå­—典类型信息
     *
     *
     * @param dictType å­—典类型信息
     * @return ç»“æžœ
     */
@@ -67,7 +69,7 @@
    /**
     * ä¿®æ”¹å­—典类型信息
     *
     *
     * @param dictType å­—典类型信息
     * @return ç»“æžœ
     */
@@ -75,7 +77,7 @@
    /**
     * æ ¡éªŒå­—典类型称是否唯一
     *
     *
     * @param dictType å­—典类型
     * @return ç»“æžœ
     */
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysLogininforMapper.java
@@ -2,24 +2,26 @@
import java.util.List;
import com.ruoyi.system.domain.SysLogininfor;
import org.apache.ibatis.annotations.Mapper;
/**
 * ç³»ç»Ÿè®¿é—®æ—¥å¿—情况信息 æ•°æ®å±‚
 *
 *
 * @author ruoyi
 */
@Mapper
public interface SysLogininforMapper
{
    /**
     * æ–°å¢žç³»ç»Ÿç™»å½•日志
     *
     *
     * @param logininfor è®¿é—®æ—¥å¿—对象
     */
    public void insertLogininfor(SysLogininfor logininfor);
    /**
     * æŸ¥è¯¢ç³»ç»Ÿç™»å½•日志集合
     *
     *
     * @param logininfor è®¿é—®æ—¥å¿—对象
     * @return ç™»å½•记录集合
     */
@@ -27,7 +29,7 @@
    /**
     * æ‰¹é‡åˆ é™¤ç³»ç»Ÿç™»å½•日志
     *
     *
     * @param infoIds éœ€è¦åˆ é™¤çš„登录日志ID
     * @return ç»“æžœ
     */
@@ -35,7 +37,7 @@
    /**
     * æ¸…空系统登录日志
     *
     *
     * @return ç»“æžœ
     */
    public int cleanLogininfor();
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysMenuMapper.java
@@ -1,6 +1,8 @@
package com.ruoyi.system.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import com.ruoyi.common.core.domain.entity.SysMenu;
@@ -9,6 +11,7 @@
 *
 * @author ruoyi
 */
@Mapper
public interface SysMenuMapper
{
    /**
@@ -36,7 +39,7 @@
    /**
     * æ ¹æ®è§’色ID查询权限
     *
     *
     * @param roleId è§’色ID
     * @return æƒé™åˆ—表
     */
@@ -67,7 +70,7 @@
    /**
     * æ ¹æ®è§’色ID查询菜单树信息
     *
     *
     * @param roleId è§’色ID
     * @param menuCheckStrictly èœå•树选择项是否关联显示
     * @return é€‰ä¸­èœå•列表
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysNoticeMapper.java
@@ -2,17 +2,19 @@
import java.util.List;
import com.ruoyi.system.domain.SysNotice;
import org.apache.ibatis.annotations.Mapper;
/**
 * é€šçŸ¥å…¬å‘Šè¡¨ æ•°æ®å±‚
 *
 *
 * @author ruoyi
 */
@Mapper
public interface SysNoticeMapper
{
    /**
     * æŸ¥è¯¢å…¬å‘Šä¿¡æ¯
     *
     *
     * @param noticeId å…¬å‘ŠID
     * @return å…¬å‘Šä¿¡æ¯
     */
@@ -20,7 +22,7 @@
    /**
     * æŸ¥è¯¢å…¬å‘Šåˆ—表
     *
     *
     * @param notice å…¬å‘Šä¿¡æ¯
     * @return å…¬å‘Šé›†åˆ
     */
@@ -28,7 +30,7 @@
    /**
     * æ–°å¢žå…¬å‘Š
     *
     *
     * @param notice å…¬å‘Šä¿¡æ¯
     * @return ç»“æžœ
     */
@@ -36,7 +38,7 @@
    /**
     * ä¿®æ”¹å…¬å‘Š
     *
     *
     * @param notice å…¬å‘Šä¿¡æ¯
     * @return ç»“æžœ
     */
@@ -44,7 +46,7 @@
    /**
     * æ‰¹é‡åˆ é™¤å…¬å‘Š
     *
     *
     * @param noticeId å…¬å‘ŠID
     * @return ç»“æžœ
     */
@@ -52,7 +54,7 @@
    /**
     * æ‰¹é‡åˆ é™¤å…¬å‘Šä¿¡æ¯
     *
     *
     * @param noticeIds éœ€è¦åˆ é™¤çš„公告ID
     * @return ç»“æžœ
     */
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysOperLogMapper.java
@@ -2,24 +2,26 @@
import java.util.List;
import com.ruoyi.system.domain.SysOperLog;
import org.apache.ibatis.annotations.Mapper;
/**
 * æ“ä½œæ—¥å¿— æ•°æ®å±‚
 *
 *
 * @author ruoyi
 */
@Mapper
public interface SysOperLogMapper
{
    /**
     * æ–°å¢žæ“ä½œæ—¥å¿—
     *
     *
     * @param operLog æ“ä½œæ—¥å¿—对象
     */
    public void insertOperlog(SysOperLog operLog);
    /**
     * æŸ¥è¯¢ç³»ç»Ÿæ“ä½œæ—¥å¿—集合
     *
     *
     * @param operLog æ“ä½œæ—¥å¿—对象
     * @return æ“ä½œæ—¥å¿—集合
     */
@@ -27,7 +29,7 @@
    /**
     * æ‰¹é‡åˆ é™¤ç³»ç»Ÿæ“ä½œæ—¥å¿—
     *
     *
     * @param operIds éœ€è¦åˆ é™¤çš„æ“ä½œæ—¥å¿—ID
     * @return ç»“æžœ
     */
@@ -35,7 +37,7 @@
    /**
     * æŸ¥è¯¢æ“ä½œæ—¥å¿—详细
     *
     *
     * @param operId æ“ä½œID
     * @return æ“ä½œæ—¥å¿—对象
     */
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysPostMapper.java
@@ -2,17 +2,19 @@
import java.util.List;
import com.ruoyi.system.domain.SysPost;
import org.apache.ibatis.annotations.Mapper;
/**
 * å²—位信息 æ•°æ®å±‚
 *
 *
 * @author ruoyi
 */
@Mapper
public interface SysPostMapper
{
    /**
     * æŸ¥è¯¢å²—位数据集合
     *
     *
     * @param post å²—位信息
     * @return å²—位数据集合
     */
@@ -20,14 +22,14 @@
    /**
     * æŸ¥è¯¢æ‰€æœ‰å²—位
     *
     *
     * @return å²—位列表
     */
    public List<SysPost> selectPostAll();
    /**
     * é€šè¿‡å²—位ID查询岗位信息
     *
     *
     * @param postId å²—位ID
     * @return è§’色对象信息
     */
@@ -35,7 +37,7 @@
    /**
     * æ ¹æ®ç”¨æˆ·ID获取岗位选择框列表
     *
     *
     * @param userId ç”¨æˆ·ID
     * @return é€‰ä¸­å²—位ID列表
     */
@@ -43,7 +45,7 @@
    /**
     * æŸ¥è¯¢ç”¨æˆ·æ‰€å±žå²—位组
     *
     *
     * @param userName ç”¨æˆ·å
     * @return ç»“æžœ
     */
@@ -51,7 +53,7 @@
    /**
     * åˆ é™¤å²—位信息
     *
     *
     * @param postId å²—位ID
     * @return ç»“æžœ
     */
@@ -59,7 +61,7 @@
    /**
     * æ‰¹é‡åˆ é™¤å²—位信息
     *
     *
     * @param postIds éœ€è¦åˆ é™¤çš„岗位ID
     * @return ç»“æžœ
     */
@@ -67,7 +69,7 @@
    /**
     * ä¿®æ”¹å²—位信息
     *
     *
     * @param post å²—位信息
     * @return ç»“æžœ
     */
@@ -75,7 +77,7 @@
    /**
     * æ–°å¢žå²—位信息
     *
     *
     * @param post å²—位信息
     * @return ç»“æžœ
     */
@@ -83,7 +85,7 @@
    /**
     * æ ¡éªŒå²—位名称
     *
     *
     * @param postName å²—位名称
     * @return ç»“æžœ
     */
@@ -91,7 +93,7 @@
    /**
     * æ ¡éªŒå²—位编码
     *
     *
     * @param postCode å²—位编码
     * @return ç»“æžœ
     */
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleDeptMapper.java
@@ -2,17 +2,19 @@
import java.util.List;
import com.ruoyi.system.domain.SysRoleDept;
import org.apache.ibatis.annotations.Mapper;
/**
 * è§’色与部门关联表 æ•°æ®å±‚
 *
 *
 * @author ruoyi
 */
@Mapper
public interface SysRoleDeptMapper
{
    /**
     * é€šè¿‡è§’色ID删除角色和部门关联
     *
     *
     * @param roleId è§’色ID
     * @return ç»“æžœ
     */
@@ -20,7 +22,7 @@
    /**
     * æ‰¹é‡åˆ é™¤è§’色部门关联信息
     *
     *
     * @param ids éœ€è¦åˆ é™¤çš„æ•°æ®ID
     * @return ç»“æžœ
     */
@@ -28,7 +30,7 @@
    /**
     * æŸ¥è¯¢éƒ¨é—¨ä½¿ç”¨æ•°é‡
     *
     *
     * @param deptId éƒ¨é—¨ID
     * @return ç»“æžœ
     */
@@ -36,7 +38,7 @@
    /**
     * æ‰¹é‡æ–°å¢žè§’色部门信息
     *
     *
     * @param roleDeptList è§’色部门列表
     * @return ç»“æžœ
     */
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleMapper.java
@@ -2,17 +2,19 @@
import java.util.List;
import com.ruoyi.common.core.domain.entity.SysRole;
import org.apache.ibatis.annotations.Mapper;
/**
 * è§’色表 æ•°æ®å±‚
 *
 *
 * @author ruoyi
 */
@Mapper
public interface SysRoleMapper
{
    /**
     * æ ¹æ®æ¡ä»¶åˆ†é¡µæŸ¥è¯¢è§’色数据
     *
     *
     * @param role è§’色信息
     * @return è§’色数据集合信息
     */
@@ -20,7 +22,7 @@
    /**
     * æ ¹æ®ç”¨æˆ·ID查询角色
     *
     *
     * @param userId ç”¨æˆ·ID
     * @return è§’色列表
     */
@@ -28,14 +30,14 @@
    /**
     * æŸ¥è¯¢æ‰€æœ‰è§’色
     *
     *
     * @return è§’色列表
     */
    public List<SysRole> selectRoleAll();
    /**
     * æ ¹æ®ç”¨æˆ·ID获取角色选择框列表
     *
     *
     * @param userId ç”¨æˆ·ID
     * @return é€‰ä¸­è§’色ID列表
     */
@@ -43,7 +45,7 @@
    /**
     * é€šè¿‡è§’色ID查询角色
     *
     *
     * @param roleId è§’色ID
     * @return è§’色对象信息
     */
@@ -51,7 +53,7 @@
    /**
     * æ ¹æ®ç”¨æˆ·ID查询角色
     *
     *
     * @param userName ç”¨æˆ·å
     * @return è§’色列表
     */
@@ -59,7 +61,7 @@
    /**
     * æ ¡éªŒè§’色名称是否唯一
     *
     *
     * @param roleName è§’色名称
     * @return è§’色信息
     */
@@ -67,7 +69,7 @@
    /**
     * æ ¡éªŒè§’色权限是否唯一
     *
     *
     * @param roleKey è§’色权限
     * @return è§’色信息
     */
@@ -75,7 +77,7 @@
    /**
     * ä¿®æ”¹è§’色信息
     *
     *
     * @param role è§’色信息
     * @return ç»“æžœ
     */
@@ -83,7 +85,7 @@
    /**
     * æ–°å¢žè§’色信息
     *
     *
     * @param role è§’色信息
     * @return ç»“æžœ
     */
@@ -91,7 +93,7 @@
    /**
     * é€šè¿‡è§’色ID删除角色
     *
     *
     * @param roleId è§’色ID
     * @return ç»“æžœ
     */
@@ -99,7 +101,7 @@
    /**
     * æ‰¹é‡åˆ é™¤è§’色信息
     *
     *
     * @param roleIds éœ€è¦åˆ é™¤çš„角色ID
     * @return ç»“æžœ
     */
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleMenuMapper.java
@@ -2,17 +2,19 @@
import java.util.List;
import com.ruoyi.system.domain.SysRoleMenu;
import org.apache.ibatis.annotations.Mapper;
/**
 * è§’色与菜单关联表 æ•°æ®å±‚
 *
 *
 * @author ruoyi
 */
@Mapper
public interface SysRoleMenuMapper
{
    /**
     * æŸ¥è¯¢èœå•使用数量
     *
     *
     * @param menuId èœå•ID
     * @return ç»“æžœ
     */
@@ -20,7 +22,7 @@
    /**
     * é€šè¿‡è§’色ID删除角色和菜单关联
     *
     *
     * @param roleId è§’色ID
     * @return ç»“æžœ
     */
@@ -28,7 +30,7 @@
    /**
     * æ‰¹é‡åˆ é™¤è§’色菜单关联信息
     *
     *
     * @param ids éœ€è¦åˆ é™¤çš„æ•°æ®ID
     * @return ç»“æžœ
     */
@@ -36,7 +38,7 @@
    /**
     * æ‰¹é‡æ–°å¢žè§’色菜单信息
     *
     *
     * @param roleMenuList è§’色菜单列表
     * @return ç»“æžœ
     */
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java
@@ -1,19 +1,22 @@
package com.ruoyi.system.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import com.ruoyi.common.core.domain.entity.SysUser;
/**
 * ç”¨æˆ·è¡¨ æ•°æ®å±‚
 *
 *
 * @author ruoyi
 */
@Mapper
public interface SysUserMapper
{
    /**
     * æ ¹æ®æ¡ä»¶åˆ†é¡µæŸ¥è¯¢ç”¨æˆ·åˆ—表
     *
     *
     * @param sysUser ç”¨æˆ·ä¿¡æ¯
     * @return ç”¨æˆ·ä¿¡æ¯é›†åˆä¿¡æ¯
     */
@@ -21,7 +24,7 @@
    /**
     * æ ¹æ®æ¡ä»¶åˆ†é¡µæŸ¥è¯¢å·²é…ç”¨æˆ·è§’色列表
     *
     *
     * @param user ç”¨æˆ·ä¿¡æ¯
     * @return ç”¨æˆ·ä¿¡æ¯é›†åˆä¿¡æ¯
     */
@@ -29,7 +32,7 @@
    /**
     * æ ¹æ®æ¡ä»¶åˆ†é¡µæŸ¥è¯¢æœªåˆ†é…ç”¨æˆ·è§’色列表
     *
     *
     * @param user ç”¨æˆ·ä¿¡æ¯
     * @return ç”¨æˆ·ä¿¡æ¯é›†åˆä¿¡æ¯
     */
@@ -37,7 +40,7 @@
    /**
     * é€šè¿‡ç”¨æˆ·åæŸ¥è¯¢ç”¨æˆ·
     *
     *
     * @param userName ç”¨æˆ·å
     * @return ç”¨æˆ·å¯¹è±¡ä¿¡æ¯
     */
@@ -45,7 +48,7 @@
    /**
     * é€šè¿‡ç”¨æˆ·ID查询用户
     *
     *
     * @param userId ç”¨æˆ·ID
     * @return ç”¨æˆ·å¯¹è±¡ä¿¡æ¯
     */
@@ -53,7 +56,7 @@
    /**
     * æ–°å¢žç”¨æˆ·ä¿¡æ¯
     *
     *
     * @param user ç”¨æˆ·ä¿¡æ¯
     * @return ç»“æžœ
     */
@@ -61,7 +64,7 @@
    /**
     * ä¿®æ”¹ç”¨æˆ·ä¿¡æ¯
     *
     *
     * @param user ç”¨æˆ·ä¿¡æ¯
     * @return ç»“æžœ
     */
@@ -69,7 +72,7 @@
    /**
     * ä¿®æ”¹ç”¨æˆ·å¤´åƒ
     *
     *
     * @param userName ç”¨æˆ·å
     * @param avatar å¤´åƒåœ°å€
     * @return ç»“æžœ
@@ -78,7 +81,7 @@
    /**
     * é‡ç½®ç”¨æˆ·å¯†ç 
     *
     *
     * @param userName ç”¨æˆ·å
     * @param password å¯†ç 
     * @return ç»“æžœ
@@ -87,7 +90,7 @@
    /**
     * é€šè¿‡ç”¨æˆ·ID删除用户
     *
     *
     * @param userId ç”¨æˆ·ID
     * @return ç»“æžœ
     */
@@ -95,7 +98,7 @@
    /**
     * æ‰¹é‡åˆ é™¤ç”¨æˆ·ä¿¡æ¯
     *
     *
     * @param userIds éœ€è¦åˆ é™¤çš„用户ID
     * @return ç»“æžœ
     */
@@ -103,7 +106,7 @@
    /**
     * æ ¡éªŒç”¨æˆ·åç§°æ˜¯å¦å”¯ä¸€
     *
     *
     * @param userName ç”¨æˆ·åç§°
     * @return ç»“æžœ
     */
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserPostMapper.java
@@ -2,17 +2,19 @@
import java.util.List;
import com.ruoyi.system.domain.SysUserPost;
import org.apache.ibatis.annotations.Mapper;
/**
 * ç”¨æˆ·ä¸Žå²—位关联表 æ•°æ®å±‚
 *
 *
 * @author ruoyi
 */
@Mapper
public interface SysUserPostMapper
{
    /**
     * é€šè¿‡ç”¨æˆ·ID删除用户和岗位关联
     *
     *
     * @param userId ç”¨æˆ·ID
     * @return ç»“æžœ
     */
@@ -20,7 +22,7 @@
    /**
     * é€šè¿‡å²—位ID查询岗位使用数量
     *
     *
     * @param postId å²—位ID
     * @return ç»“æžœ
     */
@@ -28,7 +30,7 @@
    /**
     * æ‰¹é‡åˆ é™¤ç”¨æˆ·å’Œå²—位关联
     *
     *
     * @param ids éœ€è¦åˆ é™¤çš„æ•°æ®ID
     * @return ç»“æžœ
     */
@@ -36,7 +38,7 @@
    /**
     * æ‰¹é‡æ–°å¢žç”¨æˆ·å²—位信息
     *
     *
     * @param userPostList ç”¨æˆ·è§’色列表
     * @return ç»“æžœ
     */
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserRoleMapper.java
@@ -1,19 +1,22 @@
package com.ruoyi.system.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import com.ruoyi.system.domain.SysUserRole;
/**
 * ç”¨æˆ·ä¸Žè§’色关联表 æ•°æ®å±‚
 *
 *
 * @author ruoyi
 */
@Mapper
public interface SysUserRoleMapper
{
    /**
     * é€šè¿‡ç”¨æˆ·ID删除用户和角色关联
     *
     *
     * @param userId ç”¨æˆ·ID
     * @return ç»“æžœ
     */
@@ -21,7 +24,7 @@
    /**
     * æ‰¹é‡åˆ é™¤ç”¨æˆ·å’Œè§’色关联
     *
     *
     * @param ids éœ€è¦åˆ é™¤çš„æ•°æ®ID
     * @return ç»“æžœ
     */
@@ -29,7 +32,7 @@
    /**
     * é€šè¿‡è§’色ID查询角色使用数量
     *
     *
     * @param roleId è§’色ID
     * @return ç»“æžœ
     */
@@ -37,7 +40,7 @@
    /**
     * æ‰¹é‡æ–°å¢žç”¨æˆ·è§’色信息
     *
     *
     * @param userRoleList ç”¨æˆ·è§’色列表
     * @return ç»“æžœ
     */
@@ -45,7 +48,7 @@
    /**
     * åˆ é™¤ç”¨æˆ·å’Œè§’色关联信息
     *
     *
     * @param userRole ç”¨æˆ·å’Œè§’色关联信息
     * @return ç»“æžœ
     */
@@ -53,7 +56,7 @@
    /**
     * æ‰¹é‡å–消授权用户角色
     *
     *
     * @param roleId è§’色ID
     * @param userIds éœ€è¦åˆ é™¤çš„用户数据ID
     * @return ç»“æžœ
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java
@@ -8,6 +8,8 @@
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.common.constant.Constants;
@@ -27,12 +29,11 @@
/**
 * èœå• ä¸šåŠ¡å±‚å¤„ç†
 *
 *
 * @author ruoyi
 */
@Service
public class SysMenuServiceImpl implements ISysMenuService
{
public class SysMenuServiceImpl implements ISysMenuService {
    public static final String PREMISSION_STRING = "perms[\"{0}\"]";
    @Autowired
@@ -46,34 +47,29 @@
    /**
     * æ ¹æ®ç”¨æˆ·æŸ¥è¯¢ç³»ç»Ÿèœå•列表
     *
     *
     * @param userId ç”¨æˆ·ID
     * @return èœå•列表
     */
    @Override
    public List<SysMenu> selectMenuList(Long userId)
    {
    public List<SysMenu> selectMenuList(Long userId) {
        return selectMenuList(new SysMenu(), userId);
    }
    /**
     * æŸ¥è¯¢ç³»ç»Ÿèœå•列表
     *
     *
     * @param menu èœå•信息
     * @return èœå•列表
     */
    @Override
    public List<SysMenu> selectMenuList(SysMenu menu, Long userId)
    {
    public List<SysMenu> selectMenuList(SysMenu menu, Long userId) {
        List<SysMenu> menuList = null;
        // ç®¡ç†å‘˜æ˜¾ç¤ºæ‰€æœ‰èœå•信息
        if (SysUser.isAdmin(userId))
        {
        if (SysUser.isAdmin(userId)) {
            menuList = menuMapper.selectMenuList(menu);
        }
        else
        {
            menu.getParams().put("userId", userId);
        } else {
            menu.getParams().put("userId" , userId);
            menuList = menuMapper.selectMenuListByUserId(menu);
        }
        return menuList;
@@ -81,19 +77,16 @@
    /**
     * æ ¹æ®ç”¨æˆ·ID查询权限
     *
     *
     * @param userId ç”¨æˆ·ID
     * @return æƒé™åˆ—表
     */
    @Override
    public Set<String> selectMenuPermsByUserId(Long userId)
    {
    public Set<String> selectMenuPermsByUserId(Long userId) {
        List<String> perms = menuMapper.selectMenuPermsByUserId(userId);
        Set<String> permsSet = new HashSet<>();
        for (String perm : perms)
        {
            if (StringUtils.isNotEmpty(perm))
            {
        for (String perm : perms) {
            if (StringUtils.isNotEmpty(perm)) {
                permsSet.addAll(Arrays.asList(perm.trim().split(",")));
            }
        }
@@ -102,19 +95,16 @@
    /**
     * æ ¹æ®è§’色ID查询权限
     *
     *
     * @param roleId è§’色ID
     * @return æƒé™åˆ—表
     */
    @Override
    public Set<String> selectMenuPermsByRoleId(Long roleId)
    {
    public Set<String> selectMenuPermsByRoleId(Long roleId) {
        List<String> perms = menuMapper.selectMenuPermsByRoleId(roleId);
        Set<String> permsSet = new HashSet<>();
        for (String perm : perms)
        {
            if (StringUtils.isNotEmpty(perm))
            {
        for (String perm : perms) {
            if (StringUtils.isNotEmpty(perm)) {
                permsSet.addAll(Arrays.asList(perm.trim().split(",")));
            }
        }
@@ -123,20 +113,16 @@
    /**
     * æ ¹æ®ç”¨æˆ·ID查询菜单
     *
     *
     * @param userId ç”¨æˆ·åç§°
     * @return èœå•列表
     */
    @Override
    public List<SysMenu> selectMenuTreeByUserId(Long userId)
    {
    public List<SysMenu> selectMenuTreeByUserId(Long userId) {
        List<SysMenu> menus = null;
        if (SecurityUtils.isAdmin(userId))
        {
        if (SecurityUtils.isAdmin(userId)) {
            menus = menuMapper.selectMenuTreeAll();
        }
        else
        {
        } else {
            menus = menuMapper.selectMenuTreeByUserId(userId);
        }
        return getChildPerms(menus, 0);
@@ -144,58 +130,50 @@
    /**
     * æ ¹æ®è§’色ID查询菜单树信息
     *
     *
     * @param roleId è§’色ID
     * @return é€‰ä¸­èœå•列表
     */
    @Override
    public List<Long> selectMenuListByRoleId(Long roleId)
    {
    public List<Long> selectMenuListByRoleId(Long roleId) {
        SysRole role = roleMapper.selectRoleById(roleId);
        return menuMapper.selectMenuListByRoleId(roleId, role.isMenuCheckStrictly());
    }
    /**
     * æž„建前端路由所需要的菜单
     *
     *
     * @param menus èœå•列表
     * @return è·¯ç”±åˆ—表
     */
    @Override
    public List<RouterVo> buildMenus(List<SysMenu> menus)
    {
    public List<RouterVo> buildMenus(List<SysMenu> menus) {
        List<RouterVo> routers = new LinkedList<RouterVo>();
        for (SysMenu menu : menus)
        {
        for (SysMenu menu : menus) {
            RouterVo router = new RouterVo();
            router.setHidden("1".equals(menu.getVisible()));
            router.setName(getRouteName(menu));
            router.setPath(getRouterPath(menu));
            router.setComponent(getComponent(menu));
            router.setQuery(menu.getQuery());
            router.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon(), StringUtils.equals("1", menu.getIsCache()), menu.getPath()));
            router.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon(), StringUtils.equals("1" , menu.getIsCache()), menu.getPath()));
            List<SysMenu> cMenus = menu.getChildren();
            if (!cMenus.isEmpty() && cMenus.size() > 0 && UserConstants.TYPE_DIR.equals(menu.getMenuType()))
            {
            if (!cMenus.isEmpty() && cMenus.size() > 0 && UserConstants.TYPE_DIR.equals(menu.getMenuType())) {
                router.setAlwaysShow(true);
                router.setRedirect("noRedirect");
                router.setChildren(buildMenus(cMenus));
            }
            else if (isMenuFrame(menu))
            {
            } else if (isMenuFrame(menu)) {
                router.setMeta(null);
                List<RouterVo> childrenList = new ArrayList<RouterVo>();
                RouterVo children = new RouterVo();
                children.setPath(menu.getPath());
                children.setComponent(menu.getComponent());
                children.setName(StringUtils.capitalize(menu.getPath()));
                children.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon(), StringUtils.equals("1", menu.getIsCache()), menu.getPath()));
                children.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon(), StringUtils.equals("1" , menu.getIsCache()), menu.getPath()));
                children.setQuery(menu.getQuery());
                childrenList.add(children);
                router.setChildren(childrenList);
            }
            else if (menu.getParentId().intValue() == 0 && isInnerLink(menu))
            {
            } else if (menu.getParentId().intValue() == 0 && isInnerLink(menu)) {
                router.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon()));
                router.setPath("/");
                List<RouterVo> childrenList = new ArrayList<RouterVo>();
@@ -210,32 +188,40 @@
            }
            routers.add(router);
        }
        for (RouterVo routerVo : routers) {
            List<String> childName = new ArrayList<>();
            List<RouterVo> childrens = routerVo.getChildren();
            if (CollectionUtils.isNotEmpty(childrens)) {
                for (RouterVo routerVo1 : childrens) {
                    if (!routerVo1.getHidden()) {
                        childName.add(routerVo1.getMeta().getTitle());
                    }
                }
            }
            routerVo.setChildName(childName);
        }
        return routers;
    }
    /**
     * æž„建前端所需要树结构
     *
     *
     * @param menus èœå•列表
     * @return æ ‘结构列表
     */
    @Override
    public List<SysMenu> buildMenuTree(List<SysMenu> menus)
    {
    public List<SysMenu> buildMenuTree(List<SysMenu> menus) {
        List<SysMenu> returnList = new ArrayList<SysMenu>();
        List<Long> tempList = menus.stream().map(SysMenu::getMenuId).collect(Collectors.toList());
        for (Iterator<SysMenu> iterator = menus.iterator(); iterator.hasNext();)
        {
        for (Iterator<SysMenu> iterator = menus.iterator(); iterator.hasNext(); ) {
            SysMenu menu = (SysMenu) iterator.next();
            // å¦‚果是顶级节点, éåŽ†è¯¥çˆ¶èŠ‚ç‚¹çš„æ‰€æœ‰å­èŠ‚ç‚¹
            if (!tempList.contains(menu.getParentId()))
            {
            if (!tempList.contains(menu.getParentId())) {
                recursionFn(menus, menu);
                returnList.add(menu);
            }
        }
        if (returnList.isEmpty())
        {
        if (returnList.isEmpty()) {
            returnList = menus;
        }
        return returnList;
@@ -243,104 +229,95 @@
    /**
     * æž„建前端所需要下拉树结构
     *
     *
     * @param menus èœå•列表
     * @return ä¸‹æ‹‰æ ‘结构列表
     */
    @Override
    public List<TreeSelect> buildMenuTreeSelect(List<SysMenu> menus)
    {
    public List<TreeSelect> buildMenuTreeSelect(List<SysMenu> menus) {
        List<SysMenu> menuTrees = buildMenuTree(menus);
        return menuTrees.stream().map(TreeSelect::new).collect(Collectors.toList());
    }
    /**
     * æ ¹æ®èœå•ID查询信息
     *
     *
     * @param menuId èœå•ID
     * @return èœå•信息
     */
    @Override
    public SysMenu selectMenuById(Long menuId)
    {
    public SysMenu selectMenuById(Long menuId) {
        return menuMapper.selectMenuById(menuId);
    }
    /**
     * æ˜¯å¦å­˜åœ¨èœå•子节点
     *
     *
     * @param menuId èœå•ID
     * @return ç»“æžœ
     */
    @Override
    public boolean hasChildByMenuId(Long menuId)
    {
    public boolean hasChildByMenuId(Long menuId) {
        int result = menuMapper.hasChildByMenuId(menuId);
        return result > 0;
    }
    /**
     * æŸ¥è¯¢èœå•使用数量
     *
     *
     * @param menuId èœå•ID
     * @return ç»“æžœ
     */
    @Override
    public boolean checkMenuExistRole(Long menuId)
    {
    public boolean checkMenuExistRole(Long menuId) {
        int result = roleMenuMapper.checkMenuExistRole(menuId);
        return result > 0;
    }
    /**
     * æ–°å¢žä¿å­˜èœå•信息
     *
     *
     * @param menu èœå•信息
     * @return ç»“æžœ
     */
    @Override
    public int insertMenu(SysMenu menu)
    {
    public int insertMenu(SysMenu menu) {
        return menuMapper.insertMenu(menu);
    }
    /**
     * ä¿®æ”¹ä¿å­˜èœå•信息
     *
     *
     * @param menu èœå•信息
     * @return ç»“æžœ
     */
    @Override
    public int updateMenu(SysMenu menu)
    {
    public int updateMenu(SysMenu menu) {
        return menuMapper.updateMenu(menu);
    }
    /**
     * åˆ é™¤èœå•管理信息
     *
     *
     * @param menuId èœå•ID
     * @return ç»“æžœ
     */
    @Override
    public int deleteMenuById(Long menuId)
    {
    public int deleteMenuById(Long menuId) {
        return menuMapper.deleteMenuById(menuId);
    }
    /**
     * æ ¡éªŒèœå•名称是否唯一
     *
     *
     * @param menu èœå•信息
     * @return ç»“æžœ
     */
    @Override
    public String checkMenuNameUnique(SysMenu menu)
    {
    public String checkMenuNameUnique(SysMenu menu) {
        Long menuId = StringUtils.isNull(menu.getMenuId()) ? -1L : menu.getMenuId();
        SysMenu info = menuMapper.checkMenuNameUnique(menu.getMenuName(), menu.getParentId());
        if (StringUtils.isNotNull(info) && info.getMenuId().longValue() != menuId.longValue())
        {
        if (StringUtils.isNotNull(info) && info.getMenuId().longValue() != menuId.longValue()) {
            return UserConstants.NOT_UNIQUE;
        }
        return UserConstants.UNIQUE;
@@ -348,16 +325,14 @@
    /**
     * èŽ·å–è·¯ç”±åç§°
     *
     *
     * @param menu èœå•信息
     * @return è·¯ç”±åç§°
     */
    public String getRouteName(SysMenu menu)
    {
    public String getRouteName(SysMenu menu) {
        String routerName = StringUtils.capitalize(menu.getPath());
        // éžå¤–链并且是一级目录(类型为目录)
        if (isMenuFrame(menu))
        {
        if (isMenuFrame(menu)) {
            routerName = StringUtils.EMPTY;
        }
        return routerName;
@@ -365,27 +340,22 @@
    /**
     * èŽ·å–è·¯ç”±åœ°å€
     *
     *
     * @param menu èœå•信息
     * @return è·¯ç”±åœ°å€
     */
    public String getRouterPath(SysMenu menu)
    {
    public String getRouterPath(SysMenu menu) {
        String routerPath = menu.getPath();
        // å†…链打开外网方式
        if (menu.getParentId().intValue() != 0 && isInnerLink(menu))
        {
        if (menu.getParentId().intValue() != 0 && isInnerLink(menu)) {
            routerPath = innerLinkReplaceEach(routerPath);
        }
        // éžå¤–链并且是一级目录(类型为目录)
        if (0 == menu.getParentId().intValue() && UserConstants.TYPE_DIR.equals(menu.getMenuType())
                && UserConstants.NO_FRAME.equals(menu.getIsFrame()))
        {
        if (0 == menu.getParentId().intValue() && UserConstants.TYPE_DIR.equals(menu.getMenuType()) && UserConstants.NO_FRAME.equals(menu.getIsFrame())) {
            routerPath = "/" + menu.getPath();
        }
        // éžå¤–链并且是一级目录(类型为菜单)
        else if (isMenuFrame(menu))
        {
        else if (isMenuFrame(menu)) {
            routerPath = "/";
        }
        return routerPath;
@@ -393,23 +363,17 @@
    /**
     * èŽ·å–ç»„ä»¶ä¿¡æ¯
     *
     *
     * @param menu èœå•信息
     * @return ç»„件信息
     */
    public String getComponent(SysMenu menu)
    {
    public String getComponent(SysMenu menu) {
        String component = UserConstants.LAYOUT;
        if (StringUtils.isNotEmpty(menu.getComponent()) && !isMenuFrame(menu))
        {
        if (StringUtils.isNotEmpty(menu.getComponent()) && !isMenuFrame(menu)) {
            component = menu.getComponent();
        }
        else if (StringUtils.isEmpty(menu.getComponent()) && menu.getParentId().intValue() != 0 && isInnerLink(menu))
        {
        } else if (StringUtils.isEmpty(menu.getComponent()) && menu.getParentId().intValue() != 0 && isInnerLink(menu)) {
            component = UserConstants.INNER_LINK;
        }
        else if (StringUtils.isEmpty(menu.getComponent()) && isParentView(menu))
        {
        } else if (StringUtils.isEmpty(menu.getComponent()) && isParentView(menu)) {
            component = UserConstants.PARENT_VIEW;
        }
        return component;
@@ -417,54 +381,47 @@
    /**
     * æ˜¯å¦ä¸ºèœå•内部跳转
     *
     *
     * @param menu èœå•信息
     * @return ç»“æžœ
     */
    public boolean isMenuFrame(SysMenu menu)
    {
        return menu.getParentId().intValue() == 0 && UserConstants.TYPE_MENU.equals(menu.getMenuType())
                && menu.getIsFrame().equals(UserConstants.NO_FRAME);
    public boolean isMenuFrame(SysMenu menu) {
        return menu.getParentId().intValue() == 0 && UserConstants.TYPE_MENU.equals(menu.getMenuType()) && menu.getIsFrame().equals(UserConstants.NO_FRAME);
    }
    /**
     * æ˜¯å¦ä¸ºå†…链组件
     *
     *
     * @param menu èœå•信息
     * @return ç»“æžœ
     */
    public boolean isInnerLink(SysMenu menu)
    {
    public boolean isInnerLink(SysMenu menu) {
        return menu.getIsFrame().equals(UserConstants.NO_FRAME) && StringUtils.ishttp(menu.getPath());
    }
    /**
     * æ˜¯å¦ä¸ºparent_view组件
     *
     *
     * @param menu èœå•信息
     * @return ç»“æžœ
     */
    public boolean isParentView(SysMenu menu)
    {
    public boolean isParentView(SysMenu menu) {
        return menu.getParentId().intValue() != 0 && UserConstants.TYPE_DIR.equals(menu.getMenuType());
    }
    /**
     * æ ¹æ®çˆ¶èŠ‚ç‚¹çš„ID获取所有子节点
     *
     * @param list åˆ†ç±»è¡¨
     *
     * @param list     åˆ†ç±»è¡¨
     * @param parentId ä¼ å…¥çš„父节点ID
     * @return String
     */
    public List<SysMenu> getChildPerms(List<SysMenu> list, int parentId)
    {
    public List<SysMenu> getChildPerms(List<SysMenu> list, int parentId) {
        List<SysMenu> returnList = new ArrayList<SysMenu>();
        for (Iterator<SysMenu> iterator = list.iterator(); iterator.hasNext();)
        {
        for (Iterator<SysMenu> iterator = list.iterator(); iterator.hasNext(); ) {
            SysMenu t = (SysMenu) iterator.next();
            // ä¸€ã€æ ¹æ®ä¼ å…¥çš„æŸä¸ªçˆ¶èŠ‚ç‚¹ID,遍历该父节点的所有子节点
            if (t.getParentId() == parentId)
            {
            if (t.getParentId() == parentId) {
                recursionFn(list, t);
                returnList.add(t);
            }
@@ -474,19 +431,16 @@
    /**
     * é€’归列表
     *
     *
     * @param list åˆ†ç±»è¡¨
     * @param t å­èŠ‚ç‚¹
     * @param t    å­èŠ‚ç‚¹
     */
    private void recursionFn(List<SysMenu> list, SysMenu t)
    {
    private void recursionFn(List<SysMenu> list, SysMenu t) {
        // å¾—到子节点列表
        List<SysMenu> childList = getChildList(list, t);
        t.setChildren(childList);
        for (SysMenu tChild : childList)
        {
            if (hasChild(list, tChild))
            {
        for (SysMenu tChild : childList) {
            if (hasChild(list, tChild)) {
                recursionFn(list, tChild);
            }
        }
@@ -495,15 +449,12 @@
    /**
     * å¾—到子节点列表
     */
    private List<SysMenu> getChildList(List<SysMenu> list, SysMenu t)
    {
    private List<SysMenu> getChildList(List<SysMenu> list, SysMenu t) {
        List<SysMenu> tlist = new ArrayList<SysMenu>();
        Iterator<SysMenu> it = list.iterator();
        while (it.hasNext())
        {
        while (it.hasNext()) {
            SysMenu n = (SysMenu) it.next();
            if (n.getParentId().longValue() == t.getMenuId().longValue())
            {
            if (n.getParentId().longValue() == t.getMenuId().longValue()) {
                tlist.add(n);
            }
        }
@@ -513,19 +464,16 @@
    /**
     * åˆ¤æ–­æ˜¯å¦æœ‰å­èŠ‚ç‚¹
     */
    private boolean hasChild(List<SysMenu> list, SysMenu t)
    {
    private boolean hasChild(List<SysMenu> list, SysMenu t) {
        return getChildList(list, t).size() > 0;
    }
    /**
     * å†…链域名特殊字符替换
     *
     *
     * @return æ›¿æ¢åŽçš„内链域名
     */
    public String innerLinkReplaceEach(String path)
    {
        return StringUtils.replaceEach(path, new String[] { Constants.HTTP, Constants.HTTPS, Constants.WWW, "." },
                new String[] { "", "", "", "/" });
    public String innerLinkReplaceEach(String path) {
        return StringUtils.replaceEach(path, new String[]{Constants.HTTP, Constants.HTTPS, Constants.WWW, "."}, new String[]{"" , "" , "" , "/"});
    }
}
smartor/pom.xml
@@ -120,7 +120,17 @@
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-amqp</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.axis</groupId>
            <artifactId>axis</artifactId>
            <version>1.4</version>
        </dependency>
        <dependency>
            <groupId>org.apache.axis</groupId>
            <artifactId>axis-jaxrpc</artifactId>
            <version>1.4</version>
        </dependency>
    </dependencies>
</project>
</project>
smartor/src/main/java/com/smartor/common/SendService.java
@@ -1,11 +1,15 @@
package com.smartor.common;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject;
import com.aliyun.dysmsapi20170525.models.SendSmsResponseBody;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.ruoyi.common.utils.http.HttpUtils;
import com.smartor.domain.*;
import com.smartor.mapper.PatWildcardMapper;
import com.smartor.service.DingTalkService;
import com.smartor.service.ISmsParamService;
import com.smartor.service.WeChatService;
import com.smartor.service.impl.BaseSmsaccountServiceImpl;
import lombok.extern.slf4j.Slf4j;
@@ -36,6 +40,9 @@
    @Autowired
    private WeChatService weChatService;
    @Autowired
    ISmsParamService iSmsParamService;
    public Boolean sendMsg(SendMagParam sendMagParam) {
        // 1,多媒体 2,纸质  3,电话  4,短信  5.微信公众号 6.微信小程序 7.支付宝  8.智能小程序  9.钉钉
        switch (sendMagParam.getType()) {
@@ -46,23 +53,25 @@
            case ("3"):
            case ("4"):
//                BaseSmsRequest baseSmsRequest = new BaseSmsRequest();
//                baseSmsRequest.setPhoneNumber(sendMagParam.getPhone());
//                baseSmsRequest.setTemplateCode("SMS_461860582");
//                SendSmsResponseBody sendSmsResponseBody = baseSmsaccountService.sendMsg(baseSmsRequest);
                //下面的短信发送,仅测试
                BaseSmsRequest baseSmsRequest = new BaseSmsRequest();
                baseSmsRequest.setPhoneNumber("19157806063");
                baseSmsRequest.setTemplateCode("SMS_279456451");
                baseSmsRequest.setTemplateParam("{'code':'58965'}");
                SendSmsResponseBody sendSmsResponseBody = baseSmsaccountService.sendMsg(baseSmsRequest);
                log.error(sendSmsResponseBody.message);
                if (sendSmsResponseBody.getCode().equals("OK")) {
                //短信
                int i = iSmsParamService.sendSmsInfo(sendMagParam.getUrl(), sendMagParam.getPhone());
                if (i == 1) {
                    return true;
                }
                return false;
            case ("5"):
                //公众号
//                String params = "service=smarthos.yygh.ApiService.push&idcard=" + sendMagParam.getIdcard() + "&url=" + sendMagParam.getUrl() + "&keyword1=null&keyword2=null&keyword3=null&keyword4=null";
//                String result = HttpUtils.sendPost("/api", params);
//                JSONObject jsonObject = JSONObject.parseObject(result);
//                String code = (String) jsonObject.get("code");
//                if (!code.equals(0)) {
//                    log.error("微信公众号消息发送失败了:{}", sendMagParam);
//                    return false;
//                }
//                 return true;
                WeChatSendVo weChatSendVo = new WeChatSendVo();
                weChatSendVo.setUrl(sendMagParam.getUrl());
                weChatSendVo.setTemplateId(sendMagParam.getTmpCode());
smartor/src/main/java/com/smartor/domain/IvrLibaTemplate.java
@@ -342,6 +342,18 @@
    private String revisitAfter;
    /**
     * å‡ºé™¢å¤©æ•°ï¼ˆé•¿æœŸä»»åŠ¡ï¼Œå‡ºå®‰é™¢åŽï¼Œç¬¬å‡ å¤©å‘é€ä¿¡æ¯ï¼‰
     */
    @ApiModelProperty(value = "出院天数(长期任务,出安院后,第几天发送信息)")
    private Integer sendDay;
    /**
     * æ˜¯å¦æ˜¯é•¿æœŸæ¨¡æ¿ï¼š  0:不是    1:是
     */
    @ApiModelProperty(value = "是否是长期模板:  0:不是    1:是")
    private Integer longTemp;
    /**
     * pageNum
     */
    @ApiModelProperty(value = "pageNum")
smartor/src/main/java/com/smartor/domain/IvrLibaTemplateTargetoption.java
@@ -213,7 +213,7 @@
     * æ˜¯å¦æ˜¯ç”¨æˆ·é€‰æ‹©çš„选项
     */
    @ApiModelProperty(value = "是否是用户选择的选项")
    private Boolean isUserOperation = false;
    private Integer isUserOperation = 0;
    /**
     * ä¸‹ä¸€é¢˜
smartor/src/main/java/com/smartor/domain/IvrTaskTemplate.java
@@ -93,7 +93,7 @@
     * ç¬¬ä¸€æ¬¡é—®é¢˜ç¼–号
     */
    @Excel(name = "第一次问题编号")
    @ApiModelProperty(value = "第一次问题编号")
    @ApiModelProperty(value = "第一次问题编号(序号)")
    private Long firstQuestionNum;
    /**
@@ -337,7 +337,7 @@
    private Long mateNum;
    /**
     * éšè®¿å‰
     * éšè®¿å‰,开场白
     */
    @Excel(name = "随访前")
    @ApiModelProperty(value = "随访前")
@@ -377,4 +377,12 @@
    @ApiModelProperty(value = "指导语")
    private String instruction;
    /**
     * å‡ºé™¢å¤©æ•°ï¼ˆé•¿æœŸä»»åŠ¡ï¼Œå‡ºå®‰é™¢åŽï¼Œç¬¬å‡ å¤©å‘é€ä¿¡æ¯ï¼‰
     */
    @ApiModelProperty(value = "出院天数(长期任务,出安院后,第几天发送信息)")
    private Integer sendDay;
}
smartor/src/main/java/com/smartor/domain/IvrTaskTemplateScript.java
@@ -8,6 +8,7 @@
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
 * éšè®¿ä»»åŠ¡æ¨¡ç‰ˆé—®é¢˜è¯æœ¯åº“å¯¹è±¡ ivr_task_template_script
@@ -16,7 +17,7 @@
 * @date 2024-05-13
 */
@Data
@ApiModel(value = "IvrTaskTemplateScript", description = "随访任务模版问题话术库对象")
@ApiModel(value = "IvrTaskTemplateScript" , description = "随访任务模版问题话术库对象")
public class IvrTaskTemplateScript extends BaseEntity {
    private static final long serialVersionUID = 1L;
@@ -56,6 +57,13 @@
    @Excel(name = "问题点")
    @ApiModelProperty(value = "问题点")
    private String questionPoint;
    /**
     * è¯æœ¯å†…容
     */
    @Excel(name = "话术内容")
    @ApiModelProperty(value = "话术内容")
    private String scriptContent;
    /**
     * æ— åŒ¹é…è¯æœ¯
@@ -144,7 +152,7 @@
    /**
     * å€¼ç±»åž‹ï¼ˆ1 é€‰é¡¹  2 æ–‡æœ¬  3 æ•°å€¼ï¼‰
     */
    @Excel(name = "值类型", readConverterExp = "值类型(1 é€‰é¡¹  2 æ–‡æœ¬  3 æ•°å€¼ï¼‰")
    @Excel(name = "值类型" , readConverterExp = "值类型(1 é€‰é¡¹  2 æ–‡æœ¬  3 æ•°å€¼ï¼‰")
    @ApiModelProperty(value = "主键")
    private Long valueType;
@@ -165,7 +173,7 @@
     * ä¸Šä¼ æ—¶é—´
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = " ä¸Šä¼ æ—¶é—´ ", width = 30, dateFormat = "yyyy-MM-dd")
    @Excel(name = " ä¸Šä¼ æ—¶é—´ " , width = 30, dateFormat = "yyyy-MM-dd")
    @ApiModelProperty(value = "上传时间")
    private Date uploadTime;
@@ -214,21 +222,21 @@
    /**
     * å…¶å®ƒæ•°æ®ï¼ˆå­˜å‚¨å˜é‡ï¼‰
     */
    @Excel(name = "其它数据", readConverterExp = "存=储变量")
    @Excel(name = "其它数据" , readConverterExp = "存=储变量")
    @ApiModelProperty(value = "其它数据(存储变量)")
    private String otherdata;
    /**
     * æ˜¯å¦å¿…å¡«,1:必填    2:可以不填    ï¼ˆç»™äººå·¥ç”¨çš„,AI不用遵守)
     */
    @Excel(name = "是否必填,1:必填    2:可以不填    ", readConverterExp = "给=人工用的,AI不用遵守")
    @Excel(name = "是否必填,1:必填    2:可以不填    " , readConverterExp = "给=人工用的,AI不用遵守")
    @ApiModelProperty(value = "是否必填,1:必填    2:可以不填    ï¼ˆç»™äººå·¥ç”¨çš„,AI不用遵守)")
    private String isMust;
    /**
     * é—®é¢˜ç»“果(给“值类型”是文本或者数值用的)
     */
    @Excel(name = "问题结果", readConverterExp = "给=“值类型”是文本或者数值用的")
    @Excel(name = "问题结果" , readConverterExp = "给=“值类型”是文本或者数值用的")
    @ApiModelProperty(value = "问题结果(给“值类型”是文本或者数值用的)")
    private String questionResult;
@@ -238,6 +246,12 @@
    @ApiModelProperty(value = "是否存在操作:1 æ–°å¢ž 2修改 3删除")
    private Integer isoperation;
    /**
     * åºå·
     */
    @ApiModelProperty(value = "序号")
    private Integer sort;
    /**
@@ -254,4 +268,16 @@
    @ApiModelProperty(value = "选项分支的下一个话术编号")
    private String branchNextscriptno;
    /**
     * é€‰é¡¹åˆ†æ”¯çš„下一个话术编号
     */
    @Excel(name = "选项分支的下一个话术编号")
    @ApiModelProperty(value = "选项分支的下一个话术编号")
    private Long nextScriptno;
    /**
     * é—®é¢˜é€‰é¡¹
     */
    private List<IvrTaskTemplateTargetoption> ivrTaskTemplateTargetoptionList;
}
smartor/src/main/java/com/smartor/domain/IvrTaskTemplateScriptVO.java
@@ -282,6 +282,19 @@
    private Integer isoperation;
    /**
     * é€‰é¡¹åˆ†æ”¯æ ‡è¯†(0:无分支1:有分支)
     */
    @Excel(name = "选项分支标识(0:无分支1:有分支)")
    @ApiModelProperty(value = "选项分支标识(0:无分支1:有分支)")
    private String branchFlag;
    /**
     * åºå·
     */
    @ApiModelProperty(value = "序号")
    private Integer sort;
    /**
     * è¯æœ¯é€‰é¡¹
     */
    @ApiModelProperty(value = "话术选项")
smartor/src/main/java/com/smartor/domain/IvrTaskTemplateTargetoption.java
@@ -21,7 +21,7 @@
 * @date 2024-05-13
 */
@Data
@ApiModel(value = "IvrTaskTemplateTargetoption", description = "随访任务模板指标选项库对象")
@ApiModel(value = "IvrTaskTemplateTargetoption" , description = "随访任务模板指标选项库对象")
public class IvrTaskTemplateTargetoption extends BaseEntity {
    private static final long serialVersionUID = 1L;
@@ -167,7 +167,7 @@
     * ä¸Šä¼ æ—¶é—´
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = " ä¸Šä¼ æ—¶é—´ ", width = 30, dateFormat = "yyyy-MM-dd")
    @Excel(name = " ä¸Šä¼ æ—¶é—´ " , width = 30, dateFormat = "yyyy-MM-dd")
    @ApiModelProperty(value = "上传时间")
    private Date uploadTime;
@@ -221,7 +221,7 @@
    @ApiModelProperty(value = "正则关键字(不含)")
    @Excel(name = "正则关键字(不含)")
    private List<String> dynamiccruxs= new ArrayList<>();
    private List<String> dynamiccruxs = new ArrayList<>();
    /**
     * ä¸‹ä¸€é¢˜
@@ -240,7 +240,7 @@
     * æ˜¯å¦æ˜¯ç”¨æˆ·é€‰æ‹©çš„选项
     */
    @ApiModelProperty(value = "是否是用户选择的选项")
    private Boolean isUserOperation = false;
    private Integer isUserOperation;
    /**
     * é€‰é¡¹ç»­å·
smartor/src/main/java/com/smartor/domain/PatArchiveVO.java
@@ -19,15 +19,14 @@
 * @author smartor
 * @date 2023-03-04
 */
@ApiModel(value = "PatArchiveVO", description = "患者档案对象")
@ApiModel(value = "PatArchiveVO" , description = "患者档案对象")
@Data
public class PatArchiveVO extends BaseEntity {
    private static final long serialVersionUID = 1L;
    /**
     * è‡ªå¢žID
     */
    @ApiModelProperty(value = "自增ID")
    @ApiModelProperty("自增ID")
    private Long id;
    /**
@@ -45,26 +44,19 @@
    private Long sex;
    /**
     * è¯ä»¶ç±»åž‹
     */
    @ApiModelProperty("证件类型")
    @Excel(name = " è¯ä»¶ç±»åž‹ ")
    private String idcardtype;
    /**
     * è¯ä»¶å·ç 
     */
    @ApiModelProperty("证件号码")
    @Excel(name = " è¯ä»¶å·ç  ")
    private String idcardno;
    /**
     * ç”Ÿæ—¥
     */
    @ApiModelProperty("生日")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = " ç”Ÿæ—¥ ", width = 30, dateFormat = "yyyy-MM-dd")
    private Date birthdate;
    /**
     * å¹´é¾„
     */
    @ApiModelProperty("年龄")
    @Excel(name = " å¹´é¾„ ")
    private Long age;
    @ApiModelProperty("籍贯")
    @Excel(name = " ç±è´¯ ")
    private String nativePlace;
    /**
@@ -82,6 +74,37 @@
    @Excel(name = " å‡ºç”Ÿåœ° ")
    private String birthplace;
    /**
     * è¯ä»¶å·ç 
     */
    @ApiModelProperty("证件号码")
    @Excel(name = " è¯ä»¶å·ç  ")
    private String idcardno;
    /**
     * ç”Ÿæ—¥
     */
    @ApiModelProperty("生日")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = " ç”Ÿæ—¥ " , width = 30, dateFormat = "yyyy-MM-dd")
    private Date birthdate;
    /**
     * å…¥é™¢æ—¶é—´
     */
    @ApiModelProperty("入院时间")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = " ç”Ÿæ—¥ " , width = 30, dateFormat = "yyyy-MM-dd")
    private Date inhosptime;
    /**
     * å¹´é¾„
     */
    @ApiModelProperty("年龄")
    @Excel(name = " å¹´é¾„ ")
    private Long age;
    /**
     * æ¥æº
     */
@@ -89,9 +112,6 @@
    @Excel(name = " æ¥æº ")
    private Long sourcefrom;
    /**
     * å»ºæ¡£æ—¶é—´
     */
    /**
     * å»ºæ¡£æ—¶é—´
     */
@@ -104,6 +124,7 @@
     * å»ºæ¡£äºº
     */
    @ApiModelProperty("建档人")
    @Excel(name = " å»ºæ¡£äºº ")
    private String archiveby;
    /**
@@ -113,17 +134,20 @@
    @Excel(name = " æ‰‹æœºå·ç  ")
    private String telcode;
    /**
     * äº²å±žå·ç 
     */
    @ApiModelProperty("亲属号码")
    @Excel(name = " äº²å±žå·ç  ")
    private String relativetelcode;
    /**
     * è¯ä»¶ç±»åž‹
     * æ°‘族
     */
    @ApiModelProperty("证件类型")
    private String idcardtype;
    @ApiModelProperty("民族")
    @Excel(name = " æ°‘族 ")
    private String nation;
    /**
     * æœºæž„ID
@@ -136,6 +160,7 @@
     * å¾®ä¿¡openid
     */
    @ApiModelProperty("微信openid")
    @Excel(name = " å¾®ä¿¡openid ")
    private String openid;
    /**
@@ -160,10 +185,54 @@
     * æ ‡ç­¾
     */
    @ApiModelProperty("标签")
    @Excel(name = " æ ‡ç­¾ " , cellType = Excel.ColumnType.STRING)
    private String tag;
    /**
     * æ ‡ç­¾
     */
    @ApiModelProperty("标签id")
    @Excel(name = " æ ‡ç­¾id " , cellType = Excel.ColumnType.STRING)
    private Long tagid;
    @ApiModelProperty("标签集合")
    List<PatArchivetag> tagList = new ArrayList<>();
    private List<PatArchivetag> tagList;
    /**
     * æ ‡ç­¾
     */
    @ApiModelProperty("患者类型")
    @Excel(name = " æ‚£è€…类型 " , cellType = Excel.ColumnType.STRING)
    private String pattype;
    /**
     * é’‰é’‰å·
     */
    @ApiModelProperty("钉钉号")
    @Excel(name = " é’‰é’‰å· ")
    private String dduserid;
    /**
     * é’‰é’‰å·
     */
    @ApiModelProperty("科室")
    @Excel(name = " ç§‘室 ")
    private String dept;
    /**
     * é’‰é’‰å·
     */
    @ApiModelProperty("科室")
    @Excel(name = " ç§‘室 ")
    private String bedNo;
    /**
     * ä¼šå‘˜å±žæ€§:0非会员,1一般会员、2重要会员
     */
    @ApiModelProperty("会员属性:0非会员,1一般会员、2重要会员")
    @Excel(name = " ä¼šå‘˜å±žæ€§:0非会员,1一般会员、2重要会员 ")
    private String viptype;
    @ApiModelProperty(value = "是否存在操作:1 æ–°å¢ž 2修改 3删除")
    private Integer isoperation;
smartor/src/main/java/com/smartor/domain/PatMedInhosp.java
@@ -256,4 +256,16 @@
    @ApiModelProperty(value = "患者编号")
    private String patno;
    /**
     * ä½é™¢æ ‡è¯†ï¼š 0:在院  1:出院    2:转科
     */
    @ApiModelProperty(value = "住院标识: 0:在院  1:出院    2:转科")
    private String inhospstate;
    /**
     * é•¿æœŸä»»åŠ¡ï¼Œæ˜¯å¦å¤„ç†ï¼š0未处理   1处理
     */
    @ApiModelProperty(value = "长期任务,是否处理:0未处理   1处理")
    private String checkFlag;
}
smartor/src/main/java/com/smartor/domain/PhoneCallBackYQVO.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,44 @@
package com.smartor.domain;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
 * ç”µè¯ASR回调(雨绮)
 *
 * @author ls
 * @date 2024-08-8
 */
@Data
public class PhoneCallBackYQVO {
    /**
     * å¯ä»¥å¯¹å½“前通道的音量进行适当调整,取值范围【-4,4】
     */
    @ApiModelProperty(value = "可以对当前通道的音量进行适当调整,取值范围【-4,4】")
    private Integer volume = 0;
    /**
     * å¯ä»¥è°ƒæ•´å½“前通话的静默回调间隔时间,单位为毫秒,默认为3000
     */
    @ApiModelProperty(value = "可以调整当前通话的静默回调间隔时间,单位为毫秒,默认为3000")
    private Integer silent_interval = 5000;
    /**
     * è¿”回当前的操作类型,具体类型
     * ç±»åž‹å ï¼štext    æ“ä½œ ï¼šéŸ³ä¹æ’­æ”¾    æè¿°ï¼šå½“前将响应音乐内容的播放,支持文本、本地音乐路径或http音乐路径;音乐内容文件格式支持wav和mp3
     * ç±»åž‹å ï¼šhangup    æ“ä½œ ï¼šæŒ‚断操作   æè¿°ï¼šæ­¤æ—¶å¦‚æžœvalue存在值时,表示挂断结束语的内容
     * ç±»åž‹å ï¼šagent    æ“ä½œ ï¼šè½¬æŽ¥é€šè¯    æè¿°ï¼šå°†å½“前通话转接到人工座席,value值为座席号或外线号码,如果为外线号码时,则需要落地线路支持并发呼叫,否则将呼叫失败。该操作支持在转接时播放音乐,字段为music,如果存在该字段内容时,则表示为转接时向对端播放的音乐内容
     * ç±»åž‹å ï¼šanswer    æ“ä½œ ï¼šåº”答通话    æè¿°ï¼šå¯¹é€šè¯æ‰§è¡Œåº”答操作,些操作适用于呼入时首次请求的响应
     * ç±»åž‹å ï¼šbreakoff    æ“ä½œ ï¼šä¸­æ–­æ’­æ”¾    æè¿°ï¼šå¯¹å½“前正在播放的音乐资源,执行停止操作
     */
    @ApiModelProperty(value = "返回当前的操作类型,具体类型请参考后读说明")
    private String type;
    /**
     * ä¸åŒæ“ä½œç±»åž‹æ‰€å¯¹åº”的参数值
     */
    @ApiModelProperty(value = "不同操作类型所对应的参数值")
    private String value;
}
smartor/src/main/java/com/smartor/domain/PhoneCallReqYQVO.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,131 @@
package com.smartor.domain;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
 * ç”µè¯ASR回调请求(雨绮)
 *
 * @author ls
 * @date 2024-08-8
 */
@Data
public class PhoneCallReqYQVO {
    @ApiModelProperty(value = "任务编号(这里存在的就是subtaskID)")
    private String taskid;
    // UUID
    @ApiModelProperty(value = "uuid")
    private String uuid;
    /**
     * å½“前呼叫的目标号码
     */
    @ApiModelProperty(value = "当前呼叫的目标号码")
    private String phone;
    /**
     * å½“前回调的请求类型,包括:AsrCallback: ASR文本回调    DtmfCallback:收到按键回调       SilentCallback:静默回调      PlayEvent:音乐播放开始、结束事件回调
     */
    @ApiModelProperty(value = "当前回调的请求类型,包括:AsrCallback: ASR文本回调    DtmfCallback:收到按键回调       SilentCallback:静默回调      PlayEvent:音乐播放开始、结束事件回调")
    private String operate;
    /**
     * å½“前呼叫时使用的外显号码
     */
    @ApiModelProperty(value = "当前呼叫时使用的外显号码")
    private String displayno;
    /**
     * æ˜¯å¦å‘¼å…¥é€šè¯
     */
    @ApiModelProperty(value = "是否呼入通话")
    private Boolean inbound = false;
    /**
     * æ˜¯å¦å‘¼å…¥é€šè¯
     */
    @ApiModelProperty(value = "是否为呼入请求操作")
    private Boolean incoming = false;
    /**
     * åˆ†é…æ—¶é—´,呼入时为0
     */
    @ApiModelProperty(value = "分配时间,呼入时为0")
    private Long assigntime;
    /**
     * å¼€å§‹æ—¶é—´ï¼Œå¦‚果呼入的则为呼入开始时间
     */
    @ApiModelProperty(value = "开始时间,如果呼入的则为呼入开始时间")
    private Long starttime;
    /**
     * åº”答时间
     */
    @ApiModelProperty(value = "应答时间")
    private Long answertime;
    /**
     * æ ‡è¯†å½“前是否为静默回调
     */
    @ApiModelProperty(value = "标识当前是否为静默回调")
    private Boolean silent = false;
    /**
     * æ”¶åˆ°çš„æŒ‰é”®å†…容
     */
    @ApiModelProperty(value = "收到的按键内容")
    private String dtmf_key;
    /**
     * éŸ³ä¹æ’­æ”¾æˆ–停止时相关音乐名称
     */
    @ApiModelProperty(value = "音乐播放或停止时相关音乐名称")
    private String musicpath;
    /**
     * å½“前句子的索引号
     */
    @ApiModelProperty(value = "当前句子的索引号")
    private Integer sent_index;
    /**
     * å½“前是否为说话开始
     */
    @ApiModelProperty(value = "当前是否为说话开始")
    private Boolean sent_begin;
    /**
     * å½“前收到的ASR识别文本
     */
    @ApiModelProperty(value = "当前收到的ASR识别文本")
    private String asrtext;
    /**
     * å½“前asr文本通话开始时间点,毫秒数
     */
    @ApiModelProperty(value = "当前asr文本通话开始时间点,毫秒数")
    private Long begin_time;
    /**
     * å½“前asr文本所处结束时间点,毫秒数,当前文本不是句子结束时,则为-1
     */
    @ApiModelProperty(value = "当前asr文本所处结束时间点,毫秒数,当前文本不是句子结束时,则为-1")
    private Long end_time;
    /**
     * æ ‡è¯†å½“前是否为句子结束
     */
    @ApiModelProperty(value = "标识当前是否为句子结束")
    private Boolean send_end = false;
    /**
     * å½“前句子的录音文件路径,句子未结束时为空
     */
    @ApiModelProperty(value = "当前句子的录音文件路径,句子未结束时为空")
    private String recordpath;
}
smartor/src/main/java/com/smartor/domain/PhoneRecordAccept.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,84 @@
package com.smartor.domain;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
 * ç”µè¯ASR回调请求(雨绮)
 *
 * @author ls
 * @date 2024-08-8
 */
@Data
public class PhoneRecordAccept {
    @ApiModelProperty(value = "任务编号(这里存在的就是subtaskID)")
    private String taskid;
    // UUID
    @ApiModelProperty(value = "uuid")
    private String uuid;
    /**
     * å½“前呼叫的目标号码
     */
    @ApiModelProperty(value = "当前呼叫的目标号码")
    private String phone;
    /**
     * å½“前呼叫时使用的外显号码
     */
    @ApiModelProperty(value = "当前呼叫时使用的外显号码")
    private String displayno;
    /**
     * æ—©æœŸçš„ASR识别文本
     */
    private String early_asrtext;
    /**
     * åˆ†é…æ—¶é—´,13位unix时间戳
     */
    @ApiModelProperty(value = "分配时间,13位unix时间戳")
    private Long assign_time;
    /**
     * å¼€å§‹æ—¶é—´ï¼Œå¦‚果呼入的则为呼入开始时间
     */
    @ApiModelProperty(value = "开始时间,如果呼入的则为呼入开始时间")
    private Long start_time;
    /**
     * åº”答时间
     */
    @ApiModelProperty(value = "应答时间")
    private Long answer_time;
    /**
     * æŒ‚æ–­æ—¶é—´
     */
    @ApiModelProperty(value = "挂断时间")
    private Long hangup_time;
    /**
     * ç»“束时间
     */
    @ApiModelProperty(value = "结束时间")
    private Long end_time;
    /**
     * æŒ‚机时的sip代码值
     */
    @ApiModelProperty(value = "挂机时的sip代码值")
    private String hangup_sipcode;
    /**
     * æŒ‚机原因字符串
     */
    @ApiModelProperty(value = "挂机原因字符串")
    private String hangup_cause;
}
smartor/src/main/java/com/smartor/domain/PullTaskVO.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,71 @@
package com.smartor.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
 * é›¨ç»®ç”µè¯ä»»åŠ¡æ‹‰å– PullTaskVO
 *
 * @author ls
 * @date 2024-08-07
 */
@Data
@ApiModel(value = "PullTaskVO" , description = "雨绮电话任务拉取")
public class PullTaskVO {
    /**
     * ä»»åŠ¡ID
     */
    @ApiModelProperty(value = "任务ID")
    private String taskid;
    /**
     * ä»»åŠ¡id
     */
    @Excel(name = "本任务需要播放的开场白")
    @ApiModelProperty(value = "本任务需要播放的开场白")
    private String prologue;
    /**
     * å‘¼å«æ—¶é—´æ®µ,以mm-hh:mm格式设置,按分 å·åˆ†éš”多个时间段,支持按星期分段,1=8:00-12:30;
     */
    @Excel(name = "呼叫时间段,以mm-hh:mm格式设置,按分 å·åˆ†éš”多个时间段,支持按星期分段,1=8:00-12:30;")
    @ApiModelProperty(value = "呼叫时间段,以mm-hh:mm格式设置,按分 å·åˆ†éš”多个时间段,支持按星期分段,1=8:00-12:30;")
    private String sections;
    /**
     * æœ¬æ¬¡ä»»åŠ¡æ‰€ä½¿ç”¨çš„é»˜è®¤å¤–æ˜¾å·ç ï¼Œç”¨äºŽåŒ¹é…ç½‘å…³
     */
    @Excel(name = "本次任务所使用的默认外显号码,用于匹配网关")
    @ApiModelProperty(value = "本次任务所使用的默认外显号码,用于匹配网关")
    private String displayNo;
    /**
     * é˜¿é‡Œäº‘帐号appkey或铝箔,如果存在该值,则从本地配置的阿里云profile中匹配选择,如果未设置或匹配不到,则使用默认第1个帐号
     */
    @Excel(name = "阿里云帐号appkey或铝箔,如果存在该值,则从本地配置的阿里云profile中匹配选择,如果未设置或匹配不到,则使用默认第1个帐号")
    @ApiModelProperty(value = "阿里云帐号appkey或铝箔,如果存在该值,则从本地配置的阿里云profile中匹配选择,如果未设置或匹配不到,则使用默认第1个帐号")
    private String appkey;
    /**
     * æœ¬æ¬¡ä»»åŠ¡éœ€è¦å¤–å‘¼çš„å·ç æ¸…å•ï¼Œè€ƒè™‘ç½‘å…³çš„å¹¶å‘èƒ½åŠ›ï¼Œå»ºè®®å·ç æ•°é‡ä¸ºå¹¶å‘æ•°çš„3~5倍,如果本字段类型为字符串,则以分号作为多个号码之前的分隔符
     */
    @Excel(name = "本次任务需要外呼的号码清单,考虑网关的并发能力,建议号码数量为并发数的3~5倍,如果本字段类型为字符串,则以分号作为多个号码之前的分隔符")
    @ApiModelProperty(value = "本次任务需要外呼的号码清单,考虑网关的并发能力,建议号码数量为并发数的3~5倍,如果本字段类型为字符串,则以分号作为多个号码之前的分隔符")
    private String phones;
    /**
     * æŒ‡å®šasr的url路径(这个路径需要我们这边提供,入参可以参考文档)
     */
    @ApiModelProperty(value = " æŒ‡å®šasr的url路径(这个路径需要我们这边提供,入参可以参考文档)")
    private String asrcallback = "http://35z1t16164.qicp.vip/smartor/serviceSubtask/phoneCallBackYQ";
}
smartor/src/main/java/com/smartor/domain/SendMagParam.java
@@ -19,4 +19,6 @@
    private String url;
    private String openid;
    private String idcard;
}
smartor/src/main/java/com/smartor/domain/ServiceSubTaskAnswerReq.java
@@ -22,7 +22,9 @@
    @ApiModelProperty(value = "患者ID")
    private String param2;
    @ApiModelProperty(value = "试卷类型:1 éšè®¿   2 é—®å·")
    private Integer type;
//    @ApiModelProperty(value = "试卷类型:1 éšè®¿   2 é—®å·")
//    private Integer type;
    @ApiModelProperty(value = "问题结果详情")
    private List<ServiceSubtaskDetail> serviceSubtaskDetailList;
}
smartor/src/main/java/com/smartor/domain/ServiceSubtask.java
@@ -17,7 +17,7 @@
 */
@ApiModel(value = "ServiceSubtask", description = "单一随访任务")
@Data
public class ServiceSubtask extends BaseEntity {
public class ServiceSubtask extends PatArchive {
    private static final long serialVersionUID = 1L;
    /**
@@ -409,4 +409,11 @@
    private String libtemplatename;
    /**
     * é•¿æœŸä»»åŠ¡ï¼Œç»™æ‚£è€…å‘é€çš„æ—¶é—´
     */
    @Excel(name = " é•¿æœŸä»»åŠ¡ï¼Œç»™æ‚£è€…å‘é€çš„æ—¶é—´")
    @ApiModelProperty(value = "长期任务,给患者发送的时间")
    private Date longSendTime;
}
smartor/src/main/java/com/smartor/domain/ServiceSubtaskDetail.java
@@ -28,6 +28,9 @@
    @ApiModelProperty(value = "子任务ID")
    private Long subId;
    @ApiModelProperty(value = "子任务ID")
    private Long taskid;
    @ApiModelProperty(value = "拨号uuid")
    private String uuid;
@@ -147,4 +150,17 @@
    private String valueType;
    @ApiModelProperty(value = "问题类型")
    private Long scriptid;
    @ApiModelProperty(value = "选项答案的附加信息")
    private String answerps;
    @ApiModelProperty(value = "对答案的评语")
    private String comment;
    @ApiModelProperty(value = "患者ID")
    private Long patid;
}
smartor/src/main/java/com/smartor/domain/ServiceSubtaskDetailVO.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,165 @@
package com.smartor.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
 * è¯­éŸ³ä»»åŠ¡å‘¼å«æ˜Žç»†å¯¹è±¡ ivr_taskcalldetail
 *
 * @author smartor
 * @date 2023-03-24
 */
@Data
@ApiModel(value = "ServiceSubtaskDetail", description = "问题回答明细")
public class ServiceSubtaskDetailVO extends BaseEntity {
    private static final long serialVersionUID = 1L;
    @ApiModelProperty(value = "主键")
    private String id;
    @ApiModelProperty(value = "子任务ID")
    private Long subId;
    @ApiModelProperty(value = "子任务ID")
    private Long taskid;
    @ApiModelProperty(value = "拨号uuid")
    private String uuid;
    @ApiModelProperty(value = "电话号码")
    private String phone;
    @ApiModelProperty(value = "操作人 ")
    private String operate;
    @ApiModelProperty(value = "显示号码")
    private String displayno;
    @ApiModelProperty(value = "")
    private Long inbound;
    @ApiModelProperty(value = "")
    private Long incoming;
    @ApiModelProperty(value = "")
    private Long assigntime;
    @ApiModelProperty(value = "开始时间")
    private Long starttime;
    @ApiModelProperty(value = "回答时间")
    private Long answertime;
    @ApiModelProperty(value = "")
    private Long silent;
    @ApiModelProperty(value = "")
    private String dtmfKey;
    @ApiModelProperty(value = "音乐路径")
    private String musicpath;
    @ApiModelProperty(value = "发送索引")
    private Long sentIndex;
    @ApiModelProperty(value = "发送开始状态")
    private Long sentBegin;
    @ApiModelProperty(value = "回答结果")
    private String asrtext;
    @ApiModelProperty(value = "开始时间")
    private Long beginTime;
    @ApiModelProperty(value = "结束时间")
    private Long endTime;
    @ApiModelProperty(value = "发送结束状态")
    private Long sentEnd;
    @ApiModelProperty(value = "提交路径")
    private String recordpath;
    @ApiModelProperty(value = "提交URL")
    private String recordurl;
    @ApiModelProperty(value = "模板ID")
    private String templateid;
    @ApiModelProperty(value = "模板问题编号")
    private Long templatequestionnum;
    @ApiModelProperty(value = "交换机ID")
    private Long switchid;
    @ApiModelProperty(value = "问题文本")
    private String questiontext;
    @ApiModelProperty(value = "问题语音")
    private String questionvoice;
    @ApiModelProperty(value = "类别")
    private String categoryname;
    @ApiModelProperty(value = "指标选项")
    private String targetoptions;
    @ApiModelProperty(value = "指标值(正则匹配的选项值)")
    private String targetvalue;
    @ApiModelProperty(value = "通过正则解析的值")
    private String matchedtext;
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "  ", width = 30, dateFormat = "yyyy-MM-dd")
    @ApiModelProperty(value = "添加时间")
    private Date addtime;
    @ApiModelProperty(value = "上传标记")
    private Long isupload;
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = " ä¸Šä¼ æ—¶é—´ ", width = 30, dateFormat = "yyyy-MM-dd")
    @ApiModelProperty(value = "上传时间")
    private Date uploadTime;
    @ApiModelProperty(value = "机构ID")
    private String orgid;
    @ApiModelProperty(value = "删除标记")
    private String delFlag;
    @ApiModelProperty(value = "问题类型")
    private String valueType;
    @ApiModelProperty(value = "问题类型")
    private Long scriptid;
    @ApiModelProperty(value = "选项答案的附加信息")
    private String answerps;
    @ApiModelProperty(value = "对答案的评语")
    private String comment;
    @ApiModelProperty(value = "患者ID")
    private Long patid;
    private List<SvyTaskTemplateTargetoption> svyTaskTemplateTargetoptions;
}
smartor/src/main/java/com/smartor/domain/ServiceTask.java
@@ -15,7 +15,7 @@
 * @author smartor
 * @date 2023-03-24
 */
@ApiModel(value = "ServiceTask", description = "任务对象")
@ApiModel(value = "ServiceTask" , description = "任务对象")
@Data
public class ServiceTask extends BaseEntity {
    private static final long serialVersionUID = 1L;
@@ -119,18 +119,18 @@
     *
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "  ", width = 30, dateFormat = "yyyy-MM-dd")
    @Excel(name = "  " , width = 30, dateFormat = "yyyy-MM-dd")
    @ApiModelProperty(value = "添加时间")
    private Date addtime;
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "  ", width = 30, dateFormat = "yyyy-MM-dd")
    @Excel(name = "  " , width = 30, dateFormat = "yyyy-MM-dd")
    @ApiModelProperty(value = "开始时间")
    private Date beginTime;
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "  ", width = 30, dateFormat = "yyyy-MM-dd")
    @Excel(name = "  " , width = 30, dateFormat = "yyyy-MM-dd")
    @ApiModelProperty(value = "结束时间")
    private Date endTime;
@@ -152,16 +152,23 @@
     * å®¡æ ¸äººæ—¶é—´
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "  ", width = 30, dateFormat = "yyyy-MM-dd")
    @Excel(name = "  " , width = 30, dateFormat = "yyyy-MM-dd")
    @ApiModelProperty(value = "审核人时间")
    private Date checktime;
    /**
     * "1,随访;2,问卷;3.宣教;
     * ä»»åŠ¡ç±»åž‹:1、监测评估;2、出院随访;3、门诊随访
     */
    @Excel(name = "1,随访;2,问卷;3.宣教; ")
    @ApiModelProperty(value = "1,随访;2,问卷;3.宣教;")
    @Excel(name = "任务类型(通知、问卷、机器人语音)")
    @ApiModelProperty(value = "任务类型(通知、问卷、机器人语音)")
    private String type;
    /**
     * æœåŠ¡ç±»åž‹(1、监测评估;2、出院随访;3、门诊随访;4、宣教关怀;5、复诊通知;6、满意度调查;7、患者报告; 8、其他通知)
     */
    @Excel(name = "服务类型(1、监测评估;2、出院随访;3、门诊随访;4、宣教关怀;5、复诊通知;6、满意度调查;7、患者报告; 8、其他通知)")
    @ApiModelProperty(value = "服务类型(1、监测评估;2、出院随访;3、门诊随访;4、宣教关怀;5、复诊通知;6、满意度调查;7、患者报告; 8、其他通知)")
    private String serviceType;
    /**
     * ç±»åž‹åç§°
@@ -169,7 +176,6 @@
    @Excel(name = "类型名称")
    @ApiModelProperty(value = "类型名称")
    private String typename;
    /**
     * ç±»åž‹åç§°
@@ -223,7 +229,7 @@
     * ä¸Šä¼ æ—¶é—´
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = " ä¸Šä¼ æ—¶é—´ ", width = 30, dateFormat = "yyyy-MM-dd")
    @Excel(name = " ä¸Šä¼ æ—¶é—´ " , width = 30, dateFormat = "yyyy-MM-dd")
    @ApiModelProperty(value = "上传时间")
    private Date uploadTime;
@@ -256,10 +262,10 @@
    private String preachform;
    /**
     * å‘送类型: 1指定时间发送 2即刻发送
     * å‘送类型: 1指定时间段发送 2即刻发送 3时间点
     */
    @Excel(name = " å‘送类型: 1指定时间发送 2即刻发送 ")
    @ApiModelProperty(value = "发送类型: 1指定时间发送 2即刻发送 3时间点")
    @Excel(name = " å‘送类型: 1指定时间段发送 2即刻发送 3时间点")
    @ApiModelProperty(value = "发送类型: 1指定时间段发送 2即刻发送 3时间点")
    private Long sendType;
    /**
@@ -289,6 +295,12 @@
    private Integer pageSize;
    /**
     * pageSize
     */
    @ApiModelProperty("是否是长期任务 0:不是    1:是")
    private Integer longTask;
    /**
     * å°±è¯Šç±»åž‹ï¼ˆ1门诊  2出院)
     */
    @Excel(name = "  å°±è¯Šç±»åž‹ï¼ˆ1门诊  2出院)")
smartor/src/main/java/com/smartor/domain/ServiceTaskVO.java
@@ -144,9 +144,9 @@
    private Date checktime;
    /**
     * 1,出院随访;2,体检通知;3,满意度调查;4,宣教;
     * ä»»åŠ¡ç±»åž‹(通知、问卷、机器人语音)
     */
    @Excel(name = " 1,出院随访;2,体检通知;3,满意度调查;4,宣教; ")
    @Excel(name = " ä»»åŠ¡ç±»åž‹(通知、问卷、机器人语音) ")
    private String type;
    /**
@@ -282,5 +282,12 @@
    @ApiModelProperty(value = "展示日期")
    private String showDate;
    /**
     * æœåŠ¡ç±»åž‹(1、监测评估;2、出院随访;3、门诊随访;4、宣教关怀;5、复诊通知;6、满意度调查;7、患者报告; 8、其他通知)
     */
    @Excel(name = "服务类型(1、监测评估;2、出院随访;3、门诊随访;4、宣教关怀;5、复诊通知;6、满意度调查;7、患者报告; 8、其他通知)")
    @ApiModelProperty(value = "服务类型(1、监测评估;2、出院随访;3、门诊随访;4、宣教关怀;5、复诊通知;6、满意度调查;7、患者报告; 8、其他通知)")
    private String serviceType;
}
smartor/src/main/java/com/smartor/domain/SvyTaskTemplate.java
@@ -88,7 +88,7 @@
     */
    @Excel(name = " ç‰ˆæœ¬ ")
    @ApiModelProperty(value = "版本")
    private BigDecimal version;
    private String version;
    /**
     * ä¸­å¿ƒåº“代码
@@ -231,7 +231,6 @@
    @ApiModelProperty(value = "结束语")
    private String conclusion;
}
smartor/src/main/java/com/smartor/domain/SvyTaskTemplateScriptVO.java
@@ -140,9 +140,9 @@
    private String targetOptions;
    /**
     * åŸºç¡€æŒ‡æ ‡ç±»åž‹ï¼ˆ1 é€‰é¡¹  2 æ–‡æœ¬  3 æ•°å€¼ï¼‰
     * é¢˜ç›®ç±»åž‹;枚举 1.单选 2多选 3填空 4其它
     */
    @ApiModelProperty(value = "基础指标类型 1=选项,2=文本,3=数值")
    @ApiModelProperty(value = "题目类型;枚举 1.单选 2多选 3填空 4其它")
    private String scriptType;
    /**
smartor/src/main/java/com/smartor/domain/SvyTaskTemplateVO.java
@@ -90,7 +90,7 @@
     */
    @Excel(name = " ç‰ˆæœ¬ ")
    @ApiModelProperty(value = "版本")
    private BigDecimal version;
    private String version;
    /**
     * ä¸­å¿ƒåº“代码
smartor/src/main/java/com/smartor/domain/VisitPlan.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,82 @@
package com.smartor.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
 * éšè®¿è®¡åˆ’对象 visit_plan
 *
 * @author lihu
 * @date 2024-08-26
 */
@Data
@ApiModel("随访计划")
public class VisitPlan extends BaseEntity
        {
private static final long serialVersionUID = 1L;
    /** ä¸»é”® */
    @ApiModelProperty("主键")
        //数据库自增改成@TableId(type = IdType.AUTO)
    private Long id;
    /** å‡ºé™¢æ—¥æœŸ */
    @ApiModelProperty("出院日期")
            @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
            @Excel(name = "出院日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date outHospDate;
    /** è®¡åˆ’随访日期 */
    @ApiModelProperty("计划随访日期")
            @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
            @Excel(name = "计划随访日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date planVisitDate;
    /** è¯­éŸ³åŸºç¡€æ¨¡æ¿ID(商议的固定模板放这个表里) */
    @ApiModelProperty("语音基础模板ID(商议的固定模板放这个表里)")
            @Excel(name = "语音基础模板ID", readConverterExp = "商=议的固定模板放这个表里")
    private Long ivrLibaTemplateId;
    /** æ‚£è€…ID */
    @ApiModelProperty("患者ID")
            @Excel(name = "患者ID")
    private Long patid;
    /** æ‚£è€…手机号 */
    @ApiModelProperty("患者手机号")
            @Excel(name = "患者手机号")
    private String phone;
    /** service_task主键 */
    @ApiModelProperty("service_task主键")
            @Excel(name = "service_task主键")
    private Long taskId;
    /** å­ä»»åŠ¡ID */
    @ApiModelProperty("子任务ID")
            @Excel(name = "子任务ID")
    private Long subTaskId;
    /** ä»»åŠ¡æ¨¡æ¿ID */
    @ApiModelProperty("任务模板ID")
            @Excel(name = "任务模板ID")
    private Long taskTemplateId;
    /** 0 æœªæ‰§è¡Œ    1已执行 */
    @ApiModelProperty("0 æœªæ‰§è¡Œ    1已执行")
            @Excel(name = "0 æœªæ‰§è¡Œ    1已执行")
    private Long isExecute;
    /** å…¬ä¼—号ID */
    @ApiModelProperty("公众号ID")
            @Excel(name = "公众号ID")
    private String openid;
        }
smartor/src/main/java/com/smartor/domain/robot/RobotScritpTemplateVO.java
@@ -1,16 +1,9 @@
package com.smartor.domain.robot;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import com.smartor.domain.PatTaskRelevance;
import com.smartor.domain.TaskSendTimeVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
smartor/src/main/java/com/smartor/mapper/SmsParamMapper.java
@@ -1,19 +1,21 @@
package com.smartor.mapper;
import java.util.List;
import com.smartor.domain.SmsParam;
import org.apache.ibatis.annotations.Mapper;
/**
 * çŸ­ä¿¡å‚æ•°Mapper接口
 *
 *
 * @author smartor
 * @date 2023-03-06
 */
public interface SmsParamMapper
{
@Mapper
public interface SmsParamMapper {
    /**
     * æŸ¥è¯¢çŸ­ä¿¡å‚æ•°
     *
     *
     * @param paramid çŸ­ä¿¡å‚数主键
     * @return çŸ­ä¿¡å‚æ•°
     */
@@ -21,7 +23,7 @@
    /**
     * æŸ¥è¯¢çŸ­ä¿¡å‚数列表
     *
     *
     * @param smsParam çŸ­ä¿¡å‚æ•°
     * @return çŸ­ä¿¡å‚数集合
     */
@@ -29,7 +31,7 @@
    /**
     * æ–°å¢žçŸ­ä¿¡å‚æ•°
     *
     *
     * @param smsParam çŸ­ä¿¡å‚æ•°
     * @return ç»“æžœ
     */
@@ -37,7 +39,7 @@
    /**
     * ä¿®æ”¹çŸ­ä¿¡å‚æ•°
     *
     *
     * @param smsParam çŸ­ä¿¡å‚æ•°
     * @return ç»“æžœ
     */
@@ -45,7 +47,7 @@
    /**
     * åˆ é™¤çŸ­ä¿¡å‚æ•°
     *
     *
     * @param paramid çŸ­ä¿¡å‚数主键
     * @return ç»“æžœ
     */
@@ -53,7 +55,7 @@
    /**
     * æ‰¹é‡åˆ é™¤çŸ­ä¿¡å‚æ•°
     *
     *
     * @param paramids éœ€è¦åˆ é™¤çš„æ•°æ®ä¸»é”®é›†åˆ
     * @return ç»“æžœ
     */
smartor/src/main/java/com/smartor/service/IIvrTaskTemplateScriptService.java
@@ -1,6 +1,7 @@
package com.smartor.service;
import com.smartor.domain.IvrTaskTemplateScript;
import com.smartor.domain.IvrTaskTemplateScriptVO;
import java.util.List;
@@ -20,6 +21,8 @@
     */
    public IvrTaskTemplateScript selectIvrTaskTemplateScriptByID(Long ID);
    public IvrTaskTemplateScriptVO getTaskTempScriptInfoByid(Long ID);
    /**
     * æŸ¥è¯¢éšè®¿ä»»åŠ¡æ¨¡ç‰ˆé—®é¢˜è¯æœ¯åº“åˆ—è¡¨
     *
smartor/src/main/java/com/smartor/service/IPatArchiveService.java
@@ -93,5 +93,5 @@
    public List<Object> getUserTreatmentInfo(String pid, String type);
    public List<PatTaskRelevance> getPatientInfo(PatArchiveReq patArchiveReq);
    public List<ServiceSubtask> getPatientInfo(PatArchiveReq patArchiveReq);
}
smartor/src/main/java/com/smartor/service/IPatMedInhospService.java
@@ -1,19 +1,19 @@
package com.smartor.service;
import java.util.List;
import com.smartor.domain.PatMedInhosp;
/**
 * æ‚£è€…住院记录Service接口
 *
 *
 * @author smartor
 * @date 2023-03-04
 */
public interface IPatMedInhospService
{
public interface IPatMedInhospService {
    /**
     * æŸ¥è¯¢æ‚£è€…住院记录
     *
     *
     * @param inhospid æ‚£è€…住院记录主键
     * @return æ‚£è€…住院记录
     */
@@ -21,7 +21,7 @@
    /**
     * æŸ¥è¯¢æ‚£è€…住院记录列表
     *
     *
     * @param patMedInhosp æ‚£è€…住院记录
     * @return æ‚£è€…住院记录集合
     */
@@ -29,7 +29,7 @@
    /**
     * æ–°å¢žæ‚£è€…住院记录
     *
     *
     * @param patMedInhosp æ‚£è€…住院记录
     * @return ç»“æžœ
     */
@@ -37,7 +37,7 @@
    /**
     * ä¿®æ”¹æ‚£è€…住院记录
     *
     *
     * @param patMedInhosp æ‚£è€…住院记录
     * @return ç»“æžœ
     */
@@ -45,7 +45,7 @@
    /**
     * æ‰¹é‡åˆ é™¤æ‚£è€…住院记录
     *
     *
     * @param inhospids éœ€è¦åˆ é™¤çš„æ‚£è€…住院记录主键集合
     * @return ç»“æžœ
     */
@@ -53,9 +53,17 @@
    /**
     * åˆ é™¤æ‚£è€…住院记录信息
     *
     *
     * @param inhospid æ‚£è€…住院记录主键
     * @return ç»“æžœ
     */
    public int deletePatMedInhospByInhospid(Long inhospid);
    /**
     * å¤„理从his取来的出院数据
     *
     * @param
     * @return ç»“æžœ
     */
    public int dealOupHospInfo();
}
smartor/src/main/java/com/smartor/service/IServiceSubtaskAnswerService.java
@@ -77,6 +77,6 @@
     */
    public Integer saveQuestionCache(ServiceSubTaskCacheReq serviceSubTaskCacheReq);
    public List<ServiceSubtaskAnswer> selectPatQuestionResult(ServiceSubTaskQueryReq serviceSubTaskQueryReq);
    public List<ServiceSubtaskDetailVO> selectPatQuestionResult(ServiceSubTaskQueryReq serviceSubTaskQueryReq);
}
smartor/src/main/java/com/smartor/service/IServiceSubtaskService.java
@@ -82,6 +82,21 @@
     */
    public void phoneCallBack(PhoneCallBackVO phoneCallBackVO);
    /**
     * ç”µè¯ASR通话回调(雨绮)
     *
     * @param phoneCallReqYQVO
     * @return ç»“æžœ
     */
    public PhoneCallBackYQVO phoneCallBackYQ(PhoneCallReqYQVO phoneCallReqYQVO);
    /**
     * é›¨ç»®ä»»åŠ¡æ‹‰å–
     *
     * @return
     */
    public List<PullTaskVO> taskPull();
    public Integer saveQuestionAnswerPhone(ServiceSubTaskDetailReq serviceSubTaskDetailReq);
}
smartor/src/main/java/com/smartor/service/ISmsParamService.java
@@ -1,19 +1,19 @@
package com.smartor.service;
import java.util.List;
import com.smartor.domain.SmsParam;
/**
 * çŸ­ä¿¡å‚æ•°Service接口
 *
 *
 * @author smartor
 * @date 2023-03-06
 */
public interface ISmsParamService
{
public interface ISmsParamService {
    /**
     * æŸ¥è¯¢çŸ­ä¿¡å‚æ•°
     *
     *
     * @param paramid çŸ­ä¿¡å‚数主键
     * @return çŸ­ä¿¡å‚æ•°
     */
@@ -21,7 +21,7 @@
    /**
     * æŸ¥è¯¢çŸ­ä¿¡å‚数列表
     *
     *
     * @param smsParam çŸ­ä¿¡å‚æ•°
     * @return çŸ­ä¿¡å‚数集合
     */
@@ -29,7 +29,7 @@
    /**
     * æ–°å¢žçŸ­ä¿¡å‚æ•°
     *
     *
     * @param smsParam çŸ­ä¿¡å‚æ•°
     * @return ç»“æžœ
     */
@@ -37,7 +37,7 @@
    /**
     * ä¿®æ”¹çŸ­ä¿¡å‚æ•°
     *
     *
     * @param smsParam çŸ­ä¿¡å‚æ•°
     * @return ç»“æžœ
     */
@@ -45,7 +45,7 @@
    /**
     * æ‰¹é‡åˆ é™¤çŸ­ä¿¡å‚æ•°
     *
     *
     * @param paramids éœ€è¦åˆ é™¤çš„短信参数主键集合
     * @return ç»“æžœ
     */
@@ -53,9 +53,11 @@
    /**
     * åˆ é™¤çŸ­ä¿¡å‚数信息
     *
     *
     * @param paramid çŸ­ä¿¡å‚数主键
     * @return ç»“æžœ
     */
    public int deleteSmsParamByParamid(Long paramid);
    public int sendSmsInfo(String info,String phone);
}
smartor/src/main/java/com/smartor/service/impl/CommonTaskServiceImpl.java
@@ -55,7 +55,7 @@
                return wjSend(sendTaskVO);
            } else if (sendTaskVO.getTaskType() == 3) {
                //宣教
                xjSend(sendTaskVO);
                return xjSend(sendTaskVO);
            }
        }
        return null;
smartor/src/main/java/com/smartor/service/impl/IvrLibaTemplateServiceImpl.java
@@ -135,7 +135,7 @@
            ivrLibaTemplateMapper.updateIvrLibaTemplate(ivrLibaTemplate);
            i = ivrLibaTemplate.getId().intValue();
        }
        log.info("新增或修改模板详情的id为:{}", ivrLibaTemplate.getId());
        log.info("新增或修改模板详情的id为:{}" , ivrLibaTemplate.getId());
        //对模板标签进行处理
        if (CollectionUtils.isNotEmpty(ivrLibaTemplateVO.getIvrLibaTemplateTagList())) {
@@ -167,10 +167,10 @@
            for (IvrLibaTemplateScriptVO ivrLibaTemplateScriptVO : ivrLibaTemplateVO.getIvrLibaTemplateScriptVOList()) {
                if (ivrLibaTemplateScriptVO.getIsoperation() != null) {
                    IvrLibaTemplateScript ivrLibaTemplateScript = scriptHandle(ivrLibaTemplate, ivrLibaTemplateScriptVO, ivrLibaTemplateScriptVO.getIsoperation());
                    dealOption(ivrLibaTemplateScriptVO.getIvrLibaScriptTargetoptionList(), ivrLibaTemplateScript, ivrLibaTemplate.getId(),ivrLibaTemplateScriptVO.getIsoperation());
//                    dealOption(ivrLibaTemplateScriptVO.getIvrLibaScriptTargetoptionList(), ivrLibaTemplateScript, ivrLibaTemplate.getId(), ivrLibaTemplateScriptVO.getIsoperation());
                } else {
                    IvrLibaTemplateScript ivrLibaTemplateScript = scriptHandle(ivrLibaTemplate, ivrLibaTemplateScriptVO, ivrLibaTemplateVO.getIsoperation());
                    dealOption(ivrLibaTemplateScriptVO.getIvrLibaScriptTargetoptionList(), ivrLibaTemplateScript, ivrLibaTemplate.getId(),ivrLibaTemplateVO.getIsoperation());
//                    dealOption(ivrLibaTemplateScriptVO.getIvrLibaScriptTargetoptionList(), ivrLibaTemplateScript, ivrLibaTemplate.getId(), ivrLibaTemplateVO.getIsoperation());
                }
            }
        }
@@ -200,7 +200,7 @@
            ivrLibaTemplateScript.setCreateTime(new Date());
            ivrLibaTemplateScriptMapper.insertIvrLibaTemplateScript(ivrLibaTemplateScript);
            //对选项目进行处理
            dealOption(ivrLibaTemplateScriptVO.getIvrLibaScriptTargetoptionList(), ivrLibaTemplateScript, ivrLibaTemplate.getId(),isoperation);
            dealOption(ivrLibaTemplateScriptVO.getIvrLibaScriptTargetoptionList(), ivrLibaTemplateScript, ivrLibaTemplate.getId(), isoperation);
        } else if (isoperation == 2) {
            //修改
@@ -230,7 +230,7 @@
     * @param tmpID
     */
    private void dealOption(List<IvrLibaTemplateTargetoption> ivrLibaTemplateTargetoptionList, IvrLibaTemplateScript ivrLibaTemplateScript, Long tmpID, Integer isoperation) {
        log.info("ivrLibaTemplateScript的值为:{}", ivrLibaTemplateScript);
        log.info("ivrLibaTemplateScript的值为:{}" , ivrLibaTemplateScript);
        //对模板指标选项进行处理
        Integer lsIsoperation = isoperation;
        if (CollectionUtils.isNotEmpty(ivrLibaTemplateTargetoptionList)) {
@@ -275,12 +275,12 @@
     */
    @Override
    public IvrLibaTemplateVO selectInfoByCondition(IvrLibaTemplateVO ivrLibaTemplateVO) {
        log.info("查询模板详情根据条件的入参为 : {}", ivrLibaTemplateVO);
        log.info("查询模板详情根据条件的入参为 : {}" , ivrLibaTemplateVO);
        //先根据条件查询问题表信息
        IvrLibaTemplate ivrLibaTemplate = DtoConversionUtils.sourceToTarget(ivrLibaTemplateVO, IvrLibaTemplate.class);
        List<IvrLibaTemplate> ivrLibaTemplates = selectIvrLibaTemplateList(ivrLibaTemplate);
        if (CollectionUtils.isEmpty(ivrLibaTemplates)) {
            log.info("提供的条件,查询模板详情数据为空:{}", ivrLibaTemplates);
            log.info("提供的条件,查询模板详情数据为空:{}" , ivrLibaTemplates);
            throw new BaseException("提供的条件,查询模板详情数据为空");
        }
        //定义IvrLibaTemplateVO ç”¨äºŽè¿”参
@@ -299,7 +299,7 @@
        //通过话术ID获取选项
        for (IvrLibaTemplateScriptVO ivrLibaTemplateScriptVO : ivrLibaTemplateScriptVOS) {
            log.info("ivrLibaTemplateScriptVO的主键id为:{}", ivrLibaTemplateScriptVO.getId());
            log.error("ivrLibaTemplateScriptVO的主键id为:{}" , ivrLibaTemplateScriptVO.getId());
            IvrLibaTemplateTargetoption ivrLibaTemplateTargetoption = new IvrLibaTemplateTargetoption();
            ivrLibaTemplateTargetoption.setScriptid(ivrLibaTemplateScriptVO.getId());
            List<IvrLibaTemplateTargetoption> ivrLibaTemplateTargetoptions = ivrLibaTemplateTargetOptionMapper.selectIvrLibaTemplateTargetoptionList(ivrLibaTemplateTargetoption);
@@ -324,7 +324,7 @@
            }
            ivrLibaTemplateScriptVO.setIvrLibaScriptTargetoptionList(ivrLibaTemplateTargetoptions);
        }
        Collections.sort(ivrLibaTemplateScriptVOS, Comparator.comparing(IvrLibaTemplateScriptVO::getTargetid));
        Collections.sort(ivrLibaTemplateScriptVOS, Comparator.comparing(IvrLibaTemplateScriptVO::getSort));
        //数据组装
        templateVO.setIvrLibaTemplateTagList(ivrLibaTemplateTags);
        templateVO.setIvrLibaTemplateScriptVOList(ivrLibaTemplateScriptVOS);
smartor/src/main/java/com/smartor/service/impl/IvrTaskTemplateScriptServiceImpl.java
@@ -1,8 +1,12 @@
package com.smartor.service.impl;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.DtoConversionUtils;
import com.smartor.domain.IvrTaskTemplateScript;
import com.smartor.domain.IvrTaskTemplateScriptVO;
import com.smartor.domain.IvrTaskTemplateTargetoption;
import com.smartor.mapper.IvrTaskTemplateScriptMapper;
import com.smartor.mapper.IvrTaskTemplateTargetoptionMapper;
import com.smartor.service.IIvrTaskTemplateScriptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -19,6 +23,8 @@
public class IvrTaskTemplateScriptServiceImpl implements IIvrTaskTemplateScriptService {
    @Autowired
    private IvrTaskTemplateScriptMapper ivrTaskTemplateScriptMapper;
    @Autowired
    private IvrTaskTemplateTargetoptionMapper ivrTaskTemplateTargetoptionMapper;
    /**
     * æŸ¥è¯¢éšè®¿ä»»åŠ¡æ¨¡ç‰ˆé—®é¢˜è¯æœ¯åº“
@@ -31,6 +37,17 @@
        return ivrTaskTemplateScriptMapper.selectIvrTaskTemplateScriptByID(ID);
    }
    @Override
    public IvrTaskTemplateScriptVO getTaskTempScriptInfoByid(Long ID) {
        IvrTaskTemplateScript ivrTaskTemplateScript = selectIvrTaskTemplateScriptByID(ID);
        IvrTaskTemplateScriptVO ivrTaskTemplateScriptVO = DtoConversionUtils.sourceToTarget(ivrTaskTemplateScript, IvrTaskTemplateScriptVO.class);
        IvrTaskTemplateTargetoption ivrTaskTemplateTargetoption = new IvrTaskTemplateTargetoption();
        ivrTaskTemplateTargetoption.setScriptid(ivrTaskTemplateScriptVO.getId());
        List<IvrTaskTemplateTargetoption> ivrTaskTemplateTargetoptions = ivrTaskTemplateTargetoptionMapper.selectIvrTaskTemplateTargetoptionList(ivrTaskTemplateTargetoption);
        ivrTaskTemplateScriptVO.setIvrTaskScriptTargetoptionList(ivrTaskTemplateTargetoptions);
        return ivrTaskTemplateScriptVO;
    }
    /**
     * æŸ¥è¯¢éšè®¿ä»»åŠ¡æ¨¡ç‰ˆé—®é¢˜è¯æœ¯åº“åˆ—è¡¨
     *
smartor/src/main/java/com/smartor/service/impl/IvrTaskTemplateServiceImpl.java
@@ -78,6 +78,10 @@
    public int saveOrUpdateTempScript(IvrTaskTemplateVO ivrTaskTemplateVO) {
        Integer i = null;
        IvrTaskTemplate ivrTaskTemplate = DtoConversionUtils.sourceToTarget(ivrTaskTemplateVO, IvrTaskTemplate.class);
        //传过来的静默时间是秒,需要改成毫秒
        if (ivrTaskTemplate.getSilencetime() != null)
            ivrTaskTemplate.setSilencetime(ivrTaskTemplate.getSilencetime() * 1000);
        if (ivrTaskTemplateVO.getIsoperation() != null && ivrTaskTemplateVO.getIsoperation() == 1) {
            //新增
            ivrTaskTemplate.setCreateTime(new Date());
@@ -89,11 +93,11 @@
            updateIvrTaskTemplate(ivrTaskTemplate);
            i = ivrTaskTemplate.getId().intValue();
        }
        log.info("新增随访任务随访模板的id为:{}", ivrTaskTemplate.getId());
        log.info("新增随访任务随访模板的id为:{}" , ivrTaskTemplate.getId());
        //对模板话术和选项进行处理(话术表与指标表进行合并了,)
        if (CollectionUtils.isNotEmpty(ivrTaskTemplateVO.getIvrTaskTemplateScriptVOList())) {
            log.error("ivrTaskTemplateVO.getIvrTaskTemplateScriptVOList()是否有数据哈:{}", ivrTaskTemplateVO.getIvrTaskTemplateScriptVOList());
            log.error("ivrTaskTemplateVO.getIvrTaskTemplateScriptVOList()是否有数据哈:{}" , ivrTaskTemplateVO.getIvrTaskTemplateScriptVOList());
            for (IvrTaskTemplateScriptVO ivrTaskTemplateScriptVO : ivrTaskTemplateVO.getIvrTaskTemplateScriptVOList()) {
                if (ivrTaskTemplateScriptVO.getIsoperation() != null) {
                    IvrTaskTemplateScript ivrTaskTemplateScript = scriptHandle(ivrTaskTemplate, ivrTaskTemplateScriptVO, ivrTaskTemplateScriptVO.getIsoperation());
@@ -148,16 +152,16 @@
     */
    @Override
    public IvrTaskTemplateVO selectInfoByCondition(IvrTaskTemplateVO ivrTaskTemplateVO) {
        log.info("查询模板详情根据条件的入参为 : {}", ivrTaskTemplateVO);
        log.info("查询模板详情根据条件的入参为 : {}" , ivrTaskTemplateVO);
        //先根据条件查询问题表信息
        IvrTaskTemplate ivrTaskTemplate = DtoConversionUtils.sourceToTarget(ivrTaskTemplateVO, IvrTaskTemplate.class);
        List<IvrTaskTemplate> ivrTaskTemplates = selectIvrTaskTemplateList(ivrTaskTemplate);
        if (CollectionUtils.isEmpty(ivrTaskTemplates)) {
            log.info("提供的条件,查询模板详情数据为空:{}", ivrTaskTemplates);
            log.info("提供的条件,查询模板详情数据为空:{}" , ivrTaskTemplates);
            throw new BaseException("提供的条件,查询模板详情数据为空");
        }
        log.info("ivrLibaTemplates的查询结果为:{},数量为 : {}", ivrTaskTemplates.get(0), ivrTaskTemplates.size());
        log.info("ivrLibaTemplates的查询结果为:{},数量为 : {}" , ivrTaskTemplates.get(0), ivrTaskTemplates.size());
        //定义IvrLibaTemplateVO ç”¨äºŽè¿”参
        IvrTaskTemplateVO templateVO = DtoConversionUtils.sourceToTarget(ivrTaskTemplates.get(0), IvrTaskTemplateVO.class);
//
@@ -174,7 +178,7 @@
        //通过话术ID获取选项
        for (IvrTaskTemplateScriptVO ivrTaskTemplateScriptVO : ivrTaskTemplateScriptVOS) {
            log.info("ivrLibaTemplateScriptVO的主键id为:{}", ivrTaskTemplateScriptVO.getId());
            log.info("ivrLibaTemplateScriptVO的主键id为:{}" , ivrTaskTemplateScriptVO.getId());
            IvrTaskTemplateTargetoption ivrTaskTemplateTargetoption = new IvrTaskTemplateTargetoption();
            ivrTaskTemplateTargetoption.setScriptid(ivrTaskTemplateScriptVO.getId());
            List<IvrTaskTemplateTargetoption> ivrTaskTemplateTargetoptions = ivrTaskTemplateTargetoptionMapper.selectIvrTaskTemplateTargetoptionList(ivrTaskTemplateTargetoption);
@@ -235,7 +239,7 @@
    }
    private void dealOption(List<IvrTaskTemplateTargetoption> ivrTaskTemplateTargetoptionList, IvrTaskTemplateScript ivrTaskTemplateScript, Long tmpID, Integer isoperation) {
        log.info("ivrLibaTemplateScript的值为:{}", ivrTaskTemplateScript);
        log.info("ivrLibaTemplateScript的值为:{}" , ivrTaskTemplateScript);
        Integer lsisoperation = isoperation;
        //对模板指标选项进行处理
        if (CollectionUtils.isNotEmpty(ivrTaskTemplateTargetoptionList)) {
smartor/src/main/java/com/smartor/service/impl/PatArchiveServiceImpl.java
@@ -189,8 +189,8 @@
     * @return
     */
    @Override
    public List<PatTaskRelevance> getPatientInfo(PatArchiveReq patArchiveReq) {
        List<PatTaskRelevance> PatTaskRelevances = new ArrayList<>();
    public List<ServiceSubtask> getPatientInfo(PatArchiveReq patArchiveReq) {
        List<ServiceSubtask> serviceSubtaskList = new ArrayList<>();
        List<PatArchive> patArchiveList = new ArrayList<>();
        if (patArchiveReq.getAllhosp() != null && patArchiveReq.getAllhosp() == 1) {
@@ -213,14 +213,15 @@
            }
        }
        for (PatArchive patArchive : patArchiveList) {
            PatTaskRelevance patTaskRelevance = DtoConversionUtils.sourceToTarget(patArchive, PatTaskRelevance.class);
            patTaskRelevance.setCreateTime(patArchive.getCreateTime());
            patTaskRelevance.setCreateBy(patArchive.getCreateBy());
            patTaskRelevance.setDeptName(patArchive.getDept());
            PatTaskRelevances.add(patTaskRelevance);
            ServiceSubtask serviceSubtask = DtoConversionUtils.sourceToTarget(patArchive, ServiceSubtask.class);
            serviceSubtask.setCreateTime(patArchive.getCreateTime());
            serviceSubtask.setCreateBy(patArchive.getCreateBy());
            serviceSubtask.setDeptname(patArchive.getDept());
            serviceSubtask.setPhone(patArchive.getTelcode());
            serviceSubtaskList.add(serviceSubtask);
        }
        return PatTaskRelevances;
        return serviceSubtaskList;
    }
smartor/src/main/java/com/smartor/service/impl/PatMedInhospServiceImpl.java
@@ -1,96 +1,205 @@
package com.smartor.service.impl;
import java.time.LocalDate;
import java.time.ZoneOffset;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.DtoConversionUtils;
import com.ruoyi.common.utils.StringUtils;
import com.smartor.domain.*;
import com.smartor.mapper.*;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import com.smartor.mapper.PatMedInhospMapper;
import com.smartor.domain.PatMedInhosp;
import com.smartor.service.IPatMedInhospService;
import org.springframework.transaction.annotation.Transactional;
/**
 * æ‚£è€…住院记录Service业务层处理
 *
 *
 * @author smartor
 * @date 2023-03-04
 */
@Slf4j
@Service
public class PatMedInhospServiceImpl implements IPatMedInhospService
{
public class PatMedInhospServiceImpl implements IPatMedInhospService {
    @Autowired
    private PatMedInhospMapper patMedInhospMapper;
    @Autowired
    private PatArchiveMapper patArchiveMapper;
    @Autowired
    private IvrLibaTemplateMapper ivrLibaTemplateMapper;
    @Autowired
    private IvrTaskTemplateMapper ivrTaskTemplateMapper;
    @Autowired
    private ServiceTaskMapper serviceTaskMapper;
    @Autowired
    private ServiceSubtaskMapper serviceSubtaskMapper;
    //记录长期任务基础信息
    List<IvrLibaTemplate> libaTemplates = new ArrayList<>();
    List<IvrTaskTemplate> ivrTaskTemplates = new ArrayList<>();
    List<ServiceTask> serviceTaskList = new ArrayList<>();
    /**
     * æŸ¥è¯¢æ‚£è€…住院记录
     *
     *
     * @param inhospid æ‚£è€…住院记录主键
     * @return æ‚£è€…住院记录
     */
    @Override
    public PatMedInhosp selectPatMedInhospByInhospid(Long inhospid)
    {
    public PatMedInhosp selectPatMedInhospByInhospid(Long inhospid) {
        return patMedInhospMapper.selectPatMedInhospByInhospid(inhospid);
    }
    /**
     * æŸ¥è¯¢æ‚£è€…住院记录列表
     *
     *
     * @param patMedInhosp æ‚£è€…住院记录
     * @return æ‚£è€…住院记录
     */
    @Override
    public List<PatMedInhosp> selectPatMedInhospList(PatMedInhosp patMedInhosp)
    {
    public List<PatMedInhosp> selectPatMedInhospList(PatMedInhosp patMedInhosp) {
        return patMedInhospMapper.selectPatMedInhospList(patMedInhosp);
    }
    /**
     * æ–°å¢žæ‚£è€…住院记录
     *
     *
     * @param patMedInhosp æ‚£è€…住院记录
     * @return ç»“æžœ
     */
    @Override
    public int insertPatMedInhosp(PatMedInhosp patMedInhosp)
    {
    public int insertPatMedInhosp(PatMedInhosp patMedInhosp) {
        patMedInhosp.setCreateTime(DateUtils.getNowDate());
        patMedInhosp.setUpdateTime(DateUtils.getNowDate());
        return patMedInhospMapper.insertPatMedInhosp(patMedInhosp);
    }
    /**
     * ä¿®æ”¹æ‚£è€…住院记录
     *
     *
     * @param patMedInhosp æ‚£è€…住院记录
     * @return ç»“æžœ
     */
    @Override
    public int updatePatMedInhosp(PatMedInhosp patMedInhosp)
    {
    public int updatePatMedInhosp(PatMedInhosp patMedInhosp) {
        patMedInhosp.setUpdateTime(DateUtils.getNowDate());
        return patMedInhospMapper.updatePatMedInhosp(patMedInhosp);
    }
    /**
     * æ‰¹é‡åˆ é™¤æ‚£è€…住院记录
     *
     *
     * @param inhospids éœ€è¦åˆ é™¤çš„æ‚£è€…住院记录主键
     * @return ç»“æžœ
     */
    @Override
    public int deletePatMedInhospByInhospids(Long[] inhospids)
    {
    public int deletePatMedInhospByInhospids(Long[] inhospids) {
        return patMedInhospMapper.deletePatMedInhospByInhospids(inhospids);
    }
    /**
     * åˆ é™¤æ‚£è€…住院记录信息
     *
     *
     * @param inhospid æ‚£è€…住院记录主键
     * @return ç»“æžœ
     */
    @Override
    public int deletePatMedInhospByInhospid(Long inhospid)
    {
    public int deletePatMedInhospByInhospid(Long inhospid) {
        return patMedInhospMapper.deletePatMedInhospByInhospid(inhospid);
    }
    @Transactional(rollbackFor = Exception.class)
    @Override
    public int dealOupHospInfo() {
        //获取长期模板
        IvrLibaTemplate ivrTemp = new IvrLibaTemplate();
        ivrTemp.setDelFlag("0");
        ivrTemp.setLongTemp(1);
        List<IvrLibaTemplate> ivrLibaTemplates = ivrLibaTemplateMapper.selectIvrLibaTemplateList(ivrTemp);
        if (CollectionUtils.isNotEmpty(ivrLibaTemplates)) {
            for (IvrLibaTemplate ivrLibaTemplate : ivrLibaTemplates) {
                //获取到任务模板信息
                IvrTaskTemplate ivrTaskTemplate = new IvrTaskTemplate();
                ivrTaskTemplate.setLibtemplateid(ivrLibaTemplate.getId().toString());
                List<IvrTaskTemplate> ivrTaskTemplates = ivrTaskTemplateMapper.selectIvrTaskTemplateList(ivrTaskTemplate);
                if (CollectionUtils.isNotEmpty(ivrTaskTemplates)) {
                    IvrTaskTemplate ivrTaskTemplate1 = ivrTaskTemplates.get(0);
                    //通过任务模板ID获取任务
                    ServiceTask ServiceTask = new ServiceTask();
                    ServiceTask.setTemplateid(ivrTaskTemplate1.getId());
                    List<ServiceTask> serviceTasks = serviceTaskMapper.selectServiceTaskList(ServiceTask);
                    if (CollectionUtils.isNotEmpty(serviceTasks)) {
                        serviceTaskList.add(serviceTasks.get(0));
                    }
                    ivrTaskTemplates.add(ivrTaskTemplate1);
                }
                libaTemplates.add(ivrLibaTemplate);
            }
        }
        PatMedInhosp patMedInhosp = new PatMedInhosp();
        //获取未处理的数据
        patMedInhosp.setCheckFlag("0");
        patMedInhosp.setInhospstate("1");
        List<PatMedInhosp> patMedInhosps = patMedInhospMapper.selectPatMedInhospList(patMedInhosp);
        for (PatMedInhosp patMedInhosp1 : patMedInhosps) {
            PatArchive patArchive = patArchiveMapper.selectPatArchiveByPatid(patMedInhosp1.getPatid());
            //通过icd10code去获取相应的ivr_liba_template_id
            if (StringUtils.isNotEmpty(patMedInhosp1.getIcd10code())) {
                for (IvrLibaTemplate ivrLibaTemplate : libaTemplates) {
                    String icdCode = patMedInhosp1.getIcd10code().split(",")[0];
                    if (ivrLibaTemplate.getIcd10code().equals(icdCode)) {
                        //通过模板ID获取任务模板
                        for (IvrTaskTemplate ivrTaskTemplate : ivrTaskTemplates) {
                            if (ivrTaskTemplate.getLibtemplateid().equals(ivrLibaTemplate.getId().toString())) {
                                for (ServiceTask serviceTask : serviceTaskList) {
                                    if (serviceTask.getTemplateid() == ivrTaskTemplate.getId()) {
                                        //将该患者,插入到子任务表中
                                        ServiceSubtask serviceSubtask = DtoConversionUtils.sourceToTarget(serviceTask, ServiceSubtask.class);
                                        serviceSubtask.setId(null);
                                        serviceSubtask.setTaskid(serviceTask.getTaskid());
                                        serviceSubtask.setLibtemplateid(ivrLibaTemplate.getId());
                                        serviceSubtask.setTemplateid(ivrTaskTemplate.getId());
                                        serviceSubtask.setTemplatename(ivrLibaTemplate.getTemplateName());
                                        serviceSubtask.setPatid(patMedInhosp1.getPatid());
                                        serviceSubtask.setSendname(patMedInhosp1.getPatname());
                                        serviceSubtask.setPhone(patArchive.getTelcode());
                                        serviceSubtask.setSex(patArchive.getSex());
                                        serviceSubtask.setAge(patArchive.getAge());
                                        serviceSubtask.setSendstate(2L);
                                        serviceSubtask.setServiceform(serviceTask.getPreachform());
                                        serviceSubtask.setHospType("2");
                                        //患者发送时间
                                        LocalDate currentDate = LocalDate.now();
                                        LocalDate newDate = currentDate.plusDays(ivrTaskTemplate.getSendDay());
                                        serviceSubtask.setLongSendTime(Date.from(newDate.atStartOfDay(ZoneOffset.ofHours(8)).toInstant()));
                                        serviceSubtaskMapper.insertServiceSubtask(serviceSubtask);
                                        //将check_flag改成1(已处理)
                                        PatMedInhosp patMedInhosp2 = new PatMedInhosp();
                                        patMedInhosp2.setInhospid(patMedInhosp1.getInhospid());
                                        patMedInhosp2.setCheckFlag("1");
                                        patMedInhospMapper.updatePatMedInhosp(patMedInhosp2);
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        return 1;
    }
}
smartor/src/main/java/com/smartor/service/impl/PatMedInspectionServiceImpl.java
@@ -11,7 +11,7 @@
/**
 * æ‚£è€…检查检验记录Service业务层处理
 *
 *
 * @author ruoyi
 * @date 2023-06-16
 */
@@ -23,7 +23,7 @@
    /**
     * æŸ¥è¯¢æ‚£è€…检查检验记录
     *
     *
     * @param id æ‚£è€…检查检验记录主键
     * @return æ‚£è€…检查检验记录
     */
@@ -35,7 +35,7 @@
    /**
     * æŸ¥è¯¢æ‚£è€…检查检验记录列表
     *
     *
     * @param patMedInspection æ‚£è€…检查检验记录
     * @return æ‚£è€…检查检验记录
     */
@@ -47,7 +47,7 @@
    /**
     * æ–°å¢žæ‚£è€…检查检验记录
     *
     *
     * @param patMedInspection æ‚£è€…检查检验记录
     * @return ç»“æžœ
     */
@@ -55,12 +55,13 @@
    public int insertPatMedInspection(PatMedInspection patMedInspection)
    {
        patMedInspection.setCreateTime(DateUtils.getNowDate());
        patMedInspection.setUpdateTime(DateUtils.getNowDate());
        return patMedInspectionMapper.insertPatMedInspection(patMedInspection);
    }
    /**
     * ä¿®æ”¹æ‚£è€…检查检验记录
     *
     *
     * @param patMedInspection æ‚£è€…检查检验记录
     * @return ç»“æžœ
     */
@@ -73,7 +74,7 @@
    /**
     * æ‰¹é‡åˆ é™¤æ‚£è€…检查检验记录
     *
     *
     * @param ids éœ€è¦åˆ é™¤çš„æ‚£è€…检查检验记录主键
     * @return ç»“æžœ
     */
@@ -85,7 +86,7 @@
    /**
     * åˆ é™¤æ‚£è€…检查检验记录信息
     *
     *
     * @param id æ‚£è€…检查检验记录主键
     * @return ç»“æžœ
     */
smartor/src/main/java/com/smartor/service/impl/PatMedRegistrationServiceImpl.java
@@ -55,6 +55,7 @@
    public int insertPatMedRegistration(PatMedRegistration patMedRegistration)
    {
        patMedRegistration.setCreateTime(DateUtils.getNowDate());
        patMedRegistration.setUpdateTime(DateUtils.getNowDate());
        return patMedRegistrationMapper.insertPatMedRegistration(patMedRegistration);
    }
smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskAnswerServiceImpl.java
@@ -1,24 +1,16 @@
package com.smartor.service.impl;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONArray;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.DtoConversionUtils;
import com.ruoyi.common.utils.RSAPublicKeyExample;
import com.ruoyi.common.utils.StringUtils;
import com.smartor.domain.*;
import com.smartor.mapper.IvrTaskTemplateScriptMapper;
import com.smartor.mapper.ServiceSubtaskAnswerMapper;
import com.smartor.mapper.ServiceSubtaskMapper;
import com.smartor.mapper.ServiceTaskMapper;
import com.smartor.service.IIvrTaskTemplateService;
import com.smartor.mapper.ServiceSubtaskDetailMapper;
import com.smartor.mapper.SvyTaskTemplateTargetoptionMapper;
import com.smartor.service.IServiceSubtaskAnswerService;
import com.smartor.service.ISvyTaskTemplateService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
@@ -42,6 +34,12 @@
    @Autowired
    private RedisCache redisCache;
    @Autowired
    private ServiceSubtaskDetailMapper serviceSubtaskDetailMapper;
    @Autowired
    private SvyTaskTemplateTargetoptionMapper svyTaskTemplateTargetoptionMapper;
    @Value("${pri_key}")
    private String pri_key;
@@ -120,51 +118,22 @@
        if (ObjectUtils.isNotEmpty(serviceSubTaskAnswerReq)) {
            //需要立即执行
            RSAPublicKeyExample rsaPublicKeyExample = new RSAPublicKeyExample();
//            Long tid = Long.valueOf(rsaPublicKeyExample.decryptedData(serviceSubTaskAnswerReq.getParam1(), pri_key));
//            Long pid = Long.valueOf(rsaPublicKeyExample.decryptedData(serviceSubTaskAnswerReq.getParam2(), pri_key));
            Long tid=Long.valueOf(serviceSubTaskAnswerReq.getParam1());
            Long pid=Long.valueOf(serviceSubTaskAnswerReq.getParam2());
            Long tid = Long.valueOf(rsaPublicKeyExample.decryptedData(serviceSubTaskAnswerReq.getParam1(), pri_key));
            Long pid = Long.valueOf(rsaPublicKeyExample.decryptedData(serviceSubTaskAnswerReq.getParam2(), pri_key));
            allKeys = new HashSet<>();
            if (serviceSubTaskAnswerReq.getType() == 1) {
                allKeys.add(pid + "-" + tid + "-SFscriptCache");
            } else if (serviceSubTaskAnswerReq.getType() == 2) {
                allKeys.add(pid + "-" + tid + "-WJscriptCache");
            }
            allKeys.add(pid + "-" + tid + "-WJscriptCache");
        }
        Long nextScriptno = null;
        for (String key : allKeys) {
            String[] split = key.split("-");
            if (key.contains("-SFscriptCache")) {
                //包含了,说明了是随访问题
                List<IvrTaskTemplateScriptVO> cacheList = redisCache.getCacheObject(key);
                for (int i = 0; i < cacheList.size(); i++) {
                    if (i == 0) {
                        // è¯´æ˜Žæ˜¯ç¬¬ä¸€é¢˜
                        IvrTaskTemplateScriptVO ivrLibaTemplateScriptVO = cacheList.get(0);
                        //将第一题的信息放到表中
                        setSFInfo(ivrLibaTemplateScriptVO, Long.valueOf(split[1]), Long.valueOf(split[0]));
                        nextScriptno = cacheList.get(0).getNextScriptno();
                    } else {
                        //不是第 ä¸€ é¢˜
                        for (IvrTaskTemplateScriptVO ivrLibaTemplateScriptVO : cacheList) {
                            if (ivrLibaTemplateScriptVO.getId() == nextScriptno) {
                                setSFInfo(ivrLibaTemplateScriptVO, Long.valueOf(split[1]), Long.valueOf(split[0]));
                                nextScriptno = ivrLibaTemplateScriptVO.getNextScriptno();
                            }
                        }
                    }
                }
            } else if (key.contains("-WJscriptCache")) {
            if (key.contains("-WJscriptCache")) {
                List<SvyTaskTemplateScriptVO> cacheList = redisCache.getCacheList(key);
                for (int i = 0; i < cacheList.size(); i++) {
                    if (i == 0) {
                        // è¯´æ˜Žæ˜¯ç¬¬ä¸€é¢˜
                        //将第一题的信息放到表中
                        setWJInfo(cacheList.get(0), Long.valueOf(split[1]), Long.valueOf(split[0]));
                        nextScriptno = Long.valueOf(cacheList.get(0).getNextScriptno());
                        nextScriptno = setWJInfo(cacheList.get(0), Long.valueOf(split[1]), Long.valueOf(split[0]));
                    } else {
                        for (SvyTaskTemplateScriptVO svyTaskTemplateScriptVO : cacheList) {
                            if (svyTaskTemplateScriptVO.getId() == nextScriptno) {
@@ -192,114 +161,84 @@
    @Override
    public Integer saveQuestionCache(ServiceSubTaskCacheReq serviceSubTaskCacheReq) {
        RSAPublicKeyExample rsaPublicKeyExample = new RSAPublicKeyExample();
//        Long tid = Long.valueOf(rsaPublicKeyExample.decryptedData(serviceSubTaskCacheReq.getParam1(), pri_key));
//        Long pid = Long.valueOf(rsaPublicKeyExample.decryptedData(serviceSubTaskCacheReq.getParam2(), pri_key));
        Long tid=Long.valueOf(serviceSubTaskCacheReq.getParam1());
        Long pid=Long.valueOf(serviceSubTaskCacheReq.getParam2());
        if (CollectionUtils.isNotEmpty(serviceSubTaskCacheReq.getIvrTaskTemplateScriptVOList())) {
            //随访
            redisCache.setCacheObject(pid + "-" + tid + "-SFscriptCache", serviceSubTaskCacheReq.getIvrTaskTemplateScriptVOList());
        } else if (CollectionUtils.isNotEmpty(serviceSubTaskCacheReq.getSvyTaskTemplateScriptVOList())) {
            //问卷
            redisCache.setCacheObject(pid + "-" + tid + "-WJscriptCache", serviceSubTaskCacheReq.getSvyTaskTemplateScriptVOList());
        }
        Long tid = Long.valueOf(rsaPublicKeyExample.decryptedData(serviceSubTaskCacheReq.getParam1(), pri_key));
        Long pid = Long.valueOf(rsaPublicKeyExample.decryptedData(serviceSubTaskCacheReq.getParam2(), pri_key));
        //问卷
        redisCache.setCacheObject(pid + "-" + tid + "-WJscriptCache", serviceSubTaskCacheReq.getSvyTaskTemplateScriptVOList());
        return 1;
    }
    @Override
    public List<ServiceSubtaskAnswer> selectPatQuestionResult(ServiceSubTaskQueryReq serviceSubTaskQueryReq) {
    public List<ServiceSubtaskDetailVO> selectPatQuestionResult(ServiceSubTaskQueryReq serviceSubTaskQueryReq) {
        log.error("selectPatQuesTionResult的入参为:{}", serviceSubTaskQueryReq);
        ServiceSubtaskAnswer serviceSubtaskAnswer = new ServiceSubtaskAnswer();
        serviceSubtaskAnswer.setTaskid(serviceSubTaskQueryReq.getTaskid());
        serviceSubtaskAnswer.setPatId(serviceSubTaskQueryReq.getPatId());
        serviceSubtaskAnswer.setScriptid(serviceSubTaskQueryReq.getScriptid());
        List<ServiceSubtaskAnswer> serviceSubtaskAnswerList = serviceSubtaskAnswerMapper.selectServiceSubtaskAnswerList(serviceSubtaskAnswer);
        for (ServiceSubtaskAnswer serviceSubtaskAnswer1 : serviceSubtaskAnswerList) {
            ObjectMapper mapper = new ObjectMapper();
            try {
                List<ServiceSubtaskOptionAnswer> serviceSubtaskOptionAnswer = mapper.readValue(serviceSubtaskAnswer1.getAnswer(), List.class);
                serviceSubtaskAnswer1.setOptionAnswer(serviceSubtaskOptionAnswer);
            } catch (JsonProcessingException e) {
                e.printStackTrace();
            }
        List<ServiceSubtaskDetailVO> serviceSubtaskDetailVOList = new ArrayList<>();
        ServiceSubtaskDetail serviceSubtaskDetail = new ServiceSubtaskDetail();
        serviceSubtaskDetail.setTaskid(serviceSubTaskQueryReq.getTaskid());
        serviceSubtaskDetail.setPatid(serviceSubTaskQueryReq.getPatId());
        serviceSubtaskDetail.setScriptid(serviceSubTaskQueryReq.getScriptid());
        List<ServiceSubtaskDetail> serviceSubtaskDetails = serviceSubtaskDetailMapper.selectServiceSubtaskDetailList(serviceSubtaskDetail);
        for (ServiceSubtaskDetail serviceSubtaskDetail1 : serviceSubtaskDetails) {
            ServiceSubtaskDetailVO serviceSubtaskDetailVO = DtoConversionUtils.sourceToTarget(serviceSubtaskDetail1, ServiceSubtaskDetailVO.class);
            SvyTaskTemplateTargetoption svyTaskTemplateTargetoption = new SvyTaskTemplateTargetoption();
            svyTaskTemplateTargetoption.setScriptid(serviceSubtaskDetailVO.getScriptid());
            svyTaskTemplateTargetoption.setTaskid(serviceSubtaskDetailVO.getTaskid());
            List<SvyTaskTemplateTargetoption> svyTaskTemplateTargetoptions = svyTaskTemplateTargetoptionMapper.selectSvyTaskTemplateTargetoptionList(svyTaskTemplateTargetoption);
            serviceSubtaskDetailVO.setSvyTaskTemplateTargetoptions(svyTaskTemplateTargetoptions);
            serviceSubtaskDetailVOList.add(serviceSubtaskDetailVO);
        }
        return serviceSubtaskAnswerList;
        return serviceSubtaskDetailVOList;
    }
    private void setSFInfo(IvrTaskTemplateScriptVO ivrTaskTemplateScriptVO, Long taskid, Long patid) {
        ServiceSubtaskAnswer serviceSubtaskAnswer = new ServiceSubtaskAnswer();
        List<ServiceSubtaskOptionAnswer> answerList = new ArrayList<>();
        if (StringUtils.isNotEmpty(ivrTaskTemplateScriptVO.getScriptType()) && ivrTaskTemplateScriptVO.getScriptType().equals("1") || StringUtils.isNotEmpty(ivrTaskTemplateScriptVO.getScriptType()) && ivrTaskTemplateScriptVO.getScriptType().equals("2")) {
            //1、2为单选或多选
            for (IvrTaskTemplateTargetoption ivrTaskTemplateTargetoption : ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList()) {
                //获取用户选中的选项号
                if (ivrTaskTemplateTargetoption.getIsUserOperation() == true) {
                    ServiceSubtaskOptionAnswer serviceSubtaskOptionAnswer = new ServiceSubtaskOptionAnswer();
                    serviceSubtaskOptionAnswer.setId(ivrTaskTemplateTargetoption.getId());
                    serviceSubtaskOptionAnswer.setCode(ivrTaskTemplateTargetoption.getOptionCode());
                    serviceSubtaskOptionAnswer.setValue(ivrTaskTemplateTargetoption.getTargetvalue());
                    serviceSubtaskOptionAnswer.setAppenddesc(ivrTaskTemplateTargetoption.getAppenddesc());
                    answerList.add(serviceSubtaskOptionAnswer);
                }
            }
        } else {
            //非单多选
            if (CollectionUtils.isNotEmpty(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList())) {
                log.error("IvrTaskScriptTargetoptionList的值为:{}", ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList());
                ServiceSubtaskOptionAnswer serviceSubtaskOptionAnswer = new ServiceSubtaskOptionAnswer();
                serviceSubtaskOptionAnswer.setId(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(0).getId());
                serviceSubtaskOptionAnswer.setCode(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(0).getOptionCode());
                serviceSubtaskOptionAnswer.setValue(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(0).getTargetvalue());
                serviceSubtaskOptionAnswer.setAppenddesc(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(0).getAppenddesc());
                answerList.add(serviceSubtaskOptionAnswer);
            }
        }
        //数据保存
        serviceSubtaskAnswer.setTaskid(taskid);
        serviceSubtaskAnswer.setPatId(patid);
        serviceSubtaskAnswer.setScriptid(ivrTaskTemplateScriptVO.getId());
        serviceSubtaskAnswer.setScriptType(Long.valueOf(ivrTaskTemplateScriptVO.getScriptType()));
        serviceSubtaskAnswer.setAnswer(JSON.toJSONString(answerList));
        serviceSubtaskAnswer.setComment(null);
        serviceSubtaskAnswer.setCreateTime(new Date());
        serviceSubtaskAnswer.setUpdateTime(new Date());
        serviceSubtaskAnswerMapper.insertServiceSubtaskAnswer(serviceSubtaskAnswer);
    }
    private Long setWJInfo(SvyTaskTemplateScriptVO svyTaskTemplateScriptVO, Long taskid, Long patid) {
        //下题跳转
        Long nextScriptNo = null;
    private void setWJInfo(SvyTaskTemplateScriptVO svyTaskTemplateScriptVO, Long taskid, Long patid) {
        ServiceSubtaskAnswer serviceSubtaskAnswer = null;
        ServiceSubtaskDetailVO serviceSubtaskDetailVO = new ServiceSubtaskDetailVO();
        List<ServiceSubtaskOptionAnswer> answerList = new ArrayList<>();
        if (svyTaskTemplateScriptVO.getScriptType().equals("1") || svyTaskTemplateScriptVO.getScriptType().equals("2")) {
            //1、2为单选或多选
            for (SvyTaskTemplateTargetoption svyTaskTemplateTargetoption : svyTaskTemplateScriptVO.getSvyTaskTemplateTargetoptions()) {
                //将问题选项记录下来
                if (StringUtils.isEmpty(serviceSubtaskDetailVO.getTargetvalue())) {
                    serviceSubtaskDetailVO.setTargetvalue(svyTaskTemplateTargetoption.getTargetvalue());
                } else {
                    serviceSubtaskDetailVO.setTargetvalue(serviceSubtaskDetailVO.getTargetvalue() + "  " + svyTaskTemplateTargetoption.getTargetvalue());
                }
                if (svyTaskTemplateTargetoption.getIsUserOperation() == true) {
                    ServiceSubtaskOptionAnswer serviceSubtaskOptionAnswer = new ServiceSubtaskOptionAnswer();
                    serviceSubtaskOptionAnswer.setId(svyTaskTemplateTargetoption.getId());
                    serviceSubtaskOptionAnswer.setCode(svyTaskTemplateTargetoption.getOptionCode());
                    serviceSubtaskOptionAnswer.setValue(svyTaskTemplateTargetoption.getTargetvalue());
                    serviceSubtaskOptionAnswer.setAppenddesc(svyTaskTemplateTargetoption.getAppenddesc());
                    answerList.add(serviceSubtaskOptionAnswer);
                    //将选中的结果放到asrtext中
                    if (StringUtils.isEmpty(serviceSubtaskDetailVO.getAsrtext())) {
                        serviceSubtaskDetailVO.setAsrtext(svyTaskTemplateTargetoption.getTargetvalue());
                    } else {
                        //如果是多选,答案需要用 & è¿›è¡Œæ‹¼æŽ¥
                        serviceSubtaskDetailVO.setAsrtext(serviceSubtaskDetailVO.getAnswerps() + "&" + svyTaskTemplateTargetoption.getTargetvalue());
                    }
                    if (svyTaskTemplateScriptVO.getScriptType().equals("1") && svyTaskTemplateScriptVO.getBranchFlag().equals("1")) {
                        //是单选,并且是有分支的
                        nextScriptNo = svyTaskTemplateTargetoption.getNextQuestion();
                    } else {
                        nextScriptNo = svyTaskTemplateScriptVO.getNextScriptno();
                    }
                }
            }
            serviceSubtaskDetailVO.setSvyTaskTemplateTargetoptions(svyTaskTemplateScriptVO.getSvyTaskTemplateTargetoptions());
        } else {
            //非单多选
            if (CollectionUtils.isNotEmpty(svyTaskTemplateScriptVO.getSvyTaskTemplateTargetoptions())) {
                ServiceSubtaskOptionAnswer serviceSubtaskOptionAnswer = new ServiceSubtaskOptionAnswer();
                serviceSubtaskOptionAnswer.setId(svyTaskTemplateScriptVO.getSvyTaskTemplateTargetoptions().get(0).getId());
                serviceSubtaskOptionAnswer.setCode(svyTaskTemplateScriptVO.getSvyTaskTemplateTargetoptions().get(0).getOptionCode());
                serviceSubtaskOptionAnswer.setValue(svyTaskTemplateScriptVO.getSvyTaskTemplateTargetoptions().get(0).getTargetvalue());
                serviceSubtaskOptionAnswer.setAppenddesc(svyTaskTemplateScriptVO.getSvyTaskTemplateTargetoptions().get(0).getAppenddesc());
                answerList.add(serviceSubtaskOptionAnswer);
                serviceSubtaskDetailVO.setAsrtext(svyTaskTemplateScriptVO.getScriptResult());
                nextScriptNo = svyTaskTemplateScriptVO.getNextScriptno();
            }
        }
        serviceSubtaskAnswer.setTaskid(Long.valueOf(taskid));
        serviceSubtaskAnswer.setPatId(Long.valueOf(patid));
        serviceSubtaskAnswer.setScriptid(svyTaskTemplateScriptVO.getId());
        serviceSubtaskAnswer.setScriptType(Long.valueOf(svyTaskTemplateScriptVO.getScriptType()));
        serviceSubtaskAnswer.setAnswer(JSON.toJSONString(answerList));
        serviceSubtaskAnswer.setComment(null);
        serviceSubtaskAnswer.setCreateTime(new Date());
        serviceSubtaskAnswer.setUpdateTime(new Date());
        serviceSubtaskAnswerMapper.insertServiceSubtaskAnswer(serviceSubtaskAnswer);
        serviceSubtaskDetailVO.setTaskid(Long.valueOf(taskid));
        serviceSubtaskDetailVO.setPatid(Long.valueOf(patid));
        serviceSubtaskDetailVO.setScriptid(svyTaskTemplateScriptVO.getId());
        serviceSubtaskDetailVO.setValueType(svyTaskTemplateScriptVO.getScriptType());
        serviceSubtaskDetailVO.setAsrtext(JSON.toJSONString(answerList));
        serviceSubtaskDetailVO.setComment(null);
        serviceSubtaskDetailVO.setCreateTime(new Date());
        serviceSubtaskDetailVO.setUpdateTime(new Date());
        ServiceSubtaskDetail serviceSubtaskDetail = DtoConversionUtils.sourceToTarget(serviceSubtaskDetailVO, ServiceSubtaskDetail.class);
        serviceSubtaskDetailMapper.insertServiceSubtaskDetail(serviceSubtaskDetail);
        return nextScriptNo;
    }
}
smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java
@@ -12,6 +12,8 @@
import com.smartor.config.PhoneUtils;
import com.smartor.domain.*;
import com.smartor.mapper.*;
import com.smartor.service.IIvrTaskTemplateScriptService;
import com.smartor.service.IIvrTaskTemplateService;
import com.smartor.service.IServiceSubtaskService;
import com.smartor.service.IServiceTaskService;
import lombok.extern.slf4j.Slf4j;
@@ -24,10 +26,15 @@
import org.springframework.transaction.annotation.Transactional;
import java.text.SimpleDateFormat;
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import static cn.hutool.poi.excel.sax.AttributeName.r;
import static cn.hutool.poi.excel.sax.AttributeName.s;
/**
 * å•一任务(随访)Service业务层处理
@@ -42,7 +49,7 @@
    private ServiceSubtaskMapper serviceSubtaskMapper;
    @Autowired
    private ServiceSubtaskDetailMapper ivrTaskcalldetailMapper;
    private ServiceSubtaskDetailMapper serviceSubtaskDetailMapper;
    @Autowired
    private IServiceTaskService serviceTaskService;
@@ -58,6 +65,11 @@
    @Autowired
    private IvrLibaExtemplatescriptMapper ivrLibaExtemplatescriptMapper;
    @Autowired
    private IIvrTaskTemplateService ivrTaskTemplateService;
    @Autowired
    private IIvrTaskTemplateScriptService iIvrTaskTemplateScriptService;
    @Value("${pri_key}")
    private String pri_key;
@@ -219,7 +231,8 @@
            if (ObjectUtils.isNotEmpty(serviceTaskVO.getSendTimeslot()))
                serviceTask.setSendTimeSlot(JSON.toJSONString(serviceTaskVO.getSendTimeslot()));
            if (serviceTask.getSendState() == null) serviceTask.setSendState(1);
            serviceTask.setTemplateid(serviceTaskVO.getLibtemplateid());
            serviceTask.setLibtemplateid(serviceTaskVO.getLibtemplateid().toString());
            serviceTask.setTemplateid(serviceTaskVO.getTemplateid());
            serviceTaskService.insertServiceTask(serviceTask);
            //将任务信息放到服务表中
@@ -233,11 +246,6 @@
                    serviceSubtask.setSendname(patTaskRelevance.getName());
                    serviceSubtask.setAge(patTaskRelevance.getAge());
                    serviceSubtask.setSfzh(patTaskRelevance.getSfzh());
                    serviceSubtask.setPhone(patTaskRelevance.getPhone());
                    serviceSubtask.setAddr(patTaskRelevance.getAddr());
                    serviceSubtask.setPatid(patTaskRelevance.getPatid());
                    serviceSubtask.setCreateTime(DateUtils.getNowDate());
                    serviceSubtask.setSendstate(1L);
                    serviceSubtask.setType(serviceTaskVO.getHospType());
                    serviceSubtask.setHospType(patTaskRelevance.getHospType());
                    serviceSubtask.setOpenid(patTaskRelevance.getOpenid());
@@ -255,15 +263,10 @@
            serviceTask.setStopState(serviceTask1.getStopState() + 1);
            serviceTask.setTemplateid(serviceTaskVO.getLibtemplateid());
            serviceTaskService.updateServiceTask(serviceTask);
            if (CollectionUtils.isNotEmpty(serviceTaskVO.getPatTaskRelevances())) {
                for (PatTaskRelevance patTaskRelevance : serviceTaskVO.getPatTaskRelevances()) {
                    ServiceSubtask serviceSubtask = DtoConversionUtils.sourceToTarget(serviceTaskVO, ServiceSubtask.class);
                    serviceSubtask.setSendname(patTaskRelevance.getName());
                    serviceSubtask.setAge(patTaskRelevance.getAge());
                    serviceSubtask.setSfzh(patTaskRelevance.getSfzh());
                    serviceSubtask.setPhone(patTaskRelevance.getPhone());
                    serviceSubtask.setAddr(patTaskRelevance.getAddr());
                    serviceSubtask.setPatid(patTaskRelevance.getPatid());
                    serviceSubtask.setOpenid(patTaskRelevance.getOpenid());
@@ -292,7 +295,6 @@
    @Override
    public void phoneCallBack(PhoneCallBackVO phoneCallBackVO) {
        phoneCallBackVO.setTextResult(phoneCallBackVO.getTextResult().substring(0, phoneCallBackVO.getTextResult().length() - 1));
        SimpleDateFormat simpleDateFormat1 = new SimpleDateFormat("YYYY-MM-dd HH:mm:ss");
@@ -335,15 +337,10 @@
            if (noVoice == ivrTaskTemplateVO.getNoVoiceNum().intValue()) {
                //已经问了对应的遍数,就判断是否还有下一题
                if (nowQuestion.getTargetid() == IvrTaskTemplateScriptVOs.size()) {
                    //没有下一题了,就挂断电话,播放结束语
                    redisCache.setCacheObject(phoneCallBackVO.getUuid() + "hangup", 1, 120, TimeUnit.MINUTES);
                    phoneUtils.ttsPlayback(ivrTaskTemplateVO.getRevisitAfter(), phoneCallBackVO.getUuid());
                    return;
                } else {
                    //有下一题
                    redisCache.setCacheObject(phoneCallBackVO.getUuid() + "noVoice", 0, 120, TimeUnit.MINUTES);
                    IvrTaskTemplateScriptVO nextQuestion = getNextQuestion(IvrTaskTemplateScriptVOs, nowQuestion);
                    // é—®é¢˜ï¼Œ  åŽ»è°ƒç”¨â€œtts合成和播放”接口
                    String date = simpleDateFormat1.format(new Date());
                    log.info("去调用tts合成和播放接口: {},uuid为:{}", date, phoneCallBackVO.getUuid());
                    phoneUtils.ttsPlayback(nowQuestion.getScriptContent(), phoneCallBackVO.getUuid());
@@ -376,60 +373,6 @@
                    Pattern pattern2 = Pattern.compile(nowQuestion.getIvrTaskScriptTargetoptionList().get(j).getTargetregex2());
                    matcher2 = pattern2.matcher(phoneCallBackVO.getTextResult());
                }
                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是单选题的改法
                    nowQuestion.getIvrTaskScriptTargetoptionList().get(j).setIsUserOperation(true);
                    serviceTaskScriptTargetoptionMapper.updateIvrTaskTemplateTargetoption(nowQuestion.getIvrTaskScriptTargetoptionList().get(j));
                    //将静默置为0
                    redisCache.setCacheObject(phoneCallBackVO.getUuid() + "noVoice", 0, 120, TimeUnit.MINUTES);
                    redisCache.setCacheObject(phoneCallBackVO.getUuid() + "mateNum", 0, 120, TimeUnit.MINUTES);
                    //将患者的回签写进表里
                    IvrTaskVisitResult serviceTaskVisitResult = DtoConversionUtils.sourceToTarget(serviceSubtask, IvrTaskVisitResult.class);
                    serviceTaskVisitResult.setId(null);
                    serviceTaskVisitResult.setQuestion(nowQuestion.getScriptContent());
                    serviceTaskVisitResult.setPatientAnswer(phoneCallBackVO.getTextResult());
                    serviceTaskVisitResult.setCreateTime(new Date());
                    serviceTaskVisitResult.setOptionResult(nowQuestion.getIvrTaskScriptTargetoptionList().get(j).getTargetvalue());
                    serviceTaskVisitResultMapper.insertIvrTaskVisitResult(serviceTaskVisitResult);
                    //将匹配到的标识改成true
                    isppd = true;
                    //获取下一题
                    Long nextQuestion = nowQuestion.getIvrTaskScriptTargetoptionList().get(j).getNextQuestion();
                    for (IvrTaskTemplateScriptVO script : IvrTaskTemplateScriptVOs) {
                        if (script.getTargetid() == nextQuestion) {
                            QuestionMessage questionMessage = new QuestionMessage();
                            questionMessage.setNowQuestion(script);
                            questionMessage.setQuestionList(IvrTaskTemplateScriptVOs);
                            redisCache.setCacheObject(phoneCallBackVO.getUuid() + "returnQues", questionMessage, 120, TimeUnit.MINUTES);
                            phoneUtils.ttsPlayback(script.getScriptContent(), phoneCallBackVO.getUuid());
                            return;
                        } else if (nextQuestion > IvrTaskTemplateScriptVOs.size()) {
                            //没有下一题了,就结束了
                            String date = simpleDateFormat1.format(new Date());
                            log.error("没有下一题了,就结束了: {},uuid为:{}", date, phoneCallBackVO.getUuid());
                            redisCache.setCacheObject(phoneCallBackVO.getUuid() + "hangup", 1, 120, TimeUnit.MINUTES);
                            phoneUtils.ttsPlayback(ivrTaskTemplateVO.getRevisitAfter(), phoneCallBackVO.getUuid());
                            try {
                                Thread.sleep(3000);
                            } catch (InterruptedException e) {
                                e.printStackTrace();
                            }
                            phoneUtils.hangup("", "", ivrTaskTemplateVO.getRevisitAfter(), "", "", "", "", phoneCallBackVO.getUuid());
                            return;
                        }
                    }
                    return;
                } else {
                    //没有匹配上当前option
                    //Targetregex2 ä¸ºfalse,表示在Targetregex2中存在  è¯­å¥ä¸­çš„关键字,这个option就不用再继续匹配了,直接匹配下一个option
                    continue;
                }
            }
            if (isppd != true) {
@@ -444,8 +387,6 @@
                        IvrTaskTemplateScriptVO nextQuestion = getNextQuestion(IvrTaskTemplateScriptVOs, nowQuestion);
                        questionMessage.setQuestionList(IvrTaskTemplateScriptVOs);
                        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.getScriptContent(), phoneCallBackVO.getUuid());
@@ -454,7 +395,6 @@
                        //就可以挂断电话了
                        String date = simpleDateFormat1.format(new Date());
                        log.info("就可以挂断电话了------: {},uuid为:{}", date, phoneCallBackVO.getUuid());
                        redisCache.setCacheObject(phoneCallBackVO.getUuid() + "hangup", 1, 120, TimeUnit.MINUTES);
                        phoneUtils.ttsPlayback(ivrTaskTemplateVO.getRevisitAfter(), phoneCallBackVO.getUuid());
                        try {
                            Thread.sleep(3000);
@@ -481,39 +421,16 @@
                }
                List<IvrLibaExtemplatescript> ivrLibaExtemplatescripts = ivrLibaExtemplatescriptMapper.queryIvrLibaExtemplatescriptList(list1);
                for (IvrLibaExtemplatescript ivrLibaExtemplatescript : ivrLibaExtemplatescripts) {
                    Matcher matcher = null;
                    if (StringUtils.isNotEmpty(ivrLibaExtemplatescript.getSelfRegex())) {
                        Pattern pattern = Pattern.compile(ivrLibaExtemplatescript.getSelfRegex());
                        matcher = pattern.matcher(returnQues.getContent());
                        pattern.matcher(returnQues.getContent());
                    }
                    Matcher matcher2 = null;
                    if (StringUtils.isNotEmpty(ivrLibaExtemplatescript.getSelfRegex2())) {
                        Pattern pattern2 = Pattern.compile(ivrLibaExtemplatescript.getSelfRegex2());
                        matcher2 = pattern2.matcher(returnQues.getContent());
                        pattern2.matcher(returnQues.getContent());
                    }
                    log.info("++++++++++++++++++++++++++通用库是否为空:selfRegex : {} , selfRegex2 : {}", ivrLibaExtemplatescript.getSelfRegex(), ivrLibaExtemplatescript.getSelfRegex2());
                    if (StringUtils.isNotEmpty(ivrLibaExtemplatescript.getSelfRegex()) && matcher.matches() && StringUtils.isNotEmpty(ivrLibaExtemplatescript.getSelfRegex2()) && matcher2.matches() || StringUtils.isEmpty(ivrLibaExtemplatescript.getSelfRegex()) && StringUtils.isNotEmpty(ivrLibaExtemplatescript.getSelfRegex2()) && matcher2.matches() || StringUtils.isEmpty(ivrLibaExtemplatescript.getSelfRegex2()) && StringUtils.isNotEmpty(ivrLibaExtemplatescript.getSelfRegex()) && matcher.matches()) {
                        QuestionMessage questionMessage = redisCache.getCacheObject(phoneCallBackVO.getUuid() + "returnQues");
                        IvrTaskTemplateScriptVO ivrTaskTemplateScriptVO = returnQues.getNowQuestion();
                        ivrTaskTemplateScriptVO.setSubmoduleText(ivrLibaExtemplatescript.getSwitchText());
                        ivrTaskTemplateScriptVO.setSubmoduleVoice(ivrLibaExtemplatescript.getSwitchWav());
                        redisCache.setCacheObject(phoneCallBackVO.getUuid() + "returnQues", questionMessage, 120, TimeUnit.MINUTES);
                        if (ivrLibaExtemplatescript.getIsEnd() == 1) {
                            //将问题置空
                            IvrTaskTemplateScriptVO nowQuestion1 = questionMessage.getNowQuestion();
                            nowQuestion1.setScriptContent(null);
                            nowQuestion1.setScriptVoice(null);
                            questionMessage.setNowQuestion(nowQuestion1);
                            redisCache.setCacheObject(phoneCallBackVO.getUuid() + "returnQues", questionMessage, 120, TimeUnit.MINUTES);
                            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.getScriptContent() + ivrTaskTemplateScriptVO.getSubmoduleText(), phoneCallBackVO.getUuid());
                    }
                    break;
                }
                String date = simpleDateFormat1.format(new Date());
@@ -523,261 +440,432 @@
        }
    }
    //下面的代码不能删除,上面的方法只是配合电话端联调用的,
//    @Override
//    public PhoneCallBackVO phoneCallBack(PhoneCallBackVO phoneCallBackVO) {
//        log.error("phoneCallBackVO的入参:{},{},{},{},{},{},{}", phoneCallBackVO.getResultType(), phoneCallBackVO.getUuid(), phoneCallBackVO.getErrResult(), phoneCallBackVO.getTextResult(), phoneCallBackVO.getHangUpResult(), phoneCallBackVO.getEnumState(), phoneCallBackVO.getUint8());
//        //获取数据
//        Boolean aBoolean = redisCache.hasKey(phoneCallBackVO.getUuid());
//        if (!aBoolean) {
//            throw new BaseException("该uuid不存在");
//        }
//        Integer hangupValue = redisCache.getCacheObject(phoneCallBackVO.getUuid() + "hangup");
//        if (hangupValue != null && hangupValue == 1) {
//            //hangupValue == 1  éšè®¿ç»“束,直接可以挂电话
//            PhoneUtils phoneUtils = new PhoneUtils();
//            phoneUtils.hangup(phoneCallBackVO.getUuid(), null, null, null, null, null, null, null);
    /**
     * ç”µè¯ASR通话回调(雨绮)
     *
     * @param phoneCallReqYQVO
     */
    @Override
    public PhoneCallBackYQVO phoneCallBackYQ(PhoneCallReqYQVO phoneCallReqYQVO) {
        PhoneCallBackYQVO phoneCallBackYQVO = new PhoneCallBackYQVO();
        //channel_create é€šé“创建的时候,可以执行一些其它操作,譬如发个短信之类的;  æˆ‘们的业务可以不用管    PlayEventCallback è¿™ä¸ªæ˜¯æ’­æ”¾è¯­éŸ³çš„,暂时用不到     End_time()= -1或null表示当前的asrtext不是一句完整的话
        if (phoneCallReqYQVO.getOperate().equals("channel_create") || phoneCallReqYQVO.getOperate().equals("PlayEventCallback") || phoneCallReqYQVO.getEnd_time() == null || phoneCallReqYQVO.getEnd_time() == -1) {
            return phoneCallBackYQVO;
        }
        //通过子任务ID获取到模板信息
        ServiceSubtask serviceSubtask = serviceSubtaskMapper.selectServiceSubtaskById(Long.valueOf(phoneCallReqYQVO.getTaskid()));
        IvrTaskTemplate ivrTaskTemplate = ivrTaskTemplateService.selectIvrTaskTemplateByID(serviceSubtask.getTemplateid());
        //获取模板问题
        IvrTaskTemplateScript ivrTaskTemplateScript = new IvrTaskTemplateScript();
        ivrTaskTemplateScript.setTemplateID(serviceSubtask.getTemplateid());
        List<IvrTaskTemplateScript> ivrTaskTemplateScripts = iIvrTaskTemplateScriptService.selectIvrTaskTemplateScriptList(ivrTaskTemplateScript);
        //获取问题ID å’Œ åºå·
        String scriptId = redisCache.getCacheObject(phoneCallReqYQVO.getTaskid().trim() + "-" + phoneCallReqYQVO.getPhone().trim());
        log.error("scriptId是多少:{}", scriptId);
        //当前题的信息
        IvrTaskTemplateScriptVO ivrTaskTemplateScriptVO = iIvrTaskTemplateScriptService.getTaskTempScriptInfoByid(Long.valueOf(scriptId));
        //判断UUID是否存在
        Boolean aBoolean = redisCache.hasKey(phoneCallReqYQVO.getUuid());
        if (!aBoolean) {
            //给静默设置一个默认次数在redis中
            redisCache.setCacheObject(phoneCallReqYQVO.getUuid() + "noVoice", 0, 120, TimeUnit.MINUTES);
        }
        if ("SilentCallback".equals(phoneCallReqYQVO.getOperate())) {
            //如果是静默回调
            Integer num = redisCache.getCacheObject(phoneCallReqYQVO.getUuid() + "noVoice");
            //判断静默回调次数是否小与模板规定的次数
            if (num < ivrTaskTemplate.getNoVoiceNum()) {
                //小与的话,就继续问患者
                phoneCallBackYQVO.setType("text");
                phoneCallBackYQVO.setSilent_interval(ivrTaskTemplate.getSilencetime().intValue());
                String scriptContent = ivrTaskTemplateScriptVO.getScriptContent();
                phoneCallBackYQVO.setValue(getObject(serviceSubtask, scriptContent));
                //将静默次数加1
                Integer noVoiceNum = redisCache.getCacheObject(phoneCallReqYQVO.getUuid() + "noVoice");
                redisCache.setCacheObject(phoneCallReqYQVO.getUuid() + "noVoice", noVoiceNum + 1, 120, TimeUnit.MINUTES);
            } else {
                log.error("静默次数达到,挂掉电话:{}", num);
                //大与等于的话,直接挂断
                phoneCallBackYQVO.setType("hangup");
                phoneCallBackYQVO.setSilent_interval(ivrTaskTemplate.getSilencetime().intValue());
                phoneCallBackYQVO.setValue(ivrTaskTemplate.getRevisitAfter());
                //将结果写到detail中
                ServiceSubTaskDetailReq serviceSubTaskDetailReq = new ServiceSubTaskDetailReq();
                List<ServiceSubtaskDetail> serviceSubtaskDetailList = new ArrayList<>();
                serviceSubtaskDetailList.add(getServiceSubtaskDetail(phoneCallReqYQVO, ivrTaskTemplateScriptVO, serviceSubtask, ivrTaskTemplate));
                serviceSubTaskDetailReq.setServiceSubtaskDetailList(serviceSubtaskDetailList);
                saveQuestionAnswerPhone(serviceSubTaskDetailReq);
                redisCache.deleteObject(serviceSubtask.getId() + "-" + serviceSubtask.getPhone());
            }
            return phoneCallBackYQVO;
        } else if ("AsrCallback".equals(phoneCallReqYQVO.getOperate())) {
            //如果是文本回调
            //根据问题ID获取该问题的类型
            if (ivrTaskTemplateScriptVO.getScriptType().equals("1")) {
                //是选择题
                for (int j = 0; j < ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().size(); j++) {
                    log.error("phoneCallReqYQVO.getAsrtext()的值为:{}", phoneCallReqYQVO.getAsrtext());
                    if (StringUtils.isEmpty(phoneCallReqYQVO.getAsrtext())) {
                        continue;
                    }
                    //包含
                    Matcher matcher = null;
                    if (StringUtils.isNotEmpty(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).getTargetregex())) {
                        Pattern pattern = Pattern.compile(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).getTargetregex());
                        matcher = pattern.matcher(phoneCallReqYQVO.getAsrtext());
                    }
                    //不包含
                    Matcher matcher2 = null;
                    if (StringUtils.isNotEmpty(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).getTargetregex2())) {
                        Pattern pattern2 = Pattern.compile(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).getTargetregex2());
                        matcher2 = pattern2.matcher(phoneCallReqYQVO.getAsrtext());
                    }
                    if (StringUtils.isNotEmpty(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).getTargetregex2()) && matcher2.matches() && StringUtils.isNotEmpty(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).getTargetregex()) && matcher.matches() || StringUtils.isEmpty(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).getTargetregex()) && StringUtils.isNotEmpty(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).getTargetregex2()) && matcher2.matches() || StringUtils.isEmpty(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).getTargetregex2()) && StringUtils.isNotEmpty(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).getTargetregex()) && matcher.matches()) {
                        //说明匹配正确了
                        //这里应该先判断类型,去再修改,设置IsUserOperation是单选题的改法
                        ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).setIsUserOperation(1);
                        serviceTaskScriptTargetoptionMapper.updateIvrTaskTemplateTargetoption(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j));
                        //将患者的回签写进service_subtask_detail中
                        ServiceSubTaskDetailReq serviceSubTaskDetailReq = new ServiceSubTaskDetailReq();
                        List<ServiceSubtaskDetail> serviceSubtaskDetailList = new ArrayList<>();
                        ivrTaskTemplateScriptVO.setQuestionResult(ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).getOptiondesc());
                        serviceSubtaskDetailList.add(getServiceSubtaskDetail(phoneCallReqYQVO, ivrTaskTemplateScriptVO, serviceSubtask, ivrTaskTemplate));
                        serviceSubTaskDetailReq.setServiceSubtaskDetailList(serviceSubtaskDetailList);
                        saveQuestionAnswerPhone(serviceSubTaskDetailReq);
//
//        }
//
//        Map<String, Object> map = redisCache.getCacheObject(phoneCallBackVO.getUuid());
////        ObjectMapper objectMapper = new ObjectMapper();
////        Map<String, Object> map = null;
////        try {
////            map = objectMapper.readValue(cacheObject, Map.class);
////        } catch (JsonProcessingException e) {
////            e.printStackTrace();
////        }
//
//        ServiceSubtask ServiceSubtask = (ServiceSubtask) map.get("ServiceSubtask");
//        List<IvrLibaTemplateScriptVO> ivrLibaTemplateScriptVOs = (List<IvrLibaTemplateScriptVO>) map.get("ivrLibaTemplateScriptVO");
//        //将uuid更新到数据库中
//        ServiceSubtask.setSenduuid(phoneCallBackVO.getUuid());
//        ServiceSubtaskMapper.updateServiceSubtask(ServiceSubtask);
//
//        //获取模板信息
//        IvrLibaTemplateVO ivrLibaTemplateVO = redisCache.getCacheObject(phoneCallBackVO.getUuid() + "ivrLibaTemplateVO");
//
//
//        //首先判断resultType
//        if (phoneCallBackVO.getResultType() == 1) {
//            //呼叫结果接口: 1
//            if (phoneCallBackVO.getUint8() == 1) {
//                //呼叫失败,去redis中记录一下失败次数,进行再次呼叫
//                Integer integer = redisCache.getCacheObject(phoneCallBackVO.getUuid() + "uint8");
//                if (integer != null) {
//                    redisCache.setCacheObject(phoneCallBackVO.getUuid() + "uint8", integer + 1, 120, TimeUnit.MINUTES);
//                } else {
//                    redisCache.setCacheObject(phoneCallBackVO.getUuid() + "uint8", 1, 120, TimeUnit.MINUTES);
//                }
//
//                if (integer != null && integer == ServiceSubtask.getRecallcount().intValue()) {
//                    log.info("无人接听:{},   {}", phoneCallBackVO.getErrResult(), phoneCallBackVO.getUuid());
//                    //连续打规定次,如果要没人接,那就结束
//                    ServiceSubtask.setResult(phoneCallBackVO.getErrResult());
//                    ServiceSubtaskMapper.updateServiceSubtask(ServiceSubtask);
//                    redisCache.deleteObject(phoneCallBackVO.getUuid() + "uint8");
//                } else if (integer != null && integer < ServiceSubtask.getRecallcount().intValue()) {
//                    //进行重拨
//                    PhoneUtils phoneUtils = new PhoneUtils();
//                    phoneUtils.ob(null, null, null, null, null, null, null, ServiceSubtask.getPhone(), phoneCallBackVO.getUuid(), true);
//                }
//            }
//
//        } else if (phoneCallBackVO.getResultType() == 2) {
//            //通话状态更新接口: 2
//            if (phoneCallBackVO.getEnumState() == 0) {
//                // 0-振铃
//                Integer integer = redisCache.getCacheObject(phoneCallBackVO.getUuid() + "enumState");
//
//                if (integer != null && integer < ServiceSubtask.getRecallcount().intValue()) {
//                    redisCache.setCacheObject(phoneCallBackVO.getUuid() + "enumState", integer + 1, 120, TimeUnit.MINUTES);
//                } else if (integer == null) {
//                    redisCache.setCacheObject(phoneCallBackVO.getUuid() + "enumState", 1, 120, TimeUnit.MINUTES);
//                } else if (integer != null && integer == ServiceSubtask.getRecallcount().intValue()) {
//                    ServiceSubtask.setResult("无人接听");
//                    ServiceSubtaskMapper.updateServiceSubtask(ServiceSubtask);
//                    redisCache.deleteObject(phoneCallBackVO.getUuid() + "enumState");
//                }
//            } else if (phoneCallBackVO.getEnumState() == 2) {
//                //患者挂断电话
//                log.info("患者挂断电话:{}", phoneCallBackVO.getUuid());
//                ServiceSubtask.setResult(phoneCallBackVO.getHangUpResult());
//                ServiceSubtaskMapper.updateServiceSubtask(ServiceSubtask);
//                redisCache.deleteObject(phoneCallBackVO.getUuid() + "enumState");
//            }
//
//
//        } else if (phoneCallBackVO.getResultType() == 3) {
//            //语音识别结果上报接口: 3
//            Integer noVoice = redisCache.getCacheObject(phoneCallBackVO.getUuid() + "noVoice");
//            QuestionMessage returnQues = redisCache.getCacheObject(phoneCallBackVO.getUuid() + "returnQues");
//            IvrLibaTemplateScriptVO nowQuestion = returnQues.getNowQuestion();
//            PhoneUtils phoneUtils = new PhoneUtils();
//
//            if (StringUtils.isEmpty(phoneCallBackVO.getTextResult())) {
//                //无回话
//                //判断noVoice是否已经到了最大值
//                if (noVoice == ivrLibaTemplateVO.getNoVoiceNum().intValue()) {
//                    //已经问了对应的遍数,就判断是否还有下一题
//                    if (nowQuestion.getTargetid() == ivrLibaTemplateScriptVOs.size()) {
//                        //没有下一题了,就挂断电话,播放结束语
//                        redisCache.setCacheObject(phoneCallBackVO.getUuid() + "hangup", 1, 120, TimeUnit.MINUTES);
//                        phoneUtils.ttsPlayback(ivrLibaTemplateVO.getRevisitAfter(), phoneCallBackVO.getUuid());
//                    } else {
//                        //有下一题
//                        redisCache.setCacheObject(phoneCallBackVO.getUuid() + "noVoice", 0, 120, TimeUnit.MINUTES);
//                        IvrLibaTemplateScriptVO nextQuestion = getNextQuestion(ivrLibaTemplateScriptVOs, nowQuestion);
//                        // é—®é¢˜ï¼Œ  åŽ»è°ƒç”¨â€œtts合成和播放”接口
//                        phoneUtils.ttsPlayback(nowQuestion.getQuestionText(), phoneCallBackVO.getUuid());
//                    }
//                } else {
//                    redisCache.setCacheObject(phoneCallBackVO.getUuid() + "noVoice", noVoice + 1, 120, TimeUnit.MINUTES);
//                    //调用ivrLibaTemplateScriptVO中的slienceText(静默话术)
//                    String slienceText = nowQuestion.getSlienceText();
//                    //静默话术  + é—®é¢˜ï¼Œ  åŽ»è°ƒç”¨â€œtts合成和播放”接口
//                    phoneUtils.ttsPlayback(slienceText + nowQuestion.getQuestionText(), phoneCallBackVO.getUuid());
//                    return new PhoneCallBackVO();
//                }
//
//            } else {
//                //有回话,对回答的问题,进行正则匹配(这里只针对选择题,其它题型不行)
//                for (int j = 0; j < nowQuestion.getIvrLibaScriptTargetoptionList().size(); j++) {
//                    //包含
//                    Matcher matcher = null;
//                    if (StringUtils.isNotEmpty(nowQuestion.getIvrLibaScriptTargetoptionList().get(j).getTargetregex())) {
//                        Pattern pattern = Pattern.compile(nowQuestion.getIvrLibaScriptTargetoptionList().get(j).getTargetregex());
//                        matcher = pattern.matcher(phoneCallBackVO.getTextResult());
//                    }
//                    //不包含
//                    Matcher matcher2 = null;
//                    if (StringUtils.isNotEmpty(nowQuestion.getIvrLibaScriptTargetoptionList().get(j).getTargetregex2())) {
//                        Pattern pattern2 = Pattern.compile(nowQuestion.getIvrLibaScriptTargetoptionList().get(j).getTargetregex2());
//                        matcher2 = pattern2.matcher(phoneCallBackVO.getTextResult());
//                    }
//                    log.info("phoneCallBack--Targetregex的值为:{}, phoneCallBack--Targetregex2的值为:{}", nowQuestion.getIvrLibaScriptTargetoptionList().get(j).getTargetregex(), nowQuestion.getIvrLibaScriptTargetoptionList().get(j).getTargetregex2());
//                    if (StringUtils.isNotEmpty(nowQuestion.getIvrLibaScriptTargetoptionList().get(j).getTargetregex()) && matcher.matches() && StringUtils.isNotEmpty(nowQuestion.getIvrLibaScriptTargetoptionList().get(j).getTargetregex2()) && matcher2.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);
//                        ivrLibaScriptTargetoptionMapper.updateIvrLibaTemplateTargetoption(nowQuestion.getIvrLibaScriptTargetoptionList().get(j));
//
//
//                        //将静默置为0
//                        redisCache.setCacheObject(phoneCallBackVO.getUuid() + "noVoice", 0, 120, TimeUnit.MINUTES);
//                        redisCache.setCacheObject(phoneCallBackVO.getUuid() + "mateNum", 0, 120, TimeUnit.MINUTES);
//                        //获取下一题
//                        Integer nextQuestion = nowQuestion.getIvrLibaScriptTargetoptionList().get(j).getNextQuestion();
//                        for (IvrLibaTemplateScriptVO script : ivrLibaTemplateScriptVOs) {
//                            if (script.getTargetid() == nextQuestion) {
//                                QuestionMessage questionMessage = new QuestionMessage();
//                                questionMessage.setNowQuestion(script);
//                                questionMessage.setQuestionList(ivrLibaTemplateScriptVOs);
//                                redisCache.setCacheObject(phoneCallBackVO.getUuid() + "returnQues", questionMessage, 120, TimeUnit.MINUTES);
//                                break;
//                            }
//                        }
//                        break;
//                    } else {
//                        //没有匹配到
//                        Integer mateNum = redisCache.getCacheObject(phoneCallBackVO.getUuid() + "mateNum");
//                        //无匹配次数去判断是否到最大询问次数,并且所有的选项都匹配完了
//                        if (mateNum == ivrLibaTemplateVO.getMateNum().intValue() && j == nowQuestion.getIvrLibaScriptTargetoptionList().size() - 1) {
//                            //如果下一题为空.则新的数据返回,并加上感谢语
//                            if (nowQuestion.getTargetid() < ivrLibaTemplateScriptVOs.size()) {
//                                QuestionMessage questionMessage = new QuestionMessage();
//                                IvrLibaTemplateScriptVO nextQuestion = getNextQuestion(ivrLibaTemplateScriptVOs, nowQuestion);
//                                questionMessage.setQuestionList(ivrLibaTemplateScriptVOs);
//                                questionMessage.setNowQuestion(nextQuestion);
//                                redisCache.setCacheObject(phoneCallBackVO.getUuid() + "returnQues", questionMessage, 120, TimeUnit.MINUTES);
//                                redisCache.setCacheObject(phoneCallBackVO.getUuid() + "mateNum", 0, 120, TimeUnit.MINUTES);
//                            } else {
//                                //就可以挂断电话了
//                                redisCache.setCacheObject(phoneCallBackVO.getUuid() + "hangup", 1, 120, TimeUnit.MINUTES);
//                                phoneUtils.ttsPlayback(ivrLibaTemplateVO.getRevisitAfter(), phoneCallBackVO.getUuid());
//                                break;
//                            }
//                        } else if (mateNum < ivrLibaTemplateVO.getMateNum().intValue() && j == nowQuestion.getIvrLibaScriptTargetoptionList().size() - 1) {
//                            //没有问到规定次数
//                            mateNum = mateNum + 1;
//                            redisCache.setCacheObject(phoneCallBackVO.getUuid() + "mateNum", mateNum, 120, TimeUnit.MINUTES);
//                        }
//                    }
//
//                }
//                //选项匹配完成后,需要再去通过库再进行匹配一次
//                String extemplateID = ivrLibaTemplateVO.getSubmoduleID();
//                String[] split = extemplateID.split(",");
//                List<String> list = Arrays.asList(split);
//                List<Long> list1 = new ArrayList<>();
//                if (StringUtils.isNotEmpty(extemplateID)) {
//                    for (String str : list) {
//                        list1.add(Long.valueOf(str));
//                    }
//                    List<IvrLibaExtemplatescript> ivrLibaExtemplatescripts = ivrLibaExtemplatescriptMapper.queryIvrLibaExtemplatescriptList(list1);
//                    for (IvrLibaExtemplatescript ivrLibaExtemplatescript : ivrLibaExtemplatescripts) {
//                        Matcher matcher = null;
//                        if (StringUtils.isNotEmpty(ivrLibaExtemplatescript.getSelfRegex())) {
//                            Pattern pattern = Pattern.compile(ivrLibaExtemplatescript.getSelfRegex());
//                            matcher = pattern.matcher(returnQues.getContent());
//                        }
//
//                        Matcher matcher2 = null;
//                        if (StringUtils.isNotEmpty(ivrLibaExtemplatescript.getSelfRegex2())) {
//                            Pattern pattern2 = Pattern.compile(ivrLibaExtemplatescript.getSelfRegex2());
//                            matcher2 = pattern2.matcher(returnQues.getContent());
//                        }
//                        log.info("++++++++++++++++++++++++++通用库是否为空:selfRegex : {} , selfRegex2 : {}", ivrLibaExtemplatescript.getSelfRegex(), ivrLibaExtemplatescript.getSelfRegex2());
//                        if (StringUtils.isNotEmpty(ivrLibaExtemplatescript.getSelfRegex()) && matcher.matches() && StringUtils.isNotEmpty(ivrLibaExtemplatescript.getSelfRegex2()) && matcher2.matches() || StringUtils.isEmpty(ivrLibaExtemplatescript.getSelfRegex()) && StringUtils.isNotEmpty(ivrLibaExtemplatescript.getSelfRegex2()) && matcher2.matches() || StringUtils.isEmpty(ivrLibaExtemplatescript.getSelfRegex2()) && StringUtils.isNotEmpty(ivrLibaExtemplatescript.getSelfRegex()) && matcher.matches()) {
//                            QuestionMessage questionMessage = redisCache.getCacheObject(phoneCallBackVO.getUuid() + "returnQues");
//                            IvrLibaTemplateScriptVO ivrLibaTemplateScriptVO = returnQues.getNowQuestion();
//                            ivrLibaTemplateScriptVO.setSubmoduleText(ivrLibaExtemplatescript.getSwitchText());
//                            ivrLibaTemplateScriptVO.setSubmoduleVoice(ivrLibaExtemplatescript.getSwitchWav());
//                            redisCache.setCacheObject(phoneCallBackVO.getUuid() + "returnQues", questionMessage, 120, TimeUnit.MINUTES);
//                            if (ivrLibaExtemplatescript.getIsEnd() == 1) {
//                                //将问题置空
//                                IvrLibaTemplateScriptVO nowQuestion1 = questionMessage.getNowQuestion();
//                                nowQuestion1.setQuestionText(null);
//                                nowQuestion1.setQuestionVoice(null);
//                                questionMessage.setNowQuestion(nowQuestion1);
//                                redisCache.setCacheObject(phoneCallBackVO.getUuid() + "returnQues", questionMessage, 120, TimeUnit.MINUTES);
//
//                                redisCache.setCacheObject(phoneCallBackVO.getUuid() + "isOver", 1, 120, TimeUnit.MINUTES);
//                            }
//
//                            //调用“15、tts合成和播放, tts_playback”将结果传回
//
//
//                        }
//                        break;
//                    }
//                }
//
//            }
//        }
//        return phoneCallBackVO;
//    }
                        if (ivrTaskTemplateScriptVO.getBranchFlag().equals("1") || ivrTaskTemplateScriptVO.getBranchFlag().equals("0") && ivrTaskTemplateScriptVO.getNextScriptno() != 0) {
                            Long nextQuestion = null;
                            if (ivrTaskTemplateScriptVO.getBranchFlag().equals("1")) {
                                nextQuestion = ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList().get(j).getNextQuestion();
                            } else {
                                nextQuestion = ivrTaskTemplateScriptVO.getNextScriptno();
                            }
                            for (IvrTaskTemplateScript script : ivrTaskTemplateScripts) {
                                if (script.getSort() == nextQuestion.intValue()) {
                                    phoneCallBackYQVO.setType("text");
                                    phoneCallBackYQVO.setSilent_interval(ivrTaskTemplate.getSilencetime().intValue());
                                    String scriptContent = script.getScriptContent();
                                    phoneCallBackYQVO.setValue(getObject(serviceSubtask, scriptContent));
                                    //将该患者的Redis中的题目ID,进行修改
                                    redisCache.setCacheObject(phoneCallReqYQVO.getTaskid().trim() + "-" + phoneCallReqYQVO.getPhone().trim(), script.getId().toString(), 120, TimeUnit.MINUTES);
                                    //删除无响应
                                    redisCache.deleteObject(phoneCallReqYQVO.getTaskid().trim() + "&&" + "mate" + "&&" + phoneCallReqYQVO.getUuid());
                                }
                            }
                        } else if (ivrTaskTemplateScriptVO.getBranchFlag().equals("0")) {
                            if (ivrTaskTemplateScriptVO.getNextScriptno() == 0 || ivrTaskTemplateScriptVO.getNextScriptno() == null) {
                                phoneCallBackYQVO.setType("hangup");
                                phoneCallBackYQVO.setSilent_interval(ivrTaskTemplate.getSilencetime().intValue());
                                //设置结束语
                                phoneCallBackYQVO.setValue(ivrTaskTemplate.getRevisitAfter());
                                Long id = serviceSubtask.getId();
                                Map<String, String> map = delRedisValue(null, id.toString());
                                redisCache.setCacheObject(map.get("cacheName"), map.get("val"));
                                redisCache.deleteObject(serviceSubtask.getId() + "-" + serviceSubtask.getPhone());
                                redisCache.deleteObject(phoneCallReqYQVO.getTaskid().trim() + "&&" + "mate" + "&&" + phoneCallReqYQVO.getUuid());
//                                return phoneCallBackYQVO;
                            }
                        }
                    } else {
                        continue;
                    }
                }
                //都没有匹配到
                if (StringUtils.isEmpty(phoneCallBackYQVO.getValue())) {
                    Integer count = redisCache.getCacheObject(phoneCallReqYQVO.getTaskid().trim() + "&&" + "mate" + "&&" + phoneCallReqYQVO.getUuid());
                    if (count != null && count >= ivrTaskTemplate.getMateNum()) {
                        //如果count已经大于或等于没有匹配次数
                        if (ivrTaskTemplateScriptVO.getBranchFlag().equals("0") && ivrTaskTemplateScriptVO.getNextScriptno() == null || ivrTaskTemplateScriptVO.getBranchFlag().equals("0") && ivrTaskTemplateScriptVO.getNextScriptno() == 0 || ivrTaskTemplateScriptVO.getBranchFlag().equals("1") && ivrTaskTemplateScriptVO.getNextScriptno() == null || ivrTaskTemplateScriptVO.getBranchFlag().equals("1") && ivrTaskTemplateScriptVO.getNextScriptno() == 0) {
                            //如果是最后一道题,或者没有下一题了,就直接挂机
                            phoneCallBackYQVO.setType("hangup");
                            phoneCallBackYQVO.setSilent_interval(ivrTaskTemplate.getSilencetime().intValue());
                            if (StringUtils.isNotEmpty(phoneCallBackYQVO.getValue()))
                                phoneCallBackYQVO.setValue(phoneCallBackYQVO.getValue() + ivrTaskTemplate.getRevisitAfter());
                            else phoneCallBackYQVO.setValue(ivrTaskTemplate.getRevisitAfter());
                            //去redis中,把该子任务ID删除
                            Long id = serviceSubtask.getId();
                            Map<String, String> map = delRedisValue(null, id.toString());
                            redisCache.setCacheObject(map.get("cacheName"), map.get("val"));
                            redisCache.deleteObject(serviceSubtask.getId() + "-" + serviceSubtask.getPhone());
//                            return phoneCallBackYQVO;
                        } else {
                            //根据ivrTaskTemplateScriptVO.getNextScriptno()获取下一题进行提问
                            for (IvrTaskTemplateScript script : ivrTaskTemplateScripts) {
                                if (script.getSort() == ivrTaskTemplateScriptVO.getNextScriptno().intValue()) {
                                    phoneCallBackYQVO.setType("text");
                                    phoneCallBackYQVO.setSilent_interval(ivrTaskTemplate.getSilencetime().intValue());
                                    String scriptContent = script.getScriptContent();
                                    phoneCallBackYQVO.setValue(getObject(serviceSubtask, scriptContent));
                                    //将该患者的Redis中的题目ID,进行修改
                                    redisCache.setCacheObject(phoneCallReqYQVO.getTaskid().trim() + "-" + phoneCallReqYQVO.getPhone().trim(), script.getId().toString(), 120, TimeUnit.MINUTES);
                                }
                            }
                        }
                    } else {
                        if (count == null)
                            redisCache.setCacheObject(phoneCallReqYQVO.getTaskid().trim() + "&&" + "mate" + "&&" + phoneCallReqYQVO.getUuid(), 1, 120, TimeUnit.MINUTES);
                        else
                            redisCache.setCacheObject(phoneCallReqYQVO.getTaskid().trim() + "&&" + "mate" + "&&" + phoneCallReqYQVO.getUuid(), count + 1, 120, TimeUnit.MINUTES);
                        phoneCallBackYQVO.setType("text");
                        phoneCallBackYQVO.setValue(ivrTaskTemplateScriptVO.getNoMatchText() + getObject(serviceSubtask, ivrTaskTemplateScriptVO.getScriptContent()));
                    }
                }
            } else {
                //不是选择题,直接记录答案,将结果写到detail中
                ServiceSubTaskDetailReq serviceSubTaskDetailReq = new ServiceSubTaskDetailReq();
                List<ServiceSubtaskDetail> serviceSubtaskDetailList = new ArrayList<>();
                serviceSubtaskDetailList.add(getServiceSubtaskDetail(phoneCallReqYQVO, ivrTaskTemplateScriptVO, serviceSubtask, ivrTaskTemplate));
                serviceSubTaskDetailReq.setServiceSubtaskDetailList(serviceSubtaskDetailList);
                saveQuestionAnswerPhone(serviceSubTaskDetailReq);
                //如果选项分支为1的话,则需要根据问题上的nextScriptno进行跳转
                //问答题没有跳转
                if (ivrTaskTemplateScriptVO.getNextScriptno() != null || ivrTaskTemplateScriptVO.getNextScriptno() != 0) {
                    for (IvrTaskTemplateScript ivrTaskTemplateScript1 : ivrTaskTemplateScripts) {
                        if (ivrTaskTemplateScriptVO.getNextScriptno().intValue() == ivrTaskTemplateScript1.getSort()) {
                            phoneCallBackYQVO.setType("text");
                            phoneCallBackYQVO.setSilent_interval(ivrTaskTemplate.getSilencetime().intValue());
                            String scriptContent = ivrTaskTemplateScript1.getScriptContent();
                            phoneCallBackYQVO.setValue(getObject(serviceSubtask, scriptContent));
                            redisCache.deleteObject(phoneCallReqYQVO.getTaskid().trim() + "&&" + "mate" + "&&" + phoneCallReqYQVO.getUuid());
                        }
                    }
                } else if (ivrTaskTemplateScriptVO.getNextScriptno() == null) {
                    //没有下一题了,就结束了
                    phoneCallBackYQVO.setType("hangup");
                    phoneCallBackYQVO.setSilent_interval(ivrTaskTemplate.getSilencetime().intValue());
                    phoneCallBackYQVO.setValue(ivrTaskTemplate.getRevisitAfter());
                    //去redis中,把该子任务ID删除
                    Long id = serviceSubtask.getId();
                    redisCache.deleteObject(serviceSubtask.getId() + "-" + serviceSubtask.getPhone());
                    log.error("电话挂断4");
                }
                //选项匹配完成后,需要再去通过库再进行匹配一次
                String extemplateID = ivrTaskTemplate.getSubmoduleID();
                String[] split = extemplateID.split(",");
                List<String> list = Arrays.asList(split);
                List<Long> list1 = new ArrayList<>();
                if (StringUtils.isNotEmpty(extemplateID)) {
                    for (String str : list) {
                        list1.add(Long.valueOf(str));
                    }
                    List<IvrLibaExtemplatescript> ivrLibaExtemplatescripts = ivrLibaExtemplatescriptMapper.queryIvrLibaExtemplatescriptList(list1);
                    for (IvrLibaExtemplatescript ivrLibaExtemplatescript : ivrLibaExtemplatescripts) {
                        Matcher matcher = null;
                        if (StringUtils.isNotEmpty(ivrLibaExtemplatescript.getSelfRegex())) {
                            Pattern pattern = Pattern.compile(ivrLibaExtemplatescript.getSelfRegex());
                            matcher = pattern.matcher(phoneCallReqYQVO.getAsrtext());
                        }
                        Matcher matcher2 = null;
                        if (StringUtils.isNotEmpty(ivrLibaExtemplatescript.getSelfRegex2())) {
                            Pattern pattern2 = Pattern.compile(ivrLibaExtemplatescript.getSelfRegex2());
                            matcher2 = pattern2.matcher(phoneCallReqYQVO.getAsrtext());
                        }
                        if (StringUtils.isNotEmpty(ivrLibaExtemplatescript.getSelfRegex()) && matcher.matches() && StringUtils.isNotEmpty(ivrLibaExtemplatescript.getSelfRegex2()) && matcher2.matches() || StringUtils.isEmpty(ivrLibaExtemplatescript.getSelfRegex()) && StringUtils.isNotEmpty(ivrLibaExtemplatescript.getSelfRegex2()) && matcher2.matches() || StringUtils.isEmpty(ivrLibaExtemplatescript.getSelfRegex2()) && StringUtils.isNotEmpty(ivrLibaExtemplatescript.getSelfRegex()) && matcher.matches()) {
                            //将通用库匹配的,放到返回值中
                            phoneCallBackYQVO.setValue(phoneCallBackYQVO.getValue() + ivrLibaExtemplatescript.getSwitchText());
                        }
                        break;
                    }
                }
            }
        }
        return phoneCallBackYQVO;
    }
    private String getObject(ServiceSubtask serviceSubtask, String scriptContent) {
        Map<String, Map<String, String>> param = getParam(serviceSubtask.getTaskid());
        for (Map<String, String> map : param.values()) {
            for (String key : map.keySet()) {
                scriptContent = scriptContent.replace(key, StringUtils.isNotEmpty(map.get(key)) ? map.get(key) : "");
            }
        }
        scriptContent.replace("${name}", StringUtils.isNotEmpty(serviceSubtask.getName()) ? serviceSubtask.getName() : "");
        scriptContent.replace("${dzz}", StringUtils.isNotEmpty(serviceSubtask.getPlaceOfResidence()) ? serviceSubtask.getPlaceOfResidence() : "");
        scriptContent.replace("${phone}", StringUtils.isNotEmpty(serviceSubtask.getTelcode()) ? serviceSubtask.getTelcode() : "");
        return scriptContent;
    }
    /**
     * èŽ·å–ä»»åŠ¡é‡Œçš„é€šé…ç¬¦
     *
     * @param taskId
     * @return
     */
    private Map<String, Map<String, String>> getParam(Long taskId) {
        ServiceTask serviceTask = serviceTaskService.selectServiceTaskByTaskid(taskId);
        ObjectMapper objectMapper = new ObjectMapper();
        Map<String, Map<String, String>> serviceTaskMap = null;
        try {
            serviceTaskMap = objectMapper.readValue(serviceTask.getTextParam(), Map.class);
        } catch (JsonProcessingException e) {
            e.printStackTrace();
        }
        return serviceTaskMap;
    }
    private Map<String, String> delRedisValue(String cache, String id) {
        id = "," + id + ",";
        String val = "";
        String cacheName = "";
        Map<String, String> map = new HashMap<>();
        if (StringUtils.isNotEmpty(cache)) {
            val = redisCache.getCacheObject(cache);
            if (!StringUtils.isEmpty(val)) {
                if (val.contains(id)) {
                    val = val.replaceAll(id, "");
                }
            }
            map.put("val", val);
            map.put("cacheName", cache);
            return map;
        }
        for (int i = 0; i < 6; i++) {
            val = redisCache.getCacheObject("cache-0" + i);
            if (!StringUtils.isEmpty(val)) {
                if (val.contains(id)) {
                    val = val.replaceAll(id, "");
                    map.put("val", val);
                    map.put("cacheName", "cache-0" + i);
                }
            }
        }
        return map;
    }
    /**
     * é›¨ç»®ä»»åŠ¡æ‹‰å–
     *
     * @return
     */
    @Override
    public List<PullTaskVO> taskPull() {
        //pullTaskVOList用于数据返回
        List<PullTaskVO> pullTaskVOList = new ArrayList<>();
        String value0 = redisCache.getCacheObject("cache-0");
        //  cache-0为立即发起的,其它的先推迟
        if (!StringUtils.isEmpty(value0)) {
            pullTaskVOList = getPullTaskList(value0, "cache-0");
            //将cache-0的数据,转移不对劲cache-00中
            String cache00 = redisCache.getCacheObject("cache-0");
            if (!StringUtils.isEmpty(cache00)) redisCache.setCacheObject("cache-0", cache00 + "," + value0);
            else redisCache.setCacheObject("cache-0", value0);
            redisCache.deleteObject("cache-0");
        } else {
            for (int i = 1; i < 6; i++) {
                //取出从cache-1 åˆ° cache-5的第一个子任务信息
                String value = redisCache.getCacheObject("cache-" + i);
                if (StringUtils.isEmpty(value)) continue;
                List<PullTaskVO> pullTaskVOList2 = getPullTaskList(value, "cache-" + i);
                if (CollectionUtils.isNotEmpty(pullTaskVOList2) && pullTaskVOList2.size() > 0) {
                    pullTaskVOList.addAll(pullTaskVOList2);
                }
                redisCache.deleteObject("cache-" + i);
            }
        }
        return pullTaskVOList;
    }
    private List<PullTaskVO> getPullTaskList(String subIds, String cacheName) {
        //pullTaskVOList用于数据返回
        List<PullTaskVO> pullTaskVOList = new ArrayList<>();
        //newValue0用于保存没有处理的子 ä»»åŠ¡
        String newValue0 = "";
        //根据,获取子任务的ID
        String[] split = subIds.split(",,");
        for (int i = 0; i < split.length; i++) {
            if (cacheName.equals("cache-0") && i < 5 || !cacheName.equals("cache-0") && i < 1) {
                PullTaskVO pullTaskVO = new PullTaskVO();
                String subId = split[i].trim().replace(",", "");
                ServiceSubtask serviceSubtask = serviceSubtaskMapper.selectServiceSubtaskById(Long.valueOf(subId));
                IvrTaskTemplate ivrTaskTemplate = ivrTaskTemplateService.selectIvrTaskTemplateByID(serviceSubtask.getTemplateid());
                //通过任务模板中的"第一次问题编号"获取第一个问题;
                IvrTaskTemplateScript ivrTaskTemplateScript = null;
                IvrTaskTemplateScript ivrTaskTemplateScript1 = new IvrTaskTemplateScript();
                ivrTaskTemplateScript1.setTemplateID(ivrTaskTemplate.getId());
                List<IvrTaskTemplateScript> ivrTaskTemplateScripts = iIvrTaskTemplateScriptService.selectIvrTaskTemplateScriptList(ivrTaskTemplateScript1);
                aa:
                for (IvrTaskTemplateScript ivrTaskTemplateScript2 : ivrTaskTemplateScripts) {
                    if (ivrTaskTemplate.getFirstQuestionNum() == Long.valueOf(ivrTaskTemplateScript2.getSort())) {
                        ivrTaskTemplateScript = ivrTaskTemplateScript2;
                        break aa;
                    }
                }
                //如果ivrTaskTemplateScript为空,也就没有往下执行的必要了
                if (ObjectUtils.isEmpty(ivrTaskTemplateScript)) return null;
                //获取通配符匹配过后的问题
                String scrContent = getObject(serviceSubtask, ivrTaskTemplateScript.getScriptContent());
                String kcb = ivrTaskTemplate.getRevisitBefore() + "," + scrContent;
                //封装返回数据
                //taskId = å­ä»»åŠ¡ID + é—®é¢˜ID +问题序号
                pullTaskVO.setTaskid(subId);
                pullTaskVO.setAppkey("ZurNHpaQLq6P55YS");
                pullTaskVO.setSections(LocalTime.now().format(DateTimeFormatter.ofPattern("hh:mm")) + "-" + LocalTime.now().plusMinutes(1).format(DateTimeFormatter.ofPattern("hh:mm")));
                pullTaskVO.setPhones(serviceSubtask.getPhone());
                pullTaskVO.setPrologue(kcb);
                pullTaskVO.setDisplayNo("85129866");
                pullTaskVOList.add(pullTaskVO);
                redisCache.setCacheObject(subId.trim() + "-" + serviceSubtask.getPhone().trim(), ivrTaskTemplateScript.getId().toString());
            } else {
                if (StringUtils.isEmpty(newValue0)) {
                    newValue0 = "," + split[i].trim() + ",";
                } else {
                    newValue0 = newValue0 + "," + split[i].trim() + ",";
                }
                redisCache.setCacheObject(cacheName, newValue0);
            }
        }
        return pullTaskVOList;
    }
    @Override
    public Integer saveQuestionAnswerPhone(ServiceSubTaskDetailReq serviceSubTaskDetailReq) {
        RSAPublicKeyExample rsaPublicKeyExample = new RSAPublicKeyExample();
        Long tid = Long.valueOf(rsaPublicKeyExample.decryptedData(serviceSubTaskDetailReq.getParam1(), pri_key));
        Long pid = Long.valueOf(rsaPublicKeyExample.decryptedData(serviceSubTaskDetailReq.getParam2(), pri_key));
        ServiceSubtask ivrTaskSingle = new ServiceSubtask();
        ivrTaskSingle.setTaskid(tid);
        ivrTaskSingle.setPatid(pid);
        List<ServiceSubtask> selectServiceSubtaskList = serviceSubtaskMapper.selectServiceSubtaskList(ivrTaskSingle);
        if (CollectionUtils.isEmpty(selectServiceSubtaskList) || selectServiceSubtaskList.size() == 0) {
            log.error("报错了,selectServiceSubtaskList数据为空了:{}", ivrTaskSingle);
            return 0;
        }
        int i = 0;
        //随访
        for (ServiceSubtaskDetail serviceSubtaskDetail : serviceSubTaskDetailReq.getServiceSubtaskDetailList()) {
            serviceSubtaskDetail.setSubId(selectServiceSubtaskList.get(0).getId());
            serviceSubtaskDetail.setId(UUID.randomUUID().toString());
            serviceSubtaskDetail.setCreateTime(new Date());
            i = ivrTaskcalldetailMapper.insertServiceSubtaskDetail(serviceSubtaskDetail);
        if (StringUtils.isNotEmpty(serviceSubTaskDetailReq.getParam1())) {
            RSAPublicKeyExample rsaPublicKeyExample = new RSAPublicKeyExample();
            Long tid = Long.valueOf(rsaPublicKeyExample.decryptedData(serviceSubTaskDetailReq.getParam1(), pri_key));
            Long pid = Long.valueOf(rsaPublicKeyExample.decryptedData(serviceSubTaskDetailReq.getParam2(), pri_key));
            ServiceSubtask ivrTaskSingle = new ServiceSubtask();
            ivrTaskSingle.setTaskid(tid);
            ivrTaskSingle.setPatid(pid);
            List<ServiceSubtask> selectServiceSubtaskList = serviceSubtaskMapper.selectServiceSubtaskList(ivrTaskSingle);
            if (CollectionUtils.isEmpty(selectServiceSubtaskList) || selectServiceSubtaskList.size() == 0) {
                log.error("报错了,selectServiceSubtaskList数据为空了:{}", ivrTaskSingle);
                return 0;
            }
            //随访
            for (ServiceSubtaskDetail serviceSubtaskDetail : serviceSubTaskDetailReq.getServiceSubtaskDetailList()) {
                serviceSubtaskDetail.setSubId(selectServiceSubtaskList.get(0).getId());
                serviceSubtaskDetail.setId(UUID.randomUUID().toString());
                serviceSubtaskDetail.setCreateTime(new Date());
                i = serviceSubtaskDetailMapper.insertServiceSubtaskDetail(serviceSubtaskDetail);
            }
        } else {
            for (ServiceSubtaskDetail serviceSubtaskDetail : serviceSubTaskDetailReq.getServiceSubtaskDetailList()) {
                serviceSubtaskDetail.setCreateTime(new Date());
                i = serviceSubtaskDetailMapper.insertServiceSubtaskDetail(serviceSubtaskDetail);
            }
        }
        return i;
    }
@@ -793,4 +881,43 @@
        return null;
    }
    private ServiceSubtaskDetail getServiceSubtaskDetail(PhoneCallReqYQVO phoneCallReqYQVO, IvrTaskTemplateScriptVO ivrTaskTemplateScriptVO, ServiceSubtask serviceSubtask, IvrTaskTemplate ivrTaskTemplate) {
        ServiceSubtaskDetail serviceSubtaskDetail = new ServiceSubtaskDetail();
        serviceSubtaskDetail.setSubId(Long.valueOf(phoneCallReqYQVO.getTaskid()));
        serviceSubtaskDetail.setUuid(phoneCallReqYQVO.getUuid());
        serviceSubtaskDetail.setPhone(phoneCallReqYQVO.getPhone());
        serviceSubtaskDetail.setOperate(serviceSubtask.getCreateBy());
        serviceSubtaskDetail.setDisplayno(phoneCallReqYQVO.getPhone());
        serviceSubtaskDetail.setAssigntime(System.currentTimeMillis());
        serviceSubtaskDetail.setStarttime(System.currentTimeMillis());
        serviceSubtaskDetail.setAnswertime(System.currentTimeMillis());
        serviceSubtaskDetail.setAsrtext("无应答");
        if (StringUtils.isNotEmpty(phoneCallReqYQVO.getAsrtext()))
            serviceSubtaskDetail.setAsrtext(phoneCallReqYQVO.getAsrtext());
        serviceSubtaskDetail.setBeginTime(System.currentTimeMillis());
        serviceSubtaskDetail.setEndTime(System.currentTimeMillis());
        serviceSubtaskDetail.setSentEnd(1L);
        serviceSubtaskDetail.setTemplateid(ivrTaskTemplate.getId().toString());
        serviceSubtaskDetail.setTemplatequestionnum(ivrTaskTemplateScriptVO.getId());
        serviceSubtaskDetail.setQuestiontext(ivrTaskTemplateScriptVO.getScriptContent());
        serviceSubtaskDetail.setCategoryname(ivrTaskTemplateScriptVO.getScriptType());
        serviceSubtaskDetail.setTargetoptions(ivrTaskTemplateScriptVO.getTargetOptions());
        int i = 1;
        for (IvrTaskTemplateTargetoption ivrTaskTemplateTargetoption : ivrTaskTemplateScriptVO.getIvrTaskScriptTargetoptionList()) {
            if (ivrTaskTemplateTargetoption.getIsUserOperation() == 1) {
                serviceSubtaskDetail.setMatchedtext(ivrTaskTemplateTargetoption.getTargetvalue());
            }
            serviceSubtaskDetail.setTargetvalue(StringUtils.isEmpty(serviceSubtaskDetail.getTargetvalue()) ? i + ivrTaskTemplateTargetoption.getTargetvalue() : serviceSubtaskDetail.getTargetvalue() + "  " + (i + 1) + ivrTaskTemplateTargetoption.getTargetvalue());
        }
        serviceSubtaskDetail.setAddtime(new Date());
        serviceSubtaskDetail.setIsupload(0L);
        serviceSubtaskDetail.setUploadTime(new Date());
        serviceSubtaskDetail.setDelFlag("0");
        serviceSubtaskDetail.setValueType(ivrTaskTemplateScriptVO.getScriptType());
        return serviceSubtaskDetail;
    }
}
smartor/src/main/java/com/smartor/service/impl/ServiceTaskServiceImpl.java
@@ -172,7 +172,7 @@
    public List sfInfo(ServiceTask serviceTask, Long patid) {
        //通过模板ID获取问题信息
        IvrLibaTemplateScript ivrLibaTemplateScript = new IvrLibaTemplateScript();
        ivrLibaTemplateScript.setTemplateid(serviceTask.getTemplateid());
        ivrLibaTemplateScript.setTemplateid(Long.valueOf(serviceTask.getLibtemplateid()));
        ivrLibaTemplateScript.setDelFlag("0");
        List<IvrLibaTemplateScript> ivrLibaTemplateScripts = ivrLibaTemplateScriptMapper.selectIvrLibaTemplateScriptList(ivrLibaTemplateScript);
        if (CollectionUtils.isEmpty(ivrLibaTemplateScripts) || ivrLibaTemplateScripts.size() == 0) {
smartor/src/main/java/com/smartor/service/impl/SmsParamServiceImpl.java
@@ -1,96 +1,114 @@
package com.smartor.service.impl;
import java.util.List;
import WebServiceClient.MessagingInsertLocator;
import WebServiceClient.MessagingInsertSoap12Stub;
import com.ruoyi.common.utils.DateUtils;
import com.smartor.domain.SmsParam;
import com.smartor.mapper.SmsParamMapper;
import com.smartor.service.ISmsParamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.smartor.mapper.SmsParamMapper;
import com.smartor.domain.SmsParam;
import com.smartor.service.ISmsParamService;
import javax.xml.rpc.holders.IntHolder;
import java.rmi.RemoteException;
import java.util.Date;
import java.util.List;
/**
 * çŸ­ä¿¡å‚æ•°Service业务层处理
 *
 *
 * @author smartor
 * @date 2023-03-06
 */
@Service
public class SmsParamServiceImpl implements ISmsParamService
{
public class SmsParamServiceImpl implements ISmsParamService {
    @Autowired
    private SmsParamMapper smsParamMapper;
    /**
     * æŸ¥è¯¢çŸ­ä¿¡å‚æ•°
     *
     *
     * @param paramid çŸ­ä¿¡å‚数主键
     * @return çŸ­ä¿¡å‚æ•°
     */
    @Override
    public SmsParam selectSmsParamByParamid(Long paramid)
    {
    public SmsParam selectSmsParamByParamid(Long paramid) {
        return smsParamMapper.selectSmsParamByParamid(paramid);
    }
    /**
     * æŸ¥è¯¢çŸ­ä¿¡å‚数列表
     *
     *
     * @param smsParam çŸ­ä¿¡å‚æ•°
     * @return çŸ­ä¿¡å‚æ•°
     */
    @Override
    public List<SmsParam> selectSmsParamList(SmsParam smsParam)
    {
    public List<SmsParam> selectSmsParamList(SmsParam smsParam) {
        return smsParamMapper.selectSmsParamList(smsParam);
    }
    /**
     * æ–°å¢žçŸ­ä¿¡å‚æ•°
     *
     *
     * @param smsParam çŸ­ä¿¡å‚æ•°
     * @return ç»“æžœ
     */
    @Override
    public int insertSmsParam(SmsParam smsParam)
    {
    public int insertSmsParam(SmsParam smsParam) {
        smsParam.setCreateTime(DateUtils.getNowDate());
        return smsParamMapper.insertSmsParam(smsParam);
    }
    /**
     * ä¿®æ”¹çŸ­ä¿¡å‚æ•°
     *
     *
     * @param smsParam çŸ­ä¿¡å‚æ•°
     * @return ç»“æžœ
     */
    @Override
    public int updateSmsParam(SmsParam smsParam)
    {
    public int updateSmsParam(SmsParam smsParam) {
        smsParam.setUpdateTime(DateUtils.getNowDate());
        return smsParamMapper.updateSmsParam(smsParam);
    }
    /**
     * æ‰¹é‡åˆ é™¤çŸ­ä¿¡å‚æ•°
     *
     *
     * @param paramids éœ€è¦åˆ é™¤çš„短信参数主键
     * @return ç»“æžœ
     */
    @Override
    public int deleteSmsParamByParamids(Long[] paramids)
    {
    public int deleteSmsParamByParamids(Long[] paramids) {
        return smsParamMapper.deleteSmsParamByParamids(paramids);
    }
    /**
     * åˆ é™¤çŸ­ä¿¡å‚数信息
     *
     *
     * @param paramid çŸ­ä¿¡å‚数主键
     * @return ç»“æžœ
     */
    @Override
    public int deleteSmsParamByParamid(Long paramid)
    {
    public int deleteSmsParamByParamid(Long paramid) {
        return smsParamMapper.deleteSmsParamByParamid(paramid);
    }
    @Override
    public int sendSmsInfo(String info, String phone) {
        MessagingInsertSoap12Stub binding = null;
        try {
            binding = (MessagingInsertSoap12Stub) new MessagingInsertLocator().getMessagingInsertSoap12();
        } catch (Exception e) {
            e.printStackTrace();
        }
        String aa = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" + "<Request>\n" + "<operate>S001</operate>\n" + "<Sheets>\n" + "<Sheet>\n" + "<Content>" + info + "</Content>\n" + "<Mobile>" + phone + "</Mobile>\n" + "<DateTime>" + new Date() + "</DateTime>\n" + "<Type>预约挂号</Type>\n" + "</Sheet>\n" + "</Sheets>\n" + "</Request>";
        Integer integer = null;
        try {
            integer = binding.SMSMessageAccept(aa, new IntHolder(), new javax.xml.rpc.holders.StringHolder());
        } catch (RemoteException e) {
            e.printStackTrace();
        }
        return integer;
    }
}
smartor/src/main/java/com/smartor/service/impl/SvyLibTemplateServiceImpl.java
@@ -14,9 +14,7 @@
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.*;
import java.util.stream.Collectors;
/**
@@ -127,6 +125,13 @@
                    //再将整理好的“疾病名称”替换
                    libTemplates.get(i).setIcdname(icdname);
                }
                //将问题按序号排一下序
                Collections.sort(svyLibTemplateVOS.get(j).getSvyTemplateLibScripts(), new Comparator<SvyLibTemplateScript>() {
                    @Override
                    public int compare(SvyLibTemplateScript o1, SvyLibTemplateScript o2) {
                        return Integer.compare(o1.getSort().intValue(), o2.getSort().intValue());
                    }
                });
            }
        }
smartor/src/main/resources/mapper/smartor/IvrLibaScriptMapper.xml
@@ -145,7 +145,7 @@
            <if test="tag != null">tag,</if>
            <if test="isAvailable != null">isAvailable,</if>
            <if test="reply != null">reply,</if>
            <if test="scriptContent != null">script_topic,</if>
            <if test="scriptContent != null">script_content,</if>
            <if test="scriptDesc != null">script_desc,</if>
            <if test="scriptVoice != null">script_voice,</if>
            <if test="noMatchText != null">nomatchtext,</if>
smartor/src/main/resources/mapper/smartor/IvrLibaTemplateMapper.xml
@@ -41,12 +41,16 @@
        <result property="revisitAfter" column="revisit_after"/>
        <result property="noVoiceNum" column="no_voice_num"/>
        <result property="silencetime" column="silencetime"/>
        <result property="sendDay" column="send_day"/>
        <result property="longTemp" column="long_temp"/>
    </resultMap>
    <sql id="selectIvrLibaTemplateVo">
        select id,
               revisit_before,
               revisit_after,
               send_day,
               long_temp,
               templateName,
               firstQuestionNum,
               version,
@@ -71,6 +75,8 @@
                '%')
            </if>
            <if test="id != null ">and id = #{id}</if>
            <if test="sendDay != null ">and send_day = #{sendDay}</if>
            <if test="longTemp != null ">and long_temp = #{longTemp}</if>
            <if test="revisitAfter != null ">and revisit_after = #{revisitAfter}</if>
            <if test="revisitBefore != null ">and revisit_before = #{revisitBefore}</if>
            <if test="mateNum != null and mateNum > 0">and mate_num = #{mateNum}</if>
@@ -150,6 +156,8 @@
            <if test="revisitBefore != null ">revisit_before,</if>
            <if test="noVoiceNum != null and noVoiceNum > 0 ">no_voice_num,</if>
            <if test="silencetime != null  ">silencetime,</if>
            <if test="sendDay != null ">send_day,</if>
            <if test="longTemp != null ">long_temp,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="templateName != null and templateName != ''">#{templateName},</if>
@@ -187,7 +195,8 @@
            <if test="revisitBefore != null ">#{revisitBefore},</if>
            <if test="noVoiceNum != null and noVoiceNum > 0">#{noVoiceNum},</if>
            <if test="silencetime != null ">#{silencetime},</if>
            <if test="sendDay != null ">#{sendDay},</if>
            <if test="longTemp != null ">#{longTemp},</if>
        </trim>
    </insert>
@@ -229,7 +238,9 @@
            <if test="revisitAfter != null ">revisit_after = #{revisitAfter},</if>
            <if test="revisitBefore != null ">revisit_before = #{revisitBefore},</if>
            <if test="noVoiceNum != null and noVoiceNum > 0 ">no_voice_num = #{noVoiceNum},</if>
            <if test="silencetime != null">silencetime = #{silencetime}</if>
            <if test="silencetime != null">silencetime = #{silencetime},</if>
            <if test="sendDay != null ">send_day = #{sendDay},</if>
            <if test="longTemp != null ">long_temp = #{longTemp},</if>
        </trim>
        where id = #{id}
    </update>
smartor/src/main/resources/mapper/smartor/IvrTaskTemplateMapper.xml
@@ -60,11 +60,14 @@
        <result property="libtemplatename" column="libtemplatename"/>
        <result property="recallcount" column="recallcount"/>
        <result property="instruction" column="instruction"/>
        <result property="sendDay" column="send_day"/>
    </resultMap>
    <sql id="selectIvrTaskTemplateVo">
        select id,
               taskid,
               send_day,
               recallcount,
               instruction,
               libtemplateid,
@@ -86,6 +89,7 @@
        <include refid="selectIvrTaskTemplateVo"/>
        <where>
            <if test="taskid != null ">and taskid = #{taskid}</if>
            <if test="sendDay != null ">and send_day = #{sendDay}</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>
@@ -205,6 +209,7 @@
            <if test="libtemplateid != null ">libtemplateid,</if>
            <if test="libtemplatename != null ">libtemplatename,</if>
            <if test="instruction != null ">instruction,</if>
            <if test="sendDay != null ">send_day,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="taskid != null">#{taskid},</if>
@@ -261,6 +266,7 @@
            <if test="libtemplateid != null ">#{libtemplateid},</if>
            <if test="libtemplatename != null ">#{libtemplatename},</if>
            <if test="instruction != null ">#{instruction},</if>
            <if test="sendDay != null ">#{sendDay},</if>
        </trim>
    </insert>
@@ -321,6 +327,7 @@
            <if test="libtemplateid != null ">libtemplateid = #{libtemplateid},</if>
            <if test="libtemplatename != null ">libtemplatename = #{libtemplatename},</if>
            <if test="instruction != null ">instruction = #{instruction},</if>
            <if test="sendDay != null ">send_day = #{sendDay},</if>
        </trim>
        where id = #{id}
    </update>
smartor/src/main/resources/mapper/smartor/IvrTaskTemplateScriptMapper.xml
@@ -40,17 +40,23 @@
        <result property="questionResult" column="question_result"/>
        <result property="branchFlag" column="branch_flag"/>
        <result property="branchNextscriptno" column="branch_nextscriptno"/>
        <result property="nextScriptno" column="next_scriptno"/>
        <result property="scriptType" column="script_type"/>
        <result property="scriptContent" column="script_content"/>
        <result property="sort" column="sort"/>
    </resultMap>
    <sql id="selectIvrTaskTemplateScriptVo">
        select id,
               taskid,
               sort,
               script_type,
               branch_flag,
               branch_nextscriptno,
               next_scriptno,
               templateID,
               questionPoint,
               script_content,
               noMatchText,
               noMatchVoice,
               slienceText,
@@ -69,6 +75,7 @@
        <include refid="selectIvrTaskTemplateScriptVo"/>
        <where>
            <if test="taskid != null ">and taskid = #{taskid}</if>
            <if test="sort != null ">and sort = #{sort}</if>
            <if test="templateID != null ">and templateID = #{templateID}</if>
            <if test="questionPoint != null  and questionPoint != ''">and questionPoint = #{questionPoint}</if>
            <if test="noMatchText != null  and noMatchText != ''">and noMatchText = #{noMatchText}</if>
@@ -99,6 +106,8 @@
            <if test="questionResult != null  and questionResult != ''">and question_result = #{questionResult}</if>
            <if test="branchFlag != null  and branchFlag != ''">and branch_flag = #{branchFlag}</if>
            <if test="scriptType != null  and scriptType != ''">and script_type = #{scriptType}</if>
            <if test="scriptContent != null  and scriptContent != ''">and script_content = #{scriptContent}</if>
            <if test="nextScriptno != null  and nextScriptno != ''">and next_scriptno = #{nextScriptno}</if>
            <if test="branchNextscriptno != null  and branchNextscriptno != ''">and branch_nextscriptno =
                #{branchNextscriptno}
            </if>
@@ -149,6 +158,9 @@
            <if test="branchFlag != null  and branchFlag != ''">branch_flag,</if>
            <if test="branchNextscriptno != null  and branchNextscriptno != ''">branch_nextscriptno,</if>
            <if test="scriptType != null  and scriptType != ''">script_type,</if>
            <if test="scriptContent != null  and scriptContent != ''">script_content,</if>
            <if test="sort != null ">sort,</if>
            <if test="nextScriptno != null  and nextScriptno != ''">next_scriptno,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="taskid != null">#{taskid},</if>
@@ -186,6 +198,9 @@
            <if test="branchFlag != null  and branchFlag != ''">#{branchFlag},</if>
            <if test="branchNextscriptno != null  and branchNextscriptno != ''">#{branchNextscriptno},</if>
            <if test="scriptType != null  and scriptType != ''">#{scriptType},</if>
            <if test="scriptContent != null  and scriptContent != ''">#{scriptContent},</if>
            <if test="sort != null">#{sort},</if>
            <if test="nextScriptno != null  and nextScriptno != ''">#{nextScriptno},</if>
        </trim>
    </insert>
@@ -229,6 +244,9 @@
                #{branchNextscriptno},
            </if>
            <if test="scriptType != null  and scriptType != ''">script_type = #{scriptType},</if>
            <if test="scriptContent != null  and scriptContent != ''">script_content = #{scriptContent},</if>
            <if test="sort != null">sort = #{sort},</if>
            <if test="nextScriptno != null  and nextScriptno != ''">next_scriptno = #{nextScriptno},</if>
        </trim>
        where id = #{id}
    </update>
smartor/src/main/resources/mapper/smartor/IvrTaskTemplateTargetoptionMapper.xml
@@ -38,12 +38,14 @@
        <result property="nextQuestion" column="next_question"/>
        <result property="appenddesc" column="appenddesc"/>
        <result property="optionCode" column="option_code"/>
        <result property="isUserOperation" column="is_user_operation"/>
    </resultMap>
    <sql id="selectIvrTaskTemplateTargetoptionVo">
        select id,
               taskid,
               templateID,
               is_user_operation,
               appenddesc,
               targetid,
               option_code,
@@ -92,6 +94,7 @@
            <if test="nextQuestion != null ">and next_question = #{nextQuestion}</if>
            <if test="appenddesc != null ">and appenddesc = #{appenddesc}</if>
            <if test="optionCode != null ">and option_code = #{optionCode}</if>
            <if test="isUserOperation != null ">and is_user_operation = #{isUserOperation}</if>
        </where>
    </select>
@@ -137,6 +140,7 @@
            <if test="nextQuestion != null">next_question,</if>
            <if test="appenddesc != null">appenddesc,</if>
            <if test="optionCode != null ">option_code,</if>
            <if test="isUserOperation != null ">is_user_operation,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="taskid != null">#{taskid},</if>
@@ -171,6 +175,7 @@
            <if test="nextQuestion != null">#{nextQuestion},</if>
            <if test="appenddesc != null">#{appenddesc},</if>
            <if test="optionCode != null ">#{optionCode},</if>
            <if test="isUserOperation != null ">#{isUserOperation},</if>
        </trim>
    </insert>
@@ -209,6 +214,8 @@
            <if test="nextQuestion != null">next_question = #{nextQuestion},</if>
            <if test="appenddesc != null">appenddesc = #{appenddesc},</if>
            <if test="optionCode != null ">option_code = #{optionCode},</if>
            <if test="isUserOperation != null ">is_user_operation = #{isUserOperation},</if>
        </trim>
        where id = #{id}
    </update>
smartor/src/main/resources/mapper/smartor/PatArchiveMapper.xml
@@ -81,6 +81,7 @@
            <if test="isupload != null ">and isupload = #{isupload}</if>
            <if test="uploadTime != null ">and upload_time = #{uploadTime}</if>
            <if test="viptype != null ">and viptype = #{viptype}</if>
            <if test="pattype != null ">and pattype = #{pattype}</if>
        </where>
    </select>
@@ -271,6 +272,7 @@
            </if>
        </where>
        order by a.update_time desc
    </select>
@@ -359,6 +361,7 @@
                AND NOT exists ( SELECT 1 FROM pat_filterlist f where d.patid=f.patid)
            </if>
        </where>
        order by a.update_time desc
    </select>
    <select id="selectPatArchiveInfoByOuthosp" parameterType="com.smartor.domain.PatArchiveReq"
@@ -431,6 +434,7 @@
                AND NOT exists ( SELECT 1 FROM pat_filterlist f where d.patid=f.patid)
            </if>
        </where>
        order by a.update_time desc
    </select>
    <select id="selectPatArchiveInfoByPhysical" parameterType="com.smartor.domain.PatArchiveReq"
@@ -504,7 +508,7 @@
                AND NOT exists ( SELECT 1 FROM pat_filterlist f where d.patid=f.patid)
            </if>
        </where>
        order by a.update_time desc
    </select>
</mapper>
smartor/src/main/resources/mapper/smartor/PatMedInhospMapper.xml
@@ -46,10 +46,12 @@
        <result property="schemetime"    column="schemetime"    />
        <result property="patname"    column="patname"    />
        <result property="patno"    column="patno"    />
        <result property="inhospstate"    column="inhospstate"    />
        <result property="checkFlag"    column="check_flag"    />
    </resultMap>
    <sql id="selectPatMedInhospVo">
        select inhospid,inhospno, serialnum, hospitalname, hospitalcode, hospitaldistrictcode, hospitaldistrictname, icd10code, diagname, starttime, endtime, deptcode, deptname, roomno, bed_no, orgid, del_flag, update_by, update_time, create_by, create_time, isupload, upload_time, patid, leavediagname, leaveicd10code, drcode, drname, schemestatus, generalschemestatus, leaveldeptcode, leaveldeptname, hospitaldistrictid, leavehospitaldistrictcode, leavehospitaldistrictname, leavehospitaldistrictid, deptid, leaveldeptid, schemetime from pat_med_inhosp
        select inhospid,patname,check_flag,inhospstate,patno,inhospno, serialnum, hospitalname, hospitalcode, hospitaldistrictcode, hospitaldistrictname, icd10code, diagname, starttime, endtime, deptcode, deptname, roomno, bed_no, orgid, del_flag, update_by, update_time, create_by, create_time, isupload, upload_time, patid, leavediagname, leaveicd10code, drcode, drname, schemestatus, generalschemestatus, leaveldeptcode, leaveldeptname, hospitaldistrictid, leavehospitaldistrictcode, leavehospitaldistrictname, leavehospitaldistrictid, deptid, leaveldeptid, schemetime from pat_med_inhosp
    </sql>
    <select id="selectPatMedInhospList" parameterType="com.smartor.domain.PatMedInhosp" resultMap="PatMedInhospResult">
@@ -60,11 +62,15 @@
            <if test="hospitaldistrictname != null  and hospitaldistrictname != ''"> and hospitaldistrictname like concat('%', #{hospitaldistrictname}, '%')</if>
            <if test="endtime != null "> and endtime = #{endtime}</if>
            <if test="patno != null "> and patno = #{patno}</if>
            <if test="checkFlag != null "> and check_flag = #{checkFlag}</if>
            <if test="inhospstate != null "> and inhospstate = #{inhospstate}</if>
            <if test="schemestatus != null "> and schemestatus = #{schemestatus}</if>
            <if test="leavediagname != null  and leavediagname != ''"> and leavediagname like concat('%', #{leavediagname}, '%')</if>
            <if test="drname != null  and drname != ''"> and drname like concat('%', #{drname}, '%')</if>
            <if test="leaveldeptname != null  and leaveldeptname != ''"> and leaveldeptname like concat('%', #{leaveldeptname}, '%')</if>
            <if test="leavehospitaldistrictname != null  and leavehospitaldistrictname != ''"> and leavehospitaldistrictname like concat('%', #{leavehospitaldistrictname}, '%')</if>
        </where>
        order by update_time desc
    </select>
    <select id="selectPatMedInhospByInhospid" parameterType="Long" resultMap="PatMedInhospResult">
@@ -114,6 +120,8 @@
            <if test="schemetime != null">schemetime,</if>
            <if test="patname!= null">patname,</if>
            <if test="patno != null">patno,</if>
            <if test="inhospstate != null">inhospstate,</if>
            <if test="checkFlag != null">check_flag,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="serialnum != null">#{serialnum},</if>
@@ -155,6 +163,8 @@
            <if test="schemetime != null">#{schemetime},</if>
            <if test="patname!= null">#{patname},</if>
            <if test="patno != null">#{patno},</if>
            <if test="inhospstate != null">#{inhospstate},</if>
            <if test="checkFlag != null">#{checkFlag},</if>
         </trim>
    </insert>
@@ -200,6 +210,8 @@
            <if test="schemetime != null">schemetime = #{schemetime},</if>
            <if test="patname!= null">patname = #{patname},</if>
            <if test="patno != null">patno = #{patno},</if>
            <if test="inhospstate != null">inhospstate = #{inhospstate},</if>
            <if test="checkFlag != null">check_flag = #{checkFlag},</if>
        </trim>
        where inhospid = #{inhospid}
    </update>
smartor/src/main/resources/mapper/smartor/PatMedInspectionMapper.xml
@@ -99,6 +99,7 @@
            <if test="deptname != null  and deptname != ''">and deptname like concat('%', #{deptname}, '%')</if>
            <if test="deptid != null ">and deptid = #{deptid}</if>
        </where>
        order by update_time desc
    </select>
    <select id="selectPatMedInspectionById" parameterType="Long" resultMap="PatMedInspectionResult">
@@ -215,4 +216,4 @@
            #{id}
        </foreach>
    </delete>
</mapper>
</mapper>
smartor/src/main/resources/mapper/smartor/PatMedRegistrationMapper.xml
@@ -84,6 +84,7 @@
            <if test="pid != null ">and pid = #{pid}</if>
            <if test="guid != null  and guid != ''">and guid = #{guid}</if>
        </where>
        order by create_time desc
    </select>
    <select id="selectPatMedRegistrationByRegistid" parameterType="Long" resultMap="PatMedRegistrationResult">
smartor/src/main/resources/mapper/smartor/ServiceSubtaskDetailMapper.xml
@@ -7,6 +7,7 @@
    <resultMap type="com.smartor.domain.ServiceSubtaskDetail" id="ServiceSubtaskDetailResult">
        <result property="id" column="id"/>
        <result property="subId" column="sub_id"/>
        <result property="taskid" column="taskid"/>
        <result property="uuid" column="uuid"/>
        <result property="phone" column="phone"/>
        <result property="operate" column="operate"/>
@@ -46,11 +47,20 @@
        <result property="updateTime" column="update_time"/>
        <result property="createBy" column="create_by"/>
        <result property="valueType" column="value_type"/>
        <result property="scriptid" column="scriptid"/>
        <result property="answerps" column="answerps"/>
        <result property="comment" column="comment"/>
        <result property="patid" column="patid"/>
    </resultMap>
    <sql id="selectServiceSubtaskDetailVo">
        select id,
               sub_id,
               answerps,
               scriptid,
               comment,
               patid,
               taskid,
               uuid,
               phone,
               operate,
@@ -90,7 +100,7 @@
               update_time,
               value_type,
               create_by
        from ivr_taskcalldetail
        from service_subtask_detail
    </sql>
    <select id="selectServiceSubtaskDetailList" parameterType="com.smartor.domain.ServiceSubtaskDetail"
@@ -98,6 +108,7 @@
        <include refid="selectServiceSubtaskDetailVo"/>
        <where>
            <if test="subId != null">and sub_id = #{subId}</if>
            <if test="taskid != null">and taskid = #{taskid}</if>
            <if test="uuid != null  and uuid != ''">and uuid = #{uuid}</if>
            <if test="phone != null  and phone != ''">and phone = #{phone}</if>
            <if test="operate != null  and operate != ''">and operate = #{operate}</if>
@@ -134,6 +145,10 @@
            <if test="uploadTime != null ">and upload_time = #{uploadTime}</if>
            <if test="orgid != null  and orgid != ''">and orgid = #{orgid}</if>
            <if test="valueType != null  and valueType != ''">and value_type = #{valueType}</if>
            <if test="answerps != null  and answerps != ''">and answerps = #{answerps}</if>
            <if test="comment != null  and comment != ''">and comment = #{comment}</if>
            <if test="scriptid != null ">and scriptid = #{scriptid}</if>
            <if test=" patid != null">and patid = #{patid}</if>
        </where>
    </select>
@@ -143,10 +158,11 @@
    </select>
    <insert id="insertServiceSubtaskDetail" parameterType="com.smartor.domain.ServiceSubtaskDetail">
        insert into ivr_taskcalldetail
        insert into service_subtask_detail
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">id,</if>
            <if test="subId != null">sub_id,</if>
            <if test="taskid != null">taskid,</if>
            <if test="uuid != null">uuid,</if>
            <if test="phone != null">phone,</if>
            <if test="operate != null">operate,</if>
@@ -186,10 +202,15 @@
            <if test="updateTime != null">update_time,</if>
            <if test="createBy != null">create_by,</if>
            <if test="valueType != null">value_type,</if>
            <if test="answerps != null  and answerps != ''">answerps,</if>
            <if test="comment != null  and comment != ''">comment,</if>
            <if test="scriptid != null ">scriptid,</if>
            <if test=" patid != null">patid,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id},</if>
            <if test="subId != null">#{subId},</if>
            <if test="taskid != null">#{taskid},</if>
            <if test="uuid != null">#{uuid},</if>
            <if test="phone != null">#{phone},</if>
            <if test="operate != null">#{operate},</if>
@@ -229,13 +250,18 @@
            <if test="updateTime != null">#{updateTime},</if>
            <if test="createBy != null">#{createBy},</if>
            <if test="valueType != null">#{valueType},</if>
            <if test="answerps != null  and answerps != ''">#{answerps},</if>
            <if test="comment != null  and comment != ''">#{comment},</if>
            <if test="scriptid != null ">#{scriptid},</if>
            <if test=" patid != null">#{patid},</if>
        </trim>
    </insert>
    <update id="updateServiceSubtaskDetail" parameterType="com.smartor.domain.ServiceSubtaskDetail">
        update ivr_taskcalldetail
        update service_subtask_detail
        <trim prefix="SET" suffixOverrides=",">
            <if test="subId != null">sub_id = #{subId},</if>
            <if test="taskid != null">taskid = #{taskid},</if>
            <if test="uuid != null">uuid = #{uuid},</if>
            <if test="phone != null">phone = #{phone},</if>
            <if test="operate != null">operate = #{operate},</if>
@@ -275,18 +301,22 @@
            <if test="updateTime != null">update_time = #{updateTime},</if>
            <if test="createBy != null">create_by = #{createBy},</if>
            <if test="valueType != null">value_type = #{valueType},</if>
            <if test="answerps != null  and answerps != ''">answerps = #{answerps},</if>
            <if test="comment != null  and comment != ''">comment = #{comment},</if>
            <if test="scriptid != null ">scriptid = #{scriptid},</if>
            <if test=" patid != null">patid = #{patid},</if>
        </trim>
        where id = #{id}
    </update>
    <delete id="deleteServiceSubtaskDetailByCalldetailid" parameterType="String">
        delete
        from ivr_taskcalldetail
        from service_subtask_detail
        where id = #{id}
    </delete>
    <delete id="deleteServiceSubtaskDetailByCalldetailids" parameterType="String">
        delete from ivr_taskcalldetail where id in
        delete from service_subtask_detail where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
@@ -55,11 +55,13 @@
        <result property="libtemplatename" column="libtemplatename"/>
        <result property="libtemplateid" column="libtemplateid"/>
        <result property="openid" column="openid"/>
        <result property="longSendTime" column="long_send_time"/>
    </resultMap>
    <sql id="selectServiceSubtaskVo">
        select id,
               hosp_type,
               long_send_time,
               openid,
               libtemplateid,
               libtemplatename,
@@ -112,7 +114,8 @@
        from service_subtask
    </sql>
    <select id="selectServiceSubtaskList" parameterType="com.smartor.domain.ServiceSubtask" resultMap="ServiceSubtaskResult">
    <select id="selectServiceSubtaskList" parameterType="com.smartor.domain.ServiceSubtask"
            resultMap="ServiceSubtaskResult">
        <include refid="selectServiceSubtaskVo"/>
        <where>
            del_flag=0
@@ -152,9 +155,11 @@
            <if test="operatorNo != null  and operatorNo != ''">and operator_no = #{operatorNo}</if>
            <if test="wechat != null  and wechat != ''">and wechat = #{wechat}</if>
            <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>
            <if test="libtemplateid != null ">and libtemplateid = #{libtemplateid}</if>
            <if test="libtemplatename != null ">and libtemplatename = #{libtemplatename}</if>
            <if test="openid != null ">and openid = #{openid}</if>
            <if test="longSendTime != null ">and long_send_time = #{longSendTime}</if>
            <if test="sendstate != null ">and sendstate = #{sendstate}</if>
        </where>
        order by update_time desc,id desc
    </select>
@@ -217,6 +222,8 @@
            <if test="libtemplatename != null ">libtemplatename,</if>
            <if test="patid != null ">patid,</if>
            <if test="openid != null ">openid,</if>
            <if test="longSendTime != null ">long_send_time,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="sendname != null">#{sendname},</if>
@@ -268,6 +275,8 @@
            <if test="libtemplatename != null ">#{libtemplatename},</if>
            <if test="patid != null ">#{patid},</if>
            <if test="openid != null ">#{openid},</if>
            <if test="longSendTime != null ">#{longSendTime},</if>
        </trim>
    </insert>
@@ -323,6 +332,8 @@
            <if test="libtemplatename != null ">libtemplatename = #{libtemplatename},</if>
            <if test="patid != null ">patid = #{patid},</if>
            <if test="openid != null ">openid = #{openid},</if>
            <if test="longSendTime != null ">long_send_time = #{longSendTime},</if>
            <if test="sendstate != null ">sendstate = #{sendstate},</if>
        </trim>
        where id = #{id}
    </update>
@@ -379,6 +390,7 @@
            <if test="libtemplatename != null ">libtemplatename = #{libtemplatename},</if>
            <if test="patid != null ">patid = #{patid},</if>
            <if test="openid != null ">openid = #{openid},</if>
            <if test="longSendTime != null ">long_send_time = #{longSendTime},</if>
        </trim>
        where patid = #{patid} and taskid = #{taskid}
    </update>
@@ -391,7 +403,7 @@
        where id = #{id}
    </update>
    <update id="deleteServiceSubtaskByCondition" >
    <update id="deleteServiceSubtaskByCondition">
        update service_subtask
        <trim prefix="SET" suffixOverrides=",">
            del_flag =1
@@ -403,6 +415,7 @@
        select id,
               sendname,
               long_send_time,
               phone,
               sex,
               age,
smartor/src/main/resources/mapper/smartor/ServiceTaskMapper.xml
@@ -44,11 +44,14 @@
        <result property="showTimeNoon" column="show_time_noon"/>
        <result property="showTimeNight" column="show_time_night"/>
        <result property="textParam" column="text_param"/>
        <result property="serviceType" column="service_type"/>
        <result property="longTask" column="long_task"/>
    </resultMap>
    <sql id="selectServiceTaskVo">
        select taskid,
               task_name,
               long_task,
               show_date,
               show_time_morn,
               show_time_noon,
@@ -85,6 +88,7 @@
               send_type,
               send_state,
               send_time_slot,
               service_type,
               orgid
        from service_task
    </sql>
@@ -97,6 +101,8 @@
                '%')
            </if>
            <if test="templateid != null  and templateid != ''">and templateid = #{templateid}</if>
            <if test="longTask != null  and longTask != ''">and long_task = #{longTask}</if>
            <if test="serviceType != null  and serviceType != ''">and service_type = #{serviceType}</if>
            <if test="templatename != null  and templatename != ''">and templatename like concat('%', #{templatename},
                '%')
            </if>
@@ -178,6 +184,8 @@
            <if test="showTimeNoon != null and showTimeNoon != ''">show_time_noon,</if>
            <if test="showTimeMorn != null and showTimeMorn != ''">show_time_morn,</if>
            <if test="textParam != null and textParam != ''">text_param,</if>
            <if test="serviceType != null  and serviceType != ''">service_type,</if>
            <if test="longTask != null  and longTask != ''">long_task,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="taskName != null">#{taskName},</if>
@@ -218,6 +226,8 @@
            <if test="showTimeNoon != null and showTimeNoon != ''">#{showTimeNoon},</if>
            <if test="showTimeMorn != null and showTimeMorn != ''">#{showTimeMorn},</if>
            <if test="textParam != null and textParam != ''">#{textParam},</if>
            <if test="serviceType != null  and serviceType != ''">#{serviceType},</if>
            <if test="longTask != null  and longTask != ''">#{longTask},</if>
        </trim>
    </insert>
@@ -262,6 +272,8 @@
            <if test="showTimeNoon != null and showTimeNoon != ''">show_time_noon=#{showTimeNoon},</if>
            <if test="showTimeMorn != null and showTimeMorn != ''">show_time_morn=#{showTimeMorn},</if>
            <if test="textParam != null and textParam != ''">text_param=#{textParam},</if>
            <if test="serviceType != null  and serviceType != ''">service_type = #{serviceType},</if>
            <if test="longTask != null  and longTask != ''">long_task = #{longTask},</if>
        </trim>
        where taskid = #{taskid}
    </update>