diff --git a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/history/ErrorUtil.java b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/history/ErrorUtil.java index 0590d17..2ea09db 100644 --- a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/history/ErrorUtil.java +++ b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/history/ErrorUtil.java @@ -50,8 +50,8 @@ public class ErrorUtil { if (ObjectUtil.isNotEmpty(dictDetailDtos)) { List dtos = dictDetailDtos .stream() - .filter(dictDetailDto -> !dictDetailDto.getValue().equals("0")) - .filter(dictDetailDto -> !dictDetailDto.getValue().equals("-1")) + .filter(dictDetailDto -> !"0".equals(dictDetailDto.getValue())) + .filter(dictDetailDto -> !"-1".equals(dictDetailDto.getValue())) .collect(Collectors.toList()); dtos.forEach(dictDetailDto -> map.put(Integer.parseInt(dictDetailDto.getValue()), dictDetailDto.getLabel())); } @@ -62,7 +62,6 @@ public class ErrorUtil { public static void getDict() { if (ObjectUtil.isEmpty(dictMap)) { ISysDictService dictDetailService = SpringContextHolder.getBean(SysDictServiceImpl.class); - //DictService dictService = SpringContextHolder.getBean(DictServiceImpl.class); List dictDtos = dictDetailService.queryAll(); for (int i = 0; i < dictDtos.size(); i++) { Dict dictDto = dictDtos.get(i); @@ -123,7 +122,7 @@ public class ErrorUtil { } } - Map map = new HashMap<>(); + Map map = new HashMap<>(2); map.put("code", replace(code)); map.put("info", replace(message)); return map; diff --git a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/history/rest/DeviceErrorLogController.java b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/history/rest/DeviceErrorLogController.java index 0b24d88..3310320 100644 --- a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/history/rest/DeviceErrorLogController.java +++ b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/history/rest/DeviceErrorLogController.java @@ -32,6 +32,12 @@ public class DeviceErrorLogController { private final DeviceErrorLogService acsDeviceErrorLogService; + /** + * + * @param whereJson + * @param page + * @return + */ @GetMapping @Log("查询设备报警记录") @ApiOperation("查询设备报警记录") @@ -40,6 +46,11 @@ public class DeviceErrorLogController { return new ResponseEntity<>(acsDeviceErrorLogService.queryAll(whereJson,page),HttpStatus.OK); } + /** + * + * @param dto + * @return + */ @PostMapping @Log("新增设备报警记录") @ApiOperation("新增设备报警记录") @@ -49,6 +60,11 @@ public class DeviceErrorLogController { return new ResponseEntity<>(HttpStatus.CREATED); } + /** + * + * @param dto + * @return + */ @PutMapping @Log("修改设备报警记录") @ApiOperation("修改设备报警记录") @@ -58,6 +74,11 @@ public class DeviceErrorLogController { return new ResponseEntity<>(HttpStatus.NO_CONTENT); } + /** + * + * @param ids + * @return + */ @Log("删除设备报警记录") @ApiOperation("删除设备报警记录") //@PreAuthorize("@el.check('acsDeviceErrorLog:del')") @@ -67,6 +88,12 @@ public class DeviceErrorLogController { return new ResponseEntity<>(HttpStatus.OK); } + /** + * + * @param response + * @param whereJson + * @throws IOException + */ @Log("导出设备报警记录") @ApiOperation("导出设备报警记录") @GetMapping(value = "/download") diff --git a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/history/service/impl/DeviceErrorLogServiceImpl.java b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/history/service/impl/DeviceErrorLogServiceImpl.java index d297a0b..c5e92df 100644 --- a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/history/service/impl/DeviceErrorLogServiceImpl.java +++ b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/history/service/impl/DeviceErrorLogServiceImpl.java @@ -48,6 +48,8 @@ public class DeviceErrorLogServiceImpl extends CommonServiceImpl queryAll(Map whereJson, Pageable page1) { LambdaQueryWrapper wrapper = getAcsDeviceErrorLogLambdaQueryWrapper(whereJson); @@ -55,7 +57,7 @@ public class DeviceErrorLogServiceImpl extends CommonServiceImpl acsDeviceErrorLogIPage = acsDeviceErrorLogMapper.selectPage(objectIPage, wrapper); List records = acsDeviceErrorLogIPage.getRecords(); long total = acsDeviceErrorLogIPage.getTotal(); - HashMap json = new HashMap<>(); + HashMap json = new HashMap<>(2); json.put("content", records); json.put("totalElements", total); return json; @@ -89,18 +91,12 @@ public class DeviceErrorLogServiceImpl extends CommonServiceImpl