Commit 78f3b6fd by 泽锋 李

销量配置支持商品编码指定

parent 996e432f
......@@ -1590,6 +1590,18 @@ and start_date<=@end_date and end_date>=@start_date
}
}
if (input_data.product_codes != null)
{
foreach (var item in input_data.product_codes.Split(','))
{
conn.Insert(new dc_auto_sales_forecast_product_code_config
{
product_code = item,
config_id = new_id ?? 0
});
}
}
if (input_data.stages != null)
{
foreach (var item in input_data.stages)
......@@ -1610,6 +1622,7 @@ and start_date<=@end_date and end_date>=@start_date
{
var data = _connection.QueryFirstOrDefault<dc_auto_sales_forecast_config_dto>("select * from dc_auto_sales_forecast_config where id=@id ", new { id = id });
data.bailun_skus = string.Join(",", _connection.Query<string>(" select bailun_sku from dc_auto_sales_forecast_sku_config where config_id=@config_id ", new { config_id = id }).ToList());
data.product_codes = string.Join(",", _connection.Query<string>(" select product_code from dc_auto_sales_forecast_product_code_config where config_id=@config_id ", new { config_id = id }).ToList());
data.stages = _connection.Query<dc_auto_sales_forecast_stage_config>(" select * from dc_auto_sales_forecast_stage_config where config_id=@config_id ", new { config_id = id }).OrderBy(s=>s.index).ToList();
return data;
}
......
......@@ -106,6 +106,7 @@ namespace AutoTurnOver.Models
public class dc_auto_sales_forecast_config_dto: dc_auto_sales_forecast_config
{
public string bailun_skus { get; set; }
public string product_codes { get; set; }
public string warehouse_name { get; set; }
public List<dc_auto_sales_forecast_stage_config> stages { get; set; }
......@@ -128,4 +129,11 @@ namespace AutoTurnOver.Models
public int config_id { get; set; }
public string bailun_sku { get; set; }
}
public class dc_auto_sales_forecast_product_code_config
{
public int id { get; set; }
public int config_id { get; set; }
public string product_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