liusheng
2024-09-04 9526971c403417c1c007804f24884c443b9e6cd7
代码提交
已添加16个文件
已修改84个文件
5085 ■■■■ 文件已修改
ruoyi-admin/src/main/java/com/ruoyi/web/component/RedisMqReceiver.java 133 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatMedInhospController.java 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatMedOuthospController.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskAnswerController.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskController.java 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceTaskController.java 36 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/SvyTaskController.java 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/SvyTaskSingleController.java 77 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java 76 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserDeptController.java 106 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/test/MQTest.java 159 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/resources/application-druid.yml 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/resources/application.yml 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/CommonRes.java 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java 258 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUserDept.java 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-common/src/main/java/com/ruoyi/common/utils/RSAPublicKeyExample.java 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-common/src/main/java/com/ruoyi/common/utils/http/HttpUtils.java 208 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java 157 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/pom.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserDeptService.java 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserDeptServiceImpl.java 94 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java 300 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml 64 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/IvrLibaTargetoption.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/IvrLibaTemplateScript.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/IvrLibaTemplateScriptVO.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/IvrLibaTemplateTargetoption.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/IvrTaskTemplateScript.java 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/IvrTaskTemplateScriptVO.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/IvrTaskTemplateTargetoption.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/PatArchive.java 50 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/PatMedInhosp.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/PatMedReq.java 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/PatMedRes.java 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/PatTaskRelevance.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/ServiceSubTaskCacheReq.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/ServiceSubTaskQueryReq.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/ServiceSubtask.java 29 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/ServiceSubtaskCount.java 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/ServiceSubtaskCountReq.java 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/ServiceSubtaskDetail.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/ServiceSubtaskDetailVO.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/ServiceSubtaskVO.java 78 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/SvyLibScript.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/SvyLibScriptOption.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/SvyLibTemplate.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/SvyLibTemplateScript.java 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/SvyLibTemplateScriptVO.java 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/SvyLibTemplateTargetoption.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/SvyLibTemplateVO.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/SvyTaskSingleVO.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/SvyTaskTemplateScript.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/SvyTaskTemplateScriptVO.java 101 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/SvyTaskTemplateTargetoption.java 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/ThiedInhospCheckInfo.java 71 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/ThiedInhospInfo.java 446 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/ThiedOutHospCheckInfo.java 74 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/ThiedOutHospInfo.java 121 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/XinHuaWXReq.java 64 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/mapper/PatArchiveMapper.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/mapper/PatMedInhospMapper.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/mapper/PatMedOuthospMapper.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/mapper/ServiceSubtaskMapper.java 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/mapper/SysUserDeptMapper.java 72 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/IPatMedInhospService.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/IPatMedOuthospService.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/IServiceSubtaskAnswerService.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/IServiceSubtaskService.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/IServiceTaskService.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/ISvyTaskSingleService.java 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/CommonTaskServiceImpl.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/PatArchiveServiceImpl.java 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/PatFilterlistServiceImpl.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/PatMedInhospServiceImpl.java 65 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/PatMedOuthospServiceImpl.java 60 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskAnswerServiceImpl.java 220 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/ServiceTaskServiceImpl.java 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/SvyLibTemplateServiceImpl.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/SvyTaskSingleServiceImpl.java 265 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/IvrLibaTargetoptionMapper.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/IvrLibaTemplateScriptMapper.xml 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/IvrLibaTemplateTargetoptionMapper.xml 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/IvrTaskTemplateScriptMapper.xml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/IvrTaskTemplateTargetoptionMapper.xml 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/PatArchiveMapper.xml 157 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/PatMedInhospMapper.xml 276 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/PatMedOuthospMapper.xml 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml 54 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/ServiceTaskMapper.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/SvyLibScriptMapper.xml 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/SvyLibTemplateMapper.xml 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/SvyLibTemplateScriptMapper.xml 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/SvyLibTemplateTargetoptionMapper.xml 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/SvyLibTopicCategoryMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/SvyTaskTemplateScriptMapper.xml 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/SvyTaskTemplateTargetoptionMapper.xml 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/SysUserDeptMapper.xml 145 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/component/RedisMqReceiver.java
@@ -1,11 +1,14 @@
package com.ruoyi.web.component;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.gson.Gson;
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.ruoyi.common.utils.http.HttpUtils;
import com.ruoyi.web.task.PhoneTask;
import com.smartor.common.SendService;
import com.smartor.config.RobotPhoneUtils;
@@ -44,6 +47,9 @@
    @Value("${req_path}")
    private String req_path;
    @Value("${thirdWXUrl}")
    private String thirdWXUrl;
    @Autowired
    private IIvrTaskTemplateService ivrTaskTemplateService;
@@ -63,10 +69,10 @@
    private RobotPhoneUtils robotPhoneUtils;
    @Autowired
    private SvyTaskMapper svyTaskMapper;
    private ServiceTaskMapper svyTaskMapper;
    @Autowired
    private SvyTaskSingleMapper svyTaskSingleMapper;
    private ServiceSubtaskMapper serviceSubtaskMapper;
    @Autowired
    private ISvyTaskTemplateService iSvyTaskTemplateService;
