From 11387ac3c418d352c84b6221880c0bf642b8e604 Mon Sep 17 00:00:00 2001 From: ndbs Date: Mon, 3 Jun 2024 09:12:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=A1=E5=8C=BA=E7=AE=A1=E7=90=86=E4=B8=8A?= =?UTF-8?q?=E7=BA=A7=E4=B8=8D=E5=85=81=E8=AE=B8=E9=80=89=E8=87=AA=E5=B7=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Company/CompanyService.cs | 3 ++- .../Controllers/CompanyController.cs | 17 +++++++++++++++-- .../Views/Company/Form.cshtml | 10 +++++----- 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Organization/Company/CompanyService.cs b/Learun.Framework.Ultimate V7/Learun.Application.Organization/Company/CompanyService.cs index ac26c1139..0ca9a1926 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Organization/Company/CompanyService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Organization/Company/CompanyService.cs @@ -53,7 +53,8 @@ namespace Learun.Application.Organization t.F_Photo, t.F_BriefIntroduction, t.F_EnrollmentInformation, - t.F_ModifyUserName + t.F_ModifyUserName, + T.F_USCreditCode "; } #endregion diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OrganizationModule/Controllers/CompanyController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OrganizationModule/Controllers/CompanyController.cs index 045da684c..6475a40f4 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OrganizationModule/Controllers/CompanyController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OrganizationModule/Controllers/CompanyController.cs @@ -131,6 +131,11 @@ namespace Learun.Application.Web.Areas.LR_OrganizationModule.Controllers list = list.Where(m => m.F_CompanyId != keyValue).ToList(); } + if (keyValue == entity.F_ParentId) + { + return Fail("操作失败,当前项不允许"); + } + if (list.Any(a => a.F_FullName == entity.F_FullName)) { return Fail("学校名称重复"); @@ -157,8 +162,16 @@ namespace Learun.Application.Web.Areas.LR_OrganizationModule.Controllers [AjaxOnly] public ActionResult DeleteForm(string keyValue) { - companyIBLL.VirtualDelete(keyValue); - return Success("删除成功!", "公司信息", OperationType.Delete, keyValue, ""); + var list = companyIBLL.GetList().Where(x => x.F_ParentId == keyValue && x.F_EnabledMark == 1 && x.F_DeleteMark == 0); + if (list.Count() > 0) + { + return Fail("删除失败!拥有下辖项不可直接删除"); + } + else + { + companyIBLL.VirtualDelete(keyValue); + return Success("删除成功!", "公司信息", OperationType.Delete, keyValue, ""); + } } #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OrganizationModule/Views/Company/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OrganizationModule/Views/Company/Form.cshtml index 6a78c3355..877361cf1 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OrganizationModule/Views/Company/Form.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OrganizationModule/Views/Company/Form.cshtml @@ -20,12 +20,12 @@
-
统一社会信用代码*
+
统一信用代码*
-
-
成立时间
- +
+
成立时间*
+
负责人
@@ -40,7 +40,7 @@
电子邮箱
-
+
照片