158 lines
6.7 KiB
Java
158 lines
6.7 KiB
Java
package com.baiyue.firstleg.dto;
|
|
|
|
import jakarta.validation.constraints.Min;
|
|
import jakarta.validation.constraints.NotBlank;
|
|
import jakarta.validation.constraints.NotEmpty;
|
|
import jakarta.validation.constraints.NotNull;
|
|
import jakarta.validation.constraints.Pattern;
|
|
import jakarta.validation.constraints.Size;
|
|
import jakarta.validation.Valid;
|
|
|
|
import java.util.List;
|
|
import java.time.LocalDateTime;
|
|
|
|
/** PDA 装柜拣货接口模型。 */
|
|
public final class LoadingPickDtos {
|
|
private LoadingPickDtos() {
|
|
}
|
|
|
|
public record PickRequest(
|
|
@NotNull @Min(1) Long warehouseId,
|
|
@NotNull @Min(1) Integer pickedPackageCount,
|
|
@NotNull @Min(0) Integer version,
|
|
@NotBlank @Size(max = 128) String operationId
|
|
) {}
|
|
|
|
public record PalletPickRequest(
|
|
@NotNull @Min(1) Long warehouseId,
|
|
@NotBlank @Pattern(regexp = "DP-[0-9]{6}-[0-9]{4}") String palletNo,
|
|
@NotNull @Min(0) Integer expectedTaskVersion,
|
|
@NotBlank @Size(max = 128) String operationId
|
|
) {}
|
|
|
|
/** 部分拣货为该 PDA 明细的最终实际拣出箱数,不是增量。 */
|
|
public record PartialPickRequest(
|
|
@NotNull @Min(1) Long warehouseId,
|
|
@NotNull @Min(1) Integer finalPickedPackageCount,
|
|
@NotNull @Min(0) Integer version,
|
|
@NotBlank @Size(max = 128) String operationId
|
|
) {}
|
|
|
|
/** 跳拣只能发生在尚未拣出任何箱数的 PDA 明细上。 */
|
|
public record SkipRequest(
|
|
@NotNull @Min(1) Long warehouseId,
|
|
@NotNull @Min(0) Integer version,
|
|
@NotBlank @Size(max = 128) String operationId,
|
|
@Size(max = 500) String reason
|
|
) {
|
|
}
|
|
|
|
/** PDA 在线草稿只在员工提交时发送一次,服务端原子处理整批明细。 */
|
|
public record BatchRequest(
|
|
@NotNull @Min(1) Long warehouseId,
|
|
@NotNull @Min(1) Long loadingPlanId,
|
|
@NotNull @Min(1) Long containerBookingId,
|
|
@NotNull @Min(0) Integer expectedVersion,
|
|
@NotBlank @Size(max = 64) String inventorySnapshotToken,
|
|
@NotEmpty @Size(max = 500) List<@Valid BatchItemRequest> items
|
|
) {}
|
|
|
|
public record BatchItemRequest(
|
|
@NotNull @Min(1) Long itemId,
|
|
@NotBlank @Pattern(regexp = "PICK|PARTIAL|SKIP") String action,
|
|
@Min(1) Integer pickedPackageCount,
|
|
@Min(1) Integer finalPickedPackageCount,
|
|
@NotNull @Min(0) Integer version,
|
|
@Size(max = 500) String reason
|
|
) {
|
|
}
|
|
|
|
public record ClaimRequest(
|
|
@NotNull @Min(0) Integer expectedAssignmentVersion,
|
|
@NotBlank @Size(max = 128) String operationId
|
|
) {
|
|
}
|
|
|
|
public record AssignRequest(
|
|
@NotNull @Min(1) Long assigneeId,
|
|
@NotBlank @Size(max = 64) String assigneeName,
|
|
@NotNull @Min(0) Integer expectedAssignmentVersion,
|
|
@NotBlank @Size(max = 128) String operationId
|
|
) {
|
|
}
|
|
|
|
public record ReviewRequest(
|
|
@NotNull @Min(0) Integer expectedTaskVersion,
|
|
@NotBlank @Size(max = 128) String operationId,
|
|
@Size(max = 500) String remark
|
|
) {
|
|
}
|
|
|
|
/** PDA 人工确认装柜完成。拣货记录只会锁定货物,确认后才结算资源并完成装柜。 */
|
|
public record CompleteLoadingRequest(
|
|
@NotNull @Min(0) Integer expectedTaskVersion,
|
|
@NotBlank @Size(max = 128) String operationId,
|
|
@Size(max = 500) String remark
|
|
) {
|
|
}
|
|
|
|
|
|
public record PickItem(Long id, Long loadingPlanItemId, Long tenantId, Long inboundId, Long inboundDetailId,
|
|
String orderNo, String inboundCode, String cargoName, List<String> boxCodes,
|
|
List<InventoryResource> inventoryResources,
|
|
Integer plannedPackageCount, Integer pickedPackageCount,
|
|
String itemStatus, Integer version) {
|
|
}
|
|
|
|
public record Assignment(Long assigneeId, String assigneeName, Long assignedBy,
|
|
String assignedByName, String assignmentType, Integer version) {
|
|
}
|
|
|
|
public record Review(String status, Long reviewedBy, String reviewedByName,
|
|
String remark, Integer version) {
|
|
}
|
|
|
|
public record Operation(Long id, Long pickTaskId, String operationId, String actionType,
|
|
Long operatorId, String operatorName, LocalDateTime createdAt) {
|
|
}
|
|
|
|
public record CompletionCommand(Long id, String operationId, String status, Integer expectedTaskVersion, String remark,
|
|
Integer attemptCount, LocalDateTime nextRetryAt, String failureStage,
|
|
String failureCode, String requestId, String traceId,
|
|
LocalDateTime completedAt) {
|
|
}
|
|
|
|
public record Task(Long id, Long loadingPlanId, Long containerBookingId, Long inboundId,
|
|
Integer inboundVersion, Integer loadingVersion, String cabinetNo,
|
|
String currentContainerNo, String sourceType, String recordStatus,
|
|
Long mergedIntoContainerBookingId, String taskStatus,
|
|
String workflowStatus, Integer version, Assignment assignment,
|
|
Review review, CompletionCommand completionCommand, List<PickItem> items) {
|
|
}
|
|
|
|
/** PDA 工作台只展示当前作业员可领取或已领取的进行中任务。 */
|
|
public record PendingTask(Long taskId, Long loadingPlanId, Long containerBookingId,
|
|
String cabinetNo, String currentContainerNo,
|
|
String sourceType, String recordStatus, Long mergedIntoContainerBookingId,
|
|
Long warehouseId, String warehouseName, String taskStatus,
|
|
String workflowStatus, Integer version, Integer assignmentVersion,
|
|
Integer itemCount, Integer pendingItemCount) {
|
|
}
|
|
|
|
public record InventoryResource(Long blockId, Integer slotNo, Long reservationId,
|
|
Long weightResultId, Integer palletSequence, Long palletId,
|
|
Long locationId, String locationCode, Boolean sharedOverflow,
|
|
String slotStatus, Integer availablePackageCount) {
|
|
}
|
|
|
|
public record InboundInventory(Long inboundId, Integer availablePackageCount,
|
|
List<InventoryResource> resources) {
|
|
}
|
|
|
|
public record InventorySnapshot(Long taskId, Long loadingPlanId, Long containerBookingId,
|
|
String cabinetNo, Integer taskVersion, String currentContainerNo,
|
|
Long warehouseId, LocalDateTime capturedAt, String snapshotToken,
|
|
List<InboundInventory> inbounds) {
|
|
}
|
|
}
|