sgj
2026-03-06 e05c88cc87a122a7877085234bfe55617886802c
fzzy-igdss-core/src/main/java/com/fzzy/igds/service/DepotService.java
@@ -249,6 +249,8 @@
            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);
@@ -265,9 +267,26 @@
        }
        if (!list.isEmpty()) {
            //重新排序
            Collections.sort(list, (p1, p2) -> p1.getOrderNum() - p2.getOrderNum());
            //检查数据是否为空
            for (Depot depot : list) {
                if( null!=depot){
                    resultList.add(depot);
                }
            }
            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 list;
        return resultList;
    }
    /**