定时任务修改
This commit is contained in:
parent
15ae71e230
commit
1d4a0a4481
@ -7,12 +7,12 @@ import io.swagger.annotations.ApiModel;
|
|||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 微信小程序订阅消息记录对象 subscribe_message_record
|
* 微信小程序订阅消息记录对象 subscribe_message_record
|
||||||
@ -23,7 +23,6 @@ import java.time.LocalDateTime;
|
|||||||
@Data
|
@Data
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@EqualsAndHashCode(callSuper = true)
|
|
||||||
@ApiModel(value = "微信小程序订阅消息记录对象", description = "subscribe_message_record")
|
@ApiModel(value = "微信小程序订阅消息记录对象", description = "subscribe_message_record")
|
||||||
public class SubscribeMessageRecord extends BaseEntity {
|
public class SubscribeMessageRecord extends BaseEntity {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
@ -105,6 +104,24 @@ public class SubscribeMessageRecord extends BaseEntity {
|
|||||||
private String subscribeStatus;
|
private String subscribeStatus;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object o) {
|
||||||
|
if (this == o) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (o == null || getClass() != o.getClass()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
SubscribeMessageRecord that = (SubscribeMessageRecord) o;
|
||||||
|
return Objects.equals(openid, that.openid) && Objects.equals(templateId, that.templateId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return Objects.hash(openid, templateId);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
package com.xinelu.manage.mapper.patientinfo;
|
package com.xinelu.manage.mapper.patientinfo;
|
||||||
|
|
||||||
import com.xinelu.manage.domain.patientinfo.PatientInfo;
|
import com.xinelu.manage.domain.patientinfo.PatientInfo;
|
||||||
|
import com.xinelu.manage.domain.residentinfo.ResidentInfo;
|
||||||
import com.xinelu.manage.dto.patientinfo.PatientInfoDto;
|
import com.xinelu.manage.dto.patientinfo.PatientInfoDto;
|
||||||
import com.xinelu.manage.vo.patientinfo.PatientBaseInfoVo;
|
import com.xinelu.manage.vo.patientinfo.PatientBaseInfoVo;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -82,5 +83,5 @@ public interface PatientInfoMapper {
|
|||||||
* @param openId 微信openId
|
* @param openId 微信openId
|
||||||
* @return 被护理人基本信息
|
* @return 被护理人基本信息
|
||||||
*/
|
*/
|
||||||
PatientInfo getPatientInfoByOpenId(String openId);
|
ResidentInfo getPatientInfoByOpenId(String openId);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -578,32 +578,26 @@
|
|||||||
</foreach>
|
</foreach>
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<select id="getPatientInfoByOpenId" parameterType="string" resultType="patientInfo">
|
<select id="getPatientInfoByOpenId" parameterType="string" resultType="ResidentInfo">
|
||||||
SELECT
|
SELECT
|
||||||
id,
|
id,
|
||||||
community_code,
|
patient_name,
|
||||||
area_code,
|
patient_phone,
|
||||||
patient_code,
|
family_member_phone,
|
||||||
patient_name,
|
birth_date,
|
||||||
card_no,
|
card_no,
|
||||||
user_id,
|
sex,
|
||||||
unionid,
|
|
||||||
openid,
|
|
||||||
official_account_openid,
|
|
||||||
phone,
|
|
||||||
address,
|
address,
|
||||||
urgent_contact_name,
|
open_id,
|
||||||
urgent_contact_phone,
|
union_id,
|
||||||
community_alias_name,
|
official_account_openid,
|
||||||
home_longitude,
|
avatar_picture_url
|
||||||
home_latitude,
|
|
||||||
head_picture_url
|
|
||||||
FROM
|
FROM
|
||||||
patient_info
|
resident_info
|
||||||
<where>
|
<where>
|
||||||
del_flag = 0
|
del_flag = 0
|
||||||
<if test="openId != null and openId != ''">
|
<if test="openId != null and openId != ''">
|
||||||
and openid = #{openId}
|
and open_id = #{openId}
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
@ -57,4 +57,12 @@ public interface HomePageMapper {
|
|||||||
* @return PatientVO
|
* @return PatientVO
|
||||||
*/
|
*/
|
||||||
List<PatientVO> selectSignPatientManageRouteNode(@Param("patientId") List<Long> patientId);
|
List<PatientVO> selectSignPatientManageRouteNode(@Param("patientId") List<Long> patientId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改执行状态
|
||||||
|
*
|
||||||
|
* @param signPatientManageRouteNodeIds
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
int updateNodeExecuteStatusByIds(@Param("signPatientManageRouteNodeIds") List<Long> signPatientManageRouteNodeIds);
|
||||||
}
|
}
|
||||||
@ -227,7 +227,7 @@ public class HomePageServiceImpl implements HomePageService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<PatientTaskExecuteRecord> selectPatientTaskExecuteRecord(Long residentId) {
|
public List<PatientTaskExecuteRecord> selectPatientTaskExecuteRecord(Long residentId) {
|
||||||
return homePageMapper.selectTaskExecuteRecordByResidentId(residentId, NodeExecuteStatusEnum.EXECUTED.getInfo());
|
return homePageMapper.selectTaskExecuteRecordByResidentId(residentId, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import com.xinelu.common.config.WeChatAppletChatConfig;
|
|||||||
import com.xinelu.common.enums.SubscribeMessageTypeEnum;
|
import com.xinelu.common.enums.SubscribeMessageTypeEnum;
|
||||||
import com.xinelu.common.exception.ServiceException;
|
import com.xinelu.common.exception.ServiceException;
|
||||||
import com.xinelu.common.utils.DateUtils;
|
import com.xinelu.common.utils.DateUtils;
|
||||||
import com.xinelu.manage.domain.patientinfo.PatientInfo;
|
import com.xinelu.manage.domain.residentinfo.ResidentInfo;
|
||||||
import com.xinelu.manage.domain.subscribemessagerecord.SubscribeMessageRecord;
|
import com.xinelu.manage.domain.subscribemessagerecord.SubscribeMessageRecord;
|
||||||
import com.xinelu.manage.domain.subscribemessagesendrecord.SubscribeMessageSendRecord;
|
import com.xinelu.manage.domain.subscribemessagesendrecord.SubscribeMessageSendRecord;
|
||||||
import com.xinelu.manage.mapper.patientinfo.PatientInfoMapper;
|
import com.xinelu.manage.mapper.patientinfo.PatientInfoMapper;
|
||||||
@ -92,9 +92,9 @@ public class WeChatAppletCallBackServiceImpl implements WeChatAppletCallBackServ
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//查询用户信息表
|
//查询用户信息表
|
||||||
PatientInfo patientInfo = patientInfoMapper.getPatientInfoByOpenId(StringUtils.isBlank(weChatMessagePushVO.getFromUserName()) ? "" : weChatMessagePushVO.getFromUserName());
|
ResidentInfo residentInfo = patientInfoMapper.getPatientInfoByOpenId(StringUtils.isBlank(weChatMessagePushVO.getFromUserName()) ? "" : weChatMessagePushVO.getFromUserName());
|
||||||
//组装数据
|
//组装数据
|
||||||
List<SubscribeMessageRecord> subscribeMessageRecordList = createSubscribeMessageRecordList(patientInfo, weChatMessagePushVO, SUBSCRIBE_MSG_POPUP_EVENT);
|
List<SubscribeMessageRecord> subscribeMessageRecordList = createSubscribeMessageRecordList(residentInfo, weChatMessagePushVO, SUBSCRIBE_MSG_POPUP_EVENT);
|
||||||
if (CollectionUtils.isEmpty(subscribeMessageRecordList)) {
|
if (CollectionUtils.isEmpty(subscribeMessageRecordList)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -116,9 +116,9 @@ public class WeChatAppletCallBackServiceImpl implements WeChatAppletCallBackServ
|
|||||||
//修改订阅信息状态
|
//修改订阅信息状态
|
||||||
for (SubscribeMessageRecord messageRecord : intersectionSubscribeList) {
|
for (SubscribeMessageRecord messageRecord : intersectionSubscribeList) {
|
||||||
Long patientId = null;
|
Long patientId = null;
|
||||||
if (Objects.nonNull(patientInfo) && Objects.nonNull(patientInfo.getId())) {
|
// if (Objects.nonNull(residentInfo) && Objects.nonNull(residentInfo.getId())) {
|
||||||
patientId = patientInfo.getId();
|
// patientId = residentInfo.getId();
|
||||||
}
|
// }
|
||||||
String openId = StringUtils.isBlank(messageRecord.getOpenid()) ? "" : messageRecord.getOpenid();
|
String openId = StringUtils.isBlank(messageRecord.getOpenid()) ? "" : messageRecord.getOpenid();
|
||||||
String templateId = StringUtils.isBlank(messageRecord.getTemplateId()) ? "" : messageRecord.getTemplateId();
|
String templateId = StringUtils.isBlank(messageRecord.getTemplateId()) ? "" : messageRecord.getTemplateId();
|
||||||
String subscribeStatus = StringUtils.isBlank(messageRecord.getSubscribeStatus()) ? "" : messageRecord.getSubscribeStatus();
|
String subscribeStatus = StringUtils.isBlank(messageRecord.getSubscribeStatus()) ? "" : messageRecord.getSubscribeStatus();
|
||||||
@ -137,9 +137,9 @@ public class WeChatAppletCallBackServiceImpl implements WeChatAppletCallBackServ
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//查询用户信息表
|
//查询用户信息表
|
||||||
PatientInfo patientInfo = patientInfoMapper.getPatientInfoByOpenId(StringUtils.isBlank(weChatMessagePushVO.getFromUserName()) ? "" : weChatMessagePushVO.getFromUserName());
|
ResidentInfo residentInfo = patientInfoMapper.getPatientInfoByOpenId(StringUtils.isBlank(weChatMessagePushVO.getFromUserName()) ? "" : weChatMessagePushVO.getFromUserName());
|
||||||
//组装数据
|
//组装数据
|
||||||
List<SubscribeMessageRecord> subscribeMessageRecordList = createSubscribeMessageRecordList(patientInfo, weChatMessagePushVO, SUBSCRIBE_MSG_CHANGE_EVENT);
|
List<SubscribeMessageRecord> subscribeMessageRecordList = createSubscribeMessageRecordList(residentInfo, weChatMessagePushVO, SUBSCRIBE_MSG_CHANGE_EVENT);
|
||||||
if (CollectionUtils.isEmpty(subscribeMessageRecordList)) {
|
if (CollectionUtils.isEmpty(subscribeMessageRecordList)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -152,9 +152,9 @@ public class WeChatAppletCallBackServiceImpl implements WeChatAppletCallBackServ
|
|||||||
//修改订阅信息状态
|
//修改订阅信息状态
|
||||||
for (SubscribeMessageRecord messageRecord : intersectionSubscribeList) {
|
for (SubscribeMessageRecord messageRecord : intersectionSubscribeList) {
|
||||||
Long patientId = null;
|
Long patientId = null;
|
||||||
if (Objects.nonNull(patientInfo) && Objects.nonNull(patientInfo.getId())) {
|
// if (Objects.nonNull(residentInfo) && Objects.nonNull(residentInfo.getId())) {
|
||||||
patientId = patientInfo.getId();
|
// patientId = residentInfo.getId();
|
||||||
}
|
// }
|
||||||
String openId = StringUtils.isBlank(messageRecord.getOpenid()) ? "" : messageRecord.getOpenid();
|
String openId = StringUtils.isBlank(messageRecord.getOpenid()) ? "" : messageRecord.getOpenid();
|
||||||
String templateId = StringUtils.isBlank(messageRecord.getTemplateId()) ? "" : messageRecord.getTemplateId();
|
String templateId = StringUtils.isBlank(messageRecord.getTemplateId()) ? "" : messageRecord.getTemplateId();
|
||||||
String subscribeStatus = StringUtils.isBlank(messageRecord.getSubscribeStatus()) ? "" : messageRecord.getSubscribeStatus();
|
String subscribeStatus = StringUtils.isBlank(messageRecord.getSubscribeStatus()) ? "" : messageRecord.getSubscribeStatus();
|
||||||
@ -186,19 +186,19 @@ public class WeChatAppletCallBackServiceImpl implements WeChatAppletCallBackServ
|
|||||||
/**
|
/**
|
||||||
* 组装订阅消息数据
|
* 组装订阅消息数据
|
||||||
*
|
*
|
||||||
* @param patientInfo 会员用户信息
|
* @param residentInfo 会员用户信息
|
||||||
* @param weChatMessagePushVO 微信请求参数信息
|
* @param weChatMessagePushVO 微信请求参数信息
|
||||||
* @param eventType 事件类型
|
* @param eventType 事件类型
|
||||||
* @return List<SubscribeMessageRecord>
|
* @return List<SubscribeMessageRecord>
|
||||||
*/
|
*/
|
||||||
private List<SubscribeMessageRecord> createSubscribeMessageRecordList(PatientInfo patientInfo, WeChatMessagePushVO weChatMessagePushVO, String eventType) {
|
private List<SubscribeMessageRecord> createSubscribeMessageRecordList(ResidentInfo residentInfo, WeChatMessagePushVO weChatMessagePushVO, String eventType) {
|
||||||
List<SubscribeMessageRecord> subscribeMessageRecordList = Lists.newArrayList();
|
List<SubscribeMessageRecord> subscribeMessageRecordList = Lists.newArrayList();
|
||||||
if (SUBSCRIBE_MSG_POPUP_EVENT.equals(eventType)) {
|
if (SUBSCRIBE_MSG_POPUP_EVENT.equals(eventType)) {
|
||||||
subscribeMessageRecordList = weChatMessagePushVO.getSubscribeMsgPopupEvent().getSubscribeMsgPopupEventList().stream().filter(Objects::nonNull).map(item -> {
|
subscribeMessageRecordList = weChatMessagePushVO.getSubscribeMsgPopupEvent().getSubscribeMsgPopupEventList().stream().filter(Objects::nonNull).map(item -> {
|
||||||
SubscribeMessageRecord subscribe = new SubscribeMessageRecord();
|
SubscribeMessageRecord subscribe = new SubscribeMessageRecord();
|
||||||
if (Objects.nonNull(patientInfo) && Objects.nonNull(patientInfo.getId())) {
|
// if (Objects.nonNull(residentInfo) && Objects.nonNull(residentInfo.getId())) {
|
||||||
subscribe.setPatientId(patientInfo.getId());
|
// subscribe.setPatientId(residentInfo.getId());
|
||||||
}
|
// }
|
||||||
//此处模板通知需要根据实际情况进行修改
|
//此处模板通知需要根据实际情况进行修改
|
||||||
subscribe.setOpenid(StringUtils.isBlank(weChatMessagePushVO.getFromUserName()) ? "" : weChatMessagePushVO.getFromUserName());
|
subscribe.setOpenid(StringUtils.isBlank(weChatMessagePushVO.getFromUserName()) ? "" : weChatMessagePushVO.getFromUserName());
|
||||||
subscribe.setAppletId(StringUtils.isBlank(weChatMessagePushVO.getToUserName()) ? "" : weChatMessagePushVO.getToUserName());
|
subscribe.setAppletId(StringUtils.isBlank(weChatMessagePushVO.getToUserName()) ? "" : weChatMessagePushVO.getToUserName());
|
||||||
@ -216,9 +216,9 @@ public class WeChatAppletCallBackServiceImpl implements WeChatAppletCallBackServ
|
|||||||
if (SUBSCRIBE_MSG_CHANGE_EVENT.equals(eventType)) {
|
if (SUBSCRIBE_MSG_CHANGE_EVENT.equals(eventType)) {
|
||||||
subscribeMessageRecordList = weChatMessagePushVO.getSubscribeMsgChangeEvent().getSubscribeMsgPopupEventList().stream().filter(Objects::nonNull).map(item -> {
|
subscribeMessageRecordList = weChatMessagePushVO.getSubscribeMsgChangeEvent().getSubscribeMsgPopupEventList().stream().filter(Objects::nonNull).map(item -> {
|
||||||
SubscribeMessageRecord subscribe = new SubscribeMessageRecord();
|
SubscribeMessageRecord subscribe = new SubscribeMessageRecord();
|
||||||
if (Objects.nonNull(patientInfo) && Objects.nonNull(patientInfo.getId())) {
|
// if (Objects.nonNull(residentInfo) && Objects.nonNull(residentInfo.getId())) {
|
||||||
subscribe.setPatientId(patientInfo.getId());
|
// subscribe.setPatientId(residentInfo.getId());
|
||||||
}
|
// }
|
||||||
//此处模板通知需要根据实际情况进行修改
|
//此处模板通知需要根据实际情况进行修改
|
||||||
subscribe.setOpenid(StringUtils.isBlank(weChatMessagePushVO.getFromUserName()) ? "" : weChatMessagePushVO.getFromUserName());
|
subscribe.setOpenid(StringUtils.isBlank(weChatMessagePushVO.getFromUserName()) ? "" : weChatMessagePushVO.getFromUserName());
|
||||||
subscribe.setAppletId(StringUtils.isBlank(weChatMessagePushVO.getToUserName()) ? "" : weChatMessagePushVO.getToUserName());
|
subscribe.setAppletId(StringUtils.isBlank(weChatMessagePushVO.getToUserName()) ? "" : weChatMessagePushVO.getToUserName());
|
||||||
|
|||||||
@ -6,7 +6,7 @@ import com.xinelu.common.exception.ServiceException;
|
|||||||
import com.xinelu.common.utils.DateUtils;
|
import com.xinelu.common.utils.DateUtils;
|
||||||
import com.xinelu.manage.domain.officialaccountsubscribeevent.OfficialAccountSubscribeEvent;
|
import com.xinelu.manage.domain.officialaccountsubscribeevent.OfficialAccountSubscribeEvent;
|
||||||
import com.xinelu.manage.domain.officialaccounttemplateevent.OfficialAccountTemplateEvent;
|
import com.xinelu.manage.domain.officialaccounttemplateevent.OfficialAccountTemplateEvent;
|
||||||
import com.xinelu.manage.domain.patientinfo.PatientInfo;
|
import com.xinelu.manage.domain.residentinfo.ResidentInfo;
|
||||||
import com.xinelu.manage.mapper.officialaccountsubscribeevent.OfficialAccountSubscribeEventMapper;
|
import com.xinelu.manage.mapper.officialaccountsubscribeevent.OfficialAccountSubscribeEventMapper;
|
||||||
import com.xinelu.manage.mapper.officialaccounttemplateevent.OfficialAccountTemplateEventMapper;
|
import com.xinelu.manage.mapper.officialaccounttemplateevent.OfficialAccountTemplateEventMapper;
|
||||||
import com.xinelu.manage.mapper.patientinfo.PatientInfoMapper;
|
import com.xinelu.manage.mapper.patientinfo.PatientInfoMapper;
|
||||||
@ -47,7 +47,7 @@ public class WeChatOfficialAccountCallbackServiceImpl implements WeChatOfficialA
|
|||||||
@Override
|
@Override
|
||||||
public void handleOfficialAccountTemplateEvent(WeChatOfficialAccountEventPushVO eventPushVO) {
|
public void handleOfficialAccountTemplateEvent(WeChatOfficialAccountEventPushVO eventPushVO) {
|
||||||
//查询患者信息
|
//查询患者信息
|
||||||
PatientInfo patientInfo = patientInfoMapper.getPatientInfoByOpenId(eventPushVO.getFromUserName());
|
ResidentInfo patientInfo = patientInfoMapper.getPatientInfoByOpenId(eventPushVO.getFromUserName());
|
||||||
if (Objects.isNull(patientInfo)) {
|
if (Objects.isNull(patientInfo)) {
|
||||||
log.info("当前患者信息不存在,微信用户openid为:{}", eventPushVO.getFromUserName());
|
log.info("当前患者信息不存在,微信用户openid为:{}", eventPushVO.getFromUserName());
|
||||||
return;
|
return;
|
||||||
|
|||||||
@ -190,7 +190,7 @@ public class WeChatOfficialAccountUtils {
|
|||||||
/**
|
/**
|
||||||
* 微信小程序模板消息发送
|
* 微信小程序模板消息发送
|
||||||
*/
|
*/
|
||||||
public void sendAppletTemplateMessage(PatientVO patientVO) {
|
public Integer sendAppletTemplateMessage(PatientVO patientVO) {
|
||||||
//微信模版组装
|
//微信模版组装
|
||||||
String thing5 = "每日阅读有助于了解当前情况哦";
|
String thing5 = "每日阅读有助于了解当前情况哦";
|
||||||
String thing1 = "新入院注意事项指导、术前须知";
|
String thing1 = "新入院注意事项指导、术前须知";
|
||||||
@ -252,5 +252,6 @@ public class WeChatOfficialAccountUtils {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return errCode.getErrcode();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -137,4 +137,15 @@
|
|||||||
and pi.del_flag = 0
|
and pi.del_flag = 0
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<update id="updateNodeExecuteStatusByIds">
|
||||||
|
update sign_patient_manage_route_node
|
||||||
|
set node_execute_status = 'EXECUTED'
|
||||||
|
where
|
||||||
|
id in
|
||||||
|
<foreach item="signPatientManageRouteNodeIds" collection="signPatientManageRouteNodeIds" open="(" separator=","
|
||||||
|
close=")">
|
||||||
|
#{signPatientManageRouteNodeIds}
|
||||||
|
</foreach>
|
||||||
|
</update>
|
||||||
</mapper>
|
</mapper>
|
||||||
@ -49,43 +49,54 @@ public class subscribeTaskServiceImpl implements SubscribeTaskService {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
//判断路径节点,组装数据
|
//判断路径节点,组装数据
|
||||||
if (signPatientManageRouteNode.getRouteNodeName().equals(RouteNodeNameEnum.AFTER_DISCHARGE.getName()) || signPatientManageRouteNode.getRouteNodeName().equals(RouteNodeNameEnum.AFTER_VISIT_DISCHARGE.getName())) {
|
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());
|
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())) {
|
if (patientVO.getPatientType().equals(PatientTypeEnum.DISCHARGED_PATIENT.getInfo())) {
|
||||||
LocalDate localDate = patientVO.getDischargeTime().plusDays(signPatientManageRouteNode.getRouteNodeDay());
|
LocalDate localDate = patientVO.getDischargeTime().plusDays(signPatientManageRouteNode.getRouteNodeDay());
|
||||||
boolean before = localDate.isEqual(LocalDate.now());
|
boolean before = localDate.isEqual(LocalDate.now());
|
||||||
if (before) {
|
if (before) {
|
||||||
signPatientManageRouteNode.setOpenId(patientVO.getOpenId());
|
signPatientManageRouteNode.setOpenId(patientVO.getOpenId());
|
||||||
|
signPatientManageRouteNode.setRouteNodeName(RouteNodeNameEnum.AFTER_DISCHARGE.getName());
|
||||||
patientVOS.add(signPatientManageRouteNode);
|
patientVOS.add(signPatientManageRouteNode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (signPatientManageRouteNode.getRouteNodeName().equals(RouteNodeNameEnum.AFTER_ADMISSION.getName())) {
|
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());
|
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())) {
|
if (patientVO.getPatientType().equals(PatientTypeEnum.IN_HOSPITAL_PATIENT.getInfo())) {
|
||||||
LocalDate localDate = patientVO.getAdmissionTime().plusDays(signPatientManageRouteNode.getRouteNodeDay());
|
LocalDate localDate = patientVO.getAdmissionTime().plusDays(signPatientManageRouteNode.getRouteNodeDay());
|
||||||
boolean before = localDate.isEqual(LocalDate.now());
|
boolean before = localDate.isEqual(LocalDate.now());
|
||||||
if (before) {
|
if (before) {
|
||||||
signPatientManageRouteNode.setOpenId(patientVO.getOpenId());
|
signPatientManageRouteNode.setOpenId(patientVO.getOpenId());
|
||||||
|
signPatientManageRouteNode.setRouteNodeName(RouteNodeNameEnum.AFTER_ADMISSION.getName());
|
||||||
patientVOS.add(signPatientManageRouteNode);
|
patientVOS.add(signPatientManageRouteNode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (signPatientManageRouteNode.getRouteNodeName().equals(RouteNodeNameEnum.AFTER_CONSULTATION.getName()) || signPatientManageRouteNode.getRouteNodeName().equals(RouteNodeNameEnum.AFTER_VISIT_DISCHARGE.getName())) {
|
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());
|
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.getAdmissionTime() == null) {
|
if (patientVO.getPatientType().equals(PatientTypeEnum.OUTPATIENT.getInfo()) && patientVO.getAdmissionTime() == null) {
|
||||||
LocalDate localDate = patientVO.getVisitDate().plusDays(signPatientManageRouteNode.getRouteNodeDay());
|
LocalDate localDate = patientVO.getVisitDate().plusDays(signPatientManageRouteNode.getRouteNodeDay());
|
||||||
boolean before = localDate.isEqual(LocalDate.now());
|
boolean before = localDate.isEqual(LocalDate.now());
|
||||||
if (before) {
|
if (before) {
|
||||||
signPatientManageRouteNode.setOpenId(patientVO.getOpenId());
|
signPatientManageRouteNode.setOpenId(patientVO.getOpenId());
|
||||||
|
signPatientManageRouteNode.setRouteNodeName(RouteNodeNameEnum.AFTER_CONSULTATION.getName());
|
||||||
patientVOS.add(signPatientManageRouteNode);
|
patientVOS.add(signPatientManageRouteNode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
List<Long> signPatientManageRouteNodeIds = new ArrayList<>();
|
||||||
//发送
|
//发送
|
||||||
for (PatientVO patientVO : patientVOS) {
|
for (PatientVO patientVO : patientVOS) {
|
||||||
weChatOfficialAccountUtils.sendAppletTemplateMessage(patientVO);
|
Integer integer = weChatOfficialAccountUtils.sendAppletTemplateMessage(patientVO);
|
||||||
|
if (integer == 0) {
|
||||||
|
signPatientManageRouteNodeIds.add(patientVO.getSignPatientManageRouteNodeId());
|
||||||
|
}
|
||||||
|
//更改执行状态
|
||||||
|
if (CollectionUtils.isNotEmpty(signPatientManageRouteNodeIds)) {
|
||||||
|
homePageMapper.updateNodeExecuteStatusByIds(signPatientManageRouteNodeIds);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user