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
9244e21a
Commit
9244e21a
authored
Jan 15, 2021
by
guanzhenshan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OMS发货收入增加导出功能
parent
4a80d12f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
97 additions
and
15 deletions
+97
-15
FinanceController.cs
Bailun.DC.Web/Areas/Reports/Controllers/FinanceController.cs
+93
-13
ShippingIncoming.cshtml
...C.Web/Areas/Reports/Views/Finance/ShippingIncoming.cshtml
+4
-2
No files found.
Bailun.DC.Web/Areas/Reports/Controllers/FinanceController.cs
View file @
9244e21a
...
@@ -9540,20 +9540,25 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
...
@@ -9540,20 +9540,25 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
foreach
(
var
item
in
groupPlatform
)
foreach
(
var
item
in
groupPlatform
)
{
{
var
platform
=
item
.
Key
;
var
platform
=
item
.
Key
;
var
groupCurrency
=
item
.
GroupBy
(
a
=>
a
.
currency
);
foreach
(
var
c
in
groupCurrency
)
var
groupWebSite
=
item
.
GroupBy
(
a
=>
a
.
website
);
foreach
(
var
website
in
groupWebSite
)
{
{
var
currency
=
c
.
Key
;
var
groupCurrency
=
website
.
GroupBy
(
a
=>
a
.
currency
)
;
foreach
(
var
o
in
c
)
foreach
(
var
c
in
groupCurrency
)
{
{
result
.
Add
(
new
dc_month_shipping_incoming
foreach
(
var
o
in
c
)
{
{
platform_type
=
platform
,
result
.
Add
(
new
dc_month_shipping_incoming
currency
=
currency
,
{
financecategoryname
=
o
.
financecategoryname
,
platform_type
=
platform
,
amount
=
o
.
amount
,
currency
=
c
.
Key
,
month
=
o
.
month
,
financecategoryname
=
o
.
financecategoryname
,
});
amount
=
o
.
amount
,
month
=
o
.
month
,
website
=
website
.
Key
});
}
}
}
result
.
Add
(
new
dc_month_shipping_incoming
result
.
Add
(
new
dc_month_shipping_incoming
...
@@ -9561,8 +9566,8 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
...
@@ -9561,8 +9566,8 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
platform_type
=
"合计"
,
platform_type
=
"合计"
,
currency
=
""
,
currency
=
""
,
financecategoryname
=
""
,
financecategoryname
=
""
,
amount
=
c
.
Sum
(
a
=>
a
.
amount
),
amount
=
website
.
Sum
(
a
=>
a
.
amount
),
month
=
c
.
FirstOrDefault
().
month
,
month
=
website
.
FirstOrDefault
().
month
,
});
});
}
}
}
}
...
@@ -9584,8 +9589,83 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
...
@@ -9584,8 +9589,83 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
});
});
}
}
}
public
ActionResult
ExportShippingIncoming
(
string
month
)
{
try
{
var
result
=
new
List
<
dc_month_shipping_incoming
>();
var
obj
=
new
Services
.
FinanceReportServices
().
ListMonthShippingIncoming
(
month
);
//组装数据
obj
=
obj
.
OrderBy
(
a
=>
a
.
platform_type
).
ToList
();
var
groupPlatform
=
obj
.
GroupBy
(
a
=>
a
.
platform_type
);
foreach
(
var
item
in
groupPlatform
)
{
var
platform
=
item
.
Key
;
var
groupWebSite
=
item
.
GroupBy
(
a
=>
a
.
website
);
foreach
(
var
website
in
groupWebSite
)
{
var
groupCurrency
=
website
.
GroupBy
(
a
=>
a
.
currency
);
foreach
(
var
c
in
groupCurrency
)
{
foreach
(
var
o
in
c
)
{
result
.
Add
(
new
dc_month_shipping_incoming
{
platform_type
=
platform
,
currency
=
c
.
Key
,
financecategoryname
=
o
.
financecategoryname
,
amount
=
o
.
amount
,
month
=
o
.
month
,
website
=
website
.
Key
});
}
}
result
.
Add
(
new
dc_month_shipping_incoming
{
platform_type
=
"合计"
,
currency
=
""
,
financecategoryname
=
""
,
amount
=
website
.
Sum
(
a
=>
a
.
amount
),
month
=
website
.
FirstOrDefault
().
month
,
});
}
}
var
colNames
=
new
List
<
string
>
{
"平台类型"
,
"站点"
,
"原币种"
,
"中文分类"
,
"订单总金额"
};
var
list
=
new
List
<
string
>();
foreach
(
var
item
in
result
)
{
list
.
Add
(
item
.
platform_type
+
"|"
+
item
.
website
+
"|"
+
item
.
currency
+
"|"
+
item
.
financecategoryname
+
"|"
+
item
.
amount
);
}
var
guid
=
Guid
.
NewGuid
().
ToString
();
var
filename
=
month
+
" OMS发货收入"
+
DateTime
.
Now
.
ToString
(
"yyyyMMddHHmmss"
);
var
filepath
=
_hostingEnvironment
.
WebRootPath
+
"\\Files\\Report\\"
+
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd"
)
+
"\\"
;
ToCSV
(
list
,
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"
);
}
catch
(
Exception
ex
)
{
return
Json
(
new
{
success
=
false
,
msg
=
ex
.
Message
,
});
}
}
}
...
...
Bailun.DC.Web/Areas/Reports/Views/Finance/ShippingIncoming.cshtml
View file @
9244e21a
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
<div class="form-group">
<div class="form-group">
<label> </label>
<label> </label>
<button type="button" class="btn btn-primary" onclick="list();"><i class="fa fa-search"></i> 查询</button>
<button type="button" class="btn btn-primary" onclick="list();"><i class="fa fa-search"></i> 查询</button>
@*<button type="button" class="btn btn-danger" onclick="exportxls();">导出</button>*@
<button type="button" class="btn btn-danger" onclick="exportxls();">导出</button>
</div>
</div>
</div>
</div>
</form>
</form>
...
@@ -34,6 +34,7 @@
...
@@ -34,6 +34,7 @@
<thead>
<thead>
<tr>
<tr>
<td>平台</td>
<td>平台</td>
<td>站点</td>
<td>原始币种</td>
<td>原始币种</td>
<td>中文分类</td>
<td>中文分类</td>
<td>订单总金额</td>
<td>订单总金额</td>
...
@@ -85,6 +86,7 @@
...
@@ -85,6 +86,7 @@
var obj = result.data[i];
var obj = result.data[i];
rows += '<tr>';
rows += '<tr>';
rows += '<td>' + obj.platform_type + '</td>';
rows += '<td>' + obj.platform_type + '</td>';
rows += '<td>' + obj.website + '</td>';
rows += '<td>' + obj.currency + '</td>';
rows += '<td>' + obj.currency + '</td>';
rows += '<td>' + obj.financecategoryname + '</td>';
rows += '<td>' + obj.financecategoryname + '</td>';
rows += '<td>' + obj.amount + '</td>';
rows += '<td>' + obj.amount + '</td>';
...
@@ -171,7 +173,7 @@
...
@@ -171,7 +173,7 @@
return;
return;
}
}
window.open('@Url.Content("~/Reports/Finance/Export
MonthSaleProfitNew
?month=")' + mon, '_blank');
window.open('@Url.Content("~/Reports/Finance/Export
ShippingIncoming
?month=")' + mon, '_blank');
}
}
function clearHtml(s) {
function clearHtml(s) {
...
...
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