| | |
| | | private MatnrMapper matnrMapper; |
| | | @Autowired |
| | | private ConfigService configService; |
| | | @Autowired |
| | | private CusBarcodeSyncMatnrService cusBarcodeSyncMatnrService; |
| | | |
| | | |
| | | /** |
| | |
| | | } |
| | | 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())); |
| | |
| | | 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()); |
| | | } |
| | |
| | | |
| | | 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; |
| | | } |
| | | } |