110 lines
7.3 KiB
Java
110 lines
7.3 KiB
Java
package com.baiyue.firstleg.dto;
|
|
import com.baiyue.firstleg.entity.LoadingPlanItemEntity; import jakarta.validation.constraints.*; import java.math.BigDecimal; import java.time.LocalDate; import java.time.LocalDateTime; import java.util.List;
|
|
public final class SmartLoadingDtos { private SmartLoadingDtos(){}
|
|
public record ChannelSummary(String channelCode, String channelName,
|
|
long candidateInboundCount, long availablePackageCount, long availableContainerCount) {}
|
|
public enum CandidateOrderStatus { PENDING_REVIEW, WAIT_MEASURE, WAIT_SPLIT, LOADING }
|
|
public record InboundCandidateQuery(
|
|
@NotEmpty @Size(max=9) List<@NotBlank String> channelGroupCodes,
|
|
@Positive Long warehouseId, @Positive Long customerId, @Size(max=40) String inboundCode,
|
|
LocalDate createdStart, LocalDate createdEnd,
|
|
LocalDate expectedArrivalStart, LocalDate expectedArrivalEnd,
|
|
@Size(max=4) List<@NotNull CandidateOrderStatus> orderStatuses,
|
|
@Min(1) long page, @Min(1) @Max(200) long size) {
|
|
public InboundCandidateQuery {
|
|
channelGroupCodes = channelGroupCodes == null ? List.of() : List.copyOf(channelGroupCodes);
|
|
orderStatuses = orderStatuses == null ? List.of()
|
|
: List.copyOf(new java.util.LinkedHashSet<>(orderStatuses));
|
|
if (page == 0) page = 1;
|
|
if (size == 0) size = 20;
|
|
}
|
|
}
|
|
public record GroupMemberCandidate(Long accountId, Long inboundId, Long orderId, String orderNo,
|
|
String inboundCode, String customerName, Integer availablePackageCount,
|
|
String orderStatusSnapshot, LocalDateTime expectedArrivalAt) {}
|
|
public record PalletCandidate(Long palletId,String palletNo,String unitType,Boolean indivisible,
|
|
Integer cartonCount,Integer skuCount,BigDecimal weightKg,BigDecimal volumeCbm) {}
|
|
public record InboundCandidate(Long accountId, Long inboundId, Long orderId, String orderNo, String inboundCode,
|
|
Long warehouseId, String channelCode, String channelName, Long destinationWarehouseId,
|
|
String destinationWarehouseCode, String destinationWarehouseName, String customerName, String goodsSummary,
|
|
Integer availablePackageCount, BigDecimal unitGrossWeightKg, BigDecimal unitNetWeightKg,
|
|
BigDecimal averageUnitVolumeCbm, BigDecimal availableVolumeCbm,
|
|
String unitType,Long palletId,String palletNo,Boolean indivisible,
|
|
Long coLoadGroupId, String groupNo, Integer memberCount, Integer groupTotalBoxes,
|
|
Boolean locked, Boolean canAssign, String blockReason,
|
|
String orderStatusSnapshot, LocalDateTime expectedArrivalAt,
|
|
List<GroupMemberCandidate> groupMembers) {
|
|
public InboundCandidate { groupMembers = groupMembers == null ? List.of() : List.copyOf(groupMembers); }
|
|
public Long customerId() { return accountId; }
|
|
}
|
|
public record WorkbenchContainerQuery(
|
|
@NotEmpty @Size(max=9) List<@NotBlank String> channelGroupCodes,
|
|
@Positive Long warehouseId, @Positive Long customerId, @Size(max=40) String inboundCode,
|
|
LocalDate createdStart, LocalDate createdEnd,
|
|
@Min(1) long page, @Min(1) @Max(200) long size) {
|
|
public WorkbenchContainerQuery {
|
|
channelGroupCodes = channelGroupCodes == null ? List.of() : List.copyOf(channelGroupCodes);
|
|
if (page == 0) page = 1;
|
|
if (size == 0) size = 20;
|
|
}
|
|
}
|
|
public record WorkbenchContainer(Long bookingId, String cabinetNo, String containerNo,
|
|
Long warehouseId, String warehouseName, String channelGroupCode, String channelCode, String channelName, String containerType,
|
|
BigDecimal capacityCbm, BigDecimal maxWeightKg,
|
|
Long planId, String planNo, String planStatus, Integer version) {}
|
|
public record Candidate(Long accountId, Long inboundId, Long inboundDetailId, Long orderId, String orderNo, String inboundCode,
|
|
Long warehouseId, String channelCode, String channelName, Long destinationWarehouseId, String destinationWarehouseCode, String destinationWarehouseName, String customerName, String goodsName, Integer availablePackageCount,
|
|
BigDecimal unitGrossWeightKg, BigDecimal unitNetWeightKg, BigDecimal unitVolumeCbm,
|
|
Long coLoadGroupId, String groupNo, Integer memberCount, Integer groupTotalBoxes,
|
|
Boolean locked, String blockReason, String orderStatusSnapshot, LocalDateTime expectedArrivalAt) {}
|
|
public record AssignRequest(@NotNull @Positive Long inboundId,@NotNull @Positive Long inboundDetailId,
|
|
@NotNull @Positive Integer packageCount,@NotNull @Min(0) Integer expectedVersion,@NotBlank @Size(max=128) String operationId) {}
|
|
public record AssignInboundRequest(@NotNull @Positive Long inboundId,
|
|
@NotNull @Positive Integer packageCount,@NotNull @Min(0) Integer expectedVersion,
|
|
@NotBlank @Size(max=128) String operationId) {}
|
|
public record AssignPendingReviewRequest(@NotNull @Positive Long customerId,
|
|
@NotNull @Positive Long orderId,@NotBlank @Size(max=40) String inboundCode,
|
|
@NotNull @Positive Integer packageCount,
|
|
@NotNull @Min(0) Integer expectedVersion,@NotBlank @Size(max=128) String operationId) {}
|
|
public record AssignGroupRequest(@NotNull @Positive Long inboundId,
|
|
@NotNull @Min(0) Integer expectedVersion,
|
|
@NotBlank @Size(max=128) String operationId) {}
|
|
public record AssignPalletRequest(@NotNull @Positive Long palletId,@NotNull @Min(0) Integer expectedVersion,
|
|
@NotBlank @Size(max=128) String operationId) {}
|
|
public record RemovePalletRequest(@NotNull @Min(0) Integer expectedPlanVersion,
|
|
@NotBlank @Size(max=128) String operationId) {}
|
|
public record RemoveGroupRequest(@NotNull @Min(0) Integer expectedPlanVersion,
|
|
@NotBlank @Size(max=128) String operationId) {}
|
|
public record RecommendRequest(@NotNull @Min(0) Integer expectedVersion,
|
|
@NotBlank @Size(max=128) String operationId,
|
|
@Positive Long customerId, @Size(max=64) String inboundCode) {}
|
|
public record AdjustRequest(@NotNull @Positive Integer packageCount,@NotNull @Min(0) Integer expectedPlanVersion,
|
|
@NotNull @Min(0) Integer expectedItemVersion,@NotBlank @Size(max=128) String operationId) {}
|
|
public record DeleteRequest(@NotNull @Min(0) Integer expectedPlanVersion,
|
|
@NotNull @Min(0) Integer expectedItemVersion,@NotBlank @Size(max=128) String operationId) {}
|
|
public record RemoveUnpickedRequest(@NotNull @Min(0) Integer expectedPlanVersion,
|
|
@NotBlank @Size(max=128) String operationId) {}
|
|
public record RemarksRequest(@Size(max=1000) String internalRemark,
|
|
@Size(max=1000) String warehouseRemark, @Size(max=1000) String customerServiceRemark,
|
|
@NotNull @Min(0) Integer expectedPlanVersion, @NotNull @Min(0) Integer expectedItemVersion,
|
|
@NotBlank @Size(max=128) String operationId) {}
|
|
public record PlanCoLoadGroup(Long groupId,String groupNo,Long lockedPlanId,Integer memberOrderCount,
|
|
Integer inboundFragmentCount,Integer fullPackageCount,List<Long> memberInboundIds) {
|
|
public PlanCoLoadGroup { memberInboundIds=memberInboundIds==null?List.of():List.copyOf(memberInboundIds); }
|
|
}
|
|
public record PlanPalletMembers(Long palletId,List<GroupMemberCandidate> members) {
|
|
public PlanPalletMembers { members=members==null?List.of():List.copyOf(members); }
|
|
}
|
|
public record Plan(Long id,String planNo,String status,Long bookingId,String containerNo,String voyageNo,
|
|
Integer version,Boolean canAssign,Boolean canEdit,String blockedReason,String finalCompletionStatus,
|
|
Long pdaTaskId,String pdaTaskStatus,Integer pdaTaskVersion,List<PlanCoLoadGroup> coLoadGroups,
|
|
List<PlanPalletMembers> palletMembers,
|
|
List<LoadingPlanItemEntity> items) {
|
|
public Plan {
|
|
coLoadGroups=coLoadGroups==null?List.of():List.copyOf(coLoadGroups);
|
|
palletMembers=palletMembers==null?List.of():List.copyOf(palletMembers);
|
|
items=items==null?List.of():List.copyOf(items);
|
|
}
|
|
}
|
|
}
|