Commit ff8e5e10 by guanzhenshan

利润接口增加仓库编码,货值字段

parent 561e6555
...@@ -545,5 +545,10 @@ namespace Bailun.DC.Models.Orders ...@@ -545,5 +545,10 @@ namespace Bailun.DC.Models.Orders
/// 上架费 /// 上架费
/// </summary> /// </summary>
public decimal? putawayfee { get; set; } public decimal? putawayfee { get; set; }
/// <summary>
/// 货值
/// </summary>
public decimal? productvalue { get; set; }
} }
} }
...@@ -65,11 +65,10 @@ namespace Bailun.DC.Services ...@@ -65,11 +65,10 @@ 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='None' "; 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) if (companyid.HasValue && companyid.Value > 0)
{ {
...@@ -168,7 +167,7 @@ namespace Bailun.DC.Services ...@@ -168,7 +167,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='None' "; 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) if(companyid.HasValue && companyid.Value>0)
{ {
...@@ -285,7 +284,7 @@ namespace Bailun.DC.Services ...@@ -285,7 +284,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='None' "; 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) if (companyid.HasValue && companyid.Value > 0)
{ {
fromsql += "and t1.company_id = " + companyid.Value; //增加公司id判断 fromsql += "and t1.company_id = " + companyid.Value; //增加公司id判断
...@@ -390,7 +389,7 @@ namespace Bailun.DC.Services ...@@ -390,7 +389,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='None' "; 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) if (companyid.HasValue && companyid.Value > 0)
{ {
...@@ -475,7 +474,7 @@ namespace Bailun.DC.Services ...@@ -475,7 +474,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='None' "; 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)) if (!string.IsNullOrWhiteSpace(account))
{ {
...@@ -554,7 +553,7 @@ namespace Bailun.DC.Services ...@@ -554,7 +553,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='None' "; 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)) if (!string.IsNullOrWhiteSpace(account))
{ {
...@@ -631,7 +630,7 @@ namespace Bailun.DC.Services ...@@ -631,7 +630,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='None' "; 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) if (companyid.HasValue && companyid.Value>0)
{ {
...@@ -781,7 +780,7 @@ namespace Bailun.DC.Services ...@@ -781,7 +780,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='None' "; 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) if (companyid.HasValue && companyid.Value > 0)
{ {
...@@ -904,7 +903,7 @@ namespace Bailun.DC.Services ...@@ -904,7 +903,7 @@ namespace Bailun.DC.Services
sql += " and t2.company_id=" + companyid.Value; //增加公司id过滤 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.has_delete=0 and t1.bailun_interception_status='None' "; 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.has_delete=0 and t1.bailun_interception_status in ('None','Failed') ";
if (!string.IsNullOrWhiteSpace(platform)) if (!string.IsNullOrWhiteSpace(platform))
{ {
...@@ -990,7 +989,7 @@ namespace Bailun.DC.Services ...@@ -990,7 +989,7 @@ namespace Bailun.DC.Services
sql += " and t2.company_id=" + companyid.Value; //增加公司id过滤 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='None' "; 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)) if (!string.IsNullOrWhiteSpace(platform))
{ {
...@@ -1413,7 +1412,7 @@ namespace Bailun.DC.Services ...@@ -1413,7 +1412,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='None' "; 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) if (companyid.HasValue && companyid.Value > 0)
{ {
...@@ -1499,7 +1498,7 @@ namespace Bailun.DC.Services ...@@ -1499,7 +1498,7 @@ namespace Bailun.DC.Services
} }
sql += " ) t1 "; sql += " ) t1 ";
sql += " join dc_base_oms_sku t2 on t1.bailun_order_id = t2.bailun_order_id and t1.bailun_sku=t2.bailun_sku and t2.bailun_order_status != 'Canceled' and t2.has_scalp = 0 and ((t2.platform_type!='FBA' and t2.bailun_order_status!='CantHandle') or t2.platform_type='FBA') and t2.has_scalp = 0 and t2.has_innersale = 0 and t2.has_delete=0 and t2.bailun_interception_status='None'"; sql += " join dc_base_oms_sku t2 on t1.bailun_order_id = t2.bailun_order_id and t1.bailun_sku=t2.bailun_sku and t2.bailun_order_status != 'Canceled' and t2.has_scalp = 0 and ((t2.platform_type!='FBA' and t2.bailun_order_status!='CantHandle') or t2.platform_type='FBA') and t2.has_scalp = 0 and t2.has_innersale = 0 and t2.has_delete=0 ";
if (!string.IsNullOrWhiteSpace(skucategoryids)) if (!string.IsNullOrWhiteSpace(skucategoryids))
...@@ -1589,7 +1588,7 @@ namespace Bailun.DC.Services ...@@ -1589,7 +1588,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 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_tail) 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 "; 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_tail) 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='None' "; 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) if (companyid.HasValue && companyid.Value > 0)
{ {
...@@ -1647,7 +1646,7 @@ namespace Bailun.DC.Services ...@@ -1647,7 +1646,7 @@ namespace Bailun.DC.Services
var sqlparam = new DynamicParameters(); 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_tail) 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 "; 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_tail) 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='None' "; 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) if (companyid.HasValue && companyid.Value > 0)
{ {
...@@ -1722,7 +1721,7 @@ namespace Bailun.DC.Services ...@@ -1722,7 +1721,7 @@ namespace Bailun.DC.Services
sql += " group by bailun_order_id) t2 on t1.bailun_order_id=t2.bailun_order_id "; 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='None' "; 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)) if (!string.IsNullOrWhiteSpace(platform))
{ {
...@@ -1817,7 +1816,7 @@ namespace Bailun.DC.Services ...@@ -1817,7 +1816,7 @@ namespace Bailun.DC.Services
sql += " group by bailun_order_id) t2 on t1.bailun_order_id=t2.bailun_order_id "; 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='None' "; 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)) if (!string.IsNullOrWhiteSpace(platform))
{ {
...@@ -1889,7 +1888,7 @@ namespace Bailun.DC.Services ...@@ -1889,7 +1888,7 @@ namespace Bailun.DC.Services
left join dc_base_warehouse t3 on t1.warehouse_code=t3.warehouse_code 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='None' "; 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) if (companyid.HasValue && companyid.Value > 0)
{ {
...@@ -2003,7 +2002,7 @@ namespace Bailun.DC.Services ...@@ -2003,7 +2002,7 @@ namespace Bailun.DC.Services
left join dc_base_warehouse t3 on t1.warehouse_code=t3.warehouse_code 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='None' "; 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) if (companyid.HasValue && companyid.Value > 0)
{ {
...@@ -2105,7 +2104,7 @@ namespace Bailun.DC.Services ...@@ -2105,7 +2104,7 @@ namespace Bailun.DC.Services
{ {
var sqlparam = new DynamicParameters(); var sqlparam = new DynamicParameters();
var strwhere = ""; 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='None' "; 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) if (companyid.HasValue && companyid.Value > 0)
{ {
...@@ -2191,7 +2190,7 @@ namespace Bailun.DC.Services ...@@ -2191,7 +2190,7 @@ namespace Bailun.DC.Services
{ {
var sqlparam = new DynamicParameters(); var sqlparam = new DynamicParameters();
var strwhere = ""; 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='None' "; 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) if (companyid.HasValue && companyid.Value > 0)
{ {
...@@ -2324,7 +2323,7 @@ namespace Bailun.DC.Services ...@@ -2324,7 +2323,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='None' "; 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) if (companyid.HasValue && companyid.Value > 0)
{ {
...@@ -2416,7 +2415,7 @@ namespace Bailun.DC.Services ...@@ -2416,7 +2415,7 @@ namespace Bailun.DC.Services
} }
} }
var sqlwhere = " 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='None' "; var sqlwhere = " 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 (companyid.HasValue && companyid.Value > 0) if (companyid.HasValue && companyid.Value > 0)
{ {
...@@ -2547,7 +2546,7 @@ namespace Bailun.DC.Services ...@@ -2547,7 +2546,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='None' "; 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 (companyid.HasValue && companyid.Value > 0) if (companyid.HasValue && companyid.Value > 0)
{ {
...@@ -2692,8 +2691,8 @@ namespace Bailun.DC.Services ...@@ -2692,8 +2691,8 @@ namespace Bailun.DC.Services
public List<dc_base_finance_ebay> ListEbayFee(int page, int pagesize, DateTime start, DateTime end, string[] feetype) public List<dc_base_finance_ebay> ListEbayFee(int page, int pagesize, DateTime start, DateTime end, string[] feetype)
{ {
var sqlparam = new DynamicParameters(); var sqlparam = new DynamicParameters();
var sql = $"select account_entry_type,description,bj_date,gross_amount,item_id,account_id,currency,exchange_rate,company_id from dc_base_finance_ebay where bj_date>='{start.ToString("yyyy-MM-dd HH:mm:ss")}' and bj_date<'{end.ToString("yyyy-MM-dd HH:mm:ss")}' and account_entry_type in ('{string.Join("','",feetype)}') "; var sql = $"select id,account_entry_type,description,bj_date,gross_amount,item_id,account_id,currency,exchange_rate,company_id from dc_base_finance_ebay where bj_date>='{start.ToString("yyyy-MM-dd HH:mm:ss")}' and bj_date<'{end.ToString("yyyy-MM-dd HH:mm:ss")}' and account_entry_type in ('{string.Join("','",feetype)}') ";
var sqllimit = "limit " + (page - 1) * pagesize + "," + pagesize; var sqllimit = " limit " + (page - 1) * pagesize + "," + pagesize;
using (var cn = new MySqlConnection(Common.GlobalConfig.ConnectionString)) using (var cn = new MySqlConnection(Common.GlobalConfig.ConnectionString))
{ {
...@@ -2702,7 +2701,7 @@ namespace Bailun.DC.Services ...@@ -2702,7 +2701,7 @@ namespace Bailun.DC.Services
cn.Open(); cn.Open();
} }
var list = cn.Query<dc_base_finance_ebay>(sql, null, null, true, 2 * 60); var list = cn.Query<dc_base_finance_ebay>(sql+ sqllimit, null, null, true, 2 * 60);
return list.AsList(); return list.AsList();
} }
...@@ -3147,8 +3146,8 @@ namespace Bailun.DC.Services ...@@ -3147,8 +3146,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) 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 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_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='None'"; 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_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_tail) 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='None' "; 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_tail) 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)) if (!string.IsNullOrEmpty(platform))
{ {
...@@ -3387,10 +3386,10 @@ namespace Bailun.DC.Services ...@@ -3387,10 +3386,10 @@ namespace Bailun.DC.Services
/// <returns></returns> /// <returns></returns>
public List<dc_base_oms_sku> ListOrderSkuProfit(int page, int pagesize, DateTime start, DateTime end) public List<dc_base_oms_sku> ListOrderSkuProfit(int page, int pagesize, DateTime start, DateTime end)
{ {
var sql = $@"select t1.platform_type,t1.seller_account,t1.bailun_account_id,t1.website,t1.bailun_order_id,t1.origin_order_id,t1.transaction_id,t1.paid_time,t1.gmt_modified,t1.bailun_sku,(t1.amount_sales*t1.seller_order_exchange_rate*t2.quantity_shipped) amount_sales,(t1.profit_total*t2.quantity_shipped) profit_total,t1.company_id,t2.pick_order_id,t2.shipping_time,t2.has_delete var sql = $@"select t1.id,t2.warehouse_code,((((t1.amount_product-t1.cost_platform_fee)*t1.seller_order_exchange_rate)-t1.cost_logistics-t1.cost_handle_bailun)*t2.quantity_shipped) as productvalue, t1.platform_type,t1.seller_account,t1.bailun_account_id,t1.website,t1.bailun_order_id,t1.origin_order_id,t1.transaction_id,t1.paid_time,t1.gmt_modified,t1.bailun_sku,(t1.amount_sales*t1.seller_order_exchange_rate*t2.quantity_shipped) amount_sales,t1.profit_total,t2.quantity_shipped as platform_sku_quantity_shipped,t1.company_id,t2.pick_order_id,t2.shipping_time,t2.has_delete
from dc_base_oms_sku t1 from dc_base_oms_sku t1
join dc_base_oms_pick t2 on t1.bailun_order_id = t2.bailun_order_id and t1.bailun_sku = t2.bailun_sku and t2.shipping_time >= '{start.ToString("yyyy-MM-dd HH:mm:ss")}' and t2.shipping_time < '{end.ToString("yyyy-MM-dd HH:mm:ss")}' and t2.shipping_status = 'TotalShipping' and t2.company_id = 1 join dc_base_oms_pick t2 on t1.bailun_order_id = t2.bailun_order_id and t1.bailun_sku = t2.bailun_sku and t2.shipping_time >= '{start.ToString("yyyy-MM-dd HH:mm:ss")}' and t2.shipping_time < '{end.ToString("yyyy-MM-dd HH:mm:ss")}' and t2.shipping_status = 'TotalShipping' and t2.company_id = 1
where t1.bailun_order_status != 'Canceled' and t1.has_scalp = 0 and t1.bailun_order_status != 'CantHandle' and t1.has_scalp = 0 and t1.has_innersale = 0 and t1.company_id = 1 and t1.has_delete = 0 and t1.bailun_interception_status='None' "; where t1.bailun_order_status != 'Canceled' and t1.has_scalp = 0 and t1.bailun_order_status != 'CantHandle' and t1.has_scalp = 0 and t1.has_innersale = 0 and t1.company_id = 1 and t1.has_delete = 0 and t1.bailun_interception_status in ('None','Failed') ";
using (var cn = new MySqlConnection(Common.GlobalConfig.ConnectionString)) using (var cn = new MySqlConnection(Common.GlobalConfig.ConnectionString))
{ {
...@@ -3817,7 +3816,7 @@ namespace Bailun.DC.Services ...@@ -3817,7 +3816,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='None' "; 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) if (companyid.HasValue && companyid.Value > 0)
{ {
...@@ -3954,7 +3953,7 @@ namespace Bailun.DC.Services ...@@ -3954,7 +3953,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='None' "; 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) if (companyid.HasValue && companyid.Value > 0)
{ {
......
...@@ -239,6 +239,11 @@ namespace Bailun.DC.Web.Controllers ...@@ -239,6 +239,11 @@ namespace Bailun.DC.Web.Controllers
a.bailun_account_id, a.bailun_account_id,
a.shipping_time, a.shipping_time,
a.has_delete, a.has_delete,
quantity_shipped = a.bailun_sku_quantity_shipped,
a.warehouse_code,
a.id,
a.productvalue,
}); });
return Json(new { return Json(new {
...@@ -284,7 +289,8 @@ namespace Bailun.DC.Web.Controllers ...@@ -284,7 +289,8 @@ namespace Bailun.DC.Web.Controllers
"PaypalOnFile", "PaypalOnFile",
"PrivateListing", "PrivateListing",
"SubscriptionSMBasic", "SubscriptionSMBasic",
"SubtitleFee"}; "SubtitleFee"
};
} }
else if (m.type == 2) //广告费 else if (m.type == 2) //广告费
{ {
...@@ -298,6 +304,7 @@ namespace Bailun.DC.Web.Controllers ...@@ -298,6 +304,7 @@ namespace Bailun.DC.Web.Controllers
var obj = new Services.OrdersServices().ListEbayFee(m.page, pagesize, m.start, m.end, arrtype.ToArray()); var obj = new Services.OrdersServices().ListEbayFee(m.page, pagesize, m.start, m.end, arrtype.ToArray());
var list = obj.Select(a => new { var list = obj.Select(a => new {
a.id,
a.account_entry_type, a.account_entry_type,
a.description, a.description,
bj_date = a.bj_date.Value.ToString("yyyy-MM-dd HH:mm:ss"), bj_date = a.bj_date.Value.ToString("yyyy-MM-dd HH:mm:ss"),
......
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