From c3c7f534d532e63eeb2f68ff926141d07c4290c2 Mon Sep 17 00:00:00 2001 From: wenjy Date: Tue, 26 Apr 2022 21:29:31 +0800 Subject: [PATCH] =?UTF-8?q?change=20-=20=E7=9B=91=E6=8E=A7=E5=8D=95?= =?UTF-8?q?=E5=85=83=E7=B1=BB=E5=9E=8B=E4=B8=AD=E7=9A=84=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=EF=BC=8C=E7=B1=BB=E5=9E=8B=E7=BC=96=E5=8F=B7?= =?UTF-8?q?=E6=98=AF=E5=8F=AF=E4=BB=A5=E9=87=8D=E5=A4=8D=E7=9A=84=E3=80=82?= =?UTF-8?q?=E6=94=B9=E8=BF=9B-=E5=87=BA=E7=8E=B0=E9=87=8D=E5=A4=8D?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E4=B8=8D=E8=83=BD=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../base/BaseMonitorunitTypeController.java | 13 ++++++++++ .../base/BaseSubstationInfoController.java | 7 ++++++ .../templates/base/monitorUnitType/add.html | 25 ++++++++++++++++++- .../templates/base/monitorUnitType/edit.html | 2 +- 4 files changed, 45 insertions(+), 2 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/base/BaseMonitorunitTypeController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/base/BaseMonitorunitTypeController.java index ba8ca46..e48d2cf 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/base/BaseMonitorunitTypeController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/base/BaseMonitorunitTypeController.java @@ -4,10 +4,13 @@ import java.util.ArrayList; import java.util.Date; import java.util.List; +import com.ruoyi.common.constant.UserConstants; import com.ruoyi.common.core.domain.Ztree; import com.ruoyi.common.utils.ShiroUtils; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.system.domain.BaseMonitorunitInfo; +import com.ruoyi.system.domain.BaseSensorInfo; +import com.ruoyi.system.domain.dto.BaseSensorInfoDto; import com.ruoyi.system.service.IBaseMonitorunitInfoService; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; @@ -182,4 +185,14 @@ public class BaseMonitorunitTypeController extends BaseController { } return ztrees; } + + @PostMapping("/checkUnitTypeIdUnique") + @ResponseBody + public String checkMonitorUnitTypeIdUnique(BaseMonitorunitType baseMonitorunitType){ + List baseMonitorunitTypes = baseMonitorunitTypeService.selectBaseMonitorunitTypeList(baseMonitorunitType); + if(baseMonitorunitTypes.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 e675668..5c1d9d9 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 @@ -113,6 +113,13 @@ public class BaseSubstationInfoController extends BaseController { return toAjax(baseSubstationInfoService.deleteBaseSubstationInfoByObjIds(ids)); } + /** + * 变电站编号校验 + * @author WenJY + * @date 2022/4/26 21:19 + * @param baseSubstationInfo + * @return java.lang.String + */ @PostMapping("/checkSubstationIdIdUnique") @ResponseBody public String checkSubstationIdIdUnique(BaseSubstationInfo baseSubstationInfo){ diff --git a/ruoyi-admin/src/main/resources/templates/base/monitorUnitType/add.html b/ruoyi-admin/src/main/resources/templates/base/monitorUnitType/add.html index f0f5e7f..d1544b0 100644 --- a/ruoyi-admin/src/main/resources/templates/base/monitorUnitType/add.html +++ b/ruoyi-admin/src/main/resources/templates/base/monitorUnitType/add.html @@ -9,7 +9,7 @@
- +
@@ -32,6 +32,29 @@