TASK:十月优惠邮件发送接口;

This commit is contained in:
shahaibo
2024-10-03 12:15:55 +08:00
parent 51a1c1d8e1
commit 6f98f111dd

View File

@@ -1039,6 +1039,40 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
} }
} }
@Override
public void halfPricePromotion() {
// 所有试用用户 不管过没过期 所有转为游客的正式用户以及试用用户
QueryWrapper<Account> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(Account::getSystemUser, 3);
List<Account> accountList = accountMapper.selectList(queryWrapper);
List<Account> halfPricePromotionList = new ArrayList<>(accountList);
QueryWrapper<Account> queryWrapper1 = new QueryWrapper<>();
queryWrapper1.lambda().eq(Account::getSystemUser, 0);
queryWrapper1.lambda().isNotNull(Account::getValidStartTime);
List<Account> accountList1 = accountMapper.selectList(queryWrapper1);
halfPricePromotionList.addAll(accountList1);
log.info("十月优惠邮件名单:" + JSON.toJSONString(halfPricePromotionList));
int i = 0;
for (Account account : halfPricePromotionList) {
if (i > 53) {
try {
if (account.getLanguage().equals(Language.CHINESE_SIMPLIFIED.name())) {
SendEmailUtil.halfPricePromotion(account, null, 0);
}else {
SendEmailUtil.halfPricePromotion(account, null, 1);
}
}catch (Exception e) {
log.info(e.getMessage());
}
}
i ++;
log.info("十月优惠邮件成功发送第" + i + "");
}
}
@Override @Override
public void moveLibraryDate() { public void moveLibraryDate() {
// 查询生产全部library数据遍历数据根据用户id和md5查询是否已经迁移过 // 查询生产全部library数据遍历数据根据用户id和md5查询是否已经迁移过