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
a4cbb1d1
Commit
a4cbb1d1
authored
Jan 16, 2021
by
泽锋 李
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
采购建议,新增字段,导出切换到离线下载
parent
74cdd815
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
102 additions
and
3 deletions
+102
-3
dc_auto_purchase_advise.cs
AutoTurnOver.Models/dc_auto_purchase_advise.cs
+16
-3
PurchaseAdviseServices.cs
AutoTurnOver.Services/PurchaseAdviseServices.cs
+69
-0
TaskDownloadServices.cs
AutoTurnOver.Services/TaskDownloadServices.cs
+17
-0
PurchaseAdviseController.cs
AutoTurnOver/Controllers/PurchaseAdviseController.cs
+0
-0
No files found.
AutoTurnOver.Models/dc_auto_purchase_advise.cs
View file @
a4cbb1d1
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.ComponentModel
;
using
System.Text
;
using
System.Text
;
namespace
AutoTurnOver.Models
namespace
AutoTurnOver.Models
...
@@ -439,33 +440,41 @@ namespace AutoTurnOver.Models
...
@@ -439,33 +440,41 @@ namespace AutoTurnOver.Models
/// </summary>
/// </summary>
public
int
main_id
{
get
;
set
;
}
public
int
main_id
{
get
;
set
;
}
[
Description
(
"sku"
)]
public
string
sku
{
get
;
set
;
}
public
string
sku
{
get
;
set
;
}
[
Description
(
"仓库编码"
)]
public
string
warehouse_code
{
get
;
set
;
}
public
string
warehouse_code
{
get
;
set
;
}
[
Description
(
"开始时间"
)]
public
DateTime
?
start_date
{
get
;
set
;
}
public
DateTime
?
start_date
{
get
;
set
;
}
[
Description
(
"结束时间"
)]
public
DateTime
?
end_date
{
get
;
set
;
}
public
DateTime
?
end_date
{
get
;
set
;
}
[
Description
(
"仓库类型"
)]
public
string
warehousetype
{
get
;
set
;
}
public
string
warehousetype
{
get
;
set
;
}
[
Description
(
"仓库国家"
)]
public
int
?
warehousearea
{
get
;
set
;
}
public
int
?
warehousearea
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 是否推送
/// 是否推送
/// </summary>
/// </summary>
[
Description
(
"是否已推送"
)]
public
bool
?
ispush
{
get
;
set
;
}
public
bool
?
ispush
{
get
;
set
;
}
[
Description
(
"类型"
)]
public
int
?
type
{
get
;
set
;
}
public
int
?
type
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 采购员
/// 采购员
/// </summary>
/// </summary>
[
Description
(
"采购员"
)]
public
string
purchase_user
{
get
;
set
;
}
public
string
purchase_user
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 供应商
/// 供应商
/// </summary>
/// </summary>
[
Description
(
"供应商"
)]
public
string
supplier_name
{
get
;
set
;
}
public
string
supplier_name
{
get
;
set
;
}
[
Description
(
"商品内部编码"
)]
public
string
product_inner_code
{
get
;
set
;
}
public
string
product_inner_code
{
get
;
set
;
}
public
bool
isSum
{
get
;
set
;
}
public
bool
isSum
{
get
;
set
;
}
...
@@ -474,12 +483,16 @@ namespace AutoTurnOver.Models
...
@@ -474,12 +483,16 @@ namespace AutoTurnOver.Models
/// 是否是同区多仓的sku
/// 是否是同区多仓的sku
/// </summary>
/// </summary>
public
bool
is_multiple_warehouse
{
get
;
set
;
}
public
bool
is_multiple_warehouse
{
get
;
set
;
}
[
Description
(
"是否有换物流切换建议"
)]
public
int
?
is_replace_logistics
{
get
;
set
;
}
public
int
?
is_replace_logistics
{
get
;
set
;
}
[
Description
(
"是否有换物流切换建议"
)]
public
decimal
?
quantity_final_advise_price_min
{
get
;
set
;
}
public
decimal
?
quantity_final_advise_price_min
{
get
;
set
;
}
public
decimal
?
quantity_final_advise_price_max
{
get
;
set
;
}
public
decimal
?
quantity_final_advise_price_max
{
get
;
set
;
}
[
Description
(
"jit备货类型"
)]
public
int
?
purchase_type_jit
{
get
;
set
;
}
public
int
?
purchase_type_jit
{
get
;
set
;
}
}
}
...
...
AutoTurnOver.Services/PurchaseAdviseServices.cs
View file @
a4cbb1d1
...
@@ -6,6 +6,7 @@ using Bailun.ServiceFabric;
...
@@ -6,6 +6,7 @@ using Bailun.ServiceFabric;
using
Dapper
;
using
Dapper
;
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Data
;
using
System.Linq
;
using
System.Linq
;
using
System.Text.RegularExpressions
;
using
System.Text.RegularExpressions
;
...
@@ -92,6 +93,74 @@ namespace AutoTurnOver.Services
...
@@ -92,6 +93,74 @@ namespace AutoTurnOver.Services
return
purchase_advise
.
DetailList
(
m
,
offset
,
limit
,
ref
total
,
order
,
sort
);
return
purchase_advise
.
DetailList
(
m
,
offset
,
limit
,
ref
total
,
order
,
sort
);
}
}
public
string
Export
(
dc_auto_purchase_advise_detailed_search_dto
searchData
)
{
var
total
=
0
;
var
list
=
PurchaseAdviseServices
.
DetailList
(
searchData
,
0
,
int
.
MaxValue
,
ref
total
);
DataTable
table
=
new
DataTable
();
string
[]
cols
=
new
string
[]
{
"初始建议数"
,
"系统建议数"
,
"采购数量"
,
"是否已推送"
,
"jit备货类型"
,
"时间"
,
"sku"
,
"产品名称"
,
"产品14日日均"
,
"仓库编码"
,
"仓库名称"
,
"源仓库"
,
"内部商品编码"
,
"商品建议采购"
,
"商品14日日均"
,
"商品moq"
,
"日均加权销量"
,
"安全库存"
,
"缺货"
,
"实时缺货"
,
"调拨在途"
,
"调拨单在途"
,
"调拨在途(采购临时数据)"
,
"调拨在途(暂存)"
,
"采购在途"
,
"库存数"
,
"采购金额"
,
"供应链长度"
,
"供应商名称"
,
"采购类型"
,
"采购员"
,
"突增关注"
,
"待发货百伦单号"
,
"7日日均"
,
"14日日均"
,
"30日日均"
,
"海外仓入库天数"
,
"采购单价"
,
"历史7天日均"
,
"历史14日均"
,
"历史30日均"
,
"加权日均"
,
"安全库存"
,
"今日实际缺货"
,
"供应链累积销量"
,
"供应链到货当天的销量"
,
"预测销量"
,
"累积入库数量"
,
"实际库存"
,
"moq"
,
"多备天数"
,
"预测销量公式"
};
foreach
(
var
item
in
cols
)
{
table
.
Columns
.
Add
(
item
);
}
foreach
(
var
itemData
in
list
)
{
DataRow
row
=
table
.
NewRow
();
row
[
"调拨单在途"
]
=
itemData
.
quantity_transfer_order
;
row
[
"调拨在途(采购临时数据)"
]
=
itemData
.
quantity_transfer_temp_schedule
;
row
[
"调拨在途(暂存)"
]
=
itemData
.
quantity_transfer_temporary_storage
;
row
[
"7日日均"
]
=
itemData
.
t_history_sevenday_sales
;
row
[
"14日日均"
]
=
itemData
.
t_history_fourteenday_sales
;
row
[
"30日日均"
]
=
itemData
.
t_history_thirtyday_sales
;
row
[
"源仓库"
]
=
itemData
.
source_warehouse_code_name_str
;
row
[
"初始建议数"
]
=
itemData
.
quantity_init_advise
;
row
[
"系统建议数"
]
=
itemData
.
quantity_final_advise
;
row
[
"采购数量"
]
=
itemData
.
quantity_actual
;
row
[
"是否已推送"
]
=
itemData
.
ispush
==
1
?
"是"
:
"否"
;
row
[
"jit备货类型"
]
=
itemData
.
purchase_type_jit_str
;
row
[
"时间"
]
=
itemData
.
create_time_str
;
row
[
"sku"
]
=
itemData
.
bailun_sku
;
row
[
"产品名称"
]
=
itemData
.
sku_name
;
row
[
"产品14日日均"
]
=
itemData
.
history_fourteenday_sales
;
row
[
"仓库编码"
]
=
itemData
.
warehouse_code
;
row
[
"仓库名称"
]
=
itemData
.
warehouse_name
;
row
[
"内部商品编码"
]
=
itemData
.
product_inner_code
;
row
[
"商品建议采购"
]
=
itemData
.
goods_quantity_init_advise
;
row
[
"商品14日日均"
]
=
itemData
.
goods_history_fourteenday_sales
;
row
[
"商品moq"
]
=
itemData
.
goods_moq
;
row
[
"日均加权销量"
]
=
itemData
.
daily_weighted_sales
;
row
[
"安全库存"
]
=
itemData
.
quantity_safe_inventory
;
row
[
"缺货"
]
=
itemData
.
quantity_out_stock
;
row
[
"实时缺货"
]
=
itemData
.
realtime_quantity_out_stock
;
row
[
"调拨在途"
]
=
itemData
.
quantity_transfer
;
row
[
"采购在途"
]
=
itemData
.
quantity_purchase
;
row
[
"库存数"
]
=
itemData
.
quantity_inventory
;
row
[
"采购金额"
]
=
itemData
.
quantity_final_advise_price
;
row
[
"供应链长度"
]
=
itemData
.
turnover_days
;
row
[
"供应商名称"
]
=
itemData
.
suppliers_name
;
row
[
"采购类型"
]
=
itemData
.
type_str
;
row
[
"采购员"
]
=
itemData
.
buyer_name
;
row
[
"突增关注"
]
=
itemData
.
sudden_increase
;
row
[
"待发货百伦单号"
]
=
itemData
.
bailun_order_ids
;
row
[
"海外仓入库天数"
]
=
itemData
.
abroad_inbound_config_delivery
;
table
.
Rows
.
Add
(
row
);
}
var
fileName
=
AppContext
.
BaseDirectory
+
@"Result\RealtimeStock\采购建议.csv"
;
CsvFileHelper
.
SaveCSV
(
table
,
fileName
);
return
fileName
;
}
/// <summary>
/// <summary>
/// 设置采购数量
/// 设置采购数量
/// </summary>
/// </summary>
...
...
AutoTurnOver.Services/TaskDownloadServices.cs
View file @
a4cbb1d1
...
@@ -53,6 +53,9 @@ namespace AutoTurnOver.Services
...
@@ -53,6 +53,9 @@ namespace AutoTurnOver.Services
case
"转仓日志"
:
case
"转仓日志"
:
item
.
result_file_url
=
await
DownloadTransferWarehouseLog
(
item
.
parameter
,
item
);
item
.
result_file_url
=
await
DownloadTransferWarehouseLog
(
item
.
parameter
,
item
);
break
;
break
;
case
"采购建议"
:
item
.
result_file_url
=
await
DownloadPurchaseAdvise
(
item
.
parameter
,
item
);
break
;
default
:
throw
new
Exception
(
"无法识别的任务"
);
default
:
throw
new
Exception
(
"无法识别的任务"
);
}
}
item
.
end_date
=
DateTime
.
Now
;
item
.
end_date
=
DateTime
.
Now
;
...
@@ -130,6 +133,20 @@ namespace AutoTurnOver.Services
...
@@ -130,6 +133,20 @@ namespace AutoTurnOver.Services
return
fileData
;
return
fileData
;
}
}
/// <summary>
/// <summary>
/// 下载采购建议
/// </summary>
public
async
Task
<
string
>
DownloadPurchaseAdvise
(
string
par_json
,
dc_task_download
download_data
)
{
dc_auto_purchase_advise_detailed_search_dto
search_data
=
par_json
.
ToObject
<
dc_auto_purchase_advise_detailed_search_dto
>();
Console
.
WriteLine
(
"DownloadStock - 开始生成文件"
);
var
memory
=
new
PurchaseAdviseServices
().
Export
(
search_data
);
Console
.
WriteLine
(
"DownloadStock - 开始生成上传文件"
);
var
fileData
=
await
AutoTurnOver
.
Utility
.
QiNiuCloudHelper
.
UploadSectioningAsync
(
memory
);
Console
.
WriteLine
(
"DownloadStock - 上传完毕"
);
return
fileData
;
}
/// <summary>
/// 下载库存
/// 下载库存
/// </summary>
/// </summary>
public
async
Task
<
string
>
DownloadFbaStock
(
string
par_json
,
dc_task_download
download_data
)
public
async
Task
<
string
>
DownloadFbaStock
(
string
par_json
,
dc_task_download
download_data
)
...
...
AutoTurnOver/Controllers/PurchaseAdviseController.cs
View file @
a4cbb1d1
This diff is collapsed.
Click to expand it.
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