liusheng
2 天以前 6393d6ba70099f1b47f4124e06426f016fb28052
代码提交
已添加6个文件
已修改30个文件
1693 ■■■■ 文件已修改
ruoyi-admin/src/main/java/com/ruoyi/web/component/RedisMqReceiver.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/hanler/ChatWebSocketHandler.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/AIRobot/AIRobotPhoneCallBackController.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatMedOuthospController.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatSatisfactionController.java 137 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceExternalController.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskAnswerController.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskController.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceTaskController.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/TemplateDeptController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-common/src/main/java/com/ruoyi/common/utils/RSAPublicKeyExample.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-common/src/main/java/com/ruoyi/common/utils/http/HttpUtils.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java 281 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java 305 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/common/FtpService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/PatArchive.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/PatArchiveOthreInfo.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/PatArchiveReq.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/PatArchiveVO.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/PatSatisfaction.java 142 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/mapper/PatSatisfactionMapper.java 64 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/IPatSatisfactionService.java 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/PatArchiveServiceImpl.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/PatMedInhospServiceImpl.java 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/PatMedOuthospServiceImpl.java 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/PatSatisfactionServiceImpl.java 102 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/ServiceExternalServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/SvyTaskSingleServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/PatArchiveMapper.xml 59 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/PatSatisfactionMapper.xml 306 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/component/RedisMqReceiver.java
@@ -104,7 +104,7 @@
    public void onMessage(Message message, byte[] pattern) {
        log.info("监听Redis key过期,key:{},channel:{}", message.toString(), new String(pattern));
        String ip = localIP;
        log.error("本机的网络IP为:{}", ip);
        log.info("本机的网络IP为:{}", ip);
        String content = message.toString();
        //判断是不是任务信息,如果不是,直接返回,不需要执行
        if (!content.contains("taskid") || !port.equals("8095")) {
@@ -154,7 +154,7 @@
     * @param commonTaskcallMQ
     */
    public void tsakHandle(CommonTaskcallMQ commonTaskcallMQ, String ip, Integer type) {
        log.error("进任务了吗?{}", commonTaskcallMQ);
        log.info("进任务了吗?{}", commonTaskcallMQ);
        //判断一下commonTaskcallMQ中的stopstate是否与ivr_task中的一致,不一致,则说明是暂停了
        ServiceTask ivrTask1 = ivrTaskMapper.selectServiceTaskByTaskid(commonTaskcallMQ.getTaskid());
@@ -166,7 +166,7 @@
        if (StringUtils.isNotEmpty(commonTaskcallMQ.getPreachform())) {
            //如何任务发送方式不为空
            String[] split = commonTaskcallMQ.getPreachform().split(",");
            log.error("split的值为:{}", split);
            log.info("split的值为:{}", split);
            //定义一个集合,用与存没有执行的子任务ID
            List<Long> subIds = new ArrayList<>();
@@ -211,13 +211,13 @@
                                //说明是立即发送
                                ServiceSubtaskVO serviceSubtask1 = new ServiceSubtaskVO();
                                serviceSubtask1.setTaskid(commonTaskcallMQ.getTaskid());
                                log.error("缓存中serviceSubtask1的值为:{}", serviceSubtask1);
                                log.info("缓存中serviceSubtask1的值为:{}", serviceSubtask1);
                                List<String> list = new ArrayList<>();
                                List<ServiceSubtask> selectServiceSubtaskList1 = ivrTaskcallMapper.selectServiceSubtaskList(serviceSubtask1);
                                for (ServiceSubtask serviceSubtask2 : selectServiceSubtaskList1) {
                                    list.add(serviceSubtask2.getId().toString());
                                }
                                log.error("缓存中cache-0的值为:{}", list);
                                log.info("缓存中cache-0的值为:{}", list);
//                                redisCache.setCacheListLeft("cache-0", list);
                                redisCache.setCacheListLeftAndDistinct("cache-0", list);
                            } else {
@@ -384,7 +384,7 @@
                                //丽水的短信发送方式
                                Map<String, String> map = MsgLSEnum.getAddressByCode(serviceSubtask.getOrgid());
                                String token = LSHospTokenUtil.getToken(serviceSubtask.getOrgid());
                                log.error("-----------token的值为:{}", token);
                                log.info("-----------token的值为:{}", token);
                                if (ObjectUtils.isNotEmpty(map) && StringUtils.isEmpty(map.get("address"))) {
                                    ServiceSubtask ss = new ServiceSubtask();
                                    ss.setResult("error");
ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java
@@ -247,7 +247,7 @@
    @ApiOperation("富文本转html")
    @PostMapping("/htmlContent")
    public AjaxResult htmlContent(@RequestBody HtmlContentVO htmlContentVO) {
        log.error("htmlContentVO入参为:{}", htmlContentVO);
        log.info("htmlContentVO入参为:{}", htmlContentVO);
        // èŽ·å–æ–‡ä»¶çš„åŽŸå§‹åç§°
        String fileName = htmlContentVO.getFileName();
        if (!fileName.endsWith(".html")) {
ruoyi-admin/src/main/java/com/ruoyi/web/controller/hanler/ChatWebSocketHandler.java
@@ -327,7 +327,7 @@
                                    StringUtils.isEmpty(ivrLibaTemplateScriptVO.getIvrLibaScriptTargetoptionList().get(j).getTargetregex2()) &&
                                            StringUtils.isNotEmpty(ivrLibaTemplateScriptVO.getIvrLibaScriptTargetoptionList().get(j).getTargetregex()) &&
                                            matcher.matches()) {
                                log.error("匹配正确了");
                                log.info("匹配正确了");
                                //说明匹配正确了
                                ivrLibaTemplateScriptVO.getIvrLibaScriptTargetoptionList().get(j).setIsUserOperation(1);
                                List<IvrLibaTemplateScriptVO> backQuset = redisCache.getCacheObject(userId + "backQuset");
@@ -369,7 +369,7 @@
                                    break;
                                }
                            } else {
                                log.error("无匹配");
                                log.info("无匹配");
                                //没有匹配到
                                Integer mateNum = redisCache.getCacheObject(userId + "mateNum");
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/AIRobot/AIRobotPhoneCallBackController.java
@@ -35,7 +35,7 @@
    @ApiOperation("AIRobot呼叫到达线路后的状态返回接口")
    @PostMapping("/callstatus")
    public AjaxResult callstatus(@RequestBody RobotCallBack robotCallBack) {
        log.error("AIRobot呼叫到达线路后的状态返回接口---------{}", robotCallBack);
        log.info("AIRobot呼叫到达线路后的状态返回接口---------{}", robotCallBack);
        aiRobotPhoneCallBackService.callstatus(robotCallBack);
        return success();
    }
@@ -46,7 +46,7 @@
    @ApiOperation("AIRobot用户 AI äº¤äº’数据返回接口(包括 n ç§èŠ‚ç‚¹çš„è¿”å›žæ•°æ®åŒ…)")
    @PostMapping("/aidialog")
    public AjaxResult aidialog(@RequestBody RobotAIDialogBack robotAIDialogBack) {
        log.error("用户 AI äº¤äº’数据返回接口(包括 n ç§èŠ‚ç‚¹çš„è¿”å›žæ•°æ®åŒ…)-----------{}", robotAIDialogBack);
        log.info("用户 AI äº¤äº’数据返回接口(包括 n ç§èŠ‚ç‚¹çš„è¿”å›žæ•°æ®åŒ…)-----------{}", robotAIDialogBack);
        aiRobotPhoneCallBackService.aidialog(robotAIDialogBack);
        return success();
    }
@@ -57,7 +57,7 @@
    @ApiOperation("挂机计费信息返回数据接口")
    @PostMapping("/cdrinfo")
    public AjaxResult cdrinfo(@RequestBody RobotcdrInfoBack robotAIDialogBack) {
        log.error("挂机计费信息返回数据接口-----------{}", robotAIDialogBack);
        log.info("挂机计费信息返回数据接口-----------{}", robotAIDialogBack);
        aiRobotPhoneCallBackService.cdrinfo(robotAIDialogBack);
        return success();
    }
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatMedOuthospController.java
@@ -1,16 +1,21 @@
package com.ruoyi.web.controller.smartor;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.utils.PageUtils;
import com.smartor.domain.PatMedReq;
import com.smartor.domain.PatMedRes;
import io.netty.util.internal.ObjectUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
@@ -63,6 +68,12 @@
    @PostMapping("/selectPatMedOuthospCount")
    @ApiOperation("查询门诊看病人次和人数")
    public AjaxResult selectPatMedOuthospCount(@RequestBody PatMedReq patMedReq) {
        SysUser user = getLoginUser().getUser();
        List<String> deptCode = new ArrayList<>();
        for (Map<String, Object> map : user.getBelongDepts()) {
            if (ObjectUtils.isNotEmpty(map.get("deptCode"))) deptCode.add(map.get("deptCode").toString());
        }
        patMedReq.setDeptcodeList(deptCode);
        PatMedRes patMedRes = patMedOuthospService.selectPatMedOuthospCount(patMedReq);
        return success(patMedRes);
    }
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatSatisfactionController.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,137 @@
package com.ruoyi.web.controller.smartor;
import java.util.List;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.LoginUser;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.smartor.domain.PatSatisfaction;
import com.smartor.service.IPatSatisfactionService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
 * æ‚£è€…满意度Controller
 *
 * @author lihu
 * @date 2025-06-30
 */
@Api(description = "患者满意度")
@RestController
@RequestMapping("/smartor/satisfaction")
public class PatSatisfactionController extends BaseController {
    @Autowired
    private IPatSatisfactionService patSatisfactionService;
    /**
     * æŸ¥è¯¢æ‚£è€…满意度列表
     */
    @ApiOperation("查询患者满意度列表")
    //@PreAuthorize("@ss.hasPermi('smartor:satisfaction:list')")
    @PostMapping("/list")
    public TableDataInfo list(@RequestBody PatSatisfaction patSatisfaction) {
        startPage();
        List<PatSatisfaction> list = patSatisfactionService.selectPatSatisfactionList(patSatisfaction);
        return getDataTable(list);
    }
    /**
     * å¯¼å‡ºæ‚£è€…满意度列表
     */
    @ApiOperation("导出患者满意度列表")
    //@PreAuthorize("@ss.hasPermi('smartor:satisfaction:export')")
    @Log(title = "患者满意度", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, PatSatisfaction patSatisfaction) {
        List<PatSatisfaction> list = patSatisfactionService.selectPatSatisfactionList(patSatisfaction);
        ExcelUtil<PatSatisfaction> util = new ExcelUtil<PatSatisfaction>(PatSatisfaction.class);
        util.exportExcel(response, list, "患者满意度数据");
    }
    /**
     * èŽ·å–æ‚£è€…æ»¡æ„åº¦è¯¦ç»†ä¿¡æ¯
     */
    @ApiOperation("获取患者满意度详细信息")
    //@PreAuthorize("@ss.hasPermi('smartor:satisfaction:query')")
    @GetMapping(value = "/getInfo/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id) {
        return success(patSatisfactionService.selectPatSatisfactionById(id));
    }
    /**
     * æ–°å¢žæ‚£è€…满意度
     */
    @ApiOperation("新增患者满意度")
    //@PreAuthorize("@ss.hasPermi('smartor:satisfaction:add')")
    @Log(title = "患者满意度", businessType = BusinessType.INSERT)
    @PostMapping("/add")
    public AjaxResult add(@RequestBody PatSatisfaction patSatisfaction) {
        LoginUser loginUser = getLoginUser();
        SysUser user = loginUser.getUser();
        patSatisfaction.setCreateBy(user.getNickName());
        patSatisfaction.setOrgid(user.getOrgid());
        return toAjax(patSatisfactionService.insertPatSatisfaction(patSatisfaction));
    }
    /**
     * æ–°å¢žæ‚£è€…满意度
     */
    @ApiOperation("批量新增患者满意度")
    //@PreAuthorize("@ss.hasPermi('smartor:satisfaction:add')")
    @Log(title = "患者满意度", businessType = BusinessType.INSERT)
    @PostMapping("/batchinsert")
    public AjaxResult batchinsert(@RequestBody List<PatSatisfaction> patSatisfaction) {
        LoginUser loginUser = getLoginUser();
        SysUser user = loginUser.getUser();
        for (PatSatisfaction patSatisfaction1 : patSatisfaction) {
            patSatisfaction1.setCreateBy(user.getNickName());
            patSatisfaction1.setOrgid(user.getOrgid());
            patSatisfactionService.insertPatSatisfaction(patSatisfaction1);
        }
        return toAjax(1);
    }
    /**
     * ä¿®æ”¹æ‚£è€…满意度
     */
    @ApiOperation("修改患者满意度")
    //@PreAuthorize("@ss.hasPermi('smartor:satisfaction:edit')")
    @Log(title = "患者满意度", businessType = BusinessType.UPDATE)
    @PostMapping("/edit")
    public AjaxResult edit(@RequestBody PatSatisfaction patSatisfaction) {
        LoginUser loginUser = getLoginUser();
        SysUser user = loginUser.getUser();
        patSatisfaction.setCreateBy(user.getNickName());
        return toAjax(patSatisfactionService.updatePatSatisfaction(patSatisfaction));
    }
    /**
     * åˆ é™¤æ‚£è€…满意度
     */
    @ApiOperation("删除患者满意度")
    //@PreAuthorize("@ss.hasPermi('smartor:satisfaction:remove')")
    @Log(title = "患者满意度", businessType = BusinessType.DELETE)
    @GetMapping("/remove/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids) {
        return toAjax(patSatisfactionService.deletePatSatisfactionByIds(ids));
    }
}
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceExternalController.java
@@ -62,7 +62,7 @@
    @ApiOperation("新增体检任务进子任务")
    @PostMapping("/generalInterfaceAddTask")
    public AjaxResult generalInterfaceAddTask(@RequestBody ServiceTaskInfo serviceTaskInfo) {
        log.error("------serviceTaskInfo的值为:{}", serviceTaskInfo);
        log.info("------serviceTaskInfo的值为:{}", serviceTaskInfo);
        Integer res = 0;
        try {
            res = svyTaskSingleService.insertTaskInfo(serviceTaskInfo);
@@ -80,7 +80,7 @@
    @ApiOperation("360患者信息获取")
    @PostMapping("/query360PatInfo")
    public Map query360PatInfo(@RequestBody ServiceQueryInfo serviceQueryInfo) {
        log.error("------serviceQueryInfo的入参为:{}", serviceQueryInfo);
        log.info("------serviceQueryInfo的入参为:{}", serviceQueryInfo);
        Map map = null;
        try {
            map = svyTaskSingleService.query360PatInfo(serviceQueryInfo);
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskAnswerController.java
@@ -107,7 +107,7 @@
    @ApiOperation("患者问题结果记录(外链)")
    @PostMapping("/saveQuestionAnswer")
    public AjaxResult saveQuestionAnswer(@RequestBody ServiceSubTaskAnswerReq serviceSubTaskAnswerReq) {
        log.error("-----saveQuestionAnswer方法的入参为:{}", serviceSubTaskAnswerReq);
        log.info("-----saveQuestionAnswer方法的入参为:{}", serviceSubTaskAnswerReq);
        return toAjax(serviceSubtaskAnswerService.saveQuestionAnswer(serviceSubTaskAnswerReq, 0L));
    }
@@ -122,7 +122,7 @@
    @ApiOperation("患者问题结果记录(小程充外链)")
    @PostMapping("/saveQuestionAnswerXCH")
    public AjaxResult saveQuestionAnswerXCH(@RequestBody ServiceSubTaskAnswerReq serviceSubTaskAnswerReq) {
        log.error("-------saveQuestionAnswerXCH的入参的值为:{}", serviceSubTaskAnswerReq);
        log.info("-------saveQuestionAnswerXCH的入参的值为:{}", serviceSubTaskAnswerReq);
        return toAjax(serviceSubtaskAnswerService.saveQuestionAnswer(serviceSubTaskAnswerReq, 1L));
    }
@@ -135,7 +135,7 @@
    @ApiOperation("患者问题结果记录缓存(外链)")
    @PostMapping("/saveQuestionCache")
    public AjaxResult saveQuestionCache(@RequestBody ServiceSubTaskCacheReq serviceSubTaskCacheReq) {
        log.error("serviceSubTaskCacheReq的入参为:{}", serviceSubTaskCacheReq);
        log.info("serviceSubTaskCacheReq的入参为:{}", serviceSubTaskCacheReq);
        return toAjax(serviceSubtaskAnswerService.saveQuestionCache(serviceSubTaskCacheReq, 0L));
    }
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskController.java
@@ -192,7 +192,7 @@
    @Log(title = "单一任务(随访)", businessType = BusinessType.INSERT)
    @PostMapping("/insertOrUpdateTask")
    public AjaxResult insertOrUpdateHeTask(@RequestBody ServiceTaskVO ivrTaskVO) {
        log.error("insertOrUpdateHeTask的入参为:{}", ivrTaskVO);
        log.info("insertOrUpdateHeTask的入参为:{}", ivrTaskVO);
        LoginUser loginUser = getLoginUser();
        SysUser user = loginUser.getUser();
        ivrTaskVO.setCreateBy(user.getNickName());
@@ -249,7 +249,7 @@
    @ApiOperation("电话ASR通话回调(雨绮)")
    @PostMapping("/phoneCallBackYQ")
    public PhoneCallBackYQVO phoneCallBackYQ(@RequestBody PhoneCallReqYQVO phoneCallReqYQVO) {
        log.error("电话ASR通话回调(雨绮) ï¼Ÿ{}", phoneCallReqYQVO);
        log.info("电话ASR通话回调(雨绮) ï¼Ÿ{}", phoneCallReqYQVO);
//        SysUser user = getLoginUser().getUser();
//        phoneCallReqYQVO.setOrgid(user.getOrgid());
        PhoneCallBackYQVO phoneCallBackYQVO = serviceSubtaskService.phoneCallBackYQ(phoneCallReqYQVO);
@@ -262,11 +262,9 @@
    @ApiOperation("电话任务拉取(雨绮)")
    @PostMapping("/taskPull")
    public List<PullTaskVO> taskPull() {
        log.error("电话任务拉取(雨绮)");
        log.info("电话任务拉取(雨绮)");
        List<PullTaskVO> pullTaskVOList = serviceSubtaskService.taskPull();
//        List<PullTaskVO> pullTaskVOList = new ArrayList<>();
        log.error("电话任务拉取(雨绮):{}", pullTaskVOList);
        log.info("电话任务拉取数据(雨绮):{}", pullTaskVOList);
        return pullTaskVOList;
    }
@@ -296,10 +294,7 @@
    @ApiOperation("通话记录回调(雨绮)")
    @PostMapping("/recordAccept")
    public AjaxResult recordAccept(@RequestBody PhoneCallRecordVO phoneCallRecordVO) {
        log.error("通话记录回调(雨绮):{}", phoneCallRecordVO);
//        return toAjax(serviceSubtaskService.saveQuestionAnswerPhone(serviceSubTaskDetailReq));
//        SysUser user = getLoginUser().getUser();
//        phoneCallRecordVO.setOrgid(user.getOrgid());
        log.info("通话记录回调(雨绮):{}", phoneCallRecordVO);
        serviceSubtaskService.recordAccept(phoneCallRecordVO);
        return success();
    }
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceTaskController.java
@@ -182,7 +182,7 @@
    public AjaxResult getScriptInfoByCondition(@RequestBody ServiceTaskScriptQues serviceTaskScriptQues) {
        Long tid = null;
        Long pid = null;
        log.error("getScriptInfoByCondition入参为:{}", serviceTaskScriptQues);
        log.info("getScriptInfoByCondition入参为:{}", serviceTaskScriptQues);
        try {
            tid = Long.valueOf(rsaPublicKeyExample.decryptedData(serviceTaskScriptQues.getParam1(), pri_key));
            pid = Long.valueOf(rsaPublicKeyExample.decryptedData(serviceTaskScriptQues.getParam2(), pri_key));
@@ -190,7 +190,7 @@
            log.error("getScriptInfoByCondition报错了:{}", e.getMessage());
        }
        log.error("tid和pid的值为:{},{}", tid, pid);
        log.info("tid和pid的值为:{},{}", tid, pid);
        if (StringUtils.isEmpty(serviceTaskScriptQues.getPatfrom())) serviceTaskScriptQues.setPatfrom("0");
        return success(serviceTaskService.getScriptInfoByCondition(tid, pid, true, serviceTaskScriptQues.getPatfrom()));
    }
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/TemplateDeptController.java
@@ -98,7 +98,7 @@
    @Log(title = "模板科室关联", businessType = BusinessType.DELETE)
    @GetMapping("/remove/{id}")
    public AjaxResult remove(@PathVariable("id") Long id) {
        log.error("删除的ID为:{}",id);
        log.info("删除的ID为:{}",id);
        return toAjax(templateDeptService.deleteTemplateDeptById(id));
    }
}
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java
@@ -93,7 +93,7 @@
    @GetMapping("getRouters")
    public AjaxResult getRouters() {
        Long userId = SecurityUtils.getUserId();
        log.error("----------getRouters的userId入参为:{}", userId);
        log.info("----------getRouters的userId入参为:{}", userId);
        List<SysMenu> menus = menuService.selectMenuTreeByUserId(userId);
        return AjaxResult.success(menuService.buildMenus(menus));
    }
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java
@@ -101,7 +101,7 @@
    //@PreAuthorize("@ss.hasPermi('system:user:query')")
    @GetMapping("/getInfo/{userId}")
    public AjaxResult getInfo(@PathVariable(value = "userId", required = false) Long userId) {
        log.error("--------userId的值为:{}",userId);
        log.info("--------userId的值为:{}",userId);
        userService.checkUserDataScope(userId);
        AjaxResult ajax = AjaxResult.success();
        List<SysRole> roles = roleService.selectRoleAll();
@@ -120,7 +120,7 @@
        sysUserDept.setDeptType("1");
        LoginUser loginUser = getLoginUser();
        SysUser user = loginUser.getUser();
        log.error("--------user的值为:{}",user);
        log.info("--------user的值为:{}",user);
        sysUserDept.setOrgid(user.getOrgid());
        sysUserDeptKSs = sysUserDeptMapper.selectSysUserDeptList(sysUserDept);
        ajax.put("belongDepts", sysUserDeptKSs);
@@ -234,7 +234,7 @@
    @Log(title = "用户管理", businessType = BusinessType.GRANT)
    @PostMapping("/authRole/insertAuthRole")
    public AjaxResult insertAuthRole(@RequestBody AuthRole authRole) {
        log.error("-----用户授权角色的入参为:userId={},roleIds={}", authRole.getUserId(), authRole.getRoleIds());
        log.info("-----用户授权角色的入参为:userId={},roleIds={}", authRole.getUserId(), authRole.getRoleIds());
        if (ObjectUtils.isEmpty(authRole.getRoleIds())) {
            throw new BaseException("角色为空,请检查之后再次尝试");
        }
ruoyi-common/src/main/java/com/ruoyi/common/utils/RSAPublicKeyExample.java
@@ -58,7 +58,7 @@
     * @return
     */
    public String encryptedData(String plainText, String pub_key) {
        log.error("需要加密的数据:{}", plainText);
        log.info("需要加密的数据:{}", plainText);
        try {
            byte[] publicKeyBytes = Base64.getDecoder().decode(pub_key);
@@ -73,11 +73,11 @@
            // å°†åŠ å¯†åŽçš„æ•°æ®è½¬æ¢ä¸ºBase64编码的字符串
            String encryptedText = Base64.getEncoder().encodeToString(encryptedBytes);
            log.error("Base64加密后的数据:{}", encryptedText);
            log.info("Base64加密后的数据:{}", encryptedText);
            encryptedText = URLEncoder.encode(encryptedText, StandardCharsets.UTF_8.toString());
            log.error("URLEncoder编码后的数据:{}", encryptedText);
            log.info("URLEncoder编码后的数据:{}", encryptedText);
            String decodedString = URLDecoder.decode(encryptedText, "UTF-8");
            log.error("URLEncoder解码后的数据:{}", decodedString);
            log.info("URLEncoder解码后的数据:{}", decodedString);
            return encryptedText;
        } catch (Exception e) {
            log.error("加密失败了:{}", e.getMessage());
ruoyi-common/src/main/java/com/ruoyi/common/utils/http/HttpUtils.java
@@ -168,7 +168,7 @@
                }
            }
            out = new PrintWriter(new OutputStreamWriter(conn.getOutputStream(), StandardCharsets.UTF_8));
            log.error("---------param发送的数据为:{}",param);
            log.info("---------param发送的数据为:{}",param);
            out.print(param);
            out.flush();
            in = new BufferedReader(new InputStreamReader(conn.getInputStream(), StandardCharsets.UTF_8));
@@ -220,7 +220,7 @@
                }
            }
            log.error("发送参数:{}", param);
            log.info("发送参数:{}", param);
            try (OutputStream os = conn.getOutputStream()) {
                byte[] input = param.getBytes(StandardCharsets.UTF_8);
                os.write(input, 0, input.length);
ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java
@@ -212,27 +212,27 @@
    public void dealHisData() {
        log.info("【dealHisData】开始执行HIS数据采集任务");
        long startTime = System.currentTimeMillis();
        try {
            // èŽ·å–æ˜¨å¤©0点到今天0点的时间范围
            LocalDateTime todayZero = LocalDateTime.now().with(LocalTime.MIN);
            LocalDateTime yesterdayZero = todayZero.minusDays(1);
            log.info("【dealHisData】采集时间范围:{} ~ {}", yesterdayZero, todayZero);
            // é‡‡é›†å…¥é™¢æ•°æ®
            log.info("【dealHisData】开始采集入院数据");
            getInHospInfo("0", yesterdayZero, todayZero);
            log.info("【dealHisData】入院数据采集完成");
            // é‡‡é›†å‡ºé™¢æ•°æ®
            log.info("【dealHisData】开始采集出院数据");
            getInHospInfo("1", yesterdayZero, todayZero);
            log.info("【dealHisData】出院数据采集完成");
            long endTime = System.currentTimeMillis();
            log.info("【dealHisData】HIS数据采集任务完成,总耗时:{}ms", endTime - startTime);
        } catch (Exception e) {
            log.error("【dealHisData】HIS数据采集异常", e);
            // è¿™é‡Œå¯ä»¥æ·»åŠ å‘Šè­¦é€šçŸ¥é€»è¾‘ï¼Œæ¯”å¦‚å‘é€é‚®ä»¶æˆ–çŸ­ä¿¡
@@ -560,7 +560,6 @@
                    RSAPublicKeyExample rsaPublicKeyExample = new RSAPublicKeyExample();
                    String taskId = rsaPublicKeyExample.encryptedData(ivrTask1.getTaskid().toString(), pub_key);
                    for (ServiceSubtask serviceSubtask : selectServiceSubtaskList) {
                        //  log.error("serviceSubtask---------进来了吗?{}", serviceSubtask);
                        boolean dateToday = isDateToday(serviceSubtask.getLongSendTime());
                        if (dateToday) {
                            try {
@@ -650,42 +649,43 @@
    /**
     * èŽ·å–æ‚£è€…å‡ºå…¥é™¢ä¿¡æ¯
     * @param cry å‡ºå…¥é™¢ç±»åž‹ï¼š0-入院,1-出院
     *
     * @param cry       å‡ºå…¥é™¢ç±»åž‹ï¼š0-入院,1-出院
     * @param startTime å¼€å§‹æ—¶é—´
     * @param endTime ç»“束时间
     * @param endTime   ç»“束时间
     */
    @Transactional
    public void getInHospInfo(String cry, LocalDateTime startTime, LocalDateTime endTime) {
        String typeName = "0".equals(cry) ? "入院" : "出院";
        log.info("【getInHospInfo】开始获取{}患者信息,时间范围:{} ~ {}", typeName, startTime, endTime);
        long startTimeMillis = System.currentTimeMillis();
        try {
            // ç¬¬ä¸€æ­¥ï¼šæž„建请求参数并调用HIS接口
            List<ThiedInhospInfo> thiedInhospInfoList = fetchHisData(cry, startTime, endTime);
            if (CollectionUtils.isEmpty(thiedInhospInfoList)) {
                log.info("【getInHospInfo】{}患者信息为空,跳过处理", typeName);
                return;
            }
            log.info("【getInHospInfo】获取到{}条{}患者信息", thiedInhospInfoList.size(), typeName);
            // ç¬¬äºŒæ­¥ï¼šä¿å­˜åŽŸå§‹æ•°æ®åˆ°æ–‡ä»¶ï¼ˆç”¨äºŽå¤‡ä»½ï¼‰
            saveRawDataToFile(cry, thiedInhospInfoList);
            // ç¬¬ä¸‰æ­¥ï¼šå¤„理患者数据
            processPatientData(thiedInhospInfoList, cry);
            long endTimeMillis = System.currentTimeMillis();
            log.info("【getInHospInfo】{}患者信息处理完成,耗时:{}ms", typeName, endTimeMillis - startTimeMillis);
        } catch (Exception e) {
            log.error("【getInHospInfo】获取{}患者信息异常", typeName, e);
            throw new RuntimeException("获取" + typeName + "患者信息失败", e);
        }
    }
    /**
     * ç¬¬ä¸€æ­¥ï¼šè°ƒç”¨HIS接口获取数据
     */
@@ -693,29 +693,29 @@
        try {
            // æž„建请求参数
            Map<String, String> requestParams = buildRequestParams(cry, startTime, endTime);
            // æž„建请求头
            Map<String, String> headers = buildRequestHeaders(startTime);
            // å‘送HTTP请求
            String result = HttpUtils.sendPostByHeader(hospInfoUrl, new Gson().toJson(requestParams), headers);
            // è§£æžå“åº”数据
            return parseResponseData(result);
        } catch (Exception e) {
            log.error("【fetchHisData】调用HIS接口异常", e);
            throw e;
        }
    }
    /**
     * æž„建请求参数
     */
    private Map<String, String> buildRequestParams(String cry, LocalDateTime startTime, LocalDateTime endTime) {
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.S");
        Map<String, String> req = new HashMap<>();
        if ("1".equals(cry)) {
            // å‡ºé™¢å‚æ•°
            req.put("cashStartDate", startTime.format(formatter));
@@ -727,10 +727,10 @@
            req.put("admissEndDate", endTime.format(formatter));
            req.put("currStatus", "2");
        }
        return req;
    }
    /**
     * æž„建请求头
     */
@@ -744,23 +744,24 @@
        header.put("x-hcsb-msgdate", startTime.format(formatter));
        return header;
    }
    /**
     * è§£æžå“åº”数据
     */
    private List<ThiedInhospInfo> parseResponseData(String result) {
        try {
        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();
            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();
            return gson.fromJson(resultArray, resultType);
        } catch (Exception e) {
            log.error("【parseResponseData】解析响应数据异常,原始数据:{}", result, e);
            throw e;
        }
    }
    /**
     * ç¬¬äºŒæ­¥ï¼šä¿å­˜åŽŸå§‹æ•°æ®åˆ°æ–‡ä»¶
     */
@@ -769,30 +770,30 @@
            String typeName = "0".equals(cry) ? "入院信息" : "出院信息";
            String filename = typeName + "_" + System.currentTimeMillis() + ".json";
            String filePath = "D:\\public\\HIS数据采集\\" + filename;
            File file = new File(filePath);
            File parentDir = file.getParentFile();
            if (!parentDir.exists()) {
                parentDir.mkdirs();
            }
        if (!file.exists()) {
            if (!file.exists()) {
                file.createNewFile();
            }
            // å°†æ•°æ®å†™å…¥æ–‡ä»¶
            try (FileWriter writer = new FileWriter(file)) {
                writer.write(new Gson().toJson(dataList));
            }
            log.info("【saveRawDataToFile】原始数据已保存到文件:{}", filePath);
        } catch (Exception e) {
            log.error("【saveRawDataToFile】保存原始数据到文件异常", e);
            // æ–‡ä»¶ä¿å­˜å¤±è´¥ä¸å½±å“ä¸»æµç¨‹ï¼Œåªè®°å½•日志
        }
    }
    /**
     * ç¬¬ä¸‰æ­¥ï¼šå¤„理患者数据
     */
@@ -800,7 +801,7 @@
        int successCount = 0;
        int skipCount = 0;
        int errorCount = 0;
        for (ThiedInhospInfo thiedInhospInfo : thiedInhospInfoList) {
            try {
                if (processSinglePatient(thiedInhospInfo, cry)) {
@@ -810,35 +811,32 @@
                }
            } catch (Exception e) {
                errorCount++;
                log.error("【processPatientData】处理患者数据异常,患者ID:{}",
                    thiedInhospInfo.getPatiMediaNo(), e);
                log.error("【processPatientData】处理患者数据异常,患者ID:{}", thiedInhospInfo.getPatiMediaNo(), e);
            }
        }
        log.info("【processPatientData】患者数据处理完成,成功:{},跳过:{},失败:{}",
            successCount, skipCount, errorCount);
        log.info("【processPatientData】患者数据处理完成,成功:{},跳过:{},失败:{}", successCount, skipCount, errorCount);
    }
    /**
     * å¤„理单个患者数据
     */
    private boolean processSinglePatient(ThiedInhospInfo thiedInhospInfo, String cry) {
        // éªŒè¯èº«ä»½è¯å·
        if (StringUtils.isEmpty(thiedInhospInfo.getPatiIdCardNo())) {
            log.warn("【processSinglePatient】患者身份证号为空,跳过处理,患者编号:{}",
                thiedInhospInfo.getPatiMediaNo());
            log.warn("【processSinglePatient】患者身份证号为空,跳过处理,患者编号:{}", thiedInhospInfo.getPatiMediaNo());
            return false;
        }
        // å¤„理患者档案信息
        PatArchive patArchive = processPatientArchive(thiedInhospInfo, cry);
        // å¤„理患者住院信息
        processPatientInhospInfo(thiedInhospInfo, patArchive, cry);
        return true;
    }
    /**
     * å¤„理患者档案信息
     */
@@ -847,66 +845,66 @@
        PatArchive queryArchive = new PatArchive();
        queryArchive.setIdcardno(thiedInhospInfo.getPatiIdCardNo().trim());
        List<PatArchive> existingArchives = patArchiveService.selectPatArchiveList(queryArchive);
        // æž„建患者档案信息
        PatArchive patArchive = buildPatientArchive(thiedInhospInfo, cry);
        // ä¿å­˜æˆ–更新患者档案
        if (CollectionUtils.isEmpty(existingArchives)) {
            patArchiveService.insertPatArchive(patArchive);
            log.debug("【processPatientArchive】新增患者档案,患者编号:{}", patArchive.getPatientno());
                } else {
        } else {
            patArchive.setId(existingArchives.get(0).getId());
            patArchiveService.updateArchive(patArchive);
            log.debug("【processPatientArchive】更新患者档案,患者编号:{}", patArchive.getPatientno());
        }
        return patArchive;
    }
    /**
     * æž„建患者档案信息
     */
    private PatArchive buildPatientArchive(ThiedInhospInfo thiedInhospInfo, String cry) {
        PatArchive patArchive = new PatArchive();
        // åŸºæœ¬ä¿¡æ¯
                patArchive.setPatientno(thiedInhospInfo.getPatiMediaNo());
        patArchive.setPatientno(thiedInhospInfo.getPatiMediaNo());
        patArchive.setIdcardno(thiedInhospInfo.getPatiIdCardNo().trim());
        patArchive.setName(thiedInhospInfo.getPatiRecordName());
                patArchive.setSourcefrom(2);
                patArchive.setPattype("2");
        patArchive.setSourcefrom(2);
        patArchive.setPattype("2");
        // æ€§åˆ«
        patArchive.setSex("男".equals(thiedInhospInfo.getPatiRecordGender()) ? 1L : 2L);
        // æ°‘族和籍贯
                patArchive.setNation(thiedInhospInfo.getPatiNation());
                patArchive.setNativePlace(thiedInhospInfo.getPatiNationality());
        patArchive.setNation(thiedInhospInfo.getPatiNation());
        patArchive.setNativePlace(thiedInhospInfo.getPatiNationality());
        // å±…住地址
        String homeAddr = thiedInhospInfo.getPatiHomeAddr();
        patArchive.setPlaceOfResidence(StringUtils.isNotEmpty(homeAddr) ? homeAddr.replace("null", "") : "");
        // å‡ºç”Ÿæ—¥æœŸ
        if (StringUtils.isNotEmpty(thiedInhospInfo.getPatiBirthday())) {
            try {
                        patArchive.setBirthdate(new SimpleDateFormat("yyyy-MM-dd").parse(thiedInhospInfo.getPatiBirthday()));
                } catch (ParseException e) {
                patArchive.setBirthdate(new SimpleDateFormat("yyyy-MM-dd").parse(thiedInhospInfo.getPatiBirthday()));
            } catch (ParseException e) {
                log.warn("【buildPatientArchive】解析出生日期失败:{}", thiedInhospInfo.getPatiBirthday(), e);
                }
            }
        }
        // å¹´é¾„
                if (thiedInhospInfo.getTreateAge() != null) {
                    patArchive.setAge(Long.valueOf(thiedInhospInfo.getTreateAge()));
                }
                patArchive.setAgeUnit(thiedInhospInfo.getTreatAgeunit());
        if (thiedInhospInfo.getTreateAge() != null) {
            patArchive.setAge(Long.valueOf(thiedInhospInfo.getTreateAge()));
        }
        patArchive.setAgeUnit(thiedInhospInfo.getTreatAgeunit());
        // è”系方式
                patArchive.setTelcode(thiedInhospInfo.getCompanyTelNum());
                patArchive.setRelativetelcode(thiedInhospInfo.getContactPersonPhone());
        patArchive.setTelcode(thiedInhospInfo.getCompanyTelNum());
        patArchive.setRelativetelcode(thiedInhospInfo.getContactPersonPhone());
        // å‡ºé™¢æ–¹å¼å¤„理(死亡等特殊情况)
        if (StringUtils.isNotEmpty(thiedInhospInfo.getOutWayId()) && "4".equals(thiedInhospInfo.getOutWayId())) {
            patArchive.setNotrequiredFlag("1");
@@ -916,114 +914,117 @@
            patArchive.setNotrequiredFlag("1");
            patArchive.setNotrequiredreason("出院方式为空");
        }
        // ç³»ç»Ÿå­—段
                patArchive.setDelFlag("0");
                patArchive.setCreateTime(new Date());
                patArchive.setUpdateTime(new Date());
        patArchive.setDelFlag("0");
        patArchive.setCreateTime(new Date());
        patArchive.setUpdateTime(new Date());
        return patArchive;
    }
    /**
     * å¤„理患者住院信息
     */
    private void processPatientInhospInfo(ThiedInhospInfo thiedInhospInfo, PatArchive patArchive, String cry) {
        // æž„建住院信息
        PatMedInhosp patMedInhosp = buildPatientInhospInfo(thiedInhospInfo, patArchive, cry);
        // æŸ¥è¯¢æ˜¯å¦å·²å­˜åœ¨ä½é™¢è®°å½•
        PatMedInhosp queryInhosp = new PatMedInhosp();
        queryInhosp.setPatno(patArchive.getPatientno());
        queryInhosp.setSerialnum(patMedInhosp.getSerialnum());
        List<PatMedInhosp> existingInhosps = patMedInhospService.selectPatMedInhospList(queryInhosp);
        // ä¿å­˜æˆ–更新住院信息
        if (CollectionUtils.isNotEmpty(existingInhosps)) {
            patMedInhosp.setInhospid(existingInhosps.get(0).getInhospid());
            patMedInhospService.updatePatMedInhosp(patMedInhosp);
            log.debug("【processPatientInhospInfo】更新住院信息,患者编号:{},流水号:{}",
                patArchive.getPatientno(), patMedInhosp.getSerialnum());
                } else {
            log.debug("【processPatientInhospInfo】更新住院信息,患者编号:{},流水号:{}", patArchive.getPatientno(), patMedInhosp.getSerialnum());
        } else {
            patMedInhospService.insertPatMedInhosp(patMedInhosp);
            log.debug("【processPatientInhospInfo】新增住院信息,患者编号:{},流水号:{}",
                patArchive.getPatientno(), patMedInhosp.getSerialnum());
            log.debug("【processPatientInhospInfo】新增住院信息,患者编号:{},流水号:{}", patArchive.getPatientno(), patMedInhosp.getSerialnum());
        }
    }
    /**
     * æž„建患者住院信息
     */
    private PatMedInhosp buildPatientInhospInfo(ThiedInhospInfo thiedInhospInfo, PatArchive patArchive, String cry) {
                PatMedInhosp patMedInhosp = new PatMedInhosp();
        PatMedInhosp patMedInhosp = new PatMedInhosp();
        // æ‚£è€…基本信息
                patMedInhosp.setPatid(patArchive.getId());
                patMedInhosp.setPatno(patArchive.getPatientno());
                patMedInhosp.setPatname(patArchive.getName());
        patMedInhosp.setPatid(patArchive.getId());
        patMedInhosp.setPatno(patArchive.getPatientno());
        patMedInhosp.setPatname(patArchive.getName());
        // æŠ¤ç†ä¿¡æ¯
                patMedInhosp.setNurseId(thiedInhospInfo.getNurseId());
                patMedInhosp.setNurseName(thiedInhospInfo.getNurseName());
        patMedInhosp.setNurseId(thiedInhospInfo.getNurseId());
        patMedInhosp.setNurseName(thiedInhospInfo.getNurseName());
        // ä½é™¢ä¿¡æ¯
                patMedInhosp.setSerialnum(thiedInhospInfo.getInpatientId());
                patMedInhosp.setFuflag("1");
        patMedInhosp.setSerialnum(thiedInhospInfo.getInpatientId());
        patMedInhosp.setFuflag("1");
        patMedInhosp.setInhospstate("0".equals(cry) ? "0" : "1");
        // åŒ»é™¢å’Œç§‘室信息
                patMedInhosp.setHospitalcode(thiedInhospInfo.getAreaId());
        patMedInhosp.setDeptcode(thiedInhospInfo.getAdmissDeptId());
        patMedInhosp.setDeptid(thiedInhospInfo.getAdmissDeptId());
        patMedInhosp.setDeptname(thiedInhospInfo.getAdmissDeptName());
        // åŒ»é™¢å’ŒåºŠä½ä¿¡æ¯
        patMedInhosp.setHospitalcode(thiedInhospInfo.getAreaId());
        patMedInhosp.setBedNo(thiedInhospInfo.getAdmissBedNo());
        // è¯Šæ–­ä¿¡æ¯
                patMedInhosp.setIcd10code(thiedInhospInfo.getDiagIcd10());
                patMedInhosp.setDiagname(thiedInhospInfo.getDiagName());
        // æ—¶é—´ä¿¡æ¯
        if (StringUtils.isNotEmpty(thiedInhospInfo.getAdmissDate())) {
                try {
                        patMedInhosp.setStarttime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(thiedInhospInfo.getAdmissDate()));
                } catch (ParseException e) {
            try {
                patMedInhosp.setStarttime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(thiedInhospInfo.getAdmissDate()));
            } catch (ParseException e) {
                log.warn("【buildPatientInhospInfo】解析入院时间失败:{}", thiedInhospInfo.getAdmissDate(), e);
                }
            }
        }
        if (StringUtils.isNotEmpty(thiedInhospInfo.getOutDate())) {
                try {
                        patMedInhosp.setEndtime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(thiedInhospInfo.getOutDate()));
                } catch (ParseException e) {
            try {
                patMedInhosp.setEndtime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(thiedInhospInfo.getOutDate()));
            } catch (ParseException e) {
                log.warn("【buildPatientInhospInfo】解析出院时间失败:{}", thiedInhospInfo.getOutDate(), e);
            }
        }
        // å‡ºé™¢ä¿¡æ¯
                patMedInhosp.setLeaveldeptcode(thiedInhospInfo.getCurrDeptId());
                patMedInhosp.setLeaveldeptname(thiedInhospInfo.getCurrDeptName());
                patMedInhosp.setLeavediagname(thiedInhospInfo.getDiagName());
                patMedInhosp.setLeaveicd10code(thiedInhospInfo.getDiagIcd10());
                patMedInhosp.setOutWayId(thiedInhospInfo.getOutWayId());
                patMedInhosp.setOutWayName(thiedInhospInfo.getOutWayName());
        if (cry.equals("1")) {
            patMedInhosp.setLeaveldeptcode(thiedInhospInfo.getCurrDeptId());
            patMedInhosp.setLeaveldeptname(thiedInhospInfo.getCurrDeptName());
            patMedInhosp.setLeavediagname(thiedInhospInfo.getDiagName());
            patMedInhosp.setLeaveicd10code(thiedInhospInfo.getDiagIcd10());
            patMedInhosp.setOutWayId(thiedInhospInfo.getOutWayId());
            patMedInhosp.setOutWayName(thiedInhospInfo.getOutWayName());
            // ç—…区信息
            patMedInhosp.setLeavehospitaldistrictid(thiedInhospInfo.getCurrWardCode());
            patMedInhosp.setLeavehospitaldistrictcode(thiedInhospInfo.getCurrWardId());
            patMedInhosp.setLeavehospitaldistrictname(thiedInhospInfo.getCurrWardName());
            patMedInhosp.setLeaveldeptid(thiedInhospInfo.getCurrDeptCode());
        } else {
            //入院
            patMedInhosp.setDeptcode(thiedInhospInfo.getCurrDeptId());
            patMedInhosp.setDeptname(thiedInhospInfo.getCurrDeptName());
            patMedInhosp.setDiagname(thiedInhospInfo.getDiagName());
            patMedInhosp.setIcd10code(thiedInhospInfo.getDiagIcd10());
            patMedInhosp.setHospitaldistrictid(thiedInhospInfo.getAdmissWardCode());
            patMedInhosp.setHospitaldistrictcode(thiedInhospInfo.getAdmissWardId());
            patMedInhosp.setHospitaldistrictname(thiedInhospInfo.getAdmissWardName());
        }
        // åŒ»ç”Ÿä¿¡æ¯
        patMedInhosp.setDrname(thiedInhospInfo.getDoctName());
        patMedInhosp.setDrcode(thiedInhospInfo.getDoctId());
        // ç—…区信息
                patMedInhosp.setLeavehospitaldistrictid(thiedInhospInfo.getCurrWardCode());
                patMedInhosp.setLeavehospitaldistrictcode(thiedInhospInfo.getCurrWardId());
                patMedInhosp.setLeavehospitaldistrictname(thiedInhospInfo.getCurrWardName());
                patMedInhosp.setLeaveldeptid(thiedInhospInfo.getCurrDeptCode());
        // çŠ¶æ€ä¿¡æ¯
        patMedInhosp.setSchemestatus("0".equals(cry) ? 1L : 2L);
        // ç³»ç»Ÿå­—段
        patMedInhosp.setDelFlag("0");
                patMedInhosp.setOrgid("1");
        patMedInhosp.setOrgid("1");
        return patMedInhosp;
    }
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java
@@ -191,7 +191,7 @@
                }
                routers.add(router);
            }
            log.error("----------routers的入参为:{}", routers);
            log.info("----------routers的入参为:{}", routers);
            for (RouterVo routerVo : routers) {
                List<String> childName = new ArrayList<>();
                List<RouterVo> childrens = routerVo.getChildren();
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java
@@ -166,238 +166,107 @@
    @Override
    public SysUser selectUserByUserName2(String userName) {
        log.debug("开始查询用户信息,用户名: {}", userName);
        try {
            // å‚数校验
            if (StringUtils.isEmpty(userName)) {
                log.warn("用户名参数为空");
                return null;
            }
            // è§£æžç”¨æˆ·åå’Œæœºæž„ID
            String[] userInfo = parseUserName(userName);
            if (userInfo == null) {
                log.warn("用户名格式不正确: {}", userName);
                return null;
            }
            String username = userInfo[0];
            String orgId = userInfo[1];
            // æŸ¥è¯¢ç”¨æˆ·åŸºæœ¬ä¿¡æ¯
            SysUser sysUser = userMapper.selectUserByUserNameByCondition(username, orgId);
            if (Objects.isNull(sysUser)) {
                log.warn("未找到用户信息: username={}, orgId={}", username, orgId);
                return null;
            }
            // æŸ¥è¯¢ç”¨æˆ·éƒ¨é—¨ä¿¡æ¯
            List<SysDept> sysDepts = getUserDepts(sysUser, username, orgId);
            List<Long> deptIds = extractDeptIds(sysDepts);
            sysUser.setDepts(deptIds);
            // æ ¹æ®æœç´¢èŒƒå›´å¤„理科室和病区信息
            processUserDeptInfo(sysUser, username, orgId);
            log.debug("用户信息查询完成: userId={}", sysUser.getUserId());
            return sysUser;
        } catch (Exception e) {
            log.error("查询用户信息时发生异常: userName={}", userName, e);
            return null;
        }
    }
    /**
     * è§£æžç”¨æˆ·åï¼Œæå–用户名和机构ID
     */
    private String[] parseUserName(String userName) {
        if (StringUtils.isEmpty(userName) || !userName.contains("&")) {
            return null;
        }
        return userName.split("&");
    }
    /**
     * èŽ·å–ç”¨æˆ·éƒ¨é—¨ä¿¡æ¯
     */
    private List<SysDept> getUserDepts(SysUser sysUser, String username, String orgId) {
        if ("admin".equals(username)) {
        String[] split = userName.split("&");
        SysUser sysUser = userMapper.selectUserByUserNameByCondition(split[0], split[1]);
        if (Objects.isNull(sysUser)) return sysUser;
        List<SysDept> sysDepts = null;
        if (StringUtils.isNotEmpty(split[0]) && split[0].equals("admin")) {
            SysDept dept = new SysDept();
            dept.setOrgid(orgId);
            return sysDeptMapper.selectDeptList(dept);
            dept.setOrgid(split[1]);
            sysDepts = sysDeptMapper.selectDeptList(dept);
        } else {
            return sysUserDeptMapper.selectDeptListByUserId(sysUser.getUserId());
            sysDepts = sysUserDeptMapper.selectDeptListByUserId(sysUser.getUserId());
        }
    }
    /**
     * æå–部门ID列表
     */
    private List<Long> extractDeptIds(List<SysDept> sysDepts) {
        if (CollectionUtils.isEmpty(sysDepts)) {
            return new ArrayList<>();
        List<Long> deptIds = new ArrayList<>();
        for (SysDept sysDept : sysDepts) {
            deptIds.add(sysDept.getDeptId());
        }
        return sysDepts.stream()
                .map(SysDept::getDeptId)
                .collect(Collectors.toList());
    }
    /**
     * å¤„理用户科室和病区信息
     */
    private void processUserDeptInfo(SysUser sysUser, String username, String orgId) {
        String searchScope = sysUser.getSearchscope();
        if (StringUtils.isEmpty(searchScope)) {
            return;
        }
        switch (searchScope) {
            case "0": // å…¨éƒ¨èŒƒå›´
                processFullScopeDeptInfo(sysUser, username, orgId);
                break;
            case "1": // ç§‘室范围
                processDeptScopeInfo(sysUser, orgId, "1");
                break;
            case "2": // ç—…区范围
                processDeptScopeInfo(sysUser, orgId, "2");
                break;
            default:
                log.warn("未知的搜索范围: {}", searchScope);
        }
    }
    /**
     * å¤„理全部范围的部门信息
     */
    private void processFullScopeDeptInfo(SysUser sysUser, String username, String orgId) {
        SysUserDept sysUserDept = createSysUserDept(sysUser, orgId);
        SysUserDept sysUserDept = new SysUserDept();
        sysUserDept.setUserId(sysUser.getUserId());
        sysUserDept.setDeptType(sysUser.getSearchscope());
        sysUserDept.setOrgid(split[1]);
        List<SysUserDept> sysUserDeptKSs = null;
        List<SysUserDept> sysUserDeptBQs = null;
        if ("admin".equals(username)) {
            // admin用户特殊处理
            sysUserDept.setUserId(null);
            sysUserDeptKSs = getAdminDeptList(orgId, "1");
            sysUserDeptBQs = getAdminDeptList(orgId, "2");
            // åŽ»é‡å¤„ç†
            sysUserDeptKSs = removeDuplicateDepts(sysUserDeptKSs);
            sysUserDeptBQs = removeDuplicateDepts(sysUserDeptBQs);
        } else {
            // æ™®é€šç”¨æˆ·å¤„理
        if (StringUtils.isNotEmpty(sysUser.getSearchscope()) && sysUser.getSearchscope().equals("0")) {
            if (StringUtils.isNotEmpty(split[0]) && split[0].equals("admin")) {
                sysUserDept.setUserId(null);
            }
            sysUserDept.setDeptType("1");
            sysUserDeptKSs = sysUserDeptMapper.selectSysUserDeptList(sysUserDept);
            sysUserDept.setDeptType("2");
            sysUserDeptBQs = sysUserDeptMapper.selectSysUserDeptList(sysUserDept);
        }
        // è®¾ç½®ç§‘室和病区信息
        setBelongWards(sysUser, sysUserDeptBQs);
        setBelongDepts(sysUser, sysUserDeptKSs);
    }
    /**
     * å¤„理指定范围的部门信息
     */
    private void processDeptScopeInfo(SysUser sysUser, String orgId, String deptType) {
        SysUserDept sysUserDept = createSysUserDept(sysUser, orgId);
        sysUserDept.setDeptType(deptType);
        List<SysUserDept> deptList = sysUserDeptMapper.selectSysUserDeptList(sysUserDept);
        if ("1".equals(deptType)) {
            setBelongDepts(sysUser, deptList);
        } else if ("2".equals(deptType)) {
            setBelongWards(sysUser, deptList);
        }
    }
    /**
     * åˆ›å»ºSysUserDept对象
     */
    private SysUserDept createSysUserDept(SysUser sysUser, String orgId) {
        SysUserDept sysUserDept = new SysUserDept();
        sysUserDept.setUserId(sysUser.getUserId());
        sysUserDept.setDeptType(sysUser.getSearchscope());
        sysUserDept.setOrgid(orgId);
        return sysUserDept;
    }
    /**
     * èŽ·å–admin用户的部门列表
     */
    private List<SysUserDept> getAdminDeptList(String orgId, String deptType) {
        SysDept dept = new SysDept();
        dept.setOrgid(orgId);
        dept.setDeptType(deptType);
        List<SysDept> sysDepts = sysDeptMapper.selectDeptList(dept);
        return DtoConversionUtils.sourceToTarget(sysDepts, SysUserDept.class);
    }
    /**
     * åŽ»é™¤é‡å¤çš„éƒ¨é—¨ä¿¡æ¯
     */
    private List<SysUserDept> removeDuplicateDepts(List<SysUserDept> deptList) {
        if (CollectionUtils.isEmpty(deptList)) {
            return new ArrayList<>();
        }
        List<SysUserDept> distinctDepts = new ArrayList<>();
        Set<String> uniqueCodes = new HashSet<>();
        for (SysUserDept dept : deptList) {
            String deptCode = dept.getDeptCode();
            if (StringUtils.isNotEmpty(deptCode) && !uniqueCodes.contains(deptCode)) {
                distinctDepts.add(dept);
                uniqueCodes.add(deptCode);
            //如果是admin,需要对sysUserDeptBQs,sysUserDeptBQs去重
            if (StringUtils.isNotEmpty(split[0]) && split[0].equals("admin")) {
                //如果是admin,只能去sys_dept去取数据
                SysDept dept = new SysDept();
                dept.setOrgid(split[1]);
                dept.setDeptType("1");
                sysDepts = sysDeptMapper.selectDeptList(dept);
                sysUserDeptKSs = DtoConversionUtils.sourceToTarget(sysDepts, SysUserDept.class);
                dept.setDeptType("2");
                sysDepts = sysDeptMapper.selectDeptList(dept);
                sysUserDeptBQs = DtoConversionUtils.sourceToTarget(sysDepts, SysUserDept.class);
                List<SysUserDept> distinctUserDepts = new ArrayList<>();
                Set<String> uniqueDeptCodes = new HashSet<>();
                for (SysUserDept userDept : sysUserDeptKSs) {
                    String deptCode = userDept.getDeptCode();
                    if (StringUtils.isNotEmpty(deptCode) && !uniqueDeptCodes.contains(deptCode)) {
                        distinctUserDepts.add(userDept);
                        uniqueDeptCodes.add(deptCode);
                    }
                }
                List<SysUserDept> distinctUserBQs = new ArrayList<>();
                Set<String> uniqueBQCodes = new HashSet<>();
                for (SysUserDept userDept : sysUserDeptBQs) {
                    String deptCode = userDept.getDeptCode();
                    if (StringUtils.isNotEmpty(deptCode) && !uniqueBQCodes.contains(deptCode)) {
                        distinctUserBQs.add(userDept);
                        uniqueBQCodes.add(deptCode);
                    }
                }
                sysUserDeptKSs = distinctUserDepts;
                sysUserDeptBQs = distinctUserBQs;
            }
        } else if (StringUtils.isNotEmpty(sysUser.getSearchscope()) && sysUser.getSearchscope().equals("1")) {
            sysUserDept.setDeptType("1");
            sysUserDeptKSs = sysUserDeptMapper.selectSysUserDeptList(sysUserDept);
        } else if (StringUtils.isNotEmpty(sysUser.getSearchscope()) && sysUser.getSearchscope().equals("2")) {
            sysUserDept.setDeptType("2");
            sysUserDeptBQs = sysUserDeptMapper.selectSysUserDeptList(sysUserDept);
        }
        return distinctDepts;
    }
    /**
     * è®¾ç½®ç—…区信息
     */
    private void setBelongWards(SysUser sysUser, List<SysUserDept> sysUserDeptBQs) {
        if (CollectionUtils.isEmpty(sysUserDeptBQs)) {
            return;
        sysUser.setDepts(deptIds);
        if (!CollectionUtils.isEmpty(sysUserDeptBQs)) {
            List<Map<String, Object>> list = new ArrayList<>();
            for (SysUserDept sud : sysUserDeptBQs) {
                Map<String, Object> map = new HashMap<>();
                map.put("districtCode", "");
                if (StringUtils.isNotEmpty(sud.getDeptCode())) map.put("districtCode", sud.getDeptCode());
                else continue;
                map.put("districtName", "");
                if (StringUtils.isNotEmpty(sud.getDeptName())) map.put("districtName", sud.getDeptName());
                list.add(map);
            }
            sysUser.setBelongWards(list);
        }
        List<Map<String, Object>> wardList = sysUserDeptBQs.stream()
                .filter(sud -> StringUtils.isNotEmpty(sud.getDeptCode()))
                .map(sud -> {
                    Map<String, Object> map = new HashMap<>();
                    map.put("districtCode", StringUtils.defaultString(sud.getDeptCode(), ""));
                    map.put("districtName", StringUtils.defaultString(sud.getDeptName(), ""));
                    return map;
                })
                .collect(Collectors.toList());
        sysUser.setBelongWards(wardList);
    }
    /**
     * è®¾ç½®ç§‘室信息
     */
    private void setBelongDepts(SysUser sysUser, List<SysUserDept> sysUserDeptKSs) {
        if (CollectionUtils.isEmpty(sysUserDeptKSs)) {
            return;
        if (!CollectionUtils.isEmpty(sysUserDeptKSs)) {
            List<Map<String, Object>> list = new ArrayList<>();
            for (SysUserDept sud : sysUserDeptKSs) {
                Map<String, Object> map = new HashMap<>();
                map.put("deptCode", "");
                if (StringUtils.isNotEmpty(sud.getDeptCode())) map.put("deptCode", sud.getDeptCode());
                else continue;
                map.put("deptName", "");
                if (StringUtils.isNotEmpty(sud.getDeptName())) map.put("deptName", sud.getDeptName());
                list.add(map);
            }
            sysUser.setBelongDepts(list);
        }
        List<Map<String, Object>> deptList = sysUserDeptKSs.stream()
                .filter(sud -> StringUtils.isNotEmpty(sud.getDeptCode()))
                .map(sud -> {
                    Map<String, Object> map = new HashMap<>();
                    map.put("deptCode", StringUtils.defaultString(sud.getDeptCode(), ""));
                    map.put("deptName", StringUtils.defaultString(sud.getDeptName(), ""));
                    return map;
                })
                .collect(Collectors.toList());
        sysUser.setBelongDepts(deptList);
        return sysUser;
    }
    /**
ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml
@@ -77,6 +77,9 @@
        <if test="hisParentId != null and hisParentId != ''">
            AND his_parent_id = #{hisParentId}
        </if>
            <if test="orgid != null and orgid != ''">
            AND orgid = #{orgid}
        </if>
        <!-- æ•°æ®èŒƒå›´è¿‡æ»¤ -->
        ${params.dataScope}
        order by d.dept_type asc, d.parent_id, d.order_num
smartor/src/main/java/com/smartor/common/FtpService.java
@@ -103,7 +103,7 @@
                try (FileOutputStream fos = new FileOutputStream(localFile)) {
                    channelSftp.get(remoteFilePath, fos);
                    log.error("文件下载成功:{}", remoteFilePath);
                    log.info("文件下载成功:{}", remoteFilePath);
                } catch (Exception e) {
                    System.err.println("文件下载失败: " + remoteFilePath);
                    e.printStackTrace();
smartor/src/main/java/com/smartor/domain/PatArchive.java
@@ -64,6 +64,19 @@
    private String notrequiredreason;
    /**
     * ä¸è¦æœåŠ¡çš„æ“ä½œåŒ»ç”Ÿ
     */
    @ApiModelProperty("不要服务的操作医生")
    private String filterDrname;
    /**
     * ä¸è¦æœåŠ¡çš„æ“ä½œåŒ»ç”Ÿ
     */
    @ApiModelProperty("不要服务的操作医生编码")
    private String filterDrcode;
    /**
     * æ¥æº(1:HIS;2:数据平台;3:文件导入)
     */
    @ApiModelProperty("来源(1:HIS;2:数据平台;3:文件导入)")
smartor/src/main/java/com/smartor/domain/PatArchiveOthreInfo.java
@@ -44,6 +44,20 @@
    /**
     * ä¸è¦æœåŠ¡çš„æ“ä½œåŒ»ç”Ÿ
     */
    @ApiModelProperty("不要服务的操作医生")
    private String filterDrname;
    /**
     * ä¸è¦æœåŠ¡çš„æ“ä½œåŒ»ç”Ÿ
     */
    @ApiModelProperty("不要服务的操作医生编码")
    private String filterDrcode;
    /**
     * ä½é™¢å·
     */
    @ApiModelProperty(value = "住院号")
@@ -382,5 +396,8 @@
    @ApiModelProperty("出院病区编号")
    private String leavehospitaldistrictcode;
    @ApiModelProperty("入院病区名称")
    private String hospitaldistrictname;
}
smartor/src/main/java/com/smartor/domain/PatArchiveReq.java
@@ -60,6 +60,27 @@
    @Excel(name = " æœåŠ¡æ ‡è¯†ï¼š0,需要,1,不需要 ")
    private String notrequiredFlag;
    /**
     * ä¸è¦æœåŠ¡çš„åŽŸå› 
     */
    @ApiModelProperty("不要服务的原因")
    @Excel(name = " ä¸è¦æœåŠ¡çš„åŽŸå›  ")
    private String notrequiredreason;
    /**
     * ä¸è¦æœåŠ¡çš„æ“ä½œåŒ»ç”Ÿ
     */
    @ApiModelProperty("不要服务的操作医生")
    private String filterDrname;
    /**
     * ä¸è¦æœåŠ¡çš„æ“ä½œåŒ»ç”Ÿ
     */
    @ApiModelProperty("不要服务的操作医生编码")
    private String filterDrcode;
    /**
     * è¯ä»¶å·ç 
@@ -91,9 +112,9 @@
    /**
     * æŸ¥çœ‹å…¨éƒ¨  0   æŸ¥çœ‹ä½é™¢  1  æŸ¥çœ‹é—¨è¯Š  2   æŸ¥çœ‹ä½“检  3
     * æŸ¥çœ‹å…¨éƒ¨  0   æŸ¥çœ‹ä½é™¢  1  æŸ¥çœ‹é—¨è¯Š  2   æŸ¥çœ‹ä½“检  3   æŸ¥çœ‹å‡ºé™¢ 4
     */
    @ApiModelProperty(value = " æŸ¥çœ‹ä½é™¢  1  æŸ¥çœ‹é—¨è¯Š  2   æŸ¥çœ‹ä½“检  3")
    @ApiModelProperty(value = " æŸ¥çœ‹ä½é™¢  1  æŸ¥çœ‹é—¨è¯Š  2   æŸ¥çœ‹ä½“检  3   æŸ¥çœ‹å‡ºé™¢ 4")
    private Long allhosp;
smartor/src/main/java/com/smartor/domain/PatArchiveVO.java
@@ -234,6 +234,20 @@
    @Excel(name = " ä¸è¦æœåŠ¡çš„åŽŸå›  ")
    private String notrequiredreason;
    /**
     * ä¸è¦æœåŠ¡çš„æ“ä½œåŒ»ç”Ÿ
     */
    @ApiModelProperty("不要服务的操作医生")
    private String filterDrname;
    /**
     * ä¸è¦æœåŠ¡çš„æ“ä½œåŒ»ç”Ÿ
     */
    @ApiModelProperty("不要服务的操作医生编码")
    private String filterDrcode;
    /**
     * é’‰é’‰å·
     */
smartor/src/main/java/com/smartor/domain/PatSatisfaction.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,142 @@
package com.smartor.domain;
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;
/**
 * æ‚£è€…满意度对象 pat_satisfaction
 *
 * @author lihu
 * @date 2025-06-30
 */
@Data
@ApiModel("患者满意度")
public class PatSatisfaction extends BaseEntity {
    private static final long serialVersionUID = 1L;
    /**
     * $column.columnComment
     */
    @ApiModelProperty("$column.columnComment")
    //数据库自增改成@TableId(type = IdType.AUTO)
    private Long id;
    /**
     * $column.columnComment
     */
    @ApiModelProperty("患者姓名")
    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
    private String patName;
    /**
     * $column.columnComment
     */
    @ApiModelProperty("患者编码")
    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
    private String patCode;
    /**
     * $column.columnComment
     */
    @ApiModelProperty("手机号")
    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
    private String phone;
    /**
     * $column.columnComment
     */
    @ApiModelProperty("病区名称")
    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
    private String hospitaldistrictname;
    /**
     * $column.columnComment
     */
    @ApiModelProperty("病区编码")
    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
    private String hospitaldistrictcode;
    /**
     * $column.columnComment
     */
    @ApiModelProperty("部门名称")
    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
    private String deptname;
    /**
     * éƒ¨é—¨ç¼–码
     */
    @ApiModelProperty("部门编码")
    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
    private String deptcode;
    /**
     * çœŸå®žæ€§
     */
    @ApiModelProperty("真实性")
    @Excel(name = "真实性")
    private double authenticity;
    /**
     * ä¸€å‘¨å†…完成
     */
    @ApiModelProperty("一周内完成")
    @Excel(name = "一周内完成")
    private double weekFinish;
    /**
     * è§„范性
     */
    @ApiModelProperty("规范性")
    @Excel(name = "规范性")
    private double standard;
    /**
     * åŠæ—¶æ€§
     */
    @ApiModelProperty("及时性")
    @Excel(name = "及时性")
    private double timeliness;
    /**
     * å®£æ•™æƒ…况
     */
    @ApiModelProperty("宣教情况")
    @Excel(name = "宣教情况")
    private double library;
    /**
     * çŽ¯å¢ƒæ»¡æ„åº¦
     */
    @ApiModelProperty("环境满意度")
    @Excel(name = "环境满意度")
    private double environment;
    /**
     * åŒ»ç”Ÿæ»¡æ„åº¦
     */
    @ApiModelProperty("医生满意度")
    @Excel(name = "医生满意度")
    private double doctorSatisfaction;
    /**
     * $column.columnComment
     */
    @ApiModelProperty("护士满意度")
    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
    private double nurseSatisfaction;
    @ApiModelProperty("总分")
    private double total;
    /**
     * $column.columnComment
     */
    @ApiModelProperty("删除")
    private String delFlag;
}
smartor/src/main/java/com/smartor/mapper/PatSatisfactionMapper.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,64 @@
package com.smartor.mapper;
import com.smartor.domain.PatSatisfaction;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
 * æ‚£è€…满意度Mapper接口
 *
 * @author lihu
 * @date 2025-06-30
 */
@Mapper
public interface PatSatisfactionMapper
{
    /**
     * æŸ¥è¯¢æ‚£è€…满意度
     *
     * @param id æ‚£è€…满意度主键
     * @return æ‚£è€…满意度
     */
    public PatSatisfaction selectPatSatisfactionById(Long id);
    /**
     * æŸ¥è¯¢æ‚£è€…满意度列表
     *
     * @param patSatisfaction æ‚£è€…满意度
     * @return æ‚£è€…满意度集合
     */
    public List<PatSatisfaction> selectPatSatisfactionList(PatSatisfaction patSatisfaction);
    /**
     * æ–°å¢žæ‚£è€…满意度
     *
     * @param patSatisfaction æ‚£è€…满意度
     * @return ç»“æžœ
     */
    public int insertPatSatisfaction(PatSatisfaction patSatisfaction);
    /**
     * ä¿®æ”¹æ‚£è€…满意度
     *
     * @param patSatisfaction æ‚£è€…满意度
     * @return ç»“æžœ
     */
    public int updatePatSatisfaction(PatSatisfaction patSatisfaction);
    /**
     * åˆ é™¤æ‚£è€…满意度
     *
     * @param id æ‚£è€…满意度主键
     * @return ç»“æžœ
     */
    public int deletePatSatisfactionById(Long id);
    /**
     * æ‰¹é‡åˆ é™¤æ‚£è€…满意度
     *
     * @param ids éœ€è¦åˆ é™¤çš„æ•°æ®ä¸»é”®é›†åˆ
     * @return ç»“æžœ
     */
    public int deletePatSatisfactionByIds(Long[] ids);
}
smartor/src/main/java/com/smartor/service/IPatSatisfactionService.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,61 @@
package com.smartor.service;
import java.util.List;
import com.smartor.domain.PatSatisfaction;
/**
 * æ‚£è€…满意度Service接口
 *
 * @author lihu
 * @date 2025-06-30
 */
public interface IPatSatisfactionService
{
    /**
     * æŸ¥è¯¢æ‚£è€…满意度
     *
     * @param id æ‚£è€…满意度主键
     * @return æ‚£è€…满意度
     */
    public PatSatisfaction selectPatSatisfactionById(Long id);
    /**
     * æŸ¥è¯¢æ‚£è€…满意度列表
     *
     * @param patSatisfaction æ‚£è€…满意度
     * @return æ‚£è€…满意度集合
     */
    public List<PatSatisfaction> selectPatSatisfactionList(PatSatisfaction patSatisfaction);
    /**
     * æ–°å¢žæ‚£è€…满意度
     *
     * @param patSatisfaction æ‚£è€…满意度
     * @return ç»“æžœ
     */
    public int insertPatSatisfaction(PatSatisfaction patSatisfaction);
    /**
     * ä¿®æ”¹æ‚£è€…满意度
     *
     * @param patSatisfaction æ‚£è€…满意度
     * @return ç»“æžœ
     */
    public int updatePatSatisfaction(PatSatisfaction patSatisfaction);
    /**
     * æ‰¹é‡åˆ é™¤æ‚£è€…满意度
     *
     * @param ids éœ€è¦åˆ é™¤çš„æ‚£è€…满意度主键集合
     * @return ç»“æžœ
     */
    public int deletePatSatisfactionByIds(Long[] ids);
    /**
     * åˆ é™¤æ‚£è€…满意度信息
     *
     * @param id æ‚£è€…满意度主键
     * @return ç»“æžœ
     */
    public int deletePatSatisfactionById(Long id);
}
smartor/src/main/java/com/smartor/service/impl/PatArchiveServiceImpl.java
@@ -172,7 +172,7 @@
                //去redis中,查询是否有subid,有的话移除cache-exist
                if (CollectionUtils.isNotEmpty(serviceSubtaskList)) {
                    for (ServiceSubtask serviceSubtask : serviceSubtaskList) {
                        log.error("需要移除的subId为:{}", serviceSubtask.getId().toString());
                        log.info("需要移除的subId为:{}", serviceSubtask.getId().toString());
                        serviceSubtaskMapper.deleteServiceSubtaskById(serviceSubtask.getId());
                        redisCache.removeElementFromList("cache-exist", serviceSubtask.getId().toString());
                        redisCache.removeElementFromList("cache-0", serviceSubtask.getId().toString());
@@ -279,6 +279,13 @@
            List<PatArchiveOthreInfo> patArchives3 = patArchiveMapper.selectPatArchiveInfoByPhysical(patArchiveReq);
            if (CollectionUtils.isNotEmpty(patArchives3)) {
                patArchiveList.addAll(patArchives3);
            }
        } else if (patArchiveReq.getAllhosp() != null && patArchiveReq.getAllhosp() == 4) {
            //  æŸ¥çœ‹ä½é™¢  1  æŸ¥çœ‹é—¨è¯Š  2   æŸ¥çœ‹ä½“检  3   æŸ¥çœ‹å‡ºé™¢ 4
            patArchiveReq.setCry(1);
            List<PatArchiveOthreInfo> patArchives1 = patArchiveMapper.selectPatArchiveInfoByInhospQC(patArchiveReq);
            if (CollectionUtils.isNotEmpty(patArchives1)) {
                patArchiveList.addAll(patArchives1);
            }
        }
@@ -588,6 +595,13 @@
            if (CollectionUtils.isNotEmpty(patArchives3)) {
                patArchiveList.addAll(patArchives3);
            }
        } else if (patArchive.getAllhosp() != null && patArchive.getAllhosp() == 4) {
            //  æŸ¥çœ‹ä½é™¢  1  æŸ¥çœ‹é—¨è¯Š  2   æŸ¥çœ‹ä½“检  3   æŸ¥çœ‹å‡ºé™¢ 4
            patArchive.setCry(1);
            List<PatArchiveOthreInfo> patArchives1 = patArchiveMapper.selectPatArchiveInfoByInhospQC(patArchive);
            if (CollectionUtils.isNotEmpty(patArchives1)) {
                patArchiveList.addAll(patArchives1);
            }
        }
        //根据患者ID进行分组
@@ -752,6 +766,7 @@
        List<PatArchiveOthreInfo> patArchiveList = new ArrayList<>();
        if (patArchiveReq.getAllhosp() != null && patArchiveReq.getAllhosp() == 1) {
            //  æŸ¥çœ‹ä½é™¢  1  æŸ¥çœ‹é—¨è¯Š  2   æŸ¥çœ‹ä½“检  3
            patArchiveReq.setCry(0);
            List<PatArchiveOthreInfo> patArchives1 = patArchiveMapper.selectPatArchiveInfoByInhospQC(patArchiveReq);
            if (CollectionUtils.isNotEmpty(patArchives1)) {
                patArchiveList.addAll(patArchives1);
@@ -768,6 +783,14 @@
            if (CollectionUtils.isNotEmpty(patArchives3)) {
                patArchiveList.addAll(patArchives3);
            }
        } else if (patArchiveReq.getAllhosp() != null && patArchiveReq.getAllhosp() == 4) {
            //  æŸ¥çœ‹ä½é™¢  1  æŸ¥çœ‹é—¨è¯Š  2   æŸ¥çœ‹ä½“检  3   æŸ¥çœ‹å‡ºé™¢ 4
            patArchiveReq.setCry(1);
            List<PatArchiveOthreInfo> patArchives1 = patArchiveMapper.selectPatArchiveInfoByInhospQC(patArchiveReq);
            if (CollectionUtils.isNotEmpty(patArchives1)) {
                patArchiveList.addAll(patArchives1);
            }
        }
        return patArchiveList;
smartor/src/main/java/com/smartor/service/impl/PatMedInhospServiceImpl.java
@@ -209,7 +209,7 @@
        pmks.setInhospstate("1");
        pmks.setFuflag("1");
        List<PatMedInhosp> patMedInhosps = patMedInhospMapper.selectPatMedInhospList(pmks);
        log.error("dealOutHospInfo需要处理的出院部门患者信息:{}", patMedInhosps);
        log.info("dealOutHospInfo需要处理的出院部门患者信息:{}", patMedInhosps);
        for (PatMedInhosp patMedInhosp1 : patMedInhosps) {
            String tagname = patMedInhospMapper.getTagnameBypatid(patMedInhosp1.getPatid());
            patMedInhosp1.setTagname(tagname);
@@ -262,7 +262,7 @@
            pmbq.setInhospstate("1");
            pmbq.setFuflag("1");
            List<PatMedInhosp> patMedInhospBQs = patMedInhospMapper.selectPatMedInhospList(pmbq);
            log.error("dealOutHospInfo需要处理的出院病区患者信息:{}", patMedInhosps);
            log.info("dealOutHospInfo需要处理的出院病区患者信息:{}", patMedInhosps);
            for (PatMedInhosp patMedInhosp1 : patMedInhospBQs) {
                String tagname = patMedInhospMapper.getTagnameBypatid(patMedInhosp1.getPatid());
                patMedInhosp1.setTagname(tagname);
@@ -312,7 +312,7 @@
            pmjb.setInhospstate("1");
            pmjb.setFuflag("1");
            List<PatMedInhosp> patMedInhospJBs = patMedInhospMapper.selectPatMedInhospList(pmjb);
            log.error("dealOutHospInfo需要处理的出院疾病患者信息:{}", patMedInhosps);
            log.info("dealOutHospInfo需要处理的出院疾病患者信息:{}", patMedInhosps);
            for (PatMedInhosp patMedInhosp1 : patMedInhospJBs) {
                String tagname = patMedInhospMapper.getTagnameBypatid(patMedInhosp1.getPatid());
                patMedInhosp1.setTagname(tagname);
@@ -538,7 +538,7 @@
        st.setSendState(2L);
        List<ServiceTask> serviceTasks = serviceTaskMapper.selectServiceTaskList(st);
        if (CollectionUtils.isEmpty(serviceTasks)) {
            log.error("该患者出院随访长期任务不存在,任务ID为:{}", taskid);
            log.info("该患者出院随访长期任务不存在,任务ID为:{}", taskid);
            patMedInhosp1.setDeptcheckFlag("2");
            patMedInhosp1.setLongTaskReason(longTaskReason + " & è¯¥æ‚£è€…出院随访长期任务不存在,任务ID为:" + taskid);
            patMedInhospMapper.updatePatMedInhosp(patMedInhosp1);
@@ -566,7 +566,7 @@
            subtask.setSendstate(2L);
            subtask.setTaskid(taskid);
            List<ServiceSubtask> selectServiceSubtaskList = serviceSubtaskMapper.selectServiceSubtaskList(subtask);
            log.error("该患者待执行的任务:{}", selectServiceSubtaskList);
            log.info("该患者待执行的任务:{}", selectServiceSubtaskList);
            if (CollectionUtils.isNotEmpty(selectServiceSubtaskList) && selectServiceSubtaskList.size() > 0) {
                for (ServiceSubtask serviceSubtask1 : selectServiceSubtaskList) {
                    if (Objects.isNull(serviceSubtask1.getLongSendTime())) {
@@ -643,7 +643,7 @@
            patMedInhospMapper.updatePatMedInhosp(patMedInhosp2);
        } else {
            //生成子任务失败,
            log.error("生成子任务失败serviceSubtask为:{}", serviceSubtask);
            log.info("生成子任务失败serviceSubtask为:{}", serviceSubtask);
            PatMedInhosp patMedInhosp2 = new PatMedInhosp();
            patMedInhosp2.setInhospid(patMedInhosp1.getInhospid());
            if (type == 1) patMedInhosp2.setDeptcheckFlag("2");
@@ -695,6 +695,7 @@
        if (serviceTask.getSendDay() == null) serviceTask.setSendDay(1L);
        Date newDate = addDays(patMedInhosp1.getEndtime(), serviceTask.getSendDay().intValue());
        serviceSubtask.setLongSendTime(newDate);
        serviceSubtask.setVisitTime(newDate);
        //患者发送时间
        if (StringUtils.isNotEmpty(patArchive.getNotrequiredFlag()) && patArchive.getNotrequiredFlag().equals("1")) {
//            log.error("serviceSubtask99999999的值为:{}",serviceSubtask);
smartor/src/main/java/com/smartor/service/impl/PatMedOuthospServiceImpl.java
@@ -116,16 +116,16 @@
    @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);
        }
//        // èŽ·å–å½“å‰ç™»é™†äººçš„éƒ¨é—¨æƒé™
//        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);
    }
smartor/src/main/java/com/smartor/service/impl/PatSatisfactionServiceImpl.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,102 @@
package com.smartor.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.smartor.mapper.PatSatisfactionMapper;
import com.smartor.domain.PatSatisfaction;
import com.smartor.service.IPatSatisfactionService;
/**
 * æ‚£è€…满意度Service业务层处理
 *
 * @author lihu
 * @date 2025-06-30
 */
@Service
public class PatSatisfactionServiceImpl implements IPatSatisfactionService {
    @Autowired
    private PatSatisfactionMapper patSatisfactionMapper;
    /**
     * æŸ¥è¯¢æ‚£è€…满意度
     *
     * @param id æ‚£è€…满意度主键
     * @return æ‚£è€…满意度
     */
    @Override
    public PatSatisfaction selectPatSatisfactionById(Long id) {
        PatSatisfaction ps = patSatisfactionMapper.selectPatSatisfactionById(id);
        double total = ps.getDoctorSatisfaction() + ps.getAuthenticity() + ps.getWeekFinish() + ps.getStandard() + ps.getTimeliness() + ps.getLibrary() + ps.getEnvironment() + ps.getNurseSatisfaction();
        ps.setTotal(total);
        return ps;
    }
    /**
     * æŸ¥è¯¢æ‚£è€…满意度列表
     *
     * @param patSatisfaction æ‚£è€…满意度
     * @return æ‚£è€…满意度
     */
    @Override
    public List<PatSatisfaction> selectPatSatisfactionList(PatSatisfaction patSatisfaction) {
        List<PatSatisfaction> patSatisfactions = patSatisfactionMapper.selectPatSatisfactionList(patSatisfaction);
        if (CollectionUtils.isNotEmpty(patSatisfactions)) {
            patSatisfactions.forEach(ps -> {
                double total = ps.getDoctorSatisfaction() + ps.getAuthenticity() + ps.getWeekFinish() + ps.getStandard() + ps.getTimeliness() + ps.getLibrary() + ps.getEnvironment() + ps.getNurseSatisfaction();
                ps.setTotal(total);
            });
        }
        return patSatisfactions;
    }
    /**
     * æ–°å¢žæ‚£è€…满意度
     *
     * @param patSatisfaction æ‚£è€…满意度
     * @return ç»“æžœ
     */
    @Override
    public int insertPatSatisfaction(PatSatisfaction patSatisfaction) {
        patSatisfaction.setCreateTime(DateUtils.getNowDate());
        patSatisfaction.setUpdateTime(DateUtils.getNowDate());
        return patSatisfactionMapper.insertPatSatisfaction(patSatisfaction);
    }
    /**
     * ä¿®æ”¹æ‚£è€…满意度
     *
     * @param patSatisfaction æ‚£è€…满意度
     * @return ç»“æžœ
     */
    @Override
    public int updatePatSatisfaction(PatSatisfaction patSatisfaction) {
        patSatisfaction.setUpdateTime(DateUtils.getNowDate());
        return patSatisfactionMapper.updatePatSatisfaction(patSatisfaction);
    }
    /**
     * æ‰¹é‡åˆ é™¤æ‚£è€…满意度
     *
     * @param ids éœ€è¦åˆ é™¤çš„æ‚£è€…满意度主键
     * @return ç»“æžœ
     */
    @Override
    public int deletePatSatisfactionByIds(Long[] ids) {
        return patSatisfactionMapper.deletePatSatisfactionByIds(ids);
    }
    /**
     * åˆ é™¤æ‚£è€…满意度信息
     *
     * @param id æ‚£è€…满意度主键
     * @return ç»“æžœ
     */
    @Override
    public int deletePatSatisfactionById(Long id) {
        return patSatisfactionMapper.deletePatSatisfactionById(id);
    }
}
smartor/src/main/java/com/smartor/service/impl/ServiceExternalServiceImpl.java
@@ -127,7 +127,7 @@
    @Override
    public Boolean addUserInfo(Map dataMap) {
        log.error("ServiceExternalServiceImpl---addUserInfo的新增的值为:{}", dataMap);
        log.info("ServiceExternalServiceImpl---addUserInfo的新增的值为:{}", dataMap);
        Map yeWuXX = (Map) dataMap.get("YeWuXX");
        Map<String, Object> yongHuXX = (Map<String, Object>) yeWuXX.get("YongHuXX");
        ExternalUserInfo externalUserInfo = BeanUtil.mapToBean(yongHuXX, ExternalUserInfo.class, true);
smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java
@@ -454,7 +454,7 @@
            serviceTask.setCreateTime(new Date());
            serviceTask.setUpdateTime(new Date());
            serviceTaskService.insertServiceTask(serviceTask);
            log.error("----serviceTaskVO.getAppltype()的值为:{}", serviceTaskVO.getAppltype());
            log.info("----serviceTaskVO.getAppltype()的值为:{}", serviceTaskVO.getAppltype());
            if (StringUtils.isNotEmpty(serviceTaskVO.getAppltype())) {
                if (serviceTaskVO.getAppltype().equals("3")) {
                    ServiceTaskdiag serviceTaskdiag = new ServiceTaskdiag();
@@ -467,7 +467,7 @@
                    serviceTaskdiag.setGuid(serviceTask.getGuid());
                    serviceTaskdiag.setOrgid(serviceTask.getOrgid());
                    serviceTaskdiag.setCreateTime(new Date());
                    log.error("----serviceTaskdiag的值为:{}", serviceTaskdiag);
                    log.info("----serviceTaskdiag的值为:{}", serviceTaskdiag);
                    if (StringUtils.isNotEmpty(serviceTaskVO.getIcd10code())) {
                        String[] Icd10codes = serviceTaskVO.getIcd10code().split(",");
                        for (String icd10code : Icd10codes) {
@@ -490,7 +490,7 @@
                        String[] opcodes = serviceTaskVO.getOpcode().split(",");
                        for (String opcode : opcodes) {
                            serviceTaskoper.setOpcode(opcode);
                            log.error("----serviceTaskoper的值为:{}", serviceTaskoper);
                            log.info("----serviceTaskoper的值为:{}", serviceTaskoper);
                            serviceTaskoperService.insertServiceTaskoper(serviceTaskoper);
                        }
                    }
@@ -595,7 +595,7 @@
            }
            if (CollectionUtils.isNotEmpty(serviceSubtaskList)) {
                for (ServiceSubtask serviceSubtask : serviceSubtaskList) {
                    log.error("insertOrUpdateTask需要移除的subId为:{}", serviceSubtask.getId().toString());
                    log.info("insertOrUpdateTask需要移除的subId为:{}", serviceSubtask.getId().toString());
                    serviceSubtaskMapper.deleteServiceSubtaskById(serviceSubtask.getId());
                    redisCache.removeElementFromList("cache-exist", serviceSubtask.getId().toString());
                    redisCache.removeElementFromList("cache-0", serviceSubtask.getId().toString());
@@ -685,7 +685,7 @@
                        serviceTaskdiag2.setIcd10code(icdcode);
                        List<ServiceTaskdiag> serviceTaskdiags = serviceTaskdiagService.selectServiceTaskdiagList(serviceTaskdiag2);
                        serviceTaskdiag.setIcd10code(icdcode);
                        log.error("----serviceTaskdiag更新的值为:{}", serviceTaskdiag);
                        log.info("----serviceTaskdiag更新的值为:{}", serviceTaskdiag);
                        if (CollectionUtils.isNotEmpty(serviceTaskdiags)) {
                            serviceTaskdiag.setId(serviceTaskdiags.get(0).getId());
                            serviceTaskdiagService.updateServiceTaskdiag(serviceTaskdiag);
@@ -719,7 +719,7 @@
                        List<ServiceTaskoper> serviceTaskopers = serviceTaskoperService.selectServiceTaskoperList(serviceTaskoper2);
                        serviceTaskoper.setOpcode(opcode);
                        log.error("----serviceTaskoper的值为:{}", serviceTaskoper);
                        log.info("----serviceTaskoper的值为:{}", serviceTaskoper);
                        if (CollectionUtils.isNotEmpty(serviceTaskopers)) {
                            serviceTaskoper.setId(serviceTaskopers.get(0).getId());
                            serviceTaskoperService.updateServiceTaskoper(serviceTaskoper);
smartor/src/main/java/com/smartor/service/impl/SvyTaskSingleServiceImpl.java
@@ -278,7 +278,7 @@
        serviceSubtask.setBedNo(serviceTaskVO.getBedno());
        serviceSubtask.setDeptname(serviceTaskVO.getDeptname());
        serviceSubtask.setDeptcode(serviceTaskVO.getDeptcode());
        serviceSubtask.setSendstate(1L);
        serviceSubtask.setSendstate(6L);
        serviceSubtask.setCreateTime(new Date());
        serviceSubtask.setLeavehospitaldistrictcode(serviceTaskVO.getDistrictcode());
        //先查询一遍,该taskGuid是否存在
smartor/src/main/resources/mapper/smartor/PatArchiveMapper.xml
@@ -60,6 +60,8 @@
        <result property="carePerson" column="care_person"/>
        <result property="casePersonAge" column="case_person_age"/>
        <result property="guid" column="guid"/>
        <result property="filterDrname" column="filter_drname"/>
        <result property="filterDrcode" column="filter_drcode"/>
    </resultMap>
@@ -119,6 +121,8 @@
        <result property="guid" column="guid"/>
        <result property="leavediagname" column="leavediagname"/>
        <result property="leaveicd10code" column="leaveicd10code"/>
        <result property="filterDrname" column="filter_drname"/>
        <result property="filterDrcode" column="filter_drcode"/>
    </resultMap>
    <sql id="selectPatArchiveVo">
@@ -126,6 +130,8 @@
               notrequired_flag,
               notrequiredreason,
               patientno,
               filter_drname,
               filter_drcode,
               patid_his,
               age_unit,
               age_unit2,
@@ -200,6 +206,8 @@
            <if test="medicareType != null ">and medicare_type = #{medicareType}</if>
            <if test="carePerson != null ">and care_person = #{carePerson}</if>
            <if test="casePersonAge != null ">and case_person_age = #{casePersonAge}</if>
            <if test="filterDrname != null ">and filter_drname = #{filterDrname}</if>
            <if test="filterDrcode != null ">and filter_drcode = #{filterDrcode}</if>
        </where>
    </select>
@@ -233,11 +241,15 @@
        a.income,
        a.medicare_type,
        a.care_person,
        a.filter_drname,
        a.filter_drcode,
        a.case_person_age
        from pat_archive a,pat_archivetag b ,base_tag c
        <where>
            a.del_flag=0 and
            a.id = b.patid and b.tagid = c.tagid
            <if test="filterDrname != null ">and filter_drname = #{filterDrname}</if>
            <if test="filterDrcode != null ">and filter_drcode = #{filterDrcode}</if>
            <if test="name != null  and name != ''">and a.name like concat('%', #{name}, '%')</if>
            <if test="idcardno != null  and idcardno != ''">and idcardno = #{idcardno}</if>
            <if test="telcode != null  and telcode != ''">and telcode = #{telcode}</if>
@@ -303,6 +315,8 @@
            <if test="medicareType != null ">medicare_type,</if>
            <if test="carePerson != null ">care_person,</if>
            <if test="casePersonAge != null ">case_person_age,</if>
            <if test="filterDrname != null ">filter_drname,</if>
            <if test="filterDrcode != null ">filter_drcode,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="patientno != null">#{patientno},</if>
@@ -350,6 +364,8 @@
            <if test="medicareType != null ">#{medicareType},</if>
            <if test="carePerson != null ">#{carePerson},</if>
            <if test="casePersonAge != null ">#{casePersonAge},</if>
            <if test="filterDrname != null ">#{filterDrname},</if>
            <if test="filterDrcode != null ">#{filterDrcode},</if>
        </trim>
    </insert>
@@ -357,14 +373,14 @@
        insert into
        pat_archive(name,viptype,sex,idcardno,birthdate,place_of_residence,age,age2,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,patientno,patid_his,sd_flag,age_unit,age_unit2,notrequired_flag,notrequiredreason,care_facilities,case_path,
        degree_of_education,marital_status,income,medicare_type,care_person,case_person_age)
        degree_of_education,marital_status,income,medicare_type,care_person,case_person_age,filter_drname,filter_drcode)
        values
        <foreach item="item" index="index" collection="list" separator=",">
            (#{item.name},#{item.viptype},#{item.sex},#{item.idcardno},#{item.birthdate},#{item.placeOfResidence},#{item.age},#{item.age2},#{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.patientno},
            #{item.patidHis},#{item.sdFlag},#{item.ageUnit},#{item.ageUnit2},#{item.notrequiredFlag},#{item.notrequiredreason}
            ,#{item.careFacilities},#{item.casePath},#{item.degreeOfEducation},#{item.maritalStatus},#{item.income},#{item.medicareType},#{item.carePerson},#{item.casePersonAge})
            ,#{item.careFacilities},#{item.casePath},#{item.degreeOfEducation},#{item.maritalStatus},#{item.income},#{item.medicareType},#{item.carePerson},#{item.casePersonAge},#{item.filterDrname},#{item.filterDrcode})
        </foreach>
    </insert>
@@ -411,6 +427,8 @@
            <if test="carePerson != null ">care_person = #{carePerson},</if>
            <if test="casePersonAge != null ">case_person_age = #{casePersonAge},</if>
            <if test="guid != null ">guid = #{guid},</if>
            <if test="filterDrname != null ">filter_drname = #{filterDrname},</if>
            <if test="filterDrcode != null ">filter_drcode = #{filterDrcode},</if>
        </trim>
        where id = #{id}
    </update>
@@ -469,6 +487,8 @@
        a.upload_time,
        a.viptype,
        a.pattype,
        a.filter_drname,
        a.filter_drcode,
        b.tagname AS tag,
        b.tagid AS tagid
        FROM
@@ -536,6 +556,8 @@
        a.isupload,
        a.upload_time,
        a.pattype,
        a.filter_drname,
        a.filter_drcode,
        d.bed_no,
        d.starttime,
        d.endtime,
@@ -671,6 +693,8 @@
        a.create_time,
        a.isupload,
        a.upload_time,
        a.filter_drname,
        a.filter_drcode,
        t.tagname,
        a.pattype
        from pat_med_outhosp d JOIN pat_archive a ON a.id = d.patid
@@ -760,6 +784,8 @@
        a.create_time,
        a.isupload,
        a.upload_time,
        a.filter_drname,
        a.filter_drcode,
        t.tagname,
        a.pattype
        from pat_med_physical d JOIN pat_archive a ON a.id = d.patid
@@ -810,7 +836,7 @@
    <select id="selectPatArchiveInfoByInhospQC" parameterType="com.smartor.domain.PatArchiveReq"
            resultMap="PatArchiveOthreInfoResult">
        select * from (
        select
        a.idcardno,
        a.id,
@@ -854,6 +880,8 @@
        a.isupload,
        a.upload_time,
        a.pattype,
        a.filter_drname,
        a.filter_drcode,
        d.bed_no,
        d.starttime,
        d.endtime,
@@ -916,6 +944,21 @@
                    #{leaveldeptcode}
                </foreach>
            </if>
            <if test="hospitaldistrictcodes != null and hospitaldistrictcodes.size()>0">
                AND d.hospitaldistrictcode IN
                <foreach collection="hospitaldistrictcodes" item="hospitaldistrictcode" open="(" separator=","
                         close=")">
                    #{hospitaldistrictcode}
                </foreach>
            </if>
            <if test="deptcodes != null and deptcodes.size() > 0">
                AND d.deptcode IN
                <foreach collection="deptcodes" item="deptcode" open="(" separator=","
                         close=")">
                    #{deptcode}
                </foreach>
            </if>
            <if test="pids != null">
                AND a.id NOT IN
                <foreach collection="pids" item="pid" open="(" separator="," close=")">
@@ -926,7 +969,7 @@
                AND NOT exists ( SELECT 1 FROM pat_filterlist f where d.patid=f.patid)
            </if>
        </where>
        order by a.id,a.update_time desc ) order by endtime desc
        order by a.id,a.update_time desc ) as tmp order by endtime desc
    </select>
    <select id="selectPatArchiveInfoByOuthospQC" parameterType="com.smartor.domain.PatArchiveReq"
@@ -953,8 +996,8 @@
        a.place_of_residence,
        a.birthplace,
        a.birthdate,
--         a.icd10code as leaveicd10code,
--         a.diagname as leavediagname,
        -- a.icd10code as leaveicd10code,
        -- a.diagname as leavediagname,
        a.age,
        a.age2,
        a.viptype,
@@ -973,6 +1016,8 @@
        a.create_time,
        a.isupload,
        a.upload_time,
        a.filter_drname,
        a.filter_drcode,
        t.tagname,
        a.pattype
        from pat_med_outhosp d JOIN pat_archive a ON a.id = d.patid
@@ -1046,6 +1091,8 @@
        a.viptype,
        a.birthdate,
        a.age,
        a.filter_drname,
        a.filter_drcode,
        a.age2,
        a.sourcefrom,
        a.archivetime,
smartor/src/main/resources/mapper/smartor/PatSatisfactionMapper.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,306 @@
<?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.PatSatisfactionMapper">
    <resultMap type="com.smartor.domain.PatSatisfaction" id="PatSatisfactionResult">
        <result property="id" column="id"/>
        <result property="patName" column="pat_name"/>
        <result property="patCode" column="pat_code"/>
        <result property="phone" column="phone"/>
        <result property="hospitaldistrictname" column="hospitaldistrictname"/>
        <result property="hospitaldistrictcode" column="hospitaldistrictcode"/>
        <result property="deptname" column="deptname"/>
        <result property="deptcode" column="deptcode"/>
        <result property="authenticity" column="authenticity"/>
        <result property="weekFinish" column="week_finish"/>
        <result property="standard" column="standard"/>
        <result property="timeliness" column="timeliness"/>
        <result property="library" column="library"/>
        <result property="environment" column="environment"/>
        <result property="doctorSatisfaction" column="doctor_satisfaction"/>
        <result property="nurseSatisfaction" column="nurse_satisfaction"/>
        <result property="updateTime" column="update_time"/>
        <result property="createTime" column="create_time"/>
        <result property="updateBy" column="update_by"/>
        <result property="createBy" column="create_by"/>
        <result property="delFlag" column="del_flag"/>
        <result property="orgid" column="orgid"/>
    </resultMap>
    <sql id="selectPatSatisfactionVo">
        select id,
               orgid,
               pat_name,
               pat_code,
               phone,
               hospitaldistrictname,
               hospitaldistrictcode,
               deptname,
               deptcode,
               authenticity,
               week_finish,
               standard,
               timeliness,
               library,
               environment,
               doctor_satisfaction,
               nurse_satisfaction,
               update_time,
               create_time,
               update_by,
               create_by,
               del_flag
        from pat_satisfaction
    </sql>
    <select id="selectPatSatisfactionList" parameterType="com.smartor.domain.PatSatisfaction"
            resultMap="PatSatisfactionResult">
        <include refid="selectPatSatisfactionVo"/>
        <where>
            del_flag=0
            <if test="patName != null  and patName != ''">
                and pat_name like concat('%', #{patName}, '%')
            </if>
            <if test="patCode != null  and patCode != ''">
                and pat_code = #{patCode}
            </if>
            <if test="phone != null  and phone != ''">
                and phone = #{phone}
            </if>
            <if test="hospitaldistrictname != null  and hospitaldistrictname != ''">
                and hospitaldistrictname like concat('%', #{hospitaldistrictname}, '%')
            </if>
            <if test="hospitaldistrictcode != null  and hospitaldistrictcode != ''">
                and hospitaldistrictcode = #{hospitaldistrictcode}
            </if>
            <if test="deptname != null  and deptname != ''">
                and deptname like concat('%', #{deptname}, '%')
            </if>
            <if test="deptcode != null  and deptcode != ''">
                and deptcode = #{deptcode}
            </if>
            <if test="authenticity != null  and authenticity != ''">
                and authenticity = #{authenticity}
            </if>
            <if test="weekFinish != null  and weekFinish != ''">
                and week_finish = #{weekFinish}
            </if>
            <if test="standard != null  and standard != ''">
                and standard = #{standard}
            </if>
            <if test="timeliness != null  and timeliness != ''">
                and timeliness = #{timeliness}
            </if>
            <if test="library != null  and library != ''">
                and library = #{library}
            </if>
            <if test="environment != null  and environment != ''">
                and environment = #{environment}
            </if>
            <if test="doctorSatisfaction != null  and doctorSatisfaction != ''">
                and doctor_satisfaction = #{doctorSatisfaction}
            </if>
            <if test="nurseSatisfaction != null  and nurseSatisfaction != ''">
                and nurse_satisfaction = #{nurseSatisfaction}
            </if>
            <if test="orgid != null  and orgid != ''">
                and orgid = #{orgid}
            </if>
        </where>
    </select>
    <select id="selectPatSatisfactionById" parameterType="Long"
            resultMap="PatSatisfactionResult">
        <include refid="selectPatSatisfactionVo"/>
        where id = #{id}
    </select>
    <insert id="insertPatSatisfaction" parameterType="com.smartor.domain.PatSatisfaction">
        insert into pat_satisfaction
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">id,
            </if>
            <if test="patName != null">pat_name,
            </if>
            <if test="patCode != null">pat_code,
            </if>
            <if test="phone != null">phone,
            </if>
            <if test="hospitaldistrictname != null">hospitaldistrictname,
            </if>
            <if test="hospitaldistrictcode != null">hospitaldistrictcode,
            </if>
            <if test="deptname != null">deptname,
            </if>
            <if test="deptcode != null">deptcode,
            </if>
            <if test="authenticity != null">authenticity,
            </if>
            <if test="weekFinish != null">week_finish,
            </if>
            <if test="standard != null">standard,
            </if>
            <if test="timeliness != null">timeliness,
            </if>
            <if test="library != null">library,
            </if>
            <if test="environment != null">environment,
            </if>
            <if test="doctorSatisfaction != null">doctor_satisfaction,
            </if>
            <if test="nurseSatisfaction != null">nurse_satisfaction,
            </if>
            <if test="updateTime != null">update_time,
            </if>
            <if test="createTime != null">create_time,
            </if>
            <if test="updateBy != null">update_by,
            </if>
            <if test="createBy != null">create_by,
            </if>
            <if test="delFlag != null">del_flag,
            </if>
            <if test="orgid != null">orgid,
            </if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id},
            </if>
            <if test="patName != null">#{patName},
            </if>
            <if test="patCode != null">#{patCode},
            </if>
            <if test="phone != null">#{phone},
            </if>
            <if test="hospitaldistrictname != null">#{hospitaldistrictname},
            </if>
            <if test="hospitaldistrictcode != null">#{hospitaldistrictcode},
            </if>
            <if test="deptname != null">#{deptname},
            </if>
            <if test="deptcode != null">#{deptcode},
            </if>
            <if test="authenticity != null">#{authenticity},
            </if>
            <if test="weekFinish != null">#{weekFinish},
            </if>
            <if test="standard != null">#{standard},
            </if>
            <if test="timeliness != null">#{timeliness},
            </if>
            <if test="library != null">#{library},
            </if>
            <if test="environment != null">#{environment},
            </if>
            <if test="doctorSatisfaction != null">#{doctorSatisfaction},
            </if>
            <if test="nurseSatisfaction != null">#{nurseSatisfaction},
            </if>
            <if test="updateTime != null">#{updateTime},
            </if>
            <if test="createTime != null">#{createTime},
            </if>
            <if test="updateBy != null">#{updateBy},
            </if>
            <if test="createBy != null">#{createBy},
            </if>
            <if test="delFlag != null">#{delFlag},
            </if>
            <if test="orgid != null">#{orgid},
            </if>
        </trim>
    </insert>
    <update id="updatePatSatisfaction" parameterType="com.smartor.domain.PatSatisfaction">
        update pat_satisfaction
        <trim prefix="SET" suffixOverrides=",">
            <if test="patName != null">pat_name =
                #{patName},
            </if>
            <if test="patCode != null">pat_code =
                #{patCode},
            </if>
            <if test="phone != null">phone =
                #{phone},
            </if>
            <if test="hospitaldistrictname != null">hospitaldistrictname =
                #{hospitaldistrictname},
            </if>
            <if test="hospitaldistrictcode != null">hospitaldistrictcode =
                #{hospitaldistrictcode},
            </if>
            <if test="deptname != null">deptname =
                #{deptname},
            </if>
            <if test="deptcode != null">deptcode =
                #{deptcode},
            </if>
            <if test="authenticity != null">authenticity =
                #{authenticity},
            </if>
            <if test="weekFinish != null">week_finish =
                #{weekFinish},
            </if>
            <if test="standard != null">standard =
                #{standard},
            </if>
            <if test="timeliness != null">timeliness =
                #{timeliness},
            </if>
            <if test="library != null">library =
                #{library},
            </if>
            <if test="environment != null">environment =
                #{environment},
            </if>
            <if test="doctorSatisfaction != null">doctor_satisfaction =
                #{doctorSatisfaction},
            </if>
            <if test="nurseSatisfaction != null">nurse_satisfaction =
                #{nurseSatisfaction},
            </if>
            <if test="updateTime != null">update_time =
                #{updateTime},
            </if>
            <if test="createTime != null">create_time =
                #{createTime},
            </if>
            <if test="updateBy != null">update_by =
                #{updateBy},
            </if>
            <if test="createBy != null">create_by =
                #{createBy},
            </if>
            <if test="delFlag != null">del_flag =
                #{delFlag},
            </if>
            <if test="orgid != null">orgid =
                #{orgid},
            </if>
        </trim>
        where id = #{id}
    </update>
    <update id="deletePatSatisfactionById" parameterType="Long">
        update pat_satisfaction
        <trim prefix="SET" suffixOverrides=",">
            del_flag =1
        </trim>
        where id = #{id}
    </update>
    <update id="deletePatSatisfactionByIds" parameterType="String">
        update pat_satisfaction
        <trim prefix="SET" suffixOverrides=",">
            del_flag =1
        </trim>
        where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </update>
</mapper>