diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/base/BaseSensorInfoController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/base/BaseSensorInfoController.java index f99f2a9..07bbfd6 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/base/BaseSensorInfoController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/base/BaseSensorInfoController.java @@ -191,6 +191,11 @@ public class BaseSensorInfoController extends BaseController { baseAlarmInfo.setAlarmtypeId(baseSensorInfo.getParamCode()[i]); baseAlarmInfo.setMaxValue(baseSensorInfo.getMaxValue()[i]); baseAlarmInfo.setMinValue(baseSensorInfo.getMinValue()[i]); + int flag = baseSensorInfo.getMinValue()[i].compareTo(baseSensorInfo.getMaxValue()[i]); + if(flag == 1){ + return AjaxResult.error("添加失败:阈值中最大值小于最小值"); + } + baseAlarmInfo.setEnableFlag(baseSensorInfo.getEnableFlag()); List baseAlarmInfoDtos = baseAlarmInfoService.selectBaseAlarmInfoList(baseAlarmInfo);