fix: carry partial dropship measurements to outbound
This commit is contained in:
+7
-1
@@ -17,7 +17,13 @@ public interface DropshipOrderProfileMapper extends BaseMapper<DropshipOrderProf
|
||||
"WHERE s.customer_id=p.customer_id AND s.profile_id=p.id) product_name," +
|
||||
"LEAST(pos.available_packages,(SELECT COUNT(*) FROM ll_dropship_carton c " +
|
||||
"WHERE c.customer_id=p.customer_id AND c.profile_id=p.id " +
|
||||
"AND c.status='AVAILABLE')) available_packages FROM ll_dropship_order_profile p " +
|
||||
"AND c.status='AVAILABLE')) available_packages,COALESCE(o.package_count,0) source_package_count," +
|
||||
"COALESCE((SELECT SUM(d.gross_weight_kg) FROM ll_order_detail d " +
|
||||
"WHERE d.customer_id=o.customer_id AND d.order_id=o.id)," +
|
||||
"(SELECT inbound.gross_weight_kg FROM ll_inbound_order inbound " +
|
||||
"WHERE inbound.customer_id=o.customer_id AND inbound.id=o.id LIMIT 1),0) source_gross_weight_kg," +
|
||||
"COALESCE(o.volume_weight_kg,0) source_volume_weight_kg,COALESCE(o.volume_cbm,0) source_volume_cbm " +
|
||||
"FROM ll_dropship_order_profile p " +
|
||||
"JOIN ll_order o ON o.id=p.order_id AND o.customer_id=p.customer_id " +
|
||||
"AND o.order_type='ONE_CLICK_DROPSHIP' AND COALESCE(o.detained,0)=0 " +
|
||||
"JOIN ll_inventory_position pos ON pos.id=p.inventory_position_id AND pos.customer_id=p.customer_id " +
|
||||
|
||||
+7
@@ -2,6 +2,8 @@ package com.baiyue.lastleg.dropship.model;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/** Server-authoritative one-click dropship inventory dimension eligible for outbound creation. */
|
||||
@Data
|
||||
public class DropshipOutboundCandidate {
|
||||
@@ -18,4 +20,9 @@ public class DropshipOutboundCandidate {
|
||||
private String skuCode;
|
||||
private String productName;
|
||||
private Long availablePackages;
|
||||
/** Loaded-order denominator and immutable metrics used for proportional outbound snapshots. */
|
||||
private Long sourcePackageCount;
|
||||
private BigDecimal sourceGrossWeightKg;
|
||||
private BigDecimal sourceVolumeWeightKg;
|
||||
private BigDecimal sourceVolumeCbm;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user