Merge branch '0418_小程序开发' of http://182.92.166.109:3000/zhuangyuanke/PostDischargePatientManage into 0418_小程序开发
Conflicts: postdischarge-manage/src/main/resources/mapper/manage/labelfieldcontent/LabelFieldContentMapper.xml
This commit is contained in:
commit
86a96c3769
@ -82,7 +82,7 @@ spring:
|
||||
# 数据库索引
|
||||
database: 6
|
||||
# 密码
|
||||
password: xinelu@6990
|
||||
password:
|
||||
# 连接超时时间
|
||||
timeout: 10s
|
||||
lettuce:
|
||||
@ -203,14 +203,10 @@ wechat-applet-chat-config:
|
||||
token: uI1NGHesp7ylIYVYQvp0TlcDmUTKCHj2
|
||||
# 微信小程序事件回调消息加密密钥
|
||||
encoding-aes-key: 5rbyhMBpdnxTEVT54zeHMNcXi3ccilQZ209QqGi89EW
|
||||
# 优惠券领取模板id
|
||||
coupon-receive-template-id: e1JRZaw1OfTz2b6X9DTqqaJtV4rXEt7uhwXoZLDb_eA
|
||||
# 商品订单支付成功通知模板id
|
||||
goods-order-template-id: -IxZeEkkXFhoSwGtBHbipKQ6kjEmkdTkswKeOypSsNQ
|
||||
# 预约服务订单通知模板id
|
||||
appoint-order-template-id: nUB9HRbqQXOVuTpkKBIHMgzWlNq6touzxf5QYBiMkbU
|
||||
# 签到成功通知模板id
|
||||
sign-template-id: S_c9bR4znSWpXg-6ACIMn7AkaR11dzo113XM8w4CKz0
|
||||
# 随访模板id
|
||||
follow-template-id: p__w9HO65a8aqgy6OuNG9t_v9_j1dcT81CEA_cdMhaw
|
||||
# 健康宣教模板id
|
||||
healthy-propaganda-id: YNeOOaRXbtLFJ1H7HRb9Ot6HADnKO_mg2uLFrqYOhCw
|
||||
|
||||
# 院后微信公众号参数配置
|
||||
wechat-official-account-config:
|
||||
|
||||
@ -46,22 +46,12 @@ public class WeChatAppletChatConfig {
|
||||
private String encodingAesKey;
|
||||
|
||||
/**
|
||||
* 优惠券领取模板id
|
||||
* 随访模板id
|
||||
*/
|
||||
private String couponReceiveTemplateId;
|
||||
private String followTemplateId;
|
||||
|
||||
/**
|
||||
* 商品订单支付成功通知模板id
|
||||
* 健康宣教模板id
|
||||
*/
|
||||
private String goodsOrderTemplateId;
|
||||
|
||||
/**
|
||||
* 预约服务订单通知模板id
|
||||
*/
|
||||
private String appointOrderTemplateId;
|
||||
|
||||
/**
|
||||
* 签到通知模板
|
||||
*/
|
||||
private String signTemplateId;
|
||||
private String healthyPropagandaId;
|
||||
}
|
||||
|
||||
@ -12,24 +12,14 @@ import lombok.Getter;
|
||||
public enum SubscribeMessageTypeEnum {
|
||||
|
||||
/**
|
||||
* 预约服务付款通知提醒
|
||||
* 随访通知提醒
|
||||
*/
|
||||
APPOINT_ORDER_MESSAGE_PUSH("APPOINT_ORDER_MESSAGE_PUSH"),
|
||||
FOLLOW_MESSAGE_PUSH("FOLLOW_MESSAGE_PUSH"),
|
||||
|
||||
/**
|
||||
* 优惠券领取提醒
|
||||
* 健康宣教提醒
|
||||
*/
|
||||
COUPON_RECEIVE_MESSAGE_PUSH("COUPON_RECEIVE_MESSAGE_PUSH"),
|
||||
|
||||
/**
|
||||
* 商品订单支付成功提醒
|
||||
*/
|
||||
GOODS_ORDER_MESSAGE_PUSH("GOODS_ORDER_MESSAGE_PUSH"),
|
||||
|
||||
/**
|
||||
* 签到积分通知提醒
|
||||
*/
|
||||
SIGN_MESSAGE_PUSH("SIGN_MESSAGE_PUSH"),
|
||||
HEALTHY_PROPAGANDA_MESSAGE_PUSH("HEALTHY_PROPAGANDA_MESSAGE_PUSH"),
|
||||
;
|
||||
|
||||
final private String info;
|
||||
|
||||
@ -64,4 +64,12 @@ public interface TermBankMapper {
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteTermBankByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 查询父级信息
|
||||
*
|
||||
* @param parentTermCode 父级编号
|
||||
* @return TermBank
|
||||
*/
|
||||
TermBank selectTermBankByParentTermCode(String parentTermCode);
|
||||
}
|
||||
|
||||
@ -12,16 +12,23 @@ import com.xinelu.manage.domain.labelfieldcontent.LabelFieldContent;
|
||||
import com.xinelu.manage.domain.labelfieldinfo.LabelFieldInfo;
|
||||
import com.xinelu.manage.domain.patientinfo.PatientAllInfoView;
|
||||
import com.xinelu.manage.domain.patientinfo.PatientAllInfoViewUppercase;
|
||||
import com.xinelu.manage.domain.signpatientmanageroutenode.SignPatientManageRouteNode;
|
||||
import com.xinelu.manage.dto.labelfieldcontent.LabelFieldContentAddDTO;
|
||||
import com.xinelu.manage.dto.labelfieldcontent.LabelFieldContentDTO;
|
||||
import com.xinelu.manage.dto.signpatientmanageroutenode.PatientTaskDto;
|
||||
import com.xinelu.manage.mapper.labelfieldcontent.LabelFieldContentMapper;
|
||||
import com.xinelu.manage.mapper.labelfieldinfo.LabelFieldInfoMapper;
|
||||
import com.xinelu.manage.mapper.patientinfo.PatientAllInfoViewMapper;
|
||||
import com.xinelu.manage.mapper.signpatientmanageroutenode.SignPatientManageRouteNodeMapper;
|
||||
import com.xinelu.manage.service.labelfieldcontent.ILabelFieldContentService;
|
||||
import com.xinelu.manage.vo.labelfieldcontent.*;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.jsoup.Jsoup;
|
||||
import org.jsoup.nodes.Document;
|
||||
import org.jsoup.nodes.Element;
|
||||
import org.jsoup.select.Elements;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@ -50,6 +57,8 @@ public class LabelFieldContentServiceImpl implements ILabelFieldContentService {
|
||||
private LabelFieldInfoMapper labelFieldInfoMapper;
|
||||
@Resource
|
||||
private PatientAllInfoViewMapper patientAllInfoViewMapper;
|
||||
@Resource
|
||||
private SignPatientManageRouteNodeMapper signPatientManageRouteNodeMapper;
|
||||
|
||||
/**
|
||||
* 查询标签字段内容信息
|
||||
@ -193,6 +202,19 @@ public class LabelFieldContentServiceImpl implements ILabelFieldContentService {
|
||||
if (ObjectUtils.isEmpty(patientId)) {
|
||||
throw new ServiceException("请选择患者!");
|
||||
}
|
||||
PatientTaskDto patientTaskDto = new PatientTaskDto();
|
||||
patientTaskDto.setPatientId(patientId);
|
||||
List<SignPatientManageRouteNode> nodeList = signPatientManageRouteNodeMapper.getNodeList(patientTaskDto);
|
||||
List<String> nodeContentList = nodeList.stream().filter(Objects::nonNull).map(SignPatientManageRouteNode::getNodeContent).filter(Objects::nonNull).collect(Collectors.toList());
|
||||
String nodeContentListJoin = String.join(",", nodeContentList);
|
||||
Document document = Jsoup.parse(nodeContentListJoin);
|
||||
// 需要提取的span
|
||||
List<String> string = new ArrayList<>();
|
||||
Elements spanList = document.select("span[data-w-e-type]");
|
||||
for (Element span : spanList) {
|
||||
String paramKey = span.attr("data-fieldMark");
|
||||
string.add(paramKey);
|
||||
}
|
||||
//根据patientId查询是否有已经维护的参数
|
||||
List<LabelFieldAndPartitionDict> labelFieldContents = labelFieldContentMapper.labelFieldAndPartitionDict(taskPartitionDictId, patientId, null);
|
||||
if (CollectionUtils.isNotEmpty(labelFieldContents)) {
|
||||
|
||||
@ -92,13 +92,17 @@ public class TermBankServiceImpl implements ITermBankService {
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult updateTermBank(TermBank termBank) {
|
||||
if (Objects.nonNull(termBank) && Objects.nonNull(termBank.getTermLevel()) && termBank.getTermLevel() < Constants.TERM_MAX_LEVEL) {
|
||||
termBank.setTermLevel(termBank.getTermLevel() + 1);
|
||||
termBank.setTermLevel(1L);
|
||||
if (StringUtils.isNotBlank(termBank.getParentTermCode())) {
|
||||
TermBank parentTermCode = termBankMapper.selectTermBankByParentTermCode(termBank.getParentTermCode());
|
||||
if (Objects.nonNull(parentTermCode) && Objects.nonNull(parentTermCode.getTermLevel())) {
|
||||
termBank.setTermLevel(parentTermCode.getTermLevel() + 1);
|
||||
}
|
||||
if (Objects.nonNull(termBank) && Objects.nonNull(termBank.getTermLevel()) && termBank.getTermLevel() > (Constants.TERM_MAX_LEVEL)) {
|
||||
}
|
||||
if (Objects.nonNull(termBank.getTermLevel()) && termBank.getTermLevel() > (Constants.TERM_MAX_LEVEL)) {
|
||||
return AjaxResult.error("常用话术层数最大值为" + Constants.TERM_MAX_LEVEL + "层");
|
||||
}
|
||||
if (Objects.nonNull(termBank) && StringUtils.isBlank(termBank.getParentTermCode())) {
|
||||
if (StringUtils.isBlank(termBank.getParentTermCode())) {
|
||||
termBank.setTermLevel(Constants.TERM_MIN_LEVEL);
|
||||
}
|
||||
termBank.setUpdateTime(LocalDateTime.now());
|
||||
|
||||
@ -360,7 +360,7 @@
|
||||
<if test="portraitStatus != null">
|
||||
and lfc.portrait_status = #{portraitStatus}
|
||||
</if>
|
||||
Order by tpd.task_partition_sort,lfi.field_sort
|
||||
Order by tpd.task_partition_sort,lfc.portrait_sn,lfc.content_sort
|
||||
</select>
|
||||
|
||||
<insert id="insertLabelFieldContentList">
|
||||
|
||||
@ -331,12 +331,12 @@
|
||||
spmrn.route_node_name AS 'routeNodeName',
|
||||
spmrn.task_type,
|
||||
CASE
|
||||
WHEN spmrn.task_type = 'PHONE_OUTBOUND' THEN COALESCE(spmrn.phone_template_name, spmrn.follow_template_name)
|
||||
WHEN spmrn.task_type = 'PHONE_OUTBOUND' THEN spmrn.phone_template_name
|
||||
WHEN spmrn.task_type = 'QUESTIONNAIRE_SCALE' THEN spmrn.questionnaire_name
|
||||
WHEN spmrn.task_type = 'ARTIFICIAL_FOLLOW_UP' THEN spmrn.follow_template_name
|
||||
END AS 'templateName',
|
||||
CASE
|
||||
WHEN spmrn.task_type = 'PHONE_OUTBOUND' THEN COALESCE(spmrn.phone_id, spmrn.follow_template_id)
|
||||
WHEN spmrn.task_type = 'PHONE_OUTBOUND' THEN spmrn.phone_id
|
||||
WHEN spmrn.task_type = 'QUESTIONNAIRE_SCALE' THEN spmrn.question_info_id
|
||||
WHEN spmrn.task_type = 'ARTIFICIAL_FOLLOW_UP' THEN spmrn.follow_template_id
|
||||
END AS 'templateId',
|
||||
|
||||
@ -185,4 +185,13 @@
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="selectTermBankByParentTermCode" resultType="com.xinelu.manage.domain.termbank.TermBank">
|
||||
<include refid="selectTermBankVo"/>
|
||||
<where>
|
||||
<if test="parentTermCode != null and parentTermCode != ''">
|
||||
and term_code = #{parentTermCode}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
@ -0,0 +1,14 @@
|
||||
package com.xinelu.mobile.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 微信内容实体
|
||||
*/
|
||||
@Data
|
||||
public class TemplateContent {
|
||||
|
||||
private String name;
|
||||
|
||||
private String value;
|
||||
}
|
||||
@ -41,7 +41,20 @@ public interface HomePageMapper {
|
||||
*/
|
||||
List<SatisfactionQuestionnaire> satisfactionQuestionnaireByResidentId(@Param("residentId") Long residentId, @Param("questionType") String questionType, @Param("questionnaireStatus") String questionnaireStatus);
|
||||
|
||||
/**
|
||||
* 微信小程序订阅消息记录表
|
||||
*
|
||||
* @param subscribeStatus 状态
|
||||
* @param templateId 模版
|
||||
* @return PatientVO
|
||||
*/
|
||||
List<PatientVO> selectResidentAndSubscribeMessageRecord(@Param("subscribeStatus") String subscribeStatus, @Param("templateId") String templateId);
|
||||
|
||||
/**
|
||||
* 患者节点表
|
||||
*
|
||||
* @param patientId 患者id
|
||||
* @return PatientVO
|
||||
*/
|
||||
List<PatientVO> selectSignPatientManageRouteNode(@Param("patientId") List<Long> patientId);
|
||||
}
|
||||
@ -203,17 +203,8 @@ public class WeChatAppletCallBackServiceImpl implements WeChatAppletCallBackServ
|
||||
subscribe.setOpenid(StringUtils.isBlank(weChatMessagePushVO.getFromUserName()) ? "" : weChatMessagePushVO.getFromUserName());
|
||||
subscribe.setAppletId(StringUtils.isBlank(weChatMessagePushVO.getToUserName()) ? "" : weChatMessagePushVO.getToUserName());
|
||||
subscribe.setTemplateId(StringUtils.isBlank(item.getTemplateId()) ? "" : item.getTemplateId());
|
||||
if (StringUtils.isNotBlank(item.getTemplateId()) && appletChatConfig.getCouponReceiveTemplateId().equals(item.getTemplateId())) {
|
||||
subscribe.setMessageType(SubscribeMessageTypeEnum.COUPON_RECEIVE_MESSAGE_PUSH.getInfo());
|
||||
}
|
||||
if (StringUtils.isNotBlank(item.getTemplateId()) && appletChatConfig.getAppointOrderTemplateId().equals(item.getTemplateId())) {
|
||||
subscribe.setMessageType(SubscribeMessageTypeEnum.APPOINT_ORDER_MESSAGE_PUSH.getInfo());
|
||||
}
|
||||
if (StringUtils.isNotBlank(item.getTemplateId()) && appletChatConfig.getGoodsOrderTemplateId().equals(item.getTemplateId())) {
|
||||
subscribe.setMessageType(SubscribeMessageTypeEnum.GOODS_ORDER_MESSAGE_PUSH.getInfo());
|
||||
}
|
||||
if (StringUtils.isNotBlank(item.getTemplateId()) && appletChatConfig.getSignTemplateId().equals(item.getTemplateId())) {
|
||||
subscribe.setMessageType(SubscribeMessageTypeEnum.SIGN_MESSAGE_PUSH.getInfo());
|
||||
if (StringUtils.isNotBlank(item.getTemplateId()) && appletChatConfig.getFollowTemplateId().equals(item.getTemplateId())) {
|
||||
subscribe.setMessageType(SubscribeMessageTypeEnum.FOLLOW_MESSAGE_PUSH.getInfo());
|
||||
}
|
||||
subscribe.setSubscribeCount(1);
|
||||
subscribe.setSubscribeTime(StringUtils.isBlank(weChatMessagePushVO.getCreateTime()) ? null : DateUtils.timestampToLocalDateTime(Long.parseLong(weChatMessagePushVO.getCreateTime()) * 1000L));
|
||||
@ -232,17 +223,8 @@ public class WeChatAppletCallBackServiceImpl implements WeChatAppletCallBackServ
|
||||
subscribe.setOpenid(StringUtils.isBlank(weChatMessagePushVO.getFromUserName()) ? "" : weChatMessagePushVO.getFromUserName());
|
||||
subscribe.setAppletId(StringUtils.isBlank(weChatMessagePushVO.getToUserName()) ? "" : weChatMessagePushVO.getToUserName());
|
||||
subscribe.setTemplateId(StringUtils.isBlank(item.getTemplateId()) ? "" : item.getTemplateId());
|
||||
if (StringUtils.isNotBlank(item.getTemplateId()) && appletChatConfig.getCouponReceiveTemplateId().equals(item.getTemplateId())) {
|
||||
subscribe.setMessageType(SubscribeMessageTypeEnum.COUPON_RECEIVE_MESSAGE_PUSH.getInfo());
|
||||
}
|
||||
if (StringUtils.isNotBlank(item.getTemplateId()) && appletChatConfig.getAppointOrderTemplateId().equals(item.getTemplateId())) {
|
||||
subscribe.setMessageType(SubscribeMessageTypeEnum.APPOINT_ORDER_MESSAGE_PUSH.getInfo());
|
||||
}
|
||||
if (StringUtils.isNotBlank(item.getTemplateId()) && appletChatConfig.getGoodsOrderTemplateId().equals(item.getTemplateId())) {
|
||||
subscribe.setMessageType(SubscribeMessageTypeEnum.GOODS_ORDER_MESSAGE_PUSH.getInfo());
|
||||
}
|
||||
if (StringUtils.isNotBlank(item.getTemplateId()) && appletChatConfig.getSignTemplateId().equals(item.getTemplateId())) {
|
||||
subscribe.setMessageType(SubscribeMessageTypeEnum.SIGN_MESSAGE_PUSH.getInfo());
|
||||
if (StringUtils.isNotBlank(item.getTemplateId()) && appletChatConfig.getFollowTemplateId().equals(item.getTemplateId())) {
|
||||
subscribe.setMessageType(SubscribeMessageTypeEnum.FOLLOW_MESSAGE_PUSH.getInfo());
|
||||
}
|
||||
subscribe.setSubscribeCount(1);
|
||||
subscribe.setSubscribeTime(StringUtils.isBlank(weChatMessagePushVO.getCreateTime()) ? null : DateUtils.timestampToLocalDateTime(Long.parseLong(weChatMessagePushVO.getCreateTime()) * 1000L));
|
||||
|
||||
@ -8,15 +8,18 @@ import com.xinelu.common.entity.AccessToken;
|
||||
import com.xinelu.common.entity.MessageValueEntity;
|
||||
import com.xinelu.common.exception.ServiceException;
|
||||
import com.xinelu.common.utils.http.HttpUtils;
|
||||
import com.xinelu.mobile.domain.TemplateContent;
|
||||
import com.xinelu.mobile.vo.wechatofficialaccountcallback.PatientVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
@ -187,17 +190,30 @@ public class WeChatOfficialAccountUtils {
|
||||
* 微信小程序模板消息发送
|
||||
*/
|
||||
public void sendAppletTemplateMessage(PatientVO patientVO) {
|
||||
//微信模版组装
|
||||
String thing5 = "每日阅读有助于了解当前情况哦";
|
||||
String thing1 = "新入院注意事项指导、术前须知";
|
||||
List<TemplateContent> templateContents = JSON.parseArray(patientVO.getAppletNodeContent(), TemplateContent.class);
|
||||
if (CollectionUtils.isNotEmpty(templateContents)) {
|
||||
TemplateContent templateContent = templateContents.stream().filter(Objects::nonNull).filter(item -> Objects.nonNull(item.getName()) && Objects.nonNull(item.getValue()) && "thing5".equals(item.getName())).findFirst().orElse(new TemplateContent());
|
||||
thing5 = templateContent.getValue();
|
||||
TemplateContent templateContentTwo = templateContents.stream().filter(Objects::nonNull).filter(item -> Objects.nonNull(item.getName()) && Objects.nonNull(item.getValue()) && "thing5".equals(item.getName())).findFirst().orElse(new TemplateContent());
|
||||
thing1 = templateContentTwo.getValue();
|
||||
}
|
||||
//获取微信小程序的accessToken
|
||||
String accessToken = this.getWeChatAppletAccessToken();
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
//定义模板内容
|
||||
Map<String, Object> paramsMap = new LinkedHashMap<>();
|
||||
paramsMap.put("touser", patientVO.getOpenId());
|
||||
paramsMap.put("template_id", "S_c9bR4znSWpXg-6ACIMn7AkaR11dzo113XM8w4CKz0");
|
||||
paramsMap.put("template_id", weChatAppletChatConfig.getHealthyPropagandaId());
|
||||
paramsMap.put("page", "/postDischarge/homePage/subscriptionMessage?id =" + patientVO.getSignPatientManageRouteNodeId());
|
||||
Map<String, Object> dataMap = new LinkedHashMap<>();
|
||||
dataMap.put("thing1", new MessageValueEntity("每日签到"));
|
||||
dataMap.put("thing2", new MessageValueEntity(LocalDate.now().getYear() + "年" + LocalDate.now().getMonthValue() + "月" + LocalDate.now().getDayOfMonth() + "日签到成功"));
|
||||
dataMap.put("thing3", new MessageValueEntity(patientVO.getRouteNodeName() + "第" + patientVO.getRouteNodeDay()));
|
||||
dataMap.put("thing5", new MessageValueEntity(thing5));
|
||||
dataMap.put("thing4", new MessageValueEntity(patientVO.getHospitalName()));
|
||||
dataMap.put("time3", new MessageValueEntity(now.getYear() + "年" + now.getMonthValue() + "月" + now.getDayOfMonth() + "日" + now.getHour() + ":" + now.getSecond()));
|
||||
dataMap.put("thing6", new MessageValueEntity(patientVO.getRouteNodeName() + "第" + patientVO.getRouteNodeDay()));
|
||||
dataMap.put("thing1", new MessageValueEntity(thing1));
|
||||
paramsMap.put("data", dataMap);
|
||||
//拼接请求地址并发送
|
||||
String messageUrl = Constants.OFFICIAL_ACCOUNT_SUBSCRIBE_SEND_URL + accessToken;
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
package com.xinelu.mobile.vo.wechatofficialaccountcallback;
|
||||
|
||||
import com.xinelu.common.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@ -9,80 +8,72 @@ import java.time.LocalDate;
|
||||
@Data
|
||||
public class PatientVO {
|
||||
|
||||
/** 居民表 */
|
||||
@ApiModelProperty(value = "居民表id")
|
||||
private Long residentId;
|
||||
|
||||
/** 微信标识 */
|
||||
@ApiModelProperty(value = "微信标识")
|
||||
private String openId;
|
||||
|
||||
/** 患者姓名 */
|
||||
@ApiModelProperty(value = "患者姓名")
|
||||
private String patientName;
|
||||
|
||||
/** 患者手机号 */
|
||||
@ApiModelProperty(value = "患者手机号")
|
||||
private String patientPhone;
|
||||
|
||||
/** 患者身份证号 */
|
||||
@ApiModelProperty(value = "患者身份证号")
|
||||
private String cardNo;
|
||||
|
||||
/** 患者类型 */
|
||||
@ApiModelProperty(value = "患者类型")
|
||||
private String patientType;
|
||||
|
||||
/** 入院时间 */
|
||||
@ApiModelProperty(value = "入院时间")
|
||||
private LocalDate admissionTime;
|
||||
|
||||
/** 出院时间 */
|
||||
@ApiModelProperty(value = "出院时间")
|
||||
private LocalDate dischargeTime;
|
||||
|
||||
/** 就诊时间 */
|
||||
@ApiModelProperty(value = "就诊时间")
|
||||
private LocalDate visitDate;
|
||||
|
||||
@ApiModelProperty(value = "签约患者管理任务表id")
|
||||
private Long patientId;
|
||||
|
||||
/** 签约患者管理任务表id */
|
||||
@ApiModelProperty(value = "签约患者管理任务表id")
|
||||
private Long manageRouteId;
|
||||
|
||||
/** 路径名称(任务名称) */
|
||||
@ApiModelProperty(value = "路径名称")
|
||||
private String manageRouteName;
|
||||
|
||||
/** 管理路径节点名称 */
|
||||
@ApiModelProperty(value = "管理路径节点名称")
|
||||
private String routeNodeName;
|
||||
|
||||
|
||||
/** 管理路径节点时间,时间单位为:天 */
|
||||
@ApiModelProperty(value = "管理路径节点时间,时间单位为:天")
|
||||
private Integer routeNodeDay;
|
||||
|
||||
/** 任务类型 */
|
||||
@ApiModelProperty(value = "任务类型")
|
||||
private String taskType;
|
||||
|
||||
/** 任务状态 */
|
||||
@ApiModelProperty(value = "任务状态")
|
||||
private String taskStatus;
|
||||
|
||||
/** 任务细分 */
|
||||
@ApiModelProperty(value = "任务细分")
|
||||
private String taskSubdivision;
|
||||
|
||||
|
||||
/** 公众号推送标识,0:未开启,1:已开启 */
|
||||
@ApiModelProperty(value = "公众号推送标识,0:未开启,1:已开启")
|
||||
private Integer officialPushSign;
|
||||
|
||||
/** 小程序推送标识,0:未开启,1:已开启 */
|
||||
@ApiModelProperty(value = "小程序推送标识,0:未开启,1:已开启")
|
||||
private Integer appletPushSign;
|
||||
|
||||
/**
|
||||
* 节点内容
|
||||
*/
|
||||
@ApiModelProperty(value = "节点内容")
|
||||
private String nodeContent;
|
||||
|
||||
@ApiModelProperty(value = "节点id")
|
||||
private Long signPatientManageRouteNodeId;
|
||||
|
||||
@ApiModelProperty(value = "医院名称")
|
||||
private String hospitalName;
|
||||
|
||||
@ApiModelProperty(value = "微信内容")
|
||||
private String appletNodeContent;
|
||||
}
|
||||
|
||||
@ -118,7 +118,7 @@
|
||||
spmrn.applet_push_sign,
|
||||
spmrn.node_content,
|
||||
spmrn.node_execute_status,
|
||||
spmr.patient_id
|
||||
spmrn.applet_node_content
|
||||
from sign_patient_manage_route_node spmrn
|
||||
LEFT JOIN sign_patient_manage_route spmr ON spmr.id = spmrn.manage_route_id
|
||||
LEFT JOIN patient_info pi ON pi.id = spmr.patient_id
|
||||
|
||||
@ -30,18 +30,25 @@ public class subscribeTaskServiceImpl implements SubscribeTaskService {
|
||||
@Resource
|
||||
private WeChatOfficialAccountUtils weChatOfficialAccountUtils;
|
||||
|
||||
/**
|
||||
* 推送任务组装数据
|
||||
*/
|
||||
public void signPatientManageRouteNodeTask() {
|
||||
List<PatientVO> patient = homePageMapper.selectResidentAndSubscribeMessageRecord(SubscribeStatusEnum.accept.getValue(), weChatAppletChatConfig.getSignTemplateId());
|
||||
//微信小程序订阅消息记录表
|
||||
List<PatientVO> patient = homePageMapper.selectResidentAndSubscribeMessageRecord(SubscribeStatusEnum.accept.getValue(), weChatAppletChatConfig.getFollowTemplateId());
|
||||
List<Long> collect = patient.stream().filter(Objects::nonNull).map(PatientVO::getPatientId).filter(Objects::nonNull).collect(Collectors.toList());
|
||||
if (CollectionUtils.isEmpty(collect)) {
|
||||
return;
|
||||
}
|
||||
//患者节点表
|
||||
List<PatientVO> signPatientManageRouteNodes = homePageMapper.selectSignPatientManageRouteNode(collect);
|
||||
List<PatientVO> patientVOS = new ArrayList<>();
|
||||
for (PatientVO signPatientManageRouteNode : signPatientManageRouteNodes) {
|
||||
//判断推送状态
|
||||
if (Objects.isNull(signPatientManageRouteNode.getAppletPushSign()) || signPatientManageRouteNode.getAppletPushSign() != 1) {
|
||||
continue;
|
||||
}
|
||||
//判断路径节点,组装数据
|
||||
if (signPatientManageRouteNode.getRouteNodeName().equals(RouteNodeNameEnum.AFTER_DISCHARGE.getInfo()) || signPatientManageRouteNode.getRouteNodeName().equals(RouteNodeNameEnum.AFTER_VISIT_DISCHARGE.getInfo())) {
|
||||
PatientVO patientVO = patient.stream().filter(Objects::nonNull).filter(item -> signPatientManageRouteNode.getPatientId().equals(item.getPatientId())).findFirst().orElse(new PatientVO());
|
||||
if (patientVO.getPatientType().equals(PatientTypeEnum.DISCHARGED_PATIENT.getInfo())) {
|
||||
@ -76,6 +83,7 @@ public class subscribeTaskServiceImpl implements SubscribeTaskService {
|
||||
}
|
||||
}
|
||||
}
|
||||
//发送
|
||||
for (PatientVO patientVO : patientVOS) {
|
||||
weChatOfficialAccountUtils.sendAppletTemplateMessage(patientVO);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user