Commit 4724255d by guanzhenshan

增加FBA的发货数据

parent bdfd483b
......@@ -80,12 +80,19 @@ namespace Bailun.DC.SkuDailyPurchaseAndSales
left join dc_base_warehouse t2 on t1.warehouse_code=t2.warehouse_code";
var objPutin = cn.Query<Models.mSkuCount>(sql, null, null, true, 2 * 60).AsList();
//发货的
sql = $@"select t1.warehouse_code,t3.warehouse_name,t1.bailun_sku,sum(t1.quantity_shipped) count,sum(t1.quantity_shipped*t2.unit_price) amount from dc_base_oms_pick t1
//发货的 自发货+FBA的
sql = $@"select tb.warehouse_code,tb.warehouse_name,tb.bailun_sku,sum(count) count,sum(amount) amount from (select t1.warehouse_code,t3.warehouse_name,t1.bailun_sku,sum(t1.quantity_shipped) count,sum(t1.quantity_shipped*t2.unit_price) amount from dc_base_oms_pick t1
left join dc_base_sku t2 on t1.bailun_sku=t2.bailun_sku
left join dc_base_warehouse t3 on t1.warehouse_code=t3.warehouse_code
where t1.has_delete=0 and t1.shipping_status='TotalShipping' and t1.shipping_time>='{start.ToString("yyyy-MM-dd HH:mm:ss")}' and t1.shipping_time<'{end.ToString("yyyy-MM-dd HH:mm:ss")}'
group by t1.warehouse_code,t1.bailun_sku";
group by t1.warehouse_code,t1.bailun_sku
union all
select t1.warehouse_code,t3.warehouse_name,t1.bailun_sku,sum(t1.bailun_sku_quantity_ordered) count,sum(t1.bailun_sku_quantity_ordered*t2.unit_price) amount from dc_base_oms_sku t1
left join dc_base_sku t2 on t1.bailun_sku=t2.bailun_sku
left join dc_base_warehouse t3 on t1.warehouse_code=t3.warehouse_code
where t1.paid_time>='{start.ToString("yyyy-MM-dd HH:mm:ss")}' and t1.paid_time<'{end.ToString("yyyy-MM-dd HH:mm:ss")}' and t1.bailun_order_status!='Canceled' and t1.has_scalp=0 and t1.has_delete=0 and t1.has_cancle=0 and platform_type='FBA'
group by t1.warehouse_code,t1.bailun_sku) tb
group by tb.bailun_sku,tb.warehouse_code";
var objShipping = cn.Query<Models.mSkuCount>(sql, null, null, true, 2 * 60).AsList();
var listSkuWarehouse = objPurchase.Select(a => new {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment