Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
eshiled-new
/
ne-shield-standard-interfaces
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
1
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 51ca61b0
authored
Apr 13, 2022
by
杨林龙
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
优化短信发送参数
1 parent
9a6bf5db
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
4 deletions
src/main/java/cn/com/glsx/stdinterface/modules/service/AlarmElectricFenceService.java
src/main/java/cn/com/glsx/stdinterface/modules/service/AlarmElectricFenceService.java
View file @
51ca61b
...
...
@@ -16,6 +16,7 @@ import cn.com.glsx.stdinterface.modules.remote.NotifyCenterService;
import
cn.com.glsx.stdinterface.modules.remote.RemoteGpsBsService
;
import
cn.com.glsx.stdinterface.modules.util.DateUtils
;
import
cn.hutool.core.date.DateUtil
;
import
com.glsx.plat.common.utils.StringUtils
;
import
com.google.common.collect.Maps
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -160,10 +161,10 @@ public class AlarmElectricFenceService {
return
;
}
Map
<
String
,
Object
>
args
=
Maps
.
newLinkedHashMap
();
args
.
put
(
"arg1"
,
vehicle
.
getOwnerName
(
));
args
.
put
(
"arg2"
,
vehicle
.
getLicensePlate
(
));
args
.
put
(
"arg3"
,
DateUtil
.
formatDateTime
(
alarmElectricFence
.
getAlarmTime
(
)));
args
.
put
(
"arg4"
,
electricFence
.
getFenceName
(
));
args
.
put
(
"arg1"
,
replaceStr
(
vehicle
.
getOwnerName
()
));
args
.
put
(
"arg2"
,
replaceStr
(
vehicle
.
getLicensePlate
()
));
args
.
put
(
"arg3"
,
replaceStr
(
DateUtil
.
formatDateTime
(
alarmElectricFence
.
getAlarmTime
()
)));
args
.
put
(
"arg4"
,
replaceStr
(
electricFence
.
getFenceName
()
));
SmsMessageRequest
messageRequest
=
new
SmsMessageRequest
();
messageRequest
.
setPhone
(
electricFence
.
getTelNumbers
());
messageRequest
.
setArgs
(
args
);
...
...
@@ -171,4 +172,14 @@ public class AlarmElectricFenceService {
notifyCenterService
.
sendSms
(
messageRequest
);
log
.
info
(
"发送短信结束"
);
}
/**
* 将null替换为空字符串
*
* @param str 字符串
* @return 替换后的字符串
*/
private
String
replaceStr
(
String
str
)
{
return
StringUtils
.
isEmpty
(
str
)
?
""
:
str
;
}
}
Write
Preview
Markdown
is supported
Attach a file
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 post a comment