Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
DataCenter_Core2.1_20190520
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bltdc
DataCenter_Core2.1_20190520
Commits
d2e5009e
Commit
d2e5009e
authored
Aug 28, 2020
by
huangruiyao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
数据中心日志记录
parent
e8eb42c6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
289 additions
and
2 deletions
+289
-2
HomeController.cs
Bailun.DC.Web/Areas/Logistics/Controllers/HomeController.cs
+1
-0
AllotController.cs
Bailun.DC.Web/Areas/Reports/Controllers/AllotController.cs
+1
-1
FinanceController.cs
Bailun.DC.Web/Areas/Reports/Controllers/FinanceController.cs
+18
-1
InventoryController.cs
...n.DC.Web/Areas/Reports/Controllers/InventoryController.cs
+4
-0
LogisticsController.cs
...n.DC.Web/Areas/Reports/Controllers/LogisticsController.cs
+2
-0
OnWayController.cs
Bailun.DC.Web/Areas/Reports/Controllers/OnWayController.cs
+1
-0
OrdersController.cs
Bailun.DC.Web/Areas/Reports/Controllers/OrdersController.cs
+0
-0
PurchaseController.cs
...un.DC.Web/Areas/Reports/Controllers/PurchaseController.cs
+1
-0
SkuController.cs
Bailun.DC.Web/Areas/Reports/Controllers/SkuController.cs
+3
-0
WarehouseController.cs
...n.DC.Web/Areas/Reports/Controllers/WarehouseController.cs
+5
-0
HomeController.cs
Bailun.DC.Web/Areas/Users/Controllers/HomeController.cs
+5
-0
BrowseLogAttribute.cs
Bailun.DC.Web/BrowseLogAttribute.cs
+240
-0
appsettings.Development.json
Bailun.DC.Web/appsettings.Development.json
+4
-0
appsettings.json
Bailun.DC.Web/appsettings.json
+4
-0
No files found.
Bailun.DC.Web/Areas/Logistics/Controllers/HomeController.cs
View file @
d2e5009e
...
...
@@ -141,6 +141,7 @@ namespace Bailun.DC.Web.Areas.Logistics.Controllers
/// </summary>
/// <param name="start"></param>
/// <returns></returns>
[
BrowseLog
(
"Bailun_data"
,
"访问【百伦数据中心】->【数据分析】->【EbayUK平邮比例】->【查询】页面"
,
0
)]
public
string
EbayUkReportJson
(
Models
.
BtTableParameter
request
,
DateTime
start
,
DateTime
end
,
int
?
l_start
,
int
?
l_end
,
int
?
bg_start
,
int
?
bg_end
)
{
var
service
=
new
Services
.
OrdersServices
();
...
...
Bailun.DC.Web/Areas/Reports/Controllers/AllotController.cs
View file @
d2e5009e
...
...
@@ -16,7 +16,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
{
return
View
();
}
[
BrowseLog
(
"Bailun_data"
,
"访问【百伦数据中心】->【订单】->【调拨单(调拨在途明细】->【查询】页面"
,
0
)]
public
string
ListAllotJson
(
BtTableParameter
parameter
,
string
warehouse
,
int
?
status
,
string
orderno
,
string
sku
)
{
var
total
=
0
;
...
...
Bailun.DC.Web/Areas/Reports/Controllers/FinanceController.cs
View file @
d2e5009e
...
...
@@ -43,6 +43,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
/// <returns></returns>
[
BailunAuthentication
(
LoginMode
.
Enforce
)]
[
HttpPost
]
[
BrowseLog
(
"Bailun_data"
,
"访问【百伦数据中心】->【财务报表】->【资产负债表】->【查询】页面"
,
0
)]
public
JsonResult
IndexJson
(
int
type
,
int
paycompanyvalue
,
DateTime
?
day
)
{
var
date
=
DateTime
.
Now
;
...
...
@@ -480,6 +481,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
/// </summary>
/// <returns></returns>
[
HttpPost
]
[
BrowseLog
(
"Bailun_data"
,
"访问【百伦数据中心】->【财务报表】->【资产负债表】->【任务运行情况】->【查询】页面"
,
0
)]
public
JsonResult
BalanceSheetTaskJson
(
DateTime
day
)
{
if
(
day
>
DateTime
.
Now
.
AddDays
(-
1
))
...
...
@@ -595,6 +597,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
/// <returns></returns>
[
BailunAuthentication
(
LoginMode
.
Enforce
)]
[
HttpPost
]
[
BrowseLog
(
"Bailun_data"
,
"访问【百伦数据中心】->【财务报表】->【管理成本报表】->【查询】页面"
,
0
)]
public
JsonResult
AdministrativeCostJson
(
int
t
,
DateTime
start
,
DateTime
end
,
int
?
paycompanyid
)
{
var
url
=
ConfigHelper
.
GetByName
(
"FeeUrl"
)+
"?o=0"
;
...
...
@@ -3146,6 +3149,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
}
[
HttpPost
]
[
BrowseLog
(
"Bailun_data"
,
"访问【百伦数据中心】->【财务报表】->【资产负债表】->【环比报表】->【查询】页面"
,
0
)]
public
JsonResult
FinanceDebtChainChartJson
(
DateTime
start
,
DateTime
end
)
{
try
...
...
@@ -4025,6 +4029,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
/// </summary>
/// <returns></returns>
[
BailunAuthentication
(
LoginMode
.
Enforce
)]
[
BrowseLog
(
"Bailun_data"
,
"访问【百伦数据中心】->【财务报表】->【平台余额】->【查询】页面"
,
0
)]
public
string
ListAccoutBalanceCountJson
(
BtTableParameter
request
,
DateTime
day
,
string
platformname
)
{
var
user
=
HttpContextHelper
.
Current
?.
User
;
...
...
@@ -4402,6 +4407,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
/// 每日销售额统计
/// </summary>
/// <returns></returns>
[
BrowseLog
(
"Bailun_data"
,
"访问【百伦数据中心】->【财务报表】->【每日销售额】->【查询】页面"
,
0
)]
public
string
DailySalesCountJson
(
BtTableParameter
request
,
DateTime
day
,
string
platformcode
)
{
var
services
=
new
Services
.
FinanceReportServices
();
...
...
@@ -4678,6 +4684,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
/// <param name="dateWay">统计方式 1按日 2按周 3按月</param>
/// <returns></returns>
[
HttpPost
]
[
BrowseLog
(
"Bailun_data"
,
"访问【百伦数据中心】->【财务报表】->【每日发生额汇总】->【查询】页面"
,
0
)]
public
JsonResult
HappenAmountCountJson
(
DateTime
start
,
DateTime
end
,
int
dateWay
)
{
var
list
=
new
List
<
mHappenAmount
>();
...
...
@@ -7130,6 +7137,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
/// <returns></returns>
[
BailunAuthentication
(
LoginMode
.
Enforce
)]
[
HttpPost
]
[
BrowseLog
(
"Bailun_data"
,
"访问【百伦数据中心】->【财务报表】->【跨境电商现金流报告】->【查询】页面"
,
0
)]
public
JsonResult
ListDailyCompanyMoneyJson
(
DateTime
start
,
DateTime
end
)
{
try
...
...
@@ -7222,6 +7230,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
/// <param name="start">期初时间</param>
/// <param name="end">期末时间</param>
/// <returns></returns>
[
BrowseLog
(
"Bailun_data"
,
"访问【百伦数据中心】->【财务报表】->【成品仓库进销存】->【查询】页面"
,
0
)]
public
string
WHPurchaseSellStockJson
(
BtTableParameter
parameter
,
string
warehousetype
,
string
warehouse
,
DateTime
start
,
DateTime
end
)
{
var
total
=
0
;
...
...
@@ -7309,6 +7318,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
/// <param name="start">期初日期</param>
/// <param name="end">期末日期</param>
/// <returns></returns>
[
BrowseLog
(
"Bailun_data"
,
"访问【百伦数据中心】->【财务报表】->【成品SKU进销存】->【查询】页面"
,
0
)]
public
string
SkuPurchaseSellStockJson
(
BtTableParameter
parameter
,
string
sku
,
string
warehousetype
,
string
warehouse
,
DateTime
start
,
DateTime
end
)
{
var
_service
=
new
Services
.
FinanceReportServices
();
...
...
@@ -7391,6 +7401,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
/// <param name="start">期初时间</param>
/// <param name="end">期末时间</param>
/// <returns></returns>
[
BrowseLog
(
"Bailun_data"
,
"访问【百伦数据中心】->【财务报表】->【半成品仓库进销存报表】->【查询】页面"
,
0
)]
public
string
SemiWHPurchaseSellStockJson
(
BtTableParameter
parameter
,
string
warehousetype
,
string
warehouse
,
DateTime
start
,
DateTime
end
)
{
var
total
=
0
;
...
...
@@ -7482,6 +7493,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
/// <param name="start">期初日期</param>
/// <param name="end">期末日期</param>
/// <returns></returns>
[
BrowseLog
(
"Bailun_data"
,
"访问【百伦数据中心】->【财务报表】->【半成品SKU进销存】->【查询】页面"
,
0
)]
public
string
SemiSkuPurchaseSellStockJson
(
BtTableParameter
parameter
,
string
sku
,
string
warehousetype
,
string
warehouse
,
DateTime
start
,
DateTime
end
)
{
var
_service
=
new
Services
.
FinanceReportServices
();
...
...
@@ -7558,7 +7570,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
{
return
View
();
}
[
BrowseLog
(
"Bailun_data"
,
"访问【百伦数据中心】->【分平台利润统计】->【AliExpress】->【速卖通充值记录】->【查询】页面"
,
0
)]
public
string
AliExpressChargeJson
(
BtTableParameter
parameter
,
string
account
,
DateTime
?
start
,
DateTime
?
end
)
{
var
total
=
0
;
...
...
@@ -7591,6 +7603,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
/// </summary>
/// <returns></returns>
[
HttpPost
]
[
BrowseLog
(
"Bailun_data"
,
"触发【百伦数据中心】->【分平台利润统计】->【AliExpress】->【速卖通充值记录】->【导入】操作"
,
1
)]
public
JsonResult
UploadAliExpressCharge
()
{
if
(
Request
.
Form
.
Files
.
Count
==
0
)
...
...
@@ -7724,6 +7737,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
/// <param name="end">结束月份</param>
/// <returns></returns>
[
HttpPost
]
[
BrowseLog
(
"Bailun_data"
,
"访问【百伦数据中心】->【财务报表】->【月度销售利润统计】->【查询】页面"
,
0
)]
public
JsonResult
ListMonthSaleProfit
(
string
month
)
{
var
_service
=
new
Services
.
FinanceReportServices
();
...
...
@@ -8074,6 +8088,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
/// <param name="end">结束时间</param>
/// <param name="platform">平台类型</param>
/// <returns></returns>
[
BrowseLog
(
"Bailun_data"
,
"访问【百伦数据中心】->【财务报表】->【平台应收账款】->【搜索】页面"
,
0
)]
public
string
PlatformReceivableJson
(
BtTableParameter
parameter
,
DateTime
start
,
DateTime
end
,
string
platform
,
int
type
)
{
var
total
=
0
;
...
...
@@ -8178,6 +8193,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
/// <returns></returns>
[
BailunAuthentication
(
LoginMode
.
Enforce
)]
[
HttpPost
]
[
BrowseLog
(
"Bailun_data"
,
"访问【百伦数据中心】->【财务报表】->【进销存差异汇总】->【搜索】页面"
,
0
)]
public
JsonResult
UnReasonableJson
(
string
month
)
{
if
(
string
.
IsNullOrEmpty
(
month
))
...
...
@@ -8291,6 +8307,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
/// <param name="isaims">是否aims下单</param>
/// <returns></returns>
[
BailunAuthentication
(
LoginMode
.
Enforce
)]
[
BrowseLog
(
"Bailun_data"
,
"访问【百伦数据中心】->【财务报表】->【每月进销存合理报表】->【搜索】页面"
,
0
)]
public
string
ListUnReasonableJson
(
BtTableParameter
parameter
,
string
month
,
string
warehousetype
,
string
warehouse
,
int
?
type
,
int
?
isclear
,
int
?
isnew
,
int
?
isaims
,
string
category
,
int
isreasonable
=
-
1
)
{
var
total
=
0
;
...
...
Bailun.DC.Web/Areas/Reports/Controllers/InventoryController.cs
View file @
d2e5009e
...
...
@@ -119,6 +119,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
}
[
HttpPost
]
[
BrowseLog
(
"Bailun_data"
,
"访问【百伦数据中心】->【库存】->【库存周转报表】->【数据仓】->【查询】页面"
,
0
)]
public
JsonResult
DataWareHouseCountJson
(
Models
.
BtTableParameter
request
,
string
warehousetype
,
int
?
areaid
,
string
warehousecode
,
DateTime
?
start
,
DateTime
?
end
,
int
?
monitorstatus
,
int
?
cleanstatus
,
int
?
infringestatus
,
string
skutip
,
int
?
storestart
,
int
?
storeend
,
int
?
skucategory
,
string
searchkey
,
string
skucategoryids
,
string
groupname
,
string
skubrand
)
{
var
service
=
new
Services
.
SkuMonitorServices
();
...
...
@@ -269,6 +270,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
/// <param name="groupname"></param>
/// <returns></returns>
[
HttpPost
]
[
BrowseLog
(
"Bailun_data"
,
"触发【百伦数据中心】->【库存】->【库存周转报表】->【数据仓】->【设置分组】操作"
,
1
)]
public
JsonResult
SaveGroupName
(
string
s
,
string
groupname
)
{
if
(
string
.
IsNullOrWhiteSpace
(
groupname
))
...
...
@@ -302,6 +304,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
/// 上传Sku分组文件
/// </summary>
/// <returns></returns>
[
BrowseLog
(
"Bailun_data"
,
"触发【百伦数据中心】->【库存】->【库存周转报表】->【数据仓】->【上传分组文件】操作"
,
1
)]
public
JsonResult
UploadSkuGroup
()
{
if
(
Request
.
Form
.
Files
.
Count
==
0
)
...
...
@@ -414,6 +417,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
/// <param name="start">开发开始时间</param>
/// <param name="end">开发结束时间</param>
/// <returns></returns>
[
BrowseLog
(
"Bailun_data"
,
"访问【百伦数据中心】->【库存】->【库存周转报表】->【数据仓销售分析】->【查询】页面"
,
0
)]
public
string
WarehouseSaleReportJson
(
Models
.
BtTableParameter
parameter
,
string
warehousetype
,
string
warehousecode
,
int
?
startcount
,
int
?
endcount
,
DateTime
?
devstart
,
DateTime
?
devend
,
DateTime
?
start
,
DateTime
?
end
)
{
var
total
=
0
;
...
...
Bailun.DC.Web/Areas/Reports/Controllers/LogisticsController.cs
View file @
d2e5009e
...
...
@@ -41,6 +41,8 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
/// <param name="suppliername">供应商名称</param>
/// <returns></returns>
[
BailunAuthentication
(
LoginMode
.
Enforce
)]
[
BrowseLog
(
"Bailun_data"
,
"访问【百伦数据中心】->【财务报表】->【物流供应商往来】->【搜索】页面"
,
0
)]
public
string
SupplierTrancationReportJson
(
BtTableParameter
request
,
DateTime
start
,
DateTime
end
,
string
suppliername
)
{
var
total
=
0
;
...
...
Bailun.DC.Web/Areas/Reports/Controllers/OnWayController.cs
View file @
d2e5009e
...
...
@@ -134,6 +134,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
}
[
BailunAuthentication
(
LoginMode
.
Enforce
)]
[
BrowseLog
(
"Bailun_data"
,
"访问【百伦数据中心】->【订单】->【调拨计划在途明细】->【查询】页面"
,
0
)]
public
string
AllotPlanJson
(
BtTableParameter
parameter
,
string
orderno
,
string
sku
,
string
warehousetype
,
string
warehousecode
)
{
var
total
=
0
;
...
...
Bailun.DC.Web/Areas/Reports/Controllers/OrdersController.cs
View file @
d2e5009e
This diff is collapsed.
Click to expand it.
Bailun.DC.Web/Areas/Reports/Controllers/PurchaseController.cs
View file @
d2e5009e
...
...
@@ -45,6 +45,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
/// <param name="no">采购单号</param>
/// <param name="status">采购单状态</param>
/// <returns></returns>
[
BrowseLog
(
"Bailun_data"
,
"访问【百伦数据中心】->【订单】->【采购单】->【查询】页面"
,
0
)]
public
string
ListPurchaseJson
(
BtTableParameter
parameter
,
string
warehouse
,
string
sku
,
string
no
,
int
?
status
)
{
var
total
=
0
;
...
...
Bailun.DC.Web/Areas/Reports/Controllers/SkuController.cs
View file @
d2e5009e
...
...
@@ -43,6 +43,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
/// <param name="sku"></param>
/// <param name="skuname"></param>
/// <returns></returns>
[
BrowseLog
(
"Bailun_data"
,
"访问【百伦数据中心】->【库存】->【库存周转报表】->【sku】->【查询】页面"
,
0
)]
public
string
ListSkuJson
(
BtTableParameter
parameter
,
string
sku
,
string
skuname
)
{
var
total
=
0
;
...
...
@@ -98,6 +99,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
/// <param name="max">差异结束值</param>
/// <returns></returns>
[
BailunAuthentication
(
LoginMode
.
Enforce
)]
[
BrowseLog
(
"Bailun_data"
,
"访问【百伦数据中心】->【数据分析】->【Sku发货重量差异】->【查询】页面"
,
0
)]
public
string
ListSkuDiffWeighJson
(
BtTableParameter
parameter
,
string
sku
,
string
warehousetype
,
string
warehousecode
,
DateTime
?
shipstart
,
DateTime
?
shipend
,
int
?
min
,
int
?
max
)
{
var
total
=
0
;
...
...
@@ -173,6 +175,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
/// <param name="type">库龄,3:3个月以上,6:6个月以上,12:1年以上,24:2年以上,36:3年以上,4:3个月以上,6个月以下,7:6个月以上,12个月以下,13:12个月以上,24个月以下,25:24个月以上,36个月以下</param>
/// <returns></returns>
[
BailunAuthentication
(
LoginMode
.
Enforce
)]
[
BrowseLog
(
"Bailun_data"
,
"访问【百伦数据中心】->【库存】->【库龄列表】->【查询】页面"
,
0
)]
public
string
ListInventoryAgingJson
(
BtTableParameter
parameter
,
string
sku
,
string
warehouse
,
string
warehousetype
,
int
type
,
string
buyername
)
{
var
total
=
0
;
...
...
Bailun.DC.Web/Areas/Reports/Controllers/WarehouseController.cs
View file @
d2e5009e
...
...
@@ -46,6 +46,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
/// <param name="warehouse">仓库编码</param>
/// <returns></returns>
[
BailunAuthentication
(
LoginMode
.
Enforce
)]
[
BrowseLog
(
"Bailun_data"
,
"访问【百伦数据中心】->【库存】->【库存周转报表】->【逻辑仓库】->【查询】页面"
,
0
)]
public
string
LogicWarehouseJson
(
BtTableParameter
parameter
,
string
warehousetype
,
string
warehousecode
)
{
var
user
=
HttpContextHelper
.
Current
?.
User
;
...
...
@@ -253,6 +254,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
/// <param name="warehousetype">仓库类型</param>
/// <param name="code">仓库编码</param>
/// <returns></returns>
[
BrowseLog
(
"Bailun_data"
,
"访问【百伦数据中心】->【库存】->【库存周转报表】->【查询】页面"
,
0
)]
public
string
WarehouseRedundancyJson
(
BtTableParameter
parameter
,
string
warehousetype
,
string
code
,
DateTime
?
day
)
{
var
total
=
0
;
...
...
@@ -749,6 +751,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
/// <param name="t">1:按采购下单,2:按入库</param>
/// <returns></returns>
[
HttpPost
]
[
BrowseLog
(
"Bailun_data"
,
"访问【百伦数据中心】->【财务报表】->【每日销进差异汇总】->【查询】页面"
,
0
)]
public
JsonResult
DailyPurchaseSalesCountJson
(
int
dateWay
,
DateTime
start
,
DateTime
end
,
string
warehousetype
,
string
warehousecode
,
int
t
)
{
var
list
=
new
List
<
mDailyPurchaseSales
>();
...
...
@@ -1253,6 +1256,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
/// <param name="warehousecode"></param>
/// <param name="skucategoryids"></param>
/// <returns></returns>
[
BrowseLog
(
"Bailun_data"
,
"访问【百伦数据中心】->【利润统计】->【仓库利润统计】->【查询】页面"
,
0
)]
public
string
ListWarehouseProfitJson
(
BtTableParameter
parameter
,
string
warehousecode
,
string
skucategoryids
)
{
var
total
=
0
;
...
...
@@ -1346,6 +1350,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
/// <param name="warehousecode"></param>
/// <param name="skucategoryids"></param>
/// <returns></returns>
[
BrowseLog
(
"Bailun_data"
,
"访问【百伦数据中心】->【利润统计】->【sku利润统计】->【查询】页面"
,
0
)]
public
string
ListSkuProfitJson
(
BtTableParameter
parameter
,
string
warehousecode
,
string
skucategoryids
)
{
var
total
=
0
;
...
...
Bailun.DC.Web/Areas/Users/Controllers/HomeController.cs
View file @
d2e5009e
...
...
@@ -32,6 +32,7 @@ namespace Bailun.DC.Web.Areas.Users.Controllers
/// </summary>
/// <param name="parameter"></param>
/// <returns></returns>
[
BrowseLog
(
"Bailun_data"
,
"访问【百伦数据中心】->【系统设置】->【角色设置】->【查询】页面"
,
0
)]
public
string
ListUserRoles
(
BtTableParameter
parameter
,
string
name
)
{
var
total
=
0
;
...
...
@@ -85,6 +86,7 @@ namespace Bailun.DC.Web.Areas.Users.Controllers
/// <returns></returns>
[
BailunAuthentication
(
LoginMode
.
Enforce
)]
[
HttpPost
]
[
BrowseLog
(
"Bailun_data"
,
"触发【百伦数据中心】->【系统设置】->【角色设置】->【保存用户角色信息】操作"
,
1
)]
public
JsonResult
SaveUserRole
(
int
?
id
,
string
name
,
string
note
)
{
var
user
=
HttpContextHelper
.
Current
?.
User
;
...
...
@@ -103,6 +105,7 @@ namespace Bailun.DC.Web.Areas.Users.Controllers
/// <returns></returns>
[
BailunAuthentication
(
LoginMode
.
Enforce
)]
[
HttpPost
]
[
BrowseLog
(
"Bailun_data"
,
"触发【百伦数据中心】->【系统设置】->【角色设置】->【删除用户角色信息】操作"
,
2
)]
public
JsonResult
DelUserRole
(
int
id
)
{
var
user
=
HttpContextHelper
.
Current
?.
User
;
...
...
@@ -301,6 +304,7 @@ namespace Bailun.DC.Web.Areas.Users.Controllers
/// <returns></returns>
[
BailunAuthentication
(
LoginMode
.
Enforce
)]
[
HttpPost
]
[
BrowseLog
(
"Bailun_data"
,
"触发【百伦数据中心】->【系统设置】->【权限设置】->【保存菜单权限】操作"
,
1
)]
public
JsonResult
SaveRoleMenus
(
int
roleid
,
string
s
,
int
?
isall
=
0
)
{
var
user
=
HttpContextHelper
.
Current
?.
User
;
...
...
@@ -321,6 +325,7 @@ namespace Bailun.DC.Web.Areas.Users.Controllers
/// <returns></returns>
[
BailunAuthentication
(
LoginMode
.
Enforce
)]
[
HttpPost
]
[
BrowseLog
(
"Bailun_data"
,
"触发【百伦数据中心】->【系统设置】->【权限设置】->【保存导出权限】操作"
,
1
)]
public
JsonResult
SaveRoleExport
(
int
roleid
,
string
s
)
{
var
user
=
HttpContextHelper
.
Current
?.
User
;
...
...
Bailun.DC.Web/BrowseLogAttribute.cs
0 → 100644
View file @
d2e5009e
using
System
;
using
Microsoft.AspNetCore.Mvc.Filters
;
using
System.Net
;
using
System.Net.Http
;
using
System.Net.Http.Headers
;
using
System.Text
;
using
Newtonsoft.Json
;
using
Bailun.ServiceFabric.Extension
;
using
Bailun.ServiceFabric.Core.Extension.HttpContext
;
using
Bailun.ServiceFabric.Core.Extension
;
namespace
Bailun.DC.Web
{
public
class
BrowseLogAttribute
:
ActionFilterAttribute
{
/// <summary>
/// 项目id
/// </summary>
private
readonly
string
_projectCode
;
/// <summary>
/// 模块名称
/// </summary>
private
readonly
string
_moduleName
;
/// <summary>
/// 备注信息
/// </summary>
private
readonly
string
_remark
;
/// <summary>
/// 操作类型 (0查、1增、2删、3修改)
/// </summary>
private
readonly
int
_operationType
;
/// <summary>
/// 此特性负责写浏览日志
/// </summary>
/// <param name="projectId">项目id</param>
/// <param name="moduleName">模块名称</param>
/// <param name="operationType">操作类型 (0查、1增、2删、3修改)</param>
/// <param name="remark">备注信息</param>
public
BrowseLogAttribute
(
string
projectCode
,
string
moduleName
,
int
operationType
,
string
remark
=
""
)
{
_projectCode
=
projectCode
;
_moduleName
=
moduleName
;
_operationType
=
operationType
;
_remark
=
remark
;
}
public
override
void
OnActionExecuted
(
ActionExecutedContext
context
)
{
try
{
string
canLogValue
=
ConfigManagerConf
.
GetValue
(
"BrowseLogSetting:CanLog"
);
if
(
canLogValue
!=
"yes"
)
{
return
;
}
var
userId
=
HttpContextHelper
.
Current
?.
User
?.
GetUid
();
var
userName
=
HttpContextHelper
.
Current
?.
User
?.
GetUserName
();
var
companyId
=
HttpContextHelper
.
Current
?.
User
?.
GetCompanyId
();
// 执行结果
var
isSuccessed
=
true
;
// 执行失败的信息
var
execFaildMsg
=
""
;
if
(
context
.
Exception
!=
null
&&
context
.
Result
==
null
)
{
// 方法执行失败 有异常
isSuccessed
=
false
;
execFaildMsg
=
context
.
Exception
.
Message
;
}
// 组装写日志的入参
var
input
=
new
AddOperationLogInfoInput
{
UserId
=
(
int
)
userId
,
UserName
=
userName
,
ProjectCode
=
_projectCode
,
OperationType
=
_operationType
,
OperationContent
=
_moduleName
,
OperationTime
=
DateTime
.
Now
,
IsSuccessed
=
isSuccessed
,
FailInfo
=
execFaildMsg
,
Remarks
=
_remark
,
CompanyId
=
companyId
};
var
url
=
ConfigManagerConf
.
GetValue
(
"BrowseLogSetting:Url"
);
var
logRes
=
PostAsync
<
AddOperationLogInfoInput
,
AddOperationLogInfoOutput
>(
url
,
input
);
if
(
logRes
.
StatusCode
!=
200
)
{
Console
.
WriteLine
(
$"写浏览日志失败:
{
logRes
.
Message
}
"
);
}
}
catch
(
Exception
e
)
{
Console
.
WriteLine
(
e
);
}
}
/// <summary>
/// HttpClient实现Post请求
/// </summary>
/// <typeparam name="T1">传入对象类型</typeparam>
/// <typeparam name="T2">返回对象类型</typeparam>
/// <param name="url"></param>
/// <param name="content"></param>
/// <returns></returns>
public
static
T2
PostAsync
<
T1
,
T2
>(
string
url
,
T1
content
)
where
T2
:
new
()
{
if
(
string
.
IsNullOrWhiteSpace
(
url
)
||
content
==
null
)
{
return
new
T2
();
}
try
{
//设置内容压缩
var
handler
=
new
HttpClientHandler
()
{
AutomaticDecompression
=
DecompressionMethods
.
GZip
};
using
(
var
client
=
new
HttpClient
(
handler
))
{
client
.
DefaultRequestHeaders
.
Accept
.
Clear
();
client
.
DefaultRequestHeaders
.
Accept
.
Add
(
new
MediaTypeWithQualityHeaderValue
(
"application/json"
));
var
postDataJson
=
JsonConvert
.
SerializeObject
(
content
,
new
JsonSerializerSettings
()
{
ReferenceLoopHandling
=
ReferenceLoopHandling
.
Ignore
,
NullValueHandling
=
NullValueHandling
.
Ignore
});
var
response
=
client
.
PostAsync
(
url
,
new
StringContent
(
postDataJson
,
Encoding
.
UTF8
,
"application/json"
)).
Result
;
//var response = client.PostAsJsonAsync<T1>(url, content).Result;
if
(
response
.
IsSuccessStatusCode
)
{
var
reponseResult
=
response
.
Content
.
ReadAsStringAsync
().
Result
;
var
result
=
JsonConvert
.
DeserializeObject
<
T2
>(
reponseResult
,
new
JsonSerializerSettings
()
{
ReferenceLoopHandling
=
ReferenceLoopHandling
.
Ignore
,
NullValueHandling
=
NullValueHandling
.
Ignore
});
return
result
;
}
return
JsonConvert
.
DeserializeObject
<
T2
>(
null
,
new
JsonSerializerSettings
()
{
ReferenceLoopHandling
=
ReferenceLoopHandling
.
Ignore
,
NullValueHandling
=
NullValueHandling
.
Ignore
});
//return new T2() { Message = "HTTP响应失败", };
}
}
catch
(
Exception
ex
)
{
throw
ex
;
}
}
public
class
AddOperationLogInfoOutput
{
/// <summary>
/// 信息
/// </summary>
[
JsonProperty
(
"message"
)]
public
string
Message
{
get
;
set
;
}
/// <summary>
/// 结果
/// </summary>
[
JsonProperty
(
"result"
)]
public
object
Result
{
get
;
set
;
}
/// <summary>
/// 状态码
/// </summary>
[
JsonProperty
(
"statusCode"
)]
public
int
StatusCode
{
get
;
set
;
}
}
public
class
AddOperationLogInfoInput
{
/// <summary>
///
/// </summary>
public
int
UserId
{
get
;
set
;
}
/// <summary>
/// 系统id
/// </summary>
public
int
ProjectId
{
get
;
set
;
}
/// <summary>
/// 系统代码
/// </summary>
public
string
ProjectCode
{
get
;
set
;
}
/// <summary>
///
/// </summary>
public
string
UserName
{
get
;
set
;
}
/// <summary>
/// 公司id
/// </summary>
public
string
CompanyId
{
get
;
set
;
}
/// <summary>
/// 操作类型(0查、1增、2删、3修改)
/// </summary>
public
int
OperationType
{
get
;
set
;
}
/// <summary>
/// 操作内容
/// </summary>
public
string
OperationContent
{
get
;
set
;
}
/// <summary>
/// 操作时间
/// </summary>
public
DateTime
OperationTime
{
get
;
set
;
}
=
DateTime
.
Now
;
/// <summary>
/// 是否操作成功
/// </summary>
public
bool
IsSuccessed
{
get
;
set
;
}
/// <summary>
/// 失败原因
/// </summary>
public
string
FailInfo
{
get
;
set
;
}
/// <summary>
/// 备注
/// </summary>
public
string
Remarks
{
get
;
set
;
}
}
}
}
\ No newline at end of file
Bailun.DC.Web/appsettings.Development.json
View file @
d2e5009e
...
...
@@ -5,5 +5,9 @@
"System"
:
"Information"
,
"Microsoft"
:
"Information"
}
},
"BrowseLogSetting"
:
{
"Url"
:
"http://saas.admin.bailuntec.com/Api/Ssoadmin/operationloginfo/addoperationloginfo"
,
"CanLog"
:
"yes"
}
}
Bailun.DC.Web/appsettings.json
View file @
d2e5009e
...
...
@@ -15,5 +15,9 @@
"AppSetting"
:
{
"SsoUrl"
:
"http://sso.bailuntec.com"
,
//֤url
"AuthType"
:
""
//Ƿdebugģʽ
},
"BrowseLogSetting"
:
{
"Url"
:
"http://saas.admin.bailuntec.com/Api/Ssoadmin/operationloginfo/addoperationloginfo"
,
"CanLog"
:
"yes"
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment