@@ -626,9 +626,18 @@ left join dc_base_warehouse as dbw on dacp.warehouse_code = dbw.warehouse_code w
...
@@ -626,9 +626,18 @@ left join dc_base_warehouse as dbw on dacp.warehouse_code = dbw.warehouse_code w
{
{
conn.Execute(" update dc_auto_config_sku_warehouse set status=@monitor_status,bl_operator=@bl_operator where id=@id",new{monitor_status,id=oldData.id,bl_operator=user.UserName});
conn.Execute(" update dc_auto_config_sku_warehouse set status=@monitor_status,bl_operator=@bl_operator where id=@id",new{monitor_status,id=oldData.id,bl_operator=user.UserName});
}
}
conn.Insert(newdc_base_monitor_status_log{
bailun_sku=turnover_item.bailun_sku,
warehouse_code=turnover_item.warehouse_code,
date=DateTime.Now,
monitor_status=monitor_status.ToString(),
user_name=user.UserName
});
}
}
_connection.Execute(@"delete from dc_auto_monitor_sku_type where bailun_sku in @bailun_skus;
_connection.Execute(@"delete from dc_auto_monitor_sku_type where bailun_sku in @bailun_skus;
INSERT into dc_auto_monitor_sku_type(`bailun_sku`,`warehouse_type`) (
INSERT into dc_auto_monitor_sku_type(`bailun_sku`,`warehouse_type`) (
@@ -641,7 +641,7 @@ and not exists ( select * from dc_auto_shortage_push_not_config where dc_auto_sh
...
@@ -641,7 +641,7 @@ 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}' and dc_auto_shortage_push.has_return_goods=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}' and dc_auto_shortage_push.has_return_goods=0 ) ";
//shortage_list.AddRange(conn.Query<dc_auto_shortage_push>(sql, new { platform = platform }, commandTimeout: 0));
// 0库存推送
// 0库存推送
stringno_library_sql=@" select t1.bailun_sku,
stringno_library_sql=@" select t1.bailun_sku,
...
@@ -659,12 +659,19 @@ left join dc_mid_transit as t2 on t1.warehouse_code =t2.warehouse_code and t1.b
...
@@ -659,12 +659,19 @@ left join dc_mid_transit as t2 on t1.warehouse_code =t2.warehouse_code and t1.b
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
left join dc_base_sku as t3 on t1.bailun_sku = t3.bailun_sku
left join dc_base_sku as t3 on t1.bailun_sku = t3.bailun_sku
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 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 holiday_supplier_view as t_sp on t3.suppliers_id = t_sp.supplier_id
left join (
select t1.bailun_sku,t2.area_id,sum(t1.usable_stock) as 'sum_usable_stock' from dc_base_stock as t1
left join dc_base_warehouse as t2 on t1.warehouse_code = t2.warehouse_code
where t1.warehouse_code in ( 'GZBLWH','BLGZ03','YWWH01' )
GROUP BY t1.bailun_sku,t2.area_id
) as t4 on t1.bailun_sku = t4.bailun_sku and t_db.area_id = t4.area_id
where
where
(
(
t1.usable_stock<=0 and t1.bailun_sku!=''
t4.sum_usable_stock<=0 and t1.bailun_sku!=''
and ( t1.warehouse_code in ('GZBLWH','BLGZ03','YWWH01'))
and ( t1.warehouse_code in ('GZBLWH','BLGZ03','YWWH01'))
and ( t3.`status`=1 or t6.`status`=1)
and ( t3.`status`=1 or t7.bailun_sku is null)
and not exists ( select * from dc_auto_shortage_push_not_config where dc_auto_shortage_push_not_config.warehouse_code=t1.warehouse_code and dc_auto_shortage_push_not_config.bailun_sku=t1.bailun_sku )
and not exists ( select * from dc_auto_shortage_push_not_config where dc_auto_shortage_push_not_config.warehouse_code=t1.warehouse_code and dc_auto_shortage_push_not_config.bailun_sku=t1.bailun_sku )