|
@@ -12,6 +12,7 @@ import cn.tr.module.smart.common.dto.BizReasearchQueueAddClinicDTO;
|
|
|
import cn.tr.module.smart.common.dto.BizReasearchQueueClinicQuestionAnswerRecordQueryDTO;
|
|
import cn.tr.module.smart.common.dto.BizReasearchQueueClinicQuestionAnswerRecordQueryDTO;
|
|
|
import cn.tr.module.smart.common.enums.MpPublishTaskTypeEnums;
|
|
import cn.tr.module.smart.common.enums.MpPublishTaskTypeEnums;
|
|
|
import cn.tr.module.smart.common.enums.RabbitMQConstant;
|
|
import cn.tr.module.smart.common.enums.RabbitMQConstant;
|
|
|
|
|
+import cn.tr.module.smart.common.enums.ReasearchQueueStatusEnums;
|
|
|
import cn.tr.module.smart.common.mapper.BizQuestionAnswerMapper;
|
|
import cn.tr.module.smart.common.mapper.BizQuestionAnswerMapper;
|
|
|
import cn.tr.module.smart.common.po.*;
|
|
import cn.tr.module.smart.common.po.*;
|
|
|
import cn.tr.module.smart.common.repository.*;
|
|
import cn.tr.module.smart.common.repository.*;
|
|
@@ -100,7 +101,17 @@ public class BizReasearchQueueClinicServiceImpl extends ServiceImpl<BizReasearch
|
|
|
.setSql("queue_count = queue_count + 1")
|
|
.setSql("queue_count = queue_count + 1")
|
|
|
.in(BizClinicRoomPO::getId,clinicIds));
|
|
.in(BizClinicRoomPO::getId,clinicIds));
|
|
|
this.saveBatch(insertBatch);
|
|
this.saveBatch(insertBatch);
|
|
|
- //todo 运行任务
|
|
|
|
|
|
|
+ insertBatch.parallelStream().forEach(queueClinicPO -> {
|
|
|
|
|
+ rabbitTemplate.convertAndSend(
|
|
|
|
|
+ RabbitMQConstant.TOPIC_EXCHANGE_MP_NAME,
|
|
|
|
|
+ RabbitMQConstant.ROUTING_KEY_MP_PUSH,
|
|
|
|
|
+ queueClinicPO.getId(),
|
|
|
|
|
+ message -> {
|
|
|
|
|
+ message.getMessageProperties().getHeaders().put("x-delay", 3);
|
|
|
|
|
+ return message;
|
|
|
|
|
+ }
|
|
|
|
|
+ );
|
|
|
|
|
+ });
|
|
|
return Boolean.TRUE;
|
|
return Boolean.TRUE;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
@@ -146,6 +157,10 @@ public class BizReasearchQueueClinicServiceImpl extends ServiceImpl<BizReasearch
|
|
|
log.warn("未找到对应的研究队列信息,ID: {}", id);
|
|
log.warn("未找到对应的研究队列信息,ID: {}", id);
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
+ if (StrUtil.equals(ReasearchQueueStatusEnums.QUEUE_PAUSE, reasearchQueuePushVO.getStatus())) {
|
|
|
|
|
+ log.debug("研究队列已暂停,reasearchQueueId: {}", id);
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
// 获取当前时间和手术结束时间
|
|
// 获取当前时间和手术结束时间
|
|
|
Date now = new Date();
|
|
Date now = new Date();
|
|
|
Date clinicEndTime = reasearchQueuePushVO.getClinicEndTime();
|
|
Date clinicEndTime = reasearchQueuePushVO.getClinicEndTime();
|