skyouc
2025-07-07 2a24c69b830d9dc97a8673f5f69418e9f95f3e1b
zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/controller/ZpalletBarcodeController.java
@@ -55,6 +55,10 @@
    @OperationLog("添加容器管理")
    @PostMapping("/zpalletBarcode/save")
    public R save(@RequestBody ZpalletBarcode zpalletBarcode) {
        ZpalletBarcode one = zpalletBarcodeService.getOne(new LambdaQueryWrapper<ZpalletBarcode>().eq(ZpalletBarcode::getBarcode, zpalletBarcode.getBarcode()));
        if (!Objects.isNull(one)) {
            return R.error("容器已存在,不可重复添加!!");
        }
        if (!zpalletBarcodeService.save(zpalletBarcode)) {
            return R.error("添加失败");
        }
@@ -120,16 +124,18 @@
                pakinType = "ctu";
            }
        }
        ZpalletBarcode one = zpalletBarcodeService.getOne(new LambdaQueryWrapper<ZpalletBarcode>().eq(ZpalletBarcode::getBarcode, barcode));
        if (one != null) {
            return R.error("条码起始值已存在");
        }
        if (pakinType.equals("flat")) {
            int barcodeInt = Integer.parseInt(String.valueOf(barcode));
            for (int i = 0; i < Integer.parseInt(String.valueOf(num)); i++) {
                ZpalletBarcode zpalletBarcode = new ZpalletBarcode();
                String strBarcode = String.format("%08d", barcodeInt);
                zpalletBarcode.setBarcode("PK" + strBarcode);
                ZpalletBarcode one = zpalletBarcodeService.getOne(new LambdaQueryWrapper<ZpalletBarcode>()
                        .eq(ZpalletBarcode::getBarcode, strBarcode));
                if (one != null) {
                    continue;
                }
                zpalletBarcodeService.save(zpalletBarcode);
                barcodeInt += 1;
            }
@@ -139,6 +145,11 @@
                ZpalletBarcode zpalletBarcode = new ZpalletBarcode();
                String strBarcode = String.format("%08d", barcodeInt);
                zpalletBarcode.setBarcode(strBarcode);
                ZpalletBarcode one = zpalletBarcodeService.getOne(new LambdaQueryWrapper<ZpalletBarcode>()
                        .eq(ZpalletBarcode::getBarcode, strBarcode));
                if (one != null) {
                    continue;
                }
                zpalletBarcodeService.save(zpalletBarcode);
                barcodeInt += 1;
            }