YYC
2023-06-21 e17db1a57b9788ab16c805e44b54a0324fea7da0
igds-core/src/main/java/com/ld/igds/common/manager/CommonManager.java
@@ -11,6 +11,7 @@
import com.ld.igds.data.BaseParam;
import com.ld.igds.data.Page;
import com.ld.igds.data.PageResponse;
import com.ld.igds.data.SimpleDepot;
import com.ld.igds.grain.dto.GrainData;
import com.ld.igds.grain.service.CoreGrainService;
import com.ld.igds.inout.dto.InoutParam;
@@ -64,24 +65,45 @@
    private RedisUtil redisUtil;
    /**
     * 获取入库的下拉框
     * 获取入库作业中,仓库下拉框,值获取状态=非满仓的粮库
     *
     * @return
     */
    public List<Depot> listInDepot() {
        List<Depot> list = listDepot(true);
        return list;
    public List<SimpleDepot> getCacheDeptIn(String companyId, String deptId) {
        List<SimpleDepot> result = new ArrayList<>();
        List<Depot> list = coreCommonService.getCacheDepotList(companyId, deptId);
        for (Depot depot : list) {
            if (DepotStatus.STATUS_3.getCode().equals(depot.getDepotStatus())) continue;
            if (DepotStatus.STATUS_31.getCode().equals(depot.getDepotStatus())) continue;
            if (DepotStatus.STATUS_32.getCode().equals(depot.getDepotStatus())) continue;
            if (DepotStatus.STATUS_33.getCode().equals(depot.getDepotStatus())) continue;
            if (DepotStatus.STATUS_34.getCode().equals(depot.getDepotStatus())) continue;
            result.add(new SimpleDepot(depot));
        }
        return result;
    }
    /**
     * 获取出库的下拉框
     * 获取出库下拉框列表,自动屏蔽空仓
     *
     * @return
     */
    public List<Depot> listOutDepot() {
        List<Depot> list = listDepot(true);
    public List<SimpleDepot> getCacheDeptOut(String companyId, String deptId) {
        List<SimpleDepot> result = new ArrayList<>();
        List<Depot> list = coreCommonService.getCacheDepotList(companyId, deptId);
        return list;
        for (Depot depot : list) {
            if (DepotStatus.STATUS_1.getCode().equals(depot.getDepotStatus())) continue;
            if (DepotStatus.STATUS_2.getCode().equals(depot.getDepotStatus())) continue;
            result.add(new SimpleDepot(depot));
        }
        return result;
    }
    /**
@@ -117,38 +139,12 @@
    /**
     * 查询部门下属所有仓库列表
     *
     * @param isDelOther
     * @param companyId
     * @param deptId
     * @return
     */
    public List<Depot> listDepotByDeptId(boolean isDelOther, String deptId) {
        String companyId = ContextUtil.getCompanyId();
        if (StringUtils.isEmpty(deptId)) {
            return null;
        }
        List<Depot> list = coreCommonService.getCacheDepotList(companyId);
        if (null == list || list.isEmpty()) {
            return list;
        }
        List<Depot> listDepot = new ArrayList<>();
        for (Depot depot : list) {
            if (depot.getDeptId().contains(deptId)) {
                listDepot.add(depot);
            }
        }
        // 删除非仓库列表
        if (isDelOther) {
            return listDepot
                    .stream()
                    .filter(item -> !item.getDepotType().equals(
                            DepotType.TYPE_99.getCode())).collect(Collectors.toList());
        }
        return listDepot;
    public List<Depot> listDepotByDeptId(String companyId, String deptId) {
        return coreCommonService.getCacheDepotList(companyId, deptId);
    }
    /**
@@ -485,18 +481,6 @@
        return new PageResponse<>(RespCodeEnum.CODE_0000, data);
    }
    public PageResponse<Page<DicFoodOrigin>> pageFoodLocation(InoutParam param) {
        Page<DicFoodOrigin> result = coreDicService.pageFoodLocation(param);
        if (null == result.getRecords() || result.getRecords().isEmpty()) {
            return new PageResponse<>(RespCodeEnum.CODE_2000.getCode(),
                    "获取到数据信息为空");
        }
        return new PageResponse<Page<DicFoodOrigin>>(RespCodeEnum.CODE_0000,
                result);
    }
    public DepotConf getDepotConf(String companyId, String depotId) {
        return coreCommonService.getCacheDepotConf(companyId, depotId);
@@ -621,5 +605,15 @@
        return (String) redisUtil.get(key);
    }
    public Page<DicArea> pageDicArea(BaseParam param) {
        Page<DicArea> page = new Page<>(param.getPage(), param.getLimit());
        List<DicArea> list = coreDicService.listDicArea(page, param);
        page.setRecords(list);
        return page;
    }
}