| | |
| | | private Object processDBDD(List<OrderDetl> orderDetls) { |
| | | //组装对象数据 |
| | | Map<String, Object> data = new HashMap<String, Object>(); |
| | | IaIjBill iaIjBill = new IaIjBill(); |
| | | iaIjBill.setPk_org("FYT"); |
| | | //iaIjBill.setCwarehouseid("6101"); |
| | | IaIjBillB iaIjBillB = null; |
| | | List<IaIjBillB> iaIjBillBS = new ArrayList<>(); |
| | | |
| | | String hid = ""; |
| | | List<IaIjBillB> bids = new ArrayList<>(); |
| | | for (OrderDetl orderDetl : orderDetls) { |
| | | iaIjBillB = new IaIjBillB(); |
| | | if (orderDetl.getQty() <= 0) { |
| | | continue; |
| | | } |
| | | IaIjBillB iaIjBillB = new IaIjBillB(); |
| | | String remark = orderDetl.getRemark(); |
| | | if (!Cools.isEmpty(remark)) { |
| | | NccSaleDbddWms nccSaleXsfhmxWms = JSONObject.parseObject(remark, NccSaleDbddWms.class); |
| | | iaIjBillB.setCinventoryid(nccSaleXsfhmxWms.getWlbm()); |
| | | iaIjBillB.setCinventoryvid(nccSaleXsfhmxWms.getWlbm()); |
| | | iaIjBillB.setCsrcid(nccSaleXsfhmxWms.getCbillid()); |
| | | iaIjBillB.setNnum(orderDetl.getQty().intValue() + ""); |
| | | iaIjBillB.setPk_org("FYT"); |
| | | NccScPcdaWms nccScPcdaWms = nccScPcdaWmsService.selectOne(new EntityWrapper<NccScPcdaWms>().eq("vbatchcode", orderDetl.getBatch()).eq("wlbm", orderDetl.getMatnr())); |
| | | if (nccScPcdaWms == null) { |
| | | throw new CoolException("批次[{}]物料[{}]未找到" + orderDetl.getBatch() + orderDetl.getMatnr()); |
| | | } |
| | | |
| | | Double weight = MatUtils.calcWeight(orderDetl.getMatnr(), orderDetl.getQty()); |
| | | NccSaleDbddWms nccSaleDbddWms = JSONObject.parseObject(remark, NccSaleDbddWms.class); |
| | | iaIjBillB.setBid(nccSaleDbddWms.getCbill_bid()); |
| | | iaIjBillB.setNassistnum(weight); |
| | | iaIjBillB.setNnum(orderDetl.getQty()); |
| | | iaIjBillB.setVbatchcode(orderDetl.getBatch()); |
| | | iaIjBillB.setClocationid(""); |
| | | iaIjBillB.setCstateid(nccScPcdaWms.getVcode()); |
| | | |
| | | hid = nccSaleDbddWms.getCbillid(); |
| | | } |
| | | iaIjBillBS.add(iaIjBillB); |
| | | bids.add(iaIjBillB); |
| | | } |
| | | data.put("ia_ijbill", iaIjBill); |
| | | data.put("ia_ijbill_b", iaIjBillBS); |
| | | data.put("hid", hid); |
| | | data.put("bids", bids); |
| | | return data; |
| | | } |
| | | |