12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using TempDbToUfida.OpenApi;
- using WangToTempDb;
- namespace YlInit
- {
- public class Inventory : IProcess
- {
- public void Process()
- {
- DateTime dt1, dt2, dt3;
- dt1 = new DateTime(2017, 5, 1);
- dt2 = dt1.AddDays(30);
- dt3 = DateTime.Now.AddMinutes(-10);
- int i = 0;
- //增加条件
- if (dt2.Subtract(dt3).TotalDays <=30&&dt2>=dt3)
- {
- __Process(dt1, dt3);
- }
- while (dt2 < dt3 )
- {
- __Process(dt1, dt2);
- dt1 = dt2.AddSeconds(1);
- dt2 = dt1.AddDays(30);
- if (dt2 > dt3)
- {
- dt2 = dt3;
- __Process(dt1, dt2);
- //dt3 = dt2.AddDays(-10);
- }
- }
- DownLoadInventory download = new DownLoadInventory();
- download.DownLoad();
-
- }
- private void __Process(DateTime dt1, DateTime dt2)
- {
- Dictionary<string, string> args = new Dictionary<string, string>();
- args["start_time"] = dt1.ToString("yyyy-MM-dd HH:mm:ss");
- args["end_time"] = dt2.ToString("yyyy-MM-dd HH:mm:ss");
- InventoryUpLoad upload = new InventoryUpLoad();
- upload.UpLoad(args);
-
- }
- }
- }
|