Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gxpt_ht
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
pseer
gxpt_ht
Commits
d25900a4
Commit
d25900a4
authored
Jul 03, 2024
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加自动提示权益会员失效
parent
7669fce1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
5 deletions
+33
-5
RedisTask.java
share-quartz/src/main/java/share/quartz/task/RedisTask.java
+8
-0
SmsService.java
...system/src/main/java/share/system/service/SmsService.java
+3
-1
RechargeServiceImpl.java
...n/java/share/system/service/impl/RechargeServiceImpl.java
+2
-0
SmsServiceImpl.java
...c/main/java/share/system/service/impl/SmsServiceImpl.java
+20
-4
No files found.
share-quartz/src/main/java/share/quartz/task/RedisTask.java
View file @
d25900a4
...
...
@@ -101,6 +101,8 @@ public class RedisTask {
final
long
FOUR_MINUTES
=
60
*
4
;
//1分钟的常量
final
long
ONE_MINUTES
=
60
;
final
long
THREE_DAY
=
60
*
24
*
3
;
final
long
TWO_DAY
=
60
*
24
*
2
;
/**
...
...
@@ -465,6 +467,12 @@ public class RedisTask {
JSONObject
jsonObject
=
new
JSONObject
(
value
);
Date
expirationTime
=
jsonObject
.
getDate
(
"expirationTime"
);
Long
consumerId
=
jsonObject
.
getLong
(
"consumerId"
);
//判断当前的日期是否在第3天和第2天中
long
expire
=
(
expirationTime
.
getTime
()
-
new
Date
().
getTime
())
/
1000
/
60
/
60
;
if
(
TWO_DAY
<
expire
&&
expire
<
THREE_DAY
)
{
SConsumer
sConsumer
=
sConsumerService
.
getById
(
consumerId
);
smsService
.
sendOneSms
(
sConsumer
.
getPhone
(),
"年度权益会员将在3天后失效,请及时续约保障权益会员的权益"
);
}
});
}
...
...
share-system/src/main/java/share/system/service/SmsService.java
View file @
d25900a4
package
share
.
system
.
service
;
import
cn.hutool.json.JSON
Array
;
import
cn.hutool.json.JSON
Object
;
import
share.system.domain.*
;
import
share.system.domain.vo.SmsDownResultVo
;
...
...
@@ -85,5 +85,7 @@ public interface SmsService {
* @return SUCCESS
*/
String
updateDownResult
(
String
tKey
,
String
password
,
List
<
SmsDownResultVo
>
data
);
JSONObject
sendOneSms
(
String
phone
,
String
content
);
}
share-system/src/main/java/share/system/service/impl/RechargeServiceImpl.java
View file @
d25900a4
...
...
@@ -46,6 +46,8 @@ public class RechargeServiceImpl extends ServiceImpl<RechargeMapper, Recharge> i
private
ConsumerWalletService
consumerWalletService
;
@Autowired
private
MemberConfigService
memberConfigService
;
@Autowired
private
ISConsumptionRecordsService
sConsumptionRecordsService
;
/**
* 查询充值记录
...
...
share-system/src/main/java/share/system/service/impl/SmsServiceImpl.java
View file @
d25900a4
...
...
@@ -3,7 +3,6 @@ package share.system.service.impl;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.crypto.SecureUtil
;
import
cn.hutool.json.JSONArray
;
import
cn.hutool.json.JSONObject
;
import
cn.hutool.json.JSONUtil
;
import
org.slf4j.Logger
;
...
...
@@ -20,16 +19,13 @@ import share.common.utils.BaseUtil;
import
share.common.utils.SmsUtil
;
import
share.system.domain.*
;
import
share.system.domain.vo.SmsDownResultVo
;
import
share.system.mapper.SysConfigMapper
;
import
share.system.service.ISysConfigService
;
import
share.system.service.SConsumerService
;
import
share.system.service.SmsLogService
;
import
share.system.service.SmsService
;
import
java.text.MessageFormat
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Objects
;
import
java.util.concurrent.TimeUnit
;
...
...
@@ -368,6 +364,26 @@ public class SmsServiceImpl implements SmsService {
return
null
;
}
@Override
public
JSONObject
sendOneSms
(
String
phone
,
String
content
)
{
// 发送内容添加短信签名
String
smsContent
=
StrUtil
.
concat
(
true
,
signature
,
content
);
Long
timestamp
=
DateUtil
.
date
().
getTime
()
/
1000
;
JSONObject
param
=
JSONUtil
.
createObj
();
param
.
set
(
"username"
,
userName
);
param
.
set
(
"password"
,
SecureUtil
.
md5
(
SecureUtil
.
md5
(
passWord
)
+
timestamp
));
param
.
set
(
"tKey"
,
timestamp
);
param
.
set
(
"mobile"
,
phone
);
param
.
set
(
"content"
,
smsContent
);
param
.
set
(
"time"
,
DateUtil
.
now
());
param
.
set
(
"ext"
,
extno
);
try
{
return
smsUtil
.
postFrom
(
url
+
"/v2/sendSms"
,
param
);
}
catch
(
BaseException
exception
)
{
throw
new
BaseException
(
exception
.
getDefaultMessage
());
}
}
private
void
checkResult
(
JSONObject
result
,
SmsLog
smsLog
)
{
smsLog
.
setRemark
(
SmsStatusEnum
.
getNameStr
(
result
.
getInt
(
"code"
)));
...
...
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