Merge branch '0418_小程序开发' of http://182.92.166.109:3000/zhuangyuanke/PostDischargePatientManage into 0418_小程序开发
This commit is contained in:
commit
2e79919d0b
@ -78,7 +78,7 @@ public class SignPatientManageRouteController extends BaseController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增签约患者管理任务路径
|
||||
* 新增签约患者管理任务路径(手动创建任务)
|
||||
*/
|
||||
@Log(title = "签约患者管理任务路径", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/add")
|
||||
|
||||
@ -81,7 +81,7 @@ public class ShortMessageSendRecord extends BaseEntity {
|
||||
* 推送结果状态码(0表示成功)
|
||||
*/
|
||||
@ApiModelProperty(value = "推送结果状态码")
|
||||
@Excel(name = "推送结果状态码", readConverterExp = "0=表示成功")
|
||||
@Excel(name = "推送结果状态码", readConverterExp = "0表示成功")
|
||||
private Long errorCode;
|
||||
|
||||
/**
|
||||
|
||||
@ -15,18 +15,7 @@ import com.xinelu.common.constant.TaskCreateTypeConstant;
|
||||
import com.xinelu.common.constant.TaskNodeTypeConstants;
|
||||
import com.xinelu.common.constant.TemplateTypeConstants;
|
||||
import com.xinelu.common.core.domain.AjaxResult;
|
||||
import com.xinelu.common.enums.ErrorStatusEnum;
|
||||
import com.xinelu.common.enums.NodeExecuteResultStatusEnum;
|
||||
import com.xinelu.common.enums.NodeExecuteStatusEnum;
|
||||
import com.xinelu.common.enums.PhoneConnectStatusEnum;
|
||||
import com.xinelu.common.enums.PhoneMessageRemindEnum;
|
||||
import com.xinelu.common.enums.PhoneRedialTimesEnum;
|
||||
import com.xinelu.common.enums.RouteNodeNameEnum;
|
||||
import com.xinelu.common.enums.ShortMessageTypeEnum;
|
||||
import com.xinelu.common.enums.SmsErrorCodeEnum;
|
||||
import com.xinelu.common.enums.TaskContentEnum;
|
||||
import com.xinelu.common.enums.TaskCreateTypeEnum;
|
||||
import com.xinelu.common.enums.TaskNodeTypeEnum;
|
||||
import com.xinelu.common.enums.*;
|
||||
import com.xinelu.common.exception.ServiceException;
|
||||
import com.xinelu.common.utils.AgeUtil;
|
||||
import com.xinelu.common.utils.SecurityUtils;
|
||||
@ -81,16 +70,6 @@ import com.xinelu.manage.vo.specialdiseasenode.RouteTaskAuditVo;
|
||||
import com.xinelu.manage.vo.specialdiseasenode.SpecialDiseaseNodeAuditVo;
|
||||
import com.xinelu.manage.vo.specialdiseaseroute.SpecialDiseaseChildRouteAuditVo;
|
||||
import com.xinelu.manage.vo.specialdiseaseroute.SpecialDiseaseRouteAuditVo;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
@ -98,6 +77,13 @@ import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
/**
|
||||
* 签约患者管理任务路径Service业务层处理
|
||||
@ -858,7 +844,7 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
|
||||
return retList;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* 新增患者管理任务执行记录
|
||||
*/
|
||||
private Long insertPatientTaskExecuteRecord(PatientQuestionSubmitResultDTO dto, String routeHandlePerson, LocalDateTime time) {
|
||||
@ -934,6 +920,7 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
|
||||
*/
|
||||
private void extracted(SignPatientManageRouteVO signPatientManageRoute, List<SignPatientManageRouteNode> signPatientManageRouteNodes, SignPatientManageRouteNode routeNode) {
|
||||
SignPatientManageRouteNode signPatientManageRouteNode = new SignPatientManageRouteNode();
|
||||
//电话外呼
|
||||
if (Objects.nonNull(routeNode) && TaskNodeTypeEnum.PHONE_OUTBOUND.getInfo().equals(routeNode.getTaskNodeType())) {
|
||||
signPatientManageRouteNode.setPhonePushSign(Objects.isNull(routeNode.getPhonePushSign()) ? null : routeNode.getPhonePushSign());
|
||||
signPatientManageRouteNode.setScriptInfoId(Objects.isNull(routeNode.getScriptInfoId()) ? null : routeNode.getScriptInfoId());
|
||||
@ -947,6 +934,7 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
|
||||
signPatientManageRouteNode.setPhoneMessageTemplateName(StringUtils.isBlank(routeNode.getPhoneMessageTemplateName()) ? null : routeNode.getPhoneMessageTemplateName());
|
||||
signPatientManageRouteNode.setPhoneDialMethod(StringUtils.isBlank(routeNode.getPhoneDialMethod()) ? null : routeNode.getPhoneDialMethod());
|
||||
}
|
||||
//问卷
|
||||
if (Objects.nonNull(routeNode) && TaskNodeTypeEnum.QUESTIONNAIRE_SCALE.getInfo().equals(routeNode.getTaskNodeType())) {
|
||||
signPatientManageRouteNode.setQuestionInfoId(Objects.isNull(routeNode.getQuestionInfoId()) ? null : routeNode.getQuestionInfoId());
|
||||
signPatientManageRouteNode.setQuestionnaireName(StringUtils.isBlank(routeNode.getQuestionnaireName()) ? null : routeNode.getQuestionnaireName());
|
||||
@ -954,22 +942,31 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
|
||||
signPatientManageRouteNode.setQuestionExpirationDate(Objects.isNull(routeNode.getQuestionExpirationDate()) ? null : routeNode.getQuestionExpirationDate());
|
||||
signPatientManageRouteNode.setPhoneDialMethod(StringUtils.isBlank(routeNode.getPhoneDialMethod()) ? null : routeNode.getPhoneDialMethod());
|
||||
}
|
||||
//宣教
|
||||
if (Objects.nonNull(routeNode) && TaskNodeTypeEnum.PROPAGANDA_ARTICLE.getInfo().equals(routeNode.getTaskNodeType())) {
|
||||
signPatientManageRouteNode.setPropagandaInfoId(Objects.isNull(routeNode.getPropagandaInfoId()) ? null : routeNode.getPropagandaInfoId());
|
||||
signPatientManageRouteNode.setPropagandaTitle(StringUtils.isBlank(routeNode.getPropagandaTitle()) ? null : routeNode.getPropagandaTitle());
|
||||
signPatientManageRouteNode.setPropagandaContent(StringUtils.isBlank(routeNode.getPropagandaContent()) ? null : routeNode.getPropagandaContent());
|
||||
}
|
||||
//文字提醒
|
||||
if (Objects.nonNull(routeNode) && TaskNodeTypeEnum.TEXT_REMIND.getInfo().equals(routeNode.getTaskNodeType())) {
|
||||
signPatientManageRouteNode.setNodeContent(StringUtils.isBlank(routeNode.getNodeContent()) ? null : routeNode.getNodeContent());
|
||||
}
|
||||
//短信
|
||||
signPatientManageRouteNode.setMessagePushSign(Objects.isNull(routeNode.getMessagePushSign()) ? null : routeNode.getMessagePushSign());
|
||||
signPatientManageRouteNode.setMessageTemplateId(Objects.isNull(routeNode.getMessageTemplateId()) ? null : routeNode.getMessageTemplateId());
|
||||
signPatientManageRouteNode.setMessageTemplateCode(Objects.isNull(routeNode.getMessageTemplateCode()) ? null : routeNode.getMessageTemplateCode());
|
||||
;
|
||||
signPatientManageRouteNode.setMessageTemplateName(StringUtils.isBlank(routeNode.getMessageTemplateName()) ? null : routeNode.getMessageTemplateName());
|
||||
//公众号
|
||||
signPatientManageRouteNode.setOfficialPushSign(Objects.isNull(routeNode.getOfficialPushSign()) ? null : routeNode.getOfficialPushSign());
|
||||
signPatientManageRouteNode.setOfficialTemplateId(Objects.isNull(routeNode.getOfficialTemplateId()) ? null : routeNode.getOfficialTemplateId());
|
||||
signPatientManageRouteNode.setOfficialTemplateCode(Objects.isNull(routeNode.getOfficialTemplateCode()) ? null : routeNode.getOfficialTemplateCode());
|
||||
signPatientManageRouteNode.setOfficialTemplateName(StringUtils.isBlank(routeNode.getOfficialTemplateName()) ? null : routeNode.getOfficialTemplateName());
|
||||
//小程序
|
||||
signPatientManageRouteNode.setAppletPushSign(Objects.isNull(routeNode.getAppletPushSign()) ? null : routeNode.getAppletPushSign());
|
||||
signPatientManageRouteNode.setAppletTemplateId(Objects.isNull(routeNode.getAppletTemplateId()) ? null : routeNode.getAppletTemplateId());
|
||||
signPatientManageRouteNode.setAppletTemplateCode(Objects.isNull(routeNode.getAppletTemplateCode()) ? null : routeNode.getAppletTemplateCode());
|
||||
signPatientManageRouteNode.setAppletTemplateName(StringUtils.isBlank(routeNode.getAppletTemplateName()) ? null : routeNode.getAppletTemplateName());
|
||||
signPatientManageRouteNode.setManageRouteId(signPatientManageRoute.getId());
|
||||
signPatientManageRouteNode.setManageRouteName(signPatientManageRoute.getRouteName());
|
||||
|
||||
@ -117,4 +117,9 @@ public class TextMessageTaskVO {
|
||||
*/
|
||||
@ApiModelProperty(value = "适用任务类型字典表ids")
|
||||
private Long[] suitTaskTypeIds;
|
||||
|
||||
/**
|
||||
* 短信模版code(手动创建人任务使用)
|
||||
*/
|
||||
private String messageTemplateCode;
|
||||
}
|
||||
|
||||
@ -118,4 +118,8 @@ public class TextMessageVO extends BaseEntity {
|
||||
@ApiModelProperty(value = "短信模板适用任务类型列表")
|
||||
private List<TextMessageSuitTask> suitTaskList;
|
||||
|
||||
/**
|
||||
* 短信模版code(手动创建人任务使用)
|
||||
*/
|
||||
private String messageTemplateCode;
|
||||
}
|
||||
|
||||
@ -107,4 +107,16 @@ public class WechatTemplateTaskVO {
|
||||
*/
|
||||
@ApiModelProperty(value = "适用任务类型字典表ids")
|
||||
private Long[] suitTaskTypeIds;
|
||||
|
||||
/**
|
||||
* 微信模板ID (手动创建任务使用)
|
||||
*/
|
||||
@ApiModelProperty(value = "模板ID")
|
||||
private String appletTemplateCode;
|
||||
|
||||
/**
|
||||
* 公众号模板ID (手动创建任务使用)
|
||||
*/
|
||||
@ApiModelProperty(value = "模板ID")
|
||||
private String officialTemplateCode ;
|
||||
}
|
||||
|
||||
@ -32,6 +32,7 @@
|
||||
<result column="disease_type_name" property="diseaseTypeName"/>
|
||||
<result column="text_message_name" property="textMessageName"/>
|
||||
<result column="text_message_id" property="textMessageId"/>
|
||||
<result column="messageTemplateCode" property="messageTemplateCode"/>
|
||||
<result column="text_message_content" property="textMessageContent"/>
|
||||
<result column="text_message_channel" property="textMessageChannel"/>
|
||||
<result column="text_message_status" property="textMessageStatus"/>
|
||||
@ -106,6 +107,7 @@
|
||||
tm.disease_type_name,
|
||||
tm.text_message_name,
|
||||
tm.text_message_id,
|
||||
tm.text_message_id messageTemplateCode,
|
||||
tm.text_message_content,
|
||||
tm.text_message_channel,
|
||||
tm.text_message_status,
|
||||
|
||||
@ -123,11 +123,17 @@
|
||||
wt.disease_type_name,
|
||||
wt.wechat_template_name,
|
||||
wt.template_id,
|
||||
CASE
|
||||
WHEN wt.template_source = 'WE_CHAT_APPLET' THEN wt.template_id
|
||||
END AS appletTemplateCode,
|
||||
CASE
|
||||
WHEN wt.template_source = 'WE_CHAT_OFFICIAL_ACCOUNT' THEN wt.template_id
|
||||
END AS officialTemplateCode,
|
||||
wt.template_content,
|
||||
wt.template_source,
|
||||
wt.template_sort,
|
||||
wt.template_remark,
|
||||
wt.source_template_id,
|
||||
wt.source_template_id,
|
||||
IFNULL(MAX(wtst.id), 0) AS taskId,
|
||||
GROUP_CONCAT(wtst.suit_task_type_name SEPARATOR ',') as suitTaskTypeName
|
||||
from wechat_template wt
|
||||
|
||||
@ -212,7 +212,7 @@ public class WeChatOfficialAccountUtils {
|
||||
paramsMap.put("touser", patientVO.getOpenId());
|
||||
paramsMap.put("template_id", weChatAppletChatConfig.getHealthyPropagandaId());
|
||||
//跳转小程序类型:developer为开发版;trial为体验版;formal为正式版;默认为正式版
|
||||
//paramsMap.put("miniprogram_state", "developer");
|
||||
paramsMap.put("miniprogram_state", "developer");
|
||||
paramsMap.put("page", "pages/pushDetails/pushDetails?manageRouteNodeId=" + patientVO.getSignPatientManageRouteNodeId());
|
||||
Map<String, Object> dataMap = new LinkedHashMap<>();
|
||||
dataMap.put("thing5", new MessageValueEntity(thing5));
|
||||
|
||||
@ -3,11 +3,8 @@ package com.xinelu.quartz.service.impl;
|
||||
import com.aliyuncs.exceptions.ClientException;
|
||||
import com.xinelu.common.config.AliYunSmsTwoConfig;
|
||||
import com.xinelu.common.config.PushMessageRestrictions;
|
||||
import com.xinelu.common.enums.ErrorStatusEnum;
|
||||
import com.xinelu.common.enums.NodeExecuteResultStatusEnum;
|
||||
import com.xinelu.common.enums.NodeExecuteStatusEnum;
|
||||
import com.xinelu.common.enums.RouteNodeNameEnum;
|
||||
import com.xinelu.manage.domain.subscribemessagesendrecord.SubscribeMessageSendRecord;
|
||||
import com.xinelu.common.enums.*;
|
||||
import com.xinelu.manage.domain.shortmessagesendrecord.ShortMessageSendRecord;
|
||||
import com.xinelu.manage.dto.smssend.SmsInfoDTO;
|
||||
import com.xinelu.manage.mapper.shortmessagesendrecord.ShortMessageSendRecordMapper;
|
||||
import com.xinelu.manage.mapper.signpatientmanageroutenode.SignPatientManageRouteNodeMapper;
|
||||
@ -22,6 +19,7 @@ import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@ -151,21 +149,30 @@ public class SendTextMessageServiceImpl implements SendTextMessageService {
|
||||
// 根据模版id发送
|
||||
smsInfoDTO.setTemplateCode(message.getTextMessageId());
|
||||
Boolean aBoolean = smsSendUtils.sendTextMessage(smsInfoDTO);
|
||||
SubscribeMessageSendRecord subscribeMessageSendRecord = new SubscribeMessageSendRecord();
|
||||
ShortMessageSendRecord shortMessageSendRecord = new ShortMessageSendRecord();
|
||||
shortMessageSendRecord.setMessageType(ShortMessageTypeEnum.COMMON.getInfo());
|
||||
shortMessageSendRecord.setPatientId(message.getPatientId());
|
||||
shortMessageSendRecord.setPatientPhone(message.getPatientPhone());
|
||||
shortMessageSendRecord.setManageRouteNodeId(message.getSignPatientManageRouteNodeId());
|
||||
shortMessageSendRecord.setSendTime(LocalDateTime.now());
|
||||
shortMessageSendRecord.setMessageTemplateId(message.getTextMessageId());
|
||||
shortMessageSendRecord.setMessageNodeContent(message.getMessageNodeContent());
|
||||
shortMessageSendRecord.setCreateTime(LocalDateTime.now());
|
||||
//成功
|
||||
if (aBoolean) {
|
||||
ids.add(message.getSignPatientManageRouteNodeId());
|
||||
subscribeMessageSendRecord.setErrorCode(0);
|
||||
subscribeMessageSendRecord.setErrorStatus(ErrorStatusEnum.success.getValue());
|
||||
shortMessageSendRecord.setErrorCode(0L);
|
||||
shortMessageSendRecord.setErrorStatus(ErrorStatusEnum.success.getValue());
|
||||
} else {
|
||||
//失败
|
||||
subscribeMessageSendRecord.setErrorCode(1);
|
||||
subscribeMessageSendRecord.setErrorStatus(ErrorStatusEnum.fail.getValue());
|
||||
shortMessageSendRecord.setErrorCode(1L);
|
||||
shortMessageSendRecord.setErrorStatus(ErrorStatusEnum.fail.getValue());
|
||||
RecordNum recordNum = recordNums.stream().filter(Objects::nonNull).filter(item -> Objects.nonNull(item.getManageRouteNodeId()) && item.getManageRouteNodeId().equals(message.getSignPatientManageRouteNodeId())).findFirst().orElse(new RecordNum());
|
||||
//三次失败
|
||||
if (Objects.nonNull(recordNum.getNum()) && recordNum.getNum() >= pushMessageRestrictions.getNumber()) {
|
||||
failSignPatientManageRouteNodeIds.add(message.getSignPatientManageRouteNodeId());
|
||||
}
|
||||
shortMessageSendRecordMapper.insertShortMessageSendRecord(shortMessageSendRecord);
|
||||
}
|
||||
}
|
||||
//修改节点状态
|
||||
|
||||
@ -180,7 +180,6 @@ public class subscribeTaskServiceImpl implements SubscribeTaskService {
|
||||
subscribeMessageSendRecord.setOpenid(patientVO.getOpenId());
|
||||
subscribeMessageSendRecord.setAppletId(weChatAppletChatConfig.getAppletId());
|
||||
subscribeMessageSendRecord.setTemplateId(weChatAppletChatConfig.getHealthyPropagandaId());
|
||||
subscribeMessageSendRecord.setCreateBy(SecurityUtils.getUsername());
|
||||
subscribeMessageSendRecord.setCreateTime(LocalDateTime.now());
|
||||
subscribeMessageSendRecordMapper.insertSubscribeMessageSendRecord(subscribeMessageSendRecord);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user