fix 控制网格推送处理
This commit is contained in:
@@ -142,6 +142,8 @@ 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
|
||||
{
|
||||
@@ -177,6 +179,9 @@ public class WorkGridScheduleService : IWorkGridScheduleService
|
||||
.Where(x => x.PeriodType == workGridSchedule.PeriodType)
|
||||
.ExecuteCommandAsync();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//todo sub pub
|
||||
//推送排班通知
|
||||
@@ -242,6 +247,8 @@ 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
|
||||
@@ -271,8 +278,9 @@ public class WorkGridScheduleService : IWorkGridScheduleService
|
||||
{
|
||||
workGridSchedule.SyncResult = response.Items.FirstOrDefault(x => x.UserCode == workGridSchedule.UserCode)?.Message;
|
||||
}
|
||||
|
||||
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