|
|
@ -192,6 +192,7 @@ public class DcDeviceController extends BaseController { |
|
|
|
|
|
|
|
/** |
|
|
|
* 导出 |
|
|
|
* |
|
|
|
* @param response 响应 |
|
|
|
* @param iotDevice 导入数据结果 |
|
|
|
*/ |
|
|
@ -591,8 +592,8 @@ public class DcDeviceController extends BaseController { |
|
|
|
resultArray.add(getAjaxResult(deviceId, functionId, (HashMap<String, Object>) param)); |
|
|
|
} |
|
|
|
HashMap<String, Object> hashMap = new HashMap<>(); |
|
|
|
hashMap.put("SET", UniversalEnum.SEVEN.getValue()); |
|
|
|
getAjaxResult(deviceId, "SETMD", hashMap); |
|
|
|
hashMap.put(UniversalEnum.SET.getValue(), UniversalEnum.SEVEN.getValue()); |
|
|
|
getAjaxResult(deviceId, UniversalEnum.SETMD.getValue(), hashMap); |
|
|
|
return AjaxResult.success(resultArray); |
|
|
|
} |
|
|
|
|
|
|
@ -648,7 +649,7 @@ public class DcDeviceController extends BaseController { |
|
|
|
if (!StringUtils.hasText(deviceId) || !StringUtils.hasText(type)) { |
|
|
|
return AjaxResult.error(UniversalEnum.DEVICE_NOT_CONNECTED.getValue()); |
|
|
|
} |
|
|
|
if (type.equals(UniversalEnum.ALL.getValue())){ |
|
|
|
if (type.equals(UniversalEnum.ALL.getValue())) { |
|
|
|
|
|
|
|
OkHttp okHttp = new OkHttp(); |
|
|
|
|
|
|
@ -656,11 +657,11 @@ public class DcDeviceController extends BaseController { |
|
|
|
|
|
|
|
Response response // 请求响应
|
|
|
|
= okHttp |
|
|
|
.url(iotAddress + UniversalEnum.QUERY_EVENT_DATA_OF_IOT_DEVICES.getValue()+deviceId) // 请求地址
|
|
|
|
.url(iotAddress + UniversalEnum.QUERY_EVENT_DATA_OF_IOT_DEVICES.getValue() + deviceId) // 请求地址
|
|
|
|
.data(requestParams) |
|
|
|
.get(); // 请求方法
|
|
|
|
return JSON.parseObject(response.body().string(), AjaxResult.class); |
|
|
|
}else { |
|
|
|
} else { |
|
|
|
return queryPagerDeviceEvents(deviceId, type, queryParam); |
|
|
|
} |
|
|
|
} |
|
|
@ -678,27 +679,25 @@ public class DcDeviceController extends BaseController { |
|
|
|
OkHttp okHttp = new OkHttp(); |
|
|
|
Response response // 请求响应
|
|
|
|
= okHttp |
|
|
|
.url(iotAddress + UniversalEnum.GET_A_PHYSICAL_MODEL_OF_AN_IOT_DEVICE.getValue()+ id) // 请求地址
|
|
|
|
.url(iotAddress + UniversalEnum.GET_A_PHYSICAL_MODEL_OF_AN_IOT_DEVICE.getValue() + id) // 请求地址
|
|
|
|
.get(); // 请求方法
|
|
|
|
return JSON.parseObject(response.body().string(), AjaxResult.class); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* @Description 查询上游10公里内的情报板 |
|
|
|
* |
|
|
|
* @author liuwenge |
|
|
|
* @date 2024/4/15 14:22 |
|
|
|
* @param stakeMark |
|
|
|
* @param direction |
|
|
|
* @return com.ruoyi.common.core.domain.AjaxResult |
|
|
|
* @Description 查询上游10公里内的情报板 |
|
|
|
* @author liuwenge |
|
|
|
* @date 2024/4/15 14:22 |
|
|
|
*/ |
|
|
|
@ApiOperation("查询上游10公里内的情报板") |
|
|
|
@PostMapping("/selectNearBoard") |
|
|
|
public AjaxResult selectNearBoard(@ApiParam(value="桩号", name="stakeMark", required=true) @RequestParam ("stakeMark") String stakeMark, |
|
|
|
@ApiParam(value="方向", name="direction", required=true) @RequestParam ("direction") String direction){ |
|
|
|
return dcDeviceService.selectNearBoard(stakeMark,direction); |
|
|
|
public AjaxResult selectNearBoard(@ApiParam(value = "桩号", name = "stakeMark", required = true) @RequestParam("stakeMark") String stakeMark, |
|
|
|
@ApiParam(value = "方向", name = "direction", required = true) @RequestParam("direction") String direction) { |
|
|
|
return dcDeviceService.selectNearBoard(stakeMark, direction); |
|
|
|
} |
|
|
|
|
|
|
|
@OperationLog(operUrl = "/business/device/batchFunctions") |
|
|
@ -710,6 +709,7 @@ public class DcDeviceController extends BaseController { |
|
|
|
|
|
|
|
/** |
|
|
|
* 分页查询设备名称列表 |
|
|
|
* |
|
|
|
* @param dcDevice 请求参数 |
|
|
|
* @return 分页查询结果 |
|
|
|
*/ |
|
|
@ -718,10 +718,12 @@ public class DcDeviceController extends BaseController { |
|
|
|
startPage(); |
|
|
|
return getDataTable(dcDeviceService.selectDeviceNameList(dcDevice)); |
|
|
|
} |
|
|
|
|
|
|
|
@GetMapping("/deviceParameter") |
|
|
|
public AjaxResult selectDeviceParameterProperties(DcDevice dcDevice) { |
|
|
|
return AjaxResult.success(dcDeviceService.selectDeviceParameterProperties(dcDevice)); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 查询设备指定属性属性列表 |
|
|
|
* param参数 |
|
|
@ -730,13 +732,14 @@ public class DcDeviceController extends BaseController { |
|
|
|
* propertyName 属性名称 |
|
|
|
* deviceType 设备类型 |
|
|
|
* dateTime 时间 |
|
|
|
* |
|
|
|
* @return 属性列表 |
|
|
|
*/ |
|
|
|
@PostMapping("/properties/deviceNameData") |
|
|
|
public AjaxResult queryDevice(@RequestBody HashMap map) throws HttpException, IOException { |
|
|
|
if (map==null||!map.containsKey("deviceId")||!map.containsKey("deviceType") |
|
|
|
||!map.containsKey("propertyName")||!map.containsKey("propertyId") |
|
|
|
||!map.containsKey("dateTime")){ |
|
|
|
if (map == null || !map.containsKey("deviceId") || !map.containsKey("deviceType") |
|
|
|
|| !map.containsKey("propertyName") || !map.containsKey("propertyId") |
|
|
|
|| !map.containsKey("dateTime")) { |
|
|
|
return AjaxResult.error(UniversalEnum.PARAMETER_ERROR.getValue()); |
|
|
|
} |
|
|
|
String deviceType = map.get("deviceType").toString();//设备类型
|
|
|
@ -763,7 +766,7 @@ public class DcDeviceController extends BaseController { |
|
|
|
props.put("sorts[0].name", "timestamp"); |
|
|
|
AjaxResult ajaxResult = queryDeviceProperties(deviceId, propertyId, props); |
|
|
|
String code = ajaxResult.get("code").toString(); |
|
|
|
if ("500".equals(code)){ |
|
|
|
if (UniversalEnum.FIVE_HUNDRED.getValue().equals(code)) { |
|
|
|
return ajaxResult; |
|
|
|
} |
|
|
|
if (UniversalEnum.THIRTEEN.getValue().equals(deviceType) || UniversalEnum.SIXTEEN.getValue().equals(deviceType)) { //判断是否为设备箱/远端机
|
|
|
@ -813,6 +816,7 @@ public class DcDeviceController extends BaseController { |
|
|
|
} |
|
|
|
return null; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 设备箱-设备操作口令校验 |
|
|
|
*/ |
|
|
@ -911,4 +915,22 @@ public class DcDeviceController extends BaseController { |
|
|
|
return AjaxResult.success(resultsMapValue); |
|
|
|
} |
|
|
|
|
|
|
|
///***
|
|
|
|
// * 合流区预警设备设备电量不足警告
|
|
|
|
// */
|
|
|
|
//@Scheduled(cron = "0 0/1 * * * ?")
|
|
|
|
//public void ConfluenceAreaEarlyWarningDeviceBatteryLowWarning() throws HttpException, IOException {
|
|
|
|
// DcDevice dcDevice = new DcDevice();
|
|
|
|
// dcDevice.setDeviceType("8");
|
|
|
|
// List<DcDevice> devices = dcDeviceService.listDevice(dcDevice);
|
|
|
|
// for (DcDevice device : devices) {
|
|
|
|
// String iotDeviceId = device.getIotDeviceId();
|
|
|
|
// if (iotDeviceId != null && !iotDeviceId.equals("")) {
|
|
|
|
// AjaxResult deviceLatestProperty = queryDeviceProperties(iotDeviceId, "batteryCapacity",new HashMap<>());
|
|
|
|
// System.out.println(deviceLatestProperty.get("code"));
|
|
|
|
// System.out.println(deviceLatestProperty.get("msg"));
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
//}
|
|
|
|
|
|
|
|
} |
|
|
|