Commit f2a88eeb by 邓实川 Committed by chenzg

优化

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