手动生成任务接口。

This commit is contained in:
haown 2024-06-13 16:51:48 +08:00
parent 29b2b5d996
commit 5d7e557dfb
12 changed files with 139 additions and 6 deletions

View File

@ -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";
}

View File

@ -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";
}

View File

@ -34,6 +34,11 @@ public enum MessageTypeEnum {
* 人工随访
*/
ARTIFICIAL_FOLLOW_UP("ARTIFICIAL_FOLLOW_UP"),
/**
* 短信提醒
*/
SMS_REMIND("SMS_REMIND"),
;
final private String value;

View File

@ -34,6 +34,11 @@ public enum TaskContentEnum {
* 人工随访
*/
ARTIFICIAL_FOLLOW_UP("ARTIFICIAL_FOLLOW_UP"),
/**
* 短信提醒
*/
SMS_REMIND("SMS_REMIND"),
;
final private String info;

View File

@ -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;
/** 任务状态 */

View File

@ -36,6 +36,12 @@ public class SpecialDiseaseRoute extends BaseEntity {
*/
private Long id;
/**
* 主路径默认为0子路径存储其对应主路径ID
*/
@ApiModelProperty(value = "主路径默认为0子路径存储其对应主路径ID")
private Long parentRouteId;
/**
* 所属科室id
*/

View File

@ -79,6 +79,13 @@ public class SpecialDiseaseTriggerCondition extends BaseEntity {
@Excel(name = "排序")
private Integer triggerConditionSort;
/**
* andor说明如果为or则根据排序同前面条件或运算
*/
@ApiModelProperty(value = "and、or说明如果为or则根据排序同前面条件或运算")
@Excel(name = "and、or说明如果为or则根据排序同前面条件或运算")
private String triggerLogic;
/**
* 备注信息
*/

View File

@ -167,6 +167,6 @@ public class PatientNodeParamsCurrentServiceImpl implements IPatientNodeParamsCu
});
patientNodeParamsLogMapper.insertList(paramsLogList);
// 生成任务
manageRouteNodeService.updateTask(paramsList);
manageRouteNodeService.updateTaskWithParam(paramsList);
}
}

View File

@ -127,5 +127,12 @@ public interface ISignPatientManageRouteNodeService {
* 根据参数列表修改任务
* @param paramsCurrentLists 参数列表
*/
void updateTask(List<List<PatientNodeParamsCurrent>> paramsCurrentLists);
void updateTaskWithParam(List<List<PatientNodeParamsCurrent>> paramsCurrentLists);
/**
* 手动生成任务
* @param manageRouteNodeId 患者管理节点id
* @param taskType 任务类型
*/
void generateTask(Long manageRouteNodeId, String taskType);
}

View File

@ -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<List<PatientNodeParamsCurrent>> 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<List<PatientNodeParamsCurrent>> paramsCurrentLists) {
public void updateTaskWithParam(List<List<PatientNodeParamsCurrent>> 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;

View File

@ -6,6 +6,7 @@
<resultMap type="SpecialDiseaseRoute" id="SpecialDiseaseRouteResult">
<result property="id" column="id"/>
<result property="parentRouteId" column="parent_route_id"/>
<result property="departmentId" column="department_id"/>
<result property="departmentName" column="department_name"/>
<result property="diseaseTypeId" column="disease_type_id"/>
@ -91,6 +92,9 @@
resultMap="SpecialDiseaseRouteResult">
<include refid="selectSpecialDiseaseRouteVo"/>
<where>
<if test="parentRouteId != null ">
and parent_route_id = #{parentRouteId}
</if>
<if test="departmentId != null ">
and department_id = #{departmentId}
</if>
@ -212,6 +216,8 @@
keyProperty="id">
insert into special_disease_route
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="parentRouteId != null">parent_route_id,
</if>
<if test="departmentId != null">department_id,
</if>
<if test="departmentName != null">department_name,
@ -246,6 +252,8 @@
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="parentRouteId != null">#{parentRouteId},
</if>
<if test="departmentId != null">#{departmentId},
</if>
<if test="departmentName != null">#{departmentName},
@ -284,6 +292,9 @@
<update id="updateSpecialDiseaseRoute" parameterType="SpecialDiseaseRoute">
update special_disease_route
<trim prefix="SET" suffixOverrides=",">
<if test="parentRouteId != null">parent_route_id=
#{parentRouteId},
</if>
<if test="departmentId != null">department_id =
#{departmentId},
</if>

View File

@ -13,6 +13,7 @@
<result property="triggerConditionOperator" column="trigger_condition_operator"/>
<result property="triggerConditionValue" column="trigger_condition_value"/>
<result property="triggerConditionSort" column="trigger_condition_sort"/>
<result property="triggerLogic" column="trigger_logic"/>
<result property="triggerConditionRemark" column="trigger_condition_remark"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
@ -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 @@
</if>
<if test="triggerConditionSort != null">trigger_condition_sort,
</if>
<if test="triggerLogic != null">trigger_logic,
</if>
<if test="triggerConditionRemark != null">trigger_condition_remark,
</if>
<if test="createBy != null">create_by,
@ -119,6 +123,8 @@
</if>
<if test="triggerConditionSort != null">#{triggerConditionSort},
</if>
<if test="triggerLogic != null">#{triggerLogic},
</if>
<if test="triggerConditionRemark != null">#{triggerConditionRemark},
</if>
<if test="createBy != null">#{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 @@
<if test="triggerConditionSort != null">trigger_condition_sort =
#{triggerConditionSort},
</if>
<if test="triggerLogic != null">trigger_logic =
#{triggerLogic},
</if>
<if test="triggerConditionRemark != null">trigger_condition_remark =
#{triggerConditionRemark},
</if>