任务代办修改

This commit is contained in:
zhangheng 2024-07-30 13:36:51 +08:00
parent 68846ecb7d
commit 33b058bad9
24 changed files with 1738 additions and 390 deletions

View File

@ -0,0 +1,29 @@
package com.xinelu.common.enums;
import lombok.Getter;
/**
* @Description 电话拨通情况短信发送情况公众号消息发送情况小程序模板消息发送情况
* @Author zh
* @Date 2024-07-29
*/
@Getter
public enum NodeExecuteResultStatusEnum {
/**
* 成功
*/
SUCCESS("SUCCESS"),
/**
* 失败
*/
FAILURE("FAILURE"),
;
final private String info;
NodeExecuteResultStatusEnum(String info) {
this.info = info;
}
}

View File

@ -2,6 +2,11 @@ package com.xinelu.common.enums;
import lombok.Getter; import lombok.Getter;
/**
* @Description 电话接通状态
* @Author zh
* @Date 2024-06-17
*/
@Getter @Getter
public enum PhoneConnectStatusEnum { public enum PhoneConnectStatusEnum {

View File

@ -2,6 +2,11 @@ package com.xinelu.common.enums;
import lombok.Getter; import lombok.Getter;
/**
* @Description 电话短信提醒
* @Author zh
* @Date 2024-06-17
*/
@Getter @Getter
public enum PhoneMessageRemindEnum { public enum PhoneMessageRemindEnum {

View File

@ -0,0 +1,34 @@
package com.xinelu.common.enums;
import lombok.Getter;
/**
* @Description 电话重拨次数
* @Author zh
* @Date 2024-07-29
*/
@Getter
public enum PhoneRedialTimesEnum {
/**
* 重拨一次
*/
REDIAL_ONCE("REDIAL_ONCE"),
/**
* 重拨二次
*/
REDIAL_TWICE("REDIAL_TWICE"),
/**
* 不重播
*/
NOT_REPLAY("NOT_REPLAY"),
;
final private String info;
PhoneRedialTimesEnum(String info) {
this.info = info;
}
}

View File

@ -0,0 +1,29 @@
package com.xinelu.common.enums;
import lombok.Getter;
/**
* @Description 短信发送类型
* @Author zh
* @Date 2024-07-29
*/
@Getter
public enum ShortMessageTypeEnum {
/**
* 电话同时发短信时
*/
PHONE_MSG("PHONE_MSG"),
/**
* 通用
*/
COMMON("COMMON"),
;
final private String info;
ShortMessageTypeEnum(String info) {
this.info = info;
}
}

View File

@ -158,5 +158,4 @@ public class SignPatientManageRouteController extends BaseController {
public R<List<SignPatientManageNodeAuditVo>> getRouteNodeInfo(@PathVariable("signRecordId") Long signRecordId) { public R<List<SignPatientManageNodeAuditVo>> getRouteNodeInfo(@PathVariable("signRecordId") Long signRecordId) {
return R.ok(signPatientManageRouteService.getRouteNodeInfo(signRecordId)); return R.ok(signPatientManageRouteService.getRouteNodeInfo(signRecordId));
} }
} }

View File

@ -65,7 +65,7 @@ public class PatientQuestionSubmitResult extends BaseEntity {
* 患者姓名提交者姓名 * 患者姓名提交者姓名
*/ */
@ApiModelProperty(value = "患者姓名") @ApiModelProperty(value = "患者姓名")
@Excel(name = "患者姓名", readConverterExp = "=交者姓名") @Excel(name = "患者姓名", readConverterExp = "交者姓名")
private String patientName; private String patientName;
/** /**

View File

@ -0,0 +1,128 @@
package com.xinelu.manage.domain.phonedialrecord;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.xinelu.common.annotation.Excel;
import com.xinelu.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.time.LocalDateTime;
/**
* 电话拨打记录对象 phone_dial_record
*
* @author xinelu
* @date 2024-07-29
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "电话拨打记录对象", description = "phone_dial_record")
public class PhoneDialRecord extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 主键id
*/
private Long id;
/**
* 患者id
*/
@ApiModelProperty(value = "患者id")
@Excel(name = "患者id")
private Long patientId;
/**
* 签约患者管理任务节点表id
*/
@ApiModelProperty(value = "签约患者管理任务节点表id")
@Excel(name = "签约患者管理任务节点表id")
private Long manageRouteNodeId;
/**
* 患者手机号
*/
@ApiModelProperty(value = "患者手机号")
@Excel(name = "患者手机号")
private String patientPhone;
/**
* 呼叫时间
*/
@ApiModelProperty(value = "呼叫时间")
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "呼叫时间", width = 30, dateFormat = "yyyy-MM-dd")
private LocalDateTime dialTime;
/**
* 电话模板id
*/
@ApiModelProperty(value = "电话模板id")
@Excel(name = "电话模板id")
private String phoneTemplateId;
/**
* 电话模板名称
*/
@ApiModelProperty(value = "电话模板名称")
@Excel(name = "电话模板名称")
private String phoneTemplateName;
/**
* 替换标签之后的电话内容
*/
@ApiModelProperty(value = "替换标签之后的电话内容")
@Excel(name = "替换标签之后的电话内容")
private String messageNodeContent;
/**
* AI 自动外呼 COMMON人工随访电话否则为空
*/
@ApiModelProperty(value = "AI :自动外呼 或 COMMON人工随访电话否则为空")
@Excel(name = "AI :自动外呼 或 COMMON人工随访电话否则为空")
private String phoneDialMethod;
/**
* 推送结果状态码0表示成功
*/
@ApiModelProperty(value = "推送结果状态码")
@Excel(name = "推送结果状态码", readConverterExp = "0表示成功")
private Long errorCode;
/**
* 推送结果状态码success成功fail失败
*/
@ApiModelProperty(value = "推送结果状态码success成功fail失败")
@Excel(name = "推送结果状态码success成功fail失败")
private String errorStatus;
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("patientId", getPatientId())
.append("manageRouteNodeId", getManageRouteNodeId())
.append("patientPhone", getPatientPhone())
.append("dialTime", getDialTime())
.append("phoneTemplateId", getPhoneTemplateId())
.append("phoneTemplateName", getPhoneTemplateName())
.append("messageNodeContent", getMessageNodeContent())
.append("phoneDialMethod", getPhoneDialMethod())
.append("errorCode", getErrorCode())
.append("errorStatus", getErrorStatus())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}

View File

@ -0,0 +1,121 @@
package com.xinelu.manage.domain.shortmessagesendrecord;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.xinelu.common.annotation.Excel;
import com.xinelu.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.time.LocalDateTime;
import java.util.Date;
/**
* 短信发送结果记录对象 short_message_send_record
*
* @author xinelu
* @date 2024-07-30
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "短信发送结果记录对象", description = "short_message_send_record")
public class ShortMessageSendRecord extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 主键id
*/
private Long id;
/**
* 患者id
*/
@ApiModelProperty(value = "患者id")
@Excel(name = "患者id")
private Long patientId;
/**
* 签约患者管理任务节点表id
*/
@ApiModelProperty(value = "签约患者管理任务节点表id")
@Excel(name = "签约患者管理任务节点表id")
private Long manageRouteNodeId;
/**
* 患者手机号
*/
@ApiModelProperty(value = "患者手机号")
@Excel(name = "患者手机号")
private String patientPhone;
/**
* 消息发送时间
*/
@ApiModelProperty(value = "消息发送时间")
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "消息发送时间", width = 30, dateFormat = "yyyy-MM-dd")
private LocalDateTime sendTime;
/**
* 消息模板id
*/
@ApiModelProperty(value = "消息模板id")
@Excel(name = "消息模板id")
private String messageTemplateId;
/**
* 消息内容
*/
@ApiModelProperty(value = "消息内容")
@Excel(name = "消息内容")
private String messageNodeContent;
/**
* 推送结果状态码0表示成功
*/
@ApiModelProperty(value = "推送结果状态码")
@Excel(name = "推送结果状态码", readConverterExp = "0=表示成功")
private Long errorCode;
/**
* 推送结果状态码success成功fail失败
*/
@ApiModelProperty(value = "推送结果状态码success成功fail失败")
@Excel(name = "推送结果状态码success成功fail失败")
private String errorStatus;
/**
* PHONE_MSG:电话同时发短信时COMMON:通用
*/
@ApiModelProperty(value = "PHONE_MSG:电话同时发短信时COMMON:通用")
@Excel(name = "PHONE_MSG:电话同时发短信时COMMON:通用")
private String messageType;
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("patientId", getPatientId())
.append("manageRouteNodeId", getManageRouteNodeId())
.append("patientPhone", getPatientPhone())
.append("sendTime", getSendTime())
.append("messageTemplateId", getMessageTemplateId())
.append("messageNodeContent", getMessageNodeContent())
.append("errorCode", getErrorCode())
.append("errorStatus", getErrorStatus())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("messageType", getMessageType())
.toString();
}
}

View File

