Commit ee3591f0 by guanzhenshan

增加交运时间

parent 429a0d85
...@@ -166,6 +166,11 @@ namespace Bailun.DC.AllotOrderDetail.Models ...@@ -166,6 +166,11 @@ namespace Bailun.DC.AllotOrderDetail.Models
/// </summary> /// </summary>
public DateTime? CompletionDate { get; set; } public DateTime? CompletionDate { get; set; }
/// <summary>
/// 交运确认时间
/// </summary>
public DateTime? DeliveryTime { get; set; }
} }
public class AllotOrderProductItemOutputDto public class AllotOrderProductItemOutputDto
......
...@@ -92,5 +92,7 @@ namespace Bailun.DC.AllotOrderDetail.Models ...@@ -92,5 +92,7 @@ namespace Bailun.DC.AllotOrderDetail.Models
public DateTime dc_createtime { get; set; } public DateTime dc_createtime { get; set; }
public DateTime? finishtime { get; set; } public DateTime? finishtime { get; set; }
public DateTime? deliverytime { get; set; }
} }
} }
...@@ -22,7 +22,14 @@ namespace Bailun.DC.AllotOrderDetail ...@@ -22,7 +22,14 @@ namespace Bailun.DC.AllotOrderDetail
//static void Main(string[] args) //static void Main(string[] args)
//{ //{
// var service = new Services(); // var service = new Services();
// service.Init(); // //service.Init();
// var day = DateTime.Parse("2020-06-24");
// while(day<DateTime.Now)
// {
// service.GetData(day, day.AddHours(1));
// day = day.AddHours(1);
// }
//} //}
} }
} }
...@@ -47,8 +47,7 @@ namespace Bailun.DC.AllotOrderDetail ...@@ -47,8 +47,7 @@ namespace Bailun.DC.AllotOrderDetail
public void Init() public void Init()
{ {
var page = 1;
var rows = 1000;
var starttime = DateTime.Now; var starttime = DateTime.Now;
using (var cn = new MySqlConnection(Common.GlobalConfig.ConnectionString)) using (var cn = new MySqlConnection(Common.GlobalConfig.ConnectionString))
...@@ -72,7 +71,7 @@ namespace Bailun.DC.AllotOrderDetail ...@@ -72,7 +71,7 @@ namespace Bailun.DC.AllotOrderDetail
endtime = DateTime.Now; endtime = DateTime.Now;
starttime = starttime.AddMinutes(-3); starttime = starttime.AddMinutes(-3);
var total = -1;
//测试 //测试
#if DEBUG #if DEBUG
...@@ -80,21 +79,31 @@ namespace Bailun.DC.AllotOrderDetail ...@@ -80,21 +79,31 @@ namespace Bailun.DC.AllotOrderDetail
endtime = starttime.AddSeconds(10); endtime = starttime.AddSeconds(10);
#endif #endif
GetData(starttime, endtime);
}
public void GetData(DateTime starttime, DateTime end)
{
var page = 1;
var rows = 1000;
var total = -1;
while (total == -1 || total > ((page-1) * rows)) while (total == -1 || total > ((page - 1) * rows))
{ {
total = 0; total = 0;
var data = new var data = new
{ {
Data = new { Data = new
Page = new { {
Page = new
{
page = page, page = page,
rows = rows rows = rows
}, },
StartTime = starttime.ToString("yyyy-MM-dd HH:mm:ss"), StartTime = starttime.ToString("yyyy-MM-dd HH:mm:ss"),
EndTime = endtime.ToString("yyyy-MM-dd HH:mm:ss"), EndTime = end.ToString("yyyy-MM-dd HH:mm:ss"),
}, },
}; };
...@@ -110,13 +119,13 @@ namespace Bailun.DC.AllotOrderDetail ...@@ -110,13 +119,13 @@ namespace Bailun.DC.AllotOrderDetail
//保存数据 //保存数据
Save(json.data.items); Save(json.data.items);
Console.WriteLine("时间:" + starttime.ToString("yyyy-MM-dd HH:mm:ss") + "-" + endtime.ToString("yyyy-MM-dd HH:mm:ss") + ",页码:" + page + ",请求记录数:" + json.data.items.Count+",总记录数:"+ total); Console.WriteLine("时间:" + starttime.ToString("yyyy-MM-dd HH:mm:ss") + "-" + end.ToString("yyyy-MM-dd HH:mm:ss") + ",页码:" + page + ",请求记录数:" + json.data.items.Count + ",总记录数:" + total);
page++; page++;
} }
else else
{ {
Console.WriteLine("时间:" + starttime.ToString("yyyy-MM-dd HH:mm:ss") + "-" + endtime.ToString("yyyy-MM-dd HH:mm:ss") + ",页码:" + page + ",请求记录数:0"); Console.WriteLine("时间:" + starttime.ToString("yyyy-MM-dd HH:mm:ss") + "-" + end.ToString("yyyy-MM-dd HH:mm:ss") + ",页码:" + page + ",请求记录数:0");
} }
} }
} }
...@@ -184,8 +193,11 @@ namespace Bailun.DC.AllotOrderDetail ...@@ -184,8 +193,11 @@ namespace Bailun.DC.AllotOrderDetail
skuweight = 0, skuweight = 0,
skuweightStr = "", skuweightStr = "",
finishtime = item.CompletionDate finishtime = item.CompletionDate,
deliverytime = item.DeliveryTime,
}; };
cn.Insert<Models.dc_base_transfer_info>(m); cn.Insert<Models.dc_base_transfer_info>(m);
......
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