消息修改修改
This commit is contained in:
parent
ec10885a85
commit
ce46a17bc9
@ -235,10 +235,12 @@
|
|||||||
<select id="selectRecordCountByManageRouteNodeIds"
|
<select id="selectRecordCountByManageRouteNodeIds"
|
||||||
resultType="com.xinelu.manage.vo.subscribemessagesendrecord.RecordNum">
|
resultType="com.xinelu.manage.vo.subscribemessagesendrecord.RecordNum">
|
||||||
select
|
select
|
||||||
manage_route_node_id,
|
spmrn.id manageRouteNodeId,
|
||||||
COUNT(1) num
|
COUNT(smsr.id) num
|
||||||
from subscribe_message_send_record
|
FROM
|
||||||
where manage_route_node_id IN
|
sign_patient_manage_route_node spmrn
|
||||||
|
LEFT JOIN subscribe_message_send_record smsr ON spmrn.id = smsr.manage_route_node_id
|
||||||
|
where spmrn.id IN
|
||||||
<foreach item="manageRouteNodeIds" collection="manageRouteNodeIds" open="(" separator="," close=")">
|
<foreach item="manageRouteNodeIds" collection="manageRouteNodeIds" open="(" separator="," close=")">
|
||||||
#{manageRouteNodeIds}
|
#{manageRouteNodeIds}
|
||||||
</foreach>
|
</foreach>
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
package com.xinelu.quartz.service.impl;
|
package com.xinelu.quartz.service.impl;
|
||||||
|
|
||||||
import com.alibaba.fastjson2.JSON;
|
|
||||||
import com.xinelu.common.config.PushMessageRestrictions;
|
import com.xinelu.common.config.PushMessageRestrictions;
|
||||||
import com.xinelu.common.config.WeChatAppletChatConfig;
|
import com.xinelu.common.config.WeChatAppletChatConfig;
|
||||||
import com.xinelu.common.enums.*;
|
import com.xinelu.common.enums.*;
|
||||||
@ -9,7 +8,6 @@ import com.xinelu.manage.domain.subscribemessagesendrecord.SubscribeMessageSendR
|
|||||||
import com.xinelu.manage.mapper.signpatientmanageroutenode.SignPatientManageRouteNodeMapper;
|
import com.xinelu.manage.mapper.signpatientmanageroutenode.SignPatientManageRouteNodeMapper;
|
||||||
import com.xinelu.manage.mapper.subscribemessagesendrecord.SubscribeMessageSendRecordMapper;
|
import com.xinelu.manage.mapper.subscribemessagesendrecord.SubscribeMessageSendRecordMapper;
|
||||||
import com.xinelu.manage.vo.subscribemessagesendrecord.RecordNum;
|
import com.xinelu.manage.vo.subscribemessagesendrecord.RecordNum;
|
||||||
import com.xinelu.mobile.domain.TemplateContent;
|
|
||||||
import com.xinelu.mobile.mapper.homepage.HomePageMapper;
|
import com.xinelu.mobile.mapper.homepage.HomePageMapper;
|
||||||
import com.xinelu.mobile.utils.WeChatOfficialAccountUtils;
|
import com.xinelu.mobile.utils.WeChatOfficialAccountUtils;
|
||||||
import com.xinelu.mobile.vo.wechatofficialaccountcallback.PatientVO;
|
import com.xinelu.mobile.vo.wechatofficialaccountcallback.PatientVO;
|
||||||
@ -87,9 +85,9 @@ public class subscribeTaskServiceImpl implements SubscribeTaskService {
|
|||||||
}
|
}
|
||||||
boolean before = localDate.isBefore(LocalDate.now()) || localDate.isEqual(LocalDate.now());
|
boolean before = localDate.isBefore(LocalDate.now()) || localDate.isEqual(LocalDate.now());
|
||||||
if (before) {
|
if (before) {
|
||||||
long until =localDate.until(LocalDate.now(), ChronoUnit.DAYS);
|
long until = localDate.until(LocalDate.now(), ChronoUnit.DAYS);
|
||||||
if (until >= pushMessageRestrictions.getTime()) {
|
if (until >= pushMessageRestrictions.getTime()) {
|
||||||
expiredManageRouteNodeIds.add(patientVO.getSignPatientManageRouteNodeId());
|
expiredManageRouteNodeIds.add(signPatientManageRouteNode.getSignPatientManageRouteNodeId());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
signPatientManageRouteNode.setOpenId(patientVO.getOpenId());
|
signPatientManageRouteNode.setOpenId(patientVO.getOpenId());
|
||||||
@ -160,12 +158,6 @@ public class subscribeTaskServiceImpl implements SubscribeTaskService {
|
|||||||
//发送失败
|
//发送失败
|
||||||
List<Long> failSignPatientManageRouteNodeIds = new ArrayList<>();
|
List<Long> failSignPatientManageRouteNodeIds = new ArrayList<>();
|
||||||
for (PatientVO patientVO : patientVOList) {
|
for (PatientVO patientVO : patientVOList) {
|
||||||
try {
|
|
||||||
//判断推送内容格式是否符合
|
|
||||||
JSON.parseArray(patientVO.getAppletNodeContent(), TemplateContent.class);
|
|
||||||
} catch (Exception e) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
// 开始推送消息
|
// 开始推送消息
|
||||||
Integer integer = weChatOfficialAccountUtils.sendAppletTemplateMessage(patientVO);
|
Integer integer = weChatOfficialAccountUtils.sendAppletTemplateMessage(patientVO);
|
||||||
SubscribeMessageSendRecord subscribeMessageSendRecord = new SubscribeMessageSendRecord();
|
SubscribeMessageSendRecord subscribeMessageSendRecord = new SubscribeMessageSendRecord();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user