优化
This commit is contained in:
@@ -98,7 +98,7 @@ public final class LoadingPickDtos {
|
||||
) {
|
||||
}
|
||||
|
||||
public record PickItem(Long id, Long loadingPlanItemId, Long inboundId, Long inboundDetailId,
|
||||
public record PickItem(Long id, Long loadingPlanItemId, Long tenantId, Long inboundId, Long inboundDetailId,
|
||||
String orderNo, String inboundCode, String cargoName, List<String> boxCodes,
|
||||
Integer plannedPackageCount, Integer pickedPackageCount,
|
||||
String itemStatus, Integer version) {
|
||||
|
||||
@@ -12,7 +12,7 @@ import java.util.List;
|
||||
@Mapper
|
||||
public interface LoadingPickItemMapper extends BaseMapper<LoadingPickItemEntity> {
|
||||
@Select("""
|
||||
SELECT pick_item.id AS pickItemId, plan_item.order_no AS orderNo,
|
||||
SELECT pick_item.id AS pickItemId, plan_item.account_id AS tenantId, plan_item.order_no AS orderNo,
|
||||
plan_item.inbound_code AS inboundCode, label.cargo_name AS cargoName,
|
||||
label.box_code AS boxCode
|
||||
FROM fl_loading_pick_item pick_item
|
||||
@@ -27,6 +27,7 @@ public interface LoadingPickItemMapper extends BaseMapper<LoadingPickItemEntity>
|
||||
|
||||
interface CartonLabelRow {
|
||||
Long getPickItemId();
|
||||
Long getTenantId();
|
||||
String getOrderNo();
|
||||
String getInboundCode();
|
||||
String getCargoName();
|
||||
|
||||
@@ -491,7 +491,8 @@ public class LoadingPickService {
|
||||
List<PickItem> items = source.stream().map(item -> {
|
||||
List<CartonLabelRow> cartons = cartonsByItem.getOrDefault(item.getId(), List.of());
|
||||
CartonLabelRow first = cartons.isEmpty() ? null : cartons.get(0);
|
||||
return new PickItem(item.getId(), item.getLoadingPlanItemId(), item.getInboundId(),
|
||||
return new PickItem(item.getId(), item.getLoadingPlanItemId(), first == null ? null : first.getTenantId(),
|
||||
item.getInboundId(),
|
||||
item.getInboundDetailId(), first == null ? null : first.getOrderNo(),
|
||||
first == null ? null : first.getInboundCode(), first == null ? null : first.getCargoName(),
|
||||
cartons.stream().map(CartonLabelRow::getBoxCode).toList(), item.getPlannedPackageCount(),
|
||||
|
||||
Reference in New Issue
Block a user