暂存提交

This commit is contained in:
2026-08-19 16:24:02 +08:00
parent f5c4bf130a
commit 6acb6178da
354 changed files with 25000 additions and 198 deletions
@@ -0,0 +1,89 @@
package com.baiyue.lastleg.trucking.dto;
import jakarta.validation.constraints.DecimalMin;
import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.List;
public final class UsTruckOrderRequests {
private UsTruckOrderRequests() {}
public record Create(
@Size(max = 32) String transportType,
@NotBlank @Size(max = 255) String origin,
@Size(max = 500) String originAddress,
@NotBlank @Size(max = 255) String destination,
@Size(max = 500) String destinationAddress,
@Size(max = 32) String containerType,
@NotNull @Min(1) Integer palletCount,
@Min(0) Integer packageCount,
@NotNull @DecimalMin("0.00") BigDecimal totalWeightKg,
@NotNull @DecimalMin("0.00") BigDecimal totalVolumeCbm,
@DecimalMin("0.00") BigDecimal budgetAmount,
@Size(min = 3, max = 3) String currency,
@NotBlank @Size(max = 128) String contactName,
@NotBlank @Size(max = 128) String contactInfo,
@NotNull LocalDate requestedDate,
@Size(max = 1000) String remark,
@NotBlank @Size(max = 255) String idempotencyKey) {
/** Backward-compatible constructor for clients still sending legacy transport fields. */
public Create(String transportType, String origin, String originAddress, String destination,
String destinationAddress, String containerType, Integer packageCount,
BigDecimal totalWeightKg, BigDecimal totalVolumeCbm, BigDecimal budgetAmount,
String currency, String contactName, String contactInfo, LocalDate requestedDate,
String remark, String idempotencyKey) {
this(transportType, origin, originAddress, destination, destinationAddress, containerType,
packageCount == null || packageCount < 1 ? 1 : packageCount, packageCount,
totalWeightKg, totalVolumeCbm, budgetAmount, currency, contactName, contactInfo,
requestedDate, remark, idempotencyKey);
}
}
public record Query(
@Min(1) long page, @Min(1) @Max(200) long size,
String orderNo, String routeKeyword, String status, String transportType,
String customerId, LocalDate requestedFrom, LocalDate requestedTo) {}
public record Update(
@NotNull @Min(0) Long version,
@Size(max = 32) String transportType,
@Size(max = 255) String origin,
@Size(max = 500) String originAddress,
@Size(max = 255) String destination,
@Size(max = 500) String destinationAddress,
@Size(max = 32) String containerType,
@Min(1) Integer palletCount,
@Min(0) Integer packageCount,
@DecimalMin("0.00") BigDecimal totalWeightKg,
@DecimalMin("0.00") BigDecimal totalVolumeCbm,
@DecimalMin("0.00") BigDecimal budgetAmount,
@Size(min = 3, max = 3) String currency,
@Size(max = 128) String contactName,
@Size(max = 128) String contactInfo,
LocalDate requestedDate,
@Size(max = 1000) String remark) {}
public record ChangeStatus(
@NotNull @Min(0) Long version,
@NotBlank @Size(max = 32) String status,
@Size(max = 1000) String remark) {}
public record ReceivePallets(
@NotNull @Min(0) Long version,
@NotNull @Min(1) Integer actualPalletCount,
@Min(0) Integer packageCount,
@Size(max = 500) List<@Min(0) Integer> palletPackageCounts,
@NotBlank @Size(max = 255) String idempotencyKey,
@Size(max = 1000) String remark) {
public ReceivePallets(Long version, Integer actualPalletCount, Integer packageCount,
String idempotencyKey, String remark) {
this(version, actualPalletCount, packageCount, List.of(), idempotencyKey, remark);
}
}
}
@@ -0,0 +1,28 @@
package com.baiyue.lastleg.trucking.dto;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;
public final class UsTruckOrderResponses {
private UsTruckOrderResponses() {}
public record Summary(
Long id, String customerId, String orderNo, String transportType,
String origin, String destination, String containerType, int palletCount, int packageCount,
int receivedPalletCount, int allocatedPalletCount, int shippedPalletCount,
BigDecimal totalWeightKg, BigDecimal totalVolumeCbm, BigDecimal budgetAmount,
String currency, String contactName, String contactInfo, LocalDate requestedDate,
String status, long version, LocalDateTime createdAt, LocalDateTime updatedAt) {}
public record History(
String fromStatus, String toStatus, String operatorId, String remark, LocalDateTime createdAt) {}
public record Pallet(Long id, String palletNo, int sequenceNo, String source, String status,
Long warehousePalletId, Integer packageCount, LocalDateTime receivedAt) {}
public record Detail(
Summary summary, String originAddress, String destinationAddress, String remark,
String createdBy, List<Pallet> pallets, List<History> histories) {}
}