Commit d2019531 by 泽锋 李

fix

parent 59b61089
...@@ -6,7 +6,7 @@ namespace AutoTurnOver.Models ...@@ -6,7 +6,7 @@ namespace AutoTurnOver.Models
{ {
public class dc_base_order_data_source public class dc_base_order_data_source
{ {
public int id { get; set; } public long id { get; set; }
public string order_no { get; set; } public string order_no { get; set; }
public string order_type { get; set; } public string order_type { get; set; }
......
...@@ -37,7 +37,7 @@ namespace AutoTurnOver.Purchase.AverageTarget ...@@ -37,7 +37,7 @@ namespace AutoTurnOver.Purchase.AverageTarget
try try
{ {
Console.WriteLine($"开始 init2 ,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}"); Console.WriteLine($"开始 init2 ,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
PurchaseAverageTargetServices.Calculation(days:360); //PurchaseAverageTargetServices.Calculation(days:360);
Console.WriteLine($"结束 init2,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}"); Console.WriteLine($"结束 init2,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
} }
catch (Exception ex) catch (Exception ex)
......
...@@ -31,8 +31,8 @@ namespace AutoTurnOver.Purchase.AverageTarget ...@@ -31,8 +31,8 @@ namespace AutoTurnOver.Purchase.AverageTarget
//PurchaseAverageTargetServices.CalculationTransfer(); //PurchaseAverageTargetServices.CalculationTransfer();
//report.ResetTransExpectArrivaltime(); //report.ResetTransExpectArrivaltime();
//dc_auto_return_goods_config_dao.NewCalculation(); //dc_auto_return_goods_config_dao.NewCalculation();
//PurchaseAverageTargetServices.Calculation("951755902", days: 360); //PurchaseAverageTargetServices.Calculation("942517901", days: 360);
//PurchaseAverageTargetServices.CalculationTransfer("951755902", 360); //PurchaseAverageTargetServices.CalculationTransfer("942517901", 360);
} }
catch (Exception ex) catch (Exception ex)
{ {
......
...@@ -232,7 +232,7 @@ namespace AutoTurnOver.Services ...@@ -232,7 +232,7 @@ namespace AutoTurnOver.Services
{ {
try try
{ {
if (skuItem.warehouse_code == " BLGZ03") if (skuItem.warehouse_code == "MMDUSFBA")
{ {
} }
...@@ -260,7 +260,7 @@ namespace AutoTurnOver.Services ...@@ -260,7 +260,7 @@ namespace AutoTurnOver.Services
if (inboundList != null && inboundList.Count >= 1) if (inboundList != null && inboundList.Count >= 1)
{ {
foreach (var itemLms in inboundList) foreach (var itemLms in inboundList.GroupBy(s=>s.purchase_id))
{ {
conn.Insert(new dc_base_order_data_source conn.Insert(new dc_base_order_data_source
{ {
...@@ -270,9 +270,9 @@ namespace AutoTurnOver.Services ...@@ -270,9 +270,9 @@ namespace AutoTurnOver.Services
bailun_sku_warehouse_code = $"{skuItem.bailun_sku}{skuItem.warehouse_code}", bailun_sku_warehouse_code = $"{skuItem.bailun_sku}{skuItem.warehouse_code}",
bale_days = 0, bale_days = 0,
logistics_name = "", logistics_name = "",
order_no = itemLms.purchase_id, order_no = itemLms.Key,
order_type = "采购单-质检入库天数计算", order_type = "采购单-质检入库天数计算",
put_days = (decimal)Math.Ceiling((itemLms.update_time - itemLms.arrival_time).TotalHours / 24), put_days = (decimal)Math.Ceiling((itemLms.Min(s=>s.update_time) - itemLms.Min(s=>s.arrival_time)).TotalHours / 24),
sign_days = 0, sign_days = 0,
transport_type = "" transport_type = ""
}); });
...@@ -282,7 +282,8 @@ namespace AutoTurnOver.Services ...@@ -282,7 +282,8 @@ namespace AutoTurnOver.Services
if (inboundList != null && inboundList.Count() >= 1) if (inboundList != null && inboundList.Count() >= 1)
{ {
dataWarehouse.inbound_days = (int)inboundList.Sum(s => Math.Ceiling((s.update_time - s.arrival_time).TotalHours / 24)) / inboundList.Count(); var inboundListGroup = inboundList.GroupBy(s => s.purchase_id).ToList();
dataWarehouse.inbound_days = (int)inboundListGroup.Sum(s => Math.Ceiling((s.Min(v=>v.update_time) - s.Min(v=>v.arrival_time)).TotalHours / 24)) / inboundListGroup.Count();
} }
else else
{ {
...@@ -519,8 +520,8 @@ namespace AutoTurnOver.Services ...@@ -519,8 +520,8 @@ namespace AutoTurnOver.Services
logistics_name = "", logistics_name = "",
order_no = "无有效历史单,当前写死2天", order_no = "无有效历史单,当前写死2天",
order_type = "采购单-质检入库天数计算", order_type = "采购单-质检入库天数计算",
put_days = 0, put_days = sku_sign_days,
sign_days = sku_sign_days, sign_days = 0,
transport_type = "" transport_type = ""
}); });
......
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