From 2a2328e9f301270acad705d8126082350d722761 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 30 Mar 2022 14:10:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E4=B8=8A=E9=80=9A=E7=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IcEpidemicSpecialAttentionController.java | 4 +- .../IcEpidemicSpecialAttentionService.java | 2 +- ...IcEpidemicSpecialAttentionServiceImpl.java | 49 ++++++++++++++++--- 3 files changed, 45 insertions(+), 10 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicSpecialAttentionController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicSpecialAttentionController.java index c642775fac..8a2cd30ea8 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicSpecialAttentionController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcEpidemicSpecialAttentionController.java @@ -83,9 +83,9 @@ public class IcEpidemicSpecialAttentionController { */ @PostMapping("vaccination-update") @NoRepeatSubmit - public Result vaccinationUpdate(@RequestBody IcEpidemicSpecialAttentionDTO formDTO){ + public Result vaccinationUpdate(@RequestBody IcEpidemicSpecialAttentionDTO formDTO,@LoginUser TokenDto tokenDto){ ValidatorUtils.validateEntity(formDTO, IcEpidemicSpecialAttentionDTO.IcEpidemicSpecialAttentionUpdate.class); - icEpidemicSpecialAttentionService.vaccinationUpdate(formDTO); + icEpidemicSpecialAttentionService.vaccinationUpdate(formDTO,tokenDto); return new Result(); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcEpidemicSpecialAttentionService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcEpidemicSpecialAttentionService.java index 75658ca720..8a6eb03f04 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcEpidemicSpecialAttentionService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcEpidemicSpecialAttentionService.java @@ -104,7 +104,7 @@ public interface IcEpidemicSpecialAttentionService extends BaseService page(Map params) { @@ -207,7 +207,19 @@ public class IcEpidemicSpecialAttentionServiceImpl extends BaseServiceImpl needSedNotice = formDTO.getList().stream().filter(l -> CollectionUtils.isNotEmpty(l.getChannel())).collect(Collectors.toList()); + if (CollectionUtils.isNotEmpty(needSedNotice)) { + SendNoticeFormDTO dto = new SendNoticeFormDTO(); + List userListBeans = ConvertUtils.sourceToTarget(needSedNotice, SendNoticeFormDTO.UserListBean.class); + dto.setCustomerId(formDTO.getCustomerId()); + dto.setUserList(userListBeans); + dto.setChannel(needSedNotice.get(NumConstant.ZERO).getChannel()); + dto.setOrigin(needSedNotice.get(NumConstant.ZERO).getAttentionType().toString()); + dto.setContent(needSedNotice.get(NumConstant.ZERO).getContent()); + dto.setStaffId(formDTO.getUserId()); + noticeService.sendNotice(dto); + } } /** @@ -220,7 +232,7 @@ public class IcEpidemicSpecialAttentionServiceImpl extends BaseServiceImpl w = new LambdaQueryWrapper<>(); IcEpidemicSpecialAttentionEntity e = new IcEpidemicSpecialAttentionEntity(); w.eq(IcEpidemicSpecialAttentionEntity::getIdCard,formDTO.getIdCard()) @@ -229,7 +241,17 @@ public class IcEpidemicSpecialAttentionServiceImpl extends BaseServiceImpl needSendList = needInsert.stream().filter(l -> CollectionUtils.isNotEmpty(l.getChannel())).collect(Collectors.toList()); + if (CollectionUtils.isNotEmpty(needSendList)) { + SendNoticeFormDTO dto = new SendNoticeFormDTO(); + List userListBeans = ConvertUtils.sourceToTarget(needSendList, SendNoticeFormDTO.UserListBean.class); + dto.setCustomerId(tokenDto.getCustomerId()); + dto.setUserList(userListBeans); + dto.setChannel(needSendList.get(NumConstant.ZERO).getChannel()); + dto.setOrigin(needSendList.get(NumConstant.ZERO).getAttentionType().toString()); + dto.setContent(needSendList.get(NumConstant.ZERO).getContent()); + dto.setStaffId(tokenDto.getUserId()); + noticeService.sendNotice(dto); + } } if (CollectionUtils.isNotEmpty(errorInfo)){ String url = importOssUpload(errorInfo, EpidemicSpecialAttentionErrorModel.class);