自动化立体仓库 - WMS系统
1
dubin
2025-09-29 8d2398cb9d27e216d94fe0d7252339b8e0f4779c
src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
@@ -134,14 +134,19 @@
                //校验当前物料与托盘绑定信息是否正确
                MatBarcode matBarcode = new MatBarcode();
                MatBarcode mb = matBarcodeService.selectbyMatnr(detlDto.getMatnr());
                if (mb != null && !mb.getZpallet().equals(param.getBarcode())) {
                    throw new CoolException(detlDto.getMatnr() + "该物料与其他托盘绑定,请先解绑");
                } else {
                if (mb != null){
                    if (!mb.getZpallet().equals(param.getBarcode())){
                        throw new CoolException(detlDto.getMatnr() + "该物料与其他托盘绑定,请先解绑");
                    }
                }else {
                    matBarcode.setZpallet(param.getBarcode());//托盘码
                    matBarcode.setMatnr(mat.getMatnr());//物料号
                    matBarcode.setMaktx(mat.getMaktx());//物料名称
                    matBarcode.setSpecs(mat.getSpecs());//规格
                    matBarcode.setModel(mat.getModel());//型号
                    if (!matBarcodeService.insert(matBarcode)) {
                        throw new CoolException("物料与托盘绑定失败");
                    }
                }
                WaitPakin waitPakin = new WaitPakin();
                waitPakin.sync(mat);
@@ -160,9 +165,6 @@
                waitPakin.setMemo(detlDto.getMemo());
                if (!waitPakinService.insert(waitPakin)) {
                    throw new CoolException("保存入库通知档失败");
                }
                if (!matBarcodeService.insert(matBarcode)) {
                    throw new CoolException("物料与托盘绑定失败");
                }
            }
            // 关联组托
@@ -194,14 +196,19 @@
                //校验当前物料与托盘绑定信息是否正确
                MatBarcode matBarcode = new MatBarcode();
                MatBarcode mb = matBarcodeService.selectbyMatnr(orderDetl.getMatnr());
                if (mb != null && !mb.getZpallet().equals(param.getBarcode())) {
                    throw new CoolException(orderDetl.getMatnr() + "该物料与其他托盘绑定,请先解绑");
                } else {
                if (mb != null){
                    if (!mb.getZpallet().equals(param.getBarcode())){
                        throw new CoolException(orderDetl.getMatnr() + "该物料与其他托盘绑定,请先解绑");
                    }
                }else {
                    matBarcode.setZpallet(param.getBarcode());//托盘码
                    matBarcode.setMatnr(mat.getMatnr());//物料号
                    matBarcode.setMaktx(mat.getMaktx());//物料名称
                    matBarcode.setSpecs(mat.getSpecs());//规格
                    matBarcode.setModel(mat.getModel());//型号
                    if (!matBarcodeService.insert(matBarcode)) {
                        throw new CoolException("物料与托盘绑定失败");
                    }
                }
                WaitPakin waitPakin = new WaitPakin();
                waitPakin.sync(mat);
@@ -224,9 +231,6 @@
                waitPakin.setPacking(orderDetl.getPacking());
                if (!waitPakinService.insert(waitPakin)) {
                    throw new CoolException("保存入库通知档失败");
                }
                if (!matBarcodeService.insert(matBarcode)) {
                    throw new CoolException("物料与托盘绑定失败");
                }
            });