public void Run(Newegg.Oversea.Framework.JobConsole.Client.JobContext context) { string baseUrl = System.Configuration.ConfigurationManager.AppSettings["RestFulBaseUrl"]; string languageCode = System.Configuration.ConfigurationManager.AppSettings["LanguageCode"]; ECCentral.Job.Utility.RestClient client = new ECCentral.Job.Utility.RestClient(baseUrl, languageCode); ECCentral.Job.Utility.RestServiceError error; var ar = client.Update("/SO/Job/CreateBuyMobileSettlementSO", null, out error); }
public void Run(Newegg.Oversea.Framework.JobConsole.Client.JobContext context) { string baseUrl = System.Configuration.ConfigurationManager.AppSettings["RestFulBaseUrl"]; ECCentral.Job.Utility.RestClient client = new ECCentral.Job.Utility.RestClient(baseUrl); client.AsyncUpdate("/SO/Job/InsertKnownFraudCustomer", null, () => { }); }
public void Run(Newegg.Oversea.Framework.JobConsole.Client.JobContext context) { string baseUrl = System.Configuration.ConfigurationManager.AppSettings["RestFulBaseUrl"]; string languageCode = System.Configuration.ConfigurationManager.AppSettings["LanguageCode"]; ECCentral.Job.Utility.RestClient client = new ECCentral.Job.Utility.RestClient(baseUrl, languageCode); string companyCode = System.Configuration.ConfigurationManager.AppSettings["CompanyCode"]; //可以传入null ,表示所有 companyCode = companyCode == null ? null : (companyCode.Trim() == String.Empty ? null : companyCode.Trim()); ECCentral.Job.Utility.RestServiceError error; var ar = client.Update("/SO/Job/AbandonNotPayGroupBuySO", companyCode, out error); }
public void Run(Newegg.Oversea.Framework.JobConsole.Client.JobContext context) { string baseUrl = System.Configuration.ConfigurationManager.AppSettings["RestFulBaseUrl"]; string languageCode = System.Configuration.ConfigurationManager.AppSettings["LanguageCode"]; ECCentral.Job.Utility.RestClient client = new ECCentral.Job.Utility.RestClient(baseUrl, languageCode); client.Timeout = 100000; string companyCode = System.Configuration.ConfigurationManager.AppSettings["CompanyCode"]; companyCode = companyCode == null ? null : (companyCode.Trim() == String.Empty ? null : companyCode.Trim()); ECCentral.Job.Utility.RestServiceError error; List <WaitDeclareSO> waitDeclareSOList = new List <WaitDeclareSO>(); client.Query <List <WaitDeclareSO> >("/SO/Job/GetWaitDeclareSO", out waitDeclareSOList, out error); if (waitDeclareSOList != null && waitDeclareSOList.Count > 0) { int totalDeclareCnt = waitDeclareSOList.Count; int successCnt = 0; int failCnt = 0; waitDeclareSOList = waitDeclareSOList.FindAll(m => !string.IsNullOrWhiteSpace(m.TrackingNumber)); foreach (var item in waitDeclareSOList) { bool bResult = false; client.Query("/SO/Job/DeclareSO", item, out bResult, out error); if (error != null) { string errorMessage = ""; foreach (var errItem in error.Faults) { errorMessage = errItem.ErrorDescription; } throw new Exception(error.StatusDescription + errorMessage); } if (bResult) { successCnt++; } else { failCnt++; } } context.Message = string.Format("总申报数量:{0},成功数量:{1},失败数量:{2}", totalDeclareCnt, successCnt, failCnt); } else { context.Message = "总申报数量:0"; } }
public void Run(Newegg.Oversea.Framework.JobConsole.Client.JobContext context) { string baseUrl = System.Configuration.ConfigurationManager.AppSettings["RestFulBaseUrl"]; string languageCode = System.Configuration.ConfigurationManager.AppSettings["LanguageCode"]; ECCentral.Job.Utility.RestClient client = new ECCentral.Job.Utility.RestClient(baseUrl, languageCode); string companyCode = System.Configuration.ConfigurationManager.AppSettings["CompanyCode"]; //可以传入null ,表示所有 companyCode = companyCode == null ? null : (companyCode.Trim() == String.Empty ? null : companyCode.Trim()); //client.AsyncUpdate("/SO/Job/ProcessFinishedAndInvalidGroupBuySO", companyCode, () => //{ // Console.WriteLine("Processed"); //}); ECCentral.Job.Utility.RestServiceError error; var ar = client.Update("/SO/Job/ProcessFinishedAndInvalidGroupBuySO", companyCode, out error); }
public void Run(Newegg.Oversea.Framework.JobConsole.Client.JobContext context) { string baseUrl = System.Configuration.ConfigurationManager.AppSettings["RestFulBaseUrl"]; string languageCode = System.Configuration.ConfigurationManager.AppSettings["LanguageCode"]; ECCentral.Job.Utility.RestClient client = new ECCentral.Job.Utility.RestClient(baseUrl, languageCode); client.Timeout = 100000; string companyCode = System.Configuration.ConfigurationManager.AppSettings["CompanyCode"]; companyCode = companyCode == null ? null : (companyCode.Trim() == String.Empty ? null : companyCode.Trim()); int Cnt = int.Parse(System.Configuration.ConfigurationManager.AppSettings["SigleCount"]); ECCentral.Job.Utility.RestServiceError error; List <string> trackingNumberList = new List <string>(); client.Query <List <string> >("/SO/Job/GetWaitingFinishShippingList", ExpressType.SF, out trackingNumberList, out error); if (trackingNumberList != null && trackingNumberList.Count > 0) { trackingNumberList = trackingNumberList.FindAll(m => !string.IsNullOrWhiteSpace(m)); for (int i = 0; i < trackingNumberList.Count; i = i + Cnt) { List <string> currHandleList = new List <string>(); int thisCnt = i + Cnt; for (int j = i; j < thisCnt; j++) { if (j >= trackingNumberList.Count) { break; } currHandleList.Add(trackingNumberList[j]); } object obj = new object(); client.Query("/SO/Job/QueryTracking", new ExpressQueryEntity() { Type = ExpressType.SF, TrackingNumberList = trackingNumberList }, out obj, out error); } } }