Commit 24edb3f3 authored by 黄奎's avatar 黄奎

页面修改

parent eca93b80
This diff is collapsed.
using Edu.Model.ViewModel.User;
using Edu.Repository.User;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Edu.Module.User
{
/// <summary>
/// 员工处理类
/// </summary>
public class EmployeeModule
{
/// <summary>
/// 账号管理处理类对象
/// </summary>
private readonly RB_AccountRepository accountRepository = new RB_AccountRepository();
/// <summary>
/// 部门仓储层对象
/// </summary>
private readonly RB_DepartmentRepository departmentRepository = new RB_DepartmentRepository();
/// <summary>
/// 获取员工列表【管理者、讲师、助教】
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<Employee_ViewModel> GetEmployeeListModule(Employee_ViewModel query)
{
return accountRepository.GetEmployeeListRepository(query);
}
/// <summary>
/// 根据员工部门获取员工列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<Employee_ViewModel> GetEmployeeByDeptTierModule(Employee_ViewModel query)
{
List<Employee_ViewModel> employeeList = new List<Employee_ViewModel>();
//获取当前部门所有的上级部门
if (query.DeptTier == 1)
{
var currentDeptModel = departmentRepository.GetEntity<RB_Department_ViewModel>(query.Dept_Id);
if (currentDeptModel != null && !string.IsNullOrEmpty(currentDeptModel.ManagerIds))
{
employeeList = accountRepository.GetEmployeeListRepository(new Employee_ViewModel()
{
QIds = currentDeptModel.ManagerIds
});
}
}
else
{
var allDeptList = departmentRepository.GetAllSuperiorDepartmentListRepository(query.Dept_Id);
var subList = allDeptList.Where(qitem => qitem.DeptTier == (query.DeptTier - 1));
if (subList != null && subList.Count() > 0)
{
string managerIds = "0";
foreach (var item in subList)
{
if (!string.IsNullOrEmpty(item.ManagerIds))
{
managerIds += "," + item.ManagerIds;
}
}
if (!string.IsNullOrEmpty(managerIds))
{
employeeList = accountRepository.GetEmployeeListRepository(new Employee_ViewModel()
{
QIds = managerIds
});
}
}
}
return employeeList;
}
}
}
using Edu.Model.ViewModel.User;
using Edu.Repository.User;
using System.Collections.Generic;
using VT.FW.DB;
namespace Edu.Module.User
{
/// <summary>
/// 岗位处理类
/// </summary>
public class PostModule
{
/// <summary>
/// 岗位仓储层对象
/// </summary>
private readonly RB_PostRepository postRepository = new RB_PostRepository();
/// <summary>
/// 获取岗位分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Post_ViewModel> GetPostPageListModule(int pageIndex, int pageSize, out long rowsCount, RB_Post_ViewModel query)
{
var list = postRepository.GetPostPageListRepository(pageIndex, pageSize, out rowsCount, query);
return list;
}
/// <summary>
/// 获取岗位列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Post_ViewModel> GetPostListModule(RB_Post_ViewModel query)
{
return postRepository.GetPostListRepository(query);
}
/// <summary>
/// 新增修改岗位
/// </summary>
/// <param name="extModel"></param>
/// <returns></returns>
public bool SetPostModule(RB_Post_ViewModel extModel)
{
bool flag;
if (extModel.PostId > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Post_ViewModel.PostName),extModel.PostName },
{nameof(RB_Post_ViewModel.RB_Dept_Id),extModel.RB_Dept_Id },
{nameof(RB_Post_ViewModel.UpdateBy),extModel.UpdateBy },
{nameof(RB_Post_ViewModel.UpdateTime),extModel.UpdateTime },
};
flag = postRepository.Update(fileds, new WhereHelper(nameof(RB_Post_ViewModel.PostId), extModel.PostId));
}
else
{
var newId = postRepository.Insert(extModel);
extModel.PostId = newId;
flag = newId > 0;
}
return flag;
}
/// <summary>
/// 根据岗位编号获取部门岗位
/// </summary>
/// <param name="DeptId"></param>
/// <returns></returns>
public RB_Post_ViewModel GetPostModule(object PostId)
{
return postRepository.GetEntity<RB_Post_ViewModel>(PostId);
}
/// <summary>
/// 修改岗位状态
/// </summary>
/// <param name="PostId">岗位编号</param>
/// <param name="Status">状态</param>
/// <returns></returns>
public bool RemovePostModule(int PostId, int Status)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Post_ViewModel.Status),Status }
};
return postRepository.Update(fileds, new WhereHelper(nameof(RB_Post_ViewModel.PostId), PostId));
}
}
}
\ No newline at end of file
...@@ -23,7 +23,7 @@ namespace Edu.WebApi.Controllers.Third ...@@ -23,7 +23,7 @@ namespace Edu.WebApi.Controllers.Third
/// <summary> /// <summary>
/// 员工处理类 /// 员工处理类
/// </summary> /// </summary>
private readonly EmployeeModule1 employeeModule = new EmployeeModule1(); private readonly EmployeeModule employeeModule = new EmployeeModule();
/// <summary> /// <summary>
/// 根部部门层级获取部门主管 /// 根部部门层级获取部门主管
......
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