Files
baiyue-firstleg/lastleg-service/src/main/java/com/baiyue/lastleg/dto/LastlegOrderRequests.java
T

131 lines
4.3 KiB
Java
Raw Normal View History

2026-08-19 16:24:02 +08:00
package com.baiyue.lastleg.dto;
import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.Size;
2026-08-26 11:05:26 +08:00
import jakarta.validation.constraints.DecimalMin;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.NotNull;
2026-08-19 16:24:02 +08:00
2026-08-26 11:05:26 +08:00
import java.math.BigDecimal;
2026-08-19 16:24:02 +08:00
import java.time.LocalDateTime;
2026-09-09 16:37:28 +08:00
import java.time.LocalDate;
2026-08-19 16:24:02 +08:00
import java.util.List;
public final class LastlegOrderRequests {
private LastlegOrderRequests() {
}
public enum SailingStage { BEFORE_DEPARTURE, AFTER_DEPARTURE }
2026-08-19 16:24:02 +08:00
public record Query(
2026-08-31 14:39:40 +08:00
@Min(1) Long page,
@Min(1) @Max(200) Long size,
2026-08-19 16:24:02 +08:00
String orderNo,
2026-08-21 14:42:40 +08:00
String orderType,
2026-08-19 16:24:02 +08:00
String inboundCode,
2026-09-06 16:02:11 +08:00
String lxCode,
2026-08-19 16:24:02 +08:00
String sourceOrderNo,
String containerNo,
2026-08-21 14:42:40 +08:00
String currentStatus,
2026-08-19 16:24:02 +08:00
String status,
2026-08-21 14:42:40 +08:00
String warehouse,
2026-08-19 16:24:02 +08:00
String transferWarehouseCode,
Boolean abnormal,
Boolean detained,
LocalDateTime createdFrom,
LocalDateTime createdTo,
SailingStage sailingStage
2026-08-19 16:24:02 +08:00
) {
public Query {
2026-08-31 14:39:40 +08:00
if (page == null || page == 0) page = 1L;
if (size == null || size == 0) size = 20L;
2026-08-19 16:24:02 +08:00
}
}
2026-08-28 13:54:32 +08:00
public record ContainerProgressQuery(
2026-08-27 17:16:33 +08:00
@Min(1) long page,
@Min(1) @Max(200) long size,
String containerNo,
LocalDateTime createdFrom,
LocalDateTime createdTo
) {
2026-08-28 13:54:32 +08:00
public ContainerProgressQuery {
2026-08-27 17:16:33 +08:00
if (page == 0) page = 1;
if (size == 0) size = 20;
}
}
2026-09-07 15:07:34 +08:00
public record ChangeReceivingWarehouse(
@NotNull Long overseasWarehouseId,
@NotNull @Min(0) Integer expectedVersion,
@Size(max = 500) String remark
) { }
2026-09-15 16:10:55 +08:00
public record ContainerArrivalTimeQuery(
@NotEmpty @Size(max = 200) List<@NotBlank @Size(max = 128) String> sourceContainerBookingIds
) { }
public record ChangeExpectedWarehouseArrival(
@NotNull LocalDateTime estimatedWarehouseArrivalAt,
@NotNull @Min(0) Integer expectedVersion,
@Size(max = 500) String remark
) { }
2026-08-19 16:24:02 +08:00
public record TransferDestination(
@NotEmpty @Size(max = 200) List<Long> orderIds,
@NotBlank @Size(max = 128) String warehouseId,
@NotBlank @Size(max = 128) String warehouseCode,
@NotBlank @Size(max = 255) String warehouseName,
@Size(max = 500) String remark
) {
}
public record SingleTransferDestination(
@NotBlank @Size(max = 128) String warehouseId,
@NotBlank @Size(max = 128) String warehouseCode,
@NotBlank @Size(max = 255) String warehouseName,
@Size(max = 500) String remark
) {
public TransferDestination withOrderId(long orderId) {
return new TransferDestination(List.of(orderId), warehouseId, warehouseCode, warehouseName, remark);
}
}
2026-08-26 11:05:26 +08:00
public record CreateFee(
2026-09-09 16:37:28 +08:00
@NotBlank @Size(max = 64) String feeItemCode,
@NotBlank @Size(max = 200) String feeItemName,
@NotBlank @Pattern(regexp = "RECEIVABLE|PAYABLE") String direction,
@NotBlank @Pattern(regexp = "CNY|USD") String currency,
2026-08-26 11:05:26 +08:00
@NotNull @DecimalMin(value = "0.01") BigDecimal amount,
2026-09-09 16:37:28 +08:00
@NotNull LocalDate businessDate,
@Min(1) Long supplierId,
@Size(max = 200) String supplierName,
@Size(max = 32) String supplierCategory,
@Pattern(regexp = "ON_ACCOUNT|DIRECT_PAID") String settlementMode,
LocalDateTime paidAt,
@Pattern(regexp = "ONLINE|BANK_TRANSFER|CASH|OTHER") String paymentMethod,
@Size(max = 128) String paymentReferenceNo,
@Size(max = 20) List<@NotBlank String> paymentVoucherFileIds,
@DecimalMin(value = "0.00", inclusive = false) BigDecimal chargeableQuantity,
@Size(max = 32) String quantityUnit,
@DecimalMin(value = "0.00", inclusive = false) BigDecimal unitPrice,
LocalDate periodStart,
LocalDate periodEnd
2026-08-26 11:05:26 +08:00
) {
}
2026-08-28 14:20:48 +08:00
public record SetPalletMergeRequired(
@NotNull Boolean palletMergeRequired
) {
}
2026-08-31 14:39:40 +08:00
public record SetPalletMergeBatch(
@NotEmpty @Size(max = 200) List<Long> orderIds,
@NotNull Boolean palletMergeRequired
) {
}
2026-08-19 16:24:02 +08:00
}