From c10d51e3f9c3f324676fceac7ea213f885a1b108 Mon Sep 17 00:00:00 2001 From: puhanshu <a9236326> Date: 星期四, 28 四月 2022 15:18:29 +0800 Subject: [PATCH] 推送消息 --- springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActAcidRecordServiceImpl.java | 17 +++++++++++++---- 1 files changed, 13 insertions(+), 4 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActAcidRecordServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActAcidRecordServiceImpl.java index 6f03b18..ddff8b3 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActAcidRecordServiceImpl.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActAcidRecordServiceImpl.java @@ -8,6 +8,7 @@ import com.panzhihua.common.model.vos.R; import com.panzhihua.common.model.vos.community.acid.ComAcidAreaVO; import com.panzhihua.common.model.vos.community.acid.ComAcidStaticVO; +import com.panzhihua.common.model.vos.community.acid.ComActAcidDangerMemberVO; import com.panzhihua.common.model.vos.community.acid.ComActAcidRecordVO; import com.panzhihua.common.utlis.StringUtils; import com.panzhihua.service_community.dao.ComActAcidDangerMemberDao; @@ -78,10 +79,6 @@ || dangerArea.equals("是") || outsideCity.equals("是") || acidTest.equals("阳性")) { //风险人员 saveAcidDangerMember(comActAcidRecordVO, comActAcidRecord.getId(), 1); -// rabbitTemplate.convertAndSend("huacheng.acid.danger.exchange", "huacheng.acid.danger.key", comActAcidRecordVO, message -> { -// message.getMessageProperties().setHeader("x-delay", 24*60*60*1000); -// return message; -// }); return R.ok(); } if (StringUtils.isEmpty(comActAcidRecordVO.getLocalCity())) { @@ -119,6 +116,18 @@ dangerMember.setUpdateTime(new Date()); comActAcidDangerMemberDao.updateById(dangerMember); } + ComActAcidDangerMemberVO dangerMemberVO = new ComActAcidDangerMemberVO(); + BeanUtils.copyProperties(dangerMember, dangerMemberVO); + String realAddress = comActAcidRecordVO.getRealAddress(); + if (realAddress.contains("区")) { + dangerMemberVO.setRelationName(realAddress.substring(realAddress.indexOf("市") + 1, realAddress.indexOf("区") + 1)); + } else { + dangerMemberVO.setRelationName(realAddress.substring(realAddress.indexOf("市") + 1, realAddress.indexOf("县") + 1)); + } + rabbitTemplate.convertAndSend("huacheng.acid.danger.exchange", "huacheng.acid.danger.key", dangerMemberVO, message -> { + message.getMessageProperties().setHeader("x-delay", 5*60*1000); + return message; + }); } @Override -- Gitblit v1.7.1