test 增加错误提醒返回
This commit is contained in:
@@ -155,6 +155,11 @@ public class WorkGridScheduleService : IWorkGridScheduleService
|
|||||||
}).ToList();
|
}).ToList();
|
||||||
|
|
||||||
var response = await _jinkoJipApi.SyncWorkShiftAsync(new SyncWorkShiftRequest { Items = items });
|
var response = await _jinkoJipApi.SyncWorkShiftAsync(new SyncWorkShiftRequest { Items = items });
|
||||||
|
response.Message.IsPresent().ThrowIfTrue("JIP接口返回错误:" + response.Message);
|
||||||
|
if (response == null || response.Items == null || response.Items.Count == 0)
|
||||||
|
{
|
||||||
|
throw new UserFriendlyException("JIP接口返回数据异常,请联系管理员");
|
||||||
|
}
|
||||||
if (response.Items.Any(x => x.Result != "S"))
|
if (response.Items.Any(x => x.Result != "S"))
|
||||||
{
|
{
|
||||||
var errorMessages = response.Items.Where(x => x.Result != "S")
|
var errorMessages = response.Items.Where(x => x.Result != "S")
|
||||||
@@ -253,6 +258,11 @@ public class WorkGridScheduleService : IWorkGridScheduleService
|
|||||||
}).ToList();
|
}).ToList();
|
||||||
|
|
||||||
var response = await _jinkoJipApi.SyncWorkShiftAsync(new SyncWorkShiftRequest { Items = items });
|
var response = await _jinkoJipApi.SyncWorkShiftAsync(new SyncWorkShiftRequest { Items = items });
|
||||||
|
response.Message.IsPresent().ThrowIfTrue("JIP接口返回错误:" + response.Message);
|
||||||
|
if (response == null || response.Items == null || response.Items.Count == 0)
|
||||||
|
{
|
||||||
|
throw new UserFriendlyException("JIP接口返回数据异常,请联系管理员");
|
||||||
|
}
|
||||||
if (response.Items.Any(x => x.Result != "S"))
|
if (response.Items.Any(x => x.Result != "S"))
|
||||||
{
|
{
|
||||||
var errorMessages = response.Items.Where(x => x.Result != "S")
|
var errorMessages = response.Items.Where(x => x.Result != "S")
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ public class SyncWorkShiftResponse
|
|||||||
{
|
{
|
||||||
[JsonProperty("OT_2003")]
|
[JsonProperty("OT_2003")]
|
||||||
public List<SyncWorkShiftItem> Items { get; set; }
|
public List<SyncWorkShiftItem> Items { get; set; }
|
||||||
|
|
||||||
|
public string Message { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class SyncWorkShiftItem
|
public class SyncWorkShiftItem
|
||||||
|
|||||||
Reference in New Issue
Block a user