Commit 9c42645c by 泽锋 李

新增母sku周转数据增量同步服务

parent 4426e865
...@@ -29,7 +29,7 @@ namespace AutoTurnOver.DB ...@@ -29,7 +29,7 @@ namespace AutoTurnOver.DB
if (objTurnOver != null) if (objTurnOver != null)
{ {
var sql1 = "select * from dc_auto_sales where bailun_sku='" + objTurnOver.bailun_sku + "' and warehouse_code='"+objTurnOver.warehouse_code+"'"; var sql1 = "select * from dc_auto_sales where bailun_sku='" + objTurnOver.bailun_sku + "' and warehouse_code='" + objTurnOver.warehouse_code + "'";
return _connection.QueryFirstOrDefault<dc_auto_sales>(sql1); return _connection.QueryFirstOrDefault<dc_auto_sales>(sql1);
} }
......
...@@ -211,13 +211,20 @@ left join dc_base_warehouse as t2 on t1.warehouse_code = t2.warehouse_code where ...@@ -211,13 +211,20 @@ left join dc_base_warehouse as t2 on t1.warehouse_code = t2.warehouse_code where
catch (Exception ex) catch (Exception ex)
{ {
t.Rollback(); t.Rollback();
throw;
} }
} }
//更新母sku库容 //更新母sku库容
dc_base_mother_sku_dao.ResetStorageCapacityByMapSku(data.bailun_sku, data.warehouse_code,new UserData { UserName = data.create_user}); dc_base_mother_sku_dao.ResetStorageCapacityByMapSku(data.bailun_sku, data.warehouse_code,new UserData { UserName = data.create_user});
if(type_enum== dc_base_storage_capacity_log_enum.导入)
{
// 如果是导入库容,则需要扣采购在途、采购临时
} }
}
/// <summary> /// <summary>
/// 批量修改库容 /// 批量修改库容
......
...@@ -24,7 +24,7 @@ namespace AutoTurnOver.Models ...@@ -24,7 +24,7 @@ namespace AutoTurnOver.Models
/// <summary> /// <summary>
/// 实际库存 /// 实际库存
/// </summary> /// </summary>
public int actual_inbound { get; set; } public int actual_inventory { get; set; }
/// <summary> /// <summary>
/// 预测今天入库 /// 预测今天入库
...@@ -181,10 +181,7 @@ namespace AutoTurnOver.Models ...@@ -181,10 +181,7 @@ namespace AutoTurnOver.Models
/// </summary> /// </summary>
public decimal forecast_thirtyday_inbound { get; set; } public decimal forecast_thirtyday_inbound { get; set; }
/// <summary>
/// 记录时间
/// </summary>
public DateTime record_time { get; set; }
/// <summary> /// <summary>
/// 创建时间 /// 创建时间
...@@ -196,10 +193,7 @@ namespace AutoTurnOver.Models ...@@ -196,10 +193,7 @@ namespace AutoTurnOver.Models
/// </summary> /// </summary>
public DateTime gmt_modified { get; set; } public DateTime gmt_modified { get; set; }
/// <summary>
/// 入库类型 1是采购入库, 2是调拨入库
/// </summary>
public int type { get; set; }
/// <summary> /// <summary>
/// 详细预测入库数据 /// 详细预测入库数据
...@@ -212,4 +206,16 @@ namespace AutoTurnOver.Models ...@@ -212,4 +206,16 @@ namespace AutoTurnOver.Models
public string relation { get; set; } public string relation { get; set; }
} }
public class dc_auto_inbound_dto : dc_auto_inbound {
/// <summary>
/// 记录时间
/// </summary>
public DateTime record_time { get; set; }
/// <summary>
/// 入库类型 1是采购入库, 2是调拨入库
/// </summary>
public int type { get; set; }
}
} }
...@@ -13,25 +13,7 @@ namespace AutoTurnOver.Models ...@@ -13,25 +13,7 @@ namespace AutoTurnOver.Models
/// </summary> /// </summary>
public string forecast_formula { get; set; } public string forecast_formula { get; set; }
/// <summary>
/// 平台
/// </summary>
public string platform { get; set; }
/// <summary>
/// 站点
/// </summary>
public string website { get; set; }
/// <summary>
/// 百伦帐号id
/// </summary>
public string bailun_account_id { get; set; }
/// <summary>
/// 百伦帐号
/// </summary>
public string bailun_account { get; set; }
/// <summary> /// <summary>
/// 百伦SKU /// 百伦SKU
...@@ -219,10 +201,7 @@ namespace AutoTurnOver.Models ...@@ -219,10 +201,7 @@ namespace AutoTurnOver.Models
/// </summary> /// </summary>
public string warehouse_name { get; set; } public string warehouse_name { get; set; }
/// <summary>
/// 记录时间
/// </summary>
public DateTime record_time { get; set; }
/// <summary> /// <summary>
/// 预测今日销量 /// 预测今日销量
...@@ -405,4 +384,31 @@ namespace AutoTurnOver.Models ...@@ -405,4 +384,31 @@ namespace AutoTurnOver.Models
public string fit_forecast_formula { get; set; } public string fit_forecast_formula { get; set; }
} }
public class dc_auto_sales_dto : dc_auto_sales
{
/// <summary>
/// 平台
/// </summary>
public string platform { get; set; }
/// <summary>
/// 站点
/// </summary>
public string website { get; set; }
/// <summary>
/// 百伦帐号id
/// </summary>
public string bailun_account_id { get; set; }
/// <summary>
/// 百伦帐号
/// </summary>
public string bailun_account { get; set; }
/// <summary>
/// 记录时间
/// </summary>
public DateTime record_time { get; set; }
}
} }
...@@ -601,6 +601,9 @@ namespace AutoTurnOver.Models ...@@ -601,6 +601,9 @@ namespace AutoTurnOver.Models
[Description("是否监控库容")] [Description("是否监控库容")]
public int? storage_capacity_status { get; set; } public int? storage_capacity_status { get; set; }
[Description("子母sku类型")]
public int? is_mother_sku { get; set; }
/// <summary> /// <summary>
/// 仓库编码 /// 仓库编码
/// </summary> /// </summary>
...@@ -775,6 +778,9 @@ namespace AutoTurnOver.Models ...@@ -775,6 +778,9 @@ namespace AutoTurnOver.Models
public class dc_auto_turnover_list_dto public class dc_auto_turnover_list_dto
{ {
public string bailun_sku_warehouse_code { get; set; }
public List<dc_auto_turnover_list_dto> maps { get; set; }
/// <summary> /// <summary>
/// 备货数量 /// 备货数量
/// </summary> /// </summary>
......
...@@ -30,7 +30,7 @@ namespace ResetOutofstock ...@@ -30,7 +30,7 @@ namespace ResetOutofstock
//dc_base_transfer_freight_dao.Init(); //dc_base_transfer_freight_dao.Init();
//daily.ResetFbaExtendSales(DateTime.Now); //daily.ResetFbaExtendSales(DateTime.Now);
dc_base_mother_sku_dao.ResetTurnOver("",""); //dc_base_mother_sku_dao.SynchroCalculationTurnOver();
} }
catch (Exception ex) catch (Exception ex)
{ {
......
...@@ -296,6 +296,26 @@ namespace ResetOutofstock ...@@ -296,6 +296,26 @@ namespace ResetOutofstock
} }
}); });
Task.Factory.StartNew(() =>
{
while (true)
{
try
{
Console.WriteLine($"开始刷新 增量刷新母sku周转数据,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
dc_base_mother_sku_dao.SynchroCalculationTurnOver();
Console.WriteLine($"结束刷新 增量刷新母sku周转数据,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
}
catch (Exception ex)
{
Console.WriteLine("增量刷新母sku周转数据:" + ex.Message);
Console.WriteLine("增量刷新母sku周转数据:" + ex.StackTrace);
}
Thread.Sleep(10 * 60 * 1000);
}
});
......
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