diff --git a/nladmin-system/wms-server/src/main/java/org/nl/wms/pm_manage/delivery/service/impl/PlatingDeliveryServiceImpl.java b/nladmin-system/wms-server/src/main/java/org/nl/wms/pm_manage/delivery/service/impl/PlatingDeliveryServiceImpl.java index 3e3945f9..8cd1a4c0 100644 --- a/nladmin-system/wms-server/src/main/java/org/nl/wms/pm_manage/delivery/service/impl/PlatingDeliveryServiceImpl.java +++ b/nladmin-system/wms-server/src/main/java/org/nl/wms/pm_manage/delivery/service/impl/PlatingDeliveryServiceImpl.java @@ -320,7 +320,8 @@ public class PlatingDeliveryServiceImpl implements PlatingDeliveryService { g -> key(portByPallet.get(g.getStoragevehicle_code()), g.getMaterial_code()), LinkedHashMap::new, Collectors.toList())); JSONArray tableData = new JSONArray(); - String storCode = null; + BsrealStorattr storattr = storeService.findById(sect.getStor_id()); + String storCode = storattr.getStor_code(); for (Map.Entry> entry : platesByKey.entrySet()) { List stock = entry.getValue(); String port = portByPallet.get(stock.get(0).getStoragevehicle_code()); @@ -332,12 +333,6 @@ public class PlatingDeliveryServiceImpl implements PlatingDeliveryService { throw new BadRequestException("托盘物料" + materialCode + "不在所选工单上料口" + port + "的BOM中"); } JSONArray sources = allocateSources(bomOfKey, orderMap, totalQty, materialCode, port); - String bomStor = resolveBomWarehouse(bomOfKey); - if (storCode == null) { - storCode = bomStor; - } else if (!storCode.equals(bomStor)) { - throw new BadRequestException("一张出库单只能对应一个仓库,请选择相同仓库的工单"); - } MdMeMaterialbase material = materialService.getByCode(materialCode); if (material == null) { throw new BadRequestException("物料不存在:" + materialCode); @@ -355,14 +350,10 @@ public class PlatingDeliveryServiceImpl implements PlatingDeliveryService { row.put("source_work_orders", sources); tableData.add(row); } - BsrealStorattr store = resolveStore(storCode); - if (store == null) { - throw new BadRequestException("仓库不存在:" + storCode); - } // 生成出库单 JSONObject bill = new JSONObject(); - bill.put("stor_code", store.getStor_code()); - bill.put("stor_id", store.getStor_id()); + bill.put("stor_code", storattr.getStor_code()); + bill.put("stor_id", storattr.getStor_id()); bill.put("biz_date", DateUtil.today()); bill.put("bill_type", IOSEnum.BILL_TYPE.code("生产出库")); bill.put("remark", "配盘配送出库:" + String.join(",", orderCodes));