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
f60d6fb2
Commit
f60d6fb2
authored
Mar 03, 2023
by
lizefeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
13b563a9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
10 deletions
+29
-10
ApiServices.cs
AutoTurnOver.Services/ApiServices.cs
+28
-9
Program.cs
ResetOutofstock/Program.cs
+1
-1
No files found.
AutoTurnOver.Services/ApiServices.cs
View file @
f60d6fb2
...
@@ -12,6 +12,7 @@ using System.Text.RegularExpressions;
...
@@ -12,6 +12,7 @@ using System.Text.RegularExpressions;
using
AutoTurnOver.Models.Base
;
using
AutoTurnOver.Models.Base
;
using
System.Threading.Tasks
;
using
System.Threading.Tasks
;
using
AutoTurnOver.Models.ApiDto.Stock
;
using
AutoTurnOver.Models.ApiDto.Stock
;
using
System.Threading
;
namespace
AutoTurnOver.Services
namespace
AutoTurnOver.Services
{
{
...
@@ -262,20 +263,38 @@ namespace AutoTurnOver.Services
...
@@ -262,20 +263,38 @@ namespace AutoTurnOver.Services
/// 获取亚马逊账号
/// 获取亚马逊账号
/// </summary>
/// </summary>
/// <returns></returns>
/// <returns></returns>
public
static
List
<
AmazonAccountDto
>
GetAmazonAccountList
()
public
static
List
<
AmazonAccountDto
>
GetAmazonAccountList
(
int
count
=
0
)
{
{
string
url
=
ConfigHelper
.
GetValue
(
"Pams_GetAccountToken"
);
try
string
resultStr
=
HttpHelper
.
Request
(
url
,
RequestType
.
GET
,
""
,
timeout
:
1000
*
60
*
60
*
24
);
var
result
=
resultStr
.
ToObj
<
PamsResultDto
<
List
<
AmazonAccountDto
>>>();
if
(
result
==
null
)
{
{
throw
new
Exception
(
"账号系统异常: 未获取到数据"
);
string
url
=
ConfigHelper
.
GetValue
(
"Pams_GetAccountToken"
);
string
resultStr
=
HttpHelper
.
Request
(
url
,
RequestType
.
GET
,
""
,
timeout
:
1000
*
60
*
60
*
24
);
var
result
=
resultStr
.
ToObj
<
PamsResultDto
<
List
<
AmazonAccountDto
>>>();
if
(
result
==
null
)
{
throw
new
Exception
(
"账号系统异常: 未获取到数据"
);
}
if
(!
result
.
Success
)
{
throw
new
Exception
(
"账号系统异常: "
+
result
.
Message
);
}
return
result
.
Data
;
}
}
if
(!
result
.
Success
)
catch
(
Exception
ex
)
{
{
throw
new
Exception
(
"账号系统异常: "
+
result
.
Message
);
if
(
count
<
20
)
{
Thread
.
Sleep
(
10
*
1000
);
count
++;
return
GetAmazonAccountList
(
count
);
}
else
{
throw
;
}
}
}
return
result
.
Data
;
}
}
public
static
List
<
AccountDto
>
AccountList
(
string
name
)
public
static
List
<
AccountDto
>
AccountList
(
string
name
)
...
...
ResetOutofstock/Program.cs
View file @
f60d6fb2
...
@@ -57,7 +57,7 @@ namespace ResetOutofstock
...
@@ -57,7 +57,7 @@ namespace ResetOutofstock
//new AmazonDataSynchroService().SynchroReportIds(FikaAmazonAPI.Utils.Constants.ReportTypes.GET_V2_SETTLEMENT_REPORT_DATA_FLAT_FILE_V2, 10);
//new AmazonDataSynchroService().SynchroReportIds(FikaAmazonAPI.Utils.Constants.ReportTypes.GET_V2_SETTLEMENT_REPORT_DATA_FLAT_FILE_V2, 10);
//while (true)
//while (true)
//{
//{
// new AmazonDataSynchroService().AnaReport();
// new AmazonDataSynchroService().AnaReport(
-1
);
//}
//}
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
...
...
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