Commit 918d93ef by 泽锋 李

fix

parent 963f82be
...@@ -464,7 +464,7 @@ t1.warehouse_code, ...@@ -464,7 +464,7 @@ t1.warehouse_code,
now() as 'push_date', now() as 'push_date',
1 as 'type', 1 as 'type',
t5.usable_stock as 'stocks', t5.usable_stock as 'stocks',
'ebay' as 'platform' @platform as 'platform'
from dc_mid_transit as t1 from dc_mid_transit as t1
left join dc_base_sku as t2 on t1.bailun_sku = t2.bailun_sku left join dc_base_sku as t2 on t1.bailun_sku = t2.bailun_sku
left join dc_base_warehouse as t_db on t1.warehouse_code = t_db.warehouse_code left join dc_base_warehouse as t_db on t1.warehouse_code = t_db.warehouse_code
...@@ -493,14 +493,14 @@ and not exists ( select * from dc_auto_shortage_push_not_config where dc_auto_sh ...@@ -493,14 +493,14 @@ and not exists ( select * from dc_auto_shortage_push_not_config where dc_auto_sh
{ {
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}' ) "; 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}' ) ";
} }
shortage_list.AddRange(conn.Query<dc_auto_shortage_push>(sql,commandTimeout: 0)); shortage_list.AddRange(conn.Query<dc_auto_shortage_push>(sql,new { platform = platform },commandTimeout: 0));
// 0库存推送 // 0库存推送
string no_library_sql = @" select t1.bailun_sku, string no_library_sql = @" select t1.bailun_sku,
t1.warehouse_code, t1.warehouse_code,
now() as 'push_date', now() as 'push_date',
0 as 'stocks', 0 as 'stocks',
'ebay' as 'platform', @platform as 'platform',
2 as 'type' from dc_base_stock as t1 2 as 'type' from dc_base_stock as t1
left join dc_mid_transit as t2 on t1.warehouse_code =t2.warehouse_code and t1.bailun_sku =t2.bailun_sku left join dc_mid_transit as t2 on t1.warehouse_code =t2.warehouse_code and t1.bailun_sku =t2.bailun_sku
left join dc_base_warehouse as t_db on t1.warehouse_code = t_db.warehouse_code left join dc_base_warehouse as t_db on t1.warehouse_code = t_db.warehouse_code
...@@ -529,7 +529,7 @@ and not exists ( select * from dc_auto_shortage_push_not_config where dc_auto_sh ...@@ -529,7 +529,7 @@ and not exists ( select * from dc_auto_shortage_push_not_config where dc_auto_sh
{ {
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}' ) "; 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}' ) ";
} }
shortage_list.AddRange(conn.Query<dc_auto_shortage_push>(no_library_sql, commandTimeout: 0)); shortage_list.AddRange(conn.Query<dc_auto_shortage_push>(no_library_sql, new { platform = platform },commandTimeout: 0));
return shortage_list; return shortage_list;
...@@ -551,7 +551,7 @@ t1.warehouse_code, ...@@ -551,7 +551,7 @@ t1.warehouse_code,
now() as 'push_date', now() as 'push_date',
1 as 'type', 1 as 'type',
t5.usable_stock as 'stocks', t5.usable_stock as 'stocks',
'ebay' as 'platform' @platform as 'platform'
from dc_mid_transit as t1 from dc_mid_transit as t1
left join dc_base_sku as t2 on t1.bailun_sku = t2.bailun_sku left join dc_base_sku as t2 on t1.bailun_sku = t2.bailun_sku
left join dc_base_warehouse as t_db on t1.warehouse_code = t_db.warehouse_code left join dc_base_warehouse as t_db on t1.warehouse_code = t_db.warehouse_code
...@@ -576,14 +576,14 @@ and ( ifnull(t6.usable_stock,0)<ifnull(t7.quantity_unshipped,0) ) -- 有缺货 ...@@ -576,14 +576,14 @@ and ( ifnull(t6.usable_stock,0)<ifnull(t7.quantity_unshipped,0) ) -- 有缺货
{ {
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}' ) "; 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}' ) ";
} }
shortage_list.AddRange(conn.Query<dc_auto_shortage_push>(sql,new { warehouse_codes = warehouse_codes }, commandTimeout: 0)); shortage_list.AddRange(conn.Query<dc_auto_shortage_push>(sql,new { warehouse_codes = warehouse_codes, platform = platform }, commandTimeout: 0));
// 0库存推送 // 0库存推送
string no_library_sql = @" select t1.bailun_sku, string no_library_sql = @" select t1.bailun_sku,
t1.warehouse_code, t1.warehouse_code,
now() as 'push_date', now() as 'push_date',
0 as 'stocks', 0 as 'stocks',
'ebay' as 'platform', @platform as 'platform',
2 as 'type' 2 as 'type'
from dc_base_stock as t1 from dc_base_stock as t1
left join dc_base_warehouse as t_db on t1.warehouse_code = t_db.warehouse_code left join dc_base_warehouse as t_db on t1.warehouse_code = t_db.warehouse_code
...@@ -601,7 +601,7 @@ and not exists ( select * from dc_auto_shortage_push_not_config where dc_auto_sh ...@@ -601,7 +601,7 @@ and not exists ( select * from dc_auto_shortage_push_not_config where dc_auto_sh
{ {
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}' ) "; 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}' ) ";
} }
shortage_list.AddRange(conn.Query<dc_auto_shortage_push>(no_library_sql,new { warehouse_codes = warehouse_codes }, commandTimeout: 0)); shortage_list.AddRange(conn.Query<dc_auto_shortage_push>(no_library_sql,new { warehouse_codes = warehouse_codes, platform = platform }, commandTimeout: 0));
return shortage_list; return shortage_list;
......
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