重新排班时删除旧数据
This commit is contained in:
parent
76efd0535e
commit
0097618f5f
@ -225,9 +225,18 @@ namespace APT.PP.WebApi.Controllers
|
||||
|
||||
}
|
||||
}
|
||||
//判断开始时间=当前时间的,为重新排班,删除该班组已有的排班
|
||||
var deleteConfigs = configData.Where(t => t.START_TIME.Date == t.CURR_TIME.Date && t.CURR_TIME.Date == DateTime.Now.Date).ToList();
|
||||
var deleteTeamIds = deleteConfigs.SelectMany(i => i.Nav_DepartmentCalendarConfigTeam).Select(i => i.TEAM_ID).ToArray();
|
||||
var deleteShiftDataIds = this.GetEntities<T_FM_DEPARTMENT_SCHEDULING>(s => s.DATE_TIME.Date >= DateTime.Now.Date && deleteTeamIds.Contains(s.TEAM_ID), new BaseFilter(filter.OrgId)).Select(m=>m.ID).ToList();
|
||||
var deleteShiftPersonIds = this.GetEntities<T_FM_DEPARTMENT_SCHEDULING_DETAIL>(s => deleteShiftDataIds.Contains(s.DEPARTMENT_SCHEDULING_ID), new BaseFilter(filter.OrgId)).Select(m => m.ID).ToList();
|
||||
//统一提交数据
|
||||
this.UnifiedCommit(() =>
|
||||
{
|
||||
{
|
||||
if (deleteShiftPersonIds != null && deleteShiftPersonIds.Any())
|
||||
this.BantchDeleteEntityNoCommit<T_FM_DEPARTMENT_SCHEDULING_DETAIL>(deleteShiftPersonIds);
|
||||
if (deleteShiftDataIds != null && deleteShiftDataIds.Any())
|
||||
this.BantchDeleteEntityNoCommit<T_FM_DEPARTMENT_SCHEDULING>(deleteShiftDataIds);
|
||||
if (shiftList.Any())
|
||||
this.BantchAddEntityNoCommit(shiftList);
|
||||
if (shiftDetailList.Any())
|
||||
|
||||
Loading…
Reference in New Issue
Block a user