Commit 04fc998f by guanzhenshan

1、完成接入新用户验证

2、利润统计报表按发货时间增加FBA发货数据
3、解决数据中心帐号余额导入出错的问题
parent eba59f23
...@@ -987,7 +987,7 @@ namespace Bailun.DC.Services ...@@ -987,7 +987,7 @@ namespace Bailun.DC.Services
/// <param name="start">付款开始时间</param> /// <param name="start">付款开始时间</param>
/// <param name="end">付款结束时间</param> /// <param name="end">付款结束时间</param>
/// <returns></returns> /// <returns></returns>
public List<Models.Orders.dc_base_oms_sku> ListPlatformProfit(string platform, DateTime? start, DateTime? end,DateTime? shipstart,DateTime? shipend,bool isUSD) public List<Models.Orders.dc_base_oms_sku> ListPlatformProfit(string platform, DateTime? start, DateTime? end,DateTime? shipstart,DateTime? shipend,bool isUSD, int companyid)
{ {
var sqlparam = new DynamicParameters(); var sqlparam = new DynamicParameters();
var sql = "select tb.platform_type,count(tb.bailun_order_id) order_count,sum(tb.amount_sales*"+(isUSD? "tb.order_to_usd_exchange_rate" : "tb.seller_order_exchange_rate") + ") as amount_sales,sum(tb.cost_platform_fee*(if(tb.platform_type='Ebay'," + (isUSD ? "tb.other_to_usd_exchange_rate" : "tb.seller_other_exchange_rate") + "," + (isUSD ? "tb.order_to_usd_exchange_rate" : "tb.seller_order_exchange_rate") + "))) as cost_platform_fee,sum(cost_first*"+ (isUSD ? "tb.cny_to_usd_exchange_rate" : "1") + ") as cost_first,sum(cost_tail*" + (isUSD ? "tb.cny_to_usd_exchange_rate" : "1") + ") cost_tail,sum(cost_handle_bailun*" + (isUSD ? "tb.cny_to_usd_exchange_rate" : "1") + ") cost_handle_bailun,sum(cost_handle_platform*" + (isUSD ? "tb.cny_to_usd_exchange_rate" : "1") + ") cost_handle_platform,sum(amount_refund*" + (isUSD ? "tb.order_to_usd_exchange_rate" : "tb.seller_order_exchange_rate") + ") amount_refund,sum(cost_product*" + (isUSD ? "tb.cny_to_usd_exchange_rate" : "1") + ") cost_product,sum(profit_total*" + (isUSD ? "tb.cny_to_usd_exchange_rate" : "1") + ") profit_total,(sum(profit_total*" + (isUSD ? "tb.cny_to_usd_exchange_rate" : "1") + ")/sum(tb.amount_sales*" + (isUSD ? "tb.order_to_usd_exchange_rate" : "tb.seller_order_exchange_rate") + ")) profit_rate,count(amount_prepaid>0 or null) as noshippingcount,sum(amount_prepaid*" + (isUSD ? "tb.cny_to_usd_exchange_rate" : "1") + ") amount_prepaid from dc_base_oms_order tb "; var sql = "select tb.platform_type,count(tb.bailun_order_id) order_count,sum(tb.amount_sales*"+(isUSD? "tb.order_to_usd_exchange_rate" : "tb.seller_order_exchange_rate") + ") as amount_sales,sum(tb.cost_platform_fee*(if(tb.platform_type='Ebay'," + (isUSD ? "tb.other_to_usd_exchange_rate" : "tb.seller_other_exchange_rate") + "," + (isUSD ? "tb.order_to_usd_exchange_rate" : "tb.seller_order_exchange_rate") + "))) as cost_platform_fee,sum(cost_first*"+ (isUSD ? "tb.cny_to_usd_exchange_rate" : "1") + ") as cost_first,sum(cost_tail*" + (isUSD ? "tb.cny_to_usd_exchange_rate" : "1") + ") cost_tail,sum(cost_handle_bailun*" + (isUSD ? "tb.cny_to_usd_exchange_rate" : "1") + ") cost_handle_bailun,sum(cost_handle_platform*" + (isUSD ? "tb.cny_to_usd_exchange_rate" : "1") + ") cost_handle_platform,sum(amount_refund*" + (isUSD ? "tb.order_to_usd_exchange_rate" : "tb.seller_order_exchange_rate") + ") amount_refund,sum(cost_product*" + (isUSD ? "tb.cny_to_usd_exchange_rate" : "1") + ") cost_product,sum(profit_total*" + (isUSD ? "tb.cny_to_usd_exchange_rate" : "1") + ") profit_total,(sum(profit_total*" + (isUSD ? "tb.cny_to_usd_exchange_rate" : "1") + ")/sum(tb.amount_sales*" + (isUSD ? "tb.order_to_usd_exchange_rate" : "tb.seller_order_exchange_rate") + ")) profit_rate,count(amount_prepaid>0 or null) as noshippingcount,sum(amount_prepaid*" + (isUSD ? "tb.cny_to_usd_exchange_rate" : "1") + ") amount_prepaid from dc_base_oms_order tb ";
...@@ -997,7 +997,8 @@ namespace Bailun.DC.Services ...@@ -997,7 +997,8 @@ namespace Bailun.DC.Services
sql += " left join dc_base_oms_pick t1 on tb.bailun_order_id =t1.bailun_order_id "; 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.bailun_order_status!='CantHandle' and tb.has_scalp=0 and tb.has_innersale=0"; sql += " where tb.bailun_order_status!='Canceled' and tb.bailun_order_status!='CantHandle' and tb.has_scalp=0 and tb.has_innersale=0 ";
//sql += " and tb.company_id=" + companyid; //按公司区分
if (!string.IsNullOrWhiteSpace(platform)) if (!string.IsNullOrWhiteSpace(platform))
{ {
...@@ -1051,7 +1052,7 @@ namespace Bailun.DC.Services ...@@ -1051,7 +1052,7 @@ namespace Bailun.DC.Services
/// <param name="shipstart">发货开始时间</param> /// <param name="shipstart">发货开始时间</param>
/// <param name="shipend">发货结束时间</param> /// <param name="shipend">发货结束时间</param>
/// <returns></returns> /// <returns></returns>
public List<Models.Orders.dc_base_oms_sku> ListPlatformProfitByShipTime(string platform, DateTime? start, DateTime? end, DateTime? shipstart, DateTime? shipend, bool isUSD) public List<Models.Orders.dc_base_oms_sku> ListPlatformProfitByShipTime(string platform, DateTime? start, DateTime? end, DateTime? shipstart, DateTime? shipend, bool isUSD,int companyid)
{ {
var sqlparam = new DynamicParameters(); var sqlparam = new DynamicParameters();
var sql = "select tb.platform_type,count(tb.bailun_order_id) order_count,sum(tb.amount_sales*" + (isUSD ? "tb.order_to_usd_exchange_rate" : "tb.seller_order_exchange_rate") + ") as amount_sales,sum(tb.cost_platform_fee*(if(tb.platform_type='Ebay'," + (isUSD ? "tb.other_to_usd_exchange_rate" : "tb.seller_other_exchange_rate") + "," + (isUSD ? "tb.order_to_usd_exchange_rate" : "tb.seller_order_exchange_rate") + "))) as cost_platform_fee,sum(cost_first*" + (isUSD ? "tb.cny_to_usd_exchange_rate" : "1") + ") as cost_first,sum(cost_tail*" + (isUSD ? "tb.cny_to_usd_exchange_rate" : "1") + ") cost_tail,sum(cost_handle_bailun*" + (isUSD ? "tb.cny_to_usd_exchange_rate" : "1") + ") cost_handle_bailun,sum(cost_handle_platform*" + (isUSD ? "tb.cny_to_usd_exchange_rate" : "1") + ") cost_handle_platform,sum(amount_refund*" + (isUSD ? "tb.order_to_usd_exchange_rate" : "tb.seller_order_exchange_rate") + ") amount_refund,sum(cost_product*" + (isUSD ? "tb.cny_to_usd_exchange_rate" : "1") + ") cost_product,sum(profit_total*" + (isUSD ? "tb.cny_to_usd_exchange_rate" : "1") + ") profit_total,(sum(profit_total*" + (isUSD ? "tb.cny_to_usd_exchange_rate" : "1") + ")/sum(tb.amount_sales*" + (isUSD ? "tb.order_to_usd_exchange_rate" : "tb.seller_order_exchange_rate") + ")) profit_rate,count(amount_prepaid>0 or null) as noshippingcount,sum(amount_prepaid*" + (isUSD ? "tb.cny_to_usd_exchange_rate" : "1") + ") amount_prepaid from dc_base_oms_order tb "; var sql = "select tb.platform_type,count(tb.bailun_order_id) order_count,sum(tb.amount_sales*" + (isUSD ? "tb.order_to_usd_exchange_rate" : "tb.seller_order_exchange_rate") + ") as amount_sales,sum(tb.cost_platform_fee*(if(tb.platform_type='Ebay'," + (isUSD ? "tb.other_to_usd_exchange_rate" : "tb.seller_other_exchange_rate") + "," + (isUSD ? "tb.order_to_usd_exchange_rate" : "tb.seller_order_exchange_rate") + "))) as cost_platform_fee,sum(cost_first*" + (isUSD ? "tb.cny_to_usd_exchange_rate" : "1") + ") as cost_first,sum(cost_tail*" + (isUSD ? "tb.cny_to_usd_exchange_rate" : "1") + ") cost_tail,sum(cost_handle_bailun*" + (isUSD ? "tb.cny_to_usd_exchange_rate" : "1") + ") cost_handle_bailun,sum(cost_handle_platform*" + (isUSD ? "tb.cny_to_usd_exchange_rate" : "1") + ") cost_handle_platform,sum(amount_refund*" + (isUSD ? "tb.order_to_usd_exchange_rate" : "tb.seller_order_exchange_rate") + ") amount_refund,sum(cost_product*" + (isUSD ? "tb.cny_to_usd_exchange_rate" : "1") + ") cost_product,sum(profit_total*" + (isUSD ? "tb.cny_to_usd_exchange_rate" : "1") + ") profit_total,(sum(profit_total*" + (isUSD ? "tb.cny_to_usd_exchange_rate" : "1") + ")/sum(tb.amount_sales*" + (isUSD ? "tb.order_to_usd_exchange_rate" : "tb.seller_order_exchange_rate") + ")) profit_rate,count(amount_prepaid>0 or null) as noshippingcount,sum(amount_prepaid*" + (isUSD ? "tb.cny_to_usd_exchange_rate" : "1") + ") amount_prepaid from dc_base_oms_order tb ";
...@@ -1070,9 +1071,13 @@ namespace Bailun.DC.Services ...@@ -1070,9 +1071,13 @@ namespace Bailun.DC.Services
sql += " and shipping_time<'"+shipend.Value.AddDays(1).ToString("yyyy-MM-dd")+"'"; sql += " and shipping_time<'"+shipend.Value.AddDays(1).ToString("yyyy-MM-dd")+"'";
} }
sql += " group by bailun_order_id) t2 on tb.bailun_order_id=t2.bailun_order_id "; //sql += " company_id="+companyid; //按公司区分
sql += " group by bailun_order_id ";
sql += " ) t2 on tb.bailun_order_id=t2.bailun_order_id ";
sql += " where tb.bailun_order_status!='Canceled' and tb.has_scalp=0 and tb.bailun_order_status!='CantHandle' and tb.has_scalp=0 and tb.has_innersale=0 "; sql += " where tb.bailun_order_status!='Canceled' and tb.has_scalp=0 and tb.bailun_order_status!='CantHandle' and tb.has_scalp=0 and tb.has_innersale=0 ";
//sql += " and tb.company_id=" + companyid; //按公司区分
if (!string.IsNullOrWhiteSpace(platform)) if (!string.IsNullOrWhiteSpace(platform))
{ {
...@@ -2511,11 +2516,11 @@ namespace Bailun.DC.Services ...@@ -2511,11 +2516,11 @@ namespace Bailun.DC.Services
if (start.HasValue) if (start.HasValue)
{ {
sql += " and paid_time_site>='" + start.Value.ToString("yyyy-MM-dd HH:mm:ss") + "'"; sql += " and paid_time>='" + start.Value.ToString("yyyy-MM-dd HH:mm:ss") + "'";
} }
if (end.HasValue) if (end.HasValue)
{ {
sql += " and paid_time_site<'" + end.Value.ToString("yyyy-MM-dd HH:mm:ss") + "'"; sql += " and paid_time<'" + end.Value.ToString("yyyy-MM-dd HH:mm:ss") + "'";
} }
if (!string.IsNullOrEmpty(platform)) if (!string.IsNullOrEmpty(platform))
{ {
......
...@@ -389,7 +389,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers ...@@ -389,7 +389,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
{ {
if (t == 2) //按付款主体 if (t == 2) //按付款主体
{ {
listCol = list.GroupBy(a => a.companyName).Select(p => p.Key).ToList(); listCol = list.GroupBy(a => a.companyName).Select(p => p.Key).OrderBy(a=>a).ToList();
} }
else //按部门 else //按部门
......
...@@ -6,6 +6,10 @@ using Microsoft.AspNetCore.Mvc; ...@@ -6,6 +6,10 @@ using Microsoft.AspNetCore.Mvc;
using Bailun.DC.Models; using Bailun.DC.Models;
using Newtonsoft.Json; using Newtonsoft.Json;
using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Hosting;
using Bailun.ServiceFabric.Authorize;
using Bailun.ServiceFabric.Core.Extension.HttpContext;
using Bailun.ServiceFabric.Core.Extension;
using Bailun.ServiceFabric.Extension;
namespace Bailun.DC.Web.Areas.Reports.Controllers namespace Bailun.DC.Web.Areas.Reports.Controllers
{ {
...@@ -42,6 +46,8 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers ...@@ -42,6 +46,8 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
/// <returns></returns> /// <returns></returns>
public string ListPlatformCostJson(BtTableParameter parameter, string platform, DateTime? start, DateTime? end,string website,string account,string warehousetype,string warehousecode) public string ListPlatformCostJson(BtTableParameter parameter, string platform, DateTime? start, DateTime? end,string website,string account,string warehousetype,string warehousecode)
{ {
var companyid = HttpContextHelper.Current?.User.GetCompanyId().ToInt32();
var total = 0; var total = 0;
var obj = new Services.OrdersServices().ListPlatformCost(parameter, platform, start, end,website,account,warehousetype,warehousecode, ref total); var obj = new Services.OrdersServices().ListPlatformCost(parameter, platform, start, end,website,account,warehousetype,warehousecode, ref total);
...@@ -577,15 +583,21 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers ...@@ -577,15 +583,21 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
[HttpPost] [HttpPost]
public JsonResult PlatformProfitCountJson(string platform,DateTime? start,DateTime? end,DateTime? shipstart,DateTime? shipend,string currency) public JsonResult PlatformProfitCountJson(string platform,DateTime? start,DateTime? end,DateTime? shipstart,DateTime? shipend,string currency)
{ {
var companyid = HttpContextHelper.Current?.User?.GetCompanyId().ToInt32();
var result = new List<Models.Orders.dc_base_oms_sku>(); var result = new List<Models.Orders.dc_base_oms_sku>();
if (shipstart.HasValue || shipend.HasValue) if (shipstart.HasValue || shipend.HasValue)
{ {
result = new Services.OrdersServices().ListPlatformProfitByShipTime(platform, start, end, shipstart, shipend, currency.ToUpper() == "USD"); result = new Services.OrdersServices().ListPlatformProfitByShipTime(platform, start, end, shipstart, shipend, currency.ToUpper() == "USD",companyid??0);
var fbaResult = new Services.OrdersServices().ListPlatformProfit(string.IsNullOrEmpty(platform) ? "FBA" : "", shipstart, shipend, null, null, currency.ToUpper() == "USD", companyid ?? 0);
result.AddRange(fbaResult);
} }
else else
{ {
result = new Services.OrdersServices().ListPlatformProfit(platform, start, end, shipstart, shipend,currency.ToUpper()=="USD"); result = new Services.OrdersServices().ListPlatformProfit(platform, start, end, shipstart, shipend,currency.ToUpper()=="USD",companyid??0);
} }
if (result.Count > 0) if (result.Count > 0)
...@@ -1012,6 +1024,8 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers ...@@ -1012,6 +1024,8 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
/// <returns></returns> /// <returns></returns>
public string EbaySaleStatisticsJson(BtTableParameter parameter, string selleraccount, string website, DateTime start, DateTime end, string warehousetype, string warehousecode) public string EbaySaleStatisticsJson(BtTableParameter parameter, string selleraccount, string website, DateTime start, DateTime end, string warehousetype, string warehousecode)
{ {
var companyid = HttpContextHelper.Current?.User?.GetCompanyId().ToInt32();
var total = 0; var total = 0;
var services = new Services.OrdersServices(); var services = new Services.OrdersServices();
var objwithdraw = new Services.PlatformSiteServices().GetPlatformLossWithdraw().Where(a => a.english_name == "Ebay").FirstOrDefault(); var objwithdraw = new Services.PlatformSiteServices().GetPlatformLossWithdraw().Where(a => a.english_name == "Ebay").FirstOrDefault();
......
...@@ -14,6 +14,8 @@ ...@@ -14,6 +14,8 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Bailun.ServiceFabric.Authorize" Version="1.0.3" />
<PackageReference Include="Bailun.ServiceFabric.Core" Version="1.1.0" />
<PackageReference Include="Microsoft.AspNetCore.App" /> <PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.1.1" /> <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.1.1" />
<PackageReference Include="NPOI" Version="2.4.1" /> <PackageReference Include="NPOI" Version="2.4.1" />
......
...@@ -2,6 +2,10 @@ ...@@ -2,6 +2,10 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Bailun.ServiceFabric.Authorize;
using Bailun.ServiceFabric.Core.Extension;
using Bailun.ServiceFabric.Core.Extension.HttpContext;
using Bailun.ServiceFabric.Extension;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
namespace Bailun.DC.Web.Controllers namespace Bailun.DC.Web.Controllers
...@@ -97,33 +101,21 @@ namespace Bailun.DC.Web.Controllers ...@@ -97,33 +101,21 @@ namespace Bailun.DC.Web.Controllers
return Json(result); return Json(result);
} }
[BailunAuthentication(LoginMode.Enforce)]
[HttpPost] [HttpPost]
public JsonResult GetUserInfo(string acc) public JsonResult GetUserInfo()
{ {
var strResult = Common.HttpHelper.NetHelper.HttpPost(ConfigHelper.GetByName("GetUser"), "BLUserAcct=" + acc + "&webcode=wuliu"); var userid = HttpContextHelper.Current?.User?.GetUid().ToStr();
var username = HttpContextHelper.Current.User.GetUserName();
var jobs = ""; //HttpContextHelper.Current.User.GetRolesCode();
var companyid = HttpContextHelper.Current.User.GetCompanyId();
try
{
var obj = Newtonsoft.Json.Linq.JObject.Parse(strResult);
if (obj["code"].ToString() != "0")
{
return Json(new return Json(new
{ {
success = true, success = true,
userid = Convert.ToInt32(obj["data"]["UserId"].ToString().Trim()), userid = userid,
username = obj["data"]["UserName"].ToString().Trim(), username = username,
jobs = obj["data"]["Jobs"].ToString().Trim() jobs = jobs
});
}
}
catch
{
}
return Json(new
{
success = false
}); });
} }
......
...@@ -30,10 +30,13 @@ ...@@ -30,10 +30,13 @@
<script src="css/hplus/js/jquery.min.js?v=2.1.4"></script> <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/jquery.cookie.js" type="text/javascript"></script>
<script src="~/js/common.js" type="text/javascript"></script> <script src="~/js/common.js?20190606001" type="text/javascript"></script>
</head> </head>
<body class="fixed-sidebar full-height-layout gray-bg" style="overflow:hidden"> <body class="fixed-sidebar full-height-layout gray-bg" style="overflow:hidden">
<script type="text/javascript">
login();
</script>
<div id="wrapper"> <div id="wrapper">
<!--左侧导航开始--> <!--左侧导航开始-->
<nav class="navbar-default navbar-static-side" role="navigation"> <nav class="navbar-default navbar-static-side" role="navigation">
...@@ -278,7 +281,7 @@ ...@@ -278,7 +281,7 @@
</ul> </ul>
</li> </li>
</ul> </ul>
</div> </div>
</nav> </nav>
<!--左侧导航结束--> <!--左侧导航结束-->
<!--右侧部分开始--> <!--右侧部分开始-->
...@@ -341,6 +344,5 @@ ...@@ -341,6 +344,5 @@
<script src="css/hplus/js/hplus.min.js?v=4.1.0"></script> <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 type="text/javascript" src="css/hplus/js/contabs.min.js"></script>
<script src="css/hplus/js/plugins/pace/pace.min.js"></script> <script src="css/hplus/js/plugins/pace/pace.min.js"></script>
</body> </body>
</html> </html>
...@@ -85,7 +85,7 @@ ...@@ -85,7 +85,7 @@
<script src="/css/bootstrap-select-1.12.4/js/bootstrap-select.js"></script> <script src="/css/bootstrap-select-1.12.4/js/bootstrap-select.js"></script>
<script src="~/js/jquery.cookie.js" type="text/javascript"></script> <script src="~/js/jquery.cookie.js" type="text/javascript"></script>
<!--常用js方法--> <!--常用js方法-->
<script src="/js/common.js?=201903011812"></script> <script src="/js/common.js?=20190606001"></script>
@RenderSection("scripts", required: false) @RenderSection("scripts", required: false)
<script type="text/javascript"> <script type="text/javascript">
......
...@@ -106,7 +106,7 @@ ...@@ -106,7 +106,7 @@
<!--下拉选择搜索控件--> <!--下拉选择搜索控件-->
<script src="/css/bootstrap-select-1.12.4/js/bootstrap-select.js"></script> <script src="/css/bootstrap-select-1.12.4/js/bootstrap-select.js"></script>
<!--常用js方法--> <!--常用js方法-->
<script src="/css/js/common.js?=201801251445"></script> <script src="/css/js/common.js?=20190606001"></script>
@RenderSection("scripts", required: false) @RenderSection("scripts", required: false)
<script type="text/javascript"> <script type="text/javascript">
......
...@@ -2,12 +2,16 @@ using System; ...@@ -2,12 +2,16 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Bailun.ServiceFabric.Core.Extension.HttpContext;
using Bailun.ServiceFabric.Extension;
using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Infrastructure;
using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
namespace Bailun.DC.Web namespace Bailun.DC.Web
{ {
...@@ -34,7 +38,7 @@ namespace Bailun.DC.Web ...@@ -34,7 +38,7 @@ namespace Bailun.DC.Web
//services.AddSession(); //services.AddSession();
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1); services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
services.TryAddSingleton<IHttpContextAccessor, HttpContextAccessor>();
} }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
...@@ -78,6 +82,9 @@ namespace Bailun.DC.Web ...@@ -78,6 +82,9 @@ namespace Bailun.DC.Web
template: "{controller=Home}/{action=Index}/{id?}"); template: "{controller=Home}/{action=Index}/{id?}");
}); });
ConfigManagerConf.SetConfiguration(Configuration);
app.UseStaticHttpContext();
} }
} }
} }
...@@ -11,5 +11,9 @@ ...@@ -11,5 +11,9 @@
"rootFilePath": "C:\\WebSite\\DataCenter-NetCore2", "rootFilePath": "C:\\WebSite\\DataCenter-NetCore2",
"LoginUrl": "http://www.bailuntec.com/Login/Index?guid=dbc0cffc7f4d11e8a4ca246e96754d42", "LoginUrl": "http://www.bailuntec.com/Login/Index?guid=dbc0cffc7f4d11e8a4ca246e96754d42",
"LoginOutUrl": "http://www.bailuntec.com/Login/LoginOut", "LoginOutUrl": "http://www.bailuntec.com/Login/LoginOut",
"GetUser": "http://www.bailuntec.com/Login/GetUserByBLUserAcct" "GetUser": "http://www.bailuntec.com/Login/GetUserByBLUserAcct",
"AppSetting": {
"SsoUrl": "http://sso.bailuntec.com", //֤url
"AuthType": "" //Ƿdebugģʽ
}
} }
var baseUrl = 'http://data.bailuntec.com/'; var baseUrl = 'http://localhost:59628/';
var globalOrderSort=''; var globalOrderSort='';
var globalOrderType = ''; var globalOrderType = '';
...@@ -211,11 +211,14 @@ $.submit = function (data) { ...@@ -211,11 +211,14 @@ $.submit = function (data) {
url: data.url, url: data.url,
type: data.type||'GET', type: data.type||'GET',
data: data.paramData, data: data.paramData,
beforeSend: function () { beforeSend: function (request) {
if (!data.noloading) if (!data.noloading)
{ {
//load_index = layer.load(); //load_index = layer.load();
} }
request.setRequestHeader("Authorization", $.cookie("token"));
}, },
success: function (result) { success: function (result) {
try { try {
...@@ -298,15 +301,23 @@ function numFormat(num) { ...@@ -298,15 +301,23 @@ function numFormat(num) {
} }
function login() { function login() {
var useracc = $.cookie('BLUserAcct'); var token = getUrlParam('token');
//useracc = "4DF8961A9925E5F930133BB9235E605D4028EC3AA22DF07934EBDF7837FCBB9AC7D7B73BF50EF3B8B0B39499EFE2B0776303D6177B439F52B2781CD19831235EE5800ADB5B0770479A89E6DF7BA71D84|4DF8961A9925E5F925E15FBFCF682CAFA7CE698D19B44E255990FC4BF53934C8E87F5463597DB55AEE88A69634CB5A5FE25B58A53DE2651717042F901222BBD828E8ABA3401F54262493AA27D2E9383D0A097B881DF74984932FE6D929A706C0B0280272C4EDB089A66F2A11012E0C5CC19E7F0DF4490C8AF34AC401B4709A4AC9C10DF18923EF3DFE31F49C7E970031ED90B215F31D9CAE166DD59D87F5D1E60955AB383BE1F84F611D8B3C71247748D6F212472D44BB853F4935180429A01961CEFC8F7A528AE14BB1B4B987F4E337";
if (useracc == undefined || useracc == null) { if (token != '') {
window.location = "http://www.bailuntec.com/Login/Index?guid=dbc0cffc7f4d11e8a4ca246e96754d42"; $.cookie('token', token, { expires: 1 });
} }
else { else {
token = $.cookie('token');
if (token == undefined) {
window.location = "http://sso.bailuntec.com/?returnUrl=" + baseUrl;
return false;
}
}
$.submit({ $.submit({
type:'POST', type:'POST',
url: baseUrl+'Home/GetUserInfo?acc=' + useracc, url: baseUrl+'Home/GetUserInfo',
paramData: '', paramData: '',
func: function (result) { func: function (result) {
if (result.success) { if (result.success) {
...@@ -319,10 +330,8 @@ function login() { ...@@ -319,10 +330,8 @@ function login() {
} }
else { else {
window.location = "http://www.bailuntec.com/Login/Index?guid=dbc0cffc7f4d11e8a4ca246e96754d42"; window.location = "http://sso.bailuntec.com/?returnUrl=" + baseUrl;
} }
} }
}) })
}
} }
//login();
\ No newline at end of file
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