diff --git a/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java b/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java index 45306d4d..91198962 100644 --- a/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java @@ -1039,6 +1039,40 @@ public class AccountServiceImpl extends ServiceImpl impl } } + @Override + public void halfPricePromotion() { + + // 所有试用用户 不管过没过期 所有转为游客的正式用户以及试用用户 + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(Account::getSystemUser, 3); + List accountList = accountMapper.selectList(queryWrapper); + + List halfPricePromotionList = new ArrayList<>(accountList); + + QueryWrapper queryWrapper1 = new QueryWrapper<>(); + queryWrapper1.lambda().eq(Account::getSystemUser, 0); + queryWrapper1.lambda().isNotNull(Account::getValidStartTime); + List 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 public void moveLibraryDate() { // 查询生产全部library数据,遍历数据,根据用户id和md5查询是否已经迁移过