From 3884228f0be8cf58089bf51b71f152ac694f1500 Mon Sep 17 00:00:00 2001 From: haown <454902499@qq.com> Date: Fri, 2 Aug 2024 13:45:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=82=A3=E8=80=85=E5=BA=B7=E5=A4=8D=E8=AE=A1?= =?UTF-8?q?=E5=88=92=E5=8F=8A=E8=AE=B0=E5=BD=95=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/constant/TaskStatusConstant.java | 34 ++++ .../SignPatientManageRouteController.java | 10 + .../SignPatientManageRouteNodeController.java | 18 +- .../SignPatientManageRouteNodeMapper.java | 11 +- .../ISignPatientManageRouteService.java | 10 + .../SignPatientManageRouteServiceImpl.java | 63 ++++-- .../ISignPatientManageRouteNodeService.java | 7 +- ...SignPatientManageRouteNodeServiceImpl.java | 139 ++++++++++++-- .../SignPatientTaskVo.java | 179 ++++++++++++++++++ .../SignPatientRecordSelectVo.java | 32 ++++ .../SignPatientManageRouteNodeMapper.xml | 23 ++- 11 files changed, 482 insertions(+), 44 deletions(-) create mode 100644 postdischarge-common/src/main/java/com/xinelu/common/constant/TaskStatusConstant.java create mode 100644 postdischarge-manage/src/main/java/com/xinelu/manage/vo/signpatientmanageroutenode/SignPatientTaskVo.java create mode 100644 postdischarge-manage/src/main/java/com/xinelu/manage/vo/signpatientrecord/SignPatientRecordSelectVo.java diff --git a/postdischarge-common/src/main/java/com/xinelu/common/constant/TaskStatusConstant.java b/postdischarge-common/src/main/java/com/xinelu/common/constant/TaskStatusConstant.java new file mode 100644 index 00000000..5f37d157 --- /dev/null +++ b/postdischarge-common/src/main/java/com/xinelu/common/constant/TaskStatusConstant.java @@ -0,0 +1,34 @@ +package com.xinelu.common.constant; + +/** + * @description: 任务完成情况常量 + * @author: haown + * @create: 2024-08-01 14:24 + **/ +public class TaskStatusConstant { + + /** + * 电话未接通 + */ + public static final String NOT_CONNECTED = "NOT_CONNECTED"; + + /** + * 电话已接通 + */ + public static final String CONNECTED = "CONNECTED"; + + /** + * 任务已超期 + */ + public static final String EXPIRED = "EXPIRED"; + + /** + * 消息未读 + */ + public static final String UNREAD = "UNREAD"; + + /** + * 消息已读 + */ + public static final String READ = "READ"; +} diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/controller/signpatientmanageroute/SignPatientManageRouteController.java b/postdischarge-manage/src/main/java/com/xinelu/manage/controller/signpatientmanageroute/SignPatientManageRouteController.java index 4750ab03..b4ba0545 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/controller/signpatientmanageroute/SignPatientManageRouteController.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/controller/signpatientmanageroute/SignPatientManageRouteController.java @@ -16,6 +16,7 @@ import com.xinelu.manage.service.signpatientmanageroute.ISignPatientManageRouteS import com.xinelu.manage.vo.manualfollowup.ManualFollowUpVO; import com.xinelu.manage.vo.signpatientmanageroute.SignPatientManageRouteVO; import com.xinelu.manage.vo.signpatientmanageroutenode.SignPatientManageNodeAuditVo; +import com.xinelu.manage.vo.signpatientrecord.SignPatientRecordSelectVo; import com.xinelu.manage.vo.specialdiseaseroute.SpecialDiseaseRouteAuditVo; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -158,4 +159,13 @@ public class SignPatientManageRouteController extends BaseController { public R> getRouteNodeInfo(@PathVariable("signRecordId") Long signRecordId) { return R.ok(signPatientManageRouteService.getRouteNodeInfo(signRecordId)); } + + /** + * 患者详情--康复计划及记录,右上角签约记录下拉框 + */ + @ApiOperation("患者详情--康复计划及记录,右上角签约记录下拉框") + @GetMapping("/getRecordList/{patientId}") + public R> getRecordList(@PathVariable("patientId") Long patientId) { + return R.ok(signPatientManageRouteService.getRecordList(patientId)); + } } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/controller/signpatientmanageroutenode/SignPatientManageRouteNodeController.java b/postdischarge-manage/src/main/java/com/xinelu/manage/controller/signpatientmanageroutenode/SignPatientManageRouteNodeController.java index 8708c160..7144fe34 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/controller/signpatientmanageroutenode/SignPatientManageRouteNodeController.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/controller/signpatientmanageroutenode/SignPatientManageRouteNodeController.java @@ -13,6 +13,7 @@ import com.xinelu.manage.vo.signpatientmanageroutenode.PatientManageNodeInfoVo; import com.xinelu.manage.vo.signpatientmanageroutenode.PatientManageNodeListVo; import com.xinelu.manage.vo.signpatientmanageroutenode.PatientTaskVo; import com.xinelu.manage.vo.signpatientmanageroutenode.SignPatientManageRouteNodeVo; +import com.xinelu.manage.vo.signpatientmanageroutenode.SignPatientTaskVo; import com.xinelu.manage.vo.specialdiseasenode.PatientSpecialDiseaseNodeVo; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -76,14 +77,17 @@ public class SignPatientManageRouteNodeController extends BaseController { return R.ok(signNodeService.getNodeListByPatient(patientTaskDto)); } - /** - * 患者详情--查询患者任务路径及节点列表 - */ - @ApiOperation("患者详情--查询患者任务路径及节点列表") - @GetMapping("/getNodeList") - public R> getNodeList(PatientTaskDto patientTaskDto) { - return R.ok(signNodeService.getNodeList(patientTaskDto)); + * @description 患者详情--康复计划及记录 + * @param signPatientRecordId 签约记录表主键 + * @return 患者管理任务路径节点 + * @Author haown + * @Date 2024-08-01 15:23 + */ + @ApiOperation("患者详情--康复计划及记录") + @GetMapping("/getNodeList/{signPatientRecordId}") + public R> getNodeList(@PathVariable("signPatientRecordId") Long signPatientRecordId) { + return R.ok(signNodeService.getNodeList(signPatientRecordId)); } /** diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/signpatientmanageroutenode/SignPatientManageRouteNodeMapper.java b/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/signpatientmanageroutenode/SignPatientManageRouteNodeMapper.java index d7c0d26c..b414f74c 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/signpatientmanageroutenode/SignPatientManageRouteNodeMapper.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/signpatientmanageroutenode/SignPatientManageRouteNodeMapper.java @@ -6,11 +6,11 @@ import com.xinelu.manage.dto.signpatientmanageroutenode.SignPatientManageRouteNo import com.xinelu.manage.vo.signpatientmanageroutenode.PatientManageNodeListVo; import com.xinelu.manage.vo.signpatientmanageroutenode.PatientTaskVo; import com.xinelu.manage.vo.signpatientmanageroutenode.SignPatientManageNodeAuditVo; +import com.xinelu.manage.vo.signpatientmanageroutenode.SignPatientTaskVo; import com.xinelu.manage.vo.signpatientmanageroutenode.TextMessage; import com.xinelu.manage.vo.specialdiseasenode.SpecialDiseaseNodeAuditVo; -import org.apache.ibatis.annotations.Param; - import java.util.List; +import org.apache.ibatis.annotations.Param; /** * 签约患者管理任务路径节点Mapper接口 @@ -112,6 +112,13 @@ public interface SignPatientManageRouteNodeMapper { */ List selectAuditNodeInfo(@Param("manageRouteIds") List manageRouteIds); + /** + * 患者详情,查询任务节点详情 + * @param manageRouteIds 路径列表 + * @return 节点详细信息列表 + */ + List selectNodeInfoByManageIds(@Param("manageRouteIds") List manageRouteIds); + /** * 根据路径主键列表查询节点列表 * @param manageRouteIds 路径主键列表 diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientmanageroute/ISignPatientManageRouteService.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientmanageroute/ISignPatientManageRouteService.java index fec56c73..c648c800 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientmanageroute/ISignPatientManageRouteService.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientmanageroute/ISignPatientManageRouteService.java @@ -8,6 +8,7 @@ import com.xinelu.manage.dto.patientquestionsubmitresult.PatientQuestionSubmitRe import com.xinelu.manage.vo.manualfollowup.ManualFollowUpVO; import com.xinelu.manage.vo.signpatientmanageroute.SignPatientManageRouteVO; import com.xinelu.manage.vo.signpatientmanageroutenode.SignPatientManageNodeAuditVo; +import com.xinelu.manage.vo.signpatientrecord.SignPatientRecordSelectVo; import com.xinelu.manage.vo.specialdiseaseroute.SpecialDiseaseRouteAuditVo; import java.util.List; @@ -105,4 +106,13 @@ public interface ISignPatientManageRouteService { * @return 节点详细信息列表 */ List getRouteNodeInfo(Long signRecordId); + + /** + * @description 患者详情--康复计划及记录,右上角签约记录下拉框 + * @Param patientId 患者主键 + * @return 签约记录列表 + * @Author haown + * @Date 2024-08-01 14:48 + */ + List getRecordList(Long patientId); } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientmanageroute/impl/SignPatientManageRouteServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientmanageroute/impl/SignPatientManageRouteServiceImpl.java index 25202d75..8f99920e 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientmanageroute/impl/SignPatientManageRouteServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientmanageroute/impl/SignPatientManageRouteServiceImpl.java @@ -15,7 +15,18 @@ import com.xinelu.common.constant.TaskCreateTypeConstant; import com.xinelu.common.constant.TaskNodeTypeConstants; import com.xinelu.common.constant.TemplateTypeConstants; import com.xinelu.common.core.domain.AjaxResult; -import com.xinelu.common.enums.*; +import com.xinelu.common.enums.ErrorStatusEnum; +import com.xinelu.common.enums.NodeExecuteResultStatusEnum; +import com.xinelu.common.enums.NodeExecuteStatusEnum; +import com.xinelu.common.enums.PhoneConnectStatusEnum; +import com.xinelu.common.enums.PhoneMessageRemindEnum; +import com.xinelu.common.enums.PhoneRedialTimesEnum; +import com.xinelu.common.enums.RouteNodeNameEnum; +import com.xinelu.common.enums.ShortMessageTypeEnum; +import com.xinelu.common.enums.SmsErrorCodeEnum; +import com.xinelu.common.enums.TaskContentEnum; +import com.xinelu.common.enums.TaskCreateTypeEnum; +import com.xinelu.common.enums.TaskNodeTypeEnum; import com.xinelu.common.exception.ServiceException; import com.xinelu.common.utils.AgeUtil; import com.xinelu.common.utils.SecurityUtils; @@ -63,11 +74,23 @@ import com.xinelu.manage.vo.propagandainfo.PropagandaMaterialsVo; import com.xinelu.manage.vo.questionInfo.QuestionVO; import com.xinelu.manage.vo.signpatientmanageroute.SignPatientManageRouteVO; import com.xinelu.manage.vo.signpatientmanageroutenode.SignPatientManageNodeAuditVo; +import com.xinelu.manage.vo.signpatientrecord.SignPatientRecordSelectVo; +import com.xinelu.manage.vo.signpatientrecord.SignPatientRecordVo; import com.xinelu.manage.vo.signroutetriggercondition.SignRouteTriggerConditionVO; import com.xinelu.manage.vo.specialdiseasenode.RouteTaskAuditVo; import com.xinelu.manage.vo.specialdiseasenode.SpecialDiseaseNodeAuditVo; import com.xinelu.manage.vo.specialdiseaseroute.SpecialDiseaseChildRouteAuditVo; import com.xinelu.manage.vo.specialdiseaseroute.SpecialDiseaseRouteAuditVo; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.stream.Collectors; +import javax.annotation.Resource; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.ObjectUtils; @@ -75,12 +98,6 @@ import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import javax.annotation.Resource; -import java.time.LocalDate; -import java.time.LocalDateTime; -import java.util.*; -import java.util.stream.Collectors; - /** * 签约患者管理任务路径Service业务层处理 @@ -710,10 +727,6 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout List createRouteList = signPatientManageRouteMapper.selectSignPatientManageRouteList(manageRouteQuery); if (CollectionUtils.isNotEmpty(createRouteList)) { List manageRouteIds = createRouteList.stream().map(SignPatientManageRoute::getId).collect(Collectors.toList()); - //for (Long routeId : manageRouteIds) { - // boolean satisfy = signPatientManageRouteNodeService.getSignTriggerConditon(routeId, signPatientRecord.getPatientId()); - // routeSatisfyMap.put(routeId, satisfy); - //} List manageNodeList = signPatientManageRouteNodeMapper.selectAuditNodeInfo(manageRouteIds); // 根据node去替换模板信息 manageNodeList.forEach(manageNode -> { @@ -816,7 +829,33 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout return manageNodeAuditList; } - /** + /** + * @description 患者详情--康复计划及记录,右上角签约记录下拉框 + * @Param patientId 患者主键 + * @return 签约记录列表 + * @Author haown + * @Date 2024-08-01 14:48 + */ + @Override public List getRecordList(Long patientId) { + List retList = new ArrayList<>(); + // 查询签约记录 + List signRecordList = signPatientRecordMapper.getByPatient(patientId); + signRecordList.forEach(signRecord -> { + SignPatientManageRoute manageRouteQuery = new SignPatientManageRoute(); + manageRouteQuery.setSignPatientRecordId(signRecord.getId()); + manageRouteQuery.setTaskCreateType(TaskCreateTypeConstant.MANUAL_MATCHE); + List manageRouteList = signPatientManageRouteMapper.selectSignPatientManageRouteList(manageRouteQuery); + if (CollectionUtils.isNotEmpty(manageRouteList)) { + retList.add(SignPatientRecordSelectVo.builder() + .id(signRecord.getId()) + .signRouteName(signRecord.getSignTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")) + "|" + manageRouteList.get(0).getRouteName()) + .build()); + } + }); + return retList; + } + + /** * 新增患者管理任务执行记录 */ private Long insertPatientTaskExecuteRecord(PatientQuestionSubmitResultDTO dto, String routeHandlePerson, LocalDateTime time) { diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientmanageroutenode/ISignPatientManageRouteNodeService.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientmanageroutenode/ISignPatientManageRouteNodeService.java index a37165a6..711ad1fa 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientmanageroutenode/ISignPatientManageRouteNodeService.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientmanageroutenode/ISignPatientManageRouteNodeService.java @@ -14,6 +14,7 @@ import com.xinelu.manage.vo.signpatientmanageroutenode.PatientManageNodeListVo; import com.xinelu.manage.vo.signpatientmanageroutenode.PatientTaskVo; import com.xinelu.manage.vo.signpatientmanageroutenode.SignPatientManageNodeAuditVo; import com.xinelu.manage.vo.signpatientmanageroutenode.SignPatientManageRouteNodeVo; +import com.xinelu.manage.vo.signpatientmanageroutenode.SignPatientTaskVo; import com.xinelu.manage.vo.specialdiseasenode.PatientSpecialDiseaseNodeVo; import java.time.LocalDateTime; import java.time.LocalTime; @@ -37,10 +38,12 @@ public interface ISignPatientManageRouteNodeService { /** * 查询患者管理路径节点 - * @param patientTaskDto 任务查询传输对象 + * @param signPatientRecordId 签约记录主键 * @return 患者管理任务路径节点 + * @Author haown + * @Date 2024-08-01 15:23 */ - List getNodeList(PatientTaskDto patientTaskDto); + List getNodeList(Long signPatientRecordId); /** * 根据节点类型查询节点列表详情 diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientmanageroutenode/impl/SignPatientManageRouteNodeServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientmanageroutenode/impl/SignPatientManageRouteNodeServiceImpl.java index 0f0eede8..b1122cda 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientmanageroutenode/impl/SignPatientManageRouteNodeServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientmanageroutenode/impl/SignPatientManageRouteNodeServiceImpl.java @@ -6,12 +6,16 @@ import com.xinelu.common.constant.ApplyRangeContant; import com.xinelu.common.constant.RouteNodeNameConstants; import com.xinelu.common.constant.TaskCreateTypeConstant; import com.xinelu.common.constant.TaskNodeTypeConstants; +import com.xinelu.common.constant.TaskStatusConstant; import com.xinelu.common.constant.TemplateTypeConstants; import com.xinelu.common.constant.TriggerConditionOperatorConstants; import com.xinelu.common.constant.TriggerLogicConstants; import com.xinelu.common.constant.VisitMethodConstants; +import com.xinelu.common.enums.MessageStatusEnum; +import com.xinelu.common.enums.NodeExecuteResultStatusEnum; import com.xinelu.common.enums.NodeExecuteStatusEnum; import com.xinelu.common.enums.RouteCheckStatusEnum; +import com.xinelu.common.enums.RouteNodeNameEnum; import com.xinelu.common.exception.ServiceException; import com.xinelu.common.utils.SecurityUtils; import com.xinelu.common.utils.StringUtils; @@ -19,7 +23,9 @@ import com.xinelu.common.utils.bean.BeanUtils; import com.xinelu.manage.domain.patientinfo.PatientAllInfoViewUppercase; import com.xinelu.manage.domain.patientinfo.PatientInfo; import com.xinelu.manage.domain.patientnodeparamscurrent.PatientNodeParamsCurrent; +import com.xinelu.manage.domain.patienttaskexecuterecord.PatientTaskExecuteRecord; import com.xinelu.manage.domain.patientvisitrecord.PatientVisitRecord; +import com.xinelu.manage.domain.propagandainfo.PropagandaInfo; import com.xinelu.manage.domain.scriptInfo.ScriptInfo; import com.xinelu.manage.domain.signpatientmanageroute.SignPatientManageRoute; import com.xinelu.manage.domain.signpatientmanageroutenode.SignPatientManageRouteNode; @@ -38,6 +44,8 @@ import com.xinelu.manage.dto.signpatientmanageroutenode.SignPatientManageRouteNo import com.xinelu.manage.mapper.labelfieldcontent.LabelFieldContentMapper; import com.xinelu.manage.mapper.patientinfo.PatientAllInfoViewMapper; import com.xinelu.manage.mapper.patientinfo.PatientInfoMapper; +import com.xinelu.manage.mapper.patientquestionsubmitresult.PatientQuestionSubmitResultMapper; +import com.xinelu.manage.mapper.patienttaskexecuterecord.PatientTaskExecuteRecordMapper; import com.xinelu.manage.mapper.patientvisitrecord.PatientVisitRecordMapper; import com.xinelu.manage.mapper.scriptInfo.ScriptInfoMapper; import com.xinelu.manage.mapper.signpatientmanageroute.SignPatientManageRouteMapper; @@ -54,6 +62,7 @@ import com.xinelu.manage.service.questioninfo.IQuestionInfoService; import com.xinelu.manage.service.signpatientmanageroutenode.ISignPatientManageRouteNodeService; import com.xinelu.manage.service.specialdiseaseroute.ISpecialDiseaseRouteService; import com.xinelu.manage.vo.labelfieldcontent.LabelFieldInfoContentVo; +import com.xinelu.manage.vo.patientquestionsubmitresult.PatientQuestionSubmitResultVO; import com.xinelu.manage.vo.propagandainfo.PropagandaMaterialsVo; import com.xinelu.manage.vo.questionInfo.QuestionVO; import com.xinelu.manage.vo.signpatientmanageroutenode.AppletRouteNodeListVo; @@ -63,6 +72,7 @@ import com.xinelu.manage.vo.signpatientmanageroutenode.PatientTaskVo; import com.xinelu.manage.vo.signpatientmanageroutenode.SignPatientManageNodeAuditVo; import com.xinelu.manage.vo.signpatientmanageroutenode.SignPatientManageRouteNodeInfoVo; import com.xinelu.manage.vo.signpatientmanageroutenode.SignPatientManageRouteNodeVo; +import com.xinelu.manage.vo.signpatientmanageroutenode.SignPatientTaskVo; import com.xinelu.manage.vo.specialdiseasenode.PatientSpecialDiseaseNodeVo; import com.xinelu.manage.vo.specialdiseasenode.SpecialDiseaseNodeVO; import com.xinelu.manage.vo.specialdiseaseroute.SpecialDiseaseRouteVO; @@ -132,6 +142,10 @@ public class SignPatientManageRouteNodeServiceImpl implements ISignPatientManage private SpecialDiseaseRouteMapper specialDiseaseRouteMapper; @Resource private SignRouteTriggerConditionMapper signRouteTriggerConditionMapper; + @Resource + private PatientQuestionSubmitResultMapper patientQuestionSubmitResultMapper; + @Resource + private PatientTaskExecuteRecordMapper patientTaskExecuteRecordMapper; /** * 查询签约患者管理任务路径节点 @@ -166,16 +180,112 @@ public class SignPatientManageRouteNodeServiceImpl implements ISignPatientManage return retVo; } - @Override public List getNodeList(PatientTaskDto patientTaskDto) { - if (patientTaskDto.getPatientId() == null) { - throw new ServiceException("患者信息有误"); + /** + * 查询患者管理路径节点 + * @param signPatientRecordId 签约记录主键 + * @return 患者管理任务路径节点 + * @Author haown + * @Date 2024-08-01 15:23 + */ + @Override public List getNodeList(Long signPatientRecordId) { + List retList = new ArrayList<>(); + SignPatientRecord signPatientRecord = signPatientRecordMapper.selectByPrimaryKey(signPatientRecordId); + if (ObjectUtils.isEmpty(signPatientRecord)) { + throw new ServiceException("数据有误,请联系管理员!"); } - PatientInfo patientInfo = patientInfoMapper.selectPatientInfoById(patientTaskDto.getPatientId()); - if (ObjectUtils.isEmpty(patientInfo)) { - throw new ServiceException("患者信息有误!"); + PatientVisitRecord patientVisitRecord = patientVisitRecordMapper.selectPatientVisitRecordById(signPatientRecord.getPatientVisitRecordId()); + // 根据签约记录主键查询患者任务列表 + SignPatientManageRoute manageRouteQuery = new SignPatientManageRoute(); + manageRouteQuery.setSignPatientRecordId(signPatientRecordId); + List manageRouteList = signRouteMapper.selectSignPatientManageRouteList(manageRouteQuery); + if (CollectionUtils.isNotEmpty(manageRouteList)) { + List manageRouteIds = manageRouteList.stream().map(SignPatientManageRoute::getId).collect(Collectors.toList()); + List manageNodeList = signPatientManageRouteNodeMapper.selectNodeInfoByManageIds(manageRouteIds); + // 组装数据 + List finalRetList = new ArrayList<>(); + manageNodeList.forEach(manageNode -> { + manageNode.setTaskCreateType(ObjectUtils.isEmpty(manageNode.getRouteNodeId()) ? TaskCreateTypeConstant.MANUAL_CREATE : TaskCreateTypeConstant.MANUAL_MATCHE); + manageNode.setRouteNodeNameCN(RouteNodeNameEnum.getNameByInfo(manageNode.getRouteNodeName()).getName()); + manageNode.setExecuteDateTime(getExecuteTime(manageNode.getExecuteTime(), manageNode.getRouteNodeName(), manageNode.getRouteNodeDay(), patientVisitRecord)); + manageNode.setTaskTypeName(StringUtils.isEmpty(manageNode.getTaskTypeName()) ? manageNode.getTaskNodeTypeName() : manageNode.getTaskTypeName()); + // 判断电话拨通情况、任务超时、已读、未读 + if (StringUtils.equals(NodeExecuteResultStatusEnum.FAILURE.getInfo(), manageNode.getPhoneNodeExecuteResultStatus())) { + manageNode.setTaskStatus(TaskStatusConstant.NOT_CONNECTED); + } else if (StringUtils.equals(NodeExecuteResultStatusEnum.SUCCESS.getInfo(), manageNode.getPhoneNodeExecuteResultStatus())) { + manageNode.setTaskStatus(TaskStatusConstant.CONNECTED); + } else if (StringUtils.equals(NodeExecuteResultStatusEnum.EXPIRED.getInfo(), manageNode.getPhoneNodeExecuteResultStatus())) { + manageNode.setTaskStatus(TaskStatusConstant.EXPIRED); + } else { + // 判断消息已读未读 + if (ObjectUtils.isEmpty(manageNode.getNodeFinishDate()) || StringUtils.isBlank(manageNode.getMessageStatus()) || StringUtils.equals(MessageStatusEnum.UNREAD.getInfo(), manageNode.getMessageStatus())) { + manageNode.setTaskStatus(TaskStatusConstant.UNREAD); + } else { + manageNode.setTaskStatus(TaskStatusConstant.READ); + } + } + + JSONObject templateDetail = new JSONObject(); + if (StringUtils.isNotBlank(manageNode.getTaskNodeType())) { + switch (manageNode.getTaskNodeType()) { + // 电话外呼 + case TaskNodeTypeConstants.PHONE_OUTBOUND: + manageNode.setTaskName(manageNode.getPhoneTemplateName()); + break; + // 问卷,查询问卷详情,已作答的问卷展示作答详情,未作答显示问卷详情 + case TaskNodeTypeConstants.QUESTIONNAIRE_SCALE: + if (manageNode.getQuestionInfoId() != null) { + if (ObjectUtils.isEmpty(manageNode.getNodeFinishDate())) { + QuestionVO questionVO = questionInfoService.selectQuestionInfoById(manageNode.getQuestionInfoId()); + if (ObjectUtils.isNotEmpty(questionVO)) { + templateDetail = JSONObject.parseObject(JSONObject.toJSONString(questionVO)); + manageNode.setDetailInfo(templateDetail); + } + manageNode.setTaskName(questionVO.getQuestionnaireName()); + } else { + // 查询执行记录 + PatientTaskExecuteRecord patientTaskExecuteRecordQuery = new PatientTaskExecuteRecord(); + patientTaskExecuteRecordQuery.setManageRouteNodeId(manageNode.getId()); + List taskExecuteRecordList = patientTaskExecuteRecordMapper.selectPatientTaskExecuteRecordList(patientTaskExecuteRecordQuery); + if (CollectionUtils.isEmpty(taskExecuteRecordList)) { + QuestionVO questionVO = questionInfoService.selectQuestionInfoById(manageNode.getQuestionInfoId()); + if (ObjectUtils.isNotEmpty(questionVO)) { + templateDetail = JSONObject.parseObject(JSONObject.toJSONString(questionVO)); + manageNode.setTaskName(questionVO.getQuestionnaireName()); + } + } else { + PatientQuestionSubmitResultVO patientQuestionSubmitResultVO = patientQuestionSubmitResultMapper.selectResultByTaskExecuteRecordId(taskExecuteRecordList.get(0).getId(), null); + if (ObjectUtils.isNotEmpty(patientQuestionSubmitResultVO)) { + templateDetail = JSONObject.parseObject(JSONObject.toJSONString(patientQuestionSubmitResultVO)); + manageNode.setTaskName(patientQuestionSubmitResultVO.getQuestionnaireName()); + } + } + manageNode.setDetailInfo(templateDetail); + } + } + break; + // 宣教 + case TaskNodeTypeConstants.PROPAGANDA_ARTICLE: + // 查询宣教详情 + if (manageNode.getPropagandaInfoId() != null) { + PropagandaInfo propagandaInfo = propagandaInfoService.getById(manageNode.getPropagandaInfoId()); + if (ObjectUtils.isNotEmpty(propagandaInfo)) { + manageNode.setPropagandaContent(propagandaInfo.getPropagandaContent()); + } + manageNode.setTaskName(propagandaInfo.getPropagandaTitle()); + } + break; + // 文字提醒--展示nodeContent,根据message_status判断已读状态 + case TaskNodeTypeConstants.TEXT_REMIND: + manageNode.setTaskName(StringUtils.isEmpty(manageNode.getTaskPartitionDictName()) ? manageNode.getTaskNodeTypeName() : manageNode.getTaskPartitionDictName()); + break; + } + } + finalRetList.add(manageNode); + }); + // 按照执行时间正序排序 + retList = finalRetList.stream().sorted(Comparator.comparing(SignPatientTaskVo::getExecuteDateTime)).collect(Collectors.toList()); } - patientTaskDto.setSignPatientRecordId(patientInfo.getSignPatientRecordId()); - return getRouteNodeList(patientTaskDto); + return retList; } @Override public List getNodeListByPatient(PatientTaskDto patientTaskDto) { @@ -258,12 +368,6 @@ public class SignPatientManageRouteNodeServiceImpl implements ISignPatientManage detailInfo = JSONObject.parseObject(JSONObject.toJSONString(questionVO)); } break; - //case (TaskNodeTypeConstants.ARTIFICIAL_FOLLOW_UP): // 人工随访-返回问卷信息 - // if (node.getFollowTemplateId() != null) { - // QuestionVO questionVO = questionInfoService.selectQuestionInfoById(node.getFollowTemplateId()); - // detailInfo = JSONObject.parseObject(JSONObject.toJSONString(questionVO)); - // } - // break; case (TaskNodeTypeConstants.PROPAGANDA_ARTICLE): // 宣教文章-返回宣教库信息 if (node.getPropagandaInfoId() != null) { PropagandaMaterialsVo propagandaMaterialsVo = propagandaInfoService.selectPropagandaInfoById(node.getPropagandaInfoId()); @@ -304,8 +408,7 @@ public class SignPatientManageRouteNodeServiceImpl implements ISignPatientManage } @Override public List selectPatientManageNodeList(SignPatientManageRouteNodeDto signPatientManageRouteNodeDto) { - List nodeList = signPatientManageRouteNodeMapper.selectPatientManageNodeList(signPatientManageRouteNodeDto); - return nodeList; + return signPatientManageRouteNodeMapper.selectPatientManageNodeList(signPatientManageRouteNodeDto); } /** @@ -925,7 +1028,7 @@ public class SignPatientManageRouteNodeServiceImpl implements ISignPatientManage } /** - * 查询手动船舰路径触发条件是否满足 + * 查询手动创建路径触发条件是否满足 * @param signPatientManageRouteId 专病管理路径主键 * @param patientId 患者主键 * @return 是否满足触发条件,true:满足,false:不满足 @@ -1024,7 +1127,7 @@ public class SignPatientManageRouteNodeServiceImpl implements ISignPatientManage break; // 话术 case TaskNodeTypeConstants.PHONE_OUTBOUND: - manageRouteNode.setPhoneId(node.getTemplateId()); + manageRouteNode.setPhoneId(node.getPhoneTemplateId()); // 查询话术 ScriptInfo scriptInfo = scriptInfoMapper.selectScriptInfoById(node.getPhoneTemplateId()); if (ObjectUtils.isNotEmpty(scriptInfo)) { diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/vo/signpatientmanageroutenode/SignPatientTaskVo.java b/postdischarge-manage/src/main/java/com/xinelu/manage/vo/signpatientmanageroutenode/SignPatientTaskVo.java new file mode 100644 index 00000000..7c7b7279 --- /dev/null +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/vo/signpatientmanageroutenode/SignPatientTaskVo.java @@ -0,0 +1,179 @@ +package com.xinelu.manage.vo.signpatientmanageroutenode; + +import com.alibaba.fastjson2.JSONObject; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.xinelu.common.annotation.Excel; +import io.swagger.annotations.ApiModelProperty; +import java.time.LocalDateTime; +import java.time.LocalTime; +import lombok.Data; + +/** + * @description: 患者康复计划及记录返回视图类 + * @author: haown + * @create: 2024-07-31 17:41 + **/ +@Data +public class SignPatientTaskVo { + + /** 任务创建类型,手动创建:MANUAL_CREATE,自动匹配:MANUAL_MATCHE */ + @ApiModelProperty(value = "任务创建类型,手动创建:MANUAL_CREATE,自动匹配:MANUAL_MATCHE") + private String taskCreateType; + + /** 主键id */ + private Long id; + + /** 签约患者管理任务表id */ + @ApiModelProperty(value = "签约患者管理任务表id") + private Long manageRouteId; + + /** 路径名称 */ + @ApiModelProperty(value = "路径名称") + private String manageRouteName; + + /** 管理路径节点id */ + @ApiModelProperty(value = "管理路径节点id") + private Long routeNodeId; + + /** 管理路径节点名称 */ + @ApiModelProperty(value = "管理路径节点名称") + private String routeNodeName; + + /** 管理路径节点名称中文 */ + @ApiModelProperty(value = "管理路径节点名称中文") + private String routeNodeNameCN; + + /** 管理路径节点时间,时间单位为:天 */ + @ApiModelProperty(value = "管理路径节点时间,时间单位为:天") + private Integer routeNodeDay; + + /** + * 任务名称 + */ + @ApiModelProperty(value = "任务名称") + private String taskName; + + /** 任务类型,电话外呼:PHONE_OUTBOUND,问卷量表:QUESTIONNAIRE_SCALE,宣教文章:PROPAGANDA_ARTICLE,文字提醒:TEXT_REMIND,人工随访:ARTIFICIAL_FOLLOW_UP */ + @ApiModelProperty(value = "任务类型,电话外呼:PHONE_OUTBOUND,问卷量表:QUESTIONNAIRE_SCALE,宣教文章:PROPAGANDA_ARTICLE,文字提醒:TEXT_REMIND,人工随访:ARTIFICIAL_FOLLOW_UP") + private String taskType; + + /** + * 任务类型名称 + */ + @ApiModelProperty(value = "任务类型名称") + private String taskTypeName; + + /** 任务细分 */ + @ApiModelProperty(value = "任务细分") + private String taskSubdivision; + + /** 任务细分名称 */ + @ApiModelProperty(value = "任务细分名称") + private String taskPartitionDictName; + + /** 二级分类描述 */ + @ApiModelProperty(value = "二级分类描述") + private String secondClassifyDescribe; + + /** 执行时间,格式:HH:mm */ + @ApiModelProperty(value = "执行时间,格式:HH:mm") + @JsonFormat(pattern = "HH:mm") + private LocalTime executeTime; + + /** 执行时间,格式:yyyy-MM-dd */ + @ApiModelProperty(value = "执行时间,格式:yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd") + private LocalDateTime executeDateTime; + + /** 电话话术表id */ + @ApiModelProperty(value = "电话话术表id") + @Excel(name = "电话话术表id") + private Long phoneId; + + /** 电话模板ID */ + @ApiModelProperty(value = "电话模板ID") + @Excel(name = "电话模板ID") + private String phoneTemplateId; + + /** 电话模板名称 */ + @ApiModelProperty(value = "电话模板名称") + @Excel(name = "电话模板名称") + private String phoneTemplateName; + + /** 电话内容(富文本存放整个节点的信息,包含标签画像的名称以及其它,标签画像名称使用特殊符号进行标记) */ + @ApiModelProperty(value = "电话内容") + @Excel(name = "电话内容", readConverterExp = "富文本存放整个节点的信息,包含标签画像的名称以及其它,标签画像名称使用特殊符号进行标记") + private String phoneNodeContent; + + /** 问卷表id */ + @ApiModelProperty(value = "问卷表id") + @Excel(name = "问卷表id") + private Long questionInfoId; + + /** 问卷模板名称 */ + @ApiModelProperty(value = "问卷模板名称") + private String questionnaireName; + + /** 问卷模板内容(富文本存放整个节点的信息,包含标签画像的名称以及其它,标签画像名称使用特殊符号进行标记) */ + @ApiModelProperty(value = "问卷模板内容") + private String questionnaireContent; + + /** 宣教文章表id */ + @ApiModelProperty(value = "宣教文章表id") + private Long propagandaInfoId; + + /** 宣教文章模板标题(宣教模板名称) */ + @ApiModelProperty(value = "宣教文章模板标题") + private String propagandaTitle; + + /** 宣教文章内容(富文本存放整个节点的信息,包含标签画像的名称以及其它,标签画像名称使用特殊符号进行标记) */ + @ApiModelProperty(value = "宣教文章内容") + private String propagandaContent; + + /** 任务处理信息 */ + @ApiModelProperty(value = "任务处理信息") + private String routeHandleRemark; + + @ApiModelProperty(value = "消息状态:已读:READ;未读:UNREAD。") + private String messageStatus; + + /** + * 节点内容 + */ + @ApiModelProperty(value = "节点内容") + private String nodeContent; + + /** + * 任务节点类型:PHONE_OUTBOUND:电话外呼(默认自动。人工或自动);QUESTIONNAIRE_SCALE:问卷量表(消息推送或人工随访);PROPAGANDA_ARTICLE:宣教文章;TEXT_REMIND:文字提醒(微信、短信、公众号) + */ + @ApiModelProperty(value = "任务节点类型") + private String taskNodeType; + + /** + * 任务节点类型:PHONE_OUTBOUND:电话外呼(默认自动。人工或自动);QUESTIONNAIRE_SCALE:问卷量表(消息推送或人工随访);PROPAGANDA_ARTICLE:宣教文章;TEXT_REMIND:文字提醒(微信、短信、公众号) + */ + @ApiModelProperty(value = "任务节点类型-中文") + private String taskNodeTypeName; + + /** 节点任务执行状态,已执行:EXECUTED,未执行:UNEXECUTED */ + @ApiModelProperty(value = "节点任务执行状态,已执行:EXECUTED,未执行:UNEXECUTED") + private String nodeExecuteStatus; + + /** 电话拨通情况;SUCCESS:成功;FAILURE:失败;EXPIRED:超期自动作废(如超期一周);NULL或空字符串:缺省值,表示未执行; */ + @ApiModelProperty(value = "电话拨通情况") + private String phoneNodeExecuteResultStatus; + + /** 患者宣教阅读或问卷提交的时间;null表示尚未阅读或提交 */ + @ApiModelProperty(value = "患者宣教阅读或问卷提交的时间") + private LocalDateTime nodeFinishDate; + + /** + * 任务状态 + */ + @ApiModelProperty(value = "任务状态,NOT_CONNECTED:未接通,CONNECTED:已接通,EXPIRED:任务已超时,UNREAD:未阅读,READ:已阅读") + private String taskStatus; + + /** 详细信息 */ + @ApiModelProperty(value = "详细信息") + private JSONObject detailInfo; +} diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/vo/signpatientrecord/SignPatientRecordSelectVo.java b/postdischarge-manage/src/main/java/com/xinelu/manage/vo/signpatientrecord/SignPatientRecordSelectVo.java new file mode 100644 index 00000000..8994a3b6 --- /dev/null +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/vo/signpatientrecord/SignPatientRecordSelectVo.java @@ -0,0 +1,32 @@ +package com.xinelu.manage.vo.signpatientrecord; + +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @description: 签约记录下拉框返回视图类 + * @author: haown + * @create: 2024-08-01 14:41 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class SignPatientRecordSelectVo { + + /** + * 签约记录主键 + */ + @ApiModelProperty("签约记录主键") + private Long id; + + /** + * 路径名称,签约时间|路径名称格式 + */ + @ApiModelProperty("路径名称,签约时间|路径名称格式") + private String signRouteName; + +} diff --git a/postdischarge-manage/src/main/resources/mapper/manage/signpatientmanageroutenode/SignPatientManageRouteNodeMapper.xml b/postdischarge-manage/src/main/resources/mapper/manage/signpatientmanageroutenode/SignPatientManageRouteNodeMapper.xml index 80ed6586..6260bb48 100644 --- a/postdischarge-manage/src/main/resources/mapper/manage/signpatientmanageroutenode/SignPatientManageRouteNodeMapper.xml +++ b/postdischarge-manage/src/main/resources/mapper/manage/signpatientmanageroutenode/SignPatientManageRouteNodeMapper.xml @@ -820,9 +820,9 @@ + +