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
2eb10052
Commit
2eb10052
authored
Aug 03, 2021
by
guanzhenshan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
财务会计流水增加数据类型筛选
parent
14c7e74d
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
352 additions
and
95 deletions
+352
-95
order_fee_value_amazon.cs
Bailun.DC.Models/DataWareHouse/order_fee_value_amazon.cs
+0
-1
LogisticServices.cs
Bailun.DC.Services/DataWareHouse/LogisticServices.cs
+60
-2
PlatformOrderFeeServices.cs
Bailun.DC.Services/DataWareHouse/PlatformOrderFeeServices.cs
+9
-3
LogisticsController.cs
...eb/Areas/DataWareHouse/Controllers/LogisticsController.cs
+184
-3
PlatformOrderController.cs
...reas/DataWareHouse/Controllers/PlatformOrderController.cs
+39
-17
List.cshtml
...un.DC.Web/Areas/DataWareHouse/Views/Logistics/List.cshtml
+15
-66
FinanceAccount_OrderBilling.cshtml
...se/Views/PlatformOrder/FinanceAccount_OrderBilling.cshtml
+45
-3
No files found.
Bailun.DC.Models/DataWareHouse/order_fee_value_amazon.cs
View file @
2eb10052
...
@@ -104,7 +104,6 @@ namespace Bailun.DC.Models.DataWareHouse
...
@@ -104,7 +104,6 @@ namespace Bailun.DC.Models.DataWareHouse
/// </summary>
/// </summary>
public
decimal
?
amountval_rmb
{
get
;
set
;
}
public
decimal
?
amountval_rmb
{
get
;
set
;
}
[
NotMapped
]
public
string
month
{
get
;
set
;
}
public
string
month
{
get
;
set
;
}
}
}
...
...
Bailun.DC.Services/DataWareHouse/LogisticServices.cs
View file @
2eb10052
...
@@ -11,6 +11,58 @@ namespace Bailun.DC.Services.DataWareHouse
...
@@ -11,6 +11,58 @@ namespace Bailun.DC.Services.DataWareHouse
public
class
LogisticServices
public
class
LogisticServices
{
{
/// <summary>
/// <summary>
/// 获取销售平台流水的模版数据
/// </summary>
/// <param name="platform"></param>
/// <param name="website"></param>
/// <param name="start"></param>
/// <param name="end"></param>
/// <returns></returns>
public
Models
.
DataWareHouse
.
flowing_logistic
Get
(
string
platform
,
string
website
,
DateTime
?
start
,
DateTime
?
end
,
string
month
)
{
var
sql
=
"select * from flowing_logistic where 1=1"
;
var
sqlParam
=
new
DynamicParameters
();
if
(!
string
.
IsNullOrEmpty
(
platform
))
{
sql
+=
" and platformtype=@platform"
;
sqlParam
.
Add
(
"platform"
,
platform
);
}
if
(!
string
.
IsNullOrEmpty
(
website
))
{
sql
+=
" and website=@website"
;
sqlParam
.
Add
(
"website"
,
website
);
}
if
(
start
.
HasValue
)
{
sql
+=
$" and datatime>='
{
start
.
Value
.
ToString
(
"yyyy-MM-dd"
)}
'"
;
}
if
(
end
.
HasValue
)
{
sql
+=
$" and datatime<'
{
end
.
Value
.
AddDays
(
1
).
ToString
(
"yyyy-MM-dd"
)}
'"
;
}
if
(!
string
.
IsNullOrEmpty
(
month
))
{
sql
+=
$" and month=@month"
;
sqlParam
.
Add
(
"month"
,
month
);
}
using
(
var
cn
=
new
MySqlConnection
(
Common
.
GlobalConfig
.
ConnectionString_DW
))
{
if
(
cn
.
State
==
System
.
Data
.
ConnectionState
.
Closed
)
{
cn
.
Open
();
}
var
obj
=
cn
.
QueryFirstOrDefault
<
Models
.
DataWareHouse
.
flowing_logistic
>(
sql
,
sqlParam
);
return
obj
;
}
}
/// <summary>
/// 获取物流流水的简单配置
/// 获取物流流水的简单配置
/// </summary>
/// </summary>
/// <returns></returns>
/// <returns></returns>
...
@@ -38,7 +90,7 @@ namespace Bailun.DC.Services.DataWareHouse
...
@@ -38,7 +90,7 @@ namespace Bailun.DC.Services.DataWareHouse
/// <param name="end"></param>
/// <param name="end"></param>
/// <param name="total"></param>
/// <param name="total"></param>
/// <returns></returns>
/// <returns></returns>
public
List
<
flowing_logistic
>
ListFlowingLogistic
(
int
page
,
int
pagesize
,
string
platform
,
string
website
,
DateTime
?
start
,
DateTime
?
end
,
string
orderno
,
ref
int
total
)
public
List
<
flowing_logistic
>
ListFlowingLogistic
(
int
page
,
int
pagesize
,
string
platform
,
string
website
,
string
month
,
DateTime
?
start
,
DateTime
?
end
,
string
orderno
,
ref
int
total
)
{
{
var
sql
=
"select * from flowing_logistic where 1=1"
;
var
sql
=
"select * from flowing_logistic where 1=1"
;
var
sqlparam
=
new
DynamicParameters
();
var
sqlparam
=
new
DynamicParameters
();
...
@@ -71,6 +123,12 @@ namespace Bailun.DC.Services.DataWareHouse
...
@@ -71,6 +123,12 @@ namespace Bailun.DC.Services.DataWareHouse
sqlparam
.
Add
(
"no"
,
orderno
);
sqlparam
.
Add
(
"no"
,
orderno
);
}
}
if
(!
string
.
IsNullOrEmpty
(
month
))
{
sql
+=
" and month=@month"
;
sqlparam
.
Add
(
"month"
,
month
);
}
using
(
var
cn
=
new
MySqlConnection
(
Common
.
GlobalConfig
.
ConnectionString_DW
))
using
(
var
cn
=
new
MySqlConnection
(
Common
.
GlobalConfig
.
ConnectionString_DW
))
{
{
if
(
cn
.
State
==
System
.
Data
.
ConnectionState
.
Closed
)
if
(
cn
.
State
==
System
.
Data
.
ConnectionState
.
Closed
)
...
@@ -85,7 +143,7 @@ namespace Bailun.DC.Services.DataWareHouse
...
@@ -85,7 +143,7 @@ namespace Bailun.DC.Services.DataWareHouse
}
}
else
else
{
{
var
obj
=
cn
.
Query
<
flowing_logistic
>(
sql
).
ToList
();
var
obj
=
cn
.
Query
<
flowing_logistic
>(
sql
,
sqlparam
).
ToList
();
total
=
obj
.
Count
;
total
=
obj
.
Count
;
return
obj
;
return
obj
;
...
...
Bailun.DC.Services/DataWareHouse/PlatformOrderFeeServices.cs
View file @
2eb10052
...
@@ -133,12 +133,18 @@ namespace Bailun.DC.Services.DataWareHouse
...
@@ -133,12 +133,18 @@ namespace Bailun.DC.Services.DataWareHouse
/// <param name="orderno"></param>
/// <param name="orderno"></param>
/// <param name="total"></param>
/// <param name="total"></param>
/// <returns></returns>
/// <returns></returns>
public
List
<
order_fee_value_amazon
>
ListOrderFeeValue
(
int
page
,
int
pagesize
,
string
platform
,
string
website
,
DateTime
?
start
,
DateTime
?
end
,
string
orderno
,
string
month
,
ref
int
total
)
public
List
<
order_fee_value_amazon
>
ListOrderFeeValue
(
int
page
,
int
pagesize
,
string
platform
,
string
website
,
DateTime
?
start
,
DateTime
?
end
,
string
orderno
,
string
month
,
ref
int
total
,
int
?
datatype
)
{
{
var
sql
=
$@"select t1.*
,t2.month from order_fee_value_amazon t1 join flowing_sales t2 on t1.flowing_sales_id=t2.id
var
sql
=
$@"select t1.*
from order_fee_value_amazon t1
where t1.amountval!=0 "
;
where t1.amountval!=0 "
;
var
sqlparam
=
new
DynamicParameters
();
var
sqlparam
=
new
DynamicParameters
();
if
(
datatype
.
HasValue
)
{
sql
+=
" and t1.datatype="
+
datatype
.
Value
;
}
if
(!
string
.
IsNullOrEmpty
(
platform
))
if
(!
string
.
IsNullOrEmpty
(
platform
))
{
{
sql
+=
" and t1.platform=@platform"
;
sql
+=
" and t1.platform=@platform"
;
...
@@ -175,7 +181,7 @@ namespace Bailun.DC.Services.DataWareHouse
...
@@ -175,7 +181,7 @@ namespace Bailun.DC.Services.DataWareHouse
if
(!
string
.
IsNullOrEmpty
(
month
))
if
(!
string
.
IsNullOrEmpty
(
month
))
{
{
sql
+=
$" and t
2
.month=@month"
;
sql
+=
$" and t
1
.month=@month"
;
sqlparam
.
Add
(
"month"
,
month
);
sqlparam
.
Add
(
"month"
,
month
);
}
}
...
...
Bailun.DC.Web/Areas/DataWareHouse/Controllers/LogisticsController.cs
View file @
2eb10052
using
Microsoft.AspNetCore.Mvc
;
using
Microsoft.AspNetCore.Hosting
;
using
Microsoft.AspNetCore.Mvc
;
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Data
;
using
System.Data
;
...
@@ -10,6 +11,14 @@ namespace Bailun.DC.Web.Areas.DataWareHouse.Controllers
...
@@ -10,6 +11,14 @@ namespace Bailun.DC.Web.Areas.DataWareHouse.Controllers
[
Area
(
"DataWareHouse"
)]
[
Area
(
"DataWareHouse"
)]
public
class
LogisticsController
:
Base
.
BaseController
public
class
LogisticsController
:
Base
.
BaseController
{
{
private
readonly
IHostingEnvironment
_hostingEnvironment
;
public
LogisticsController
(
IHostingEnvironment
hostingEnvironment
)
{
_hostingEnvironment
=
hostingEnvironment
;
}
public
IActionResult
List
(
string
platform
)
public
IActionResult
List
(
string
platform
)
{
{
var
listconfig
=
new
Services
.
DataWareHouse
.
PlatformOrderFeeServices
().
ListOrderFeeConfig
(
2
);
var
listconfig
=
new
Services
.
DataWareHouse
.
PlatformOrderFeeServices
().
ListOrderFeeConfig
(
2
);
...
@@ -32,7 +41,7 @@ namespace Bailun.DC.Web.Areas.DataWareHouse.Controllers
...
@@ -32,7 +41,7 @@ namespace Bailun.DC.Web.Areas.DataWareHouse.Controllers
/// <param name="pagesize"></param>
/// <param name="pagesize"></param>
/// <returns></returns>
/// <returns></returns>
[
HttpPost
]
[
HttpPost
]
public
JsonResult
ListFlowingJson
(
int
page
,
string
platform
,
string
website
,
DateTime
?
start
,
DateTime
?
end
,
string
orderno
,
int
pagesize
=
25
)
public
JsonResult
ListFlowingJson
(
int
page
,
string
platform
,
string
website
,
string
month
,
DateTime
?
start
,
DateTime
?
end
,
string
orderno
,
int
pagesize
=
25
)
{
{
var
total
=
0
;
var
total
=
0
;
if
(
page
<=
0
)
if
(
page
<=
0
)
...
@@ -40,7 +49,7 @@ namespace Bailun.DC.Web.Areas.DataWareHouse.Controllers
...
@@ -40,7 +49,7 @@ namespace Bailun.DC.Web.Areas.DataWareHouse.Controllers
page
=
1
;
page
=
1
;
}
}
var
obj
=
new
Services
.
DataWareHouse
.
LogisticServices
().
ListFlowingLogistic
(
page
,
pagesize
,
platform
,
website
,
start
,
end
,
orderno
,
ref
total
);
var
obj
=
new
Services
.
DataWareHouse
.
LogisticServices
().
ListFlowingLogistic
(
page
,
pagesize
,
platform
,
website
,
month
,
start
,
end
,
orderno
,
ref
total
);
;
;
var
list
=
obj
.
Select
(
a
=>
new
{
var
list
=
obj
.
Select
(
a
=>
new
{
a
.
createtime
,
a
.
createtime
,
...
@@ -60,6 +69,7 @@ namespace Bailun.DC.Web.Areas.DataWareHouse.Controllers
...
@@ -60,6 +69,7 @@ namespace Bailun.DC.Web.Areas.DataWareHouse.Controllers
}
}
/// <summary>
/// <summary>
/// 上传物流流水数据
/// 上传物流流水数据
/// </summary>
/// </summary>
...
@@ -142,5 +152,176 @@ namespace Bailun.DC.Web.Areas.DataWareHouse.Controllers
...
@@ -142,5 +152,176 @@ namespace Bailun.DC.Web.Areas.DataWareHouse.Controllers
}
}
public
ActionResult
ExportFlowing
(
string
platform
,
string
website
,
string
month
,
DateTime
?
start
,
DateTime
?
end
,
string
orderno
)
{
if
(
string
.
IsNullOrEmpty
(
platform
))
{
return
Json
(
new
{
success
=
false
,
msg
=
"请选择平台类型"
});
}
var
total
=
0
;
var
obj
=
new
Services
.
DataWareHouse
.
LogisticServices
().
ListFlowingLogistic
(
0
,
0
,
platform
,
website
,
month
,
start
,
end
,
orderno
,
ref
total
);
if
(
obj
.
Count
==
0
)
{
return
Json
(
new
{
success
=
true
,
msg
=
"没有数据"
});
}
//列头
DataTable
dataTable
=
new
DataTable
();
//实例化
var
objFirst
=
obj
.
FirstOrDefault
();
var
jsonData
=
Newtonsoft
.
Json
.
JsonConvert
.
DeserializeObject
<
Dictionary
<
string
,
string
>>(
objFirst
.
jsondata
);
var
colnames
=
new
List
<
string
>();
foreach
(
var
item
in
jsonData
)
{
dataTable
.
Columns
.
Add
(
item
.
Key
,
typeof
(
string
));
colnames
.
Add
(
item
.
Key
);
}
foreach
(
var
item
in
obj
)
{
jsonData
=
Newtonsoft
.
Json
.
JsonConvert
.
DeserializeObject
<
Dictionary
<
string
,
string
>>(
item
.
jsondata
);
DataRow
dataRow
=
dataTable
.
NewRow
();
foreach
(
var
c
in
jsonData
)
{
dataRow
[
c
.
Key
]
=
c
.
Value
;
}
dataTable
.
Rows
.
Add
(
dataRow
);
}
//for (var i = 0; i < dataTable.Columns.Count; i++)
//{
// colnames.Add(dataTable.Columns[i].ColumnName);
//}
var
listVal
=
new
List
<
string
>();
for
(
int
j
=
0
;
j
<
dataTable
.
Rows
.
Count
;
j
++)
{
var
s
=
""
;
for
(
int
k
=
0
;
k
<
dataTable
.
Columns
.
Count
;
k
++)
{
string
tmpRowValue
=
dataTable
.
Rows
[
j
][
k
].
ToString
();
s
+=
tmpRowValue
+
"|"
;
}
//s = s.Substring(0, s.Length - 1);
listVal
.
Add
(
s
);
}
var
guid
=
Guid
.
NewGuid
().
ToString
();
var
filename
=
platform
+
" "
+
((
start
.
HasValue
?
start
.
Value
.
ToString
(
"yyyy-MM-dd"
)
:
""
+
(
end
.
HasValue
?
"至"
+
end
.
Value
.
ToString
(
"yyyy-MM-dd"
)
:
""
)))
+
"的账单流水"
;
var
filepath
=
_hostingEnvironment
.
WebRootPath
+
"\\Files\\Report\\"
+
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd"
)
+
"\\"
;
ToCSV
(
listVal
,
colnames
,
guid
,
filepath
);
var
ms
=
new
System
.
IO
.
MemoryStream
();
using
(
var
f
=
new
System
.
IO
.
FileStream
(
filepath
+
guid
+
".csv"
,
System
.
IO
.
FileMode
.
Open
))
{
f
.
CopyTo
(
ms
);
}
ms
.
Position
=
0
;
return
File
(
ms
,
"text/csv"
,
filename
+
".csv"
);
}
/// <summary>
/// 下载销售平台流水上传模版
/// </summary>
/// <param name="platform"></param>
/// <param name="website"></param>
/// <param name="start"></param>
/// <param name="end"></param>
/// <returns></returns>
public
ActionResult
DownLoadFlowingTemplate
(
string
platform
,
string
website
,
DateTime
?
start
,
DateTime
?
end
,
string
month
)
{
if
(
string
.
IsNullOrEmpty
(
platform
))
{
return
Content
(
"请选择完平台再导出"
);
}
var
obj
=
new
Services
.
DataWareHouse
.
LogisticServices
().
Get
(
platform
,
website
,
start
,
end
,
month
);
if
(
obj
==
null
)
{
return
Content
(
"系统没有该平台的模版可导出,你可自定义一个模版,后面的导入都以本次导入的格式作为新模板。"
);
}
DataTable
dataTable
=
new
DataTable
();
//实例化
var
jsonData
=
Newtonsoft
.
Json
.
JsonConvert
.
DeserializeObject
<
Dictionary
<
string
,
string
>>(
obj
.
jsondata
);
var
colnames
=
new
List
<
string
>();
foreach
(
var
item
in
jsonData
)
{
dataTable
.
Columns
.
Add
(
item
.
Key
,
typeof
(
string
));
colnames
.
Add
(
item
.
Key
);
}
jsonData
=
Newtonsoft
.
Json
.
JsonConvert
.
DeserializeObject
<
Dictionary
<
string
,
string
>>(
obj
.
jsondata
);
DataRow
dataRow
=
dataTable
.
NewRow
();
foreach
(
var
c
in
jsonData
)
{
dataRow
[
c
.
Key
]
=
c
.
Value
;
}
dataTable
.
Rows
.
Add
(
dataRow
);
//for (var i = 0; i < dataTable.Columns.Count; i++)
//{
// colnames.Add(dataTable.Columns[i].ColumnName);
//}
var
listVal
=
new
List
<
string
>();
for
(
int
j
=
0
;
j
<
dataTable
.
Rows
.
Count
;
j
++)
{
var
s
=
""
;
for
(
int
k
=
0
;
k
<
dataTable
.
Columns
.
Count
;
k
++)
{
string
tmpRowValue
=
dataTable
.
Rows
[
j
][
k
].
ToString
();
s
+=
tmpRowValue
+
"|"
;
}
//s = s.Substring(0, s.Length - 1);
listVal
.
Add
(
s
);
}
var
guid
=
Guid
.
NewGuid
().
ToString
();
var
filename
=
platform
+
" "
+
((
start
.
HasValue
?
start
.
Value
.
ToString
(
"yyyy-MM-dd"
)
:
""
+
(
end
.
HasValue
?
"至"
+
end
.
Value
.
ToString
(
"yyyy-MM-dd"
)
:
""
)))
+
"的上传模版"
;
var
filepath
=
_hostingEnvironment
.
WebRootPath
+
"\\Files\\Report\\"
+
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd"
)
+
"\\"
;
//ToCSV(listVal, colnames, guid, filepath);
ToExcel
(
dataTable
,
guid
,
filepath
);
var
ms
=
new
System
.
IO
.
MemoryStream
();
using
(
var
f
=
new
System
.
IO
.
FileStream
(
filepath
+
guid
+
".xls"
,
System
.
IO
.
FileMode
.
Open
))
{
f
.
CopyTo
(
ms
);
}
ms
.
Position
=
0
;
return
File
(
ms
,
"text/xls"
,
filename
+
".xls"
);
}
}
}
}
}
Bailun.DC.Web/Areas/DataWareHouse/Controllers/PlatformOrderController.cs
View file @
2eb10052
...
@@ -453,11 +453,11 @@ namespace Bailun.DC.Web.Areas.DataWareHouse.Controllers
...
@@ -453,11 +453,11 @@ namespace Bailun.DC.Web.Areas.DataWareHouse.Controllers
return
View
();
return
View
();
}
}
public
string
FinanceAccount_OrderBillingJson
(
Models
.
BtTableParameter
request
,
string
platform
,
string
website
,
string
account
,
DateTime
?
start
,
DateTime
?
end
,
string
orderno
,
string
month
)
public
string
FinanceAccount_OrderBillingJson
(
Models
.
BtTableParameter
request
,
string
platform
,
string
website
,
string
account
,
DateTime
?
start
,
DateTime
?
end
,
string
orderno
,
string
month
,
int
?
datatype
)
{
{
var
total
=
0
;
var
total
=
0
;
var
obj
=
new
Services
.
DataWareHouse
.
PlatformOrderFeeServices
().
ListOrderFeeValue
(
request
.
pageIndex
,
request
.
limit
,
platform
,
website
,
start
,
end
,
orderno
,
month
,
ref
total
);
var
obj
=
new
Services
.
DataWareHouse
.
PlatformOrderFeeServices
().
ListOrderFeeValue
(
request
.
pageIndex
,
request
.
limit
,
platform
,
website
,
start
,
end
,
orderno
,
month
,
ref
total
,
datatype
);
var
list
=
obj
.
Select
(
a
=>
new
var
list
=
obj
.
Select
(
a
=>
new
{
{
...
@@ -496,11 +496,11 @@ namespace Bailun.DC.Web.Areas.DataWareHouse.Controllers
...
@@ -496,11 +496,11 @@ namespace Bailun.DC.Web.Areas.DataWareHouse.Controllers
/// <param name="end"></param>
/// <param name="end"></param>
/// <param name="orderno"></param>
/// <param name="orderno"></param>
/// <returns></returns>
/// <returns></returns>
public
ActionResult
ExportFinanceAccount_OrderBilling
(
string
platform
,
string
website
,
string
account
,
DateTime
?
start
,
DateTime
?
end
,
string
orderno
,
string
month
)
public
ActionResult
ExportFinanceAccount_OrderBilling
(
string
platform
,
string
website
,
string
account
,
DateTime
?
start
,
DateTime
?
end
,
string
orderno
,
string
month
,
int
?
datatype
)
{
{
var
total
=
0
;
var
total
=
0
;
var
obj
=
new
Services
.
DataWareHouse
.
PlatformOrderFeeServices
().
ListOrderFeeValue
(
0
,
0
,
platform
,
website
,
start
,
end
,
orderno
,
month
,
ref
total
);
var
obj
=
new
Services
.
DataWareHouse
.
PlatformOrderFeeServices
().
ListOrderFeeValue
(
0
,
0
,
platform
,
website
,
start
,
end
,
orderno
,
month
,
ref
total
,
datatype
);
var
colnames
=
new
List
<
string
>
{
var
colnames
=
new
List
<
string
>
{
"主体"
,
"平台"
,
"站点"
,
"账单时间"
,
"单号"
,
"费用字段说明"
,
"财务分类归集说明"
,
"数据中心费用类型"
,
"会计科目编码"
,
"项目编码"
,
"币种"
,
"原币金额"
,
"汇率"
,
"RMB金额"
,
"月份"
"主体"
,
"平台"
,
"站点"
,
"账单时间"
,
"单号"
,
"费用字段说明"
,
"财务分类归集说明"
,
"数据中心费用类型"
,
"会计科目编码"
,
"项目编码"
,
"币种"
,
"原币金额"
,
"汇率"
,
"RMB金额"
,
"月份"
...
@@ -535,25 +535,47 @@ namespace Bailun.DC.Web.Areas.DataWareHouse.Controllers
...
@@ -535,25 +535,47 @@ namespace Bailun.DC.Web.Areas.DataWareHouse.Controllers
/// <param name="platform"></param>
/// <param name="platform"></param>
/// <returns></returns>
/// <returns></returns>
[
HttpPost
]
[
HttpPost
]
public
JsonResult
ListWebsite
(
string
platform
)
public
JsonResult
ListWebsite
(
string
platform
,
int
?
datatype
)
{
{
if
(
string
.
IsNullOrEmpty
(
platform
))
//if (string.IsNullOrEmpty(platform))
//{
// return Json(new {
// success = false,
// msg = "请选择平台",
// });
//}
var
listFeeCol
=
new
Services
.
DataWareHouse
.
PlatformOrderFeeServices
().
ListOrderFeeCol
();
if
(
datatype
.
HasValue
)
{
{
return
Json
(
new
{
listFeeCol
=
listFeeCol
.
Where
(
a
=>
a
.
datatype
==
datatype
.
Value
).
ToList
();
success
=
false
,
msg
=
"请选择平台"
,
});
}
}
var
listFeeCol
=
new
Services
.
DataWareHouse
.
PlatformOrderFeeServices
().
ListOrderFeeCol
();
if
(!
string
.
IsNullOrEmpty
(
platform
))
{
var
listWebsite
=
listFeeCol
.
Where
(
a
=>
a
.
platform
==
platform
).
Where
(
a
=>
!
string
.
IsNullOrEmpty
(
a
.
website
)).
ToList
();
var
listWebsite
=
listFeeCol
.
Where
(
a
=>
a
.
platform
==
platform
).
Where
(
a
=>
!
string
.
IsNullOrEmpty
(
a
.
website
)).
ToList
();
return
Json
(
new
{
success
=
true
,
data
=
listWebsite
.
Select
(
a
=>
a
.
website
).
Distinct
().
ToList
(),
msg
=
""
,
});
}
else
{
var
listPlatform
=
listFeeCol
.
Where
(
a
=>
!
string
.
IsNullOrEmpty
(
a
.
platform
)).
ToList
();
return
Json
(
new
{
return
Json
(
new
success
=
true
,
{
data
=
listWebsite
.
Select
(
a
=>
a
.
website
).
Distinct
().
ToList
(),
success
=
true
,
msg
=
""
,
data
=
listPlatform
.
Select
(
a
=>
a
.
platform
).
Distinct
().
ToList
(),
});
msg
=
""
,
});
}
}
}
...
...
Bailun.DC.Web/Areas/DataWareHouse/Views/Logistics/List.cshtml
View file @
2eb10052
...
@@ -46,8 +46,8 @@
...
@@ -46,8 +46,8 @@
<input id="end" name="end" class="form-control" style="width:100px" value="" placeholder="结束时间" />
<input id="end" name="end" class="form-control" style="width:100px" value="" placeholder="结束时间" />
</div>
</div>
<div class="form-group" style="margin-left:10px">
<div class="form-group" style="margin-left:10px">
<label>
跟踪
单号</label>
<label>单号</label>
<input id="orderno" name="orderno" class="form-control" style="width:200px" placeholder="请输入
跟踪
单号" />
<input id="orderno" name="orderno" class="form-control" style="width:200px" placeholder="请输入单号" />
</div>
</div>
<div class="form-group">
<div class="form-group">
<label> </label>
<label> </label>
...
@@ -355,18 +355,6 @@
...
@@ -355,18 +355,6 @@
return false;
return false;
}
}
//var month = $('#month').val();
//if (month == '') {
// alert('请选择月份');
// return false;
//}
//if (websitecount > 0 && website == '') {
// alert('请选择站点,再下载导入模版。');
// return false;
//}
uploadfile('btn_Upload',
uploadfile('btn_Upload',
'@Url.Content("~/DataWareHouse/Logistics/UploadFlowing")' + '?platform=' + platform + '&month=' + month + '&website=' + website,
'@Url.Content("~/DataWareHouse/Logistics/UploadFlowing")' + '?platform=' + platform + '&month=' + month + '&website=' + website,
function(result){
function(result){
...
@@ -434,13 +422,6 @@
...
@@ -434,13 +422,6 @@
}
}
function ExportCSV() {
function ExportCSV() {
//var website = $('#website').val();
//var month = $('#month').val();
//if (website == '') {
// alert('请选择站点');
// return false;
//}
var start = $('#start').val();
var start = $('#start').val();
var end = $('#end').val();
var end = $('#end').val();
...
@@ -449,11 +430,17 @@
...
@@ -449,11 +430,17 @@
alert('请选择平台');
alert('请选择平台');
return false;
return false;
}
}
var month = $('#month').val();
//window.open('@Url.Content("~/DataWareHouse/PlatformOrder/ExportOrderBillings")' + '?platform=' + platform + '&start=' + start + '&end=' + end + '&orderno=' + orderno
);
window.open('@Url.Content("~/DataWareHouse/Logistics/ExportFlowing")' + '?platform=' + platform + '&website=' + website + '&start=' + start + '&end=' + end + '&orderno=' + orderno + '&month=' + month
);
}
}
function downloadTemplate() {
function downloadTemplate() {
if (websitecount > 0 && website=='') {
alert('请选择站点,再下载导入模版。');
return false;
}
if (platform == '') {
if (platform == '') {
alert('请选择平台');
alert('请选择平台');
return false;
return false;
...
@@ -462,9 +449,14 @@
...
@@ -462,9 +449,14 @@
var start = $('#start').val();
var start = $('#start').val();
var end = $('#end').val();
var end = $('#end').val();
var orderno = $('#orderno').val();
var orderno = $('#orderno').val();
var month = $('#month').val();
//window.open('@Url.Content("~/DataWareHouse/PlatformOrder/DownLoadOrderBillingTemplate?platform=")' + platform + '&start=' + start + '&end=' + end ,'_blank');
if (month == '') {
alert('请选择月份');
return false;
}
window.open('@Url.Content("~/DataWareHouse/Logistics/DownLoadFlowingTemplate?platform=")' + platform + '&website=' + website + '&start=' + start + '&end=' + end + '&month=' + month, '_blank');
}
}
function uploadfile(id,url,callback)
function uploadfile(id,url,callback)
...
@@ -498,49 +490,6 @@
...
@@ -498,49 +490,6 @@
layer.msg("上传出错");
layer.msg("上传出错");
});
});
uploader.register({
"before-send-file": "beforeSendFile",
"before-send": "beforeSend",
"after-send-file": "afterSendFile",
}, {
//时间点1:所有分块进行上传之前调用此函数
beforeSendFile: function (file) {
var deferred = WebUploader.Deferred();
//1、计算文件的唯一标记,用于断点续传
(new WebUploader.Uploader()).md5File(file, 0, 2 * 1024 * 1024)
.progress(function (percentage) {
})
.then(function (val) {
fileMd5 = val;
//获取文件信息后进入下一步
deferred.resolve();
});
return deferred.promise();
},
//时间点2:如果有分块上传,则每个分块上传之前调用此函数
beforeSend: function (block) {
var deferred = WebUploader.Deferred();
if (videoAdd[block.file.id] > block.start) {
// 分块存在,跳过
deferred.reject();
} else {
// 分块不存在或不完整,重新发送该分块内容
this.owner.options.formData = {
start: block.start,//设置视频上传的start点
fileMd5: videoMd5[block.file.id]//设置视频上传的唯一标识MD5
}
deferred.resolve();
}
return deferred.promise();
},
//时间点3:所有分块上传成功后调用此函数
afterSendFile: function (file, response) {
//分块上传成功,执行成功回调
successHandler(file, response, fileArr);
}
});
}
}
...
...
Bailun.DC.Web/Areas/DataWareHouse/Views/PlatformOrder/FinanceAccount_OrderBilling.cshtml
View file @
2eb10052
...
@@ -14,8 +14,17 @@
...
@@ -14,8 +14,17 @@
<form id="toolbar">
<form id="toolbar">
<div class="form-inline" style="line-height:40px;">
<div class="form-inline" style="line-height:40px;">
<div class="form-group">
<div class="form-group">
<label>数据来源类型:</label>
<select id="datatype" name="datatype" class="form-control" style="width:160px;">
<option value="">请选择数据类型</option>
<option value="1">销售平台</option>
<option value="2">物流账单</option>
</select>
</div>
<div class="form-group">
<label>平台:</label>
<label>平台:</label>
<select id="platform" name="platform" class="form-control" style="width:150px;">
<select id="platform" name="platform" class="form-control" style="width:150px;">
<option value="">请选择平台</option>
@if (ViewBag.platform.Count > 0)
@if (ViewBag.platform.Count > 0)
{
{
foreach (var item in ViewBag.platform)
foreach (var item in ViewBag.platform)
...
@@ -112,6 +121,11 @@
...
@@ -112,6 +121,11 @@
//获取平台站点
//获取平台站点
getWebsite();
getWebsite();
})
})
$('#datatype').change(function () {
//获取平台
getPlatform();
})
})
})
function list() {
function list() {
...
@@ -128,7 +142,7 @@
...
@@ -128,7 +142,7 @@
}
}
},
},
{ field: 'feetype', title: '费用字段说明', width: '160' },
{ field: 'feetype', title: '费用字段说明', width: '160' },
{ field: 'financecategory', title: '财务分类归集说明', width: '
18
0' },
{ field: 'financecategory', title: '财务分类归集说明', width: '
20
0' },
{ field: 'datacenter_col', title: '数据中心费用类型', width: '180'},
{ field: 'datacenter_col', title: '数据中心费用类型', width: '180'},
/*{ field: 'financecategory', title: '会计科目分类', width: '130' },*/
/*{ field: 'financecategory', title: '会计科目分类', width: '130' },*/
{ field: 'subjectcode', title: '会计科目编码', width: '130' },
{ field: 'subjectcode', title: '会计科目编码', width: '130' },
...
@@ -180,13 +194,15 @@
...
@@ -180,13 +194,15 @@
}
}
function getWebsite() {
function getWebsite() {
var _platform = $('#platform').val();
$.submit({
$.submit({
url: '@Url.Content("~/DataWareHouse/PlatformOrder/ListWebsite?platform=")' +
$('#platform').val()
,
url: '@Url.Content("~/DataWareHouse/PlatformOrder/ListWebsite?platform=")' +
_platform
,
paramData: '',
paramData: '',
type:'POST',
type:'POST',
func: function (result) {
func: function (result) {
$('#website').html('<option value="">请选择站点</option>');
if (result.success) {
if (result.success) {
$('#website').html('<option value="">请选择站点</option>');
if (result.data.length > 0) {
if (result.data.length > 0) {
for (var i in result.data) {
for (var i in result.data) {
$('#website').append('<option value="' + result.data[i] + '">' + result.data[i] + '</option>');
$('#website').append('<option value="' + result.data[i] + '">' + result.data[i] + '</option>');
...
@@ -197,6 +213,32 @@
...
@@ -197,6 +213,32 @@
else {
else {
alert(result.msg);
alert(result.msg);
}
}
}
})
}
function getPlatform() {
var _datatype = $('#datatype').val();
$.submit({
url: '@Url.Content("~/DataWareHouse/PlatformOrder/ListWebsite?datatype=")' + _datatype,
paramData: '',
type:'POST',
func: function (result) {
if (result.success) {
$('#platform').html('<option value="">请选择平台</option>');
if (result.data.length > 0) {
for (var i in result.data) {
$('#platform').append('<option value="' + result.data[i] + '">' + result.data[i] + '</option>');
}
}
$('#website').html('<option value="">请选择站点</option>');
}
else {
alert(result.msg);
}
}
}
})
})
...
...
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