| | |
| | | import com.zy.asrs.service.StoreTypeService; |
| | | import com.zy.nc.SendUtil; |
| | | import com.zy.nc.entity.*; |
| | | import com.zy.nc.service.NccSaleXsfhmxWmsService; |
| | | import com.zy.nc.service.NccScPcdaWmsService; |
| | | import com.zy.nc.util.NcResultMessage; |
| | | import com.zy.nc.vo.*; |
| | |
| | | |
| | | @Autowired |
| | | private NccScPcdaWmsService nccScPcdaWmsService; |
| | | |
| | | @Autowired |
| | | private NccSaleXsfhmxWmsService nccSaleXsfhmxWmsService; |
| | | |
| | | @Value("${NYNC.ip}") |
| | | private String nyncIp; |
| | |
| | | } |
| | | break; |
| | | case "采购到货": |
| | | process1 = processCGDH(orderDetls); |
| | | List<Object> cg = new ArrayList<>(); |
| | | cg.add(process1); |
| | | //发送请求 |
| | | response = SendUtil.sendDataToNc(SendUtil.token, nyncIp + ":" + port, purchasein, JSONObject.toJSONString(cg)); |
| | | if (!Cools.isEmpty(response) && response.isSuccess()) { |
| | | log.info("采购到货response:{}", response); |
| | | step = 10; |
| | | } else { |
| | | remark = response.getMessage() + "--" + response.getErrorStack().substring(0, 100); |
| | | } |
| | | //不需要上报了 |
| | | step = 10; |
| | | // process1 = processCGDH(orderDetls); |
| | | // List<Object> cg = new ArrayList<>(); |
| | | // cg.add(process1); |
| | | // //发送请求 |
| | | // response = SendUtil.sendDataToNc(SendUtil.token, nyncIp + ":" + port, purchasein, JSONObject.toJSONString(cg)); |
| | | // if (!Cools.isEmpty(response) && response.isSuccess()) { |
| | | // log.info("采购到货response:{}", response); |
| | | // step = 10; |
| | | // } else { |
| | | // remark = response.getMessage() + "--" + response.getErrorStack().substring(0, 100); |
| | | // } |
| | | break; |
| | | case "转库-出库": |
| | | if (step == 1) { |
| | |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public boolean reportTkrk(String matnr, String batch, String orderNo, Double anfme) { |
| | | Object process1 = processTKRK(matnr, batch, orderNo, anfme); |
| | | //发送请求 |
| | | NcResultMessage response = SendUtil.sendDataToNc(SendUtil.token, nyncIp + ":" + port, saveRefDelivery, JSONObject.toJSONString(process1)); |
| | | log.info("退库入库response:{}", response); |
| | | if (!Cools.isEmpty(response) && response.isSuccess()) { |
| | | log.info("退库入库response:{}", response); |
| | | return true; |
| | | } else { |
| | | // remark = response.getMessage() + "--" + response.getErrorStack().substring(0, 100); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | private Object processXSFH(List<OrderDetl> orderDetls, Boolean flag) { |
| | | //组装对象数据 |
| | |
| | | return data; |
| | | } |
| | | |
| | | private Object processTKRK(String matnr,String batch, String orderNo, Double anfme) { |
| | | // EntityWrapper<NccXsckmxTkWms> wrapper = new EntityWrapper<>(); |
| | | // wrapper.eq("VBATCHCODE", batch).eq("VSOURCEBILLCODE", orderNo); |
| | | // NccXsckmxTkWms nccXsckmxTkWms = nccXsckmxTkWmsService.selectOne(wrapper); |
| | | // if (null == nccXsckmxTkWms) { |
| | | // throw new CoolException("未找到此条码"); |
| | | // } |
| | | |
| | | NccSaleXsfhmxWms nccSaleXsfhmxWms = nccSaleXsfhmxWmsService.selectOne(new EntityWrapper<NccSaleXsfhmxWms>() |
| | | .eq("VBILLCODE", orderNo) |
| | | .eq("WLBM", matnr) |
| | | ); |
| | | if(null == nccSaleXsfhmxWms) { |
| | | throw new CoolException("未找到销售单据"); |
| | | } |
| | | |
| | | //组装对象数据 |
| | | Map<String, Object> data = new HashMap<String, Object>(); |
| | | SaleOutHeadVO saleOutHeadVO = new SaleOutHeadVO(); |
| | | saleOutHeadVO.setPk_org("FYT"); |
| | | SaleOutBodyVO saleOutBodyVO = null; |
| | | List<SaleOutBodyVO> saleOutBodyVOList = new ArrayList<>(); |
| | | |
| | | saleOutBodyVO = new SaleOutBodyVO(); |
| | | saleOutBodyVO.setCsourcetype("4331"); |
| | | saleOutBodyVO.setCsourcebillbid(nccSaleXsfhmxWms.getCdeliverybid()); |
| | | saleOutBodyVO.setCsourcebillhid(nccSaleXsfhmxWms.getCdeliveryid()); |
| | | saleOutHeadVO.setCwarehouseid(nccSaleXsfhmxWms.getFhckbm()); |
| | | |
| | | saleOutBodyVO.setVbatchcode(batch); |
| | | saleOutBodyVO.setNnum(anfme * -1); |
| | | saleOutBodyVOList.add(saleOutBodyVO); |
| | | |
| | | data.put("SaleOutHeadVO", saleOutHeadVO); |
| | | data.put("SaleOutBodyVO", saleOutBodyVOList); |
| | | return data; |
| | | } |
| | | |
| | | private Object processZKRK(List<OrderDetl> orderDetls) { |
| | | //组装对象数据 |
| | | Map<String, Object> data = new HashMap<String, Object>(); |