|
|
@ -411,10 +411,11 @@ public class HandServiceImpl implements HandService { |
|
|
|
String name = param.get("name"); |
|
|
|
String type = param.get("type"); |
|
|
|
String value = param.get("value"); |
|
|
|
Device device = deviceAppService.findDeviceByCode("PB01"); |
|
|
|
HailiangFlatDeviceDriver hailiangFlatDeviceDriver; |
|
|
|
if (device.getDeviceDriver() instanceof HailiangFlatDeviceDriver){ |
|
|
|
hailiangFlatDeviceDriver = (HailiangFlatDeviceDriver) device.getDeviceDriver(); |
|
|
|
HailiangFlatDeviceDriver hailiangFlatDeviceDriver = deviceAppService.findDeviceDriver(HailiangFlatDeviceDriver.class).get(0); |
|
|
|
//Device device = deviceAppService.findDeviceByCode("PB01");
|
|
|
|
//HailiangFlatDeviceDriver hailiangFlatDeviceDriver;
|
|
|
|
//if (device.getDeviceDriver() instanceof HailiangFlatDeviceDriver){
|
|
|
|
// hailiangFlatDeviceDriver = (HailiangFlatDeviceDriver) device.getDeviceDriver();
|
|
|
|
if (type.equals("1")){ |
|
|
|
hailiangFlatDeviceDriver.writing(name,value); |
|
|
|
}else if (type.equals("2")){ |
|
|
@ -428,7 +429,7 @@ public class HandServiceImpl implements HandService { |
|
|
|
} else { |
|
|
|
hailiangFlatDeviceDriver.writing(name,value); |
|
|
|
} |
|
|
|
} |
|
|
|
// }
|
|
|
|
// 返回
|
|
|
|
resultJSON.put("code", "1"); |
|
|
|
resultJSON.put("desc", "下发成功"); |
|
|
@ -437,11 +438,12 @@ public class HandServiceImpl implements HandService { |
|
|
|
|
|
|
|
@Override |
|
|
|
public JSONObject queryDeviceInfo() { |
|
|
|
Device device = deviceAppService.findDeviceByCode("PB01"); |
|
|
|
HailiangFlatDeviceDriver hailiangFlatDeviceDriver = deviceAppService.findDeviceDriver(HailiangFlatDeviceDriver.class).get(0); |
|
|
|
//Device device = deviceAppService.findDeviceByCode("PB01");
|
|
|
|
JSONObject resp = new JSONObject(); |
|
|
|
HailiangFlatDeviceDriver hailiangFlatDeviceDriver; |
|
|
|
if (device.getDeviceDriver() instanceof HailiangFlatDeviceDriver){ |
|
|
|
hailiangFlatDeviceDriver = (HailiangFlatDeviceDriver) device.getDeviceDriver(); |
|
|
|
//HailiangFlatDeviceDriver hailiangFlatDeviceDriver;
|
|
|
|
//if (device.getDeviceDriver() instanceof HailiangFlatDeviceDriver){
|
|
|
|
// hailiangFlatDeviceDriver = (HailiangFlatDeviceDriver) device.getDeviceDriver();
|
|
|
|
int is_auto = hailiangFlatDeviceDriver.getIs_auto(); |
|
|
|
int is_running = hailiangFlatDeviceDriver.getIs_running(); |
|
|
|
int mode = hailiangFlatDeviceDriver.getMode(); |
|
|
@ -595,9 +597,9 @@ public class HandServiceImpl implements HandService { |
|
|
|
result.put("error_clear",error_clear); |
|
|
|
resp.put("result",result); |
|
|
|
return resp; |
|
|
|
} |
|
|
|
resp.put("code","0"); |
|
|
|
resp.put("desc","查询失败"); |
|
|
|
return resp; |
|
|
|
// }
|
|
|
|
// resp.put("code","0");
|
|
|
|
// resp.put("desc","查询失败");
|
|
|
|
// return resp;
|
|
|
|
} |
|
|
|
} |
|
|
|