feat 推送排班到sap
This commit is contained in:
@@ -142,8 +142,6 @@ public class WorkGridScheduleService : IWorkGridScheduleService
|
||||
await _dbContext.InsertAsync(toInserts);
|
||||
await _operateLog.LogAsync(OperateLogType.WorkGrid, $"新增网格({workGrid.Name}){request.Date.ToString("yyyy-M-d")}的{request.PeriodType.GetDescription()}人员:{request.UserCodes.Join(",")}");
|
||||
|
||||
if (workGrid.Code.ToString() == "4cc354b4-a727-4120-86b7-a160590bedb3")
|
||||
{
|
||||
//推送到SAP
|
||||
var items = toInserts.Select(x => new SyncWorkShiftDayItem
|
||||
{
|
||||
@@ -160,6 +158,7 @@ public class WorkGridScheduleService : IWorkGridScheduleService
|
||||
{
|
||||
throw new UserFriendlyException("JIP接口返回数据异常,请联系管理员");
|
||||
}
|
||||
|
||||
if (response.Items.Any(x => x.Result != "S"))
|
||||
{
|
||||
var errorMessages = response.Items.Where(x => x.Result != "S")
|
||||
@@ -178,7 +177,6 @@ public class WorkGridScheduleService : IWorkGridScheduleService
|
||||
.Where(x => x.PeriodType == workGridSchedule.PeriodType)
|
||||
.ExecuteCommandAsync();
|
||||
}
|
||||
}
|
||||
|
||||
//todo sub pub
|
||||
//推送排班通知
|
||||
@@ -244,8 +242,6 @@ public class WorkGridScheduleService : IWorkGridScheduleService
|
||||
.ToListAsync();
|
||||
|
||||
if (data.Any())
|
||||
{
|
||||
if (workGrid.Code.ToString() == "4cc354b4-a727-4120-86b7-a160590bedb3")
|
||||
{
|
||||
//推送到SAP
|
||||
var items = data.Select(x => new SyncWorkShiftDayItem
|
||||
@@ -263,6 +259,7 @@ public class WorkGridScheduleService : IWorkGridScheduleService
|
||||
{
|
||||
throw new UserFriendlyException("JIP接口返回数据异常,请联系管理员");
|
||||
}
|
||||
|
||||
if (response.Items.Any(x => x.Result != "S"))
|
||||
{
|
||||
var errorMessages = response.Items.Where(x => x.Result != "S")
|
||||
@@ -276,9 +273,6 @@ public class WorkGridScheduleService : IWorkGridScheduleService
|
||||
}
|
||||
|
||||
await _dbContext.UpdateAsync(data);
|
||||
}
|
||||
|
||||
|
||||
await _dbContext.DeleteAsync(data);
|
||||
await _operateLog.LogAsync(OperateLogType.WorkGrid, $"移除网格({workGrid.Name}){request.Date.ToString("yyyy-M-d")}的{request.PeriodType.GetDescription()}人员:{request.UserCodes.Join(",")}");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user