Commit d56242ac by 泽锋 李

fix

parent 22ccd411
...@@ -509,7 +509,8 @@ t9.quantity_transfer_temp_schedule as 'quantity_transfer_temp_schedule', ...@@ -509,7 +509,8 @@ t9.quantity_transfer_temp_schedule as 'quantity_transfer_temp_schedule',
t9.quantity_transfer_temporary_storage as 'quantity_transfer_temporary_storage', t9.quantity_transfer_temporary_storage as 'quantity_transfer_temporary_storage',
t1.first_order_date as 'first_order_date', t1.first_order_date as 'first_order_date',
t1.first_order_bailun_order_id as 'first_order_bailun_order_id', t1.first_order_bailun_order_id as 'first_order_bailun_order_id',
t1.is_mother_sku as 'is_mother_map_sku' t1.is_mother_sku as 'is_mother_map_sku',
t1.daily_weighted_sales as 'fixed_daily_weighted_sales'
from (select * from dc_auto_turnover where gmt_modified>=@btime ) as t1 from (select * from dc_auto_turnover where gmt_modified>=@btime ) 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
...@@ -1126,19 +1127,21 @@ left join dc_mid_transit as t9 on t1.bailun_sku = t9.bailun_sku and t1.warehouse ...@@ -1126,19 +1127,21 @@ left join dc_mid_transit as t9 on t1.bailun_sku = t9.bailun_sku and t1.warehouse
{ {
item.bailun_sku_warehouse_code = $"{item.bailun_sku}{item.warehouse_code}"; item.bailun_sku_warehouse_code = $"{item.bailun_sku}{item.warehouse_code}";
item.create_time = DateTime.Now; item.create_time = DateTime.Now;
// 查询是否有未过期 未推送的数据 // 查询是否有未过期 未推送的数据 (不包含本次需求)
var oldCreateDate = _connection.QuerySingleOrDefault<DateTime?>(" select create_time from dc_auto_purchase_advise_detailed where bailun_sku_warehouse_code = @bailun_sku_warehouse_code and status=0 and ispush=0 limit 1 ", new var oldCreateDate = _connection.QuerySingleOrDefault<DateTime?>(" select create_time from dc_auto_purchase_advise_detailed where bailun_sku_warehouse_code = @bailun_sku_warehouse_code and main_id!=@main_id and status=0 and ispush=0 limit 1 ", new
{ {
bailun_sku_warehouse_code = item.bailun_sku_warehouse_code bailun_sku_warehouse_code = item.bailun_sku_warehouse_code,
main_id = item.main_id
}, commandTimeout: 0); }, commandTimeout: 0);
if (oldCreateDate != null) if (oldCreateDate != null)
{ {
item.create_time = oldCreateDate; item.create_time = oldCreateDate;
} }
_connection.Execute(" update dc_auto_purchase_advise_detailed set status=-1 where bailun_sku_warehouse_code = @bailun_sku_warehouse_code ", new _connection.Execute(" update dc_auto_purchase_advise_detailed set status=-1 and main_id!=@main_id where bailun_sku_warehouse_code = @bailun_sku_warehouse_code ", new
{ {
bailun_sku_warehouse_code = item.bailun_sku_warehouse_code bailun_sku_warehouse_code = item.bailun_sku_warehouse_code,
main_id = item.main_id
}, commandTimeout: 0); }, commandTimeout: 0);
_connection.Insert(item); _connection.Insert(item);
} }
...@@ -1167,6 +1170,9 @@ left join dc_mid_transit as t9 on t1.bailun_sku = t9.bailun_sku and t1.warehouse ...@@ -1167,6 +1170,9 @@ left join dc_mid_transit as t9 on t1.bailun_sku = t9.bailun_sku and t1.warehouse
var item2 = item.ToJson().ToObj<dc_auto_purchase_advise_detailed>(); var item2 = item.ToJson().ToObj<dc_auto_purchase_advise_detailed>();
item2.auto_replace_logistics_task_id = 0; item2.auto_replace_logistics_task_id = 0;
item2.replace_logistics_remarks = "同仓库sku有切换空运的而需求,但是需求超过35天的量了,由此裂变出一条超出的需求走回默认运输方式"; item2.replace_logistics_remarks = "同仓库sku有切换空运的而需求,但是需求超过35天的量了,由此裂变出一条超出的需求走回默认运输方式";
item2.logistics_code = "";
item2.logistics_name = "";
item2.task_transport_type = "";
item2.quantity_final_advise = quantity_final_advise-quantity_35; item2.quantity_final_advise = quantity_final_advise-quantity_35;
datas.Add(item2); datas.Add(item2);
} }
......
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