自动化立体仓库 - WMS系统
#
luxiaotao1123
2022-08-16 040c966720e66bfa400181bb26d46ca59ac44e6c
src/main/java/com/zy/common/service/CommonService.java
@@ -17,6 +17,7 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/**
@@ -26,6 +27,15 @@
@Slf4j
@Service
public class CommonService {
    public static final List<Integer> FIRST_GROUP_ROW_LIST = new ArrayList<Integer>() {{
        add(2);add(3);add(4);add(5);add(6);add(7);add(8);add(9);add(10);
        add(11);add(12);add(13);add(14);add(15);add(16);add(17);
    }};
    public static final List<Integer> SECOND_GROUP_ROW_LIST = new ArrayList<Integer>() {{
        add(18);add(19);add(20);
        add(21);add(22);add(23);add(24);add(25);add(26);add(27);add(28);add(29);add(30);
    }};
    @Autowired
    private WrkMastService wrkMastService;
@@ -204,11 +214,23 @@
        // 1.当检索库排为浅库位排时,优先寻找当前库排的深库位排
        if (locMast == null) {
            locMast = locMastService.queryFreeLocMast(curRow, locTypeDto.getLocType1());
            // 因库位移转、需预留空库位
            if (!locMastService.checkEmptyCount(locMast)) {
                locMast = null;
            List<Integer> rows;
            switch (curRow) {
                case 1:
                    rows = FIRST_GROUP_ROW_LIST;
                    break;
                case 2:
                    rows = SECOND_GROUP_ROW_LIST;
                    break;
                default:
                    throw new CoolException("入库逻辑故障【" + curRow + "】");
            }
            locMast = locMastService.queryFreeLocMast(curRow, rows, locTypeDto.getLocType1());
            // 因库位移转、需预留空库位
//            if (!locMastService.checkEmptyCount(locMast)) {
//                locMast = null;
//            }
        }
        // 2.库位当前所属尺寸无空库位时,调整尺寸参数,向上兼容检索库位