Merge branch 'release/3.0' into dev/dev_xp

This commit is contained in:
2024-07-15 13:57:20 +08:00
4 changed files with 37 additions and 13 deletions

View File

@@ -560,7 +560,8 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
account.setCreateDate(new Date());
account.setIsTrial(1);
account.setIsBeginner(1);
account.setSystemUser(1);
account.setSystemUser(3);
account.setCredits(BigDecimal.valueOf(100));
accountMapper.insert(account);
}
// 发送邮件提醒用户试用用户已创建
@@ -928,24 +929,31 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
@Override
public void upgradeNotification() {
// QueryWrapper<Account> queryWrapper = new QueryWrapper<>();
//// queryWrapper.eq("id", 88L);
// queryWrapper.and(wrapper ->
// wrapper.gt("valid_end_time", 1720540799000L)
// .or().isNull("valid_end_time"))
// .isNotNull("user_email");
QueryWrapper<Account> queryWrapper = new QueryWrapper<>();
// queryWrapper.eq("id", 88L);
queryWrapper.and(wrapper ->
wrapper.gt("valid_end_time", 1720540799000L)
.or().isNull("valid_end_time"))
.isNotNull("user_email");
queryWrapper.lt("valid_end_time", 1720540799000L);
List<Account> accountList = accountMapper.selectList(queryWrapper);
System.out.println(accountList);
int i = 0;
for (Account account : accountList) {
// SendEmailUtil.sendUpgradeNotification(account, null, 0);
// SendEmailUtil.sendUpgradeNotification(account, null, 1);
if (account.getLanguage().equals(Language.CHINESE_SIMPLIFIED.name())) {
SendEmailUtil.sendUpgradeNotification(account, null, 0);
} else {
// 英文
SendEmailUtil.sendUpgradeNotification(account, null, 1);
if (i > 6) {
if (account.getLanguage().equals(Language.CHINESE_SIMPLIFIED.name())) {
SendEmailUtil.sendUpgradeNotification(account, null, 0);
} else {
// 英文
SendEmailUtil.sendUpgradeNotification(account, null, 1);
}
}
i ++;
}
}