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
3f14a996
Commit
3f14a996
authored
Apr 26, 2023
by
lizefeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
bf6e325e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
5 deletions
+28
-5
AmazonDataSynchroService.cs
AutoTurnOver.Services/AmazonDataSynchroService.cs
+26
-3
ResetOutofstockBackgrounService.cs
ResetOutofstock/ResetOutofstockBackgrounService.cs
+2
-2
No files found.
AutoTurnOver.Services/AmazonDataSynchroService.cs
View file @
3f14a996
...
@@ -284,6 +284,13 @@ namespace AutoTurnOver.Services
...
@@ -284,6 +284,13 @@ namespace AutoTurnOver.Services
public
void
SynchroReportIdByCreate
(
ReportTypes
reportTypeEnum
,
int
version
=
8
,
string
account
=
""
,
string
site
=
""
,
DateTime
?
btime
=
null
,
DateTime
?
etime
=
null
)
public
void
SynchroReportIdByCreate
(
ReportTypes
reportTypeEnum
,
int
version
=
8
,
string
account
=
""
,
string
site
=
""
,
DateTime
?
btime
=
null
,
DateTime
?
etime
=
null
)
{
{
if
(
btime
!=
null
&&
etime
!=
null
)
{
if
(
etime
.
Value
<
btime
.
Value
)
{
return
;
}
}
// 拉取亚马逊账号
// 拉取亚马逊账号
var
amazonAccounts
=
ApiServices
.
GetAmazonAccountList
();
var
amazonAccounts
=
ApiServices
.
GetAmazonAccountList
();
if
(!
string
.
IsNullOrWhiteSpace
(
account
))
if
(!
string
.
IsNullOrWhiteSpace
(
account
))
...
@@ -839,9 +846,25 @@ namespace AutoTurnOver.Services
...
@@ -839,9 +846,25 @@ namespace AutoTurnOver.Services
else
else
{
{
var
filePath
=
DownloadReportData
(
pamsAccount
,
ana_task
.
report_id
);
var
reportData
=
DownloadReportData
(
pamsAccount
,
ana_task
.
report_id
);
if
(
string
.
IsNullOrWhiteSpace
(
reportData
.
ReportDocumentId
))
{
if
(
reportData
.
ProcessingStatus
==
Report
.
ProcessingStatusEnum
.
FATAL
||
reportData
.
ProcessingStatus
==
Report
.
ProcessingStatusEnum
.
CANCELLED
)
{
ana_task
.
ana_status
=
-
2
;
MyMySqlConnection
.
_connection
.
Update
(
ana_task
);
return
;
}
else
{
ana_task
.
report_par_json
=
reportData
.
ToJson
();
MyMySqlConnection
.
_connection
.
Update
(
ana_task
);
return
;
}
}
StringBuilder
response_str
=
new
StringBuilder
()
{
};
StringBuilder
response_str
=
new
StringBuilder
()
{
};
using
(
StreamReader
sr
=
new
StreamReader
(
filePath
.
ReportDocumentId
))
using
(
StreamReader
sr
=
new
StreamReader
(
reportData
.
ReportDocumentId
))
{
{
response_str
.
AppendLine
(
sr
.
ReadToEnd
());
response_str
.
AppendLine
(
sr
.
ReadToEnd
());
sr
.
Close
();
sr
.
Close
();
...
@@ -850,7 +873,7 @@ namespace AutoTurnOver.Services
...
@@ -850,7 +873,7 @@ namespace AutoTurnOver.Services
string
jsonText
=
response_str
.
ToString
();
string
jsonText
=
response_str
.
ToString
();
ana_task
.
content
=
jsonText
;
ana_task
.
content
=
jsonText
;
table
=
CsvFileHelper
.
ReadFromCSV
(
filePath
.
ReportDocumentId
,
true
,
'\t'
);
table
=
CsvFileHelper
.
ReadFromCSV
(
reportData
.
ReportDocumentId
,
true
,
'\t'
);
}
}
foreach
(
DataRow
row
in
table
.
Rows
)
foreach
(
DataRow
row
in
table
.
Rows
)
...
...
ResetOutofstock/ResetOutofstockBackgrounService.cs
View file @
3f14a996
...
@@ -701,7 +701,7 @@ namespace ResetOutofstock
...
@@ -701,7 +701,7 @@ namespace ResetOutofstock
FikaAmazonAPI
.
Utils
.
Constants
.
ReportTypes
.
GET_FBA_INVENTORY_PLANNING_DATA
,
FikaAmazonAPI
.
Utils
.
Constants
.
ReportTypes
.
GET_FBA_INVENTORY_PLANNING_DATA
,
version
:
19
,
version
:
19
,
btime
:
DateTime
.
Now
.
GetMonthFirstDay
().
ToDayHome
(),
btime
:
DateTime
.
Now
.
GetMonthFirstDay
().
ToDayHome
(),
etime
:
DateTime
.
Now
.
ToDayEnd
());
etime
:
DateTime
.
Now
.
ToDayEnd
()
.
AddDays
(-
1
)
);
Console
.
WriteLine
(
$"结束 拉取亚马逊 长期仓储费,线程Id:
{
Thread
.
CurrentThread
.
ManagedThreadId
}
,
{
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)}
"
);
Console
.
WriteLine
(
$"结束 拉取亚马逊 长期仓储费,线程Id:
{
Thread
.
CurrentThread
.
ManagedThreadId
}
,
{
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)}
"
);
Thread
.
Sleep
(
1000
*
60
*
3
);
Thread
.
Sleep
(
1000
*
60
*
3
);
}
}
...
@@ -735,7 +735,7 @@ namespace ResetOutofstock
...
@@ -735,7 +735,7 @@ namespace ResetOutofstock
FikaAmazonAPI
.
Utils
.
Constants
.
ReportTypes
.
GET_FBA_STORAGE_FEE_CHARGES_DATA
,
FikaAmazonAPI
.
Utils
.
Constants
.
ReportTypes
.
GET_FBA_STORAGE_FEE_CHARGES_DATA
,
version
:
23
,
version
:
23
,
btime
:
DateTime
.
Now
.
GetMonthFirstDay
().
ToDayHome
(),
btime
:
DateTime
.
Now
.
GetMonthFirstDay
().
ToDayHome
(),
etime
:
DateTime
.
Now
.
ToDayEnd
());
etime
:
DateTime
.
Now
.
AddDays
(-
1
).
ToDayEnd
());
Console
.
WriteLine
(
$"结束 拉取亚马逊 月度仓储费,线程Id:
{
Thread
.
CurrentThread
.
ManagedThreadId
}
,
{
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)}
"
);
Console
.
WriteLine
(
$"结束 拉取亚马逊 月度仓储费,线程Id:
{
Thread
.
CurrentThread
.
ManagedThreadId
}
,
{
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)}
"
);
Thread
.
Sleep
(
1000
*
60
*
3
);
Thread
.
Sleep
(
1000
*
60
*
3
);
}
}
...
...
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