Commit 08d66024 by lizefeng

新增库存分计算任务

parent 8eee12ed
...@@ -26,6 +26,7 @@ namespace AutoTurnOver.Models.ApiDto ...@@ -26,6 +26,7 @@ namespace AutoTurnOver.Models.ApiDto
public class data_dto { public class data_dto {
public string bailun_order_id { get; set; } public string bailun_order_id { get; set; }
public string warehouse_code { get; set; }
public string origin_order_id { get; set; } public string origin_order_id { get; set; }
public string bailun_sku { get; set; } public string bailun_sku { get; set; }
public decimal refund_amount { get; set; } public decimal refund_amount { get; set; }
......
using System;
using System.Collections.Generic;
using System.Text;
namespace AutoTurnOver.Models
{
/// <summary>
/// sku 单位调拨费计算
/// </summary>
public class dc_base_transfer_freight_new
{
public int id { get; set; }
public string bailun_sku { get; set; }
public string warehouse_code { get; set; }
/// <summary>
/// 运费单价
/// </summary>
public decimal freight_unit_price { get; set; }
/// <summary>
/// 最近30天总运费 cny
/// </summary>
public decimal freight { get; set; }
public DateTime update_time { get; set; }
public decimal count { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Text;
namespace AutoTurnOver.Models
{
/// <summary>
/// sku 单位 调拨费 明细
/// </summary>
public class dc_base_transfer_freight_new_order
{
public long id { get; set; }
/// <summary>
/// 仓库sku
/// </summary>
public string bailun_sku { get; set; }
public string main_bailun_sku { get; set; }
/// <summary>
/// 仓库编码
/// </summary>
public string warehouse_code { get; set; }
/// <summary>
/// 调拨单号
/// </summary>
public string transfer_order_id { get; set; }
/// <summary>
/// 调拨总单运费
/// </summary>
public decimal order_cost { get; set; }
/// <summary>
/// 调拨单总总量
/// </summary>
public decimal order_weight { get; set; }
/// <summary>
/// 调拨单总产品数量
/// </summary>
public decimal order_sku_count { get; set; }
/// <summary>
/// 该sku 在该调拨单中分摊的总运费
/// </summary>
public decimal sku_cost { get; set; }
/// <summary>
/// 该sku 在该调拨单中的总重量
/// </summary>
public decimal sku_weight { get; set; }
/// <summary>
/// sku的购买数量
/// </summary>
public decimal sku_count { get; set; }
/// <summary>
/// 数据最后更新时间
/// </summary>
public DateTime gmt_update_time { get; set; }
}
}
...@@ -75,6 +75,10 @@ namespace AutoTurnOver.Models ...@@ -75,6 +75,10 @@ namespace AutoTurnOver.Models
///预计30天营业利润=预计30天内销量* 单位售价*(1-最近1个月的款率-最近1个月的平台费率最近1个月的广告费率)-预计30天内销量* 单位采购成本 ///预计30天营业利润=预计30天内销量* 单位售价*(1-最近1个月的款率-最近1个月的平台费率最近1个月的广告费率)-预计30天内销量* 单位采购成本
/// </summary> /// </summary>
public decimal profit_30_forecast { get; set; } public decimal profit_30_forecast { get; set; }
/// <summary>
/// 单位运费
/// </summary>
public decimal freight_unit_price { get; set; }
/// <summary> /// <summary>
/// 可售天数: /// 可售天数:
...@@ -103,6 +107,10 @@ namespace AutoTurnOver.Models ...@@ -103,6 +107,10 @@ namespace AutoTurnOver.Models
/// </summary> /// </summary>
public decimal platform_fee_day_30 { get; set; } public decimal platform_fee_day_30 { get; set; }
/// <summary> /// <summary>
/// 最近30天退款金额
/// </summary>
public decimal refund_amount_day_30 { get; set; }
/// <summary>
/// 最近30天的销售额(usd) /// 最近30天的销售额(usd)
/// </summary> /// </summary>
public decimal amount_total_day_30 { get; set; } public decimal amount_total_day_30 { get; set; }
...@@ -115,6 +123,10 @@ namespace AutoTurnOver.Models ...@@ -115,6 +123,10 @@ namespace AutoTurnOver.Models
/// </summary> /// </summary>
public decimal platform_fee_rate { get; set; } public decimal platform_fee_rate { get; set; }
/// <summary> /// <summary>
/// 退款率 (最近30天退款金额/总销售额)
/// </summary>
public decimal refund_rate { get; set; }
/// <summary>
/// 采购在途数量 /// 采购在途数量
/// </summary> /// </summary>
public decimal quantity_purchase { get; set; } public decimal quantity_purchase { get; set; }
......
...@@ -11,6 +11,7 @@ namespace AutoTurnOver.Models ...@@ -11,6 +11,7 @@ namespace AutoTurnOver.Models
{ {
public int id { get; set; } public int id { get; set; }
public string bailun_order_id { get; set; } public string bailun_order_id { get; set; }
public string warehouse_code { get; set; }
public string origin_order_id { get; set; } public string origin_order_id { get; set; }
public string bailun_sku { get; set; } public string bailun_sku { get; set; }
public decimal refund_amount { get; set; } public decimal refund_amount { get; set; }
......
...@@ -48,6 +48,7 @@ namespace ResetOutofstock ...@@ -48,6 +48,7 @@ namespace ResetOutofstock
// report_invest_return_dao.SynchBtmAdFees(); // report_invest_return_dao.SynchBtmAdFees();
//report_invest_return_dao.ShareAdFee(); //report_invest_return_dao.ShareAdFee();
//report_invest_return_dao.SynchBtmOrderRefund(); //report_invest_return_dao.SynchBtmOrderRefund();
//report_invest_return_dao.CalculationStockScore();
} }
catch (Exception ex) catch (Exception ex)
{ {
......
...@@ -517,7 +517,7 @@ namespace ResetOutofstock ...@@ -517,7 +517,7 @@ namespace ResetOutofstock
} }
}); });
Task.Factory.StartNew(() => Task.Factory.StartNew(() =>
{ {
...@@ -528,7 +528,7 @@ namespace ResetOutofstock ...@@ -528,7 +528,7 @@ namespace ResetOutofstock
{ {
Console.WriteLine($"开始 拉取pps sku,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}"); Console.WriteLine($"开始 拉取pps sku,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
report_invest_return_dao.SynchPpsSku(); report_invest_return_dao.SynchPpsSku();
Console.WriteLine($"结束 拉取pps sku,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}"); Console.WriteLine($"结束 拉取pps sku,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
Thread.Sleep(10 * 60 * 1000); Thread.Sleep(10 * 60 * 1000);
} }
...@@ -566,7 +566,7 @@ namespace ResetOutofstock ...@@ -566,7 +566,7 @@ namespace ResetOutofstock
} }
}); });
Task.Factory.StartNew(() => Task.Factory.StartNew(() =>
{ {
while (true) while (true)
...@@ -576,7 +576,6 @@ namespace ResetOutofstock ...@@ -576,7 +576,6 @@ namespace ResetOutofstock
{ {
Console.WriteLine($"开始 分摊广告费,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}"); Console.WriteLine($"开始 分摊广告费,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
report_invest_return_dao.ShareAdFee(); report_invest_return_dao.ShareAdFee();
Console.WriteLine($"结束 分摊广告费,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}"); Console.WriteLine($"结束 分摊广告费,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
Thread.Sleep(10 * 60 * 1000); Thread.Sleep(10 * 60 * 1000);
} }
...@@ -590,6 +589,28 @@ namespace ResetOutofstock ...@@ -590,6 +589,28 @@ namespace ResetOutofstock
} }
}); });
Task.Factory.StartNew(() =>
{
while (true)
{
try
{
Console.WriteLine($"开始 计算库存分,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
report_invest_return_dao.CalculationStockScore();
Console.WriteLine($"结束 计算库存分,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
Thread.Sleep(10 * 60 * 1000);
}
catch (Exception ex)
{
Console.WriteLine(" 分摊广告费:" + ex.Message);
Console.WriteLine(" 分摊广告费 :" + ex.StackTrace);
}
}
});
......
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