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); } }