| | |
| | | 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.entity.OrderDetl; |
| | | import com.zy.asrs.entity.StoreType; |
| | | import com.zy.asrs.service.ApiLogService; |
| | | import com.zy.asrs.service.OrderService; |
| | | import com.zy.asrs.service.ReportToThirdService; |
| | | import com.zy.asrs.service.StoreTypeService; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.service.*; |
| | | 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 ApiLogService apiLogService; |
| | | |
| | | @Autowired |
| | | private OrderService orderService; |
| | | @Autowired |
| | | private WrkDetlService wrkDetlService; |
| | | @Autowired |
| | | private InventoryCheckOrderService inventoryCheckOrderService; |
| | | @Autowired |
| | | private InventoryCheckOrderDetlService inventoryCheckOrderDetlService; |
| | | |
| | | @Autowired |
| | | private StoreTypeService storeTypeService; |
| | | |
| | | @Autowired |
| | | private NccScPcdaWmsService nccScPcdaWmsService; |
| | | |
| | | @Autowired |
| | | private NccXsckmxTkWmsService nccXsckmxTkWmsService; |
| | | |
| | | @Autowired |
| | | private NccSaleXsfhmxWmsService nccSaleXsfhmxWmsService; |
| | |
| | | |
| | | @Value("${NYNC.saveRefWhsTrans}") |
| | | private String saveRefWhsTrans; |
| | | |
| | | @Value("${NYNC.invcountAdd}") |
| | | private String invcountAdd; |
| | | |
| | | @Value("${NYNC.purchasein}") |
| | | private String purchasein; |
| | |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public boolean reportCheckOrder(InventoryCheckOrder checkOrder) { |
| | | Object process1 = processInvcount(checkOrder); |
| | | //发送请求 |
| | | NcResultMessage response = SendUtil.sendDataToNc(SendUtil.token, nyncIp + ":" + port, invcountAdd, 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) { |
| | | //组装对象数据 |
| | | Map<String, Object> data = new HashMap<String, Object>(); |
| | |
| | | return data; |
| | | } |
| | | |
| | | private Object processInvcount(InventoryCheckOrder checkOrder) { |
| | | List<InventoryCheckOrderDetl> inventoryCheckOrderDetls = inventoryCheckOrderDetlService.selectList(new EntityWrapper<InventoryCheckOrderDetl>() |
| | | .eq("order_no", checkOrder.getOrderNo())); |
| | | if (inventoryCheckOrderDetls.isEmpty()) { |
| | | throw new CoolException("盘点明细不存在"); |
| | | } |
| | | |
| | | //组装对象数据 |
| | | Map<String, Object> data = new HashMap<String, Object>(); |
| | | |
| | | //仓库id |
| | | String cwarehouseid = null; |
| | | List<InvCountBodyVO> invCountBodyVOList = new ArrayList<>(); |
| | | for (InventoryCheckOrderDetl inventoryCheckOrderDetl : inventoryCheckOrderDetls) { |
| | | List<WrkDetl> wrkDetls = wrkDetlService.selectList(new EntityWrapper<WrkDetl>() |
| | | .eq("matnr", inventoryCheckOrderDetl.getMatnr()) |
| | | .eq("batch", inventoryCheckOrderDetl.getBatch()) |
| | | ); |
| | | if (wrkDetls.isEmpty()) { |
| | | throw new CoolException("工作档明细不存在"); |
| | | } |
| | | |
| | | cwarehouseid = wrkDetls.get(0).getStandby1(); |
| | | |
| | | InvCountBodyVO invCountBodyVO = new InvCountBodyVO(); |
| | | invCountBodyVO.setCmaterialoid(inventoryCheckOrderDetl.getMatnr()); |
| | | invCountBodyVO.setVbatchcode(inventoryCheckOrderDetl.getBatch()); |
| | | invCountBodyVO.setNcountastnum(inventoryCheckOrderDetl.getCheckAnfme()); |
| | | invCountBodyVOList.add(invCountBodyVO); |
| | | } |
| | | |
| | | InvCountHeaderVO invCountHeaderVO = new InvCountHeaderVO(); |
| | | invCountHeaderVO.setPk_org("FYT"); |
| | | invCountHeaderVO.setCtrantypeid("4R-01"); |
| | | invCountHeaderVO.setCwarehouseid(cwarehouseid); |
| | | |
| | | data.put("InvCountHeaderVO", invCountHeaderVO); |
| | | data.put("InvCountBodyVO", invCountBodyVOList); |
| | | data.put("paper", "2"); |
| | | data.put("splr", "1"); |
| | | |
| | | ArrayList<Map<String, Object>> list = new ArrayList<>(); |
| | | list.add(data); |
| | | return list; |
| | | } |
| | | |
| | | private Object processZKRK(List<OrderDetl> orderDetls) { |
| | | //组装对象数据 |
| | | Map<String, Object> data = new HashMap<String, Object>(); |