From f61ad81a76c4f68e1ba2c625b0b78c273d4a0546 Mon Sep 17 00:00:00 2001 From: ndbs Date: Wed, 24 Aug 2022 17:16:12 +0800 Subject: [PATCH] =?UTF-8?q?app2.0=E8=8E=B7=E5=8F=96=E6=A0=A1=E5=86=85?= =?UTF-8?q?=E9=80=9A=E7=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Post/PostBLL.cs | 20 ++++++++++ .../Post/PostIBLL.cs | 3 ++ .../Post/PostService.cs | 28 +++++++++++++ .../Modules/NewsApi.cs | 39 ++++++++++++++++++- 4 files changed, 88 insertions(+), 2 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Organization/Post/PostBLL.cs b/Learun.Framework.Ultimate V7/Learun.Application.Organization/Post/PostBLL.cs index aaa9ee915..a7150a410 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Organization/Post/PostBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Organization/Post/PostBLL.cs @@ -3,6 +3,8 @@ using Learun.Cache.Factory; using Learun.Util; using System; using System.Collections.Generic; +using System.Linq; + namespace Learun.Application.Organization { /// @@ -515,6 +517,24 @@ namespace Learun.Application.Organization return res; } + public List GetAllList() + { + try + { + return postService.GetAllList().ToList(); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } #endregion } } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Organization/Post/PostIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Application.Organization/Post/PostIBLL.cs index 84f4ffa02..306e04593 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Organization/Post/PostIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Organization/Post/PostIBLL.cs @@ -94,5 +94,8 @@ namespace Learun.Application.Organization /// 级数 /// List GetDownIdList(string strPostIds, int level); + + List GetAllList(); + } } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Organization/Post/PostService.cs b/Learun.Framework.Ultimate V7/Learun.Application.Organization/Post/PostService.cs index 2b35797b9..4ae6a033d 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Organization/Post/PostService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Organization/Post/PostService.cs @@ -235,5 +235,33 @@ namespace Learun.Application.Organization } } } + + + /// + /// 获取部门列表信息(根据公司Id) + /// + /// + public IEnumerable GetAllList() + { + try + { + var strSql = new StringBuilder(); + strSql.Append("SELECT "); + strSql.Append(fieldSql); + strSql.Append(" FROM LR_BASE_POST t WHERE t.F_DeleteMark = 0 "); + return this.BaseRepository().FindList(strSql.ToString()); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } } } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/NewsApi.cs b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/NewsApi.cs index 41a74b72c..ccf065c4c 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/NewsApi.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/NewsApi.cs @@ -8,6 +8,7 @@ using Learun.Application.TwoDevelopment.LR_Desktop; using System.Text; using System.Data; using Learun.Application.OA; +using Learun.Application.Organization; namespace Learun.Application.WebApi.Modules { @@ -15,6 +16,8 @@ namespace Learun.Application.WebApi.Modules public class NewsApi : BaseApi { private NoticeIBLL noticeIBLL = new NoticeBLL(); + private DepartmentIBLL departmentIBLL = new DepartmentBLL(); + private PostIBLL postIBLL = new PostBLL(); public NewsApi() : base("/learun/news") @@ -33,7 +36,7 @@ namespace Learun.Application.WebApi.Modules { var userinfo = LoginUserInfo.Get(); Pagination paginationobj = new Pagination(); - var newsList = noticeIBLL.GetList("", userinfo.userId,(Request.Query["F_CategoryId"]!=null?Request.Query["F_CategoryId"].ToString():"")); + var newsList = noticeIBLL.GetList("", userinfo.userId, (Request.Query["F_CategoryId"] != null ? Request.Query["F_CategoryId"].ToString() : "")); var newsListOfSelf = new List(); foreach (var newsitemEntity in newsList) @@ -95,6 +98,38 @@ namespace Learun.Application.WebApi.Modules { NoticeEntity parameter = this.GetReqData(); var shlist = noticeIBLL.GetEntityByProcessId(parameter.ProgressId); + //if (!shlist.F_SendDeptId.IsEmpty()) + //{ + var Array = shlist.F_SendPostId.Split(','); + var deept = departmentIBLL.GetAllList(); + foreach (var item in Array) + { + for (int i = 0; i < deept.Count; i++) + { + if (item == deept[i].F_CompanyId) + { + shlist.F_SendDeptId += deept[i].F_FullName + ","; + } + } + } + shlist.F_SendDeptId.Trim(','); + //} + //if (!shlist.F_SendDeptId.IsEmpty()) + //{ + var Array1 = shlist.F_SendPostId.Split(','); + var post = postIBLL.GetAllList(); + foreach (var item in Array1) + { + for (int i = 0; i < post.Count; i++) + { + if (item == post[i].F_CompanyId) + { + shlist.F_SendDeptId += post[i].F_Name + ","; + } + } + } + shlist.F_SendDeptId.Trim(','); + //} return Success(shlist); } #region 私有类 @@ -102,7 +137,7 @@ namespace Learun.Application.WebApi.Modules private class NoticeEntity { public string ProgressId { get; set; } - } + } #endregion }