| | |
| | | } |
| | | |
| | | @Override |
| | | public boolean reportTkrk(String matnr, String batch, String orderNo, Double anfme) { |
| | | public boolean reportTkrk(WaitPakin waitPakin) { |
| | | String matnr = waitPakin.getMatnr(); |
| | | String batch = waitPakin.getBatch(); |
| | | String orderNo = waitPakin.getOrderNo(); |
| | | Double anfme = waitPakin.getAnfme(); |
| | | |
| | | Object process1 = null; |
| | | NcResultMessage response1 = null; |
| | | boolean success1 = false; |
| | | try { |
| | | process1 = processTKRK(matnr, batch, orderNo, anfme); |
| | | process1 = processTKRK(matnr, batch, orderNo, anfme, waitPakin.getCstateid()); |
| | | //发送请求 |
| | | response1 = SendUtil.sendDataToNc(SendUtil.token, nyncIp + ":" + port, saveRefDelivery, JSONObject.toJSONString(process1)); |
| | | log.info("退库入库response:{}", response1); |
| | |
| | | NcResultMessage response2 = null; |
| | | boolean success2 = false; |
| | | try { |
| | | process2 = processDBTK(matnr, batch, orderNo, anfme); |
| | | process2 = processDBTK(matnr, batch, orderNo, anfme, waitPakin.getCstateidVcode()); |
| | | //发送请求 |
| | | response2 = SendUtil.sendDataToNc(SendUtil.token, nyncIp + ":" + port, dbdd, JSONObject.toJSONString(process2)); |
| | | log.info("退库入库response:{}", response2); |
| | |
| | | return data; |
| | | } |
| | | |
| | | private Object processTKRK(String matnr,String batch, String orderNo, Double anfme) { |
| | | private Object processTKRK(String matnr, String batch, String orderNo, Double anfme, String cstateid) { |
| | | // EntityWrapper<NccXsckmxTkWms> wrapper = new EntityWrapper<>(); |
| | | // wrapper.eq("VBATCHCODE", batch).eq("VSOURCEBILLCODE", orderNo); |
| | | // NccXsckmxTkWms nccXsckmxTkWms = nccXsckmxTkWmsService.selectOne(wrapper); |
| | |
| | | |
| | | saleOutBodyVO.setVbatchcode(batch); |
| | | saleOutBodyVO.setNnum(anfme * -1); |
| | | saleOutBodyVO.setCstateid(cstateid); |
| | | saleOutBodyVOList.add(saleOutBodyVO); |
| | | |
| | | data.put("SaleOutHeadVO", saleOutHeadVO); |
| | |
| | | return data; |
| | | } |
| | | |
| | | private Object processDBTK(String matnr, String batch, String orderNo, Double anfme) { |
| | | private Object processDBTK(String matnr, String batch, String orderNo, Double anfme, String cstateid) { |
| | | List<NccSaleDbddWms> nccSaleDbddWmsList = nccSaleDbddWmsService.selectList(new EntityWrapper<NccSaleDbddWms>() |
| | | .eq("wlbm", matnr) |
| | | .eq("vbillcode", orderNo) |
| | |
| | | |
| | | List<IaIjBillB> bids = new ArrayList<>(); |
| | | IaIjBillB iaIjBillB = new IaIjBillB(); |
| | | NccScPcdaWms nccScPcdaWms = nccScPcdaWmsService.selectOne(new EntityWrapper<NccScPcdaWms>().eq("vbatchcode", batch).eq("wlbm", matnr)); |
| | | if (nccScPcdaWms == null) { |
| | | throw new CoolException("批次[{}]物料[{}]未找到" + batch + "-" + matnr); |
| | | } |
| | | // NccScPcdaWms nccScPcdaWms = nccScPcdaWmsService.selectOne(new EntityWrapper<NccScPcdaWms>().eq("vbatchcode", batch).eq("wlbm", matnr)); |
| | | // if (nccScPcdaWms == null) { |
| | | // throw new CoolException("批次[{}]物料[{}]未找到" + batch + "-" + matnr); |
| | | // } |
| | | |
| | | Double weight = MatUtils.calcWeight(matnr, anfme); |
| | | iaIjBillB.setBid(nccSaleDbddWms.getCbill_bid()); |
| | |
| | | iaIjBillB.setNnum(anfme * -1); |
| | | iaIjBillB.setVbatchcode(batch); |
| | | iaIjBillB.setClocationid(""); |
| | | iaIjBillB.setCstateid(nccScPcdaWms.getVcode()); |
| | | iaIjBillB.setCstateid(cstateid); |
| | | |
| | | bids.add(iaIjBillB); |
| | | |