自动化立体仓库 - WMS系统
#1
dubin
2025-12-19 11788cc8e4ddc3af0eb430badac4d1ad8b8595e4
#1
3个文件已修改
296 ■■■■■ 已修改文件
src/main/java/com/zy/asrs/service/impl/MatBarcodeServiceImpl.java 185 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/task/handler/WorkMastHandler.java 109 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/common.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/MatBarcodeServiceImpl.java
@@ -47,25 +47,29 @@
//            if (locCount > 0 || waitCount > 0){
//                throw new CoolException("库存/组托档存在该模具,不能解绑,商品模具名称:" + matBarcode.getMatnr() + "托盘码:" + matBarcode.getZpallet());
//            }
            Integer wrkNo = wrkDetlService.selectWrkNoByMatnr(matBarcode.getMatnr());
            if (wrkNo != null){
                WrkMast wrkMast = wrkMastService.selectById(wrkNo);
                if (wrkMast == null){
                    throw new CoolException("工作档异常,有工作明细档无工作档");
                }
                if (wrkMast.getIoType() != 103 && wrkMast.getIoType() != 101){
                    throw new CoolException("工作档不是全板出库/拣料出库");
                }
                if (wrkMast.getWrkSts() != 14 && wrkMast.getWrkSts() != 15){
                    throw new CoolException("工作档未完成");
                }
            }
//            Integer wrkNo = wrkDetlService.selectWrkNoByMatnr(matBarcode.getMatnr());
//            if (wrkNo != null){
//                WrkMast wrkMast = wrkMastService.selectById(wrkNo);
//                if (wrkMast == null){
//                    throw new CoolException("工作档异常,有工作明细档无工作档");
//                }
//                if (wrkMast.getIoType() != 103 && wrkMast.getIoType() != 101){
//                    throw new CoolException("工作档不是全板出库/拣料出库");
//                }
//                if (wrkMast.getWrkSts() != 14 && wrkMast.getWrkSts() != 15){
//                    throw new CoolException("工作档未完成");
//                }
//            }
            //对于已经有库存 组托档 工作档的数据 不允许解绑
            Integer locCount = locDetlService.selectCountByMatNr(matBarcode.getMatnr());
            Integer waitCount = waitPakinService.selectCountByMatNr(matBarcode.getMatnr());
            if (locCount > 0 || waitCount > 0){
                throw new CoolException("库存/组托档存在该模具,不能解绑,商品模具名称:" + matBarcode.getMatnr() + "托盘码:" + matBarcode.getZpallet());
            }
