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
27964b16
Commit
27964b16
authored
Mar 30, 2019
by
lizefeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增付款类型
parent
b644c10d
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
13 additions
and
8 deletions
+13
-8
Program.cs
AutoGeneratePurchaseAdvise/Program.cs
+1
-1
purchase_advise.cs
AutoTurnOver.DB/purchase_advise.cs
+2
-2
dc_auto_purchase_advise.cs
AutoTurnOver.Models/dc_auto_purchase_advise.cs
+4
-1
dc_average_purchase.cs
AutoTurnOver.Models/dc_average_purchase.cs
+2
-0
PurchaseAverageTargetServices.cs
AutoTurnOver.Services/PurchaseAverageTargetServices.cs
+2
-2
PurchaseAdviseController.cs
AutoTurnOver/Controllers/PurchaseAdviseController.cs
+2
-2
No files found.
AutoGeneratePurchaseAdvise/Program.cs
View file @
27964b16
...
@@ -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/purchase_advise.cs
View file @
27964b16
...
@@ -194,7 +194,7 @@ select
...
@@ -194,7 +194,7 @@ select
{
{
sql
=
@"
sql
=
@"
select
select
sum(t5.
forecast_turnoverday_sales) as 'forecast_turnoverday_sales', -- 供应链长度日均
sum(t5.
quantity_safe_inventory) as 'quantity_safe_inventory', -- 日均加权销量
sum(t5.quantity_out_stock) as 'quantity_out_stock', -- 缺货
sum(t5.quantity_out_stock) as 'quantity_out_stock', -- 缺货
sum(t5.quantity_transfer) as 'quantity_transfer', -- 调拨在途
sum(t5.quantity_transfer) as 'quantity_transfer', -- 调拨在途
sum(t5.quantity_purchase) as 'quantity_purchase', -- 采购在途
sum(t5.quantity_purchase) as 'quantity_purchase', -- 采购在途
...
@@ -219,7 +219,7 @@ where 1=1 ";
...
@@ -219,7 +219,7 @@ where 1=1 ";
sql
=
@"
sql
=
@"
select
select
t1.*,t2.warehouse_name,t3.sku_title_cn as 'sku_name',t4.create_time,
t1.*,t2.warehouse_name,t3.sku_title_cn as 'sku_name',t4.create_time,
(t5.
forecast_turnoverday_sales) as 'forecast_turnoverday_sales', -- 供应链长度日均
(t5.
quantity_safe_inventory) as 'quantity_safe_inventory', -- 日均加权销量
(t5.quantity_out_stock) as 'quantity_out_stock', -- 缺货
(t5.quantity_out_stock) as 'quantity_out_stock', -- 缺货
(t5.quantity_transfer) as 'quantity_transfer', -- 调拨在途
(t5.quantity_transfer) as 'quantity_transfer', -- 调拨在途
(t5.quantity_purchase) as 'quantity_purchase', -- 采购在途
(t5.quantity_purchase) as 'quantity_purchase', -- 采购在途
...
...
AutoTurnOver.Models/dc_auto_purchase_advise.cs
View file @
27964b16
...
@@ -169,7 +169,10 @@ namespace AutoTurnOver.Models
...
@@ -169,7 +169,10 @@ namespace AutoTurnOver.Models
public
string
create_time_str
{
get
{
return
create_time
.
ToString
(
"yyyy-MM-dd"
);
}
}
public
string
create_time_str
{
get
{
return
create_time
.
ToString
(
"yyyy-MM-dd"
);
}
}
public
decimal
forecast_turnoverday_sales
{
get
;
set
;
}
/// <summary>
/// 日均加权销量
/// </summary>
public
decimal
quantity_safe_inventory
{
get
;
set
;
}
public
decimal
quantity_out_stock
{
get
;
set
;
}
public
decimal
quantity_out_stock
{
get
;
set
;
}
...
...
AutoTurnOver.Models/dc_average_purchase.cs
View file @
27964b16
...
@@ -43,5 +43,7 @@ namespace AutoTurnOver.Models
...
@@ -43,5 +43,7 @@ namespace AutoTurnOver.Models
/// 更新时间
/// 更新时间
/// </summary>
/// </summary>
public
DateTime
update_time
{
get
;
set
;
}
public
DateTime
update_time
{
get
;
set
;
}
public
int
payment_type
{
get
;
set
;
}
}
}
}
}
AutoTurnOver.Services/PurchaseAverageTargetServices.cs
View file @
27964b16
...
@@ -81,7 +81,7 @@ namespace AutoTurnOver.Services
...
@@ -81,7 +81,7 @@ namespace AutoTurnOver.Services
// 平均采购交期
// 平均采购交期
data
.
delivery_days
=
delivery_days
/
purchaseList
.
Count
;
data
.
delivery_days
=
delivery_days
/
purchaseList
.
Count
;
data
.
payment_type
=
purchaseList
.
Any
(
s
=>
s
.
pay_type
==
1
)
?
1
:
2
;
...
@@ -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
=>
Math
.
Ceiling
((
s
.
update_time
-
s
.
arrival_time
).
TotalHours
/
24
))
/
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/PurchaseAdviseController.cs
View file @
27964b16
...
@@ -153,7 +153,7 @@ namespace AutoTurnOver.Controllers
...
@@ -153,7 +153,7 @@ namespace AutoTurnOver.Controllers
DataTable
table
=
new
DataTable
();
DataTable
table
=
new
DataTable
();
string
[]
cols
=
new
string
[]
{
"初始建议数"
,
"系统建议数"
,
"采购数量"
,
"是否已推送"
,
"时间"
,
"sku"
,
"产品名称"
,
"产品14日日均"
,
"仓库编码"
,
"仓库名称"
,
string
[]
cols
=
new
string
[]
{
"初始建议数"
,
"系统建议数"
,
"采购数量"
,
"是否已推送"
,
"时间"
,
"sku"
,
"产品名称"
,
"产品14日日均"
,
"仓库编码"
,
"仓库名称"
,
"内部商品编码"
,
"商品建议采购"
,
"商品14日日均"
,
"商品moq"
,
"
供应链日均
销量"
,
"缺货"
,
"调拨在途"
,
"采购在途"
,
"库存数"
,
"内部商品编码"
,
"商品建议采购"
,
"商品14日日均"
,
"商品moq"
,
"
日均加权
销量"
,
"缺货"
,
"调拨在途"
,
"采购在途"
,
"库存数"
,
"采购金额"
,
"供应链长度"
,
"供应商名称"
,
"采购类型"
"采购金额"
,
"供应链长度"
,
"供应商名称"
,
"采购类型"
};
};
foreach
(
var
item
in
cols
)
foreach
(
var
item
in
cols
)
...
@@ -179,7 +179,7 @@ namespace AutoTurnOver.Controllers
...
@@ -179,7 +179,7 @@ namespace AutoTurnOver.Controllers
row
[
"商品建议采购"
]
=
itemData
.
goods_quantity_init_advise
;
row
[
"商品建议采购"
]
=
itemData
.
goods_quantity_init_advise
;
row
[
"商品14日日均"
]
=
itemData
.
goods_history_fourteenday_sales
;
row
[
"商品14日日均"
]
=
itemData
.
goods_history_fourteenday_sales
;
row
[
"商品moq"
]
=
itemData
.
goods_moq
;
row
[
"商品moq"
]
=
itemData
.
goods_moq
;
row
[
"
供应链日均销量"
]
=
itemData
.
forecast_turnoverday_sales
;
row
[
"
日均加权销量"
]
=
itemData
.
quantity_safe_inventory
;
row
[
"缺货"
]
=
itemData
.
quantity_out_stock
;
row
[
"缺货"
]
=
itemData
.
quantity_out_stock
;
row
[
"调拨在途"
]
=
itemData
.
quantity_transfer
;
row
[
"调拨在途"
]
=
itemData
.
quantity_transfer
;
row
[
"采购在途"
]
=
itemData
.
quantity_purchase
;
row
[
"采购在途"
]
=
itemData
.
quantity_purchase
;
...
...
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