Commit 66ae1d27 by 泽锋 李

fix

parent a04be26c
...@@ -530,30 +530,24 @@ and ( t5.`status`=0 or t5.`status` is null ) and t7.sum_quantity_init_advise>0 ...@@ -530,30 +530,24 @@ and ( t5.`status`=0 or t5.`status` is null ) and t7.sum_quantity_init_advise>0
", new { main_id = mainID, btime = date }, commandTimeout: 0).ToList(); ", new { main_id = mainID, btime = date }, commandTimeout: 0).ToList();
Console.WriteLine("开始出建议 完"); Console.WriteLine("开始出建议 完");
if (is_clear_data)
if (datas1 != null && datas1.Count >= 1)
{ {
var initDate = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd 00:00:00")); var datas2 = SetMotherSkuStorageCapacity(datas1);
// 清理历史数据
_connection.Execute(@"update dc_auto_purchase_advise_detailed set `status`=-1 where main_id in ( if (is_clear_data)
select id from dc_auto_purchase_advise where buy_sys_plan_no in ('Generate')
)
and `status`=0 and bailun_sku_warehouse_code not in @bailun_sku_warehouse_codes
", new { bailun_sku_warehouse_codes = datas1.Select(s => $"{s.bailun_sku}{s.warehouse_code}") });
// 清理历史数据
if(datas1.Any(s => s.is_mother_map_sku == 1))
{ {
var initDate = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd 00:00:00"));
// 清理历史数据
_connection.Execute(@"update dc_auto_purchase_advise_detailed set `status`=-1 where main_id in ( _connection.Execute(@"update dc_auto_purchase_advise_detailed set `status`=-1 where main_id in (
select id from dc_auto_purchase_advise where buy_sys_plan_no in ('Generate') select id from dc_auto_purchase_advise where buy_sys_plan_no in ('Generate')
) )
and `status`=0 and mother_sku_warehouse_code not in @bailun_sku_warehouse_codes and `status`=0 and bailun_sku_warehouse_code not in @bailun_sku_warehouse_codes
", new { bailun_sku_warehouse_codes = datas1.Where(s => s.is_mother_map_sku == 1).Select(s => $"{s.bailun_sku}{s.warehouse_code}") }); ", new { bailun_sku_warehouse_codes = datas2.Select(s => $"{s.bailun_sku}{s.warehouse_code}") });
} }
}
if (datas1 != null && datas1.Count >= 1)
{
var datas2 = SetMotherSkuStorageCapacity(datas1);
WritePurchaseAdvise(datas2); WritePurchaseAdvise(datas2);
} }
......
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