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
000c5d2e
Commit
000c5d2e
authored
Jan 23, 2021
by
泽锋 李
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
生产在途数据,只需从去年5月抓起
parent
662f0877
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
5 deletions
+47
-5
daily.cs
AutoTurnOver.DB/daily.cs
+34
-3
dc_base_prod_order_dao.cs
AutoTurnOver.DB/dc_base_prod_order_dao.cs
+2
-2
DailyController.cs
AutoTurnOver/Controllers/DailyController.cs
+11
-0
No files found.
AutoTurnOver.DB/daily.cs
View file @
000c5d2e
...
...
@@ -1319,7 +1319,38 @@ where id=@id
var
sql
=
""
;
if
(
search_data
.
isSum
||
search_data
.
is_warehouse_sum
)
{
throw
new
Exception
(
"暂不做汇总处理"
);
sql
=
@"
select
sum(ifnull(t4.usable_stock,0)) as 'stock',
t1.purchase_id as 'purchase_id',
sum(ifnull(t1.quantity_purchase)) as 'quantity_purchase',
sum(ifnull(t1.`quantity_arrival`)) as 'quantity_arrival',
sum(ifnull(t1.`quantity_inbound`)) as 'quantity_inbound',
sum(ifnull(t1.`quantity_not_inbound`)) as 'quantity_not_inbound',
sum(ifnull(t8.distribution_quantity)) as 'prod_distribution_quantity',
sum(ifnull(( t8.order_quantity - t8.distribution_quantity))) as 'prod_not_distribution_quantity',
sum(ifnull(t8.prod_quantity)) as 'prod_quantity'
from dc_base_purchase_details as t1
left join dc_base_warehouse as t2 on t1.warehouse_code = t2.warehouse_code
left join dc_base_sku as t3 on t1.bailun_sku = t3.bailun_sku
left join dc_base_stock as t4 on t1.bailun_sku = t4.bailun_sku and t1.warehouse_code = t4.warehouse_code
left join dc_mid_transit as t5 on t1.bailun_sku = t5.bailun_sku and t1.warehouse_code = t5.warehouse_code
left join dc_auto_turnover as t6 on t1.bailun_sku = t6.bailun_sku and t1.warehouse_code = t6.warehouse_code
left join dc_auto_forecast_fluctuation as t7 on t1.bailun_sku = t7.bailun_sku and t1.warehouse_code = t7.warehouse_code
left join dc_base_prod_order as t8 on t1.bailun_sku = t8.bailun_sku and t1.purchase_id = t8.purchase_no
"
;
if
(
search_data
.
has_tort
!=
null
)
{
sql
+=
" left join dc_base_tort as t9 on t1.bailun_sku = t9.bailun_sku "
;
}
if
(
search_data
.
monitor_status
!=
null
)
{
sql
+=
" left join dc_auto_config_sku_warehouse as t10 on t1.bailun_sku = t10.bailun_sku and t1.warehouse_code = t10.warehouse_code "
;
}
sql
+=
" where t1.`status` not in (-1,4) and t1.has_delete =0 and t1.quantity_not_inbound > 0 "
;
}
else
{
...
...
@@ -1376,7 +1407,7 @@ left join dc_base_prod_order as t8 on t1.bailun_sku = t8.bailun_sku and t1.purch
{
sql
+=
" left join dc_auto_config_sku_warehouse as t10 on t1.bailun_sku = t10.bailun_sku and t1.warehouse_code = t10.warehouse_code "
;
}
sql
+=
" where t1.`status` not in (-1,4) and t1.quantity_not_inbound > 0 "
;
sql
+=
" where t1.`status` not in (-1,4) and t1.
has_delete =0 and t1.
quantity_not_inbound > 0 "
;
}
...
...
@@ -1400,7 +1431,7 @@ left join dc_base_warehouse as t2 on t1.warehouse_code = t2.warehouse_code
countSql
+=
" left join dc_auto_config_sku_warehouse as t10 on t1.bailun_sku = t10.bailun_sku and t1.warehouse_code = t10.warehouse_code "
;
}
countSql
+=
" where t1.`status` not in (-1,4) and t1.quantity_not_inbound > 0 "
;
countSql
+=
" where t1.`status` not in (-1,4) and t1.
has_delete =0 and t1.
quantity_not_inbound > 0 "
;
...
...
AutoTurnOver.DB/dc_base_prod_order_dao.cs
View file @
000c5d2e
...
...
@@ -10,7 +10,7 @@ namespace AutoTurnOver.DB
{
public
static
void
SynchroData
()
{
var
task_name
=
"SynchroProdData_v
1
"
;
var
task_name
=
"SynchroProdData_v
2
"
;
var
conn
=
_connection
;
// 查询最后一次成功抓取的记录
var
last_task_synchro_log
=
conn
.
QuerySingleOrDefault
<
task_synchro_log
>(
" select * from task_synchro_log where task_name=@task_name and status=1 order by end_time desc limit 1 "
,
new
{
task_name
=
task_name
});
...
...
@@ -29,7 +29,7 @@ namespace AutoTurnOver.DB
}
else
{
new_task_synchro_log
.
start_time
=
new
DateTime
(
20
18
,
05
,
14
);
new_task_synchro_log
.
start_time
=
new
DateTime
(
20
20
,
05
,
14
);
}
if
((
new_task_synchro_log
.
end_time
-
new_task_synchro_log
.
start_time
).
TotalDays
>
90
)
...
...
AutoTurnOver/Controllers/DailyController.cs
View file @
000c5d2e
...
...
@@ -7,6 +7,7 @@ using System.Threading.Tasks;
using
AutoTurnOver.Common
;
using
AutoTurnOver.DB
;
using
AutoTurnOver.Models
;
using
AutoTurnOver.Models.Report
;
using
AutoTurnOver.Services
;
using
AutoTurnOver.Utility
;
using
Microsoft.AspNetCore.Mvc
;
...
...
@@ -182,6 +183,16 @@ namespace AutoTurnOver.Controllers
return
new
JsonResult
(
list
==
null
||
list
.
Count
<=
0
?
new
dc_base_stock_fba_dto
()
:
list
[
0
]);
}
public
JsonResult
FullLinkPurchaseSumFooter
([
FromQuery
]
dc_base_stock_search_dto
search_data
)
{
var
services
=
new
DailyServices
();
var
total
=
0
;
search_data
.
isSum
=
true
;
var
list
=
services
.
FullLinkPurchaseList
(
search_data
,
ref
total
);
return
new
JsonResult
(
list
==
null
||
list
.
Count
<=
0
?
new
full_link_purchase_dto
()
:
list
[
0
]);
}
/// <summary>
/// 缺货推送记录
...
...
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