Files
baiyue-firstleg/firstleg/src/main/java/com/baiyue/firstleg/dto/DropshipPalletizationDtos.java
T
2026-10-19 16:41:20 +08:00

97 lines
5.3 KiB
Java

package com.baiyue.firstleg.dto;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Positive;
import jakarta.validation.constraints.PositiveOrZero;
import jakarta.validation.constraints.Size;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.Valid;
import java.time.LocalDateTime;
import java.util.List;
/** 一件代发测量完成后的独立 PDA 合托契约。 */
public final class DropshipPalletizationDtos {
private DropshipPalletizationDtos() {}
public record ClaimRequest(@Positive long warehouseId) {}
/** 跨票只读识别结果;确认清点前仍须领取对应任务。 */
public record ScanContext(Task task, Carton carton) {}
/** 当前实物托盘及逐客户、逐票组成。 */
public record PalletWorkspace(Pallet pallet, List<PalletMember> members) {}
public record PalletMember(Long taskId, Long inboundId, String inboundCode,
Long customerId, String customerName, Integer cartonCount) {}
public enum DiscrepancyAction { MATCH, ACCEPT_VARIANCE }
public record CountCartonRequest(@Positive long warehouseId,
@NotBlank @Size(max = 80) String boxCode,
@NotEmpty @Valid List<CountSkuLine> skuLines,
@Pattern(regexp = "DP-[0-9]{6}-[0-9]{4}") String palletNo,
@NotBlank @Size(max = 128) String operationId) {}
public record CountSkuLine(@Positive long inboundDetailId,
@NotBlank @Size(max = 128) String skuCode,
@PositiveOrZero int actualQuantity,
@NotNull DiscrepancyAction discrepancyAction,
@Size(max = 500) String discrepancyRemark) {}
public record BindPendingRequest(@Positive long warehouseId,
@NotBlank @Pattern(regexp = "DP-[0-9]{6}-[0-9]{4}") String palletNo,
@NotBlank @Size(max = 128) String operationId) {}
public record MoveCartonRequest(@Positive long warehouseId,
@Pattern(regexp = "DP-[0-9]{6}-[0-9]{4}") String targetPalletNo,
@NotBlank @Size(max = 128) String operationId) {}
public record SealPalletRequest(@Positive long warehouseId,
@NotBlank @Size(max = 128) String operationId,
@Positive int expectedVersion) {}
public record UnsealPalletRequest(@Positive long warehouseId,
@NotBlank @Size(max = 128) String operationId,
@Positive int expectedVersion) {}
public record PendingTask(Long taskId, Long inboundId, String inboundCode, Long tenantId,
String customerName, Long warehouseId, String warehouseName,
Integer totalCartons, Integer countedCartons, Integer boundCartons,
Integer unboundCartons, Integer discrepancyCartons, String taskStatus,
LocalDateTime createdAt) {}
public record Task(Long taskId, Long inboundId, String inboundCode, Long tenantId,
String customerName, Long warehouseId, String warehouseName,
Integer totalCartons, Integer countedCartons, Integer boundCartons,
Integer unboundCartons, Integer discrepancyCartons,
Integer expectedPalletCount, Integer generatedPalletCount,
Boolean palletSetupReady, String palletSetupMessage, String taskStatus,
Long assigneeId, String assigneeName, Integer version,
List<Pallet> pallets, List<Carton> unbound) {}
public record Pallet(Long palletId, String palletNo, String status,
Integer cartonCount, Integer skuCount, Integer discrepancyCartons,
java.math.BigDecimal weightKg, java.math.BigDecimal volumeCbm,
Integer version, List<SkuItem> items, List<Carton> cartons,
LocalDateTime sealedAt) {}
public record SkuItem(Long inboundId, String inboundCode, Long inboundDetailId,
String skuCode, String cargoName, Integer cartonCount, Integer skuQuantity,
List<String> cartonMarks) {}
public record Carton(Long cartonId, String boxCode, Long inboundId, String inboundCode,
List<CartonSkuLine> skuLines,
String countStatus, Long palletId, String palletNo,
Boolean canCount, String blockReason) {}
public record CartonSkuLine(Long inboundDetailId, String skuCode, String cargoName,
Integer expectedQuantity, Integer actualQuantity,
String discrepancyStatus, String discrepancyRemark) {}
public record CountResult(Carton carton, Integer countedCartons, Integer boundCartons,
Integer unboundCartons, Integer remainingCartons, Pallet pallet) {}
}