Commit 4758ffd8 by zhiwj

短信计费

parent f620bef5
......@@ -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;
......
......@@ -123,8 +123,8 @@ public class SmsRecordApiServiceImpl implements SmsRecordApiService {
try {
String json = JSON.toJSONString(smsRecordDTO);
// logger.info("收到国内短信计费信息:{}", json);
client.sendMessage("smsMq", json);
// this.run(json);
// client.sendMessage("smsMq", json);
this.run(json);
} catch (Exception e) {
logger.warn("调用mq失败", e);
}
......@@ -160,8 +160,8 @@ public class SmsRecordApiServiceImpl implements SmsRecordApiService {
billingSmsRecordService.updateCacheStatus(smsRecordDTO.getSmsRecordId());
smsRecordDTO.setCacheStatus(1);
// 队列
client.sendMessage("smsDbMq", JSON.toJSONString(smsRecordDTO));
// this.executeDatabase(JSON.toJSONString(smsRecordDTO));
// client.sendMessage("smsDbMq", JSON.toJSONString(smsRecordDTO));
this.executeDatabase(JSON.toJSONString(smsRecordDTO));
} catch (Exception e) {
logger.warn("调用mq失败", 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