Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
open-source
/
chejia-smart-service
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 8b354337
authored
Apr 15, 2021
by
111-PC\111
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
[+]通知消息修改
1 parent
773a7c8e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
src/main/java/com/glsx/smart/service/impl/SmartSceneServiceImpl.java
src/main/java/com/glsx/smart/service/impl/SmartSceneServiceImpl.java
View file @
8b35433
...
@@ -283,7 +283,7 @@ public class SmartSceneServiceImpl extends BaseService implements SmartSceneServ
...
@@ -283,7 +283,7 @@ public class SmartSceneServiceImpl extends BaseService implements SmartSceneServ
paramMap
.
put
(
"deviceType"
,
map
.
get
(
"source"
)+
""
);
paramMap
.
put
(
"deviceType"
,
map
.
get
(
"source"
)+
""
);
paramMap
.
put
(
"title"
,
title
);
paramMap
.
put
(
"title"
,
title
);
paramMap
.
put
(
"body"
,
msg
);
paramMap
.
put
(
"body"
,
msg
);
saveMegInfo
(
user_id
,
title
,
msg
,
scene
.
getId
()
);
saveMegInfo
(
user_id
,
title
,
msg
);
try
{
try
{
JSONObject
jsonObject
=
HttpUtil
.
sendPost
(
infoUrl
,
JSONObject
.
toJSONString
(
paramMap
),
new
HashMap
<>());
JSONObject
jsonObject
=
HttpUtil
.
sendPost
(
infoUrl
,
JSONObject
.
toJSONString
(
paramMap
),
new
HashMap
<>());
if
(
jsonObject
!=
null
)
{
if
(
jsonObject
!=
null
)
{
...
@@ -305,9 +305,8 @@ public class SmartSceneServiceImpl extends BaseService implements SmartSceneServ
...
@@ -305,9 +305,8 @@ public class SmartSceneServiceImpl extends BaseService implements SmartSceneServ
* @param user_id 用户id
* @param user_id 用户id
* @param title 标题
* @param title 标题
* @param msg 消息
* @param msg 消息
* @param id 场景id
*/
*/
private
void
saveMegInfo
(
String
user_id
,
String
title
,
String
msg
,
Long
id
)
{
private
void
saveMegInfo
(
String
user_id
,
String
title
,
String
msg
)
{
CarAssistantInfo
carAssistantInfo
=
new
CarAssistantInfo
();
CarAssistantInfo
carAssistantInfo
=
new
CarAssistantInfo
();
carAssistantInfo
.
setUserId
(
Integer
.
parseInt
(
user_id
));
carAssistantInfo
.
setUserId
(
Integer
.
parseInt
(
user_id
));
carAssistantInfo
.
setCreateBy
(
Integer
.
parseInt
(
user_id
));
carAssistantInfo
.
setCreateBy
(
Integer
.
parseInt
(
user_id
));
...
@@ -346,7 +345,9 @@ public class SmartSceneServiceImpl extends BaseService implements SmartSceneServ
...
@@ -346,7 +345,9 @@ public class SmartSceneServiceImpl extends BaseService implements SmartSceneServ
content
=
MessageFormat
.
format
(
"您配置的{0}场景未顺利执行,点击可查看详情。"
,
scene_name
);
content
=
MessageFormat
.
format
(
"您配置的{0}场景未顺利执行,点击可查看详情。"
,
scene_name
);
}
}
paramMap
.
put
(
"body"
,
content
);
paramMap
.
put
(
"body"
,
content
);
saveInfo
(
user_id
,
title
,
collect
,
scene
.
getId
(),
scene_name
);
String
context
=
buildBody
(
user_id
,
title
,
collect
,
scene
.
getId
(),
scene_name
);
paramMap
.
put
(
"msgBody"
,
context
);
saveMegInfo
(
user_id
,
title
,
context
);
try
{
try
{
JSONObject
jsonObject
=
HttpUtil
.
sendPost
(
infoUrl
,
JSONObject
.
toJSONString
(
paramMap
),
new
HashMap
<>());
JSONObject
jsonObject
=
HttpUtil
.
sendPost
(
infoUrl
,
JSONObject
.
toJSONString
(
paramMap
),
new
HashMap
<>());
if
(
jsonObject
!=
null
)
{
if
(
jsonObject
!=
null
)
{
...
@@ -384,7 +385,7 @@ public class SmartSceneServiceImpl extends BaseService implements SmartSceneServ
...
@@ -384,7 +385,7 @@ public class SmartSceneServiceImpl extends BaseService implements SmartSceneServ
* @param id 场景id
* @param id 场景id
* @param scene_name
* @param scene_name
*/
*/
private
void
saveInfo
(
String
user_id
,
String
title
,
List
<
OrderResponse
>
orderResponseList
,
Long
id
,
String
scene_name
)
{
private
String
buildBody
(
String
user_id
,
String
title
,
List
<
OrderResponse
>
orderResponseList
,
Long
id
,
String
scene_name
)
{
String
context
=
""
;
String
context
=
""
;
if
(
CollectionUtils
.
isEmpty
(
orderResponseList
))
{
if
(
CollectionUtils
.
isEmpty
(
orderResponseList
))
{
context
=
MessageFormat
.
format
(
"您配置的{0}场景已在{1} 成功执行"
,
scene_name
,
new
Date
());
context
=
MessageFormat
.
format
(
"您配置的{0}场景已在{1} 成功执行"
,
scene_name
,
new
Date
());
...
@@ -392,7 +393,7 @@ public class SmartSceneServiceImpl extends BaseService implements SmartSceneServ
...
@@ -392,7 +393,7 @@ public class SmartSceneServiceImpl extends BaseService implements SmartSceneServ
List
<
String
>
names
=
orderResponseList
.
stream
().
map
(
p
->
p
.
getDeviceName
()).
collect
(
Collectors
.
toList
());
List
<
String
>
names
=
orderResponseList
.
stream
().
map
(
p
->
p
.
getDeviceName
()).
collect
(
Collectors
.
toList
());
context
=
MessageFormat
.
format
(
"您配置的{0}场景已在{1}触发执行,但因以下设备{2}未能执行成功,请关注以上设备状态"
,
scene_name
,
new
Date
(),
names
);
context
=
MessageFormat
.
format
(
"您配置的{0}场景已在{1}触发执行,但因以下设备{2}未能执行成功,请关注以上设备状态"
,
scene_name
,
new
Date
(),
names
);
}
}
saveMegInfo
(
user_id
,
title
,
context
,
id
)
;
return
context
;
}
}
}
}
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