Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
data-center-auto
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
data-center-auto
Commits
18824b02
Commit
18824b02
authored
Apr 02, 2020
by
泽锋 李
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
商品销售情况统计 新增文件上传
parent
0374a869
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
3 deletions
+11
-3
ReportServices.cs
AutoTurnOver.Services/ReportServices.cs
+4
-1
ReportsController.cs
AutoTurnOver/Controllers/ReportsController.cs
+2
-1
Startup.cs
AutoTurnOver/Startup.cs
+5
-1
No files found.
AutoTurnOver.Services/ReportServices.cs
View file @
18824b02
...
...
@@ -10,6 +10,7 @@ using System.Data;
using
AutoTurnOver.Models.ApiDto
;
using
System.Dynamic
;
using
System.IO
;
using
System.Threading.Tasks
;
namespace
AutoTurnOver.Services
{
...
...
@@ -583,6 +584,7 @@ namespace AutoTurnOver.Services
try
{
var
qiniuname
=
$"
{
user
.
UserAccount
}
商品汇总-
{
DateTime
.
Now
.
ToString
(
"yyyyMMddHHmmss"
)}
.csv"
;
var
fileName
=
AppContext
.
BaseDirectory
+
$@"Result\RealtimeStock\
{
user
.
UserAccount
}
商品汇总-
{
DateTime
.
Now
.
ToString
(
"yyyyMMddHHmmss"
)}
.csv"
;
var
total
=
0
;
...
...
@@ -635,9 +637,10 @@ namespace AutoTurnOver.Services
stream
.
CopyTo
(
memory
);
}
memory
.
Position
=
0
;
return
memory
;
}
catch
(
Exception
)
catch
(
Exception
ex
)
{
throw
;
}
...
...
AutoTurnOver/Controllers/ReportsController.cs
View file @
18824b02
...
...
@@ -719,7 +719,7 @@ namespace AutoTurnOver.Controllers
});
}
public
FileResult
GetGoodsExport
(
string
product_inner_code
,
string
platform_type
)
public
async
Task
<
FileResult
>
GetGoodsExport
(
string
product_inner_code
,
string
platform_type
)
{
var
user
=
AutoUtility
.
GetUser
();
var
m
=
new
bailun_sku_goods_search_dto
...
...
@@ -728,6 +728,7 @@ namespace AutoTurnOver.Controllers
platform_type
=
platform_type
};
var
memory
=
new
ReportServices
().
GetGoodsExport
(
m
,
user
);
var
fileData
=
await
QiNiuCloudHelper
.
UploadAsync
(
memory
,
$"商品销售情况统计
{
user
.
UserName
}
-
{
DateTime
.
Now
.
ToString
(
"yyyyMMddHHmmss"
)}
导入结果.csv"
);
return
File
(
memory
,
"text/csv"
,
$"
{
user
.
UserAccount
}
商品汇总数据信息.csv"
);
}
...
...
AutoTurnOver/Startup.cs
View file @
18824b02
...
...
@@ -62,7 +62,11 @@ namespace AutoTurnOver
}
app
.
UseDeveloperExceptionPage
();
//app.UseHttpsRedirection();
app
.
UseStaticFiles
();
app
.
UseFileServer
(
new
FileServerOptions
()
//直接开启文件目录访问和文件访问
{
EnableDirectoryBrowsing
=
true
//开启目录访
});
// 跨域配置
//app.UseCors(builder =>
//builder.WithOrigins("http://aims.bailuntec.com")
...
...
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