diff --git a/postdischarge-common/src/main/java/com/xinelu/common/enums/NodeExecuteResultStatusEnum.java b/postdischarge-common/src/main/java/com/xinelu/common/enums/NodeExecuteResultStatusEnum.java new file mode 100644 index 00000000..aad34ac0 --- /dev/null +++ b/postdischarge-common/src/main/java/com/xinelu/common/enums/NodeExecuteResultStatusEnum.java @@ -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; + } +} diff --git a/postdischarge-common/src/main/java/com/xinelu/common/enums/PhoneConnectStatusEnum.java b/postdischarge-common/src/main/java/com/xinelu/common/enums/PhoneConnectStatusEnum.java index c907816a..9a7f2106 100644 --- a/postdischarge-common/src/main/java/com/xinelu/common/enums/PhoneConnectStatusEnum.java +++ b/postdischarge-common/src/main/java/com/xinelu/common/enums/PhoneConnectStatusEnum.java @@ -2,6 +2,11 @@ package com.xinelu.common.enums; import lombok.Getter; +/** + * @Description 电话接通状态 + * @Author zh + * @Date 2024-06-17 + */ @Getter public enum PhoneConnectStatusEnum { diff --git a/postdischarge-common/src/main/java/com/xinelu/common/enums/PhoneMessageRemindEnum.java b/postdischarge-common/src/main/java/com/xinelu/common/enums/PhoneMessageRemindEnum.java index b6960acb..4e8203f8 100644 --- a/postdischarge-common/src/main/java/com/xinelu/common/enums/PhoneMessageRemindEnum.java +++ b/postdischarge-common/src/main/java/com/xinelu/common/enums/PhoneMessageRemindEnum.java @@ -2,6 +2,11 @@ package com.xinelu.common.enums; import lombok.Getter; +/** + * @Description 电话短信提醒 + * @Author zh + * @Date 2024-06-17 + */ @Getter public enum PhoneMessageRemindEnum { diff --git a/postdischarge-common/src/main/java/com/xinelu/common/enums/PhoneRedialTimesEnum.java b/postdischarge-common/src/main/java/com/xinelu/common/enums/PhoneRedialTimesEnum.java new file mode 100644 index 00000000..02de979f --- /dev/null +++ b/postdischarge-common/src/main/java/com/xinelu/common/enums/PhoneRedialTimesEnum.java @@ -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; + } +} diff --git a/postdischarge-common/src/main/java/com/xinelu/common/enums/ShortMessageTypeEnum.java b/postdischarge-common/src/main/java/com/xinelu/common/enums/ShortMessageTypeEnum.java new file mode 100644 index 00000000..84b88cc0 --- /dev/null +++ b/postdischarge-common/src/main/java/com/xinelu/common/enums/ShortMessageTypeEnum.java @@ -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; + } +} diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/controller/signpatientmanageroute/SignPatientManageRouteController.java b/postdischarge-manage/src/main/java/com/xinelu/manage/controller/signpatientmanageroute/SignPatientManageRouteController.java index b42f8e64..4750ab03 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/controller/signpatientmanageroute/SignPatientManageRouteController.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/controller/signpatientmanageroute/SignPatientManageRouteController.java @@ -158,5 +158,4 @@ public class SignPatientManageRouteController extends BaseController { public R> getRouteNodeInfo(@PathVariable("signRecordId") Long signRecordId) { return R.ok(signPatientManageRouteService.getRouteNodeInfo(signRecordId)); } - } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/domain/patientquestionsubmitresult/PatientQuestionSubmitResult.java b/postdischarge-manage/src/main/java/com/xinelu/manage/domain/patientquestionsubmitresult/PatientQuestionSubmitResult.java index df867e44..6b69296f 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/domain/patientquestionsubmitresult/PatientQuestionSubmitResult.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/domain/patientquestionsubmitresult/PatientQuestionSubmitResult.java @@ -65,7 +65,7 @@ public class PatientQuestionSubmitResult extends BaseEntity { * 患者姓名(提交者姓名) */ @ApiModelProperty(value = "患者姓名") - @Excel(name = "患者姓名", readConverterExp = "提=交者姓名") + @Excel(name = "患者姓名", readConverterExp = "提交者姓名") private String patientName; /** diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/domain/phonedialrecord/PhoneDialRecord.java b/postdischarge-manage/src/main/java/com/xinelu/manage/domain/phonedialrecord/PhoneDialRecord.java new file mode 100644 index 00000000..b0690f05 --- /dev/null +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/domain/phonedialrecord/PhoneDialRecord.java @@ -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(); + } +} diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/domain/shortmessagesendrecord/ShortMessageSendRecord.java b/postdischarge-manage/src/main/java/com/xinelu/manage/domain/shortmessagesendrecord/ShortMessageSendRecord.java new file mode 100644 index 00000000..c1120f63 --- /dev/null +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/domain/shortmessagesendrecord/ShortMessageSendRecord.java @@ -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(); + } +} diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/domain/signpatientmanageroutenode/SignPatientManageRouteNode.java b/postdischarge-manage/src/main/java/com/xinelu/manage/domain/signpatientmanageroutenode/SignPatientManageRouteNode.java index 86b138a3..c6927d94 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/domain/signpatientmanageroutenode/SignPatientManageRouteNode.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/domain/signpatientmanageroutenode/SignPatientManageRouteNode.java @@ -149,7 +149,7 @@ public class SignPatientManageRouteNode extends BaseEntity { /** 问卷模板内容(富文本存放整个节点的信息,包含标签画像的名称以及其它,标签画像名称使用特殊符号进行标记) */ @ApiModelProperty(value = "问卷模板内容") - @Excel(name = "问卷模板内容", readConverterExp = "富=文本存放整个节点的信息,包含标签画像的名称以及其它,标签画像名称使用特殊符号进行标记") + @Excel(name = "问卷模板内容", readConverterExp = "富文本存放整个节点的信息,包含标签画像的名称以及其它,标签画像名称使用特殊符号进行标记") private String questionnaireContent; /** 问卷有效期,单位:天 */ @@ -169,7 +169,7 @@ public class SignPatientManageRouteNode extends BaseEntity { /** 宣教文章内容(富文本存放整个节点的信息,包含标签画像的名称以及其它,标签画像名称使用特殊符号进行标记) */ @ApiModelProperty(value = "宣教文章内容") - @Excel(name = "宣教文章内容", readConverterExp = "富=文本存放整个节点的信息,包含标签画像的名称以及其它,标签画像名称使用特殊符号进行标记") + @Excel(name = "宣教文章内容", readConverterExp = "富文本存放整个节点的信息,包含标签画像的名称以及其它,标签画像名称使用特殊符号进行标记") private String propagandaContent; /** 短信推送标识,0:未开启,1:已开启 */ @@ -194,7 +194,7 @@ public class SignPatientManageRouteNode extends BaseEntity { /** 短信节点内容(富文本存放整个节点的信息,包含标签画像的名称以及其它,标签画像名称使用特殊符号进行标记) */ @ApiModelProperty(value = "短信节点内容") - @Excel(name = "短信节点内容", readConverterExp = "富=文本存放整个节点的信息,包含标签画像的名称以及其它,标签画像名称使用特殊符号进行标记") + @Excel(name = "短信节点内容", readConverterExp = "富文本存放整个节点的信息,包含标签画像的名称以及其它,标签画像名称使用特殊符号进行标记") private String messageNodeContent; /** 公众号推送标识,0:未开启,1:已开启 */ @@ -219,7 +219,7 @@ public class SignPatientManageRouteNode extends BaseEntity { /** 公众号节点内容(富文本存放整个节点的信息,包含标签画像的名称以及其它,标签画像名称使用特殊符号进行标记) */ @ApiModelProperty(value = "公众号节点内容") - @Excel(name = "公众号节点内容", readConverterExp = "富=文本存放整个节点的信息,包含标签画像的名称以及其它,标签画像名称使用特殊符号进行标记") + @Excel(name = "公众号节点内容", readConverterExp = "富文本存放整个节点的信息,包含标签画像的名称以及其它,标签画像名称使用特殊符号进行标记") private String officialNodeContent; /** 小程序推送标识,0:未开启,1:已开启 */ @@ -249,7 +249,7 @@ public class SignPatientManageRouteNode extends BaseEntity { /** 小程序节点内容(富文本存放整个节点的信息,包含标签画像的名称以及其它,标签画像名称使用特殊符号进行标记) */ @ApiModelProperty(value = "小程序节点内容") - @Excel(name = "小程序节点内容", readConverterExp = "富=文本存放整个节点的信息,包含标签画像的名称以及其它,标签画像名称使用特殊符号进行标记") + @Excel(name = "小程序节点内容", readConverterExp = "富文本存放整个节点的信息,包含标签画像的名称以及其它,标签画像名称使用特殊符号进行标记") private String appletNodeContent; /** 节点审核状态,同意:AGREE,不同意:DISAGREE */ @@ -349,4 +349,34 @@ public class SignPatientManageRouteNode extends BaseEntity { @ApiModelProperty(value = "任务节点类型") @Excel(name = "任务节点类型") 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; } diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/dto/patientquestionsubmitresult/PatientQuestionSubmitResultDTO.java b/postdischarge-manage/src/main/java/com/xinelu/manage/dto/patientquestionsubmitresult/PatientQuestionSubmitResultDTO.java index 14a45fcb..77ec2d5d 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/dto/patientquestionsubmitresult/PatientQuestionSubmitResultDTO.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/dto/patientquestionsubmitresult/PatientQuestionSubmitResultDTO.java @@ -17,6 +17,8 @@ import java.util.List; @EqualsAndHashCode(callSuper = true) @Data public class PatientQuestionSubmitResultDTO extends PatientQuestionSubmitResult { + @ApiModelProperty(value = "患者手机号") + private String patientPhone; @ApiModelProperty(value = "任务类型,电话外呼:PHONE_OUTBOUND,问卷量表:QUESTIONNAIRE_SCALE,人工随访:ARTIFICIAL_FOLLOW_UP") private String taskType; @@ -33,12 +35,33 @@ public class PatientQuestionSubmitResultDTO extends PatientQuestionSubmitResult @ApiModelProperty(value = "任务处理信息") 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") private String phoneConnectStatus; @ApiModelProperty(value = "电话短信提醒,不发送短信:NOT_SEND_MESSAGE,未接通发短信:NOT_CONNECTED_SEND_MESSAGE,接通后发短信:CONNECTED_SEND_MESSAGE,所有人发短信:EVERYONE_SEND_MESSAGE") private String phoneMessageRemind; + @ApiModelProperty(value = "电话重拨次数,重拨一次:REDIAL_ONCE,重拨二次:REDIAL_TWICE,不重播:NOT_REPLAY") + private String phoneRedialTimes; + @ApiModelProperty(value = "患者就诊记录基本信息表id") private Long visitRecordId; diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/phonedialrecord/PhoneDialRecordMapper.java b/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/phonedialrecord/PhoneDialRecordMapper.java new file mode 100644 index 00000000..6f1fbe4b --- /dev/null +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/phonedialrecord/PhoneDialRecordMapper.java @@ -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 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); +} diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/shortmessagesendrecord/ShortMessageSendRecordMapper.java b/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/shortmessagesendrecord/ShortMessageSendRecordMapper.java new file mode 100644 index 00000000..561fc34f --- /dev/null +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/mapper/shortmessagesendrecord/ShortMessageSendRecordMapper.java @@ -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 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); +} diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/phonedialrecord/IPhoneDialRecordService.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/phonedialrecord/IPhoneDialRecordService.java new file mode 100644 index 00000000..3304caaa --- /dev/null +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/phonedialrecord/IPhoneDialRecordService.java @@ -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 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); +} diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/phonedialrecord/impl/PhoneDialRecordServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/phonedialrecord/impl/PhoneDialRecordServiceImpl.java new file mode 100644 index 00000000..8c9fe2c8 --- /dev/null +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/phonedialrecord/impl/PhoneDialRecordServiceImpl.java @@ -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 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); + } +} diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/shortmessagesendrecord/IShortMessageSendRecordService.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/shortmessagesendrecord/IShortMessageSendRecordService.java new file mode 100644 index 00000000..a9a32ab0 --- /dev/null +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/shortmessagesendrecord/IShortMessageSendRecordService.java @@ -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 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); +} diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/shortmessagesendrecord/impl/ShortMessageSendRecordServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/shortmessagesendrecord/impl/ShortMessageSendRecordServiceImpl.java new file mode 100644 index 00000000..42ea8463 --- /dev/null +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/shortmessagesendrecord/impl/ShortMessageSendRecordServiceImpl.java @@ -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 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); + } +} diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientmanageroute/impl/SignPatientManageRouteServiceImpl.java b/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientmanageroute/impl/SignPatientManageRouteServiceImpl.java index e903bab0..9961d8bd 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientmanageroute/impl/SignPatientManageRouteServiceImpl.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/service/signpatientmanageroute/impl/SignPatientManageRouteServiceImpl.java @@ -25,7 +25,9 @@ import com.xinelu.manage.domain.patientquestionsubjectresult.PatientQuestionSubj import com.xinelu.manage.domain.patientquestionsubmitresult.PatientQuestionSubmitResult; import com.xinelu.manage.domain.patienttaskexecuterecord.PatientTaskExecuteRecord; 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.shortmessagesendrecord.ShortMessageSendRecord; import com.xinelu.manage.domain.signpatientmanageroute.SignPatientManageRoute; import com.xinelu.manage.domain.signpatientmanageroutenode.SignPatientManageRouteNode; 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.patienttaskexecuterecord.PatientTaskExecuteRecordMapper; 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.shortmessagesendrecord.ShortMessageSendRecordMapper; import com.xinelu.manage.mapper.signpatientmanageroute.SignPatientManageRouteMapper; import com.xinelu.manage.mapper.signpatientmanageroutenode.SignPatientManageRouteNodeMapper; import com.xinelu.manage.mapper.signpatientrecord.SignPatientRecordMapper; @@ -123,6 +127,10 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout private ISignPatientManageRouteNodeService signPatientManageRouteNodeService; @Resource private AliYunSmsTwoConfig aliYunSmsTwoConfig; + @Resource + private PhoneDialRecordMapper phoneDialRecordMapper; + @Resource + private ShortMessageSendRecordMapper shortMessageSendRecordMapper; private static final String SUCCESS = "OK"; @@ -291,32 +299,49 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout ArrayList manualFollowUps = new ArrayList<>(); for (ManualFollowUpVO manualFollowUpVO : manualFollowUpVOS) { //判断路径节点,组装数据 - if (manualFollowUpVO.getRouteNodeName().equals(RouteNodeNameEnum.AFTER_DISCHARGE.getInfo()) || manualFollowUpVO.getRouteNodeName().equals(RouteNodeNameEnum.AFTER_VISIT_DISCHARGE.getInfo())) { - if (manualFollowUpVO.getPatientType().equals(PatientTypeEnum.DISCHARGED_PATIENT.getInfo())) { - LocalDate localDate = manualFollowUpVO.getDischargeTime().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_DISCHARGE.getInfo()) || manualFollowUpVO.getRouteNodeName().equals(RouteNodeNameEnum.AFTER_VISIT_DISCHARGE.getInfo())) { +// if (manualFollowUpVO.getPatientType().equals(PatientTypeEnum.DISCHARGED_PATIENT.getInfo())) { +// LocalDate localDate = manualFollowUpVO.getDischargeTime().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_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 (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 (Objects.isNull(manualFollowUpVO.getDischargeTime()) && Objects.nonNull(manualFollowUpVO.getVisitTime())) { + localDate = manualFollowUpVO.getVisitTime().plusDays(manualFollowUpVO.getRouteNodeDay()).toLocalDate(); } - 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); - } - } + if (Objects.isNull(localDate)) { + continue; + } + boolean before = localDate.isBefore(LocalDate.now()) || localDate.isEqual(LocalDate.now()); + if (before) { + //转换成中文…… + manualFollowUpVO.setRouteNodeName(RouteNodeNameEnum.getNameByInfo(manualFollowUpVO.getRouteNodeName()).getName()); + manualFollowUps.add(manualFollowUpVO); } } return manualFollowUps; @@ -359,6 +384,8 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout updateSignPatientManageRouteNode(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())))) { SmsInfoDTO smsInfoDTO = new SmsInfoDTO(); @@ -367,10 +394,13 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout smsInfoDTO.setSignName(aliYunSmsTwoConfig.getSignName()); smsInfoDTO.setTemplateCode(aliYunSmsTwoConfig.getTemplateCode()); Boolean b = sendSms(smsInfoDTO); + //发送记录 + ShortMessageSendRecordExtracted(dto, time, b); if (!b) { log.info("短信发送失败"); + } else { + log.info("短信发送成功"); } - log.info("短信发送成功"); } } else { // 如果任务类型不是电话外呼,更新节点任务表,新增患者管理任务执行记录,新增问卷提交结果表、题目表、选项表 @@ -426,6 +456,63 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout 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)); } - /** - * 路径审核->路径信息获取主路径及子路径信息及节点 - * @param signRecordId 签约记录主键 - * @return 主路径信息及节点、子路径信息及节点 - */ - @Override public SpecialDiseaseRouteAuditVo getRouteAuditInfo(Long signRecordId) { - SignPatientRecord signPatientRecord = signPatientRecordMapper.selectByPrimaryKey(signRecordId); - if (ObjectUtils.isEmpty(signPatientRecord)) { - throw new ServiceException("未找到该患者签约信息"); - } - SignPatientManageRoute manageRouteQuery = new SignPatientManageRoute(); - manageRouteQuery.setSignPatientRecordId(signRecordId); - manageRouteQuery.setTaskCreateType(TaskCreateTypeConstant.MANUAL_MATCHE); - List manageRouteList = signPatientManageRouteMapper.selectSignPatientManageRouteList(manageRouteQuery); - if (CollectionUtils.isEmpty(manageRouteList)) { - throw new ServiceException("未找到签约管理路径"); - } - SignPatientManageRoute signPatientManageRoute = manageRouteList.get(0); - 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("未找到患者就诊记录"); - } - // 计算主路径节点执行时间 - 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 -> { - // 判断触发条件是否满足 - boolean satisfy = signPatientManageRouteNodeService.getTriggerConditon(childRoute.getId(), signPatientRecord.getPatientId()); - childRoute.setConditionSatisfyStatus(satisfy); - childRoute.getNodeList() - .forEach(childNode -> childNode.setExecuteTime( - iSignPatientManageRouteNodeService.getExecuteTime(childNode.getExecutionTime(), childNode.getRouteNodeName(), childNode.getRouteNodeDay(), patientVisitRecord))); - }); - // 查询手动创建的路径 - manageRouteQuery.setTaskCreateType(TaskCreateTypeConstant.MANUAL_CREATE); - List manualRouteList = signPatientManageRouteMapper.selectSignPatientManageRouteList(manageRouteQuery); - if (CollectionUtils.isNotEmpty(manualRouteList)) { - // 查询节点信息组装成返回的数据类型 - manualRouteList.forEach(route -> { - //boolean satisfy = signPatientManageRouteNodeService.getSignTriggerConditon(route.getId(), signPatientRecord.getPatientId()); - // 查询节点 - List nodeList = signPatientManageRouteNodeMapper.selectByRouteId(route.getId()); - nodeList.forEach(node-> { - node.setRouteNodeNameCN(RouteNodeNameEnum.getNameByInfo(node.getRouteNodeName()).getName()); - node.setExecuteTime(iSignPatientManageRouteNodeService.getExecuteTime(node.getExecutionTime(), node.getRouteNodeName(), node.getRouteNodeDay(), patientVisitRecord)); - }); - specialDiseaseRouteAuditVo.getChildRouteList().add( - SpecialDiseaseChildRouteAuditVo.builder() - .diseaseTypeName(route.getDiseaseTypeName()) - .routeName(route.getRouteName()) - .diseaseTypeId(route.getDiseaseTypeId()) - .conditionSatisfyStatus(true) - .nodeList(nodeList).build() - ); - }); - } + /** + * 路径审核->路径信息获取主路径及子路径信息及节点 + * + * @param signRecordId 签约记录主键 + * @return 主路径信息及节点、子路径信息及节点 + */ + @Override + public SpecialDiseaseRouteAuditVo getRouteAuditInfo(Long signRecordId) { + SignPatientRecord signPatientRecord = signPatientRecordMapper.selectByPrimaryKey(signRecordId); + if (ObjectUtils.isEmpty(signPatientRecord)) { + throw new ServiceException("未找到该患者签约信息"); + } + SignPatientManageRoute manageRouteQuery = new SignPatientManageRoute(); + manageRouteQuery.setSignPatientRecordId(signRecordId); + manageRouteQuery.setTaskCreateType(TaskCreateTypeConstant.MANUAL_MATCHE); + List manageRouteList = signPatientManageRouteMapper.selectSignPatientManageRouteList(manageRouteQuery); + if (CollectionUtils.isEmpty(manageRouteList)) { + throw new ServiceException("未找到签约管理路径"); + } + SignPatientManageRoute signPatientManageRoute = manageRouteList.get(0); + 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("未找到患者就诊记录"); + } + // 计算主路径节点执行时间 + 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 -> { + // 判断触发条件是否满足 + boolean satisfy = signPatientManageRouteNodeService.getTriggerConditon(childRoute.getId(), signPatientRecord.getPatientId()); + childRoute.setConditionSatisfyStatus(satisfy); + childRoute.getNodeList() + .forEach(childNode -> childNode.setExecuteTime( + iSignPatientManageRouteNodeService.getExecuteTime(childNode.getExecutionTime(), childNode.getRouteNodeName(), childNode.getRouteNodeDay(), patientVisitRecord))); + }); + // 查询手动创建的路径 + manageRouteQuery.setTaskCreateType(TaskCreateTypeConstant.MANUAL_CREATE); + List manualRouteList = signPatientManageRouteMapper.selectSignPatientManageRouteList(manageRouteQuery); + if (CollectionUtils.isNotEmpty(manualRouteList)) { + // 查询节点信息组装成返回的数据类型 + manualRouteList.forEach(route -> { + //boolean satisfy = signPatientManageRouteNodeService.getSignTriggerConditon(route.getId(), signPatientRecord.getPatientId()); + // 查询节点 + List nodeList = signPatientManageRouteNodeMapper.selectByRouteId(route.getId()); + nodeList.forEach(node -> { + node.setRouteNodeNameCN(RouteNodeNameEnum.getNameByInfo(node.getRouteNodeName()).getName()); + node.setExecuteTime(iSignPatientManageRouteNodeService.getExecuteTime(node.getExecutionTime(), node.getRouteNodeName(), node.getRouteNodeDay(), patientVisitRecord)); + }); + specialDiseaseRouteAuditVo.getChildRouteList().add( + SpecialDiseaseChildRouteAuditVo.builder() + .diseaseTypeName(route.getDiseaseTypeName()) + .routeName(route.getRouteName()) + .diseaseTypeId(route.getDiseaseTypeId()) + .conditionSatisfyStatus(true) + .nodeList(nodeList).build() + ); + }); + } - specialDiseaseRouteAuditVo.setRouteCheckStatus(signPatientRecord.getRouteCheckStatus()); - return specialDiseaseRouteAuditVo; - } + specialDiseaseRouteAuditVo.setRouteCheckStatus(signPatientRecord.getRouteCheckStatus()); + return specialDiseaseRouteAuditVo; + } - @Override public List getRouteNodeInfo(Long signRecordId) { - List manageNodeAuditList = new ArrayList<>(); - // 查询专病路径节点和手动创建的任务节点 - SignPatientRecord signPatientRecord = signPatientRecordMapper.selectByPrimaryKey(signRecordId); - if (ObjectUtils.isEmpty(signPatientRecord)) { - throw new ServiceException("未找到该患者签约信息"); - } - SignPatientManageRoute manageRouteQuery = new SignPatientManageRoute(); - manageRouteQuery.setSignPatientRecordId(signRecordId); - manageRouteQuery.setTaskCreateType(TaskCreateTypeConstant.MANUAL_MATCHE); - List manageRouteList = signPatientManageRouteMapper.selectSignPatientManageRouteList(manageRouteQuery); - if (CollectionUtils.isEmpty(manageRouteList)) { - throw new ServiceException("未找到签约管理路径"); - } - SignPatientManageRoute signPatientManageRoute = manageRouteList.get(0); - // 查询主路径及子路径节点 - List nodeList = specialDiseaseNodeService.getByParentRouteId(signPatientManageRoute.getRouteId()); + @Override + public List getRouteNodeInfo(Long signRecordId) { + List manageNodeAuditList = new ArrayList<>(); + // 查询专病路径节点和手动创建的任务节点 + SignPatientRecord signPatientRecord = signPatientRecordMapper.selectByPrimaryKey(signRecordId); + if (ObjectUtils.isEmpty(signPatientRecord)) { + throw new ServiceException("未找到该患者签约信息"); + } + SignPatientManageRoute manageRouteQuery = new SignPatientManageRoute(); + manageRouteQuery.setSignPatientRecordId(signRecordId); + manageRouteQuery.setTaskCreateType(TaskCreateTypeConstant.MANUAL_MATCHE); + List manageRouteList = signPatientManageRouteMapper.selectSignPatientManageRouteList(manageRouteQuery); + if (CollectionUtils.isEmpty(manageRouteList)) { + throw new ServiceException("未找到签约管理路径"); + } + SignPatientManageRoute signPatientManageRoute = manageRouteList.get(0); + // 查询主路径及子路径节点 + List nodeList = specialDiseaseNodeService.getByParentRouteId(signPatientManageRoute.getRouteId()); - // 查询子路径的触发条件是否满足 - Map> groupByRouteId = nodeList.stream().collect(Collectors.groupingBy(RouteTaskAuditVo::getRouteId)); - Map routeSatisfyMap = new HashMap<>(); - for (Long routeId : groupByRouteId.keySet()) { - if (Objects.equals(routeId, signPatientManageRoute.getRouteId())) { - // 主路径不做处理 - routeSatisfyMap.put(routeId, true); - } else { - boolean satisfy = signPatientManageRouteNodeService.getTriggerConditon(routeId, signPatientRecord.getPatientId()); - routeSatisfyMap.put(routeId, satisfy); - } - } + // 查询子路径的触发条件是否满足 + Map> groupByRouteId = nodeList.stream().collect(Collectors.groupingBy(RouteTaskAuditVo::getRouteId)); + Map routeSatisfyMap = new HashMap<>(); + for (Long routeId : groupByRouteId.keySet()) { + if (Objects.equals(routeId, signPatientManageRoute.getRouteId())) { + // 主路径不做处理 + routeSatisfyMap.put(routeId, true); + } else { + boolean satisfy = signPatientManageRouteNodeService.getTriggerConditon(routeId, signPatientRecord.getPatientId()); + routeSatisfyMap.put(routeId, satisfy); + } + } - // 查询患者画像信息 - List labelFieldContentList = labelFieldContentMapper.selectByPatientId(signPatientRecord.getPatientId()); - if (CollectionUtils.isEmpty(labelFieldContentList)) { - throw new ServiceException("请先维护画像信息"); - } - // 组装数据 - nodeList.forEach(node -> { - SignPatientManageNodeAuditVo manageRouteNode = new SignPatientManageNodeAuditVo(); - BeanUtils.copyBeanProp(manageRouteNode, node); - manageRouteNode.setManageRouteName(signPatientManageRoute.getRouteName()); - manageRouteNode.setId(null); - manageRouteNode.setRouteNodeId(node.getId()); - manageRouteNode.setExecuteTime(node.getExecutionTime()); - manageRouteNode.setRouteNodeNameCN(RouteNodeNameEnum.getNameByInfo(node.getRouteNodeName()).getName()); - manageRouteNode.setConditionSatisfyStatus(routeSatisfyMap.getOrDefault(node.getRouteId(), null)); + // 查询患者画像信息 + List labelFieldContentList = labelFieldContentMapper.selectByPatientId(signPatientRecord.getPatientId()); + if (CollectionUtils.isEmpty(labelFieldContentList)) { + throw new ServiceException("请先维护画像信息"); + } + // 组装数据 + nodeList.forEach(node -> { + SignPatientManageNodeAuditVo manageRouteNode = new SignPatientManageNodeAuditVo(); + BeanUtils.copyBeanProp(manageRouteNode, node); + manageRouteNode.setManageRouteName(signPatientManageRoute.getRouteName()); + manageRouteNode.setId(null); + manageRouteNode.setRouteNodeId(node.getId()); + manageRouteNode.setExecuteTime(node.getExecutionTime()); + manageRouteNode.setRouteNodeNameCN(RouteNodeNameEnum.getNameByInfo(node.getRouteNodeName()).getName()); + manageRouteNode.setConditionSatisfyStatus(routeSatisfyMap.getOrDefault(node.getRouteId(), null)); - JSONObject templateDetail = new JSONObject(); - // 根据模板类型,存放模板字段 - if(StringUtils.isNotBlank(node.getTaskNodeType())) { - switch(node.getTaskNodeType()) { - // 宣教 - case TaskNodeTypeConstants.PROPAGANDA_ARTICLE: - manageRouteNode.setPropagandaInfoId(node.getTemplateId()); - manageRouteNode.setPropagandaTitle(node.getTemplateName()); - // 查询宣教表 - if (manageRouteNode.getPropagandaInfoId() != null) { - PropagandaMaterialsVo propagandaMaterialsVo = propagandaInfoService.selectPropagandaInfoById(node.getTemplateId()); - if (ObjectUtils.isNotEmpty(propagandaMaterialsVo)) { - templateDetail = JSONObject.parseObject(JSONObject.toJSONString(propagandaMaterialsVo)); - manageRouteNode.setTemplateDetail(templateDetail); - } - } - manageRouteNode.setTemplateType(TemplateTypeConstants.PROPAGANDA); - break; - // 问卷 - case TaskNodeTypeConstants.QUESTIONNAIRE_SCALE: - manageRouteNode.setQuestionInfoId(node.getTemplateId()); - manageRouteNode.setQuestionnaireName(node.getTemplateName()); - // 查询问卷详情 - QuestionVO questionVO = questionInfoService.selectQuestionInfoById(node.getTemplateId()); - if (ObjectUtils.isNotEmpty(questionVO)) { - templateDetail = JSONObject.parseObject(JSONObject.toJSONString(questionVO)); - manageRouteNode.setTemplateType(TemplateTypeConstants.QUESTIONNAIRE); - manageRouteNode.setTemplateDetail(templateDetail); - } - break; - // 话术 - case TaskNodeTypeConstants.PHONE_OUTBOUND: - manageRouteNode.setPhoneId(node.getPhoneTemplateId()); - // 查询话术 - ScriptInfo scriptInfo = scriptInfoMapper.selectScriptInfoById(node.getPhoneTemplateId()); - if (ObjectUtils.isNotEmpty(scriptInfo)) { - // 话术库json内容替换 - manageRouteNode.setPhoneNodeContent(signPatientManageRouteNodeService.getFlowScheme(scriptInfo.getFlowScheme(), labelFieldContentList)); - templateDetail = JSONObject.parseObject(JSONObject.toJSONString(scriptInfo)); - manageRouteNode.setTemplateType(TemplateTypeConstants.SCRIPT); - manageRouteNode.setTemplateDetail(templateDetail); - } - // 电话短信内容 - if (node.getPhoneMessageTemplateId() != null) { - // 查询短信库 - manageRouteNode.setPhoneMessageTemplateContent(signPatientManageRouteNodeService.replaceMessageInfo(node.getPhoneMessageTemplateId(), labelFieldContentList)); - } - break; - } - } - // 替换短信、公众号、小程序内容 - replaceTemplateInfo(manageRouteNode, node, labelFieldContentList); - // 替换nodeContent - List manageNodeList = new ArrayList<>(); - if (StringUtils.contains(node.getNodeContent(), "data-w-e-type")) { - manageNodeList = signPatientManageRouteNodeService.replaceNodeContent(manageRouteNode, node.getTaskPartitionDictId(), labelFieldContentList); - } else { - manageNodeList.add(manageRouteNode); - } - manageNodeAuditList.addAll(manageNodeList); - }); - // 查询手动创建的节点 - manageRouteQuery.setTaskCreateType(TaskCreateTypeConstant.MANUAL_CREATE); - List createRouteList = signPatientManageRouteMapper.selectSignPatientManageRouteList(manageRouteQuery); - if (CollectionUtils.isNotEmpty(createRouteList)) { - List manageRouteIds = createRouteList.stream().map(SignPatientManageRoute::getId).collect(Collectors.toList()); - //for (Long routeId : manageRouteIds) { - // boolean satisfy = signPatientManageRouteNodeService.getSignTriggerConditon(routeId, signPatientRecord.getPatientId()); - // routeSatisfyMap.put(routeId, satisfy); - //} - List manageNodeList = signPatientManageRouteNodeMapper.selectAuditNodeInfo(manageRouteIds); - // 根据node去替换模板信息 - manageNodeList.forEach(manageNode -> { - // 判断触发条件是否满足 - manageNode.setConditionSatisfyStatus(true); - manageNode.setRouteNodeNameCN(RouteNodeNameEnum.getNameByInfo(manageNode.getRouteNodeName()).getName()); - JSONObject templateDetail = new JSONObject(); - if (StringUtils.isNotBlank(manageNode.getTaskNodeType())) { - switch(manageNode.getTaskNodeType()) { - // 电话外呼 - case TaskNodeTypeConstants.PHONE_OUTBOUND: - // 电话外呼分为话术和问卷两种,根据模板id判断选择的哪种模板 - if (manageNode.getPhoneId() != null) { // 话术 - ScriptInfo scriptInfo = scriptInfoMapper.selectScriptInfoById(manageNode.getPhoneId()); - if (ObjectUtils.isNotEmpty(scriptInfo)) { - // 话术库json内容替换 - manageNode.setPhoneNodeContent(signPatientManageRouteNodeService.getFlowScheme(scriptInfo.getFlowScheme(), labelFieldContentList)); - templateDetail = JSONObject.parseObject(JSONObject.toJSONString(scriptInfo)); - manageNode.setTemplateType(TemplateTypeConstants.SCRIPT); - manageNode.setTemplateDetail(templateDetail); - } - } else if (manageNode.getQuestionInfoId() != null) { // 问卷 - // 查询问卷详情 - QuestionVO questionVO = questionInfoService.selectQuestionInfoById(manageNode.getQuestionInfoId()); - if (ObjectUtils.isNotEmpty(questionVO)) { - templateDetail = JSONObject.parseObject(JSONObject.toJSONString(questionVO)); - manageNode.setTemplateType(TemplateTypeConstants.QUESTIONNAIRE); - manageNode.setTemplateDetail(templateDetail); - } - } - // 电话短信内容 - if (manageNode.getPhoneMessageTemplateId() != null) { - // 查询短信库 - manageNode.setPhoneMessageTemplateContent(signPatientManageRouteNodeService.replaceMessageInfo(manageNode.getPhoneMessageTemplateId(), labelFieldContentList)); - } - break; - // 问卷 - case TaskNodeTypeConstants.QUESTIONNAIRE_SCALE: - // 查询问卷详情 - if (manageNode.getQuestionInfoId() != null) { - QuestionVO questionVO = questionInfoService.selectQuestionInfoById(manageNode.getQuestionInfoId()); - if (ObjectUtils.isNotEmpty(questionVO)) { - templateDetail = JSONObject.parseObject(JSONObject.toJSONString(questionVO)); - manageNode.setTemplateType(TemplateTypeConstants.QUESTIONNAIRE); - manageNode.setTemplateDetail(templateDetail); - } - } - break; - // 宣教 - case TaskNodeTypeConstants.PROPAGANDA_ARTICLE: - // 查询宣教详情 - if (manageNode.getPropagandaInfoId() != null) { - PropagandaMaterialsVo propagandaMaterialsVo = propagandaInfoService.selectPropagandaInfoById(manageNode.getPropagandaInfoId()); - if (ObjectUtils.isNotEmpty(propagandaMaterialsVo)) { - templateDetail = JSONObject.parseObject(JSONObject.toJSONString(propagandaMaterialsVo)); - manageNode.setTemplateType(TemplateTypeConstants.PROPAGANDA); - manageNode.setTemplateDetail(templateDetail); - } - } - break; - // 文字提醒 - case TaskNodeTypeConstants.TEXT_REMIND: - manageNode.setTemplateType(TaskContentConstants.TEXT_REMIND); - break; - // 人工随访 - //case TaskContentConstants.ARTIFICIAL_FOLLOW_UP: - // // 查询问卷详情 - // if (manageNode.getFollowTemplateId() != null) { - // QuestionVO questionVO1 = questionInfoService.selectQuestionInfoById(manageNode.getFollowTemplateId()); - // if (ObjectUtils.isNotEmpty(questionVO1)) { - // templateDetail = JSONObject.parseObject(JSONObject.toJSONString(questionVO1)); - // manageNode.setTemplateType(TemplateTypeConstants.QUESTIONNAIRE); - // manageNode.setTemplateDetail(templateDetail); - // } - // } - // break; - } - } - // 替换短信、公众号、小程序内容 - if (manageNode.getMessageTemplateId() != null) { - // 替换短信模板 - manageNode.setMessageNodeContent(signPatientManageRouteNodeService.replaceMessageInfo(manageNode.getMessageTemplateId(), labelFieldContentList)); - } - if (manageNode.getPhoneMessageTemplateId() != null) { - // 替换短信模板 - manageNode.setPhoneMessageTemplateContent(signPatientManageRouteNodeService.replaceMessageInfo(manageNode.getPhoneMessageTemplateId(), labelFieldContentList)); - } - // 替换公众号模板 - if (manageNode.getOfficialPushSign() != null && manageNode.getOfficialPushSign() == 1) { - manageNode.setOfficialNodeContent(signPatientManageRouteNodeService.replaceWeChatTemplate(manageNode.getOfficialTemplateId(), labelFieldContentList)); - } - // 替换小程序模板 - if (manageNode.getAppletPushSign() != null && manageNode.getAppletPushSign() == 1) { - manageNode.setAppletNodeContent(signPatientManageRouteNodeService.replaceWeChatTemplate(manageNode.getAppletTemplateId(), labelFieldContentList)); - } - manageNodeAuditList.add(manageNode); - }); - } + JSONObject templateDetail = new JSONObject(); + // 根据模板类型,存放模板字段 + if (StringUtils.isNotBlank(node.getTaskNodeType())) { + switch (node.getTaskNodeType()) { + // 宣教 + case TaskNodeTypeConstants.PROPAGANDA_ARTICLE: + manageRouteNode.setPropagandaInfoId(node.getTemplateId()); + manageRouteNode.setPropagandaTitle(node.getTemplateName()); + // 查询宣教表 + if (manageRouteNode.getPropagandaInfoId() != null) { + PropagandaMaterialsVo propagandaMaterialsVo = propagandaInfoService.selectPropagandaInfoById(node.getTemplateId()); + if (ObjectUtils.isNotEmpty(propagandaMaterialsVo)) { + templateDetail = JSONObject.parseObject(JSONObject.toJSONString(propagandaMaterialsVo)); + manageRouteNode.setTemplateDetail(templateDetail); + } + } + manageRouteNode.setTemplateType(TemplateTypeConstants.PROPAGANDA); + break; + // 问卷 + case TaskNodeTypeConstants.QUESTIONNAIRE_SCALE: + manageRouteNode.setQuestionInfoId(node.getTemplateId()); + manageRouteNode.setQuestionnaireName(node.getTemplateName()); + // 查询问卷详情 + QuestionVO questionVO = questionInfoService.selectQuestionInfoById(node.getTemplateId()); + if (ObjectUtils.isNotEmpty(questionVO)) { + templateDetail = JSONObject.parseObject(JSONObject.toJSONString(questionVO)); + manageRouteNode.setTemplateType(TemplateTypeConstants.QUESTIONNAIRE); + manageRouteNode.setTemplateDetail(templateDetail); + } + break; + // 话术 + case TaskNodeTypeConstants.PHONE_OUTBOUND: + manageRouteNode.setPhoneId(node.getPhoneTemplateId()); + // 查询话术 + ScriptInfo scriptInfo = scriptInfoMapper.selectScriptInfoById(node.getPhoneTemplateId()); + if (ObjectUtils.isNotEmpty(scriptInfo)) { + // 话术库json内容替换 + manageRouteNode.setPhoneNodeContent(signPatientManageRouteNodeService.getFlowScheme(scriptInfo.getFlowScheme(), labelFieldContentList)); + templateDetail = JSONObject.parseObject(JSONObject.toJSONString(scriptInfo)); + manageRouteNode.setTemplateType(TemplateTypeConstants.SCRIPT); + manageRouteNode.setTemplateDetail(templateDetail); + } + // 电话短信内容 + if (node.getPhoneMessageTemplateId() != null) { + // 查询短信库 + manageRouteNode.setPhoneMessageTemplateContent(signPatientManageRouteNodeService.replaceMessageInfo(node.getPhoneMessageTemplateId(), labelFieldContentList)); + } + break; + } + } + // 替换短信、公众号、小程序内容 + replaceTemplateInfo(manageRouteNode, node, labelFieldContentList); + // 替换nodeContent + List manageNodeList = new ArrayList<>(); + if (StringUtils.contains(node.getNodeContent(), "data-w-e-type")) { + manageNodeList = signPatientManageRouteNodeService.replaceNodeContent(manageRouteNode, node.getTaskPartitionDictId(), labelFieldContentList); + } else { + manageNodeList.add(manageRouteNode); + } + manageNodeAuditList.addAll(manageNodeList); + }); + // 查询手动创建的节点 + manageRouteQuery.setTaskCreateType(TaskCreateTypeConstant.MANUAL_CREATE); + List createRouteList = signPatientManageRouteMapper.selectSignPatientManageRouteList(manageRouteQuery); + if (CollectionUtils.isNotEmpty(createRouteList)) { + List manageRouteIds = createRouteList.stream().map(SignPatientManageRoute::getId).collect(Collectors.toList()); + //for (Long routeId : manageRouteIds) { + // boolean satisfy = signPatientManageRouteNodeService.getSignTriggerConditon(routeId, signPatientRecord.getPatientId()); + // routeSatisfyMap.put(routeId, satisfy); + //} + List manageNodeList = signPatientManageRouteNodeMapper.selectAuditNodeInfo(manageRouteIds); + // 根据node去替换模板信息 + manageNodeList.forEach(manageNode -> { + // 判断触发条件是否满足 + manageNode.setConditionSatisfyStatus(true); + manageNode.setRouteNodeNameCN(RouteNodeNameEnum.getNameByInfo(manageNode.getRouteNodeName()).getName()); + JSONObject templateDetail = new JSONObject(); + if (StringUtils.isNotBlank(manageNode.getTaskNodeType())) { + switch (manageNode.getTaskNodeType()) { + // 电话外呼 + case TaskNodeTypeConstants.PHONE_OUTBOUND: + // 电话外呼分为话术和问卷两种,根据模板id判断选择的哪种模板 + if (manageNode.getPhoneId() != null) { // 话术 + ScriptInfo scriptInfo = scriptInfoMapper.selectScriptInfoById(manageNode.getPhoneId()); + if (ObjectUtils.isNotEmpty(scriptInfo)) { + // 话术库json内容替换 + manageNode.setPhoneNodeContent(signPatientManageRouteNodeService.getFlowScheme(scriptInfo.getFlowScheme(), labelFieldContentList)); + templateDetail = JSONObject.parseObject(JSONObject.toJSONString(scriptInfo)); + manageNode.setTemplateType(TemplateTypeConstants.SCRIPT); + manageNode.setTemplateDetail(templateDetail); + } + } else if (manageNode.getQuestionInfoId() != null) { // 问卷 + // 查询问卷详情 + QuestionVO questionVO = questionInfoService.selectQuestionInfoById(manageNode.getQuestionInfoId()); + if (ObjectUtils.isNotEmpty(questionVO)) { + templateDetail = JSONObject.parseObject(JSONObject.toJSONString(questionVO)); + manageNode.setTemplateType(TemplateTypeConstants.QUESTIONNAIRE); + manageNode.setTemplateDetail(templateDetail); + } + } + // 电话短信内容 + if (manageNode.getPhoneMessageTemplateId() != null) { + // 查询短信库 + manageNode.setPhoneMessageTemplateContent(signPatientManageRouteNodeService.replaceMessageInfo(manageNode.getPhoneMessageTemplateId(), labelFieldContentList)); + } + break; + // 问卷 + case TaskNodeTypeConstants.QUESTIONNAIRE_SCALE: + // 查询问卷详情 + if (manageNode.getQuestionInfoId() != null) { + QuestionVO questionVO = questionInfoService.selectQuestionInfoById(manageNode.getQuestionInfoId()); + if (ObjectUtils.isNotEmpty(questionVO)) { + templateDetail = JSONObject.parseObject(JSONObject.toJSONString(questionVO)); + manageNode.setTemplateType(TemplateTypeConstants.QUESTIONNAIRE); + manageNode.setTemplateDetail(templateDetail); + } + } + break; + // 宣教 + case TaskNodeTypeConstants.PROPAGANDA_ARTICLE: + // 查询宣教详情 + if (manageNode.getPropagandaInfoId() != null) { + PropagandaMaterialsVo propagandaMaterialsVo = propagandaInfoService.selectPropagandaInfoById(manageNode.getPropagandaInfoId()); + if (ObjectUtils.isNotEmpty(propagandaMaterialsVo)) { + templateDetail = JSONObject.parseObject(JSONObject.toJSONString(propagandaMaterialsVo)); + manageNode.setTemplateType(TemplateTypeConstants.PROPAGANDA); + manageNode.setTemplateDetail(templateDetail); + } + } + break; + // 文字提醒 + case TaskNodeTypeConstants.TEXT_REMIND: + manageNode.setTemplateType(TaskContentConstants.TEXT_REMIND); + break; + // 人工随访 + //case TaskContentConstants.ARTIFICIAL_FOLLOW_UP: + // // 查询问卷详情 + // if (manageNode.getFollowTemplateId() != null) { + // QuestionVO questionVO1 = questionInfoService.selectQuestionInfoById(manageNode.getFollowTemplateId()); + // if (ObjectUtils.isNotEmpty(questionVO1)) { + // templateDetail = JSONObject.parseObject(JSONObject.toJSONString(questionVO1)); + // manageNode.setTemplateType(TemplateTypeConstants.QUESTIONNAIRE); + // manageNode.setTemplateDetail(templateDetail); + // } + // } + // break; + } + } + // 替换短信、公众号、小程序内容 + if (manageNode.getMessageTemplateId() != null) { + // 替换短信模板 + manageNode.setMessageNodeContent(signPatientManageRouteNodeService.replaceMessageInfo(manageNode.getMessageTemplateId(), labelFieldContentList)); + } + if (manageNode.getPhoneMessageTemplateId() != null) { + // 替换短信模板 + manageNode.setPhoneMessageTemplateContent(signPatientManageRouteNodeService.replaceMessageInfo(manageNode.getPhoneMessageTemplateId(), labelFieldContentList)); + } + // 替换公众号模板 + if (manageNode.getOfficialPushSign() != null && manageNode.getOfficialPushSign() == 1) { + manageNode.setOfficialNodeContent(signPatientManageRouteNodeService.replaceWeChatTemplate(manageNode.getOfficialTemplateId(), labelFieldContentList)); + } + // 替换小程序模板 + if (manageNode.getAppletPushSign() != null && manageNode.getAppletPushSign() == 1) { + manageNode.setAppletNodeContent(signPatientManageRouteNodeService.replaceWeChatTemplate(manageNode.getAppletTemplateId(), labelFieldContentList)); + } + manageNodeAuditList.add(manageNode); + }); + } - return manageNodeAuditList; - } + return manageNodeAuditList; + } - /** + /** * 新增患者管理任务执行记录 */ 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) { SignPatientManageRouteNode signPatientManageRouteNode = new SignPatientManageRouteNode(); 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 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())) { signPatientManageRouteNode.setPhoneConnectStatus(dto.getPhoneConnectStatus()); } + if (dto.getTaskNodeType().equals(TaskContentEnum.QUESTIONNAIRE_SCALE.getInfo())) { + signPatientManageRouteNode.setNodeFinishDate(time); + } signPatientManageRouteNode.setRouteHandleRemark(dto.getRouteHandleRemark()); - signPatientManageRouteNode.setPhoneConnectStatus(dto.getPhoneConnectStatus()); signPatientManageRouteNode.setRouteHandleId(dto.getRouteHandleId()); signPatientManageRouteNode.setRouteHandlePerson(routeHandlePerson); signPatientManageRouteNode.setUpdateBy(routeHandlePerson); @@ -818,24 +938,24 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout } - private void replaceTemplateInfo(SignPatientManageNodeAuditVo manageRouteNode, RouteTaskAuditVo node, List labelFieldContentList) { - if (node.getMessageTemplateId() != null) { - // 替换短信模板 - manageRouteNode.setMessageNodeContent(signPatientManageRouteNodeService.replaceMessageInfo(node.getMessageTemplateId(), labelFieldContentList)); - } - if (node.getPhoneMessageTemplateId() != null) { - // 替换短信模板 - manageRouteNode.setPhoneMessageTemplateContent(signPatientManageRouteNodeService.replaceMessageInfo(node.getPhoneMessageTemplateId(), labelFieldContentList)); - } - // 替换公众号模板 - if (node.getOfficialPushSign() != null && node.getOfficialPushSign() == 1) { - manageRouteNode.setOfficialNodeContent(signPatientManageRouteNodeService.replaceWeChatTemplate(node.getOfficialTemplateId(), labelFieldContentList)); - } - // 替换小程序模板 - if (node.getAppletPushSign() != null && node.getAppletPushSign() == 1) { - manageRouteNode.setAppletNodeContent(signPatientManageRouteNodeService.replaceWeChatTemplate(node.getAppletTemplateId(), labelFieldContentList)); - } - } + private void replaceTemplateInfo(SignPatientManageNodeAuditVo manageRouteNode, RouteTaskAuditVo node, List labelFieldContentList) { + if (node.getMessageTemplateId() != null) { + // 替换短信模板 + manageRouteNode.setMessageNodeContent(signPatientManageRouteNodeService.replaceMessageInfo(node.getMessageTemplateId(), labelFieldContentList)); + } + if (node.getPhoneMessageTemplateId() != null) { + // 替换短信模板 + manageRouteNode.setPhoneMessageTemplateContent(signPatientManageRouteNodeService.replaceMessageInfo(node.getPhoneMessageTemplateId(), labelFieldContentList)); + } + // 替换公众号模板 + if (node.getOfficialPushSign() != null && node.getOfficialPushSign() == 1) { + manageRouteNode.setOfficialNodeContent(signPatientManageRouteNodeService.replaceWeChatTemplate(node.getOfficialTemplateId(), labelFieldContentList)); + } + // 替换小程序模板 + if (node.getAppletPushSign() != null && node.getAppletPushSign() == 1) { + manageRouteNode.setAppletNodeContent(signPatientManageRouteNodeService.replaceWeChatTemplate(node.getAppletTemplateId(), labelFieldContentList)); + } + } /** diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/vo/signpatientmanageroute/PhonePush.java b/postdischarge-manage/src/main/java/com/xinelu/manage/vo/signpatientmanageroute/PhonePush.java index a010cf0e..18e1fa9f 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/vo/signpatientmanageroute/PhonePush.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/vo/signpatientmanageroute/PhonePush.java @@ -12,94 +12,69 @@ import lombok.Data; @Data public class PhonePush { - /** - * 管理路径节点名称,出院后:AFTER_DISCHARGE,入院后:AFTER_ADMISSION,就诊后:AFTER_CONSULTATION - */ + @ApiModelProperty(value = "管理路径节点名称,出院后:AFTER_DISCHARGE,入院后:AFTER_ADMISSION,就诊后:AFTER_CONSULTATION") private String routeNodeName; - /** - * 管理路径节点时间,时间单位为:天 - */ + @ApiModelProperty(value = "管理路径节点时间,时间单位为:天") private String routeNodeDay; + @ApiModelProperty(value = "患者id") + private Long patientId; + @ApiModelProperty(value = "患者姓名") private String patientName; - /** - * 患者电话 - */ @ApiModelProperty(value = "患者电话") private String patientPhone; - /** - * 电话推送标识 - */ + @ApiModelProperty(value = "电话推送标识") private Integer phonePushSign; - /** - * 电话话术表id - */ @ApiModelProperty(value = "电话话术表id") private Long phoneId; - /** - * 电话模板ID - */ @ApiModelProperty(value = "电话模板ID") private String phoneTemplateId; - /** - * 电话模板名称 - */ @ApiModelProperty(value = "电话模板名称") private String phoneTemplateName; - /** - * 电话内容(富文本存放整个节点的信息,包含标签画像的名称以及其它,标签画像名称使用特殊符号进行标记) - */ @ApiModelProperty(value = "电话内容") private String phoneNodeContent; - /** - * 电话重拨次数,重拨一次:REDIAL_ONCE,重拨二次:REDIAL_TWICE,不重播:NOT_REPLAY - */ + @ApiModelProperty(value = "电话呼叫类型") + private String phoneDialMethod; + @ApiModelProperty(value = "电话重拨次数,重拨一次:REDIAL_ONCE,重拨二次:REDIAL_TWICE,不重播:NOT_REPLAY") private String phoneRedialTimes; - /** - * 电话时间间隔,单位为:分钟 - */ @ApiModelProperty(value = "电话时间间隔,单位为:分钟") 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") private String phoneMessageRemind; - /** - * 默认已接通:CONNECTED;未接通:NOTCONNECTED - */ + @ApiModelProperty(value = "电话接通状态,默认已接通:CONNECTED;未接通:NOTCONNECTED") private String phoneConnectStatus; - /** - * 任务处理信息;执行结果记录(电话反馈 - */ + @ApiModelProperty(value = "任务处理信息") private String routeHandleRemark; - /** - * 电话短信模板表id - */ @ApiModelProperty(value = "电话短信模板表id") private Long phoneMessageTemplateId; - /** - * 电话短信模板名称 - */ + @ApiModelProperty(value = "电话短信模板表code") + private String phoneMessageTemplateCode; + @ApiModelProperty(value = "电话短信模板名称") private String phoneMessageTemplateName; - @ApiModelProperty(value = "话术图片文件路径") - private String scriptFilePath; + @ApiModelProperty(value = "替换标签之后的电话短信内容") + private String phoneMessageTemplateContent; + + @ApiModelProperty(value = "电话拨通情况") + private String phoneNodeExecuteResultStatus; + + @ApiModelProperty(value = "电话短信发送情况") + private String phoneMessageNodeExecuteResultStatus; } diff --git a/postdischarge-manage/src/main/resources/mapper/manage/phonedialrecord/PhoneDialRecordMapper.xml b/postdischarge-manage/src/main/resources/mapper/manage/phonedialrecord/PhoneDialRecordMapper.xml new file mode 100644 index 00000000..5852699c --- /dev/null +++ b/postdischarge-manage/src/main/resources/mapper/manage/phonedialrecord/PhoneDialRecordMapper.xml @@ -0,0 +1,212 @@ + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + insert into phone_dial_record + + 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, + + + + #{patientId}, + + #{manageRouteNodeId}, + + #{patientPhone}, + + #{dialTime}, + + #{phoneTemplateId}, + + #{phoneTemplateName}, + + #{messageNodeContent}, + + #{phoneDialMethod}, + + #{errorCode}, + + #{errorStatus}, + + #{createBy}, + + #{createTime}, + + #{updateBy}, + + #{updateTime}, + + + + + + update phone_dial_record + + patient_id = + #{patientId}, + + manage_route_node_id = + #{manageRouteNodeId}, + + patient_phone = + #{patientPhone}, + + dial_time = + #{dialTime}, + + phone_template_id = + #{phoneTemplateId}, + + phone_template_name = + #{phoneTemplateName}, + + message_node_content = + #{messageNodeContent}, + + phone_dial_method = + #{phoneDialMethod}, + + error_code = + #{errorCode}, + + error_status = + #{errorStatus}, + + create_by = + #{createBy}, + + create_time = + #{createTime}, + + update_by = + #{updateBy}, + + update_time = + #{updateTime}, + + + where id = #{id} + + + + delete + from phone_dial_record + where id = #{id} + + + + delete from phone_dial_record where id in + + #{id} + + + \ No newline at end of file diff --git a/postdischarge-manage/src/main/resources/mapper/manage/shortmessagesendrecord/ShortMessageSendRecordMapper.xml b/postdischarge-manage/src/main/resources/mapper/manage/shortmessagesendrecord/ShortMessageSendRecordMapper.xml new file mode 100644 index 00000000..3ca18fc1 --- /dev/null +++ b/postdischarge-manage/src/main/resources/mapper/manage/shortmessagesendrecord/ShortMessageSendRecordMapper.xml @@ -0,0 +1,201 @@ + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + insert into short_message_send_record + + 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, + + + + #{patientId}, + + #{manageRouteNodeId}, + + #{patientPhone}, + + #{sendTime}, + + #{messageTemplateId}, + + #{messageNodeContent}, + + #{errorCode}, + + #{errorStatus}, + + #{createBy}, + + #{createTime}, + + #{updateBy}, + + #{updateTime}, + + #{messageType}, + + + + + + update short_message_send_record + + patient_id = + #{patientId}, + + manage_route_node_id = + #{manageRouteNodeId}, + + patient_phone = + #{patientPhone}, + + send_time = + #{sendTime}, + + message_template_id = + #{messageTemplateId}, + + message_node_content = + #{messageNodeContent}, + + error_code = + #{errorCode}, + + error_status = + #{errorStatus}, + + create_by = + #{createBy}, + + create_time = + #{createTime}, + + update_by = + #{updateBy}, + + update_time = + #{updateTime}, + + message_type = + #{messageType}, + + + where id = #{id} + + + + delete + from short_message_send_record + where id = #{id} + + + + delete from short_message_send_record where id in + + #{id} + + + \ No newline at end of file diff --git a/postdischarge-manage/src/main/resources/mapper/manage/signpatientmanageroute/SignPatientManageRouteMapper.xml b/postdischarge-manage/src/main/resources/mapper/manage/signpatientmanageroute/SignPatientManageRouteMapper.xml index db5de8d3..46eb5133 100644 --- a/postdischarge-manage/src/main/resources/mapper/manage/signpatientmanageroute/SignPatientManageRouteMapper.xml +++ b/postdischarge-manage/src/main/resources/mapper/manage/signpatientmanageroute/SignPatientManageRouteMapper.xml @@ -393,10 +393,13 @@ AND spmrn.manage_route_name like concat('%', #{manageRouteName}, '%') + + AND (spmrn.phone_node_execute_result_status is null or spmrn.phone_node_execute_result_status = ' ') + ${params.dataScope} - order by spmr.create_time DESC + order by spmr.create_time DESC diff --git a/postdischarge-mobile/src/main/java/com/xinelu/mobile/utils/SmsSendUtils.java b/postdischarge-mobile/src/main/java/com/xinelu/mobile/utils/SmsSendUtils.java index 7cdae33b..3ca7af11 100644 --- a/postdischarge-mobile/src/main/java/com/xinelu/mobile/utils/SmsSendUtils.java +++ b/postdischarge-mobile/src/main/java/com/xinelu/mobile/utils/SmsSendUtils.java @@ -38,7 +38,7 @@ public class SmsSendUtils { private AliYunSmsTwoConfig aliYunSmsTwoConfig; /** - * 发送短信 + * 单{code}替换值,发送短信 */ public Boolean sendSms(SmsInfoDTO smsInfoDTO) throws ClientException, ServiceException { try { @@ -88,7 +88,7 @@ public class SmsSendUtils { } /** - * 无替换模版发送短信 + * 无替换值模版,发送短信 */ public Boolean sendTextMessage(SmsInfoDTO smsInfoDTO) throws ClientException, ServiceException { try {