@ -149,7 +149,7 @@ public class SignPatientManageRouteNode extends BaseEntity {
/** 问卷模板内容(富文本存放整个节点的信息,包含标签画像的名称以及其它,标签画像名称使用特殊符号进行标记) */ /** 问卷模板内容(富文本存放整个节点的信息,包含标签画像的名称以及其它,标签画像名称使用特殊符号进行标记) */
@ApiModelProperty(value = "问卷模板内容") @ApiModelProperty(value = "问卷模板内容")
@Excel(name = "问卷模板内容", readConverterExp = "=文本存放整个节点的信息,包含标签画像的名称以及其它,标签画像名称使用特殊符号进行标记") @Excel(name = "问卷模板内容", readConverterExp = "文本存放整个节点的信息,包含标签画像的名称以及其它,标签画像名称使用特殊符号进行标记")
private String questionnaireContent; private String questionnaireContent;
/** 问卷有效期,单位:天 */ /** 问卷有效期,单位:天 */
@ -169,7 +169,7 @@ public class SignPatientManageRouteNode extends BaseEntity {
/** 宣教文章内容(富文本存放整个节点的信息,包含标签画像的名称以及其它,标签画像名称使用特殊符号进行标记) */ /** 宣教文章内容(富文本存放整个节点的信息,包含标签画像的名称以及其它,标签画像名称使用特殊符号进行标记) */
@ApiModelProperty(value = "宣教文章内容") @ApiModelProperty(value = "宣教文章内容")
@Excel(name = "宣教文章内容", readConverterExp = "=文本存放整个节点的信息,包含标签画像的名称以及其它,标签画像名称使用特殊符号进行标记") @Excel(name = "宣教文章内容", readConverterExp = "文本存放整个节点的信息,包含标签画像的名称以及其它,标签画像名称使用特殊符号进行标记")
private String propagandaContent; private String propagandaContent;
/** 短信推送标识0未开启1已开启 */ /** 短信推送标识0未开启1已开启 */
@ -194,7 +194,7 @@ public class SignPatientManageRouteNode extends BaseEntity {
/** 短信节点内容(富文本存放整个节点的信息,包含标签画像的名称以及其它,标签画像名称使用特殊符号进行标记) */ /** 短信节点内容(富文本存放整个节点的信息,包含标签画像的名称以及其它,标签画像名称使用特殊符号进行标记) */
@ApiModelProperty(value = "短信节点内容") @ApiModelProperty(value = "短信节点内容")
@Excel(name = "短信节点内容", readConverterExp = "=文本存放整个节点的信息,包含标签画像的名称以及其它,标签画像名称使用特殊符号进行标记") @Excel(name = "短信节点内容", readConverterExp = "文本存放整个节点的信息,包含标签画像的名称以及其它,标签画像名称使用特殊符号进行标记")
private String messageNodeContent; private String messageNodeContent;
/** 公众号推送标识0未开启1已开启 */ /** 公众号推送标识0未开启1已开启 */
@ -219,7 +219,7 @@ public class SignPatientManageRouteNode extends BaseEntity {
/** 公众号节点内容(富文本存放整个节点的信息,包含标签画像的名称以及其它,标签画像名称使用特殊符号进行标记) */ /** 公众号节点内容(富文本存放整个节点的信息,包含标签画像的名称以及其它,标签画像名称使用特殊符号进行标记) */
@ApiModelProperty(value = "公众号节点内容") @ApiModelProperty(value = "公众号节点内容")
@Excel(name = "公众号节点内容", readConverterExp = "=文本存放整个节点的信息,包含标签画像的名称以及其它,标签画像名称使用特殊符号进行标记") @Excel(name = "公众号节点内容", readConverterExp = "文本存放整个节点的信息,包含标签画像的名称以及其它,标签画像名称使用特殊符号进行标记")
private String officialNodeContent; private String officialNodeContent;
/** 小程序推送标识0未开启1已开启 */ /** 小程序推送标识0未开启1已开启 */
@ -249,7 +249,7 @@ public class SignPatientManageRouteNode extends BaseEntity {
/** 小程序节点内容(富文本存放整个节点的信息,包含标签画像的名称以及其它,标签画像名称使用特殊符号进行标记) */ /** 小程序节点内容(富文本存放整个节点的信息,包含标签画像的名称以及其它,标签画像名称使用特殊符号进行标记) */
@ApiModelProperty(value = "小程序节点内容") @ApiModelProperty(value = "小程序节点内容")
@Excel(name = "小程序节点内容", readConverterExp = "=文本存放整个节点的信息,包含标签画像的名称以及其它,标签画像名称使用特殊符号进行标记") @Excel(name = "小程序节点内容", readConverterExp = "文本存放整个节点的信息,包含标签画像的名称以及其它,标签画像名称使用特殊符号进行标记")
private String appletNodeContent; private String appletNodeContent;
/** 节点审核状态同意AGREE不同意DISAGREE */ /** 节点审核状态同意AGREE不同意DISAGREE */
@ -349,4 +349,34 @@ public class SignPatientManageRouteNode extends BaseEntity {
@ApiModelProperty(value = "任务节点类型") @ApiModelProperty(value = "任务节点类型")
@Excel(name = "任务节点类型") @Excel(name = "任务节点类型")
private String taskNodeType; private String taskNodeType;
/** 电话拨通情况SUCCESS成功FAILURE失败EXPIRED超期自动作废如超期一周NULL或空字符串缺省值表示未执行 */
@ApiModelProperty(value = "电话拨通情况")
@Excel(name = "电话拨通情况")
private String phoneNodeExecuteResultStatus;
/** 电话未接通时短信发送情况SUCCESS成功FAILURE失败EXPIRED超期自动作废如超期一周NULL或空字符串缺省值表示未执行 */
@ApiModelProperty(value = "电话短信发送情况")
@Excel(name = "电话短信发送情况")
private String phoneMessageNodeExecuteResultStatus;
/** 短信发送情况SUCCESS成功FAILURE失败EXPIRED超期自动作废如超期一周NULL或空字符串缺省值表示未执行 */
@ApiModelProperty(value = "短信发送情况")
@Excel(name = "短信发送情况")
private String messageNodeExecuteResultStatus;
/** 公众号消息发送情况SUCCESS成功FAILURE失败EXPIRED超期自动作废如超期一周NULL或空字符串缺省值表示未执行 */
@ApiModelProperty(value = "公众号消息发送情况")
@Excel(name = "公众号消息发送情况")
private String officialNodeExecuteResultStatus;
/** 小程序模板消息发送情况SUCCESS成功FAILURE失败EXPIRED超期自动作废如超期一周NULL或空字符串缺省值表示未执行 */
@ApiModelProperty(value = "小程序模板消息发送情况")
@Excel(name = "小程序模板消息发送情况")
private String appletNodeExecuteResultStatus;
/** 患者宣教阅读或问卷提交的时间null表示尚未阅读或提交 */
@ApiModelProperty(value = "患者宣教阅读或问卷提交的时间")
@Excel(name = "患者宣教阅读或问卷提交的时间")
private LocalDateTime nodeFinishDate;
} }

View File

@ -17,6 +17,8 @@ import java.util.List;
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@Data @Data
public class PatientQuestionSubmitResultDTO extends PatientQuestionSubmitResult { public class PatientQuestionSubmitResultDTO extends PatientQuestionSubmitResult {
@ApiModelProperty(value = "患者手机号")
private String patientPhone;
@ApiModelProperty(value = "任务类型电话外呼PHONE_OUTBOUND问卷量表QUESTIONNAIRE_SCALE人工随访ARTIFICIAL_FOLLOW_UP") @ApiModelProperty(value = "任务类型电话外呼PHONE_OUTBOUND问卷量表QUESTIONNAIRE_SCALE人工随访ARTIFICIAL_FOLLOW_UP")
private String taskType; private String taskType;
@ -33,12 +35,33 @@ public class PatientQuestionSubmitResultDTO extends PatientQuestionSubmitResult
@ApiModelProperty(value = "任务处理信息") @ApiModelProperty(value = "任务处理信息")
private String routeHandleRemark; private String routeHandleRemark;
@ApiModelProperty(value = "电话模板ID")
private String phoneTemplateId;
@ApiModelProperty(value = "电话模板名称")
private String phoneTemplateName;
@ApiModelProperty(value = "电话内容")
private String phoneNodeContent;
@ApiModelProperty(value = "电话呼叫类型")
private String phoneDialMethod;
@ApiModelProperty(value = "电话短信模板表code")
private String phoneMessageTemplateCode;
@ApiModelProperty(value = "替换标签之后的电话内容")
private String phoneMessageTemplateContent;
@ApiModelProperty(value = "电话是否接通已接通CONNECTED未接通:NOTCONNECTED") @ApiModelProperty(value = "电话是否接通已接通CONNECTED未接通:NOTCONNECTED")
private String phoneConnectStatus; private String phoneConnectStatus;
@ApiModelProperty(value = "电话短信提醒不发送短信NOT_SEND_MESSAGE未接通发短信NOT_CONNECTED_SEND_MESSAGE接通后发短信CONNECTED_SEND_MESSAGE所有人发短信EVERYONE_SEND_MESSAGE") @ApiModelProperty(value = "电话短信提醒不发送短信NOT_SEND_MESSAGE未接通发短信NOT_CONNECTED_SEND_MESSAGE接通后发短信CONNECTED_SEND_MESSAGE所有人发短信EVERYONE_SEND_MESSAGE")
private String phoneMessageRemind; private String phoneMessageRemind;
@ApiModelProperty(value = "电话重拨次数重拨一次REDIAL_ONCE重拨二次REDIAL_TWICE不重播NOT_REPLAY")
private String phoneRedialTimes;
@ApiModelProperty(value = "患者就诊记录基本信息表id") @ApiModelProperty(value = "患者就诊记录基本信息表id")
private Long visitRecordId; private Long visitRecordId;

View File

@ -0,0 +1,61 @@
package com.xinelu.manage.mapper.phonedialrecord;
import com.xinelu.manage.domain.phonedialrecord.PhoneDialRecord;
import java.util.List;
/**
* 电话拨打记录Mapper接口
*
* @author xinelu
* @date 2024-07-29
*/
public interface PhoneDialRecordMapper {
/**
* 查询电话拨打记录
*
* @param id 电话拨打记录主键
* @return 电话拨打记录
*/
PhoneDialRecord selectPhoneDialRecordById(Long id);
/**
* 查询电话拨打记录列表
*
* @param phoneDialRecord 电话拨打记录
* @return 电话拨打记录集合
*/
List<PhoneDialRecord> selectPhoneDialRecordList(PhoneDialRecord phoneDialRecord);
/**
* 新增电话拨打记录
*
* @param phoneDialRecord 电话拨打记录
* @return 结果
*/
int insertPhoneDialRecord(PhoneDialRecord phoneDialRecord);
/**
* 修改电话拨打记录
*
* @param phoneDialRecord 电话拨打记录
* @return 结果
*/
int updatePhoneDialRecord(PhoneDialRecord phoneDialRecord);
/**
* 删除电话拨打记录
*
* @param id 电话拨打记录主键
* @return 结果
*/
int deletePhoneDialRecordById(Long id);
/**
* 批量删除电话拨打记录
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
int deletePhoneDialRecordByIds(Long[] ids);
}

View File

@ -0,0 +1,61 @@
package com.xinelu.manage.mapper.shortmessagesendrecord;
import com.xinelu.manage.domain.shortmessagesendrecord.ShortMessageSendRecord;
import java.util.List;
/**
* 短信发送结果记录Mapper接口
*
* @author xinelu
* @date 2024-07-30
*/
public interface ShortMessageSendRecordMapper {
/**
* 查询短信发送结果记录
*
* @param id 短信发送结果记录主键
* @return 短信发送结果记录
*/
ShortMessageSendRecord selectShortMessageSendRecordById(Long id);
/**
* 查询短信发送结果记录列表
*
* @param shortMessageSendRecord 短信发送结果记录
* @return 短信发送结果记录集合
*/
List<ShortMessageSendRecord> selectShortMessageSendRecordList(ShortMessageSendRecord shortMessageSendRecord);
/**
* 新增短信发送结果记录
*
* @param shortMessageSendRecord 短信发送结果记录
* @return 结果
*/
int insertShortMessageSendRecord(ShortMessageSendRecord shortMessageSendRecord);
/**
* 修改短信发送结果记录
*
* @param shortMessageSendRecord 短信发送结果记录
* @return 结果
*/
int updateShortMessageSendRecord(ShortMessageSendRecord shortMessageSendRecord);
/**
* 删除短信发送结果记录
*
* @param id 短信发送结果记录主键
* @return 结果
*/
int deleteShortMessageSendRecordById(Long id);
/**
* 批量删除短信发送结果记录
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
int deleteShortMessageSendRecordByIds(Long[] ids);
}

View File

@ -0,0 +1,61 @@
package com.xinelu.manage.service.phonedialrecord;
import com.xinelu.manage.domain.phonedialrecord.PhoneDialRecord;
import java.util.List;
/**
* 电话拨打记录Service接口
*
* @author xinelu
* @date 2024-07-29
*/
public interface IPhoneDialRecordService {
/**
* 查询电话拨打记录
*
* @param id 电话拨打记录主键
* @return 电话拨打记录
*/
PhoneDialRecord selectPhoneDialRecordById(Long id);
/**
* 查询电话拨打记录列表
*
* @param phoneDialRecord 电话拨打记录
* @return 电话拨打记录集合
*/
List<PhoneDialRecord> selectPhoneDialRecordList(PhoneDialRecord phoneDialRecord);
/**
* 新增电话拨打记录
*
* @param phoneDialRecord 电话拨打记录
* @return 结果
*/
int insertPhoneDialRecord(PhoneDialRecord phoneDialRecord);
/**
* 修改电话拨打记录
*
* @param phoneDialRecord 电话拨打记录
* @return 结果
*/
int updatePhoneDialRecord(PhoneDialRecord phoneDialRecord);
/**
* 批量删除电话拨打记录
*
* @param ids 需要删除的电话拨打记录主键集合
* @return 结果
*/
int deletePhoneDialRecordByIds(Long[] ids);
/**
* 删除电话拨打记录信息
*
* @param id 电话拨打记录主键
* @return 结果
*/
int deletePhoneDialRecordById(Long id);
}

View File

@ -0,0 +1,90 @@
package com.xinelu.manage.service.phonedialrecord.impl;
import com.xinelu.manage.domain.phonedialrecord.PhoneDialRecord;
import com.xinelu.manage.mapper.phonedialrecord.PhoneDialRecordMapper;
import com.xinelu.manage.service.phonedialrecord.IPhoneDialRecordService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.List;
/**
* 电话拨打记录Service业务层处理
*
* @author xinelu
* @date 2024-07-29
*/
@Service
public class PhoneDialRecordServiceImpl implements IPhoneDialRecordService {
@Resource
private PhoneDialRecordMapper phoneDialRecordMapper;
/**
* 查询电话拨打记录
*
* @param id 电话拨打记录主键
* @return 电话拨打记录
*/
@Override
public PhoneDialRecord selectPhoneDialRecordById(Long id) {
return phoneDialRecordMapper.selectPhoneDialRecordById(id);
}
/**
* 查询电话拨打记录列表
*
* @param phoneDialRecord 电话拨打记录
* @return 电话拨打记录
*/
@Override
public List<PhoneDialRecord> selectPhoneDialRecordList(PhoneDialRecord phoneDialRecord) {
return phoneDialRecordMapper.selectPhoneDialRecordList(phoneDialRecord);
}
/**
* 新增电话拨打记录
*
* @param phoneDialRecord 电话拨打记录
* @return 结果
*/
@Override
public int insertPhoneDialRecord(PhoneDialRecord phoneDialRecord) {
phoneDialRecord.setCreateTime(LocalDateTime.now());
return phoneDialRecordMapper.insertPhoneDialRecord(phoneDialRecord);
}
/**
* 修改电话拨打记录
*
* @param phoneDialRecord 电话拨打记录
* @return 结果
*/
@Override
public int updatePhoneDialRecord(PhoneDialRecord phoneDialRecord) {
phoneDialRecord.setUpdateTime(LocalDateTime.now());
return phoneDialRecordMapper.updatePhoneDialRecord(phoneDialRecord);
}
/**
* 批量删除电话拨打记录
*
* @param ids 需要删除的电话拨打记录主键
* @return 结果
*/
@Override
public int deletePhoneDialRecordByIds(Long[] ids) {
return phoneDialRecordMapper.deletePhoneDialRecordByIds(ids);
}
/**
* 删除电话拨打记录信息
*
* @param id 电话拨打记录主键
* @return 结果
*/
@Override
public int deletePhoneDialRecordById(Long id) {
return phoneDialRecordMapper.deletePhoneDialRecordById(id);
}
}

View File

@ -0,0 +1,61 @@
package com.xinelu.manage.service.shortmessagesendrecord;
import com.xinelu.manage.domain.shortmessagesendrecord.ShortMessageSendRecord;
import java.util.List;
/**
* 短信发送结果记录Service接口
*
* @author xinelu
* @date 2024-07-30
*/
public interface IShortMessageSendRecordService {
/**
* 查询短信发送结果记录
*
* @param id 短信发送结果记录主键
* @return 短信发送结果记录
*/
ShortMessageSendRecord selectShortMessageSendRecordById(Long id);
/**
* 查询短信发送结果记录列表
*
* @param shortMessageSendRecord 短信发送结果记录
* @return 短信发送结果记录集合
*/
List<ShortMessageSendRecord> selectShortMessageSendRecordList(ShortMessageSendRecord shortMessageSendRecord);
/**
* 新增短信发送结果记录
*
* @param shortMessageSendRecord 短信发送结果记录
* @return 结果
*/
int insertShortMessageSendRecord(ShortMessageSendRecord shortMessageSendRecord);
/**
* 修改短信发送结果记录
*
* @param shortMessageSendRecord 短信发送结果记录
* @return 结果
*/
int updateShortMessageSendRecord(ShortMessageSendRecord shortMessageSendRecord);
/**
* 批量删除短信发送结果记录
*
* @param ids 需要删除的短信发送结果记录主键集合
* @return 结果
*/
int deleteShortMessageSendRecordByIds(Long[] ids);
/**
* 删除短信发送结果记录信息
*
* @param id 短信发送结果记录主键
* @return 结果
*/
int deleteShortMessageSendRecordById(Long id);
}

View File

@ -0,0 +1,90 @@
package com.xinelu.manage.service.shortmessagesendrecord.impl;
import com.xinelu.manage.domain.shortmessagesendrecord.ShortMessageSendRecord;
import com.xinelu.manage.mapper.shortmessagesendrecord.ShortMessageSendRecordMapper;
import com.xinelu.manage.service.shortmessagesendrecord.IShortMessageSendRecordService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.List;
/**
* 短信发送结果记录Service业务层处理
*
* @author xinelu
* @date 2024-07-30
*/
@Service
public class ShortMessageSendRecordServiceImpl implements IShortMessageSendRecordService {
@Resource
private ShortMessageSendRecordMapper shortMessageSendRecordMapper;
/**
* 查询短信发送结果记录
*
* @param id 短信发送结果记录主键
* @return 短信发送结果记录
*/
@Override
public ShortMessageSendRecord selectShortMessageSendRecordById(Long id) {
return shortMessageSendRecordMapper.selectShortMessageSendRecordById(id);
}
/**
* 查询短信发送结果记录列表
*
* @param shortMessageSendRecord 短信发送结果记录
* @return 短信发送结果记录
*/
@Override
public List<ShortMessageSendRecord> selectShortMessageSendRecordList(ShortMessageSendRecord shortMessageSendRecord) {
return shortMessageSendRecordMapper.selectShortMessageSendRecordList(shortMessageSendRecord);
}
/**
* 新增短信发送结果记录
*
* @param shortMessageSendRecord 短信发送结果记录
* @return 结果
*/
@Override
public int insertShortMessageSendRecord(ShortMessageSendRecord shortMessageSendRecord) {
shortMessageSendRecord.setCreateTime(LocalDateTime.now());
return shortMessageSendRecordMapper.insertShortMessageSendRecord(shortMessageSendRecord);
}
/**
* 修改短信发送结果记录
*
* @param shortMessageSendRecord 短信发送结果记录
* @return 结果
*/
@Override
public int updateShortMessageSendRecord(ShortMessageSendRecord shortMessageSendRecord) {
shortMessageSendRecord.setUpdateTime(LocalDateTime.now());
return shortMessageSendRecordMapper.updateShortMessageSendRecord(shortMessageSendRecord);
}
/**
* 批量删除短信发送结果记录
*
* @param ids 需要删除的短信发送结果记录主键
* @return 结果
*/
@Override
public int deleteShortMessageSendRecordByIds(Long[] ids) {
return shortMessageSendRecordMapper.deleteShortMessageSendRecordByIds(ids);
}
/**
* 删除短信发送结果记录信息
*
* @param id 短信发送结果记录主键
* @return 结果
*/
@Override
public int deleteShortMessageSendRecordById(Long id) {
return shortMessageSendRecordMapper.deleteShortMessageSendRecordById(id);
}
}

View File

@ -25,7 +25,9 @@ import com.xinelu.manage.domain.patientquestionsubjectresult.PatientQuestionSubj
import com.xinelu.manage.domain.patientquestionsubmitresult.PatientQuestionSubmitResult; import com.xinelu.manage.domain.patientquestionsubmitresult.PatientQuestionSubmitResult;
import com.xinelu.manage.domain.patienttaskexecuterecord.PatientTaskExecuteRecord; import com.xinelu.manage.domain.patienttaskexecuterecord.PatientTaskExecuteRecord;
import com.xinelu.manage.domain.patientvisitrecord.PatientVisitRecord; import com.xinelu.manage.domain.patientvisitrecord.PatientVisitRecord;
import com.xinelu.manage.domain.phonedialrecord.PhoneDialRecord;
import com.xinelu.manage.domain.scriptInfo.ScriptInfo; import com.xinelu.manage.domain.scriptInfo.ScriptInfo;
import com.xinelu.manage.domain.shortmessagesendrecord.ShortMessageSendRecord;
import com.xinelu.manage.domain.signpatientmanageroute.SignPatientManageRoute; import com.xinelu.manage.domain.signpatientmanageroute.SignPatientManageRoute;
import com.xinelu.manage.domain.signpatientmanageroutenode.SignPatientManageRouteNode; import com.xinelu.manage.domain.signpatientmanageroutenode.SignPatientManageRouteNode;
import com.xinelu.manage.domain.signpatientrecord.SignPatientRecord; import com.xinelu.manage.domain.signpatientrecord.SignPatientRecord;
@ -41,7 +43,9 @@ import com.xinelu.manage.mapper.patientquestionsubjectresult.PatientQuestionSubj
import com.xinelu.manage.mapper.patientquestionsubmitresult.PatientQuestionSubmitResultMapper; import com.xinelu.manage.mapper.patientquestionsubmitresult.PatientQuestionSubmitResultMapper;
import com.xinelu.manage.mapper.patienttaskexecuterecord.PatientTaskExecuteRecordMapper; import com.xinelu.manage.mapper.patienttaskexecuterecord.PatientTaskExecuteRecordMapper;
import com.xinelu.manage.mapper.patientvisitrecord.PatientVisitRecordMapper; import com.xinelu.manage.mapper.patientvisitrecord.PatientVisitRecordMapper;
import com.xinelu.manage.mapper.phonedialrecord.PhoneDialRecordMapper;
import com.xinelu.manage.mapper.scriptInfo.ScriptInfoMapper; import com.xinelu.manage.mapper.scriptInfo.ScriptInfoMapper;
import com.xinelu.manage.mapper.shortmessagesendrecord.ShortMessageSendRecordMapper;
import com.xinelu.manage.mapper.signpatientmanageroute.SignPatientManageRouteMapper; import com.xinelu.manage.mapper.signpatientmanageroute.SignPatientManageRouteMapper;
import com.xinelu.manage.mapper.signpatientmanageroutenode.SignPatientManageRouteNodeMapper; import com.xinelu.manage.mapper.signpatientmanageroutenode.SignPatientManageRouteNodeMapper;
import com.xinelu.manage.mapper.signpatientrecord.SignPatientRecordMapper; import com.xinelu.manage.mapper.signpatientrecord.SignPatientRecordMapper;
@ -123,6 +127,10 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
private ISignPatientManageRouteNodeService signPatientManageRouteNodeService; private ISignPatientManageRouteNodeService signPatientManageRouteNodeService;
@Resource @Resource
private AliYunSmsTwoConfig aliYunSmsTwoConfig; private AliYunSmsTwoConfig aliYunSmsTwoConfig;
@Resource
private PhoneDialRecordMapper phoneDialRecordMapper;
@Resource
private ShortMessageSendRecordMapper shortMessageSendRecordMapper;
private static final String SUCCESS = "OK"; private static final String SUCCESS = "OK";
@ -291,32 +299,49 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
ArrayList<ManualFollowUpVO> manualFollowUps = new ArrayList<>(); ArrayList<ManualFollowUpVO> manualFollowUps = new ArrayList<>();
for (ManualFollowUpVO manualFollowUpVO : manualFollowUpVOS) { for (ManualFollowUpVO manualFollowUpVO : manualFollowUpVOS) {
//判断路径节点组装数据 //判断路径节点组装数据
if (manualFollowUpVO.getRouteNodeName().equals(RouteNodeNameEnum.AFTER_DISCHARGE.getInfo()) || manualFollowUpVO.getRouteNodeName().equals(RouteNodeNameEnum.AFTER_VISIT_DISCHARGE.getInfo())) { // if (manualFollowUpVO.getRouteNodeName().equals(RouteNodeNameEnum.AFTER_DISCHARGE.getInfo()) || manualFollowUpVO.getRouteNodeName().equals(RouteNodeNameEnum.AFTER_VISIT_DISCHARGE.getInfo())) {
if (manualFollowUpVO.getPatientType().equals(PatientTypeEnum.DISCHARGED_PATIENT.getInfo())) { // if (manualFollowUpVO.getPatientType().equals(PatientTypeEnum.DISCHARGED_PATIENT.getInfo())) {
LocalDate localDate = manualFollowUpVO.getDischargeTime().plusDays(manualFollowUpVO.getRouteNodeDay()).toLocalDate(); // LocalDate localDate = manualFollowUpVO.getDischargeTime().plusDays(manualFollowUpVO.getRouteNodeDay()).toLocalDate();
boolean before = localDate.isBefore(LocalDate.now()) || localDate.isEqual(LocalDate.now()); // boolean before = localDate.isBefore(LocalDate.now()) || localDate.isEqual(LocalDate.now());
if (before) { // if (before) {
manualFollowUps.add(manualFollowUpVO); // manualFollowUps.add(manualFollowUpVO);
} // }
} // }
// }
// if (manualFollowUpVO.getRouteNodeName().equals(RouteNodeNameEnum.AFTER_ADMISSION.getInfo())) {
// if (manualFollowUpVO.getPatientType().equals(PatientTypeEnum.IN_HOSPITAL_PATIENT.getInfo())) {
// LocalDate localDate = manualFollowUpVO.getAdmissionTime().plusDays(manualFollowUpVO.getRouteNodeDay()).toLocalDate();
// boolean before = localDate.isBefore(LocalDate.now()) || localDate.isEqual(LocalDate.now());
// if (before) {
// manualFollowUps.add(manualFollowUpVO);
// }
// }
// }
// if (manualFollowUpVO.getRouteNodeName().equals(RouteNodeNameEnum.AFTER_CONSULTATION.getInfo()) || manualFollowUpVO.getRouteNodeName().equals(RouteNodeNameEnum.AFTER_VISIT_DISCHARGE.getInfo())) {
// if (manualFollowUpVO.getPatientType().equals(PatientTypeEnum.OUTPATIENT.getInfo()) && manualFollowUpVO.getAdmissionTime() == null) {
// LocalDate localDate = manualFollowUpVO.getVisitTime().plusDays(manualFollowUpVO.getRouteNodeDay()).toLocalDate();
// boolean before = localDate.isBefore(LocalDate.now()) || localDate.isEqual(LocalDate.now());
// if (before) {
// manualFollowUps.add(manualFollowUpVO);
// }
// }
// }
//判断路径节点组装数据
LocalDate localDate = null;
if (Objects.nonNull(manualFollowUpVO.getDischargeTime())) {
localDate = manualFollowUpVO.getDischargeTime().plusDays(manualFollowUpVO.getRouteNodeDay()).toLocalDate();
} }
if (manualFollowUpVO.getRouteNodeName().equals(RouteNodeNameEnum.AFTER_ADMISSION.getInfo())) { if (Objects.isNull(manualFollowUpVO.getDischargeTime()) && Objects.nonNull(manualFollowUpVO.getVisitTime())) {
if (manualFollowUpVO.getPatientType().equals(PatientTypeEnum.IN_HOSPITAL_PATIENT.getInfo())) { localDate = manualFollowUpVO.getVisitTime().plusDays(manualFollowUpVO.getRouteNodeDay()).toLocalDate();
LocalDate localDate = manualFollowUpVO.getAdmissionTime().plusDays(manualFollowUpVO.getRouteNodeDay()).toLocalDate();
boolean before = localDate.isBefore(LocalDate.now()) || localDate.isEqual(LocalDate.now());
if (before) {
manualFollowUps.add(manualFollowUpVO);
}
}
} }
if (manualFollowUpVO.getRouteNodeName().equals(RouteNodeNameEnum.AFTER_CONSULTATION.getInfo()) || manualFollowUpVO.getRouteNodeName().equals(RouteNodeNameEnum.AFTER_VISIT_DISCHARGE.getInfo())) { if (Objects.isNull(localDate)) {
if (manualFollowUpVO.getPatientType().equals(PatientTypeEnum.OUTPATIENT.getInfo()) && manualFollowUpVO.getAdmissionTime() == null) { continue;
LocalDate localDate = manualFollowUpVO.getVisitTime().plusDays(manualFollowUpVO.getRouteNodeDay()).toLocalDate(); }
boolean before = localDate.isBefore(LocalDate.now()) || localDate.isEqual(LocalDate.now()); boolean before = localDate.isBefore(LocalDate.now()) || localDate.isEqual(LocalDate.now());
if (before) { if (before) {
manualFollowUps.add(manualFollowUpVO); //转换成中文
} manualFollowUpVO.setRouteNodeName(RouteNodeNameEnum.getNameByInfo(manualFollowUpVO.getRouteNodeName()).getName());
} manualFollowUps.add(manualFollowUpVO);
} }
} }
return manualFollowUps; return manualFollowUps;
@ -359,6 +384,8 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
updateSignPatientManageRouteNode(dto, routeHandlePerson, time); updateSignPatientManageRouteNode(dto, routeHandlePerson, time);
// 新增患者管理任务执行记录 // 新增患者管理任务执行记录
insertPatientTaskExecuteRecord(dto, routeHandlePerson, time); insertPatientTaskExecuteRecord(dto, routeHandlePerson, time);
// 电话记录
phoneDialRecordExtracted(dto, time);
// 发送短信 // 发送短信
if (StringUtils.isNotBlank(dto.getPhoneMessageRemind()) && (PhoneMessageRemindEnum.EVERYONE_SEND_MESSAGE.getInfo().equals(dto.getPhoneMessageRemind()) || (PhoneConnectStatusEnum.CONNECTED.getInfo().equals(dto.getPhoneConnectStatus()) && PhoneMessageRemindEnum.CONNECTED_SEND_MESSAGE.getInfo().equals(dto.getPhoneMessageRemind())) || (PhoneConnectStatusEnum.NOTCONNECTED.getInfo().equals(dto.getPhoneConnectStatus()) && PhoneMessageRemindEnum.NOT_CONNECTED_SEND_MESSAGE.getInfo().equals(dto.getPhoneMessageRemind())))) { if (StringUtils.isNotBlank(dto.getPhoneMessageRemind()) && (PhoneMessageRemindEnum.EVERYONE_SEND_MESSAGE.getInfo().equals(dto.getPhoneMessageRemind()) || (PhoneConnectStatusEnum.CONNECTED.getInfo().equals(dto.getPhoneConnectStatus()) && PhoneMessageRemindEnum.CONNECTED_SEND_MESSAGE.getInfo().equals(dto.getPhoneMessageRemind())) || (PhoneConnectStatusEnum.NOTCONNECTED.getInfo().equals(dto.getPhoneConnectStatus()) && PhoneMessageRemindEnum.NOT_CONNECTED_SEND_MESSAGE.getInfo().equals(dto.getPhoneMessageRemind())))) {
SmsInfoDTO smsInfoDTO = new SmsInfoDTO(); SmsInfoDTO smsInfoDTO = new SmsInfoDTO();
@ -367,10 +394,13 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
smsInfoDTO.setSignName(aliYunSmsTwoConfig.getSignName()); smsInfoDTO.setSignName(aliYunSmsTwoConfig.getSignName());
smsInfoDTO.setTemplateCode(aliYunSmsTwoConfig.getTemplateCode()); smsInfoDTO.setTemplateCode(aliYunSmsTwoConfig.getTemplateCode());
Boolean b = sendSms(smsInfoDTO); Boolean b = sendSms(smsInfoDTO);
//发送记录
ShortMessageSendRecordExtracted(dto, time, b);
if (!b) { if (!b) {
log.info("短信发送失败"); log.info("短信发送失败");
} else {
log.info("短信发送成功");
} }
log.info("短信发送成功");
} }
} else { } else {
// 如果任务类型不是电话外呼,更新节点任务表,新增患者管理任务执行记录,新增问卷提交结果表题目表选项表 // 如果任务类型不是电话外呼,更新节点任务表,新增患者管理任务执行记录,新增问卷提交结果表题目表选项表
@ -426,6 +456,63 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
return AjaxResult.success(); return AjaxResult.success();
} }
/**
* 短信发送记录
*
* @param dto 信息
* @param time 时间
* @param b 状态
*/
private void ShortMessageSendRecordExtracted(PatientQuestionSubmitResultDTO dto, LocalDateTime time, Boolean b) {
ShortMessageSendRecord shortMessageSendRecord = new ShortMessageSendRecord();
shortMessageSendRecord.setPatientId(dto.getPatientId());
shortMessageSendRecord.setPatientPhone(dto.getPatientPhone());
shortMessageSendRecord.setManageRouteNodeId(dto.getManageRouteNodeId());
shortMessageSendRecord.setMessageTemplateId(dto.getPhoneMessageTemplateCode());
shortMessageSendRecord.setMessageNodeContent(dto.getPhoneMessageTemplateContent());
shortMessageSendRecord.setMessageType(ShortMessageTypeEnum.PHONE_MSG.getInfo());
shortMessageSendRecord.setSendTime(time);
if (!b) {
shortMessageSendRecord.setErrorCode(1L);
shortMessageSendRecord.setErrorStatus(ErrorStatusEnum.fail.getValue());
} else {
shortMessageSendRecord.setErrorCode(0L);
shortMessageSendRecord.setErrorStatus(ErrorStatusEnum.success.getValue());
}
shortMessageSendRecord.setCreateBy(SecurityUtils.getUsername());
shortMessageSendRecord.setCreateTime(time);
shortMessageSendRecordMapper.insertShortMessageSendRecord(shortMessageSendRecord);
}
/**
* 电话记录
*
* @param dto 信息
* @param time 时间
*/
private void phoneDialRecordExtracted(PatientQuestionSubmitResultDTO dto, LocalDateTime time) {
//电话记录
PhoneDialRecord phoneDialRecord = new PhoneDialRecord();
phoneDialRecord.setPatientId(dto.getPatientId());
phoneDialRecord.setManageRouteNodeId(dto.getManageRouteNodeId());
phoneDialRecord.setPatientPhone(dto.getPatientPhone());
phoneDialRecord.setDialTime(time);
phoneDialRecord.setPhoneTemplateName(dto.getPhoneTemplateName());
phoneDialRecord.setPhoneTemplateId(dto.getPhoneTemplateId());
phoneDialRecord.setMessageNodeContent(dto.getPhoneNodeContent());
phoneDialRecord.setPhoneDialMethod(StringUtils.isBlank(dto.getPhoneDialMethod()) ? "" : dto.getPhoneDialMethod());
if (dto.getPhoneConnectStatus().equals(PhoneConnectStatusEnum.NOTCONNECTED.getInfo())) {
phoneDialRecord.setErrorCode(1L);
phoneDialRecord.setErrorStatus(ErrorStatusEnum.fail.getValue());
} else {
phoneDialRecord.setErrorCode(0L);
phoneDialRecord.setErrorStatus(ErrorStatusEnum.success.getValue());
}
phoneDialRecord.setCreateBy(SecurityUtils.getUsername());
phoneDialRecord.setCreateTime(time);
phoneDialRecordMapper.insertPhoneDialRecord(phoneDialRecord);
}
/** /**
* 话术类型代办处理详情 * 话术类型代办处理详情
*/ */
@ -434,296 +521,299 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
return AjaxResult.success(signPatientManageRouteMapper.selectSignPatientManageRouteNode(manageRouteNodeId)); return AjaxResult.success(signPatientManageRouteMapper.selectSignPatientManageRouteNode(manageRouteNodeId));
} }
/** /**
* 路径审核->路径信息获取主路径及子路径信息及节点 * 路径审核->路径信息获取主路径及子路径信息及节点
* @param signRecordId 签约记录主键 *
* @return 主路径信息及节点子路径信息及节点 * @param signRecordId 签约记录主键
*/ * @return 主路径信息及节点子路径信息及节点
@Override public SpecialDiseaseRouteAuditVo getRouteAuditInfo(Long signRecordId) { */
SignPatientRecord signPatientRecord = signPatientRecordMapper.selectByPrimaryKey(signRecordId); @Override
if (ObjectUtils.isEmpty(signPatientRecord)) { public SpecialDiseaseRouteAuditVo getRouteAuditInfo(Long signRecordId) {
throw new ServiceException("未找到该患者签约信息"); SignPatientRecord signPatientRecord = signPatientRecordMapper.selectByPrimaryKey(signRecordId);
} if (ObjectUtils.isEmpty(signPatientRecord)) {
SignPatientManageRoute manageRouteQuery = new SignPatientManageRoute(); throw new ServiceException("未找到该患者签约信息");
manageRouteQuery.setSignPatientRecordId(signRecordId); }
manageRouteQuery.setTaskCreateType(TaskCreateTypeConstant.MANUAL_MATCHE); SignPatientManageRoute manageRouteQuery = new SignPatientManageRoute();
List<SignPatientManageRoute> manageRouteList = signPatientManageRouteMapper.selectSignPatientManageRouteList(manageRouteQuery); manageRouteQuery.setSignPatientRecordId(signRecordId);
if (CollectionUtils.isEmpty(manageRouteList)) { manageRouteQuery.setTaskCreateType(TaskCreateTypeConstant.MANUAL_MATCHE);
throw new ServiceException("未找到签约管理路径"); List<SignPatientManageRoute> manageRouteList = signPatientManageRouteMapper.selectSignPatientManageRouteList(manageRouteQuery);
} if (CollectionUtils.isEmpty(manageRouteList)) {
SignPatientManageRoute signPatientManageRoute = manageRouteList.get(0); throw new ServiceException("未找到签约管理路径");
SpecialDiseaseRouteAuditVo specialDiseaseRouteAuditVo = specialDiseaseRouteService.getRouteAuditInfo(signPatientManageRoute.getRouteId()); }
if (ObjectUtils.isEmpty(specialDiseaseRouteAuditVo)) { SignPatientManageRoute signPatientManageRoute = manageRouteList.get(0);
throw new ServiceException("未找到该专病管理路径请联系管理员"); SpecialDiseaseRouteAuditVo specialDiseaseRouteAuditVo = specialDiseaseRouteService.getRouteAuditInfo(signPatientManageRoute.getRouteId());
} if (ObjectUtils.isEmpty(specialDiseaseRouteAuditVo)) {
// 计算子路径的节点执行时间 throw new ServiceException("未找到该专病管理路径请联系管理员");
PatientVisitRecord patientVisitRecord = patientVisitRecordMapper.selectPatientVisitRecordById(signPatientRecord.getPatientVisitRecordId()); }
if (ObjectUtils.isEmpty(patientVisitRecord)) { // 计算子路径的节点执行时间
throw new ServiceException("未找到患者就诊记录"); PatientVisitRecord patientVisitRecord = patientVisitRecordMapper.selectPatientVisitRecordById(signPatientRecord.getPatientVisitRecordId());
} if (ObjectUtils.isEmpty(patientVisitRecord)) {
// 计算主路径节点执行时间 throw new ServiceException("未找到患者就诊记录");
specialDiseaseRouteAuditVo.getNodeList().forEach(node -> { }
node.setRouteNodeNameCN(RouteNodeNameEnum.getNameByInfo(node.getRouteNodeName()).getName()); // 计算主路径节点执行时间
node.setExecuteTime(iSignPatientManageRouteNodeService.getExecuteTime(node.getExecutionTime(), node.getRouteNodeName(), node.getRouteNodeDay(), patientVisitRecord)); specialDiseaseRouteAuditVo.getNodeList().forEach(node -> {
}); node.setRouteNodeNameCN(RouteNodeNameEnum.getNameByInfo(node.getRouteNodeName()).getName());
// 计算子路径节点执行时间 node.setExecuteTime(iSignPatientManageRouteNodeService.getExecuteTime(node.getExecutionTime(), node.getRouteNodeName(), node.getRouteNodeDay(), patientVisitRecord));
specialDiseaseRouteAuditVo.getChildRouteList() });
.forEach(childRoute -> { // 计算子路径节点执行时间
// 判断触发条件是否满足 specialDiseaseRouteAuditVo.getChildRouteList()
boolean satisfy = signPatientManageRouteNodeService.getTriggerConditon(childRoute.getId(), signPatientRecord.getPatientId()); .forEach(childRoute -> {
childRoute.setConditionSatisfyStatus(satisfy); // 判断触发条件是否满足
childRoute.getNodeList() boolean satisfy = signPatientManageRouteNodeService.getTriggerConditon(childRoute.getId(), signPatientRecord.getPatientId());
.forEach(childNode -> childNode.setExecuteTime( childRoute.setConditionSatisfyStatus(satisfy);
iSignPatientManageRouteNodeService.getExecuteTime(childNode.getExecutionTime(), childNode.getRouteNodeName(), childNode.getRouteNodeDay(), patientVisitRecord))); childRoute.getNodeList()
}); .forEach(childNode -> childNode.setExecuteTime(
// 查询手动创建的路径 iSignPatientManageRouteNodeService.getExecuteTime(childNode.getExecutionTime(), childNode.getRouteNodeName(), childNode.getRouteNodeDay(), patientVisitRecord)));
manageRouteQuery.setTaskCreateType(TaskCreateTypeConstant.MANUAL_CREATE); });
List<SignPatientManageRoute> manualRouteList = signPatientManageRouteMapper.selectSignPatientManageRouteList(manageRouteQuery); // 查询手动创建的路径
if (CollectionUtils.isNotEmpty(manualRouteList)) { manageRouteQuery.setTaskCreateType(TaskCreateTypeConstant.MANUAL_CREATE);
// 查询节点信息组装成返回的数据类型 List<SignPatientManageRoute> manualRouteList = signPatientManageRouteMapper.selectSignPatientManageRouteList(manageRouteQuery);
manualRouteList.forEach(route -> { if (CollectionUtils.isNotEmpty(manualRouteList)) {
//boolean satisfy = signPatientManageRouteNodeService.getSignTriggerConditon(route.getId(), signPatientRecord.getPatientId()); // 查询节点信息组装成返回的数据类型
// 查询节点 manualRouteList.forEach(route -> {
List<SpecialDiseaseNodeAuditVo> nodeList = signPatientManageRouteNodeMapper.selectByRouteId(route.getId()); //boolean satisfy = signPatientManageRouteNodeService.getSignTriggerConditon(route.getId(), signPatientRecord.getPatientId());
nodeList.forEach(node-> { // 查询节点
node.setRouteNodeNameCN(RouteNodeNameEnum.getNameByInfo(node.getRouteNodeName()).getName()); List<SpecialDiseaseNodeAuditVo> nodeList = signPatientManageRouteNodeMapper.selectByRouteId(route.getId());
node.setExecuteTime(iSignPatientManageRouteNodeService.getExecuteTime(node.getExecutionTime(), node.getRouteNodeName(), node.getRouteNodeDay(), patientVisitRecord)); nodeList.forEach(node -> {
}); node.setRouteNodeNameCN(RouteNodeNameEnum.getNameByInfo(node.getRouteNodeName()).getName());
specialDiseaseRouteAuditVo.getChildRouteList().add( node.setExecuteTime(iSignPatientManageRouteNodeService.getExecuteTime(node.getExecutionTime(), node.getRouteNodeName(), node.getRouteNodeDay(), patientVisitRecord));
SpecialDiseaseChildRouteAuditVo.builder() });
.diseaseTypeName(route.getDiseaseTypeName()) specialDiseaseRouteAuditVo.getChildRouteList().add(
.routeName(route.getRouteName()) SpecialDiseaseChildRouteAuditVo.builder()
.diseaseTypeId(route.getDiseaseTypeId()) .diseaseTypeName(route.getDiseaseTypeName())
.conditionSatisfyStatus(true) .routeName(route.getRouteName())
.nodeList(nodeList).build() .diseaseTypeId(route.getDiseaseTypeId())
); .conditionSatisfyStatus(true)
}); .nodeList(nodeList).build()
} );
});
}
specialDiseaseRouteAuditVo.setRouteCheckStatus(signPatientRecord.getRouteCheckStatus()); specialDiseaseRouteAuditVo.setRouteCheckStatus(signPatientRecord.getRouteCheckStatus());
return specialDiseaseRouteAuditVo; return specialDiseaseRouteAuditVo;
} }
@Override public List<SignPatientManageNodeAuditVo> getRouteNodeInfo(Long signRecordId) { @Override
List<SignPatientManageNodeAuditVo> manageNodeAuditList = new ArrayList<>(); public List<SignPatientManageNodeAuditVo> getRouteNodeInfo(Long signRecordId) {
// 查询专病路径节点和手动创建的任务节点 List<SignPatientManageNodeAuditVo> manageNodeAuditList = new ArrayList<>();
SignPatientRecord signPatientRecord = signPatientRecordMapper.selectByPrimaryKey(signRecordId); // 查询专病路径节点和手动创建的任务节点
if (ObjectUtils.isEmpty(signPatientRecord)) { SignPatientRecord signPatientRecord = signPatientRecordMapper.selectByPrimaryKey(signRecordId);
throw new ServiceException("未找到该患者签约信息"); if (ObjectUtils.isEmpty(signPatientRecord)) {
} throw new ServiceException("未找到该患者签约信息");
SignPatientManageRoute manageRouteQuery = new SignPatientManageRoute(); }
manageRouteQuery.setSignPatientRecordId(signRecordId); SignPatientManageRoute manageRouteQuery = new SignPatientManageRoute();
manageRouteQuery.setTaskCreateType(TaskCreateTypeConstant.MANUAL_MATCHE); manageRouteQuery.setSignPatientRecordId(signRecordId);
List<SignPatientManageRoute> manageRouteList = signPatientManageRouteMapper.selectSignPatientManageRouteList(manageRouteQuery); manageRouteQuery.setTaskCreateType(TaskCreateTypeConstant.MANUAL_MATCHE);
if (CollectionUtils.isEmpty(manageRouteList)) { List<SignPatientManageRoute> manageRouteList = signPatientManageRouteMapper.selectSignPatientManageRouteList(manageRouteQuery);
throw new ServiceException("未找到签约管理路径"); if (CollectionUtils.isEmpty(manageRouteList)) {
} throw new ServiceException("未找到签约管理路径");
SignPatientManageRoute signPatientManageRoute = manageRouteList.get(0); }
// 查询主路径及子路径节点 SignPatientManageRoute signPatientManageRoute = manageRouteList.get(0);
List<RouteTaskAuditVo> nodeList = specialDiseaseNodeService.getByParentRouteId(signPatientManageRoute.getRouteId()); // 查询主路径及子路径节点
List<RouteTaskAuditVo> nodeList = specialDiseaseNodeService.getByParentRouteId(signPatientManageRoute.getRouteId());
// 查询子路径的触发条件是否满足 // 查询子路径的触发条件是否满足
Map<Long, List<RouteTaskAuditVo>> groupByRouteId = nodeList.stream().collect(Collectors.groupingBy(RouteTaskAuditVo::getRouteId)); Map<Long, List<RouteTaskAuditVo>> groupByRouteId = nodeList.stream().collect(Collectors.groupingBy(RouteTaskAuditVo::getRouteId));
Map<Long, Boolean> routeSatisfyMap = new HashMap<>(); Map<Long, Boolean> routeSatisfyMap = new HashMap<>();
for (Long routeId : groupByRouteId.keySet()) { for (Long routeId : groupByRouteId.keySet()) {
if (Objects.equals(routeId, signPatientManageRoute.getRouteId())) { if (Objects.equals(routeId, signPatientManageRoute.getRouteId())) {
// 主路径不做处理 // 主路径不做处理
routeSatisfyMap.put(routeId, true); routeSatisfyMap.put(routeId, true);
} else { } else {
boolean satisfy = signPatientManageRouteNodeService.getTriggerConditon(routeId, signPatientRecord.getPatientId()); boolean satisfy = signPatientManageRouteNodeService.getTriggerConditon(routeId, signPatientRecord.getPatientId());
routeSatisfyMap.put(routeId, satisfy); routeSatisfyMap.put(routeId, satisfy);
} }
} }
// 查询患者画像信息 // 查询患者画像信息
List<LabelFieldInfoContentVo> labelFieldContentList = labelFieldContentMapper.selectByPatientId(signPatientRecord.getPatientId()); List<LabelFieldInfoContentVo> labelFieldContentList = labelFieldContentMapper.selectByPatientId(signPatientRecord.getPatientId());
if (CollectionUtils.isEmpty(labelFieldContentList)) { if (CollectionUtils.isEmpty(labelFieldContentList)) {
throw new ServiceException("请先维护画像信息"); throw new ServiceException("请先维护画像信息");
} }
// 组装数据 // 组装数据
nodeList.forEach(node -> { nodeList.forEach(node -> {
SignPatientManageNodeAuditVo manageRouteNode = new SignPatientManageNodeAuditVo(); SignPatientManageNodeAuditVo manageRouteNode = new SignPatientManageNodeAuditVo();
BeanUtils.copyBeanProp(manageRouteNode, node); BeanUtils.copyBeanProp(manageRouteNode, node);
manageRouteNode.setManageRouteName(signPatientManageRoute.getRouteName()); manageRouteNode.setManageRouteName(signPatientManageRoute.getRouteName());
manageRouteNode.setId(null); manageRouteNode.setId(null);
manageRouteNode.setRouteNodeId(node.getId()); manageRouteNode.setRouteNodeId(node.getId());
manageRouteNode.setExecuteTime(node.getExecutionTime()); manageRouteNode.setExecuteTime(node.getExecutionTime());
manageRouteNode.setRouteNodeNameCN(RouteNodeNameEnum.getNameByInfo(node.getRouteNodeName()).getName()); manageRouteNode.setRouteNodeNameCN(RouteNodeNameEnum.getNameByInfo(node.getRouteNodeName()).getName());
manageRouteNode.setConditionSatisfyStatus(routeSatisfyMap.getOrDefault(node.getRouteId(), null)); manageRouteNode.setConditionSatisfyStatus(routeSatisfyMap.getOrDefault(node.getRouteId(), null));
JSONObject templateDetail = new JSONObject(); JSONObject templateDetail = new JSONObject();
// 根据模板类型存放模板字段 // 根据模板类型存放模板字段
if(StringUtils.isNotBlank(node.getTaskNodeType())) { if (StringUtils.isNotBlank(node.getTaskNodeType())) {
switch(node.getTaskNodeType()) { switch (node.getTaskNodeType()) {
// 宣教 // 宣教
case TaskNodeTypeConstants.PROPAGANDA_ARTICLE: case TaskNodeTypeConstants.PROPAGANDA_ARTICLE:
manageRouteNode.setPropagandaInfoId(node.getTemplateId()); manageRouteNode.setPropagandaInfoId(node.getTemplateId());
manageRouteNode.setPropagandaTitle(node.getTemplateName()); manageRouteNode.setPropagandaTitle(node.getTemplateName());
// 查询宣教表 // 查询宣教表
if (manageRouteNode.getPropagandaInfoId() != null) { if (manageRouteNode.getPropagandaInfoId() != null) {
PropagandaMaterialsVo propagandaMaterialsVo = propagandaInfoService.selectPropagandaInfoById(node.getTemplateId()); PropagandaMaterialsVo propagandaMaterialsVo = propagandaInfoService.selectPropagandaInfoById(node.getTemplateId());
if (ObjectUtils.isNotEmpty(propagandaMaterialsVo)) { if (ObjectUtils.isNotEmpty(propagandaMaterialsVo)) {
templateDetail = JSONObject.parseObject(JSONObject.toJSONString(propagandaMaterialsVo)); templateDetail = JSONObject.parseObject(JSONObject.toJSONString(propagandaMaterialsVo));
manageRouteNode.setTemplateDetail(templateDetail); manageRouteNode.setTemplateDetail(templateDetail);
} }
} }
manageRouteNode.setTemplateType(TemplateTypeConstants.PROPAGANDA); manageRouteNode.setTemplateType(TemplateTypeConstants.PROPAGANDA);
break; break;
// 问卷 // 问卷
case TaskNodeTypeConstants.QUESTIONNAIRE_SCALE: case TaskNodeTypeConstants.QUESTIONNAIRE_SCALE:
manageRouteNode.setQuestionInfoId(node.getTemplateId()); manageRouteNode.setQuestionInfoId(node.getTemplateId());
manageRouteNode.setQuestionnaireName(node.getTemplateName()); manageRouteNode.setQuestionnaireName(node.getTemplateName());
// 查询问卷详情 // 查询问卷详情
QuestionVO questionVO = questionInfoService.selectQuestionInfoById(node.getTemplateId()); QuestionVO questionVO = questionInfoService.selectQuestionInfoById(node.getTemplateId());
if (ObjectUtils.isNotEmpty(questionVO)) { if (ObjectUtils.isNotEmpty(questionVO)) {
templateDetail = JSONObject.parseObject(JSONObject.toJSONString(questionVO)); templateDetail = JSONObject.parseObject(JSONObject.toJSONString(questionVO));
manageRouteNode.setTemplateType(TemplateTypeConstants.QUESTIONNAIRE); manageRouteNode.setTemplateType(TemplateTypeConstants.QUESTIONNAIRE);
manageRouteNode.setTemplateDetail(templateDetail); manageRouteNode.setTemplateDetail(templateDetail);
} }
break; break;
// 话术 // 话术
case TaskNodeTypeConstants.PHONE_OUTBOUND: case TaskNodeTypeConstants.PHONE_OUTBOUND:
manageRouteNode.setPhoneId(node.getPhoneTemplateId()); manageRouteNode.setPhoneId(node.getPhoneTemplateId());
// 查询话术 // 查询话术
ScriptInfo scriptInfo = scriptInfoMapper.selectScriptInfoById(node.getPhoneTemplateId()); ScriptInfo scriptInfo = scriptInfoMapper.selectScriptInfoById(node.getPhoneTemplateId());
if (ObjectUtils.isNotEmpty(scriptInfo)) { if (ObjectUtils.isNotEmpty(scriptInfo)) {
// 话术库json内容替换 // 话术库json内容替换
manageRouteNode.setPhoneNodeContent(signPatientManageRouteNodeService.getFlowScheme(scriptInfo.getFlowScheme(), labelFieldContentList)); manageRouteNode.setPhoneNodeContent(signPatientManageRouteNodeService.getFlowScheme(scriptInfo.getFlowScheme(), labelFieldContentList));
templateDetail = JSONObject.parseObject(JSONObject.toJSONString(scriptInfo)); templateDetail = JSONObject.parseObject(JSONObject.toJSONString(scriptInfo));
manageRouteNode.setTemplateType(TemplateTypeConstants.SCRIPT); manageRouteNode.setTemplateType(TemplateTypeConstants.SCRIPT);
manageRouteNode.setTemplateDetail(templateDetail); manageRouteNode.setTemplateDetail(templateDetail);
} }
// 电话短信内容 // 电话短信内容
if (node.getPhoneMessageTemplateId() != null) { if (node.getPhoneMessageTemplateId() != null) {
// 查询短信库 // 查询短信库
manageRouteNode.setPhoneMessageTemplateContent(signPatientManageRouteNodeService.replaceMessageInfo(node.getPhoneMessageTemplateId(), labelFieldContentList)); manageRouteNode.setPhoneMessageTemplateContent(signPatientManageRouteNodeService.replaceMessageInfo(node.getPhoneMessageTemplateId(), labelFieldContentList));
} }
break; break;
} }
} }
// 替换短信公众号小程序内容 // 替换短信公众号小程序内容
replaceTemplateInfo(manageRouteNode, node, labelFieldContentList); replaceTemplateInfo(manageRouteNode, node, labelFieldContentList);
// 替换nodeContent // 替换nodeContent
List<SignPatientManageNodeAuditVo> manageNodeList = new ArrayList<>(); List<SignPatientManageNodeAuditVo> manageNodeList = new ArrayList<>();
if (StringUtils.contains(node.getNodeContent(), "data-w-e-type")) { if (StringUtils.contains(node.getNodeContent(), "data-w-e-type")) {
manageNodeList = signPatientManageRouteNodeService.replaceNodeContent(manageRouteNode, node.getTaskPartitionDictId(), labelFieldContentList); manageNodeList = signPatientManageRouteNodeService.replaceNodeContent(manageRouteNode, node.getTaskPartitionDictId(), labelFieldContentList);
} else { } else {
manageNodeList.add(manageRouteNode); manageNodeList.add(manageRouteNode);
} }
manageNodeAuditList.addAll(manageNodeList); manageNodeAuditList.addAll(manageNodeList);
}); });
// 查询手动创建的节点 // 查询手动创建的节点
manageRouteQuery.setTaskCreateType(TaskCreateTypeConstant.MANUAL_CREATE); manageRouteQuery.setTaskCreateType(TaskCreateTypeConstant.MANUAL_CREATE);
List<SignPatientManageRoute> createRouteList = signPatientManageRouteMapper.selectSignPatientManageRouteList(manageRouteQuery); List<SignPatientManageRoute> createRouteList = signPatientManageRouteMapper.selectSignPatientManageRouteList(manageRouteQuery);
if (CollectionUtils.isNotEmpty(createRouteList)) { if (CollectionUtils.isNotEmpty(createRouteList)) {
List<Long> manageRouteIds = createRouteList.stream().map(SignPatientManageRoute::getId).collect(Collectors.toList()); List<Long> manageRouteIds = createRouteList.stream().map(SignPatientManageRoute::getId).collect(Collectors.toList());
//for (Long routeId : manageRouteIds) { //for (Long routeId : manageRouteIds) {
// boolean satisfy = signPatientManageRouteNodeService.getSignTriggerConditon(routeId, signPatientRecord.getPatientId()); // boolean satisfy = signPatientManageRouteNodeService.getSignTriggerConditon(routeId, signPatientRecord.getPatientId());
// routeSatisfyMap.put(routeId, satisfy); // routeSatisfyMap.put(routeId, satisfy);
//} //}
List<SignPatientManageNodeAuditVo> manageNodeList = signPatientManageRouteNodeMapper.selectAuditNodeInfo(manageRouteIds); List<SignPatientManageNodeAuditVo> manageNodeList = signPatientManageRouteNodeMapper.selectAuditNodeInfo(manageRouteIds);
// 根据node去替换模板信息 // 根据node去替换模板信息
manageNodeList.forEach(manageNode -> { manageNodeList.forEach(manageNode -> {
// 判断触发条件是否满足 // 判断触发条件是否满足
manageNode.setConditionSatisfyStatus(true); manageNode.setConditionSatisfyStatus(true);
manageNode.setRouteNodeNameCN(RouteNodeNameEnum.getNameByInfo(manageNode.getRouteNodeName()).getName()); manageNode.setRouteNodeNameCN(RouteNodeNameEnum.getNameByInfo(manageNode.getRouteNodeName()).getName());
JSONObject templateDetail = new JSONObject(); JSONObject templateDetail = new JSONObject();
if (StringUtils.isNotBlank(manageNode.getTaskNodeType())) { if (StringUtils.isNotBlank(manageNode.getTaskNodeType())) {
switch(manageNode.getTaskNodeType()) { switch (manageNode.getTaskNodeType()) {
// 电话外呼 // 电话外呼
case TaskNodeTypeConstants.PHONE_OUTBOUND: case TaskNodeTypeConstants.PHONE_OUTBOUND:
// 电话外呼分为话术和问卷两种根据模板id判断选择的哪种模板 // 电话外呼分为话术和问卷两种根据模板id判断选择的哪种模板
if (manageNode.getPhoneId() != null) { // 话术 if (manageNode.getPhoneId() != null) { // 话术
ScriptInfo scriptInfo = scriptInfoMapper.selectScriptInfoById(manageNode.getPhoneId()); ScriptInfo scriptInfo = scriptInfoMapper.selectScriptInfoById(manageNode.getPhoneId());
if (ObjectUtils.isNotEmpty(scriptInfo)) { if (ObjectUtils.isNotEmpty(scriptInfo)) {
// 话术库json内容替换 // 话术库json内容替换
manageNode.setPhoneNodeContent(signPatientManageRouteNodeService.getFlowScheme(scriptInfo.getFlowScheme(), labelFieldContentList)); manageNode.setPhoneNodeContent(signPatientManageRouteNodeService.getFlowScheme(scriptInfo.getFlowScheme(), labelFieldContentList));
templateDetail = JSONObject.parseObject(JSONObject.toJSONString(scriptInfo)); templateDetail = JSONObject.parseObject(JSONObject.toJSONString(scriptInfo));
manageNode.setTemplateType(TemplateTypeConstants.SCRIPT); manageNode.setTemplateType(TemplateTypeConstants.SCRIPT);
manageNode.setTemplateDetail(templateDetail); manageNode.setTemplateDetail(templateDetail);
} }
} else if (manageNode.getQuestionInfoId() != null) { // 问卷 } else if (manageNode.getQuestionInfoId() != null) { // 问卷
// 查询问卷详情 // 查询问卷详情
QuestionVO questionVO = questionInfoService.selectQuestionInfoById(manageNode.getQuestionInfoId()); QuestionVO questionVO = questionInfoService.selectQuestionInfoById(manageNode.getQuestionInfoId());
if (ObjectUtils.isNotEmpty(questionVO)) { if (ObjectUtils.isNotEmpty(questionVO)) {
templateDetail = JSONObject.parseObject(JSONObject.toJSONString(questionVO)); templateDetail = JSONObject.parseObject(JSONObject.toJSONString(questionVO));
manageNode.setTemplateType(TemplateTypeConstants.QUESTIONNAIRE); manageNode.setTemplateType(TemplateTypeConstants.QUESTIONNAIRE);
manageNode.setTemplateDetail(templateDetail); manageNode.setTemplateDetail(templateDetail);
} }
} }
// 电话短信内容 // 电话短信内容
if (manageNode.getPhoneMessageTemplateId() != null) { if (manageNode.getPhoneMessageTemplateId() != null) {
// 查询短信库 // 查询短信库
manageNode.setPhoneMessageTemplateContent(signPatientManageRouteNodeService.replaceMessageInfo(manageNode.getPhoneMessageTemplateId(), labelFieldContentList)); manageNode.setPhoneMessageTemplateContent(signPatientManageRouteNodeService.replaceMessageInfo(manageNode.getPhoneMessageTemplateId(), labelFieldContentList));
} }
break; break;
// 问卷 // 问卷
case TaskNodeTypeConstants.QUESTIONNAIRE_SCALE: case TaskNodeTypeConstants.QUESTIONNAIRE_SCALE:
// 查询问卷详情 // 查询问卷详情
if (manageNode.getQuestionInfoId() != null) { if (manageNode.getQuestionInfoId() != null) {
QuestionVO questionVO = questionInfoService.selectQuestionInfoById(manageNode.getQuestionInfoId()); QuestionVO questionVO = questionInfoService.selectQuestionInfoById(manageNode.getQuestionInfoId());
if (ObjectUtils.isNotEmpty(questionVO)) { if (ObjectUtils.isNotEmpty(questionVO)) {
templateDetail = JSONObject.parseObject(JSONObject.toJSONString(questionVO)); templateDetail = JSONObject.parseObject(JSONObject.toJSONString(questionVO));
manageNode.setTemplateType(TemplateTypeConstants.QUESTIONNAIRE); manageNode.setTemplateType(TemplateTypeConstants.QUESTIONNAIRE);
manageNode.setTemplateDetail(templateDetail); manageNode.setTemplateDetail(templateDetail);
} }
} }
break; break;
// 宣教 // 宣教
case TaskNodeTypeConstants.PROPAGANDA_ARTICLE: case TaskNodeTypeConstants.PROPAGANDA_ARTICLE:
// 查询宣教详情 // 查询宣教详情
if (manageNode.getPropagandaInfoId() != null) { if (manageNode.getPropagandaInfoId() != null) {
PropagandaMaterialsVo propagandaMaterialsVo = propagandaInfoService.selectPropagandaInfoById(manageNode.getPropagandaInfoId()); PropagandaMaterialsVo propagandaMaterialsVo = propagandaInfoService.selectPropagandaInfoById(manageNode.getPropagandaInfoId());
if (ObjectUtils.isNotEmpty(propagandaMaterialsVo)) { if (ObjectUtils.isNotEmpty(propagandaMaterialsVo)) {
templateDetail = JSONObject.parseObject(JSONObject.toJSONString(propagandaMaterialsVo)); templateDetail = JSONObject.parseObject(JSONObject.toJSONString(propagandaMaterialsVo));
manageNode.setTemplateType(TemplateTypeConstants.PROPAGANDA); manageNode.setTemplateType(TemplateTypeConstants.PROPAGANDA);
manageNode.setTemplateDetail(templateDetail); manageNode.setTemplateDetail(templateDetail);
} }
} }
break; break;
// 文字提醒 // 文字提醒
case TaskNodeTypeConstants.TEXT_REMIND: case TaskNodeTypeConstants.TEXT_REMIND:
manageNode.setTemplateType(TaskContentConstants.TEXT_REMIND); manageNode.setTemplateType(TaskContentConstants.TEXT_REMIND);
break; break;
// 人工随访 // 人工随访
//case TaskContentConstants.ARTIFICIAL_FOLLOW_UP: //case TaskContentConstants.ARTIFICIAL_FOLLOW_UP:
// // 查询问卷详情 // // 查询问卷详情
// if (manageNode.getFollowTemplateId() != null) { // if (manageNode.getFollowTemplateId() != null) {
// QuestionVO questionVO1 = questionInfoService.selectQuestionInfoById(manageNode.getFollowTemplateId()); // QuestionVO questionVO1 = questionInfoService.selectQuestionInfoById(manageNode.getFollowTemplateId());
// if (ObjectUtils.isNotEmpty(questionVO1)) { // if (ObjectUtils.isNotEmpty(questionVO1)) {
// templateDetail = JSONObject.parseObject(JSONObject.toJSONString(questionVO1)); // templateDetail = JSONObject.parseObject(JSONObject.toJSONString(questionVO1));
// manageNode.setTemplateType(TemplateTypeConstants.QUESTIONNAIRE); // manageNode.setTemplateType(TemplateTypeConstants.QUESTIONNAIRE);
// manageNode.setTemplateDetail(templateDetail); // manageNode.setTemplateDetail(templateDetail);
// } // }
// } // }
// break; // break;
} }
} }
// 替换短信公众号小程序内容 // 替换短信公众号小程序内容
if (manageNode.getMessageTemplateId() != null) { if (manageNode.getMessageTemplateId() != null) {
// 替换短信模板 // 替换短信模板
manageNode.setMessageNodeContent(signPatientManageRouteNodeService.replaceMessageInfo(manageNode.getMessageTemplateId(), labelFieldContentList)); manageNode.setMessageNodeContent(signPatientManageRouteNodeService.replaceMessageInfo(manageNode.getMessageTemplateId(), labelFieldContentList));
} }
if (manageNode.getPhoneMessageTemplateId() != null) { if (manageNode.getPhoneMessageTemplateId() != null) {
// 替换短信模板 // 替换短信模板
manageNode.setPhoneMessageTemplateContent(signPatientManageRouteNodeService.replaceMessageInfo(manageNode.getPhoneMessageTemplateId(), labelFieldContentList)); manageNode.setPhoneMessageTemplateContent(signPatientManageRouteNodeService.replaceMessageInfo(manageNode.getPhoneMessageTemplateId(), labelFieldContentList));
} }
// 替换公众号模板 // 替换公众号模板
if (manageNode.getOfficialPushSign() != null && manageNode.getOfficialPushSign() == 1) { if (manageNode.getOfficialPushSign() != null && manageNode.getOfficialPushSign() == 1) {
manageNode.setOfficialNodeContent(signPatientManageRouteNodeService.replaceWeChatTemplate(manageNode.getOfficialTemplateId(), labelFieldContentList)); manageNode.setOfficialNodeContent(signPatientManageRouteNodeService.replaceWeChatTemplate(manageNode.getOfficialTemplateId(), labelFieldContentList));
} }
// 替换小程序模板 // 替换小程序模板
if (manageNode.getAppletPushSign() != null && manageNode.getAppletPushSign() == 1) { if (manageNode.getAppletPushSign() != null && manageNode.getAppletPushSign() == 1) {
manageNode.setAppletNodeContent(signPatientManageRouteNodeService.replaceWeChatTemplate(manageNode.getAppletTemplateId(), labelFieldContentList)); manageNode.setAppletNodeContent(signPatientManageRouteNodeService.replaceWeChatTemplate(manageNode.getAppletTemplateId(), labelFieldContentList));
} }
manageNodeAuditList.add(manageNode); manageNodeAuditList.add(manageNode);
}); });
} }
return manageNodeAuditList; return manageNodeAuditList;
} }
/** /**
* 新增患者管理任务执行记录 * 新增患者管理任务执行记录
*/ */
private Long insertPatientTaskExecuteRecord(PatientQuestionSubmitResultDTO dto, String routeHandlePerson, LocalDateTime time) { private Long insertPatientTaskExecuteRecord(PatientQuestionSubmitResultDTO dto, String routeHandlePerson, LocalDateTime time) {
@ -748,12 +838,42 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
private void updateSignPatientManageRouteNode(PatientQuestionSubmitResultDTO dto, String routeHandlePerson, LocalDateTime time) { private void updateSignPatientManageRouteNode(PatientQuestionSubmitResultDTO dto, String routeHandlePerson, LocalDateTime time) {
SignPatientManageRouteNode signPatientManageRouteNode = new SignPatientManageRouteNode(); SignPatientManageRouteNode signPatientManageRouteNode = new SignPatientManageRouteNode();
signPatientManageRouteNode.setId(dto.getManageRouteNodeId()); signPatientManageRouteNode.setId(dto.getManageRouteNodeId());
signPatientManageRouteNode.setNodeExecuteStatus(NodeExecuteStatusEnum.EXECUTED.toString()); //已接通
if (StringUtils.isNotBlank(dto.getPhoneConnectStatus()) && PhoneConnectStatusEnum.CONNECTED.getInfo().equals(dto.getPhoneConnectStatus())) {
signPatientManageRouteNode.setPhoneNodeExecuteResultStatus(NodeExecuteResultStatusEnum.SUCCESS.getInfo());
}
//未接通
if (StringUtils.isNotBlank(dto.getPhoneConnectStatus()) && PhoneConnectStatusEnum.NOTCONNECTED.getInfo().equals(dto.getPhoneConnectStatus())) {
//不重播
if (dto.getPhoneRedialTimes().equals(PhoneRedialTimesEnum.NOT_REPLAY.getInfo())) {
signPatientManageRouteNode.setPhoneNodeExecuteResultStatus(NodeExecuteResultStatusEnum.FAILURE.getInfo());
}
//重播
if (!dto.getPhoneRedialTimes().equals(PhoneRedialTimesEnum.NOT_REPLAY.getInfo())) {
PhoneDialRecord phoneDialRecord = new PhoneDialRecord();
phoneDialRecord.setManageRouteNodeId(dto.getManageRouteNodeId());
List<PhoneDialRecord> phoneDialRecords = phoneDialRecordMapper.selectPhoneDialRecordList(phoneDialRecord);
//一次
if (dto.getPhoneRedialTimes().equals(PhoneRedialTimesEnum.REDIAL_ONCE.getInfo()) && CollectionUtils.isNotEmpty(phoneDialRecords) && phoneDialRecords.size() > 0) {
signPatientManageRouteNode.setPhoneNodeExecuteResultStatus(NodeExecuteResultStatusEnum.FAILURE.getInfo());
}
//两次
if (dto.getPhoneRedialTimes().equals(PhoneRedialTimesEnum.REDIAL_ONCE.getInfo()) && CollectionUtils.isNotEmpty(phoneDialRecords) && phoneDialRecords.size() > 1) {
signPatientManageRouteNode.setPhoneNodeExecuteResultStatus(NodeExecuteResultStatusEnum.FAILURE.getInfo());
}
}
}
//执行状态电话拨通情况不是空或题目信息不是空
if (StringUtils.isNotBlank(signPatientManageRouteNode.getPhoneNodeExecuteResultStatus()) || CollectionUtils.isNotEmpty(dto.getSubjectResultDTOList())) {
signPatientManageRouteNode.setNodeExecuteStatus(NodeExecuteStatusEnum.EXECUTED.getInfo());
}
if (dto.getTaskNodeType().equals(TaskContentEnum.PHONE_OUTBOUND.getInfo())) { if (dto.getTaskNodeType().equals(TaskContentEnum.PHONE_OUTBOUND.getInfo())) {
signPatientManageRouteNode.setPhoneConnectStatus(dto.getPhoneConnectStatus()); signPatientManageRouteNode.setPhoneConnectStatus(dto.getPhoneConnectStatus());
} }
if (dto.getTaskNodeType().equals(TaskContentEnum.QUESTIONNAIRE_SCALE.getInfo())) {
signPatientManageRouteNode.setNodeFinishDate(time);
}
signPatientManageRouteNode.setRouteHandleRemark(dto.getRouteHandleRemark()); signPatientManageRouteNode.setRouteHandleRemark(dto.getRouteHandleRemark());
signPatientManageRouteNode.setPhoneConnectStatus(dto.getPhoneConnectStatus());
signPatientManageRouteNode.setRouteHandleId(dto.getRouteHandleId()); signPatientManageRouteNode.setRouteHandleId(dto.getRouteHandleId());
signPatientManageRouteNode.setRouteHandlePerson(routeHandlePerson); signPatientManageRouteNode.setRouteHandlePerson(routeHandlePerson);
signPatientManageRouteNode.setUpdateBy(routeHandlePerson); signPatientManageRouteNode.setUpdateBy(routeHandlePerson);
@ -818,24 +938,24 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
} }
private void replaceTemplateInfo(SignPatientManageNodeAuditVo manageRouteNode, RouteTaskAuditVo node, List<LabelFieldInfoContentVo> labelFieldContentList) { private void replaceTemplateInfo(SignPatientManageNodeAuditVo manageRouteNode, RouteTaskAuditVo node, List<LabelFieldInfoContentVo> labelFieldContentList) {
if (node.getMessageTemplateId() != null) { if (node.getMessageTemplateId() != null) {
// 替换短信模板 // 替换短信模板
manageRouteNode.setMessageNodeContent(signPatientManageRouteNodeService.replaceMessageInfo(node.getMessageTemplateId(), labelFieldContentList)); manageRouteNode.setMessageNodeContent(signPatientManageRouteNodeService.replaceMessageInfo(node.getMessageTemplateId(), labelFieldContentList));
} }
if (node.getPhoneMessageTemplateId() != null) { if (node.getPhoneMessageTemplateId() != null) {
// 替换短信模板 // 替换短信模板
manageRouteNode.setPhoneMessageTemplateContent(signPatientManageRouteNodeService.replaceMessageInfo(node.getPhoneMessageTemplateId(), labelFieldContentList)); manageRouteNode.setPhoneMessageTemplateContent(signPatientManageRouteNodeService.replaceMessageInfo(node.getPhoneMessageTemplateId(), labelFieldContentList));
} }
// 替换公众号模板 // 替换公众号模板
if (node.getOfficialPushSign() != null && node.getOfficialPushSign() == 1) { if (node.getOfficialPushSign() != null && node.getOfficialPushSign() == 1) {
manageRouteNode.setOfficialNodeContent(signPatientManageRouteNodeService.replaceWeChatTemplate(node.getOfficialTemplateId(), labelFieldContentList)); manageRouteNode.setOfficialNodeContent(signPatientManageRouteNodeService.replaceWeChatTemplate(node.getOfficialTemplateId(), labelFieldContentList));
} }
// 替换小程序模板 // 替换小程序模板
if (node.getAppletPushSign() != null && node.getAppletPushSign() == 1) { if (node.getAppletPushSign() != null && node.getAppletPushSign() == 1) {
manageRouteNode.setAppletNodeContent(signPatientManageRouteNodeService.replaceWeChatTemplate(node.getAppletTemplateId(), labelFieldContentList)); manageRouteNode.setAppletNodeContent(signPatientManageRouteNodeService.replaceWeChatTemplate(node.getAppletTemplateId(), labelFieldContentList));
} }
} }
/** /**

View File

@ -12,94 +12,69 @@ import lombok.Data;
@Data @Data
public class PhonePush { public class PhonePush {
/** @ApiModelProperty(value = "管理路径节点名称出院后AFTER_DISCHARGE入院后AFTER_ADMISSION就诊后AFTER_CONSULTATION")
* 管理路径节点名称出院后AFTER_DISCHARGE入院后AFTER_ADMISSION就诊后AFTER_CONSULTATION
*/
private String routeNodeName; private String routeNodeName;
/** @ApiModelProperty(value = "管理路径节点时间,时间单位为:天")
* 管理路径节点时间时间单位为
*/
private String routeNodeDay; private String routeNodeDay;
@ApiModelProperty(value = "患者id")
private Long patientId;
@ApiModelProperty(value = "患者姓名")
private String patientName; private String patientName;
/**
* 患者电话
*/
@ApiModelProperty(value = "患者电话") @ApiModelProperty(value = "患者电话")
private String patientPhone; private String patientPhone;
/** @ApiModelProperty(value = "电话推送标识")
* 电话推送标识
*/
private Integer phonePushSign; private Integer phonePushSign;
/**
* 电话话术表id
*/
@ApiModelProperty(value = "电话话术表id") @ApiModelProperty(value = "电话话术表id")
private Long phoneId; private Long phoneId;
/**
* 电话模板ID
*/
@ApiModelProperty(value = "电话模板ID") @ApiModelProperty(value = "电话模板ID")
private String phoneTemplateId; private String phoneTemplateId;
/**
* 电话模板名称
*/
@ApiModelProperty(value = "电话模板名称") @ApiModelProperty(value = "电话模板名称")
private String phoneTemplateName; private String phoneTemplateName;
/**
* 电话内容富文本存放整个节点的信息包含标签画像的名称以及其它标签画像名称使用特殊符号进行标记
*/
@ApiModelProperty(value = "电话内容") @ApiModelProperty(value = "电话内容")
private String phoneNodeContent; private String phoneNodeContent;
/** @ApiModelProperty(value = "电话呼叫类型")
* 电话重拨次数重拨一次REDIAL_ONCE重拨二次REDIAL_TWICE不重播NOT_REPLAY private String phoneDialMethod;
*/
@ApiModelProperty(value = "电话重拨次数重拨一次REDIAL_ONCE重拨二次REDIAL_TWICE不重播NOT_REPLAY") @ApiModelProperty(value = "电话重拨次数重拨一次REDIAL_ONCE重拨二次REDIAL_TWICE不重播NOT_REPLAY")
private String phoneRedialTimes; private String phoneRedialTimes;
/**
* 电话时间间隔单位为分钟
*/
@ApiModelProperty(value = "电话时间间隔,单位为:分钟") @ApiModelProperty(value = "电话时间间隔,单位为:分钟")
private Integer phoneTimeInterval; private Integer phoneTimeInterval;
/**
* 电话短信提醒不发送短信NOT_SEND_MESSAGE未接通发短信NOT_CONNECTED_SEND_MESSAGE接通后发短信CONNECTED_SEND_MESSAGE所有人发短信EVERYONE_SEND_MESSAGE
*/
@ApiModelProperty(value = "电话短信提醒不发送短信NOT_SEND_MESSAGE未接通发短信NOT_CONNECTED_SEND_MESSAGE接通后发短信CONNECTED_SEND_MESSAGE所有人发短信EVERYONE_SEND_MESSAGE") @ApiModelProperty(value = "电话短信提醒不发送短信NOT_SEND_MESSAGE未接通发短信NOT_CONNECTED_SEND_MESSAGE接通后发短信CONNECTED_SEND_MESSAGE所有人发短信EVERYONE_SEND_MESSAGE")
private String phoneMessageRemind; private String phoneMessageRemind;
/** @ApiModelProperty(value = "电话接通状态默认已接通CONNECTED未接通:NOTCONNECTED")
* 默认已接通CONNECTED未接通:NOTCONNECTED
*/
private String phoneConnectStatus; private String phoneConnectStatus;
/** @ApiModelProperty(value = "任务处理信息")
* 任务处理信息执行结果记录(电话反馈
*/
private String routeHandleRemark; private String routeHandleRemark;
/**
* 电话短信模板表id
*/
@ApiModelProperty(value = "电话短信模板表id") @ApiModelProperty(value = "电话短信模板表id")
private Long phoneMessageTemplateId; private Long phoneMessageTemplateId;
/** @ApiModelProperty(value = "电话短信模板表code")
* 电话短信模板名称 private String phoneMessageTemplateCode;
*/
@ApiModelProperty(value = "电话短信模板名称") @ApiModelProperty(value = "电话短信模板名称")
private String phoneMessageTemplateName; private String phoneMessageTemplateName;
@ApiModelProperty(value = "话术图片文件路径") @ApiModelProperty(value = "替换标签之后的电话短信内容")
private String scriptFilePath; private String phoneMessageTemplateContent;
@ApiModelProperty(value = "电话拨通情况")
private String phoneNodeExecuteResultStatus;
@ApiModelProperty(value = "电话短信发送情况")
private String phoneMessageNodeExecuteResultStatus;
} }

View File

@ -0,0 +1,212 @@
<?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.xinelu.manage.mapper.phonedialrecord.PhoneDialRecordMapper">
<resultMap type="PhoneDialRecord" id="PhoneDialRecordResult">
<result property="id" column="id"/>
<result property="patientId" column="patient_id"/>
<result property="manageRouteNodeId" column="manage_route_node_id"/>
<result property="patientPhone" column="patient_phone"/>
<result property="dialTime" column="dial_time"/>
<result property="phoneTemplateId" column="phone_template_id"/>
<result property="phoneTemplateName" column="phone_template_name"/>
<result property="messageNodeContent" column="message_node_content"/>
<result property="phoneDialMethod" column="phone_dial_method"/>
<result property="errorCode" column="error_code"/>
<result property="errorStatus" column="error_status"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
</resultMap>
<sql id="selectPhoneDialRecordVo">
select id,
patient_id,
manage_route_node_id,
patient_phone,
dial_time,
phone_template_id,
phone_template_name,
message_node_content,
phone_dial_method,
error_code,
error_status,
create_by,
create_time,
update_by,
update_time
from phone_dial_record
</sql>
<select id="selectPhoneDialRecordList" parameterType="PhoneDialRecord" resultMap="PhoneDialRecordResult">
<include refid="selectPhoneDialRecordVo"/>
<where>
<if test="patientId != null ">
and patient_id = #{patientId}
</if>
<if test="manageRouteNodeId != null ">
and manage_route_node_id = #{manageRouteNodeId}
</if>
<if test="patientPhone != null and patientPhone != ''">
and patient_phone = #{patientPhone}
</if>
<if test="dialTime != null ">
and dial_time = #{dialTime}
</if>
<if test="phoneTemplateId != null and phoneTemplateId != ''">
and phone_template_id = #{phoneTemplateId}
</if>
<if test="phoneTemplateName != null and phoneTemplateName != ''">
and phone_template_name like concat('%', #{phoneTemplateName}, '%')
</if>
<if test="messageNodeContent != null and messageNodeContent != ''">
and message_node_content = #{messageNodeContent}
</if>
<if test="phoneDialMethod != null and phoneDialMethod != ''">
and phone_dial_method = #{phoneDialMethod}
</if>
<if test="errorCode != null ">
and error_code = #{errorCode}
</if>
<if test="errorStatus != null and errorStatus != ''">
and error_status = #{errorStatus}
</if>
</where>
</select>
<select id="selectPhoneDialRecordById" parameterType="Long"
resultMap="PhoneDialRecordResult">
<include refid="selectPhoneDialRecordVo"/>
where id = #{id}
</select>
<insert id="insertPhoneDialRecord" parameterType="PhoneDialRecord" useGeneratedKeys="true"
keyProperty="id">
insert into phone_dial_record
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="patientId != null">patient_id,
</if>
<if test="manageRouteNodeId != null">manage_route_node_id,
</if>
<if test="patientPhone != null">patient_phone,
</if>
<if test="dialTime != null">dial_time,
</if>
<if test="phoneTemplateId != null">phone_template_id,
</if>
<if test="phoneTemplateName != null">phone_template_name,
</if>
<if test="messageNodeContent != null">message_node_content,
</if>
<if test="phoneDialMethod != null">phone_dial_method,
</if>
<if test="errorCode != null">error_code,
</if>
<if test="errorStatus != null">error_status,
</if>
<if test="createBy != null">create_by,
</if>
<if test="createTime != null">create_time,
</if>
<if test="updateBy != null">update_by,
</if>
<if test="updateTime != null">update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="patientId != null">#{patientId},
</if>
<if test="manageRouteNodeId != null">#{manageRouteNodeId},
</if>
<if test="patientPhone != null">#{patientPhone},
</if>
<if test="dialTime != null">#{dialTime},
</if>
<if test="phoneTemplateId != null">#{phoneTemplateId},
</if>
<if test="phoneTemplateName != null">#{phoneTemplateName},
</if>
<if test="messageNodeContent != null">#{messageNodeContent},
</if>
<if test="phoneDialMethod != null">#{phoneDialMethod},
</if>
<if test="errorCode != null">#{errorCode},
</if>
<if test="errorStatus != null">#{errorStatus},
</if>
<if test="createBy != null">#{createBy},
</if>
<if test="createTime != null">#{createTime},
</if>
<if test="updateBy != null">#{updateBy},
</if>
<if test="updateTime != null">#{updateTime},
</if>
</trim>
</insert>
<update id="updatePhoneDialRecord" parameterType="PhoneDialRecord">
update phone_dial_record
<trim prefix="SET" suffixOverrides=",">
<if test="patientId != null">patient_id =
#{patientId},
</if>
<if test="manageRouteNodeId != null">manage_route_node_id =
#{manageRouteNodeId},
</if>
<if test="patientPhone != null">patient_phone =
#{patientPhone},
</if>
<if test="dialTime != null">dial_time =
#{dialTime},
</if>
<if test="phoneTemplateId != null">phone_template_id =
#{phoneTemplateId},
</if>
<if test="phoneTemplateName != null">phone_template_name =
#{phoneTemplateName},
</if>
<if test="messageNodeContent != null">message_node_content =
#{messageNodeContent},
</if>
<if test="phoneDialMethod != null">phone_dial_method =
#{phoneDialMethod},
</if>
<if test="errorCode != null">error_code =
#{errorCode},
</if>
<if test="errorStatus != null">error_status =
#{errorStatus},
</if>
<if test="createBy != null">create_by =
#{createBy},
</if>
<if test="createTime != null">create_time =
#{createTime},
</if>
<if test="updateBy != null">update_by =
#{updateBy},
</if>
<if test="updateTime != null">update_time =
#{updateTime},
</if>
</trim>
where id = #{id}
</update>
<delete id="deletePhoneDialRecordById" parameterType="Long">
delete
from phone_dial_record
where id = #{id}
</delete>
<delete id="deletePhoneDialRecordByIds" parameterType="String">
delete from phone_dial_record where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,201 @@
<?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.xinelu.manage.mapper.shortmessagesendrecord.ShortMessageSendRecordMapper">
<resultMap type="ShortMessageSendRecord" id="ShortMessageSendRecordResult">
<result property="id" column="id"/>
<result property="patientId" column="patient_id"/>
<result property="manageRouteNodeId" column="manage_route_node_id"/>
<result property="patientPhone" column="patient_phone"/>
<result property="sendTime" column="send_time"/>
<result property="messageTemplateId" column="message_template_id"/>
<result property="messageNodeContent" column="message_node_content"/>
<result property="errorCode" column="error_code"/>
<result property="errorStatus" column="error_status"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="messageType" column="message_type"/>
</resultMap>
<sql id="selectShortMessageSendRecordVo">
select id,
patient_id,
manage_route_node_id,
patient_phone,
send_time,
message_template_id,
message_node_content,
error_code,
error_status,
create_by,
create_time,
update_by,
update_time,
message_type
from short_message_send_record
</sql>
<select id="selectShortMessageSendRecordList" parameterType="ShortMessageSendRecord"
resultMap="ShortMessageSendRecordResult">
<include refid="selectShortMessageSendRecordVo"/>
<where>
<if test="patientId != null ">
and patient_id = #{patientId}
</if>
<if test="manageRouteNodeId != null ">
and manage_route_node_id = #{manageRouteNodeId}
</if>
<if test="patientPhone != null and patientPhone != ''">
and patient_phone = #{patientPhone}
</if>
<if test="sendTime != null ">
and send_time = #{sendTime}
</if>
<if test="messageTemplateId != null and messageTemplateId != ''">
and message_template_id = #{messageTemplateId}
</if>
<if test="messageNodeContent != null and messageNodeContent != ''">
and message_node_content = #{messageNodeContent}
</if>
<if test="errorCode != null ">
and error_code = #{errorCode}
</if>
<if test="errorStatus != null and errorStatus != ''">
and error_status = #{errorStatus}
</if>
<if test="messageType != null and messageType != ''">
and message_type = #{messageType}
</if>
</where>
</select>
<select id="selectShortMessageSendRecordById" parameterType="Long"
resultMap="ShortMessageSendRecordResult">
<include refid="selectShortMessageSendRecordVo"/>
where id = #{id}
</select>
<insert id="insertShortMessageSendRecord" parameterType="ShortMessageSendRecord" useGeneratedKeys="true"
keyProperty="id">
insert into short_message_send_record
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="patientId != null">patient_id,
</if>
<if test="manageRouteNodeId != null">manage_route_node_id,
</if>
<if test="patientPhone != null">patient_phone,
</if>
<if test="sendTime != null">send_time,
</if>
<if test="messageTemplateId != null">message_template_id,
</if>
<if test="messageNodeContent != null">message_node_content,
</if>
<if test="errorCode != null">error_code,
</if>
<if test="errorStatus != null">error_status,
</if>
<if test="createBy != null">create_by,
</if>
<if test="createTime != null">create_time,
</if>
<if test="updateBy != null">update_by,
</if>
<if test="updateTime != null">update_time,
</if>
<if test="messageType != null">message_type,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="patientId != null">#{patientId},
</if>
<if test="manageRouteNodeId != null">#{manageRouteNodeId},
</if>
<if test="patientPhone != null">#{patientPhone},
</if>
<if test="sendTime != null">#{sendTime},
</if>
<if test="messageTemplateId != null">#{messageTemplateId},
</if>
<if test="messageNodeContent != null">#{messageNodeContent},
</if>
<if test="errorCode != null">#{errorCode},
</if>
<if test="errorStatus != null">#{errorStatus},
</if>
<if test="createBy != null">#{createBy},
</if>
<if test="createTime != null">#{createTime},
</if>
<if test="updateBy != null">#{updateBy},
</if>
<if test="updateTime != null">#{updateTime},
</if>
<if test="messageType != null">#{messageType},
</if>
</trim>
</insert>
<update id="updateShortMessageSendRecord" parameterType="ShortMessageSendRecord">
update short_message_send_record
<trim prefix="SET" suffixOverrides=",">
<if test="patientId != null">patient_id =
#{patientId},
</if>
<if test="manageRouteNodeId != null">manage_route_node_id =
#{manageRouteNodeId},
</if>
<if test="patientPhone != null">patient_phone =
#{patientPhone},
</if>
<if test="sendTime != null">send_time =
#{sendTime},
</if>
<if test="messageTemplateId != null">message_template_id =
#{messageTemplateId},
</if>
<if test="messageNodeContent != null">message_node_content =
#{messageNodeContent},
</if>
<if test="errorCode != null">error_code =
#{errorCode},
</if>
<if test="errorStatus != null">error_status =
#{errorStatus},
</if>
<if test="createBy != null">create_by =
#{createBy},
</if>
<if test="createTime != null">create_time =
#{createTime},
</if>
<if test="updateBy != null">update_by =
#{updateBy},
</if>
<if test="updateTime != null">update_time =
#{updateTime},
</if>
<if test="messageType != null">message_type =
#{messageType},
</if>
</trim>
where id = #{id}
</update>
<delete id="deleteShortMessageSendRecordById" parameterType="Long">
delete
from short_message_send_record
where id = #{id}
</delete>
<delete id="deleteShortMessageSendRecordByIds" parameterType="String">
delete from short_message_send_record where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -393,10 +393,13 @@
<if test="manageRouteName != null and manageRouteName != ''"> <if test="manageRouteName != null and manageRouteName != ''">
AND spmrn.manage_route_name like concat('%', #{manageRouteName}, '%') AND spmrn.manage_route_name like concat('%', #{manageRouteName}, '%')
</if> </if>
<if test="nodeExecuteStatus != null and nodeExecuteStatus = 'UNEXECUTED'">
AND (spmrn.phone_node_execute_result_status is null or spmrn.phone_node_execute_result_status = ' ')
</if>
<!-- 数据范围过滤 --> <!-- 数据范围过滤 -->
${params.dataScope} ${params.dataScope}
</where> </where>
order by spmr.create_time DESC order by spmr.create_time DESC
</select> </select>
<select id="selectFollowPatientInfo" <select id="selectFollowPatientInfo"
@ -606,7 +609,8 @@
<select id="selectSignPatientManageRouteNode" <select id="selectSignPatientManageRouteNode"
resultType="com.xinelu.manage.vo.signpatientmanageroute.PhonePush"> resultType="com.xinelu.manage.vo.signpatientmanageroute.PhonePush">
select pi.patient_name, select pi.id patientId,
pi.patient_name,
pi.patient_phone, pi.patient_phone,
spmrn.route_node_name, spmrn.route_node_name,
spmrn.phone_push_sign, spmrn.phone_push_sign,
@ -614,17 +618,21 @@
spmrn.phone_id, spmrn.phone_id,
spmrn.phone_template_id, spmrn.phone_template_id,
spmrn.phone_template_name, spmrn.phone_template_name,
spmrn.phone_node_content,
spmrn.phone_redial_times, spmrn.phone_redial_times,
spmrn.phone_dial_method,
spmrn.phone_time_interval, spmrn.phone_time_interval,
spmrn.phone_message_remind, spmrn.phone_message_remind,
spmrn.phone_connect_status, spmrn.phone_connect_status,
spmrn.route_handle_remark, spmrn.route_handle_remark,
spmrn.phone_message_template_id, spmrn.phone_message_template_id,
spmrn.phone_message_template_name, spmrn.phone_message_template_name,
spmrn.phone_node_content, spmrn.phone_node_execute_result_status,
si.script_file_path spmrn.phone_message_node_execute_result_status,
(SELECT text_message_id
FROM text_message tm
WHERE tm.id = spmrn.phone_message_template_id) phoneMessageTemplateCode
from sign_patient_manage_route_node spmrn from sign_patient_manage_route_node spmrn
LEFT JOIN script_info si ON spmrn.phone_id = si.script_id
LEFT JOIN sign_patient_manage_route spmr ON spmr.id = spmrn.manage_route_id LEFT JOIN sign_patient_manage_route spmr ON spmr.id = spmrn.manage_route_id
LEFT JOIN patient_info pi ON spmr.patient_id = pi.id LEFT JOIN patient_info pi ON spmr.patient_id = pi.id
where spmrn.id = #{manageRouteNodeId} where spmrn.id = #{manageRouteNodeId}

View File

@ -72,10 +72,15 @@
<result property="updateBy" column="update_by"/> <result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/> <result property="updateTime" column="update_time"/>
<result property="phoneDialMethod" column="phone_dial_method"/> <result property="phoneDialMethod" column="phone_dial_method"/>
<result property="phoneNodeExecuteResultStatus" column="phone_node_execute_result_status"/>
<result property="messageNodeExecuteResultStatus" column="message_node_execute_result_status"/>
<result property="officialNodeExecuteResultStatus" column="official_node_execute_result_status"/>
<result property="appletNodeExecuteResultStatus" column="applet_node_execute_result_status"/>
<result property="nodeFinishDate" column="node_finish_date"/>
</resultMap> </resultMap>
<sql id="selectSignPatientManageRouteNodeVo"> <sql id="selectSignPatientManageRouteNodeVo">
select id, manage_route_id, manage_route_name, route_node_id, route_node_name, route_node_day, task_type, task_status, task_subdivision, task_node_type, second_classify_describe, execute_time, phone_push_sign, phone_id, phone_template_id, phone_template_name, phone_node_content, phone_redial_times, phone_time_interval, phone_message_remind, phone_message_template_id, phone_message_template_name,phone_message_template_content,question_info_id, questionnaire_name, questionnaire_content, question_expiration_date, propaganda_info_id, propaganda_title, propaganda_content, message_push_sign, message_template_id, message_template_name, message_preview, message_node_content, official_push_sign, official_template_id, official_template_name, official_remind_content, official_node_content, follow_template_id, follow_template_name, applet_push_sign, applet_template_id, applet_template_name, applet_remind_content, applet_prompt_description, applet_node_content, route_check_status, route_check_person, route_check_date, route_check_remark, route_node_remark, node_execute_status, route_handle_remark, route_handle_id, route_handle_person, route_link,text_remind_content, node_content,message_status, del_flag, create_by, create_time, update_by, update_time, phone_dial_method from sign_patient_manage_route_node select id, manage_route_id, manage_route_name, route_node_id, route_node_name, route_node_day, task_type, task_status, task_subdivision, task_node_type, second_classify_describe, execute_time, phone_push_sign, phone_id, phone_template_id, phone_template_name, phone_node_content, phone_redial_times, phone_time_interval, phone_message_remind, phone_message_template_id, phone_message_template_name,phone_message_template_content,question_info_id, questionnaire_name, questionnaire_content, question_expiration_date, propaganda_info_id, propaganda_title, propaganda_content, message_push_sign, message_template_id, message_template_name, message_preview, message_node_content, official_push_sign, official_template_id, official_template_name, official_remind_content, official_node_content, follow_template_id, follow_template_name, applet_push_sign, applet_template_id, applet_template_name, applet_remind_content, applet_prompt_description, applet_node_content, route_check_status, route_check_person, route_check_date, route_check_remark, route_node_remark, node_execute_status, route_handle_remark, route_handle_id, route_handle_person, route_link,text_remind_content, node_content,message_status, del_flag, create_by, create_time, update_by, update_time, phone_dial_method, phone_node_execute_result_status, message_node_execute_result_status, official_node_execute_result_status, applet_node_execute_result_status, node_finish_date from sign_patient_manage_route_node
</sql> </sql>
<select id="selectSignPatientManageRouteNodeList" parameterType="com.xinelu.manage.dto.signpatientmanageroutenode.SignPatientManageRouteNodeDto" resultMap="SignPatientManageRouteNodeResult"> <select id="selectSignPatientManageRouteNodeList" parameterType="com.xinelu.manage.dto.signpatientmanageroutenode.SignPatientManageRouteNodeDto" resultMap="SignPatientManageRouteNodeResult">

View File

@ -38,7 +38,7 @@ public class SmsSendUtils {
private AliYunSmsTwoConfig aliYunSmsTwoConfig; private AliYunSmsTwoConfig aliYunSmsTwoConfig;
/** /**
* 发送短信 * {code}替换值发送短信
*/ */
public Boolean sendSms(SmsInfoDTO smsInfoDTO) throws ClientException, ServiceException { public Boolean sendSms(SmsInfoDTO smsInfoDTO) throws ClientException, ServiceException {
try { try {
@ -88,7 +88,7 @@ public class SmsSendUtils {
} }
/** /**
* 无替换模版发送短信 * 无替换模版发送短信
*/ */
public Boolean sendTextMessage(SmsInfoDTO smsInfoDTO) throws ClientException, ServiceException { public Boolean sendTextMessage(SmsInfoDTO smsInfoDTO) throws ClientException, ServiceException {
try { try {