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 c80df7ec
authored
Apr 20, 2021
by
wnb0128
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'master' of 192.168.3.233:open-source/chejia-smart-service
2 parents
55e9dd4f
b8d6e15d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletions
src/main/java/com/glsx/smart/service/impl/SmartSceneServiceImpl.java
src/main/java/com/glsx/smart/service/impl/SmartSceneServiceImpl.java
View file @
c80df7e
...
...
@@ -5,6 +5,7 @@ import cn.com.glsx.didicb.app.model.CarAssistantInfo;
import
cn.com.glsx.didicb.app.remote.CarAssistantInfoRemote
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.nacos.common.utils.MD5Utils
;
import
com.glsx.smart.dao.entity.SmartDeviceStatus
;
import
com.glsx.smart.dao.entity.SmartScene
;
import
com.glsx.smart.dao.entity.SmartSceneData
;
...
...
@@ -276,12 +277,16 @@ public class SmartSceneServiceImpl extends BaseService implements SmartSceneServ
Map
<
String
,
Object
>
map
=
sceneMapper
.
getBySourceAndUserId
(
scene
.
getId
());
String
user_id
=
map
.
get
(
"user_id"
)
+
""
;
Map
<
String
,
String
>
paramMap
=
new
HashMap
<>();
String
source
=
map
.
get
(
"source"
)
+
""
;
paramMap
.
put
(
"alias"
,
user_id
);
paramMap
.
put
(
"deviceType"
,
map
.
get
(
"source"
)
+
""
);
paramMap
.
put
(
"title"
,
title
);
paramMap
.
put
(
"body"
,
msg
);
paramMap
.
put
(
"msgBody"
,
msg
);
saveMegInfo
(
user_id
,
title
,
msg
);
if
(
StringUtils
.
isEmpty
(
source
)){
return
;
}
try
{
log
.
info
(
"通知入参{}"
,
JSONObject
.
toJSONString
(
paramMap
));
JSONObject
jsonObject
=
HttpUtil
.
sendPost
(
infoUrl
,
JSONObject
.
toJSONString
(
paramMap
),
new
HashMap
<>());
...
...
@@ -328,6 +333,7 @@ public class SmartSceneServiceImpl extends BaseService implements SmartSceneServ
Map
<
String
,
Object
>
map
=
sceneMapper
.
getBySourceAndUserId
(
scene
.
getId
());
String
user_id
=
map
.
get
(
"user_id"
)
+
""
;
String
scene_name
=
map
.
get
(
"scene_name"
)
+
""
;
String
source
=
map
.
get
(
"source"
)
+
""
;
Map
<
String
,
String
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"alias"
,
user_id
);
paramMap
.
put
(
"deviceType"
,
map
.
get
(
"source"
)
+
""
);
...
...
@@ -347,8 +353,10 @@ public class SmartSceneServiceImpl extends BaseService implements SmartSceneServ
String
context
=
buildBody
(
user_id
,
title
,
collect
,
scene
.
getId
(),
scene_name
);
paramMap
.
put
(
"msgBody"
,
context
);
saveMegInfo
(
user_id
,
title
,
context
);
if
(
StringUtils
.
isEmpty
(
source
)){
return
;
}
try
{
log
.
info
(
"通知入参{}"
,
JSONObject
.
toJSONString
(
paramMap
));
JSONObject
jsonObject
=
HttpUtil
.
sendPost
(
infoUrl
,
JSONObject
.
toJSONString
(
paramMap
),
new
HashMap
<>());
if
(
jsonObject
!=
null
)
{
String
code
=
jsonObject
.
get
(
"code"
)
+
""
;
...
...
@@ -403,4 +411,8 @@ public class SmartSceneServiceImpl extends BaseService implements SmartSceneServ
return
context
;
}
public
static
void
main
(
String
[]
args
)
{
System
.
out
.
println
(
MD5Utils
.
md5Hex
(
"13450798972"
,
"utf-8"
));
}
}
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