Commit a64701bc by 泽锋 李

采购建议,薪资调拨暂存在途

parent 727d8448
...@@ -55,6 +55,10 @@ namespace AutoTurnOver.DB ...@@ -55,6 +55,10 @@ namespace AutoTurnOver.DB
{ {
foreach (var itemSku in item.allotScheduleProducts) foreach (var itemSku in item.allotScheduleProducts)
{ {
if (itemSku.sku == "942660104" && item.targetWareNo== "ESFBABLEM")
{
}
var db_data = new dc_base_trans_temp_schedule() var db_data = new dc_base_trans_temp_schedule()
{ {
code = item.code ?? "", code = item.code ?? "",
...@@ -109,6 +113,10 @@ GROUP BY sku_ware_no", new { sku_ware_nos = data_skus.Select(s=>s.sku_ware_no).D ...@@ -109,6 +113,10 @@ GROUP BY sku_ware_no", new { sku_ware_nos = data_skus.Select(s=>s.sku_ware_no).D
foreach (var item in temp_datas) foreach (var item in temp_datas)
{ {
if (item.bailun_sku == "942660104" && item.warehouse_code == "ESFBABLEM")
{
}
_connection.Execute("update dc_mid_transit set quantity_transfer_temp_schedule=@quantity_transfer_temp_schedule where bailun_sku=@bailun_sku and warehouse_code=@warehouse_code ", new _connection.Execute("update dc_mid_transit set quantity_transfer_temp_schedule=@quantity_transfer_temp_schedule where bailun_sku=@bailun_sku and warehouse_code=@warehouse_code ", new
{ {
bailun_sku = item.bailun_sku, bailun_sku = item.bailun_sku,
...@@ -122,6 +130,10 @@ GROUP BY sku_ware_no", new { sku_ware_nos = data_skus.Select(s=>s.sku_ware_no).D ...@@ -122,6 +130,10 @@ GROUP BY sku_ware_no", new { sku_ware_nos = data_skus.Select(s=>s.sku_ware_no).D
{ {
foreach (var item in data_0.Select(s=>new { s.sku,s.target_ware_no}).Distinct()) foreach (var item in data_0.Select(s=>new { s.sku,s.target_ware_no}).Distinct())
{ {
if (item.sku == "942660104" && item.target_ware_no == "ESFBABLEM")
{
}
_connection.Execute("update dc_mid_transit set quantity_transfer_temp_schedule=0 where bailun_sku=@bailun_sku and warehouse_code=@warehouse_code ", new _connection.Execute("update dc_mid_transit set quantity_transfer_temp_schedule=0 where bailun_sku=@bailun_sku and warehouse_code=@warehouse_code ", new
{ {
bailun_sku = item.sku, bailun_sku = item.sku,
...@@ -138,6 +150,10 @@ GROUP BY sku_ware_no", new { sku_ware_nos = data_skus.Select(s => s.sku_ware_no) ...@@ -138,6 +150,10 @@ GROUP BY sku_ware_no", new { sku_ware_nos = data_skus.Select(s => s.sku_ware_no)
foreach (var item in temp_datas2) foreach (var item in temp_datas2)
{ {
if (item.bailun_sku == "942660104" && item.warehouse_code == "ESFBABLEM")
{
}
_connection.Execute("update dc_mid_transit set quantity_transfer_temporary_storage=@quantity_transfer_temporary_storage where bailun_sku=@bailun_sku and warehouse_code=@warehouse_code ", new _connection.Execute("update dc_mid_transit set quantity_transfer_temporary_storage=@quantity_transfer_temporary_storage where bailun_sku=@bailun_sku and warehouse_code=@warehouse_code ", new
{ {
bailun_sku = item.bailun_sku, bailun_sku = item.bailun_sku,
...@@ -151,6 +167,10 @@ GROUP BY sku_ware_no", new { sku_ware_nos = data_skus.Select(s => s.sku_ware_no) ...@@ -151,6 +167,10 @@ GROUP BY sku_ware_no", new { sku_ware_nos = data_skus.Select(s => s.sku_ware_no)
{ {
foreach (var item in data_1.Select(s => new { s.sku, s.target_ware_no }).Distinct()) foreach (var item in data_1.Select(s => new { s.sku, s.target_ware_no }).Distinct())
{ {
if (item.sku == "942660104" && item.target_ware_no == "ESFBABLEM")
{
}
_connection.Execute("update dc_mid_transit set quantity_transfer_temporary_storage=0 where bailun_sku=@bailun_sku and warehouse_code=@warehouse_code ", new _connection.Execute("update dc_mid_transit set quantity_transfer_temporary_storage=0 where bailun_sku=@bailun_sku and warehouse_code=@warehouse_code ", new
{ {
bailun_sku = item.sku, bailun_sku = item.sku,
......
...@@ -393,7 +393,10 @@ t1.auto_replace_logistics_task_id, ...@@ -393,7 +393,10 @@ t1.auto_replace_logistics_task_id,
tr_task.logistics_code, tr_task.logistics_code,
tr_task.logistics_name, tr_task.logistics_name,
tr_task.transport_type as 'task_transport_type', tr_task.transport_type as 'task_transport_type',
tr_task.remarks as 'replace_logistics_remarks' tr_task.remarks as 'replace_logistics_remarks',
t9.quantity_transfer_order as 'quantity_transfer_order',
t9.quantity_transfer_temp_schedule as 'quantity_transfer_temp_schedule',
t9.quantity_transfer_temporary_storage as 'quantity_transfer_temporary_storage'
from dc_auto_turnover as t1 from dc_auto_turnover as t1
left join dc_auto_sales as t2 on t1.bailun_sku = t2.bailun_sku and t1.warehouse_code = t2.warehouse_code left join dc_auto_sales as t2 on t1.bailun_sku = t2.bailun_sku and t1.warehouse_code = t2.warehouse_code
left join dc_auto_config_sku_warehouse as t5 on t1.bailun_sku = t5.bailun_sku and t1.warehouse_code = t5.warehouse_code left join dc_auto_config_sku_warehouse as t5 on t1.bailun_sku = t5.bailun_sku and t1.warehouse_code = t5.warehouse_code
...@@ -401,6 +404,7 @@ tr_task.remarks as 'replace_logistics_remarks' ...@@ -401,6 +404,7 @@ tr_task.remarks as 'replace_logistics_remarks'
left join view_goods_moq as t7 on t6.product_inner_code = t7.product_inner_code and t1.warehouse_code = t7.warehouse_code and t6.suppliers_id = t7.suppliers_id left join view_goods_moq as t7 on t6.product_inner_code = t7.product_inner_code and t1.warehouse_code = t7.warehouse_code and t6.suppliers_id = t7.suppliers_id
left join dc_auto_jit_tag as t8 on t1.tag_id = t8.id left join dc_auto_jit_tag as t8 on t1.tag_id = t8.id
left join dc_auto_replace_logistics_task as tr_task on t1.auto_replace_logistics_task_id = tr_task.id left join dc_auto_replace_logistics_task as tr_task on t1.auto_replace_logistics_task_id = tr_task.id
left join dc_mid_transit as t9 on t1.bailun_sku = t9.bailun_sku and t1.warehouse_code = t9.warehouse_code
where t1.gmt_modified>=@btime where t1.gmt_modified>=@btime
and t6.`status`=2 and (t1.history_fourteenday_sales>0 or t1.quantity_out_stock>0 ) and ( t5.`status`=0 or t5.`status` is null ) and t7.sum_quantity_init_advise>0 and t6.`status`=2 and (t1.history_fourteenday_sales>0 or t1.quantity_out_stock>0 ) and ( t5.`status`=0 or t5.`status` is null ) and t7.sum_quantity_init_advise>0
and ( and (
...@@ -548,7 +552,11 @@ t1.auto_replace_logistics_task_id, ...@@ -548,7 +552,11 @@ t1.auto_replace_logistics_task_id,
tr_task.logistics_code, tr_task.logistics_code,
tr_task.logistics_name, tr_task.logistics_name,
tr_task.transport_type as 'task_transport_type', tr_task.transport_type as 'task_transport_type',
tr_task.remarks as 'replace_logistics_remarks' tr_task.remarks as 'replace_logistics_remarks',
t9.quantity_transfer_order as 'quantity_transfer_order',
t9.quantity_transfer_temp_schedule as 'quantity_transfer_temp_schedule',
t9.quantity_transfer_temporary_storage as 'quantity_transfer_temporary_storage'
from dc_auto_turnover as t1 from dc_auto_turnover as t1
left join dc_auto_sales as t2 on t1.bailun_sku = t2.bailun_sku and t1.warehouse_code = t2.warehouse_code left join dc_auto_sales as t2 on t1.bailun_sku = t2.bailun_sku and t1.warehouse_code = t2.warehouse_code
left join dc_auto_config_sku_warehouse as t5 on t1.bailun_sku = t5.bailun_sku and t1.warehouse_code = t5.warehouse_code left join dc_auto_config_sku_warehouse as t5 on t1.bailun_sku = t5.bailun_sku and t1.warehouse_code = t5.warehouse_code
...@@ -556,6 +564,7 @@ tr_task.remarks as 'replace_logistics_remarks' ...@@ -556,6 +564,7 @@ tr_task.remarks as 'replace_logistics_remarks'
left join view_goods_moq as t7 on t6.product_inner_code = t7.product_inner_code and t1.warehouse_code = t7.warehouse_code and t6.suppliers_id = t7.suppliers_id left join view_goods_moq as t7 on t6.product_inner_code = t7.product_inner_code and t1.warehouse_code = t7.warehouse_code and t6.suppliers_id = t7.suppliers_id
left join dc_auto_jit_tag as t8 on t1.tag_id = t8.id left join dc_auto_jit_tag as t8 on t1.tag_id = t8.id
left join dc_auto_replace_logistics_task as tr_task on t1.auto_replace_logistics_task_id = tr_task.id left join dc_auto_replace_logistics_task as tr_task on t1.auto_replace_logistics_task_id = tr_task.id
left join dc_mid_transit as t9 on t1.bailun_sku = t9.bailun_sku and t1.warehouse_code = t9.warehouse_code
where t1.gmt_modified>=@btime where t1.gmt_modified>=@btime
and t6.`status`=2 and t6.`status`=2
-- and (t1.history_fourteenday_sales>0 or t1.quantity_out_stock>0 ) -- and (t1.history_fourteenday_sales>0 or t1.quantity_out_stock>0 )
...@@ -726,16 +735,21 @@ and t1.quantity_init_advise>=0 and ( t3.buyer_name in ('张莹霞1') and t1.ware ...@@ -726,16 +735,21 @@ and t1.quantity_init_advise>=0 and ( t3.buyer_name in ('张莹霞1') and t1.ware
2 as 'purchase_type_jit', 2 as 'purchase_type_jit',
sum(t7.quantity_out_stock_aliexpress) as 'quantity_out_stock_aliexpress', sum(t7.quantity_out_stock_aliexpress) as 'quantity_out_stock_aliexpress',
sum(t7.quantity_out_stock_amazon) as 'quantity_out_stock_amazon', sum(t7.quantity_out_stock_amazon) as 'quantity_out_stock_amazon',
sum(t7.quantity_out_stock_other) as 'quantity_out_stock_other' sum(t7.quantity_out_stock_other) as 'quantity_out_stock_other',
t9.quantity_transfer_order as 'quantity_transfer_order',
t9.quantity_transfer_temp_schedule as 'quantity_transfer_temp_schedule',
t9.quantity_transfer_temporary_storage as 'quantity_transfer_temporary_storage'
from dc_base_stock as t1 from dc_base_stock as t1
left join dc_auto_sales as t2 on t1.bailun_sku = t2.bailun_sku and t1.warehouse_code = t2.warehouse_code left join dc_auto_sales as t2 on t1.bailun_sku = t2.bailun_sku and t1.warehouse_code = t2.warehouse_code
left join dc_auto_config_sku_warehouse as t5 on t1.bailun_sku = t5.bailun_sku and t1.warehouse_code = t5.warehouse_code left join dc_auto_config_sku_warehouse as t5 on t1.bailun_sku = t5.bailun_sku and t1.warehouse_code = t5.warehouse_code
left join dc_base_sku as t6 on t1.bailun_sku = t6.bailun_sku left join dc_base_sku as t6 on t1.bailun_sku = t6.bailun_sku
left join dc_mid_transit as t7 on t1.bailun_sku = t7.bailun_sku and t1.warehouse_code = t7.warehouse_code left join dc_mid_transit as t7 on t1.bailun_sku = t7.bailun_sku and t1.warehouse_code = t7.warehouse_code
left join dc_mid_transit as t9 on t1.bailun_sku = t9.bailun_sku and t1.warehouse_code = t9.warehouse_code
where t6.`status`=2 and ( t6.buyer_name in ('张莹霞') and t1.warehouse_code in ('GZBLWH','GZBLYS') ) where t6.`status`=2 and ( t6.buyer_name in ('张莹霞') and t1.warehouse_code in ('GZBLWH','GZBLYS') )
and ( t5.`status`=0 or t5.`status` is null ) and ( t5.`status`=0 or t5.`status` is null )
GROUP BY t1.bailun_sku GROUP BY t1.bailun_sku
HAVING ( sum((case when t7.quantity_out_stock>0 then 0 else (t1.usable_stock+t1.occupy_order) end )) + sum(t7.quantity_transfer) + sum(t7.quantity_purchase) < sum(t7.quantity_out_stock) )", new { main_id = mainID }, commandTimeout: 0).ToList(); HAVING ( sum((case when t7.quantity_out_stock>0 then 0 else (t1.usable_stock+t1.occupy_order) end )) + sum(t7.quantity_transfer) + sum(t7.quantity_purchase) < sum(t7.quantity_out_stock) )
", new { main_id = mainID }, commandTimeout: 0).ToList();
if (datas != null) if (datas != null)
{ {
...@@ -790,12 +804,16 @@ and t1.quantity_init_advise>=0 and ( t3.buyer_name in ('张莹霞1') and t1.ware ...@@ -790,12 +804,16 @@ and t1.quantity_init_advise>=0 and ( t3.buyer_name in ('张莹霞1') and t1.ware
t6.suppliers_id, t6.suppliers_id,
t7.quantity_out_stock, t7.quantity_out_stock,
2 as 'purchase_type_jit', 2 as 'purchase_type_jit',
sum(t7.quantity_out_stock_aliexpress) as 'quantity_out_stock_aliexpress' sum(t7.quantity_out_stock_aliexpress) as 'quantity_out_stock_aliexpress',
t9.quantity_transfer_order as 'quantity_transfer_order',
t9.quantity_transfer_temp_schedule as 'quantity_transfer_temp_schedule',
t9.quantity_transfer_temporary_storage as 'quantity_transfer_temporary_storage'
from dc_base_stock as t1 from dc_base_stock as t1
left join dc_auto_sales as t2 on t1.bailun_sku = t2.bailun_sku and t1.warehouse_code = t2.warehouse_code left join dc_auto_sales as t2 on t1.bailun_sku = t2.bailun_sku and t1.warehouse_code = t2.warehouse_code
left join dc_auto_config_sku_warehouse as t5 on t1.bailun_sku = t5.bailun_sku and t1.warehouse_code = t5.warehouse_code left join dc_auto_config_sku_warehouse as t5 on t1.bailun_sku = t5.bailun_sku and t1.warehouse_code = t5.warehouse_code
left join dc_base_sku as t6 on t1.bailun_sku = t6.bailun_sku left join dc_base_sku as t6 on t1.bailun_sku = t6.bailun_sku
left join dc_mid_transit as t7 on t1.bailun_sku = t7.bailun_sku and t1.warehouse_code = t7.warehouse_code left join dc_mid_transit as t7 on t1.bailun_sku = t7.bailun_sku and t1.warehouse_code = t7.warehouse_code
left join dc_mid_transit as t9 on t1.bailun_sku = t9.bailun_sku and t1.warehouse_code = t9.warehouse_code
where t6.`status`=2 and ( t6.buyer_name in ('张莹霞1') and t1.warehouse_code in ('GZBLWH','GZBLYS') ) where t6.`status`=2 and ( t6.buyer_name in ('张莹霞1') and t1.warehouse_code in ('GZBLWH','GZBLYS') )
and ( t5.`status`=0 or t5.`status` is null ) and ( t5.`status`=0 or t5.`status` is null )
GROUP BY t1.bailun_sku GROUP BY t1.bailun_sku
...@@ -854,12 +872,16 @@ sum(t7.quantity_out_stock_aliexpress) as 'quantity_out_stock_aliexpress' ...@@ -854,12 +872,16 @@ sum(t7.quantity_out_stock_aliexpress) as 'quantity_out_stock_aliexpress'
t6.suppliers_id, t6.suppliers_id,
t7.quantity_out_stock, t7.quantity_out_stock,
0 as 'purchase_type_jit', 0 as 'purchase_type_jit',
t7.bailun_order_ids t7.bailun_order_ids,
t9.quantity_transfer_order as 'quantity_transfer_order',
t9.quantity_transfer_temp_schedule as 'quantity_transfer_temp_schedule',
t9.quantity_transfer_temporary_storage as 'quantity_transfer_temporary_storage'
from dc_base_stock as t1 from dc_base_stock as t1
left join dc_auto_sales as t2 on t1.bailun_sku = t2.bailun_sku and t1.warehouse_code = t2.warehouse_code left join dc_auto_sales as t2 on t1.bailun_sku = t2.bailun_sku and t1.warehouse_code = t2.warehouse_code
left join dc_auto_config_sku_warehouse as t5 on t1.bailun_sku = t5.bailun_sku and t1.warehouse_code = t5.warehouse_code left join dc_auto_config_sku_warehouse as t5 on t1.bailun_sku = t5.bailun_sku and t1.warehouse_code = t5.warehouse_code
left join dc_base_sku as t6 on t1.bailun_sku = t6.bailun_sku left join dc_base_sku as t6 on t1.bailun_sku = t6.bailun_sku
left join dc_mid_transit as t7 on t1.bailun_sku = t7.bailun_sku and t1.warehouse_code = t7.warehouse_code left join dc_mid_transit as t7 on t1.bailun_sku = t7.bailun_sku and t1.warehouse_code = t7.warehouse_code
left join dc_mid_transit as t9 on t1.bailun_sku = t9.bailun_sku and t1.warehouse_code = t9.warehouse_code
where t6.`status`=2 and ( t6.buyer_name in ('赵美聪','甄杰靖','赵美聪1','秦振荣','李华娟') and t1.warehouse_code in ('BLGZ03','GZBLWH') ) where t6.`status`=2 and ( t6.buyer_name in ('赵美聪','甄杰靖','赵美聪1','秦振荣','李华娟') and t1.warehouse_code in ('BLGZ03','GZBLWH') )
and ( t5.`status`=0 or t5.`status` is null ) and ( t5.`status`=0 or t5.`status` is null )
and ((case when t7.quantity_out_stock>0 then 0 else (t1.usable_stock+t1.occupy_order) end ) + t7.quantity_transfer + t7.quantity_purchase < t7.quantity_out_stock) ", new { main_id = mainID }, commandTimeout: 0).ToList(); and ((case when t7.quantity_out_stock>0 then 0 else (t1.usable_stock+t1.occupy_order) end ) + t7.quantity_transfer + t7.quantity_purchase < t7.quantity_out_stock) ", new { main_id = mainID }, commandTimeout: 0).ToList();
...@@ -916,12 +938,16 @@ t7.bailun_order_ids ...@@ -916,12 +938,16 @@ t7.bailun_order_ids
t6.suppliers_id, t6.suppliers_id,
t7.quantity_out_stock, t7.quantity_out_stock,
0 as 'purchase_type_jit', 0 as 'purchase_type_jit',
t7.bailun_order_ids t7.bailun_order_ids,
t9.quantity_transfer_order as 'quantity_transfer_order',
t9.quantity_transfer_temp_schedule as 'quantity_transfer_temp_schedule',
t9.quantity_transfer_temporary_storage as 'quantity_transfer_temporary_storage'
from dc_base_stock as t1 from dc_base_stock as t1
left join dc_auto_sales as t2 on t1.bailun_sku = t2.bailun_sku and t1.warehouse_code = t2.warehouse_code left join dc_auto_sales as t2 on t1.bailun_sku = t2.bailun_sku and t1.warehouse_code = t2.warehouse_code
left join dc_auto_config_sku_warehouse as t5 on t1.bailun_sku = t5.bailun_sku and t1.warehouse_code = t5.warehouse_code left join dc_auto_config_sku_warehouse as t5 on t1.bailun_sku = t5.bailun_sku and t1.warehouse_code = t5.warehouse_code
left join dc_base_sku as t6 on t1.bailun_sku = t6.bailun_sku left join dc_base_sku as t6 on t1.bailun_sku = t6.bailun_sku
left join dc_mid_transit as t7 on t1.bailun_sku = t7.bailun_sku and t1.warehouse_code = t7.warehouse_code left join dc_mid_transit as t7 on t1.bailun_sku = t7.bailun_sku and t1.warehouse_code = t7.warehouse_code
left join dc_mid_transit as t9 on t1.bailun_sku = t9.bailun_sku and t1.warehouse_code = t9.warehouse_code
where t6.`status`=2 and ( t1.warehouse_code in ('YWWH01') ) where t6.`status`=2 and ( t1.warehouse_code in ('YWWH01') )
and ( t5.`status`=0 or t5.`status` is null ) and ( t5.`status`=0 or t5.`status` is null )
and ((case when t7.quantity_out_stock>0 then 0 else (t1.usable_stock+t1.occupy_order) end ) + t7.quantity_transfer + t7.quantity_purchase < t7.quantity_out_stock)", new { main_id = mainID }, commandTimeout: 0).ToList(); and ((case when t7.quantity_out_stock>0 then 0 else (t1.usable_stock+t1.occupy_order) end ) + t7.quantity_transfer + t7.quantity_purchase < t7.quantity_out_stock)", new { main_id = mainID }, commandTimeout: 0).ToList();
...@@ -979,12 +1005,16 @@ t7.bailun_order_ids ...@@ -979,12 +1005,16 @@ t7.bailun_order_ids
t6.suppliers_id, t6.suppliers_id,
t7.quantity_out_stock, t7.quantity_out_stock,
0 as 'purchase_type_jit', 0 as 'purchase_type_jit',
t7.bailun_order_ids t7.bailun_order_ids,
t9.quantity_transfer_order as 'quantity_transfer_order',
t9.quantity_transfer_temp_schedule as 'quantity_transfer_temp_schedule',
t9.quantity_transfer_temporary_storage as 'quantity_transfer_temporary_storage'
from dc_base_stock as t1 from dc_base_stock as t1
left join dc_auto_sales as t2 on t1.bailun_sku = t2.bailun_sku and t1.warehouse_code = t2.warehouse_code left join dc_auto_sales as t2 on t1.bailun_sku = t2.bailun_sku and t1.warehouse_code = t2.warehouse_code
left join dc_auto_config_sku_warehouse as t5 on t1.bailun_sku = t5.bailun_sku and t1.warehouse_code = t5.warehouse_code left join dc_auto_config_sku_warehouse as t5 on t1.bailun_sku = t5.bailun_sku and t1.warehouse_code = t5.warehouse_code
left join dc_base_sku as t6 on t1.bailun_sku = t6.bailun_sku left join dc_base_sku as t6 on t1.bailun_sku = t6.bailun_sku
left join dc_mid_transit as t7 on t1.bailun_sku = t7.bailun_sku and t1.warehouse_code = t7.warehouse_code left join dc_mid_transit as t7 on t1.bailun_sku = t7.bailun_sku and t1.warehouse_code = t7.warehouse_code
left join dc_mid_transit as t9 on t1.bailun_sku = t9.bailun_sku and t1.warehouse_code = t9.warehouse_code
where t6.`status`=2 and ( t6.buyer_name in ('赵美聪_独立站') ) where t6.`status`=2 and ( t6.buyer_name in ('赵美聪_独立站') )
and ( t5.`status`=0 or t5.`status` is null ) and ( t5.`status`=0 or t5.`status` is null )
and ((case when t7.quantity_out_stock>0 then 0 else (t1.usable_stock+t1.occupy_order) end ) + t7.quantity_transfer + t7.quantity_purchase < t7.quantity_out_stock)", new { main_id = mainID }, commandTimeout: 0).ToList(); and ((case when t7.quantity_out_stock>0 then 0 else (t1.usable_stock+t1.occupy_order) end ) + t7.quantity_transfer + t7.quantity_purchase < t7.quantity_out_stock)", new { main_id = mainID }, commandTimeout: 0).ToList();
...@@ -1237,12 +1267,16 @@ t8.bailun_order_ids ...@@ -1237,12 +1267,16 @@ t8.bailun_order_ids
t6.suppliers_id, t6.suppliers_id,
t7.quantity_out_stock, t7.quantity_out_stock,
0 as 'purchase_type_jit', 0 as 'purchase_type_jit',
t8.bailun_order_ids t8.bailun_order_ids,
t9.quantity_transfer_order as 'quantity_transfer_order',
t9.quantity_transfer_temp_schedule as 'quantity_transfer_temp_schedule',
t9.quantity_transfer_temporary_storage as 'quantity_transfer_temporary_storage'
from dc_base_stock as t1 from dc_base_stock as t1
left join dc_auto_sales as t2 on t1.bailun_sku = t2.bailun_sku and t1.warehouse_code = t2.warehouse_code left join dc_auto_sales as t2 on t1.bailun_sku = t2.bailun_sku and t1.warehouse_code = t2.warehouse_code
left join dc_auto_config_sku_warehouse as t5 on t1.bailun_sku = t5.bailun_sku and t1.warehouse_code = t5.warehouse_code left join dc_auto_config_sku_warehouse as t5 on t1.bailun_sku = t5.bailun_sku and t1.warehouse_code = t5.warehouse_code
left join dc_base_sku as t6 on t1.bailun_sku = t6.bailun_sku left join dc_base_sku as t6 on t1.bailun_sku = t6.bailun_sku
left join dc_mid_transit as t7 on t1.bailun_sku = t7.bailun_sku and t1.warehouse_code = t7.warehouse_code left join dc_mid_transit as t7 on t1.bailun_sku = t7.bailun_sku and t1.warehouse_code = t7.warehouse_code
left join dc_mid_transit as t9 on t1.bailun_sku = t9.bailun_sku and t1.warehouse_code = t9.warehouse_code
left join ( select bailun_sku,sum(bailun_sku_quantity_ordered) as 'quantity',GROUP_CONCAT(bailun_order_id) as 'bailun_order_ids' from dc_base_oms_sku where warehouse_code in ('BLGZ03') and gmt_create>@time and has_scalp=0 and has_buyer_remark = 0 left join ( select bailun_sku,sum(bailun_sku_quantity_ordered) as 'quantity',GROUP_CONCAT(bailun_order_id) as 'bailun_order_ids' from dc_base_oms_sku where warehouse_code in ('BLGZ03') and gmt_create>@time and has_scalp=0 and has_buyer_remark = 0
and has_platsku_remark = 0 GROUP BY bailun_sku ) as t8 on t1.bailun_sku =t8.bailun_sku and has_platsku_remark = 0 GROUP BY bailun_sku ) as t8 on t1.bailun_sku =t8.bailun_sku
where t6.`status`=2 and ( t6.buyer_name in ('赵美聪','甄杰靖','赵美聪1','秦振荣','李华娟') and t1.warehouse_code in ('BLGZ03') ) where t6.`status`=2 and ( t6.buyer_name in ('赵美聪','甄杰靖','赵美聪1','秦振荣','李华娟') and t1.warehouse_code in ('BLGZ03') )
...@@ -1299,12 +1333,16 @@ t8.bailun_order_ids ...@@ -1299,12 +1333,16 @@ t8.bailun_order_ids
2 as 'type', 2 as 'type',
t6.suppliers_id, t6.suppliers_id,
t7.quantity_out_stock, t7.quantity_out_stock,
0 as 'purchase_type_jit' 0 as 'purchase_type_jit',
t9.quantity_transfer_order as 'quantity_transfer_order',
t9.quantity_transfer_temp_schedule as 'quantity_transfer_temp_schedule',
t9.quantity_transfer_temporary_storage as 'quantity_transfer_temporary_storage'
from dc_base_stock as t1 from dc_base_stock as t1
left join dc_auto_sales as t2 on t1.bailun_sku = t2.bailun_sku and t1.warehouse_code = t2.warehouse_code left join dc_auto_sales as t2 on t1.bailun_sku = t2.bailun_sku and t1.warehouse_code = t2.warehouse_code
left join dc_auto_config_sku_warehouse as t5 on t1.bailun_sku = t5.bailun_sku and t1.warehouse_code = t5.warehouse_code left join dc_auto_config_sku_warehouse as t5 on t1.bailun_sku = t5.bailun_sku and t1.warehouse_code = t5.warehouse_code
left join dc_base_sku as t6 on t1.bailun_sku = t6.bailun_sku left join dc_base_sku as t6 on t1.bailun_sku = t6.bailun_sku
left join dc_mid_transit as t7 on t1.bailun_sku = t7.bailun_sku and t1.warehouse_code = t7.warehouse_code left join dc_mid_transit as t7 on t1.bailun_sku = t7.bailun_sku and t1.warehouse_code = t7.warehouse_code
left join dc_mid_transit as t9 on t1.bailun_sku = t9.bailun_sku and t1.warehouse_code = t9.warehouse_code
where t6.`status`=2 and ( t6.buyer_name in ('陈嘉雯1','黎艳漫') and t1.warehouse_code in ('BLGZ03') ) where t6.`status`=2 and ( t6.buyer_name in ('陈嘉雯1','黎艳漫') and t1.warehouse_code in ('BLGZ03') )
and ( t5.`status`=0 or t5.`status` is null ) and ( t5.`status`=0 or t5.`status` is null )
and ((case when t7.quantity_out_stock>0 then 0 else (t1.usable_stock+t1.occupy_order) end ) + t7.quantity_transfer + t7.quantity_purchase < t7.quantity_out_stock)", new { main_id = mainID }, commandTimeout: 0).ToList(); and ((case when t7.quantity_out_stock>0 then 0 else (t1.usable_stock+t1.occupy_order) end ) + t7.quantity_transfer + t7.quantity_purchase < t7.quantity_out_stock)", new { main_id = mainID }, commandTimeout: 0).ToList();
......
...@@ -196,6 +196,20 @@ namespace AutoTurnOver.Models ...@@ -196,6 +196,20 @@ namespace AutoTurnOver.Models
/// 物流切换备注 /// 物流切换备注
/// </summary> /// </summary>
public string replace_logistics_remarks { get; set; } public string replace_logistics_remarks { get; set; }
/// <summary>
/// 调拨单在途
/// </summary>
public int? quantity_transfer_order { get; set; }
/// <summary>
/// 调拨单采购临时数据
/// </summary>
public int? quantity_transfer_temp_schedule { get; set; }
/// <summary>
/// 调拨在途,暂存
/// </summary>
public int? quantity_transfer_temporary_storage { get; set; }
} }
......
...@@ -23,13 +23,13 @@ namespace AutoTurnOver.Purchase.AverageTarget ...@@ -23,13 +23,13 @@ namespace AutoTurnOver.Purchase.AverageTarget
Console.WriteLine("采购平均值计算任务启动..."); Console.WriteLine("采购平均值计算任务启动...");
try try
{ {
//PurchaseAverageTargetServices.CalculationTransfer("942517901"); //PurchaseAverageTargetServices.CalculationTransfer("N-G-TOP");
//report.ResetTransExpectArrivaltime(); //report.ResetTransExpectArrivaltime();
//report.ResetTransExpectArrivaltime(); //report.ResetTransExpectArrivaltime();
//PurchaseAverageTargetServices.CalculationTransfer(); //PurchaseAverageTargetServices.CalculationTransfer();
report.ResetTransExpectArrivaltime(); //report.ResetTransExpectArrivaltime();
} }
catch (Exception ex) catch (Exception ex)
......
...@@ -164,7 +164,7 @@ namespace AutoTurnOver.Services ...@@ -164,7 +164,7 @@ namespace AutoTurnOver.Services
var chageSkuList = AveragePurchase.GetTransferChangeSku(30, bailun_sku); var chageSkuList = AveragePurchase.GetTransferChangeSku(30, bailun_sku);
foreach (var skuItem in chageSkuList) foreach (var skuItem in chageSkuList)
{ {
if (skuItem.warehouse_code == "MMDUSFBA") if (skuItem.warehouse_code == "MDBLWYT")
{ {
} }
......
...@@ -28,6 +28,7 @@ namespace ResetOutofstock ...@@ -28,6 +28,7 @@ namespace ResetOutofstock
//report.PurchaseWeekBackUp(); //report.PurchaseWeekBackUp();
//report.PurchaseWeekBackUp(); //report.PurchaseWeekBackUp();
//await new TaskDownloadServices().Download(); //await new TaskDownloadServices().Download();
dc_base_trans_temp_schedule_dao.SynchroTransTempScheduleData();
} }
catch (Exception ex) catch (Exception ex)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment