glj-代码提交

This commit is contained in:
管李杰 2024-08-14 10:29:23 +08:00
parent 1d4b8c1e9f
commit 9a9a238de1
1 changed files with 14 additions and 15 deletions

View File

@ -394,17 +394,16 @@ public class DisasterInfoController {
LambdaQueryWrapper<GuestInfo> guestInfoQw = new LambdaQueryWrapper<>();
guestInfoQw.eq(GuestInfo::getId, one.getSponsorId());
GuestInfo guestInfoNew = guestInfoService.getOne(guestInfoQw);
if (guestInfoNew == null) {
LambdaQueryWrapper<Administrator> 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<UserVo> allUserEmail = disasterInfoService.getAllUserEmail();
List<String> 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!");
}