| | |
| | | |
| | | |
| | | |
| | | |
| | | // new TransactionScope(TransactionScopeOption.Required, |
| | | // new TransactionOptions |
| | | // { |
| | | // IsolationLevel = IsolationLevel.ReadCommitted, |
| | | // Timeout = TransactionManager.MaximumTimeout |
| | | // } |
| | | //) |
| | | |
| | | |
| | | |
| | |
| | | Uri getUrl = new Uri(Shuchengurl + GetShopUsers + "?start="+ start.ToString("yyyy-MM-dd HH:mm:ss") + "&end="+ end.ToString("yyyy-MM-dd HH:mm:ss")); |
| | | |
| | | var httpClient = _clientFactory.CreateClient(); |
| | | httpClient.Timeout = new TimeSpan(0, 0, 60); |
| | | httpClient.Timeout = new TimeSpan(0, 0, 10); |
| | | var Result = await httpClient.GetAsync(getUrl); |
| | | result = Result.Content.ReadAsStringAsync().Result; |
| | | |
| | |
| | | httpContent.Headers.ContentType = new MediaTypeHeaderValue("application/json"); |
| | | |
| | | var httpClient2 = _clientFactory.CreateClient(); |
| | | httpClient2.Timeout = new TimeSpan(0, 0, 60); |
| | | httpClient2.Timeout = new TimeSpan(0, 0, 10); |
| | | var Result2 = await httpClient2.PostAsync(postUrl2, httpContent); |
| | | result2 = Result2.Content.ReadAsStringAsync().Result; |
| | | } |
| | |
| | | _logger.LogInformation("result2:" + result2); |
| | | |
| | | JObject jobjectresult2 = (JObject)JsonConvert.DeserializeObject(result2); |
| | | if (jobjectresult2["code"] == null && jobjectresult2["code"].ToString() != "1") |
| | | if (jobjectresult2["code"] == null || jobjectresult2["code"].ToString() != "1") |
| | | { |
| | | throw new Exception(jobjectresult2["msg"].ToString()); |
| | | } |
| | | |
| | | JObject jobjectkehu = (JObject)jobjectresult2["data"]; |
| | | if (jobjectkehu["Name"] == null || jobjectkehu["Name"].ToString() == "") |
| | | if (jobjectkehu == null || jobjectkehu["Name"] == null || jobjectkehu["Name"].ToString() == "") |
| | | { |
| | | throw new Exception("未找到对应的会员!"); |
| | | } |
| | |
| | | httpContent.Headers.ContentType = new MediaTypeHeaderValue("application/json"); |
| | | |
| | | var httpClient1 = _clientFactory.CreateClient(); |
| | | httpClient1.Timeout = new TimeSpan(0, 0, 60); |
| | | httpClient1.Timeout = new TimeSpan(0, 0, 10); |
| | | var Result1 = await httpClient1.PostAsync(postUrl, httpContent); |
| | | result1 = Result1.Content.ReadAsStringAsync().Result; |
| | | } |