| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.common.Cools; |
| | | import com.core.common.R; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.DocType; |
| | | import com.zy.asrs.entity.Order; |
| | |
| | | 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.service.NccXsckmxTkWmsService; |
| | | import com.zy.nc.util.NcResultMessage; |
| | | import com.zy.nc.vo.*; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | |
| | | @Autowired |
| | | private NccScPcdaWmsService nccScPcdaWmsService; |
| | | |
| | | @Autowired |
| | | private NccXsckmxTkWmsService nccXsckmxTkWmsService; |
| | | |
| | | @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 batch, String orderNo, Double anfme) { |
| | | Object process1 = processTKRK(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 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", nccXsckmxTkWms.getVsourcebillcode()) |
| | | .eq("WLBM", nccXsckmxTkWms.getWlbm()) |
| | | ); |
| | | 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(nccXsckmxTkWms.getCsourcebillbid()); |
| | | saleOutBodyVO.setCsourcebillhid(nccXsckmxTkWms.getCsourcebillhid()); |
| | | saleOutHeadVO.setCwarehouseid(nccSaleXsfhmxWms.getFhckbm()); |
| | | |
| | | saleOutBodyVO.setVbatchcode(nccXsckmxTkWms.getVbatchcode()); |
| | | 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>(); |