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 @@