diff --git a/postdischarge-common/src/main/java/com/xinelu/common/constant/TemplateTypeConstants.java b/postdischarge-common/src/main/java/com/xinelu/common/constant/TemplateTypeConstants.java new file mode 100644 index 00000000..9686a6c0 --- /dev/null +++ b/postdischarge-common/src/main/java/com/xinelu/common/constant/TemplateTypeConstants.java @@ -0,0 +1,33 @@ +package com.xinelu.common.constant; + +/** + * @description: 模板类型 + * @author: haown + * @create: 2024-05-30 13:55 + **/ +public class TemplateTypeConstants { + /** + * 话术 + */ + public static final String SCRIPT = "SCRIPT"; + + /** + * 微信 + */ + public static final String WECHAT = "WECHAT"; + + /** + * 短信 + */ + public static final String TEXT_MESSAGE = "TEXT_MESSAGE"; + + /** + * 问卷 + */ + public static final String QUESTIONNAIRE = "QUESTIONNAIRE"; + + /** + * 宣教 + */ + public static final String PROPAGANDA = "PROPAGANDA"; +} diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientvisitrecord/impl/PatientVisitRecordServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientvisitrecord/impl/PatientVisitRecordServiceImpl.java index b5b3370e..5ff4d49e 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientvisitrecord/impl/PatientVisitRecordServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientvisitrecord/impl/PatientVisitRecordServiceImpl.java @@ -274,6 +274,8 @@ public class PatientVisitRecordServiceImpl implements IPatientVisitRecordService patientInfo.setVisitMethod(updDto.getVisitMethod()); patientInfo.setDepartmentId(updDto.getDepartmentId()); patientInfo.setDepartmentName(updDto.getDepartmentName()); + patientInfo.setAdmissionTime(updDto.getAdmissionTime()); + patientInfo.setDischargeTime(updDto.getDischargeTime()); setPatientType(patientInfo, patientVisitRecord); patientInfoService.updatePatientInfo(patientInfo); } 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 60a26187..37c8a2d0 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 @@ -7,6 +7,7 @@ import com.xinelu.manage.dto.signpatientmanageroutenode.PatientTaskDto; import com.xinelu.manage.dto.signpatientmanageroutenode.RouteNodeCheckDto; import com.xinelu.manage.dto.signpatientmanageroutenode.SignPatientManageRouteNodeDto; import com.xinelu.manage.vo.signpatientmanageroutenode.AppletRouteNodeListVo; +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; @@ -27,7 +28,7 @@ public interface ISignPatientManageRouteNodeService { * @param id 签约患者管理任务路径节点主键 * @return 签约患者管理任务路径节点 */ - SignPatientManageRouteNode selectSignPatientManageRouteNodeById(Long id); + PatientManageNodeInfoVo selectSignPatientManageRouteNodeById(Long id); /** * 查询患者管理路径节点 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 e565e06c..bf4ced91 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 @@ -4,6 +4,7 @@ import com.alibaba.fastjson2.JSONObject; import com.xinelu.common.constant.RouteNodeNameConstants; import com.xinelu.common.constant.TaskContentConstants; import com.xinelu.common.constant.TaskCreateTypeConstant; +import com.xinelu.common.constant.TemplateTypeConstants; import com.xinelu.common.constant.VisitMethodConstants; import com.xinelu.common.enums.NodeExecuteStatusEnum; import com.xinelu.common.enums.RouteCheckStatusEnum; @@ -38,6 +39,7 @@ import com.xinelu.manage.service.specialdiseaseroute.ISpecialDiseaseRouteService import com.xinelu.manage.vo.propagandainfo.PropagandaMaterialsVo; import com.xinelu.manage.vo.questionInfo.QuestionVO; import com.xinelu.manage.vo.signpatientmanageroutenode.AppletRouteNodeListVo; +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.SignPatientManageRouteNodeInfoVo; @@ -98,8 +100,30 @@ public class SignPatientManageRouteNodeServiceImpl implements ISignPatientManage * @return 签约患者管理任务路径节点 */ @Override - public SignPatientManageRouteNode selectSignPatientManageRouteNodeById(Long id) { - return signPatientManageRouteNodeMapper.selectSignPatientManageRouteNodeById(id); + public PatientManageNodeInfoVo selectSignPatientManageRouteNodeById(Long id) { + PatientManageNodeInfoVo retVo = new PatientManageNodeInfoVo(); + SignPatientManageRouteNode node = signPatientManageRouteNodeMapper.selectSignPatientManageRouteNodeById(id); + BeanUtils.copyBeanProp(retVo, node); + // 判断节点是否选择模板,选择模板则返回模板内容 + JSONObject detailInfo = new JSONObject(); + if (node.getPropagandaInfoId() != null) { + // 宣教 + PropagandaMaterialsVo propagandaMaterialsVo = propagandaInfoService.selectPropagandaInfoById(node.getPropagandaInfoId()); + detailInfo = JSONObject.parseObject(JSONObject.toJSONString(propagandaMaterialsVo)); + retVo.setTemplateType(TemplateTypeConstants.PROPAGANDA); + } else if (StringUtils.isNotBlank(node.getPhoneTemplateId())) { + // 话术 + ScriptInfo scriptInfo = scriptInfoMapper.selectScriptInfoById(node.getPhoneId()); + detailInfo = JSONObject.parseObject(JSONObject.toJSONString(scriptInfo)); + retVo.setTemplateType(TemplateTypeConstants.SCRIPT); + } else if (node.getQuestionInfoId() != null) { + // 问卷 + QuestionVO questionVO = questionInfoService.selectQuestionInfoById(node.getQuestionInfoId()); + detailInfo = JSONObject.parseObject(JSONObject.toJSONString(questionVO)); + retVo.setTemplateType(TemplateTypeConstants.QUESTIONNAIRE); + } + retVo.setDetailInfo(detailInfo); + return retVo; } @Override public List getNodeList(PatientTaskDto patientTaskDto) { diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientrecord/impl/SignPatientRecordServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientrecord/impl/SignPatientRecordServiceImpl.java index 7dac8939..8b38bd37 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientrecord/impl/SignPatientRecordServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientrecord/impl/SignPatientRecordServiceImpl.java @@ -2,6 +2,7 @@ package com.xinelu.manage.service.signpatientrecord.impl; import com.xinelu.common.constant.SignRecordServiceStatusConstants; import com.xinelu.common.constant.TaskCreateTypeConstant; +import com.xinelu.common.constant.TemplateTypeConstants; import com.xinelu.common.enums.NodeExecuteStatusEnum; import com.xinelu.common.enums.RouteCheckStatusEnum; import com.xinelu.common.exception.ServiceException; @@ -207,6 +208,23 @@ public class SignPatientRecordServiceImpl implements ISignPatientRecordService { manageRouteNode.setNodeExecuteStatus(NodeExecuteStatusEnum.UNEXECUTED.getInfo()); manageRouteNode.setRouteNodeId(node.getId()); manageRouteNode.setExecuteTime(node.getExecutionTime()); + // 根据模板类型,存放模板字段 + switch(node.getTemplateType()) { + // 宣教 + case TemplateTypeConstants.PROPAGANDA: + manageRouteNode.setPropagandaInfoId(node.getTemplateId()); + manageRouteNode.setPropagandaTitle(node.getTemplateName()); + break; + // 问卷 + case TemplateTypeConstants.QUESTIONNAIRE: + manageRouteNode.setQuestionInfoId(node.getTemplateId()); + manageRouteNode.setQuestionnaireName(node.getTemplateName()); + break; + // 话术 + case TemplateTypeConstants.SCRIPT: + manageRouteNode.setPhoneId(node.getTemplateId()); + break; + } manageRouteNode.setDelFlag(0); manageRouteNode.setCreateTime(LocalDateTime.now()); manageRouteNode.setCreateBy(SecurityUtils.getLoginUser().getUser().getNickName()); diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/specialdiseaseroute/impl/SpecialDiseaseRouteServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/specialdiseaseroute/impl/SpecialDiseaseRouteServiceImpl.java index 1245fcfc..459ebfa9 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/specialdiseaseroute/impl/SpecialDiseaseRouteServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/specialdiseaseroute/impl/SpecialDiseaseRouteServiceImpl.java @@ -225,6 +225,7 @@ public class SpecialDiseaseRouteServiceImpl implements ISpecialDiseaseRouteServi return AjaxResult.error("请选择需要发布专病路径的信息!"); } if (ReleaseStatusEnum.PUBLISHED.getInfo().equals(specialDiseaseRoute.getReleaseStatus())) { + // 专病路径没有节点不能发布 int count = specialDiseaseRouteMapper.selectRouteCheckStatus(specialDiseaseRoute.getId(), RouteCheckStatusEnum.AGREE.getInfo()); if (count > 0) { return AjaxResult.error("该路径存在未审核的节点,请全部审核后发布!"); diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/vo/signpatientmanageroutenode/PatientManageNodeInfoVo.java b/postdischarge-manage/src/main/java/com/xinelu/manage/vo/signpatientmanageroutenode/PatientManageNodeInfoVo.java new file mode 100644 index 00000000..fda47805 --- /dev/null +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/vo/signpatientmanageroutenode/PatientManageNodeInfoVo.java @@ -0,0 +1,23 @@ +package com.xinelu.manage.vo.signpatientmanageroutenode; + +import com.alibaba.fastjson2.JSONObject; +import com.xinelu.manage.domain.signpatientmanageroutenode.SignPatientManageRouteNode; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @description: 专病节点详情返回视图类 + * @author: haown + * @create: 2024-05-30 14:47 + **/ +@Data +public class PatientManageNodeInfoVo extends SignPatientManageRouteNode { + + /** 模板类型,话术:SCRIPT,微信:WECHAT,短信:TEXT_MESSAGE,问卷:QUESTIONNAIRE,宣教:PROPAGANDA */ + @ApiModelProperty(value = "模板类型,话术:SCRIPT,微信:WECHAT,短信:TEXT_MESSAGE,问卷:QUESTIONNAIRE,宣教:PROPAGANDA") + private String templateType; + + /** 详细信息 */ + @ApiModelProperty(value = "详细信息") + private JSONObject detailInfo; +} 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 ef3caddc..2fc0c68b 100644 --- a/postdischarge-manage/src/main/resources/mapper/manage/signpatientmanageroutenode/SignPatientManageRouteNodeMapper.xml +++ b/postdischarge-manage/src/main/resources/mapper/manage/signpatientmanageroutenode/SignPatientManageRouteNodeMapper.xml @@ -161,7 +161,14 @@ and route.patient_id = #{patientId} - and node.task_type = #{taskType} + + + and node.propaganda_info_id is not null + + + and node.task_type = #{taskType} + + and route.task_create_type = #{taskCreateType}