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
2407a46d
Commit
2407a46d
authored
Jan 14, 2021
by
泽锋 李
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
销量预测规则,新增一个【日均出单次数】【首次出单日期】
parent
c3e8524b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
6 deletions
+17
-6
Program.cs
AutoGeneratePurchaseAdvise/Program.cs
+1
-0
purchase_advise.cs
AutoTurnOver.DB/purchase_advise.cs
+16
-6
No files found.
AutoGeneratePurchaseAdvise/Program.cs
View file @
2407a46d
...
@@ -35,6 +35,7 @@ namespace AutoGeneratePurchaseAdvise
...
@@ -35,6 +35,7 @@ namespace AutoGeneratePurchaseAdvise
//report.ResetTransExpectArrivaltime();
//report.ResetTransExpectArrivaltime();
//PurchaseAdviseServices.AutoPushBuySys(4);
//PurchaseAdviseServices.AutoPushBuySys(4);
//PurchaseAdviseServices.AutoPushBuySys(4);
//PurchaseAdviseServices.AutoPushBuySys(4);
//purchase_advise.ReplaceLogistics(DateTime.Now, "935619301", "MMDUKFBA");
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
...
...
AutoTurnOver.DB/purchase_advise.cs
View file @
2407a46d
...
@@ -42,10 +42,10 @@ namespace AutoTurnOver.DB
...
@@ -42,10 +42,10 @@ namespace AutoTurnOver.DB
/// <summary>
/// <summary>
/// 切换物流商
/// 切换物流商
/// </summary>
/// </summary>
public
static
void
ReplaceLogistics
(
DateTime
date
)
public
static
void
ReplaceLogistics
(
DateTime
date
,
string
bailun_sku
=
null
,
string
warehouse_code
=
null
)
{
{
// 查询需要切换的数据
// 查询需要切换的数据
List
<
replace_logistics_outofstock_dto
>
ouDatas
=
GetOutOfStock
();
List
<
replace_logistics_outofstock_dto
>
ouDatas
=
GetOutOfStock
(
bailun_sku
,
warehouse_code
);
// 寻找有没有满足条件的物流方案
// 寻找有没有满足条件的物流方案
foreach
(
var
item
in
ouDatas
)
foreach
(
var
item
in
ouDatas
)
...
@@ -130,11 +130,11 @@ namespace AutoTurnOver.DB
...
@@ -130,11 +130,11 @@ namespace AutoTurnOver.DB
/// 获取供应链内有缺货的数据
/// 获取供应链内有缺货的数据
/// </summary>
/// </summary>
/// <returns></returns>
/// <returns></returns>
public
static
List
<
replace_logistics_outofstock_dto
>
GetOutOfStock
()
public
static
List
<
replace_logistics_outofstock_dto
>
GetOutOfStock
(
string
bailun_sku
=
null
,
string
warehouse_code
=
null
)
{
{
var
now
=
DateTime
.
Now
;
var
now
=
DateTime
.
Now
;
List
<
replace_logistics_outofstock_dto
>
datas
=
new
List
<
replace_logistics_outofstock_dto
>();
List
<
replace_logistics_outofstock_dto
>
datas
=
new
List
<
replace_logistics_outofstock_dto
>();
List
<
replace_logistics_outofstock_dto
>
ouDatas
=
_connection
.
Query
<
replace_logistics_outofstock_dto
>(
@"
var
sql
=
@"
select
select
t1.bailun_sku,
t1.bailun_sku,
t1.warehouse_code,
t1.warehouse_code,
...
@@ -152,8 +152,18 @@ from dc_auto_forecast_fluctuation as t1
...
@@ -152,8 +152,18 @@ from dc_auto_forecast_fluctuation as t1
left join dc_base_warehouse as t2 on t1.warehouse_code =t2.warehouse_code
left join dc_base_warehouse as t2 on t1.warehouse_code =t2.warehouse_code
left join dc_auto_turnover as t3 on t1.warehouse_code =t3.warehouse_code and t1.bailun_sku = t3.bailun_sku
left join dc_auto_turnover as t3 on t1.warehouse_code =t3.warehouse_code and t1.bailun_sku = t3.bailun_sku
where t1.type=2 and t2.hq_type in ('第三方仓库','FBA仓') and t1.start_time>=now() and t1.start_time<=DATE_ADD(now(),INTERVAL t3.turnover_days day)
where t1.type=2 and t2.hq_type in ('第三方仓库','FBA仓') and t1.start_time>=now() and t1.start_time<=DATE_ADD(now(),INTERVAL t3.turnover_days day)
order by t1.start_time desc
"
).
ToList
();
"
;
if
(!
string
.
IsNullOrWhiteSpace
(
bailun_sku
))
{
sql
+=
$" and t1.bailun_sku='
{
bailun_sku
}
' "
;
}
if
(!
string
.
IsNullOrWhiteSpace
(
warehouse_code
))
{
sql
+=
$" and t1.warehouse_code='
{
warehouse_code
}
' "
;
}
sql
+=
" order by t1.start_time desc ;"
;
List
<
replace_logistics_outofstock_dto
>
ouDatas
=
_connection
.
Query
<
replace_logistics_outofstock_dto
>(
sql
).
ToList
();
foreach
(
var
item
in
ouDatas
)
foreach
(
var
item
in
ouDatas
)
{
{
// 如果采购都没到货就已经缺货了,调拨天数切换已经没有意义了
// 如果采购都没到货就已经缺货了,调拨天数切换已经没有意义了
...
...
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