Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform
Project
Project
Details
Activity
Releases
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
youjj
cloud-platform
Commits
e48ad8be
Commit
e48ad8be
authored
Jul 20, 2019
by
周健威
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/base-modify' into base-modify
parents
f9c80bb1
e88782e6
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
78 additions
and
8 deletions
+78
-8
MyWalletDetail.java
.../github/wxiaoqi/security/admin/entity/MyWalletDetail.java
+0
-1
AppletWalletVo.java
.../com/github/wxiaoqi/security/admin/vo/AppletWalletVo.java
+4
-0
MyWalletBiz.java
...va/com/github/wxiaoqi/security/admin/biz/MyWalletBiz.java
+5
-1
UserCouponBiz.java
...in/java/com/xxfc/platform/activity/biz/UserCouponBiz.java
+3
-3
SmsService.java
.../java/com/xxfc/platform/universal/service/SmsService.java
+66
-3
No files found.
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/entity/MyWalletDetail.java
View file @
e48ad8be
...
...
@@ -104,5 +104,4 @@ public class MyWalletDetail implements Serializable {
@ApiModelProperty
(
value
=
"操作时间"
,
hidden
=
true
)
private
Long
crtTime
;
}
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/vo/AppletWalletVo.java
View file @
e48ad8be
...
...
@@ -36,4 +36,8 @@ public class AppletWalletVo {
*/
@ApiModelProperty
(
value
=
"今日收益(元)"
)
private
BigDecimal
todayAmount
;
@ApiModelProperty
(
value
=
"未入账金额"
)
private
BigDecimal
unbooked
;
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/MyWalletBiz.java
View file @
e48ad8be
...
...
@@ -46,7 +46,11 @@ public class MyWalletBiz extends BaseBiz<MyWalletMapper, MyWallet> {
List
<
MyWallet
>
wallets
=
mapper
.
selectByExample
(
example
);
MyWallet
myWallet
=
wallets
.
get
(
0
);
BeanUtils
.
copyProperties
(
myWallet
,
appletWalletVo
);
appletWalletVo
.
setBalance
(
myWallet
.
getBalance
()==
null
?
new
BigDecimal
(
0
):
myWallet
.
getBalance
());
appletWalletVo
.
setTodayAmount
(
myWallet
.
getTodayAmount
()==
null
?
new
BigDecimal
(
0
):
myWallet
.
getTodayAmount
());
appletWalletVo
.
setTotalAmount
(
myWallet
.
getTotalAmount
()==
null
?
new
BigDecimal
(
0
):
myWallet
.
getTotalAmount
());
appletWalletVo
.
setUnbooked
(
myWallet
.
getUnbooked
()==
null
?
new
BigDecimal
(
0
):
myWallet
.
getUnbooked
());
appletWalletVo
.
setUserId
(
myWallet
.
getUserId
());
return
appletWalletVo
;
}
...
...
xx-activity/xx-activity-server/src/main/java/com/xxfc/platform/activity/biz/UserCouponBiz.java
View file @
e48ad8be
...
...
@@ -161,13 +161,13 @@ public class UserCouponBiz extends BaseBiz<UserCouponMapper, UserCoupon> {
example
.
createCriteria
().
andEqualTo
(
"tickerNo"
,
TickerNo
).
andEqualTo
(
"isDel"
,
0
);
List
<
UserCoupon
>
list
=
selectByExample
(
example
);
if
(
list
.
size
()==
0
){
log
.
error
(
userId
+
"----没有可用优惠卷--
T
ickerNo==="
+
TickerNo
);
log
.
error
(
userId
+
"----没有可用优惠卷--
t
ickerNo==="
+
TickerNo
);
return
couponAmout
;
}
UserCoupon
userCoupon
=
list
.
get
(
0
);
if
(
userCoupon
!=
null
&&
userCoupon
.
getIsUse
()==
1
){
log
.
error
(
userId
+
"----该优惠卷已使用--
T
ickerNo=="
+
TickerNo
);
log
.
error
(
userId
+
"----该优惠卷已使用--
t
ickerNo=="
+
TickerNo
);
return
couponAmout
;
}
if
(
type
==
1
){
...
...
@@ -209,7 +209,7 @@ public class UserCouponBiz extends BaseBiz<UserCouponMapper, UserCoupon> {
return
;
}
Example
example
=
new
Example
(
UserCoupon
.
class
);
example
.
createCriteria
().
andEqualTo
(
"
T
ickerNo"
,
TickerNo
).
andEqualTo
(
"isDel"
,
0
);
example
.
createCriteria
().
andEqualTo
(
"
t
ickerNo"
,
TickerNo
).
andEqualTo
(
"isDel"
,
0
);
List
<
UserCoupon
>
list
=
selectByExample
(
example
);
if
(
list
.
size
()==
0
){
log
.
error
(
TickerNo
+
"----优惠卷不存在"
);
...
...
xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/service/SmsService.java
View file @
e48ad8be
...
...
@@ -15,6 +15,8 @@ import com.aliyuncs.profile.IClientProfile;
import
java.nio.charset.Charset
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.UUID
;
import
com.github.wxiaoqi.security.common.util.RandomUtil
;
...
...
@@ -155,6 +157,62 @@ public class SmsService {
return
false
;
}
public
boolean
sendTemplate
(
String
PhoneNumbers
,
String
params
,
String
templateCode
)
throws
ClientException
{
//可自助调整超时时间
System
.
setProperty
(
"sun.net.client.defaultConnectTimeout"
,
"10000"
);
System
.
setProperty
(
"sun.net.client.defaultReadTimeout"
,
"10000"
);
//初始化acsClient,暂不支持region化
IClientProfile
profile
=
DefaultProfile
.
getProfile
(
"cn-hangzhou"
,
accessKeyId
,
accessKeySecret
);
DefaultProfile
.
addEndpoint
(
"cn-hangzhou"
,
"cn-hangzhou"
,
product
,
domain
);
IAcsClient
acsClient
=
new
DefaultAcsClient
(
profile
);
//组装请求对象-具体描述见控制台-文档部分内容
SendSmsRequest
request
=
new
SendSmsRequest
();
//必填:待发送手机号
request
.
setPhoneNumbers
(
PhoneNumbers
);
//必填:短信签名-可在短信控制台中找到
request
.
setSignName
(
SignName
);
//必填:短信模板-可在短信控制台中找到
request
.
setTemplateCode
(
templateCode
);
//可选:模板中的变量替换JSON串,如模板内容为"亲爱的${name},您的验证码为${code}"时,此处的值为
request
.
setTemplateParam
(
params
);
//\"name\":\"Tom\",
//选填-上行短信扩展码(无特殊需求用户请忽略此字段)
//request.setSmsUpExtendCode("90997");
//可选:outId为提供给业务方扩展字段,最终在短信回执消息中将此值带回给调用者
//request.setOutId("yourOutId");
//hint 此处可能会抛出异常,注意catch
SendSmsResponse
sendSmsResponse
=
acsClient
.
getAcsResponse
(
request
);
log
.
info
(
"短信接口返回的数据----------------mobile======"
+
PhoneNumbers
+
"----templateParam===="
+
params
);
log
.
info
(
"Code="
+
sendSmsResponse
.
getCode
());
log
.
info
(
"Message="
+
sendSmsResponse
.
getMessage
());
log
.
info
(
"RequestId="
+
sendSmsResponse
.
getRequestId
());
log
.
info
(
"BizId="
+
sendSmsResponse
.
getBizId
());
if
(
sendSmsResponse
.
getCode
()
!=
null
&&
sendSmsResponse
.
getCode
().
equals
(
"OK"
))
{
//请求成功
return
true
;
}
return
false
;
}
public
String
getString
(
Map
<
String
,
Object
>
params
){
if
(
params
!=
null
){
StringBuilder
sb
=
new
StringBuilder
(
"{"
);
for
(
Object
o
:
params
.
keySet
())
{
sb
.
append
(
"\""
+
o
+
"\""
+
":"
+
"\""
+
params
.
get
(
o
)
+
"\""
+
","
);
}
sb
.
replace
(
sb
.
length
()
-
1
,
sb
.
length
(),
"}"
);
return
sb
.
toString
();
}
return
null
;
}
/* public static QuerySendDetailsResponse querySendDetails(String bizId) throws ClientException {
...
...
@@ -188,14 +246,19 @@ public class SmsService {
}
*/
public
static
void
main
(
String
[]
args
)
throws
ClientException
,
InterruptedException
{
SmsService
S
msService
=
new
SmsService
();
SmsService
s
msService
=
new
SmsService
();
//发短信
String
response
=
SmsService
.
sendSms
(
"15521075918"
,
"123456"
);
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"name"
,
"何振"
);
params
.
put
(
"code"
,
"123456"
);
params
.
put
(
"time"
,
5
);
params
.
put
(
"other"
,
"何振2"
);
smsService
.
sendTemplate
(
"13612688539"
,
"123"
,
"SMS_171112286"
);
/*System.out.println("短信接口返回的数据----------------");
System.out.println("Code=" + response.getCode());
System.out.println("Message=" + response.getMessage());
System.out.println("RequestId=" + response.getRequestId());
System.out.println("BizId=" + response.getBizId());*/
System.out.println("BizId=" + response.getBizId());*/
/*
Thread.sleep(3000L);
/*
...
...
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