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
b0608934
Commit
b0608934
authored
Dec 22, 2020
by
泽锋 李
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
bd1e01f5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
18 deletions
+29
-18
SkuAutoTurnServices.cs
AutoTurnOver.Services/SkuAutoTurnServices.cs
+19
-18
TaskDownloadServices.cs
AutoTurnOver.Services/TaskDownloadServices.cs
+10
-0
No files found.
AutoTurnOver.Services/SkuAutoTurnServices.cs
View file @
b0608934
...
...
@@ -279,7 +279,7 @@ namespace AutoTurnOver.Services
return
DB
.
dc_auto_turnover
.
SkuNewSupplierDeliveryList
();
}
public
MemoryStream
Export
(
UserData
user
,
Condition_AutoTurnOver
m
,
string
order
,
string
sort
)
public
string
Export
(
UserData
user
,
Condition_AutoTurnOver
m
,
string
order
,
string
sort
)
{
var
fileName
=
AppContext
.
BaseDirectory
+
$@"Result\RealtimeStock\
{
user
.
UserAccount
}
周转表.csv"
;
...
...
@@ -398,14 +398,15 @@ namespace AutoTurnOver.Services
page
++;
}
var
memory
=
new
MemoryStream
();
using
(
var
stream
=
new
FileStream
(
fileName
,
FileMode
.
Open
))
{
stream
.
CopyTo
(
memory
);
}
memory
.
Position
=
0
;
//
var memory = new MemoryStream();
//
using (var stream = new FileStream(fileName, FileMode.Open))
//
{
//
stream.CopyTo(memory);
//
}
//
memory.Position = 0;
return
memory
;
//return memory;
return
fileName
;
}
/// <summary>
...
...
@@ -414,16 +415,16 @@ namespace AutoTurnOver.Services
/// <returns></returns>
public
async
void
GenerateData
()
{
try
{
var
memory
=
Export
(
new
UserData
{
UserAccount
=
"admin"
},
new
Condition_AutoTurnOver
{
warehouse_code
=
"GZBLWH"
},
""
,
""
);
var
fileData
=
await
QiNiuCloudHelper
.
UploadAsync
(
memory
,
$"zhouzhuangshuj_
{
DateTime
.
Now
.
ToString
(
"yyyyMMddHHmmss"
)}
.csv"
);
ApiServices
.
QiYeJiQiRenMsPush
(
new
QiYeJiQiRenMsDto
{
msgtype
=
"text"
,
text
=
new
QiYeJiQiRenMsDto
.
text_dto
{
content
=
"广州01周转数据:"
+
fileData
}
});
}
catch
(
Exception
ex
)
{
Console
.
WriteLine
(
ex
.
Message
);
}
//
try
//
{
//
var memory = Export(new UserData { UserAccount = "admin" }, new Condition_AutoTurnOver { warehouse_code = "GZBLWH" }, "", "");
//
var fileData = await QiNiuCloudHelper.UploadAsync(memory, $"zhouzhuangshuj_{DateTime.Now.ToString("yyyyMMddHHmmss")}.csv");
//
ApiServices.QiYeJiQiRenMsPush(new QiYeJiQiRenMsDto { msgtype = "text", text = new QiYeJiQiRenMsDto.text_dto { content = "广州01周转数据:" + fileData } });
//
}
//
catch (Exception ex)
//
{
//
Console.WriteLine(ex.Message);
//
}
}
...
...
AutoTurnOver.Services/TaskDownloadServices.cs
View file @
b0608934
...
...
@@ -66,6 +66,16 @@ namespace AutoTurnOver.Services
var
fileData
=
await
AutoTurnOver
.
Utility
.
QiNiuCloudHelper
.
UploadSectioningAsync
(
memory
);
return
fileData
;
}
/// <summary>
/// 下载周转表
/// </summary>
public
async
Task
<
string
>
DownloadAuto
(
string
par_json
,
dc_task_download
download_data
)
{
Condition_AutoTurnOver
search_data
=
par_json
.
ToObject
<
Condition_AutoTurnOver
>();
var
memory
=
new
SkuAutoTurnServices
().
Export
(
search_data
);
var
fileData
=
await
AutoTurnOver
.
Utility
.
QiNiuCloudHelper
.
UploadSectioningAsync
(
memory
);
return
fileData
;
}
}
}
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