Commit e2a615d4 by zhiwj

欠费提醒优化

parent 79a0c623
...@@ -64,6 +64,8 @@ public class BillingAccountApiServiceImpl implements BillingAccountApiService { ...@@ -64,6 +64,8 @@ public class BillingAccountApiServiceImpl implements BillingAccountApiService {
@Autowired @Autowired
private EnterpriseWhiteListService enterpriseWhiteListService; private EnterpriseWhiteListService enterpriseWhiteListService;
private final int ACCOUNT_NOTICE_LINE = 1000;
@Override @Override
public ServiceResponse<BillingAccountDTO> getByEnterpriseId(Integer enterpriseId) { public ServiceResponse<BillingAccountDTO> getByEnterpriseId(Integer enterpriseId) {
TabEnterprise tabEnterprise = enterpriseService.getEnterpriseById(enterpriseId); TabEnterprise tabEnterprise = enterpriseService.getEnterpriseById(enterpriseId);
...@@ -250,12 +252,11 @@ public class BillingAccountApiServiceImpl implements BillingAccountApiService { ...@@ -250,12 +252,11 @@ public class BillingAccountApiServiceImpl implements BillingAccountApiService {
String content = "您的达摩账户已欠费, 为避免您的业务受到影响,请及时<a href='" + config.getHost() + "cost-center/billing-center/recharge'>充值</a>"; String content = "您的达摩账户已欠费, 为避免您的业务受到影响,请及时<a href='" + config.getHost() + "cost-center/billing-center/recharge'>充值</a>";
this.pushMessageApiService.pushMessage(enterpriseId, "系统消息", "商户欠费", content); this.pushMessageApiService.pushMessage(enterpriseId, "系统消息", "商户欠费", content);
sendArrearsSms(enterpriseId); sendArrearsSms(enterpriseId);
// ServiceResponse<Void> smsSendResult = smsSendApiService.sendPlatformSms("GICJFZX001", enterpriseId, userDTO.getPhoneAreaCode(), userDTO.getPhoneNumber(), smsArr);
// 待办事项 // 待办事项
sendTotoItem(enterpriseId, "您的达摩账户已欠费"); sendTotoItem(enterpriseId, "您的达摩账户已欠费");
RedisUtil.setCache("message:" + enterpriseId, 1, 1L, TimeUnit.DAYS); RedisUtil.setCache("message:" + enterpriseId, 1, 1L, TimeUnit.DAYS);
} }
} else if (account.getAccountBalance() < 1000) { } else if (account.getAccountBalance() < ACCOUNT_NOTICE_LINE) {
Object cache = RedisUtil.getCache("message:" + enterpriseId); Object cache = RedisUtil.getCache("message:" + enterpriseId);
if (cache == null) { if (cache == null) {
String content = "您的达摩账户余额已不足1000元,若账户欠费将中断部分正常业务,请及时<a href='" + config.getHost() + "cost-center/billing-center/recharge'>充值</a>"; String content = "您的达摩账户余额已不足1000元,若账户欠费将中断部分正常业务,请及时<a href='" + config.getHost() + "cost-center/billing-center/recharge'>充值</a>";
...@@ -314,7 +315,7 @@ public class BillingAccountApiServiceImpl implements BillingAccountApiService { ...@@ -314,7 +315,7 @@ public class BillingAccountApiServiceImpl implements BillingAccountApiService {
Integer enterpriseId = enterpriseDTO.getEnterpriseId(); Integer enterpriseId = enterpriseDTO.getEnterpriseId();
if (isNotInWhiteList(enterpriseId)) { if (isNotInWhiteList(enterpriseId)) {
TabBillingAccount account = this.billingAccountService.getByEnterpriseId(enterpriseId); TabBillingAccount account = this.billingAccountService.getByEnterpriseId(enterpriseId);
if (account.getAccountBalance() < 1000) { if (account.getAccountBalance() < ACCOUNT_NOTICE_LINE) {
String[] smsArr = new String[]{enterpriseDTO.getEnterpriseName(), String.valueOf(-account.getAccountBalance())}; String[] smsArr = new String[]{enterpriseDTO.getEnterpriseName(), String.valueOf(-account.getAccountBalance())};
ServiceResponse<UserDTO> userResult = userApiService.getUserByEnterpriseId(enterpriseId); ServiceResponse<UserDTO> userResult = userApiService.getUserByEnterpriseId(enterpriseId);
UserDTO userDTO = userResult.getResult(); UserDTO userDTO = userResult.getResult();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment