Commit ee3591f0 by guanzhenshan

增加交运时间

parent 429a0d85
......@@ -166,6 +166,11 @@ namespace Bailun.DC.AllotOrderDetail.Models
/// </summary>
public DateTime? CompletionDate { get; set; }
/// <summary>
/// 交运确认时间
/// </summary>
public DateTime? DeliveryTime { get; set; }
}
public class AllotOrderProductItemOutputDto
......
......@@ -92,5 +92,7 @@ namespace Bailun.DC.AllotOrderDetail.Models
public DateTime dc_createtime { get; set; }
public DateTime? finishtime { get; set; }
public DateTime? deliverytime { get; set; }
}
}
......@@ -22,7 +22,14 @@ namespace Bailun.DC.AllotOrderDetail
//static void Main(string[] args)
//{
// 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
public void Init()
{
var page = 1;
var rows = 1000;
var starttime = DateTime.Now;
using (var cn = new MySqlConnection(Common.GlobalConfig.ConnectionString))
......@@ -72,7 +71,7 @@ namespace Bailun.DC.AllotOrderDetail
endtime = DateTime.Now;
starttime = starttime.AddMinutes(-3);
var total = -1;
//测试
#if DEBUG
......@@ -80,21 +79,31 @@ namespace Bailun.DC.AllotOrderDetail
endtime = starttime.AddSeconds(10);
#endif
GetData(starttime, endtime);
}
while (total == -1 || total > ((page-1) * rows))
public void GetData(DateTime starttime, DateTime end)
{
var page = 1;
var rows = 1000;
var total = -1;
while (total == -1 || total > ((page - 1) * rows))
{
total = 0;
var data = new
{
Data = new {
Page = new {
Data = new
{
Page = new
{
page = page,
rows = rows
},
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
//保存数据
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++;
}
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,7 +193,10 @@ namespace Bailun.DC.AllotOrderDetail
skuweight = 0,
skuweightStr = "",
finishtime = item.CompletionDate
finishtime = item.CompletionDate,
deliverytime = item.DeliveryTime,
};
......
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