From 10b8264fe5c3ce99219827bcd67ff7fdcadce3b4 Mon Sep 17 00:00:00 2001 From: wenjy Date: Tue, 26 Apr 2022 21:19:10 +0800 Subject: [PATCH] =?UTF-8?q?change=20-=20=E4=BC=A0=E6=84=9F=E5=99=A8?= =?UTF-8?q?=E6=8A=A5=E8=AD=A6=E7=B1=BB=E5=9E=8B=E5=92=8C=E5=8F=98=E7=94=B5?= =?UTF-8?q?=E7=AB=99=E4=BF=A1=E6=81=AF=E4=B8=AD=E5=87=BA=E7=8E=B0=E5=90=8C?= =?UTF-8?q?=E6=A0=B7=E7=9A=84=E7=B1=BB=E5=9E=8B=E7=BC=96=E5=8F=B7=EF=BC=8C?= =?UTF-8?q?=E7=BC=96=E5=8F=B7=E7=B1=BB=E5=9E=8B=E6=B7=BB=E5=8A=A0=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E6=A0=A1=E9=AA=8C=E6=98=AF=E5=90=A6=E9=87=8D=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../base/BaseAlarmTypeController.java | 21 +++++++++++++++++ .../base/BaseSubstationInfoController.java | 13 +++++++++++ .../templates/base/alarmType/add.html | 23 +++++++++++++++++++ .../templates/base/alarmType/edit.html | 2 +- .../templates/base/stationInfo/add.html | 23 +++++++++++++++++++ .../templates/base/stationInfo/edit.html | 2 +- 6 files changed, 82 insertions(+), 2 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/base/BaseAlarmTypeController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/base/BaseAlarmTypeController.java index edaf5c3..413b593 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/base/BaseAlarmTypeController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/base/BaseAlarmTypeController.java @@ -3,7 +3,10 @@ package com.ruoyi.web.controller.base; import java.util.Date; import java.util.List; +import com.ruoyi.common.constant.UserConstants; import com.ruoyi.common.utils.ShiroUtils; +import com.ruoyi.system.domain.BaseSensorInfo; +import com.ruoyi.system.domain.dto.BaseSensorInfoDto; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; @@ -165,4 +168,22 @@ public class BaseAlarmTypeController extends BaseController List ztrees = baseAlarmTypeService.selectBaseAlarmTypeTree(); return ztrees; } + + /** + * 告警类型编号校验 + * @author WenJY + * @date 2022/4/26 21:05 + * @param baseAlarmType + * @return java.lang.String + */ + @PostMapping("/checkAlarmTypeIdUnique") + @ResponseBody + public String checkAlarmTypeIdUnique(BaseAlarmType baseAlarmType){ + List baseAlarmTypes = baseAlarmTypeService.selectBaseAlarmTypeList(baseAlarmType); + + if(baseAlarmTypes.size() > 0){ + return UserConstants.DEPT_NAME_NOT_UNIQUE; + } + return UserConstants.DEPT_NAME_UNIQUE; + } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/base/BaseSubstationInfoController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/base/BaseSubstationInfoController.java index 9043c14..e675668 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/base/BaseSubstationInfoController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/base/BaseSubstationInfoController.java @@ -3,7 +3,9 @@ package com.ruoyi.web.controller.base; import java.util.Date; import java.util.List; +import com.ruoyi.common.constant.UserConstants; import com.ruoyi.common.utils.ShiroUtils; +import com.ruoyi.system.domain.BaseAlarmType; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; @@ -110,4 +112,15 @@ public class BaseSubstationInfoController extends BaseController { public AjaxResult remove(String ids) { return toAjax(baseSubstationInfoService.deleteBaseSubstationInfoByObjIds(ids)); } + + @PostMapping("/checkSubstationIdIdUnique") + @ResponseBody + public String checkSubstationIdIdUnique(BaseSubstationInfo baseSubstationInfo){ + List baseSubstationInfos = baseSubstationInfoService.selectBaseSubstationInfoList(baseSubstationInfo); + + if(baseSubstationInfos.size() > 0){ + return UserConstants.DEPT_NAME_NOT_UNIQUE; + } + return UserConstants.DEPT_NAME_UNIQUE; + } } diff --git a/ruoyi-admin/src/main/resources/templates/base/alarmType/add.html b/ruoyi-admin/src/main/resources/templates/base/alarmType/add.html index 2042966..40d21c7 100644 --- a/ruoyi-admin/src/main/resources/templates/base/alarmType/add.html +++ b/ruoyi-admin/src/main/resources/templates/base/alarmType/add.html @@ -42,6 +42,29 @@