sgj
2026-03-09 c9a45ec5524b67a1236fc9d944f602c820f27069
fzzy-igdss-core/src/main/java/com/fzzy/igds/service/DepotService.java
@@ -250,13 +250,15 @@
            companyId = ContextUtil.getCompanyId();
        }
        List<Depot> list = new ArrayList<>();
        List<Depot> resultList = new ArrayList<>();
        String patten = RedisConst.buildKey(companyId, RedisConst.KEY_DEPOT) + "*";
        Collection<String> keys = redisCache.keys(patten);
        if (null != keys) {
            for (String key : keys) {
                if(null == redisCache.getCacheObject(key)){
                    list = new ArrayList<>();
                    break;
                }
                list.add((Depot) redisCache.getCacheObject(key));
            }
        }
@@ -267,27 +269,16 @@
            setCacheDepotList(list, companyId);
        }
        if (!list.isEmpty()) {
            //重新排序
            //检查数据是否为空
            for (Depot depot : list) {
                if( null!=depot){
                    resultList.add(depot);
                }
            }
            boolean hasNullOrderNum = true;
            // 检查是否有仓库的排序号为空
            for (Depot depot : resultList) {
            for (Depot depot : list) {
                if ( null== depot.getOrderNum()) {
                    hasNullOrderNum = true;
                    break;
                    //排序号为空,则默认给1
                    depot.setOrderNum(1);
                }
            }
            // 如果存在排序号为空的仓库,则不进行排序
            if (!hasNullOrderNum) {
                Collections.sort(resultList, (p1, p2) -> p1.getOrderNum() - p2.getOrderNum());
            Collections.sort(list, (p1, p2) -> p1.getOrderNum() - p2.getOrderNum());
            }
        }
        return resultList;
        return list;
    }
    /**
@@ -302,8 +293,6 @@
            return null;
        }
        List<Depot> list = getCacheDepotList(companyId);
        List<Depot> resultList = new ArrayList<>();
        if (null == list || list.isEmpty()) {
            return null;
        }
@@ -313,28 +302,11 @@
                result.add(depot);
            }
        }
        if (!list.isEmpty()) {
        if (!result.isEmpty()) {
            //重新排序
            //检查数据是否为空
            for (Depot depot : list) {
                if( null!=depot){
                    resultList.add(depot);
            Collections.sort(list, (p1, p2) -> p1.getOrderNum() - p2.getOrderNum());
                }
            }
            boolean hasNullOrderNum = true;
            // 检查是否有仓库的排序号为空
            for (Depot depot : resultList) {
                if ( null== depot.getOrderNum()) {
                    hasNullOrderNum = true;
                    break;
                }
            }
            // 如果存在排序号为空的仓库,则不进行排序
            if (!hasNullOrderNum) {
                Collections.sort(resultList, (p1, p2) -> p1.getOrderNum() - p2.getOrderNum());
            }
        }
        return resultList;
        return result;
    }
    /**