public void Execute(IJobExecutionContext context)
        {
            try
            {
                var host = new MvcApiHost("api/Customer/BatchUpdateApplyInfoesPrice");
                var request = new MvcRequestContext<string>() { Content = string.Empty };

                var response = RzHttpClient.Post<RequestContext<string>, ResponseContext<bool>>(host, request);

                if (response.HasContent() && response.Result.Content)
                {
                    return;
                }
                Log.Info("Rongzi.SDT.Schedule", "RequeirmentPriceJob",
                    string.Format("RequeirmentPriceJob == host:{0}  /r  request:{1} /r response:{2}",
                    host.ToString(),
                    Newtonsoft.Json.JsonConvert.SerializeObject(request),
                    Newtonsoft.Json.JsonConvert.SerializeObject(response)));

                CommonLogger.Info("RequeirmentPriceJob 任务运行成功结束");
            }
            catch (Exception ex)
            {
                CommonLogger.Error("Rongzi.SDT.Schedule---RequirementPriceJob", ex);
            }
        }
Example #2
0
        /// <summary>
        /// 调用接口获取省份信息
        /// </summary>
        /// <param name="isHot"></param>
        /// <returns></returns>
        private static Dictionary<int, ProvinceModel> GetProvinceMap(int isHot)
        {
            //请求参数
            var request = new MvcRequestContext<string>();
            ApiHost host = new MvcApiHost("api/Common/Province?isHot=" + isHot);

            var ret = RzHttpClient.Post<RequestContext<string>, ResponseContext<List<ProvinceModel>>>(host, request).Result;
            if (ret.Head.Ret != 0 || ret.Content == null)
            {
                return null;
            }

            return ret.Content.ToDictionary(k => k.ProId, v => v);
        }
Example #3
0
 /// <summary>
 /// 调用接口,取某个城市下的区域
 /// </summary>
 /// <param name="cityID"></param>
 /// <returns></returns>
 public List<DistrictModel> GetDistricts(int cityID)
 {
     ApiHost host = new MvcApiHost("api/Common/District");
     RequestContext<int> req = new MvcRequestContext<int>();
     req.Content = cityID;
     var res = RzHttpClient.Post<RequestContext<int>, ResponseContext<List<DistrictModel>>>(host, req);
     if (res.HasContent())
     {
         return res.Result.Content;
     }
     return null;
 }