From 7169f305d1b212fe9ceb8abb024a26fc2c70d6ff Mon Sep 17 00:00:00 2001 From: wenjy Date: Wed, 25 May 2022 20:53:00 +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=E6=B7=BB=E5=8A=A0=E6=98=AF=E7=BC=96?= =?UTF-8?q?=E5=8F=B7=E6=A0=A1=E9=AA=8C=E9=97=AE=E9=A2=98=EF=BC=8C=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E7=9B=91=E6=8E=A7=E5=8D=95=E5=85=83=E7=BC=96=E5=8F=B7?= =?UTF-8?q?=E6=97=B6=E4=B8=8D=E8=83=BD=E5=92=8C=E5=B7=B2=E6=9C=89=E7=BC=96?= =?UTF-8?q?=E5=8F=B7=E4=BB=BB=E6=84=8F=E5=AD=97=E7=AC=A6=E9=87=8D=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/controller/base/BaseMonitorunitTypeController.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 e48d2cf..a896964 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 @@ -3,6 +3,8 @@ package com.ruoyi.web.controller.base; import java.util.ArrayList; import java.util.Date; import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.Stream; import com.ruoyi.common.constant.UserConstants; import com.ruoyi.common.core.domain.Ztree; @@ -190,7 +192,8 @@ public class BaseMonitorunitTypeController extends BaseController { @ResponseBody public String checkMonitorUnitTypeIdUnique(BaseMonitorunitType baseMonitorunitType){ List baseMonitorunitTypes = baseMonitorunitTypeService.selectBaseMonitorunitTypeList(baseMonitorunitType); - if(baseMonitorunitTypes.size() > 0){ + List collect = baseMonitorunitTypes.stream().filter(x -> x.getMonitorunittypeId().equals(baseMonitorunitType.getMonitorunittypeId())).collect(Collectors.toList()); + if(collect.size() > 0){ return UserConstants.DEPT_NAME_NOT_UNIQUE; } return UserConstants.DEPT_NAME_UNIQUE;