Commit e75a9b41 by 泽锋 李

fix

parent 41daa25d
......@@ -498,6 +498,7 @@ left join dc_base_stock as t5 on t1.bailun_sku = t5.bailun_sku and t1.warehouse_
left join dc_auto_config_sku_warehouse as t6 on t1.bailun_sku = t6.bailun_sku and t1.warehouse_code = t6.warehouse_code
left join ( select * from dc_auto_monitor_sku_type where warehouse_type='国内仓') as t7 on t1.bailun_sku = t7.bailun_sku
left join holiday_supplier_view as t_sp on t2.suppliers_id = t_sp.supplier_id
left join dc_config_full_push_monitor as t_full_push on t_full_push.bailun_sku = t1.bailun_sku and t_full_push.warehouse_code = t1.warehouse_code and t_full_push.platform_type=@platform
where
t_sp.supplier_id is not null or
( t1.warehouse_code in ('GZBLWH','BLGZ03') or ( t1.warehouse_code in ('YWWH01') and ( t2.`status`=1 or t6.`status`=1 ) ) ) -- 义务仓 只要停止监控 或者停售就推送
......@@ -517,21 +518,15 @@ and not exists ( select * from dc_auto_shortage_push_not_config where dc_auto_sh
if (!is_all)
{
sql += $" and not exists ( select * from dc_auto_shortage_push where dc_auto_shortage_push.warehouse_code = t1.warehouse_code and dc_auto_shortage_push.bailun_sku = t1.bailun_sku and dc_auto_shortage_push.`type`=1 and dc_auto_shortage_push.platform='{platform}' and dc_auto_shortage_push.has_return_goods=0 ) ";
// 增量推,要剔除全量推的数据
sql += " and ( t_full_push.status is null or t_full_push.status=0 ) ";
}
// ebay 的 10月新品 +普货全量推
if (platform == "ebay")
{
//if (is_all)
//{
// // 全量推 只推普货
// sql += " and t2.develop_time>='2020-10-01' and t2.buyer_name not in ('张莹霞','赵美聪','甄杰靖','张莹霞') and t1.warehouse_code in ('GZBLWH') ";
//}
//else
//{
// // 增量推,那部分数据要剔除
// sql += " and !(t2.develop_time>='2020-10-01' and t2.buyer_name not in ('张莹霞','赵美聪','甄杰靖','张莹霞') and t1.warehouse_code in ('GZBLWH') ) ";
//}
else
{
// 全量推送只能推送有开启监控的
sql += " and t_full_push.status=1";
}
shortage_list.AddRange(_connection.Query<dc_auto_shortage_push>(sql, new { platform = platform }, commandTimeout: 0));
// 0库存推送
......@@ -563,6 +558,7 @@ left join (
left join dc_auto_config_sku_warehouse as t6 on t1.bailun_sku = t6.bailun_sku and t1.warehouse_code = t6.warehouse_code
left join ( select * from dc_auto_monitor_sku_type where warehouse_type='国内仓') as t7 on t1.bailun_sku = t7.bailun_sku
left join holiday_supplier_view as t_sp on t3.suppliers_id = t_sp.supplier_id
left join dc_config_full_push_monitor as t_full_push on t_full_push.bailun_sku = t1.bailun_sku and t_full_push.warehouse_code = t1.warehouse_code and t_full_push.platform_type=@platform
where
t_sp.supplier_id is not null or
t1.usable_stock<=0 and t1.bailun_sku!=''
......@@ -580,21 +576,28 @@ and not exists ( select * from dc_auto_shortage_push_not_config where dc_auto_sh
if (!is_all)
{
no_library_sql += $" and not exists ( select * from dc_auto_shortage_push where dc_auto_shortage_push.warehouse_code = t1.warehouse_code and dc_auto_shortage_push.bailun_sku = t1.bailun_sku and dc_auto_shortage_push.`type`=2 and dc_auto_shortage_push.platform='{platform}' and dc_auto_shortage_push.has_return_goods=0 ) ";
// 增量推,要剔除全量推的数据
no_library_sql += " and ( t_full_push.status is null or t_full_push.status=0 ) ";
}
// ebay 的 10月新品 +普货全量推
if (platform == "ebay")
{
//if (is_all)
//{
// // 全量推 只推普货
// no_library_sql += " and t3.develop_time>='2020-10-01' and t3.buyer_name not in ('张莹霞','赵美聪','甄杰靖','张莹霞') and t1.warehouse_code in ('GZBLWH') ";
//}
//else
//{
// // 增量推,那部分数据要剔除
// no_library_sql += " and !(t3.develop_time>='2020-10-01' and t3.buyer_name not in ('张莹霞','赵美聪','甄杰靖','张莹霞') and t1.warehouse_code in ('GZBLWH') ) ";
//}
else
{
// 全量推送只能推送有开启监控的
no_library_sql += " and t_full_push.status=1";
}
// ebay 的 10月新品 +普货全量推
//if (platform == "ebay")
//{
// //if (is_all)
// //{
// // // 全量推 只推普货
// // no_library_sql += " and t3.develop_time>='2020-10-01' and t3.buyer_name not in ('张莹霞','赵美聪','甄杰靖','张莹霞') and t1.warehouse_code in ('GZBLWH') ";
// //}
// //else
// //{
// // // 增量推,那部分数据要剔除
// // no_library_sql += " and !(t3.develop_time>='2020-10-01' and t3.buyer_name not in ('张莹霞','赵美聪','甄杰靖','张莹霞') and t1.warehouse_code in ('GZBLWH') ) ";
// //}
//}
shortage_list.AddRange(_connection.Query<dc_auto_shortage_push>(no_library_sql, new { platform = platform }, commandTimeout: 0));
return shortage_list;
......@@ -729,6 +732,7 @@ left join (
GROUP BY t1.bailun_sku,t2.area_id
) as t7 on t1.bailun_sku = t7.bailun_sku and t_db.area_id = t7.area_id
left join holiday_supplier_view as t_sp on t2.suppliers_id = t_sp.supplier_id
left join dc_config_full_push_monitor as t_full_push on t_full_push.bailun_sku = t1.bailun_sku and t_full_push.warehouse_code = t1.warehouse_code and t_full_push.platform_type=@platform
where
t_sp.supplier_id is not null or
t1.warehouse_code in @warehouse_codes
......@@ -739,6 +743,13 @@ and ( ifnull(t6.usable_stock,0)<ifnull(t7.quantity_unshipped,0) ) -- 有缺货
if (!is_all)
{
sql += $" and not exists ( select * from dc_auto_shortage_push where dc_auto_shortage_push.warehouse_code = t1.warehouse_code and dc_auto_shortage_push.bailun_sku = t1.bailun_sku and dc_auto_shortage_push.`type`=1 and dc_auto_shortage_push.platform='{platform}' and dc_auto_shortage_push.has_return_goods=0 ) ";
// 增量推,要剔除全量推的数据
sql += " and ( t_full_push.status is null or t_full_push.status=0 ) ";
}
else
{
// 全量推送只能推送有开启监控的
sql += " and t_full_push.status=1";
}
//shortage_list.AddRange(conn.Query<dc_auto_shortage_push>(sql,new { warehouse_codes = warehouse_codes, platform = platform }, commandTimeout: 0));
......@@ -765,6 +776,7 @@ left join (
GROUP BY t1.bailun_sku,t2.area_id
) as t6 on t1.bailun_sku = t6.bailun_sku and t_db.area_id = t6.area_id
left join holiday_supplier_view as t_sp on t2.suppliers_id = t_sp.supplier_id
left join dc_config_full_push_monitor as t_full_push on t_full_push.bailun_sku = t1.bailun_sku and t_full_push.warehouse_code = t1.warehouse_code and t_full_push.platform_type=@platform
where
t_sp.supplier_id is not null or
t1.warehouse_code in @warehouse_codes
......@@ -775,6 +787,13 @@ and not exists ( select * from dc_auto_shortage_push_not_config where dc_auto_sh
if (!is_all)
{
no_library_sql += $" and not exists ( select * from dc_auto_shortage_push where dc_auto_shortage_push.warehouse_code = t1.warehouse_code and dc_auto_shortage_push.bailun_sku = t1.bailun_sku and dc_auto_shortage_push.`type`=2 and dc_auto_shortage_push.platform='{platform}' and dc_auto_shortage_push.has_return_goods=0 ) ";
// 增量推,要剔除全量推的数据
no_library_sql += " and ( t_full_push.status is null or t_full_push.status=0 ) ";
}
else
{
// 全量推送只能推送有开启监控的
no_library_sql += " and t_full_push.status=1";
}
shortage_list.AddRange(conn.Query<dc_auto_shortage_push>(no_library_sql, new { warehouse_codes = warehouse_codes, platform = platform }, commandTimeout: 0));
......
......@@ -15,6 +15,10 @@ namespace ShortagePush
try
{
//new ReportServices().ShortagePushEbay();
new ReportServices().ShortagePushEbay(true, true);
//new ReportServices().ShortagePushEbay(true);
//new ReportServices().ReturnGoodsPush();
}
......
......@@ -48,7 +48,7 @@ namespace ShortagePush
System.Console.WriteLine($"结束推送 Ebay -增量 改零数据,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
System.Console.WriteLine($"开始推送 Ebay - 全量 改零数据,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
//new ReportServices().ShortagePushEbay(true,true);
new ReportServices().ShortagePushEbay(true,true);
System.Console.WriteLine($"结束推送 Ebay - 全量 改零数据,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
System.Console.WriteLine($"开始推送 Ebay 回货数据,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
......
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