BUGFIX:试用用户

This commit is contained in:
shahaibo
2024-07-11 10:50:24 +08:00
parent 6cbc4882fa
commit 6fa6c38398

View File

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