定时任务

This commit is contained in:
zhangheng 2024-05-27 18:21:21 +08:00
parent fd1f709db5
commit 5d8b110ef1
4 changed files with 45 additions and 8 deletions

View File

@ -37,6 +37,9 @@ public class SubscribeMessageSendDataServiceImpl implements SubscribeMessageSend
public void subscribeMessageSendDataTask() {
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());
if (CollectionUtils.isEmpty(collect)) {
return;
}
List<PatientVO> signPatientManageRouteNodes = homePageMapper.selectSignPatientManageRouteNode(collect);
List<PatientVO> patientVOS = new ArrayList<>();
for (PatientVO signPatientManageRouteNode : signPatientManageRouteNodes) {

View File

@ -116,17 +116,21 @@
spmrn.task_subdivision,
spmrn.applet_push_sign,
spmrn.node_content,
spmrn.node_execute_status
spmrn.node_execute_status,
spmr.patient_id
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
<if test="patientId != null and patientId.size() > 0">
spmr.patient_id in
<foreach item="patientId" collection="patientId" open="(" separator="," close=")">
#{patientId}
</foreach>
</if>
and spmrn.node_execute_status = 'UNEXECUTED'
and spmrn.del_flag = 0
and pi.del_flag = 0
</where>
</select>
</mapper>

View File

@ -0,0 +1,30 @@
package com.xinelu.quartz.controller;
import com.xinelu.quartz.task.SubscribeTask;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
* 消息推送
*
* @author xinelu
*/
@RestController
@RequestMapping("/monitor/messageSubscription")
public class MessageSubscriptionController {
@Resource
private SubscribeTask subscribeTask;
/**
* 手动执行专病路径定时任务
*/
@GetMapping("/signPatientManageRouteNode")
public void signPatientManageRouteNode() {
subscribeTask.automaticSendSignPatientManageRouteNodeTask();
}
}

View File

@ -21,7 +21,7 @@ public class SubscribeTask {
/**
* 签约患者管理任务路径节点消息推送定时任务每10分钟执行一次
*/
public void automaticSendGoodsOrderTask() {
public void automaticSendSignPatientManageRouteNodeTask() {
log.info("开始执行签约患者管理任务路径节点推送定时任务......");
subscribeTaskService.signPatientManageRouteNodeTask();
log.info("完成订阅签约患者管理任务路径节点推送定时任务......");