Commit 80b8fa11 by guanzhenshan

解决FBA单没有显示的问题

parent 7cefa2c6
......@@ -70,7 +70,7 @@ namespace Bailun.DC.Services
}
sql += " where t1.bailun_order_status!='Canceled' and ((t1.platform_type!='FBA' and t1.bailun_order_status!='CantHandle') or t1.platform_type='FBA') and t1.has_scalp=0 and t1.has_innersale=0 and t1.bailun_interception_status in ('None','Failed') ";
sql += " where t1.bailun_order_status!='Canceled' and ((t1.platform_type!='FBA' and t1.bailun_order_status!='CantHandle') or t1.platform_type='FBA') and t1.has_scalp=0 and t1.has_innersale=0 and t1.bailun_interception_status in ('','None','Failed') ";
if (companyid.HasValue && companyid.Value > 0)
{
......@@ -172,7 +172,7 @@ namespace Bailun.DC.Services
}
sql += " where t1.bailun_order_status!='Canceled' and ((t1.platform_type!='FBA' and t1.bailun_order_status!='CantHandle') or t1.platform_type='FBA') and t1.has_scalp=0 and t1.has_innersale=0 and t1.bailun_interception_status in ('None','Failed') ";
sql += " where t1.bailun_order_status!='Canceled' and ((t1.platform_type!='FBA' and t1.bailun_order_status!='CantHandle') or t1.platform_type='FBA') and t1.has_scalp=0 and t1.has_innersale=0 and t1.bailun_interception_status in ('','None','Failed') ";
if (companyid.HasValue && companyid.Value > 0)
{
......@@ -275,7 +275,7 @@ namespace Bailun.DC.Services
}
sql += " where t1.bailun_order_status!='Canceled' and ((t1.platform_type!='FBA' and t1.bailun_order_status!='CantHandle') or t1.platform_type='FBA') and t1.has_scalp=0 and t1.has_innersale=0 and t1.bailun_interception_status in ('None','Failed') ";
sql += " where t1.bailun_order_status!='Canceled' and ((t1.platform_type!='FBA' and t1.bailun_order_status!='CantHandle') or t1.platform_type='FBA') and t1.has_scalp=0 and t1.has_innersale=0 and t1.bailun_interception_status in ('','None','Failed') ";
if (companyid.HasValue && companyid.Value > 0)
{
......@@ -392,7 +392,7 @@ namespace Bailun.DC.Services
}
}
var fromsql = " where t1.paid_time>='" + start.ToString("yyyy-MM-dd") + "' and t1.paid_time<'" + end.AddDays(1).ToString("yyyy-MM-dd") + "' and t1.platform_type='Amazon' and t1.bailun_order_status!='Canceled' and t1.has_scalp=0 and t1.has_innersale=0 and t1.bailun_interception_status in ('None','Failed') ";
var fromsql = " where t1.paid_time>='" + start.ToString("yyyy-MM-dd") + "' and t1.paid_time<'" + end.AddDays(1).ToString("yyyy-MM-dd") + "' and t1.platform_type='Amazon' and t1.bailun_order_status!='Canceled' and t1.has_scalp=0 and t1.has_innersale=0 and t1.bailun_interception_status in ('','None','Failed') ";
if (companyid.HasValue && companyid.Value > 0)
{
fromsql += "and t1.company_id = " + companyid.Value; //增加公司id判断
......@@ -499,7 +499,7 @@ namespace Bailun.DC.Services
}
}
var fromsql = " where t1.paid_time>='" + start.ToString("yyyy-MM-dd") + "' and t1.paid_time<'" + end.AddDays(1).ToString("yyyy-MM-dd") + "' and t1.platform_type='Amazon' and t1.bailun_order_status!='Canceled' and t1.has_scalp=0 and t1.has_innersale=0 and t1.bailun_interception_status in ('None','Failed') ";
var fromsql = " where t1.paid_time>='" + start.ToString("yyyy-MM-dd") + "' and t1.paid_time<'" + end.AddDays(1).ToString("yyyy-MM-dd") + "' and t1.platform_type='Amazon' and t1.bailun_order_status!='Canceled' and t1.has_scalp=0 and t1.has_innersale=0 and t1.bailun_interception_status in ('','None','Failed') ";
if (companyid.HasValue && companyid.Value > 0)
{
......@@ -587,7 +587,7 @@ namespace Bailun.DC.Services
}
}
sql += " where t1.paid_time>='" + start.ToString("yyyy-MM-dd") + "' and t1.paid_time<'" + end.AddDays(1).ToString("yyyy-MM-dd") + "' and t1.platform_type='FBA' and t1.bailun_order_status!='Canceled' and t1.has_scalp=0 and t1.has_innersale=0 and t1.bailun_interception_status in ('None','Failed') ";
sql += " where t1.paid_time>='" + start.ToString("yyyy-MM-dd") + "' and t1.paid_time<'" + end.AddDays(1).ToString("yyyy-MM-dd") + "' and t1.platform_type='FBA' and t1.bailun_order_status!='Canceled' and t1.has_scalp=0 and t1.has_innersale=0 and t1.bailun_interception_status in ('','None','Failed') ";
if (!string.IsNullOrWhiteSpace(account))
{
......@@ -667,7 +667,7 @@ namespace Bailun.DC.Services
}
}
sql += " where t1.paid_time>='" + start.ToString("yyyy-MM-dd") + "' and t1.paid_time<'" + end.AddDays(1).ToString("yyyy-MM-dd") + "' and t1.platform_type='FBA' and t1.bailun_order_status!='Canceled' and t1.has_scalp=0 and t1.has_innersale=0 and t1.bailun_interception_status in ('None','Failed') ";
sql += " where t1.paid_time>='" + start.ToString("yyyy-MM-dd") + "' and t1.paid_time<'" + end.AddDays(1).ToString("yyyy-MM-dd") + "' and t1.platform_type='FBA' and t1.bailun_order_status!='Canceled' and t1.has_scalp=0 and t1.has_innersale=0 and t1.bailun_interception_status in ('','None','Failed') ";
if (!string.IsNullOrWhiteSpace(account))
{
......@@ -736,7 +736,7 @@ namespace Bailun.DC.Services
}
}
var strwhere = " where t1.bailun_order_status!='Canceled' and ((t1.platform_type!='FBA' and t1.bailun_order_status!='CantHandle') or t1.platform_type='FBA') and t1.has_scalp=0 and t1.has_innersale=0 and t1.bailun_interception_status in ('None','Failed') ";
var strwhere = " where t1.bailun_order_status!='Canceled' and ((t1.platform_type!='FBA' and t1.bailun_order_status!='CantHandle') or t1.platform_type='FBA') and t1.has_scalp=0 and t1.has_innersale=0 and t1.bailun_interception_status in ('','None','Failed') ";
if (companyid.HasValue && companyid.Value > 0)
{
......@@ -897,7 +897,7 @@ namespace Bailun.DC.Services
}
}
var strwhere = " where t1.bailun_order_status!='Canceled' and ((t1.platform_type!='FBA' and t1.bailun_order_status!='CantHandle') or t1.platform_type='FBA') and t1.has_scalp=0 and t1.has_innersale=0 and t1.bailun_interception_status in ('None','Failed') ";
var strwhere = " where t1.bailun_order_status!='Canceled' and ((t1.platform_type!='FBA' and t1.bailun_order_status!='CantHandle') or t1.platform_type='FBA') and t1.has_scalp=0 and t1.has_innersale=0 and t1.bailun_interception_status in ('','None','Failed') ";
if (companyid.HasValue && companyid.Value > 0)
{
......@@ -1024,7 +1024,7 @@ namespace Bailun.DC.Services
var sqlparam = new DynamicParameters();
var sql = "select t1.origin_order_id,t1.platform_type,t1.website,t1.seller_account,(t1.amount_sales*t1.seller_order_exchange_rate) amount_sales,(t1.cost_platform_fee*if(t1.platform_type='Ebay',t1.seller_other_exchange_rate,t1.seller_order_exchange_rate)) cost_platform_fee,(t1.cost_promotion*t1.seller_order_exchange_rate) cost_promotion,t1.cost_first,(t1.amount_shipping*t1.seller_order_exchange_rate) amount_shipping,t1.cost_logistics,(t1.cost_fba_fee*t1.seller_order_exchange_rate) cost_fba_fee,t1.cost_total,t1.amount_total,t1.paid_time from dc_base_oms_order t1";
sql += " where t1.bailun_order_status!='Canceled' and ((t1.platform_type!='FBA' and t1.bailun_order_status!='CantHandle') or t1.platform_type='FBA') and t1.has_scalp=0 and t1.has_innersale=0 and t1.bailun_interception_status in ('None','Failed') ";
sql += " where t1.bailun_order_status!='Canceled' and ((t1.platform_type!='FBA' and t1.bailun_order_status!='CantHandle') or t1.platform_type='FBA') and t1.has_scalp=0 and t1.has_innersale=0 and t1.bailun_interception_status in ('','None','Failed') ";
if (companyid.HasValue && companyid.Value > 0)
{
......@@ -1115,7 +1115,7 @@ namespace Bailun.DC.Services
sql += " and t2.company_id=" + companyid.Value; //增加公司id过滤
}
sql += " where t1.bailun_order_status!='Canceled' and ((t1.platform_type!='FBA' and t1.bailun_order_status!='CantHandle') or t1.platform_type='FBA') and t1.has_scalp=0 and t1.has_innersale=0 and t1.bailun_interception_status in ('None','Failed') ";
sql += " where t1.bailun_order_status!='Canceled' and ((t1.platform_type!='FBA' and t1.bailun_order_status!='CantHandle') or t1.platform_type='FBA') and t1.has_scalp=0 and t1.has_innersale=0 and t1.bailun_interception_status in ('','None','Failed') ";
if (!string.IsNullOrWhiteSpace(platform))
{
......@@ -1547,7 +1547,7 @@ namespace Bailun.DC.Services
}
}
sql += " where t3.bailun_order_status!='Canceled' and ((t3.platform_type!='FBA' and t3.bailun_order_status!='CantHandle') or t3.platform_type='FBA') and t3.has_scalp=0 and t3.has_innersale=0 and t3.bailun_interception_status in ('None','Failed') and t3.has_delete=0 ";
sql += " where t3.bailun_order_status!='Canceled' and ((t3.platform_type!='FBA' and t3.bailun_order_status!='CantHandle') or t3.platform_type='FBA') and t3.has_scalp=0 and t3.has_innersale=0 and t3.bailun_interception_status in ('','None','Failed') and t3.has_delete=0 ";
if (companyid.HasValue && companyid.Value > 0)
{
sql += " and t3.company_id=" + companyid.Value; //增加公司id过滤
......@@ -1576,7 +1576,7 @@ namespace Bailun.DC.Services
}
sql += " where tb.bailun_order_status!='Canceled' and ((tb.platform_type!='FBA' and tb.bailun_order_status!='CantHandle') or tb.platform_type='FBA') and tb.has_scalp=0 and tb.has_innersale=0 and tb.bailun_interception_status in ('None','Failed') ";
sql += " where tb.bailun_order_status!='Canceled' and ((tb.platform_type!='FBA' and tb.bailun_order_status!='CantHandle') or tb.platform_type='FBA') and tb.has_scalp=0 and tb.has_innersale=0 and tb.bailun_interception_status in ('','None','Failed') ";
if (companyid.HasValue && companyid.Value > 0)
{
......@@ -1699,7 +1699,7 @@ namespace Bailun.DC.Services
}
}
sql += " where t3.bailun_order_status!='Canceled' and ((t3.platform_type!='FBA' and t3.bailun_order_status!='CantHandle') or t3.platform_type='FBA') and t3.has_scalp=0 and t3.has_innersale=0 and t3.bailun_interception_status in ('None','Failed') and t3.has_delete=0 ";
sql += " where t3.bailun_order_status!='Canceled' and ((t3.platform_type!='FBA' and t3.bailun_order_status!='CantHandle') or t3.platform_type='FBA') and t3.has_scalp=0 and t3.has_innersale=0 and t3.bailun_interception_status in ('','None','Failed') and t3.has_delete=0 ";
if (companyid.HasValue && companyid.Value > 0)
{
sql += " and t3.company_id=" + companyid.Value; //增加公司id过滤
......@@ -1787,7 +1787,7 @@ namespace Bailun.DC.Services
}
sql += " where tb.bailun_order_status!='Canceled' and ((tb.platform_type!='FBA' and tb.bailun_order_status!='CantHandle') or tb.platform_type='FBA') and tb.has_scalp=0 and tb.has_innersale=0 and tb.bailun_interception_status in ('None','Failed') and tb.has_delete=0 ";
sql += " where tb.bailun_order_status!='Canceled' and ((tb.platform_type!='FBA' and tb.bailun_order_status!='CantHandle') or tb.platform_type='FBA') and tb.has_scalp=0 and tb.has_innersale=0 and tb.bailun_interception_status in ('','None','Failed') and tb.has_delete=0 ";
if (shippingstrategy.HasValue) //1专线;2中国发货;3海外仓; 4FBA仓
......@@ -2087,7 +2087,7 @@ namespace Bailun.DC.Services
//var precolumn = "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' ";
var sql = "select t1.platform_type as platform,t1.website,sum(t1.amount_sales*t1.seller_order_exchange_rate) saleamount,count(t1.bailun_order_id) ordercount,sum(t1.cost_platform_fee*t1.seller_order_exchange_rate) platformfee,(sum(t1.amount_sales*t1.seller_order_exchange_rate)/count(t1.bailun_order_id)) customerprice,sum(t1.profit_total) profit,(sum(t1.profit_total)/sum(t1.amount_sales*t1.seller_order_exchange_rate)) profitrate,sum(t1.amount_refund*t1.seller_order_exchange_rate) returnamount,(sum(t1.amount_refund)/sum(t1.amount_sales)) returnamountrate,sum(t1.cost_first) cost_first,sum(t1.cost_logistics) cost_tail,sum(t1.cost_handle_bailun) cost_handle_bailun,sum(t1.cost_handle_platform) cost_handle_platform,sum(t1.amount_prepaid) amount_prepaid from dc_base_oms_order t1 ";
sql += " where t1.bailun_order_status!='Canceled' and ((t1.platform_type!='FBA' and t1.bailun_order_status!='CantHandle') or t1.platform_type='FBA') and t1.has_scalp=0 and t1.has_innersale=0 and t1.bailun_interception_status in ('None','Failed') ";
sql += " where t1.bailun_order_status!='Canceled' and ((t1.platform_type!='FBA' and t1.bailun_order_status!='CantHandle') or t1.platform_type='FBA') and t1.has_scalp=0 and t1.has_innersale=0 and t1.bailun_interception_status in ('','None','Failed') ";
if (companyid.HasValue && companyid.Value > 0)
{
......@@ -2145,7 +2145,7 @@ namespace Bailun.DC.Services
var sqlparam = new DynamicParameters();
var sql = "select sum(t1.amount_sales*t1.seller_order_exchange_rate) saleamount,count(t1.bailun_order_id) ordercount,sum(t1.cost_platform_fee*t1.seller_order_exchange_rate) platformfee,(sum(t1.amount_sales*t1.seller_order_exchange_rate)/count(t1.bailun_order_id)) customerprice,sum(t1.profit_total) profit,(sum(t1.profit_total)/sum(t1.amount_sales*t1.seller_order_exchange_rate)) profitrate,sum(t1.amount_refund*t1.seller_order_exchange_rate) returnamount,(sum(t1.amount_refund)/sum(t1.amount_sales)) returnamountrate,sum(t1.cost_first) cost_first,sum(t1.cost_logistics) cost_tail,sum(t1.cost_handle_bailun) cost_handle_bailun,sum(t1.cost_handle_platform) cost_handle_platform,sum(t1.amount_prepaid) amount_prepaid from dc_base_oms_order t1 ";
sql += " where t1.bailun_order_status!='Canceled' and ((t1.platform_type!='FBA' and t1.bailun_order_status!='CantHandle') or t1.platform_type='FBA') and t1.has_scalp=0 and t1.has_innersale=0 and t1.bailun_interception_status in ('None','Failed') ";
sql += " where t1.bailun_order_status!='Canceled' and ((t1.platform_type!='FBA' and t1.bailun_order_status!='CantHandle') or t1.platform_type='FBA') and t1.has_scalp=0 and t1.has_innersale=0 and t1.bailun_interception_status in ('','None','Failed') ";
if (companyid.HasValue && companyid.Value > 0)
{
......@@ -2220,7 +2220,7 @@ namespace Bailun.DC.Services
sql += " group by bailun_order_id) t2 on t1.bailun_order_id=t2.bailun_order_id ";
}
sql += " where t1.bailun_order_status!='Canceled' and ((t1.platform_type!='FBA' and t1.bailun_order_status!='CantHandle') or t1.platform_type='FBA') and t1.has_scalp=0 and t1.has_innersale=0 and t1.bailun_interception_status in ('None','Failed') ";
sql += " where t1.bailun_order_status!='Canceled' and ((t1.platform_type!='FBA' and t1.bailun_order_status!='CantHandle') or t1.platform_type='FBA') and t1.has_scalp=0 and t1.has_innersale=0 and t1.bailun_interception_status in ('','None','Failed') ";
if (!string.IsNullOrWhiteSpace(platform))
{
......@@ -2324,7 +2324,7 @@ namespace Bailun.DC.Services
sql += " group by bailun_order_id) t2 on t1.bailun_order_id=t2.bailun_order_id ";
}
sql += " where t1.bailun_order_status!='Canceled' and ((t1.platform_type!='FBA' and t1.bailun_order_status!='CantHandle') or t1.platform_type='FBA') and t1.has_scalp=0 and t1.has_innersale=0 and t1.bailun_interception_status in ('None','Failed') ";
sql += " where t1.bailun_order_status!='Canceled' and ((t1.platform_type!='FBA' and t1.bailun_order_status!='CantHandle') or t1.platform_type='FBA') and t1.has_scalp=0 and t1.has_innersale=0 and t1.bailun_interception_status in ('','None','Failed') ";
if (!string.IsNullOrWhiteSpace(platform))
{
......@@ -2408,7 +2408,7 @@ namespace Bailun.DC.Services
left join dc_base_warehouse t3 on t1.warehouse_code=t3.warehouse_code
";
sqlwhere += " where t1.bailun_order_status != 'Canceled' and ((t1.platform_type!='FBA' and t1.bailun_order_status!='CantHandle') or t1.platform_type='FBA') and t1.has_scalp=0 and t1.has_innersale=0 and t1.bailun_interception_status in ('None','Failed') ";
sqlwhere += " where t1.bailun_order_status != 'Canceled' and ((t1.platform_type!='FBA' and t1.bailun_order_status!='CantHandle') or t1.platform_type='FBA') and t1.has_scalp=0 and t1.has_innersale=0 and t1.bailun_interception_status in ('','None','Failed') ";
if (companyid.HasValue && companyid.Value > 0)
{
......@@ -2522,7 +2522,7 @@ namespace Bailun.DC.Services
left join dc_base_warehouse t3 on t1.warehouse_code=t3.warehouse_code
";
sqlwhere += " where t1.bailun_order_status != 'Canceled' and ((t1.platform_type!='FBA' and t1.bailun_order_status!='CantHandle') or t1.platform_type='FBA') and t1.has_scalp=0 and t1.has_innersale=0 and t1.bailun_interception_status in ('None','Failed') ";
sqlwhere += " where t1.bailun_order_status != 'Canceled' and ((t1.platform_type!='FBA' and t1.bailun_order_status!='CantHandle') or t1.platform_type='FBA') and t1.has_scalp=0 and t1.has_innersale=0 and t1.bailun_interception_status in ('','None','Failed') ";
if (companyid.HasValue && companyid.Value > 0)
{
......@@ -2624,7 +2624,7 @@ namespace Bailun.DC.Services
{
var sqlparam = new DynamicParameters();
var strwhere = "";
var sql = "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 ((platform_type!='FBA' and bailun_order_status!='CantHandle') or platform_type='FBA') and has_scalp=0 and has_innersale=0 and bailun_interception_status in ('None','Failed') ";
var sql = "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 ((platform_type!='FBA' and bailun_order_status!='CantHandle') or platform_type='FBA') and has_scalp=0 and has_innersale=0 and bailun_interception_status in ('','None','Failed') ";
if (companyid.HasValue && companyid.Value > 0)
{
......@@ -2710,7 +2710,7 @@ namespace Bailun.DC.Services
{
var sqlparam = new DynamicParameters();
var strwhere = "";
var sql = "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 ((platform_type!='FBA' and bailun_order_status!='CantHandle') or platform_type='FBA') and has_scalp=0 and has_innersale=0 and warehouse_code!='' and bailun_interception_status in ('None','Failed') ";
var sql = "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 ((platform_type!='FBA' and bailun_order_status!='CantHandle') or platform_type='FBA') and has_scalp=0 and has_innersale=0 and warehouse_code!='' and bailun_interception_status in ('','None','Failed') ";
if (companyid.HasValue && companyid.Value > 0)
{
......@@ -2823,7 +2823,7 @@ namespace Bailun.DC.Services
sqlparam.Add("platform_type", platform);
}
var sql = $@"select {showcol} as count,t0.platform_type,t2.category_simple_id,t2.category_simple_name from (select t1.bailun_sku,{selcol},platform_type from dc_base_oms_sku t1 where t1.has_scalp=0 and t1.has_delete=0 and t1.has_innersale=0 and t1.bailun_order_status!='Canceled' and t1.has_innersale=0 and t1.bailun_interception_status in ('None','Failed') and t1.company_id=1 and ((t1.platform_type!='FBA' and t1.bailun_order_status!='CantHandle') or t1.platform_type='FBA')
var sql = $@"select {showcol} as count,t0.platform_type,t2.category_simple_id,t2.category_simple_name from (select t1.bailun_sku,{selcol},platform_type from dc_base_oms_sku t1 where t1.has_scalp=0 and t1.has_delete=0 and t1.has_innersale=0 and t1.bailun_order_status!='Canceled' and t1.has_innersale=0 and t1.bailun_interception_status in ('','None','Failed') and t1.company_id=1 and ((t1.platform_type!='FBA' and t1.bailun_order_status!='CantHandle') or t1.platform_type='FBA')
and t1.paid_time >= '{start.ToString("yyyy-MM-dd HH:mm:ss")}' and t1.paid_time < '{end.AddDays(1).ToString("yyyy-MM-dd HH:mm:ss")}' {sqlwhere}) t0
left join dc_base_sku t2 on t0.bailun_sku = t2.bailun_sku
group by t0.platform_type,t2.category_simple_id";
......@@ -2902,7 +2902,7 @@ namespace Bailun.DC.Services
}
var fromsql = " where t1.platform_type='Ebay' and t1.bailun_order_status!='Canceled' and t1.bailun_order_status!='CantHandle' and t1.has_scalp=0 and t1.has_innersale=0 and t1.bailun_interception_status in ('None','Failed') ";
var fromsql = " where t1.platform_type='Ebay' and t1.bailun_order_status!='Canceled' and t1.bailun_order_status!='CantHandle' and t1.has_scalp=0 and t1.has_innersale=0 and t1.bailun_interception_status in ('','None','Failed') ";
if (companyid.HasValue && companyid.Value > 0)
{
......@@ -2996,7 +2996,7 @@ namespace Bailun.DC.Services
}
}
var sqlwhere = " where t1.bailun_order_status!='Canceled' and t1.has_scalp=0 and t1.has_innersale=0 and t1.bailun_interception_status in ('None','Failed') ";
var sqlwhere = " where t1.bailun_order_status!='Canceled' and t1.has_scalp=0 and t1.has_innersale=0 and t1.bailun_interception_status in ('','None','Failed') ";
if (companyid.HasValue && companyid.Value > 0)
{
......@@ -3134,7 +3134,7 @@ namespace Bailun.DC.Services
var fromsql = " where t1.bailun_order_status!='Canceled' and t1.has_scalp=0 and t1.has_innersale=0 and t1.bailun_interception_status in ('None','Failed') ";
var fromsql = " where t1.bailun_order_status!='Canceled' and t1.has_scalp=0 and t1.has_innersale=0 and t1.bailun_interception_status in ('','None','Failed') ";
if (companyid.HasValue && companyid.Value > 0)
{
......@@ -3774,7 +3774,7 @@ namespace Bailun.DC.Services
var sqlparam = new DynamicParameters();
var sql = "select t1.seller_account,(t1.amount_sales*seller_order_exchange_rate) amount_sales from dc_base_oms_order t1 where t1.bailun_order_status!='Canceled' and t1.platform_type='Ebay' and t1.bailun_order_status!='CantHandle' and t1.has_scalp=0 and t1.has_innersale=0 and t1.bailun_interception_status in ('None','Failed') ";
var sql = "select t1.seller_account,(t1.amount_sales*seller_order_exchange_rate) amount_sales from dc_base_oms_order t1 where t1.bailun_order_status!='Canceled' and t1.platform_type='Ebay' and t1.bailun_order_status!='CantHandle' and t1.has_scalp=0 and t1.has_innersale=0 and t1.bailun_interception_status in ('','None','Failed') ";
if (!string.IsNullOrWhiteSpace(account))
......@@ -3818,7 +3818,7 @@ namespace Bailun.DC.Services
{
var sqlparam = new DynamicParameters();
var sql = "select sum(t1.amount_sales*t1.seller_order_exchange_rate) amount_sales from dc_base_oms_order t1 where t1.bailun_order_status!='Canceled' and t1.platform_type='Ebay' and t1.bailun_order_status!='CantHandle' and t1.has_scalp=0 and t1.has_innersale=0 and t1.bailun_interception_status in ('None','Failed') ";
var sql = "select sum(t1.amount_sales*t1.seller_order_exchange_rate) amount_sales from dc_base_oms_order t1 where t1.bailun_order_status!='Canceled' and t1.platform_type='Ebay' and t1.bailun_order_status!='CantHandle' and t1.has_scalp=0 and t1.has_innersale=0 and t1.bailun_interception_status in ('','None','Failed') ";
if (!string.IsNullOrWhiteSpace(account))
......@@ -4236,7 +4236,7 @@ namespace Bailun.DC.Services
}
var fromsql = " where t1.bailun_order_status!='Canceled' and t1.bailun_order_status!='CantHandle' and t1.has_scalp=0 and t1.has_innersale=0 and t1.bailun_interception_status in ('None','Failed') ";
var fromsql = " where t1.bailun_order_status!='Canceled' and t1.bailun_order_status!='CantHandle' and t1.has_scalp=0 and t1.has_innersale=0 and t1.bailun_interception_status in ('','None','Failed') ";
if (!string.IsNullOrWhiteSpace(platform))
{
......@@ -4336,7 +4336,7 @@ namespace Bailun.DC.Services
}
}
var sqlwhere = " where t1.bailun_order_status!='Canceled' and t1.has_scalp=0 and t1.has_innersale=0 and t1.bailun_interception_status in ('None','Failed') ";
var sqlwhere = " where t1.bailun_order_status!='Canceled' and t1.has_scalp=0 and t1.has_innersale=0 and t1.bailun_interception_status in ('','None','Failed') ";
if (companyid.HasValue && companyid.Value > 0)
{
......@@ -4560,8 +4560,8 @@ namespace Bailun.DC.Services
public List<dc_base_oms_order> ListDepositReceived(BtTableParameter request, string platform, string website, string account, DateTime? start, DateTime? end, int? companyid, ref int total, ref dc_base_oms_order m)
{
var sqlparam = new DynamicParameters();
var sql = "select origin_order_id,bailun_order_id,platform_type,website,seller_account,paid_time,(amount_sales*seller_order_exchange_rate) amount_sales,(amount_shipping*seller_order_exchange_rate) amount_shipping,(amount_product*seller_order_exchange_rate) amount_product,(amount_tax*seller_order_exchange_rate) amount_tax,(amount_adjustment*seller_order_exchange_rate) amount_adjustment,(amount_gift_wrap*seller_order_exchange_rate) amount_gift_wrap,(amount_refund*seller_order_exchange_rate) amount_refund,amount_prepaid,(cost_promotion*seller_order_exchange_rate) cost_promotion,(cost_platform_fee*seller_order_exchange_rate) cost_platform_fee,cost_product,cost_shipping,cost_package,(cost_fba_fee*seller_order_exchange_rate) cost_fba_fee,(cost_paypal_fee*seller_order_exchange_rate) cost_paypal_fee,(cost_refund_commisson*seller_order_exchange_rate) cost_refund_commisson,cost_handle_bailun,cost_handle_platform,cost_logistics as cost_tail,cost_first,profit_total,profit_rate,(cost_total) cost_total from dc_base_oms_order where bailun_order_status='Handling' and bailun_shipping_status!='TotalShipping' and amount_prepaid>0 and has_scalp=0 and has_innersale=0 and bailun_interception_status in ('None','Failed') ";
var sqlcount = "select sum(amount_sales*seller_order_exchange_rate) amount_sales,sum(amount_shipping*seller_order_exchange_rate) amount_shipping,sum(amount_product*seller_order_exchange_rate) amount_product,sum(amount_tax*seller_order_exchange_rate) amount_tax,sum(amount_adjustment*seller_order_exchange_rate) amount_adjustment,sum(amount_gift_wrap*seller_order_exchange_rate) amount_gift_wrap,sum(amount_refund*seller_order_exchange_rate) amount_refund,sum(amount_prepaid) amount_prepaid,sum(cost_promotion*seller_order_exchange_rate) cost_promotion,sum(cost_platform_fee*seller_order_exchange_rate) cost_platform_fee,sum(cost_product) cost_product,sum(cost_shipping) cost_shipping,sum(cost_package) cost_package,sum(cost_fba_fee*seller_order_exchange_rate) cost_fba_fee,sum(cost_paypal_fee*seller_order_exchange_rate) cost_paypal_fee,sum(cost_refund_commisson*seller_order_exchange_rate) cost_refund_commisson,sum(cost_handle_bailun) cost_handle_bailun,sum(cost_handle_platform) cost_handle_platform,sum(cost_logistics) cost_tail,sum(cost_first) cost_first,sum(profit_total) profit_total,sum(cost_total) cost_total from dc_base_oms_order where bailun_order_status='Handling' and bailun_shipping_status!='TotalShipping' and has_scalp=0 and has_innersale=0 and amount_prepaid>0 and bailun_interception_status in ('None','Failed') ";
var sql = "select origin_order_id,bailun_order_id,platform_type,website,seller_account,paid_time,(amount_sales*seller_order_exchange_rate) amount_sales,(amount_shipping*seller_order_exchange_rate) amount_shipping,(amount_product*seller_order_exchange_rate) amount_product,(amount_tax*seller_order_exchange_rate) amount_tax,(amount_adjustment*seller_order_exchange_rate) amount_adjustment,(amount_gift_wrap*seller_order_exchange_rate) amount_gift_wrap,(amount_refund*seller_order_exchange_rate) amount_refund,amount_prepaid,(cost_promotion*seller_order_exchange_rate) cost_promotion,(cost_platform_fee*seller_order_exchange_rate) cost_platform_fee,cost_product,cost_shipping,cost_package,(cost_fba_fee*seller_order_exchange_rate) cost_fba_fee,(cost_paypal_fee*seller_order_exchange_rate) cost_paypal_fee,(cost_refund_commisson*seller_order_exchange_rate) cost_refund_commisson,cost_handle_bailun,cost_handle_platform,cost_logistics as cost_tail,cost_first,profit_total,profit_rate,(cost_total) cost_total from dc_base_oms_order where bailun_order_status='Handling' and bailun_shipping_status!='TotalShipping' and amount_prepaid>0 and has_scalp=0 and has_innersale=0 and bailun_interception_status in ('','None','Failed') ";
var sqlcount = "select sum(amount_sales*seller_order_exchange_rate) amount_sales,sum(amount_shipping*seller_order_exchange_rate) amount_shipping,sum(amount_product*seller_order_exchange_rate) amount_product,sum(amount_tax*seller_order_exchange_rate) amount_tax,sum(amount_adjustment*seller_order_exchange_rate) amount_adjustment,sum(amount_gift_wrap*seller_order_exchange_rate) amount_gift_wrap,sum(amount_refund*seller_order_exchange_rate) amount_refund,sum(amount_prepaid) amount_prepaid,sum(cost_promotion*seller_order_exchange_rate) cost_promotion,sum(cost_platform_fee*seller_order_exchange_rate) cost_platform_fee,sum(cost_product) cost_product,sum(cost_shipping) cost_shipping,sum(cost_package) cost_package,sum(cost_fba_fee*seller_order_exchange_rate) cost_fba_fee,sum(cost_paypal_fee*seller_order_exchange_rate) cost_paypal_fee,sum(cost_refund_commisson*seller_order_exchange_rate) cost_refund_commisson,sum(cost_handle_bailun) cost_handle_bailun,sum(cost_handle_platform) cost_handle_platform,sum(cost_logistics) cost_tail,sum(cost_first) cost_first,sum(profit_total) profit_total,sum(cost_total) cost_total from dc_base_oms_order where bailun_order_status='Handling' and bailun_shipping_status!='TotalShipping' and has_scalp=0 and has_innersale=0 and amount_prepaid>0 and bailun_interception_status in ('','None','Failed') ";
if (!string.IsNullOrEmpty(platform))
{
......@@ -6730,7 +6730,7 @@ namespace Bailun.DC.Services
}
}
sql += " where tb.bailun_order_status!='Canceled' and ((tb.platform_type!='FBA' and tb.bailun_order_status!='CantHandle') or tb.platform_type='FBA') and tb.has_scalp=0 and tb.has_innersale=0 and tb.bailun_interception_status in ('None','Failed') ";
sql += " where tb.bailun_order_status!='Canceled' and ((tb.platform_type!='FBA' and tb.bailun_order_status!='CantHandle') or tb.platform_type='FBA') and tb.has_scalp=0 and tb.has_innersale=0 and tb.bailun_interception_status in ('','None','Failed') ";
if (companyid.HasValue && companyid.Value > 0)
{
......@@ -6867,7 +6867,7 @@ namespace Bailun.DC.Services
}
var fromsql = " where t1.bailun_payment_status!='Canceled' and ((t1.platform_type!='FBA' and t1.bailun_order_status!='CantHandle') or t1.platform_type='FBA') and t1.bailun_order_status!='Canceled' and t1.has_scalp=0 and t1.has_innersale=0 and t1.bailun_interception_status in ('None','Failed') ";
var fromsql = " where t1.bailun_payment_status!='Canceled' and ((t1.platform_type!='FBA' and t1.bailun_order_status!='CantHandle') or t1.platform_type='FBA') and t1.bailun_order_status!='Canceled' and t1.has_scalp=0 and t1.has_innersale=0 and t1.bailun_interception_status in ('','None','Failed') ";
if (companyid.HasValue && companyid.Value > 0)
{
......@@ -6977,7 +6977,7 @@ namespace Bailun.DC.Services
}
}
sql += " where t3.bailun_order_status!='Canceled' and ((t3.platform_type!='FBA' and t3.bailun_order_status!='CantHandle') or t3.platform_type='FBA') and t3.has_scalp=0 and t3.has_innersale=0 and t3.bailun_interception_status in ('None','Failed') and t3.has_delete=0 and t3.bailun_sku='FJH-L-2' ";
sql += " where t3.bailun_order_status!='Canceled' and ((t3.platform_type!='FBA' and t3.bailun_order_status!='CantHandle') or t3.platform_type='FBA') and t3.has_scalp=0 and t3.has_innersale=0 and t3.bailun_interception_status in ('','None','Failed') and t3.has_delete=0 and t3.bailun_sku='FJH-L-2' ";
if (companyid.HasValue && companyid.Value > 0)
{
sql += " and t3.company_id=" + companyid.Value; //增加公司id过滤
......@@ -7057,7 +7057,7 @@ namespace Bailun.DC.Services
}
sql += " where tb.bailun_order_status!='Canceled' and ((tb.platform_type!='FBA' and tb.bailun_order_status!='CantHandle') or tb.platform_type='FBA') and tb.has_scalp=0 and tb.has_innersale=0 and tb.bailun_interception_status in ('None','Failed') and tb.bailun_sku='FJH-L-2'";
sql += " where tb.bailun_order_status!='Canceled' and ((tb.platform_type!='FBA' and tb.bailun_order_status!='CantHandle') or tb.platform_type='FBA') and tb.has_scalp=0 and tb.has_innersale=0 and tb.bailun_interception_status in ('','None','Failed') and tb.bailun_sku='FJH-L-2'";
if (shippingstrategy.HasValue) //1专线;2中国发货;3海外仓; 4FBA仓
......@@ -7785,11 +7785,11 @@ namespace Bailun.DC.Services
{
var sql = $@"select t1.platform_type,t1.bailun_sku_title_cn,t1.bailun_sku,sum(amount_product) as amount_product,sum(ordercount) as ordercount,sum(t1.bailun_sku_quantity_ordered) as bailun_sku_quantity_ordered,sum(t1.amount_sales) amount_sales,sum(cost_platform_fee) cost_platform_fee,sum(cost_product) cost_product,sum(t1.cost_logistics) cost_logistics,sum(profit_total) profit_total from (
select t1.platform_type,t1.bailun_sku_title_cn,t1.bailun_sku,sum(t1.amount_product*t1.bailun_sku_quantity_ordered*t1.seller_order_exchange_rate) as amount_product,count(DISTINCT bailun_order_id) as ordercount,sum(t1.bailun_sku_quantity_ordered) as bailun_sku_quantity_ordered,sum(t1.amount_sales*t1.bailun_sku_quantity_ordered*t1.seller_order_exchange_rate) amount_sales,sum(cost_platform_fee*t1.bailun_sku_quantity_ordered*t1.seller_order_exchange_rate) cost_platform_fee,sum(cost_product*t1.bailun_sku_quantity_ordered) cost_product,sum(t1.cost_logistics*t1.bailun_sku_quantity_ordered) cost_logistics,sum(profit_total*t1.bailun_sku_quantity_ordered) profit_total from dc_base_oms_sku t1
where t1.platform_type='{platform}' and t1.has_delete=0 and t1.company_id=1 and t1.has_scalp=0 and t1.has_innersale=0 and t1.bailun_interception_status in ('None','Failed') and t1.bailun_order_status!='Canceled' and t1.platform_type!='FBA' and t1.bailun_order_status!='CantHandle' and t1.paid_time>='{start.ToString("yyyy-MM-dd")}' and t1.paid_time<'{end.AddDays(1).ToString("yyyy-MM-dd")}'
where t1.platform_type='{platform}' and t1.has_delete=0 and t1.company_id=1 and t1.has_scalp=0 and t1.has_innersale=0 and t1.bailun_interception_status in ('','None','Failed') and t1.bailun_order_status!='Canceled' and t1.platform_type!='FBA' and t1.bailun_order_status!='CantHandle' and t1.paid_time>='{start.ToString("yyyy-MM-dd")}' and t1.paid_time<'{end.AddDays(1).ToString("yyyy-MM-dd")}'
group by t1.bailun_sku,t1.platform_type
union all
select t1.platform_type,t1.bailun_sku_title_cn,t1.bailun_sku,sum(t1.amount_product*t1.bailun_sku_quantity_ordered*t1.seller_order_exchange_rate) as amount_product,count(DISTINCT bailun_order_id) as ordercount,sum(t1.bailun_sku_quantity_ordered) as bailun_sku_quantity_ordered,sum(t1.amount_sales*t1.bailun_sku_quantity_ordered*t1.seller_order_exchange_rate) amount_sales,sum(cost_platform_fee*t1.bailun_sku_quantity_ordered*t1.seller_order_exchange_rate) cost_platform_fee,sum(cost_product*t1.bailun_sku_quantity_ordered) cost_product,sum(t1.cost_logistics*t1.bailun_sku_quantity_ordered) cost_logistics,sum(profit_total*t1.bailun_sku_quantity_ordered) profit_total from dc_base_oms_sku t1
where t1.platform_type='{platform}' and t1.has_delete=0 and t1.company_id=1 and t1.has_scalp=0 and t1.has_innersale=0 and t1.bailun_interception_status in ('None','Failed') and t1.bailun_order_status!='Canceled' and t1.platform_type='FBA' and t1.purchase_create_time>='{start.ToString("yyyy-MM-dd")}' and t1.purchase_create_time<'{end.AddDays(1).ToString("yyyy-MM-dd")}'
where t1.platform_type='{platform}' and t1.has_delete=0 and t1.company_id=1 and t1.has_scalp=0 and t1.has_innersale=0 and t1.bailun_interception_status in ('','None','Failed') and t1.bailun_order_status!='Canceled' and t1.platform_type='FBA' and t1.purchase_create_time>='{start.ToString("yyyy-MM-dd")}' and t1.purchase_create_time<'{end.AddDays(1).ToString("yyyy-MM-dd")}'
group by t1.bailun_sku,t1.platform_type) t1
group by t1.bailun_sku,t1.platform_type
limit {(page-1)*pagesize},{pagesize}";
......
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