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
375b8c3a
Commit
375b8c3a
authored
Jan 15, 2021
by
泽锋 李
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增review拉取服务
parent
fefbff55
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
142 additions
and
5 deletions
+142
-5
ApiUtility.cs
AutoTurnOver.DB/ApiUtility.cs
+30
-0
daily.cs
AutoTurnOver.DB/daily.cs
+47
-0
dc_config_fba_extend.cs
AutoTurnOver.DB/dc_config_fba_extend.cs
+7
-0
api_pps_review_dto.cs
AutoTurnOver.Models/ApiDto/api_pps_review_dto.cs
+36
-0
CaseFlowBackgrounService.cs
ResetOutofstock/CaseFlowBackgrounService.cs
+6
-0
Program.cs
ResetOutofstock/Program.cs
+2
-1
ResetOutofstockBackgrounService.cs
ResetOutofstock/ResetOutofstockBackgrounService.cs
+1
-1
appsettings.dev.json
ResetOutofstock/appsettings.dev.json
+4
-1
appsettings.json
ResetOutofstock/appsettings.json
+4
-1
appsettings.prod.json
ResetOutofstock/appsettings.prod.json
+5
-1
No files found.
AutoTurnOver.DB/ApiUtility.cs
View file @
375b8c3a
...
...
@@ -583,5 +583,35 @@ namespace AutoTurnOver.DB
//throw new Exception("lms 调拨单时效 接口异常: " + ex.StackTrace);
}
}
/// <summary>
/// 查询review
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
public
static
List
<
api_pps_review_response_dto
.
result_dto
.
data_dto
>
GetReview
(
api_pps_review_request_dto
data
)
{
try
{
//查询采购建议明细
string
url
=
ConfigHelper
.
GetValue
(
"pps-sys:review"
);
string
resultStr
=
HttpHelper
.
Request
(
url
,
RequestType
.
POST
,
data
.
ToJson
(),
"application/json"
,
timeout
:
1000
*
60
*
60
*
24
);
var
result
=
resultStr
.
ToObj
<
api_pps_review_response_dto
>();
if
(
result
==
null
)
{
return
new
List
<
api_pps_review_response_dto
.
result_dto
.
data_dto
>();
}
else
{
return
result
.
result
.
reviewList
;
}
}
catch
(
Exception
ex
)
{
return
new
List
<
api_pps_review_response_dto
.
result_dto
.
data_dto
>();
//throw new Exception("平台费 接口异常: " + ex.Message);
//throw new Exception("平台费 接口异常: " + ex.StackTrace);
}
}
}
}
AutoTurnOver.DB/daily.cs
View file @
375b8c3a
...
...
@@ -1230,6 +1230,53 @@ where id=@id
}
/// <summary>
/// 刷新fba的昨日review
/// </summary>
public
static
void
ResetFbaExtendReview
(
DateTime
date
)
{
// 时间点
// 最近1天
int
page
=
0
;
int
rows
=
100
;
while
(
true
)
{
page
++;
var
configs
=
_connection
.
Query
<
dc_config_fba_extend
>(
$@" select * from dc_config_fba_extend limit
{(
page
-
1
)
*
rows
}
,
{
rows
}
"
).
ToList
();
if
(
configs
==
null
||
configs
.
Count
<=
0
)
{
break
;
}
foreach
(
var
item
in
configs
.
GroupBy
(
s
=>
s
.
web_site
))
{
// 查询review
var
reviews
=
ApiUtility
.
GetReview
(
new
api_pps_review_request_dto
{
Site
=
item
.
Key
,
Type
=
1
,
AsinList
=
item
.
Select
(
s
=>
s
.
asin
).
ToList
()});
foreach
(
var
asinItem
in
item
.
AsEnumerable
())
{
var
tempReview
=
reviews
.
FirstOrDefault
(
s
=>
s
.
asin
==
asinItem
.
asin
)
??
new
api_pps_review_response_dto
.
result_dto
.
data_dto
();
_connection
.
Execute
(
$@" update dc_config_fba_extend set
review_count=@review_count,
review_score=@review_score,
review_reset_date = now()
where id=@id
"
,
new
{
review_count
=
tempReview
.
totalComments
,
review_score
=
tempReview
.
score
,
id
=
asinItem
.
id
});
}
}
}
}
}
...
...
AutoTurnOver.DB/dc_config_fba_extend.cs
View file @
375b8c3a
...
...
@@ -25,6 +25,13 @@ namespace AutoTurnOver.DB
public
decimal
bailun_sku_quantity_ordered_7
{
get
;
set
;
}
public
decimal
amount_sales_usd_30
{
get
;
set
;
}
public
decimal
bailun_sku_quantity_ordered_30
{
get
;
set
;
}
/// <summary>
///
/// </summary>
public
decimal
?
review_count
{
get
;
set
;
}
public
decimal
?
review_score
{
get
;
set
;
}
public
DateTime
?
review_reset_date
{
get
;
set
;
}
}
public
class
dc_config_fba_extend_temp_dto
...
...
AutoTurnOver.Models/ApiDto/api_pps_review_dto.cs
0 → 100644
View file @
375b8c3a
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
AutoTurnOver.Models.ApiDto
{
public
class
api_pps_review_request_dto
{
/// <summary>
/// 1 等于过去 2 =今天
/// </summary>
public
int
Type
{
get
;
set
;
}
public
string
Site
{
get
;
set
;
}
public
List
<
string
>
AsinList
{
get
;
set
;
}
}
public
class
api_pps_review_response_dto
{
public
result_dto
result
{
get
;
set
;
}
public
int
statusCode
{
get
;
set
;
}
public
string
message
{
get
;
set
;
}
public
class
result_dto
{
public
string
site
{
get
;
set
;
}
public
List
<
data_dto
>
reviewList
{
get
;
set
;
}
public
class
data_dto
{
public
string
asin
{
get
;
set
;
}
public
string
sku
{
get
;
set
;
}
public
decimal
?
score
{
get
;
set
;
}
public
decimal
?
totalComments
{
get
;
set
;
}
}
}
}
}
ResetOutofstock/CaseFlowBackgrounService.cs
View file @
375b8c3a
...
...
@@ -58,6 +58,12 @@ namespace ResetOutofstock
daily
.
ResetFbaExtendSales
(
now
);
Console
.
WriteLine
(
$"结束 刷新fba历史销量,线程Id:
{
Thread
.
CurrentThread
.
ManagedThreadId
}
,
{
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)}
"
);
}
if
(
now
.
Hour
==
0
&&
now
.
Minute
==
06
)
{
Console
.
WriteLine
(
$"开始 刷新fba昨日review,线程Id:
{
Thread
.
CurrentThread
.
ManagedThreadId
}
,
{
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)}
"
);
daily
.
ResetFbaExtendReview
(
now
);
Console
.
WriteLine
(
$"结束 刷新fba昨日review,线程Id:
{
Thread
.
CurrentThread
.
ManagedThreadId
}
,
{
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)}
"
);
}
if
(
now
.
Hour
==
2
&&
now
.
Minute
==
23
)
{
if
(
now
.
DayOfWeek
==
DayOfWeek
.
Monday
)
...
...
ResetOutofstock/Program.cs
View file @
375b8c3a
...
...
@@ -29,7 +29,8 @@ namespace ResetOutofstock
//report.PurchaseWeekBackUp();
//await new TaskDownloadServices().Download();
//daily.ResetFbaExtendSales(DateTime.Now);
dc_aims_transfer_warehouse_dao
.
TransferWarehouseTask
();
//dc_aims_transfer_warehouse_dao.TransferWarehouseTask();
//daily.ResetFbaExtendReview(DateTime.Now);
}
catch
(
Exception
ex
)
...
...
ResetOutofstock/ResetOutofstockBackgrounService.cs
View file @
375b8c3a
...
...
@@ -42,7 +42,7 @@ namespace ResetOutofstock
Task
.
Factory
.
StartNew
(()
=>
{
Console
.
WriteLine
(
$"开始 init ,线程Id:
{
Thread
.
CurrentThread
.
ManagedThreadId
}
,
{
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)}
"
);
daily
.
ResetFbaExtend
Sales
(
DateTime
.
Now
);
daily
.
ResetFbaExtend
Review
(
DateTime
.
Now
);
Console
.
WriteLine
(
$"结束 init ,线程Id:
{
Thread
.
CurrentThread
.
ManagedThreadId
}
,
{
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)}
"
);
});
...
...
ResetOutofstock/appsettings.dev.json
View file @
375b8c3a
...
...
@@ -26,5 +26,8 @@
"list"
:
"http://supplier.bailuntec.com/Api/ListSupplierAllByTime"
},
"api_finance_body"
:
"http://cw.bailuntec.com/API/API/GetCompanyMainBody"
,
"api_trans_temp_schedule"
:
"http://api.wms.bailuntec.com/api/services/app/AllotScheduleService/GetTempSchedulePageList"
"api_trans_temp_schedule"
:
"http://api.wms.bailuntec.com/api/services/app/AllotScheduleService/GetTempSchedulePageList"
,
"pps-sys"
:
{
"review"
:
"https://pps.bailuntec.com/Api/amazon/analyze/Download/GetReviewInfoBy"
}
}
ResetOutofstock/appsettings.json
View file @
375b8c3a
...
...
@@ -27,5 +27,8 @@
"list"
:
"http://supplier.bailuntec.com/Api/ListSupplierAllByTime"
},
"api_finance_body"
:
"http://cw.bailuntec.com/API/API/GetCompanyMainBody"
,
"api_trans_temp_schedule"
:
"http://api.wms.bailuntec.com/api/services/app/AllotScheduleService/GetTempSchedulePageList"
"api_trans_temp_schedule"
:
"http://api.wms.bailuntec.com/api/services/app/AllotScheduleService/GetTempSchedulePageList"
,
"pps-sys"
:
{
"review"
:
"https://pps.bailuntec.com/Api/amazon/analyze/Download/GetReviewInfoBy"
}
}
ResetOutofstock/appsettings.prod.json
View file @
375b8c3a
...
...
@@ -26,5 +26,8 @@
"list"
:
"http://supplier.bailuntec.com/Api/ListSupplierAllByTime"
},
"api_finance_body"
:
"http://cw.bailuntec.com/API/API/GetCompanyMainBody"
,
"api_trans_temp_schedule"
:
"http://api.wms.bailuntec.com/api/services/app/AllotScheduleService/GetTempSchedulePageList"
"api_trans_temp_schedule"
:
"http://api.wms.bailuntec.com/api/services/app/AllotScheduleService/GetTempSchedulePageList"
,
"pps-sys"
:
{
"review"
:
"http://172.31.13.156/Api/amazon/analyze/Download/GetReviewInfoBy"
}
}
\ No newline at end of file
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