Merge branch 'master' of http://121.41.2.71:3000/wyw/mh_jy_safe
This commit is contained in:
commit
ea38e9656c
@ -6,6 +6,7 @@ using APT.BaseData.Domain.IServices.FM;
|
||||
using APT.BaseData.Services.Services.FM;
|
||||
using APT.Infrastructure.Core;
|
||||
using APT.MS.Domain.Entities.FO;
|
||||
using APT.MS.Domain.Entities.SK;
|
||||
using APT.MS.Domain.Enums;
|
||||
using APT.Utility;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
@ -280,6 +281,45 @@ namespace APT.FO.WebApi.Controllers.Api.FO
|
||||
result.Data = null;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除数据
|
||||
/// </summary>
|
||||
/// <param name="id">主键ID</param>
|
||||
/// <returns></returns>
|
||||
[HttpGet, Route("FullDelete")]
|
||||
public JsonActionResult<bool> FullDelete(string id)
|
||||
{
|
||||
return SafeExecute(() =>
|
||||
{
|
||||
if (string.IsNullOrEmpty(id))
|
||||
this.ThrowError("060010");
|
||||
var approves = new List<T_PF_APPROVE>();
|
||||
var tasks = new List<T_FM_NOTIFICATION_TASK>();
|
||||
var notices = new List<T_FO_TEAM_ACTIVITY>();
|
||||
var notice = this.GetEntity<T_FO_TEAM_ACTIVITY>(id);
|
||||
if (notice != null)
|
||||
{
|
||||
notice.IS_DELETED = true;
|
||||
notices.Add(notice);
|
||||
approves = this.GetEntities<T_PF_APPROVE>(t => t.DATA_ID != null && t.DATA_ID == notice.ID, new BaseFilter(notice.ORG_ID)).ToList();
|
||||
approves.ForEach(t => t.IS_DELETED = true);
|
||||
var approveIds = approves.Select(t => t.ID).ToList();
|
||||
tasks = this.GetEntities<T_FM_NOTIFICATION_TASK>(t => t.SOURCE_DATA_ID != null && (t.SOURCE_DATA_ID == notice.ID || approveIds.Contains((Guid)t.SOURCE_DATA_ID)), new BaseFilter(notice.ORG_ID)).ToList();
|
||||
tasks.ForEach(t => t.IS_DELETED = true);
|
||||
}
|
||||
UnifiedCommit(() =>
|
||||
{
|
||||
if (notices != null && notices.Any())
|
||||
this.BantchUpdateEntity_noneBase(notices);
|
||||
if (approves != null && approves.Any())
|
||||
this.BantchUpdateEntity_noneBase(approves);
|
||||
if (tasks != null && tasks.Any())
|
||||
this.BantchUpdateEntity_noneBase(tasks);
|
||||
});
|
||||
return true;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user