|
@ -1535,7 +1535,43 @@ private VideoController videoController; |
|
|
jsonObject.put("functions", functions); |
|
|
jsonObject.put("functions", functions); |
|
|
return batchInvokedFunction2(jsonObject); |
|
|
return batchInvokedFunction2(jsonObject); |
|
|
} |
|
|
} |
|
|
|
|
|
//一体机柜空调定时调用,采数据
|
|
|
|
|
|
//@PostMapping("/integratedCabinetAir2")
|
|
|
|
|
|
@Scheduled(cron = "0 7 * * * *") |
|
|
|
|
|
public AjaxResult airConditioning() throws InterruptedException, IOException, HttpException { |
|
|
|
|
|
DcDevice dcDevice = new DcDevice(); |
|
|
|
|
|
dcDevice.setDeviceType(UniversalEnum.EIGHTEEN.getValue()); |
|
|
|
|
|
dcDevice.setDeviceState(UniversalEnum.ONE.getValue()); |
|
|
|
|
|
IDcDeviceService dcDeviceService = SpringUtils.getBean(IDcDeviceService.class); |
|
|
|
|
|
List<DcDevice> dcDeviceList = dcDeviceService.listDevice(dcDevice); |
|
|
|
|
|
ArrayList devices = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
|
|
for (DcDevice device : dcDeviceList) { |
|
|
|
|
|
String iotDeviceId = device.getIotDeviceId(); |
|
|
|
|
|
if (iotDeviceId != null && !iotDeviceId.equals(UniversalEnum.EMPTY_STRING.getValue())) { |
|
|
|
|
|
JSONObject jsonObject = new JSONObject(); |
|
|
|
|
|
jsonObject.put("id", device.getId()); |
|
|
|
|
|
jsonObject.put("iotDeviceId", device.getIotDeviceId()); |
|
|
|
|
|
jsonObject.put("deviceType", device.getDeviceType()); |
|
|
|
|
|
devices.add(jsonObject); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
ArrayList functions = new ArrayList(); |
|
|
|
|
|
for (int i = UniversalEnum.ONE.getNumber(); i <= UniversalEnum.THREE.getNumber(); i++) { |
|
|
|
|
|
JSONObject function = new JSONObject(); |
|
|
|
|
|
if (i == 2) { |
|
|
|
|
|
continue; |
|
|
|
|
|
} |
|
|
|
|
|
String valueOf = String.valueOf(i); |
|
|
|
|
|
function.put("functionId", "0" + valueOf); |
|
|
|
|
|
function.put("params", new JSONObject()); |
|
|
|
|
|
functions.add(function); |
|
|
|
|
|
} |
|
|
|
|
|
JSONObject jsonObject = new JSONObject(); |
|
|
|
|
|
jsonObject.put("devices", devices); |
|
|
|
|
|
jsonObject.put("functions", functions); |
|
|
|
|
|
return batchInvokedFunction2(jsonObject); |
|
|
|
|
|
} |
|
|
public AjaxResult batchInvokedFunction2(@RequestBody Map<String, Object> props) throws HttpException, IOException, InterruptedException { |
|
|
public AjaxResult batchInvokedFunction2(@RequestBody Map<String, Object> props) throws HttpException, IOException, InterruptedException { |
|
|
ArrayList<JSONObject> devices = (ArrayList<JSONObject>) props.get("devices"); |
|
|
ArrayList<JSONObject> devices = (ArrayList<JSONObject>) props.get("devices"); |
|
|
ArrayList<JSONObject> functions = (ArrayList<JSONObject>) props.get("functions"); |
|
|
ArrayList<JSONObject> functions = (ArrayList<JSONObject>) props.get("functions"); |
|
|