自动化立体仓库 - WMS系统
#
18516761980
2023-03-08 1a30303df506698d09d106060d93d196c90c5c18
src/main/java/com/zy/asrs/service/impl/WrkMastServiceImpl.java
@@ -44,7 +44,7 @@
    public synchronized Double getIoPri(Integer ioType, String locNo) {
        Double defaultIoPri = null;
        if (Cools.isEmpty(ioType, locNo)) {
            return 15.0D;
            return 100.0D;
        }
        if (ioType != 11) {
            // 入库
@@ -54,7 +54,8 @@
                    for (String outerLoc : groupOuterLoc) {
                        WrkMast wrkMast = this.baseMapper.selectByLocNoOfPakin(outerLoc);
                        if (wrkMast != null) {
                            defaultIoPri = defaultIoPri == null ? wrkMast.getIoPri() + 2 : defaultIoPri + 2;
                            defaultIoPri = wrkMast.getIoPri() - 2;
//                            defaultIoPri = defaultIoPri == null ? wrkMast.getIoPri() - 2 : defaultIoPri - 2;
                        }
                    }
                }
@@ -63,9 +64,16 @@
                    for (String insideLoc : groupInsideLoc) {
                        WrkMast wrkMast = this.baseMapper.selectByLocNoOfPakin(insideLoc);
                        if (wrkMast != null) {
                            defaultIoPri = defaultIoPri == null ? wrkMast.getIoPri() - 2 : defaultIoPri - 2;
                            defaultIoPri = wrkMast.getIoPri() + 2;
//                            defaultIoPri = defaultIoPri == null ? wrkMast.getIoPri() + 2 : defaultIoPri + 2;
                        }
                    }
                }
                int row = getRow(locNo);
                if (row<=4){
                    return defaultIoPri == null ? 300.0D-row*2 : defaultIoPri-row*2;
                }else {
                    return defaultIoPri == null ? 300.0D+row*2 : defaultIoPri+row*2;
                }
            // 出库
            } else {
@@ -74,7 +82,8 @@
                    for (String outerLoc : groupOuterLoc) {
                        WrkMast wrkMast = this.baseMapper.selectBySourceLocNoOfPakout(outerLoc);
                        if (wrkMast != null) {
                            defaultIoPri = defaultIoPri == null ? wrkMast.getIoPri() - 2 : defaultIoPri - 2;
                            defaultIoPri = wrkMast.getIoPri() - 2;
//                            defaultIoPri = defaultIoPri == null ? wrkMast.getIoPri() - 2 : defaultIoPri - 2;
                        }
                    }
                }
@@ -83,16 +92,32 @@
                    for (String insideLoc : groupInsideLoc) {
                        WrkMast wrkMast = this.baseMapper.selectBySourceLocNoOfPakout(insideLoc);
                        if (wrkMast != null) {
                            defaultIoPri = defaultIoPri == null ? wrkMast.getIoPri() + 2 : defaultIoPri + 2;
                            defaultIoPri = wrkMast.getIoPri() + 2;
//                            defaultIoPri = defaultIoPri == null ? wrkMast.getIoPri() + 2 : defaultIoPri + 2;
                        }
                    }
                }
                int row = getRow(locNo);
                if (row<=4){
                    return defaultIoPri == null ? 300.0D+row*2 : defaultIoPri+row*2;
                }else {
                    return defaultIoPri == null ? 300.0D-row*2 : defaultIoPri-row*2;
                }
            }
        // 移库
        } else {
//            @Deprecated
        }
        return defaultIoPri == null ? 15.0D : defaultIoPri;
        return 300.0D;
    }
    /**
     * 通过库位号获取 排
     */
    public static int getRow(String locNo) {
        if (!Cools.isEmpty(locNo)) {
            return Integer.parseInt(locNo.substring(0, 2));
        }
        throw new RuntimeException("库位解析异常");
    }
    @Override
@@ -101,4 +126,14 @@
                .last(" and (wrk_sts in (1,2) or (wrk_sts=3 and wrk_no in (select wrk_no from asr_bas_devp)))"));
    }
    @Override
    public Boolean setSteEmpty(Integer wrkNo) {
        return this.baseMapper.setSteEmpty(wrkNo) > 0;
    }
    @Override
    public WrkMast selectOfPick(Integer wrkNo, Integer ioType) {
        return this.baseMapper.selectOfPick(wrkNo, ioType);
    }
}