소스 검색

fix
研究队列推送

lifang 1 개월 전
부모
커밋
4ef9302e55

+ 0 - 1
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/config/handler/JsonbLongListTypeHandler.java

@@ -1,6 +1,5 @@
 package cn.tr.module.smart.common.config.handler;
 
-import cn.tr.module.smart.common.entity.BizReasearchPushPointEntity;
 import cn.tr.plugin.mybatis.config.handler.JsonbTypeHandler;
 import org.apache.ibatis.type.JdbcType;
 import org.apache.ibatis.type.MappedJdbcTypes;

+ 5 - 1
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/service/impl/BizReasearchQueueClinicServiceImpl.java

@@ -118,7 +118,7 @@ public class BizReasearchQueueClinicServiceImpl extends ServiceImpl<BizReasearch
         insertBatch.parallelStream().forEach(queueClinicPO -> {
             rabbitTemplate.convertAndSend(
                     RabbitMQConstant.TOPIC_EXCHANGE_MP_NAME,
-                    RabbitMQConstant.QUEUE_REASEARCH_PUSH,
+                    RabbitMQConstant.ROUTING_KEY_REASEARCH_PUSH,
                     queueClinicPO.getId(),
                     message -> {
                         message.getMessageProperties().getHeaders().put("x-delay", 3);
@@ -209,6 +209,7 @@ public class BizReasearchQueueClinicServiceImpl extends ServiceImpl<BizReasearch
 
         // 过滤出大于上次推送间隔的时间点
         timePointsFormat = timePointsFormat.stream()
+                .map(Long::valueOf)
                 .filter(timeInterval -> timeInterval > lastPushInterval)
                 .collect(Collectors.toList());
         log.debug("过滤后的推送时间点: {}", timePointsFormat);
@@ -298,6 +299,9 @@ public class BizReasearchQueueClinicServiceImpl extends ServiceImpl<BizReasearch
                 .build());
         try {
             BizMpPublishInfoDTO publishInfo = baseMapper.selectPushInfo(source.getId());
+            if(ObjectUtil.isNull(publishInfo)){
+                return;
+            }
             wxTemplateSendHelper.sendMsg(publishInfo, MpPublishTaskTypeEnums.AFTER_QUESTION.getType());
         }catch (Exception e){
 

+ 2 - 1
tr-modules/tr-module-smartFollowUp/src/main/resources/mapper/smart/BizClinicRoomMapper.xml

@@ -158,6 +158,7 @@
         GREATEST(COALESCE(igu.unread_count, 0), 0) as unread_count
         FROM biz_clinic_room bcr
         join biz_clinic_room_doctor_user bcrmu on bcr.id = bcrmu.clinic_room_id
+        join biz_clinic_room_wx_user as bcrwu on bcrwu.clinic_room_id = bcr.id
         left join biz_infusion_clinic as bic on bic.clinic_id = bcr.id
         left join biz_infusion_history as bih on bih.id=bic.infusion_id
         left join (select * from im_group_user where user_id=  #{source.currentUserId,jdbcType=VARCHAR}) as igu on igu.group_id=bcr.id
@@ -267,7 +268,7 @@
         bcr.create_time as create_time
         FROM
         biz_clinic_room bcr
-        LEFT JOIN biz_clinic_room_wx_user bcrwu ON bcr.id = bcrwu.clinic_room_id
+        JOIN biz_clinic_room_wx_user bcrwu ON bcr.id = bcrwu.clinic_room_id
         LEFT JOIN biz_clinic_room_doctor_user bcrdu on bcr.id = bcrdu.clinic_room_id
         LEFT JOIN biz_wx_user as bwu on bwu.id = bcrwu.wx_user_id
         LEFT JOIN sys_user as su ON bcrdu.user_id = su.id

+ 2 - 1
tr-modules/tr-module-smartFollowUp/src/main/resources/mapper/smart/BizReasearchQueueClinicMapper.xml

@@ -44,7 +44,8 @@
         <result property="id" column="id" />
         <result property="clinicRoomId" column="clinic_room_id" />
         <result property="status" column="status" />
-        <result property="timePointsFormat" column="time_points_format" typeHandler="cn.tr.module.smart.common.config.handler.JsonbLongListTypeHandler"/>
+<!--        <result property="timePointsFormat" column="time_points_format" typeHandler="cn.tr.module.smart.common.config.handler.JsonbLongListTypeHandler"/>-->
+        <result property="timePointsFormat" column="time_points_format" typeHandler="cn.tr.plugin.mybatis.config.handler.LongListTypeHandler"/>
         <result property="lastPushInterval" column="last_push_interval"/>
         <result property="clinicEndTime" column="clinic_end_time"/>
         <result property="queueId" column="queue_id" />