Commit 35f4257a authored by 黄奎's avatar 黄奎

新增字段

parent d6a5a9c0
......@@ -87,5 +87,16 @@ namespace Edu.Model.Entity.User
/// 集团编号
/// </summary>
public int Group_Id { get; set; }
/// <summary>
/// 部门编号
/// </summary>
public int Dept_Id { get; set; }
/// <summary>
/// 岗位编号
/// </summary>
public int Post_Id { get; set; }
}
}
\ No newline at end of file
......@@ -11,7 +11,7 @@
public string NameStr { get; set; }
/// <summary>
/// 多个编号【逗号分割】
/// 多个编号【逗号分割】
/// </summary>
public string Ids { get; set; }
}
......
......@@ -64,5 +64,15 @@ namespace Edu.Model.ViewModel.User
/// 助教登录账号
/// </summary>
public string AssistAccount { get; set; }
/// <summary>
/// 部门名称
/// </summary>
public string DeptName { get; set; }
/// <summary>
/// 岗位名称
/// </summary>
public string PostName { get; set; }
}
}
\ No newline at end of file
......@@ -49,5 +49,15 @@ namespace Edu.Model.ViewModel.User
/// 管理者账号
/// </summary>
public string ManagerAccount { get; set; }
/// <summary>
/// 部门名称
/// </summary>
public string DeptName { get; set; }
/// <summary>
/// 岗位名称
/// </summary>
public string PostName { get; set; }
}
}
......@@ -45,5 +45,10 @@ namespace Edu.Model.ViewModel.User
/// 所属部门
/// </summary>
public string DeptName { get; set; }
/// <summary>
/// 岗位编号查询
/// </summary>
public string QPostIds { get; set; }
}
}
......@@ -64,5 +64,15 @@ namespace Edu.Model.ViewModel.User
/// 教师账号
/// </summary>
public string TeacherAccount { get; set; }
/// <summary>
/// 部门名称
/// </summary>
public string DeptName { get; set; }
/// <summary>
/// 岗位名称
/// </summary>
public string PostName { get; set; }
}
}
\ No newline at end of file
......@@ -27,6 +27,16 @@ namespace Edu.Module.User
/// </summary>
private readonly AccountModule accountModule = new AccountModule();
/// <summary>
/// 部门仓储层对象
/// </summary>
private readonly RB_DepartmentRepository departmentRepository = new RB_DepartmentRepository();
/// <summary>
/// 岗位仓储层对象
/// </summary>
private readonly RB_PostRepository postRepository = new RB_PostRepository();
/// <summary>
/// 获取助教列表
/// </summary>
......@@ -48,7 +58,28 @@ namespace Edu.Module.User
/// <returns></returns>
public List<RB_Assist_ViewModel> GetAssistPageListModule(int pageIndex, int pageSize, out long rowsCount, RB_Assist_ViewModel query)
{
return assistRepository.GetAssistPageListRepository(pageIndex, pageSize, out rowsCount, query);
var list= assistRepository.GetAssistPageListRepository(pageIndex, pageSize, out rowsCount, query);
if (list != null && list.Count > 0)
{
string postIds = string.Join(",", list.Where(qitem => qitem.Post_Id > 0).Select(qitem => qitem.Post_Id));
string deptIds = string.Join(",", list.Where(qitem => qitem.Dept_Id > 0).Select(qitem => qitem.Dept_Id));
List<RB_Post_ViewModel> postList = new List<RB_Post_ViewModel>();
List<RB_Department_ViewModel> deptList = new List<RB_Department_ViewModel>();
if (!string.IsNullOrEmpty(postIds))
{
postList = postRepository.GetPostListRepository(new RB_Post_ViewModel() { QPostIds = postIds });
}
if (!string.IsNullOrEmpty(deptIds))
{
deptList = departmentRepository.GetDepartmentListRepository(new RB_Department_ViewModel() { QDeptIds = deptIds });
}
foreach (var item in list)
{
item.DeptName = deptList?.Where(qitem => qitem.DeptId == item.Dept_Id)?.FirstOrDefault()?.DeptName ?? "";
item.PostName = postList?.Where(qitem => qitem.PostId == item.Post_Id)?.FirstOrDefault()?.PostName ?? "";
}
}
return list;
}
/// <summary>
......@@ -71,6 +102,8 @@ namespace Edu.Module.User
{nameof(RB_Assist.AssistIntro),model.AssistIntro },
{nameof(RB_Assist.UpdateBy),model.UpdateBy },
{nameof(RB_Assist.UpdateTime),model.UpdateTime },
{nameof(RB_Teacher_ViewModel.Dept_Id),model.Dept_Id },
{nameof(RB_Teacher_ViewModel.Post_Id),model.Post_Id },
};
flag = assistRepository.Update(fileds, new WhereHelper(nameof(RB_Assist.AId), model.AId));
}
......
......@@ -6,6 +6,7 @@ using Edu.Model.ViewModel.User;
using Edu.Repository.User;
using System;
using System.Collections.Generic;
using System.Linq;
using VT.FW.DB;
namespace Edu.Module.User
......@@ -25,6 +26,16 @@ namespace Edu.Module.User
/// </summary>
private readonly AccountModule accountModule = new AccountModule();
/// <summary>
/// 岗位仓储层对象
/// </summary>
private readonly RB_PostRepository postRepository = new RB_PostRepository();
/// <summary>
/// 部门仓储层对象
/// </summary>
private readonly RB_DepartmentRepository departmentRepository = new RB_DepartmentRepository();
/// <summary>
/// 获取管理者列表
/// </summary>
......@@ -45,7 +56,28 @@ namespace Edu.Module.User
/// <returns></returns>
public List<RB_Manager_ViewModel> GetManagerPageListModule(int pageIndex, int pageSize, out long rowsCount, RB_Manager_ViewModel query)
{
return managerRepository.GetManagerPageListRepository(pageIndex, pageSize, out rowsCount, query);
var list= managerRepository.GetManagerPageListRepository(pageIndex, pageSize, out rowsCount, query);
if (list != null && list.Count > 0)
{
string postIds = string.Join(",", list.Where(qitem => qitem.Post_Id > 0).Select(qitem => qitem.Post_Id));
string deptIds = string.Join(",", list.Where(qitem => qitem.Dept_Id > 0).Select(qitem => qitem.Dept_Id));
List<RB_Post_ViewModel> postList = new List<RB_Post_ViewModel>();
List<RB_Department_ViewModel> deptList = new List<RB_Department_ViewModel>();
if (!string.IsNullOrEmpty(postIds))
{
postList= postRepository.GetPostListRepository(new RB_Post_ViewModel() { QPostIds = postIds });
}
if (!string.IsNullOrEmpty(deptIds))
{
deptList= departmentRepository.GetDepartmentListRepository(new RB_Department_ViewModel() { QDeptIds = deptIds });
}
foreach (var item in list)
{
item.DeptName = deptList?.Where(qitem => qitem.DeptId == item.Dept_Id)?.FirstOrDefault()?.DeptName ?? "";
item.PostName = postList?.Where(qitem => qitem.PostId == item.Post_Id)?.FirstOrDefault()?.PostName ?? "";
}
}
return list;
}
/// <summary>
......@@ -66,6 +98,8 @@ namespace Edu.Module.User
{ nameof(RB_Manager_ViewModel.UpdateBy),model.UpdateBy },
{ nameof(RB_Manager_ViewModel.UpdateTime),model.UpdateTime },
{ nameof(RB_Manager_ViewModel.RoleAuth),model.RoleAuth },
{ nameof(RB_Manager_ViewModel.Dept_Id),model.Dept_Id },
{ nameof(RB_Manager_ViewModel.Post_Id),model.Post_Id },
};
flag = managerRepository.Update(fileds, new WhereHelper(nameof(RB_Manager_ViewModel.MId), model.MId));
}
......@@ -157,7 +191,7 @@ namespace Edu.Module.User
UpdateTime = DateTime.Now,
Group_Id = model.Group_Id,
School_Id = model.School_Id,
Status=model.Status,
Status = model.Status,
});
}
}
......
......@@ -27,6 +27,16 @@ namespace Edu.Module.User
/// </summary>
private readonly AccountModule accountModule = new AccountModule();
/// <summary>
/// 岗位管理仓储层对象
/// </summary>
private readonly RB_PostRepository postRepository = new RB_PostRepository();
/// <summary>
/// 部门管理仓储层对象
/// </summary>
private readonly RB_DepartmentRepository departmentRepository = new RB_DepartmentRepository();
/// <summary>
/// 获取讲师列表
/// </summary>
......@@ -48,7 +58,28 @@ namespace Edu.Module.User
/// <returns></returns>
public List<RB_Teacher_ViewModel> GetTeacherPageListModule(int pageIndex, int pageSize, out long rowsCount, RB_Teacher_ViewModel query)
{
return teacherRepository.GetTeacherPageListRepository(pageIndex, pageSize, out rowsCount, query);
var list= teacherRepository.GetTeacherPageListRepository(pageIndex, pageSize, out rowsCount, query);
if (list != null && list.Count > 0)
{
string postIds=string.Join(",",list.Where(qitem=>qitem.Post_Id>0).Select(qitem=>qitem.Post_Id));
string deptIds = string.Join(",", list.Where(qitem => qitem.Dept_Id > 0).Select(qitem => qitem.Dept_Id));
List<RB_Post_ViewModel> postList = new List<RB_Post_ViewModel>();
List<RB_Department_ViewModel> deptList = new List<RB_Department_ViewModel>();
if (!string.IsNullOrEmpty(postIds))
{
postList = postRepository.GetPostListRepository(new RB_Post_ViewModel() { QPostIds = postIds });
}
if (!string.IsNullOrEmpty(deptIds))
{
deptList = departmentRepository.GetDepartmentListRepository(new RB_Department_ViewModel() { QDeptIds = deptIds });
}
foreach (var item in list)
{
item.DeptName = deptList?.Where(qitem => qitem.DeptId == item.Dept_Id)?.FirstOrDefault()?.DeptName ?? "";
item.PostName = postList?.Where(qitem => qitem.PostId == item.Post_Id)?.FirstOrDefault()?.PostName ?? "";
}
}
return list;
}
/// <summary>
......@@ -76,6 +107,8 @@ namespace Edu.Module.User
{nameof(RB_Teacher_ViewModel.UpdateTime),model.UpdateTime },
{nameof(RB_Teacher_ViewModel.TeachTag),model.TeachTag },
{nameof(RB_Teacher_ViewModel.School_Id),model.School_Id },
{nameof(RB_Teacher_ViewModel.Dept_Id),model.Dept_Id },
{nameof(RB_Teacher_ViewModel.Post_Id),model.Post_Id },
};
flag = teacherRepository.Update(fileds, new WhereHelper(nameof(RB_Teacher_ViewModel.TId), model.TId));
}
......
......@@ -83,6 +83,14 @@ WHERE 1=1
{
builder.Append($" AND A.{nameof(RB_Post_ViewModel.PostId)}={query.PostId} ");
}
if (query.RB_Dept_Id > 0)
{
builder.Append($" AND A.{nameof(RB_Post_ViewModel.RB_Dept_Id)}={query.RB_Dept_Id} ");
}
if (!string.IsNullOrEmpty(query.QPostIds))
{
builder.Append($" AND A.{nameof(RB_Post_ViewModel.PostId)} IN({query.QPostIds}) ");
}
if (!string.IsNullOrEmpty(query.PostName))
{
builder.Append($" AND A.{nameof(RB_Post_ViewModel.PostName)} LIKE @PostName ");
......
......@@ -78,10 +78,10 @@ namespace Edu.WebApi.Controllers.User
if (int.TryParse(RequestParm.Uid, out int uid))
{
viewModel.Group_Id = UserReidsCache.GetUserLoginInfo(uid).Group_Id;
var result = accountModule.SetResetPassword(viewModel);
if (result.reuslt)
var (reuslt, newPass) = accountModule.SetResetPassword(viewModel);
if (reuslt)
{
return ApiResult.Success($"密码重置成功,用户新密码为【{result.newPass}】,请复制保存");
return ApiResult.Success($"密码重置成功,用户新密码为【{newPass}】,请复制保存");
}
else
{
......
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