Commit 5f44dcec by 泽锋 李

刷新调拨费用

parent 7771235d
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text; using System.Text;
namespace AutoTurnOver.Models.Report namespace AutoTurnOver.Models.Report
...@@ -113,10 +114,54 @@ namespace AutoTurnOver.Models.Report ...@@ -113,10 +114,54 @@ namespace AutoTurnOver.Models.Report
public string logisticscode { get; set; } public string logisticscode { get; set; }
public int isdeleted { get; set; } public int isdeleted { get; set; }
public string box_id { get; set; } public string box_id { get; set; }
public string bailun_sku { get; set; } public string bailun_skus { get; set; }
public List<sku_dto> skus { get
{
if (string.IsNullOrWhiteSpace(bailun_skus))
{
return new List<sku_dto>();
}
else
{
try
{
var temp_skus = bailun_skus.Split(',').Select(s => {
var arr = s.Split(':');
return new sku_dto()
{
bailun_sku = arr[0],
weight = decimal.Parse(arr[1])
};
}).ToList();
var sum_weight = temp_skus.Sum(s => s.weight);
foreach (var item in temp_skus)
{
item.cost_first = Math.Round(item.weight / sum_weight * sum_cost_first, 2);
}
return temp_skus;
}
catch (Exception ex)
{
throw;
}
}
} }
public class sku_dto
{
public string bailun_sku { get; set; }
public decimal weight { get; set; }
public decimal cost_first { get; set; }
}
public string transfer_order_id { get; set; } public string transfer_order_id { get; set; }
public string warehouse_code { get; set; } public string warehouse_code { get; set; }
public decimal cost_first { get; set; } public decimal sum_cost_first { get; set; }
} }
......
...@@ -15,7 +15,7 @@ namespace ResetOutofstock ...@@ -15,7 +15,7 @@ namespace ResetOutofstock
Console.WriteLine("刷新缺货数据任务启动..."); Console.WriteLine("刷新缺货数据任务启动...");
var now = DateTime.Now; var now = DateTime.Now;
//report_cash_flow_dao.CalculationTransferOrder(now.AddMonths(-3), DateTime.Parse(now.AddDays(-1).ToString("yyyy-MM-dd 23:59:59"))); report_cash_flow_dao.CalculationTransferOrder(now.AddMonths(-3), DateTime.Parse(now.AddDays(-1).ToString("yyyy-MM-dd 23:59:59")));
var builder = new HostBuilder().ConfigureServices((hostContext, services) => var builder = new HostBuilder().ConfigureServices((hostContext, services) =>
{ {
services.AddHostedService<ResetOutofstockBackgrounService>(); services.AddHostedService<ResetOutofstockBackgrounService>();
......
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