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
22ccd411
Commit
22ccd411
authored
Apr 08, 2021
by
泽锋 李
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
切换空运的时候,要分析需求,35天的量走空运,还有剩余就走海运
parent
292b0ac4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
1 deletion
+38
-1
purchase_advise.cs
AutoTurnOver.DB/purchase_advise.cs
+38
-1
No files found.
AutoTurnOver.DB/purchase_advise.cs
View file @
22ccd411
...
@@ -1118,8 +1118,10 @@ left join dc_mid_transit as t9 on t1.bailun_sku = t9.bailun_sku and t1.warehouse
...
@@ -1118,8 +1118,10 @@ left join dc_mid_transit as t9 on t1.bailun_sku = t9.bailun_sku and t1.warehouse
/// <summary>
/// <summary>
/// 写入采购建议
/// 写入采购建议
/// </summary>
/// </summary>
public
static
void
WritePurchaseAdvise
(
List
<
dc_auto_purchase_advise_detailed
>
d
atas
)
public
static
void
WritePurchaseAdvise
(
List
<
dc_auto_purchase_advise_detailed
>
originalD
atas
)
{
{
//物流切换拆分
var
datas
=
LogisticsChangeSplit
(
originalDatas
);
foreach
(
var
item
in
datas
)
foreach
(
var
item
in
datas
)
{
{
item
.
bailun_sku_warehouse_code
=
$"
{
item
.
bailun_sku
}{
item
.
warehouse_code
}
"
;
item
.
bailun_sku_warehouse_code
=
$"
{
item
.
bailun_sku
}{
item
.
warehouse_code
}
"
;
...
@@ -1142,6 +1144,41 @@ left join dc_mid_transit as t9 on t1.bailun_sku = t9.bailun_sku and t1.warehouse
...
@@ -1142,6 +1144,41 @@ left join dc_mid_transit as t9 on t1.bailun_sku = t9.bailun_sku and t1.warehouse
}
}
}
}
/// <summary>
/// 物流切换拆分
/// 多余35天的量,走海运
/// </summary>
public
static
List
<
dc_auto_purchase_advise_detailed
>
LogisticsChangeSplit
(
List
<
dc_auto_purchase_advise_detailed
>
originalDatas
)
{
List
<
dc_auto_purchase_advise_detailed
>
datas
=
new
List
<
dc_auto_purchase_advise_detailed
>();
foreach
(
var
item
in
originalDatas
)
{
//有切换空运
if
(
item
.
auto_replace_logistics_task_id
>
0
)
{
// 检查建议数是否超过35天的日均
var
quantity_35
=
(
int
)
Math
.
Ceiling
((
item
.
fixed_daily_weighted_sales
??
0
)
*
35
);
if
(
item
.
quantity_final_advise
>
quantity_35
)
{
var
quantity_final_advise
=
item
.
quantity_final_advise
;
item
.
quantity_final_advise
=
quantity_35
;
datas
.
Add
(
item
);
var
item2
=
item
.
ToJson
().
ToObj
<
dc_auto_purchase_advise_detailed
>();
item2
.
auto_replace_logistics_task_id
=
0
;
item2
.
replace_logistics_remarks
=
"同仓库sku有切换空运的而需求,但是需求超过35天的量了,由此裂变出一条超出的需求走回默认运输方式"
;
item2
.
quantity_final_advise
=
quantity_final_advise
-
quantity_35
;
datas
.
Add
(
item2
);
}
}
else
{
datas
.
Add
(
item
);
}
}
return
datas
;
}
public
class
old_purchase_advise_detailed
public
class
old_purchase_advise_detailed
{
{
public
int
id
{
get
;
set
;
}
public
int
id
{
get
;
set
;
}
...
...
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