From 989526bc26e7514afd71a33c31b0be97901dd24c Mon Sep 17 00:00:00 2001 From: dxfeng Date: Fri, 2 Sep 2022 17:31:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=BF=E7=94=A8=E7=8A=B6=E6=80=81BUG?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../organization/util/RefreshIsUsedUtil.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/com/engine/organization/util/RefreshIsUsedUtil.java b/src/com/engine/organization/util/RefreshIsUsedUtil.java index 74bfdc56..7786d2be 100644 --- a/src/com/engine/organization/util/RefreshIsUsedUtil.java +++ b/src/com/engine/organization/util/RefreshIsUsedUtil.java @@ -10,6 +10,7 @@ import com.engine.organization.mapper.staff.StaffMapper; import com.engine.organization.mapper.staff.StaffPlanMapper; import com.engine.organization.util.db.MapperProxyFactory; import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang.StringUtils; import java.util.Arrays; import java.util.List; @@ -47,7 +48,7 @@ public class RefreshIsUsedUtil { */ public static void RefreshLevel(String tableName) { List usedIds = MapperProxyFactory.getProxy(LevelMapper.class).listUsedId(); - usedIds.removeIf(Objects::isNull); + usedIds.removeIf(StringUtils::isBlank); RefreshIsUsedStatus(tableName, usedIds); } @@ -58,7 +59,8 @@ public class RefreshIsUsedUtil { */ public static void RefreshGrade(String tableName) { List usedIds = MapperProxyFactory.getProxy(GradeMapper.class).listUsedId(); - usedIds.removeIf(Objects::isNull); + //usedIds.forEach(System.out ::println); + usedIds.removeIf(StringUtils::isBlank); RefreshIsUsedStatus(tableName, usedIds); } @@ -69,7 +71,7 @@ public class RefreshIsUsedUtil { */ public static void RefreshSequence(String tableName) { List usedIds = MapperProxyFactory.getProxy(SequenceMapper.class).listUsedId(); - usedIds.removeIf(Objects::isNull); + usedIds.removeIf(StringUtils::isBlank); RefreshIsUsedStatus(tableName, usedIds); } @@ -80,7 +82,7 @@ public class RefreshIsUsedUtil { */ public static void RefreshStaffPlan(String tableName) { List usedIds = MapperProxyFactory.getProxy(StaffPlanMapper.class).listUsedId(); - usedIds.removeIf(Objects::isNull); + usedIds.removeIf(StringUtils::isBlank); RefreshIsUsedStatus(tableName, usedIds); } @@ -91,7 +93,7 @@ public class RefreshIsUsedUtil { */ public static void RefreshStaff(String tableName) { List usedIds = MapperProxyFactory.getProxy(StaffMapper.class).listUsedId(); - usedIds.removeIf(Objects::isNull); + usedIds.removeIf(StringUtils::isBlank); RefreshIsUsedStatus(tableName, usedIds); } @@ -103,7 +105,7 @@ public class RefreshIsUsedUtil { */ public static void RefreshPostInfo(String tableName) { List usedIds = MapperProxyFactory.getProxy(PostInfoMapper.class).listUsedId(); - usedIds.removeIf(Objects::isNull); + usedIds.removeIf(StringUtils::isBlank); RefreshIsUsedStatus(tableName, usedIds); } @@ -118,7 +120,7 @@ public class RefreshIsUsedUtil { List collect = Arrays.stream(String.join(",", usedIds).split(",")).collect(Collectors.toList()); getRefreshUseMapper().updateIsUsedByIds(tableName, collect, 0); getRefreshUseMapper().updateIsUsedByIds(tableName, collect, 1); - }else{ + } else { getRefreshUseMapper().initIsUseStatus(tableName); } }