Commit d10bc7de by guojuxing

Merge remote-tracking branch 'origin/developer' into developer

parents 8dcadd9c f373f8dd
......@@ -59,14 +59,9 @@ public interface Constants {
*/
String TODO_ITEM_AUDIT = "audit";
/**
* 账户余额不足
* 产品通知
*/
String TODO_ITEM_ACCOUNT_BALANCE = "account_balance";
/**
* 门店分组
*/
String TODO_ITEM_STORE_GROUP = "store_group";
String PRODUCT = "product";
// -----------------------待办事项跳转url-------------------------------
/**
......
......@@ -106,7 +106,7 @@ public class SmsRecordDTO implements Serializable {
/**
* 会员ecuId
*/
@NotNull(message = "会员ecuId不能为空", groups = SmsRecordValid.class)
// @NotNull(message = "会员ecuId不能为空", groups = SmsRecordValid.class)
private Long ecuId;
/**
......
......@@ -51,7 +51,7 @@ public class BillingAccountServiceImpl implements BillingAccountService{
double newTotal = new BigDecimal(tabBillingAccount.getAccountBalance().toString()).add(new BigDecimal(totalFee + "")).doubleValue();
logger.info("商户:{}, 充值/退款前余额:{}, 充值/退款金额:{}, 充值/退款后余额:{}", enterpriseId, tabBillingAccount.getAccountBalance(), totalFee, newTotal);
UserDTO user = userApiService.getUserByEnterpriseId(enterpriseId).getResult();
todoItemService.finishTodoItem(enterpriseId, user.getUserId(), Constants.TODO_ITEM_ACCOUNT_BALANCE, Constants.TODO_ITEM_ACCOUNT_BALANCE_URL);
todoItemService.finishTodoItem(enterpriseId, user.getUserId(), Constants.PRODUCT, Constants.TODO_ITEM_ACCOUNT_BALANCE_URL);
return tabBillingAccountMapper.updateAccountAfterRechargeOrRefund(totalFee, enterpriseId);
}
......
......@@ -77,7 +77,11 @@ public class BillingEnterpriseSmsPackageServiceImpl implements BillingEnterprise
RedisUtil.lock(Constants.ENTERPRISE_BILLING_SMS_PACKAGE_COUNT_LOCK + enterpriseId, 30L);
logger.info("redis中没有套餐包 查询数据库:{}", enterpriseId);
Integer totalSms = tabBillingEnterpriseSmsPackageMapper.getTotalSmsInPackageByEnterpriseId(enterpriseId);
smsCountR.set(totalSms);
if (totalSms != null) {
smsCountR.set(totalSms);
} else {
smsCountR.set(0);
}
RedisUtil.unlock(Constants.ENTERPRISE_BILLING_SMS_PACKAGE_COUNT_LOCK + enterpriseId);
}
return smsCountR;
......
......@@ -15,7 +15,6 @@ 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;
......@@ -233,7 +232,7 @@ public class BillingAccountApiServiceImpl implements BillingAccountApiService {
// 事项详情
todoItemDTO.setItemContent("您的GIC商户余额已欠费");
// 事项code 在运维后台字典配置 类目:待办事项类型
todoItemDTO.setItemType(Constants.TODO_ITEM_ACCOUNT_BALANCE);
todoItemDTO.setItemType(Constants.PRODUCT);
// 跳转地址 待办事项点击后要跳转的地址
todoItemDTO.setItemInfoUrl(Constants.TODO_ITEM_ACCOUNT_BALANCE_URL);
todoItemApiService.saveTodoItem(todoItemDTO);
......
......@@ -90,7 +90,7 @@ public class SmsRecordApiServiceImpl implements SmsRecordApiService {
Integer unitFee = accountStandardService.queryUnitFee(enterpriseId, AccountStandardEnum.SMS.getCode());
double needFee = (double) (missCount * unitFee) / 1000;
if (needFee - accountBalance > 5000d) {
if (needFee - accountBalance > billingAccount.getCreditLine()) {
logger.info("enterpriseId:{}, 余额:{}, 发送条数:{}, 不能发送", enterpriseId, accountBalance, sendCount);
return EnterpriseServiceResponse.failure(ErrorCode.OPERATION_FAILED.getCode(), "余额不足, 不能发送");
} else {
......@@ -101,6 +101,7 @@ public class SmsRecordApiServiceImpl implements SmsRecordApiService {
@Override
public ServiceResponse<Void> saveSmsRecord(SmsRecordDTO smsRecordDTO) {
logger.info("收到国内短信计费信息:{}", JSON.toJSONString(smsRecordDTO));
if (StringUtils.isBlank(smsRecordDTO.getNationCode())) {
smsRecordDTO.setNationCode("+86");
}
......@@ -115,12 +116,13 @@ public class SmsRecordApiServiceImpl implements SmsRecordApiService {
if (StringUtils.equals("86", smsRecordDTO.getNationCode()) || StringUtils.equals("+86", smsRecordDTO.getNationCode())) {
ServiceResponse paramResult = ValidUtil.allCheckValidate(smsRecordDTO, SmsRecordDTO.SmsRecordValid.class);
if (!paramResult.isSuccess()) {
logger.info("短信验证不通过:{}", paramResult.getMessage());
return paramResult;
}
GicMQClient client = GICMQClientUtil.getClientInstance();
try {
String json = JSON.toJSONString(smsRecordDTO);
logger.info("收到国内短信计费信息:{}", json);
// logger.info("收到国内短信计费信息:{}", json);
client.sendMessage("smsMq", json);
// this.run(json);
} catch (Exception e) {
......
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