@@ -103,7 +109,6 @@
            } else {
                commonTaskcallMQ = mapper.readValue(content, CommonTaskcallMQ.class);
            }
            if (commonTaskcallMQ.getTaskType() == 1) {
                //随访
                sfHandle(commonTaskcallMQ, ip);
@@ -116,6 +121,11 @@
            }
            //处理完成,移除redis
            redisCache.deleteObject(message.toString());
            //将状态改成完成
            ServiceTask serviceTask = new ServiceTask();
            serviceTask.setTaskid(Long.valueOf(commonTaskcallMQ.getTaskid()));
            serviceTask.setSendState(5);
            svyTaskMapper.updateServiceTask(serviceTask);
        } catch (Exception e) {
            Integer integer = redisCache.getCacheObject(commonTaskcallMQ.getTaskid().toString());
@@ -138,6 +148,7 @@
     * @param commonTaskcallMQ
     */
    public void sfHandle(CommonTaskcallMQ commonTaskcallMQ, String ip) {
        log.error("进随访了吗?{}", commonTaskcallMQ);
        //判断一下commonTaskcallMQ中的stopstate是否与ivr_task中的一致,不一致,则说明是暂停了
        ServiceTask ivrTask1 = ivrTaskMapper.selectServiceTaskByTaskid(commonTaskcallMQ.getTaskid());
        if (ivrTask1.getStopState() != commonTaskcallMQ.getStopState()) {
@@ -159,7 +170,7 @@
//                IvrTaskTemplateVO ivrTaskTemplateVO1 = ivrTaskTemplateService.selectInfoByCondition(ivrTaskTemplateVO);
                //通过任务ID拿到患者信息
                ServiceSubtask ivrTaskcall = new ServiceSubtask();
                ServiceSubtaskVO ivrTaskcall = new ServiceSubtaskVO();
                ivrTaskcall.setTaskid(commonTaskcallMQ.getTaskid());
                List<ServiceSubtask> selectServiceSubtaskList = ivrTaskcallMapper.selectServiceSubtaskList(ivrTaskcall);
                if (descByCode.equals("电话")) {
@@ -174,7 +185,7 @@
                        if (commonTaskcallMQ.getSendType().equals("2")) {
                            //说明是立即发送
                            String value = redisCache.getCacheObject("cache-0");
                            ServiceSubtask serviceSubtask1 = new ServiceSubtask();
                            ServiceSubtaskVO serviceSubtask1 = new ServiceSubtaskVO();
                            serviceSubtask1.setTaskid(commonTaskcallMQ.getTaskid());
                            List<ServiceSubtask> selectServiceSubtaskList1 = ivrTaskcallMapper.selectServiceSubtaskList(serviceSubtask1);
                            for (ServiceSubtask serviceSubtask2 : selectServiceSubtaskList1) {
@@ -188,7 +199,7 @@
                        } else {
                            //非立即发送
                            String value = redisCache.getCacheObject(key);
                            ServiceSubtask serviceSubtask1 = new ServiceSubtask();
                            ServiceSubtaskVO serviceSubtask1 = new ServiceSubtaskVO();
                            serviceSubtask1.setTaskid(commonTaskcallMQ.getTaskid());
                            List<ServiceSubtask> selectServiceSubtaskList1 = ivrTaskcallMapper.selectServiceSubtaskList(serviceSubtask1);
                            for (ServiceSubtask serviceSubtask2 : selectServiceSubtaskList1) {
@@ -250,17 +261,20 @@
                    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);
//                        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);
                        String url = ip + ":" + req_path + "/outsideChain?param1=" + taskId + "&param2=" + patid + "&param3=" + ivrTask1.getTaskName() + "&param5=false";
                        String wxCode = getWXCode(serviceSubtask.getIdcardno(), url);
                        //任务发送记录
                        ServiceSubtaskRecord serviceSubtaskRecord = new ServiceSubtaskRecord();
@@ -269,7 +283,8 @@
                        serviceSubtaskRecord.setTasktype(serviceSubtask.getType());
                        serviceSubtaskRecord.setPreachform("4");
                        serviceSubtaskRecord.setStartTime(System.currentTimeMillis());
                        serviceSubtaskRecord.setResult(aBoolean == true ? "成功" : "失败");
                        serviceSubtaskRecord.setResult("成功");
                        if (wxCode.equals("0")) serviceSubtaskRecord.setResult("失败");
                        serviceSubtaskRecordService.insertServiceSubtaskRecord(serviceSubtaskRecord);
                    }
                }
@@ -284,6 +299,7 @@
     * @param commonTaskcallMQ
     */
    private void xjHandle(CommonTaskcallMQ commonTaskcallMQ, String ip) {
        log.error("进宣教了吗?{}", commonTaskcallMQ);
        //判断一下commonTaskcallMQ中的stopstate是否与ivr_task中的一致,不一致,则说明是暂停了
        ServiceTask ivrTask1 = ivrTaskMapper.selectServiceTaskByTaskid(commonTaskcallMQ.getTaskid());
        if (ivrTask1.getStopState() != commonTaskcallMQ.getStopState()) {
@@ -307,7 +323,7 @@
                    ivrTaskTemplateVO1 = ivrTaskTemplateService.selectInfoByCondition(ivrTaskTemplateVO);
                }
                //通过任务ID拿到患者信息
                ServiceSubtask ivrTaskcall = new ServiceSubtask();
                ServiceSubtaskVO ivrTaskcall = new ServiceSubtaskVO();
                ivrTaskcall.setTaskid(commonTaskcallMQ.getTaskid());
                List<ServiceSubtask> ivrTaskcalls = ivrTaskcallMapper.selectServiceSubtaskList(ivrTaskcall);
                if (descByCode.equals("电话")) {
@@ -365,18 +381,22 @@
                    String taskId = rsaPublicKeyExample.encryptedData(ivrTask1.getTaskid().toString(), pub_key);
                    for (ServiceSubtask ivrTaskSingle : ivrTaskcalls) {
                        String patid = rsaPublicKeyExample.encryptedData(ivrTaskSingle.getPatid().toString(), pub_key);
                        SendMagParam sendMagParam = new SendMagParam();
                        sendMagParam.setType("5");
                        sendMagParam.setUrl(ip + ":" + req_path + "/outsideChainxj?param1=" + taskId + "&param2=" + patid + "&param3=" + ivrTask1.getTaskName() + "&param5=false");
                        log.info("链接完整路径:{}", req_path + "/outsideChainxj?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(ivrTaskSingle.getOpenid());
                        Boolean aBoolean = sendService.sendMsg(sendMagParam);
//                        SendMagParam sendMagParam = new SendMagParam();
//                        sendMagParam.setType("5");
//                        sendMagParam.setUrl(ip + ":" + req_path + "/outsideChainxj?param1=" + taskId + "&param2=" + patid + "&param3=" + ivrTask1.getTaskName() + "&param5=false");
//                        log.info("链接完整路径:{}", req_path + "/outsideChainxj?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(ivrTaskSingle.getOpenid());
                        //新华医院有自己的公众号发送接口,我们的先不用(先保留,其它项目可以用)
//                        Boolean aBoolean = sendService.sendMsg(sendMagParam);
//                        log.error("是否发送成功:{}", aBoolean);
                        String url = ip + ":" + req_path + "/outsideChainxj?param1=" + taskId + "&param2=" + patid + "&param3=" + ivrTask1.getTaskName() + "&param5=false";
                        String wxCode = getWXCode(ivrTaskSingle.getIdcardno(), url);
                        //任务发送记录
                        ServiceSubtaskRecord serviceSubtaskRecord = new ServiceSubtaskRecord();
                        serviceSubtaskRecord.setTaskid(ivrTaskSingle.getTaskid().toString());
@@ -384,7 +404,11 @@
                        serviceSubtaskRecord.setTasktype(ivrTaskSingle.getType());
                        serviceSubtaskRecord.setPreachform("4");
                        serviceSubtaskRecord.setStartTime(System.currentTimeMillis());
                        serviceSubtaskRecord.setResult(aBoolean == true ? "成功" : "失败");
                        serviceSubtaskRecord.setResult("成功");
                        if (!wxCode.equals("0")) {
                            serviceSubtaskRecord.setResult("失败");
                        }
                        serviceSubtaskRecordService.insertServiceSubtaskRecord(serviceSubtaskRecord);
                    }
                }
@@ -399,8 +423,11 @@
     * @param commonTaskcallMQ
     */
    private void wjHandle(CommonTaskcallMQ commonTaskcallMQ, String ip) {
        log.error("进问卷了吗?{}", commonTaskcallMQ);
        //判断一下commonTaskcallMQ中的stopstate是否与ivr_task中的一致,不一致,则说明是暂停了
        SvyTask svyTask = svyTaskMapper.selectSvyTaskByTaskid(commonTaskcallMQ.getTaskid());
        ServiceTask svyTask = svyTaskMapper.selectServiceTaskByTaskid(commonTaskcallMQ.getTaskid());
        log.error("svyTask.getStopState()的值为:{} ï¼Œ commonTaskcallMQ.getStopState()的值为:{}", svyTask.getStopState(), commonTaskcallMQ.getStopState());
        if (svyTask.getStopState() != commonTaskcallMQ.getStopState()) {
            //将消息从队列中剔除
            return;
@@ -420,12 +447,13 @@
                SvyTaskTemplateVO svyTaskTemplateVO1 = iSvyTaskTemplateService.selectInfoByCondition(svyTaskTemplateVO);
                //通过任务ID拿到患者信息
                SvyTaskSingle svyTaskSingle = new SvyTaskSingle();
                svyTaskSingle.setTaskid(commonTaskcallMQ.getTaskid());
                List<SvyTaskSingle> svyTaskSingles = svyTaskSingleMapper.selectSvyTaskSingleList(svyTaskSingle);
                ServiceSubtaskVO serviceSubtaskVO = new ServiceSubtaskVO();
                serviceSubtaskVO.setTaskid(commonTaskcallMQ.getTaskid());
                List<ServiceSubtask> selectServiceSubtaskList = serviceSubtaskMapper.selectServiceSubtaskList(serviceSubtaskVO);
                log.error("selectServiceSubtaskList数据是多少?{}", selectServiceSubtaskList.size());
                if (descByCode.equals("电话")) {
                    for (SvyTaskSingle svyTaskSingle1 : svyTaskSingles) {
                        SvyTask svyTask1 = svyTaskMapper.selectSvyTaskByTaskid(svyTaskSingle1.getTaskid());
                    for (ServiceSubtask svyTaskSingle1 : selectServiceSubtaskList) {
                        ServiceTask svyTask1 = svyTaskMapper.selectServiceTaskByTaskid(svyTaskSingle1.getTaskid());
                        if (svyTask1.getSendState() != null && svyTask1.getSendState().equals("3") || svyTask1.getSendState() != null && svyTask1.getSendState().equals("4")) {
                            //如何任务被“暂停”或“终止”
                            break;
@@ -449,21 +477,27 @@
                } else if (descByCode.equals("短信")) {
                    //短信
                } else if (descByCode.equals("公众号")) {
                    log.error("进问卷公众号了吗?{}", descByCode);
                    //公众号
                    RSAPublicKeyExample rsaPublicKeyExample = new RSAPublicKeyExample();
                    String taskId = rsaPublicKeyExample.encryptedData(svyTask.getTaskid().toString(), pub_key);
                    for (SvyTaskSingle svyTaskSingle1 : svyTaskSingles) {
                    for (ServiceSubtask svyTaskSingle1 : selectServiceSubtaskList) {
                        String patid = rsaPublicKeyExample.encryptedData(svyTaskSingle1.getPatid().toString(), pub_key);
                        String url = ip + ":" + req_path + "/outsideChainwt?param1=" + taskId + "&param2=" + patid + "&param3=" + svyTask.getTaskName() + "&param5=false";
                        //这个是我们自己的微信公众号发送方式,
                        SendMagParam sendMagParam = new SendMagParam();
                        sendMagParam.setType("5");
                        sendMagParam.setUrl(ip + ":" + req_path + "//outsideChainwt?param1=" + taskId + "&param2=" + patid + "&param3=" + svyTask.getTaskName() + "&param5=false");
                        log.info("链接完整路径:{}", req_path + "//outsideChainwt?param1=" + taskId + "&param2=" + patid + "&param3=" + svyTask.getTaskName() + "&param5=false");
                        sendMagParam.setUrl(url);
                        log.info("链接完整路径:{}", req_path + "/outsideChainwt?param1=" + taskId + "&param2=" + patid + "&param3=" + svyTask.getTaskName() + "&param5=false");
                        //这个模板ID先写死,后面做成可选
                        sendMagParam.setTmpCode("oG3pJHPVWpE81DmZsua_2tKwgJ97r0qz37z56ns7NB4");
                        Map map = new HashMap();
                        map.put("first", svyTask.getTaskName());
                        sendMagParam.setContent(JSON.toJSONString(map));
                        sendMagParam.setOpenid(svyTaskSingle1.getOpenid());
                        Boolean aBoolean = sendService.sendMsg(sendMagParam);
                        log.error("发送成功了吗?{}", aBoolean);
//                        String wxCode = getWXCode(svyTaskSingle1.getIdcardno(), url);
                        //任务发送记录
                        ServiceSubtaskRecord serviceSubtaskRecord = new ServiceSubtaskRecord();
@@ -472,7 +506,10 @@
                        serviceSubtaskRecord.setTasktype(svyTaskSingle1.getType());
                        serviceSubtaskRecord.setPreachform("4");
                        serviceSubtaskRecord.setStartTime(System.currentTimeMillis());
                        serviceSubtaskRecord.setResult(aBoolean == true ? "成功" : "失败");
                        serviceSubtaskRecord.setResult("成功");
//                        if (!wxCode.equals("0")) {
//                            serviceSubtaskRecord.setResult("失败");
//                        }
                        serviceSubtaskRecordService.insertServiceSubtaskRecord(serviceSubtaskRecord);
                    }
                }
@@ -545,4 +582,18 @@
        return key;
    }
    private String getWXCode(String idcard, String url) {
        XinHuaWXReq xinHuaWXReq = new XinHuaWXReq();
        xinHuaWXReq.setIdcard(idcard);
        xinHuaWXReq.setUrl(url);
        xinHuaWXReq.setKeyword1(null);
        xinHuaWXReq.setKeyword2(null);
        xinHuaWXReq.setKeyword3(null);
        xinHuaWXReq.setKeyword4(null);
        String result = HttpUtils.sendPost(thirdWXUrl, new Gson().toJson(xinHuaWXReq));
        JSONObject jsonObject = JSONObject.parseObject(result);
        String code = (String) jsonObject.get("code");
        return code;
    }
}
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatMedInhospController.java
@@ -1,4 +1,4 @@
package com.smartor.controller;
package com.ruoyi.web.controller.smartor;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
@@ -7,6 +7,7 @@
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.smartor.domain.PatMedInhosp;
import com.smartor.domain.PatMedReq;
import com.smartor.service.IPatMedInhospService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@@ -26,8 +27,7 @@
@Api(description = "患者住院记录")
@RestController
@RequestMapping("/smartor/patinhosp")
public class PatMedInhospController extends BaseController
{
public class PatMedInhospController extends BaseController {
    @Autowired
    private IPatMedInhospService patMedInhospService;
@@ -37,11 +37,22 @@
    @ApiOperation("查询患者住院记录列表")
    @PreAuthorize("@ss.hasPermi('smartor:patinhosp:list')")
    @PostMapping("/selectPatMedInhospList")
    public TableDataInfo selectPatMedInhosplist(@RequestBody  PatMedInhosp patMedInhosp)
    {
    public TableDataInfo selectPatMedInhosplist(@RequestBody PatMedInhosp patMedInhosp) {
        startPage();
        List<PatMedInhosp> list = patMedInhospService.selectPatMedInhospList(patMedInhosp);
        return getDataTable(list);
    }
    @PostMapping("/getDeptCodeByPatId")
    @ApiOperation("查询住、出院部门编码通过patId")
    public AjaxResult getDeptCodeByPatId(@RequestBody PatMedInhosp patMedInhosp) {
        return success(patMedInhospService.getDeptCodeByPatId(patMedInhosp));
    }
    @PostMapping("/selectPatMedInhospListCount")
    @ApiOperation("查询出、入院看病人次和人数")
    public AjaxResult selectPatMedInhospListCount(PatMedReq patMedReq) {
        return success(patMedInhospService.selectPatMedInhospListCount(patMedReq));
    }
    /**
@@ -51,8 +62,7 @@
    @PreAuthorize("@ss.hasPermi('smartor:patinhosp:export')")
    @Log(title = "患者住院记录", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, PatMedInhosp patMedInhosp)
    {
    public void export(HttpServletResponse response, PatMedInhosp patMedInhosp) {
        List<PatMedInhosp> list = patMedInhospService.selectPatMedInhospList(patMedInhosp);
        ExcelUtil<PatMedInhosp> util = new ExcelUtil<PatMedInhosp>(PatMedInhosp.class);
        util.exportExcel(response, list, "患者住院记录数据");
@@ -64,8 +74,7 @@
    @ApiOperation("获取患者住院记录详细信息")
    @PreAuthorize("@ss.hasPermi('smartor:patinhosp:query')")
    @GetMapping(value = "/{inhospid}")
    public AjaxResult getInfo(@PathVariable("inhospid") Long inhospid)
    {
    public AjaxResult getInfo(@PathVariable("inhospid") Long inhospid) {
        return success(patMedInhospService.selectPatMedInhospByInhospid(inhospid));
    }
@@ -76,8 +85,7 @@
    @PreAuthorize("@ss.hasPermi('smartor:patinhosp:add')")
    @Log(title = "患者住院记录", businessType = BusinessType.INSERT)
    @PostMapping("/add")
    public AjaxResult add(@RequestBody PatMedInhosp patMedInhosp)
    {
    public AjaxResult add(@RequestBody PatMedInhosp patMedInhosp) {
        return toAjax(patMedInhospService.insertPatMedInhosp(patMedInhosp));
    }
@@ -88,8 +96,7 @@
    @PreAuthorize("@ss.hasPermi('smartor:patinhosp:edit')")
    @Log(title = "患者住院记录", businessType = BusinessType.UPDATE)
    @PostMapping("/edit")
    public AjaxResult edit(@RequestBody PatMedInhosp patMedInhosp)
    {
    public AjaxResult edit(@RequestBody PatMedInhosp patMedInhosp) {
        return toAjax(patMedInhospService.updatePatMedInhosp(patMedInhosp));
    }
@@ -99,9 +106,20 @@
    @ApiOperation("删除患者住院记录")
    @PreAuthorize("@ss.hasPermi('smartor:patinhosp:remove')")
    @Log(title = "患者住院记录", businessType = BusinessType.DELETE)
    @GetMapping("/remove/{inhospids}")
    public AjaxResult remove(@PathVariable Long[] inhospids)
    {
    @GetMapping("/remove/{inhospids}")
    public AjaxResult remove(@PathVariable Long[] inhospids) {
        return toAjax(patMedInhospService.deletePatMedInhospByInhospids(inhospids));
    }
    /**
     * å„科室服务人次
     *
     * @return
     */
    @ApiOperation("各科室服务人次")
    @PostMapping("/getDeptRanking")
    public TableDataInfo getDeptRanking(@RequestBody PatMedReq patMedReq) {
        return getDataTable(patMedInhospService.getDeptRanking(patMedReq));
    }
}
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatMedOuthospController.java
@@ -4,6 +4,8 @@
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.smartor.domain.PatMedReq;
import com.smartor.domain.PatMedRes;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
@@ -45,13 +47,29 @@
    @PreAuthorize("@ss.hasPermi('smartor:patouthosp:list')")
    @PostMapping("/selectPatMedOuthospList")
    @ApiOperation("查询患者门诊记录列表")
    public TableDataInfo selectPatMedOuthosplist(@RequestBody  PatMedOuthosp patMedOuthosp) {
    public TableDataInfo selectPatMedOuthosplist(@RequestBody PatMedOuthosp patMedOuthosp) {
        startPage();
        List<PatMedOuthosp> list = patMedOuthospService.selectPatMedOuthospList(patMedOuthosp);
        return getDataTable(list);
    }
    /**
     * æŸ¥è¯¢æ‚£è€…门诊记录列表
     */
    @PostMapping("/selectPatMedOuthospCount")
    @ApiOperation("查询门诊看病人次和人数")
    public AjaxResult selectPatMedOuthospCount(@RequestBody PatMedReq patMedReq) {
        PatMedRes patMedRes = patMedOuthospService.selectPatMedOuthospCount(patMedReq);
        return success(patMedRes);
    }
    @PostMapping("/getDeptCodeByPatId")
    @ApiOperation("查询部门编码通过userId")
    public AjaxResult getDeptCodeByPatId(@RequestBody PatMedOuthosp patMedOuthosp) {
        return success(patMedOuthospService.getDeptCodeByPatId(patMedOuthosp));
    }
    /**
     * å¯¼å‡ºæ‚£è€…门诊记录列表
     */
    @PreAuthorize("@ss.hasPermi('smartor:patouthosp:export')")
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskAnswerController.java
@@ -6,10 +6,7 @@
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.smartor.domain.ServiceSubTaskAnswerReq;
import com.smartor.domain.ServiceSubTaskCacheReq;
import com.smartor.domain.ServiceSubTaskQueryReq;
import com.smartor.domain.ServiceSubtaskAnswer;
import com.smartor.domain.*;
import com.smartor.service.IServiceSubtaskAnswerService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@@ -115,6 +112,12 @@
        return toAjax(serviceSubtaskAnswerService.saveQuestionCache(serviceSubTaskCacheReq));
    }
    @ApiOperation("获取患者问题结果记录缓存(外链)")
    @PostMapping("/getQuestionCache")
    public AjaxResult getQuestionCache(@RequestBody ServiceSubTaskCacheReq serviceSubTaskCacheReq) {
        return AjaxResult.success(serviceSubtaskAnswerService.getQuestionCache(serviceSubTaskCacheReq));
    }
    @ApiOperation("医生查询患者问题结果(外链)")
    @PostMapping("/selectPatQuestionResult")
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskController.java
@@ -56,8 +56,9 @@
    @PreAuthorize("@ss.hasPermi('system:taskcall:export')")
    @Log(title = "单一任务(随访宣教)", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, ServiceSubtask ivrTaskcall) {
        List<ServiceSubtask> list = serviceSubtaskService.selectServiceSubtaskList(ivrTaskcall);
    public void export(HttpServletResponse response, ServiceSubtask serviceSubtask) {
        ServiceSubtaskVO serviceSubtaskVO = DtoConversionUtils.sourceToTarget(serviceSubtask, ServiceSubtaskVO.class);
        List<ServiceSubtask> list = serviceSubtaskService.selectServiceSubtaskList(serviceSubtaskVO);
        ExcelUtil<ServiceSubtask> util = new ExcelUtil<ServiceSubtask>(ServiceSubtask.class);
        util.exportExcel(response, list, "单一任务(随访)数据");
    }
@@ -93,8 +94,8 @@
    @PostMapping("/queryTaskByCondition")
    public AjaxResult queryTaskByCondition(@RequestBody ServiceSubtaskVO ivrTaskcallVO) {
        //根据入参查询信息
        ServiceSubtask ivrTaskcall = DtoConversionUtils.sourceToTarget(ivrTaskcallVO, ServiceSubtask.class);
        ServiceTaskVO ivrTaskVO = serviceSubtaskService.queryTaskByCondition(ivrTaskcall);
        ServiceSubtask serviceSubtask = DtoConversionUtils.sourceToTarget(ivrTaskcallVO, ServiceSubtask.class);
        ServiceTaskVO ivrTaskVO = serviceSubtaskService.queryTaskByCondition(serviceSubtask);
        return success(ivrTaskVO);
    }
@@ -146,4 +147,13 @@
        return toAjax(serviceSubtaskService.saveQuestionAnswerPhone(serviceSubTaskDetailReq));
    }
    /**
     * èŽ·å–æ¯ä¸ªæœˆçš„éšè®¿ã€å¤è¯Šé‡
     */
    @ApiOperation("获取每个月的随访、复诊量")
    @PostMapping("/getSfFzInfoEveryMonth")
    public TableDataInfo getSfFzInfoEveryMonth(@RequestBody ServiceSubtaskCountReq serviceSubtaskCountReq) {
        return getDataTable(serviceSubtaskService.getSfFzInfoEveryMonth(serviceSubtaskCountReq));
    }
}
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceTaskController.java
@@ -9,6 +9,7 @@
import com.ruoyi.common.utils.DtoConversionUtils;
import com.ruoyi.common.utils.PageUtils;
import com.ruoyi.common.utils.RSAPublicKeyExample;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.smartor.domain.*;
import com.smartor.service.IServiceSubtaskService;
@@ -23,6 +24,7 @@
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.net.URLDecoder;
import java.util.List;
import java.util.stream.Collectors;
@@ -49,6 +51,9 @@
    @Value("${pri_key}")
    private String pri_key;
    @Autowired
    private RSAPublicKeyExample rsaPublicKeyExample;
    /**
     * æŸ¥è¯¢è¯­éŸ³ä»»åŠ¡åˆ—è¡¨
     */
@@ -62,7 +67,7 @@
        if (CollectionUtils.isNotEmpty(serviceTaskVOS)) {
            for (ServiceTaskVO ServiceTaskVO : serviceTaskVOS) {
                ServiceSubtask ServiceTaskcall = new ServiceSubtask();
                ServiceSubtaskVO ServiceTaskcall = new ServiceSubtaskVO();
                ServiceTaskcall.setTaskid(ServiceTaskVO.getTaskid());
                List<ServiceSubtask> ServiceTaskcalls = iServiceTaskCallService.selectServiceSubtaskList(ServiceTaskcall);
                if (CollectionUtils.isNotEmpty(ServiceTaskcalls)) {
@@ -153,9 +158,13 @@
    @ApiOperation("删除任务(包括它对应的患者信息)")
    @PreAuthorize("@ss.hasPermi('smartor:ServiceTask:remove')")
    @Log(title = "语音任务", businessType = BusinessType.DELETE)
    @GetMapping("/remove/{removeTask}")
    public AjaxResult removeTask(@PathVariable Long taskId) {
        return toAjax(serviceTaskService.deleteServiceTaskByTaskid(taskId));
    @GetMapping("/remove/{taskId}")
    public AjaxResult removeTask(@PathVariable("taskId") String taskId) {
        if (StringUtils.isEmpty(taskId)) {
            AjaxResult.error("入参不能为空");
        }
        Long tid = Long.valueOf(taskId);
        return toAjax(serviceTaskService.deleteServiceTaskByTaskid(tid));
    }
    /**
@@ -165,12 +174,21 @@
     */
    @ApiOperation("通过任务ID和患者ID获取单个人的题目信息")
    @PostMapping("/getScriptInfoByCondition")
    public TableDataInfo getScriptInfoByCondition(@RequestBody ServiceTaskScriptQues serviceTaskScriptQues) {
        RSAPublicKeyExample rsaPublicKeyExample = new RSAPublicKeyExample();
        Long tid = Long.valueOf(rsaPublicKeyExample.decryptedData(serviceTaskScriptQues.getParam1(), pri_key));
        Long pid = Long.valueOf(rsaPublicKeyExample.decryptedData(serviceTaskScriptQues.getParam2(), pri_key));
    public AjaxResult getScriptInfoByCondition(@RequestBody ServiceTaskScriptQues serviceTaskScriptQues) {
        Long tid = null;
        Long pid = null;
        log.info("getScriptInfoByCondition入参为:{}", serviceTaskScriptQues);
        try {
//            tid = Long.valueOf(rsaPublicKeyExample.decryptedData(URLDecoder.decode(serviceTaskScriptQues.getParam1(), "UTF-8"), pri_key));
//            pid = Long.valueOf(rsaPublicKeyExample.decryptedData(URLDecoder.decode(serviceTaskScriptQues.getParam2(), "UTF-8"), pri_key));
            tid = Long.valueOf(rsaPublicKeyExample.decryptedData(serviceTaskScriptQues.getParam1(), pri_key));
            pid = Long.valueOf(rsaPublicKeyExample.decryptedData(serviceTaskScriptQues.getParam2(), pri_key));
        } catch (Exception e) {
            log.error("getScriptInfoByCondition报错了:{}", e.getMessage());
        }
        log.info("tid和pid的值为:{},{}", tid, pid);
        return getDataTable(serviceTaskService.getScriptInfoByCondition(tid, pid));
        return success(serviceTaskService.getScriptInfoByCondition(tid, pid));
    }
}
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/SvyTaskController.java
@@ -11,6 +11,7 @@
import com.ruoyi.common.utils.RSAPublicKeyExample;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.smartor.domain.*;
import com.smartor.service.IServiceSubtaskService;
import com.smartor.service.ISvyTaskService;
import com.smartor.service.ISvyTaskSingleService;
import io.swagger.annotations.Api;
@@ -39,9 +40,14 @@
public class SvyTaskController extends BaseController {
    @Autowired
    private ISvyTaskService svyTaskService;
//
//    @Autowired
//    private ISvyTaskSingleService iSvyTaskSingleService;
    @Autowired
    private ISvyTaskSingleService iSvyTaskSingleService;
    private IServiceSubtaskService serviceSubtaskService;
    @Value("${pub_key}")
    private String pub_key;
@@ -61,9 +67,9 @@
        List<SvyTaskVO> svyTaskVOS = DtoConversionUtils.sourceToTarget(list, SvyTaskVO.class);
        if (CollectionUtils.isNotEmpty(svyTaskVOS)) {
            for (SvyTaskVO svyTaskVO : svyTaskVOS) {
                SvyTaskSingle svyTaskSingle = new SvyTaskSingle();
                svyTaskSingle.setTaskid(svyTaskVO.getTaskid());
                List<SvyTaskSingle> svyTaskSingles = iSvyTaskSingleService.selectSvyTaskSingleList(svyTaskSingle);
                ServiceSubtaskVO serviceSubtaskVO = new ServiceSubtaskVO();
                serviceSubtaskVO.setTaskid(svyTaskVO.getTaskid());
                List<ServiceSubtask> svyTaskSingles = serviceSubtaskService.selectServiceSubtaskList(serviceSubtaskVO);
                if (CollectionUtils.isNotEmpty(svyTaskSingles)) {
                    //已发送
                    long yfs = svyTaskSingles.stream().filter(svyTaskcall1 -> svyTaskcall1.getSendstate() != null && svyTaskcall1.getSendstate() == 3L).collect(Collectors.toList()).stream().count();
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/SvyTaskSingleController.java
@@ -26,80 +26,12 @@
 * @author ruoyi
 * @date 2024-06-12
 */
@Api(description = "单一任务(问卷)")
@Api(description = "单一任务(问卷)(已经换成service_subtask)")
@RestController
@RequestMapping("/smartor/svysingle")
public class SvyTaskSingleController extends BaseController {
    @Autowired
    private ISvyTaskSingleService svyTaskSingleService;
    /**
     * æŸ¥è¯¢å•一任务(问卷)列表
     */
    @ApiOperation("查询单一任务(问卷)列表")
    @PreAuthorize("@ss.hasPermi('system:single:list')")
    @GetMapping("/list")
    public TableDataInfo list(SvyTaskSingle svyTaskSingle) {
        startPage();
        List<SvyTaskSingle> list = svyTaskSingleService.selectSvyTaskSingleList(svyTaskSingle);
        return getDataTable(list);
    }
    /**
     * å¯¼å‡ºå•一任务(问卷)列表
     */
    @ApiOperation("导出单一任务(问卷)列表")
    @PreAuthorize("@ss.hasPermi('system:single:export')")
    @Log(title = "单一任务(问卷)", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, SvyTaskSingle svyTaskSingle) {
        List<SvyTaskSingle> list = svyTaskSingleService.selectSvyTaskSingleList(svyTaskSingle);
        ExcelUtil<SvyTaskSingle> util = new ExcelUtil<SvyTaskSingle>(SvyTaskSingle.class);
        util.exportExcel(response, list, "单一任务(问卷)数据");
    }
    /**
     * èŽ·å–å•ä¸€ä»»åŠ¡ï¼ˆé—®å·ï¼‰è¯¦ç»†ä¿¡æ¯
     */
    @ApiOperation("获取单一任务(问卷)详细信息")
    @PreAuthorize("@ss.hasPermi('system:single:query')")
    @GetMapping(value = "/getInfo/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id) {
        return success(svyTaskSingleService.selectSvyTaskSingleById(id));
    }
    /**
     * æ–°å¢žå•一任务(问卷)
     */
    @ApiOperation("新增单一任务(问卷)")
    @PreAuthorize("@ss.hasPermi('system:single:add')")
    @Log(title = "单一任务(问卷)", businessType = BusinessType.INSERT)
    @PostMapping("/add")
    public AjaxResult add(@RequestBody SvyTaskSingle svyTaskSingle) {
        return toAjax(svyTaskSingleService.insertSvyTaskSingle(svyTaskSingle));
    }
    /**
     * ä¿®æ”¹å•一任务(问卷)
     */
    @ApiOperation("修改单一任务(问卷)")
    @PreAuthorize("@ss.hasPermi('system:single:edit')")
    @Log(title = "单一任务(问卷)", businessType = BusinessType.UPDATE)
    @PostMapping("/edit")
    public AjaxResult edit(@RequestBody SvyTaskSingle svyTaskSingle) {
        return toAjax(svyTaskSingleService.updateSvyTaskSingle(svyTaskSingle));
    }
    /**
     * åˆ é™¤å•一任务(问卷)
     */
    @ApiOperation(" åˆ é™¤å•一任务(问卷)")
    @PreAuthorize("@ss.hasPermi('system:single:remove')")
    @Log(title = "单一任务(问卷)", businessType = BusinessType.DELETE)
    @GetMapping("/remove/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids) {
        return toAjax(svyTaskSingleService.deleteSvyTaskSingleByIds(ids));
    }
    /**
     * æ–°å¢žæˆ–修改删除问卷任务
@@ -111,7 +43,8 @@
        LoginUser loginUser = getLoginUser();
        SysUser user = loginUser.getUser();
        svyTaskVO.setCreateBy(user.getNickName());
        return toAjax(svyTaskSingleService.insertOrUpdateSvyTask(svyTaskVO));
        ServiceTaskVO serviceTaskVO = DtoConversionUtils.sourceToTarget(svyTaskVO, ServiceTaskVO.class);
        return toAjax(svyTaskSingleService.insertOrUpdateSvyTask(serviceTaskVO));
    }
    /**
@@ -121,8 +54,8 @@
    @PostMapping("/queryTaskByCondition")
    public AjaxResult queryTaskByCondition(@RequestBody SvyTaskSingleVO svyTaskSingleVO) {
        //根据入参查询信息
        SvyTaskSingle svyTaskSingle = DtoConversionUtils.sourceToTarget(svyTaskSingleVO, SvyTaskSingle.class);
        SvyTaskVO svyTaskVO = svyTaskSingleService.queryTaskByCondition(svyTaskSingle);
        ServiceSubtask serviceSubtask = DtoConversionUtils.sourceToTarget(svyTaskSingleVO, ServiceSubtask.class);
        ServiceTaskVO svyTaskVO = svyTaskSingleService.queryTaskByCondition(serviceSubtask);
        return success(svyTaskVO);
    }
}
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java
@@ -27,7 +27,7 @@
/**
 * éƒ¨é—¨ä¿¡æ¯
 *
 *
 * @author ruoyi
 */
@Api(description = "部门信息")
@@ -68,7 +68,7 @@
     */
    @ApiOperation("根据部门编号获取详细信息")
    @PreAuthorize("@ss.hasPermi('system:dept:query')")
    @GetMapping(value = "/getInfo/{deptId}")
    @GetMapping("/getInfo/{deptId}")
    public AjaxResult getInfo(@PathVariable Long deptId)
    {
        deptService.checkDeptDataScope(deptId);
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java
@@ -34,8 +34,7 @@
 */
@RestController
@RequestMapping("/system/user")
public class SysUserController extends BaseController
{
public class SysUserController extends BaseController {
    @Autowired
    private ISysUserService userService;
@@ -53,8 +52,7 @@
     */
    @PreAuthorize("@ss.hasPermi('system:user:list')")
    @GetMapping("/list")
    public TableDataInfo list(SysUser user)
    {
    public TableDataInfo list(SysUser user) {
        startPage();
        List<SysUser> list = userService.selectUserList(user);
        return getDataTable(list);
@@ -63,8 +61,7 @@
    @Log(title = "用户管理", businessType = BusinessType.EXPORT)
    @PreAuthorize("@ss.hasPermi('system:user:export')")
    @PostMapping("/export")
    public void export(HttpServletResponse response, SysUser user)
    {
    public void export(HttpServletResponse response, SysUser user) {
        List<SysUser> list = userService.selectUserList(user);
        ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
        util.exportExcel(response, list, "用户数据");
@@ -73,8 +70,7 @@
    @Log(title = "用户管理", businessType = BusinessType.IMPORT)
    @PreAuthorize("@ss.hasPermi('system:user:import')")
    @PostMapping("/importData")
    public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception
    {
    public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception {
        ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
        List<SysUser> userList = util.importExcel(file.getInputStream());
        String operName = getUsername();
@@ -83,8 +79,7 @@
    }
    @PostMapping("/importTemplate")
    public void importTemplate(HttpServletResponse response)
    {
    public void importTemplate(HttpServletResponse response) {
        ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
        util.importTemplateExcel(response, "用户数据");
    }
@@ -93,16 +88,14 @@
     * æ ¹æ®ç”¨æˆ·ç¼–号获取详细信息
     */
    @PreAuthorize("@ss.hasPermi('system:user:query')")
    @GetMapping(value = { "/", "/{userId}" })
    public AjaxResult getInfo(@PathVariable(value = "userId", required = false) Long userId)
    {
    @GetMapping("/getInfo/{userId}")
    public AjaxResult getInfo(@PathVariable(value = "userId", required = false) Long userId) {
        userService.checkUserDataScope(userId);
        AjaxResult ajax = AjaxResult.success();
        List<SysRole> roles = roleService.selectRoleAll();
        ajax.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList()));
        ajax.put("posts", postService.selectPostAll());
        if (StringUtils.isNotNull(userId))
        {
        if (StringUtils.isNotNull(userId)) {
            SysUser sysUser = userService.selectUserById(userId);
            ajax.put(AjaxResult.DATA_TAG, sysUser);
            ajax.put("postIds", postService.selectPostListByUserId(userId));
@@ -117,20 +110,12 @@
    @PreAuthorize("@ss.hasPermi('system:user:add')")
    @Log(title = "用户管理", businessType = BusinessType.INSERT)
    @PostMapping("/add")
    public AjaxResult add(@Validated @RequestBody SysUser user)
    {
        if (UserConstants.NOT_UNIQUE.equals(userService.checkUserNameUnique(user)))
        {
    public AjaxResult add(@Validated @RequestBody SysUser user) {
        if (UserConstants.NOT_UNIQUE.equals(userService.checkUserNameUnique(user))) {
            return error("新增用户'" + user.getUserName() + "'失败,登录账号已存在");
        }
        else if (StringUtils.isNotEmpty(user.getPhonenumber())
                && UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user)))
        {
        } else if (StringUtils.isNotEmpty(user.getPhonenumber()) && UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user))) {
            return error("新增用户'" + user.getUserName() + "'失败,手机号码已存在");
        }
        else if (StringUtils.isNotEmpty(user.getEmail())
                && UserConstants.NOT_UNIQUE.equals(userService.checkEmailUnique(user)))
        {
        } else if (StringUtils.isNotEmpty(user.getEmail()) && UserConstants.NOT_UNIQUE.equals(userService.checkEmailUnique(user))) {
            return error("新增用户'" + user.getUserName() + "'失败,邮箱账号已存在");
        }
        user.setCreateBy(getUsername());
@@ -144,22 +129,14 @@
    @PreAuthorize("@ss.hasPermi('system:user:edit')")
    @Log(title = "用户管理", businessType = BusinessType.UPDATE)
    @PostMapping("/edit")
    public AjaxResult edit(@Validated @RequestBody SysUser user)
    {
    public AjaxResult edit(@Validated @RequestBody SysUser user) {
        userService.checkUserAllowed(user);
        userService.checkUserDataScope(user.getUserId());
        if (UserConstants.NOT_UNIQUE.equals(userService.checkUserNameUnique(user)))
        {
        if (UserConstants.NOT_UNIQUE.equals(userService.checkUserNameUnique(user))) {
            return error("修改用户'" + user.getUserName() + "'失败,登录账号已存在");
        }
        else if (StringUtils.isNotEmpty(user.getPhonenumber())
                && UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user)))
        {
        } else if (StringUtils.isNotEmpty(user.getPhonenumber()) && UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user))) {
            return error("修改用户'" + user.getUserName() + "'失败,手机号码已存在");
        }
        else if (StringUtils.isNotEmpty(user.getEmail())
                && UserConstants.NOT_UNIQUE.equals(userService.checkEmailUnique(user)))
        {
        } else if (StringUtils.isNotEmpty(user.getEmail()) && UserConstants.NOT_UNIQUE.equals(userService.checkEmailUnique(user))) {
            return error("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在");
        }
        user.setUpdateBy(getUsername());
@@ -172,10 +149,8 @@
    @PreAuthorize("@ss.hasPermi('system:user:remove')")
    @Log(title = "用户管理", businessType = BusinessType.DELETE)
    @GetMapping("/remove/{userIds}")
    public AjaxResult remove(@PathVariable Long[] userIds)
    {
        if (ArrayUtils.contains(userIds, getUserId()))
        {
    public AjaxResult remove(@PathVariable Long[] userIds) {
        if (ArrayUtils.contains(userIds, getUserId())) {
            return error("当前用户不能删除");
        }
        return toAjax(userService.deleteUserByIds(userIds));
@@ -187,8 +162,7 @@
    @PreAuthorize("@ss.hasPermi('system:user:resetPwd')")
    @Log(title = "用户管理", businessType = BusinessType.UPDATE)
    @PostMapping("/resetPwd")
    public AjaxResult resetPwd(@RequestBody SysUser user)
    {
    public AjaxResult resetPwd(@RequestBody SysUser user) {
        userService.checkUserAllowed(user);
        userService.checkUserDataScope(user.getUserId());
        user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
@@ -202,8 +176,7 @@
    @PreAuthorize("@ss.hasPermi('system:user:edit')")
    @Log(title = "用户管理", businessType = BusinessType.UPDATE)
    @PostMapping("/changeStatus")
    public AjaxResult changeStatus(@RequestBody SysUser user)
    {
    public AjaxResult changeStatus(@RequestBody SysUser user) {
        userService.checkUserAllowed(user);
        userService.checkUserDataScope(user.getUserId());
        user.setUpdateBy(getUsername());
@@ -215,8 +188,7 @@
     */
    @PreAuthorize("@ss.hasPermi('system:user:query')")
    @GetMapping("/authRole/{userId}")
    public AjaxResult authRole(@PathVariable("userId") Long userId)
    {
    public AjaxResult authRole(@PathVariable("userId") Long userId) {
        AjaxResult ajax = AjaxResult.success();
        SysUser user = userService.selectUserById(userId);
        List<SysRole> roles = roleService.selectRolesByUserId(userId);
@@ -231,8 +203,7 @@
    @PreAuthorize("@ss.hasPermi('system:user:edit')")
    @Log(title = "用户管理", businessType = BusinessType.GRANT)
    @PostMapping("/authRole")
    public AjaxResult insertAuthRole(Long userId, Long[] roleIds)
    {
    public AjaxResult insertAuthRole(Long userId, Long[] roleIds) {
        userService.checkUserDataScope(userId);
        userService.insertUserAuth(userId, roleIds);
        return success();
@@ -243,8 +214,7 @@
     */
    @PreAuthorize("@ss.hasPermi('system:user:list')")
    @GetMapping("/deptTree")
    public AjaxResult deptTree(SysDept dept)
    {
    public AjaxResult deptTree(SysDept dept) {
        return success(deptService.selectDeptTreeList(dept));
    }
}
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserDeptController.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,106 @@
package com.ruoyi.web.controller.system;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysUserDept;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.service.ISysUserDeptService;
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.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
 * ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘Controller
 *
 * @author lihu
 * @date 2024-08-29
 */
@Api("【请填写功能名称】")
@RestController
@RequestMapping("/smartor/userdept")
public class SysUserDeptController extends BaseController
{
    @Autowired
    private ISysUserDeptService sysUserDeptService;
    /**
     * æŸ¥è¯¢ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘åˆ—è¡¨
     */
    @ApiOperation("查询【请填写功能名称】列表")
    @PreAuthorize("@ss.hasPermi('smartor:dept:list')")
    @GetMapping("/list")
    public TableDataInfo list(SysUserDept sysUserDept)
    {
        startPage();
        List<SysUserDept> list = sysUserDeptService.selectSysUserDeptList(sysUserDept);
        return getDataTable(list);
    }
    /**
     * å¯¼å‡ºã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘åˆ—è¡¨
     */
    @ApiOperation("导出【请填写功能名称】列表")
    @PreAuthorize("@ss.hasPermi('smartor:dept:export')")
    @Log(title = "【请填写功能名称】", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, SysUserDept sysUserDept)
    {
        List<SysUserDept> list = sysUserDeptService.selectSysUserDeptList(sysUserDept);
        ExcelUtil<SysUserDept> util = new ExcelUtil<SysUserDept>(SysUserDept.class);
        util.exportExcel(response, list, "【请填写功能名称】数据");
    }
    /**
     * èŽ·å–ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘è¯¦ç»†ä¿¡æ¯
     */
    @ApiOperation("获取【请填写功能名称】详细信息")
    @PreAuthorize("@ss.hasPermi('smartor:dept:query')")
    @GetMapping(value = "/getInfo/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return success(sysUserDeptService.selectSysUserDeptById(id));
    }
    /**
     * æ–°å¢žã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘
     */
    @PreAuthorize("@ss.hasPermi('smartor:dept:add')")
    @Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT)
    @PostMapping("/add")
    public AjaxResult add(@RequestBody SysUserDept sysUserDept)
    {
        return toAjax(sysUserDeptService.insertSysUserDept(sysUserDept));
    }
    /**
     * ä¿®æ”¹ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘
     */
    @ApiOperation("修改【请填写功能名称】")
    @PreAuthorize("@ss.hasPermi('smartor:dept:edit')")
    @Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE)
    @PostMapping("/edit")
    public AjaxResult edit(@RequestBody SysUserDept sysUserDept)
    {
        return toAjax(sysUserDeptService.updateSysUserDept(sysUserDept));
    }
    /**
     * åˆ é™¤ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘
     */
    @ApiOperation("删除【请填写功能名称】")
    @PreAuthorize("@ss.hasPermi('smartor:dept:remove')")
    @Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE)
    @GetMapping("/remove/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(sysUserDeptService.deleteSysUserDeptByIds(ids));
    }
}
ruoyi-admin/src/main/java/com/ruoyi/web/test/MQTest.java
@@ -1,23 +1,172 @@
package com.ruoyi.web.test;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.reflect.TypeToken;
import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import com.smartor.domain.ThiedInhospInfo;
import org.junit.Test;
import java.lang.reflect.Type;
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;
import java.util.List;
//@SpringBootTest
//@RunWith(SpringRunner.class)
public class MQTest {
    String result="{\n" +
            "    \"code\": \"0\",\n" +
            "    \"message\": \"success\",\n" +
            "    \"data\": {\n" +
            "        \"result\": ["+
            " {\n" +
            "                \"admissDeptName\": \"测试科室\",\n" +
            "                \"patiTypeId\": \"22\",\n" +
            "                \"companyTelNum\": \"\",\n" +
            "                \"currDeptCode\": \"1024\",\n" +
            "                \"currWardCode\": \"1331\",\n" +
            "                \"patiIdCardNo\": \"\",\n" +
            "                \"PatiHomeAddr\": \"浙江省杭州市拱墅区\",\n" +
            "                \"patiMediaId\": \"69674\",\n" +
            "                \"admissBedNo\": \"\",\n" +
            "                \"patiBirthday\": \"2009-03-03 00:00:00\",\n" +
            "                \"Education\": null,\n" +
            "                \"nationalityAddr\": \"\",\n" +
            "                \"admissWardCode\": \"1331\",\n" +
            "                \"doctId\": \"6af3708533e645edb10a655cabead79f\",\n" +
            "                \"inpatientId\": \"2403000055\",\n" +
            "                \"ProfessionId\": \"\",\n" +
            "                \"admissWardId\": \"7f95c670151746bca580c866ae56cfeb\",\n" +
            "                \"doctName\": \"测试医生\",\n" +
            "                \"currBedId\": \"7aeeb24077b1434d8f2b6ccb204f9159\",\n" +
            "                \"diagName\": \"僵\",\n" +
            "                \"currWardName\": \"测试病区\",\n" +
            "                \"totalAmount\": 0.00,\n" +
            "                \"admissWardName\": \"测试病区\",\n" +
            "                \"contactPersonName\": null,\n" +
            "                \"patiMediaNo\": \"024000070\",\n" +
            "                \"patiIndex\": \"024000070\",\n" +
            "                \"diagIcd10\": \"M20.200\",\n" +
            "                \"admissDeptCode\": \"1024\",\n" +
            "                \"patiRecordGender\": \"女\",\n" +
            "                \"patiNatureId\": \"22\",\n" +
            "                \"treateAge\": 15,\n" +
            "                \"suggestAmount\": \"\",\n" +
            "                \"contactPersonAddr\": null,\n" +
            "                \"contactPersonPhone\": null,\n" +
            "                \"admissBedId\": \"\",\n" +
            "                \"treatAgeunit\": \"岁\",\n" +
            "                \"currBedNo\": \"T-003\",\n" +
            "                \"PatiNation\": \"汉族\",\n" +
            "                \"patiRecordName\": \"既往3-5\",\n" +
            "                \"currDeptId\": \"416a047536b411e7bff40242ac103005\",\n" +
            "                \"outWayName\": null,\n" +
            "                \"RelationShip\": \"\",\n" +
            "                \"admitFormId\": null,\n" +
            "                \"patiNatureName\": \"非记账医保\",\n" +
            "                \"PatiNationality\": \"中国\",\n" +
            "                \"outDate\": null,\n" +
            "                \"admissDeptId\": \"416a047536b411e7bff40242ac103005\",\n" +
            "                \"admissDate\": \"2024-03-05 14:33:00\",\n" +
            "                \"currStatus\": 2,\n" +
            "                \"DocName\": \"\",\n" +
            "                \"patiTypeName\": \"非记账医保\",\n" +
            "                \"currDeptName\": \"测试科室\",\n" +
            "                \"currWardId\": \"7f95c670151746bca580c866ae56cfeb\",\n" +
            "                \"areaId\": \"\",\n" +
            "                \"PatiMaritalStatus\": null,\n" +
            "                \"PatiHomePhone\": \"\",\n" +
            "                \"preoutDate\": null,\n" +
            "                \"outWayId\": null,\n" +
            "                \"inhospitalTimes\": 3,\n" +
            "                \"patiRecordId\": \"69409\",\n" +
            "                \"age\": \"15岁\",\n" +
            "                \"diagId\": \"314216\"\n" +
            "            },\n" +
            "            {\n" +
            "                \"admissDeptName\": \"测试科室\",\n" +
            "                \"patiTypeId\": \"22\",\n" +
            "                \"companyTelNum\": \"\",\n" +
            "                \"currDeptCode\": \"1024\",\n" +
            "                \"currWardCode\": \"1331\",\n" +
            "                \"patiIdCardNo\": \"330106198001030057\",\n" +
            "                \"PatiHomeAddr\": \"浙江省杭州市西湖区\",\n" +
            "                \"patiMediaId\": \"69675\",\n" +
            "                \"admissBedNo\": \"\",\n" +
            "                \"patiBirthday\": \"1980-01-03 00:00:00\",\n" +
            "                \"Education\": null,\n" +
            "                \"nationalityAddr\": \"\",\n" +
            "                \"admissWardCode\": \"1331\",\n" +
            "                \"doctId\": \"7d3f0eaaec304bbfad8a8471998e38e4\",\n" +
            "                \"inpatientId\": \"2403000056\",\n" +
            "                \"ProfessionId\": \"\",\n" +
            "                \"admissWardId\": \"7f95c670151746bca580c866ae56cfeb\",\n" +
            "                \"doctName\": \"住院病历\",\n" +
            "                \"currBedId\": \"377f94ca047e4786aef56a1ac22678b7\",\n" +
            "                \"diagName\": \"瘟病\",\n" +
            "                \"currWardName\": \"测试病区\",\n" +
            "                \"totalAmount\": 0.00,\n" +
            "                \"admissWardName\": \"测试病区\",\n" +
            "                \"contactPersonName\": \"\",\n" +
            "                \"patiMediaNo\": \"024000071\",\n" +
            "                \"patiIndex\": \"024000071\",\n" +
            "                \"diagIcd10\": \"A01.03.01.\",\n" +
            "                \"admissDeptCode\": \"1024\",\n" +
            "                \"patiRecordGender\": \"男\",\n" +
            "                \"patiNatureId\": \"22\",\n" +
            "                \"treateAge\": 44,\n" +
            "                \"suggestAmount\": \"\",\n" +
            "                \"contactPersonAddr\": \"\",\n" +
            "                \"contactPersonPhone\": \"\",\n" +
            "                \"admissBedId\": \"\",\n" +
            "                \"treatAgeunit\": \"岁\",\n" +
            "                \"currBedNo\": \"T-006\",\n" +
            "                \"PatiNation\": \"汉族\",\n" +
            "                \"patiRecordName\": \"担保金额01\",\n" +
            "                \"currDeptId\": \"416a047536b411e7bff40242ac103005\",\n" +
            "                \"outWayName\": null,\n" +
            "                \"RelationShip\": \"\",\n" +
            "                \"admitFormId\": null,\n" +
            "                \"patiNatureName\": \"非记账医保\",\n" +
            "                \"PatiNationality\": \"中国\",\n" +
            "                \"outDate\": null,\n" +
            "                \"admissDeptId\": \"416a047536b411e7bff40242ac103005\",\n" +
            "                \"admissDate\": \"2024-03-07 14:04:00\",\n" +
            "                \"currStatus\": 2,\n" +
            "                \"DocName\": \"\",\n" +
            "                \"patiTypeName\": \"非记账医保\",\n" +
            "                \"currDeptName\": \"测试科室\",\n" +
            "                \"currWardId\": \"7f95c670151746bca580c866ae56cfeb\",\n" +
            "                \"areaId\": \"\",\n" +
            "                \"PatiMaritalStatus\": null,\n" +
            "                \"PatiHomePhone\": \"\",\n" +
            "                \"preoutDate\": null,\n" +
            "                \"outWayId\": null,\n" +
            "                \"inhospitalTimes\": 1,\n" +
            "                \"patiRecordId\": \"69410\",\n" +
            "                \"age\": \"44岁\",\n" +
            "                \"diagId\": \"1000040\"\n" +
            "            }\n" +
            "        ],\n" +
            "        \"hasNext\": false\n" +
            "    }\n" +
            "}";
    @Test
    public void testSend22() {
        LocalTime now = LocalTime.now();
        System.out.println("当前时分: " + now.format(DateTimeFormatter.ofPattern("hh:mm")));
        Gson gson = new Gson();
        JsonObject jsonObject = gson.fromJson(result, JsonObject.class);
        JsonArray resultArray = jsonObject.getAsJsonObject("data").getAsJsonArray("result");
        // èŽ·å–ä¸‹ä¸€åˆ†é’Ÿçš„æ—¶åˆ†
        LocalTime nextMinute = now.plusMinutes(1);
        System.out.println("下一分钟的时分: " + nextMinute.format(DateTimeFormatter.ofPattern("hh:mm")));
        // å®šä¹‰ ResultItem çš„类型
        Type resultType = new TypeToken<List<ThiedInhospInfo>>() {}.getType();
        List<ThiedInhospInfo> resultList = gson.fromJson(resultArray, resultType);
        System.out.println(resultList);
    }
ruoyi-admin/src/main/resources/application-druid.yml
@@ -1,4 +1,4 @@
  # æ•°æ®æºé…ç½®
# æ•°æ®æºé…ç½®
spring:
  datasource:
    type: com.alibaba.druid.pool.DruidDataSource
@@ -10,9 +10,11 @@
        #        url: jdbc:mysql://127.0.0.1:3306/smartor?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
        #        username: root
        #        password: 123456
        #192.168.1.16:3308/smartor?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
        #        å…¬å¸
        url: jdbc:mysql://192.168.1.16:3308/smartor?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
#        url: jdbc:mysql://450scrp46939.vicp.fun:59876/smartor?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
#        url: jdbc:mysql://192.168.1.16:3308/smartor?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
        url: jdbc:mysql://127.0.0.1:3308/smartor?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
        username: smartor
        password: Smartor.2023
        driverClassName: com.mysql.cj.jdbc.Driver
@@ -90,6 +92,8 @@
  #微信公众号的密钥
appid: wx1c5243d2337753f4
appSecret: 84a2186a0d175e88345267c716516cd3
#第三方微信公众号发送地址(新华医院)
thirdWXUrl: http://192.16.4.220:8103/api
#钉钉的密钥
dingAppid: dingn8iip5ubj7clrrsv
@@ -127,8 +131,9 @@
pub_key: MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBALQzqW1EIXBKGMu+2oEYSB5gM7Ox/ihyYTeeoE0yPX1qtt4++5yNOeTBVd6EEM4iKzVEzWj6REIWVwaSNPn/SvUCAwEAAQ==
#这个是后端的私钥,用不到
#pri_key_me: MIIBUwIBADANBgkqhkiG9w0BAQEFAASCAT0wggE5AgEAAkEAtDOpbUQhcEoYy77agRhIHmAzs7H+KHJhN56gTTI9fWq23j77nI055MFV3oQQziIrNUTNaPpEQhZXBpI0+f9K9QIDAQABAkB3n0fcWfrcoMN/FU3VnrnZOEF6CzFNxkgU9P8y36QECWKZ9JhYQkNpKrMC9oXlN3VSaRigV7B+L/I/a0Rs1W+tAiEA4jx7xcXJ4y4BNwAmVHt6NNiEkzIwWnwC/0qsEu8NsOsCIQDL6MMn1D2uznC6OuOWpxDCkBh1JL1NzZTZeH2G+hj7nwIgKGAC9tjFnvWm4dn0/T7MIIJDpsFeP8fCAS2iZ/6hwuECIAS/eLvWr1EAsZNEh8QcQ8GkBU3E+ztyjAK8UX/xFt/VAiBf79/1tDErX4/DChecM8w3c3DhbBcjuE3fHZn7p6/UKg==
pri_key: MIIBVQIBADANBgkqhkiG9w0BAQEFAASCAT8wggE7AgEAAkEApHTIe/StslZAT5Jzv8XClbrqox32pfaTrP5IOCRJ3FaH/UZsGgA/tsNBBEXq9eagqwPbJrjYfpdEtINcChrK4wIDAQABAkEAilDujdKshGGmlUZHs/NQRT6AOdDpsYxBiC4V76IVvQpw0IW6c4HGEvH4T+xRufika7/48L0eu0f06H+YtL5lgQIhANUd0a6oSsVxWifAjtKwMZcXD3OaIxQIQSCN4NT4VFY3AiEAxYxYrIhkIyg+UVw3WOSvBpXKxM4/WL9HRzkxDLvp2rUCIQCK23P8tgCJ5xJT5l3onw6goFDcBKkoazxsBqVgfjENPwIgWbuTd+OIYPPhwsE5ntZZrosSDO2GlsBkFzUiU59z7VUCIA0LL+9IFb+FWCl3DGTwIQ9SZYbv61T83LKjebUcSOfe
pri_key: MIIBUwIBADANBgkqhkiG9w0BAQEFAASCAT0wggE5AgEAAkEAtDOpbUQhcEoYy77agRhIHmAzs7H+KHJhN56gTTI9fWq23j77nI055MFV3oQQziIrNUTNaPpEQhZXBpI0+f9K9QIDAQABAkB3n0fcWfrcoMN/FU3VnrnZOEF6CzFNxkgU9P8y36QECWKZ9JhYQkNpKrMC9oXlN3VSaRigV7B+L/I/a0Rs1W+tAiEA4jx7xcXJ4y4BNwAmVHt6NNiEkzIwWnwC/0qsEu8NsOsCIQDL6MMn1D2uznC6OuOWpxDCkBh1JL1NzZTZeH2G+hj7nwIgKGAC9tjFnvWm4dn0/T7MIIJDpsFeP8fCAS2iZ/6hwuECIAS/eLvWr1EAsZNEh8QcQ8GkBU3E+ztyjAK8UX/xFt/VAiBf79/1tDErX4/DChecM8w3c3DhbBcjuE3fHZn7p6/UKg==
#前端私钥(用不到了)
#pri_key: MIIBVQIBADANBgkqhkiG9w0BAQEFAASCAT8wggE7AgEAAkEApHTIe/StslZAT5Jzv8XClbrqox32pfaTrP5IOCRJ3FaH/UZsGgA/tsNBBEXq9eagqwPbJrjYfpdEtINcChrK4wIDAQABAkEAilDujdKshGGmlUZHs/NQRT6AOdDpsYxBiC4V76IVvQpw0IW6c4HGEvH4T+xRufika7/48L0eu0f06H+YtL5lgQIhANUd0a6oSsVxWifAjtKwMZcXD3OaIxQIQSCN4NT4VFY3AiEAxYxYrIhkIyg+UVw3WOSvBpXKxM4/WL9HRzkxDLvp2rUCIQCK23P8tgCJ5xJT5l3onw6goFDcBKkoazxsBqVgfjENPwIgWbuTd+OIYPPhwsE5ntZZrosSDO2GlsBkFzUiU59z7VUCIA0LL+9IFb+FWCl3DGTwIQ9SZYbv61T83LKjebUcSOfe
#二维码路径
qrpath: D:\qrcode
@@ -136,3 +141,6 @@
#外链请求IP和端口号
req_path: 8096
localIP: 192.168.1.10
#获取患者信息URL(华卓提供)
hosp_info_url: http://esb-core-rest.wowjoy.cn/esb/exchange
ruoyi-admin/src/main/resources/application.yml
@@ -72,13 +72,13 @@
  # redis é…ç½®
  redis:
    #    # åœ°å€ï¼ˆä¹‰ä¹ŒäºŒé™¢ï¼‰
    #    host: 127.0.0.1
    #    port: 6020
    host: 127.0.0.1
    port: 6020
    # åœ°å€ï¼ˆå…¬å¸ï¼‰
    #    host: 116.62.18.175
    host: 192.168.1.10
    port: 6020
#    host: 192.168.1.10
#    port: 6020
    # æ•°æ®åº“索引
    database: 0
    # å¯†ç 
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/CommonRes.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,33 @@
package com.ruoyi.common.core.domain;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@ApiModel("公共返回体")
public class CommonRes<T> implements Serializable {
    private static final long serialVersionUID = -1L;
    @ApiModelProperty(value = "返回码", notes = "200: è¯·æ±‚成功")
    private int code;
    @ApiModelProperty("返回码描述")
    private String msg;
    @ApiModelProperty("返回数据")
    private T data;
    @ApiModelProperty(value = "总记录数", notes = "分页情况下使用")
    private String totalRecord;
}
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java
@@ -3,6 +3,10 @@
import java.util.Date;
import java.util.List;
import javax.validation.constraints.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
@@ -14,311 +18,313 @@
/**
 * ç”¨æˆ·å¯¹è±¡ sys_user
 *
 *
 * @author ruoyi
 */
public class SysUser extends BaseEntity
{
@ApiModel(value = "SysUser", description = "用户对象")
public class SysUser extends BaseEntity {
    private static final long serialVersionUID = 1L;
    /** ç”¨æˆ·ID */
    /**
     * ç”¨æˆ·ID
     */
    @ApiModelProperty(value = "主键")
    @Excel(name = "用户序号", cellType = ColumnType.NUMERIC, prompt = "用户编号")
    private Long userId;
    /** éƒ¨é—¨ID */
    /**
     * éƒ¨é—¨ID
     */
    @ApiModelProperty(value = "部门ID")
    @Excel(name = "部门编号", type = Type.IMPORT)
    private Long deptId;
    /** ç”¨æˆ·è´¦å· */
    /**
     * ç”¨æˆ·è´¦å·
     */
    @ApiModelProperty(value = "用户账号")
    @Excel(name = "登录名称")
    private String userName;
    /** ç”¨æˆ·æ˜µç§° */
    /**
     * ç”¨æˆ·æ˜µç§°
     */
    @ApiModelProperty(value = "用户昵称")
    @Excel(name = "用户名称")
    private String nickName;
    /** ç”¨æˆ·é‚®ç®± */
    /**
     * ç”¨æˆ·é‚®ç®±
     */
    @ApiModelProperty(value = "用户邮箱")
    @Excel(name = "用户邮箱")
    private String email;
    /** æ‰‹æœºå·ç  */
    /**
     * æ‰‹æœºå·ç 
     */
    @ApiModelProperty(value = "手机号码")
    @Excel(name = "手机号码")
    private String phonenumber;
    /** ç”¨æˆ·æ€§åˆ« */
    /**
     * ç”¨æˆ·æ€§åˆ«
     */
    @ApiModelProperty(value = "用户性别")
    @Excel(name = "用户性别", readConverterExp = "0=男,1=女,2=未知")
    private String sex;
    /** ç”¨æˆ·å¤´åƒ */
    /**
     * ç”¨æˆ·å¤´åƒ
     */
    @ApiModelProperty(value = "用户头像")
    private String avatar;
    /** å¯†ç  */
    /**
     * å¯†ç 
     */
    @ApiModelProperty(value = "密码")
    private String password;
    /** å¸å·çŠ¶æ€ï¼ˆ0正常 1停用) */
    /**
     * å¸å·çŠ¶æ€ï¼ˆ0正常 1停用)
     */
    @ApiModelProperty(value = "帐号状态(0正常 1停用)")
    @Excel(name = "帐号状态", readConverterExp = "0=正常,1=停用")
    private String status;
    /** åˆ é™¤æ ‡å¿—(0代表存在 2代表删除) */
    /**
     * åˆ é™¤æ ‡å¿—(0代表存在 2代表删除)
     */
    @ApiModelProperty(value = "删除标志(0代表存在 2代表删除)")
    private String delFlag;
    /** æœ€åŽç™»å½•IP */
    /**
     * æœ€åŽç™»å½•IP
     */
    @ApiModelProperty(value = "最后登录IP")
    @Excel(name = "最后登录IP", type = Type.EXPORT)
    private String loginIp;
    /** æœ€åŽç™»å½•æ—¶é—´ */
    /**
     * æœ€åŽç™»å½•æ—¶é—´
     */
    @ApiModelProperty(value = "最后登录时间")
    @Excel(name = "最后登录时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Type.EXPORT)
    private Date loginDate;
    /** éƒ¨é—¨å¯¹è±¡ */
    @Excels({
        @Excel(name = "部门名称", targetAttr = "deptName", type = Type.EXPORT),
        @Excel(name = "部门负责人", targetAttr = "leader", type = Type.EXPORT)
    })
    /**
     * éƒ¨é—¨å¯¹è±¡
     */
    @ApiModelProperty(value = "部门对象")
    @Excels({@Excel(name = "部门名称", targetAttr = "deptName", type = Type.EXPORT), @Excel(name = "部门负责人", targetAttr = "leader", type = Type.EXPORT)})
    private SysDept dept;
    /** è§’色对象 */
    @ApiModelProperty(value = "部门集合")
    private List<Long> depts;
    /**
     * è§’色对象
     */
    @ApiModelProperty(value = "角色对象")
    private List<SysRole> roles;
    /** è§’色组 */
    /**
     * è§’色组
     */
    @ApiModelProperty(value = "角色组")
    private Long[] roleIds;
    /** å²—位组 */
    /**
     * å²—位组
     */
    @ApiModelProperty(value = "岗位组")
    private Long[] postIds;
    /** è§’色ID */
    /**
     * è§’色ID
     */
    @ApiModelProperty(value = "角色ID")
    private Long roleId;
    public SysUser()
    {
    public SysUser() {
    }
    public SysUser(Long userId)
    {
    public SysUser(Long userId) {
        this.userId = userId;
    }
    public Long getUserId()
    {
    public Long getUserId() {
        return userId;
    }
    public void setUserId(Long userId)
    {
    public void setUserId(Long userId) {
        this.userId = userId;
    }
    public boolean isAdmin()
    {
    public boolean isAdmin() {
        return isAdmin(this.userId);
    }
    public static boolean isAdmin(Long userId)
    {
    public static boolean isAdmin(Long userId) {
        return userId != null && 1L == userId;
    }
    public Long getDeptId()
    {
    public Long getDeptId() {
        return deptId;
    }
    public void setDeptId(Long deptId)
    {
    public void setDeptId(Long deptId) {
        this.deptId = deptId;
    }
    @Xss(message = "用户昵称不能包含脚本字符")
    @Size(min = 0, max = 30, message = "用户昵称长度不能超过30个字符")
    public String getNickName()
    {
    public String getNickName() {
        return nickName;
    }
    public void setNickName(String nickName)
    {
    public void setNickName(String nickName) {
        this.nickName = nickName;
    }
    @Xss(message = "用户账号不能包含脚本字符")
    @NotBlank(message = "用户账号不能为空")
    @Size(min = 0, max = 30, message = "用户账号长度不能超过30个字符")
    public String getUserName()
    {
    public String getUserName() {
        return userName;
    }
    public void setUserName(String userName)
    {
    public void setUserName(String userName) {
        this.userName = userName;
    }
    @Email(message = "邮箱格式不正确")
    @Size(min = 0, max = 50, message = "邮箱长度不能超过50个字符")
    public String getEmail()
    {
    public String getEmail() {
        return email;
    }
    public void setEmail(String email)
    {
    public void setEmail(String email) {
        this.email = email;
    }
    @Size(min = 0, max = 11, message = "手机号码长度不能超过11个字符")
    public String getPhonenumber()
    {
    public String getPhonenumber() {
        return phonenumber;
    }
    public void setPhonenumber(String phonenumber)
    {
    public void setPhonenumber(String phonenumber) {
        this.phonenumber = phonenumber;
    }
    public String getSex()
    {
    public String getSex() {
        return sex;
    }
    public void setSex(String sex)
    {
    public void setSex(String sex) {
        this.sex = sex;
    }
    public String getAvatar()
    {
    public String getAvatar() {
        return avatar;
    }
    public void setAvatar(String avatar)
    {
    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }
    public String getPassword()
    {
    public String getPassword() {
        return password;
    }
    public void setPassword(String password)
    {
    public void setPassword(String password) {
        this.password = password;
    }
    public String getStatus()
    {
    public String getStatus() {
        return status;
    }
    public void setStatus(String status)
    {
    public void setStatus(String status) {
        this.status = status;
    }
    public String getDelFlag()
    {
    public String getDelFlag() {
        return delFlag;
    }
    public void setDelFlag(String delFlag)
    {
    public void setDelFlag(String delFlag) {
        this.delFlag = delFlag;
    }
    public String getLoginIp()
    {
    public String getLoginIp() {
        return loginIp;
    }
    public void setLoginIp(String loginIp)
    {
    public void setLoginIp(String loginIp) {
        this.loginIp = loginIp;
    }
    public Date getLoginDate()
    {
    public Date getLoginDate() {
        return loginDate;
    }
    public void setLoginDate(Date loginDate)
    {
    public void setLoginDate(Date loginDate) {
        this.loginDate = loginDate;
    }
    public SysDept getDept()
    {
    public SysDept getDept() {
        return dept;
    }
    public void setDept(SysDept dept)
    {
    public void setDept(SysDept dept) {
        this.dept = dept;
    }
    public List<SysRole> getRoles()
    {
    public List<SysRole> getRoles() {
        return roles;
    }
    public void setRoles(List<SysRole> roles)
    {
    public void setRoles(List<SysRole> roles) {
        this.roles = roles;
    }
    public Long[] getRoleIds()
    {
    public Long[] getRoleIds() {
        return roleIds;
    }
    public void setRoleIds(Long[] roleIds)
    {
    public void setRoleIds(Long[] roleIds) {
        this.roleIds = roleIds;
    }
    public Long[] getPostIds()
    {
    public Long[] getPostIds() {
        return postIds;
    }
    public void setPostIds(Long[] postIds)
    {
    public void setPostIds(Long[] postIds) {
        this.postIds = postIds;
    }
    public Long getRoleId()
    {
    public Long getRoleId() {
        return roleId;
    }
    public void setRoleId(Long roleId)
    {
    public void setRoleId(Long roleId) {
        this.roleId = roleId;
    }
    public List<Long> getDepts() {
        return depts;
    }
    public void setDepts(List<Long> depts) {
        this.depts = depts;
    }
    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("userId", getUserId())
            .append("deptId", getDeptId())
            .append("userName", getUserName())
            .append("nickName", getNickName())
            .append("email", getEmail())
            .append("phonenumber", getPhonenumber())
            .append("sex", getSex())
            .append("avatar", getAvatar())
            .append("password", getPassword())
            .append("status", getStatus())
            .append("delFlag", getDelFlag())
            .append("loginIp", getLoginIp())
            .append("loginDate", getLoginDate())
            .append("createBy", getCreateBy())
            .append("createTime", getCreateTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .append("remark", getRemark())
            .append("dept", getDept())
            .toString();
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).append("userId", getUserId()).append("deptId", getDeptId()).append("userName", getUserName()).append("nickName", getNickName()).append("email", getEmail()).append("phonenumber", getPhonenumber()).append("sex", getSex()).append("avatar", getAvatar()).append("password", getPassword()).append("status", getStatus()).append("delFlag", getDelFlag()).append("loginIp", getLoginIp()).append("loginDate", getLoginDate()).append("createBy", getCreateBy()).append("createTime", getCreateTime()).append("updateBy", getUpdateBy()).append("updateTime", getUpdateTime()).append("remark", getRemark()).append("dept", getDept()).toString();
    }
}
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUserDept.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,47 @@
package com.ruoyi.common.core.domain.entity;
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;
/**
 * ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘å¯¹è±¡ sys_user_dept
 *
 * @author lihu
 * @date 2024-08-29
 */
@Data
@ApiModel("【请填写功能名称】")
public class SysUserDept extends BaseEntity {
    private static final long serialVersionUID = 1L;
    /**
     * $column.columnComment
     */
    @ApiModelProperty("$column.columnComment")
    //数据库自增改成@TableId(type = IdType.AUTO)
    private Long id;
    /**
     * ç”¨æˆ·ID
     */
    @ApiModelProperty("用户ID")
    @Excel(name = "用户ID")
    private Long userId;
    /**
     * éƒ¨é—¨ID
     */
    @ApiModelProperty("部门ID")
    @Excel(name = "部门ID")
    private Long deptId;
    /** åˆ é™¤æ ‡å¿—(0代表存在 2代表删除) */
    @ApiModelProperty("删除标志(0代表存在 1代表删除)")
    private Long delFlag;
}
ruoyi-common/src/main/java/com/ruoyi/common/utils/RSAPublicKeyExample.java
@@ -4,6 +4,10 @@
import org.springframework.stereotype.Component;
import javax.crypto.Cipher;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.security.KeyFactory;
import java.security.PrivateKey;
import java.security.PublicKey;
@@ -54,8 +58,7 @@
     * @return
     */
    public String encryptedData(String plainText, String pub_key) {
        String publicKeyString = "公钥的Base64编码字符串"; // å‰ç«¯ä¼ é€’的公钥字符串
        // å°†å…¬é’¥Base64编码字符串转换为PublicKey对象
        log.error("需要加密的数据:{}", plainText);
        try {
            byte[] publicKeyBytes = Base64.getDecoder().decode(pub_key);
@@ -70,7 +73,11 @@
            // å°†åŠ å¯†åŽçš„æ•°æ®è½¬æ¢ä¸ºBase64编码的字符串
            String encryptedText = Base64.getEncoder().encodeToString(encryptedBytes);
            System.out.println("加密后的数据:" + encryptedText);
            log.error("Base64加密后的数据:{}", encryptedText);
            encryptedText = URLEncoder.encode(encryptedText, StandardCharsets.UTF_8.toString());
            log.error("URLEncoder编码后的数据:{}", encryptedText);
            String decodedString = URLDecoder.decode(encryptedText, "UTF-8");
            log.error("URLEncoder解码后的数据:{}", decodedString);
            return encryptedText;
        } catch (Exception e) {
            log.error("加密失败了:{}", e.getMessage());
@@ -78,5 +85,14 @@
        return null;
    }
    public static void main(String[] args) {
        String decodedString = null;
        try {
            decodedString = URLDecoder.decode("0902%E4%BB%BB%E5%8A%A1%E6%B5%8B%E8%AF%95--------", "UTF-8");
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        System.out.println(decodedString);
    }
}
ruoyi-common/src/main/java/com/ruoyi/common/utils/http/HttpUtils.java
@@ -11,12 +11,15 @@
import java.net.URLConnection;
import java.nio.charset.StandardCharsets;
import java.security.cert.X509Certificate;
import java.util.Map;
import java.util.Objects;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSession;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.ruoyi.common.constant.Constants;
@@ -24,11 +27,10 @@
/**
 * é€šç”¨http发送方法
 *
 *
 * @author ruoyi
 */
public class HttpUtils
{
public class HttpUtils {
    private static final Logger log = LoggerFactory.getLogger(HttpUtils.class);
    /**
@@ -37,37 +39,33 @@
     * @param url å‘送请求的 URL
     * @return æ‰€ä»£è¡¨è¿œç¨‹èµ„源的响应结果
     */
    public static String sendGet(String url)
    {
    public static String sendGet(String url) {
        return sendGet(url, StringUtils.EMPTY);
    }
    /**
     * å‘指定 URL å‘送GET方法的请求
     *
     * @param url å‘送请求的 URL
     * @param url   å‘送请求的 URL
     * @param param è¯·æ±‚参数,请求参数应该是 name1=value1&name2=value2 çš„形式。
     * @return æ‰€ä»£è¡¨è¿œç¨‹èµ„源的响应结果
     */
    public static String sendGet(String url, String param)
    {
    public static String sendGet(String url, String param) {
        return sendGet(url, param, Constants.UTF8);
    }
    /**
     * å‘指定 URL å‘送GET方法的请求
     *
     * @param url å‘送请求的 URL
     * @param param è¯·æ±‚参数,请求参数应该是 name1=value1&name2=value2 çš„形式。
     * @param url         å‘送请求的 URL
     * @param param       è¯·æ±‚参数,请求参数应该是 name1=value1&name2=value2 çš„形式。
     * @param contentType ç¼–码类型
     * @return æ‰€ä»£è¡¨è¿œç¨‹èµ„源的响应结果
     */
    public static String sendGet(String url, String param, String contentType)
    {
    public static String sendGet(String url, String param, String contentType) {
        StringBuilder result = new StringBuilder();
        BufferedReader in = null;
        try
        {
        try {
            String urlNameString = StringUtils.isNotBlank(param) ? url + "?" + param : url;
//            log.info("sendGet - {}", urlNameString);
            URL realUrl = new URL(urlNameString);
@@ -78,39 +76,24 @@
            connection.connect();
            in = new BufferedReader(new InputStreamReader(connection.getInputStream(), contentType));
            String line;
            while ((line = in.readLine()) != null)
            {
            while ((line = in.readLine()) != null) {
                result.append(line);
            }
        //    log.info("recv - {}", result);
        }
        catch (ConnectException e)
        {
            //    log.info("recv - {}", result);
        } catch (ConnectException e) {
            log.error("调用HttpUtils.sendGet ConnectException, url=" + url + ",param=" + param, e);
        }
        catch (SocketTimeoutException e)
        {
        } catch (SocketTimeoutException e) {
            log.error("调用HttpUtils.sendGet SocketTimeoutException, url=" + url + ",param=" + param, e);
        }
        catch (IOException e)
        {
        } catch (IOException e) {
            log.error("调用HttpUtils.sendGet IOException, url=" + url + ",param=" + param, e);
        }
        catch (Exception e)
        {
        } catch (Exception e) {
            log.error("调用HttpsUtil.sendGet Exception, url=" + url + ",param=" + param, e);
        }
        finally
        {
            try
            {
                if (in != null)
                {
        } finally {
            try {
                if (in != null) {
                    in.close();
                }
            }
            catch (Exception ex)
            {
            } catch (Exception ex) {
                log.error("调用in.close Exception, url=" + url + ",param=" + param, ex);
            }
        }
@@ -120,17 +103,15 @@
    /**
     * å‘指定 URL å‘送POST方法的请求
     *
     * @param url å‘送请求的 URL
     * @param url   å‘送请求的 URL
     * @param param è¯·æ±‚参数,请求参数应该是 name1=value1&name2=value2 çš„形式。
     * @return æ‰€ä»£è¡¨è¿œç¨‹èµ„源的响应结果
     */
    public static String sendPost(String url, String param)
    {
    public static String sendPost(String url, String param) {
        PrintWriter out = null;
        BufferedReader in = null;
        StringBuilder result = new StringBuilder();
        try
        {
        try {
            log.info("sendPost - {}", url);
            URL realUrl = new URL(url);
            URLConnection conn = realUrl.openConnection();
@@ -146,58 +127,91 @@
            out.flush();
            in = new BufferedReader(new InputStreamReader(conn.getInputStream(), StandardCharsets.UTF_8));
            String line;
            while ((line = in.readLine()) != null)
            {
            while ((line = in.readLine()) != null) {
                result.append(line);
            }
            log.info("recv - {}", result);
        }
        catch (ConnectException e)
        {
        } catch (ConnectException e) {
            log.error("调用HttpUtils.sendPost ConnectException, url=" + url + ",param=" + param, e);
        }
        catch (SocketTimeoutException e)
        {
        } catch (SocketTimeoutException e) {
            log.error("调用HttpUtils.sendPost SocketTimeoutException, url=" + url + ",param=" + param, e);
        }
        catch (IOException e)
        {
        } catch (IOException e) {
            log.error("调用HttpUtils.sendPost IOException, url=" + url + ",param=" + param, e);
        }
        catch (Exception e)
        {
        } catch (Exception e) {
            log.error("调用HttpsUtil.sendPost Exception, url=" + url + ",param=" + param, e);
        }
        finally
        {
            try
            {
                if (out != null)
                {
        } finally {
            try {
                if (out != null) {
                    out.close();
                }
                if (in != null)
                {
                if (in != null) {
                    in.close();
                }
            }
            catch (IOException ex)
            {
            } catch (IOException ex) {
                log.error("调用in.close Exception, url=" + url + ",param=" + param, ex);
            }
        }
        return result.toString();
    }
    public static String sendSSLPost(String url, String param)
    {
    public static String sendPostByHeader(String url, String param, Map<String, String> headers) {
        PrintWriter out = null;
        BufferedReader in = null;
        StringBuilder result = new StringBuilder();
        try {
            log.info("sendPost - {}", url);
            URL realUrl = new URL(url);
            URLConnection conn = realUrl.openConnection();
            conn.setRequestProperty("accept", "*/*");
            conn.setRequestProperty("connection", "Keep-Alive");
            conn.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
            conn.setRequestProperty("Accept-Charset", "utf-8");
            conn.setRequestProperty("contentType", "utf-8");
            conn.setDoOutput(true);
            conn.setDoInput(true);
            if (!Objects.isNull(headers)) {
                for (Map.Entry<String, String> entry : headers.entrySet()) {
                    conn.setRequestProperty(entry.getKey(), entry.getValue());
                }
            }
            out = new PrintWriter(conn.getOutputStream());
            out.print(param);
            out.flush();
            in = new BufferedReader(new InputStreamReader(conn.getInputStream(), StandardCharsets.UTF_8));
            String line;
            while ((line = in.readLine()) != null) {
                result.append(line);
            }
        } catch (ConnectException e) {
            log.error("调用HttpUtils.sendPost ConnectException, url=" + url + ",param=" + param, e);
        } catch (SocketTimeoutException e) {
            log.error("调用HttpUtils.sendPost SocketTimeoutException, url=" + url + ",param=" + param, e);
        } catch (IOException e) {
            log.error("调用HttpUtils.sendPost IOException, url=" + url + ",param=" + param, e);
        } catch (Exception e) {
            log.error("调用HttpsUtil.sendPost Exception, url=" + url + ",param=" + param, e);
        } finally {
            try {
                if (out != null) {
                    out.close();
                }
                if (in != null) {
                    in.close();
                }
            } catch (IOException ex) {
                log.error("调用in.close Exception, url=" + url + ",param=" + param, ex);
            }
        }
        return result.toString();
    }
    public static String sendSSLPost(String url, String param) {
        StringBuilder result = new StringBuilder();
        String urlNameString = url + "?" + param;
        try
        {
        try {
            log.info("sendSSLPost - {}", urlNameString);
            SSLContext sc = SSLContext.getInstance("SSL");
            sc.init(null, new TrustManager[] { new TrustAnyTrustManager() }, new java.security.SecureRandom());
            sc.init(null, new TrustManager[]{new TrustAnyTrustManager()}, new java.security.SecureRandom());
            URL console = new URL(urlNameString);
            HttpsURLConnection conn = (HttpsURLConnection) console.openConnection();
            conn.setRequestProperty("accept", "*/*");
@@ -214,61 +228,45 @@
            InputStream is = conn.getInputStream();
            BufferedReader br = new BufferedReader(new InputStreamReader(is));
            String ret = "";
            while ((ret = br.readLine()) != null)
            {
                if (ret != null && !"".equals(ret.trim()))
                {
            while ((ret = br.readLine()) != null) {
                if (ret != null && !"".equals(ret.trim())) {
                    result.append(new String(ret.getBytes(StandardCharsets.ISO_8859_1), StandardCharsets.UTF_8));
                }
            }
            log.info("recv - {}", result);
            conn.disconnect();
            br.close();
        }
        catch (ConnectException e)
        {
        } catch (ConnectException e) {
            log.error("调用HttpUtils.sendSSLPost ConnectException, url=" + url + ",param=" + param, e);
        }
        catch (SocketTimeoutException e)
        {
        } catch (SocketTimeoutException e) {
            log.error("调用HttpUtils.sendSSLPost SocketTimeoutException, url=" + url + ",param=" + param, e);
        }
        catch (IOException e)
        {
        } catch (IOException e) {
            log.error("调用HttpUtils.sendSSLPost IOException, url=" + url + ",param=" + param, e);
        }
        catch (Exception e)
        {
        } catch (Exception e) {
            log.error("调用HttpsUtil.sendSSLPost Exception, url=" + url + ",param=" + param, e);
        }
        return result.toString();
    }
    private static class TrustAnyTrustManager implements X509TrustManager
    {
    private static class TrustAnyTrustManager implements X509TrustManager {
        @Override
        public void checkClientTrusted(X509Certificate[] chain, String authType)
        {
        public void checkClientTrusted(X509Certificate[] chain, String authType) {
        }
        @Override
        public void checkServerTrusted(X509Certificate[] chain, String authType)
        {
        public void checkServerTrusted(X509Certificate[] chain, String authType) {
        }
        @Override
        public X509Certificate[] getAcceptedIssuers()
        {
            return new X509Certificate[] {};
        public X509Certificate[] getAcceptedIssuers() {
            return new X509Certificate[]{};
        }
    }
    private static class TrustAnyHostnameVerifier implements HostnameVerifier
    {
    private static class TrustAnyHostnameVerifier implements HostnameVerifier {
        @Override
        public boolean verify(String hostname, SSLSession session)
        {
        public boolean verify(String hostname, SSLSession session) {
            return true;
        }
    }
}
}
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/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("/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/subtaskAnswer/getQuestionCache", "/smartor/subtaskAnswer/saveQuestionCache", "/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-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java
@@ -1,21 +1,34 @@
package com.ruoyi.quartz.task;
import com.alibaba.fastjson2.JSON;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.reflect.TypeToken;
import com.google.gson.JsonObject;
import com.google.gson.JsonArray;
import com.google.gson.Gson;
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.ruoyi.common.utils.http.HttpUtils;
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.apache.commons.lang3.math.NumberUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import java.lang.reflect.Type;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
/**
@@ -64,6 +77,18 @@
    @Autowired
    IBaseSmsaccountService baseSmsaccountService;
    @Autowired
    IPatArchiveService patArchiveService;
    @Autowired
    IPatMedInhospService patMedInhospService;
    @Autowired
    IPatMedOuthospService patMedOuthospService;
    @Value("${hosp_info_url}")
    private String hospInfoUrl;
    public void ryMultipleParams(String s, Boolean b, Long l, Double d, Integer i) {
        System.out.println(StringUtils.format("执行多参方法: å­—符串类型{},布尔类型{},长整型{},浮点型{},整形{}", s, b, l, d, i));
    }
@@ -100,7 +125,8 @@
     */
    public void dealHisData() {
        //将患者信息、出院、门诊数据全部采集
        getInHospInfo("0");
        getInHospInfo("1");
        //调用dealOupHospInfo数据处理方法,处理完后,将“出院表的check_flag=1”
        //获取当前日期 ï¼ˆç²¾ç¡®åˆ°å¤©ï¼‰å¾€å‰æŽ¨ç›¸åº”天数(在指定的基础模板中找对应的天数),
@@ -115,13 +141,13 @@
     */
    public void longTaskSend() {
        //获取任务信息
        ServiceTask st =new ServiceTask();
        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();
            ServiceSubtaskVO serviceSubtask = new ServiceSubtaskVO();
            serviceSubtask.setTaskid(serviceTask.getTaskid());
            serviceSubtask.setSendstate(2L);
            List<ServiceSubtask> selectServiceSubtaskList = iServiceSubtaskService.selectServiceSubtaskList(serviceSubtask);
@@ -177,7 +203,7 @@
                String descByCode = ServiceFromEnum.getDescByCode(Integer.valueOf(serviceFrom));
                //这里可以考虑用策略模式优化一下,不然太难看了
                //通过任务ID拿到患者信息
                ServiceSubtask ivrTaskcall = new ServiceSubtask();
                ServiceSubtaskVO ivrTaskcall = new ServiceSubtaskVO();
                ivrTaskcall.setTaskid(commonTaskcallMQ.getTaskid());
                List<ServiceSubtask> selectServiceSubtaskList = iServiceSubtaskService.selectServiceSubtaskList(ivrTaskcall);
                if (descByCode.equals("电话")) {
@@ -192,7 +218,7 @@
                        if (commonTaskcallMQ.getSendType().equals("2")) {
                            //说明是立即发送
                            String value = redisCache.getCacheObject("cache-0");
                            ServiceSubtask serviceSubtask1 = new ServiceSubtask();
                            ServiceSubtaskVO serviceSubtask1 = new ServiceSubtaskVO();
                            serviceSubtask1.setTaskid(commonTaskcallMQ.getTaskid());
                            List<ServiceSubtask> selectServiceSubtaskList1 = iServiceSubtaskService.selectServiceSubtaskList(serviceSubtask1);
                            for (ServiceSubtask serviceSubtask2 : selectServiceSubtaskList1) {
@@ -206,7 +232,7 @@
                        } else {
                            //非立即发送
                            String value = redisCache.getCacheObject(key);
                            ServiceSubtask serviceSubtask1 = new ServiceSubtask();
                            ServiceSubtaskVO serviceSubtask1 = new ServiceSubtaskVO();
                            serviceSubtask1.setTaskid(commonTaskcallMQ.getTaskid());
                            List<ServiceSubtask> selectServiceSubtaskList1 = iServiceSubtaskService.selectServiceSubtaskList(serviceSubtask1);
                            for (ServiceSubtask serviceSubtask2 : selectServiceSubtaskList1) {
@@ -297,6 +323,123 @@
        }
    }
    /**
     * èŽ·å‡ºé™¢æ‚£è€…ä¿¡æ¯
     * cry    å‡ºå…¥é™¢ï¼š 0 å…¥é™¢   1 å‡ºé™¢
     */
    private void getInHospInfo(String cry) {
        // èŽ·å–å½“å‰æ—¥æœŸå’Œæ—¶é—´
        LocalDateTime currentDateTime = LocalDateTime.now();
        // èŽ·å–å‰ä¸€å¤©çš„æ—¥æœŸå’Œæ—¶é—´
        LocalDateTime previousDateTime = currentDateTime.minusDays(1);
        // å®šä¹‰æ—¥æœŸæ—¶é—´æ ¼å¼
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.S");
        Map<String, String> req = new HashMap<>();
        if (cry.equals("1")) {
            req.put("startTime", previousDateTime.format(formatter));
            req.put("endTime", currentDateTime.format(formatter));
            req.put("currStatus", "4");
        } else if (cry.equals("0")) {
            req.put("admissStartDate", previousDateTime.format(formatter));
            req.put("admissEndDate", currentDateTime.format(formatter));
            req.put("currStatus", "2");
        }
        Map<String, String> header = new HashMap<>();
        header.put("x-hcsb-serviceno", "IS002347");
        header.put("x-hcsb-version", "2.0");
        header.put("x-hcsb-sourcesyscode", "14");
        header.put("x-hcsb-token", "ArGE2JnHtxG/Zx5nrnGY4eOfMUJGGJokAJHigG1BrCY=");
        header.put("x-hcsb-msgdate", currentDateTime.format(formatter));
        String result = HttpUtils.sendPostByHeader(hospInfoUrl, new Gson().toJson(req), header);
        //数据解析
        Gson gson = new Gson();
        JsonObject jsonObject = gson.fromJson(result, JsonObject.class);
        JsonArray resultArray = jsonObject.getAsJsonObject("data").getAsJsonArray("result");
        Type resultType = new TypeToken<List<ThiedInhospInfo>>() {
        }.getType();
        List<ThiedInhospInfo> thiedInhospInfoList = gson.fromJson(resultArray, resultType);
        if (CollectionUtils.isNotEmpty(thiedInhospInfoList)) {
            for (ThiedInhospInfo thiedInhospInfo : thiedInhospInfoList) {
                //通过身份证号查询该患者在患者表是否存在
                PatArchive patArchive = new PatArchive();
                patArchive.setIdcardno(thiedInhospInfo.getPatiIdCardNo());
                List<PatArchive> patArchives = patArchiveService.selectPatArchiveList(patArchive);
                if (CollectionUtils.isEmpty(patArchives)) {
                    patArchive.setPatientno(thiedInhospInfo.getPatiMediaNo());
                    patArchive.setSourcefrom(2);
                    patArchive.setPattype("2");
                    patArchive.setSex(thiedInhospInfo.getPatiRecordGender().equals("男") ? 1L : 2L);
                    patArchive.setNation(thiedInhospInfo.getPatiNation());
                    patArchive.setNativePlace(thiedInhospInfo.getPatiNationality());
                    patArchive.setPlaceOfResidence(thiedInhospInfo.getPatiHomeAddr());
                    try {
                        if (StringUtils.isNotEmpty(thiedInhospInfo.getPatiBirthday()))
                            patArchive.setBirthdate(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(thiedInhospInfo.getPatiBirthday()));
                    } catch (ParseException e) {
                        e.printStackTrace();
                    }
                    String age = thiedInhospInfo.getAge().replaceAll("岁", "");
                    boolean creatable = NumberUtils.isCreatable(age);
                    if (creatable) patArchive.setAge(StringUtils.isNotEmpty(age) ? Long.valueOf(age) : null);
                    patArchive.setTelcode(thiedInhospInfo.getCompanyTelNum());
                    patArchive.setRelativetelcode(thiedInhospInfo.getContactPersonPhone());
                    patArchive.setDelFlag("0");
                    patArchive.setCreateTime(new Date());
                    patArchive.setUpdateTime(new Date());
                    patArchive.setName(thiedInhospInfo.getPatiRecordName());
                    patArchiveService.insertPatArchive(patArchive);
                }
                PatMedInhosp patMedInhosp = new PatMedInhosp();
                patMedInhosp.setPatid(patArchive.getId());
                patMedInhosp.setPatno(patArchive.getPatientno());
                patMedInhosp.setPatname(patArchive.getName());
                patMedInhosp.setSerialnum(thiedInhospInfo.getInpatientId());
                if (cry.equals("0")) {
                    patMedInhosp.setInhospstate("0");
                } else if (cry.equals("1")) {
                    patMedInhosp.setInhospstate("1");
                }
                patMedInhosp.setHospitalcode(thiedInhospInfo.getAreaId());
                patMedInhosp.setIcd10code(thiedInhospInfo.getDiagIcd10());
                patMedInhosp.setDiagname(thiedInhospInfo.getDiagName());
                try {
                    if (StringUtils.isNotEmpty(thiedInhospInfo.getAdmissDate()))
                        patMedInhosp.setStarttime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(thiedInhospInfo.getAdmissDate()));
                } catch (ParseException e) {
                    e.printStackTrace();
                }
                try {
                    if (StringUtils.isNotEmpty(thiedInhospInfo.getOutDate()))
                        patMedInhosp.setEndtime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(thiedInhospInfo.getOutDate()));
                } catch (ParseException e) {
                    e.printStackTrace();
                }
                patMedInhosp.setDeptcode(thiedInhospInfo.getAdmissDeptId());
                patMedInhosp.setDeptid(thiedInhospInfo.getAdmissDeptId());
                patMedInhosp.setDeptname(thiedInhospInfo.getAdmissDeptName());
                patMedInhosp.setBedNo(thiedInhospInfo.getAdmissBedNo());
                patMedInhosp.setDelFlag("0");
                patMedInhosp.setLeaveldeptcode(thiedInhospInfo.getCurrWardId());
                patMedInhosp.setLeaveldeptname(thiedInhospInfo.getCurrWardName());
                patMedInhosp.setLeavediagname(thiedInhospInfo.getDiagName());
                patMedInhosp.setLeaveicd10code(thiedInhospInfo.getDiagIcd10());
                patMedInhosp.setDrname(thiedInhospInfo.getDoctName());
                if (cry.equals("0")) {
                    patMedInhosp.setSchemestatus(1L);
                } else if (cry.equals("1")) {
                    patMedInhosp.setSchemestatus(2L);
                }
                patMedInhosp.setLeavehospitaldistrictcode(thiedInhospInfo.getCurrWardId());
                patMedInhosp.setLeavehospitaldistrictid(thiedInhospInfo.getCurrWardId());
                patMedInhosp.setLeavehospitaldistrictname(thiedInhospInfo.getCurrWardName());
                patMedInhosp.setLeaveldeptid(thiedInhospInfo.getCurrDeptId());
                patMedInhospService.insertPatMedInhosp(patMedInhosp);
            }
        }
    }
    private String getKey() {
        Map<String, String> map = new HashMap<>();
        for (int i = 0; i < 6; i++) {
ruoyi-system/pom.xml
@@ -33,4 +33,4 @@
    </dependencies>
</project>
</project>
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserDeptService.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,62 @@
package com.ruoyi.system.service;
import com.ruoyi.common.core.domain.entity.SysUserDept;
import java.util.List;
/**
 * ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘Service接口
 *
 * @author lihu
 * @date 2024-08-29
 */
public interface ISysUserDeptService
{
    /**
     * æŸ¥è¯¢ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘
     *
     * @param id ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘ä¸»é”®
     * @return ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘
     */
    public SysUserDept selectSysUserDeptById(Long id);
    /**
     * æŸ¥è¯¢ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘åˆ—è¡¨
     *
     * @param sysUserDept ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘
     * @return ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘é›†åˆ
     */
    public List<SysUserDept> selectSysUserDeptList(SysUserDept sysUserDept);
    /**
     * æ–°å¢žã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘
     *
     * @param sysUserDept ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘
     * @return ç»“æžœ
     */
    public int insertSysUserDept(SysUserDept sysUserDept);
    /**
     * ä¿®æ”¹ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘
     *
     * @param sysUserDept ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘
     * @return ç»“æžœ
     */
    public int updateSysUserDept(SysUserDept sysUserDept);
    /**
     * æ‰¹é‡åˆ é™¤ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘
     *
     * @param ids éœ€è¦åˆ é™¤çš„【请填写功能名称】主键集合
     * @return ç»“æžœ
     */
    public int deleteSysUserDeptByIds(Long[] ids);
    /**
     * åˆ é™¤ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘ä¿¡æ¯
     *
     * @param id ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘ä¸»é”®
     * @return ç»“æžœ
     */
    public int deleteSysUserDeptById(Long id);
}
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserDeptServiceImpl.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,94 @@
package com.ruoyi.system.service.impl;
import com.ruoyi.common.core.domain.entity.SysUserDept;
import com.ruoyi.system.service.ISysUserDeptService;
import com.smartor.mapper.SysUserDeptMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
 * ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘Service业务层处理
 *
 * @author lihu
 * @date 2024-08-29
 */
@Service
public class SysUserDeptServiceImpl implements ISysUserDeptService
{
    @Autowired
    private SysUserDeptMapper sysUserDeptMapper;
    /**
     * æŸ¥è¯¢ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘
     *
     * @param id ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘ä¸»é”®
     * @return ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘
     */
    @Override
    public SysUserDept selectSysUserDeptById(Long id)
    {
        return sysUserDeptMapper.selectSysUserDeptById(id);
    }
    /**
     * æŸ¥è¯¢ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘åˆ—è¡¨
     *
     * @param sysUserDept ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘
     * @return ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘
     */
    @Override
    public List<SysUserDept> selectSysUserDeptList(SysUserDept sysUserDept)
    {
        return sysUserDeptMapper.selectSysUserDeptList(sysUserDept);
    }
    /**
     * æ–°å¢žã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘
     *
     * @param sysUserDept ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘
     * @return ç»“æžœ
     */
    @Override
    public int insertSysUserDept(SysUserDept sysUserDept)
    {
        return sysUserDeptMapper.insertSysUserDept(sysUserDept);
    }
    /**
     * ä¿®æ”¹ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘
     *
     * @param sysUserDept ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘
     * @return ç»“æžœ
     */
    @Override
    public int updateSysUserDept(SysUserDept sysUserDept)
    {
        return sysUserDeptMapper.updateSysUserDept(sysUserDept);
    }
    /**
     * æ‰¹é‡åˆ é™¤ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘
     *
     * @param ids éœ€è¦åˆ é™¤çš„【请填写功能名称】主键
     * @return ç»“æžœ
     */
    @Override
    public int deleteSysUserDeptByIds(Long[] ids)
    {
        return sysUserDeptMapper.deleteSysUserDeptByIds(ids);
    }
    /**
     * åˆ é™¤ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘ä¿¡æ¯
     *
     * @param id ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘ä¸»é”®
     * @return ç»“æžœ
     */
    @Override
    public int deleteSysUserDeptById(Long id)
    {
        return sysUserDeptMapper.deleteSysUserDeptById(id);
    }
}
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java
@@ -1,19 +1,11 @@
package com.ruoyi.system.service.impl;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import javax.validation.Validator;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.constant.UserConstants;
import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.common.core.domain.entity.SysRole;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.entity.SysUserDept;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
@@ -22,26 +14,36 @@
import com.ruoyi.system.domain.SysPost;
import com.ruoyi.system.domain.SysUserPost;
import com.ruoyi.system.domain.SysUserRole;
import com.ruoyi.system.mapper.SysPostMapper;
import com.ruoyi.system.mapper.SysRoleMapper;
import com.ruoyi.system.mapper.SysUserMapper;
import com.ruoyi.system.mapper.SysUserPostMapper;
import com.ruoyi.system.mapper.SysUserRoleMapper;
import com.ruoyi.system.mapper.*;
import com.ruoyi.system.service.ISysConfigService;
import com.ruoyi.system.service.ISysUserService;
import com.smartor.mapper.SysUserDeptMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import javax.validation.Validator;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
/**
 * ç”¨æˆ· ä¸šåŠ¡å±‚å¤„ç†
 *
 *
 * @author ruoyi
 */
@Service
public class SysUserServiceImpl implements ISysUserService
{
public class SysUserServiceImpl implements ISysUserService {
    private static final Logger log = LoggerFactory.getLogger(SysUserServiceImpl.class);
    @Autowired
    private SysUserMapper userMapper;
    @Autowired
    private SysUserDeptMapper sysUserDeptMapper;
    @Autowired
    private SysRoleMapper roleMapper;
@@ -63,79 +65,86 @@
    /**
     * æ ¹æ®æ¡ä»¶åˆ†é¡µæŸ¥è¯¢ç”¨æˆ·åˆ—表
     *
     *
     * @param user ç”¨æˆ·ä¿¡æ¯
     * @return ç”¨æˆ·ä¿¡æ¯é›†åˆä¿¡æ¯
     */
    @Override
    @DataScope(deptAlias = "d", userAlias = "u")
    public List<SysUser> selectUserList(SysUser user)
    {
    public List<SysUser> selectUserList(SysUser user) {
        return userMapper.selectUserList(user);
    }
    /**
     * æ ¹æ®æ¡ä»¶åˆ†é¡µæŸ¥è¯¢å·²åˆ†é…ç”¨æˆ·è§’色列表
     *
     *
     * @param user ç”¨æˆ·ä¿¡æ¯
     * @return ç”¨æˆ·ä¿¡æ¯é›†åˆä¿¡æ¯
     */
    @Override
    @DataScope(deptAlias = "d", userAlias = "u")
    public List<SysUser> selectAllocatedList(SysUser user)
    {
    public List<SysUser> selectAllocatedList(SysUser user) {
        return userMapper.selectAllocatedList(user);
    }
    /**
     * æ ¹æ®æ¡ä»¶åˆ†é¡µæŸ¥è¯¢æœªåˆ†é…ç”¨æˆ·è§’色列表
     *
     *
     * @param user ç”¨æˆ·ä¿¡æ¯
     * @return ç”¨æˆ·ä¿¡æ¯é›†åˆä¿¡æ¯
     */
    @Override
    @DataScope(deptAlias = "d", userAlias = "u")
    public List<SysUser> selectUnallocatedList(SysUser user)
    {
    public List<SysUser> selectUnallocatedList(SysUser user) {
        return userMapper.selectUnallocatedList(user);
    }
    /**
     * é€šè¿‡ç”¨æˆ·åæŸ¥è¯¢ç”¨æˆ·
     *
     *
     * @param userName ç”¨æˆ·å
     * @return ç”¨æˆ·å¯¹è±¡ä¿¡æ¯
     */
    @Override
    public SysUser selectUserByUserName(String userName)
    {
    public SysUser selectUserByUserName(String userName) {
        SysUser sysUser = userMapper.selectUserByUserName(userName);
        List<SysDept> sysDepts = sysUserDeptMapper.selectDeptListByUserId(sysUser.getUserId());
        List<Long> deptIds = new ArrayList<>();
        for (SysDept sysDept : sysDepts) {
            deptIds.add(sysDept.getDeptId());
        }
        sysUser.setDepts(deptIds);
        return userMapper.selectUserByUserName(userName);
    }
    /**
     * é€šè¿‡ç”¨æˆ·ID查询用户
     *
     *
     * @param userId ç”¨æˆ·ID
     * @return ç”¨æˆ·å¯¹è±¡ä¿¡æ¯
     */
    @Override
    public SysUser selectUserById(Long userId)
    {
        return userMapper.selectUserById(userId);
    public SysUser selectUserById(Long userId) {
        SysUser sysUser = userMapper.selectUserById(userId);
        List<SysDept> sysDepts = sysUserDeptMapper.selectDeptListByUserId(sysUser.getUserId());
        List<Long> deptIds = new ArrayList<>();
        for (SysDept sysDept : sysDepts) {
            deptIds.add(sysDept.getDeptId());
        }
        sysUser.setDepts(deptIds);
        return sysUser;
    }
    /**
     * æŸ¥è¯¢ç”¨æˆ·æ‰€å±žè§’色组
     *
     *
     * @param userName ç”¨æˆ·å
     * @return ç»“æžœ
     */
    @Override
    public String selectUserRoleGroup(String userName)
    {
    public String selectUserRoleGroup(String userName) {
        List<SysRole> list = roleMapper.selectRolesByUserName(userName);
        if (CollectionUtils.isEmpty(list))
        {
        if (CollectionUtils.isEmpty(list)) {
            return StringUtils.EMPTY;
        }
        return list.stream().map(SysRole::getRoleName).collect(Collectors.joining(","));
@@ -143,16 +152,14 @@
    /**
     * æŸ¥è¯¢ç”¨æˆ·æ‰€å±žå²—位组
     *
     *
     * @param userName ç”¨æˆ·å
     * @return ç»“æžœ
     */
    @Override
    public String selectUserPostGroup(String userName)
    {
    public String selectUserPostGroup(String userName) {
        List<SysPost> list = postMapper.selectPostsByUserName(userName);
        if (CollectionUtils.isEmpty(list))
        {
        if (CollectionUtils.isEmpty(list)) {
            return StringUtils.EMPTY;
        }
        return list.stream().map(SysPost::getPostName).collect(Collectors.joining(","));
@@ -160,17 +167,15 @@
    /**
     * æ ¡éªŒç”¨æˆ·åç§°æ˜¯å¦å”¯ä¸€
     *
     *
     * @param user ç”¨æˆ·ä¿¡æ¯
     * @return ç»“æžœ
     */
    @Override
    public String checkUserNameUnique(SysUser user)
    {
    public String checkUserNameUnique(SysUser user) {
        Long userId = StringUtils.isNull(user.getUserId()) ? -1L : user.getUserId();
        SysUser info = userMapper.checkUserNameUnique(user.getUserName());
        if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue())
        {
        if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue()) {
            return UserConstants.NOT_UNIQUE;
        }
        return UserConstants.UNIQUE;
@@ -183,12 +188,10 @@
     * @return
     */
    @Override
    public String checkPhoneUnique(SysUser user)
    {
    public String checkPhoneUnique(SysUser user) {
        Long userId = StringUtils.isNull(user.getUserId()) ? -1L : user.getUserId();
        SysUser info = userMapper.checkPhoneUnique(user.getPhonenumber());
        if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue())
        {
        if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue()) {
            return UserConstants.NOT_UNIQUE;
        }
        return UserConstants.UNIQUE;
@@ -201,12 +204,10 @@
     * @return
     */
    @Override
    public String checkEmailUnique(SysUser user)
    {
    public String checkEmailUnique(SysUser user) {
        Long userId = StringUtils.isNull(user.getUserId()) ? -1L : user.getUserId();
        SysUser info = userMapper.checkEmailUnique(user.getEmail());
        if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue())
        {
        if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue()) {
            return UserConstants.NOT_UNIQUE;
        }
        return UserConstants.UNIQUE;
@@ -214,33 +215,28 @@
    /**
     * æ ¡éªŒç”¨æˆ·æ˜¯å¦å…è®¸æ“ä½œ
     *
     *
     * @param user ç”¨æˆ·ä¿¡æ¯
     */
    @Override
    public void checkUserAllowed(SysUser user)
    {
        if (StringUtils.isNotNull(user.getUserId()) && user.isAdmin())
        {
    public void checkUserAllowed(SysUser user) {
        if (StringUtils.isNotNull(user.getUserId()) && user.isAdmin()) {
            throw new ServiceException("不允许操作超级管理员用户");
        }
    }
    /**
     * æ ¡éªŒç”¨æˆ·æ˜¯å¦æœ‰æ•°æ®æƒé™
     *
     *
     * @param userId ç”¨æˆ·id
     */
    @Override
    public void checkUserDataScope(Long userId)
    {
        if (!SysUser.isAdmin(SecurityUtils.getUserId()))
        {
    public void checkUserDataScope(Long userId) {
        if (!SysUser.isAdmin(SecurityUtils.getUserId())) {
            SysUser user = new SysUser();
            user.setUserId(userId);
            List<SysUser> users = SpringUtils.getAopProxy(this).selectUserList(user);
            if (StringUtils.isEmpty(users))
            {
            if (StringUtils.isEmpty(users)) {
                throw new ServiceException("没有权限访问用户数据!");
            }
        }
@@ -248,16 +244,26 @@
    /**
     * æ–°å¢žä¿å­˜ç”¨æˆ·ä¿¡æ¯
     *
     *
     * @param user ç”¨æˆ·ä¿¡æ¯
     * @return ç»“æžœ
     */
    @Override
    @Transactional
    public int insertUser(SysUser user)
    {
    public int insertUser(SysUser user) {
        // æ–°å¢žç”¨æˆ·ä¿¡æ¯
        int rows = userMapper.insertUser(user);
        //新增用户与部门关联
        if (!CollectionUtils.isEmpty(user.getDepts())) {
            for (Long deptId : user.getDepts()) {
                SysUserDept sysUserDep = new SysUserDept();
                sysUserDep.setUserId(user.getUserId());
                sysUserDep.setDeptId(deptId);
                sysUserDep.setCreateTime(new Date());
                sysUserDep.setUpdateTime(new Date());
                sysUserDeptMapper.insertSysUserDept(sysUserDep);
            }
        }
        // æ–°å¢žç”¨æˆ·å²—位关联
        insertUserPost(user);
        // æ–°å¢žç”¨æˆ·ä¸Žè§’色管理
@@ -267,26 +273,24 @@
    /**
     * æ³¨å†Œç”¨æˆ·ä¿¡æ¯
     *
     *
     * @param user ç”¨æˆ·ä¿¡æ¯
     * @return ç»“æžœ
     */
    @Override
    public boolean registerUser(SysUser user)
    {
    public boolean registerUser(SysUser user) {
        return userMapper.insertUser(user) > 0;
    }
    /**
     * ä¿®æ”¹ä¿å­˜ç”¨æˆ·ä¿¡æ¯
     *
     *
     * @param user ç”¨æˆ·ä¿¡æ¯
     * @return ç»“æžœ
     */
    @Override
    @Transactional
    public int updateUser(SysUser user)
    {
    public int updateUser(SysUser user) {
        Long userId = user.getUserId();
        // åˆ é™¤ç”¨æˆ·ä¸Žè§’色关联
        userRoleMapper.deleteUserRoleByUserId(userId);
@@ -296,109 +300,123 @@
        userPostMapper.deleteUserPostByUserId(userId);
        // æ–°å¢žç”¨æˆ·ä¸Žå²—位管理
        insertUserPost(user);
        //删除用户与部门的关联
        Long[] ids = {user.getUserId()};
        //新增用户与部门关联
        sysUserDeptMapper.deleteSysUserDeptByIds(ids);
        if (!CollectionUtils.isEmpty(user.getDepts())) {
            for ( Long deptId: user.getDepts()) {
                SysUserDept sysUserDep = new SysUserDept();
                sysUserDep.setUserId(user.getUserId());
                sysUserDep.setDeptId(deptId);
                //查询是否 å·²ç»å…³è”该部门
                List<SysUserDept> sysUserDepts = sysUserDeptMapper.selectSysUserDeptList(sysUserDep);
                if (!CollectionUtils.isEmpty(sysUserDepts)) {
                    SysUserDept sysUserDept = sysUserDepts.get(0);
                    sysUserDept.setDelFlag(0L);
                    sysUserDeptMapper.updateSysUserDept(sysUserDept);
                    continue;
                }
                sysUserDep.setCreateTime(new Date());
                sysUserDep.setUpdateTime(new Date());
                sysUserDeptMapper.insertSysUserDept(sysUserDep);
            }
        }else {
        }
        return userMapper.updateUser(user);
    }
    /**
     * ç”¨æˆ·æŽˆæƒè§’色
     *
     * @param userId ç”¨æˆ·ID
     *
     * @param userId  ç”¨æˆ·ID
     * @param roleIds è§’色组
     */
    @Override
    @Transactional
    public void insertUserAuth(Long userId, Long[] roleIds)
    {
    public void insertUserAuth(Long userId, Long[] roleIds) {
        userRoleMapper.deleteUserRoleByUserId(userId);
        insertUserRole(userId, roleIds);
    }
    /**
     * ä¿®æ”¹ç”¨æˆ·çŠ¶æ€
     *
     *
     * @param user ç”¨æˆ·ä¿¡æ¯
     * @return ç»“æžœ
     */
    @Override
    public int updateUserStatus(SysUser user)
    {
    public int updateUserStatus(SysUser user) {
        return userMapper.updateUser(user);
    }
    /**
     * ä¿®æ”¹ç”¨æˆ·åŸºæœ¬ä¿¡æ¯
     *
     *
     * @param user ç”¨æˆ·ä¿¡æ¯
     * @return ç»“æžœ
     */
    @Override
    public int updateUserProfile(SysUser user)
    {
    public int updateUserProfile(SysUser user) {
        return userMapper.updateUser(user);
    }
    /**
     * ä¿®æ”¹ç”¨æˆ·å¤´åƒ
     *
     *
     * @param userName ç”¨æˆ·å
     * @param avatar å¤´åƒåœ°å€
     * @param avatar   å¤´åƒåœ°å€
     * @return ç»“æžœ
     */
    @Override
    public boolean updateUserAvatar(String userName, String avatar)
    {
    public boolean updateUserAvatar(String userName, String avatar) {
        return userMapper.updateUserAvatar(userName, avatar) > 0;
    }
    /**
     * é‡ç½®ç”¨æˆ·å¯†ç 
     *
     *
     * @param user ç”¨æˆ·ä¿¡æ¯
     * @return ç»“æžœ
     */
    @Override
    public int resetPwd(SysUser user)
    {
    public int resetPwd(SysUser user) {
        return userMapper.updateUser(user);
    }
    /**
     * é‡ç½®ç”¨æˆ·å¯†ç 
     *
     *
     * @param userName ç”¨æˆ·å
     * @param password å¯†ç 
     * @return ç»“æžœ
     */
    @Override
    public int resetUserPwd(String userName, String password)
    {
    public int resetUserPwd(String userName, String password) {
        return userMapper.resetUserPwd(userName, password);
    }
    /**
     * æ–°å¢žç”¨æˆ·è§’色信息
     *
     *
     * @param user ç”¨æˆ·å¯¹è±¡
     */
    public void insertUserRole(SysUser user)
    {
    public void insertUserRole(SysUser user) {
        this.insertUserRole(user.getUserId(), user.getRoleIds());
    }
    /**
     * æ–°å¢žç”¨æˆ·å²—位信息
     *
     *
     * @param user ç”¨æˆ·å¯¹è±¡
     */
    public void insertUserPost(SysUser user)
    {
    public void insertUserPost(SysUser user) {
        Long[] posts = user.getPostIds();
        if (StringUtils.isNotEmpty(posts))
        {
        if (StringUtils.isNotEmpty(posts)) {
            // æ–°å¢žç”¨æˆ·ä¸Žå²—位管理
            List<SysUserPost> list = new ArrayList<SysUserPost>(posts.length);
            for (Long postId : posts)
            {
            for (Long postId : posts) {
                SysUserPost up = new SysUserPost();
                up.setUserId(user.getUserId());
                up.setPostId(postId);
@@ -410,18 +428,15 @@
    /**
     * æ–°å¢žç”¨æˆ·è§’色信息
     *
     * @param userId ç”¨æˆ·ID
     *
     * @param userId  ç”¨æˆ·ID
     * @param roleIds è§’色组
     */
    public void insertUserRole(Long userId, Long[] roleIds)
    {
        if (StringUtils.isNotEmpty(roleIds))
        {
    public void insertUserRole(Long userId, Long[] roleIds) {
        if (StringUtils.isNotEmpty(roleIds)) {
            // æ–°å¢žç”¨æˆ·ä¸Žè§’色管理
            List<SysUserRole> list = new ArrayList<SysUserRole>(roleIds.length);
            for (Long roleId : roleIds)
            {
            for (Long roleId : roleIds) {
                SysUserRole ur = new SysUserRole();
                ur.setUserId(userId);
                ur.setRoleId(roleId);
@@ -433,14 +448,13 @@
    /**
     * é€šè¿‡ç”¨æˆ·ID删除用户
     *
     *
     * @param userId ç”¨æˆ·ID
     * @return ç»“æžœ
     */
    @Override
    @Transactional
    public int deleteUserById(Long userId)
    {
    public int deleteUserById(Long userId) {
        // åˆ é™¤ç”¨æˆ·ä¸Žè§’色关联
        userRoleMapper.deleteUserRoleByUserId(userId);
        // åˆ é™¤ç”¨æˆ·ä¸Žå²—位表
@@ -450,16 +464,14 @@
    /**
     * æ‰¹é‡åˆ é™¤ç”¨æˆ·ä¿¡æ¯
     *
     *
     * @param userIds éœ€è¦åˆ é™¤çš„用户ID
     * @return ç»“æžœ
     */
    @Override
    @Transactional
    public int deleteUserByIds(Long[] userIds)
    {
        for (Long userId : userIds)
        {
    public int deleteUserByIds(Long[] userIds) {
        for (Long userId : userIds) {
            checkUserAllowed(new SysUser(userId));
            checkUserDataScope(userId);
        }
@@ -472,17 +484,15 @@
    /**
     * å¯¼å…¥ç”¨æˆ·æ•°æ®
     *
     * @param userList ç”¨æˆ·æ•°æ®åˆ—表
     *
     * @param userList        ç”¨æˆ·æ•°æ®åˆ—表
     * @param isUpdateSupport æ˜¯å¦æ›´æ–°æ”¯æŒï¼Œå¦‚果已存在,则进行更新数据
     * @param operName æ“ä½œç”¨æˆ·
     * @param operName        æ“ä½œç”¨æˆ·
     * @return ç»“æžœ
     */
    @Override
    public String importUser(List<SysUser> userList, Boolean isUpdateSupport, String operName)
    {
        if (StringUtils.isNull(userList) || userList.size() == 0)
        {
    public String importUser(List<SysUser> userList, Boolean isUpdateSupport, String operName) {
        if (StringUtils.isNull(userList) || userList.size() == 0) {
            throw new ServiceException("导入用户数据不能为空!");
        }
        int successNum = 0;
@@ -490,23 +500,18 @@
        StringBuilder successMsg = new StringBuilder();
        StringBuilder failureMsg = new StringBuilder();
        String password = configService.selectConfigByKey("sys.user.initPassword");
        for (SysUser user : userList)
        {
            try
            {
        for (SysUser user : userList) {
            try {
                // éªŒè¯æ˜¯å¦å­˜åœ¨è¿™ä¸ªç”¨æˆ·
                SysUser u = userMapper.selectUserByUserName(user.getUserName());
                if (StringUtils.isNull(u))
                {
                if (StringUtils.isNull(u)) {
                    BeanValidators.validateWithException(validator, user);
                    user.setPassword(SecurityUtils.encryptPassword(password));
                    user.setCreateBy(operName);
                    this.insertUser(user);
                    successNum++;
                    successMsg.append("<br/>" + successNum + "、账号 " + user.getUserName() + " å¯¼å…¥æˆåŠŸ");
                }
                else if (isUpdateSupport)
                {
                } else if (isUpdateSupport) {
                    BeanValidators.validateWithException(validator, user);
                    checkUserAllowed(user);
                    checkUserDataScope(user.getUserId());
@@ -514,28 +519,21 @@
                    this.updateUser(user);
                    successNum++;
                    successMsg.append("<br/>" + successNum + "、账号 " + user.getUserName() + " æ›´æ–°æˆåŠŸ");
                }
                else
                {
                } else {
                    failureNum++;
                    failureMsg.append("<br/>" + failureNum + "、账号 " + user.getUserName() + " å·²å­˜åœ¨");
                }
            }
            catch (Exception e)
            {
            } catch (Exception e) {
                failureNum++;
                String msg = "<br/>" + failureNum + "、账号 " + user.getUserName() + " å¯¼å…¥å¤±è´¥ï¼š";
                failureMsg.append(msg + e.getMessage());
                log.error(msg, e);
            }
        }
        if (failureNum > 0)
        {
        if (failureNum > 0) {
            failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " æ¡æ•°æ®æ ¼å¼ä¸æ­£ç¡®ï¼Œé”™è¯¯å¦‚下:");
            throw new ServiceException(failureMsg.toString());
        }
        else
        {
        } else {
            successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " æ¡ï¼Œæ•°æ®å¦‚下:");
        }
        return successMsg.toString();
ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml
@@ -4,7 +4,7 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.system.mapper.SysUserMapper">
    <resultMap type="SysUser" id="SysUserResult">
    <resultMap type="com.ruoyi.common.core.domain.entity.SysUser" id="SysUserResult">
        <id     property="userId"       column="user_id"      />
        <result property="deptId"       column="dept_id"      />
        <result property="userName"     column="user_name"    />
@@ -26,8 +26,8 @@
        <association property="dept"    column="dept_id" javaType="SysDept" resultMap="deptResult" />
        <collection  property="roles"   javaType="java.util.List"           resultMap="RoleResult" />
    </resultMap>
    <resultMap id="deptResult" type="SysDept">
    <resultMap id="deptResult" type="com.ruoyi.common.core.domain.entity.SysDept">
        <id     property="deptId"    column="dept_id"     />
        <result property="parentId"  column="parent_id"   />
        <result property="deptName"  column="dept_name"   />
@@ -36,8 +36,8 @@
        <result property="leader"    column="leader"      />
        <result property="status"    column="dept_status" />
    </resultMap>
    <resultMap id="RoleResult" type="SysRole">
    <resultMap id="RoleResult" type="com.ruoyi.common.core.domain.entity.SysRole">
        <id     property="roleId"       column="role_id"        />
        <result property="roleName"     column="role_name"      />
        <result property="roleKey"      column="role_key"       />
@@ -45,9 +45,9 @@
        <result property="dataScope"     column="data_scope"    />
        <result property="status"       column="role_status"    />
    </resultMap>
    <sql id="selectUserVo">
        select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,
        select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,
        d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status,
        r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status
        from sys_user u
@@ -55,7 +55,7 @@
            left join sys_user_role ur on u.user_id = ur.user_id
            left join sys_role r on r.role_id = ur.role_id
    </sql>
    <select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult">
        select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from sys_user u
        left join sys_dept d on u.dept_id = d.dept_id
@@ -84,8 +84,8 @@
        <!-- æ•°æ®èŒƒå›´è¿‡æ»¤ -->
        ${params.dataScope}
    </select>
    <select id="selectAllocatedList" parameterType="SysUser" resultMap="SysUserResult">
    <select id="selectAllocatedList" parameterType="com.ruoyi.common.core.domain.entity.SysUser" resultMap="SysUserResult">
        select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time
        from sys_user u
             left join sys_dept d on u.dept_id = d.dept_id
@@ -101,8 +101,8 @@
        <!-- æ•°æ®èŒƒå›´è¿‡æ»¤ -->
        ${params.dataScope}
    </select>
    <select id="selectUnallocatedList" parameterType="SysUser" resultMap="SysUserResult">
    <select id="selectUnallocatedList" parameterType="com.ruoyi.common.core.domain.entity.SysUser" resultMap="SysUserResult">
        select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time
        from sys_user u
             left join sys_dept d on u.dept_id = d.dept_id
@@ -119,30 +119,30 @@
        <!-- æ•°æ®èŒƒå›´è¿‡æ»¤ -->
        ${params.dataScope}
    </select>
    <select id="selectUserByUserName" parameterType="String" resultMap="SysUserResult">
        <include refid="selectUserVo"/>
        where u.user_name = #{userName} and u.del_flag = '0'
    </select>
    <select id="selectUserById" parameterType="Long" resultMap="SysUserResult">
        <include refid="selectUserVo"/>
        where u.user_id = #{userId}
    </select>
    <select id="checkUserNameUnique" parameterType="String" resultMap="SysUserResult">
        select user_id, user_name from sys_user where user_name = #{userName} and del_flag = '0' limit 1
    </select>
    <select id="checkPhoneUnique" parameterType="String" resultMap="SysUserResult">
        select user_id, phonenumber from sys_user where phonenumber = #{phonenumber} and del_flag = '0' limit 1
    </select>
    <select id="checkEmailUnique" parameterType="String" resultMap="SysUserResult">
        select user_id, email from sys_user where email = #{email} and del_flag = '0' limit 1
    </select>
    <insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId">
    <insert id="insertUser" parameterType="com.ruoyi.common.core.domain.entity.SysUser" useGeneratedKeys="true" keyProperty="userId">
         insert into sys_user(
             <if test="userId != null and userId != 0">user_id,</if>
             <if test="deptId != null and deptId != 0">dept_id,</if>
@@ -173,8 +173,8 @@
             sysdate()
         )
    </insert>
    <update id="updateUser" parameterType="SysUser">
    <update id="updateUser" parameterType="com.ruoyi.common.core.domain.entity.SysUser">
         update sys_user
         <set>
             <if test="deptId != null and deptId != 0">dept_id = #{deptId},</if>
@@ -194,28 +194,28 @@
         </set>
         where user_id = #{userId}
    </update>
    <update id="updateUserStatus" parameterType="SysUser">
    <update id="updateUserStatus" parameterType="com.ruoyi.common.core.domain.entity.SysUser">
         update sys_user set status = #{status} where user_id = #{userId}
    </update>
    <update id="updateUserAvatar" parameterType="SysUser">
    <update id="updateUserAvatar" parameterType="com.ruoyi.common.core.domain.entity.SysUser">
         update sys_user set avatar = #{avatar} where user_name = #{userName}
    </update>
    <update id="resetUserPwd" parameterType="SysUser">
    <update id="resetUserPwd" parameterType="com.ruoyi.common.core.domain.entity.SysUser">
         update sys_user set password = #{password} where user_name = #{userName}
    </update>
    <delete id="deleteUserById" parameterType="Long">
         update sys_user set del_flag = '2' where user_id = #{userId}
     </delete>
     <delete id="deleteUserByIds" parameterType="Long">
         update sys_user set del_flag = '2' where user_id in
         <foreach collection="array" item="userId" open="(" separator="," close=")">
             #{userId}
        </foreach>
        </foreach>
     </delete>
</mapper>
</mapper>
smartor/src/main/java/com/smartor/domain/IvrLibaTargetoption.java
@@ -47,6 +47,13 @@
    @Excel(name = "类别名称")
    private String categoryName;
    /**
     * é€‰ä¸­æç¤º
     */
    @ApiModelProperty(value = "选中提示")
    @Excel(name = "选中提示")
    private String prompt;
    @ApiModelProperty(value = "指标值")
    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
    private String targetvalue;
smartor/src/main/java/com/smartor/domain/IvrLibaTemplateScript.java
@@ -1,5 +1,6 @@
package com.smartor.domain;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
@@ -57,6 +58,13 @@
    private Long templateid;
    /**
     * åˆ†æ•°
     */
    @Excel(name = "分数")
    @ApiModelProperty(value = "分数")
    private BigDecimal score;
    /**
     * è¯æœ¯ID
     */
    @ApiModelProperty(value = "话术ID")
smartor/src/main/java/com/smartor/domain/IvrLibaTemplateScriptVO.java
@@ -56,6 +56,13 @@
    private String scriptPoint;
    /**
     * åˆ†æ•°
     */
    @Excel(name = "分数")
    @ApiModelProperty(value = "分数")
    private Long score;
    /**
     * è¯æœ¯å†…容
     */
    @Excel(name = "话术内容")
@@ -77,6 +84,13 @@
    private String scriptVoice;
    /**
     * é—®é¢˜ç»“æžœ
     */
    @Excel(name = "问题结果")
    @ApiModelProperty(value = "问题结果")
    private String scriptResult;
    /**
     * æ— åŒ¹é…è¯æœ¯
     */
    @Excel(name = "无匹配话术")
smartor/src/main/java/com/smartor/domain/IvrLibaTemplateTargetoption.java
@@ -7,6 +7,7 @@
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@@ -41,6 +42,13 @@
    @Excel(name = "指标名称")
    @ApiModelProperty(value = "指标名称")
    private String targetname;
    /**
     * é€‰ä¸­æç¤º
     */
    @Excel(name = "选中提示")
    @ApiModelProperty(value = "选中提示")
    private String prompt;
    /**
     * æ¨¡æ¿ID
@@ -140,6 +148,13 @@
    @ApiModelProperty(value = "是否异常标识")
    private Long isabnormal;
    /**
     * æ˜¯å¦å¼‚常标识
     */
    @Excel(name = "是否异常标识")
    @ApiModelProperty(value = "是否异常标识")
    private BigDecimal score;
//    /**
//     * é¢„警阀值上限
//     */
smartor/src/main/java/com/smartor/domain/IvrTaskTemplateScript.java
@@ -7,6 +7,7 @@
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
@@ -17,7 +18,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;
@@ -34,6 +35,13 @@
    @Excel(name = "任务id")
    @ApiModelProperty(value = "任务id")
    private Long taskid;
    /**
     * åˆ†æ•°
     */
    @Excel(name = "分数")
    @ApiModelProperty(value = "分数")
    private BigDecimal score;
    /**
@@ -152,7 +160,7 @@
    /**
     * å€¼ç±»åž‹ï¼ˆ1 é€‰é¡¹  2 æ–‡æœ¬  3 æ•°å€¼ï¼‰
     */
    @Excel(name = "值类型" , readConverterExp = "值类型(1 é€‰é¡¹  2 æ–‡æœ¬  3 æ•°å€¼ï¼‰")
    @Excel(name = "值类型", readConverterExp = "值类型(1 é€‰é¡¹  2 æ–‡æœ¬  3 æ•°å€¼ï¼‰")
    @ApiModelProperty(value = "主键")
    private Long valueType;
@@ -173,7 +181,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;
@@ -222,21 +230,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;
smartor/src/main/java/com/smartor/domain/IvrTaskTemplateScriptVO.java
@@ -7,6 +7,7 @@
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@@ -30,6 +31,13 @@
    private Long id;
    /**
     * åˆ†æ•°
     */
    @Excel(name = "分数")
    @ApiModelProperty(value = "分数")
    private BigDecimal score;
    /**
     * ä»»åŠ¡id
     */
    @Excel(name = "任务id")
smartor/src/main/java/com/smartor/domain/IvrTaskTemplateTargetoption.java
@@ -1,5 +1,6 @@
package com.smartor.domain;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@@ -46,6 +47,13 @@
    private Long templateID;
    /**
     * åˆ†æ•°
     */
    @Excel(name = "分数")
    @ApiModelProperty(value = "分数")
    private BigDecimal score;
    /**
     * æŒ‡æ ‡ID
     */
    @Excel(name = "指标ID")
@@ -60,6 +68,13 @@
    private String targetname;
    /**
     * é€‰ä¸­æç¤º
     */
    @Excel(name = "选中提示")
    @ApiModelProperty(value = "选中提示")
    private String prompt;
    /**
     * æ¨¡æ¿æŒ‡æ ‡ç±»åž‹
     */
    @Excel(name = "模板指标类型")
smartor/src/main/java/com/smartor/domain/PatArchive.java
@@ -31,6 +31,46 @@
    private Long id;
    /**
     * çˆ¶ID
     */
    @ApiModelProperty("父ID")
    private Long pid;
    /**
     * GUID
     */
    @ApiModelProperty("GUID")
    private Long guid;
    /**
     * å§“名
     */
    @ApiModelProperty("患者编号")
    @Excel(name = " æ‚£è€…编号 ")
    private String patientno;
    /**
     * æ¥æº(1:HIS;2:数据平台;3:文件导入)
     */
    @ApiModelProperty("来源(1:HIS;2:数据平台;3:文件导入)")
    @Excel(name = " æ¥æº(1:HIS;2:数据平台;3:文件导入) ")
    private int sourcefrom;
    /**
     * his系统的患者id
     */
    @ApiModelProperty("his系统的患者id")
    @Excel(name = "his系统的患者id")
    private int patidHis;
    /**
     * his系统的患者id
     */
    @ApiModelProperty("his系统的患者id")
    @Excel(name = "his系统的患者id")
    private String sdFlag;
    /**
     * å§“名
     */
    @ApiModelProperty("姓名")
@@ -59,7 +99,6 @@
    @Excel(name = " ç±è´¯ ")
    private String nativePlace;
    /**
     * è¯ä»¶å·ç 
     */
@@ -67,14 +106,12 @@
    @Excel(name = " å±…住地 ")
    private String placeOfResidence;
    /**
     * è¯ä»¶å·ç 
     */
    @ApiModelProperty("出生地")
    @Excel(name = " å‡ºç”Ÿåœ° ")
    private String birthplace;
    /**
     * è¯ä»¶å·ç 
@@ -105,13 +142,6 @@
    @ApiModelProperty("年龄")
    @Excel(name = " å¹´é¾„ ")
    private Long age;
    /**
     * æ¥æº
     */
    @ApiModelProperty("来源")
    @Excel(name = " æ¥æº ")
    private Long sourcefrom;
    /**
     * å»ºæ¡£æ—¶é—´
smartor/src/main/java/com/smartor/domain/PatMedInhosp.java
@@ -205,7 +205,7 @@
     * ç—…区ID
     */
    @ApiModelProperty(value = "病区ID")
    private Long hospitaldistrictid;
    private String hospitaldistrictid;
    /**
     * å‡ºé™¢ç—…区编号
@@ -224,19 +224,19 @@
     * å‡ºé™¢ç—…区ID
     */
    @ApiModelProperty(value = "出院病区ID")
    private Long leavehospitaldistrictid;
    private String leavehospitaldistrictid;
    /**
     * å…¥é™¢ç§‘室ID
     */
    @ApiModelProperty(value = "入院科室ID")
    private Long deptid;
    private String deptid;
    /**
     * å‡ºé™¢ç§‘室ID
     */
    @ApiModelProperty(value = "出院科室ID")
    private Long leaveldeptid;
    private String leaveldeptid;
    /**
     * æ–¹æ¡ˆçŠ¶æ€æ“ä½œæ—¶é—´
smartor/src/main/java/com/smartor/domain/PatMedReq.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,59 @@
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;
/**
 * ä½é™¢ã€é—¨è¯Šã€å‡ºé™¢ è¯·æ±‚入参
 *
 * @author smartor
 * @date 2023-03-04
 */
@ApiModel(value = "PatMedReq", description = "住院、门诊、出院请求入参对象")
@Data
public class PatMedReq extends BaseEntity {
    private static final long serialVersionUID = 1L;
    /**
     * é—¨è¯Š(为空则不查)
     */
    @ApiModelProperty(value = "门诊(为空则不查)")
    private Integer mz;
    /**
     * ä½é™¢(为空则不查)
     */
    @ApiModelProperty(value = "住院(为空则不查)")
    private Integer zy;
    /**
     * å‡ºé™¢(为空则不查)
     */
    @ApiModelProperty(value = "出院(为空则不查)")
    private Integer cy;
    /**
     * å¼€å§‹æ—¶é—´
     */
    @ApiModelProperty(value = "开始时间")
    private Date startDate;
    /**
     * ç»“束时间
     */
    @ApiModelProperty(value = "结束时间")
    private Date endDate;
    /**
     * æ”¯æŒå¤šä¸ªç§‘室
     */
    @ApiModelProperty(value = "科室")
    private List<String> deptcodeList;
}
smartor/src/main/java/com/smartor/domain/PatMedRes.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,38 @@
package com.smartor.domain;
import com.ruoyi.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
 * ä½é™¢ã€é—¨è¯Šã€å‡ºé™¢ è¯·æ±‚入参
 *
 * @author smartor
 * @date 2023-03-04
 */
@ApiModel(value = "PatMedRes", description = "住院、门诊、出院请求返参对象")
@Data
public class PatMedRes {
    private static final long serialVersionUID = 1L;
    /**
     * ç§‘室
     */
    @ApiModelProperty(value = "科室")
    private String deptname;
    /**
     * äººæ¬¡
     */
    @ApiModelProperty(value = "人次")
    private Integer rc;
    /**
     * äººæ•°
     */
    @ApiModelProperty(value = "人数")
    private Integer rs;
}
smartor/src/main/java/com/smartor/domain/PatTaskRelevance.java
@@ -96,6 +96,13 @@
    private String deptName;
    /**
     * ç§‘室编码
     */
    @Excel(name = "科室编码")
    @ApiModelProperty("科室编码")
    private String deptCode;
    /**
     * ç§‘室
     */
    @Excel(name = "地址")
smartor/src/main/java/com/smartor/domain/ServiceSubTaskCacheReq.java
@@ -26,6 +26,6 @@
    private List<IvrTaskTemplateScriptVO> ivrTaskTemplateScriptVOList;
    @ApiModelProperty(value = "问题回答明细(问卷)")
    List<SvyTaskTemplateScriptVO> svyTaskTemplateScriptVOList;
    List<SvyLibTemplateScriptVO> svyLibTemplateScriptVOS;
}
smartor/src/main/java/com/smartor/domain/ServiceSubTaskQueryReq.java
@@ -31,7 +31,7 @@
     * æ‚£è€…ID
     */
    @ApiModelProperty(value = "患者ID")
    private Long patId;
    private Long patid;
    /**
     * é¢˜ç›®ID
smartor/src/main/java/com/smartor/domain/ServiceSubtask.java
@@ -1,5 +1,6 @@
package com.smartor.domain;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
@@ -94,6 +95,13 @@
    @Excel(name = "任务类型(0通知、1宣教、2门诊、3出院、4复诊、5体检、6问卷、7医技……)")
    @ApiModelProperty(value = "任务类型(0通知、1宣教、2门诊、3出院、4复诊、5体检、6问卷、7医技……)")
    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;
    /**
     * æ¨¡æ¿ID
@@ -253,20 +261,6 @@
    private String orgid;
    /**
     * çˆ¶ID
     */
    @Excel(name = "父ID")
    @ApiModelProperty(value = "父ID")
    private Long pid;
    /**
     * GUID
     */
    @Excel(name = "GUID")
    @ApiModelProperty(value = "GUID")
    private String guid;
    /**
     * æ–‡æœ¬å˜é‡å‚æ•°
     */
    @Excel(name = "文本变量参数")
@@ -402,6 +396,13 @@
    private Long libtemplateid;
    /**
     * æ€»åˆ†
     */
    @Excel(name = "总分")
    @ApiModelProperty(value = "总分")
    private BigDecimal score;
    /**
     * æ¨¡æ¿åº“模版名称
     */
    @Excel(name = "模板库模版名称")
smartor/src/main/java/com/smartor/domain/ServiceSubtaskCount.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,39 @@
package com.smartor.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
 * å„科室完成量统计结果
 *
 * @author ruoyi
 * @date 2024-02-02
 */
@ApiModel(value = "ServiceSubtaskCount", description = "各科室完成量统计结果")
@Data
public class ServiceSubtaskCount {
    private static final long serialVersionUID = 1L;
    @ApiModelProperty(value = "子任务ID")
    private Long subTaskId;
    @ApiModelProperty(value = "服务类型")
    private Long serviceType;
    @ApiModelProperty(value = "年月")
    private String month;
    @ApiModelProperty(value = "数量")
    private Long count;
    public ServiceSubtaskCount(String month, Long serviceType, Long count) {
        this.serviceType = serviceType;
        this.month = month;
        this.count = count;
    }
}
smartor/src/main/java/com/smartor/domain/ServiceSubtaskCountReq.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,33 @@
package com.smartor.domain;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
 * å„科室完成量统计结果请求
 *
 * @author ruoyi
 * @date 2024-02-02
 */
@ApiModel(value = "ServiceSubtaskCountReq", description = "各科室完成量统计结果请求")
@Data
public class ServiceSubtaskCountReq {
    private static final long serialVersionUID = 1L;
    @ApiModelProperty(value = "用户ID")
    private Long userId;
    @ApiModelProperty(value = "开始时间")
    private Date startTime;
    @ApiModelProperty(value = "结束时间")
    private Date endTime;
    @ApiModelProperty(value = "服务类型")
    private List<Long> serviceType;
}
smartor/src/main/java/com/smartor/domain/ServiceSubtaskDetail.java
@@ -150,7 +150,7 @@
    private String valueType;
    @ApiModelProperty(value = "问题类型")
    @ApiModelProperty(value = "问题id")
    private Long scriptid;
    @ApiModelProperty(value = "选项答案的附加信息")
smartor/src/main/java/com/smartor/domain/ServiceSubtaskDetailVO.java
@@ -149,7 +149,7 @@
    private String valueType;
    @ApiModelProperty(value = "问题类型")
    @ApiModelProperty(value = "问题id")
    private Long scriptid;
    @ApiModelProperty(value = "选项答案的附加信息")
smartor/src/main/java/com/smartor/domain/ServiceSubtaskVO.java
@@ -36,11 +36,25 @@
    private String sendname;
    /**
     * å‘送UUID
     */
    @Excel(name = " å‘送UUID ")
    @ApiModelProperty(value = "发送UUID")
    private String senduuid;
    /**
     * æ‰‹æœºå·
     */
    @Excel(name = " æ‰‹æœºå· ")
    @ApiModelProperty(value = "手机号")
    private String phone;
    /**
     * æœåŠ¡ç±»åž‹(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;
    /**
     * æ€§åˆ«
@@ -278,6 +292,20 @@
    private String patientname;
    /**
     * é•¿æœŸä»»åŠ¡ï¼Œç»™æ‚£è€…å‘é€çš„æ—¶é—´
     */
    @Excel(name = " é•¿æœŸä»»åŠ¡ï¼Œç»™æ‚£è€…å‘é€çš„æ—¶é—´")
    @ApiModelProperty(value = "长期任务,给患者发送的时间")
    private Date longSendTime;
    /**
     * openid
     */
    @Excel(name = "openid")
    @ApiModelProperty(value = "openid")
    private String openid;
    /**
     * ä¸Šä¼ æ—¶é—´
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
@@ -341,29 +369,7 @@
    @Excel(name = "  æ‚£è€…ID")
    @ApiModelProperty(value = "患者ID")
    private Long patid;
//
//    /**
//     * ç–¾ç—…名称
//     */
//    @Excel(name = "疾病名称")
//    @ApiModelProperty(value = "疾病名称")
//    private String icdName;
//
//    /**
//     * ç—…历号
//     */
//    @Excel(name = "病历号")
//    @ApiModelProperty(value = "病历号")
//    private String medicalRecordNo;
//
//    /**
//     * å®£æ•™å†…容
//     */
//    @Excel(name = "宣教内容")
//    @ApiModelProperty(value = "宣教内容")
//    private String preachcontent;
//
//
    /**
     * å‘送时间段
     */
@@ -413,15 +419,15 @@
    @Excel(name = "  å°±è¯Šç±»åž‹ï¼ˆ1门诊  2出院   3.专病)")
    @ApiModelProperty(value = "就诊类型(1门诊  2出院   3.专病)")
    private String hospType;
//
//    /**
//     * å¾®ä¿¡
//     */
//    @Excel(name = "  å¾®ä¿¡")
//    @ApiModelProperty(value = "微信")
//    private String wechat;
//
//
    /**
     * å¾®ä¿¡
     */
    @Excel(name = "  å¾®ä¿¡")
    @ApiModelProperty(value = "微信")
    private String wechat;
    /**
     * è¯Šæ–­åç§°
     */
@@ -449,4 +455,12 @@
    @Excel(name = "  ç—…房号")
    @ApiModelProperty(value = "病房号")
    private String roomno;
    /**
     * æ€»åˆ†
     */
    @Excel(name = "总分")
    @ApiModelProperty(value = "总分")
    private Long score;
}
smartor/src/main/java/com/smartor/domain/SvyLibScript.java
@@ -1,5 +1,6 @@
package com.smartor.domain;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@@ -37,7 +38,7 @@
     * é¢˜ç›®ç±»åž‹;枚举 1.单选 2多选 3填空
     */
    @Excel(name = " é¢˜ç›®ç±»åž‹;枚举 1.单选 2多选 3填空 ")
    @ApiModelProperty("题目类型;枚举 1.单选 2多选 3填空")
    @ApiModelProperty("题目类型;枚举 1.单选 2多选 3填空 4问答  5其它")
    private String scriptType = "";
    /**
@@ -162,7 +163,7 @@
    private String scoretype;
    @ApiModelProperty(value = "题目分值:数字1,2等;字母A、B,C,D等;")
    private String score;
    private BigDecimal score;
    @ApiModelProperty(value = "适用疾病")
    private String icd10Name;
smartor/src/main/java/com/smartor/domain/SvyLibScriptOption.java
@@ -1,5 +1,6 @@
package com.smartor.domain;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
@@ -90,7 +91,7 @@
     * åˆ†æ•°
     */
    @ApiModelProperty(value = "分数")
    private String score;
    private BigDecimal score;
    /**
     * æç¤º
smartor/src/main/java/com/smartor/domain/SvyLibTemplate.java
@@ -170,7 +170,7 @@
     */
    @ApiModelProperty(value = "是否存在操作:1 æ–°å¢ž 2修改 3删除")
    private Integer isoperation;
    /**
     * ç§‘室名称
     */
@@ -226,6 +226,15 @@
    @ApiModelProperty(value = "分数类型(数字,字母,等级)")
    private String scoreType;
    @ApiModelProperty(value = "开场白")
    private String prologue;
    @ApiModelProperty(value = "指导语")
    private String instruction;
    @ApiModelProperty(value = "结束语")
    private String conclusion;
    public SvyLibTemplate() {
    }
smartor/src/main/java/com/smartor/domain/SvyLibTemplateScript.java
@@ -9,6 +9,7 @@
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
@@ -37,7 +38,6 @@
    private Long svyid;
    /**
     * é¢˜ç›®ç±»åž‹;枚举 1.单选 2多选 3填空 4其它
     */
@@ -51,6 +51,13 @@
    @Excel(name = " é¢˜ç›®Code ")
    @ApiModelProperty("题目Code")
    private String scriptno;
    /**
     * é€‰ä¸­æç¤º
     */
    @Excel(name = " é€‰ä¸­æç¤º ")
    @ApiModelProperty("选中提示")
    private String prompt;
    /**
     * ä¸‹ä¸€ä¸ªé—®é¢˜ç¼–号
@@ -225,7 +232,7 @@
     */
    @Excel(name = "题目分值:数字1,2等;字母A、B,C,D等;")
    @ApiModelProperty("题目分值:数字1,2等;字母A、B,C,D等;")
    private String score;
    private BigDecimal score;
    /**
     * é¢˜ç›®ä¸»é¢˜
smartor/src/main/java/com/smartor/domain/SvyLibTemplateScriptVO.java
@@ -7,6 +7,7 @@
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@@ -29,13 +30,19 @@
    private Long id;
    /**
     * é€‰é¡¹åˆ†æ”¯æ ‡è¯†(0:无分支1:有分支)
     */
    @Excel(name = "选项分支标识(0:无分支1:有分支)")
    @ApiModelProperty(value = "选项分支标识(0:无分支1:有分支)")
    private String branchFlag;
    /**
     * é€‰ä¸­æç¤º
     */
    @Excel(name = " é€‰ä¸­æç¤º ")
    @ApiModelProperty("选中提示")
    private String prompt;
    /**
     * é€‰é¡¹åˆ†æ”¯çš„下一个话术编号
@@ -238,7 +245,7 @@
     */
    @Excel(name = "题目分值:数字1,2等;字母A、B,C,D等;")
    @ApiModelProperty("题目分值:数字1,2等;字母A、B,C,D等;")
    private String score;
    private BigDecimal score;
    /**
     * é¢˜ç›®ä¸»é¢˜
@@ -247,5 +254,12 @@
    @ApiModelProperty("题目主题")
    private String scriptTopic;
    /**
     * é¢˜ç›®ä¸»é¢˜
     */
    @Excel(name = "题目结果")
    @ApiModelProperty("题目结果")
    private String scriptResult;
}
smartor/src/main/java/com/smartor/domain/SvyLibTemplateTargetoption.java
@@ -1,5 +1,6 @@
package com.smartor.domain;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@@ -37,17 +38,18 @@
    private Long targetid;
    /**
     * åˆ†æ•°
     */
    @Excel(name = "分数")
    @ApiModelProperty(value = "分数")
    private BigDecimal score;
    /**
     * æŒ‡æ ‡åç§°
     */
    @Excel(name = "指标名称")
    @ApiModelProperty(value = "指标名称")
    private String targetname;
    /**
     * æŒ‡æ ‡åç§°
     */
    @Excel(name = "分数")
    @ApiModelProperty(value = "分数")
    private String score;
    /**
     * æ¨¡æ¿ID
@@ -261,4 +263,7 @@
    @ApiModelProperty(value = "附件信息")
    private String appenddesc;
    @ApiModelProperty(value = "选中提示")
    private String prompt;
}
smartor/src/main/java/com/smartor/domain/SvyLibTemplateVO.java
@@ -232,6 +232,16 @@
    @ApiModelProperty(value = "分数类型(数字,字母,等级)")
    private String scoreType;
    @ApiModelProperty(value = "开场白")
    private String prologue;
    @ApiModelProperty(value = "指导语")
    private String instruction;
    @ApiModelProperty(value = "结束语")
    private String conclusion;
    public SvyLibTemplateVO() {
    }
smartor/src/main/java/com/smartor/domain/SvyTaskSingleVO.java
@@ -3,6 +3,7 @@
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;
@@ -15,6 +16,7 @@
 * @date 2024-06-12
 */
@Data
@ApiModel(value = "SvyTaskSingleVO", description = "单一任务(问卷)对象(已经换成ServiceSubTask)")
public class SvyTaskSingleVO extends BaseEntity {
    private static final long serialVersionUID = 1L;
smartor/src/main/java/com/smartor/domain/SvyTaskTemplateScript.java
@@ -1,5 +1,6 @@
package com.smartor.domain;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
@@ -24,6 +25,13 @@
     * ä¸»é”®ID
     */
    private Long id;
    /**
     * é€‰ä¸­æç¤º
     */
    @Excel(name = " é€‰ä¸­æç¤º ")
    @ApiModelProperty("选中提示")
    private String prompt;
    /**
     * ä»»åŠ¡id
@@ -62,6 +70,13 @@
    private String language;
    /**
     * åˆ†æ•°
     */
    @Excel(name = "分数")
    @ApiModelProperty(value = "分数")
    private BigDecimal score;
    /**
     * ç±»åˆ«å
     */
    @ApiModelProperty(value = "类别名")
smartor/src/main/java/com/smartor/domain/SvyTaskTemplateScriptVO.java
@@ -8,6 +8,7 @@
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@@ -44,7 +45,7 @@
     * æ¨¡æ¿è¯æœ¯ç¼–号
     */
    @ApiModelProperty(value = "模板话术编号")
    private Long scriptno;
    private String scriptno;
    /**
     * æ¨¡æ¿ID
@@ -69,6 +70,13 @@
     */
    @ApiModelProperty(value = "语言")
    private String language;
    /**
     * æ˜¯å¦å¯ç”¨ 0可用  1不可用
     */
    @Excel(name = "是否可用 0可用  1不可用")
    @ApiModelProperty("是否可用 0可用  1不可用")
    private String isavailable;
    /**
     * ç±»åˆ«å
@@ -131,7 +139,21 @@
     * å€¼ç±»åž‹ï¼ˆ1 é€‰é¡¹  2 æ–‡æœ¬  3 æ•°å€¼ï¼‰
     */
    @ApiModelProperty(value = "值类型1=选项,2=文本,3=数值")
    private Long valueType;
    private String valueType;
    /**
     * å›žå¤ï¼ˆæŒ‡é—®é¢˜çš„回复,给问答题用的)
     */
    @Excel(name = "回复", readConverterExp = "指=问题的回复,给问答题用的")
    @ApiModelProperty("回复(指问题的回复,给问答题用的)")
    private String reply;
    /**
     * åˆ†å€¼ç±»åž‹ï¼š1:数字,2:等级
     */
    @Excel(name = "分值类型:1:数字,2:等级")
    @ApiModelProperty("分值类型:1:数字,2:等级")
    private String scoretype;
    /**
     * æŒ‡æ ‡é€‰é¡¹*
@@ -161,7 +183,7 @@
     * ä¸‹ä¸€è¯æœ¯ç¼–号
     */
    @ApiModelProperty(value = "下一话术编号")
    private Long nextScriptno;
    private String nextScriptno;
    /**
     * é—®é¢˜ç»“果(给“值类型”是文本或者数值用的)*
@@ -217,6 +239,79 @@
    private Long xh;
    /**
     * åˆ†æ•°
     */
    @Excel(name = "分数")
    @ApiModelProperty(value = "分数")
    private BigDecimal score = BigDecimal.ZERO;
    /**
     * é€‰ä¸­æç¤º
     */
    @Excel(name = " é€‰ä¸­æç¤º ")
    @ApiModelProperty("选中提示")
    private String prompt;
    /**
     * é¢˜ç›®æ ‡ç­¾
     */
    @Excel(name = "题目标签")
    @ApiModelProperty("题目标签")
    private String tag;
    /**
     * æ˜¯å¦éšè—
     */
    @Excel(name = " æ˜¯å¦éšè— ")
    @ApiModelProperty("是否隐藏")
    private Long ishide;
    /**
     * é€‚用方式:调查表1,智能语音2、人工3
     */
    @Excel(name = "适用方式:调查表1,智能语音2、人工3")
    @ApiModelProperty("适用方式:调查表1,智能语音2、人工3")
    private String suitway;
    /**
     * é¢˜ç›®å›¾ç‰‡
     */
    @Excel(name = "题目图片")
    @ApiModelProperty("题目图片")
    private String scriptPicture;
    /**
     * é¢˜ç›®å†…容
     */
    @Excel(name = "题目内容")
    @ApiModelProperty("题目描述")
    private String scriptDesc;
    /**
     * åˆ†ç±»id
     */
    @Excel(name = "分类id")
    @ApiModelProperty("分类id")
    private Long categoryid;
    /**
     * æ˜¯å¦å¿…å¡«   0必填   1不必填
     */
    @Excel(name = " æ˜¯å¦å¿…å¡«   0必填   1不必填")
    @ApiModelProperty("是否必填   0必填   1不必填")
    private String ismandatory;
    /**
     * æŽ’序
     */
    @Excel(name = " æŽ’序 ")
    @ApiModelProperty("排序")
    private Long sort;
    /**
     * è¯æœ¯é€‰é¡¹
     */
    @ApiModelProperty(value = "话术选项")
smartor/src/main/java/com/smartor/domain/SvyTaskTemplateTargetoption.java
@@ -1,5 +1,7 @@
package com.smartor.domain;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@@ -50,6 +52,12 @@
     */
    @ApiModelProperty(value = "指标名称")
    private String targetname;
    /**
     * é€‰ä¸­æç¤º
     */
    @ApiModelProperty(value = "选中提示")
    private String prompt;
    /**
     * æ¨¡æ¿æŒ‡æ ‡ç±»åž‹
@@ -169,13 +177,15 @@
     * æ­£åˆ™å…³é”®å­—(含)
     */
    @ApiModelProperty(value = "正则关键字(含)集合")
    private List<String> nodynamiccruxs;
    private List<String> nodynamiccruxs = new ArrayList<>();
    ;
    /**
     * æ­£åˆ™å…³é”®å­—(不含)
     */
    @ApiModelProperty(value = "正则关键字(不含)集合")
    private List<String> dynamiccruxs;
    private List<String> dynamiccruxs = new ArrayList<>();
    ;
    /**
     * æ­£åˆ™å…³é”®å­—(含)
     */
@@ -192,7 +202,7 @@
     * ä¸‹ä¸€é¢˜
     */
    @ApiModelProperty(value = "下一题")
    private Long nextQuestion;
    private Integer nextQuestion;
    /**
     * é€‰é¡¹å›¾ç‰‡è·¯å¾„
@@ -226,6 +236,12 @@
    private String optionCode;
    /**
     * åˆ†æ•°
     */
    @ApiModelProperty(value = "分数")
    private BigDecimal score;
    /**
     * æ˜¯å¦æ˜¯ç”¨æˆ·é€‰æ‹©çš„选项
     */
    @ApiModelProperty(value = "是否是用户选择的选项")
smartor/src/main/java/com/smartor/domain/ThiedInhospCheckInfo.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,71 @@
package com.smartor.domain;
import com.ruoyi.common.annotation.Excel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
 * ç¬¬ä¸‰æ–¹åŽ‚å•†ä½é™¢æ£€æŸ¥ä¿¡æ¯
 *
 * @author ruoyi
 * @date 2024-9-02
 */
@Data
@ApiModel("第三方厂商出、入院信息")
public class ThiedInhospCheckInfo {
    private String hospitalId;//    é™¢åŒºID
    private String patIndex;//    ç—…人主索引
    private String patId;//    å°±è¯ŠID
    private String reqCard;//    ç”³è¯·å•号
    private String patNo;//    å°±è¯Šå·
    private String patType;//    ç—…人类型
    private String patName;//    ç—…人姓名
    private String patSex;//    æ€§åˆ«
    private String patBirth;//    å‡ºç”Ÿæ—¥æœŸ
    private String patAge;//    ç—…人年龄
    private String patAgeUnit;//    ç—…人年龄单位
    private String chargeType;//    æ”¶è´¹ç±»åž‹ä»£ç 
    private String patDiag;//    ä¸´åºŠè¯Šæ–­
    private String patDiagIcd;//    è¯Šæ–­ICD10代码
    private String patAddress;//    ç—…人联系地址
    private String patNation;//    ç—…人国籍
    private String patIdCardNo;//    ç—…人身份证号
    private String patPhone;//    ç—…人联系电话
    private String patHeight;//    ç—…人身高
    private String patWeight;//    ç—…人体重
    private String patWardId;//    ç—…人病区
    private String patBedNo;//    åºŠå·
    private String reqDeptId;//    å¼€å•科室ID
    private String reqDeptName;//    å¼€å•科室名称
    private String reqDocId;//    ç”³è¯·åŒ»ç”ŸID
    private String reqDocName;//    ç”³è¯·åŒ»ç”Ÿå§“名
    private String reqDocComm;//    åŒ»ç”Ÿå¤‡æ³¨
    private String staffNum;//    ç”³è¯·åŒ»ç”Ÿå·¥å·
    private String reqTime;//    ç”³è¯·æ—¶é—´
    private String printUser;//    æ‰“印者
    private String printTime;//    æ‰“印时间
    private String sampleUser;//    é‡‡æ ·è€…
    private String sampleTime;//    é‡‡æ ·æ—¶é—´
    private String sendUsder;//    äº¤æŽ¥æŠ¤å£«
    private String sendTime;//    ç§»äº¤ç»™æŠ¤å£«æ—¶é—´
    private String emerFlag;//    åŠ æ€¥æ ‡å¿—
    private String sampleTypeId;//    æ ·æœ¬ç±»åž‹ID
    private String sampleType;//    æ ‡æœ¬ç±»åž‹åç§°
    private String performDeptID;//    æ‰§è¡Œç§‘室ID
    private String performDeptName;//    æ‰§è¡Œç§‘室名称
    private String requestId;//    ç”³è¯·å•唯一ID
    private String reqItemCode;//    ç”³è¯·é¡¹ç›®ä»£ç 
    private String reqItemName;//    ç”³è¯·é¡¹ç›®åç§°
    private String itemPrice;//    ç”³è¯·é¡¹ç›®å•ä»·
    private String qty;//    ç”³è¯·é¡¹ç›®æ•°é‡
    private String chargeFlag;//    è®¡ä»·æ ‡å¿—
    private String detailId;//    ç”³è¯·æ˜Žç»†å”¯ä¸€ID
    private String itemTypeCode;//    è¯Šç–—项目分类
    private String itemClassCode;//    è¯Šç–—项目大类
    private String orderId;//    ç—…人医嘱ID
}
smartor/src/main/java/com/smartor/domain/ThiedInhospInfo.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,446 @@
package com.smartor.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.ruoyi.common.annotation.Excel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
 * ç¬¬ä¸‰æ–¹åŽ‚å•†å‡ºã€å…¥é™¢ä¿¡æ¯
 *
 * @author ruoyi
 * @date 2024-9-02
 */
@Data
@ApiModel("第三方厂商出、入院信息")
public class ThiedInhospInfo {
    /**
     * æ•°æ®ç±»åž‹
     */
    @ApiModelProperty("病人主索引")
    @Excel(name = "病人主索引")
    private String patiIndex;
    /**
     * æ‚£è€…姓名
     */
    @ApiModelProperty("患者姓名")
    @Excel(name = "患者姓名")
    private String patiRecordName;
    private String patiRecordId;
    private List Education;
    /**
     * æ‚£è€…姓名
     */
    @ApiModelProperty("患者姓名")
    @Excel(name = "患者姓名")
    private String currDeptCode;
    private String admissDeptCode;
    /**
     * ç—…人介质序号
     */
    @ApiModelProperty("病人介质序号")
    @Excel(name = "病人介质序号")
    private String patiMediaId1;
    /**
     * ç—…人介质号码
     */
    @ApiModelProperty("就诊卡号")
    @Excel(name = "就诊卡号")
    private String patiMediaNo;
    /**
     * ç—…人住院序号
     */
    @ApiModelProperty("病人住院序号")
    @Excel(name = "病人住院序号")
    private String inpatientId1;
    /**
     * æ€§åˆ«
     */
    @ApiModelProperty("性别")
    @Excel(name = "性别")
    private String patiRecordGender;
    /**
     * å¹´é¾„
     */
    @ApiModelProperty("年龄")
    @Excel(name = "年龄")
    private String age;
    /**
     * èº«ä»½è¯å·
     */
    @ApiModelProperty("身份证号")
    @Excel(name = "身份证号")
    private String patiIdCardNo;
    /**
     * å…¥é™¢å•号
     */
    @ApiModelProperty("入院单号")
    @Excel(name = "入院单号")
    private String admitFormId;
    /**
     * å»ºè®®é¢„交金额
     */
    @ApiModelProperty("建议预交金额")
    @Excel(name = "建议预交金额")
    private String suggestAmount;
    /**
     * å°±è¯Šå¡å·
     */
    @ApiModelProperty("就诊卡号")
    @Excel(name = "就诊卡号")
    private String patiMediaId;
    /**
     * ç—…人类别序号
     */
    @ApiModelProperty("病人类别序号")
    @Excel(name = "病人类别序号")
    private String patiTypeId1;
    /**
     * ç—…人类别名称
     */
    @ApiModelProperty("病人类别名称")
    @Excel(name = "病人类别名称")
    private String patiTypeName1;
    /**
     * åŒ»ä¿ç±»åž‹
     */
    @ApiModelProperty("医保类型")
    @Excel(name = "医保类型")
    private String patiTypeId;
    /**
     * æ•°æ®ç±»åž‹
     */
    @ApiModelProperty("医保类型名称")
    @Excel(name = "医保类型名称")
    private String patiTypeName;
    /**
     * ä½é™¢çŠ¶æ€
     * 1-尚未入科;2-已经入科;3-已预出院;4-已出院;
     */
    @ApiModelProperty("住院状态")
    @Excel(name = "住院状态")
    private String currStatus;
    /**
     * æ•°æ®ç±»åž‹
     */
    @ApiModelProperty("院区ID")
    @Excel(name = "院区ID")
    private String areaId;
    /**
     * å…¥é™¢ç—…区ID
     */
    @ApiModelProperty("入院病区ID")
    @Excel(name = "入院病区ID")
    private String admissWardId;
    /**
     * å…¥é™¢ç—…区名称
     */
    @ApiModelProperty("入院病区名称")
    @Excel(name = "入院病区名称")
    private String admissWardName;
    private String admissWardCode;
    /**
     * å…¥é™¢ç§‘室ID
     */
    @ApiModelProperty("入院科室ID")
    @Excel(name = "入院科室ID")
    private String admissDeptId;
    /**
     * å…¥é™¢ç§‘室名称
     */
    @ApiModelProperty("入院科室名称")
    @Excel(name = "入院科室名称")
    private String admissDeptName;
    /**
     * å…¥é™¢åºŠä½Id
     */
    @ApiModelProperty("入院床位Id")
    @Excel(name = "入院床位Id")
    private String admissBedId;
    /**
     * å…¥é™¢åºŠä½åºå·
     */
    @ApiModelProperty("入院床位序号")
    @Excel(name = "入院床位序号")
    private String admissBedNo;
    /**
     * å½“前病区ID
     */
    @ApiModelProperty("当前病区ID")
    @Excel(name = "当前病区ID")
    private String currWardId;
    /**
     * å½“前病区ID
     */
    @ApiModelProperty("当前病区ID")
    @Excel(name = "当前病区ID")
    private String currWardCode;
    /**
     * å½“前病区名称
     */
    @ApiModelProperty("当前病区名称")
    @Excel(name = "当前病区名称")
    private String currWardName;
    /**
     * å½“前科室ID
     */
    @ApiModelProperty("当前科室ID")
    @Excel(name = "当前科室ID")
    private String currDeptId;
    /**
     * å½“前科室名称
     */
    @ApiModelProperty("当前科室名称")
    @Excel(name = "当前科室名称")
    private String currDeptName;
    /**
     * å½“前床位序号
     */
    @ApiModelProperty("当前床位序号")
    @Excel(name = "当前床位序号")
    private String currBedNo1;
    /**
     * å½“前床位ID
     */
    @ApiModelProperty("当前床位ID")
    @Excel(name = "当前床位ID")
    private String currBedId;
    /**
     * ä½é™¢å·
     */
    @ApiModelProperty("住院号")
    @Excel(name = "住院号")
    private String inpatientId;
    /**
     * åºŠå·
     */
    @ApiModelProperty("床号")
    @Excel(name = "床号")
    private String currBedNo;
    /**
     * å…¥é™¢æ—¶é—´
     */
    @ApiModelProperty("入院时间")
    @Excel(name = "入院时间")
    private String admissDate;
    /**
     * å¼€å•医生
     */
    @ApiModelProperty("开单医生")
    @Excel(name = "开单医生")
    private String DocName;
    /**
     * ä¸»æ²»åŒ»å¸ˆ
     */
    @ApiModelProperty("主治医师")
    @Excel(name = "主治医师")
    private String doctName;
    /**
     * ä¸»æ²»åŒ»å¸ˆ
     */
    @ApiModelProperty("主治医师")
    @Excel(name = "主治医师")
    private String doctId;
    /**
     * è¯Šæ–­ID
     */
    @ApiModelProperty("诊断ID")
    @Excel(name = "诊断ID")
    private String diagId;
    /**
     * è¯Šæ–­ICD10码
     */
    @ApiModelProperty("诊断ICD10码")
    @Excel(name = "诊断ICD10码")
    private String diagIcd10;
    /**
     * è¯Šæ–­åç§°
     */
    @ApiModelProperty("诊断名称")
    @Excel(name = "诊断名称")
    private String diagName;
    /**
     * è”系人
     */
    @ApiModelProperty("联系地址")
    @Excel(name = "联系地址")
    private String contactPersonAddr;
    /**
     * è”系人
     */
    @ApiModelProperty("联系人")
    @Excel(name = "联系人")
    private String contactPersonName;
    /**
     * è”系人电话
     */
    @ApiModelProperty("联系人电话")
    @Excel(name = "联系人电话")
    private String contactPersonPhone;
    /**
     * æ•°æ®ç±»åž‹
     */
    @ApiModelProperty("国籍")
    @Excel(name = "国籍")
    private String PatiNationality;
    private String NationalityAddr;
    private String patiNatureId;
    private String treateAge;
    private String treatAgeunit;
    private String patiNatureName;
    /**
     * æ•°æ®ç±»åž‹
     */
    @ApiModelProperty("国籍")
    @Excel(name = "国籍")
    private String patNatureId;
    private String PatNation;
    /**
     * æ°‘族
     */
    @ApiModelProperty("民族")
    @Excel(name = "民族")
    private String patiNation;
    /**
     * æ•°æ®ç±»åž‹
     */
    @ApiModelProperty("职业")
    @Excel(name = "职业")
    private String ProfessionId;
    /**
     * å©šå§»çŠ¶æ€
     */
    @ApiModelProperty("婚姻状态")
    @Excel(name = "婚姻状态")
    private String PatiMaritalStatus;
    /**
     * çŽ°ä½åœ°å€
     */
    @JsonIgnoreProperties(ignoreUnknown = true)
    @ApiModelProperty("现住地址")
    @Excel(name = "现住地址")
    private String patiHomeAddr;
    private String patiHomePhone;
    /**
     * è”系电话
     */
    @ApiModelProperty("联系电话")
    @Excel(name = "联系电话")
    private String companyTelNum;
    /**
     * æ•°æ®ç±»åž‹
     */
    @ApiModelProperty("出生日期")
    @Excel(name = "出生日期")
    private String patiBirthday;
    /**
     * ä½é™¢æ¬¡æ•°
     */
    @ApiModelProperty("住院次数")
    @Excel(name = "住院次数")
    private String inhospitalTimes;
    /**
     * å‡ºé™¢æ–¹å¼åºå·
     */
    @ApiModelProperty("出院方式序号")
    @Excel(name = "出院方式序号")
    private String outWayId;
    /**
     * å‡ºé™¢æ–¹å¼åç§°
     */
    @ApiModelProperty("出院方式名称")
    @Excel(name = "出院方式名称")
    private String outWayName;
    /**
     * ä½é™¢æ€»è´¹ç”¨
     */
    @ApiModelProperty("住院总费用")
    @Excel(name = "住院总费用")
    private String totalAmount;
    /**
     * é¢„备出院日期
     */
    @ApiModelProperty("预备出院日期")
    @Excel(name = "预备出院日期")
    private String preoutDate;
    /**
     * ç—…人出院日期
     */
    @ApiModelProperty("病人出院日期")
    @Excel(name = "病人出院日期")
    private String outDate;
    private String RelationShip;
}
smartor/src/main/java/com/smartor/domain/ThiedOutHospCheckInfo.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,74 @@
package com.smartor.domain;
import io.swagger.annotations.ApiModel;
import lombok.Data;
/**
 * ç¬¬ä¸‰æ–¹åŽ‚å•†é—¨è¯Šæ£€æŸ¥ä¿¡æ¯
 *
 * @author ruoyi
 * @date 2024-9-02
 */
@Data
@ApiModel("第三方厂商门诊信息")
public class ThiedOutHospCheckInfo {
    private String hospitalId;//    é™¢åŒºID
    private String patIndex;//    ç—…人主索引
    private String patId;//    ä½é™¢ID
    private String patNo;//    ä½é™¢å·
    private String reqCard;//    ç”³è¯·å•号
    private String patType;//    ç—…人类型
    private String patName;//    ç—…人姓名
    private String patSex;//    æ€§åˆ«
    private String patBirth;//    å‡ºç”Ÿæ—¥æœŸ
    private String patAge;//    ç—…人年龄
    private String patAgeUnit;//    ç—…人年龄单位
    private String chargeType;//    æ”¶è´¹ç±»åž‹ä»£ç 
    private String patDiag;//    ä¸´åºŠè¯Šæ–­
    private String patDiagIcd;//    è¯Šæ–­ICD10代码
    private String patAddress;//    ç—…人联系地址
    private String patNation;//    ç—…人国籍
    private String patIdCardNo;//    ç—…人身份证号
    private String patPhone;//    ç—…人联系电话
    private String patHeight;//    ç—…人身高
    private String patWeight;//    ç—…人体重
    private String patWardId;//病人病区ID
    private String patWardName;//    ç—…人病区名称
    private String patDeptId;//    ç—…人科室ID
    private String patDeptName;//病人科室名称
    private String patBedNo;//    åºŠå·
    private String reqDeptId;//    å¼€å•科室ID
    private String reqDeptName;//;//    å¼€å•科室名称
    private String reqDocId;//    ç”³è¯·åŒ»ç”ŸID
    private String reqDocName;//    ç”³è¯·åŒ»ç”Ÿå§“名
    private String reqDocComm;//    åŒ»ç”Ÿå¤‡æ³¨
    private String staffNum;//    ç”³è¯·åŒ»ç”Ÿå·¥å·
    private String reqTime;//    ç”³è¯·æ—¶é—´
    private String printUser;//    æ‰“印者
    private String printTime;//    æ‰“印时间
    private String sampleUser;//    é‡‡æ ·è€…
    private String sampleTime;//    é‡‡æ ·æ—¶é—´
    private String sendUsder;//    äº¤æŽ¥æŠ¤å£«
    private String sendTime;//    ç§»äº¤ç»™æŠ¤å£«æ—¶é—´
    private String emerFlag;//    åŠ æ€¥æ ‡å¿—
    private String sampleTypeId;//    æ ‡æœ¬ç±»åž‹ID
    private String sampleType;//    æ ‡æœ¬ç±»åž‹åç§°
    private String performDeptID;//    æ‰§è¡Œç§‘室ID
    private String performDeptName;//    æ‰§è¡Œç§‘室名称
    private String requestId;//    ç”³è¯·å•唯一ID
    private String reqItemCode;//    ç”³è¯·é¡¹ç›®ä»£ç 
    private String reqItemName;//    ç”³è¯·é¡¹ç›®åç§°
    private String itemPrice;//    ç”³è¯·é¡¹ç›®å•ä»·
    private String qty;//    ç”³è¯·é¡¹ç›®æ•°é‡
    private String chargeFlag;//    è®¡ä»·æ ‡å¿—
    private String detailId;//    ç”³è¯·æ˜Žç»†å”¯ä¸€ID
    private String itemTypeCode;//    è¯Šç–—项目分类
    private String itemClassCode;//    è¯Šç–—项目大类
    private String orderId;//    ç—…人医嘱ID
    private String admissTimes;//    ä½é™¢æ¬¡æ•°
    private String entryTime;//    å…¥é™¢æ—¶é—´
}
smartor/src/main/java/com/smartor/domain/ThiedOutHospInfo.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,121 @@
package com.smartor.domain;
import io.swagger.annotations.ApiModel;
import lombok.Data;
/**
 * ç¬¬ä¸‰æ–¹åŽ‚å•†é—¨è¯Šä¿¡æ¯
 *
 * @author ruoyi
 * @date 2024-9-02
 */
@Data
@ApiModel("第三方厂商门诊信息")
public class ThiedOutHospInfo {
    private String del;      //删除标志
    private String creator;         //    åˆ›å»ºè€…
    private String createTime;      //创建时间
    private String updater;     //    æ›´æ–°è€…
    private String updateTime;//更新时间
    private String treatID; //    ç—…人就诊序号
    private String orgCode;//组织机构代码
    private String orgName;//组织机构名称
    private String treatDate;//    ç—…人就诊日期
    private String departmentID;//    å°±è¯Šç§‘室代码
    private String hisDepartmentID;//    å°±è¯Šç§‘室代码
    private String departmentName;//    å°±è¯Šç§‘室名称
    private String doctorID;//    å°±è¯ŠåŒ»ç”Ÿåºå·
    private String doctorNum;//就诊医生工号
    private String hisDoctorID;//就诊医生序号
    private String doctorName;//    å°±è¯ŠåŒ»ç”Ÿåç§°
    private String patiRecordID;//病人档案序号
    private String patiMediaID;//    ç—…人介质序号
    private String patiMediaNum;//    ç—…人介质号码
    private String patiTypeID;//    ç—…人类别序号
    private String patiTypeName;//    ç—…人类别名称
    private String patiNatureID;//    ç—…人性质序号
    private String patiNatureName;//    ç—…人性质名称
    private String patiName;//    ç—…人档案姓名
    private String patiIndex;//    ç—…人主索引
    private String patiAge;//    å°±è¯Šç—…人年龄
    private String patiAgeUnit;//    ç—…人年龄单位
    private String patiBirthday;//    ç—…人出生日期
    private String patiAddr;//    ç—…人住址
    private String patiPhone;//    ç—…人联系电话
    private String patiSex;//    ç—…人档案性别
    private String patiIDCardno;//    ç—…人身份证号
    private String patiSourceID;//病人来源id
    private String patiSource;//病人来源
    private String patiCompany;//    ç—…人单位
    private String specialPati;//    ç‰¹æ®Šç—…人类型
    private String treatStatus;//    ç—…人就诊状态
    private String treatTimes;//    ç—…人就诊次数
    private String visitFlag;//    åˆè¯Šå¤è¯Šåˆ¤åˆ«
    private String regID;//    æŒ‚号记录序号
    private String goType;//    ç—…人就诊去向
    private String attackDate;//    ç—…人发病日期
    private String treatBeginDate;//就诊开始时间
    private String treatEndDate;//    å°±è¯Šç»“束时间
    private String relateTreatID;//    å¯¹åº”就诊序号
    private String treatChangeID;//    å°±è¯Šå˜åŠ¨åºå·
    private String infectious;//    ä¼ æŸ“病种判别
    private String settleID;//结算类别序号
    private String settleName;//    ç»“算类别名称
    private String specialRemark;//    ç‰¹æ®Šç—…种
    private String cycleID;//诊疗周期编码
    private String transferID;//    è½¬è¯Šè®°å½•序号
    private String depositID;//    ç—…人交款序号
    private String systemID;//系统模块序号
    private String operateType;//接诊操作类别
    private String emergency;//是否急诊判别
    private String emergencyRegisterID;//    æ€¥è¯Šç™»è®°åºå·
    private String doctorGroupID;//    åŒ»ç”Ÿç»„号序号
    private String doctorGroupName;//医生组号名称
    private String interTreatID;//接口就诊序号
    private String summaryTimes;//就诊小结次数
    private String transportation;//交通工具
    private String evaluation;//评估值
    private String diagIcd10;//诊断ICD10
    private String diagName;//诊断名称
    private String nationCode;//民族编码
    private String nation;//民族
    private String citizenshipCode;//国籍编码
    private String citizenship;//国籍
    private String livingAddressCode;//    çŽ°ä½å€ç¼–ç 
    private String livingAddress;//    çŽ°ä½å€
    private String occupationCode;//人群分类代码
    private String occupation;//    äººç¾¤åˆ†ç±»
    private String idcardTypeCode;//    è¯ä»¶ç±»åž‹ç¼–码
    private String idcardType;//    è¯ä»¶ç±»åž‹
    private String domicileCode;//    æˆ·ç±ç±»åž‹ç¼–码
    private String domicile;//    æˆ·ç±ç±»åž‹
    private String domicileAddressCode;//    æˆ·ç±ç¼–码
    private String domicileAddress;//    æˆ·ç±
    private String domicileAdrressDetails;//    æˆ·ç±è¯¦ç»†åœ°å€
    private String contacts;//    è”系人
    private String contactsTel;//    è”系人电话
    private String mrCompletion;//    ç—…历完成度字段
    private String mrPrintFlag;//    ç—…历打印标志
    private String syncFlag;//    å°±è¯Šè®°å½•同步标志
    private String patiHeight;//    èº«é«˜
    private String patiHeightUnit;//    èº«é«˜å•位
    private String patiWeight;//    ä½“重
    private String patiWeightUnit;//    ä½“重单位
    private String zs;//    ä¸»è¯‰
    private String xbs;//    çŽ°ç—…å²
    private String jws;//    æ—¢å¾€å²
    private String breathe;//    å‘¼å¸
    private String breatheUnit;//    å‘¼å¸å•位
    private String ssy;//    æ”¶ç¼©åŽ‹
    private String ssyUnit;//    æ”¶ç¼©åŽ‹å•ä½
    private String szy;//    èˆ’张压
    private String szyUnit;//    èˆ’张压单位
    private String temperature;//    ä½“温
    private String temperatureUnit;//    ä½“温单位
    private String fzjc;//    è¾…助检查
    private String tgjc;//    ä½“格检查
}
smartor/src/main/java/com/smartor/domain/XinHuaWXReq.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,64 @@
package com.smartor.domain;
import com.ruoyi.common.annotation.Excel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
 * æ–°åŽåŒ»é™¢å…¬ä¼—号入参
 *
 * @author lihu
 * @date 2024-08-31
 */
@ApiModel(value = "XinHuaWXReq", description = "新华医院公众号入参")
@Data
public class XinHuaWXReq {
    private static final long serialVersionUID = 1L;
    /**
     * æŽ¥å£æœåŠ¡åï¼Œå›ºå®šå€¼
     */
    @ApiModelProperty(value = "接口服务名,固定值")
    private String service = "smarthos.yygh.ApiService.push";
    /**
     * è¯ä»¶å·
     */
    @Excel(name = "  è¯ä»¶å·")
    @ApiModelProperty(value = "证件号")
    private String idcard;
    /**
     * è¯¦æƒ…地址
     */
    @Excel(name = "详情地址")
    @ApiModelProperty(value = "详情地址")
    private String url;
    /**
     * å‘送类型: 1 æ—¶é—´æ®µ   2 æ—¶é—´ç‚¹   3 å³åˆ»å‘送
     */
    @ApiModelProperty(value = "随访项目")
    private String keyword1;
    /**
     * æé†’æ—¶é—´
     */
    @ApiModelProperty(value = "提醒时间")
    private String keyword2;
    /**
     * æé†’内容
     */
    @ApiModelProperty(value = "提醒内容")
    private String keyword3;
    /**
     * æ³¨æ„äº‹é¡¹
     */
    @ApiModelProperty(value = "注意事项")
    private String keyword4;
}
smartor/src/main/java/com/smartor/mapper/PatArchiveMapper.java
@@ -41,6 +41,8 @@
     */
    public int insertPatArchive(List<PatArchive> patArchives);
    public int insertPatArchiveSingle(PatArchive patArchive);
    /**
     * ä¿®æ”¹æ‚£è€…档案
     *
@@ -64,7 +66,6 @@
     * @return ç»“æžœ
     */
    public int deletePatArchiveByPatids(Long[] patids);
    public List<PatArchive> selectPatArchiveInfoByAllhosp(PatArchiveReq patArchive);
smartor/src/main/java/com/smartor/mapper/PatMedInhospMapper.java
@@ -3,6 +3,8 @@
import java.util.List;
import com.smartor.domain.PatMedInhosp;
import com.smartor.domain.PatMedReq;
import com.smartor.domain.PatMedRes;
import org.apache.ibatis.annotations.Mapper;
/**
@@ -60,4 +62,15 @@
     * @return ç»“æžœ
     */
    public int deletePatMedInhospByInhospids(Long[] inhospids);
    /**
     * å‡ºé™¢ã€å…¥é™¢äººæ•°
     *
     * @param patMedReq
     * @return
     */
    public PatMedRes selectPatMedInhospCount(PatMedReq patMedReq);
    public List<PatMedRes> getDeptRanking(PatMedReq patMedReq);
}
smartor/src/main/java/com/smartor/mapper/PatMedOuthospMapper.java
@@ -1,7 +1,10 @@
package com.smartor.mapper;
import java.util.List;
import com.smartor.domain.PatMedOuthosp;
import com.smartor.domain.PatMedReq;
import com.smartor.domain.PatMedRes;
import org.apache.ibatis.annotations.Mapper;
/**
@@ -11,8 +14,7 @@
 * @date 2023-03-04
 */
@Mapper
public interface PatMedOuthospMapper
{
public interface PatMedOuthospMapper {
    /**
     * æŸ¥è¯¢æ‚£è€…门诊记录
     *
@@ -60,4 +62,6 @@
     * @return ç»“æžœ
     */
    public int deletePatMedOuthospByIds(Long[] ids);
    PatMedRes selectPatMedOuthospCount(PatMedReq patMedReq);
}
smartor/src/main/java/com/smartor/mapper/ServiceSubtaskMapper.java
@@ -1,6 +1,9 @@
package com.smartor.mapper;
import com.smartor.domain.ServiceSubtask;
import com.smartor.domain.ServiceSubtaskCount;
import com.smartor.domain.ServiceSubtaskCountReq;
import com.smartor.domain.ServiceSubtaskVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@@ -25,10 +28,10 @@
    /**
     * æŸ¥è¯¢å•一任务(随访)列表
     *
     * @param serviceSubtask å•一任务(随访)
     * @param serviceSubtaskVO å•一任务(随访)
     * @return å•一任务(随访)集合
     */
    public List<ServiceSubtask> selectServiceSubtaskList(ServiceSubtask serviceSubtask);
    public List<ServiceSubtask> selectServiceSubtaskList(ServiceSubtaskVO serviceSubtaskVO);
    /**
     * æ–°å¢žå•一任务(随访)
@@ -64,4 +67,6 @@
     */
    public List<ServiceSubtask> getDataByTime(@Param("beganTime") String beganTime, @Param("endTime") String endTime);
    public List<ServiceSubtaskCount> getSfFzInfoEveryMonth(ServiceSubtaskCountReq serviceSubtaskCountReq);
}
smartor/src/main/java/com/smartor/mapper/SysUserDeptMapper.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,72 @@
package com.smartor.mapper;
import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.common.core.domain.entity.SysUserDept;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
 * ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘Mapper接口
 *
 * @author lihu
 * @date 2024-08-29
 */
@Mapper
public interface SysUserDeptMapper {
    /**
     * æŸ¥è¯¢ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘
     *
     * @param id ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘ä¸»é”®
     * @return ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘
     */
    public SysUserDept selectSysUserDeptById(Long id);
    /**
     * æŸ¥è¯¢ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘åˆ—è¡¨
     *
     * @param sysUserDept ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘
     * @return ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘é›†åˆ
     */
    public List<SysUserDept> selectSysUserDeptList(SysUserDept sysUserDept);
    /**
     * æ–°å¢žã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘
     *
     * @param sysUserDept ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘
     * @return ç»“æžœ
     */
    public int insertSysUserDept(SysUserDept sysUserDept);
    /**
     * ä¿®æ”¹ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘
     *
     * @param sysUserDept ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘
     * @return ç»“æžœ
     */
    public int updateSysUserDept(SysUserDept sysUserDept);
    /**
     * åˆ é™¤ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘
     *
     * @param id ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘ä¸»é”®
     * @return ç»“æžœ
     */
    public int deleteSysUserDeptById(Long id);
    /**
     * æ ¹æ®ç”¨æˆ·ID查询部门信息
     *
     * @param id
     * @return
     */
    public List<SysDept> selectDeptListByUserId(Long id);
    /**
     * æ‰¹é‡åˆ é™¤ã€è¯·å¡«å†™åŠŸèƒ½åç§°ã€‘
     *
     * @param ids éœ€è¦åˆ é™¤çš„æ•°æ®ä¸»é”®é›†åˆ
     * @return ç»“æžœ
     */
    public int deleteSysUserDeptByIds(Long[] ids);
}
smartor/src/main/java/com/smartor/service/IPatMedInhospService.java
@@ -1,8 +1,12 @@
package com.smartor.service;
import java.util.List;
import com.ruoyi.common.core.domain.AjaxResult;
import com.smartor.domain.PatMedInhosp;
import com.smartor.domain.PatMedReq;
import com.smartor.domain.PatMedRes;
import java.util.List;
import java.util.Map;
/**
 * æ‚£è€…住院记录Service接口
@@ -26,6 +30,10 @@
     * @return æ‚£è€…住院记录集合
     */
    public List<PatMedInhosp> selectPatMedInhospList(PatMedInhosp patMedInhosp);
    public PatMedInhosp getDeptCodeByPatId(PatMedInhosp patMedInhosp);
    public PatMedRes selectPatMedInhospListCount(PatMedReq patMedReq);
    /**
     * æ–°å¢žæ‚£è€…住院记录
@@ -66,4 +74,12 @@
     * @return ç»“æžœ
     */
    public int dealOupHospInfo();
    /**
     * èŽ·å–å‡ºé™¢ï¼Œä½é™¢ï¼Œé—¨è¯ŠæœåŠ¡äººæ¬¡
     *
     * @param patMedReq
     * @return
     */
    public List<PatMedRes> getDeptRanking(PatMedReq patMedReq);
}
smartor/src/main/java/com/smartor/service/IPatMedOuthospService.java
@@ -1,19 +1,23 @@
package com.smartor.service;
import java.util.List;
import com.ruoyi.common.core.page.TableDataInfo;
import com.smartor.domain.PatMedOuthosp;
import com.smartor.domain.PatMedReq;
import com.smartor.domain.PatMedRes;
import org.springframework.web.bind.annotation.RequestBody;
/**
 * æ‚£è€…门诊记录Service接口
 *
 *
 * @author smartor
 * @date 2023-03-04
 */
public interface IPatMedOuthospService
{
public interface IPatMedOuthospService {
    /**
     * æŸ¥è¯¢æ‚£è€…门诊记录
     *
     *
     * @param id æ‚£è€…门诊记录主键
     * @return æ‚£è€…门诊记录
     */
@@ -21,7 +25,7 @@
    /**
     * æŸ¥è¯¢æ‚£è€…门诊记录列表
     *
     *
     * @param patMedOuthosp æ‚£è€…门诊记录
     * @return æ‚£è€…门诊记录集合
     */
@@ -29,7 +33,7 @@
    /**
     * æ–°å¢žæ‚£è€…门诊记录
     *
     *
     * @param patMedOuthosp æ‚£è€…门诊记录
     * @return ç»“æžœ
     */
@@ -37,7 +41,7 @@
    /**
     * ä¿®æ”¹æ‚£è€…门诊记录
     *
     *
     * @param patMedOuthosp æ‚£è€…门诊记录
     * @return ç»“æžœ
     */
@@ -45,7 +49,7 @@
    /**
     * æ‰¹é‡åˆ é™¤æ‚£è€…门诊记录
     *
     *
     * @param ids éœ€è¦åˆ é™¤çš„æ‚£è€…门诊记录主键集合
     * @return ç»“æžœ
     */
@@ -53,9 +57,14 @@
    /**
     * åˆ é™¤æ‚£è€…门诊记录信息
     *
     *
     * @param id æ‚£è€…门诊记录主键
     * @return ç»“æžœ
     */
    public int deletePatMedOuthospById(Long id);
    public PatMedRes selectPatMedOuthospCount(@RequestBody PatMedReq patMedReq);
    //通过患者ID获取到最新的deptcode
    public PatMedOuthosp getDeptCodeByPatId(PatMedOuthosp patMedOuthosp);
}
smartor/src/main/java/com/smartor/service/IServiceSubtaskAnswerService.java
@@ -5,6 +5,7 @@
import org.springframework.web.bind.annotation.RequestBody;
import java.util.List;
import java.util.Map;
/**
 * ä»»åŠ¡é—®å·é—®é¢˜é€‰é¡¹Service接口
@@ -77,6 +78,8 @@
     */
    public Integer saveQuestionCache(ServiceSubTaskCacheReq serviceSubTaskCacheReq);
    public List<ServiceSubtaskDetailVO> selectPatQuestionResult(ServiceSubTaskQueryReq serviceSubTaskQueryReq);
    public List<SvyLibTemplateScriptVO> getQuestionCache(ServiceSubTaskCacheReq serviceSubTaskCacheReq);
    public Map<String, Object> selectPatQuestionResult(ServiceSubTaskQueryReq serviceSubTaskQueryReq);
}
smartor/src/main/java/com/smartor/service/IServiceSubtaskService.java
@@ -23,10 +23,10 @@
    /**
     * æŸ¥è¯¢å•一任务(随访)列表
     *
     * @param ServiceSubtask å•一任务(随访)
     * @param serviceSubtaskVO å•一任务(随访)
     * @return å•一任务(随访)集合
     */
    public List<ServiceSubtask> selectServiceSubtaskList(ServiceSubtask ServiceSubtask);
    public List<ServiceSubtask> selectServiceSubtaskList(ServiceSubtaskVO serviceSubtaskVO);
    /**
     * æ ¹æ®æ¡ä»¶æŸ¥è¯¢ä»»åŠ¡ä¿¡æ¯
@@ -99,4 +99,12 @@
    public Integer saveQuestionAnswerPhone(ServiceSubTaskDetailReq serviceSubTaskDetailReq);
    /**
     * èŽ·å–éšè®¿ã€å¤è¯Šé‡
     *
     * @param serviceSubtaskCountReq
     * @return
     */
    public List<ServiceSubtaskCount> getSfFzInfoEveryMonth(ServiceSubtaskCountReq serviceSubtaskCountReq);
}
smartor/src/main/java/com/smartor/service/IServiceTaskService.java
@@ -1,6 +1,7 @@
package com.smartor.service;
import java.util.List;
import java.util.Map;
import com.smartor.domain.IvrLibaTemplateScriptVO;
import com.smartor.domain.ServiceTask;
@@ -67,7 +68,7 @@
     * @param patid
     * @return
     */
    public List getScriptInfoByCondition(Long taskid, Long patid);
    public Map<String, Object> getScriptInfoByCondition(Long taskid, Long patid);
}
smartor/src/main/java/com/smartor/service/ISvyTaskSingleService.java
@@ -1,5 +1,7 @@
package com.smartor.service;
import com.smartor.domain.ServiceSubtask;
import com.smartor.domain.ServiceTaskVO;
import com.smartor.domain.SvyTaskSingle;
import com.smartor.domain.SvyTaskVO;
@@ -12,58 +14,13 @@
 * @date 2024-06-12
 */
public interface ISvyTaskSingleService {
    /**
     * æŸ¥è¯¢å•一任务(问卷)
     *
     * @param id å•一任务(问卷)主键
     * @return å•一任务(问卷)
     */
    public SvyTaskSingle selectSvyTaskSingleById(Long id);
    /**
     * æŸ¥è¯¢å•一任务(问卷)列表
     *
     * @param svyTaskSingle å•一任务(问卷)
     * @return å•一任务(问卷)集合
     */
    public List<SvyTaskSingle> selectSvyTaskSingleList(SvyTaskSingle svyTaskSingle);
    /**
     * æ–°å¢žå•一任务(问卷)
     *
     * @param svyTaskSingle å•一任务(问卷)
     * @return ç»“æžœ
     */
    public int insertSvyTaskSingle(SvyTaskSingle svyTaskSingle);
    /**
     * ä¿®æ”¹å•一任务(问卷)
     *
     * @param svyTaskSingle å•一任务(问卷)
     * @return ç»“æžœ
     */
    public int updateSvyTaskSingle(SvyTaskSingle svyTaskSingle);
    /**
     * æ‰¹é‡åˆ é™¤å•一任务(问卷)
     *
     * @param ids éœ€è¦åˆ é™¤çš„单一任务(问卷)主键集合
     * @return ç»“æžœ
     */
    public int deleteSvyTaskSingleByIds(Long[] ids);
    /**
     * åˆ é™¤å•一任务(问卷)信息
     *
     * @param id å•一任务(问卷)主键
     * @return ç»“æžœ
     */
    public int deleteSvyTaskSingleById(Long id);
    /**
     * æ–°å¢žæˆ–修改删除问卷任务
     */
    public int insertOrUpdateSvyTask(SvyTaskVO svyTaskVO);
    public int insertOrUpdateSvyTask(ServiceTaskVO serviceTaskVO);
    public SvyTaskVO queryTaskByCondition(SvyTaskSingle svyTaskSingle);
    public ServiceTaskVO queryTaskByCondition(ServiceSubtask serviceSubtask);
}
smartor/src/main/java/com/smartor/service/impl/CommonTaskServiceImpl.java
@@ -185,6 +185,9 @@
                    try {
                        Date date = sdf.parse(begantime);
                        milliseconds = date.getTime() - System.currentTimeMillis();
                        if (milliseconds < 0) {
                            milliseconds = 1000L;
                        }
                        System.out.println("日期毫秒数:" + milliseconds);
                    } catch (Exception e) {
                        e.printStackTrace();
smartor/src/main/java/com/smartor/service/impl/PatArchiveServiceImpl.java
@@ -1,13 +1,5 @@
package com.smartor.service.impl;
import java.io.FileOutputStream;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.stream.Collectors;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.exception.base.BaseException;
@@ -16,7 +8,9 @@
import com.ruoyi.common.utils.StringUtils;
import com.smartor.domain.*;
import com.smartor.mapper.BaseTagMapper;
import com.smartor.mapper.PatArchiveMapper;
import com.smartor.mapper.PatArchivetagMapper;
import com.smartor.service.IPatArchiveService;
import com.smartor.service.IPatMedInhospService;
import com.smartor.service.IPatMedOuthospService;
import com.smartor.service.IPatMedPhysicalService;
@@ -24,14 +18,23 @@
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.poi.hssf.usermodel.HSSFDateUtil;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.ss.usermodel.DataFormatter;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.smartor.mapper.PatArchiveMapper;
import com.smartor.service.IPatArchiveService;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import java.io.FileOutputStream;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.stream.Collectors;
/**
 * æ‚£è€…档案Service业务层处理
@@ -96,15 +99,8 @@
    @Override
    public Integer insertPatArchive(PatArchive patArchive) {
        patArchive.setCreateTime(DateUtils.getNowDate());
        List<PatArchive> patArchives = new ArrayList<>();
        patArchives.add(patArchive);
        patArchiveMapper.insertPatArchive(patArchives);
        if (CollectionUtils.isNotEmpty(patArchives)) {
            patArchives.get(0).getId();
            log.info("患者id为: {}", patArchives.get(0).getId());
            return patArchives.get(0).getId().intValue();
        }
        return null;
        patArchiveMapper.insertPatArchiveSingle(patArchive);
        return patArchive.getId().intValue();
    }
    @Override
smartor/src/main/java/com/smartor/service/impl/PatFilterlistServiceImpl.java
@@ -3,6 +3,7 @@
import com.ruoyi.common.utils.DateUtils;
import com.smartor.domain.PatFilterlist;
import com.smartor.domain.ServiceSubtask;
import com.smartor.domain.ServiceSubtaskVO;
import com.smartor.mapper.PatFilterlistMapper;
import com.smartor.mapper.ServiceSubtaskMapper;
import com.smartor.service.IPatFilterlistService;
@@ -58,7 +59,7 @@
    @Override
    public int insertPatFilterlist(PatFilterlist patFilterlist) {
        //先查询一下,该患者是否有执行的任务,如果有的话,将任务暂停
        ServiceSubtask serviceSubtask = new ServiceSubtask();
        ServiceSubtaskVO serviceSubtask = new ServiceSubtaskVO();
        serviceSubtask.setPatid(patFilterlist.getPatid());
        serviceSubtask.setDelFlag("0");
        List<ServiceSubtask> selectServiceSubtaskList = serviceSubtaskMapper.selectServiceSubtaskList(serviceSubtask);
smartor/src/main/java/com/smartor/service/impl/PatMedInhospServiceImpl.java
@@ -2,12 +2,12 @@
import java.time.LocalDate;
import java.time.ZoneOffset;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.*;
import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.DtoConversionUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.smartor.domain.*;
import com.smartor.mapper.*;
@@ -45,6 +45,8 @@
    @Autowired
    private ServiceSubtaskMapper serviceSubtaskMapper;
    @Autowired
    private SysUserDeptMapper sysUserDeptMapper;
    //记录长期任务基础信息
    List<IvrLibaTemplate> libaTemplates = new ArrayList<>();
@@ -71,6 +73,49 @@
    @Override
    public List<PatMedInhosp> selectPatMedInhospList(PatMedInhosp patMedInhosp) {
        return patMedInhospMapper.selectPatMedInhospList(patMedInhosp);
    }
    @Override
    public PatMedInhosp getDeptCodeByPatId(PatMedInhosp patMedInhosp) {
        List<PatMedInhosp> patMedInhosps = selectPatMedInhospList(patMedInhosp);
        if (!org.springframework.util.CollectionUtils.isEmpty(patMedInhosps)) {
            if (patMedInhosp.getInhospstate().equals("0")) {
                //先去掉时间为空的
                patMedInhosps.removeIf(PatMedInhosp -> PatMedInhosp.getStarttime() == null);
                Collections.sort(patMedInhosps, Comparator.comparing(PatMedInhosp::getStarttime).reversed());
            } else if (patMedInhosp.getInhospstate().equals("1")) {
                //先去掉时间为空的
                patMedInhosps.removeIf(PatMedInhosp -> PatMedInhosp.getEndtime() == null);
                Collections.sort(patMedInhosps, Comparator.comparing(PatMedInhosp::getEndtime).reversed());
            }
        }
        if (patMedInhosps != null && patMedInhosps.size() > 0) return patMedInhosps.get(0);
        else return null;
    }
    /**
     * æŸ¥è¯¢å‡ºå…¥é™¢äººæ¬¡
     *
     * @param patMedReq
     * @return
     */
    @Override
    public PatMedRes selectPatMedInhospListCount(PatMedReq patMedReq) {
        PatMedRes patMedRes = null;
        // èŽ·å–å½“å‰ç™»é™†äººçš„éƒ¨é—¨æƒé™
        if (org.springframework.util.CollectionUtils.isEmpty(patMedReq.getDeptcodeList())) {
            Long userId = SecurityUtils.getUserId();
            List<SysDept> sysDepts = sysUserDeptMapper.selectDeptListByUserId(userId);
            List<String> deptCode = new ArrayList<>();
            for (SysDept sysDept : sysDepts) {
                deptCode.add(sysDept.getDeptId().toString());
            }
            patMedReq.setDeptcodeList(deptCode);
            patMedRes = patMedInhospMapper.selectPatMedInhospCount(patMedReq);
        }
        return patMedRes;
    }
    /**
@@ -202,4 +247,18 @@
        }
        return 1;
    }
    /**
     * èŽ·å–å‡ºé™¢ï¼Œä½é™¢ï¼Œé—¨è¯ŠæœåŠ¡äººæ¬¡
     *
     * @param patMedReq
     * @return
     */
    @Override
    public List<PatMedRes> getDeptRanking(PatMedReq patMedReq) {
        return patMedInhospMapper.getDeptRanking(patMedReq);
    }
}
smartor/src/main/java/com/smartor/service/impl/PatMedOuthospServiceImpl.java
@@ -1,12 +1,23 @@
package com.smartor.service.impl;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.common.core.domain.entity.SysUserDept;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.smartor.domain.PatMedReq;
import com.smartor.domain.PatMedRes;
import com.smartor.mapper.SysUserDeptMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.smartor.mapper.PatMedOuthospMapper;
import com.smartor.domain.PatMedOuthosp;
import com.smartor.service.IPatMedOuthospService;
import org.springframework.util.CollectionUtils;
/**
 * æ‚£è€…门诊记录Service业务层处理
@@ -15,10 +26,13 @@
 * @date 2023-03-04
 */
@Service
public class PatMedOuthospServiceImpl implements IPatMedOuthospService
{
public class PatMedOuthospServiceImpl implements IPatMedOuthospService {
    @Autowired
    private PatMedOuthospMapper patMedOuthospMapper;
    @Autowired
    private SysUserDeptMapper sysUserDeptMapper;
    /**
     * æŸ¥è¯¢æ‚£è€…门诊记录
@@ -27,8 +41,7 @@
     * @return æ‚£è€…门诊记录
     */
    @Override
    public PatMedOuthosp selectPatMedOuthospById(Long id)
    {
    public PatMedOuthosp selectPatMedOuthospById(Long id) {
        return patMedOuthospMapper.selectPatMedOuthospById(id);
    }
@@ -39,8 +52,7 @@
     * @return æ‚£è€…门诊记录
     */
    @Override
    public List<PatMedOuthosp> selectPatMedOuthospList(PatMedOuthosp patMedOuthosp)
    {
    public List<PatMedOuthosp> selectPatMedOuthospList(PatMedOuthosp patMedOuthosp) {
        return patMedOuthospMapper.selectPatMedOuthospList(patMedOuthosp);
    }
@@ -51,8 +63,7 @@
     * @return ç»“æžœ
     */
    @Override
    public int insertPatMedOuthosp(PatMedOuthosp patMedOuthosp)
    {
    public int insertPatMedOuthosp(PatMedOuthosp patMedOuthosp) {
        patMedOuthosp.setCreateTime(DateUtils.getNowDate());
        patMedOuthosp.setUpdateTime(DateUtils.getNowDate());
        return patMedOuthospMapper.insertPatMedOuthosp(patMedOuthosp);
@@ -65,8 +76,7 @@
     * @return ç»“æžœ
     */
    @Override
    public int updatePatMedOuthosp(PatMedOuthosp patMedOuthosp)
    {
    public int updatePatMedOuthosp(PatMedOuthosp patMedOuthosp) {
        patMedOuthosp.setUpdateTime(DateUtils.getNowDate());
        return patMedOuthospMapper.updatePatMedOuthosp(patMedOuthosp);
    }
@@ -78,8 +88,7 @@
     * @return ç»“æžœ
     */
    @Override
    public int deletePatMedOuthospByIds(Long[] ids)
    {
    public int deletePatMedOuthospByIds(Long[] ids) {
        return patMedOuthospMapper.deletePatMedOuthospByIds(ids);
    }
@@ -90,8 +99,31 @@
     * @return ç»“æžœ
     */
    @Override
    public int deletePatMedOuthospById(Long id)
    {
    public int deletePatMedOuthospById(Long id) {
        return patMedOuthospMapper.deletePatMedOuthospById(id);
    }
    @Override
    public PatMedRes selectPatMedOuthospCount(PatMedReq patMedReq) {
        // èŽ·å–å½“å‰ç™»é™†äººçš„éƒ¨é—¨æƒé™
        if (CollectionUtils.isEmpty(patMedReq.getDeptcodeList())) {
            Long userId = SecurityUtils.getUserId();
            List<SysDept> sysDepts = sysUserDeptMapper.selectDeptListByUserId(userId);
            List<String> deptCode = new ArrayList<>();
            for (SysDept sysDept : sysDepts) {
                deptCode.add(sysDept.getDeptId().toString());
            }
            patMedReq.setDeptcodeList(deptCode);
        }
        return patMedOuthospMapper.selectPatMedOuthospCount(patMedReq);
    }
    @Override
    public PatMedOuthosp getDeptCodeByPatId(PatMedOuthosp patMedOuthosp) {
        List<PatMedOuthosp> patMedOuthosps = selectPatMedOuthospList(patMedOuthosp);
        if (!CollectionUtils.isEmpty(patMedOuthosps)) {
            Collections.sort(patMedOuthosps, Comparator.comparing(PatMedOuthosp::getAdmitdate).reversed());
        }
        return patMedOuthosps.get(0);
    }
}
smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskAnswerServiceImpl.java
@@ -9,8 +9,10 @@
import com.smartor.domain.*;
import com.smartor.mapper.ServiceSubtaskAnswerMapper;
import com.smartor.mapper.ServiceSubtaskDetailMapper;
import com.smartor.mapper.ServiceSubtaskMapper;
import com.smartor.mapper.SvyTaskTemplateTargetoptionMapper;
import com.smartor.service.IServiceSubtaskAnswerService;
import com.smartor.service.IServiceTaskService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
@@ -18,7 +20,9 @@
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.*;
import java.util.concurrent.TimeUnit;
/**
 * ä»»åŠ¡é—®å·é—®é¢˜é€‰é¡¹Service业务层处理
@@ -33,10 +37,16 @@
    private ServiceSubtaskAnswerMapper serviceSubtaskAnswerMapper;
    @Autowired
    private ServiceSubtaskMapper serviceSubtaskMapper;
    @Autowired
    private RedisCache redisCache;
    @Autowired
    private ServiceSubtaskDetailMapper serviceSubtaskDetailMapper;
    @Autowired
    private IServiceTaskService serviceTaskService;
    @Autowired
    private SvyTaskTemplateTargetoptionMapper svyTaskTemplateTargetoptionMapper;
@@ -114,12 +124,15 @@
    @Override
    public Integer saveQuestionAnswer(ServiceSubTaskAnswerReq serviceSubTaskAnswerReq) {
        Long tid = null;
        Long pid = null;
        Double score = null;
        Set<String> allKeys = redisCache.getAllKeys();
        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));
            tid = Long.valueOf(rsaPublicKeyExample.decryptedData(serviceSubTaskAnswerReq.getParam1(), pri_key));
            pid = Long.valueOf(rsaPublicKeyExample.decryptedData(serviceSubTaskAnswerReq.getParam2(), pri_key));
            allKeys = new HashSet<>();
            allKeys.add(pid + "-" + tid + "-WJscriptCache");
        }
@@ -128,26 +141,53 @@
        for (String key : allKeys) {
            String[] split = key.split("-");
            if (key.contains("-WJscriptCache")) {
                List<SvyTaskTemplateScriptVO> cacheList = redisCache.getCacheList(key);
                List<SvyLibTemplateScriptVO> cacheList = redisCache.getCacheList(key);
                for (int i = 0; i < cacheList.size(); i++) {
                    if (i == 0) {
                        // è¯´æ˜Žæ˜¯ç¬¬ä¸€é¢˜
                        //将第一题的信息放到表中
                        nextScriptno = setWJInfo(cacheList.get(0), Long.valueOf(split[1]), Long.valueOf(split[0]));
                    } else {
                        for (SvyTaskTemplateScriptVO svyTaskTemplateScriptVO : cacheList) {
                            if (svyTaskTemplateScriptVO.getId() == nextScriptno) {
                                //将第一题的信息放到表中
                                setWJInfo(svyTaskTemplateScriptVO, Long.valueOf(split[1]), Long.valueOf(split[0]));
                                nextScriptno = Long.valueOf(cacheList.get(0).getNextScriptno());
                        //这个时间要找到第一题
                        for (SvyLibTemplateScriptVO svyLibTemplateScriptVO : cacheList) {
                            if (svyLibTemplateScriptVO.getSort() == 1) {
                                //说明是第一题
                                SvyTaskTemplateScriptVO svyTaskTemplateScriptVO = DtoConversionUtils.sourceToTarget(cacheList.get(0), SvyTaskTemplateScriptVO.class);
                                List<SvyLibTemplateTargetoption> svyLibTemplateTargetoptions = cacheList.get(0).getSvyLibTemplateTargetoptions();
                                List<SvyTaskTemplateTargetoption> svyTaskTemplateTargetoptions = DtoConversionUtils.sourceToTarget(svyLibTemplateTargetoptions, SvyTaskTemplateTargetoption.class);
                                svyTaskTemplateScriptVO.setSvyTaskTemplateTargetoptions(svyTaskTemplateTargetoptions);
                                Map<String, String> map = setWJInfo(svyTaskTemplateScriptVO, tid, pid);
                                nextScriptno = Long.valueOf(map.get("nextScriptNo"));
                                if (score == null) {
                                    score = Double.valueOf(map.get("score"));
                                } else {
                                    score = score + Double.valueOf(map.get("score"));
                                }
                            }
                        }
                    } else {
                        SvyTaskTemplateScriptVO svyTaskTemplateScriptVO = DtoConversionUtils.sourceToTarget(cacheList.get(i), SvyTaskTemplateScriptVO.class);
                        List<SvyTaskTemplateTargetoption> svyTaskTemplateTargetoptions = DtoConversionUtils.sourceToTarget(cacheList.get(i).getSvyLibTemplateTargetoptions(), SvyTaskTemplateTargetoption.class);
                        svyTaskTemplateScriptVO.setSvyTaskTemplateTargetoptions(svyTaskTemplateTargetoptions);
                        if (svyTaskTemplateScriptVO.getSort() == nextScriptno) {
                            Map<String, String> map = setWJInfo(svyTaskTemplateScriptVO, Long.valueOf(split[1]), Long.valueOf(split[0]));
                            nextScriptno = Long.valueOf(map.get("nextScriptNo"));
                            if (score == null) {
                                score = Double.valueOf(map.get("score"));
                            } else {
                                score = score + Double.valueOf(map.get("score"));
                            }
                        }
                    }
                }
            }
            //将该key和value从redis中,删除
            redisCache.deleteObject(key);
            ServiceSubtask serviceSubtask = new ServiceSubtask();
            serviceSubtask.setTaskid(tid);
            serviceSubtask.setPatid(pid);
            serviceSubtask.setFinishtime(new Date());
            if (score != null) serviceSubtask.setScore(BigDecimal.valueOf(score));
            serviceSubtaskMapper.updateServiceSubtaskByCondition(serviceSubtask);
        }
        return 1;
    }
@@ -164,35 +204,80 @@
        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());
        redisCache.deleteObject(pid + "-" + tid + "-WJscriptCache");
        redisCache.setCacheList(pid + "-" + tid + "-WJscriptCache", serviceSubTaskCacheReq.getSvyLibTemplateScriptVOS());
        //设置过期时间 3天
        Long tims = Long.valueOf(3 * 24 * 3600);
        redisCache.expire(pid + "-" + tid + "-WJscriptCache", tims);
        return 1;
    }
    @Override
    public List<ServiceSubtaskDetailVO> selectPatQuestionResult(ServiceSubTaskQueryReq serviceSubTaskQueryReq) {
        log.error("selectPatQuesTionResult的入参为:{}", serviceSubTaskQueryReq);
        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 serviceSubtaskDetailVOList;
    public List<SvyLibTemplateScriptVO> getQuestionCache(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));
        //问卷
        List<SvyLibTemplateScriptVO> svyTaskTemplateScriptVOList = redisCache.getCacheList(pid + "-" + tid + "-WJscriptCache");
        return svyTaskTemplateScriptVOList;
    }
    private Long setWJInfo(SvyTaskTemplateScriptVO svyTaskTemplateScriptVO, Long taskid, Long patid) {
        //下题跳转
        Long nextScriptNo = null;
    @Override
    public Map<String, Object> selectPatQuestionResult(ServiceSubTaskQueryReq serviceSubTaskQueryReq) {
        log.error("selectPatQuesTionResult的入参为:{}", serviceSubTaskQueryReq);
        Map<String, Object> map = new HashMap<>();
        Map<String, Object> scriptInfoByCondition = serviceTaskService.getScriptInfoByCondition(serviceSubTaskQueryReq.getTaskid(), serviceSubTaskQueryReq.getPatid());
        if (scriptInfoByCondition.get("type").equals("1")) {
            List<IvrLibaTemplateScriptVO> ivrLibaTemplateScriptVOList = (List) scriptInfoByCondition.get("script");
            for (IvrLibaTemplateScriptVO ivrLibaTemplateScriptVO : ivrLibaTemplateScriptVOList) {
                String scriptResult = getScriptResult(serviceSubTaskQueryReq.getTaskid(), serviceSubTaskQueryReq.getPatid(), ivrLibaTemplateScriptVO.getId());
                ivrLibaTemplateScriptVO.setScriptResult(scriptResult);
            }
            map.put("scriptResult", ivrLibaTemplateScriptVOList);
            map.put("taskName", scriptInfoByCondition.get("taskName"));
            return map;
        } else if (scriptInfoByCondition.get("type").equals("2")) {
            List<SvyLibTemplateScriptVO> svyLibTemplateScriptVOList = (List) scriptInfoByCondition.get("script");
            for (SvyLibTemplateScriptVO svyLibTemplateScriptVO : svyLibTemplateScriptVOList) {
                String scriptResult = getScriptResult(serviceSubTaskQueryReq.getTaskid(), serviceSubTaskQueryReq.getPatid(), svyLibTemplateScriptVO.getId());
                svyLibTemplateScriptVO.setScriptResult(scriptResult);
            }
            map.put("scriptResult", scriptInfoByCondition);
            map.put("taskName", scriptInfoByCondition.get("taskName"));
            return map;
        } else if (scriptInfoByCondition.get("type").equals("3")) {
            //宣教不需要查看
            List<HeLibrary> heLibraryList = (List) scriptInfoByCondition.get("script");
            map.put("scriptResult", heLibraryList);
            map.put("taskName", scriptInfoByCondition.get("taskName"));
            return map;
        }
        return null;
    }
    private String getScriptResult(Long tid, Long pid, Long sid) {
        ServiceSubtaskDetail serviceSubtaskDetail = new ServiceSubtaskDetail();
        serviceSubtaskDetail.setTaskid(tid);
        serviceSubtaskDetail.setPatid(pid);
        serviceSubtaskDetail.setScriptid(sid);
        List<ServiceSubtaskDetail> serviceSubtaskDetails = serviceSubtaskDetailMapper.selectServiceSubtaskDetailList(serviceSubtaskDetail);
        if (CollectionUtils.isNotEmpty(serviceSubtaskDetails)) {
            return serviceSubtaskDetails.get(0).getAsrtext();
        }
        return "";
    }
    private Map<String, String> setWJInfo(SvyTaskTemplateScriptVO svyTaskTemplateScriptVO, Long taskid, Long patid) {
        ServiceSubtaskVO serviceSubtaskVO = new ServiceSubtaskVO();
        serviceSubtaskVO.setTaskid(taskid);
        serviceSubtaskVO.setPatid(patid);
        List<ServiceSubtask> selectServiceSubtaskList = serviceSubtaskMapper.selectServiceSubtaskList(serviceSubtaskVO);
        String score = "0";
        //下题跳转
        String nextScriptNo = null;
        ServiceSubtaskDetailVO serviceSubtaskDetailVO = new ServiceSubtaskDetailVO();
        List<ServiceSubtaskOptionAnswer> answerList = new ArrayList<>();
        if (svyTaskTemplateScriptVO.getScriptType().equals("1") || svyTaskTemplateScriptVO.getScriptType().equals("2")) {
@@ -200,45 +285,66 @@
            for (SvyTaskTemplateTargetoption svyTaskTemplateTargetoption : svyTaskTemplateScriptVO.getSvyTaskTemplateTargetoptions()) {
                //将问题选项记录下来
                if (StringUtils.isEmpty(serviceSubtaskDetailVO.getTargetvalue())) {
                    serviceSubtaskDetailVO.setTargetvalue(svyTaskTemplateTargetoption.getTargetvalue());
                    serviceSubtaskDetailVO.setTargetvalue(svyTaskTemplateTargetoption.getOptioncontent());
                } else {
                    serviceSubtaskDetailVO.setTargetvalue(serviceSubtaskDetailVO.getTargetvalue() + "  " + svyTaskTemplateTargetoption.getTargetvalue());
                    serviceSubtaskDetailVO.setTargetvalue(serviceSubtaskDetailVO.getTargetvalue() + "  " + svyTaskTemplateTargetoption.getOptioncontent());
                }
                if (svyTaskTemplateTargetoption.getIsUserOperation() == true) {
                    //将选中的结果放到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();
                    }
                }
//                if (svyTaskTemplateTargetoption.getIsUserOperation() == true) {
//                    //将选中的结果放到asrtext中
//                    if (StringUtils.isEmpty(serviceSubtaskDetailVO.getAsrtext())) {
//                        //和前端商量,前端会将选中的结果更新到问题上
////                        serviceSubtaskDetailVO.setAsrtext(svyTaskTemplateTargetoption.getTargetvalue());
//                        serviceSubtaskDetailVO.setAsrtext(svyTaskTemplateScriptVO.getScriptResult());
//                    } else {
//                        //如果是多选,答案需要用 & è¿›è¡Œæ‹¼æŽ¥(//和前端商量,前端会将选中的结果更新到问题上)
////                        serviceSubtaskDetailVO.setAsrtext(serviceSubtaskDetailVO.getAnswerps() + "&" + svyTaskTemplateTargetoption.getTargetvalue());
//                        serviceSubtaskDetailVO.setAsrtext(svyTaskTemplateScriptVO.getScriptResult());
//                    }
//                    if (svyTaskTemplateScriptVO.getScriptType().equals("1") && svyTaskTemplateScriptVO.getBranchFlag().equals("1")) {
//                        //是单选,并且是有分支的(和前端商量,在外链结果保存时,会将选中的选项上的跳转更新到题目上)
////                        nextScriptNo = svyTaskTemplateTargetoption.getNextQuestion().toString();
//                        nextScriptNo = svyTaskTemplateScriptVO.getNextScriptno().toString();
//                        score = svyTaskTemplateTargetoption.getScore().toString();
//                    } else {
//                        nextScriptNo = svyTaskTemplateScriptVO.getNextScriptno().toString();
//                        score = svyTaskTemplateScriptVO.getScore().toString();
//                    }
//                }
            }
            serviceSubtaskDetailVO.setSvyTaskTemplateTargetoptions(svyTaskTemplateScriptVO.getSvyTaskTemplateTargetoptions());
            nextScriptNo = svyTaskTemplateScriptVO.getNextScriptno().toString();
            if (svyTaskTemplateScriptVO.getScore() != null) {
                score = String.valueOf(svyTaskTemplateScriptVO.getScore());
            }
            serviceSubtaskDetailVO.setAsrtext(svyTaskTemplateScriptVO.getScriptResult());
//            if (StringUtils.isEmpty(serviceSubtaskDetailVO.getAsrtext())) {
//                nextScriptNo = svyTaskTemplateScriptVO.getNextScriptno().toString();
//            }
//            serviceSubtaskDetailVO.setSvyTaskTemplateTargetoptions(svyTaskTemplateScriptVO.getSvyTaskTemplateTargetoptions());
        } else {
            //非单多选
            if (CollectionUtils.isNotEmpty(svyTaskTemplateScriptVO.getSvyTaskTemplateTargetoptions())) {
            if (StringUtils.isNotEmpty(svyTaskTemplateScriptVO.getScriptResult())) {
                serviceSubtaskDetailVO.setAsrtext(svyTaskTemplateScriptVO.getScriptResult());
                nextScriptNo = svyTaskTemplateScriptVO.getNextScriptno();
                nextScriptNo = svyTaskTemplateScriptVO.getNextScriptno().toString();
                if (svyTaskTemplateScriptVO.getScore() != null) {
                    score = String.valueOf(svyTaskTemplateScriptVO.getScore());
                }
            }
        }
        serviceSubtaskDetailVO.setQuestiontext(svyTaskTemplateScriptVO.getScriptContent());
        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());
        serviceSubtaskDetailVO.setSubId(selectServiceSubtaskList.get(0).getId());
        ServiceSubtaskDetail serviceSubtaskDetail = DtoConversionUtils.sourceToTarget(serviceSubtaskDetailVO, ServiceSubtaskDetail.class);
        serviceSubtaskDetailMapper.insertServiceSubtaskDetail(serviceSubtaskDetail);
        return nextScriptNo;
        Map<String, String> map = new HashMap<>();
        map.put("nextScriptNo", nextScriptNo);
        map.put("score", score);
        return map;
    }
}
smartor/src/main/java/com/smartor/service/impl/ServiceTaskServiceImpl.java
@@ -40,6 +40,9 @@
    private SvyLibTemplateScriptMapper svyLibTemplateScriptMapper;
    @Autowired
    private SvyTaskTemplateMapper svyTaskTemplateMapper;
    @Autowired
    private PatArchiveMapper patArchiveMapper;
    @Autowired
@@ -136,7 +139,7 @@
    }
    @Override
    public List getScriptInfoByCondition(Long taskid, Long patid) {
    public Map<String, Object> getScriptInfoByCondition(Long taskid, Long patid) {
        //通过任务ID获取模板ID
        ServiceTask serviceTask = selectServiceTaskByTaskid(taskid);
        List info = new ArrayList();
@@ -148,7 +151,7 @@
            info = wjInfo(serviceTask, patid);
        } else {
            //宣教
            info = xjInfo(serviceTask.getTemplateid());
            info = xjInfo(Long.valueOf(serviceTask.getLibtemplateid()));
        }
        //只要打开了页面,就算成功
@@ -158,8 +161,14 @@
        ServiceTaskSingle.setResult("success");
        ServiceTaskSingle.setFinishtime(new Date());
        serviceSubtaskMapper.updateServiceSubtaskByCondition(ServiceTaskSingle);
        SvyTaskTemplate svyTaskTemplate = svyTaskTemplateMapper.selectSvyTaskTemplateBySvyid(serviceTask.getTemplateid());
        Map<String, Object> map = new HashMap<>();
        map.put("script", info);
        map.put("revisitAfter", svyTaskTemplate.getConclusion());
        map.put("type", serviceTask.getType());
        map.put("taskName",serviceTask.getTaskName());
        return info;
        return map;
    }
    /**
@@ -232,7 +241,7 @@
    private List wjInfo(ServiceTask serviceTask, Long patid) {
        //通过模板ID获取问题信息
        SvyLibTemplateScript svyLibTemplateScript = new SvyLibTemplateScript();
        svyLibTemplateScript.setId(Long.valueOf(serviceTask.getTemplateid()));
        svyLibTemplateScript.setSvyid(Long.valueOf(serviceTask.getLibtemplateid()));
        svyLibTemplateScript.setDelFlag("0");
        List<SvyLibTemplateScript> svyLibTemplateScripts = svyLibTemplateScriptMapper.selectSvyLibTemplateScriptList(svyLibTemplateScript);
        if (CollectionUtils.isEmpty(svyLibTemplateScripts) || svyLibTemplateScripts.size() == 0) {
smartor/src/main/java/com/smartor/service/impl/SvyLibTemplateServiceImpl.java
@@ -56,7 +56,23 @@
        svyLibTemplateReq.setSvyid(svyLibTemplate.getSvyid());
        svyLibTemplateReq.setCategoryid(svyLibTemplate.getCategoryid());
        svyLibTemplateReq.setDescription(svyLibTemplate.getDescription());
        return svyLibTemplateMapper.selectSvyLibTemplateList(svyLibTemplateReq);
        List<SvyLibTemplate> svyLibTemplates = svyLibTemplateMapper.selectSvyLibTemplateList(svyLibTemplateReq);
        for (SvyLibTemplate svyLibTemplate1 : svyLibTemplates) {
            SvyLibTemplateScript svyLibTemplateScript = new SvyLibTemplateScript();
            svyLibTemplateScript.setSvyid(svyLibTemplate1.getSvyid());
            List<SvyLibTemplateScript> svyLibTemplateScripts = svyLibTemplateScriptMapper.selectSvyLibTemplateScriptList(svyLibTemplateScript);
            for (SvyLibTemplateScript svyLibTemplateScript1 : svyLibTemplateScripts) {
                if (svyLibTemplateScript1.getScriptType().equals("1") || svyLibTemplateScript1.getScriptType().equals("2")) {
                    SvyLibTemplateTargetoption svyLibTemplateTargetoption=new SvyLibTemplateTargetoption();
                    svyLibTemplateTargetoption.setScriptid(svyLibTemplateScript1.getId());
                    List<SvyLibTemplateTargetoption> svyLibTemplateTargetoptions = svyLibTemplateTargetoptionMapper.selectSvyLibTemplateTargetoptionList(svyLibTemplateTargetoption);
                    svyLibTemplateScript1.setSvyLibTemplateTargetoptions(svyLibTemplateTargetoptions);
                }
            }
            svyLibTemplate1.setSvyTemplateLibScripts(svyLibTemplateScripts);
        }
        return svyLibTemplates;
    }
    /**
smartor/src/main/java/com/smartor/service/impl/SvyTaskSingleServiceImpl.java
@@ -8,7 +8,9 @@
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.DtoConversionUtils;
import com.smartor.domain.*;
import com.smartor.mapper.ServiceSubtaskMapper;
import com.smartor.mapper.SvyTaskSingleMapper;
import com.smartor.service.IServiceTaskService;
import com.smartor.service.ISvyTaskService;
import com.smartor.service.ISvyTaskSingleService;
import lombok.extern.slf4j.Slf4j;
@@ -31,147 +33,82 @@
@Slf4j
@Service
public class SvyTaskSingleServiceImpl implements ISvyTaskSingleService {
    @Autowired
    private SvyTaskSingleMapper svyTaskSingleMapper;
    @Autowired
    private ISvyTaskService svyTaskService;
    private ServiceSubtaskMapper serviceSubtaskMapper;
    /**
     * æŸ¥è¯¢å•一任务(问卷)
     *
     * @param id å•一任务(问卷)主键
     * @return å•一任务(问卷)
     */
    @Override
    public SvyTaskSingle selectSvyTaskSingleById(Long id) {
        return svyTaskSingleMapper.selectSvyTaskSingleById(id);
    }
    @Autowired
    private IServiceTaskService iServiceTaskService;
    /**
     * æŸ¥è¯¢å•一任务(问卷)列表
     *
     * @param svyTaskSingle å•一任务(问卷)
     * @return å•一任务(问卷)
     */
    @Override
    public List<SvyTaskSingle> selectSvyTaskSingleList(SvyTaskSingle svyTaskSingle) {
        return svyTaskSingleMapper.selectSvyTaskSingleList(svyTaskSingle);
    }
    /**
     * æ–°å¢žå•一任务(问卷)
     *
     * @param svyTaskSingle å•一任务(问卷)
     * @return ç»“æžœ
     */
    @Override
    public int insertSvyTaskSingle(SvyTaskSingle svyTaskSingle) {
        svyTaskSingle.setCreateTime(DateUtils.getNowDate());
        return svyTaskSingleMapper.insertSvyTaskSingle(svyTaskSingle);
    }
    /**
     * ä¿®æ”¹å•一任务(问卷)
     *
     * @param svyTaskSingle å•一任务(问卷)
     * @return ç»“æžœ
     */
    @Override
    public int updateSvyTaskSingle(SvyTaskSingle svyTaskSingle) {
        svyTaskSingle.setUpdateTime(DateUtils.getNowDate());
        return svyTaskSingleMapper.updateSvyTaskSingle(svyTaskSingle);
    }
    /**
     * æ‰¹é‡åˆ é™¤å•一任务(问卷)
     *
     * @param ids éœ€è¦åˆ é™¤çš„单一任务(问卷)主键
     * @return ç»“æžœ
     */
    @Override
    public int deleteSvyTaskSingleByIds(Long[] ids) {
        return svyTaskSingleMapper.deleteSvyTaskSingleByIds(ids);
    }
    /**
     * åˆ é™¤å•一任务(问卷)信息
     *
     * @param id å•一任务(问卷)主键
     * @return ç»“æžœ
     */
    @Override
    public int deleteSvyTaskSingleById(Long id) {
        return svyTaskSingleMapper.deleteSvyTaskSingleById(id);
    }
    @Override
    public int insertOrUpdateSvyTask(SvyTaskVO svyTaskVO) {
        if (ObjectUtils.isEmpty(svyTaskVO)) {
    public int insertOrUpdateSvyTask(ServiceTaskVO serviceTaskVO) {
        if (ObjectUtils.isEmpty(serviceTaskVO)) {
            log.info("问卷任务入参为空,请检查入参");
            throw new BaseException("问卷任务入参为空,请检查入参");
        }
        Integer integer = 1;
        SvyTask svyTask = DtoConversionUtils.sourceToTarget(svyTaskVO, SvyTask.class);
        svyTask.setTextParam(JSON.toJSONString(svyTaskVO.getTextParamMap()));
        if (svyTaskVO.getIsoperation() != null && svyTaskVO.getIsoperation() == 1) {
        ServiceTask serviceTask = DtoConversionUtils.sourceToTarget(serviceTaskVO, ServiceTask.class);
        serviceTask.setTextParam(JSON.toJSONString(serviceTaskVO.getTextParam()));
        if (serviceTaskVO.getIsoperation() != null && serviceTaskVO.getIsoperation() == 1) {
            //往任务表中,新增任务
            if (ObjectUtils.isNotEmpty(svyTaskVO.getSendTimeSlot()))
                svyTask.setSendTimeSlot(JSON.toJSONString(svyTaskVO.getSendTimeSlot()));
            if (svyTask.getSendState() == null) svyTask.setSendState("1");
            svyTask.setTemplateid(svyTaskVO.getLibtemplateid());
            svyTaskService.insertSvyTask(svyTask);
            if (ObjectUtils.isNotEmpty(serviceTaskVO.getSendTimeslot()))
                serviceTask.setSendTimeSlot(JSON.toJSONString(serviceTaskVO.getSendTimeslot()));
            if (serviceTask.getSendState() == null) serviceTask.setSendState(1);
            serviceTask.setTemplateid(serviceTaskVO.getLibtemplateid());
            iServiceTaskService.insertServiceTask(serviceTask);
            //将任务信息放到服务表中
            SvyTaskSingle svyTaskSingle = DtoConversionUtils.sourceToTarget(svyTaskVO, SvyTaskSingle.class);
            svyTaskSingle.setTaskid(svyTask.getTaskid());
            ServiceSubtask serviceSubtask = DtoConversionUtils.sourceToTarget(serviceTaskVO, ServiceSubtask.class);
            serviceSubtask.setTaskid(serviceTask.getTaskid());
            //新增
            if (CollectionUtils.isNotEmpty(svyTaskVO.getPatTaskRelevances())) {
                for (PatTaskRelevance patTaskRelevance : svyTaskVO.getPatTaskRelevances()) {
            if (CollectionUtils.isNotEmpty(serviceTaskVO.getPatTaskRelevances())) {
                for (PatTaskRelevance patTaskRelevance : serviceTaskVO.getPatTaskRelevances()) {
                    //将任务信息新增到随访服务表中
                    svyTaskSingle.setSendname(patTaskRelevance.getName());
                    svyTaskSingle.setAge(patTaskRelevance.getAge());
                    svyTaskSingle.setSfzh(patTaskRelevance.getSfzh());
                    svyTaskSingle.setPhone(patTaskRelevance.getPhone());
                    svyTaskSingle.setAddr(patTaskRelevance.getAddr());
                    svyTaskSingle.setPatid(patTaskRelevance.getPatid());
                    svyTaskSingle.setSendstate(1L);
                    svyTaskSingle.setHospType(patTaskRelevance.getHospType());
                    svyTaskSingle.setCreateTime(DateUtils.getNowDate());
                    svyTaskSingleMapper.insertSvyTaskSingle(svyTaskSingle);
                    integer = svyTaskSingle.getId().intValue();
                    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.setSendstate(1L);
                    serviceSubtask.setHospType(patTaskRelevance.getHospType());
                    serviceSubtask.setCreateTime(DateUtils.getNowDate());
                    serviceSubtaskMapper.insertServiceSubtask(serviceSubtask);
                    integer = serviceSubtask.getId().intValue();
                }
            }
        } else if (svyTaskVO.getIsoperation() != null && svyTaskVO.getIsoperation() == 2) {
        } else if (serviceTaskVO.getIsoperation() != null && serviceTaskVO.getIsoperation() == 2) {
            //任务修改
            if (ObjectUtils.isNotEmpty(svyTaskVO.getSendTimeSlot()))
                svyTask.setSendTimeSlot(JSON.toJSONString(svyTaskVO.getSendTimeSlot()));
            if (ObjectUtils.isNotEmpty(serviceTaskVO.getSendTimeslot()))
                serviceTask.setSendTimeSlot(JSON.toJSONString(serviceTaskVO.getSendTimeslot()));
            //修改操作,需要将stopState状态+1
            SvyTask svyTask1 = svyTaskService.selectSvyTaskByTaskid(svyTaskVO.getTaskid());
            svyTask.setStopState(svyTask1.getStopState() + 1);
            svyTask.setTemplateid(svyTaskVO.getLibtemplateid());
            svyTaskService.updateSvyTask(svyTask);
            ServiceTask serviceTask2 = iServiceTaskService.selectServiceTaskByTaskid(serviceTaskVO.getTaskid());
            serviceTask2.setStopState(serviceTask.getStopState() + 1);
            serviceTask2.setTemplateid(serviceTaskVO.getLibtemplateid());
            iServiceTaskService.updateServiceTask(serviceTask2);
            if (CollectionUtils.isNotEmpty(svyTaskVO.getPatTaskRelevances())) {
                for (PatTaskRelevance patTaskRelevance : svyTaskVO.getPatTaskRelevances()) {
            if (CollectionUtils.isNotEmpty(serviceTaskVO.getPatTaskRelevances())) {
                for (PatTaskRelevance patTaskRelevance : serviceTaskVO.getPatTaskRelevances()) {
                    SvyTaskSingle svyTaskSingle = DtoConversionUtils.sourceToTarget(svyTaskVO, SvyTaskSingle.class);
                    svyTaskSingle.setSendname(patTaskRelevance.getName());
                    svyTaskSingle.setAge(patTaskRelevance.getAge());
                    svyTaskSingle.setSfzh(patTaskRelevance.getSfzh());
                    svyTaskSingle.setPhone(patTaskRelevance.getPhone());
                    svyTaskSingle.setAddr(patTaskRelevance.getAddr());
                    svyTaskSingle.setPatid(patTaskRelevance.getPatid());
                    svyTaskSingle.setHospType(patTaskRelevance.getHospType());
                    svyTaskSingle.setCreateTime(DateUtils.getNowDate());
                    svyTaskSingle.setTextParam(new Gson().toJson(svyTaskVO.getTextParamMap()));
                    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.setHospType(patTaskRelevance.getHospType());
                    serviceSubtask.setCreateTime(DateUtils.getNowDate());
                    serviceSubtask.setTextParam(new Gson().toJson(serviceTaskVO.getTextParam()));
                    if (patTaskRelevance.getIsoperation() != null) {
                        optionHandle(svyTaskSingle, svyTaskVO.getTaskid(), patTaskRelevance.getIsoperation(), patTaskRelevance.getPatid());
                        optionHandle(serviceSubtask, serviceTaskVO.getTaskid(), patTaskRelevance.getIsoperation(), patTaskRelevance.getPatid());
                    } else if (patTaskRelevance.getIsoperation() == null) {
                        optionHandle(svyTaskSingle, svyTaskVO.getTaskid(), svyTaskVO.getIsoperation(), patTaskRelevance.getPatid());
                        optionHandle(serviceSubtask, serviceTaskVO.getTaskid(), serviceTaskVO.getIsoperation(), patTaskRelevance.getPatid());
                    }
                    integer = svyTaskSingle.getTaskid().intValue();
                    integer = serviceSubtask.getTaskid().intValue();
                }
            }
        }
@@ -179,79 +116,81 @@
    }
    @Override
    public SvyTaskVO queryTaskByCondition(SvyTaskSingle svyTaskSingle) {
    public ServiceTaskVO queryTaskByCondition(ServiceSubtask serviceSubtask) {
        //定义患者与单一任务关联表集合
        List<PatTaskRelevance> patTaskRelevances = new ArrayList<>();
        List<SvyTaskSingle> list = selectSvyTaskSingleList(svyTaskSingle);
        if (CollectionUtils.isEmpty(list) || list.size() == 0) {
            return new SvyTaskVO();
        ServiceSubtaskVO serviceSubtaskVO = new ServiceSubtaskVO();
        serviceSubtaskVO.setTaskid(serviceSubtask.getTaskid());
        List<ServiceSubtask> selectServiceSubtaskList = serviceSubtaskMapper.selectServiceSubtaskList(serviceSubtaskVO);
        if (CollectionUtils.isEmpty(selectServiceSubtaskList) || selectServiceSubtaskList.size() == 0) {
            return new ServiceTaskVO();
        }
        SvyTask svyTask = svyTaskService.selectSvyTaskByTaskid(svyTaskSingle.getTaskid());
        ServiceTask serviceTask = iServiceTaskService.selectServiceTaskByTaskid(serviceSubtask.getTaskid());
        //将查出来的数据倒入ivrTasksingleVO中
        SvyTaskVO svyTaskVO = DtoConversionUtils.sourceToTarget(list.get(0), SvyTaskVO.class);
        svyTaskVO.setShowDate(svyTask.getShowDate());
        svyTaskVO.setShowTimeMorn(svyTask.getShowTimeMorn());
        svyTaskVO.setShowTimeNoon(svyTask.getShowTimeNoon());
        svyTaskVO.setShowTimeNight(svyTask.getShowTimeNight());
        svyTaskVO.setPreachform(svyTask.getPreachform());
        String sendTimeSlot = svyTask.getSendTimeSlot();
        ServiceTaskVO serviceTaskVO = DtoConversionUtils.sourceToTarget(selectServiceSubtaskList.get(0), ServiceTaskVO.class);
        serviceTaskVO.setShowDate(serviceTask.getShowDate());
        serviceTaskVO.setShowTimeMorn(serviceTask.getShowTimeMorn());
        serviceTaskVO.setShowTimeNoon(serviceTask.getShowTimeNoon());
        serviceTaskVO.setShowTimeNight(serviceTask.getShowTimeNight());
        serviceTaskVO.setPreachform(serviceTask.getPreachform());
        String sendTimeSlot = serviceTask.getSendTimeSlot();
        ObjectMapper objectMapper = new ObjectMapper();
        try {
            //获取到发送时间的集合
            if (com.ruoyi.common.utils.StringUtils.isNotEmpty(sendTimeSlot)) {
                List<TaskSendTimeVO> taskSendTimeVOList = objectMapper.readValue(sendTimeSlot, List.class);
                svyTaskVO.setSendTimeSlot(taskSendTimeVOList);
                svyTaskVO.setSendType(svyTask.getSendType());
                serviceTaskVO.setSendTimeslot(taskSendTimeVOList);
                serviceTaskVO.setSendType(serviceTask.getSendType());
            }
            //文本变量参数
            if (com.ruoyi.common.utils.StringUtils.isNotEmpty(svyTask.getTextParam())) {
                Map<String, Map<String, String>> textParam = objectMapper.readValue(svyTask.getTextParam(), Map.class);
                svyTaskVO.setTextParam(textParam);
            if (com.ruoyi.common.utils.StringUtils.isNotEmpty(serviceTask.getTextParam())) {
                Map<String, Map<String, String>> textParam = objectMapper.readValue(serviceTask.getTextParam(), Map.class);
                serviceTaskVO.setTextParam(textParam);
            }
        } catch (JsonProcessingException e) {
            e.printStackTrace();
        }
        for (SvyTaskSingle svyTaskSingle1 : list) {
        for (ServiceSubtask serviceSubtask1 : selectServiceSubtaskList) {
            PatTaskRelevance patTaskRelevance = new PatTaskRelevance();
            if (!svyTaskSingle1.getHospType().equals("2")) {
                log.info("随访查询不为出院,{}", svyTaskSingle1.getHospType());
            if (!serviceSubtask1.getHospType().equals("2")) {
                log.info("随访查询不为出院,{}", serviceSubtask1.getHospType());
                //获取到患者信息,并放入到集合中
                patTaskRelevance.setName(svyTaskSingle1.getSendname());
                patTaskRelevance.setAge(svyTaskSingle1.getAge());
                patTaskRelevance.setSfzh(svyTaskSingle1.getSfzh());
                patTaskRelevance.setPhone(svyTaskSingle1.getPhone());
                patTaskRelevance.setAddr(svyTaskSingle1.getAddr());
                patTaskRelevance.setDiagname(svyTaskSingle1.getDiagname());
                patTaskRelevance.setPatid(svyTaskSingle1.getPatid());
                patTaskRelevance.setSendStatus(svyTaskSingle1.getSendstate());
                patTaskRelevance.setName(serviceSubtask1.getSendname());
                patTaskRelevance.setAge(serviceSubtask1.getAge());
                patTaskRelevance.setSfzh(serviceSubtask1.getSfzh());
                patTaskRelevance.setPhone(serviceSubtask1.getPhone());
                patTaskRelevance.setAddr(serviceSubtask1.getAddr());
                patTaskRelevance.setDiagname(serviceSubtask1.getDiagname());
                patTaskRelevance.setPatid(serviceSubtask1.getPatid());
                patTaskRelevance.setSendStatus(serviceSubtask1.getSendstate());
                patTaskRelevances.add(patTaskRelevance);
            }
            if (svyTaskSingle1.getHospType().equals("2")) {
                log.info("随访查询为出院,{}", svyTaskSingle1.getHospType());
                patTaskRelevance.setName(svyTaskSingle1.getSendname());
                patTaskRelevance.setAge(svyTaskSingle1.getAge());
                patTaskRelevance.setSfzh(svyTaskSingle1.getSfzh());
                patTaskRelevance.setPhone(svyTaskSingle1.getPhone());
                patTaskRelevance.setAddr(svyTaskSingle1.getAddr());
                patTaskRelevance.setDeptName(svyTaskSingle1.getDeptname());
                patTaskRelevance.setBedNo(svyTaskSingle1.getBedno());
                patTaskRelevance.setDiagname(svyTaskSingle1.getDiagname());
                patTaskRelevance.setPatid(svyTaskSingle1.getPatid());
                patTaskRelevance.setSendStatus(svyTaskSingle1.getSendstate());
            if (serviceSubtask1.getHospType().equals("2")) {
                log.info("随访查询为出院,{}", serviceSubtask1.getHospType());
                patTaskRelevance.setName(serviceSubtask1.getSendname());
                patTaskRelevance.setAge(serviceSubtask1.getAge());
                patTaskRelevance.setSfzh(serviceSubtask1.getSfzh());
                patTaskRelevance.setPhone(serviceSubtask1.getPhone());
                patTaskRelevance.setAddr(serviceSubtask1.getAddr());
                patTaskRelevance.setDeptName(serviceSubtask1.getDeptname());
                patTaskRelevance.setBedNo(serviceSubtask1.getBedNo());
                patTaskRelevance.setDiagname(serviceSubtask1.getDiagname());
                patTaskRelevance.setPatid(serviceSubtask1.getPatid());
                patTaskRelevance.setSendStatus(serviceSubtask1.getSendstate());
                patTaskRelevances.add(patTaskRelevance);
            }
        }
        svyTaskVO.setPatTaskRelevances(patTaskRelevances);
        return svyTaskVO;
        serviceTaskVO.setPatTaskRelevances(patTaskRelevances);
        return serviceTaskVO;
    }
    private void optionHandle(SvyTaskSingle svyTaskSingle, Long taskId, Integer isoperation, Long patid) {
    private void optionHandle(ServiceSubtask serviceSubtask, Long taskId, Integer isoperation, Long patid) {
        if (isoperation == 1) {
            svyTaskSingle.setSendstate(1L);
            svyTaskSingleMapper.insertSvyTaskSingle(svyTaskSingle);
        } else if (isoperation == 2) svyTaskSingleMapper.updateSvyTaskSingle(svyTaskSingle);
        else if (isoperation == 3) svyTaskSingleMapper.deleteSvyTaskcallByCondition(taskId, patid);
            serviceSubtask.setSendstate(1L);
            serviceSubtaskMapper.insertServiceSubtask(serviceSubtask);
        } else if (isoperation == 2) serviceSubtaskMapper.updateServiceSubtask(serviceSubtask);
        else if (isoperation == 3) serviceSubtaskMapper.deleteServiceSubtaskByCondition(taskId, patid);
    }
}
smartor/src/main/resources/mapper/smartor/IvrLibaTargetoptionMapper.xml
@@ -35,6 +35,7 @@
        <result property="appendflag" column="appendflag"/>
        <result property="appenddesc" column="appenddesc"/>
        <result property="picturePath" column="picture_path"/>
        <result property="prompt" column="prompt"/>
    </resultMap>
    <sql id="selectIvrLibaTargetoptionVo">
smartor/src/main/resources/mapper/smartor/IvrLibaTemplateScriptMapper.xml
@@ -45,6 +45,7 @@
        <result property="branchFlag" column="branch_flag"/>
        <result property="branchNextscriptno" column="branch_nextscriptno"/>
        <result property="sort" column="sort"/>
        <result property="score" column="score"/>
    </resultMap>
    <sql id="selectIvrLibaTemplateScriptVo">
@@ -75,6 +76,7 @@
               script_topic,
               next_scriptno,
               otherdata,
               score,
               is_must,
               playWavOnly,
               del_flag,
@@ -111,7 +113,8 @@
            <if test="noClearlyVoice != null  and noClearlyVoice != ''">and noClearlyVoice = #{noClearlyVoice}</if>
            <if test="nextScriptno != null  and nextScriptno != ''">and next_scriptno = #{nextScriptno}</if>
            <if test="branchFlag != null  and branchFlag != ''">and branch_flag = #{branchFlag}</if>
            <if test="branchNextscriptno != null  and branchNextscriptno != ''">and branch_nextscriptno = #{branchNextscriptno}
            <if test="branchNextscriptno != null  and branchNextscriptno != ''">and branch_nextscriptno =
                #{branchNextscriptno}
            </if>
            <if test="categoryName != null  and categoryName != ''">and categoryName like concat('%', #{categoryName},
                '%')
@@ -132,6 +135,7 @@
            <if test="isMust != null  and isMust != ''">and is_must = #{isMust}</if>
            <if test="scriptType != null">and script_type = #{scriptType}</if>
            <if test="sort != null">and sort = #{sort}</if>
            <if test="score != null">and score = #{score}</if>
        </where>
    </select>
@@ -183,6 +187,7 @@
            <if test="branchFlag != null  and branchFlag != ''">branch_flag,</if>
            <if test="branchNextscriptno != null  and branchNextscriptno != ''">branch_nextscriptno,</if>
            <if test="sort != null ">sort,</if>
            <if test="score != null ">score,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="scriptno != null">#{scriptno},</if>
@@ -223,6 +228,7 @@
            <if test="branchFlag != null  and branchFlag != ''">#{branchFlag},</if>
            <if test="branchNextscriptno != null  and branchNextscriptno != ''">#{branchNextscriptno},</if>
            <if test="sort != null ">#{sort},</if>
            <if test="score != null ">#{score},</if>
        </trim>
    </insert>
@@ -265,6 +271,7 @@
            <if test="scriptType != null ">script_type = #{scriptType},</if>
            <if test="sort != null ">sort = #{sort},</if>
            <if test="branchFlag != null  and branchFlag != ''">branch_flag = #{branchFlag},</if>
            <if test="score != null ">score = #{score},</if>
            <if test="branchNextscriptno != null  and branchNextscriptno != ''">branch_nextscriptno =
                #{branchNextscriptno},
            </if>
smartor/src/main/resources/mapper/smartor/IvrLibaTemplateTargetoptionMapper.xml
@@ -36,11 +36,14 @@
        <result property="appendflag" column="appendflag"/>
        <result property="appenddesc" column="appenddesc"/>
        <result property="optionNo" column="option_no"/>
        <result property="score" column="score"/>
        <result property="prompt" column="prompt"/>
    </resultMap>
    <sql id="selectIvrLibaTemplateTargetoptionVo">
        select id,
               targetid,
               score,
               appendflag,
               appenddesc,
               scriptid,
@@ -66,6 +69,7 @@
        <where>
            del_flag=0
            <if test="targetid != null ">and targetid = #{targetid}</if>
            <if test="score != null ">and score = #{score}</if>
            <if test="targetname != null ">and targetname = #{targetname}</if>
            <if test="templateID != null ">and templateID = #{templateID}</if>
            <if test="scriptid != null ">and scriptid = #{scriptid}</if>
@@ -134,6 +138,7 @@
            <if test="appendflag != null">appendflag,</if>
            <if test="appenddesc != null">appenddesc,</if>
            <if test="optionNo != null">option_no,</if>
            <if test="score != null">score,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="targetid != null">#{targetid},</if>
@@ -166,6 +171,7 @@
            <if test="appendflag != null">#{appendflag},</if>
            <if test="appenddesc != null">#{appenddesc},</if>
            <if test="optionNo != null">#{optionNo},</if>
            <if test="score != null">#{score},</if>
        </trim>
    </insert>
@@ -202,6 +208,7 @@
            <if test="appendflag != null">appendflag = #{appendflag},</if>
            <if test="appenddesc != null">appenddesc = #{appenddesc},</if>
            <if test="optionNo != null">option_no = #{optionNo},</if>
            <if test="score != null">score = #{score},</if>
        </trim>
        where id = #{id}
    </update>
smartor/src/main/resources/mapper/smartor/IvrTaskTemplateScriptMapper.xml
@@ -44,6 +44,7 @@
        <result property="scriptType" column="script_type"/>
        <result property="scriptContent" column="script_content"/>
        <result property="sort" column="sort"/>
        <result property="score" column="score"/>
    </resultMap>
    <sql id="selectIvrTaskTemplateScriptVo">
@@ -51,6 +52,7 @@
               taskid,
               sort,
               script_type,
               score,
               branch_flag,
               branch_nextscriptno,
               next_scriptno,
@@ -75,6 +77,7 @@
        <include refid="selectIvrTaskTemplateScriptVo"/>
        <where>
            <if test="taskid != null ">and taskid = #{taskid}</if>
            <if test="score != null ">and score = #{score}</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>
@@ -161,6 +164,7 @@
            <if test="scriptContent != null  and scriptContent != ''">script_content,</if>
            <if test="sort != null ">sort,</if>
            <if test="nextScriptno != null  and nextScriptno != ''">next_scriptno,</if>
            <if test="score != null ">score,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="taskid != null">#{taskid},</if>
@@ -201,6 +205,7 @@
            <if test="scriptContent != null  and scriptContent != ''">#{scriptContent},</if>
            <if test="sort != null">#{sort},</if>
            <if test="nextScriptno != null  and nextScriptno != ''">#{nextScriptno},</if>
            <if test="score != null ">#{score},</if>
        </trim>
    </insert>
@@ -247,6 +252,7 @@
            <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>
            <if test="score != null">score = #{score},</if>
        </trim>
        where id = #{id}
    </update>
smartor/src/main/resources/mapper/smartor/IvrTaskTemplateTargetoptionMapper.xml
@@ -39,12 +39,15 @@
        <result property="appenddesc" column="appenddesc"/>
        <result property="optionCode" column="option_code"/>
        <result property="isUserOperation" column="is_user_operation"/>
        <result property="score" column="score"/>
        <result property="prompt" column="prompt"/>
    </resultMap>
    <sql id="selectIvrTaskTemplateTargetoptionVo">
        select id,
               taskid,
               templateID,
               score,
               is_user_operation,
               appenddesc,
               targetid,
@@ -95,6 +98,7 @@
            <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>
            <if test="score != null ">and score = #{score}</if>
        </where>
    </select>
@@ -141,6 +145,7 @@
            <if test="appenddesc != null">appenddesc,</if>
            <if test="optionCode != null ">option_code,</if>
            <if test="isUserOperation != null ">is_user_operation,</if>
            <if test="score != null ">score,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="taskid != null">#{taskid},</if>
@@ -176,6 +181,7 @@
            <if test="appenddesc != null">#{appenddesc},</if>
            <if test="optionCode != null ">#{optionCode},</if>
            <if test="isUserOperation != null ">#{isUserOperation},</if>
            <if test="score != null ">#{score},</if>
        </trim>
    </insert>
@@ -215,6 +221,7 @@
            <if test="appenddesc != null">appenddesc = #{appenddesc},</if>
            <if test="optionCode != null ">option_code = #{optionCode},</if>
            <if test="isUserOperation != null ">is_user_operation = #{isUserOperation},</if>
            <if test="score != null ">score = #{score},</if>
        </trim>
        where id = #{id}
smartor/src/main/resources/mapper/smartor/PatArchiveMapper.xml
@@ -6,6 +6,12 @@
    <resultMap type="com.smartor.domain.PatArchive" id="PatArchiveResult">
        <result property="id" column="id"/>
        <result property="patientno" column="patientno"/>
        <result property="sourcefrom" column="sourcefrom"/>
        <result property="patidHis" column="patid_his"/>
        <result property="sdFlag" column="sd_flag"/>
        <result property="pattype" column="pattype"/>
        <result property="viptype" column="viptype"/>
        <result property="name" column="name"/>
        <result property="sex" column="sex"/>
        <result property="nation" column="nation"/>
@@ -35,11 +41,13 @@
        <result property="pattype" column="pattype"/>
        <result property="bedNo" column="bedno"/>
        <result property="inhosptime" column="inhosptime"/>
        <result property="viptype" column="viptype"/>
    </resultMap>
    <sql id="selectPatArchiveVo">
        select id,
               patientno,
               patid_his,
               sd_flag,
               name,
               sex,
               idcardno,
@@ -82,6 +90,9 @@
            <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>
            <if test="patientno != null ">and patientno = #{patientno}</if>
            <if test="patidHis != null ">and patid_his = #{patidHis}</if>
            <if test="sdFlag != null ">and sd_flag = #{sdFlag}</if>
        </where>
    </select>
@@ -89,6 +100,9 @@
    <select id="patInfoByContion" parameterType="com.smartor.domain.PatArchiveReq" resultMap="PatArchiveResult">
        select
        a.id,
        a.patientno,
        a.patid_his,
        a.sd_flag,
        a.name,
        a.sex,
        c.tagname as tag,
@@ -120,62 +134,88 @@
        where id = #{id} and del_flag=0
    </select>
    <insert id="insertPatArchive">
        <!--        insert into pat_archive-->
        <!--        <trim prefix="(" suffix=")" suffixOverrides=",">-->
        <!--            name,-->
        <!--            sex,-->
        <!--            iccardno-->
        <!--&lt;!&ndash;            <if test="birthdate != null">birthdate,</if>&ndash;&gt;-->
        <!--&lt;!&ndash;            <if test="age != null">age,</if>&ndash;&gt;-->
        <!--&lt;!&ndash;            <if test="sourcefrom != null">sourcefrom,</if>&ndash;&gt;-->
        <!--&lt;!&ndash;            <if test="archivetime != null">archivetime,</if>&ndash;&gt;-->
        <!--&lt;!&ndash;            <if test="archiveby != null">archiveby,</if>&ndash;&gt;-->
        <!--&lt;!&ndash;            <if test="telcode != null">telcode,</if>&ndash;&gt;-->
        <!--&lt;!&ndash;            <if test="relativetelcode != null">relativetelcode,</if>&ndash;&gt;-->
        <!--&lt;!&ndash;            <if test="iccardtype != null">iccardtype,</if>&ndash;&gt;-->
        <!--&lt;!&ndash;            <if test="orgid != null">orgid,</if>&ndash;&gt;-->
        <!--&lt;!&ndash;            <if test="openid != null">openid,</if>&ndash;&gt;-->
        <!--&lt;!&ndash;            <if test="delFlag != null and delFlag != ''">del_flag,</if>&ndash;&gt;-->
        <!--&lt;!&ndash;            <if test="updateBy != null">update_by,</if>&ndash;&gt;-->
        <!--&lt;!&ndash;            <if test="updateTime != null">update_time,</if>&ndash;&gt;-->
        <!--&lt;!&ndash;            <if test="createBy != null">create_by,</if>&ndash;&gt;-->
        <!--&lt;!&ndash;            <if test="createTime != null">create_time,</if>&ndash;&gt;-->
        <!--&lt;!&ndash;            <if test="isupload != null">isupload,</if>&ndash;&gt;-->
        <!--&lt;!&ndash;            <if test="uploadTime != null">upload_time,</if>&ndash;&gt;-->
        <!--        </trim>-->
        <!--        <trim prefix="values (" suffix=")" suffixOverrides=",">-->
        <!--            <foreach item="item" index="index" collection="list" separator=",">-->
        <!--                <if test="name != null">#{item.name},</if>-->
        <!--                <if test="sex != null">#{item.sex},</if>-->
        <!--                <if test="iccardno != null">#{item.iccardno},</if>-->
        <!--&lt;!&ndash;                <if test="birthdate != null">#{birthdate},</if>&ndash;&gt;-->
        <!--&lt;!&ndash;                <if test="age != null">#{item.age},</if>&ndash;&gt;-->
        <!--&lt;!&ndash;                <if test="sourcefrom != null">#{item.sourcefrom},</if>&ndash;&gt;-->
        <!--&lt;!&ndash;                <if test="archivetime != null">#{item.archivetime},</if>&ndash;&gt;-->
        <!--&lt;!&ndash;                <if test="archiveby != null">#{item.archiveby},</if>&ndash;&gt;-->
        <!--&lt;!&ndash;                <if test="telcode != null">#{item.telcode},</if>&ndash;&gt;-->
        <!--&lt;!&ndash;                <if test="relativetelcode != null">#{item.relativetelcode},</if>&ndash;&gt;-->
        <!--&lt;!&ndash;                <if test="iccardtype != null">#{item.iccardtype},</if>&ndash;&gt;-->
        <!--&lt;!&ndash;                <if test="orgid != null">#{item.orgid},</if>&ndash;&gt;-->
        <!--&lt;!&ndash;                <if test="openid != null">#{item.openid},</if>&ndash;&gt;-->
        <!--&lt;!&ndash;                <if test="delFlag != null and delFlag != ''">#{item.delFlag},</if>&ndash;&gt;-->
        <!--&lt;!&ndash;                <if test="updateBy != null">#{item.updateBy},</if>&ndash;&gt;-->
        <!--&lt;!&ndash;                <if test="updateTime != null">#{item.updateTime},</if>&ndash;&gt;-->
        <!--&lt;!&ndash;                <if test="createBy != null">#{item.createBy},</if>&ndash;&gt;-->
        <!--&lt;!&ndash;                <if test="createTime != null">#{item.createTime},</if>&ndash;&gt;-->
        <!--&lt;!&ndash;                <if test="isupload != null">#{item.isupload},</if>&ndash;&gt;-->
        <!--&lt;!&ndash;                <if test="uploadTime != null">#{item.uploadTime},</if>&ndash;&gt;-->
        <!--            </foreach>-->
        <!--        </trim>-->
    <insert id="insertPatArchiveSingle" parameterType="com.smartor.domain.PatArchive" useGeneratedKeys="true"
            keyProperty="id">
        insert into pat_archive
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="patientno != null">patientno,</if>
            <if test="patidHis != null">patid_his,</if>
            <if test="sdFlag != null">sd_flag,</if>
            <if test="pattype != null">pattype,</if>
            <if test="viptype != null">viptype,</if>
            <if test="name != null">name,</if>
            <if test="sex != null">sex,</if>
            <if test="nation != null">nation,</if>
            <if test="nativePlace != null">native_place,</if>
            <if test="placeOfResidence != null">place_of_residence,</if>
            <if test="birthplace != null">birthplace,</if>
            <if test="idcardno != null">idcardno,</if>
            <if test="dduserid != null">dduserid,</if>
            <if test="pid != null">pid,</if>
            <if test="guid != null">guid,</if>
            <if test="birthdate != null">birthdate,</if>
            <if test="age != null">age,</if>
            <if test="sourcefrom != null">sourcefrom,</if>
            <if test="archivetime != null">archivetime,</if>
            <if test="archiveby != null">archiveby,</if>
            <if test="telcode != null">telcode,</if>
            <if test="relativetelcode != null">relativetelcode,</if>
            <if test="idcardtype != null">idcardtype,</if>
            <if test="orgid != null">orgid,</if>
            <if test="openid != null">openid,</if>
            <if test="delFlag != null and delFlag != ''">del_flag,</if>
            <if test="updateBy != null">update_by,</if>
            <if test="updateTime != null">update_time,</if>
            <if test="createBy != null">create_by,</if>
            <if test="createTime != null">create_time,</if>
            <if test="isupload != null">isupload,</if>
            <if test="uploadTime != null">upload_time,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="patientno != null">#{patientno},</if>
            <if test="patidHis != null">#{patidHis},</if>
            <if test="sdFlag != null">#{sdFlag},</if>
            <if test="pattype != null">#{pattype},</if>
            <if test="viptype != null">#{>viptype},</if>
            <if test="name != null">#{name},</if>
            <if test="sex != null">#{sex},</if>
            <if test="nation != null">#{nation},</if>
            <if test="nativePlace != null">#{nativePlace},</if>
            <if test="placeOfResidence != null">#{placeOfResidence},</if>
            <if test="birthplace != null">#{birthplace},</if>
            <if test="idcardno != null">#{idcardno},</if>
            <if test="dduserid != null">#{dduserid},</if>
            <if test="pid != null">#{pid},</if>
            <if test="guid != null">#{guid},</if>
            <if test="birthdate != null">#{birthdate},</if>
            <if test="age != null">#{age},</if>
            <if test="sourcefrom != null">#{sourcefrom},</if>
            <if test="archivetime != null">#{archivetime},</if>
            <if test="archiveby != null">#{archiveby},</if>
            <if test="telcode != null">#{telcode},</if>
            <if test="relativetelcode != null">#{relativetelcode},</if>
            <if test="idcardtype != null">#{idcardtype},</if>
            <if test="orgid != null">#{orgid},</if>
            <if test="openid != null">#{openid},</if>
            <if test="delFlag != null and delFlag != ''">#{delFlag},</if>
            <if test="updateBy != null">#{updateBy},</if>
            <if test="updateTime != null">#{updateTime},</if>
            <if test="createBy != null">#{createBy},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="isupload != null">#{isupload},</if>
            <if test="uploadTime != null">#{uploadTime},</if>
        </trim>
    </insert>
    <insert id="insertPatArchive">
        insert into
        pat_archive(name,viptype,sex,idcardno,birthdate,place_of_residence,age,sourcefrom,archivetime,archiveby,telcode,relativetelcode,idcardtype,orgid,openid,dduserid,update_by,update_time
        ,create_by,create_time,isupload,upload_time,pattype,nation,birthplace,native_place) values
        ,create_by,create_time,isupload,upload_time,pattype,nation,birthplace,native_place,patientno,patid_his,sd_flag)
        values
        <foreach item="item" index="index" collection="list" separator=",">
            (#{item.name},#{item.viptype},#{item.sex},#{item.idcardno},#{item.birthdate},#{item.placeOfResidence},#{item.age},#{item.sourcefrom},#{item.archivetime},#{item.archiveby}
            ,#{item.telcode},#{item.archiveby},#{item.idcardtype},#{item.orgid},#{item.openid},#{item.dduserid},#{item.updateBy},
            #{item.updateTime},#{item.createBy},#{item.createTime},#{item.isupload},#{item.uploadTime},#{item.pattype},#{item.nation},#{item.birthplace},#{item.nativePlace}
            #{item.updateTime},#{item.createBy},#{item.createTime},#{item.isupload},#{item.uploadTime},#{item.pattype},#{item.nation},#{item.birthplace},#{item.nativePlace},#{item.patientno},#{item.patidHis},#{item.sdFlag}
            )
        </foreach>
    </insert>
@@ -206,6 +246,9 @@
            <if test="isupload != null">isupload = #{isupload},</if>
            <if test="uploadTime != null">upload_time = #{uploadTime},</if>
            <if test="viptype != null">viptype = #{viptype},</if>
            <if test="viptype != null">patientno = #{patientno},</if>
            <if test="viptype != null">patid_his = #{patidHis},</if>
            <if test="viptype != null">sd_flag = #{sdFlag},</if>
        </trim>
        where id = #{id}
    </update>
@@ -228,6 +271,9 @@
        SELECT
        a.id,
        a.patid_his,
        a.sd_flag,
        a.patientno,
        a.NAME,
        a.sex,
        a.nation,
@@ -281,6 +327,9 @@
        select
        a.id,
        a.patid_his,
        a.sd_flag,
        a.patientno,
        a.NAME,
        d.deptname,
        a.sex,
@@ -369,6 +418,9 @@
        select
        a.id,
        a.patid_his,
        a.sd_flag,
        a.patientno,
        d.deptname,
        a.name,
        a.sex,
@@ -443,6 +495,9 @@
        select
        a.id,
        a.name,
        a.patid_his,
        a.sd_flag,
        a.patientno,
        a.sex,
        d.deptname,
        a.nation,
smartor/src/main/resources/mapper/smartor/PatMedInhospMapper.xml
@@ -1,74 +1,127 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.smartor.mapper.PatMedInhospMapper">
    <resultMap type="com.smartor.domain.PatMedInhosp" id="PatMedInhospResult">
        <result property="inhospid"    column="inhospid"    />
        <result property="inhospno"    column="inhospno"    />
        <result property="serialnum"    column="serialnum"    />
        <result property="hospitalname"    column="hospitalname"    />
        <result property="hospitalcode"    column="hospitalcode"    />
        <result property="hospitaldistrictcode"    column="hospitaldistrictcode"    />
        <result property="hospitaldistrictname"    column="hospitaldistrictname"    />
        <result property="icd10code"    column="icd10code"    />
        <result property="diagname"    column="diagname"    />
        <result property="starttime"    column="starttime"    />
        <result property="endtime"    column="endtime"    />
        <result property="deptcode"    column="deptcode"    />
        <result property="deptname"    column="deptname"    />
        <result property="roomno"    column="roomno"    />
        <result property="bedNo"    column="bed_no"    />
        <result property="orgid"    column="orgid"    />
        <result property="delFlag"    column="del_flag"    />
        <result property="updateBy"    column="update_by"    />
        <result property="updateTime"    column="update_time"    />
        <result property="createBy"    column="create_by"    />
        <result property="createTime"    column="create_time"    />
        <result property="isupload"    column="isupload"    />
        <result property="uploadTime"    column="upload_time"    />
        <result property="patid"    column="patid"    />
        <result property="leavediagname"    column="leavediagname"    />
        <result property="leaveicd10code"    column="leaveicd10code"    />
        <result property="drcode"    column="drcode"    />
        <result property="drname"    column="drname"    />
        <result property="schemestatus"    column="schemestatus"    />
        <result property="generalschemestatus"    column="generalschemestatus"    />
        <result property="leaveldeptcode"    column="leaveldeptcode"    />
        <result property="leaveldeptname"    column="leaveldeptname"    />
        <result property="hospitaldistrictid"    column="hospitaldistrictid"    />
        <result property="leavehospitaldistrictcode"    column="leavehospitaldistrictcode"    />
        <result property="leavehospitaldistrictname"    column="leavehospitaldistrictname"    />
        <result property="leavehospitaldistrictid"    column="leavehospitaldistrictid"    />
        <result property="deptid"    column="deptid"    />
        <result property="leaveldeptid"    column="leaveldeptid"    />
        <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"    />
        <result property="inhospid" column="inhospid"/>
        <result property="inhospno" column="inhospno"/>
        <result property="serialnum" column="serialnum"/>
        <result property="hospitalname" column="hospitalname"/>
        <result property="hospitalcode" column="hospitalcode"/>
        <result property="hospitaldistrictcode" column="hospitaldistrictcode"/>
        <result property="hospitaldistrictname" column="hospitaldistrictname"/>
        <result property="icd10code" column="icd10code"/>
        <result property="diagname" column="diagname"/>
        <result property="starttime" column="starttime"/>
        <result property="endtime" column="endtime"/>
        <result property="deptcode" column="deptcode"/>
        <result property="deptname" column="deptname"/>
        <result property="roomno" column="roomno"/>
        <result property="bedNo" column="bed_no"/>
        <result property="orgid" column="orgid"/>
        <result property="delFlag" column="del_flag"/>
        <result property="updateBy" column="update_by"/>
        <result property="updateTime" column="update_time"/>
        <result property="createBy" column="create_by"/>
        <result property="createTime" column="create_time"/>
        <result property="isupload" column="isupload"/>
        <result property="uploadTime" column="upload_time"/>
        <result property="patid" column="patid"/>
        <result property="leavediagname" column="leavediagname"/>
        <result property="leaveicd10code" column="leaveicd10code"/>
        <result property="drcode" column="drcode"/>
        <result property="drname" column="drname"/>
        <result property="schemestatus" column="schemestatus"/>
        <result property="generalschemestatus" column="generalschemestatus"/>
        <result property="leaveldeptcode" column="leaveldeptcode"/>
        <result property="leaveldeptname" column="leaveldeptname"/>
        <result property="hospitaldistrictid" column="hospitaldistrictid"/>
        <result property="leavehospitaldistrictcode" column="leavehospitaldistrictcode"/>
        <result property="leavehospitaldistrictname" column="leavehospitaldistrictname"/>
        <result property="leavehospitaldistrictid" column="leavehospitaldistrictid"/>
        <result property="deptid" column="deptid"/>
        <result property="leaveldeptid" column="leaveldeptid"/>
        <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,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
        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">
        <include refid="selectPatMedInhospVo"/>
        <where>
            <if test="hospitalname != null  and hospitalname != ''"> and hospitalname like concat('%', #{hospitalname}, '%')</if>
            <if test="patname != null  and patname != ''"> and patname like concat('%', #{patname}, '%')</if>
            <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>
            <if test="hospitalname != null  and hospitalname != ''">and hospitalname like concat('%', #{hospitalname},
                '%')
            </if>
            <if test="patname != null  and patname != ''">and patname like concat('%', #{patname}, '%')</if>
            <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>
@@ -78,7 +131,8 @@
        where inhospid = #{inhospid}
    </select>
    <insert id="insertPatMedInhosp" parameterType="com.smartor.domain.PatMedInhosp" useGeneratedKeys="true" keyProperty="inhospid">
    <insert id="insertPatMedInhosp" parameterType="com.smartor.domain.PatMedInhosp" useGeneratedKeys="true"
            keyProperty="inhospid">
        insert into pat_med_inhosp
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="serialnum != null">serialnum,</if>
@@ -122,7 +176,7 @@
            <if test="patno != null">patno,</if>
            <if test="inhospstate != null">inhospstate,</if>
            <if test="checkFlag != null">check_flag,</if>
         </trim>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="serialnum != null">#{serialnum},</if>
            <if test="hospitalname != null">#{hospitalname},</if>
@@ -165,7 +219,7 @@
            <if test="patno != null">#{patno},</if>
            <if test="inhospstate != null">#{inhospstate},</if>
            <if test="checkFlag != null">#{checkFlag},</if>
         </trim>
        </trim>
    </insert>
    <update id="updatePatMedInhosp" parameterType="com.smartor.domain.PatMedInhosp">
@@ -217,7 +271,9 @@
    </update>
    <delete id="deletePatMedInhospByInhospid" parameterType="Long">
        delete from pat_med_inhosp where inhospid = #{inhospid}
        delete
        from pat_med_inhosp
        where inhospid = #{inhospid}
    </delete>
    <delete id="deletePatMedInhospByInhospids" parameterType="String">
@@ -226,4 +282,100 @@
            #{inhospid}
        </foreach>
    </delete>
    <select id="getDeptRanking" parameterType="com.smartor.domain.PatMedReq" resultType="com.smartor.domain.PatMedRes">
        SELECT deptname, COUNT(1) AS rc
        FROM (
        <if test="mz != null">
            SELECT deptname
            FROM pat_med_outhosp
            <where>
                del_flag=0
                <if test="deptcodeList != null">
                    and deptcode in
                    <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")">
                        #{deptcode}
                    </foreach>
                </if>
            </where>
        </if>
        <if test="mz != null and zy != null">
            UNION ALL
        </if>
        <if test="zy != null">
            SELECT deptname
            FROM pat_med_inhosp
            <where>
                del_flag=0
                and inhospstate=0
                <if test="deptcodeList != null">
                    and deptcode in
                    <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")">
                        #{deptcode}
                    </foreach>
                </if>
            </where>
        </if>
        <if test="cy != null and zy != null">
            UNION ALL
            SELECT deptname
            FROM pat_med_inhosp
            <where>
                del_flag=0
                and inhospstate=1
                <if test="deptcodeList != null">
                    and deptcode in
                    <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")">
                        #{deptcode}
                    </foreach>
                </if>
            </where>
        </if>
        <if test="mz != null and zy != null and cy==null">
            UNION ALL
            SELECT deptname
            FROM pat_med_inhosp
            <where>
                del_flag=0
                and inhospstate=1
                <if test="deptcodeList != null">
                    and deptcode in
                    <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")">
                        #{deptcode}
                    </foreach>
                </if>
            </where>
        </if>
        ) AS combined
        GROUP BY deptname;
    </select>
    <select id="selectPatMedInhospCount" parameterType="com.smartor.domain.PatMedReq"
            resultType="com.smartor.domain.PatMedRes">
        SELECT
        COUNT(1) AS rc,
        COUNT(DISTINCT patid) AS rs
        FROM
        pat_med_inhosp
        <where>
            del_flag=0
            <if test="zy != null">
                and inhospstate=0
                and date_format(starttime,'%y%m%d') &gt;= date_format(#{startDate},'%y%m%d')
                and date_format(starttime,'%y%m%d') &lt;= date_format(#{endDate},'%y%m%d')
            </if>
            <if test="cy != null">
                and inhospstate=1
                and date_format(endtime,'%y%m%d') &gt;= date_format(#{startDate},'%y%m%d')
                and date_format(endtime,'%y%m%d') &lt;= date_format(#{endDate},'%y%m%d')
            </if>
            <if test="deptcodeList != null">
                and deptcode in
                <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")">
                    #{deptcode}
                </foreach>
            </if>
        </where>
    </select>
</mapper>
smartor/src/main/resources/mapper/smartor/PatMedOuthospMapper.xml
@@ -192,4 +192,24 @@
            #{id}
        </foreach>
    </delete>
    <select id="selectPatMedOuthospCount" parameterType="com.smartor.domain.PatMedReq"
            resultType="com.smartor.domain.PatMedRes">
        SELECT
        COUNT(id) AS rc,
        COUNT(DISTINCT patid) AS rs
        FROM
        pat_med_outhosp
        <where>
            del_flag=0
            and date_format(admitdate,'%y%m%d') &gt;= date_format(#{startDate},'%y%m%d')
            and date_format(admitdate,'%y%m%d') &lt;= date_format(#{endDate},'%y%m%d')
            <if test="deptcodeList != null">
                and deptcode in
                <foreach collection="deptcodeList" item="deptcode" open="(" separator="," close=")">
                    #{deptcode}
                </foreach>
            </if>
        </where>
    </select>
</mapper>
smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
@@ -56,6 +56,15 @@
        <result property="libtemplateid" column="libtemplateid"/>
        <result property="openid" column="openid"/>
        <result property="longSendTime" column="long_send_time"/>
        <result property="serviceType" column="service_type"/>
        <result property="score" column="score"/>
    </resultMap>
    <resultMap type="com.smartor.domain.ServiceSubtaskCount" id="ServiceSubtaskResult2">
        <result property="month" column="month"/>
        <result property="serviceType" column="service_type"/>
        <result property="subTaskId" column="subTaskId"/>
    </resultMap>
    <sql id="selectServiceSubtaskVo">
@@ -63,9 +72,11 @@
               hosp_type,
               long_send_time,
               openid,
               service_type,
               libtemplateid,
               libtemplatename,
               hospno,
               score,
               phone,
               sex,
               age,
@@ -114,7 +125,7 @@
        from service_subtask
    </sql>
    <select id="selectServiceSubtaskList" parameterType="com.smartor.domain.ServiceSubtask"
    <select id="selectServiceSubtaskList" parameterType="com.smartor.domain.ServiceSubtaskVO"
            resultMap="ServiceSubtaskResult">
        <include refid="selectServiceSubtaskVo"/>
        <where>
@@ -123,6 +134,7 @@
            <if test="phone != null  and phone != ''">and phone = #{phone}</if>
            <if test="sex != null  and sex != ''">and sex = #{sex}</if>
            <if test="age != null ">and age = #{age}</if>
            <if test="serviceType != null ">and service_type = #{serviceType}</if>
            <if test="patid != null ">and patid = #{patid}</if>
            <if test="sfzh != null  and sfzh != ''">and sfzh = #{sfzh}</if>
            <if test="addr != null  and addr != ''">and addr = #{addr}</if>
@@ -160,6 +172,9 @@
            <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>
            <if test="score != null">
                and score = #{score}
            </if>
        </where>
        order by update_time desc,id desc
    </select>
@@ -223,7 +238,8 @@
            <if test="patid != null ">patid,</if>
            <if test="openid != null ">openid,</if>
            <if test="longSendTime != null ">long_send_time,</if>
            <if test="serviceType != null ">service_type,</if>
            <if test="score != null ">score,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="sendname != null">#{sendname},</if>
@@ -276,7 +292,8 @@
            <if test="patid != null ">#{patid},</if>
            <if test="openid != null ">#{openid},</if>
            <if test="longSendTime != null ">#{longSendTime},</if>
            <if test="serviceType != null ">#{serviceType},</if>
            <if test="score != null ">#{score},</if>
        </trim>
    </insert>
@@ -334,6 +351,8 @@
            <if test="openid != null ">openid = #{openid},</if>
            <if test="longSendTime != null ">long_send_time = #{longSendTime},</if>
            <if test="sendstate != null ">sendstate = #{sendstate},</if>
            <if test="serviceType != null ">service_type = #{serviceType},</if>
            <if test="score != null ">score = #{score},</if>
        </trim>
        where id = #{id}
    </update>
@@ -391,6 +410,9 @@
            <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="serviceType != null ">service_type = #{serviceType},</if>
            <if test="score != null ">score = #{score},</if>
        </trim>
        where patid = #{patid} and taskid = #{taskid}
    </update>
@@ -460,7 +482,9 @@
               roomno,
               admindate,
               patid,
               service_type,
               deptname,
               score,
               diagname
        FROM service_subtask,
             JSON_TABLE(send_time_slot, '$[*]' COLUMNS (
@@ -472,5 +496,29 @@
          AND del_flag = 0
    </select>
    <!--    èŽ·å–éšè®¿é—¨è¯Šæ¯æœˆçš„æ•°é‡-->
    <select id="getSfFzInfoEveryMonth" parameterType="com.smartor.domain.ServiceSubtaskCountReq"
            resultMap="ServiceSubtaskResult2">
        SELECT DATE_FORMAT(st.finishtime, '%Y-%m') AS month,
              st.service_type as service_type,
              st.id as subTaskId,
    COUNT(*) AS count
        FROM
            service_subtask st
            JOIN
            sys_user_dept dd
        ON dep.dept_id = dd.dept_id
        WHERE
            dd.user_id =#{userId}
          AND st.finishtime IS NOT NULL
          and DATE_FORMAT(st.finishtime
            , '%Y-%m') &gt;= #{startTime}
          and DATE_FORMAT(st.finishtime
            , '%Y-%m') &lt;= #{endTime}
        GROUP BY
            month, st.service_type, st.id
        ORDER BY
            month, st.service_type, st.id;
    </select>
</mapper>
smartor/src/main/resources/mapper/smartor/ServiceTaskMapper.xml
@@ -96,6 +96,7 @@
    <select id="selectServiceTaskList" parameterType="com.smartor.domain.ServiceTask" resultMap="ServiceTaskResult">
        <include refid="selectServiceTaskVo"/>
        <where>
            del_flag=0
            <if test="taskName != null  and taskName != ''">and task_name like concat('%', #{taskName}, '%')</if>
            <if test="sendTimeSlot != null  and sendTimeSlot != ''">and send_time_slot like concat('%', #{sendTimeSlot},
                '%')
smartor/src/main/resources/mapper/smartor/SvyLibScriptMapper.xml
@@ -135,7 +135,7 @@
            <if test="valueType != null and valueType!=''">value_type,</if>
            <if test="reply != null and reply!=''">otherdata,</if>
            <if test="scoretype != null and scoretype!=''">scoretype,</if>
            <if test="score != null and score!=''">score,</if>
            <if test="score != null ">score,</if>
            <if test="icd10Name != null and icd10Name!=''">icd10_name,</if>
            <if test="picturePath != null  and picturePath != ''">picture_path,</if>
            <if test="scriptTopic != null  and scriptTopic != ''">script_topic,</if>
@@ -168,7 +168,7 @@
            <if test="valueType != null and valueType!=''">#{valueType},</if>
            <if test="reply != null and reply!=''">#{therdata},</if>
            <if test="scoretype != null and scoretype!=''">#{scoretype},</if>
            <if test="score != null and score!=''">#{score},</if>
            <if test="score != null ">#{score},</if>
            <if test="icd10Name != null and icd10Name!=''">#{icd10Name},</if>
            <if test="picturePath != null  and picturePath != ''">#{picturePath},</if>
            <if test="scriptTopic != null  and scriptTopic != ''">#{scriptTopic},</if>
@@ -205,7 +205,7 @@
            <if test="valueType != null and valueType!=''">value_type = #{valueType},</if>
            <if test="reply != null and reply!=''">therdata =#{therdata},</if>
            <if test="scoretype != null and scoretype!=''">scoretype = #{scoretype},</if>
            <if test="score != null and score!=''">score = #{score},</if>
            <if test="score != null">score = #{score},</if>
            <if test="icd10Name != null and icd10Name!=''">icd10_name = #{icd10Name},</if>
            <if test="picturePath != null  and picturePath != ''">picture_path = #{picturePath},</if>
            <if test="scriptTopic != null  and scriptTopic != ''">script_topic = #{scriptTopic},</if>
smartor/src/main/resources/mapper/smartor/SvyLibTemplateMapper.xml
@@ -34,11 +34,17 @@
        <result property="reply" column="reply"/>
        <result property="scriptScore" column="script_score"/>
        <result property="scoreType" column="score_type"/>
        <result property="prologue" column="prologue"/>
        <result property="instruction" column="instruction"/>
        <result property="conclusion" column="conclusion"/>
    </resultMap>
    <sql id="selectSvyLibTemplateVo">
        select svyid,
               categoryid,
               instruction,
               prologue,
               conclusion,
               value_type,
               reply,
               score_type,
@@ -73,6 +79,9 @@
            resultMap="SvyLibTemplateResult">
        SELECT
        a.svyid,
        a.conclusion,
        a.instruction,
        a.prologue,
        a.categoryid,
        a.svycode,
        a.svyname,
@@ -113,7 +122,7 @@
            <if test="categoryid != null ">and a.categoryid = #{categoryid}</if>
            <if test="svyid != null ">and a.svyid = #{svyid}</if>
            <if test="svyname != null  and svyname != ''">and a.svyname like concat('%', #{svyname}, '%')</if>
            <if test="description != null  and description != ''">and  b.icd10name like concat('%', #{description}, '%')
            <if test="description != null  and description != ''">and b.icd10name like concat('%', #{description}, '%')
            </if>
        </where>
        order by a.create_time desc
@@ -156,6 +165,9 @@
            <if test="reply != null">reply,</if>
            <if test="scriptScore != null">script_score,</if>
            <if test="scoreType != null">score_type,</if>
            <if test="conclusion != null">conclusion,</if>
            <if test="instruction != null">instruction,</if>
            <if test="prologue != null">prologue,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="categoryid != null">#{categoryid},</if>
@@ -186,6 +198,9 @@
            <if test="reply != null">#{reply},</if>
            <if test="scriptScore != null">#{scriptScore},</if>
            <if test="scoreType != null">#{scoreType},</if>
            <if test="conclusion != null">#{conclusion},</if>
            <if test="instruction != null">#{instruction},</if>
            <if test="prologue != null">#{prologue},</if>
        </trim>
    </insert>
@@ -220,6 +235,9 @@
            <if test="reply != null">reply = #{reply},</if>
            <if test="scriptScore != null">script_score = #{scriptScore},</if>
            <if test="scoreType != null">score_type = #{scoreType},</if>
            <if test="conclusion != null">conclusion=#{conclusion},</if>
            <if test="instruction != null">instruction=#{instruction},</if>
            <if test="prologue != null">prologue=#{prologue},</if>
        </trim>
        where svyid = #{svyid}
    </update>
smartor/src/main/resources/mapper/smartor/SvyLibTemplateScriptMapper.xml
@@ -44,6 +44,7 @@
        <result property="targetname" column="targetname"/>
        <result property="targettype" column="targettype"/>
        <result property="targetoptions" column="targetoptions"/>
        <result property="prompt" column="prompt"/>
    </resultMap>
    <sql id="selectSvyLibTemplateScriptVo">
@@ -51,6 +52,8 @@
               script_type,
               targetid,
               targetname,
               score,
               prompt,
               targettype,
               targetoptions,
               scriptid,
@@ -80,7 +83,7 @@
               suitway,
               script_picture,
               script_topic,
               isavailable, language, otherdata, value_type, reply, scoretype, score
               isavailable, language, otherdata, value_type, reply, scoretype
        from svy_lib_template_script
    </sql>
@@ -103,6 +106,7 @@
            <if test="uploadTime != null ">and upload_time = #{uploadTime}</if>
            <if test="pid != null ">and pid = #{pid}</if>
            <if test="guid != null  and guid != ''">and guid = #{guid}</if>
            <if test="prompt != null  and prompt != ''">and prompt = #{prompt}</if>
            <if test="categoryid != null ">and categoryid = #{categoryid}</if>
            <if test="scriptContent != null  and scriptContent != ''">and script_content = #{scriptContent}</if>
            <if test="suitway != null  and suitway != ''">and suitway = #{suitway}</if>
@@ -112,7 +116,6 @@
            <if test="valueType != null  and valueType != ''">and value_type = #{valueType}</if>
            <if test="reply != null  and reply != ''">and reply = #{reply}</if>
            <if test="scoretype != null  and scoretype != ''">and scoretype = #{scoretype}</if>
            <if test="score != null  and score != ''">and score = #{score}</if>
            <if test="scriptTopic != null  and scriptTopic != ''">and script_topic = #{scriptTopic}</if>
            <if test="svyid != null  ">and svyid = #{svyid}</if>
            <if test="branchFlag != null  and branchFlag != ''">and branch_flag = #{branchFlag}</if>
@@ -123,6 +126,7 @@
            <if test="targetname != null  and targetname != ''">and targetname = #{targetname}</if>
            <if test="targettype != null  and targettype != ''">and targettype = #{targettype}</if>
            <if test="targetoptions != null  and targetoptions != ''">and targetoptions = #{targetoptions}</if>
            <if test="score != null">and score = #{score}</if>
        </where>
    </select>
@@ -173,6 +177,7 @@
            <if test="targetname != null  and targetname != ''">targetname,</if>
            <if test="targettype != null  and targettype != ''">targettype,</if>
            <if test="targetoptions != null  and targetoptions != ''">targetoptions,</if>
            <if test="prompt != null  and prompt != ''">prompt,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="nextScriptno != null">#{nextScriptno},</if>
@@ -213,6 +218,7 @@
            <if test="targetname != null  and targetname != ''">#{targetname},</if>
            <if test="targettype != null  and targettype != ''">#{targettype},</if>
            <if test="targetoptions != null  and targetoptions != ''">#{targetoptions},</if>
            <if test="prompt != null  and prompt != ''">#{prompt},</if>
        </trim>
    </insert>
@@ -259,6 +265,7 @@
            <if test="targetname != null  and targetname != ''">targetname = #{targetname},</if>
            <if test="targettype != null  and targettype != ''">targettype = #{targettype},</if>
            <if test="targetoptions != null  and targetoptions != ''">targetoptions = #{targetoptions},</if>
            <if test="prompt != null  and prompt != ''">prompt = #{prompt},</if>
        </trim>
        where id = #{id}
    </update>
smartor/src/main/resources/mapper/smartor/SvyLibTemplateTargetoptionMapper.xml
@@ -40,12 +40,14 @@
        <result property="appendflag" column="appendflag"/>
        <result property="appenddesc" column="appenddesc"/>
        <result property="optionNo" column="option_no"/>
        <result property="prompt" column="prompt"/>
    </resultMap>
    <sql id="selectSvyLibTemplateTargetoptionVo">
        select id,
               groupid,
               score,
               prompt,
               option_no,
               appendflag,
               appenddesc,
@@ -78,6 +80,7 @@
                '%')
            </if>
            <if test="scriptid != null ">and scriptid = #{scriptid}</if>
            <if test="prompt != null ">and prompt = #{prompt}</if>
            <if test="templateID != null ">and templateID = #{templateID}</if>
            <if test="targettype != null  and targettype != ''">and targettype = #{targettype}</if>
            <if test="targetid != null ">and targetid = #{targetid}</if>
@@ -101,7 +104,7 @@
            <if test="orgid != null  and orgid != ''">and orgid = #{orgid}</if>
            <if test="pid != null ">and pid = #{pid}</if>
            <if test="guid != null  and guid != ''">and guid = #{guid}</if>
            <if test="score != null  and score != ''">and score = #{score}</if>
            <if test="score != null">and score = #{score}</if>
            <if test="picturePath != null  and picturePath != ''">and picture_path = #{picturePath}</if>
            <if test="appendflag != null">and appendflag = #{appendflag}</if>
            <if test="appenddesc != null">and appenddesc = #{appenddesc}</if>
@@ -152,6 +155,7 @@
            <if test="appendflag != null">appendflag,</if>
            <if test="appenddesc != null">appenddesc,</if>
            <if test="optionNo != null">option_no,</if>
            <if test="prompt != null">prompt,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="groupid != null">#{groupid},</if>
@@ -188,6 +192,7 @@
            <if test="appendflag != null">#{appendflag},</if>
            <if test="appenddesc != null">#{appenddesc},</if>
            <if test="optionNo != null">#{optionNo},</if>
            <if test="prompt != null">#{prompt},</if>
        </trim>
    </insert>
@@ -228,6 +233,7 @@
            <if test="appendflag != null">appendflag = #{appendflag},</if>
            <if test="appenddesc != null">appenddesc = #{appenddesc},</if>
            <if test="optionNo != null">option_no = #{optionNo},</if>
            <if test="prompt != null">prompt = #{prompt},</if>
        </trim>
        where id = #{id}
    </update>
smartor/src/main/resources/mapper/smartor/SvyLibTopicCategoryMapper.xml
@@ -113,7 +113,7 @@
    <update id="deleteSvyLibScriptCategoryById" parameterType="Long">
        update svy_lib_script_category
        <trim prefix="SET" suffixOverrides=",">
            <if test="delFlag != null">del_flag = ,</if>
            <if test="delFlag != null">del_flag = 1,</if>
        </trim>
        where id = #{id}
    </update>
smartor/src/main/resources/mapper/smartor/SvyTaskTemplateScriptMapper.xml
@@ -40,14 +40,18 @@
        <result property="branchNextscriptno" column="branch_nextscriptno"/>
        <result property="targettype" column="targettype"/>
        <result property="targetname" column="targetname"/>
        <result property="score" column="score"/>
        <result property="prompt" column="prompt"/>
    </resultMap>
    <sql id="selectSvyTaskTemplateScriptVo">
        select id,
               sort,
               prompt,
               branch_flag,
               branch_nextscriptno,
               score,
               script_desc,
               targetname,
               targettype,
@@ -90,8 +94,10 @@
            <if test="picturePath != null  and picturePath != ''">and picture_path = #{picturePath}</if>
            <if test="scriptTopic != null  and scriptTopic != ''">and script_topic = #{scriptTopic}</if>
            <if test="branchFlag != null  and branchFlag != ''">and branch_flag = #{branchFlag}</if>
            <if test="targetname != null  and targetname != ''">and targetname = #{branchFtargetnamelag}</if>
            <if test="targetname != null  and targetname != ''">and targetname = #{targetname}</if>
            <if test="targettype != null  and targettype != ''">and targettype = #{targettype}</if>
            <if test="score != null ">and score = #{score}</if>
            <if test="prompt != null ">and prompt = #{prompt}</if>
            <if test="branchNextscriptno != null  and branchNextscriptno != ''">and branch_nextscriptno =
                #{branchNextscriptno}
            </if>
@@ -104,7 +110,7 @@
    </select>
    <insert id="insertSvyTaskTemplateScript" parameterType="com.smartor.domain.SvyTaskTemplateScript"
            useGeneratedKeys="true" keyProperty="ID">
            useGeneratedKeys="true" keyProperty="id">
        insert into svy_task_template_script
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="taskid != null">taskid,</if>
@@ -141,6 +147,8 @@
            <if test="branchNextscriptno != null  and branchNextscriptno != ''">branch_nextscriptno,</if>
            <if test="targetname != null  and targetname != ''">targetname,</if>
            <if test="targettype != null  and targettype != ''">targettype,</if>
            <if test="score != null ">score,</if>
            <if test="prompt != null ">prompt,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="taskid != null">#{taskid},</if>
@@ -175,8 +183,10 @@
            <if test="scriptTopic != null">#{scriptTopic},</if>
            <if test="branchFlag != null  and branchFlag != ''">#{branchFlag},</if>
            <if test="branchNextscriptno != null  and branchNextscriptno != ''">#{branchNextscriptno},</if>
            <if test="targetname != null  and targetname != ''">#{branchFtargetnamelag},</if>
            <if test="targetname != null  and targetname != ''">#{targetname},</if>
            <if test="targettype != null  and targettype != ''">#{targettype},</if>
            <if test="score != null ">#{score},</if>
            <if test="prompt != null ">#{prompt},</if>
        </trim>
    </insert>
@@ -217,8 +227,10 @@
            <if test="branchNextscriptno != null  and branchNextscriptno != ''">branch_nextscriptno =
                #{branchNextscriptno},
            </if>
            <if test="targetname != null  and targetname != ''">targetname = #{branchFtargetnamelag},</if>
            <if test="targetname != null  and targetname != ''">targetname = #{targetname},</if>
            <if test="targettype != null  and targettype != ''">targettype = #{targettype},</if>
            <if test="score != null">score = #{score},</if>
            <if test="prompt != null">prompt = #{prompt},</if>
        </trim>
        where id = #{d}
    </update>
smartor/src/main/resources/mapper/smartor/SvyTaskTemplateTargetoptionMapper.xml
@@ -40,11 +40,16 @@
        <result property="optionCode" column="option_code"/>
        <result property="appendflag" column="appendflag"/>
        <result property="appenddesc" column="appenddesc"/>
        <result property="score" column="score"/>
        <result property="score" column="score"/>
        <result property="prompt" column="prompt"/>
    </resultMap>
    <sql id="selectSvyTaskTemplateTargetoptionVo">
        select id,
               option_code,
               score,
               prompt,
               appendflag,
               appenddesc,
               taskid,
@@ -65,6 +70,8 @@
        <include refid="selectSvyTaskTemplateTargetoptionVo"/>
        <where>
            <if test="taskid != null ">and taskid = #{taskid}</if>
            <if test="score != null ">and score = #{score}</if>
            <if test="prompt != null ">and prompt = #{prompt}</if>
            <if test="templateID != null ">and templateID = #{templateID}</if>
            <if test="targetid != null ">and targetid = #{targetid}</if>
            <if test="targetname != null  and targetname != ''">and targetname like concat('%', #{targetname}, '%')</if>
@@ -142,6 +149,8 @@
            <if test="optionCode != null">option_code,</if>
            <if test="appendflag != null">appendflag,</if>
            <if test="appenddesc != null">appenddesc,</if>
            <if test="score != null">score,</if>
            <if test="prompt != null">prompt,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
@@ -176,9 +185,11 @@
            <if test="dynamiccruxs != null">#{dynamiccruxsJson},</if>
            <if test="nextQuestion != null">#{nextQuestion},</if>
            <if test="picturePath != null">#{picturePath},</if>
            <if test="optionCode != null">#{optionCode}</if>
            <if test="appendflag != null">#{appendflag}</if>
            <if test="appenddesc != null">#{appenddesc}</if>
            <if test="optionCode != null">#{optionCode},</if>
            <if test="appendflag != null">#{appendflag},</if>
            <if test="appenddesc != null">#{appenddesc},</if>
            <if test="score != null">#{score},</if>
            <if test="prompt != null">#{prompt},</if>
        </trim>
    </insert>
@@ -220,6 +231,8 @@
            <if test="optionCode != null">option_code = #{optionCode},</if>
            <if test="appendflag != null">appendflag = #{appendflag},</if>
            <if test="appenddesc != null">appenddesc = #{appenddesc},</if>
            <if test="score != null">score = #{score},</if>
            <if test="prompt != null">score = #{prompt},</if>
        </trim>
        where id = #{id}
    </update>
smartor/src/main/resources/mapper/smartor/SysUserDeptMapper.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,145 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.smartor.mapper.SysUserDeptMapper">
    <resultMap type="com.ruoyi.common.core.domain.entity.SysUserDept" id="SysUserDeptResult">
        <result property="id" column="id"/>
        <result property="userId" column="user_id"/>
        <result property="deptId" column="dept_id"/>
        <result property="delFlag" column="del_flag"/>
        <result property="createTime" column="create_time"/>
        <result property="updateTime" column="update_time"/>
    </resultMap>
    <resultMap id="deptResult" type="com.ruoyi.common.core.domain.entity.SysDept">
        <id property="deptId" column="dept_id"/>
        <result property="parentId" column="parent_id"/>
        <result property="deptName" column="dept_name"/>
        <result property="ancestors" column="ancestors"/>
        <result property="orderNum" column="order_num"/>
        <result property="leader" column="leader"/>
        <result property="status" column="dept_status"/>
    </resultMap>
    <sql id="selectSysUserDeptVo">
        select id, user_id, dept_id, del_flag, create_time, update_time
        from sys_user_dept
    </sql>
    <select id="selectSysUserDeptList" parameterType="com.ruoyi.common.core.domain.entity.SysUserDept"
            resultMap="SysUserDeptResult">
        <include refid="selectSysUserDeptVo"/>
        <where>
            <if test="userId != null ">
                and user_id = #{userId}
            </if>
            <if test="deptId != null ">
                and dept_id = #{deptId}
            </if>
            <if test="delFlag != null ">
                and del_flag = #{delFlag}
            </if>
            <if test="createTime != null ">
                and create_time = #{createTime}
            </if>
            <if test="updateTime != null ">
                and update_time = #{updateTime}
            </if>
        </where>
    </select>
    <select id="selectSysUserDeptById" parameterType="Long"
            resultMap="SysUserDeptResult">
        <include refid="selectSysUserDeptVo"/>
        where id = #{id}
    </select>
    <insert id="insertSysUserDept" parameterType="com.ruoyi.common.core.domain.entity.SysUserDept"
            useGeneratedKeys="true" keyProperty="id">
        insert into sys_user_dept
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="userId != null">user_id,
            </if>
            <if test="deptId != null">dept_id,
            </if>
            <if test="delFlag != null ">
                del_flag,
            </if>
            <if test="createTime != null ">
                create_time,
            </if>
            <if test="updateTime != null ">
                update_time,
            </if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="userId != null">#{userId},
            </if>
            <if test="deptId != null">#{deptId},
            </if>
            <if test="delFlag != null ">
                #{delFlag},
            </if>
            <if test="createTime != null ">
                #{createTime},
            </if>
            <if test="updateTime != null ">
                #{updateTime},
            </if>
        </trim>
    </insert>
    <update id="updateSysUserDept" parameterType="com.ruoyi.common.core.domain.entity.SysUserDept">
        update sys_user_dept
        <trim prefix="SET" suffixOverrides=",">
            <if test="userId != null">user_id =
                #{userId},
            </if>
            <if test="deptId != null">dept_id =
                #{deptId},
            </if>
            <if test="delFlag != null ">
                del_flag = #{delFlag},
            </if>
            <if test="createTime != null ">
                create_time = #{createTime},
            </if>
            <if test="updateTime != null ">
                update_time = #{updateTime},
            </if>
        </trim>
        where id = #{id}
    </update>
    <update id="deleteSysUserDeptById" parameterType="Long">
        update sys_user_dept
        <trim prefix="SET" suffixOverrides=",">
            del_flag =1
        </trim>
        where id = #{id}
    </update>
    <select id="selectDeptListByUserId" resultMap="deptResult">
        select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status
        from sys_dept d
                 left join sys_user_dept ud on d.dept_id = ud.dept_id
        where ud.user_id = #{userId}
          and ud.del_flag = 0
          and d.del_flag = 0
    </select>
    <update id="deleteSysUserDeptByIds" parameterType="String">
        update sys_user_dept
        <trim prefix="SET" suffixOverrides=",">
            del_flag =1,
            update_time = sysdate()
        </trim>
        where user_id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </update>
</mapper>