Commit 02bda292 authored by 黄奎's avatar 黄奎

新增头像

parent e4105f28
......@@ -136,5 +136,27 @@ namespace Edu.Common
}
return timeStr;
}
/// <summary>
/// 格式化时间【yyyy-MM-dd HH:mm:ss】
/// </summary>
/// <param name="time"></param>
/// <returns></returns>
public static string FormatDate(object time)
{
string timeStr = "";
if (time != null)
{
try
{
timeStr = Convert.ToDateTime(time.ToString()).ToString("yyyy-MM-dd");
}
catch
{
}
}
return timeStr;
}
}
}
\ No newline at end of file
......@@ -48,5 +48,15 @@ namespace Edu.Model.CacheModel
/// 菜单列表
/// </summary>
public object MenuList { get; set; }
/// <summary>
/// 集团Logo
/// </summary>
public string GroupLogo { get; set; }
/// <summary>
/// 用户头像
/// </summary>
public string UserIcon { get; set; }
}
}
......@@ -24,5 +24,15 @@ namespace Edu.Model.ViewModel.User
/// 学校名称
/// </summary>
public string SchoolName { get; set; }
/// <summary>
/// 集团Logo
/// </summary>
public string GroupLogo { get; set; }
/// <summary>
/// 用户头像
/// </summary>
public string UserIcon { get; set; }
}
}
\ No newline at end of file
......@@ -10,10 +10,39 @@ namespace Edu.Model.ViewModel.User
[Serializable]
public class RB_Group_ViewModel : Model.Entity.User.RB_Group
{
public string CreateTimeStr { get {
return "";
} }
/// <summary>
/// 创建人
/// </summary>
public string CreateByName { get; set; }
public string UpdateTimeStr { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public string CreateTimeStr
{
get
{
return Common.ConvertHelper.FormatTime(this.CreateTime);
}
}
/// <summary>
/// 修改人
/// </summary>
public string UpdateByName
{
get; set;
}
/// <summary>
/// 更新时间
/// </summary>
public string UpdateTimeStr
{
get
{
return Common.ConvertHelper.FormatTime(this.UpdateTime);
}
}
}
}
......@@ -19,5 +19,25 @@ namespace Edu.Model.ViewModel.User
/// 学校名称
/// </summary>
public string SName { get; set; }
/// <summary>
/// 创建人
/// </summary>
public string CreateByName { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public string CreateTimeStr { get { return Common.ConvertHelper.FormatTime(this.CreateTime); } }
/// <summary>
/// 修改人
/// </summary>
public string UpdateByName { get; set; }
/// <summary>
/// 修改时间
/// </summary>
public string UpdateTimeStr { get { return Common.ConvertHelper.FormatTime(this.UpdateTime); } }
}
}
\ No newline at end of file
......@@ -126,22 +126,22 @@ WHERE 1=1
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.*,IFNULL(G.GroupName,'') AS GroupName,IFNULL(s.SName,'') AS SchoolName
SELECT A.*,IFNULL(G.GroupName,'') AS GroupName,IFNULL(s.SName,'') AS SchoolName,IFNULL(G.Logo,'') AS GroupLogo
FROM
(
SELECT A.*,IFNULL(B.MName,'') AS AccountName
SELECT A.*,IFNULL(B.MName,'') AS AccountName,B.MHead AS UserIcon
FROM rb_account AS A INNER JOIN rb_manager AS B ON A.AccountId=B.MId AND A.AccountType=1
WHERE 1=1 {0}
WHERE 1=1 {0}
UNION ALL
SELECT A.*,IFNULL(B.TeacherName,'') AS AccountName
SELECT A.*,IFNULL(B.TeacherName,'') AS AccountName,B.TeacherIcon AS UserIcon
FROM rb_account AS A INNER JOIN rb_teacher AS B ON A.AccountId=B.TId AND A.AccountType=2
WHERE 1=1 {0}
UNION ALL
SELECT A.*,IFNULL(B.AssistName,'') AS AccountName
SELECT A.*,IFNULL(B.AssistName,'') AS AccountName,B.AssistIcon AS UserIcon
FROM rb_account AS A INNER JOIN rb_assist AS B ON A.AccountId=B.AId AND A.AccountType=3
WHERE 1=1 {0}
WHERE 1=1 {0}
UNION ALL
SELECT A.*,IFNULL(B.StuName,'') AS AccountName
SELECT A.*,IFNULL(B.StuName,'') AS AccountName,B.StuIcon AS UserIcon
FROM rb_account AS A INNER JOIN rb_student AS B ON A.AccountId=B.StuId AND A.AccountType=4
WHERE 1=1 {0}
) AS A LEFT JOIN rb_group AS g ON A.Group_Id=g.GId
......
......@@ -83,7 +83,9 @@ namespace Edu.WebApi.Controllers.User
GroupName = model.GroupName,
SchoolName = model.SchoolName,
Token = token,
MenuList= treeList
MenuList= treeList,
GroupLogo=model.GroupLogo,
UserIcon=model.UserIcon,
};
UserReidsCache.UserInfoSet(Cache.CacheKey.User_Login_Key + model.Id, obj, Common.Config.JwtExpirTime);
return ApiResult.Success(data: obj);
......
......@@ -77,6 +77,17 @@ namespace Edu.WebApi.Controllers.User
var pageModel = Common.Plugin.JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString());
var query = Common.Plugin.JsonHelper.DeserializeObject<RB_Group_ViewModel>(RequestParm.Msg.ToString());
var list = groupModule.GetGroupPageListModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query);
foreach (var item in list)
{
if (item.CreateBy > 0)
{
item.CreateByName = UserReidsCache.GetUserLoginInfo(item.CreateBy)?.AccountName ?? "";
}
if (item.UpdateBy > 0)
{
item.UpdateByName = UserReidsCache.GetUserLoginInfo(item.UpdateBy)?.AccountName ?? "";
}
}
pageModel.Count = rowsCount;
pageModel.PageData = list;
return ApiResult.Success(data: list);
......@@ -95,7 +106,7 @@ namespace Edu.WebApi.Controllers.User
extModel.UpdateBy = base.UserInfo.Id;
extModel.UpdateTime = DateTime.Now;
bool flag = groupModule.SetGroupModule(extModel);
return flag ? ApiResult.Success() : ApiResult.Failed();
return flag ? ApiResult.Success(data: extModel) : ApiResult.Failed();
}
/// <summary>
......@@ -221,6 +232,17 @@ namespace Edu.WebApi.Controllers.User
query.Group_Id = base.UserInfo.Group_Id;
query.School_Id = base.UserInfo.School_Id;
var list = teacherModule.GetTeacherPageListModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query);
foreach (var item in list)
{
if (item.CreateBy > 0)
{
item.CreateByName = UserReidsCache.GetUserLoginInfo(item.CreateBy)?.AccountName ?? "";
}
if (item.UpdateBy > 0)
{
item.UpdateByName = UserReidsCache.GetUserLoginInfo(item.UpdateBy)?.AccountName ?? "";
}
}
pageModel.Count = rowsCount;
pageModel.PageData = list;
return ApiResult.Success(data: list);
......
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