Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dmhub-plugin
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
qinxunjia
dmhub-plugin
Commits
bdd91a6e
Commit
bdd91a6e
authored
Jul 07, 2020
by
fuwanli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
"11"
parent
9a996165
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
13 deletions
+48
-13
DmHubApi.java
src/main/java/com/bgy/sms/channel/api/DmHubApi.java
+1
-1
BgySmsServiceImpl.java
...m/bgy/sms/channel/bgy/service/impl/BgySmsServiceImpl.java
+28
-0
MessageServiceImpl.java
...ain/java/com/bgy/sms/service/impl/MessageServiceImpl.java
+19
-12
No files found.
src/main/java/com/bgy/sms/channel/api/DmHubApi.java
View file @
bdd91a6e
src/main/java/com/bgy/sms/channel/bgy/service/impl/BgySmsServiceImpl.java
View file @
bdd91a6e
...
...
@@ -103,4 +103,32 @@ public class BgySmsServiceImpl implements BgySmsService {
smsTemplateInfo
.
setUpRejectMsg
(
auditReason
);
smsTemplateService
.
updateById
(
smsTemplateInfo
);
}
public
static
void
main
(
String
[]
args
)
{
String
appId
=
BgySMSConfig
.
appId
;
String
a
=
Md5Util
.
encrypt
(
2021
+
"930844c7-7985-435b-af47-142b59b299c3"
.
toUpperCase
());
System
.
out
.
println
(
a
);
System
.
out
.
println
(
appId
);
if
(
1
==
1
)
{
return
;
}
// String areaId = BgySMSConfig.areaId;
String
securityCode
=
BgySMSConfig
.
securityCode
;
String
url
=
BgySMSConfig
.
url
;
String
api
=
BgySMSConfig
.
api
;
Map
<
String
,
String
>
requestParams
=
new
HashMap
<>();
requestParams
.
put
(
"api"
,
"SendYXSMS"
);
requestParams
.
put
(
"appId"
,
""
);
requestParams
.
put
(
"security"
,
""
);
requestParams
.
put
(
"areaId"
,
"XXJSB"
);
requestParams
.
put
(
"content"
,
"测试模板内容,占位符测试:11,再来一个:22!退订回复TD【碧桂园】"
);
requestParams
.
put
(
"mobile"
,
"18088834894"
);
log
.
info
(
"碧桂园短信接口参数:{}"
,
requestParams
);
String
retStr
=
SendSmsUtil
.
sendSmsByPost
(
"https://xstest.bgy.com.cn/ApiBgyTest/Open/Sms.ashx"
,
JSONObject
.
toJSONString
(
requestParams
));
log
.
info
(
"碧桂园短信接口返回信息:{}"
,
retStr
);
}
}
src/main/java/com/bgy/sms/service/impl/MessageServiceImpl.java
View file @
bdd91a6e
...
...
@@ -18,6 +18,7 @@ import com.bgy.sms.service.MessageService;
import
com.bgy.sms.service.SmsTemplateService
;
import
com.bgy.sms.service.bean.TemplateChangeBean
;
import
com.bgy.util.HttpUtil
;
import
com.bgy.util.Md5Util
;
import
com.bgy.util.id.IdHandler
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
...
...
@@ -96,32 +97,38 @@ public class MessageServiceImpl implements MessageService {
log
.
error
(
"模板插入DB异常:【{}】"
,
JSONObject
.
toJSONString
(
info
));
return
new
DmHubResponse
(
ResponseCode
.
SYSTEM_ERROR
);
}
else
{
String
appId
=
BgySMSConfig
.
appId
;
String
securityCode
=
BgySMSConfig
.
securityCode
;
String
pkID
=
info
.
getId
()+
""
;
String
content
=
info
.
getContent
();
JSONObject
param
=
new
JSONObject
();
param
.
put
(
"api"
,
"AddTemplate"
);
param
.
put
(
"appid"
,
""
);
param
.
put
(
"security"
,
""
);
param
.
put
(
"appid"
,
appId
);
param
.
put
(
"security"
,
Md5Util
.
encrypt
(
appId
+
securityCode
.
toUpperCase
())
);
param
.
put
(
"content"
,
content
);
param
.
put
(
"areaid"
,
"FHY"
);
param
.
put
(
"pkID"
,
pkID
);
param
.
put
(
"account"
,
""
);
param
.
put
(
"account"
,
"
liyuecheng
"
);
param
.
put
(
"templateType"
,
""
);
String
retStr
=
HttpUtil
.
sendPost
(
BgySMSConfig
.
url
,
JSONObject
.
toJSONString
(
param
));
JSONObject
retJson
=
JSONObject
.
parseObject
(
retStr
);
String
ret
=
retJson
.
getString
(
"ret"
);
String
reePackage
=
retJson
.
getString
(
"package"
);
String
err
=
retJson
.
getString
(
"err"
);
String
retCode
=
retJson
.
getString
(
"ret"
);
if
(
ret
.
equals
(
0
))
{
if
(
"0"
.
equals
(
retCode
))
{
if
(
err
.
contains
(
"成功"
))
{
JSONObject
Json
=
JSONObject
.
parseObject
(
reePackage
);
String
data
=
Json
.
getString
(
"data"
);
info
.
setTemplateRecordId
(
data
);
info
.
setStatus
(
"normal"
);
info
.
setId
(
Long
.
parseLong
(
pkID
));
smsTemplateService
.
updateById
(
info
);
}
}
responseDTO
.
setCode
(
ResponseCode
.
SUCCESS
.
getCode
());
responseDTO
.
setError
(
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
info
)));
return
responseDTO
;
...
...
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