Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
8
8timerapiv200
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
8timerv2
8timerapiv200
Commits
f2a88eeb
Commit
f2a88eeb
authored
Apr 28, 2020
by
邓实川
Committed by
chenzg
Jul 05, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化
parent
1fa4baa3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
18 deletions
+22
-18
src/main/java/cn/timer/api/controller/LoginController.java
+12
-10
src/main/java/cn/timer/api/utils/aliyun/AliyunSMS.java
+10
-8
No files found.
src/main/java/cn/timer/api/controller/LoginController.java
View file @
f2a88eeb
...
@@ -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
);
...
...
src/main/java/cn/timer/api/utils/aliyun/AliyunSMS.java
View file @
f2a88eeb
...
@@ -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
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment