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
d16103d2
Commit
d16103d2
authored
Mar 17, 2021
by
泽锋 李
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增全链路在途订单
parent
9b94f1bd
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
288 additions
and
0 deletions
+288
-0
dc_base_full_link_wait_order_dao.cs
AutoTurnOver.DB/dc_base_full_link_wait_order_dao.cs
+0
-0
dc_base_full_link_wait_order.cs
AutoTurnOver.Models/dc_base_full_link_wait_order.cs
+31
-0
dc_base_stock.cs
AutoTurnOver.Models/dc_base_stock.cs
+55
-0
DailyServices.cs
AutoTurnOver.Services/DailyServices.cs
+120
-0
TaskDownloadServices.cs
AutoTurnOver.Services/TaskDownloadServices.cs
+17
-0
DailyController.cs
AutoTurnOver/Controllers/DailyController.cs
+65
-0
No files found.
AutoTurnOver.DB/dc_base_full_link_wait_order_dao.cs
View file @
d16103d2
This diff is collapsed.
Click to expand it.
AutoTurnOver.Models/dc_base_full_link_wait_order.cs
View file @
d16103d2
...
@@ -168,4 +168,35 @@ namespace AutoTurnOver.Models
...
@@ -168,4 +168,35 @@ namespace AutoTurnOver.Models
{
{
}
}
public
class
dc_base_full_link_wait_order_dto
:
dc_base_full_link_wait_order
{
public
string
warehouse_name
{
get
;
set
;
}
public
string
product_title
{
get
;
set
;
}
public
int
stock
{
get
;
set
;
}
public
string
product_type_desc
{
get
;
set
;
}
public
string
buyer_name
{
get
;
set
;
}
public
decimal
?
history_sevenday_sales
{
get
;
set
;
}
public
decimal
?
history_fourteenday_sales
{
get
;
set
;
}
public
decimal
?
history_thirtyday_sales
{
get
;
set
;
}
public
string
forecast_type_str
{
get
;
set
;
}
public
string
prod_status
{
get
;
set
;
}
public
int
?
prod_not_distribution_quantity
{
get
;
set
;
}
public
int
?
prod_distribution_quantity
{
get
;
set
;
}
public
int
?
prod_quantity
{
get
;
set
;
}
public
DateTime
?
lms_expectarrivaltime
{
get
;
set
;
}
public
DateTime
?
lms_sign_time
{
get
;
set
;
}
public
DateTime
?
lms_put_time
{
get
;
set
;
}
public
DateTime
?
lms_collect_time
{
get
;
set
;
}
public
DateTime
?
lms_flight_time
{
get
;
set
;
}
public
DateTime
?
lms_transport_time
{
get
;
set
;
}
public
DateTime
?
lms_ascan_time
{
get
;
set
;
}
public
DateTime
?
lms_arrival_time
{
get
;
set
;
}
public
DateTime
?
lms_clearance_time
{
get
;
set
;
}
public
DateTime
?
lms_sail_time
{
get
;
set
;
}
public
DateTime
?
lms_node_date
{
get
;
set
;
}
public
string
lms_node_name
{
get
;
set
;
}
public
string
lms_transfer_no
{
get
;
set
;
}
public
string
lms_trackingno
{
get
;
set
;
}
}
}
}
AutoTurnOver.Models/dc_base_stock.cs
View file @
d16103d2
...
@@ -510,6 +510,61 @@ namespace AutoTurnOver.Models
...
@@ -510,6 +510,61 @@ namespace AutoTurnOver.Models
public
int
?
monitor_status
{
get
;
set
;
}
public
int
?
monitor_status
{
get
;
set
;
}
[
Description
(
"单号"
)]
[
Description
(
"单号"
)]
public
string
order_no
{
get
;
set
;
}
public
string
order_no
{
get
;
set
;
}
[
Description
(
"Asin"
)]
public
string
asin
{
get
;
set
;
}
public
bool
isSum
{
get
;
set
;
}
public
bool
is_warehouse_sum
{
get
;
set
;
}
public
int
?
searchType
{
get
;
set
;
}
[
Description
(
"搜索关键词"
)]
public
string
key_words
{
get
;
set
;
}
[
Description
(
"仓库编码"
)]
public
string
warehousecode
{
get
;
set
;
}
[
Description
(
"采购员"
)]
public
string
buyer_name
{
get
;
set
;
}
[
Description
(
"供应商"
)]
public
string
supplier_name
{
get
;
set
;
}
public
int
offset
{
get
;
set
;
}
public
int
limit
{
get
;
set
;
}
public
string
order
{
get
;
set
;
}
public
string
sort
{
get
;
set
;
}
[
Description
(
"仓库类型"
)]
public
string
warehousetype
{
get
;
set
;
}
[
Description
(
"仓库国家"
)]
public
int
?
warehousearea
{
get
;
set
;
}
public
int
?
has_tort
{
get
;
set
;
}
=
null
;
[
Description
(
"分类"
)]
public
string
categoryIds
{
get
;
set
;
}
=
null
;
[
Description
(
"入库时间(起)"
)]
public
DateTime
?
start_date
{
get
;
set
;
}
=
null
;
[
Description
(
"入库时间(止)"
)]
public
DateTime
?
end_date
{
get
;
set
;
}
=
null
;
[
Description
(
"首次入库时间(起)"
)]
public
DateTime
?
f_start_date
{
get
;
set
;
}
=
null
;
[
Description
(
"首次入库时间(止)"
)]
public
DateTime
?
f_end_date
{
get
;
set
;
}
=
null
;
[
Description
(
"产品类型"
)]
public
int
?
product_type
{
get
;
set
;
}
=
null
;
}
public
class
dc_base_full_link_search_dto
{
[
Description
(
"监控状态"
)]
public
int
?
monitor_status
{
get
;
set
;
}
[
Description
(
"调拨单号"
)]
public
string
order_no
{
get
;
set
;
}
[
Description
(
"采购单号"
)]
public
string
order_no2
{
get
;
set
;
}
[
Description
(
"Asin"
)]
[
Description
(
"Asin"
)]
public
string
asin
{
get
;
set
;
}
public
string
asin
{
get
;
set
;
}
public
bool
isSum
{
get
;
set
;
}
public
bool
isSum
{
get
;
set
;
}
...
...
AutoTurnOver.Services/DailyServices.cs
View file @
d16103d2
...
@@ -67,6 +67,22 @@ namespace AutoTurnOver.Services
...
@@ -67,6 +67,22 @@ namespace AutoTurnOver.Services
}
}
return
DB
.
daily
.
FullLinkTransferList
(
search_data
,
categoryModels
,
ref
total
);
return
DB
.
daily
.
FullLinkTransferList
(
search_data
,
categoryModels
,
ref
total
);
}
}
/// <summary>
/// 全链路在途订单
/// </summary>
/// <param name="search_data"></param>
/// <param name="total"></param>
/// <returns></returns>
public
List
<
dc_base_full_link_wait_order_dto
>
FullLinkWaitPage
(
dc_base_full_link_search_dto
search_data
,
ref
int
total
)
{
List
<
bailun_category_new_dto
>
categoryModels
=
null
;
if
(!
string
.
IsNullOrWhiteSpace
(
search_data
.
categoryIds
))
{
categoryModels
=
ApiServices
.
GetNewClientNodesByIds
(
search_data
.
categoryIds
.
Split
(
','
).
Select
(
s
=>
int
.
Parse
(
s
)).
ToList
());
}
return
DB
.
dc_base_full_link_wait_order_dao
.
FullLinkWaitPage
(
search_data
,
categoryModels
,
ref
total
);
}
public
List
<
dc_base_trans_temp_schedule_dto
>
TempTransferList
(
temp_transfer_order_search_dto
search_data
,
ref
int
total
)
public
List
<
dc_base_trans_temp_schedule_dto
>
TempTransferList
(
temp_transfer_order_search_dto
search_data
,
ref
int
total
)
{
{
return
DB
.
daily
.
TempTransferList
(
search_data
,
ref
total
);
return
DB
.
daily
.
TempTransferList
(
search_data
,
ref
total
);
...
@@ -704,6 +720,110 @@ namespace AutoTurnOver.Services
...
@@ -704,6 +720,110 @@ namespace AutoTurnOver.Services
}
}
}
}
public
string
FullLinkWaitExport
(
dc_base_full_link_search_dto
search_data
)
{
try
{
export_count
++;
var
services
=
new
DailyServices
();
var
fileName
=
AppContext
.
BaseDirectory
+
$@"全链路在途订单-
{
DateTime
.
Now
.
ToString
(
"yyyyMMddHHmmss"
)}{
Guid
.
NewGuid
()}
.csv"
;
int
page
=
1
;
int
rows
=
50000
;
if
(
export_count
==
1
)
{
rows
=
250000
;
}
while
(
true
)
{
int
total
=
0
;
search_data
.
offset
=
(
page
-
1
)*
rows
;
search_data
.
limit
=
rows
;
var
list
=
services
.
FullLinkWaitPage
(
search_data
,
ref
total
);
if
(
list
==
null
||
list
.
Count
<=
0
)
break
;
DataTable
table
=
new
DataTable
();
string
[]
cols
=
new
string
[]
{
"产品编码"
,
"仓库名称"
,
"仓库编码"
,
"中文信息"
,
"可用库存"
,
"过去7天日均"
,
"过去14天日均"
,
"过去30天日均"
,
"商品来源"
,
"采购员"
,
"sku状态"
,
"采购单号"
,
"采购数量"
,
"采购在途数量"
,
"采购下单时间"
,
"采购预计到货时间"
,
"采购签收时间"
,
"采购签收数量"
,
"采购入库时间"
,
"采购入库数量"
,
"采购临时单号"
,
"采购临时数量"
,
"调拨暂存单号"
,
"调拨暂存数量"
,
"调拨计划单号"
,
"调拨计划数量"
,
"调拨单号"
,
"调拨数量"
,
"调拨在途数量"
,
"物流跟踪号"
,
"物流转单号"
,
"头程方式"
,
"物流渠道"
,
"物流渠道编码"
,
"物流节点状态"
,
"物流节点时间"
,
"调拨目标到货"
,
"调拨预计到货"
,
"实际揽收"
,
"实际上网"
,
"实际开船"
,
"实际上航"
,
"实际转运"
,
"实际到港"
,
"实际清关"
,
"实际签收"
,
"实际入库"
};
foreach
(
var
item
in
cols
)
{
table
.
Columns
.
Add
(
item
);
}
foreach
(
var
itemData
in
list
)
{
DataRow
row
=
table
.
NewRow
();
row
[
"实际入库"
]
=
itemData
.
lms_put_time
==
null
?
""
:
itemData
.
lms_put_time
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
);
row
[
"实际签收"
]
=
itemData
.
lms_sign_time
==
null
?
""
:
itemData
.
lms_sign_time
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
);
row
[
"实际清关"
]
=
itemData
.
lms_collect_time
==
null
?
""
:
itemData
.
lms_collect_time
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
);
row
[
"实际到港"
]
=
itemData
.
lms_arrival_time
==
null
?
""
:
itemData
.
lms_arrival_time
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
);
row
[
"实际转运"
]
=
itemData
.
lms_transport_time
==
null
?
""
:
itemData
.
lms_transport_time
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
);
row
[
"实际上航"
]
=
itemData
.
lms_flight_time
==
null
?
""
:
itemData
.
lms_flight_time
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
);
row
[
"实际开船"
]
=
itemData
.
lms_sail_time
==
null
?
""
:
itemData
.
lms_sail_time
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
);
row
[
"实际上网"
]
=
itemData
.
lms_ascan_time
==
null
?
""
:
itemData
.
lms_ascan_time
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
);
row
[
"实际揽收"
]
=
itemData
.
lms_collect_time
==
null
?
""
:
itemData
.
lms_collect_time
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
);
row
[
"调拨预计到货"
]
=
itemData
.
lms_expectarrivaltime
==
null
?
""
:
itemData
.
lms_expectarrivaltime
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
);
row
[
"调拨目标到货"
]
=
itemData
.
transfer_expectarrivaltime
==
null
?
""
:
itemData
.
transfer_expectarrivaltime
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
);
row
[
"物流节点时间"
]
=
itemData
.
lms_node_date
==
null
?
""
:
itemData
.
lms_node_date
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
);
row
[
"物流节点状态"
]
=
itemData
.
lms_node_name
;
row
[
"物流渠道编码"
]
=
itemData
.
transfer_logistics_code
;
row
[
"物流渠道"
]
=
itemData
.
transfer_logistics_name
;
row
[
"头程方式"
]
=
itemData
.
transfer_transporttype
;
row
[
"物流转单号"
]
=
itemData
.
lms_transfer_no
;
row
[
"物流跟踪号"
]
=
itemData
.
lms_trackingno
;
row
[
"调拨在途数量"
]
=
itemData
.
transfer_quantity_not_inbound
;
row
[
"调拨数量"
]
=
itemData
.
transfer_quantity
;
row
[
"调拨单号"
]
=
itemData
.
transfer_no
;
row
[
"调拨计划数量"
]
=
itemData
.
transfer_plan_quantity
;
row
[
"调拨计划单号"
]
=
itemData
.
transfer_plan_no
;
row
[
"调拨暂存数量"
]
=
itemData
.
transfer_temp_schedule_quantity
;
row
[
"调拨暂存单号"
]
=
itemData
.
transfer_temp_schedule_no
;
row
[
"采购临时数量"
]
=
itemData
.
transfer_temp_purchase_quantity
;
row
[
"采购临时单号"
]
=
itemData
.
transfer_temp_purchase_no
;
row
[
"采购入库数量"
]
=
itemData
.
purchase_quantity_inbound
;
row
[
"采购入库时间"
]
=
itemData
.
purchase_put_time
==
null
?
""
:
itemData
.
purchase_put_time
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
);
row
[
"采购签收数量"
]
=
itemData
.
purchase_quantity_arrival
;
row
[
"采购签收时间"
]
=
itemData
.
purchase_sign_time
==
null
?
""
:
itemData
.
purchase_sign_time
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
);
row
[
"采购预计到货时间"
]
=
itemData
.
purchase_arrivaldate
==
null
?
""
:
itemData
.
purchase_arrivaldate
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
);
row
[
"采购下单时间"
]
=
itemData
.
purchase_create_time
==
null
?
""
:
itemData
.
purchase_create_time
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
);
row
[
"采购在途数量"
]
=
itemData
.
purchase_quantity_not_inbound
;
row
[
"采购数量"
]
=
itemData
.
purchase_quantity
;
row
[
"采购单号"
]
=
itemData
.
purchase_no
;
row
[
"sku状态"
]
=
itemData
.
forecast_type_str
;
row
[
"采购员"
]
=
itemData
.
buyer_name
;
row
[
"商品来源"
]
=
itemData
.
product_type_desc
;
row
[
"过去30天日均"
]
=
itemData
.
history_thirtyday_sales
;
row
[
"过去14天日均"
]
=
itemData
.
history_fourteenday_sales
;
row
[
"过去7天日均"
]
=
itemData
.
history_sevenday_sales
;
row
[
"可用库存"
]
=
itemData
.
stock
;
row
[
"中文信息"
]
=
itemData
.
product_title
;
row
[
"仓库编码"
]
=
itemData
.
warehouse_code
;
row
[
"仓库名称"
]
=
itemData
.
warehouse_name
;
row
[
"产品编码"
]
=
itemData
.
bailun_sku
;
table
.
Rows
.
Add
(
row
);
}
CsvFileHelper
.
SaveCSV
(
table
,
fileName
,
page
==
1
);
page
++;
}
return
fileName
;
}
catch
(
Exception
)
{
export_count
--;
throw
;
}
}
public
async
void
GenerateData
()
public
async
void
GenerateData
()
{
{
...
...
AutoTurnOver.Services/TaskDownloadServices.cs
View file @
d16103d2
...
@@ -68,6 +68,9 @@ namespace AutoTurnOver.Services
...
@@ -68,6 +68,9 @@ namespace AutoTurnOver.Services
case
"供应链调拨在途"
:
case
"供应链调拨在途"
:
item
.
result_file_url
=
await
DownloadFullLinkTransfer
(
item
.
parameter
,
item
);
item
.
result_file_url
=
await
DownloadFullLinkTransfer
(
item
.
parameter
,
item
);
break
;
break
;
case
"供应链在途订单"
:
item
.
result_file_url
=
await
DownloadFullLinkWait
(
item
.
parameter
,
item
);
break
;
case
"商品销量报表(仓库维度)"
:
case
"商品销量报表(仓库维度)"
:
item
.
result_file_url
=
await
DownloadReportGoods
(
item
.
parameter
,
item
);
item
.
result_file_url
=
await
DownloadReportGoods
(
item
.
parameter
,
item
);
break
;
break
;
...
@@ -277,6 +280,20 @@ namespace AutoTurnOver.Services
...
@@ -277,6 +280,20 @@ namespace AutoTurnOver.Services
return
fileData
;
return
fileData
;
}
}
/// <summary>
/// <summary>
/// 下载供应链在途
/// </summary>
public
async
Task
<
string
>
DownloadFullLinkWait
(
string
par_json
,
dc_task_download
download_data
)
{
dc_base_full_link_search_dto
search_data
=
par_json
.
ToObject
<
dc_base_full_link_search_dto
>();
Console
.
WriteLine
(
"DownloadStock - 开始生成文件"
);
var
memory
=
new
DailyServices
().
FullLinkWaitExport
(
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/DailyController.cs
View file @
d16103d2
...
@@ -159,6 +159,41 @@ namespace AutoTurnOver.Controllers
...
@@ -159,6 +159,41 @@ namespace AutoTurnOver.Controllers
}
}
}
}
/// <summary>
/// 供应链调拨在途
/// </summary>
/// <param name="sku"></param>
/// <param name="warehousecode"></param>
/// <param name="offset"></param>
/// <param name="limit"></param>
/// <returns></returns>
[
BrowseLog
(
"Bailun_aims"
,
"访问【百伦自动周转系统】->【实时数据】->【全链路在途订单】->【搜索】页面"
,
0
)]
public
JsonResult
FullLinkWaitPage
([
FromQuery
]
dc_base_full_link_search_dto
search_data
)
{
try
{
var
services
=
new
DailyServices
();
var
total
=
0
;
var
list
=
services
.
FullLinkWaitPage
(
search_data
,
ref
total
);
return
new
JsonResult
(
new
{
rows
=
list
,
total
=
total
,
});
}
catch
(
Exception
ex
)
{
return
new
JsonResult
(
new
{
message
=
ex
.
Message
,
stack_trace
=
ex
.
StackTrace
});
}
}
[
BrowseLog
(
"Bailun_aims"
,
"访问【百伦自动周转系统】->【暂存调拨单】->【搜索】页面"
,
0
)]
[
BrowseLog
(
"Bailun_aims"
,
"访问【百伦自动周转系统】->【暂存调拨单】->【搜索】页面"
,
0
)]
public
JsonResult
TempTransferList
([
FromQuery
]
temp_transfer_order_search_dto
search_data
)
public
JsonResult
TempTransferList
([
FromQuery
]
temp_transfer_order_search_dto
search_data
)
...
@@ -265,6 +300,16 @@ namespace AutoTurnOver.Controllers
...
@@ -265,6 +300,16 @@ namespace AutoTurnOver.Controllers
return
new
JsonResult
(
list
==
null
||
list
.
Count
<=
0
?
new
order_transfer_full_link_dto
()
:
list
[
0
]);
return
new
JsonResult
(
list
==
null
||
list
.
Count
<=
0
?
new
order_transfer_full_link_dto
()
:
list
[
0
]);
}
}
public
JsonResult
FullLinkWaitSumFooter
([
FromQuery
]
dc_base_full_link_search_dto
search_data
)
{
var
services
=
new
DailyServices
();
var
total
=
0
;
search_data
.
isSum
=
true
;
var
list
=
services
.
FullLinkWaitPage
(
search_data
,
ref
total
);
return
new
JsonResult
(
list
==
null
||
list
.
Count
<=
0
?
new
dc_base_full_link_wait_order_dto
()
:
list
[
0
]);
}
/// <summary>
/// <summary>
/// 缺货推送记录
/// 缺货推送记录
...
@@ -473,6 +518,26 @@ namespace AutoTurnOver.Controllers
...
@@ -473,6 +518,26 @@ namespace AutoTurnOver.Controllers
}
}
}
}
public
JsonResult
ExportFullLinkWait
([
FromQuery
]
dc_base_stock_search_dto
search_data
)
{
try
{
var
user
=
AutoUtility
.
GetUser
();
search_data
.
limit
=
int
.
MaxValue
;
dc_task_download_dao
.
PushData
<
dc_base_stock_search_dto
>(
new
dc_task_download
{
parameter
=
search_data
.
ToJson
(),
task_name
=
"供应链在途订单"
},
user
);
return
new
JsonResult
(
new
{
success
=
true
});
}
catch
(
Exception
ex
)
{
return
new
JsonResult
(
new
{
success
=
false
,
message
=
ex
.
Message
});
}
}
public
JsonResult
ExportFullLinkPurchase
([
FromQuery
]
dc_base_stock_search_dto
search_data
)
public
JsonResult
ExportFullLinkPurchase
([
FromQuery
]
dc_base_stock_search_dto
search_data
)
{
{
try
try
...
...
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