|  |  | 
 |  |  | 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; | 
 |  |  | 
 |  |  |  | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @Override | 
 |  |  |     public void reportTkrk(String batch, Double anfme) { | 
 |  |  |         Object process1 = processTKRK(batch, 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); | 
 |  |  | //        } else { | 
 |  |  | //            remark = response.getMessage() + "--" + response.getErrorStack().substring(0, 100); | 
 |  |  | //        } | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     private Object processXSFH(List<OrderDetl> orderDetls, Boolean flag) { | 
 |  |  |         //组装对象数据 | 
 |  |  | 
 |  |  |         return data; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     private Object processTKRK(String batch, Double anfme) { | 
 |  |  |         EntityWrapper<NccXsckmxTkWms> wrapper = new EntityWrapper<>(); | 
 |  |  |         wrapper.like("VBATCHCODE", batch); | 
 |  |  |         NccXsckmxTkWms nccXsckmxTkWms = nccXsckmxTkWmsService.selectOne(wrapper); | 
 |  |  |         if (null == nccXsckmxTkWms) { | 
 |  |  |             throw new CoolException("未找到此条码"); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         NccSaleXsfhmxWms nccSaleXsfhmxWms = nccSaleXsfhmxWmsService.selectOne(new EntityWrapper<NccSaleXsfhmxWms>() | 
 |  |  |                 .eq("VBILLCODE", nccXsckmxTkWms.getVsourcebillcode())); | 
 |  |  |         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.setNshouldnum(anfme * -1); | 
 |  |  |         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>(); |