| | |
| | | @Resource |
| | | private BasDevpMapper basDevpMapper; |
| | | |
| | | @Value("mes.url") |
| | | @Value("${mes.url}") |
| | | private String url; |
| | | |
| | | @Value("mes.pakin") |
| | | @Value("${mes.code}") |
| | | private String code; |
| | | |
| | | @Override |
| | |
| | | if (Cools.isEmpty(param.getBarcode(), param.getCombMats())) { |
| | | throw new CoolException(BaseRes.PARAM); |
| | | } |
| | | if (param.getCombMats().size() > 1) { |
| | | throw new CoolException("请提取一个商品,或者刷新重新组托!"); |
| | | } |
| | | HashMap<String, Object> comData = new HashMap<>(); |
| | | param.getCombMats().forEach(elem -> { |
| | | // 判断是否有相同条码的数据 |
| | | if (waitPakinService.selectCount(new EntityWrapper<WaitPakin>(). |
| | |
| | | .eq("matnr", elem.getMatnr()).eq("batch", elem.getBatch())) > 0) { |
| | | throw new CoolException(param.getBarcode() + "已有相同数据"); |
| | | } |
| | | if (comData.get(elem.getThreeCode()) == null) { |
| | | comData.put(elem.getThreeCode(), elem); |
| | | } else { |
| | | throw new CoolException(elem.getThreeCode() + "该条码扫码了多次"); |
| | | } |
| | | }); |
| | | |
| | | |
| | | if (param.getBarcode().length() != 8) { |
| | | throw new CoolException("条码长度不是8位===>>" + param.getBarcode()); |
| | |
| | | // 生成入库通知档 |
| | | List<DetlDto> detlDtos = new ArrayList<>(); |
| | | |
| | | List<String> codes=new ArrayList<>(); |
| | | List<String> codes = new ArrayList<>(); |
| | | for (CombParam.CombMat elem : param.getCombMats()) { |
| | | codes.add(elem.getThreeCode()); |
| | | } |
| | |
| | | } |
| | | elem.setTemp1(codeDataParam.getQuality()); |
| | | elem.setAnfme(codeDataParam.getQty()); |
| | | elem.setBatch(codeDataParam.getBatchNum()); |
| | | //elem.setBatch(codeDataParam.getBatchNum()); |
| | | elem.setThreeCode(codeDataParam.getBarcode()); |
| | | elem.setMatnr(codeDataParam.getProductionCode()); |
| | | elem.setMaktx(codeDataParam.getProductionName()); |
| | |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | log.info("getData:{}", response); |
| | | MesResponse jsonObject = JSON.parseObject(response, MesResponse.class); |
| | | if (jsonObject.getCode().equals(200)) { |
| | | return JSON.parseArray(jsonObject.getData(), CodeDataParam.class); |
| | | JSONObject jsonObject1 = JSON.parseObject(jsonObject.getData()); |
| | | if (jsonObject1.getString("barcodeList") != null) { |
| | | return JSON.parseArray(jsonObject1.getString("barcodeList"), CodeDataParam.class); |
| | | } |
| | | } |
| | | throw new CoolException(jsonObject.getMessage()); |
| | | } |