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;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
public final class LastlegOrderRequests {
|
|
|
|
|
private LastlegOrderRequests() {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public record Query(
|
|
|
|
|
@Min(1) long page,
|
|
|
|
|
@Min(1) @Max(200) long size,
|
|
|
|
|
String orderNo,
|
2026-08-21 14:42:40 +08:00
|
|
|
String orderType,
|
2026-08-19 16:24:02 +08:00
|
|
|
String inboundCode,
|
|
|
|
|
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
|
|
|
|
|
) {
|
|
|
|
|
public Query {
|
|
|
|
|
if (page == 0) page = 1;
|
|
|
|
|
if (size == 0) size = 20;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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(
|
|
|
|
|
@NotBlank @Size(max = 128) String feeItem,
|
|
|
|
|
@NotBlank @Pattern(regexp = "[A-Z]{3}") String currency,
|
|
|
|
|
@NotNull @DecimalMin(value = "0.01") BigDecimal amount,
|
|
|
|
|
@NotBlank @Pattern(regexp = "PENDING_REVIEW|APPROVED|REJECTED") String status,
|
|
|
|
|
@Size(max = 500) String supplierDescription
|
|
|
|
|
) {
|
|
|
|
|
}
|
2026-08-19 16:24:02 +08:00
|
|
|
}
|