fix(firstleg): preserve sailing edit metadata

This commit is contained in:
2026-09-28 12:32:22 +08:00
parent 582ea098f9
commit ab64699245
2 changed files with 3 additions and 2 deletions
@@ -197,7 +197,8 @@ public final class SailingCalendarDtos {
String channelCode, String channelName, String vesselName, String voyageNo, String channelCode, String channelName, String vesselName, String voyageNo,
String departurePortCode, String destinationPortCode, LocalDateTime etdAt, String departurePortCode, String destinationPortCode, LocalDateTime etdAt,
LocalDateTime cutoffAt, String status, Integer version, LocalDateTime cutoffAt, String status, Integer version,
VolumeSummary volumeSummary) {} VolumeSummary volumeSummary, Long templateId, Long channelId,
LocalDateTime etaAt, String sourceType, BigDecimal plannedCapacityCbm) {}
public record VolumeSummary(BigDecimal actualReceivedCbm, BigDecimal catchableForecastCbm, public record VolumeSummary(BigDecimal actualReceivedCbm, BigDecimal catchableForecastCbm,
BigDecimal riskUnmatchedCbm, int bookedContainerCount, BigDecimal riskUnmatchedCbm, int bookedContainerCount,
int recommendedContainerCount, int pendingContainerCount, int recommendedContainerCount, int pendingContainerCount,
@@ -403,7 +403,7 @@ public class SailingCalendarService {
private void recordHistory(long sailingId, String action, String fromStatus, String toStatus, String reason, long operatorId, String operatorName, LocalDateTime at) { private void recordHistory(long sailingId, String action, String fromStatus, String toStatus, String reason, long operatorId, String operatorName, LocalDateTime at) {
SailingHistoryEntity history = new SailingHistoryEntity(); history.setId(IdWorker.getId()); history.setSailingId(sailingId); history.setAction(action); history.setFromStatus(fromStatus); history.setToStatus(toStatus); history.setReason(reason); history.setOperatorId(operatorId); history.setOperatorName(operatorName); history.setCreatedAt(at); repository.insertHistory(history); SailingHistoryEntity history = new SailingHistoryEntity(); history.setId(IdWorker.getId()); history.setSailingId(sailingId); history.setAction(action); history.setFromStatus(fromStatus); history.setToStatus(toStatus); history.setReason(reason); history.setOperatorId(operatorId); history.setOperatorName(operatorName); history.setCreatedAt(at); repository.insertHistory(history);
} }
private CalendarItem item(SailingEntity v) { return new CalendarItem(v.getId(), v.getSailingNo(), v.getWarehouseId(), v.getWarehouseNameSnapshot(), v.getChannelCodeSnapshot(), v.getChannelNameSnapshot(), v.getVesselName(), v.getVoyageNo(), v.getDeparturePortCode(), v.getDestinationPortCode(), v.getEtdAt(), v.getWarehouseCutoffAt(), v.getStatus(), v.getVersion(), summary(v)); } private CalendarItem item(SailingEntity v) { return new CalendarItem(v.getId(), v.getSailingNo(), v.getWarehouseId(), v.getWarehouseNameSnapshot(), v.getChannelCodeSnapshot(), v.getChannelNameSnapshot(), v.getVesselName(), v.getVoyageNo(), v.getDeparturePortCode(), v.getDestinationPortCode(), v.getEtdAt(), v.getWarehouseCutoffAt(), v.getStatus(), v.getVersion(), summary(v), v.getTemplateId(), v.getChannelId(), v.getEtaAt(), v.getSourceType(), v.getPlannedCapacityCbm()); }
private VolumeSummary summary(SailingEntity v) { private VolumeSummary summary(SailingEntity v) {
SailingCalendarDisplayMapper.ReceiptSummary received = repository.receiptSummary(v); SailingCalendarDisplayMapper.ReceiptSummary received = repository.receiptSummary(v);
BigDecimal eligibleActual = received == null ? BigDecimal.ZERO : nvl(received.catchableCbm()); BigDecimal eligibleActual = received == null ? BigDecimal.ZERO : nvl(received.catchableCbm());