Commit 0f89a472 by 111-PC\111

[+]代码修改

1 parent 3023a4ae
......@@ -8,9 +8,9 @@ import lombok.Data;
*/
@Data
public class ExecuteTaskVo {
private String deviceId;
private String orderCode;
private String orderValue;
private String orderValueType;
private String select;
private String order;
private String orderVal;
private String valType;
private String remoteId;
}
......@@ -170,24 +170,24 @@ public class SmartSceneServiceImpl extends BaseService implements SmartSceneServ
continue;
}
ExecuteTaskVo executeTaskVo = JSONObject.parseObject(paramValue, ExecuteTaskVo.class);
if (StringUtils.isEmpty(executeTaskVo.getOrderCode()) || StringUtils.isEmpty(executeTaskVo.getDeviceId())) {
if (StringUtils.isEmpty(executeTaskVo.getOrder()) || StringUtils.isEmpty(executeTaskVo.getSelect())) {
log.info("参数异常{}", index.getParamKey());
continue;
}
// 根据遥控器id下发普通指令还是红外遥控指令
String remoteId = executeTaskVo.getRemoteId();
String devideId = executeTaskVo.getDeviceId();
String devideId = executeTaskVo.getSelect();
JSONObject jsonObject = null;
if (StringUtils.isBlank(remoteId)) {
String valueType = executeTaskVo.getOrderValueType();
ordermap.put("code", executeTaskVo.getOrderCode());
ordermap.put("value", revertType(valueType, executeTaskVo.getOrderValue()));
String valueType = executeTaskVo.getValType();
ordermap.put("code", executeTaskVo.getOrder());
ordermap.put("value", revertType(valueType, executeTaskVo.getOrderVal()));
maps.add(ordermap);
ordermaps.put("commands", maps);
// 下发普通指令
jsonObject = HttpUtil.sendPost(orderIssueurl.replace("{device_id}", devideId), JSONObject.toJSONString(ordermaps), new HashMap<>());
} else {
ordermap.put("key", executeTaskVo.getOrderCode());
ordermap.put("key", executeTaskVo.getOrder());
// 下发红外遥控指令
jsonObject = HttpUtil.sendPost(instructionInfIssue.replace("{remote_id}", remoteId).replace("{infrared_id}", devideId), JSONObject.toJSONString(ordermap), new HashMap<>());
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!