diff --git a/nxhs-service/src/main/java/cc/yunxi/controller/DeviceController.java b/nxhs-service/src/main/java/cc/yunxi/controller/DeviceController.java index 7d7aebe..d406c28 100644 --- a/nxhs-service/src/main/java/cc/yunxi/controller/DeviceController.java +++ b/nxhs-service/src/main/java/cc/yunxi/controller/DeviceController.java @@ -127,10 +127,11 @@ public class DeviceController { Integer fullSet = bucket.getFullSet(); Integer delay = bucket.getCloseDelay(); BigDecimal weight1 = bucket.getWarningWeight(); - if (smogSet < 0) _bucket.put("smogSet", Integer.valueOf(config.getSmogSet())); - if (fullSet < 0) _bucket.put("fullSet", Integer.valueOf(config.getFullSet())); - if (delay < 0) _bucket.put("closeDelay", config.getCloseDelay()); - if (weight1.compareTo(BigDecimal.ZERO) < 0) _bucket.put("warningWeight", config.getWarningWeight()); + if (null == smogSet || smogSet < 0) _bucket.put("smogSet", Integer.valueOf(config.getSmogSet())); + if (null == fullSet || fullSet < 0) _bucket.put("fullSet", Integer.valueOf(config.getFullSet())); + if (delay == null || delay < 0) _bucket.put("closeDelay", config.getCloseDelay()); + if (null == weight1 || weight1.compareTo(BigDecimal.ZERO) < 0) + _bucket.put("warningWeight", config.getWarningWeight()); /***********************************************************************/ list.add(_bucket); } @@ -141,7 +142,7 @@ public class DeviceController { //获取设备配置 @PostMapping("/conf") - @ApiOperation("小程序接口 设备配置") + @ApiOperation("设备柜接口 设备配置") public CommonResult conf(@RequestBody DeviceVO deviceVO) { CommonResult result = new CommonResult<>();