From 9a9a238de1706b22057a83dd0eaf76cabd33c7cb Mon Sep 17 00:00:00 2001 From: glj <13935964706@163.com> Date: Wed, 14 Aug 2024 10:29:23 +0800 Subject: [PATCH] =?UTF-8?q?glj-=E4=BB=A3=E7=A0=81=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/DisasterInfoController.java | 29 +++++++++---------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/kn-service/biz-vordm/src/main/java/com/kening/vordm/controller/DisasterInfoController.java b/kn-service/biz-vordm/src/main/java/com/kening/vordm/controller/DisasterInfoController.java index b472a9f..8ad140c 100644 --- a/kn-service/biz-vordm/src/main/java/com/kening/vordm/controller/DisasterInfoController.java +++ b/kn-service/biz-vordm/src/main/java/com/kening/vordm/controller/DisasterInfoController.java @@ -394,17 +394,16 @@ public class DisasterInfoController { LambdaQueryWrapper guestInfoQw = new LambdaQueryWrapper<>(); guestInfoQw.eq(GuestInfo::getId, one.getSponsorId()); GuestInfo guestInfoNew = guestInfoService.getOne(guestInfoQw); + if (guestInfoNew == null) { LambdaQueryWrapper administratorQw = new LambdaQueryWrapper<>(); administratorQw.eq(Administrator::getId, one.getSponsorId()); Administrator administrator = administratorService.getOne(administratorQw); - guestInfo.setId(administrator.getId()); guestInfo.setEmail(administrator.getEmail()); Integer fractionUser = administrator.getFraction(); administrator.setFraction(fractionUser + 1); administratorService.updateById(administrator); }else { - guestInfo.setId(guestInfoNew.getId()); guestInfo.setEmail(guestInfoNew.getEmail()); } @@ -428,28 +427,28 @@ public class DisasterInfoController { //获取所有管理员信息 List allUserEmail = disasterInfoService.getAllUserEmail(); List userEmails = new ArrayList<>(); - allUserEmail.stream().forEach(userVo -> { - //发送信息 +// allUserEmail.stream().forEach(userVo -> { +// //发送信息 // if (userVo.getEmail() != null) { // userEmails.add(userVo.getEmail()); // } -// 获取灾害详情 - - email.setTos(new String[]{userVo.getEmail()}); - - try { - emailService.sendMimeMessage(email); - } catch (Exception e) { - userEmails.add(userVo.getEmail()); - } - }); +//// 获取灾害详情 +// +// email.setTos(new String[]{userVo.getEmail()}); +// +// try { +// emailService.sendMimeMessage(email); +// } catch (Exception e) { +// userEmails.add(userVo.getEmail()); +// } +// }); Email emailNewUser = new Email(); emailNewUser.setTos(new String[]{guestInfo.getEmail()}); emailNewUser.setSubject("Your disaster response application has been approved!"); emailNewUser.setText("Your disaster response application has been approved!"); try { - emailService.sendMimeMessage(email); + emailService.sendMimeMessage(emailNewUser); } catch (Exception e) { return R.fail("Sending failed, please check if the email is correct!"); }