Merge branch 'master' of http://121.41.2.71:3000/wyw/mh_jy_safe
This commit is contained in:
commit
564cf0dfc6
@ -3094,6 +3094,44 @@ namespace APT.SK.WebApi.Controllers.Api
|
||||
result.Add(refRecordLog);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
/// <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_SK_SECURITY_INSPECTION_NOTICE>();
|
||||
var notice = this.GetEntity<T_SK_SECURITY_INSPECTION_NOTICE>(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