Commit a97122ca authored by 黄奎's avatar 黄奎

页面修改

parent 0bf269eb
......@@ -44,6 +44,11 @@ namespace Edu.WebApi.Controllers.User
/// </summary>
public readonly AttendanceRecodModule attendRecodeModule = new AttendanceRecodModule();
/// <summary>
/// 部门处理类对象
/// </summary>
private readonly DepartmentModule departmentModule = new DepartmentModule();
#region 字典管理
/// <summary>
......@@ -314,22 +319,75 @@ namespace Edu.WebApi.Controllers.User
query.Group_Id = base.UserInfo.Group_Id;
query.DeptId = base.UserInfo.DeptId;
var list = noticeModule.GetMyNoticePageList(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query);
pageModel.Count = rowsCount;
pageModel.PageData = list.Select(x => new
List<object> result = new List<object>();
foreach (var item in list)
{
x.Id,
x.From,
x.Number,
x.Title,
x.NoticeState,
NoticeStateName = x.NoticeState.ToName(),
x.Is_Top,
x.ReadNum,
x.UpdateBy,
UpdateByName = UserReidsCache.GetUserLoginInfo(x.UpdateBy)?.AccountName ?? "",
UpdateTime = x.UpdateTime.HasValue ? x.UpdateTime.Value.ToString("yyyy-MM-dd HH:mm:ss") : "",
UpdateTimeStr = Common.ConvertHelper.FormatDate(x.UpdateTime)
});
var fileList = new List<FileModel>();
if (!string.IsNullOrEmpty(item.File))
{
try
{
fileList= Common.Plugin.JsonHelper.DeserializeObject<List<FileModel>>(item.File);
}
catch (Exception ex)
{
Common.Plugin.LogHelper.Write(ex, "GetMyNoticePageList_Item");
}
}
List<string> ccList = new List<string>();
if (!string.IsNullOrEmpty(item.CopyPeople))
{
var peopleList = Common.ConvertHelper.StringToList(item.CopyPeople);
foreach (var sItem in peopleList)
{
string aName = UserReidsCache.GetUserLoginInfo(sItem)?.AccountName ?? "";
if (!string.IsNullOrEmpty(aName))
{
ccList.Add(aName);
}
}
}
List<string> toList = new List<string>();
if (!string.IsNullOrEmpty(item.To))
{
var deptList = Common.ConvertHelper.StringToList(item.To);
if (deptList != null && deptList.Count > 0)
{
var departMentList = departmentModule.GetDepartmentListModule(new RB_Department_ViewModel() { QDeptIds = string.Join(",", deptList) });
foreach (var dItem in departMentList)
{
toList.Add(dItem.DeptName);
}
}
}
if (toList != null && toList.Count == 0)
{
toList.Add("全公司");
}
var obj = new
{
item.Id,
item.From,
item.Number,
item.Title,
item.NoticeState,
NoticeStateName = item.NoticeState.ToName(),
item.Is_Top,
item.ReadNum,
item.UpdateBy,
UpdateByName = UserReidsCache.GetUserLoginInfo(item.UpdateBy)?.AccountName ?? "",
UpdateTime =Common.ConvertHelper.FormatDate2(item.UpdateTime),
UpdateTimeStr = Common.ConvertHelper.FormatDate(item.UpdateTime),
item.Content,
fileList,
ccList,
toList
};
result.Add(obj);
}
pageModel.Count = rowsCount;
pageModel.PageData = result;
return ApiResult.Success("", pageModel);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment