Commit 6d8666f8 by 111-PC\111

[+]代码规范

1 parent 700b39d7
......@@ -54,6 +54,10 @@ public class DeviceService {
R deviceName = smartPlatformClient.getDeviceName(devId);
Object data = deviceName.getData();
JSONObject jsonObject = JSONObject.parseObject(JSONObject.toJSONString(data));
if(jsonObject==null){
log.info("查询设备{}名称为空",devId);
return null;
}
return jsonObject.getString("name");
}
}
......@@ -250,6 +250,11 @@ public class InfoService {
DeviceRequest deviceRequest = new DeviceRequest();
DeviceEventDetailRep bizData = deviceEventRep.getBizData();
if (("bindUser").equals(deviceEventRep.getBizCode())) {
try {
Thread.sleep(500);
} catch (InterruptedException e) {
e.printStackTrace();
}
String name = deviceService.getDeviceName(bizData.getDevId());
deviceRequest.setDeviceName(name);
} else {
......@@ -259,11 +264,7 @@ public class InfoService {
deviceRequest.setPlatformProductId(deviceEventRep.getProductKey());
deviceRequest.setChannel(1);
deviceRequest.setParentId(bizData.getParentDevId());
if(("uylvjbk8ao1nrfjb").equals(deviceEventRep.getProductKey())){
deviceRequest.setType(bizData.getParentDevId() == null ? 1 : 2);
}else{
deviceRequest.setType(1);
}
deviceRequest.setType(bizData.getParentDevId() == null ? 1 : 2);
deviceRequest.setDeviceId(bizData.getDevId());
return deviceRequest;
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!