| | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.common.Cools; |
| | | 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.nc.SendUtil; |
| | | import com.zy.nc.entity.NccCgCgdhdWms; |
| | | import com.zy.nc.entity.NccSaleDbddWms; |
| | | import com.zy.nc.entity.NccSaleXsfhmxWms; |
| | | import com.zy.nc.entity.NccScZkmxbWms; |
| | | import com.zy.nc.entity.*; |
| | | import com.zy.nc.service.NccScPcdaWmsService; |
| | | import com.zy.nc.util.NcResultMessage; |
| | | import com.zy.nc.vo.*; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | |
| | | @Autowired |
| | | private OrderService orderService; |
| | | |
| | | @Autowired |
| | | private StoreTypeService storeTypeService; |
| | | |
| | | @Autowired |
| | | private NccScPcdaWmsService nccScPcdaWmsService; |
| | | |
| | | @Value("${NYNC.ip}") |
| | | private String nyncIp; |
| | |
| | | break; |
| | | case "转库-出库": |
| | | if (step == 1) { |
| | | process2 = processGENERALOUT2(orderDetls, memo); |
| | | process2 = processGENERALOUT2(orderDetls, order.getOperMemb(), order.getItemId(), memo); |
| | | List<Object> zkck2 = new ArrayList<>(); |
| | | zkck2.add(process2); |
| | | //发送请求 |
| | |
| | | log.info("转库-出库1response:{}", response); |
| | | memo = response.getData().toString(); |
| | | |
| | | process2 = processGENERALOUT2(orderDetls, memo); |
| | | process2 = processGENERALOUT2(orderDetls, order.getOperMemb(), order.getItemId(), memo); |
| | | List<Object> zkck2 = new ArrayList<>(); |
| | | zkck2.add(process2); |
| | | //发送请求 |
| | |
| | | * @param orderDetls |
| | | * @return |
| | | */ |
| | | private Object processGENERALOUT2(List<OrderDetl> orderDetls, String memo) { |
| | | private Object processGENERALOUT2(List<OrderDetl> orderDetls, String renyuan, String rukucangku, String memo) { |
| | | Object o = JSONObject.parseArray(memo).get(0); |
| | | JSONObject jsonObject = JSONObject.parseObject(o.toString()); |
| | | String cspecialhid = JSONObject.parseObject(jsonObject.getString("ic.WhsTransBillHeaderVO")).getString("cspecialhid"); |
| | |
| | | ic_generalout_b generalout_b = null; |
| | | List<ic_generalout_b> ic_purchasein_bs = new ArrayList<>(); |
| | | for (int i = 0; i < orderDetls.size(); i++) { |
| | | NccScPcdaWms nccScPcdaWms = nccScPcdaWmsService.selectOne(new EntityWrapper<NccScPcdaWms>().eq("vbatchcode", orderDetls.get(i).getBatch()).eq("wlbm", orderDetls.get(i).getMatnr())); |
| | | if (nccScPcdaWms == null) { |
| | | throw new CoolException("批次[{}]物料[{}]未找到" + orderDetls.get(i).getBatch() + orderDetls.get(i).getMatnr()); |
| | | } |
| | | OrderDetl orderDetl = orderDetls.get(i); |
| | | generalout_b = new ic_generalout_b(); |
| | | generalout_b.setCsourcebillbid(s.get(i)); |
| | | generalout_b.setCsourcetype("4K-01"); |
| | | generalout_b.setCsourcebillhid(cspecialhid); |
| | | generalout_b.setCmaterialvid(orderDetl.getMatnr()); |
| | | generalout_b.setCstateid(nccScPcdaWms.getVcode()); |
| | | StoreType storeType = storeTypeService.selectOne(new EntityWrapper<StoreType>().eq("store_id", orderDetl.getStandby1())); |
| | | generalout_b.setCdptvid(storeType.getDepartmentId()); |
| | | generalout_b.setBillmaker(renyuan); |
| | | StoreType storeType2 = storeTypeService.selectOne(new EntityWrapper<StoreType>().eq("store_id", rukucangku)); |
| | | generalout_b.setCotherwhid(rukucangku); |
| | | generalout_b.setCothercalbodyvid(storeType2.getDepartmentId()); |
| | | generalout_b.setNshouldassistnum(orderDetl.getQty()); |
| | | generalout_b.setVbatchcode(orderDetl.getBatch()); |
| | | ic_purchasein_bs.add(generalout_b); |