Commit 75b3631c by guanzhenshan

解决调拨单明细同步漏数据的问题

parent 00bfe780
......@@ -30,7 +30,7 @@ namespace Bailun.DC.AllotOrderDetail
{
var now = DateTime.Now;
if (now.Minute==30)
if (now.Minute%4==0)
{
Console.WriteLine("开始启动 " + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
Init();
......@@ -55,7 +55,7 @@ namespace Bailun.DC.AllotOrderDetail
{
if (cn.State == System.Data.ConnectionState.Closed)
{
var sql = "select * from dc_base_transfer_info order by timestamp desc limit 1";
var sql = "select timestamp from dc_base_transfer_info order by timestamp desc limit 1";
var result = cn.QueryFirstOrDefault<Models.dc_base_transfer_info>(sql);
if (result == null)
......@@ -73,8 +73,8 @@ namespace Bailun.DC.AllotOrderDetail
endtime = DateTime.Now;
starttime = starttime.AddMinutes(-3);
var total = -1;
while (total == -1 || total > page * rows)
while (total == -1 || total > ((page-1) * rows))
{
total = 0;
......@@ -102,7 +102,7 @@ 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);
Console.WriteLine("时间:" + starttime.ToString("yyyy-MM-dd HH:mm:ss") + "-" + endtime.ToString("yyyy-MM-dd HH:mm:ss") + ",页码:" + page + ",请求记录数:" + json.data.items.Count+",总记录数:"+ total);
page++;
}
......
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