add log
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System.Net.Http.Headers;
|
||||
using System.Net;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Text;
|
||||
using Dlhis.Entity.Basic.Entity;
|
||||
using Dlhis.ScheduledTask.Common.Dto;
|
||||
@@ -90,8 +91,12 @@ public class JinkoSapService : IJinkoSapService
|
||||
|
||||
var content = new StringContent(JsonConvert.SerializeObject(body), Encoding.UTF8, "application/json");
|
||||
var response = await GetHttpClient().PostAsync(apiUrl, content);
|
||||
response.EnsureSuccessStatusCode();
|
||||
_logger.LogInformation("成功获取{Werk}人事范围数据", werk);
|
||||
if (response.StatusCode != HttpStatusCode.OK)
|
||||
{
|
||||
_logger.LogError("获取{Werk}人事范围数据异常:{error}", werk, await response.Content.ReadAsStringAsync());
|
||||
response.EnsureSuccessStatusCode();
|
||||
}
|
||||
|
||||
var jsonResponse = await response.Content.ReadAsStringAsync();
|
||||
|
||||
var personResp = JsonConvert.DeserializeObject<SapPersonResponse>(jsonResponse);
|
||||
|
||||
Reference in New Issue
Block a user