cl
23 小时以前 d8cbfdcac8292522dd3c39e5cafdf19a43d15a5d
rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/WaitPakinServiceImpl.java
@@ -49,6 +49,8 @@
    private MatnrMapper matnrMapper;
    @Autowired
    private ConfigService configService;
    @Autowired
    private CusBarcodeSyncMatnrService cusBarcodeSyncMatnrService;
    /**
@@ -67,6 +69,13 @@
        }
        if (StringUtils.isBlank(waitPakin.getBarcode())) {
            throw new CoolException("参数错误:料箱码为空!!");
        }
        if (isPdaPakinAsnRequired()) {
            for (PakinItem it : waitPakin.getItems()) {
                if (StringUtils.isBlank(it.getAsnCode())) {
                    throw new CoolException("请先扫描WMS单号");
                }
            }
        }
        WaitPakin pakin = waitPakinService.getOne(new LambdaQueryWrapper<WaitPakin>()
                .eq(WaitPakin::getBarcode, waitPakin.getBarcode()));
@@ -123,6 +132,11 @@
                        throw new CoolException("无订单组托时物料ID不能为空!!");
                    }
                    Matnr matnr = matnrMapper.selectById(pakinItem1.getMatnrId());
                    if (matnr == null) {
                        throw new CoolException("物料信息不存在,物料ID:" + pakinItem1.getMatnrId());
                    }
                    cusBarcodeSyncMatnrService.syncFromMatnrCodes(Collections.singletonList(matnr.getCode()), userId);
                    matnr = matnrMapper.selectById(pakinItem1.getMatnrId());
                    if (matnr == null) {
                        throw new CoolException("物料信息不存在,物料ID:" + pakinItem1.getMatnrId());
                    }
@@ -501,4 +515,17 @@
        return R.ok("Delete Success").add(pakinIds);
    }
    private boolean isPdaPakinAsnRequired() {
        Config c = configService.getOne(new LambdaQueryWrapper<Config>()
                .eq(Config::getFlag, GlobalConfigCode.PDA_PAKIN_ASN_REQUIRED)
                .eq(Config::getDeleted, 0)
                .last("LIMIT 1"));
        boolean required = true;
        if (c != null && StringUtils.isNotBlank(c.getVal())) {
            String v = c.getVal().trim();
            required = Boolean.parseBoolean(v) || "1".equals(v);
        }
        return required;
    }
}