优化
This commit is contained in:
+6
-5
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user