From 5d7e557dfba3f99ebdb2168bbe574f4d4e961914 Mon Sep 17 00:00:00 2001 From: haown <454902499@qq.com> Date: Thu, 13 Jun 2024 16:51:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=8B=E5=8A=A8=E7=94=9F=E6=88=90=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E6=8E=A5=E5=8F=A3=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../constant/PhoneMessageRemindConstants.java | 31 ++++++++++++ .../common/constant/TaskContentConstants.java | 5 ++ .../xinelu/common/enums/MessageTypeEnum.java | 5 ++ .../xinelu/common/enums/TaskContentEnum.java | 5 ++ .../SignPatientManageRouteNode.java | 6 +-- .../SpecialDiseaseRoute.java | 6 +++ .../SpecialDiseaseTriggerCondition.java | 7 +++ .../PatientNodeParamsCurrentServiceImpl.java | 2 +- .../ISignPatientManageRouteNodeService.java | 9 +++- ...SignPatientManageRouteNodeServiceImpl.java | 47 ++++++++++++++++++- .../SpecialDiseaseRouteMapper.xml | 11 +++++ .../SpecialDiseaseTriggerConditionMapper.xml | 11 +++++ 12 files changed, 139 insertions(+), 6 deletions(-) create mode 100644 postdischarge-common/src/main/java/com/xinelu/common/constant/PhoneMessageRemindConstants.java diff --git a/postdischarge-common/src/main/java/com/xinelu/common/constant/PhoneMessageRemindConstants.java b/postdischarge-common/src/main/java/com/xinelu/common/constant/PhoneMessageRemindConstants.java new file mode 100644 index 00000000..4c24f8ba --- /dev/null +++ b/postdischarge-common/src/main/java/com/xinelu/common/constant/PhoneMessageRemindConstants.java @@ -0,0 +1,31 @@ +package com.xinelu.common.constant; + +/** + * @description: 电话短信提醒常量 + * @author: haown + * @create: 2024-06-13 16:45 + **/ +public class PhoneMessageRemindConstants { + + /** + * 不发送短信 + */ + public static final String NOT_SEND_MESSAGE = "NOT_SEND_MESSAGE"; + + /** + * 未接通发短信 + */ + public static final String NOT_CONNECTED_SEND_MESSAGE = "NOT_CONNECTED_SEND_MESSAGE"; + + /** + * 接通后发短信 + */ + public static final String CONNECTED_SEND_MESSAGE = "CONNECTED_SEND_MESSAGE"; + + /** + * 所有人发短信 + */ + public static final String EVERYONE_SEND_MESSAGE = "EVERYONE_SEND_MESSAGE"; + + +} diff --git a/postdischarge-common/src/main/java/com/xinelu/common/constant/TaskContentConstants.java b/postdischarge-common/src/main/java/com/xinelu/common/constant/TaskContentConstants.java index a6635309..9432613b 100644 --- a/postdischarge-common/src/main/java/com/xinelu/common/constant/TaskContentConstants.java +++ b/postdischarge-common/src/main/java/com/xinelu/common/constant/TaskContentConstants.java @@ -31,4 +31,9 @@ public class TaskContentConstants { */ public static final String ARTIFICIAL_FOLLOW_UP = "ARTIFICIAL_FOLLOW_UP"; + /** + * 短信提醒 + */ + public static final String SMS_REMIND = "SMS_REMIND"; + } diff --git a/postdischarge-common/src/main/java/com/xinelu/common/enums/MessageTypeEnum.java b/postdischarge-common/src/main/java/com/xinelu/common/enums/MessageTypeEnum.java index a68bd7d2..8b48d2f4 100644 --- a/postdischarge-common/src/main/java/com/xinelu/common/enums/MessageTypeEnum.java +++ b/postdischarge-common/src/main/java/com/xinelu/common/enums/MessageTypeEnum.java @@ -34,6 +34,11 @@ public enum MessageTypeEnum { * 人工随访 */ ARTIFICIAL_FOLLOW_UP("ARTIFICIAL_FOLLOW_UP"), + + /** + * 短信提醒 + */ + SMS_REMIND("SMS_REMIND"), ; final private String value; diff --git a/postdischarge-common/src/main/java/com/xinelu/common/enums/TaskContentEnum.java b/postdischarge-common/src/main/java/com/xinelu/common/enums/TaskContentEnum.java index c36751c0..e469efd2 100644 --- a/postdischarge-common/src/main/java/com/xinelu/common/enums/TaskContentEnum.java +++ b/postdischarge-common/src/main/java/com/xinelu/common/enums/TaskContentEnum.java @@ -34,6 +34,11 @@ public enum TaskContentEnum { * 人工随访 */ ARTIFICIAL_FOLLOW_UP("ARTIFICIAL_FOLLOW_UP"), + + /** + * 短信提醒 + */ + SMS_REMIND("SMS_REMIND"), ; final private String info; diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/domain/signpatientmanageroutenode/SignPatientManageRouteNode.java b/postdischarge-manage/src/main/java/com/xinelu/manage/domain/signpatientmanageroutenode/SignPatientManageRouteNode.java index 581a281d..cdbda48e 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/domain/signpatientmanageroutenode/SignPatientManageRouteNode.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/domain/signpatientmanageroutenode/SignPatientManageRouteNode.java @@ -55,9 +55,9 @@ public class SignPatientManageRouteNode extends BaseEntity { @Excel(name = "管理路径节点时间,时间单位为:天") private Integer routeNodeDay; - /** 任务类型,电话外呼:PHONE_OUTBOUND,问卷量表:QUESTIONNAIRE_SCALE,宣教文章:PROPAGANDA_ARTICLE,文字提醒:TEXT_REMIND,人工随访:ARTIFICIAL_FOLLOW_UP */ - @ApiModelProperty(value = "任务类型,电话外呼:PHONE_OUTBOUND,问卷量表:QUESTIONNAIRE_SCALE,宣教文章:PROPAGANDA_ARTICLE,文字提醒:TEXT_REMIND,人工随访:ARTIFICIAL_FOLLOW_UP") - @Excel(name = "任务类型,电话外呼:PHONE_OUTBOUND,问卷量表:QUESTIONNAIRE_SCALE,宣教文章:PROPAGANDA_ARTICLE,文字提醒:TEXT_REMIND,人工随访:ARTIFICIAL_FOLLOW_UP") + /** 任务类型,电话外呼:PHONE_OUTBOUND,问卷量表:QUESTIONNAIRE_SCALE,宣教文章:PROPAGANDA_ARTICLE,文字提醒:TEXT_REMIND,人工随访:ARTIFICIAL_FOLLOW_UP,短信提醒:SMS_REMIND */ + @ApiModelProperty(value = "任务类型,电话外呼:PHONE_OUTBOUND,问卷量表:QUESTIONNAIRE_SCALE,宣教文章:PROPAGANDA_ARTICLE,文字提醒:TEXT_REMIND,人工随访:ARTIFICIAL_FOLLOW_UP,短信提醒:SMS_REMIND") + @Excel(name = "任务类型,电话外呼:PHONE_OUTBOUND,问卷量表:QUESTIONNAIRE_SCALE,宣教文章:PROPAGANDA_ARTICLE,文字提醒:TEXT_REMIND,人工随访:ARTIFICIAL_FOLLOW_UP,短信提醒:SMS_REMIND") private String taskType; /** 任务状态 */ diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/domain/specialdiseaseroute/SpecialDiseaseRoute.java b/postdischarge-manage/src/main/java/com/xinelu/manage/domain/specialdiseaseroute/SpecialDiseaseRoute.java index fa4998f7..ddd0cc78 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/domain/specialdiseaseroute/SpecialDiseaseRoute.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/domain/specialdiseaseroute/SpecialDiseaseRoute.java @@ -36,6 +36,12 @@ public class SpecialDiseaseRoute extends BaseEntity { */ private Long id; + /** + * 主路径默认为0,子路径存储其对应主路径ID + */ + @ApiModelProperty(value = "主路径默认为0,子路径存储其对应主路径ID") + private Long parentRouteId; + /** * 所属科室id */ diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/domain/specialdiseasetriggercondition/SpecialDiseaseTriggerCondition.java b/postdischarge-manage/src/main/java/com/xinelu/manage/domain/specialdiseasetriggercondition/SpecialDiseaseTriggerCondition.java index c275abd4..26ecf6f8 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/domain/specialdiseasetriggercondition/SpecialDiseaseTriggerCondition.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/domain/specialdiseasetriggercondition/SpecialDiseaseTriggerCondition.java @@ -79,6 +79,13 @@ public class SpecialDiseaseTriggerCondition extends BaseEntity { @Excel(name = "排序") private Integer triggerConditionSort; + /** + * and、or,说明:如果为or,则根据排序同前面条件或运算 + */ + @ApiModelProperty(value = "and、or,说明:如果为or,则根据排序同前面条件或运算") + @Excel(name = "and、or,说明:如果为or,则根据排序同前面条件或运算") + private String triggerLogic; + /** * 备注信息 */ diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientnodeparamscurrent/impl/PatientNodeParamsCurrentServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientnodeparamscurrent/impl/PatientNodeParamsCurrentServiceImpl.java index d0ac5ce0..b63c71dd 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientnodeparamscurrent/impl/PatientNodeParamsCurrentServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/patientnodeparamscurrent/impl/PatientNodeParamsCurrentServiceImpl.java @@ -167,6 +167,6 @@ public class PatientNodeParamsCurrentServiceImpl implements IPatientNodeParamsCu }); patientNodeParamsLogMapper.insertList(paramsLogList); // 生成任务 - manageRouteNodeService.updateTask(paramsList); + manageRouteNodeService.updateTaskWithParam(paramsList); } } 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 7a81fd75..ffb87969 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 @@ -127,5 +127,12 @@ public interface ISignPatientManageRouteNodeService { * 根据参数列表修改任务 * @param paramsCurrentLists 参数列表 */ - void updateTask(List> paramsCurrentLists); + void updateTaskWithParam(List> paramsCurrentLists); + + /** + * 手动生成任务 + * @param manageRouteNodeId 患者管理节点id + * @param taskType 任务类型 + */ + void generateTask(Long manageRouteNodeId, String taskType); } 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 c1c9dbf0..2e9098dd 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 @@ -2,6 +2,7 @@ package com.xinelu.manage.service.signpatientmanageroutenode.impl; import com.alibaba.fastjson2.JSONObject; import com.xinelu.common.annotation.DataScope; +import com.xinelu.common.constant.PhoneMessageRemindConstants; import com.xinelu.common.constant.RouteNodeNameConstants; import com.xinelu.common.constant.TaskContentConstants; import com.xinelu.common.constant.TaskCreateTypeConstant; @@ -21,6 +22,7 @@ import com.xinelu.manage.domain.signpatientmanageroute.SignPatientManageRoute; import com.xinelu.manage.domain.signpatientmanageroutenode.SignPatientManageRouteNode; import com.xinelu.manage.domain.signpatientrecord.SignPatientRecord; import com.xinelu.manage.domain.specialdiseasenode.SpecialDiseaseNode; +import com.xinelu.manage.domain.textmessage.TextMessage; import com.xinelu.manage.dto.patientinfo.PatientInfoDto; import com.xinelu.manage.dto.signpatientmanageroutenode.AppletPatientTaskDto; import com.xinelu.manage.dto.signpatientmanageroutenode.PatientTaskDto; @@ -33,6 +35,7 @@ import com.xinelu.manage.mapper.signpatientmanageroute.SignPatientManageRouteMap import com.xinelu.manage.mapper.signpatientmanageroutenode.SignPatientManageRouteNodeMapper; import com.xinelu.manage.mapper.signpatientrecord.SignPatientRecordMapper; import com.xinelu.manage.mapper.specialdiseasenode.SpecialDiseaseNodeMapper; +import com.xinelu.manage.mapper.textmessage.TextMessageMapper; import com.xinelu.manage.service.propagandainfo.IPropagandaInfoService; import com.xinelu.manage.service.questioninfo.IQuestionInfoService; import com.xinelu.manage.service.signpatientmanageroutenode.ISignPatientManageRouteNodeService; @@ -93,6 +96,8 @@ public class SignPatientManageRouteNodeServiceImpl implements ISignPatientManage private PatientVisitRecordMapper patientVisitRecordMapper; @Resource private SpecialDiseaseNodeMapper specialDiseaseNodeMapper; + @Resource + private TextMessageMapper textMessageMapper; /** * 查询签约患者管理任务路径节点 @@ -420,6 +425,13 @@ public class SignPatientManageRouteNodeServiceImpl implements ISignPatientManage return specialDiseaseNodeMapper.selectRouteNodeByRouteId(manageRouteList.get(0).getRouteId()); } + /** + * 生成有参数得任务 + * @param routeNodeId 节点id + * @param manageRouteId 管理路径id + * @param manageRouteName 管理路径名称 + * @param paramsCurrentLists 参数列表 + */ private void generateTask(Long routeNodeId, Long manageRouteId, String manageRouteName, List> paramsCurrentLists) { // 查询专病路径节点 SpecialDiseaseNode specialDiseaseNode = specialDiseaseNodeMapper.selectSpecialDiseaseNodeById(routeNodeId); @@ -452,9 +464,13 @@ public class SignPatientManageRouteNodeServiceImpl implements ISignPatientManage signPatientManageRouteNodeMapper.insertBatch(manageNodeList); } + /** + * 根据参数列表修改任务 + * @param paramsCurrentLists 参数列表 + */ @Override @Transactional(rollbackFor = Exception.class) - public void updateTask(List> paramsCurrentLists) { + public void updateTaskWithParam(List> paramsCurrentLists) { // 查询患者 Long patientId = paramsCurrentLists.get(0).get(0).getPatientId(); if (patientId == null) { @@ -490,6 +506,35 @@ public class SignPatientManageRouteNodeServiceImpl implements ISignPatientManage } } + /** + * 手动创建任务 + * @param manageRouteNodeId 患者管理节点id + * @param taskType 任务类型 + */ + @Override public void generateTask(Long manageRouteNodeId, String taskType) { + if (StringUtils.isBlank(taskType)) { + throw new ServiceException("请输入任务类型"); + } + SignPatientManageRouteNode signNode = signPatientManageRouteNodeMapper.selectSignPatientManageRouteNodeById(manageRouteNodeId); + switch(taskType) { + case TaskContentConstants.SMS_REMIND: // 短信提醒 + // 判断是否发短信 + if (!StringUtils.equals(PhoneMessageRemindConstants.NOT_SEND_MESSAGE, signNode.getPhoneMessageRemind())) { + if (signNode.getPhoneMessageTemplateId() == null) { + throw new ServiceException("为选择短信模板"); + } + TextMessage textMessage = textMessageMapper.selectTextMessageById(signNode.getPhoneMessageTemplateId()); + if (ObjectUtils.isEmpty(textMessage) || StringUtils.isBlank(textMessage.getTextMessageContent())) { + throw new ServiceException("短信模板不存在或短信模板内容为空,请联系管理员!"); + } + signNode.setId(null); + signNode.setNodeContent(textMessage.getTextMessageContent()); + signPatientManageRouteNodeMapper.insertSignPatientManageRouteNode(signNode); + } + break; + } + } + private LocalDateTime getExecuteTime(SignPatientManageRouteNode node, PatientVisitRecord patientVisitRecord) { LocalDateTime executeTime = null; diff --git a/postdischarge-manage/src/main/resources/mapper/manage/specialdiseaseroute/SpecialDiseaseRouteMapper.xml b/postdischarge-manage/src/main/resources/mapper/manage/specialdiseaseroute/SpecialDiseaseRouteMapper.xml index cf3e910a..5da89832 100644 --- a/postdischarge-manage/src/main/resources/mapper/manage/specialdiseaseroute/SpecialDiseaseRouteMapper.xml +++ b/postdischarge-manage/src/main/resources/mapper/manage/specialdiseaseroute/SpecialDiseaseRouteMapper.xml @@ -6,6 +6,7 @@ + @@ -91,6 +92,9 @@ resultMap="SpecialDiseaseRouteResult"> + + and parent_route_id = #{parentRouteId} + and department_id = #{departmentId} @@ -212,6 +216,8 @@ keyProperty="id"> insert into special_disease_route + parent_route_id, + department_id, department_name, @@ -246,6 +252,8 @@ + #{parentRouteId}, + #{departmentId}, #{departmentName}, @@ -284,6 +292,9 @@ update special_disease_route + parent_route_id= + #{parentRouteId}, + department_id = #{departmentId}, diff --git a/postdischarge-manage/src/main/resources/mapper/manage/specialdiseasetriggercondition/SpecialDiseaseTriggerConditionMapper.xml b/postdischarge-manage/src/main/resources/mapper/manage/specialdiseasetriggercondition/SpecialDiseaseTriggerConditionMapper.xml index 91f2be29..77fcf7e3 100644 --- a/postdischarge-manage/src/main/resources/mapper/manage/specialdiseasetriggercondition/SpecialDiseaseTriggerConditionMapper.xml +++ b/postdischarge-manage/src/main/resources/mapper/manage/specialdiseasetriggercondition/SpecialDiseaseTriggerConditionMapper.xml @@ -13,6 +13,7 @@ + @@ -29,6 +30,7 @@ trigger_condition_operator, trigger_condition_value, trigger_condition_sort, + trigger_logic, trigger_condition_remark, create_by, create_time, @@ -93,6 +95,8 @@ trigger_condition_sort, + trigger_logic, + trigger_condition_remark, create_by, @@ -119,6 +123,8 @@ #{triggerConditionSort}, + #{triggerLogic}, + #{triggerConditionRemark}, #{createBy}, @@ -141,6 +147,7 @@ trigger_condition_operator, trigger_condition_value, trigger_condition_sort, + trigger_logic, trigger_condition_remark, create_by, create_time @@ -154,6 +161,7 @@ #{triggerConditionList.triggerConditionOperator}, #{triggerConditionList.triggerConditionValue}, #{triggerConditionList.triggerConditionSort}, + #{triggerConditionList.triggerLogic}, #{triggerConditionList.triggerConditionRemark}, #{triggerConditionList.createBy}, #{triggerConditionList.createTime} @@ -185,6 +193,9 @@ trigger_condition_sort = #{triggerConditionSort}, + trigger_logic = + #{triggerLogic}, + trigger_condition_remark = #{triggerConditionRemark},