varsql=@"select platform_type,seller_account,website,sum(amount_sales*seller_order_exchange_rate) 'amount_product',sum(cost_product) 'cost_product',sum(cost_platform_fee*seller_order_exchange_rate) 'platform_fee',sum(cost_first) 'head_fee',count(id) 'order_count',sum(cost_total) 'cost_count',sum(cost_shipping) 'nofba_logisticsfee',sum(profit_total) 'profit_count',(sum(profit_total)/sum(amount_total*seller_order_exchange_rate)) 'profit_rate',sum(amount_prepaid) amount_prepaid,sum(amount_refund*seller_order_exchange_rate) amount_refund,sum(cost_fba_fee*seller_order_exchange_rate) cost_fba_fee,sum(cost_paypal_fee*seller_order_exchange_rate) cost_paypal_fee,sum(cost_package) cost_package,count(amount_prepaid>0 or null) as noshippingcount from dc_base_oms_order where paid_time>='"+start.ToString("yyyy-MM-dd")+"' and paid_time<'"+end.AddDays(1).ToString("yyyy-MM-dd")+"' and platform_type='FBA' and bailun_order_status!='Canceled' ";
varsql=@"select platform_type,seller_account,website,sum(amount_sales*seller_order_exchange_rate) 'amount_product',sum(cost_product) 'cost_product',sum(cost_platform_fee*seller_order_exchange_rate) 'platform_fee',sum(cost_first) 'head_fee',count(id) 'order_count',sum(cost_total) 'cost_count',sum(cost_shipping) 'nofba_logisticsfee',sum(profit_total) 'profit_count',(sum(profit_total)/sum(amount_total*seller_order_exchange_rate)) 'profit_rate',sum(amount_prepaid) amount_prepaid,sum(amount_refund*seller_order_exchange_rate) amount_refund,sum(cost_fba_fee*seller_order_exchange_rate) cost_fba_fee,sum(cost_paypal_fee*seller_order_exchange_rate) cost_paypal_fee,sum(cost_package) cost_package,count(amount_prepaid>0 or null) as noshippingcount from dc_base_oms_order where paid_time>='"+start.ToString("yyyy-MM-dd")+"' and paid_time<'"+end.AddDays(1).ToString("yyyy-MM-dd")+"' and platform_type='FBA' and bailun_order_status!='Canceled' and bailun_order_status!='CantHandle'";
if(!string.IsNullOrWhiteSpace(account))
{
...
...
@@ -388,7 +388,7 @@ namespace Bailun.DC.Services
{
varsqlparam=newDynamicParameters();
varsql=@"select sum(amount_sales*seller_order_exchange_rate) 'amount_product',sum(cost_product) 'cost_product',sum(cost_platform_fee*seller_order_exchange_rate) 'platform_fee',sum(cost_first) 'head_fee',count(id) 'order_count',sum(cost_total) 'cost_count',sum(cost_shipping) 'nofba_logisticsfee',sum(profit_total) 'profit_count',(sum(profit_total)/sum(amount_product*seller_order_exchange_rate)) 'profit_rate',sum(amount_prepaid) amount_prepaid,sum(amount_refund*seller_order_exchange_rate) amount_refund,sum(cost_fba_fee*seller_order_exchange_rate) cost_fba_fee,sum(cost_paypal_fee*seller_order_exchange_rate) cost_paypal_fee,sum(cost_package) cost_package,count(amount_prepaid>0 or null) as noshippingcount from dc_base_oms_order where paid_time>='"+start.ToString("yyyy-MM-dd")+"' and paid_time<'"+end.AddDays(1).ToString("yyyy-MM-dd")+"' and platform_type='FBA' and bailun_order_status!='Canceled' ";
varsql=@"select sum(amount_sales*seller_order_exchange_rate) 'amount_product',sum(cost_product) 'cost_product',sum(cost_platform_fee*seller_order_exchange_rate) 'platform_fee',sum(cost_first) 'head_fee',count(id) 'order_count',sum(cost_total) 'cost_count',sum(cost_shipping) 'nofba_logisticsfee',sum(profit_total) 'profit_count',(sum(profit_total)/sum(amount_product*seller_order_exchange_rate)) 'profit_rate',sum(amount_prepaid) amount_prepaid,sum(amount_refund*seller_order_exchange_rate) amount_refund,sum(cost_fba_fee*seller_order_exchange_rate) cost_fba_fee,sum(cost_paypal_fee*seller_order_exchange_rate) cost_paypal_fee,sum(cost_package) cost_package,count(amount_prepaid>0 or null) as noshippingcount from dc_base_oms_order where paid_time>='"+start.ToString("yyyy-MM-dd")+"' and paid_time<'"+end.AddDays(1).ToString("yyyy-MM-dd")+"' and platform_type='FBA' and bailun_order_status!='Canceled' and bailun_order_status!='CantHandle'";
sql="select origin_order_id,sum(bailun_sku_quantity_ordered) as bailun_sku_quantity_ordered from dc_base_oms_sku where bailun_order_status!='Canceled' and origin_order_id in ('"+string.Join("','",arr)+"') group by origin_order_id ";
sql="select origin_order_id,sum(bailun_sku_quantity_ordered) as bailun_sku_quantity_ordered from dc_base_oms_sku where bailun_order_status!='Canceled' and bailun_order_status!='CantHandle' and origin_order_id in ('"+string.Join("','",arr)+"') group by origin_order_id ";
varsql="select origin_order_id,platform_type,website,seller_account,platform_order_type,bailun_sku,amount_product,cost_first,amount_shipping,cost_promotion,cost_shipping,cost_fba_fee,cost_platform_fee,cost_package,amount_total,cost_total+cost_shipping as cost_total,paid_time,seller_order_exchange_rate,finance_order_exchange_rate from dc_base_oms_sku where bailun_order_status!='Canceled'";
varsql="select origin_order_id,platform_type,website,seller_account,platform_order_type,bailun_sku,amount_product,cost_first,amount_shipping,cost_promotion,cost_shipping,cost_fba_fee,cost_platform_fee,cost_package,amount_total,cost_total+cost_shipping as cost_total,paid_time,seller_order_exchange_rate,finance_order_exchange_rate from dc_base_oms_sku where bailun_order_status!='Canceled' and bailun_order_status!='CantHandle' ";
varsql="select sum(amount_product) amount_product,sum(cost_first) cost_first,sum(amount_shipping) amount_shipping,sum(cost_promotion) cost_promotion,sum(cost_shipping) cost_shipping,sum(cost_fba_fee) cost_fba_fee,sum(cost_platform_fee) cost_platform_fee,sum(cost_package) cost_package,sum(amount_total) amount_total,sum(cost_total+cost_shipping) as cost_total from dc_base_oms_sku where bailun_order_status!='Canceled'";
varsql="select sum(amount_product) amount_product,sum(cost_first) cost_first,sum(amount_shipping) amount_shipping,sum(cost_promotion) cost_promotion,sum(cost_shipping) cost_shipping,sum(cost_fba_fee) cost_fba_fee,sum(cost_platform_fee) cost_platform_fee,sum(cost_package) cost_package,sum(amount_total) amount_total,sum(cost_total+cost_shipping) as cost_total from dc_base_oms_sku where bailun_order_status!='Canceled' and bailun_order_status!='CantHandle' ";
varstrwhere="select t1.origin_order_id,t1.platform_type,t1.website,t1.seller_account,t1.bailun_sku,t1.order_currency,t1.cost_fba_fee,(t1.fba_fee_rmb*t1.seller_order_exchange_rate) fba_fee_rmb,t2.average_fba_fee,t2.min_fba_fee,t2.max_fba_fee,t1.create_time,t1.seller_order_exchange_rate from dc_base_oms_sku t1 join dc_mid_fba_fee_avg t2 on t1.bailun_sku=t2.bailun_sku and t1.website=t2.website where t1.bailun_order_status!='Canceled' and t1.platform_type in ('Amazon','FBA') and t1.has_fba_exception=1";
varstrwhere="select t1.origin_order_id,t1.platform_type,t1.website,t1.seller_account,t1.bailun_sku,t1.order_currency,t1.cost_fba_fee,(t1.fba_fee_rmb*t1.seller_order_exchange_rate) fba_fee_rmb,t2.average_fba_fee,t2.min_fba_fee,t2.max_fba_fee,t1.create_time,t1.seller_order_exchange_rate from dc_base_oms_sku t1 join dc_mid_fba_fee_avg t2 on t1.bailun_sku=t2.bailun_sku and t1.website=t2.website where t1.bailun_order_status!='Canceled' and t1.bailun_order_status!='CantHandle' and t1.platform_type in ('Amazon','FBA') and t1.has_fba_exception=1";
varstrwhere="select origin_order_id,bailun_order_id,seller_account,amount_product,cost_platform_fee,(cost_platform_fee/amount_product) platform_fee_rate,platform_type,website,create_time from dc_base_oms_order where bailun_order_status!='Canceled' and has_platform_exception=1 ";
varstrwhere="select origin_order_id,bailun_order_id,seller_account,amount_product,cost_platform_fee,(cost_platform_fee/amount_product) platform_fee_rate,platform_type,website,create_time from dc_base_oms_order where bailun_order_status!='Canceled' and bailun_order_status!='CantHandle' and has_platform_exception=1 ";
varstrwhere="select sum(amount_product) amount_product,sum(cost_platform_fee) cost_platform_fee from dc_base_oms_order where bailun_order_status!='Canceled' and has_platform_exception=1 ";
varstrwhere="select sum(amount_product) amount_product,sum(cost_platform_fee) cost_platform_fee from dc_base_oms_order where bailun_order_status!='Canceled' and bailun_order_status!='CantHandle' and has_platform_exception=1 ";
if(!string.IsNullOrWhiteSpace(platform))
{
...
...
@@ -997,7 +997,7 @@ namespace Bailun.DC.Services
sql+=" left join dc_base_oms_pick t1 on tb.bailun_order_id =t1.bailun_order_id ";
}
sql+=" where tb.bailun_order_status!='Canceled' and tb.has_scalp=0 ";
sql+=" where tb.bailun_order_status!='Canceled' and tb.bailun_order_status!='CantHandle' and tb.has_scalp=0 ";
varprecolumn="select website,platform_type as platform,sum(amount_prepaid) amount_prepaid from dc_base_oms_sku where bailun_order_status!='Canceled' ";
varsql="select platform_type as platform,website,sum(amount_sales*seller_order_exchange_rate*bailun_sku_quantity_shipped) saleamount,count(bailun_order_id) ordercount,sum(cost_platform_fee*seller_order_exchange_rate*bailun_sku_quantity_shipped) platformfee,(sum(amount_sales*seller_order_exchange_rate*bailun_sku_quantity_shipped)/count(bailun_order_id)) customerprice,sum(profit_total*bailun_sku_quantity_shipped) profit,(sum(profit_total)/sum(amount_sales*seller_order_exchange_rate)) profitrate,sum(amount_refund*seller_order_exchange_rate*bailun_sku_quantity_shipped) returnamount,(sum(amount_refund)/sum(amount_sales)) returnamountrate,sum(cost_first*bailun_sku_quantity_shipped) cost_first,sum(cost_tail*bailun_sku_quantity_shipped) cost_tail,sum(cost_handle_bailun*bailun_sku_quantity_shipped) cost_handle_bailun,sum(cost_handle_platform*bailun_sku_quantity_shipped) cost_handle_platform from dc_base_oms_sku where bailun_order_status!='Canceled' and bailun_sku_quantity_shipped>0";
varprecolumn="select website,platform_type as platform,sum(amount_prepaid) amount_prepaid from dc_base_oms_sku where bailun_order_status!='Canceled' and bailun_order_status!='CantHandle' ";
varsql="select platform_type as platform,website,sum(amount_sales*seller_order_exchange_rate*bailun_sku_quantity_shipped) saleamount,count(bailun_order_id) ordercount,sum(cost_platform_fee*seller_order_exchange_rate*bailun_sku_quantity_shipped) platformfee,(sum(amount_sales*seller_order_exchange_rate*bailun_sku_quantity_shipped)/count(bailun_order_id)) customerprice,sum(profit_total*bailun_sku_quantity_shipped) profit,(sum(profit_total)/sum(amount_sales*seller_order_exchange_rate)) profitrate,sum(amount_refund*seller_order_exchange_rate*bailun_sku_quantity_shipped) returnamount,(sum(amount_refund)/sum(amount_sales)) returnamountrate,sum(cost_first*bailun_sku_quantity_shipped) cost_first,sum(cost_tail*bailun_sku_quantity_shipped) cost_tail,sum(cost_handle_bailun*bailun_sku_quantity_shipped) cost_handle_bailun,sum(cost_handle_platform*bailun_sku_quantity_shipped) cost_handle_platform from dc_base_oms_sku where bailun_order_status!='Canceled' and bailun_order_status!='CantHandle' and bailun_sku_quantity_shipped>0";
varsql="select sum(amount_sales*seller_order_exchange_rate*bailun_sku_quantity_shipped) saleamount,count(bailun_order_id) ordercount,sum(cost_platform_fee*seller_order_exchange_rate*bailun_sku_quantity_shipped) platformfee,(sum(amount_sales*seller_order_exchange_rate*bailun_sku_quantity_shipped)/count(bailun_order_id)) customerprice,sum(profit_total*bailun_sku_quantity_shipped) profit,(sum(profit_total)/sum(amount_sales*seller_order_exchange_rate)) profitrate,sum(amount_refund*seller_order_exchange_rate*bailun_sku_quantity_shipped) returnamount,(sum(amount_refund)/sum(amount_sales)) returnamountrate,sum(cost_first*bailun_sku_quantity_shipped) cost_first,sum(cost_tail*bailun_sku_quantity_shipped) cost_tail,sum(cost_handle_bailun*bailun_sku_quantity_shipped) cost_handle_bailun,sum(cost_handle_platform*bailun_sku_quantity_shipped) cost_handle_platform from dc_base_oms_sku where bailun_order_status!='Canceled' and bailun_sku_quantity_shipped>0";
varprecolumn="select sum(amount_prepaid) amount_prepaid from dc_base_oms_sku where bailun_order_status!='Canceled' ";
varsql="select sum(amount_sales*seller_order_exchange_rate*bailun_sku_quantity_shipped) saleamount,count(bailun_order_id) ordercount,sum(cost_platform_fee*seller_order_exchange_rate*bailun_sku_quantity_shipped) platformfee,(sum(amount_sales*seller_order_exchange_rate*bailun_sku_quantity_shipped)/count(bailun_order_id)) customerprice,sum(profit_total*bailun_sku_quantity_shipped) profit,(sum(profit_total)/sum(amount_sales*seller_order_exchange_rate)) profitrate,sum(amount_refund*seller_order_exchange_rate*bailun_sku_quantity_shipped) returnamount,(sum(amount_refund)/sum(amount_sales)) returnamountrate,sum(cost_first*bailun_sku_quantity_shipped) cost_first,sum(cost_tail*bailun_sku_quantity_shipped) cost_tail,sum(cost_handle_bailun*bailun_sku_quantity_shipped) cost_handle_bailun,sum(cost_handle_platform*bailun_sku_quantity_shipped) cost_handle_platform from dc_base_oms_sku where bailun_order_status!='Canceled' and bailun_order_status!='CantHandle' and bailun_sku_quantity_shipped>0";
varprecolumn="select sum(amount_prepaid) amount_prepaid from dc_base_oms_sku where bailun_order_status!='Canceled' and bailun_order_status!='CantHandle'";
varsql="select platform_type,bailun_sku,warehouse_name,count(origin_order_id) ordercount,sum(bailun_sku_quantity_ordered) count,sum(bailun_sku_quantity_shipped) shippingcount from dc_base_oms_sku where bailun_order_status!='Canceled' and warehouse_code!='' ";
varsql="select platform_type,bailun_sku,warehouse_name,count(origin_order_id) ordercount,sum(bailun_sku_quantity_ordered) count,sum(bailun_sku_quantity_shipped) shippingcount from dc_base_oms_sku where bailun_order_status!='Canceled' and warehouse_code!='' and bailun_order_status!='CantHandle'";
varsql="select count(origin_order_id) ordercount,sum(bailun_sku_quantity_ordered) count,sum(bailun_sku_quantity_shipped) shippingcount from dc_base_oms_sku where bailun_order_status!='Canceled' and warehouse_code!='' ";
varsql="select count(origin_order_id) ordercount,sum(bailun_sku_quantity_ordered) count,sum(bailun_sku_quantity_shipped) shippingcount from dc_base_oms_sku where bailun_order_status!='Canceled' and bailun_order_status!='CantHandle' and warehouse_code!='' ";