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 0f89a472
authored
Mar 26, 2021
by
111-PC\111
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
[+]代码修改
1 parent
3023a4ae
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
10 deletions
src/main/java/com/glsx/smart/pojo/ExecuteTaskVo.java
src/main/java/com/glsx/smart/service/impl/SmartSceneServiceImpl.java
src/main/java/com/glsx/smart/pojo/ExecuteTaskVo.java
View file @
0f89a47
...
@@ -8,9 +8,9 @@ import lombok.Data;
...
@@ -8,9 +8,9 @@ import lombok.Data;
*/
*/
@Data
@Data
public
class
ExecuteTaskVo
{
public
class
ExecuteTaskVo
{
private
String
deviceId
;
private
String
select
;
private
String
order
Code
;
private
String
order
;
private
String
orderVal
ue
;
private
String
orderVal
;
private
String
orderValue
Type
;
private
String
val
Type
;
private
String
remoteId
;
private
String
remoteId
;
}
}
src/main/java/com/glsx/smart/service/impl/SmartSceneServiceImpl.java
View file @
0f89a47
...
@@ -170,24 +170,24 @@ public class SmartSceneServiceImpl extends BaseService implements SmartSceneServ
...
@@ -170,24 +170,24 @@ public class SmartSceneServiceImpl extends BaseService implements SmartSceneServ
continue
;
continue
;
}
}
ExecuteTaskVo
executeTaskVo
=
JSONObject
.
parseObject
(
paramValue
,
ExecuteTaskVo
.
class
);
ExecuteTaskVo
executeTaskVo
=
JSONObject
.
parseObject
(
paramValue
,
ExecuteTaskVo
.
class
);
if
(
StringUtils
.
isEmpty
(
executeTaskVo
.
getOrder
Code
())
||
StringUtils
.
isEmpty
(
executeTaskVo
.
getDeviceId
()))
{
if
(
StringUtils
.
isEmpty
(
executeTaskVo
.
getOrder
())
||
StringUtils
.
isEmpty
(
executeTaskVo
.
getSelect
()))
{
log
.
info
(
"参数异常{}"
,
index
.
getParamKey
());
log
.
info
(
"参数异常{}"
,
index
.
getParamKey
());
continue
;
continue
;
}
}
// 根据遥控器id下发普通指令还是红外遥控指令
// 根据遥控器id下发普通指令还是红外遥控指令
String
remoteId
=
executeTaskVo
.
getRemoteId
();
String
remoteId
=
executeTaskVo
.
getRemoteId
();
String
devideId
=
executeTaskVo
.
get
DeviceId
();
String
devideId
=
executeTaskVo
.
get
Select
();
JSONObject
jsonObject
=
null
;
JSONObject
jsonObject
=
null
;
if
(
StringUtils
.
isBlank
(
remoteId
))
{
if
(
StringUtils
.
isBlank
(
remoteId
))
{
String
valueType
=
executeTaskVo
.
get
OrderValue
Type
();
String
valueType
=
executeTaskVo
.
get
Val
Type
();
ordermap
.
put
(
"code"
,
executeTaskVo
.
getOrder
Code
());
ordermap
.
put
(
"code"
,
executeTaskVo
.
getOrder
());
ordermap
.
put
(
"value"
,
revertType
(
valueType
,
executeTaskVo
.
getOrderVal
ue
()));
ordermap
.
put
(
"value"
,
revertType
(
valueType
,
executeTaskVo
.
getOrderVal
()));
maps
.
add
(
ordermap
);
maps
.
add
(
ordermap
);
ordermaps
.
put
(
"commands"
,
maps
);
ordermaps
.
put
(
"commands"
,
maps
);
// 下发普通指令
// 下发普通指令
jsonObject
=
HttpUtil
.
sendPost
(
orderIssueurl
.
replace
(
"{device_id}"
,
devideId
),
JSONObject
.
toJSONString
(
ordermaps
),
new
HashMap
<>());
jsonObject
=
HttpUtil
.
sendPost
(
orderIssueurl
.
replace
(
"{device_id}"
,
devideId
),
JSONObject
.
toJSONString
(
ordermaps
),
new
HashMap
<>());
}
else
{
}
else
{
ordermap
.
put
(
"key"
,
executeTaskVo
.
getOrder
Code
());
ordermap
.
put
(
"key"
,
executeTaskVo
.
getOrder
());
// 下发红外遥控指令
// 下发红外遥控指令
jsonObject
=
HttpUtil
.
sendPost
(
instructionInfIssue
.
replace
(
"{remote_id}"
,
remoteId
).
replace
(
"{infrared_id}"
,
devideId
),
JSONObject
.
toJSONString
(
ordermap
),
new
HashMap
<>());
jsonObject
=
HttpUtil
.
sendPost
(
instructionInfIssue
.
replace
(
"{remote_id}"
,
remoteId
).
replace
(
"{infrared_id}"
,
devideId
),
JSONObject
.
toJSONString
(
ordermap
),
new
HashMap
<>());
}
}
...
...
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