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
53a88424
Commit
53a88424
authored
Jul 21, 2021
by
泽锋 李
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
采购建议,7日订单小于3,则只补缺货
parent
6f55591b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
3 deletions
+42
-3
purchase_advise.cs
AutoTurnOver.DB/purchase_advise.cs
+35
-2
dc_auto_purchase_advise.cs
AutoTurnOver.Models/dc_auto_purchase_advise.cs
+5
-0
PurchaseAdviseServices.cs
AutoTurnOver.Services/PurchaseAdviseServices.cs
+2
-1
No files found.
AutoTurnOver.DB/purchase_advise.cs
View file @
53a88424
...
...
@@ -540,9 +540,14 @@ and ( t5.`status`=0 or t5.`status` is null ) and t7.sum_quantity_init_advise>0
Console
.
WriteLine
(
"开始出建议 完"
);
// 旧品30天内只有1单,不备货;新品只出过单则只出缺货
var
datas1
=
OldProductCalculation
(
datas3
);
//var datas1 = OldProductCalculation(datas3);
//清理同区域冗余数量
var
datas2
=
AreaRedundancyClear
(
datas1
);
var
datas4
=
AreaRedundancyClear
(
datas3
);
// 如果广州01,最近7天订单数量小于3 则只补缺货
var
datas2
=
ClearOrders7
(
datas4
);
if
(
datas2
!=
null
&&
datas2
.
Count
>=
1
)
{
...
...
@@ -709,6 +714,34 @@ and quantity_init_advise<0 and t1.bailun_sku in @bailun_skus ", new {
return
datas
;
}
/// <summary>
/// 订单数量小于3个,只补缺货 (广州01)
/// </summary>
/// <param name="original_datas"></param>
/// <returns></returns>
public
static
List
<
dc_auto_purchase_advise_detailed
>
ClearOrders7
(
List
<
dc_auto_purchase_advise_detailed
>
original_datas
)
{
List
<
dc_auto_purchase_advise_detailed
>
datas
=
new
List
<
dc_auto_purchase_advise_detailed
>();
foreach
(
var
item
in
original_datas
)
{
if
(
"GZBLWH"
.
Equals
(
item
.
warehouse_code
,
StringComparison
.
InvariantCultureIgnoreCase
))
{
// 如果下单次数小于3,则只补缺货
if
(
item
.
orders_7
<
3
)
{
item
.
quantity_final_advise
=
(
int
)
Math
.
Ceiling
(
item
.
fixed_quantity_out_stock
??
0
);
item
.
remarks
=
$" 7天内只出了
{
item
.
orders_7
}
单,只补缺货 (
{(
item
.
fixed_quantity_out_stock
??
0
)}
) "
;
}
}
datas
.
Add
(
item
);
}
return
datas
;
}
public
class
AreaRedundancyClearTempDto
{
public
string
warehouse_code
{
get
;
set
;
}
...
...
AutoTurnOver.Models/dc_auto_purchase_advise.cs
View file @
53a88424
...
...
@@ -48,6 +48,11 @@ namespace AutoTurnOver.Models
public
class
dc_auto_purchase_advise_detailed
{
public
int
id
{
get
;
set
;
}
/// <summary>
/// 最近7天的订单数量
/// </summary>
public
int
?
orders_7
{
get
;
set
;
}
/// <summary>
/// 仓库所属国家
/// </summary>
...
...
AutoTurnOver.Services/PurchaseAdviseServices.cs
View file @
53a88424
...
...
@@ -133,7 +133,7 @@ namespace AutoTurnOver.Services
"采购单价"
,
"历史7天日均"
,
"历史14日均"
,
"历史30日均"
,
"加权日均"
,
"安全库存"
,
"今日实际缺货"
,
"供应链累积销量"
,
"供应链到货当天的销量"
,
"预测销量"
,
"累积入库数量"
,
"实际库存"
,
"moq"
,
"多备天数"
,
"多备数量"
,
"预测销量配置"
,
"实际推送下单数量"
,
"总下单金额"
,
"转仓来源仓库编码"
,
"转仓来源仓库名称"
,
"仓库类型"
,
"最新计算时间"
,
"首单日期"
,
"首单单号"
,
"切换物流备注"
,
"供应商交期"
,
"备注"
,
"切换物流备注"
,
"供应商交期"
,
"备注"
,
"7日订单数量"
};
foreach
(
var
item
in
cols
)
{
...
...
@@ -143,6 +143,7 @@ namespace AutoTurnOver.Services
foreach
(
var
itemData
in
list
)
{
DataRow
row
=
table
.
NewRow
();
row
[
"7日订单数量"
]
=
itemData
.
orders_7
;
row
[
"切换物流备注"
]
=
itemData
.
replace_logistics_remarks
;
row
[
"备注"
]
=
itemData
.
remarks
;
...
...
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