消息推送修改
This commit is contained in:
parent
a8050ed6fe
commit
57a67a0509
@ -267,3 +267,10 @@ applet-page-config:
|
||||
page-url: pages/startup/startup
|
||||
# 个人中心-优惠券页面跳转路径
|
||||
propaganda-page-url: pages/propaganda/propaganda
|
||||
|
||||
#推送消息限制
|
||||
push-message-restrictions:
|
||||
#次数
|
||||
number: 1
|
||||
#时间 : 单位,天
|
||||
time: 2
|
||||
|
||||
@ -0,0 +1,20 @@
|
||||
package com.xinelu.common.config;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @Description 新医路院后微信小程序消息参数配置类
|
||||
* @Author zh
|
||||
* @Date 2024-07-31
|
||||
*/
|
||||
@Data
|
||||
@Component
|
||||
@ConfigurationProperties(prefix = "push-message-restrictions")
|
||||
public class PushMessageRestrictions {
|
||||
|
||||
private Long number;
|
||||
|
||||
private Long time;
|
||||
}
|
||||
@ -13,6 +13,7 @@ import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 患者管理任务执行记录Service业务层处理
|
||||
@ -105,7 +106,9 @@ public class PatientTaskExecuteRecordServiceImpl implements IPatientTaskExecuteR
|
||||
@Override
|
||||
public AjaxResult selectVisitRecord(Long id) {
|
||||
PatientTaskExecuteRecordVO patientTaskExecuteRecordVO = patientTaskExecuteRecordMapper.selectVisitRecord(id);
|
||||
patientTaskExecuteRecordVO.setAge(AgeUtil.getAgeMonth(patientTaskExecuteRecordVO.getBirthDate().toString()));
|
||||
if (Objects.nonNull(patientTaskExecuteRecordVO.getBirthDate())) {
|
||||
patientTaskExecuteRecordVO.setAge(AgeUtil.getAgeMonth(patientTaskExecuteRecordVO.getBirthDate().toString()));
|
||||
}
|
||||
return AjaxResult.success(patientTaskExecuteRecordVO);
|
||||
}
|
||||
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.xinelu.quartz.service.impl;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.xinelu.common.config.PushMessageRestrictions;
|
||||
import com.xinelu.common.config.WeChatAppletChatConfig;
|
||||
import com.xinelu.common.enums.*;
|
||||
import com.xinelu.common.utils.SecurityUtils;
|
||||
@ -41,6 +42,8 @@ public class subscribeTaskServiceImpl implements SubscribeTaskService {
|
||||
private WeChatOfficialAccountUtils weChatOfficialAccountUtils;
|
||||
@Resource
|
||||
private SubscribeMessageSendRecordMapper subscribeMessageSendRecordMapper;
|
||||
@Resource
|
||||
private PushMessageRestrictions pushMessageRestrictions;
|
||||
|
||||
/**
|
||||
* 推送任务组装数据
|
||||
@ -81,7 +84,7 @@ public class subscribeTaskServiceImpl implements SubscribeTaskService {
|
||||
boolean before = localDate.isBefore(LocalDate.now()) || localDate.isEqual(LocalDate.now());
|
||||
if (before) {
|
||||
int i = LocalDate.now().compareTo(localDate);
|
||||
if (i >= 1) {
|
||||
if (i >= pushMessageRestrictions.getTime()) {
|
||||
expiredManageRouteNodeIds.add(patientVO.getSignPatientManageRouteNodeId());
|
||||
continue;
|
||||
}
|
||||
@ -171,7 +174,7 @@ public class subscribeTaskServiceImpl implements SubscribeTaskService {
|
||||
subscribeMessageSendRecord.setErrorCode(integer);
|
||||
subscribeMessageSendRecord.setErrorStatus(ErrorStatusEnum.fail.getValue());
|
||||
RecordNum recordNum = recordNums.stream().filter(Objects::nonNull).filter(item -> Objects.nonNull(item.getManageRouteNodeId()) && item.getManageRouteNodeId().equals(patientVO.getSignPatientManageRouteNodeId())).findFirst().orElse(new RecordNum());
|
||||
if (Objects.nonNull(recordNum.getNum()) && recordNum.getNum() >= 2) {
|
||||
if (Objects.nonNull(recordNum.getNum()) && recordNum.getNum() >= pushMessageRestrictions.getNumber()) {
|
||||
failSignPatientManageRouteNodeIds.add(patientVO.getSignPatientManageRouteNodeId());
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user