自动化立体仓库 - WMS系统
#
LSH
2023-10-25 cee9ae96ca3e2831ea659e8ccdc979f22b820ace
src/main/java/com/zy/common/service/CommonService.java
@@ -98,7 +98,7 @@
     * @return locNo 检索到的库位号
     */
    @Transactional
    public StartupDto getLocNo(Integer whsType, Integer staDescId, Integer sourceStaNo, String matnr, String batch, String grade, LocTypeDto locTypeDto, int times) {
    public StartupDto getLocNo(Integer whsType, Integer staDescId, Integer sourceStaNo, String matnr, String batch, String grade, Integer moveCrnNo, LocTypeDto locTypeDto, int times) {
        if (Cools.isEmpty(matnr)) {  //物料号
            matnr = "";
        }
@@ -128,6 +128,15 @@
        // ===============>>>> 开始执行
        curRow = rowLastno.getCurrentRow();
        if (!Cools.isEmpty(moveCrnNo) && moveCrnNo!=0){
            crnNumber = moveCrnNo;
            if (times==0){
                curRow = moveCrnNo*4-1;
            }else {
                curRow = moveCrnNo*4-2;
            }
        }
        //此程序用于优化堆垛机异常时的运行时间
        for (int i = times; i < crnNumber; i++) {
            int[] locNecessaryParameters = Utils.LocNecessaryParameters(whsType, curRow, crnNumber);
@@ -145,28 +154,40 @@
            throw new CoolException("无可用堆垛机");
        }
        boolean signRule1 = false;
        boolean signRule2 = false;
//        // 靠近摆放规则 --- 同天同规格物料 //分离版
//        if (!Cools.isEmpty(matnr) &&  (staDescId == 1 || staDescId == 11 || staDescId == 111)) {
//            List<LocMast> locMasts = locMastService.selectList(new EntityWrapper<LocMast>().eq("row1", nearRow).eq("loc_sts", "O"));
//            for (LocMast locMast1:locMasts){
//                if (VersionUtils.locMoveCheckLocTypeComplete(locMast1, locTypeDto)) {
//                    continue;
//                }
//                String shallowLoc = Utils.getDeepLoc(slaveProperties,locMast1.getLocNo());
//                LocMast locMast2 = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no",shallowLoc));
//                if (!Cools.isEmpty(locMast2) && locMast2.getLocSts().equals("F")){
//                    LocDetl locDetl = locDetlService.selectOne(new EntityWrapper<LocDetl>().eq("loc_no", locMast2.getLocNo()));
//                    if (!Cools.isEmpty(locDetl) && matnr.equals(locDetl.getMatnr())) {
//                        locMast = locMast1;
//                        break;
//                    }
//                }
//            }
        // 靠近摆放规则 --- 同天同规格物料 //分离版
//        if (!Cools.isEmpty(matnr) &&  (staDescId == 1)){
//            signRule1 = true;
//        }
        // 靠近摆放规则 --- 同天同规格物料 //互通版
        if (!Cools.isEmpty(matnr) && (staDescId == 1 || staDescId == 11 || staDescId == 111)) {
        if (!Cools.isEmpty(matnr) && staDescId == 1) {
            signRule2 = true;
        }
        if (!Cools.isEmpty(matnr) &&  (staDescId == 11 || staDescId == 111)) {
            signRule1 = true;
        }
        if (signRule1){
            List<LocMast> locMasts = locMastService.selectList(new EntityWrapper<LocMast>().eq("row1", nearRow).eq("loc_sts", "O"));
            for (LocMast locMast1:locMasts){
                if (VersionUtils.locMoveCheckLocTypeComplete(locMast1, locTypeDto)) {
                    continue;
                }
                String shallowLoc = Utils.getDeepLoc(slaveProperties,locMast1.getLocNo());
                LocMast locMast2 = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no",shallowLoc));
                if (!Cools.isEmpty(locMast2) && locMast2.getLocSts().equals("F")){
                    LocDetl locDetl = locDetlService.selectOne(new EntityWrapper<LocDetl>().eq("loc_no", locMast2.getLocNo()));
                    if (!Cools.isEmpty(locDetl) && matnr.equals(locDetl.getMatnr())) {
                        locMast = locMast1;
                        break;
                    }
                }
            }
        }else if (signRule2){
            List<String> locNos = locDetlService.getSameDetlToday(matnr,batch, sRow, eRow);
            for (String locNo : locNos) {
                if (Utils.isShallowLoc(slaveProperties, locNo)) {
@@ -284,7 +305,7 @@
            // 当前巷道无空库位时,递归调整至下一巷道,检索全部巷道无果后,跳出递归
            if (times < rowCount) {
                times = times + 1;
                return getLocNo(1, staDescId, sourceStaNo, matnr, batch, grade, locTypeDto, times);
                return getLocNo(1, staDescId, sourceStaNo, matnr, batch, grade,moveCrnNo, locTypeDto, times);
            }
//            // 2.库位当前所属尺寸无空库位时,调整尺寸参数,向上兼容检索库位
//            if (locTypeDto.getLocType1() < 2) {