自动化立体仓库 - WMS系统
zyx
2023-12-04 20a1449f65a9d577c2c9c0af62f3c4af3dd8d172
库位规则、库位编码规则bug修改
5个文件已修改
112 ■■■■■ 已修改文件
src/main/java/com/zy/asrs/controller/LocRuleController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/utils/Utils.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/common/service/CommonService.java 86 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/common/web/param/SearchLocParam.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/application.yml 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/controller/LocRuleController.java
@@ -121,7 +121,7 @@
        locRule.setUpdateTime(new Date());
        locRuleService.updateById(locRule);
        Integer locType2 = 1;//单品区域
        if (locRule.getMixed() == 0) {
        if (Cools.isEmpty(locRule.getMixed()) || locRule.getMixed() == 0) {
            locRuleService.updateKeepGoByMatnr(locRule.getMatnr(), locRule.getKeepGo());
        }else {//混载
            locRuleService.updateKeepGoByMixed(locRule.getKeepGo());
src/main/java/com/zy/asrs/utils/Utils.java
@@ -256,7 +256,7 @@
    }
    public static void main(String[] args) {
        System.out.println(JSON.toJSONString(getGroupDeepLoc("1505908")));
        System.out.println(JSON.toJSONString(getGroupInnerLoc("1505908")));
    }
    /**
src/main/java/com/zy/common/service/CommonService.java
@@ -202,18 +202,8 @@
                }
                List<LocMast> locMasts = locMastService.queryFreeLocMast2(locTypeDto.getLocType1(), locRule.getRowBeg(), locRule.getRowEnd(), locRule.getBayBeg(), locRule.getBayEnd(), locRule.getLevBeg(), locRule.getLevEnd());
                for (LocMast locMast0 : locMasts) {
                    List<String> locNos = locDetlService.getSameDetl(locMast0.getLocNo());
                    for (String locNo : locNos) {
                        LocMast locMast1 = locMastService.findInnerLoc(locNo);
                        if (null != locMast1) {
                            //预留空库位
                            if (locMastService.checkEmptyCount(locMast1, 10)) {
                                return locMast1;
                            }
                        }
                    }
                }
                locMast = locFilter(locMasts, matNos,locTypeDto);
            }
            if (locRules.get(0).getKeepGo() == 0) {
@@ -253,20 +243,8 @@
            if (locRule == null) {
                continue;
            }
            List<LocMast> locMasts = locMastService.queryFreeLocMast2(locTypeDto.getLocType1(), locRule.getRowBeg(), locRule.getRowEnd(), locRule.getBayBeg(), locRule.getBayEnd(), locRule.getLevBeg(), locRule.getLevEnd());
            for (LocMast locMast0 : locMasts) {
                List<String> locNos = locDetlService.getSameDetl(locMast0.getLocNo());
                for (String locNo : locNos) {
                    LocMast locMast1 = locMastService.findInnerLoc(locNo);
                    if (null != locMast1) {
                        //预留空库位
                        if (locMastService.checkEmptyCount(locMast1, 10)) {
                            return locMast1;
                        }
                    }
                }
            }
            locMast = locFilter(locMasts, matNos,locTypeDto);
        }
//            if (locRules.get(0).getKeepGo() == 0) {
@@ -427,6 +405,64 @@
        return locMast;
    }
    /*
    库存规则搜索到的库位确认
     */
    private LocMast locFilter(List<LocMast> locMasts,List<String> matNos,LocTypeDto locTypeDto){
        for (LocMast locMast0 : locMasts) {
            if(!VersionUtils.checkLocType(locMast0,locTypeDto)){
                continue;
            }
            if (matNos.size() == 1) {
                //单品物料
                if(Cools.isEmpty(Utils.getGroupDeepLoc(locMast0.getLocNo()))){
                    return locMast0;
                }else{
                    List<String> groupInnerLoc = Utils.getGroupInnerLoc(locMast0.getLocNo());
                    if (Cools.isEmpty(groupInnerLoc)) {
                        return locMast0;
                    }else {
                        //获取最深的库位
                        String loc = groupInnerLoc.get(groupInnerLoc.size() - 1);
                        LocMast locMast1 = locMastService.selectByLoc(loc);
                        if("O".equals(locMast1.getLocSts())){
                            return locMast1;
                        }else {
                            if(!"F".equals(locMast1.getLocSts())){
                                continue;
                            }
                            List<LocDetl> locDetls = locDetlService.selectByLocNo(loc);
                            if(!Cools.eq(locDetls.get(0).getMatnr(),matNos.get(0))){
                                continue;
                            }
                            for (int i=groupInnerLoc.size()-1; i>=0 ;i--){
                                LocMast locMast2 = locMastService.selectByLoc(groupInnerLoc.get(i));
                                if("O".equals(locMast2.getLocSts())){
                                    return locMast2;
                                }else if("F".equals(locMast2.getLocSts())){
                                    if(i==0){
                                        return locMast1;
                                    }else {
                                        continue;
                                    }
                                }else {
                                    break;
                                }
                            }
                        }
                    }
                }
            }else {
                if(Cools.isEmpty(Utils.getGroupDeepLoc(locMast0.getLocNo()))){
                    return locMast0;
                }
            }
        }
        return null;
    }
    //返回dto
    private StartupDto getLocNoStep6(Integer staDescId, Integer sourceStaNo, LocMast locMast) {
        StartupDto startupDto = new StartupDto();
src/main/java/com/zy/common/web/param/SearchLocParam.java
@@ -16,7 +16,7 @@
    private String barcode;
    // 库位规格( 0:未知, 1:低库位, 2:高库位)
    // 库位规格( 1低,2中,3高)
    private Short locType1;
}
src/main/resources/application.yml
@@ -73,16 +73,16 @@
    password: Wlzh44338
agv:
  url: localhost:8080
  taskCreatePath: /agv/task/create
  containerMoveInPath: /agv/container/moveIn
  containerMoveOutPath: /agv/container/moveOut
  containerArrivedPath: /agv/containerArrived
#  url: 10.10.10.182:9046
#  taskCreatePath: /task/create
#  containerMoveInPath: /expand/api/moveIn/container
#  containerMoveOutPath: /expand/api/moveOut/container
#  containerArrivedPath: /conveyor/containerArrived
#  url: localhost:8080
#  taskCreatePath: /agv/task/create
#  containerMoveInPath: /agv/container/moveIn
#  containerMoveOutPath: /agv/container/moveOut
#  containerArrivedPath: /agv/containerArrived
  url: 10.10.10.182:9046
  taskCreatePath: /task/create
  containerMoveInPath: /expand/api/moveIn/container
  containerMoveOutPath: /expand/api/moveOut/container
  containerArrivedPath: /conveyor/containerArrived
u8:
  url: http://192.168.1.55:8010