Commit 4d46c2e0 authored by 黄奎's avatar 黄奎

页面修改

parent 10b09886
......@@ -4,6 +4,9 @@ using Edu.Repository.Log;
using System;
using System.Collections.Generic;
using System.Text;
using System.Linq;
using Edu.Repository.User;
using Edu.Model.ViewModel.User;
namespace Edu.Module.Log
{
......@@ -14,14 +17,56 @@ namespace Edu.Module.Log
/// </summary>
private readonly RB_User_ChangeLogRepository changeLogRepository = new RB_User_ChangeLogRepository();
/// <summary>
/// 账号仓储层对象
/// </summary>
private readonly RB_AccountRepository accountRepository = new RB_AccountRepository();
/// <summary>
/// 获取用户信息改变日志列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_User_ChangeLog_ViewModel> GetUserChangeLogListModule(RB_User_ChangeLog_ViewModel query)
public object GetUserChangeLogListModule(RB_User_ChangeLog_ViewModel query)
{
return changeLogRepository.GetUserChangeLogListRepository(query);
List<object> list = new List<object>();
var logList= changeLogRepository.GetUserChangeLogListRepository(query);
if (logList != null && logList.Count > 0)
{
var empList = new List<Employee_ViewModel>();
string uids = string.Join(",", logList.Select(qitem => qitem.CreateBy));
if (!string.IsNullOrEmpty(uids))
{
empList= accountRepository.GetEmployeeListRepository(new Model.ViewModel.User.Employee_ViewModel()
{
QIds = uids
});
}
var dayList = logList.GroupBy(qitem => new { NewTime = Common.ConvertHelper.FormatDate(qitem.CreateTime) }).OrderByDescending(qitem => qitem.Key.NewTime).Select(qitem => new { qitem.Key.NewTime });
if (dayList != null && dayList.Count() > 0)
{
foreach (var item in dayList)
{
var subList = logList.Where(qitem => Common.ConvertHelper.FormatDate(qitem.CreateTime) == item.NewTime).ToList();
if (subList != null && subList.Count > 0)
{
list.Add(new
{
item.NewTime,
WeekStr = Common.ConvertHelper.GetWeekDay(Convert.ToDateTime(item.NewTime)),
LogList = subList.Select(qitem => new
{
TimeStr = Common.ConvertHelper.FormatTimeStr(qitem.CreateTime),
UserIcon = empList?.Where(eItem=> eItem.Id==qitem.CreateBy)?.FirstOrDefault()?.UserIcon??"",
CreateName = empList?.Where(eItem => eItem.Id == qitem.CreateBy)?.FirstOrDefault()?.EmployeeName ?? "",
qitem.LogContent
})
});
}
}
}
}
return list;
}
/// <summary>
......@@ -33,6 +78,7 @@ namespace Edu.Module.Log
{
return changeLogRepository.Insert(extModel) > 0;
}
/// <summary>
/// 获取日志列表
/// </summary>
......
......@@ -51,6 +51,7 @@ WHERE 1=1
builder.AppendFormat($" AND {nameof(RB_User_ChangeLog_ViewModel.SourceId)}={query.SourceId} ");
}
}
builder.Append(" ORDER BY CreateTime DESC ");
return Get<RB_User_ChangeLog_ViewModel>(builder.ToString()).ToList();
}
......
......@@ -376,11 +376,6 @@ FROM
return model;
}
/// <summary>
/// 获取账号列表(批量修改密码专用)
/// </summary>
......
......@@ -6,6 +6,7 @@ using Edu.Cache.User;
using Edu.Common.API;
using Edu.Common.Enum.User;
using Edu.Common.Plugin;
using Edu.Model.ViewModel.Log;
using Edu.Model.ViewModel.User;
using Edu.Module.Log;
using Edu.Module.User;
......@@ -842,7 +843,7 @@ namespace Edu.WebApi.Controllers.User
EducationStr = (extModel?.Education ?? 0).ToName(),
EmployeeName = extModel?.EmployeeName ?? "",
EmployeeTel = extModel?.EmployeeTel ?? "",
EntryTime = extModel?.EntryTime,
EntryTime =Common.ConvertHelper.FormatDate((extModel?.EntryTime)),
GroupName = extModel?.GroupName ?? "",
Group_Id = extModel?.Group_Id ?? 0,
IDCard = extModel?.IDCard ?? "",
......@@ -1341,5 +1342,25 @@ namespace Edu.WebApi.Controllers.User
return ApiResult.Success(data: list);
}
#endregion
#region 获取用户修改日志
/// <summary>
/// 获取岗位列表
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetEmpChangeLog()
{
var query = new RB_User_ChangeLog_ViewModel()
{
AccountType = (AccountTypeEnum)base.ParmJObj.GetInt("AccountType"),
SourceId = base.ParmJObj.GetInt("AccountId"),
};
query.Group_Id = base.UserInfo.Group_Id;
var list = userChangeLogModule.GetUserChangeLogListModule(query);
return ApiResult.Success(data: list);
}
#endregion
}
}
\ No newline at end of file
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