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
e32b047a
Commit
e32b047a
authored
Apr 23, 2020
by
qinxunjia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改包名和一些配置
parent
b9c0ae9a
Changes
12
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
204 additions
and
66 deletions
+204
-66
BizController.java
src/main/java/com/jz/sms/api/BizController.java
+10
-7
ChuangLanApi.java
src/main/java/com/jz/sms/api/ChuangLanApi.java
+15
-4
ChuangLanSMSConfig.java
.../java/com/jz/sms/chuanglan/config/ChuangLanSMSConfig.java
+11
-11
ChuangLanSmsService.java
...ava/com/jz/sms/chuanglan/service/ChuangLanSmsService.java
+1
-1
ChuangLanSmsServiceImpl.java
...z/sms/chuanglan/service/impl/ChuangLanSmsServiceImpl.java
+5
-2
DmHubBatchSendRequest.java
src/main/java/com/jz/sms/dto/DmHubBatchSendRequest.java
+11
-0
DmHubBatchSendResponse.java
src/main/java/com/jz/sms/dto/DmHubBatchSendResponse.java
+28
-0
SmsTemplateInfo.java
...in/java/com/jz/sms/repository/domain/SmsTemplateInfo.java
+9
-0
TemplateChangeBean.java
...main/java/com/jz/sms/service/bean/TemplateChangeBean.java
+39
-0
MessageServiceImpl.java
...main/java/com/jz/sms/service/impl/MessageServiceImpl.java
+73
-39
application-prod.yml
src/main/resources/application-prod.yml
+1
-1
application-test.yml
src/main/resources/application-test.yml
+1
-1
No files found.
src/main/java/com/jz/sms/api/BizController.java
View file @
e32b047a
package
com
.
jz
.
sms
.
api
;
import
com.alibaba.fastjson.JSONObject
;
import
com.jz.sms.dto.DmHubBatchSendRequest
;
import
com.jz.sms.dto.DmHubBatchSendResponse
;
import
com.jz.sms.dto.DmHubTemplateRequest
;
import
com.jz.sms.dto.DmHubTemplateResponse
;
import
com.jz.sms.service.MessageService
;
...
...
@@ -42,10 +44,11 @@ public class BizController {
* @return
*/
@PostMapping
(
"/sms/batch"
)
public
String
batch
(
@RequestParam
Map
<
String
,
Object
>
params
)
{
log
.
info
(
"**********批量发送入参*******:{}"
,
params
);
return
"success"
;
public
String
batch
(
@RequestBody
DmHubBatchSendRequest
request
)
{
log
.
info
(
"**********批量发送入参*******:{}"
,
JSONObject
.
toJSONString
(
request
));
DmHubBatchSendResponse
response
=
messageService
.
batchSend
(
request
);
// log.info("**********批量发送入参*******:{}", response);
return
"fail"
;
}
...
...
@@ -55,10 +58,10 @@ public class BizController {
* @return
*/
@RequestMapping
(
"/sms/send"
)
public
String
send
(
@Request
Param
Map
<
String
,
Object
>
params
)
{
public
String
send
(
@Request
Body
Map
<
String
,
Object
>
params
)
{
log
.
info
(
"**********单条发送入参*******:{}"
,
params
);
return
"
success
"
;
log
.
info
(
"**********单条发送入参*******:{}"
,
JSONObject
.
toJSONString
(
params
)
);
return
"
fail
"
;
}
...
...
src/main/java/com/jz/sms/api/ChuangLanApi.java
View file @
e32b047a
...
...
@@ -2,7 +2,7 @@ package com.jz.sms.api;
import
com.jz.sms.chuanglan.dto.CLNotifyRequest
;
import
com.jz.sms.chuanglan.service.ChuanLanSmsService
;
import
com.jz.sms.chuanglan.service.Chuan
g
LanSmsService
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -11,22 +11,33 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.Map
;
import
java.util.regex.Matcher
;
import
java.util.regex.Pattern
;
@RequestMapping
(
"/test/chuanglan"
)
@RestController
public
class
ChuangLanApi
{
public
static
void
main
(
String
[]
args
)
{
String
regex
=
"\\$\\{([^'}]*)'\\}"
;
Pattern
pattern
=
Pattern
.
compile
(
regex
);
Matcher
matcher
=
pattern
.
matcher
(
"你需要${a522}匹${555'}配的字符串"
);
while
(
matcher
.
find
())
{
System
.
out
.
println
(
matcher
.
group
());
}
}
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
ChuangLanApi
.
class
);
@Autowired
private
Chuan
LanSmsService
chuan
LanSmsService
;
private
Chuan
gLanSmsService
chuang
LanSmsService
;
@PostMapping
(
"/notify"
)
public
String
notify
(
@RequestParam
CLNotifyRequest
notifyInfo
)
{
log
.
info
(
"创蓝异步通知接口入参:{}"
,
notifyInfo
);
chuanLanSmsService
.
asyncNotify
(
notifyInfo
);
chuan
g
LanSmsService
.
asyncNotify
(
notifyInfo
);
String
response
=
"success"
;
...
...
src/main/java/com/jz/sms/chuanglan/config/ChuangLanSMSConfig.java
View file @
e32b047a
...
...
@@ -34,57 +34,57 @@ public class ChuangLanSMSConfig {
public
static
String
interfacePassword
;
@Value
(
"${system.config.chuanlan.notificationAccount}"
)
@Value
(
"${system.config.chuan
g
lan.notificationAccount}"
)
public
void
setNotificationAccount
(
String
notificationAccount
)
{
ChuangLanSMSConfig
.
notificationAccount
=
notificationAccount
;
}
@Value
(
"${system.config.chuanlan.notificationPassword}"
)
@Value
(
"${system.config.chuan
g
lan.notificationPassword}"
)
public
void
setNotificationPassword
(
String
notificationPassword
)
{
ChuangLanSMSConfig
.
notificationPassword
=
notificationPassword
;
}
@Value
(
"${system.config.chuanlan.marketingAccount}"
)
@Value
(
"${system.config.chuan
g
lan.marketingAccount}"
)
public
void
setMarketingAccount
(
String
marketingAccount
)
{
ChuangLanSMSConfig
.
marketingAccount
=
marketingAccount
;
}
@Value
(
"${system.config.chuanlan.marketingPassword}"
)
@Value
(
"${system.config.chuan
g
lan.marketingPassword}"
)
public
void
setMarketingPassword
(
String
marketingPassword
)
{
ChuangLanSMSConfig
.
marketingPassword
=
marketingPassword
;
}
@Value
(
"${system.config.chuanlan.sendFixed}"
)
@Value
(
"${system.config.chuan
g
lan.sendFixed}"
)
public
void
setSendFixed
(
String
sendFixed
)
{
ChuangLanSMSConfig
.
sendFixed
=
sendFixed
;
}
@Value
(
"${system.config.chuanlan.sendVariable}"
)
@Value
(
"${system.config.chuan
g
lan.sendVariable}"
)
public
void
setSendVariable
(
String
sendVariable
)
{
ChuangLanSMSConfig
.
sendVariable
=
sendVariable
;
}
@Value
(
"${system.config.chuanlan.reportUrl}"
)
@Value
(
"${system.config.chuan
g
lan.reportUrl}"
)
public
void
setReportUrl
(
String
reportUrl
)
{
ChuangLanSMSConfig
.
reportUrl
=
reportUrl
;
}
@Value
(
"${system.config.chuanlan.pullReport}"
)
@Value
(
"${system.config.chuan
g
lan.pullReport}"
)
public
void
setPullReport
(
String
pullReport
)
{
ChuangLanSMSConfig
.
pullReport
=
pullReport
;
}
@Value
(
"${system.config.chuanlan.addTemplate}"
)
@Value
(
"${system.config.chuan
g
lan.addTemplate}"
)
public
void
setAddTemplate
(
String
addTemplate
)
{
ChuangLanSMSConfig
.
addTemplate
=
addTemplate
;
}
@Value
(
"${system.config.chuanlan.interfaceUser}"
)
@Value
(
"${system.config.chuan
g
lan.interfaceUser}"
)
public
void
setInterfaceUser
(
String
interfaceUser
)
{
ChuangLanSMSConfig
.
interfaceUser
=
interfaceUser
;
}
@Value
(
"${system.config.chuanlan.interfacePassword}"
)
@Value
(
"${system.config.chuan
g
lan.interfacePassword}"
)
public
void
setInterfacePassword
(
String
interfacePassword
)
{
ChuangLanSMSConfig
.
interfacePassword
=
interfacePassword
;
}
...
...
src/main/java/com/jz/sms/chuanglan/service/ChuanLanSmsService.java
→
src/main/java/com/jz/sms/chuanglan/service/Chuan
g
LanSmsService.java
View file @
e32b047a
...
...
@@ -7,7 +7,7 @@ import com.jz.sms.dto.*;
import
java.util.List
;
public
interface
ChuanLanSmsService
{
public
interface
Chuan
g
LanSmsService
{
CLTemplateResponse
createTemplate
(
String
content
,
String
type
)
throws
Exception
;
...
...
src/main/java/com/jz/sms/chuanglan/service/impl/ChuanLanSmsServiceImpl.java
→
src/main/java/com/jz/sms/chuanglan/service/impl/Chuan
g
LanSmsServiceImpl.java
View file @
e32b047a
...
...
@@ -9,7 +9,7 @@ import com.jz.sms.chuanglan.dto.CLNotifyRequest;
import
com.jz.sms.chuanglan.dto.CLSendFixedRequest
;
import
com.jz.sms.chuanglan.dto.CLSendFixedResponse
;
import
com.jz.sms.chuanglan.dto.CLTemplateResponse
;
import
com.jz.sms.chuanglan.service.ChuanLanSmsService
;
import
com.jz.sms.chuanglan.service.Chuan
g
LanSmsService
;
import
com.jz.sms.chuanglan.utils.ChuangLanSmsUtil
;
import
com.jz.sms.chuanglan.config.ChuangLanSMSConfig
;
import
com.jz.sms.config.ResponseCode
;
...
...
@@ -31,7 +31,7 @@ import java.util.Map;
@SuppressWarnings
(
"DuplicatedCode"
)
@Service
public
class
Chuan
LanSmsServiceImpl
implements
Chuan
LanSmsService
{
public
class
Chuan
gLanSmsServiceImpl
implements
Chuang
LanSmsService
{
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
BizController
.
class
);
private
static
final
String
SUCCESS
=
"success"
;
...
...
@@ -44,6 +44,7 @@ public class ChuanLanSmsServiceImpl implements ChuanLanSmsService {
@Override
public
CLTemplateResponse
createTemplate
(
String
content
,
String
type
)
throws
Exception
{
int
i
=
1
/
0
;
log
.
info
(
"进入创蓝创建短信接口模板的逻辑:{}"
,
content
);
Map
<
String
,
Object
>
requestMap
=
new
HashMap
<>();
String
appId
;
...
...
@@ -59,12 +60,14 @@ public class ChuanLanSmsServiceImpl implements ChuanLanSmsService {
return
new
CLTemplateResponse
(
ResponseCode
.
SYSTEM_ERROR
,
"未知的模板类型:"
+
type
,
0
);
}
content
=
content
.
replaceAll
(
"回TD退订"
,
""
);
String
timestamp
=
String
.
valueOf
(
System
.
currentTimeMillis
()
/
1000
);
String
encrypt
=
Md5Util
.
encrypt
(
new
StringBuffer
(
username
).
append
(
password
).
append
(
timestamp
).
toString
());
requestMap
.
put
(
"username"
,
username
);
requestMap
.
put
(
"timestamp"
,
timestamp
);
requestMap
.
put
(
"signature"
,
encrypt
);
requestMap
.
put
(
"appid"
,
appId
);
requestMap
.
put
(
"unsubscribe"
,
"回TD退订"
);
requestMap
.
put
(
"content"
,
content
);
log
.
info
(
"请求创蓝创建短信模板的请求参数为:{}"
,
requestMap
);
String
retStr
=
HttpUtil
.
doPost
(
ChuangLanSMSConfig
.
addTemplate
,
requestMap
);
...
...
src/main/java/com/jz/sms/dto/DmHubBatchSendRequest.java
View file @
e32b047a
...
...
@@ -13,6 +13,9 @@ public class DmHubBatchSendRequest {
// 批次号
private
String
batchId
;
// 批次号
private
String
audienceIdType
;
// 短信数据
private
List
<
JSONObject
>
data
;
...
...
@@ -40,4 +43,12 @@ public class DmHubBatchSendRequest {
public
void
setData
(
List
<
JSONObject
>
data
)
{
this
.
data
=
data
;
}
public
String
getAudienceIdType
()
{
return
audienceIdType
;
}
public
void
setAudienceIdType
(
String
audienceIdType
)
{
this
.
audienceIdType
=
audienceIdType
;
}
}
src/main/java/com/jz/sms/dto/DmHubBatchSendResponse.java
View file @
e32b047a
package
com
.
jz
.
sms
.
dto
;
public
class
DmHubBatchSendResponse
{
private
String
code
;
private
String
msg
;
public
DmHubBatchSendResponse
()
{
}
public
DmHubBatchSendResponse
(
String
code
,
String
msg
)
{
this
.
code
=
code
;
this
.
msg
=
msg
;
}
public
String
getCode
()
{
return
code
;
}
public
void
setCode
(
String
code
)
{
this
.
code
=
code
;
}
public
String
getMsg
()
{
return
msg
;
}
public
void
setMsg
(
String
msg
)
{
this
.
msg
=
msg
;
}
}
src/main/java/com/jz/sms/repository/domain/SmsTemplateInfo.java
View file @
e32b047a
...
...
@@ -38,6 +38,7 @@ public class SmsTemplateInfo {
private
String
upTemplateId
;
private
String
upRejectMsg
;
private
String
params
;
public
SmsTemplateInfo
()
{
...
...
@@ -152,4 +153,12 @@ public class SmsTemplateInfo {
public
void
setUpRejectMsg
(
String
upRejectMsg
)
{
this
.
upRejectMsg
=
upRejectMsg
;
}
public
String
getParams
()
{
return
params
;
}
public
void
setParams
(
String
params
)
{
this
.
params
=
params
;
}
}
src/main/java/com/jz/sms/service/bean/TemplateChangeBean.java
0 → 100644
View file @
e32b047a
package
com
.
jz
.
sms
.
service
.
bean
;
import
com.alibaba.fastjson.JSONArray
;
import
java.util.List
;
public
class
TemplateChangeBean
{
private
String
newStr
;
private
List
<
String
>
params
;
public
TemplateChangeBean
()
{
}
public
TemplateChangeBean
(
String
newStr
,
List
<
String
>
params
)
{
this
.
newStr
=
newStr
;
this
.
params
=
params
;
}
public
String
getNewStr
()
{
return
newStr
;
}
public
void
setNewStr
(
String
newStr
)
{
this
.
newStr
=
newStr
;
}
public
List
<
String
>
getParams
()
{
return
params
;
}
public
void
setParams
(
List
<
String
>
params
)
{
this
.
params
=
params
;
}
}
src/main/java/com/jz/sms/service/impl/MessageServiceImpl.java
View file @
e32b047a
package
com
.
jz
.
sms
.
service
.
impl
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.mapper.EntityWrapper
;
import
com.jz.sms.chuanglan.dto.CLSendFixedResponse
;
import
com.jz.sms.chuanglan.dto.CLTemplateResponse
;
import
com.jz.sms.chuanglan.service.ChuanLanSmsService
;
import
com.jz.sms.chuanglan.service.Chuan
g
LanSmsService
;
import
com.jz.sms.config.ResponseCode
;
import
com.jz.sms.dto.*
;
import
com.jz.sms.repository.domain.SmsTemplateInfo
;
import
com.jz.sms.repository.domain.SysBatchInfo
;
import
com.jz.sms.service.MessageService
;
import
com.jz.sms.service.SmsTemplateService
;
import
com.jz.sms.service.bean.TemplateChangeBean
;
import
com.jz.sms.util.id.IdHandler
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -35,9 +37,7 @@ public class MessageServiceImpl implements MessageService {
private
SmsTemplateService
smsTemplateService
;
@Autowired
private
ChuanLanSmsService
chuanLanSmsService
;
String
a
=
"亲爱的${name@6!\"\"},您的手机号码:${mobile@12!\"\"}参与了优惠活动,详见: ${surl!'https://www.baidu.com/?cl_sr=短消息'} 回TD退订"
;
private
ChuangLanSmsService
chuangLanSmsService
;
/**
* 短信模板创建
...
...
@@ -59,7 +59,9 @@ public class MessageServiceImpl implements MessageService {
String
templateName
=
requestDTO
.
getTemplateName
();
// 替换模板格式,保存适合创蓝发送短信的模板,避免发送时修改模板格式
String
chuanlanSend
=
dmHub2ChuanLanSend
(
templateContent
);
TemplateChangeBean
bean
=
dmHub2ChuangLanSend
(
templateContent
);
String
chuanglanSend
=
bean
.
getNewStr
();
String
params
=
bean
.
getParams
().
toString
();
SmsTemplateInfo
info
=
new
SmsTemplateInfo
();
info
.
setContent
(
templateContent
);
...
...
@@ -71,14 +73,16 @@ public class MessageServiceImpl implements MessageService {
info
.
setTemplateName
(
templateName
);
info
.
setDateCreated
(
new
Date
());
info
.
setLastUpdated
(
new
Date
());
info
.
setUpContent
(
chuanlanSend
);
info
.
setLastUpdated
(
new
Date
());
info
.
setUpContent
(
chuanglanSend
);
info
.
setParams
(
params
);
boolean
insert
=
smsTemplateService
.
insert
(
info
);
if
(!
insert
)
{
return
new
DmHubTemplateResponse
(
"500"
,
"系统异常"
);
//TODO 发送告警
}
String
chaunglanCreate
=
dmHub2Chuan
LanCreate
(
chuan
lanSend
);
CLTemplateResponse
template
=
chuanLanSmsService
.
createTemplate
(
chaunglanCreate
,
smsType
);
String
chaunglanCreate
=
dmHub2Chuan
gLanCreate
(
chuang
lanSend
);
CLTemplateResponse
template
=
chuan
g
LanSmsService
.
createTemplate
(
chaunglanCreate
,
smsType
);
if
(
ResponseCode
.
SUCCESS
.
getCode
().
equals
(
template
.
getCode
()))
{
String
id
=
template
.
getId
();
SmsTemplateInfo
updateInfo
=
new
SmsTemplateInfo
();
...
...
@@ -100,16 +104,13 @@ public class MessageServiceImpl implements MessageService {
}
public
String
dmHub2ChuanLanSend
(
String
content
)
{
boolean
flag
=
false
;
if
(
content
.
contains
(
"${surl!"
))
{
content
=
content
.
replaceAll
(
"\\$\\{surl!'"
,
""
);
flag
=
true
;
}
String
upContent
=
content
;
/**
* 将DM HUb的模板装成可以直接用在创蓝发送短信时的模板
*
* @param content
* @return
*/
public
TemplateChangeBean
dmHub2ChuangLanSend
(
String
content
)
{
String
regex
=
"\\$\\{[^}]+\\}"
;
Pattern
pattern
=
Pattern
.
compile
(
regex
);
Matcher
matcher
=
pattern
.
matcher
(
content
);
...
...
@@ -119,38 +120,41 @@ public class MessageServiceImpl implements MessageService {
String
group
=
matcher
.
group
();
groups
.
add
(
group
);
}
if
(
groups
.
isEmpty
())
{
return
new
TemplateChangeBean
(
content
,
groups
);
}
int
idx
=
content
.
indexOf
(
"${surl!'"
);
if
(
idx
>=
0
)
{
String
substring
=
content
.
substring
(
idx
);
System
.
out
.
println
(
substring
);
int
i1
=
substring
.
indexOf
(
"'}"
);
System
.
out
.
println
(
i1
);
String
substring1
=
substring
.
substring
(
0
,
i1
+
2
);
System
.
out
.
println
(
substring1
);
System
.
out
.
println
(
content
);
substring1
=
Matcher
.
quoteReplacement
(
substring1
);
substring1
=
escapeRegex
(
substring1
);
content
=
content
.
replaceAll
(
substring1
,
"\\{\\$var\\}"
);
}
for
(
String
g
:
groups
)
{
String
t
=
g
;
g
=
Matcher
.
quoteReplacement
(
g
);
g
=
escapeRegex
(
g
);
if
(
g
.
contains
(
"\\$\\{surl!"
))
{
int
i
=
content
.
indexOf
(
"${surl!"
);
String
[]
split
=
content
.
split
(
g
);
StringBuilder
sb
=
new
StringBuilder
();
String
TmpContent
=
content
.
substring
(
i
+
"${surl!'"
.
length
(),
i
+
t
.
length
()
-
2
);
sb
.
append
(
split
[
0
]).
append
(
TmpContent
).
append
(
split
[
1
]);
content
=
sb
.
toString
();
}
content
=
content
.
replaceAll
(
g
,
"\\{\\$var\\}"
);
}
if
(
flag
)
{
content
=
content
.
replaceAll
(
"'\\}"
,
""
);
return
new
TemplateChangeBean
(
content
,
groups
);
}
// System.out.println(content);
return
content
;
}
public
String
dmHub2ChuanLanCreate
(
String
content
)
{
public
String
dmHub2ChuangLanCreate
(
String
content
)
{
content
=
content
.
replaceAll
(
"\\{\\$var\\}"
,
"\\{s20\\}"
);
return
content
;
}
public
String
escapeRegex
(
String
s
)
{
public
static
String
escapeRegex
(
String
s
)
{
String
[]
symbols
=
new
String
[]{
"\\/"
,
"\\["
,
"\\]"
,
"\\("
,
"\\)"
,
"\\{"
,
"\\}"
,
"\\?"
,
"\\+"
,
"\\*"
,
"\\|"
,
"\\."
,
"\\^"
,
"\\-"
,
"\\^"
};
if
(
s
!=
null
)
{
for
(
String
sym
:
symbols
)
{
...
...
@@ -216,12 +220,12 @@ public class MessageServiceImpl implements MessageService {
for
(
String
str
:
list
)
{
}
CLSendFixedResponse
chuanglanResponse
=
chuanLanSmsService
.
sendByFixed
(
dmHubBatchId
,
content
,
phoneList
,
type
);
CLSendFixedResponse
chuanglanResponse
=
chuan
g
LanSmsService
.
sendByFixed
(
dmHubBatchId
,
content
,
phoneList
,
type
);
}
else
{
// 固定模板
// 4、封裝數據
chuanLanSmsService
.
sendByVariable
(
dmHubBatchId
,
content
,
phoneList
,
type
);
chuan
g
LanSmsService
.
sendByVariable
(
dmHubBatchId
,
content
,
phoneList
,
type
);
}
...
...
@@ -233,9 +237,39 @@ public class MessageServiceImpl implements MessageService {
}
@Override
public
DmHubBatchSendResponse
batchSend
(
DmHubBatchSendRequest
requestDTO
)
{
public
DmHubBatchSendResponse
batchSend
(
DmHubBatchSendRequest
request
)
{
String
batchId
=
request
.
getBatchId
();
String
templateId
=
request
.
getTemplateId
();
String
audienceIdType
=
request
.
getAudienceIdType
();
List
<
JSONObject
>
data
=
request
.
getData
();
SmsTemplateInfo
templateInfo
=
smsTemplateService
.
selectOne
(
new
EntityWrapper
<
SmsTemplateInfo
>().
eq
(
"dm_template_id"
,
templateId
));
if
(
null
==
templateInfo
)
{
return
new
DmHubBatchSendResponse
(
"500"
,
"模板不存在"
);
}
for
(
JSONObject
json
:
data
)
{
Set
<
String
>
keys
=
json
.
keySet
();
StringBuilder
sb
=
new
StringBuilder
();
String
mobile
=
json
.
getString
(
"_audienceId"
);
json
.
remove
(
"name"
);
json
.
remove
(
"id"
);
json
.
remove
(
"_audienceId"
);
sb
.
append
(
mobile
);
if
(!
json
.
isEmpty
())
{
for
(
String
key
:
keys
)
{
String
value
=
json
.
getString
(
key
);
}
}
}
return
null
;
}
}
src/main/resources/application-prod.yml
View file @
e32b047a
...
...
@@ -17,7 +17,7 @@ spring:
system
:
config
:
chuanlan
:
chuan
g
lan
:
notificationAccount
:
N0767543
# 通知类短信账号
notificationPassword
:
N0767543
# 通知类短信密码
marketingAccount
:
M7603731
# 营销类短信账号
...
...
src/main/resources/application-test.yml
View file @
e32b047a
...
...
@@ -18,7 +18,7 @@ spring:
system
:
config
:
chuanlan
:
chuan
g
lan
:
notificationAccount
:
N0767543
# 通知类短信账号
notificationPassword
:
DaejS7P5ixaeee
# 通知类短信密码
marketingAccount
:
M7603731
# 营销类短信账号
...
...
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