Quellcode durchsuchen

app2.0获取校内通知

临城职教中职
ndbs vor 2 Jahren
Ursprung
Commit
f61ad81a76
4 geänderte Dateien mit 88 neuen und 2 gelöschten Zeilen
  1. +20
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Organization/Post/PostBLL.cs
  2. +3
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Organization/Post/PostIBLL.cs
  3. +28
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Organization/Post/PostService.cs
  4. +37
    -2
      Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/NewsApi.cs

+ 20
- 0
Learun.Framework.Ultimate V7/Learun.Application.Organization/Post/PostBLL.cs Datei anzeigen

@@ -3,6 +3,8 @@ using Learun.Cache.Factory;
using Learun.Util;
using System;
using System.Collections.Generic;
using System.Linq;

namespace Learun.Application.Organization
{
/// <summary>
@@ -515,6 +517,24 @@ namespace Learun.Application.Organization
return res;
}

public List<PostEntity> GetAllList()
{
try
{
return postService.GetAllList().ToList();
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}
#endregion
}
}

+ 3
- 0
Learun.Framework.Ultimate V7/Learun.Application.Organization/Post/PostIBLL.cs Datei anzeigen

@@ -94,5 +94,8 @@ namespace Learun.Application.Organization
/// <param name="level">级数</param>
/// <returns></returns>
List<string> GetDownIdList(string strPostIds, int level);

List<PostEntity> GetAllList();

}
}

+ 28
- 0
Learun.Framework.Ultimate V7/Learun.Application.Organization/Post/PostService.cs Datei anzeigen

@@ -235,5 +235,33 @@ namespace Learun.Application.Organization
}
}
}


/// <summary>
/// 获取部门列表信息(根据公司Id)
/// </summary>
/// <returns></returns>
public IEnumerable<PostEntity> 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<PostEntity>(strSql.ToString());
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}
}
}

+ 37
- 2
Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/NewsApi.cs Datei anzeigen

@@ -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<NewsEntity>();

foreach (var newsitemEntity in newsList)
@@ -95,6 +98,38 @@ namespace Learun.Application.WebApi.Modules
{
NoticeEntity parameter = this.GetReqData<NoticeEntity>();
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

}


Laden…
Abbrechen
Speichern