自动化立体仓库 - WMS系统
李天宇
2024-11-07 c8ffad2a1b5d278824aa2650a4ff461ec738af9f
src/main/java/com/zy/common/service/CommonService.java
@@ -92,7 +92,7 @@
     * @param whsType 类型 1:双深式货架
     * @param staDescId 路径工作类型
     * @param sourceStaNo 源站
     * @param matNos 商品编号集合
     * @param matNos 品号集合
     * @return locNo 检索到的库位号
     */
    @Transactional
@@ -148,7 +148,7 @@
                if (row == 1) {
                    shallowLocNo = locNo;
                } else {
                    shallowLocNo = Utils.getShallowLoc(slaveProperties, locNo);
                    shallowLocNo = zerofill(String.valueOf(2), 2) + locNo.substring(2);
                }
                // 检测目标库位是否为空库位
                LocMast shallowLoc = locMastService.selectById(shallowLocNo);
@@ -169,32 +169,17 @@
            List<LocMast> locMasts = locMastService.selectList(new EntityWrapper<LocMast>().eq("loc_sts", "D").ge("row1", sRow).le("row1", eRow));
            if (locMasts.size() > 0) {
                for (LocMast loc : locMasts) {
                    //if (Utils.isShallowLoc(slaveProperties, loc.getLocNo())) {
                    //    continue;
                    //}
                    int row = Integer.parseInt(loc.getLocNo().substring(0, 2));
                    //如果为浅库位则判断深库位是否使用
                    String shallowLocNo = "";
                    if (row == 1) {
                        shallowLocNo = loc.getLocNo();
                    } else if (row == 2){
                        LocMast deepLoc = locMastService.selectById(zerofill(String.valueOf(3), 2) + locMast.getLocNo().substring(2));
                        if (!deepLoc.getLocSts().equals("F") && !deepLoc.getLocSts().equals("D") && !deepLoc.getLocSts().equals("X")) {
                            continue;
                        }
                        shallowLocNo = loc.getLocNo();
                    } else {
                        LocMast deepLoc = locMastService.selectById(zerofill(String.valueOf(2), 2) + locMast.getLocNo().substring(2));
                        if (!deepLoc.getLocSts().equals("F") && !deepLoc.getLocSts().equals("D") && !deepLoc.getLocSts().equals("X")) {
                            continue;
                        }
                        shallowLocNo = loc.getLocNo();
                    if (row == 1 || row == 2) {
                        continue;
                    }
                    LocMast trgerLoc = locMastService.selectById(zerofill(String.valueOf(2), 2) + loc.getLocNo().substring(2));
                    if (!trgerLoc.getLocSts().equals("O")) {
                        continue;
                    }
                    shallowLocNo = trgerLoc.getLocNo();
                    // 检测目标库位是否为空库位
                    LocMast shallowLoc = locMastService.selectById(shallowLocNo);
@@ -375,12 +360,12 @@
     * @param whsType 类型 1:双深式货架
     * @param staDescId 路径工作类型
     * @param sourceStaNo 源站
     * @param matnr 商品编号集合
     * @param matnr 品号集合
     * @return locNo 检索到的库位号
     */
    @Transactional
    public StartupDto getLocNoRun(Integer whsType, Integer staDescId, Integer sourceStaNo, String matnr, String batch, String grade, Integer moveCrnNo, LocTypeDto locTypeDto, int times) {
        if (Cools.isEmpty(matnr)) {  //物料号
        if (Cools.isEmpty(matnr)) {  //品号
            matnr = "";
        }
        if (Cools.isEmpty(batch)) {  //箱号