Commit 88bfde8e authored by 吴春's avatar 吴春

Merge branch 'master' of http://gitlab.oytour.com/Kui2/education

parents eb3fdc31 a08d9abe
......@@ -114,5 +114,15 @@ namespace Edu.Model.ViewModel.User
/// 是否近7日生日
/// </summary>
public int IsBirth { get; set; }
/// <summary>
/// 员工电话
/// </summary>
public string EmployeeTel { get; set; }
/// <summary>
/// 身份证
/// </summary>
public string IDCard { get; set; }
}
}
......@@ -50,9 +50,9 @@ namespace Edu.Module.Log
CreateTime = DateTime.Now,
Group_Id = GroupId,
School_Id = SchoolId,
LogContent = content
LogContent = content.TrimStart(',')
};
return changeLogRepository.Insert(model);
return changeLogRepository.Insert(model) > 0;
}
}
}
using Edu.AOP.CustomerAttribute;
using Edu.Common.Enum;
using Edu.Common.Enum.User;
using Edu.Common.Plugin;
using Edu.Model.CacheModel;
using Edu.Model.Entity.User;
using Edu.Model.ViewModel.User;
using Edu.Module.Log;
using Edu.Repository.User;
using System;
using System.Collections.Generic;
......@@ -37,6 +39,11 @@ namespace Edu.Module.User
/// </summary>
private readonly RB_PostRepository postRepository = new RB_PostRepository();
/// <summary>
/// 用户信息日志处理类对象
/// </summary>
private readonly UserChangeLogModule userChangeLogModule = new UserChangeLogModule();
/// <summary>
/// 获取助教列表
/// </summary>
......@@ -86,25 +93,97 @@ namespace Edu.Module.User
/// 添加修改助教
/// </summary>
/// <param name="model"></param>
/// <param name="isUpdateBasic">是否更新基础资料</param>
/// <returns></returns>
public bool SetAssistModule(RB_Assist model)
public bool SetAssistModule(RB_Assist model, bool isUpdateBasic = false)
{
bool flag;
if (model.AId > 0)
{
var oldModel = GetAssistModule(model.AId);
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Assist.School_Id),model.School_Id },
{nameof(RB_Assist.Teacher_Id),model.Teacher_Id },
{nameof(RB_Assist.AssistName),model.AssistName.Trim() },
{nameof(RB_Assist.AssistTel),model.AssistTel },
{nameof(RB_Assist.AssistIcon),model.AssistIcon },
{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 },
{nameof(RB_Assist.Dept_Id),model.Dept_Id },
{nameof(RB_Assist.Post_Id),model.Post_Id },
};
if (isUpdateBasic)
{
fileds.Add(nameof(RB_Assist.AssistIcon), model.AssistIcon);
fileds.Add(nameof(RB_Assist.AssistIntro), model.AssistIntro);
fileds.Add(nameof(RB_Assist.Teacher_Id), model.Teacher_Id);
}
else
{
fileds.Add(nameof(RB_Assist.IDCard), model.IDCard);
fileds.Add(nameof(RB_Assist.Sex), model.Sex);
fileds.Add(nameof(RB_Assist.EntryTime), model.EntryTime);
fileds.Add(nameof(RB_Assist.Address), model.Address);
fileds.Add(nameof(RB_Assist.BirthDate), model.BirthDate);
fileds.Add(nameof(RB_Assist.LeaveStatus), model.LeaveStatus);
fileds.Add(nameof(RB_Assist.LeaveTime), model.LeaveTime);
fileds.Add(nameof(RB_Assist.Education), model.Education);
}
string logContent = "";
if (model.AssistName != oldModel.AssistName)
{
logContent += string.Format(",将姓名由【{0}】修改为【{1}】。", oldModel.AssistName, oldModel.AssistName);
}
if (model.AssistTel != oldModel.AssistTel)
{
logContent += string.Format(",将电话由【{0}】修改为【{1}】。", oldModel.AssistTel, oldModel.AssistTel);
}
if (model.Dept_Id != oldModel.Dept_Id)
{
var deptList = departmentRepository.GetDepartmentListRepository(new RB_Department_ViewModel() { QDeptIds = model.Dept_Id + "," + oldModel.Dept_Id });
logContent += string.Format(",将部门由【{0}】修改为【{1}】。", (deptList.Where(qitem => qitem.DeptId == oldModel.Dept_Id)?.FirstOrDefault()?.DeptName ?? ""), (deptList.Where(qitem => qitem.DeptId == model.Dept_Id)?.FirstOrDefault()?.DeptName ?? ""));
}
if (model.Post_Id != oldModel.Post_Id)
{
var postList = postRepository.GetPostListRepository(new RB_Post_ViewModel() { QPostIds = model.Post_Id + "," + oldModel.Post_Id });
logContent += string.Format(",将岗位由【{0}】修改为【{1}】。", (postList.Where(qitem => qitem.PostId == oldModel.Post_Id)?.FirstOrDefault()?.PostName ?? ""), (postList.Where(qitem => qitem.PostId == model.Post_Id)?.FirstOrDefault()?.PostName ?? ""));
}
if (model.IDCard != oldModel.IDCard)
{
logContent += string.Format(",将身份证由【{0}】修改为【{1}】。", oldModel.IDCard, model.IDCard);
}
if (model.Sex != oldModel.Sex)
{
logContent += string.Format(",将性别由【{0}】修改为【{1}】。", oldModel.Sex, model.Sex);
}
if (Common.ConvertHelper.FormatDate(model.EntryTime) != Common.ConvertHelper.FormatDate(oldModel.EntryTime))
{
logContent += string.Format(",将入职时间由【{0}】修改为【{1}】。", oldModel.EntryTime, model.EntryTime);
}
if (model.Address != oldModel.Address)
{
logContent += string.Format(",将地址由【{0}】修改为【{1}】。", oldModel.Address, model.Address);
}
if (Common.ConvertHelper.FormatDate(model.BirthDate) != Common.ConvertHelper.FormatDate(oldModel.BirthDate))
{
logContent += string.Format(",将生日由【{0}】修改为【{1}】。", Common.ConvertHelper.FormatDate(oldModel.BirthDate), Common.ConvertHelper.FormatDate(model.BirthDate));
}
if (model.LeaveStatus != oldModel.LeaveStatus)
{
logContent += string.Format(",将在职状态由【{0}】修改为【{1}】。", oldModel.LeaveStatus.ToName(), model.LeaveStatus.ToName());
}
if (model.LeaveTime != oldModel.LeaveTime)
{
logContent += string.Format(",将离职时间由【{0}】修改为【{1}】。", oldModel?.LeaveTime, model.LeaveTime);
}
if (model.Education != oldModel.Education)
{
logContent += string.Format(",将学历由【{0}】修改为【{1}】。", oldModel.Education.ToName(), model.Education.ToName());
}
if (!string.IsNullOrEmpty(logContent))
{
//新增日志
userChangeLogModule.SetUserChangeLogModule(model.CreateBy, model.Group_Id, model.School_Id, logContent);
}
flag = assistRepository.Update(fileds, new WhereHelper(nameof(RB_Assist.AId), model.AId));
}
else
......
......@@ -23,9 +23,19 @@ namespace Edu.Module.User
private readonly RB_DepartmentRepository departmentRepository = new RB_DepartmentRepository();
/// <summary>
/// 管理者仓储层对象
/// 管理者处理类对象
/// </summary>
private readonly RB_ManagerRepository managerRepository = new RB_ManagerRepository();
private readonly ManagerModule managerModule = new ManagerModule();
/// <summary>
/// 教程处理类对象
/// </summary>
private readonly TeacherModule teacherModule = new TeacherModule();
/// <summary>
/// 助理处理类对象
/// </summary>
private readonly AssistModule assistModule = new AssistModule();
/// <summary>
/// 获取员工列表【管理者、讲师、助教】
......@@ -100,10 +110,103 @@ namespace Edu.Module.User
/// 根据编号获取员工信息
/// </summary>
/// <param name="Id"></param>
/// <param name="AccountId">具体表主键编号</param>
/// <param name="AccountType">类型</param>
/// <returns></returns>
public Employee_ViewModel GetEmployeeModule(int Id, int AccountId, int AccountType)
{
return accountRepository.GetEmployeeListRepository(new Employee_ViewModel() { Id = Id, AccountId = AccountId, AccountType = (Common.Enum.User.AccountTypeEnum)AccountType })?.FirstOrDefault();
}
/// <summary>
/// 新增修改员工信息
/// </summary>
/// <param name="extModel"></param>
/// <returns></returns>
public Employee_ViewModel GetEmployeeModule(int Id)
public virtual bool SetEmployeeModule(Employee_ViewModel extModel)
{
return accountRepository.GetEmployeeInfo(Id);
bool flag = false;
switch (extModel.AccountType)
{
case Common.Enum.User.AccountTypeEnum.Admin:
flag = managerModule.SetManagerModule(new RB_Manager_ViewModel()
{
MId = extModel.AccountId,
MName = extModel.EmployeeName,
MTel = extModel.EmployeeTel,
MHead = extModel.UserIcon,
Group_Id = extModel.Group_Id,
School_Id = extModel.School_Id,
CreateBy = extModel.CreateBy,
CreateTime = extModel.CreateTime,
UpdateBy = extModel.UpdateBy,
UpdateTime = extModel.UpdateTime,
Status = extModel.Status,
Dept_Id = extModel.Dept_Id,
Post_Id = extModel.Post_Id,
IDCard = extModel.IDCard,
Sex = extModel.Sex,
EntryTime = extModel.EntryTime,
Address = extModel.Address,
BirthDate = extModel.BirthDate,
LeaveStatus = extModel.LeaveStatus,
LeaveTime = extModel.LeaveTime,
Education = extModel.Education
});
break;
case Common.Enum.User.AccountTypeEnum.Teacher:
flag = teacherModule.SetTeacherModule(new RB_Teacher_ViewModel()
{
TId=extModel.AccountId,
School_Id=extModel.School_Id,
TeacherName=extModel.EmployeeName,
TeacherTel=extModel.EmployeeTel,
TeacherHead=extModel.UserIcon,
Status=extModel.Status,
CreateBy=extModel.CreateBy,
CreateTime=extModel.CreateTime,
UpdateBy=extModel.UpdateBy,
UpdateTime=extModel.UpdateTime,
Group_Id=extModel.Group_Id,
Dept_Id=extModel.Dept_Id,
Post_Id=extModel.Post_Id,
IDCard=extModel.IDCard,
Sex=extModel.Sex,
EntryTime=extModel.EntryTime,
Address = extModel.Address,
BirthDate=extModel.BirthDate,
LeaveStatus=extModel.LeaveStatus,
LeaveTime=extModel.LeaveTime,
Education=extModel.Education,
});
break;
case Common.Enum.User.AccountTypeEnum.Assist:
flag = assistModule.SetAssistModule(new Model.Entity.User.RB_Assist()
{
AId = extModel.AccountId,
School_Id = extModel.School_Id,
AssistName = extModel.EmployeeName,
AssistTel = extModel.EmployeeTel,
AssistIcon = extModel.UserIcon,
Group_Id = extModel.Group_Id,
CreateBy = extModel.CreateBy,
CreateTime = extModel.CreateTime,
UpdateBy = extModel.UpdateBy,
UpdateTime = extModel.UpdateTime,
Dept_Id = extModel.Dept_Id,
Post_Id = extModel.Post_Id,
IDCard = extModel.IDCard,
Sex = extModel.Sex,
EntryTime = extModel.EntryTime,
Address = extModel.Address,
BirthDate = extModel.BirthDate,
LeaveStatus = extModel.LeaveStatus,
LeaveTime = extModel.LeaveTime,
Education = extModel.Education
});
break;
}
return flag;
}
}
}
\ No newline at end of file
......@@ -61,7 +61,6 @@ namespace Edu.Module.User
public bool SetManagerModule(RB_Manager_ViewModel model)
{
bool flag;
if (model.MId > 0)
{
var oldModel = GetManagerModule(model.MId);
......@@ -110,15 +109,15 @@ namespace Edu.Module.User
{
logContent += string.Format(",将性别由【{0}】修改为【{1}】。", oldModel.Sex, model.Sex);
}
if (model.EntryTime != oldModel.EntryTime)
if (Common.ConvertHelper.FormatDate(model.EntryTime) != Common.ConvertHelper.FormatDate(oldModel.EntryTime))
{
logContent += string.Format(",将入职时间由【{0}】修改为【{1}】。", oldModel.EntryTime, model.EntryTime);
logContent += string.Format(",将入职时间由【{0}】修改为【{1}】。", Common.ConvertHelper.FormatDate(oldModel.EntryTime), Common.ConvertHelper.FormatDate(model.EntryTime));
}
if (model.Address != oldModel.Address)
{
logContent += string.Format(",将地址由【{0}】修改为【{1}】。", oldModel.Address, model.Address);
}
if (model.BirthDate != oldModel.BirthDate)
if (Common.ConvertHelper.FormatDate(model.BirthDate) != Common.ConvertHelper.FormatDate(oldModel.BirthDate))
{
logContent += string.Format(",将生日由【{0}】修改为【{1}】。", Common.ConvertHelper.FormatDate(oldModel.BirthDate),Common.ConvertHelper.FormatDate(model.BirthDate));
}
......
......@@ -2,8 +2,10 @@
using Edu.Common.Encrypt;
using Edu.Common.Enum;
using Edu.Common.Enum.User;
using Edu.Common.Plugin;
using Edu.Model.CacheModel;
using Edu.Model.ViewModel.User;
using Edu.Module.Log;
using Edu.Repository.User;
using System;
using System.Collections.Generic;
......@@ -37,6 +39,11 @@ namespace Edu.Module.User
/// </summary>
private readonly RB_DepartmentRepository departmentRepository = new RB_DepartmentRepository();
/// <summary>
/// 用户信息日志处理类对象
/// </summary>
private readonly UserChangeLogModule userChangeLogModule = new UserChangeLogModule();
/// <summary>
/// 获取讲师列表
/// </summary>
......@@ -86,30 +93,102 @@ namespace Edu.Module.User
/// 新增修改讲师
/// </summary>
/// <param name="model"></param>
/// <param name="isUpdateBasic">是否更新基础资料</param>
/// <returns></returns>
public bool SetTeacherModule(RB_Teacher_ViewModel model)
public bool SetTeacherModule(RB_Teacher_ViewModel model,bool isUpdateBasic=false)
{
bool flag;
if (model.TId > 0)
{
var oldModel =GetTeacherModule(model.TId);
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Teacher_ViewModel.TeacherName),model.TeacherName },
{nameof(RB_Teacher_ViewModel.TeacherTel),model.TeacherTel },
{nameof(RB_Teacher_ViewModel.TeacherHead),model.TeacherHead },
{nameof(RB_Teacher_ViewModel.TeacherIcon),model.TeacherIcon },
{nameof(RB_Teacher_ViewModel.TeacherSay),model.TeacherSay },
{nameof(RB_Teacher_ViewModel.TeacherIntro),model.TeacherIntro },
{nameof(RB_Teacher_ViewModel.IsShow),model.IsShow },
{nameof(RB_Teacher_ViewModel.IsRecommend),model.IsRecommend },
{nameof(RB_Teacher_ViewModel.SortNum),model.SortNum },
{nameof(RB_Teacher_ViewModel.UpdateBy),model.UpdateBy },
{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 },
};
if (isUpdateBasic)
{
fileds.Add(nameof(RB_Teacher_ViewModel.TeachTag), model.TeachTag);
fileds.Add(nameof(RB_Teacher_ViewModel.SortNum), model.SortNum);
fileds.Add(nameof(RB_Teacher_ViewModel.IsRecommend), model.IsRecommend);
fileds.Add(nameof(RB_Teacher_ViewModel.IsShow), model.IsShow);
fileds.Add(nameof(RB_Teacher_ViewModel.TeacherIntro), model.TeacherIntro);
fileds.Add(nameof(RB_Teacher_ViewModel.TeacherSay), model.TeacherSay);
}
else
{
fileds.Add(nameof(RB_Teacher_ViewModel.IDCard), model.IDCard);
fileds.Add(nameof(RB_Teacher_ViewModel.Sex),model.Sex);
fileds.Add(nameof(RB_Teacher_ViewModel.EntryTime),model.EntryTime);
fileds.Add(nameof(RB_Teacher_ViewModel.Address),model.Address);
fileds.Add(nameof(RB_Teacher_ViewModel.BirthDate),model.BirthDate);
fileds.Add(nameof(RB_Teacher_ViewModel.LeaveStatus),model.LeaveStatus);
fileds.Add(nameof(RB_Teacher_ViewModel.LeaveTime),model.LeaveTime);
fileds.Add(nameof(RB_Teacher_ViewModel.Education),model.Education);
}
string logContent = "";
if (model.TeacherName != oldModel.TeacherName)
{
logContent += string.Format(",将姓名由【{0}】修改为【{1}】。", oldModel.TeacherName, oldModel.TeacherName);
}
if (model.TeacherTel != oldModel.TeacherTel)
{
logContent += string.Format(",将电话由【{0}】修改为【{1}】。", oldModel.TeacherTel, oldModel.TeacherTel);
}
if (model.Dept_Id != oldModel.Dept_Id)
{
var deptList = departmentRepository.GetDepartmentListRepository(new RB_Department_ViewModel() { QDeptIds = model.Dept_Id + "," + oldModel.Dept_Id });
logContent += string.Format(",将部门由【{0}】修改为【{1}】。", (deptList.Where(qitem => qitem.DeptId == oldModel.Dept_Id)?.FirstOrDefault()?.DeptName ?? ""), (deptList.Where(qitem => qitem.DeptId == model.Dept_Id)?.FirstOrDefault()?.DeptName ?? ""));
}
if (model.Post_Id != oldModel.Post_Id)
{
var postList = postRepository.GetPostListRepository(new RB_Post_ViewModel() { QPostIds = model.Post_Id + "," + oldModel.Post_Id });
logContent += string.Format(",将岗位由【{0}】修改为【{1}】。", (postList.Where(qitem => qitem.PostId == oldModel.Post_Id)?.FirstOrDefault()?.PostName ?? ""), (postList.Where(qitem => qitem.PostId == model.Post_Id)?.FirstOrDefault()?.PostName ?? ""));
}
if (model.IDCard != oldModel.IDCard)
{
logContent += string.Format(",将身份证由【{0}】修改为【{1}】。", oldModel.IDCard, model.IDCard);
}
if (model.Sex != oldModel.Sex)
{
logContent += string.Format(",将性别由【{0}】修改为【{1}】。", oldModel.Sex, model.Sex);
}
if (Common.ConvertHelper.FormatDate(model.EntryTime) != Common.ConvertHelper.FormatDate(oldModel.EntryTime))
{
logContent += string.Format(",将入职时间由【{0}】修改为【{1}】。", oldModel.EntryTime, model.EntryTime);
}
if (model.Address != oldModel.Address)
{
logContent += string.Format(",将地址由【{0}】修改为【{1}】。", oldModel.Address, model.Address);
}
if (Common.ConvertHelper.FormatDate(model.BirthDate) != Common.ConvertHelper.FormatDate(oldModel.BirthDate))
{
logContent += string.Format(",将生日由【{0}】修改为【{1}】。", Common.ConvertHelper.FormatDate(oldModel.BirthDate), Common.ConvertHelper.FormatDate(model.BirthDate));
}
if (model.LeaveStatus != oldModel.LeaveStatus)
{
logContent += string.Format(",将在职状态由【{0}】修改为【{1}】。", oldModel.LeaveStatus.ToName(), model.LeaveStatus.ToName());
}
if (model.LeaveTime != oldModel.LeaveTime)
{
logContent += string.Format(",将离职时间由【{0}】修改为【{1}】。", oldModel?.LeaveTime, model.LeaveTime);
}
if (model.Education != oldModel.Education)
{
logContent += string.Format(",将学历由【{0}】修改为【{1}】。", oldModel.Education.ToName(), model.Education.ToName());
}
if (!string.IsNullOrEmpty(logContent))
{
//新增日志
userChangeLogModule.SetUserChangeLogModule(model.CreateBy, model.Group_Id, model.School_Id, logContent);
}
flag = teacherRepository.Update(fileds, new WhereHelper(nameof(RB_Teacher_ViewModel.TId), model.TId));
}
else
......
......@@ -181,7 +181,6 @@ FROM
/// <returns></returns>
public List<Employee_ViewModel> GetEmployeePageListRepository(int pageIndex, int pageSize, out long rowsCount, Employee_ViewModel query)
{
rowsCount = 0;
DynamicParameters parameters = new DynamicParameters();
string sql = GetEmployeeSqlReposiroty(query, parameters);
var list = GetPage<Employee_ViewModel>(pageIndex, pageSize, out rowsCount, sql, parameters).ToList();
......@@ -196,7 +195,6 @@ FROM
/// <returns></returns>
public string GetEmployeeSqlReposiroty(Employee_ViewModel query,DynamicParameters parameters)
{
StringBuilder where = new StringBuilder();
StringBuilder where2 = new StringBuilder();
if (query != null)
......@@ -259,8 +257,8 @@ FROM
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.Id,A.Account,A.Group_Id,A.School_Id,A.EmployeeName,A.UserIcon,A.IDCard,A.Sex,A.Education,A.EntryTime,A.Address,A.BirthDate
,A.LeaveStatus,A.LeaveTime
SELECT A.Id,A.Account,A.AccountId,A.Group_Id,A.School_Id,A.EmployeeName,A.UserIcon,A.IDCard,A.Sex,A.Education,A.EntryTime,A.Address,A.BirthDate
,A.LeaveStatus,A.LeaveTime,A.EmployeeTel,A.AccountType
,IFNULL(G.GroupName,'') AS GroupName,IFNULL(s.SName,'') AS SchoolName
,IFNULL(d.DeptId,0) AS Dept_Id,IFNULL(d.DeptName,'') AS DeptName,IFNULL(p.PostId,0) AS Post_Id, IFNULL(p.PostName,'') AS PostName
,(CASE WHEN CONCAT(DATE_FORMAT(now(),'%Y'),'-',DATE_FORMAT(BirthDate,'%m-%d')) >= DATE_FORMAT(now(),'%Y-%m-%d')
......@@ -270,17 +268,17 @@ SELECT A.Id,A.Account,A.Group_Id,A.School_Id,A.EmployeeName,A.UserIcon,A.IDCard,
FROM
(
SELECT A.*,IFNULL(B.MName,'') AS EmployeeName,B.MHead AS UserIcon,B.Dept_Id,B.Post_Id,B.IDCard,B.Sex,B.Education,B.EntryTime,B.Address,B.BirthDate
,B.LeaveStatus,B.LeaveTime
,B.LeaveStatus,B.LeaveTime,B.MTel AS EmployeeTel
FROM rb_account AS A INNER JOIN rb_manager AS B ON A.AccountId=B.MId AND A.AccountType=1
WHERE 1=1 {0}
UNION ALL
SELECT A.*,IFNULL(B.TeacherName,'') AS EmployeeName,B.TeacherIcon AS UserIcon,B.Dept_Id,B.Post_Id,B.IDCard,B.Sex,B.Education,B.EntryTime,B.Address,B.BirthDate
,B.LeaveStatus,B.LeaveTime
,B.LeaveStatus,B.LeaveTime,B.TeacherTel AS EmployeeTel
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 EmployeeName,B.AssistIcon AS UserIcon,B.Dept_Id,B.Post_Id,B.IDCard,B.Sex,B.Education,B.EntryTime,B.Address,B.BirthDate
,B.LeaveStatus,B.LeaveTime
,B.LeaveStatus,B.LeaveTime,B.AssistTel AS EmployeeTel
FROM rb_account AS A INNER JOIN rb_assist AS B ON A.AccountId=B.AId AND A.AccountType=3
WHERE 1=1 {0}
) AS A LEFT JOIN rb_group AS g ON A.Group_Id=g.GId
......
......@@ -640,9 +640,11 @@ namespace Edu.WebApi.Controllers.User
BirthDate = Common.ConvertHelper.FormatDate(qitem.BirthDate),
Education = qitem.Education.ToName(),
LeaveStatus = qitem.LeaveStatus.ToName(),
LeaveStatusValue= qitem.LeaveStatus,
qitem.Account,
qitem.AccountType,
qitem.IsBirth,
qitem.AccountId,
});
return ApiResult.Success(data: pageModel);
}
......@@ -662,20 +664,20 @@ namespace Edu.WebApi.Controllers.User
}
/// <summary>
/// 添加修改管理者
/// 添加修改管理者 SetManager
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult SetManager()
public ApiResult SetEmployee()
{
var extModel = Common.Plugin.JsonHelper.DeserializeObject<RB_Manager_ViewModel>(RequestParm.Msg.ToString());
var extModel = Common.Plugin.JsonHelper.DeserializeObject<Employee_ViewModel>(RequestParm.Msg.ToString());
extModel.CreateBy = base.UserInfo.Id;
extModel.CreateTime = DateTime.Now;
extModel.UpdateBy = base.UserInfo.Id;
extModel.UpdateTime = DateTime.Now;
extModel.Group_Id = base.UserInfo.Group_Id;
extModel.School_Id = base.UserInfo.School_Id;
bool flag = managerModule.SetManagerModule(extModel);
bool flag = employeeModule.SetEmployeeModule(extModel);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
......@@ -687,7 +689,9 @@ namespace Edu.WebApi.Controllers.User
public ApiResult GetEmployee()
{
var Id = base.ParmJObj.GetInt("Id", 0);
var extModel = employeeModule.GetEmployeeModule(Id);
var AccountId = base.ParmJObj.GetInt("AccountId", 0);
var AccountType = base.ParmJObj.GetInt("AccountType", 0);
var extModel = employeeModule.GetEmployeeModule(Id, AccountId, AccountType);
return ApiResult.Success(data: extModel);
}
......@@ -883,8 +887,11 @@ namespace Edu.WebApi.Controllers.User
[HttpPost]
public ApiResult GetPostList()
{
var query = Common.Plugin.JsonHelper.DeserializeObject<RB_Post_ViewModel>(RequestParm.Msg.ToString());
query.Group_Id = base.UserInfo.Group_Id;
var query = new RB_Post_ViewModel()
{
Group_Id = base.UserInfo.Group_Id,
RB_Dept_Id=base.ParmJObj.GetInt("RB_Dept_Id"),
};
var list = postModule.GetPostListModule(query);
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