|
@@ -1114,45 +1114,36 @@ public class BaseCameraManagementController extends BaseController {
|
|
@GetMapping("/getMalfunctionAndLowCameraManagement")
|
|
@GetMapping("/getMalfunctionAndLowCameraManagement")
|
|
public AjaxResult getMalfunctionAndLowCameraManagement() {
|
|
public AjaxResult getMalfunctionAndLowCameraManagement() {
|
|
HashMap<String, Integer> map = new HashMap<>();
|
|
HashMap<String, Integer> map = new HashMap<>();
|
|
- LambdaQueryWrapper<BaseDeviceDynamicManagement> wrapper = new LambdaQueryWrapper<>();
|
|
|
|
- wrapper.eq(BaseDeviceDynamicManagement::getIsDisable, 2);
|
|
|
|
- List<BaseDeviceDynamicManagement> isDisable = baseDeviceDynamicManagementService.list(wrapper);
|
|
|
|
- List<BaseDeviceDynamicManagement> collect = isDisable.stream().filter(f -> f.getFacilityState()==2).collect(Collectors.toList());
|
|
|
|
- map.put("isDisable", collect.size());
|
|
|
|
|
|
+ DeviceStateResp deviceStateResp1 = new DeviceStateResp();
|
|
|
|
+ DeviceStateResp deviceStateResp = (DeviceStateResp) dataScoreUtil.setDataScore(getUserId(),deviceStateResp1);
|
|
|
|
+ List<DeviceStateResp> deviceStateRespList = baseCameraManagementService.deviceStateRespList(deviceStateResp);
|
|
|
|
+ List<DeviceStateResp> isDisable = deviceStateRespList.stream().filter(f -> f.getIsDisable().equals("2")).collect(Collectors.toList());
|
|
|
|
+ map.put("isDisable", isDisable.size());
|
|
LambdaQueryWrapper<BaseDeviceDynamicManagement> queryWrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<BaseDeviceDynamicManagement> queryWrapper = new LambdaQueryWrapper<>();
|
|
- queryWrapper.le(BaseDeviceDynamicManagement::getElectricity, 10);
|
|
|
|
- List<BaseDeviceDynamicManagement> electricity = baseDeviceDynamicManagementService.list(queryWrapper);
|
|
|
|
-
|
|
|
|
- List<BaseDeviceDynamicManagement> collect1 = electricity.stream().filter(f -> f.getElectricityState()==2).collect(Collectors.toList());
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- map.put("electricity", collect1.size());
|
|
|
|
|
|
+ List<DeviceStateResp> electricity = deviceStateRespList.stream().filter(f -> f.getElectricity()==10).collect(Collectors.toList());
|
|
|
|
+ map.put("electricity", electricity.size());
|
|
map.put("count", isDisable.size() + electricity.size());
|
|
map.put("count", isDisable.size() + electricity.size());
|
|
- map.put("readCount", collect.size()+collect1.size());
|
|
|
|
|
|
+ map.put("readCount", isDisable.size()+electricity.size());
|
|
return AjaxResult.success(map);
|
|
return AjaxResult.success(map);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
* 修改设备状态信息(1已读2未读)
|
|
* 修改设备状态信息(1已读2未读)
|
|
|
|
+ * 废弃
|
|
*/
|
|
*/
|
|
- @PostMapping("/updateState")
|
|
|
|
- public AjaxResult updateState(@RequestBody List<DeviceStateResp> deviceStateRespList) {
|
|
|
|
- List<String> list = deviceStateRespList.stream().map(DeviceStateResp::getCameraCode).collect(Collectors.toList());
|
|
|
|
- BaseDeviceDynamicManagement dynamicManagement = new BaseDeviceDynamicManagement();
|
|
|
|
- LambdaQueryWrapper<BaseDeviceDynamicManagement> wrapper = new LambdaQueryWrapper<BaseDeviceDynamicManagement>();
|
|
|
|
- wrapper.in(BaseDeviceDynamicManagement::getCameraCode, list);
|
|
|
|
- if (deviceStateRespList.get(0).getCategory()==1){
|
|
|
|
- dynamicManagement.setElectricityState(1);
|
|
|
|
- }else {
|
|
|
|
- dynamicManagement.setFacilityState(1);
|
|
|
|
- }
|
|
|
|
- boolean update = baseDeviceDynamicManagementService.update(dynamicManagement, wrapper);
|
|
|
|
- if (update) {
|
|
|
|
- return AjaxResult.success();
|
|
|
|
- } else {
|
|
|
|
- return AjaxResult.error();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+// @PostMapping("/updateState")
|
|
|
|
+// public AjaxResult updateState(@RequestBody List<DeviceStateResp> deviceStateRespList) {
|
|
|
|
+// List<String> list = deviceStateRespList.stream().map(DeviceStateResp::getCameraCode).collect(Collectors.toList());
|
|
|
|
+// BaseDeviceDynamicManagement dynamicManagement = new BaseDeviceDynamicManagement();
|
|
|
|
+// LambdaQueryWrapper<BaseDeviceDynamicManagement> wrapper = new LambdaQueryWrapper<BaseDeviceDynamicManagement>();
|
|
|
|
+// wrapper.in(BaseDeviceDynamicManagement::getCameraCode, list);
|
|
|
|
+// boolean update = baseDeviceDynamicManagementService.update(dynamicManagement, wrapper);
|
|
|
|
+// if (update) {
|
|
|
|
+// return AjaxResult.success();
|
|
|
|
+// } else {
|
|
|
|
+// return AjaxResult.error();
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1178,11 +1169,12 @@ public class BaseCameraManagementController extends BaseController {
|
|
|
|
|
|
/**
|
|
/**
|
|
* 批量修改相机已读未读状态
|
|
* 批量修改相机已读未读状态
|
|
|
|
+ * 废弃
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
- @GetMapping("updateStateAll/{state}")
|
|
|
|
- public AjaxResult updateStateAll(@PathVariable Integer state) {
|
|
|
|
- return baseCameraManagementService.updateStateAll(state);
|
|
|
|
- }
|
|
|
|
|
|
+// @GetMapping("updateStateAll/{state}")
|
|
|
|
+// public AjaxResult updateStateAll(@PathVariable Integer state) {
|
|
|
|
+// return baseCameraManagementService.updateStateAll(state);
|
|
|
|
+// }
|
|
}
|
|
}
|
|
|
|
|