public void SyncTest() { var outofstore = MC_OutOfStore.GetInstance(); var gettoken = MC_GetToken.GetInstance(); var token = gettoken.Request <MC_getToken_Result, MC_getToken_Params>(new MC_getToken_Params()).Result.token; int total = 0; int pagesize = 50000; int pageindex = 1; int pagecount = 0; do { var result = outofstore.Request <MC_OutOfStore_Result, MC_OutOfStore_Params>( new MC_OutOfStore_Params(token, "20190501", "20190821", pagesize, pageindex)); total = result.Result.TotalCount; if (pagecount == 0) { pagecount = total / pagesize; if (total % pagesize > 0) { pagecount++; } } Console.WriteLine(pageindex); pageindex++; } while (pageindex <= pagecount); }
public void GetTokenTest() { var par = new MC_getToken_Params("AF7E9E381F3D7A7F9AD11E0186306031"); MC_GetToken request = MC_GetToken.GetInstance(); var data = request.Request <MC_getToken_Result, TokenInfo>(par); }
public async Task Execute(IJobExecutionContext context) { var mc_outofstore = MC_PickUpGoods.GetInstance(); var token = MC_GetToken.GetInstance().Token; await mc_outofstore.SyncData_EveryDate(token); }
public async Task Execute(IJobExecutionContext context) { var mc_outofstore = MC_PickUpGoods.GetInstance(); mc_outofstore.DeleteAllData <MC_PickUpGoods_ResultInfo>(); var token = MC_GetToken.GetInstance().GetToken().GetAwaiter().GetResult(); await mc_outofstore.SyncData_EveryDate(token); }
public async Task Execute(IJobExecutionContext context) { var mc_outofstore = MC_OutOfStore.GetInstance(); var token = MC_GetToken.GetInstance().Token; LogHelper.Info("出仓单开始同步"); await mc_outofstore.SyncData_Today(token); }
public async Task Execute(IJobExecutionContext context) { var mc_outofstore = MC_PickUpGoods.GetInstance(); LogHelper.Info("开始同步"); await Console.Out.WriteLineAsync("提货单开始同步"); var token = MC_GetToken.GetInstance().Token; await mc_outofstore.SyncData_Today(token); }
public async Task Execute(IJobExecutionContext context) { var mc_outofstore = MC_OutOfStore.GetInstance(); var token = MC_GetToken.GetInstance().Token; LogHelper.LogInfo("出仓单开始同步"); Console.Out.WriteLineAsync("出仓单开始同步"); await mc_outofstore.SyncData_EveryDate(token); }
/// <summary> /// 同步指定时间的所有提货单和出仓单数据 /// </summary> /// <returns></returns> public bool Sync_Today_THD(string rq1, string rq2) { try { var token = MC_GetToken.GetInstance().Token; var result = MC_PickUpGoods.GetInstance().RequestAndWriteData(token, rq1, rq2) && MC_OutOfStore.GetInstance().RequestAndWriteData(token, rq1, rq2); if (result) { MC_PickUpGoods.GetInstance().Call_MN_THD_Update(); } return(result); } catch (Exception ex) { LogHelper.WriteLog("同步失败"); LogHelper.WriteLog(ex); return(false); } }
public async Task Execute(IJobExecutionContext context) { var rq1 = context.JobDetail.JobDataMap.GetString("rq1"); var rq2 = context.JobDetail.JobDataMap.GetString("rq2"); if (string.IsNullOrEmpty(rq1) || string.IsNullOrEmpty(rq2)) { throw new ArgumentException("参数错误,开始日期和结束日期不能为空"); } var mc_pickupgoods = MC_PickUpGoods.GetInstance(); var token = MC_GetToken.GetInstance().Token; var result = await mc_pickupgoods.RequestAndWriteData(token, rq1, rq2); mc_pickupgoods.Call_MN_THD_Update(); await Console.Out.WriteLineAsync("同步任务完成"); context.Result = result; }