Commit 6abef815 by guanzhenshan

增加登录验证

parent 7ef335b1
......@@ -42,7 +42,7 @@ namespace Bailun.DC.Services
sql += " group by tb.bailun_order_id limit 1) t2 on t1.bailun_order_id=t2.bailun_order_id ";
}
sql += " where t1.bailun_order_status!='Canceled' ";
sql += " where t1.bailun_order_status!='Canceled' and t1.bailun_order_status!='CantHandle' ";
if (!string.IsNullOrEmpty(platform))
{
......@@ -109,7 +109,7 @@ namespace Bailun.DC.Services
sql += " group by tb.bailun_order_id limit 1) t2 on t1.bailun_order_id=t2.bailun_order_id ";
}
sql += " where t1.bailun_order_status!='Canceled' ";
sql += " where t1.bailun_order_status!='Canceled' and t1.bailun_order_status!='CantHandle'";
if (!string.IsNullOrEmpty(platform))
{
......@@ -210,7 +210,7 @@ namespace Bailun.DC.Services
}
var prefromsql = fromsql;
fromsql += " and t1.bailun_payment_status!='Canceled'";
fromsql += " and t1.bailun_payment_status!='Canceled' and t1.bailun_order_status!='CantHandle'";
fromsql += " group by seller_account,website,platform_type";
if (!string.IsNullOrWhiteSpace(parameter.sort))
......@@ -303,7 +303,7 @@ namespace Bailun.DC.Services
}
var prefromsql = fromsql;
fromsql += " and t1.bailun_payment_status!='Canceled'";
fromsql += " and t1.bailun_payment_status!='Canceled' and t1.bailun_order_status!='CantHandle'";
using (var cn = new MySqlConnection(Common.GlobalConfig.ConnectionString))
{
......@@ -341,7 +341,7 @@ namespace Bailun.DC.Services
var sqlparam = new DynamicParameters();
var sql = @"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' ";
var sql = @"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
{
var sqlparam = new DynamicParameters();
var sql = @"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' ";
var sql = @"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'";
if (!string.IsNullOrWhiteSpace(account))
{
......@@ -435,7 +435,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.platform_order_type,t1.bailun_order_status,t1.bailun_payment_status,t1.bailun_shipping_status,t1.order_currency,(t1.amount_total*t1.seller_order_exchange_rate) amount_total,(t1.amount_shipping*t1.seller_order_exchange_rate) amount_shipping,(t1.amount_product*t1.seller_order_exchange_rate) amount_product,(t1.amount_adjustment*t1.seller_order_exchange_rate) amount_adjustment,(t1.cost_promotion*t1.seller_order_exchange_rate) cost_promotion,((if(t1.platform_type='Ebay',t1.seller_other_exchange_rate,t1.seller_order_exchange_rate))*t1.cost_platform_fee) cost_platform_fee,t1.cost_product,t1.cost_first,t1.cost_package,(t1.cost_fba_fee*t1.seller_order_exchange_rate) cost_fba_fee,t1.cost_total,(t1.profit_total) profit_total,t1.profit_rate,t1.create_time,t1.order_update_time from dc_base_oms_order t1";
var strwhere = " where t1.bailun_order_status!='Canceled' ";
var strwhere = " where t1.bailun_order_status!='Canceled' and t1.bailun_order_status!='CantHandle' ";
if (!string.IsNullOrWhiteSpace(platform))
{
......@@ -503,7 +503,7 @@ namespace Bailun.DC.Services
var obj = cn.Page<Models.Orders.dc_base_oms_order>(parameter.pageIndex, parameter.limit, sql + strwhere, ref total, sqlparam);
var list = obj.AsList();
var arr = list.Select(p => p.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 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 ";
var skucounts = cn.Query<Models.Orders.dc_base_oms_sku>(sql);
foreach (var item in list)
......@@ -534,7 +534,7 @@ namespace Bailun.DC.Services
var sqlparam = new DynamicParameters();
var sql = "select sum(t1.amount_total*seller_order_exchange_rate) amount_total,sum(t1.amount_shipping*seller_order_exchange_rate) amount_shipping,sum(t1.amount_product*seller_order_exchange_rate) amount_product,sum(t1.amount_adjustment*seller_order_exchange_rate) amount_adjustment,sum(t1.cost_promotion*seller_order_exchange_rate) cost_promotion,sum((if(t1.platform_type='FBA',t1.seller_other_exchange_rate,t1.seller_order_exchange_rate))*t1.cost_platform_fee) cost_platform_fee,sum(t1.cost_product) cost_product,sum(t1.cost_first) cost_first,sum(t1.cost_package) cost_package,sum(t1.cost_fba_fee*seller_order_exchange_rate) cost_fba_fee,sum(t1.cost_total) cost_total,sum(t1.profit_total) profit_total from dc_base_oms_order t1";
var strwhere = " where t1.bailun_order_status!='Canceled' ";
var strwhere = " where t1.bailun_order_status!='Canceled' and t1.bailun_order_status!='CantHandle' ";
if (!string.IsNullOrWhiteSpace(platform))
{
......@@ -625,7 +625,7 @@ namespace Bailun.DC.Services
public List<Models.Orders.dc_base_oms_sku> ListFinanceFee(BtTableParameter parameter,string platform, int feetype, int feecharacter, string account, DateTime? start, DateTime? end, string orderno, ref int total)
{
var sqlparam = new DynamicParameters();
var sql = "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'";
var sql = "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' ";
if (!string.IsNullOrWhiteSpace(platform))
{
......@@ -703,7 +703,7 @@ namespace Bailun.DC.Services
public Models.Orders.dc_base_oms_sku ListFinanceFeeCount(string platform, int feetype, int feecharacter, string account, DateTime? start, DateTime? end, string orderno)
{
var sqlparam = new DynamicParameters();
var sql = "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'";
var sql = "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' ";
if (!string.IsNullOrWhiteSpace(platform))
{
......@@ -777,7 +777,7 @@ namespace Bailun.DC.Services
public List<Models.Orders.mFBAAbnormalOrder> ListFbaAbnormalOrder(BtTableParameter parameter, string account, string website, DateTime? start, DateTime? end, string orderno, ref int total)
{
var sqlparam = new DynamicParameters();
var strwhere = "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";
var strwhere = "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";
if (!string.IsNullOrWhiteSpace(website))
{
......@@ -836,7 +836,7 @@ namespace Bailun.DC.Services
public List<Models.Orders.dc_base_oms_order> ListPlatformFeeAbnormal(BtTableParameter parameter, string platform, string account, string website, string orderno, DateTime? start, DateTime? end, ref int total)
{
var sqlparam = new DynamicParameters();
var strwhere = "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 ";
var strwhere = "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 ";
if (!string.IsNullOrWhiteSpace(platform))
{
......@@ -920,7 +920,7 @@ namespace Bailun.DC.Services
public Models.Orders.dc_base_oms_order ListPlatformFeeAbnormalCount(string platform, string account, string website, string orderno, DateTime? start, DateTime? end)
{
var sqlparam = new DynamicParameters();
var strwhere = "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 ";
var strwhere = "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 ";
if (!string.IsNullOrWhiteSpace(platform))
{
......@@ -1072,7 +1072,7 @@ namespace Bailun.DC.Services
sql += " group by bailun_order_id) t2 on tb.bailun_order_id=t2.bailun_order_id ";
sql += " where bailun_order_status!='Canceled' and tb.has_scalp=0 ";
sql += " where tb.bailun_order_status!='Canceled' and tb.has_scalp=0 and tb.bailun_order_status!='CantHandle' ";
if (!string.IsNullOrWhiteSpace(platform))
{
......@@ -1119,8 +1119,8 @@ namespace Bailun.DC.Services
{
var sqlparam = new DynamicParameters();
var precolumn = "select website,platform_type as platform,sum(amount_prepaid) amount_prepaid from dc_base_oms_sku where bailun_order_status!='Canceled' ";
var sql = "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";
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 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";
if (!string.IsNullOrWhiteSpace(platform))
{
......@@ -1189,8 +1189,8 @@ namespace Bailun.DC.Services
public Models.Orders.mPlatformProfit ListPlatformProfitByWebSiteCount(string platform, DateTime? start, DateTime? end, BtTableParameter parameter, ref int total)
{
var sqlparam = new DynamicParameters();
var sql = "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";
var precolumn = "select sum(amount_prepaid) amount_prepaid from dc_base_oms_sku where bailun_order_status!='Canceled' ";
var sql = "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";
var precolumn = "select sum(amount_prepaid) amount_prepaid from dc_base_oms_sku where bailun_order_status!='Canceled' and bailun_order_status!='CantHandle'";
if (!string.IsNullOrWhiteSpace(platform))
{
......@@ -1349,7 +1349,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'";
sql += " where t1.bailun_order_status!='Canceled' and t1.bailun_order_status!='CantHandle' ";
if (!string.IsNullOrWhiteSpace(platform))
{
......@@ -1416,7 +1416,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' ";
sqlwhere += " where t1.bailun_order_status != 'Canceled' and t1.bailun_order_status!='CantHandle' ";
sqlwhere += " and t1.platform_type"+(isFBA==1?"":"!")+"='FBA'";
......@@ -1525,7 +1525,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' ";
sqlwhere += " where t1.bailun_order_status != 'Canceled' and t1.bailun_order_status!='CantHandle' ";
sqlwhere += " and t1.platform_type" + (isFBA == 1 ? "" : "!") + "='FBA'";
......@@ -1622,7 +1622,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!='' ";
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 bailun_order_status!='CantHandle'";
if (!string.IsNullOrWhiteSpace(platform))
{
......@@ -1703,7 +1703,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 warehouse_code!='' ";
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 bailun_order_status!='CantHandle' and warehouse_code!='' ";
if (!string.IsNullOrWhiteSpace(platform))
{
......@@ -1809,7 +1809,7 @@ namespace Bailun.DC.Services
}
}
var fromsql = " where platform_type='Ebay' and bailun_order_status!='Canceled' ";
var fromsql = " where platform_type='Ebay' and bailun_order_status!='Canceled' and bailun_order_status!='CantHandle' ";
if (!string.IsNullOrWhiteSpace(account))
{
......@@ -1890,7 +1890,7 @@ namespace Bailun.DC.Services
var presql = "select platform_type,seller_account,website,sum(amount_prepaid) as amount_prepaid from dc_base_oms_sku t1 ";
//var sql = @"select t1.platform_type,t1.seller_account,t1.website,sum(t1.amount_product*t1.seller_order_exchange_rate) 'amount_product',sum(t1.cost_product) 'cost_product',sum(t1.cost_platform_fee*t1.seller_other_exchange_rate) 'cost_platform_fee',sum(t1.cost_first) 'cost_first',count(t1.id) 'order_count',sum(t1.cost_total) 'cost_total',sum(t1.cost_shipping) 'cost_shipping',sum(t1.profit_total) 'profit_total',(sum(t1.profit_total)/sum(t1.amount_total*t1.seller_order_exchange_rate)) 'profit_rate',sum(t1.amount_prepaid) amount_prepaid,sum(t1.amount_refund*t1.seller_order_exchange_rate) amount_refund from dc_base_oms_order t1";
var sqlwhere = " where platform_type='Ebay' and bailun_order_status!='Canceled' ";
var sqlwhere = " where platform_type='Ebay' and bailun_order_status!='Canceled' and bailun_order_status!='CantHandle' ";
if (!string.IsNullOrEmpty(warehousetype) || (!string.IsNullOrEmpty(warehousetype) && !string.IsNullOrEmpty(warehousecode)))
{
......@@ -2003,7 +2003,7 @@ namespace Bailun.DC.Services
}
}
var fromsql = " where platform_type='Ebay' and bailun_order_status!='Canceled' ";
var fromsql = " where platform_type='Ebay' and bailun_order_status!='Canceled' and bailun_order_status!='CantHandle' ";
if (!string.IsNullOrWhiteSpace(account))
{
......@@ -2371,11 +2371,7 @@ namespace Bailun.DC.Services
if (!string.IsNullOrEmpty(request.sort))
{
sql += " order by @orderby";
sqlparam.Add("orderby", request.sort);
sql += " @sorttype";
sqlparam.Add("sorttype", request.order);
sql += (" order by "+request.sort+" "+request.order);
}
using (var cn = new MySqlConnection(Common.GlobalConfig.ConnectionString))
......
......@@ -631,7 +631,14 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
amount_prepaid = p.amount_prepaid.ToString("N2"),
cost_product = p.cost_product.ToString("N2"),
noshippingcount = p.noshippingcount.ToString("N0")
});
}).ToList();
var objEbay = list.Where(a => a.platform_type == "Ebay").FirstOrDefault();
if (objEbay != null)
{
list.Remove(objEbay);
list.Insert(3, objEbay);
}
return Json(list);
}
......
......@@ -11,10 +11,18 @@ namespace Bailun.DC.Web.Base
{
public class BaseController: Controller
{
public BaseController()
{
//private readonly IHttpContextAccessor _contextAccessor;
}
//public BaseController(IHttpContextAccessor contextAccessor)
//{
// _contextAccessor = contextAccessor;
// var cookie = HttpContext.Request.Cookies["BLUserAcct"];
// if (cookie == null)
// {
// HttpContext.Response.Redirect(ConfigHelper.GetByName("LoginUrl"), true);
// }
//}
#region Excel表格导出
......
......@@ -97,5 +97,36 @@ namespace Bailun.DC.Web.Controllers
return Json(result);
}
[HttpPost]
public JsonResult GetUserInfo(string acc)
{
var strResult = Common.HttpHelper.NetHelper.HttpPost(ConfigHelper.GetByName("GetUser"), "BLUserAcct=" + acc + "&webcode=wuliu");
try
{
var obj = Newtonsoft.Json.Linq.JObject.Parse(strResult);
if (obj["code"].ToString() != "0")
{
return Json(new
{
success = true,
userid = Convert.ToInt32(obj["data"]["UserId"].ToString().Trim()),
username = obj["data"]["UserName"].ToString().Trim(),
jobs = obj["data"]["Jobs"].ToString().Trim()
});
}
}
catch
{
}
return Json(new
{
success = false
});
}
}
}
\ No newline at end of file
......@@ -27,6 +27,10 @@
<link href="css/hplus/css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">
<link href="css/hplus/css/animate.min.css" rel="stylesheet">
<link href="css/hplus/css/style.min862f.css?v=4.1.0" rel="stylesheet">
<script src="css/hplus/js/jquery.min.js?v=2.1.4"></script>
<script src="~/js/jquery.cookie.js" type="text/javascript"></script>
<script src="~/js/common.js" type="text/javascript"></script>
</head>
<body class="fixed-sidebar full-height-layout gray-bg" style="overflow:hidden">
......@@ -330,7 +334,6 @@
<!--右侧部分结束-->
</div>
<script src="css/hplus/js/jquery.min.js?v=2.1.4"></script>
<script src="css/hplus/js/bootstrap.min.js?v=3.3.6"></script>
<script src="css/hplus/js/plugins/metisMenu/jquery.metisMenu.js"></script>
<script src="css/hplus/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
......@@ -338,5 +341,6 @@
<script src="css/hplus/js/hplus.min.js?v=4.1.0"></script>
<script type="text/javascript" src="css/hplus/js/contabs.min.js"></script>
<script src="css/hplus/js/plugins/pace/pace.min.js"></script>
</body>
</html>
......@@ -30,8 +30,11 @@ namespace Bailun.DC.Web
options.MinimumSameSitePolicy = SameSiteMode.None;
});
//עsession
services.AddSession();
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
......@@ -61,6 +64,9 @@ namespace Bailun.DC.Web
//app.UseMvcWithDefaultRoute();
// session
app.UseSession();
app.UseMvc(routes =>
{
routes.MapRoute(name: "areaRoute",
......@@ -71,7 +77,7 @@ namespace Bailun.DC.Web
name: "default",
template: "{controller=Home}/{action=Index}/{id?}");
});
}
}
}
......@@ -8,6 +8,8 @@
"FeeUrl": "http://api.fee.bailuntec.com/purchase/other/cost/api/manageCostList",
"cn_str": "server=gz-cdb-kp7s5i79.sql.tencentcdb.com;port=61691;database=bailun_datacenter;uid=root;password=#7kfnymAM$Y9-Ntf;",
"cwUrl": "http://cw.bailuntec.com/api/api/GetRepayPlanDetails",
"rootFilePath": "C:\\WebSite\\DataCenter-NetCore2"
"rootFilePath": "C:\\WebSite\\DataCenter-NetCore2",
"LoginUrl": "http://www.bailuntec.com/Login/Index?guid=dbc0cffc7f4d11e8a4ca246e96754d42",
"LoginOutUrl": "http://www.bailuntec.com/Login/LoginOut",
"GetUser": "http://www.bailuntec.com/Login/GetUserByBLUserAcct"
}
var baseUrl = '';
var baseUrl = 'http://localhost:50181/';
var globalOrderSort='';
var globalOrderType='';
var globalOrderType = '';
var userid;
var username;
var jobs;
function OnlyTable(tableId, aoColumn, actionUrl, serverParams,tbParams,dataParam) {
var $btTable = $('#' + tableId);
$btTable.bootstrapTable({
......@@ -292,4 +295,30 @@ function numFormat(num) {
});
})
return res;
}
\ No newline at end of file
}
function login() {
var useracc = $.cookie('BLUserAcct');
//useracc = "4DF8961A9925E5F930133BB9235E605D4028EC3AA22DF07934EBDF7837FCBB9AC7D7B73BF50EF3B8B0B39499EFE2B0776303D6177B439F52B2781CD19831235EE5800ADB5B0770479A89E6DF7BA71D84|4DF8961A9925E5F925E15FBFCF682CAFA7CE698D19B44E255990FC4BF53934C8E87F5463597DB55AEE88A69634CB5A5FE25B58A53DE2651717042F901222BBD828E8ABA3401F54262493AA27D2E9383D0A097B881DF74984932FE6D929A706C0B0280272C4EDB089A66F2A11012E0C5CC19E7F0DF4490C8AF34AC401B4709A4AC9C10DF18923EF3DFE31F49C7E970031ED90B215F31D9CAE166DD59D87F5D1E60955AB383BE1F84F611D8B3C71247748D6F212472D44BB853F4935180429A01961CEFC8F7A528AE14BB1B4B987F4E337";
if (useracc == undefined || useracc == null) {
window.location = "http://www.bailuntec.com/Login/Index?guid=dbc0cffc7f4d11e8a4ca246e96754d42";
}
else {
$.submit({
type:'POST',
url: baseUrl+'Home/GetUserInfo?acc=' + useracc,
paramData: '',
func: function (result) {
if (result.success) {
userid = result.userid;
username = result.username;
jobs = result.jobs;
}
else {
window.location = "http://www.bailuntec.com/Login/Index?guid=dbc0cffc7f4d11e8a4ca246e96754d42";
}
}
})
}
}
login();
\ No newline at end of file
/*!
* jQuery Cookie Plugin v1.4.1
* https://github.com/carhartl/jquery-cookie
*
* Copyright 2013 Klaus Hartl
* Released under the MIT license
*/
(function (factory) {
if (typeof define === 'function' && define.amd) {
// AMD
define(['jquery'], factory);
} else if (typeof exports === 'object') {
// CommonJS
factory(require('jquery'));
} else {
// Browser globals
factory(jQuery);
}
}(function ($) {
var pluses = /\+/g;
function encode(s) {
return config.raw ? s : encodeURIComponent(s);
}
function decode(s) {
return config.raw ? s : decodeURIComponent(s);
}
function stringifyCookieValue(value) {
return encode(config.json ? JSON.stringify(value) : String(value));
}
function parseCookieValue(s) {
if (s.indexOf('"') === 0) {
// This is a quoted cookie as according to RFC2068, unescape...
s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\');
}
try {
// Replace server-side written pluses with spaces.
// If we can't decode the cookie, ignore it, it's unusable.
// If we can't parse the cookie, ignore it, it's unusable.
s = decodeURIComponent(s.replace(pluses, ' '));
return config.json ? JSON.parse(s) : s;
} catch(e) {}
}
function read(s, converter) {
var value = config.raw ? s : parseCookieValue(s);
return $.isFunction(converter) ? converter(value) : value;
}
var config = $.cookie = function (key, value, options) {
// Write
if (value !== undefined && !$.isFunction(value)) {
options = $.extend({}, config.defaults, options);
if (typeof options.expires === 'number') {
var days = options.expires, t = options.expires = new Date();
t.setTime(+t + days * 864e+5);
}
return (document.cookie = [
encode(key), '=', stringifyCookieValue(value),
options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
options.path ? '; path=' + options.path : '',
options.domain ? '; domain=' + options.domain : '',
options.secure ? '; secure' : ''
].join(''));
}
// Read
var result = key ? undefined : {};
// To prevent the for loop in the first place assign an empty array
// in case there are no cookies at all. Also prevents odd result when
// calling $.cookie().
var cookies = document.cookie ? document.cookie.split('; ') : [];
for (var i = 0, l = cookies.length; i < l; i++) {
var parts = cookies[i].split('=');
var name = decode(parts.shift());
var cookie = parts.join('=');
if (key && key === name) {
// If second argument (value) is a function it's a converter...
result = read(cookie, value);
break;
}
// Prevent storing a cookie that we couldn't decode.
if (!key && (cookie = read(cookie)) !== undefined) {
result[name] = cookie;
}
}
return result;
};
config.defaults = {};
$.removeCookie = function (key, options) {
if ($.cookie(key) === undefined) {
return false;
}
// Must not alter options, thus extending a fresh object...
$.cookie(key, '', $.extend({}, options, { expires: -1 }));
return !$.cookie(key);
};
}));
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