//            Integer waitCount = waitPakinService.selectCountByMatNr(matBarcode.getMatnr());
//            if (locCount > 0 || waitCount > 0){
//                throw new CoolException("库存/组托档存在该模具,不能解绑,商品模具名称:" + matBarcode.getMatnr() + "托盘码:" + matBarcode.getZpallet());
//            }
            //对模具的规格做处理得到厚度
            Integer thickness = 0;
            if (!Cools.isEmpty(matBarcode.getSpecs())){
@@ -73,7 +77,8 @@
                thickness = Integer.parseInt(split[1]);
            }
            HalfBarcode halfBarcode = halfBarcodeService.selectByZpallet(matBarcode.getZpallet());
            if (halfBarcode != null){
            // 如果模具没有库存 更新半托信息 数量 可放厚度
            if (halfBarcode != null && locCount <= 0){
                halfBarcode.setAnfme(halfBarcode.getAnfme() - 1);
                halfBarcode.setPrice(halfBarcode.getPrice() + thickness);
                if (!halfBarcodeService.half(halfBarcode)){
@@ -97,43 +102,43 @@
        if (mat.getColor().equals("报废")){
            throw new CoolException("该物料已报废,请勿绑定");
        }
        HalfBarcode halfBarcode = halfBarcodeService.selectByZpallet(waitPakin.getBarcode());
//        HalfBarcode halfBarcode = halfBarcodeService.selectByZpallet(waitPakin.getBarcode());
        //对模具的规格做处理得到厚度
        Integer thickness = 0;
        if (!Cools.isEmpty(mat.getSpecs())){
            String[] split = mat.getSpecs().split("\\*");
            thickness = Integer.parseInt(split[1]);
        }
        if (halfBarcode == null){
            HalfBarcode hb = new HalfBarcode();
            hb.setZpallet(waitPakin.getBarcode());
            hb.setSpecs(waitPakin.getBarcode().substring(0,1));
            hb.setAnfme(1);
            if (Integer.parseInt(waitPakin.getBarcode().substring(0,1))==6){
                hb.setPrice(2650 - thickness);
            }else if(Integer.parseInt(waitPakin.getBarcode().substring(0,1))==7){
                hb.setPrice(1750 - thickness);
            }else if(Integer.parseInt(waitPakin.getBarcode().substring(0,1))==8){
                hb.setPrice(800 - thickness);
            }
            if (!halfBarcodeService.insert(hb)){
                throw new CoolException("更新半托信息失败");
            }
        }else {
            if (Integer.parseInt(waitPakin.getBarcode().substring(0,1))==6){
                halfBarcode.setAnfme(halfBarcode.getAnfme() + 1);
                halfBarcode.setPrice(2650 - thickness);
            }else if(Integer.parseInt(waitPakin.getBarcode().substring(0,1))==7){
                halfBarcode.setAnfme(halfBarcode.getAnfme() + 1);
                halfBarcode.setPrice(1750 - thickness);
            }else if(Integer.parseInt(waitPakin.getBarcode().substring(0,1))==8){
                halfBarcode.setAnfme(halfBarcode.getAnfme() + 1);
                halfBarcode.setPrice(800 - thickness);
            }
            if (!halfBarcodeService.half(halfBarcode)){
                throw new CoolException("更新半托信息失败");
            }
        }
//        Integer thickness = 0;
//        if (!Cools.isEmpty(mat.getSpecs())){
//            String[] split = mat.getSpecs().split("\\*");
//            thickness = Integer.parseInt(split[1]);
//        }
//        if (halfBarcode == null){
//            HalfBarcode hb = new HalfBarcode();
//            hb.setZpallet(waitPakin.getBarcode());
//            hb.setSpecs(waitPakin.getBarcode().substring(0,1));
//            hb.setAnfme(1);
//            if (Integer.parseInt(waitPakin.getBarcode().substring(0,1))==6){
//                hb.setPrice(2650 - thickness);
//            }else if(Integer.parseInt(waitPakin.getBarcode().substring(0,1))==7){
//                hb.setPrice(1750 - thickness);
//            }else if(Integer.parseInt(waitPakin.getBarcode().substring(0,1))==8){
//                hb.setPrice(800 - thickness);
//            }
//            if (!halfBarcodeService.insert(hb)){
//                throw new CoolException("更新半托信息失败");
//            }
//        }else {
//            if (Integer.parseInt(waitPakin.getBarcode().substring(0,1))==6){
//                halfBarcode.setAnfme(halfBarcode.getAnfme() + 1);
//                halfBarcode.setPrice(2650 - thickness);
//            }else if(Integer.parseInt(waitPakin.getBarcode().substring(0,1))==7){
//                halfBarcode.setAnfme(halfBarcode.getAnfme() + 1);
//                halfBarcode.setPrice(1750 - thickness);
//            }else if(Integer.parseInt(waitPakin.getBarcode().substring(0,1))==8){
//                halfBarcode.setAnfme(halfBarcode.getAnfme() + 1);
//                halfBarcode.setPrice(800 - thickness);
//            }
//            if (!halfBarcodeService.half(halfBarcode)){
//                throw new CoolException("更新半托信息失败");
//            }
//        }
        MatBarcode mb=new MatBarcode();
        mb.setZpallet(waitPakin.getBarcode());
        mb.setMatnr(mat.getMatnr());
@@ -158,43 +163,43 @@
        if (mat.getColor().equals("报废")){
            throw new CoolException("该物料已报废,请勿绑定");
        }
        HalfBarcode halfBarcode = halfBarcodeService.selectByZpallet(mat.getUnit());
//        HalfBarcode halfBarcode = halfBarcodeService.selectByZpallet(mat.getUnit());
        //对模具的规格做处理得到厚度
        Integer thickness = 0;
        if (!Cools.isEmpty(mat.getSpecs())){
            String[] split = mat.getSpecs().split("\\*");
            thickness = Integer.parseInt(split[1]);
        }
        if (halfBarcode == null){
            HalfBarcode hb = new HalfBarcode();
            hb.setZpallet(mat.getUnit());
            hb.setSpecs(mat.getUnit().substring(0,1));
            hb.setAnfme(1);
            if (Integer.parseInt(mat.getUnit().substring(0,1))==6){
                hb.setPrice(2650 - thickness);
            }else if(Integer.parseInt(mat.getUnit().substring(0,1))==7){
                hb.setPrice(1750 - thickness);
            }else if(Integer.parseInt(mat.getUnit().substring(0,1))==8){
                hb.setPrice(800 - thickness);
            }
            if (!halfBarcodeService.insert(hb)){
                throw new CoolException("更新半托信息失败");
            }
        }else {
            if (Integer.parseInt(mat.getUnit().substring(0,1))==6){
                halfBarcode.setAnfme(halfBarcode.getAnfme() + 1);
                halfBarcode.setPrice(halfBarcode.getPrice()- thickness);
            }else if(Integer.parseInt(mat.getUnit().substring(0,1))==7){
                halfBarcode.setAnfme(halfBarcode.getAnfme() + 1);
                halfBarcode.setPrice(halfBarcode.getPrice()- thickness);
            }else if(Integer.parseInt(mat.getUnit().substring(0,1))==8){
                halfBarcode.setAnfme(halfBarcode.getAnfme() + 1);
                halfBarcode.setPrice(halfBarcode.getPrice()- thickness);
            }
            if (!halfBarcodeService.half(halfBarcode)){
                throw new CoolException("更新半托信息失败");
            }
        }
//        Integer thickness = 0;
//        if (!Cools.isEmpty(mat.getSpecs())){
//            String[] split = mat.getSpecs().split("\\*");
//            thickness = Integer.parseInt(split[1]);
//        }
//        if (halfBarcode == null){
//            HalfBarcode hb = new HalfBarcode();
//            hb.setZpallet(mat.getUnit());
//            hb.setSpecs(mat.getUnit().substring(0,1));
//            hb.setAnfme(1);
//            if (Integer.parseInt(mat.getUnit().substring(0,1))==6){
//                hb.setPrice(2650 - thickness);
//            }else if(Integer.parseInt(mat.getUnit().substring(0,1))==7){
//                hb.setPrice(1750 - thickness);
//            }else if(Integer.parseInt(mat.getUnit().substring(0,1))==8){
//                hb.setPrice(800 - thickness);
//            }
//            if (!halfBarcodeService.insert(hb)){
//                throw new CoolException("更新半托信息失败");
//            }
//        }else {
//            if (Integer.parseInt(mat.getUnit().substring(0,1))==6){
//                halfBarcode.setAnfme(halfBarcode.getAnfme() + 1);
//                halfBarcode.setPrice(halfBarcode.getPrice()- thickness);
//            }else if(Integer.parseInt(mat.getUnit().substring(0,1))==7){
//                halfBarcode.setAnfme(halfBarcode.getAnfme() + 1);
//                halfBarcode.setPrice(halfBarcode.getPrice()- thickness);
//            }else if(Integer.parseInt(mat.getUnit().substring(0,1))==8){
//                halfBarcode.setAnfme(halfBarcode.getAnfme() + 1);
//                halfBarcode.setPrice(halfBarcode.getPrice()- thickness);
//            }
//            if (!halfBarcodeService.half(halfBarcode)){
//                throw new CoolException("更新半托信息失败");
//            }
//        }
        MatBarcode mb=new MatBarcode();
        mb.setZpallet(mat.getUnit());
        mb.setMatnr(mat.getMatnr());
src/main/java/com/zy/asrs/task/handler/WorkMastHandler.java
@@ -40,6 +40,8 @@
    private InOutService inOutService;
    @Autowired
    private MatService matService;
    @Autowired
    private HalfBarcodeService halfBarcodeService;
    public ReturnT<String> start(WrkMast wrkMast) {
        // 4.入库完成
@@ -137,6 +139,46 @@
                                return FAIL.setMsg("更新模具属性失败");
                            }
                            //更新半托信息
                            HalfBarcode halfBarcode = halfBarcodeService.selectByZpallet(wrkDetl.getZpallet());
                            //对模具的规格做处理得到厚度
                            Integer thickness = 0;
                            if (!Cools.isEmpty(wrkDetl.getSpecs())){
                                String[] split = wrkDetl.getSpecs().split("\\*");
                                thickness = Integer.parseInt(split[1]);
                            }
                            if (halfBarcode == null){
                                HalfBarcode hb = new HalfBarcode();
                                hb.setZpallet(wrkDetl.getZpallet());
                                hb.setSpecs(wrkDetl.getZpallet().substring(0,1));
                                hb.setAnfme(1);
                                if (Integer.parseInt(wrkDetl.getZpallet().substring(0,1))==6){
                                    hb.setPrice(2650 - thickness);
                                }else if(Integer.parseInt(wrkDetl.getZpallet().substring(0,1))==7){
                                    hb.setPrice(1750 - thickness);
                                }else if(Integer.parseInt(wrkDetl.getZpallet().substring(0,1))==8){
                                    hb.setPrice(800 - thickness);
                                }
                                if (!halfBarcodeService.insert(hb)){
                                    throw new CoolException("更新半托信息失败");
                                }
                            }else {
                                if (Integer.parseInt(wrkDetl.getZpallet().substring(0,1))==6){
                                    halfBarcode.setAnfme(halfBarcode.getAnfme() + 1);
                                    halfBarcode.setPrice(halfBarcode.getPrice() - thickness);
                                }else if(Integer.parseInt(wrkDetl.getZpallet().substring(0,1))==7){
                                    halfBarcode.setAnfme(halfBarcode.getAnfme() + 1);
                                    halfBarcode.setPrice(halfBarcode.getPrice() - thickness);
                                }else if(Integer.parseInt(wrkDetl.getZpallet().substring(0,1))==8){
                                    halfBarcode.setAnfme(halfBarcode.getAnfme() + 1);
                                    halfBarcode.setPrice(halfBarcode.getPrice() - thickness);
                                }
                                if (!halfBarcodeService.half(halfBarcode)){
                                    throw new CoolException("更新半托信息失败");
                                }
                            }
                            if (!locDetlService.insert(locDetl)) {
//                                exceptionHandle("全板入库 ===>> 添加库存明细失败;[workNo={0}],[locNo={1}]", wrkMast.getWrkNo(), wrkMast.getLocNo());
                                TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
@@ -197,6 +239,19 @@
                            }
                            if (!inOutService.updateById(inOut)){
                                return FAIL.setMsg("更新模具属性失败");
                            }
                            // 对模具的规格做处理得到厚度
                            Integer thickness = 0;
                            if (wrkDetl.getSpecs() != null){
                                String[] split = wrkDetl.getSpecs().split("\\*");
                                thickness = Integer.parseInt(split[1]);
                            }
                            // 根据托盘码找到半托信息
                            HalfBarcode halfBarcode = halfBarcodeService.selectByZpallet(wrkDetl.getZpallet());
                            if (halfBarcode != null){
                                halfBarcode.setPrice(thickness + halfBarcode.getPrice()); // 可放厚度
                                halfBarcode.setAnfme(halfBarcode.getAnfme() - 1); // 数量
                            }
@@ -267,6 +322,45 @@
                            }
                            if (!inOutService.updateById(inOut)){
                                return FAIL.setMsg("更新模具属性失败");
                            }
                            //更新半托信息
                            HalfBarcode halfBarcode = halfBarcodeService.selectByZpallet(wrkDetl.getZpallet());
                            //对模具的规格做处理得到厚度
                            Integer thickness = 0;
                            if (!Cools.isEmpty(wrkDetl.getSpecs())){
                                String[] split = wrkDetl.getSpecs().split("\\*");
                                thickness = Integer.parseInt(split[1]);
                            }
                            if (halfBarcode == null){
                                HalfBarcode hb = new HalfBarcode();
                                hb.setZpallet(wrkDetl.getZpallet());
                                hb.setSpecs(wrkDetl.getZpallet().substring(0,1));
                                hb.setAnfme(1);
                                if (Integer.parseInt(wrkDetl.getZpallet().substring(0,1))==6){
                                    hb.setPrice(2650 - thickness);
                                }else if(Integer.parseInt(wrkDetl.getZpallet().substring(0,1))==7){
                                    hb.setPrice(1750 - thickness);
                                }else if(Integer.parseInt(wrkDetl.getZpallet().substring(0,1))==8){
                                    hb.setPrice(800 - thickness);
                                }
                                if (!halfBarcodeService.insert(hb)){
                                    throw new CoolException("更新半托信息失败");
                                }
                            }else {
                                if (Integer.parseInt(wrkDetl.getZpallet().substring(0,1))==6){
                                    halfBarcode.setAnfme(halfBarcode.getAnfme() + 1);
                                    halfBarcode.setPrice(halfBarcode.getPrice() - thickness);
                                }else if(Integer.parseInt(wrkDetl.getZpallet().substring(0,1))==7){
                                    halfBarcode.setAnfme(halfBarcode.getAnfme() + 1);
                                    halfBarcode.setPrice(halfBarcode.getPrice() - thickness);
                                }else if(Integer.parseInt(wrkDetl.getZpallet().substring(0,1))==8){
                                    halfBarcode.setAnfme(halfBarcode.getAnfme() + 1);
                                    halfBarcode.setPrice(halfBarcode.getPrice() - thickness);
                                }
                                if (!halfBarcodeService.half(halfBarcode)){
                                    throw new CoolException("更新半托信息失败");
                                }
                            }
                            locDetl = new LocDetl();
@@ -403,6 +497,18 @@
                    for (WrkDetl wrkDetl : wrkDetls101) {
                        InOut inOut=inOutService.selectByMatnr(wrkDetl.getMatnr());
                        // 对模具的规格做处理得到厚度
                        Integer thickness = 0;
                        if (wrkDetl.getSpecs() != null){
                            String[] split = wrkDetl.getSpecs().split("\\*");
                            thickness = Integer.parseInt(split[1]);
                        }
                        // 根据托盘码找到半托信息
                        HalfBarcode halfBarcode = halfBarcodeService.selectByZpallet(wrkDetl.getZpallet());
                        if (halfBarcode != null){
                            halfBarcode.setPrice(thickness + halfBarcode.getPrice()); // 可放厚度
                            halfBarcode.setAnfme(halfBarcode.getAnfme() - 1); // 数量
                        }
                        if (inOut != null){
                            inOut.setTemp1("不在库");//属性 是否在库
                            inOut.setBrand("");//托盘条码
@@ -412,6 +518,9 @@
                        if (!inOutService.updateById(inOut)){
                            return FAIL.setMsg("更新模具属性失败");
                        }
                        if (!halfBarcodeService.half(halfBarcode)){
                            return FAIL.setMsg("更新半托信息失败");
                        }
                    }
                    for (WrkDetl wrkDetl : wrkDetls101) {
src/main/webapp/static/js/common.js
@@ -278,7 +278,7 @@
    ,{field: 'outOrderNo', align: 'center',title: '合同号', sort:true, hide: true}
    ,{field: 'unit', align: 'center',title: '单位', hide: true}
    ,{field: 'zpallet', align: 'center',title: '托盘条码', hide: false}
    ,{field: 'anfme', align: 'center',title: '绑定数量', hide: false}
    ,{field: 'anfme', align: 'center',title: '模具数量', hide: false}
    ,{field: 'specs', align: 'center',title: '规格', hide: true}
    ,{field: 'color', align: 'center',title: '颜色', hide: true}
    ,{field: 'brand', align: 'center',title: '品牌', hide: true}