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
5e15acc3
Commit
5e15acc3
authored
Jul 06, 2020
by
qinxunjia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
模板审核通知接口
parent
3589f5f1
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
67 additions
and
6 deletions
+67
-6
BgyApi.java
src/main/java/com/bgy/sms/channel/api/BgyApi.java
+8
-5
TemplateNotify.java
...main/java/com/bgy/sms/channel/bgy/dto/TemplateNotify.java
+43
-0
BgySmsService.java
...n/java/com/bgy/sms/channel/bgy/service/BgySmsService.java
+2
-0
BgySmsServiceImpl.java
...m/bgy/sms/channel/bgy/service/impl/BgySmsServiceImpl.java
+11
-0
MessageServiceImpl.java
...ain/java/com/bgy/sms/service/impl/MessageServiceImpl.java
+3
-1
No files found.
src/main/java/com/bgy/sms/channel/api/BgyApi.java
View file @
5e15acc3
...
@@ -2,7 +2,7 @@ package com.bgy.sms.channel.api;
...
@@ -2,7 +2,7 @@ package com.bgy.sms.channel.api;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.bgy.sms.channel.bgy.dto.
CLNotifyRequest
;
import
com.bgy.sms.channel.bgy.dto.
TemplateNotify
;
import
com.bgy.sms.channel.bgy.dto.ReportDto
;
import
com.bgy.sms.channel.bgy.dto.ReportDto
;
import
com.bgy.sms.channel.bgy.service.BgySmsService
;
import
com.bgy.sms.channel.bgy.service.BgySmsService
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
...
@@ -16,12 +16,15 @@ public class BgyApi {
...
@@ -16,12 +16,15 @@ public class BgyApi {
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
BgyApi
.
class
);
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
BgyApi
.
class
);
@PostMapping
(
"/notify"
)
@Autowired
public
String
notify
(
@RequestParam
CLNotifyRequest
notifyInfo
)
{
private
BgySmsService
bgySmsService
;
log
.
info
(
"碧桂园异步通知接口入参:{}"
,
JSONObject
.
toJSONString
(
notifyInfo
));
@PostMapping
(
"/templateNotify"
)
public
String
notify
(
@RequestBody
TemplateNotify
templateNotify
)
{
log
.
info
(
"碧桂园异步通知接口入参:{}"
,
JSONObject
.
toJSONString
(
templateNotify
));
String
response
=
"success"
;
String
response
=
"success"
;
try
{
try
{
// bgySmsService.asyncNotify(notifyInfo
);
bgySmsService
.
asyncNotify
(
templateNotify
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"处理创建模板异步通知异常:"
,
e
);
log
.
error
(
"处理创建模板异步通知异常:"
,
e
);
response
=
"fail"
;
response
=
"fail"
;
...
...
src/main/java/com/bgy/sms/channel/bgy/dto/
CLNotifyRequest
.java
→
src/main/java/com/bgy/sms/channel/bgy/dto/
TemplateNotify
.java
View file @
5e15acc3
...
@@ -3,63 +3,26 @@ package com.bgy.sms.channel.bgy.dto;
...
@@ -3,63 +3,26 @@ package com.bgy.sms.channel.bgy.dto;
import
java.io.Serializable
;
import
java.io.Serializable
;
public
class
CLNotifyRequest
implements
Serializable
{
public
class
TemplateNotify
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
// 接口用户名
// 模板流水号
private
String
username
;
private
String
data
;
// 十位时间戳
private
String
timestamp
;
// 签名串
private
String
signature
;
// 模块
private
String
action
;
// 模板id
private
String
id
;
// 审核状态(模板(1审核,2驳回),签名(2通过,3驳回))
// 审核状态(模板(1审核,2驳回),签名(2通过,3驳回))
private
String
auditStatus
;
private
String
auditStatus
;
// 驳回原因
// 驳回原因
private
String
auditReason
;
private
String
auditReason
;
public
static
long
getSerialVersionUID
()
{
public
String
getUsername
()
{
return
serialVersionUID
;
return
username
;
}
public
void
setUsername
(
String
username
)
{
this
.
username
=
username
;
}
public
String
getTimestamp
()
{
return
timestamp
;
}
public
void
setTimestamp
(
String
timestamp
)
{
this
.
timestamp
=
timestamp
;
}
public
String
getSignature
()
{
return
signature
;
}
public
void
setSignature
(
String
signature
)
{
this
.
signature
=
signature
;
}
public
String
getAction
()
{
return
action
;
}
public
void
setAction
(
String
action
)
{
this
.
action
=
action
;
}
}
public
String
get
Id
()
{
public
String
get
Data
()
{
return
id
;
return
data
;
}
}
public
void
set
Id
(
String
id
)
{
public
void
set
Data
(
String
data
)
{
this
.
id
=
id
;
this
.
data
=
data
;
}
}
public
String
getAuditStatus
()
{
public
String
getAuditStatus
()
{
...
...
src/main/java/com/bgy/sms/channel/bgy/service/BgySmsService.java
View file @
5e15acc3
package
com
.
bgy
.
sms
.
channel
.
bgy
.
service
;
package
com
.
bgy
.
sms
.
channel
.
bgy
.
service
;
import
com.bgy.sms.channel.bgy.dto.CLBizResponse
;
import
com.bgy.sms.channel.bgy.dto.CLBizResponse
;
import
com.bgy.sms.channel.bgy.dto.TemplateNotify
;
public
interface
BgySmsService
{
public
interface
BgySmsService
{
...
@@ -8,4 +9,5 @@ public interface BgySmsService {
...
@@ -8,4 +9,5 @@ public interface BgySmsService {
CLBizResponse
sendSms
(
String
mobile
,
String
content
,
String
areaId
)
throws
Exception
;
CLBizResponse
sendSms
(
String
mobile
,
String
content
,
String
areaId
)
throws
Exception
;
void
asyncNotify
(
TemplateNotify
templateNotify
);
}
}
src/main/java/com/bgy/sms/channel/bgy/service/impl/BgySmsServiceImpl.java
View file @
5e15acc3
...
@@ -4,6 +4,7 @@ package com.bgy.sms.channel.bgy.service.impl;
...
@@ -4,6 +4,7 @@ package com.bgy.sms.channel.bgy.service.impl;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.bgy.sms.channel.bgy.config.BgySMSConfig
;
import
com.bgy.sms.channel.bgy.config.BgySMSConfig
;
import
com.bgy.sms.channel.bgy.dto.CLBizResponse
;
import
com.bgy.sms.channel.bgy.dto.CLBizResponse
;
import
com.bgy.sms.channel.bgy.dto.TemplateNotify
;
import
com.bgy.sms.channel.bgy.service.BgySmsService
;
import
com.bgy.sms.channel.bgy.service.BgySmsService
;
import
com.bgy.sms.channel.bgy.utils.SendSmsUtil
;
import
com.bgy.sms.channel.bgy.utils.SendSmsUtil
;
import
com.bgy.sms.channel.dmHub.service.DmHubService
;
import
com.bgy.sms.channel.dmHub.service.DmHubService
;
...
@@ -73,4 +74,14 @@ public class BgySmsServiceImpl implements BgySmsService {
...
@@ -73,4 +74,14 @@ public class BgySmsServiceImpl implements BgySmsService {
}
}
}
}
/**
* 处理短信模板的通知
*
* @param templateNotify
*/
@Override
public
void
asyncNotify
(
TemplateNotify
templateNotify
)
{
}
}
}
src/main/java/com/bgy/sms/service/impl/MessageServiceImpl.java
View file @
5e15acc3
...
@@ -89,6 +89,8 @@ public class MessageServiceImpl implements MessageService {
...
@@ -89,6 +89,8 @@ public class MessageServiceImpl implements MessageService {
info
.
setUpContent
(
chuanglanSend
);
info
.
setUpContent
(
chuanglanSend
);
info
.
setParams
(
params
);
info
.
setParams
(
params
);
boolean
insert
=
smsTemplateService
.
insert
(
info
);
boolean
insert
=
smsTemplateService
.
insert
(
info
);
if
(!
insert
)
{
if
(!
insert
)
{
log
.
error
(
"模板插入DB异常:【{}】"
,
JSONObject
.
toJSONString
(
info
));
log
.
error
(
"模板插入DB异常:【{}】"
,
JSONObject
.
toJSONString
(
info
));
return
new
DmHubResponse
(
ResponseCode
.
SYSTEM_ERROR
);
return
new
DmHubResponse
(
ResponseCode
.
SYSTEM_ERROR
);
...
@@ -299,7 +301,7 @@ public class MessageServiceImpl implements MessageService {
...
@@ -299,7 +301,7 @@ public class MessageServiceImpl implements MessageService {
*/
*/
private
String
getMsg
(
String
upContent
,
List
<
String
>
params
)
{
private
String
getMsg
(
String
upContent
,
List
<
String
>
params
)
{
for
(
String
info
:
params
)
{
for
(
String
info
:
params
)
{
upContent
=
upContent
.
replaceFirst
(
"\\
{\\$var\\}
"
,
info
);
upContent
=
upContent
.
replaceFirst
(
"\\
$v\\$
"
,
info
);
}
}
return
upContent
;
return
upContent
;
}
}
...
...
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