test: complete phase3 phase4 acceptance coverage

This commit is contained in:
2026-08-25 00:24:43 +08:00
parent 84ad5e779a
commit 73d206e3f3
21 changed files with 908 additions and 69 deletions
@@ -87,6 +87,25 @@ public interface OutboundDispatchReadMapper {
SELECT 'TRUCK_APPOINTMENT',h.action,h.from_status,h.to_status,h.operator_id,h.operator_name,h.reason,h.created_at
FROM fl_truck_appointment_history h WHERE h.appointment_id=#{truckAppointmentId}
UNION ALL
SELECT 'CUSTOMS',h.action,h.from_status,h.to_status,h.operator_id,h.operator_name,h.note,h.created_at
FROM fl_customs_history h JOIN fl_customs_case customs_case ON customs_case.id=h.customs_case_id
WHERE customs_case.tenant_id=#{tenantId} AND customs_case.order_id=#{orderId}
AND customs_case.inbound_id=#{inboundId} AND customs_case.container_booking_id=#{containerBookingId}
UNION ALL
SELECT 'SAILING_SCHEDULE',h.action,NULL,NULL,h.operator_id,h.operator_name,h.reason,h.created_at
FROM fl_port_schedule_history h JOIN fl_port_schedule port_schedule ON port_schedule.id=h.port_schedule_id
WHERE port_schedule.customer_id=#{tenantId} AND port_schedule.ocean_booking_id=#{oceanBookingId}
AND port_schedule.container_booking_id=#{containerBookingId}
AND EXISTS (
SELECT 1 FROM fl_loading_plan_item schedule_item
JOIN fl_loading_plan schedule_plan ON schedule_plan.id=schedule_item.loading_plan_id
JOIN fl_inbound_order schedule_inbound ON schedule_inbound.id=schedule_item.inbound_id
AND schedule_inbound.tenant_id=schedule_item.account_id AND schedule_inbound.deleted=0
WHERE schedule_item.deleted=0 AND schedule_plan.container_booking_id=port_schedule.container_booking_id
AND schedule_inbound.tenant_id=#{tenantId} AND schedule_inbound.order_id=#{orderId}
AND schedule_inbound.id=#{inboundId}
)
UNION ALL
SELECT 'OUTBOUND_DISPATCH',h.action,h.from_status,h.to_status,h.operator_id,h.operator_name,h.remark,h.created_at
FROM fl_outbound_dispatch_history h WHERE h.tenant_id=#{tenantId} AND h.inbound_id=#{inboundId}
AND h.container_booking_id=#{containerBookingId}
@@ -95,6 +114,7 @@ public interface OutboundDispatchReadMapper {
List<TimelineItem> timeline(@Param("tenantId") long tenantId, @Param("inboundId") long inboundId,
@Param("containerBookingId") long containerBookingId,
@Param("loadingPlanId") long loadingPlanId,
@Param("orderId") long orderId,
@Param("oceanBookingId") Long oceanBookingId,
@Param("truckAppointmentId") Long truckAppointmentId);
@@ -57,6 +57,6 @@ public class OutboundDispatchRepository {
}
public List<TimelineItem> timeline(OutboundDispatchReadMapper.Binding binding, Long oceanId, Long truckId) {
return reads.timeline(binding.tenantId(), binding.inboundId(), binding.containerBookingId(),
binding.loadingPlanId(), oceanId, truckId);
binding.loadingPlanId(), binding.orderId(), oceanId, truckId);
}
}