审批角色重复判断

This commit is contained in:
何美荣 2025-12-25 09:45:02 +08:00
parent 4304a7f6c0
commit 37ec22366e

View File

@ -49,9 +49,9 @@ namespace APT.PF.WebApi.Controllers.Api
} }
var orgId = APT.Infrastructure.Api.AppContext.CurrentSession.OrgId; var orgId = APT.Infrastructure.Api.AppContext.CurrentSession.OrgId;
//var roleCodes = this.GetEntities<T_PF_APPROVAL_ROLE>(t => true, new BaseFilter(orgId)).Select(x => x.NAME).ToList(); var roleCodes = this.GetEntities<T_PF_APPROVAL_ROLE>(t => !t.IS_DELETED, new BaseFilter(orgId)).Select(x => x.NAME).ToList();
//if (roleCodes.Contains(entity.NAME)) if (roleCodes.Contains(entity.NAME))
// throw new Exception("系统已存在审批角色编码为" + entity.NAME + "的数据,请勿重复!"); throw new Exception("系统已存在审批角色为" + entity.NAME + "的数据,请勿重复!");
var departs = entity.Nav_ApproveDeparts; var departs = entity.Nav_ApproveDeparts;
entity.Nav_ApproveDeparts = null; entity.Nav_ApproveDeparts = null;
if (departs != null && departs.Any()) if (departs != null && departs.Any())