Commit f2a88eeb by 邓实川 Committed by chenzg

优化

parent 1fa4baa3
......@@ -119,7 +119,7 @@ public class LoginController {
@Autowired
private QyzxEmpEntAssoMapper qyzxEmpEntAssoMapper;
@Autowired
private AliyunSMS aliyunSMS;
......@@ -150,12 +150,14 @@ public class LoginController {
remainder = quantity.getRemainder();
date = quantity.getExpireDate();
}
if (quantity == null || remainder == null || remainder <= 0) { // 判断充了钱没
return ResultUtil.error("请充值后使用短信功能!");
}
if (date != null && date.getTime() <= new Date().getTime()) {
System.err.println("企业 " + orgCode + " :短信套餐已过期");
return ResultUtil.error("短信套餐已到期!");
if (entRegisterDto.getTc() != 4) { //如果不是注册,则判断套餐余额
if (quantity == null || remainder == null || remainder <= 0) { // 判断充了钱没
return ResultUtil.error("请充值后使用短信功能!");
}
if (date != null && date.getTime() <= new Date().getTime()) {
System.err.println("企业 " + orgCode + " :短信套餐已过期");
return ResultUtil.error("短信套餐已到期!");
}
}
// 6位随机数验证码
......@@ -179,9 +181,9 @@ public class LoginController {
.getJSONObject("SmsSendDetailDTOs").getJSONArray("SmsSendDetailDTO").get(0);
String phoneNum = jsonObject.getString("PhoneNum");
String content = jsonObject.getString("Content");
// String templateCode = jsonObject.getString("TemplateCode");
// String sendStatus = jsonObject.getString("SendStatus");
// String sendDate = jsonObject.getString("SendDate");
// String templateCode = jsonObject.getString("TemplateCode");
// String sendStatus = jsonObject.getString("SendStatus");
// String sendDate = jsonObject.getString("SendDate");
QyzxSms qyzxSms = new QyzxSms();
qyzxSms.setContent(content);
......
......@@ -35,7 +35,7 @@ import cn.timer.api.dto.qyzx.EntRegisterDto;
@Transactional
@Component
public class AliyunSMS {
@Value("${config-8timer.Aliyun.PROJECT_NAME}")
public String PROJECT_NAME;
......@@ -78,13 +78,15 @@ public class AliyunSMS {
Date date = quantity.getExpireDate();
String orderNo = quantity.getOrderNo();
if (quantity == null || remainder == null || remainder <= 0) {
System.err.println("企业 " + orgCode + " :套餐余额不足,请充钱");
return null;
}
if (date != null && date.getTime() <= new Date().getTime()) {
System.err.println("企业 " + orgCode + " :短信套餐已过期");
return null;
if (templateCode != 4) {
if (quantity == null || remainder == null || remainder <= 0) {
System.err.println("企业 " + orgCode + " :套餐余额不足,请充钱");
return null;
}
if (date != null && date.getTime() <= new Date().getTime()) {
System.err.println("企业 " + orgCode + " :短信套餐已过期");
return null;
}
}
QyzxUseRecord qyzxUseRecord = new QyzxUseRecord();
......
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