Commit 1671ea28 by 泽锋 李

ebay + wish 的单独出一个单

parent e17de7cc
......@@ -20,6 +20,7 @@ namespace AutoGeneratePurchaseAdvise
//PurchaseAdviseServices.AutoPushBuySys(2);
//dc_auto_first_order_sku_dao.GeneratePurchaseAdvise();
//PurchaseAdviseServices.AutoPushBuySys(2);
//PurchaseAdviseServices.AutoPushBuySys(1);
var builder = new HostBuilder().ConfigureServices((hostContext, services) =>
{
services.AddHostedService<GeneratePurchaseAdviseBackgroundService>();
......
......@@ -746,6 +746,29 @@ where ( t5.`status`=0 or t5.`status` is null ) and t1.quantity_begin_advise>0 an
}
/// <summary>
/// 特定平台的缺货sku
/// </summary>
/// <returns></returns>
public static List<string> ShortageSkuList(List<string> platform_types)
{
return _connection.Query<string>(@"
select bailun_sku from dc_base_oms_sku as t1
where 1=1
and t1.company_id=1
and t1.has_innersale=0
and t1.create_time>'2019-03-01 12:00:00'
and t1.bailun_picking_status!='TotalPicked'
and t1.bailun_order_status = 'Handling'
and t1.has_delete=0
and t1.has_scalp=0
and t1.has_buyer_remark = 0
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();
}
/// <summary>
/// 获取采购建议列表
/// </summary>
/// <param name="m"></param>
......
......@@ -204,7 +204,7 @@ namespace AutoTurnOver.Services
/// <summary>
/// 速卖通的挑出来单独下
/// </summary>
public static void PushBuySysSplit(List<dc_auto_purchase_advise_detailed_dto> datas, UserData user, bool is_skip_error)
public static void PushBuySysSplit_bak(List<dc_auto_purchase_advise_detailed_dto> datas, UserData user, bool is_skip_error)
{
if (datas == null || datas.Count <= 0) return;
var amazon_datas = new List<dc_auto_purchase_advise_detailed_dto>();
......@@ -263,6 +263,32 @@ namespace AutoTurnOver.Services
}
/// <summary>
/// 指定平台(ebay, wish)的挑出来单独下
/// </summary>
public static void PushBuySysSplit(List<dc_auto_purchase_advise_detailed_dto> datas, UserData user, bool is_skip_error)
{
if (datas == null || datas.Count <= 0) return;
var alone_datas = new List<dc_auto_purchase_advise_detailed_dto>();
var other_datas = new List<dc_auto_purchase_advise_detailed_dto>();
// 查询当前有缺货的sku
var shortageSkuList = purchase_advise.ShortageSkuList(new List<string> { "ebay","wish"});
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();
if (alone_datas != null && alone_datas.Count > 0)
{
PushBuySys(alone_datas, user, is_skip_error,"ebay+wish");
}
if (other_datas != null && other_datas.Count > 0)
{
PushBuySys(other_datas, user, is_skip_error,"其他");
}
}
/// <summary>
/// 自动推送采购单
/// </summary>
......@@ -305,7 +331,7 @@ namespace AutoTurnOver.Services
var total = 0;
datas.AddRange(PurchaseAdviseServices.DetailList(new dc_auto_purchase_advise_detailed_search_dto { main_id = mainID, ispush = false }, 0, int.MaxValue, ref total));
//datas.AddRange(PurchaseAdviseServices.DetailList(new dc_auto_purchase_advise_detailed_search_dto { main_id = mainID, ispush = false }, 0, int.MaxValue, ref total));
if (false)
if (true)
{
PurchaseAdviseServices.PushBuySysSplit(datas, new UserData { UserName = "admin" }, true);
}
......
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