glj-代码提交
This commit is contained in:
parent
1d4b8c1e9f
commit
9a9a238de1
|
@ -394,17 +394,16 @@ public class DisasterInfoController {
|
||||||
LambdaQueryWrapper<GuestInfo> guestInfoQw = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<GuestInfo> guestInfoQw = new LambdaQueryWrapper<>();
|
||||||
guestInfoQw.eq(GuestInfo::getId, one.getSponsorId());
|
guestInfoQw.eq(GuestInfo::getId, one.getSponsorId());
|
||||||
GuestInfo guestInfoNew = guestInfoService.getOne(guestInfoQw);
|
GuestInfo guestInfoNew = guestInfoService.getOne(guestInfoQw);
|
||||||
|
|
||||||
if (guestInfoNew == null) {
|
if (guestInfoNew == null) {
|
||||||
LambdaQueryWrapper<Administrator> administratorQw = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<Administrator> administratorQw = new LambdaQueryWrapper<>();
|
||||||
administratorQw.eq(Administrator::getId, one.getSponsorId());
|
administratorQw.eq(Administrator::getId, one.getSponsorId());
|
||||||
Administrator administrator = administratorService.getOne(administratorQw);
|
Administrator administrator = administratorService.getOne(administratorQw);
|
||||||
guestInfo.setId(administrator.getId());
|
|
||||||
guestInfo.setEmail(administrator.getEmail());
|
guestInfo.setEmail(administrator.getEmail());
|
||||||
Integer fractionUser = administrator.getFraction();
|
Integer fractionUser = administrator.getFraction();
|
||||||
administrator.setFraction(fractionUser + 1);
|
administrator.setFraction(fractionUser + 1);
|
||||||
administratorService.updateById(administrator);
|
administratorService.updateById(administrator);
|
||||||
}else {
|
}else {
|
||||||
guestInfo.setId(guestInfoNew.getId());
|
|
||||||
guestInfo.setEmail(guestInfoNew.getEmail());
|
guestInfo.setEmail(guestInfoNew.getEmail());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -428,28 +427,28 @@ public class DisasterInfoController {
|
||||||
//获取所有管理员信息
|
//获取所有管理员信息
|
||||||
List<UserVo> allUserEmail = disasterInfoService.getAllUserEmail();
|
List<UserVo> allUserEmail = disasterInfoService.getAllUserEmail();
|
||||||
List<String> userEmails = new ArrayList<>();
|
List<String> userEmails = new ArrayList<>();
|
||||||
allUserEmail.stream().forEach(userVo -> {
|
// allUserEmail.stream().forEach(userVo -> {
|
||||||
//发送信息
|
// //发送信息
|
||||||
// if (userVo.getEmail() != null) {
|
// if (userVo.getEmail() != null) {
|
||||||
// userEmails.add(userVo.getEmail());
|
// userEmails.add(userVo.getEmail());
|
||||||
// }
|
// }
|
||||||
// 获取灾害详情
|
//// 获取灾害详情
|
||||||
|
//
|
||||||
email.setTos(new String[]{userVo.getEmail()});
|
// email.setTos(new String[]{userVo.getEmail()});
|
||||||
|
//
|
||||||
try {
|
// try {
|
||||||
emailService.sendMimeMessage(email);
|
// emailService.sendMimeMessage(email);
|
||||||
} catch (Exception e) {
|
// } catch (Exception e) {
|
||||||
userEmails.add(userVo.getEmail());
|
// userEmails.add(userVo.getEmail());
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
|
|
||||||
Email emailNewUser = new Email();
|
Email emailNewUser = new Email();
|
||||||
emailNewUser.setTos(new String[]{guestInfo.getEmail()});
|
emailNewUser.setTos(new String[]{guestInfo.getEmail()});
|
||||||
emailNewUser.setSubject("Your disaster response application has been approved!");
|
emailNewUser.setSubject("Your disaster response application has been approved!");
|
||||||
emailNewUser.setText("Your disaster response application has been approved!");
|
emailNewUser.setText("Your disaster response application has been approved!");
|
||||||
try {
|
try {
|
||||||
emailService.sendMimeMessage(email);
|
emailService.sendMimeMessage(emailNewUser);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
return R.fail("Sending failed, please check if the email is correct!");
|
return R.fail("Sending failed, please check if the email is correct!");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue