From 836b306db8799e957ed9cff5144687a139b67f23 Mon Sep 17 00:00:00 2001
From: PC-201906131823\Administrator <zyyao>
Date: 星期二, 23 八月 2022 14:28:13 +0800
Subject: [PATCH] 提交修改角色
---
zhengcaioa/zhengcaioa/Timer/TimerGetShopUsersService.cs | 22 ++++++++++++++--------
1 files changed, 14 insertions(+), 8 deletions(-)
diff --git a/zhengcaioa/zhengcaioa/Timer/TimerGetShopUsersService.cs b/zhengcaioa/zhengcaioa/Timer/TimerGetShopUsersService.cs
index 3258c76..ae5d141 100644
--- a/zhengcaioa/zhengcaioa/Timer/TimerGetShopUsersService.cs
+++ b/zhengcaioa/zhengcaioa/Timer/TimerGetShopUsersService.cs
@@ -101,18 +101,24 @@
+ // new TransactionScope(TransactionScopeOption.Required,
+ // new TransactionOptions
+ // {
+ // IsolationLevel = IsolationLevel.ReadCommitted,
+ // Timeout = TransactionManager.MaximumTimeout
+ // }
+ //)
-
//using (TransactionScope scope = new TransactionScope())
//{
- //鑾峰彇鏈�鍚庢洿鏂版椂闂�
- DateTime start = DateTime.Now.AddYears(-10);
+ //鑾峰彇鏈�鍚庢洿鏂版椂闂�
+ DateTime start = DateTime.Now.AddYears(-10);
DateTime end = DateTime.Now;
var ssss = _liaotianService.GetSysUpdatetime("getCustomers");
@@ -132,7 +138,7 @@
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;
@@ -168,7 +174,7 @@
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;
}
@@ -176,13 +182,13 @@
_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("鏈壘鍒板搴旂殑浼氬憳锛�");
}
@@ -272,7 +278,7 @@
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;
}
--
Gitblit v1.9.1