Commit abd720c5 by 陶光胜

通知详情修改

parent 80e81e3f
......@@ -15,6 +15,7 @@ import com.gic.enterprise.error.ErrorCode;
import com.gic.enterprise.response.EnterpriseServiceResponse;
import com.gic.enterprise.service.*;
import com.gic.redis.data.util.RedisUtil;
import org.apache.logging.log4j.core.pattern.AbstractStyleNameConverter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -25,6 +26,7 @@ import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
@Service("billingAccountApiService")
public class BillingAccountApiServiceImpl implements BillingAccountApiService {
......@@ -206,11 +208,14 @@ public class BillingAccountApiServiceImpl implements BillingAccountApiService {
if (i > 0) {
TabBillingAccount account = this.billingAccountService.getByEnterpriseId(enterpriseId);
if(account.getAccountBalance() <= 0){
String content = "您的GIC商户余额已欠费"+(-account.getAccountBalance())+"元,为了不影响业务的开展,请及时<a href='"+config.getHost()+"cost-center/billing-center/recharge'>充值</a>";
this.pushMessageApiService.pushMessage(enterpriseId, "产品通知", "商户欠费", content);
// 待办事项
sendTotoItem(enterpriseId);
Object cache = RedisUtil.getCache("message:" + enterpriseId);
if(cache == null){
String content = "您的GIC商户余额已欠费"+(-account.getAccountBalance())+"元,为了不影响业务的开展,请及时<a href='"+config.getHost()+"cost-center/billing-center/recharge'>充值</a>";
this.pushMessageApiService.pushMessage(enterpriseId, "系统消息", "商户欠费", content);
// 待办事项
sendTotoItem(enterpriseId);
RedisUtil.setCache("message:" + enterpriseId, 1, 1l, TimeUnit.DAYS);
}
}
return ServiceResponse.success(i);
} else {
......
......@@ -572,7 +572,7 @@ public class EnterpriseApiServiceImpl implements EnterpriseApiService {
Date auditTime = enterpriseDTO.getAuditTime();
long days = (sdf.parse(sdf.format(auditTime)).getTime() - sdf.parse(sdf.format(now)).getTime())/(1000 * 60 * 60 * 24);
if(days <= 7){
this.pushMessageApiService.pushMessage(enterpriseDTO.getEnterpriseId(), "产品通知",
this.pushMessageApiService.pushMessage(enterpriseDTO.getEnterpriseId(), "系统消息",
"GIC版本即将过期", "您的GIC版本即将在"+ days +"天到期,为了不影响业务的开展,请及时续费");
}
}catch (Exception e){
......
......@@ -113,7 +113,7 @@ public class WxPayStrategy implements PayStrategy {
case 1:
// 商户余额充值
billingRechargeRecordService.updateBySerialNumber(resData.getEnterpriseId(), billingPayInfo.getOrderSerialNumber(), resData.getTotalFeePaid(), resData.getTotalFeePaid(), BillingAuditStatusEnum.PASS.getCode(), resData.getTimeEnd());
this.pushMessageApiService.pushMessage(resData.getEnterpriseId(), "产品通知", "余额充值", "您的商户成功充值"+resData.getTotalFeePaid()+"元!感谢您的支持和使用!");
this.pushMessageApiService.pushMessage(resData.getEnterpriseId(), "系统通知", "余额充值", "您的商户成功充值"+resData.getTotalFeePaid()+"元!感谢您的支持和使用!");
break;
case 2:
// 短信套餐包购买
......
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