sgj
2026-03-12 533c9a4e44b06c90df7434a38e0da26e10cdac46
fzzy-igdss-core/src/main/java/com/fzzy/igds/service/DepotService.java
@@ -15,6 +15,7 @@
import javax.annotation.Resource;
import java.util.*;
import java.util.concurrent.TimeUnit;
/**
 * @Description
@@ -217,7 +218,7 @@
        String key;
        for (Depot depot : list) {
            key = RedisConst.buildKey(companyId, RedisConst.KEY_DEPOT, depot.getId());
            redisCache.setCacheObject(key, depot);
            redisCache.setCacheObject(key, depot, 24, TimeUnit.HOURS);
        }
    }
@@ -254,6 +255,10 @@
        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));
            }
        }
@@ -264,7 +269,13 @@
            setCacheDepotList(list, companyId);
        }
        if (!list.isEmpty()) {
            //重新排序
            // 检查是否有仓库的排序号为空
            for (Depot depot : list) {
                if (null == depot.getOrderNum()) {
                    //排序号为空,则默认给1
                    depot.setOrderNum(1);
                }
            }
            Collections.sort(list, (p1, p2) -> p1.getOrderNum() - p2.getOrderNum());
        }
        return list;