Commit 04085065 by 泽锋 李

记录补海运周转数的计算过程

parent f113fdd2
......@@ -1892,7 +1892,8 @@ where t1.gmt_modified>=@btime and t1.gmt_modified<=@etime
}
// 查询利润数据
var profit_data = TransferProfitList(bailun_sku, warehouse_code, DateTime.Now).today_data;
profit_data.ocean_purchase = Math.Max(0, profit_data.quantity_final_advise_ocean - profit_data.turnover);
profit_data.ocean_purchase_amount = profit_data.ocean_purchase * profit_data.unit_price;
var formula_json = profit_data.ToJson();
dc_report_profit_analysis data = formula_json.ToObj<dc_report_profit_analysis>();
data.bailun_sku = bailun_sku;
......@@ -1944,8 +1945,7 @@ from dc_base_oms_sku where bailun_sku=@bailun_sku and warehouse_code=@warehouse_
bailun_sku = bailun_sku,
warehouse_code = warehouse_code
}) ?? 0;
data.ocean_purchase = Math.Max(0, (int)Math.Ceiling(data.quantity_final_advise_ocean - data.turnover));
data.ocean_purchase_amount = data.ocean_purchase * data.unit_price;
data.update_time = DateTime.Now;
if (data.id > 0)
{
......@@ -1993,7 +1993,7 @@ from dc_base_oms_sku where bailun_sku=@bailun_sku and warehouse_code=@warehouse_
var datas = conn.Query<sku_warehouse_code_dto>($@" select t1.bailun_sku,t1.warehouse_code from dc_auto_turnover as t1 left join dc_base_warehouse as t2 on t1.warehouse_code =t2.warehouse_code
where t2.hq_type not in ('国内仓') and t1.gmt_modified>=@btime and t1.gmt_modified <=@etime and t1.daily_weighted_sales>1
order by t1.gmt_modified asc
limit {(page - 1) * rows},{rows} ", new { btime = new_task_synchro_log.start_time, etime = new_task_synchro_log.end_time }).ToList();
limit {(page - 1) * rows},{rows} ", new { btime = new_task_synchro_log.start_time, etime = new_task_synchro_log.end_time },commandTimeout:0).ToList();
if (datas.Count <= 0) { break; }
page++;
foreach (var orderItem in datas)
......
......@@ -10,6 +10,11 @@ namespace AutoTurnOver.Models.Report
/// 实际建议周转数
/// </summary>
public int quantity_final_advise;
/// <summary>
/// 补海运周转数
/// </summary>
public int ocean_purchase;
public decimal ocean_purchase_amount;
/// <summary>
/// 30天的预计周转数
......
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