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
b644c10d
Commit
b644c10d
authored
Mar 30, 2019
by
lizefeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
平均入库天数,向下取整
parent
2aac719c
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
5 deletions
+9
-5
Program.cs
AutoGeneratePurchaseAdvise/Program.cs
+1
-1
dc_auto_turnover.cs
AutoTurnOver.DB/dc_auto_turnover.cs
+1
-1
dc_auto_turnover.cs
AutoTurnOver.Models/dc_auto_turnover.cs
+2
-0
PurchaseAverageTargetServices.cs
AutoTurnOver.Services/PurchaseAverageTargetServices.cs
+1
-1
SkuAutoTurnController.cs
AutoTurnOver/Controllers/SkuAutoTurnController.cs
+4
-2
No files found.
AutoGeneratePurchaseAdvise/Program.cs
View file @
b644c10d
...
@@ -12,7 +12,7 @@ namespace AutoGeneratePurchaseAdvise
...
@@ -12,7 +12,7 @@ namespace AutoGeneratePurchaseAdvise
{
{
Console
.
WriteLine
(
"采购建议计算任务启动..."
);
Console
.
WriteLine
(
"采购建议计算任务启动..."
);
// 创建采购计划
// 创建采购计划
//
PurchaseAdviseServices.Generate();
PurchaseAdviseServices
.
Generate
();
var
builder
=
new
HostBuilder
().
ConfigureServices
((
hostContext
,
services
)
=>
var
builder
=
new
HostBuilder
().
ConfigureServices
((
hostContext
,
services
)
=>
{
{
services
.
AddHostedService
<
GeneratePurchaseAdviseBackgroundService
>();
services
.
AddHostedService
<
GeneratePurchaseAdviseBackgroundService
>();
...
...
AutoTurnOver.DB/dc_auto_turnover.cs
View file @
b644c10d
...
@@ -52,7 +52,7 @@ where 1=1 ";
...
@@ -52,7 +52,7 @@ where 1=1 ";
else
else
{
{
sql
=
@"select dat.*,t2.oneday_sales,t2.forecast_oneday_sales as 'forecast_oneday_sales2',
sql
=
@"select dat.*,t2.oneday_sales,t2.forecast_oneday_sales as 'forecast_oneday_sales2',
t4.product_inner_code,t4.product_code,t4.bailun_category_name,
t4.product_inner_code,t4.product_code,t4.bailun_category_name,
t4.buyer_name,
( case when t5.`status`=0 or t5.`status` is null then 0 else 1 end ) as 'monitor_status',t4.suppliers_name
( case when t5.`status`=0 or t5.`status` is null then 0 else 1 end ) as 'monitor_status',t4.suppliers_name
from dc_auto_turnover as dat
from dc_auto_turnover as dat
left join dc_auto_sales as t2 on t2.bailun_sku=dat.bailun_sku and dat.warehouse_code = t2.warehouse_code
left join dc_auto_sales as t2 on t2.bailun_sku=dat.bailun_sku and dat.warehouse_code = t2.warehouse_code
...
...
AutoTurnOver.Models/dc_auto_turnover.cs
View file @
b644c10d
...
@@ -356,6 +356,8 @@ namespace AutoTurnOver.Models
...
@@ -356,6 +356,8 @@ namespace AutoTurnOver.Models
public
string
supplier_name
{
get
;
set
;
}
public
string
supplier_name
{
get
;
set
;
}
public
string
buyer_name
{
get
;
set
;
}
}
}
}
}
AutoTurnOver.Services/PurchaseAverageTargetServices.cs
View file @
b644c10d
...
@@ -106,7 +106,7 @@ namespace AutoTurnOver.Services
...
@@ -106,7 +106,7 @@ namespace AutoTurnOver.Services
var
inboundList
=
AveragePurchase
.
GetInboundList
(
purchaseWList
.
Select
(
s
=>
s
.
purchase_id
),
skuItem
.
bailun_sku
);
var
inboundList
=
AveragePurchase
.
GetInboundList
(
purchaseWList
.
Select
(
s
=>
s
.
purchase_id
),
skuItem
.
bailun_sku
);
if
(
inboundList
!=
null
&&
inboundList
.
Count
()
>=
1
)
if
(
inboundList
!=
null
&&
inboundList
.
Count
()
>=
1
)
{
{
dataWarehouse
.
inbound_days
=
(
int
)
inboundList
.
Sum
(
s
=>
(
s
.
update_time
-
s
.
arrival_time
).
TotalDays
)
/
inboundList
.
Count
();
dataWarehouse
.
inbound_days
=
(
int
)
inboundList
.
Sum
(
s
=>
Math
.
Ceiling
((
s
.
update_time
-
s
.
arrival_time
).
TotalHours
/
24
)
)
/
inboundList
.
Count
();
}
}
else
else
{
{
...
...
AutoTurnOver/Controllers/SkuAutoTurnController.cs
View file @
b644c10d
...
@@ -171,13 +171,14 @@ namespace AutoTurnOver.Controllers
...
@@ -171,13 +171,14 @@ namespace AutoTurnOver.Controllers
p
.
product_code
,
p
.
product_code
,
p
.
bailun_category_name
,
p
.
bailun_category_name
,
p
.
monitor_status
,
p
.
monitor_status
,
p
.
supplier_name
p
.
supplier_name
,
p
.
buyer_name
});
});
DataTable
table
=
new
DataTable
();
DataTable
table
=
new
DataTable
();
string
[]
cols
=
new
string
[]
{
"Sku"
,
"商品编码"
,
"内部编码"
,
"sku标题"
,
"仓库编码"
,
"仓库名称"
,
"MOQ"
,
string
[]
cols
=
new
string
[]
{
"Sku"
,
"商品编码"
,
"内部编码"
,
"sku标题"
,
"仓库编码"
,
"仓库名称"
,
"MOQ"
,
"采购在途"
,
"调拨在途"
,
"昨日销量"
,
"明日销量"
,
"未来7天日均"
,
"未来14天日均"
,
"建议采购数"
,
"活动促销数量"
,
"采购在途"
,
"调拨在途"
,
"昨日销量"
,
"明日销量"
,
"未来7天日均"
,
"未来14天日均"
,
"建议采购数"
,
"活动促销数量"
,
"实际库存"
,
"安全库存"
,
"周转天数"
,
"供应商交期"
,
"质检入库天数"
,
"调拨头程天数"
,
"预测是否断货"
,
"缺货数量"
,
"监控状态"
,
"供应商"
"实际库存"
,
"安全库存"
,
"周转天数"
,
"供应商交期"
,
"质检入库天数"
,
"调拨头程天数"
,
"预测是否断货"
,
"缺货数量"
,
"监控状态"
,
"供应商"
,
"采购员"
};
};
foreach
(
var
item
in
cols
)
foreach
(
var
item
in
cols
)
{
{
...
@@ -213,6 +214,7 @@ namespace AutoTurnOver.Controllers
...
@@ -213,6 +214,7 @@ namespace AutoTurnOver.Controllers
row
[
"缺货数量"
]
=
itemData
.
quantity_out_stock
;
row
[
"缺货数量"
]
=
itemData
.
quantity_out_stock
;
row
[
"监控状态"
]
=
itemData
.
monitor_status
==
1
?
"停止监控"
:
"监控中"
;
row
[
"监控状态"
]
=
itemData
.
monitor_status
==
1
?
"停止监控"
:
"监控中"
;
row
[
"供应商"
]
=
itemData
.
supplier_name
;
row
[
"供应商"
]
=
itemData
.
supplier_name
;
row
[
"采购员"
]
=
itemData
.
buyer_name
;
table
.
Rows
.
Add
(
row
);
table
.
Rows
.
Add
(
row
);
}
}
...
...
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