fix:出库配送仓库问题

This commit is contained in:
zhaoyf
2026-10-25 18:31:55 +08:00
parent 9bafd6a5d0
commit 9588bbbe5c

View File

@@ -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<String, List<GroupPlate>> entry : platesByKey.entrySet()) {
List<GroupPlate> 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));