Commit b7f01199 by 泽锋 李

张莹霞1的缺货,无需  EB+WISH

parent 88894eff
......@@ -20,7 +20,7 @@ namespace AutoGeneratePurchaseAdvise
//PurchaseAdviseServices.AutoPushBuySys(2);
//dc_auto_first_order_sku_dao.GeneratePurchaseAdvise();
//PurchaseAdviseServices.AutoPushBuySys(2);
//PurchaseAdviseServices.AutoPushBuySys(1);
//PurchaseAdviseServices.AutoPushBuySys(4);
var builder = new HostBuilder().ConfigureServices((hostContext, services) =>
{
services.AddHostedService<GeneratePurchaseAdviseBackgroundService>();
......
......@@ -745,14 +745,22 @@ where ( t5.`status`=0 or t5.`status` is null ) and t1.quantity_begin_advise>0 an
}
}
public class shortage_sku_list_dto
{
public string bailun_sku { get; set; }
public string buyer_name { get; set; }
}
/// <summary>
/// 特定平台的缺货sku
/// </summary>
/// <param name="platform_types">平台</param>
/// <param name="not_buyer_names">过滤掉指定采购员</param>
/// <returns></returns>
public static List<string> ShortageSkuList(List<string> platform_types)
public static List<string> ShortageSkuList(List<string> platform_types,List<string> not_buyer_names)
{
return _connection.Query<string>(@"
select bailun_sku from dc_base_oms_sku as t1
var datas = _connection.Query<shortage_sku_list_dto>(@"
select t1.bailun_sku,t2.buyer_name from dc_base_oms_sku as t1
left join dc_base_sku as t2 on t1.bailun_sku = t2.bailun_sku
where 1=1
and t1.company_id=1
and t1.has_innersale=0
......@@ -766,6 +774,15 @@ and t1.has_platsku_remark = 0
and t1.bailun_interception_status not in ('Success','Part') and t1.platform_type!='FBA'
and platform_type in @platform_types
", new { platform_types = platform_types },commandTimeout:0).AsList();
if(not_buyer_names!=null && not_buyer_names.Count >= 1)
{
return datas.Where(s=> !not_buyer_names.Any(v=>v==s.buyer_name)).Select(s => s.bailun_sku).ToList();
}
else
{
return datas.Select(s => s.bailun_sku).ToList();
}
}
/// <summary>
......
......@@ -274,7 +274,7 @@ namespace AutoTurnOver.Services
var other_datas = new List<dc_auto_purchase_advise_detailed_dto>();
// 查询当前有缺货的sku
var shortageSkuList = purchase_advise.ShortageSkuList(new List<string> { "ebay","wish"});
var shortageSkuList = purchase_advise.ShortageSkuList(new List<string> { "ebay","wish"},new List<string> { "张莹霞1" });
alone_datas = datas.Where(s => shortageSkuList.Any(v => v == s.bailun_sku)).ToList();
other_datas = datas.Where(s => !shortageSkuList.Any(v => v == s.bailun_sku)).ToList();
......
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