diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OrganizationModule/Controllers/PostController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OrganizationModule/Controllers/PostController.cs index 840e39df2..59101844a 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OrganizationModule/Controllers/PostController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OrganizationModule/Controllers/PostController.cs @@ -133,10 +133,15 @@ namespace Learun.Application.Web.Areas.LR_OrganizationModule.Controllers public ActionResult SaveForm(string keyValue, PostEntity entity) { var list = postIBLL.GetList(entity.F_CompanyId); - if (list.Any(a => a.F_EnCode == entity.F_EnCode)) + if (string.IsNullOrEmpty(keyValue) && list.Any(a => a.F_EnCode == entity.F_EnCode)) { - return Fail("岗位编号重复"); + return Fail("岗位编号重复!"); } + else if (!string.IsNullOrEmpty(keyValue) && list.Any(a => a.F_EnCode == entity.F_EnCode && a.F_PostId != keyValue)) + { + return Fail("岗位编号重复!"); + } + postIBLL.SaveEntity(keyValue, entity); return Success("保存成功!"); }