BUGFIX:试用订单邮件 订单更新时间判断;

This commit is contained in:
shahaibo
2025-02-10 10:34:01 +08:00
parent 8dc5dcb1bd
commit a2390a6ab2
3 changed files with 19 additions and 3 deletions

View File

@@ -91,6 +91,7 @@ public class MyTaskScheduler {
public void sendTrialOrderExcelToManagements() { public void sendTrialOrderExcelToManagements() {
// 获取前一天日期 // 获取前一天日期
LocalDate yesterday = LocalDate.now().minusDays(1); LocalDate yesterday = LocalDate.now().minusDays(1);
// LocalDate before = LocalDate.now().minusDays(4);
// 查询前一天的试用订单 // 查询前一天的试用订单
QueryWrapper<TrialOrder> qw = new QueryWrapper<>(); QueryWrapper<TrialOrder> qw = new QueryWrapper<>();
@@ -130,7 +131,7 @@ public class MyTaskScheduler {
row.createCell(6).setCellValue(trialOrder.getCountry()); row.createCell(6).setCellValue(trialOrder.getCountry());
row.createCell(7).setCellValue(trialOrder.getOccupation()); row.createCell(7).setCellValue(trialOrder.getOccupation());
row.createCell(8).setCellValue(trialOrder.getCreateTime().format(formatter)); row.createCell(8).setCellValue(trialOrder.getCreateTime().format(formatter));
if (ObjectUtils.isEmpty(trialOrder.getUpdateTime())) { if (!ObjectUtils.isEmpty(trialOrder.getUpdateTime())) {
row.createCell(9).setCellValue(trialOrder.getUpdateTime().format(formatter)); row.createCell(9).setCellValue(trialOrder.getUpdateTime().format(formatter));
} }
row.createCell(10).setCellValue(trialOrder.getStatus()); row.createCell(10).setCellValue(trialOrder.getStatus());

View File

@@ -404,10 +404,10 @@ public class SendEmailUtil {
// template.setTemplateID(UPGRADE_NOTIFICATION_ID_CHINESE); // template.setTemplateID(UPGRADE_NOTIFICATION_ID_CHINESE);
// } // }
if (type == 1) { if (type == 1) {
subject = "Successful System Upgrade and New Features in AiDA 3.1"; subject = "Successful System Upgrade and New Features in AiDA 3.0";
template.setTemplateID(UPGRADE_SUCCESS_NOTIFICATION_ID); template.setTemplateID(UPGRADE_SUCCESS_NOTIFICATION_ID);
}else { }else {
subject = "系统升级成功和AiDA 3.1新功能"; subject = "系统升级成功和AiDA 3.0新功能";
template.setTemplateID(UPGRADE_SUCCESS_NOTIFICATION_ID_CHINESE); template.setTemplateID(UPGRADE_SUCCESS_NOTIFICATION_ID_CHINESE);
} }
template.setTemplateData(buildAccountData(account)); template.setTemplateData(buildAccountData(account));
@@ -417,8 +417,10 @@ public class SendEmailUtil {
// 发送邮件 // 发送邮件
SendEmailResponse resp = client.SendEmail(req); SendEmailResponse resp = client.SendEmail(req);
log.info(senderAddress);
log.info("短信发送结果res###{}", SendEmailResponse.toJsonString(resp)); log.info("短信发送结果res###{}", SendEmailResponse.toJsonString(resp));
} catch (TencentCloudSDKException e) { } catch (TencentCloudSDKException e) {
log.info(senderAddress);
log.info("邮件发送失败###{}", e.toString()); log.info("邮件发送失败###{}", e.toString());
throw new BusinessException("failed.to.send.mail"); throw new BusinessException("failed.to.send.mail");
} }

View File

@@ -491,6 +491,19 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
account.setCountry(emailSendDTO.getCountry()); account.setCountry(emailSendDTO.getCountry());
account.setOccupation(emailSendDTO.getOccupation()); account.setOccupation(emailSendDTO.getOccupation());
baseMapper.updateById(account); baseMapper.updateById(account);
String userEmail = account.getUserEmail();
QueryWrapper<TrialOrder> trialOrderQueryWrapper = new QueryWrapper<>();
trialOrderQueryWrapper.lambda().eq(TrialOrder::getEmail, userEmail);
List<TrialOrder> trialOrders = trialOrderMapper.selectList(trialOrderQueryWrapper);
if (CollectionUtil.isNotEmpty(trialOrders)) {
for (TrialOrder trialOrder : trialOrders) {
trialOrder.setCountry(emailSendDTO.getCountry());
trialOrder.setOccupation(emailSendDTO.getOccupation());
trialOrderMapper.updateById(trialOrder);
}
}
result = true; result = true;
} }
break; break;