Commit 790aed72 by 泽锋 李

wish 缺货算法修改

parent 94dc5874
...@@ -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(new dc_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 ) ";
} }
sql += " ) or t_sp.supplier_id is not null "; sql += " ) or t_sp.supplier_id is not null ";
shortage_list.AddRange(conn.Query<dc_auto_shortage_push>(sql, new { platform = platform }, 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,
...@@ -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 )
"; ";
if (!is_all) if (!is_all)
......
using System;
using System.Collections.Generic;
using System.Text;
namespace AutoTurnOver.Models
{
public class dc_base_monitor_status_log
{
public int id { get; set; }
public string user_name { get; set; }
public string monitor_status { get; set; }
public DateTime date { get; set; }
public string bailun_sku { get; set; }
public string warehouse_code { get; set; }
}
}
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