This commit is contained in:
2026-09-18 16:49:25 +08:00
parent fd27a0ed21
commit aedfcc3abf
@@ -754,17 +754,18 @@ public class ReceivingContainerService {
List<InboundPlan> containerPlans = plans.selectList(new LambdaQueryWrapper<InboundPlan>()
.eq(InboundPlan::getContainerNo, containerNo).orderByAsc(InboundPlan::getId));
for (InboundPlan plan : containerPlans) {
String customerId = trim(plan.getCustomerId());
if (customerId == null) throw conflict("Inbound plan has no owning customer");
for (InboundPlanLine line : lines.selectList(new LambdaQueryWrapper<InboundPlanLine>()
.eq(InboundPlanLine::getCustomerId, customerId).eq(InboundPlanLine::getPlanId, plan.getId())
.eq(InboundPlanLine::getPlanId, plan.getId())
.orderByAsc(InboundPlanLine::getId))) {
LastlegOrder order = orders.selectById(line.getOrderId());
if (order == null || !customerId.equals(order.getCustomerId())
if (order == null
|| !Objects.equals(sourceContainerBookingId, trim(order.getSourceContainerBookingId()))) continue;
String customerId = trim(plan.getCustomerId());
if (customerId == null || !customerId.equals(order.getCustomerId())
|| !customerId.equals(line.getCustomerId())
|| !Objects.equals(containerNo, trim(order.getContainerNo()))) {
throw conflict("Inbound line order is missing or belongs to another cabinet occurrence");
}
if (!Objects.equals(sourceContainerBookingId, trim(order.getSourceContainerBookingId()))) continue;
result.add(new InboundRef(plan, line, order));
}
}