Merge branch '0418_小程序开发' of http://182.92.166.109:3000/jihan/PostDischargePatientManage into 0418_小程序开发
Conflicts: postdischarge-manage/src/main/java/com/xinelu/manage/service/specialdiseasenode/impl/SpecialDiseaseNodeServiceImpl.java
This commit is contained in:
commit
5291ed69de
@ -0,0 +1,34 @@
|
|||||||
|
package com.xinelu.common.enums;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
public enum PatientTypeEnum {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预住院患者
|
||||||
|
*/
|
||||||
|
PRE_HOSPITALIZED_PATIENT("PRE_HOSPITALIZED_PATIENT"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 在院患者
|
||||||
|
*/
|
||||||
|
IN_HOSPITAL_PATIENT("IN_HOSPITAL_PATIENT"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 门诊患者
|
||||||
|
*/
|
||||||
|
OUTPATIENT("OUTPATIENT"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出院患者
|
||||||
|
*/
|
||||||
|
DISCHARGED_PATIENT("DISCHARGED_PATIENT"),
|
||||||
|
;
|
||||||
|
|
||||||
|
final private String info;
|
||||||
|
|
||||||
|
PatientTypeEnum(String info) {
|
||||||
|
this.info = info;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -12,12 +12,12 @@ import lombok.Getter;
|
|||||||
public enum ReleaseStatusEnum {
|
public enum ReleaseStatusEnum {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 同意
|
* 已发布
|
||||||
*/
|
*/
|
||||||
PUBLISHED("PUBLISHED"),
|
PUBLISHED("PUBLISHED"),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 不同意
|
* 未发布
|
||||||
*/
|
*/
|
||||||
UNPUBLISHED("UNPUBLISHED"),
|
UNPUBLISHED("UNPUBLISHED"),
|
||||||
|
|
||||||
@ -25,6 +25,12 @@ public enum ReleaseStatusEnum {
|
|||||||
* 全部
|
* 全部
|
||||||
*/
|
*/
|
||||||
ALL("ALL"),
|
ALL("ALL"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 撤销
|
||||||
|
*/
|
||||||
|
REVOKE("REVOKE"),
|
||||||
|
|
||||||
;
|
;
|
||||||
final private String info;
|
final private String info;
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,11 @@ package com.xinelu.manage.service.specialdiseasenode.impl;
|
|||||||
|
|
||||||
import com.alibaba.fastjson2.JSONObject;
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
import com.xinelu.common.core.domain.AjaxResult;
|
import com.xinelu.common.core.domain.AjaxResult;
|
||||||
|
<<<<<<< HEAD
|
||||||
import com.xinelu.common.enums.PatientSexEnum;
|
import com.xinelu.common.enums.PatientSexEnum;
|
||||||
|
=======
|
||||||
|
import com.xinelu.common.enums.ReleaseStatusEnum;
|
||||||
|
>>>>>>> a9d88907476e81d075325ea216bb7f53e0817377
|
||||||
import com.xinelu.common.exception.ServiceException;
|
import com.xinelu.common.exception.ServiceException;
|
||||||
import com.xinelu.common.utils.BaseUtil;
|
import com.xinelu.common.utils.BaseUtil;
|
||||||
import com.xinelu.common.utils.SecurityUtils;
|
import com.xinelu.common.utils.SecurityUtils;
|
||||||
@ -18,16 +22,6 @@ import com.xinelu.manage.mapper.specialdiseaseroute.SpecialDiseaseRouteMapper;
|
|||||||
import com.xinelu.manage.service.specialdiseasenode.ISpecialDiseaseNodeService;
|
import com.xinelu.manage.service.specialdiseasenode.ISpecialDiseaseNodeService;
|
||||||
import com.xinelu.manage.vo.specialdiseasenode.SpecialDiseaseNodeVO;
|
import com.xinelu.manage.vo.specialdiseasenode.SpecialDiseaseNodeVO;
|
||||||
import com.xinelu.manage.vo.specialdiseaseroute.SpecialDiseaseRouteVO;
|
import com.xinelu.manage.vo.specialdiseaseroute.SpecialDiseaseRouteVO;
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.time.format.DateTimeFormatter;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Comparator;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Objects;
|
|
||||||
import java.util.TreeSet;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.apache.commons.collections4.ListUtils;
|
import org.apache.commons.collections4.ListUtils;
|
||||||
@ -39,6 +33,12 @@ import org.jsoup.select.Elements;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 专病路径-管理节点信息Service业务层处理
|
* 专病路径-管理节点信息Service业务层处理
|
||||||
*
|
*
|
||||||
@ -52,10 +52,10 @@ public class SpecialDiseaseNodeServiceImpl implements ISpecialDiseaseNodeService
|
|||||||
private SpecialDiseaseNodeMapper specialDiseaseNodeMapper;
|
private SpecialDiseaseNodeMapper specialDiseaseNodeMapper;
|
||||||
@Resource
|
@Resource
|
||||||
private SpecialDiseaseRouteMapper specialDiseaseRouteMapper;
|
private SpecialDiseaseRouteMapper specialDiseaseRouteMapper;
|
||||||
@Resource
|
@Resource
|
||||||
private PatientNodeParamsCurrentMapper patientNodeParamsCurrentMapper;
|
private PatientNodeParamsCurrentMapper patientNodeParamsCurrentMapper;
|
||||||
@Resource
|
@Resource
|
||||||
private PatientInfoMapper patientInfoMapper;
|
private PatientInfoMapper patientInfoMapper;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -118,6 +118,12 @@ public class SpecialDiseaseNodeServiceImpl implements ISpecialDiseaseNodeService
|
|||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult updateSpecialDiseaseNode(SpecialDiseaseRouteVO specialDiseaseNode) {
|
public AjaxResult updateSpecialDiseaseNode(SpecialDiseaseRouteVO specialDiseaseNode) {
|
||||||
|
if (Objects.nonNull(specialDiseaseNode) && Objects.nonNull(specialDiseaseNode.getSpecialDiseaseRouteId())) {
|
||||||
|
SpecialDiseaseRoute specialDiseaseRoute = specialDiseaseRouteMapper.selectSpecialDiseaseRouteById(specialDiseaseNode.getSpecialDiseaseRouteId());
|
||||||
|
if (Objects.nonNull(specialDiseaseRoute) && StringUtils.isNotBlank(specialDiseaseRoute.getReleaseStatus()) && !ReleaseStatusEnum.UNPUBLISHED.getInfo().equals(specialDiseaseRoute.getReleaseStatus())) {
|
||||||
|
return AjaxResult.error("已发布过的专病路径不能修改!");
|
||||||
|
}
|
||||||
|
}
|
||||||
SpecialDiseaseRoute specialDiseaseRoute = new SpecialDiseaseRoute();
|
SpecialDiseaseRoute specialDiseaseRoute = new SpecialDiseaseRoute();
|
||||||
BeanUtils.copyBeanProp(specialDiseaseRoute, specialDiseaseNode);
|
BeanUtils.copyBeanProp(specialDiseaseRoute, specialDiseaseNode);
|
||||||
specialDiseaseRoute.setUpdateTime(LocalDateTime.now());
|
specialDiseaseRoute.setUpdateTime(LocalDateTime.now());
|
||||||
|
|||||||
@ -221,7 +221,7 @@ public class SpecialDiseaseRouteServiceImpl implements ISpecialDiseaseRouteServi
|
|||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult editReleaseStatus(SpecialDiseaseRoute specialDiseaseRoute) {
|
public AjaxResult editReleaseStatus(SpecialDiseaseRoute specialDiseaseRoute) {
|
||||||
if (Objects.isNull(specialDiseaseRoute) || StringUtils.isBlank(specialDiseaseRoute.getReleaseStatus())) {
|
if (Objects.isNull(specialDiseaseRoute) || StringUtils.isBlank(specialDiseaseRoute.getReleaseStatus()) || Objects.isNull(specialDiseaseRoute.getId())) {
|
||||||
return AjaxResult.error("请选择需要发布专病路径的信息!");
|
return AjaxResult.error("请选择需要发布专病路径的信息!");
|
||||||
}
|
}
|
||||||
if (ReleaseStatusEnum.PUBLISHED.getInfo().equals(specialDiseaseRoute.getReleaseStatus())) {
|
if (ReleaseStatusEnum.PUBLISHED.getInfo().equals(specialDiseaseRoute.getReleaseStatus())) {
|
||||||
@ -230,6 +230,9 @@ public class SpecialDiseaseRouteServiceImpl implements ISpecialDiseaseRouteServi
|
|||||||
return AjaxResult.error("该路径存在未审核的节点,请全部审核后发布!");
|
return AjaxResult.error("该路径存在未审核的节点,请全部审核后发布!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (ReleaseStatusEnum.UNPUBLISHED.getInfo().equals(specialDiseaseRoute.getReleaseStatus())) {
|
||||||
|
specialDiseaseRoute.setReleaseStatus(ReleaseStatusEnum.REVOKE.getInfo());
|
||||||
|
}
|
||||||
specialDiseaseRoute.setUpdateTime(LocalDateTime.now());
|
specialDiseaseRoute.setUpdateTime(LocalDateTime.now());
|
||||||
specialDiseaseRoute.setUpdateBy(SecurityUtils.getUsername());
|
specialDiseaseRoute.setUpdateBy(SecurityUtils.getUsername());
|
||||||
return AjaxResult.success(specialDiseaseRouteMapper.updateSpecialDiseaseRoute(specialDiseaseRoute));
|
return AjaxResult.success(specialDiseaseRouteMapper.updateSpecialDiseaseRoute(specialDiseaseRoute));
|
||||||
|
|||||||
@ -34,6 +34,11 @@ public class SpecialDiseaseRouteVO extends SpecialDiseaseRoute {
|
|||||||
*/
|
*/
|
||||||
private Long agreeNumber;
|
private Long agreeNumber;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发布状态
|
||||||
|
*/
|
||||||
|
private String releaseStatus;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 节点信息
|
* 节点信息
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -2,6 +2,7 @@ package com.xinelu.mobile.controller;
|
|||||||
|
|
||||||
import com.xinelu.mobile.utils.WeChatAppletUtils;
|
import com.xinelu.mobile.utils.WeChatAppletUtils;
|
||||||
import com.xinelu.mobile.utils.WeChatOfficialAccountUtils;
|
import com.xinelu.mobile.utils.WeChatOfficialAccountUtils;
|
||||||
|
import com.xinelu.mobile.vo.wechatofficialaccountcallback.PatientVO;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
@ -42,7 +43,7 @@ public class MobileTestController {
|
|||||||
* 测试微信公众号模板消息发送
|
* 测试微信公众号模板消息发送
|
||||||
*/
|
*/
|
||||||
@GetMapping("/sendOfficialAccountTemplate")
|
@GetMapping("/sendOfficialAccountTemplate")
|
||||||
public void sendOfficialAccountTemplateMessage() {
|
public void sendOfficialAccountTemplateMessage(PatientVO patientVO) {
|
||||||
weChatOfficialAccountUtils.sendOfficialAccountTemplateMessage();
|
weChatOfficialAccountUtils.sendOfficialAccountTemplateMessage(patientVO);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,7 +13,7 @@ import javax.annotation.Resource;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 机构信息Controller
|
* 小程序首页Controller
|
||||||
*
|
*
|
||||||
* @author xinelu
|
* @author xinelu
|
||||||
* @date 2024-04-18
|
* @date 2024-04-18
|
||||||
|
|||||||
@ -3,6 +3,7 @@ package com.xinelu.mobile.mapper.homepage;
|
|||||||
import com.xinelu.manage.domain.patienttaskexecuterecord.PatientTaskExecuteRecord;
|
import com.xinelu.manage.domain.patienttaskexecuterecord.PatientTaskExecuteRecord;
|
||||||
import com.xinelu.mobile.vo.myfollowup.MyFollowUpVO;
|
import com.xinelu.mobile.vo.myfollowup.MyFollowUpVO;
|
||||||
import com.xinelu.mobile.vo.satisfactionquestionnaire.SatisfactionQuestionnaire;
|
import com.xinelu.mobile.vo.satisfactionquestionnaire.SatisfactionQuestionnaire;
|
||||||
|
import com.xinelu.mobile.vo.wechatofficialaccountcallback.PatientVO;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -39,4 +40,8 @@ public interface HomePageMapper {
|
|||||||
* @return SatisfactionQuestionnaire
|
* @return SatisfactionQuestionnaire
|
||||||
*/
|
*/
|
||||||
List<SatisfactionQuestionnaire> satisfactionQuestionnaireByResidentId(@Param("residentId") Long residentId, @Param("questionType") String questionType, @Param("questionnaireStatus") String questionnaireStatus);
|
List<SatisfactionQuestionnaire> satisfactionQuestionnaireByResidentId(@Param("residentId") Long residentId, @Param("questionType") String questionType, @Param("questionnaireStatus") String questionnaireStatus);
|
||||||
|
|
||||||
|
List<PatientVO> selectResidentAndSubscribeMessageRecord(@Param("subscribeStatus") String subscribeStatus, @Param("templateId") String templateId);
|
||||||
|
|
||||||
|
List<PatientVO> selectSignPatientManageRouteNode(@Param("patientId") List<Long> patientId);
|
||||||
}
|
}
|
||||||
@ -1,22 +1,29 @@
|
|||||||
package com.xinelu.mobile.utils;
|
package com.xinelu.mobile.utils;
|
||||||
|
|
||||||
import com.alibaba.fastjson2.JSON;
|
import com.alibaba.fastjson2.JSON;
|
||||||
|
import com.xinelu.common.config.WeChatAppletChatConfig;
|
||||||
import com.xinelu.common.config.WeChatOfficialAccountConfig;
|
import com.xinelu.common.config.WeChatOfficialAccountConfig;
|
||||||
import com.xinelu.common.constant.Constants;
|
import com.xinelu.common.constant.Constants;
|
||||||
import com.xinelu.common.entity.AccessToken;
|
import com.xinelu.common.entity.AccessToken;
|
||||||
import com.xinelu.common.entity.MessageValueEntity;
|
import com.xinelu.common.entity.MessageValueEntity;
|
||||||
|
import com.xinelu.common.enums.PatientTypeEnum;
|
||||||
|
import com.xinelu.common.enums.RouteNodeNameEnum;
|
||||||
|
import com.xinelu.common.enums.SubscribeStatusEnum;
|
||||||
import com.xinelu.common.exception.ServiceException;
|
import com.xinelu.common.exception.ServiceException;
|
||||||
import com.xinelu.common.utils.http.HttpUtils;
|
import com.xinelu.common.utils.http.HttpUtils;
|
||||||
|
import com.xinelu.manage.service.specialdiseaseroute.ISpecialDiseaseRouteService;
|
||||||
|
import com.xinelu.mobile.mapper.homepage.HomePageMapper;
|
||||||
|
import com.xinelu.mobile.vo.wechatofficialaccountcallback.PatientVO;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.data.redis.core.RedisTemplate;
|
import org.springframework.data.redis.core.RedisTemplate;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.LinkedHashMap;
|
import java.time.LocalDate;
|
||||||
import java.util.Map;
|
import java.util.*;
|
||||||
import java.util.Objects;
|
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description 院后公众号公众方法工具类
|
* @Description 院后公众号公众方法工具类
|
||||||
@ -32,6 +39,13 @@ public class WeChatOfficialAccountUtils {
|
|||||||
private RedisTemplate<String, Object> redisTemplate;
|
private RedisTemplate<String, Object> redisTemplate;
|
||||||
@Resource
|
@Resource
|
||||||
private WeChatOfficialAccountConfig weChatOfficialAccountConfig;
|
private WeChatOfficialAccountConfig weChatOfficialAccountConfig;
|
||||||
|
@Resource
|
||||||
|
private HomePageMapper homePageMapper;
|
||||||
|
@Resource
|
||||||
|
private ISpecialDiseaseRouteService iSpecialDiseaseRouteService;
|
||||||
|
@Resource
|
||||||
|
private WeChatAppletChatConfig weChatAppletChatConfig;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 返回成功状态码
|
* 返回成功状态码
|
||||||
*/
|
*/
|
||||||
@ -77,12 +91,12 @@ public class WeChatOfficialAccountUtils {
|
|||||||
/**
|
/**
|
||||||
* 微信公众号模板消息发送
|
* 微信公众号模板消息发送
|
||||||
*/
|
*/
|
||||||
public void sendOfficialAccountTemplateMessage() {
|
public void sendOfficialAccountTemplateMessage(PatientVO patientVO) {
|
||||||
//获取微信公众号的accessToken
|
//获取微信公众号的accessToken
|
||||||
String accessToken = this.getWeChatOfficialAccountAccessToken();
|
String accessToken = this.getWeChatOfficialAccountAccessToken();
|
||||||
//定义模板内容,公众模板内容
|
//定义模板内容,公众模板内容
|
||||||
Map<String, Object> paramsMap = new LinkedHashMap<>();
|
Map<String, Object> paramsMap = new LinkedHashMap<>();
|
||||||
paramsMap.put("touser", "oSwvX5qknp3DrAXfBgFjoMvG6WCI");
|
paramsMap.put("touser", patientVO.getOpenId());
|
||||||
paramsMap.put("template_id", "WUCYtSbH-QFRV_fMcfmn86QLsz1zo881QW7fQNTWOjc");
|
paramsMap.put("template_id", "WUCYtSbH-QFRV_fMcfmn86QLsz1zo881QW7fQNTWOjc");
|
||||||
//微信小程序跳转内容
|
//微信小程序跳转内容
|
||||||
Map<String, Object> miniprogramMap = new LinkedHashMap<>();
|
Map<String, Object> miniprogramMap = new LinkedHashMap<>();
|
||||||
@ -131,4 +145,51 @@ public class WeChatOfficialAccountUtils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void aaaaaa() {
|
||||||
|
List<PatientVO> patient = homePageMapper.selectResidentAndSubscribeMessageRecord(SubscribeStatusEnum.accept.getValue(), weChatAppletChatConfig.getSignTemplateId());
|
||||||
|
List<Long> collect = patient.stream().filter(Objects::nonNull).map(PatientVO::getPatientId).filter(Objects::nonNull).collect(Collectors.toList());
|
||||||
|
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())) {
|
||||||
|
LocalDate localDate = patientVO.getDischargeTime().plusDays(signPatientManageRouteNode.getRouteNodeDay());
|
||||||
|
boolean before = localDate.isEqual(LocalDate.now());
|
||||||
|
if (before) {
|
||||||
|
patientVOS.add(signPatientManageRouteNode);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (signPatientManageRouteNode.getRouteNodeName().equals(RouteNodeNameEnum.AFTER_ADMISSION.getInfo())) {
|
||||||
|
PatientVO patientVO = patient.stream().filter(Objects::nonNull).filter(item -> signPatientManageRouteNode.getPatientId().equals(item.getPatientId())).findFirst().orElse(new PatientVO());
|
||||||
|
if (patientVO.getPatientType().equals(PatientTypeEnum.IN_HOSPITAL_PATIENT.getInfo())) {
|
||||||
|
LocalDate localDate = patientVO.getAdmissionTime().plusDays(signPatientManageRouteNode.getRouteNodeDay());
|
||||||
|
boolean before = localDate.isEqual(LocalDate.now());
|
||||||
|
if (before) {
|
||||||
|
patientVOS.add(signPatientManageRouteNode);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (signPatientManageRouteNode.getRouteNodeName().equals(RouteNodeNameEnum.AFTER_CONSULTATION.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.OUTPATIENT.getInfo()) && patientVO.getDischargeTime() == null) {
|
||||||
|
LocalDate localDate = patientVO.getVisitDate().plusDays(signPatientManageRouteNode.getRouteNodeDay());
|
||||||
|
boolean before = localDate.isEqual(LocalDate.now());
|
||||||
|
if (before) {
|
||||||
|
patientVOS.add(signPatientManageRouteNode);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (PatientVO patientVO : patientVOS) {
|
||||||
|
sendOfficialAccountTemplateMessage(patientVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,88 @@
|
|||||||
|
package com.xinelu.mobile.vo.wechatofficialaccountcallback;
|
||||||
|
|
||||||
|
import com.xinelu.common.annotation.Excel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class PatientVO {
|
||||||
|
|
||||||
|
/** 居民表 */
|
||||||
|
private Long residentId;
|
||||||
|
|
||||||
|
/** 微信标识 */
|
||||||
|
private String openId;
|
||||||
|
|
||||||
|
/** 患者姓名 */
|
||||||
|
private String patientName;
|
||||||
|
|
||||||
|
/** 患者手机号 */
|
||||||
|
private String patientPhone;
|
||||||
|
|
||||||
|
/** 患者身份证号 */
|
||||||
|
private String cardNo;
|
||||||
|
|
||||||
|
/** 患者类型 */
|
||||||
|
private String patientType;
|
||||||
|
|
||||||
|
/** 入院时间 */
|
||||||
|
private LocalDate admissionTime;
|
||||||
|
|
||||||
|
/** 出院时间 */
|
||||||
|
private LocalDate dischargeTime;
|
||||||
|
|
||||||
|
/** 就诊时间 */
|
||||||
|
private LocalDate visitDate;
|
||||||
|
|
||||||
|
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;
|
||||||
|
|
||||||
|
private Long signPatientManageRouteNodeId;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -82,4 +82,51 @@
|
|||||||
AND qi.questionnaire_status = #{questionnaireStatus}
|
AND qi.questionnaire_status = #{questionnaireStatus}
|
||||||
ORDER BY qi.create_time DESC
|
ORDER BY qi.create_time DESC
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectResidentAndSubscribeMessageRecord"
|
||||||
|
resultType="com.xinelu.mobile.vo.wechatofficialaccountcallback.PatientVO">
|
||||||
|
select ri.id residentId,
|
||||||
|
ri.open_id,
|
||||||
|
pi.patient_name,
|
||||||
|
pi.patient_phone,
|
||||||
|
pi.card_no,
|
||||||
|
pi.patient_type,
|
||||||
|
pi.admission_time,
|
||||||
|
pi.discharge_time,
|
||||||
|
pi.visit_date,
|
||||||
|
pi.id patientId
|
||||||
|
from resident_info ri
|
||||||
|
LEFT JOIN subscribe_message_record smr ON ri.open_id = smr.openid
|
||||||
|
LEFT JOIN patient_info pi ON ri.id = pi.resident_id
|
||||||
|
where ri.del_flag = 0
|
||||||
|
and smr.subscribe_status = #{subscribeStatus}
|
||||||
|
and smr.template_id = #{templateId}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectSignPatientManageRouteNode"
|
||||||
|
resultType="com.xinelu.mobile.vo.wechatofficialaccountcallback.PatientVO">
|
||||||
|
select
|
||||||
|
spmrn.manage_route_id,
|
||||||
|
spmrn.id signPatientManageRouteNodeId,
|
||||||
|
spmrn.task_type,
|
||||||
|
spmrn.task_subdivision,
|
||||||
|
spmrn.manage_route_name,
|
||||||
|
spmrn.route_node_name,
|
||||||
|
spmrn.route_node_day,
|
||||||
|
spmrn.task_subdivision,
|
||||||
|
spmrn.applet_push_sign,
|
||||||
|
spmrn.node_content,
|
||||||
|
spmrn.node_execute_status
|
||||||
|
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
|
||||||
|
<where>
|
||||||
|
spmr.patient_id in
|
||||||
|
<foreach item="patientId" collection="patientId" open="(" separator="," close=")">
|
||||||
|
#{patientId}
|
||||||
|
</foreach>
|
||||||
|
and node_execute_status = 'UNEXECUTED'
|
||||||
|
and del_flag = 0
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
Loading…
Reference in New Issue
Block a user