Commit 8366175b authored by 黄奎's avatar 黄奎

页面修改

parent 02d46a40
...@@ -74,5 +74,10 @@ namespace Edu.Model.ViewModel.User ...@@ -74,5 +74,10 @@ namespace Edu.Model.ViewModel.User
/// 岗位名称 /// 岗位名称
/// </summary> /// </summary>
public string PostName { get; set; } public string PostName { get; set; }
/// <summary>
/// 直接主管 (OKR专用)
/// </summary>
public int DirectSupervisor { get; set; }
} }
} }
\ No newline at end of file
...@@ -59,5 +59,10 @@ namespace Edu.Model.ViewModel.User ...@@ -59,5 +59,10 @@ namespace Edu.Model.ViewModel.User
/// 用户类型(1-管理端,2-讲师,3-助教) /// 用户类型(1-管理端,2-讲师,3-助教)
/// </summary> /// </summary>
public int UserType { get; set; } public int UserType { get; set; }
/// <summary>
/// 直接主管 (OKR专用)
/// </summary>
public int DirectSupervisor { get; set; }
} }
} }
...@@ -104,5 +104,10 @@ namespace Edu.Model.ViewModel.User ...@@ -104,5 +104,10 @@ namespace Edu.Model.ViewModel.User
/// 是否查询离职老师(1-是) /// 是否查询离职老师(1-是)
/// </summary> /// </summary>
public int IsQLeave { get; set; } public int IsQLeave { get; set; }
/// <summary>
/// 直接主管 (OKR专用)
/// </summary>
public int DirectSupervisor { get; set; }
} }
} }
\ No newline at end of file
...@@ -39,19 +39,6 @@ namespace Edu.Module.User ...@@ -39,19 +39,6 @@ namespace Edu.Module.User
return accountRepository.GetUpdateAccountListRepository(query); return accountRepository.GetUpdateAccountListRepository(query);
} }
/// <summary>
/// 获取账号分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Account_ViewModel> GetAccountPageListModule(int pageIndex, int pageSize, out long rowsCount, RB_Account_ViewModel query)
{
return accountRepository.GetAccountPageListRepository(pageIndex, pageSize, out rowsCount, query);
}
/// <summary> /// <summary>
/// 获取账号列表扩展列表 /// 获取账号列表扩展列表
/// </summary> /// </summary>
...@@ -75,10 +62,10 @@ namespace Edu.Module.User ...@@ -75,10 +62,10 @@ namespace Edu.Module.User
Dictionary<string, object> fileds = new Dictionary<string, object>() Dictionary<string, object> fileds = new Dictionary<string, object>()
{ {
{nameof(RB_Account_ViewModel.Account),model.Account.Trim() }, {nameof(RB_Account_ViewModel.Account),model.Account.Trim() },
{nameof(RB_Account_ViewModel.AccountType),model.AccountType},
{nameof(RB_Account_ViewModel.AccountId),model.AccountId},
{nameof(RB_Account_ViewModel.UpdateBy),model.UpdateBy}, {nameof(RB_Account_ViewModel.UpdateBy),model.UpdateBy},
{nameof(RB_Account_ViewModel.UpdateTime),model.UpdateTime}, {nameof(RB_Account_ViewModel.UpdateTime),model.UpdateTime},
{nameof(RB_Account_ViewModel.DirectSupervisor),model.DirectSupervisor},
{nameof(RB_Account_ViewModel.School_Id),model.School_Id},
}; };
flag = accountRepository.Update(fileds, new WhereHelper(nameof(RB_Account_ViewModel.Id), model.Id)); flag = accountRepository.Update(fileds, new WhereHelper(nameof(RB_Account_ViewModel.Id), model.Id));
} }
......
...@@ -105,7 +105,7 @@ namespace Edu.Module.User ...@@ -105,7 +105,7 @@ namespace Edu.Module.User
/// <param name="model"></param> /// <param name="model"></param>
/// <param name="isUpdateBasic">是否更新基础资料</param> /// <param name="isUpdateBasic">是否更新基础资料</param>
/// <returns></returns> /// <returns></returns>
public bool SetAssistModule(RB_Assist model, bool isUpdateBasic = false) public bool SetAssistModule(RB_Assist_ViewModel model, bool isUpdateBasic = false)
{ {
bool flag; bool flag;
if (model.AId > 0) if (model.AId > 0)
...@@ -113,19 +113,19 @@ namespace Edu.Module.User ...@@ -113,19 +113,19 @@ namespace Edu.Module.User
var oldModel = GetAssistModule(model.AId); var oldModel = GetAssistModule(model.AId);
Dictionary<string, object> fileds = new Dictionary<string, object>() Dictionary<string, object> fileds = new Dictionary<string, object>()
{ {
{nameof(RB_Assist.AssistName),model.AssistName.Trim() }, {nameof(RB_Assist_ViewModel.AssistName),model.AssistName.Trim() },
{nameof(RB_Assist.AssistTel),model.AssistTel }, {nameof(RB_Assist_ViewModel.AssistTel),model.AssistTel },
{nameof(RB_Assist.AssistIcon),model.AssistIcon }, {nameof(RB_Assist_ViewModel.AssistIcon),model.AssistIcon },
{nameof(RB_Assist.UpdateBy),model.UpdateBy }, {nameof(RB_Assist_ViewModel.UpdateBy),model.UpdateBy },
{nameof(RB_Assist.UpdateTime),model.UpdateTime }, {nameof(RB_Assist_ViewModel.UpdateTime),model.UpdateTime },
}; };
if (isUpdateBasic) if (isUpdateBasic)
{ {
fileds.Add(nameof(RB_Assist.Dept_Id), model.Dept_Id); fileds.Add(nameof(RB_Assist_ViewModel.Dept_Id), model.Dept_Id);
fileds.Add(nameof(RB_Assist.Post_Id), model.Post_Id); fileds.Add(nameof(RB_Assist_ViewModel.Post_Id), model.Post_Id);
fileds.Add(nameof(RB_Assist.AssistIntro), model.AssistIntro); fileds.Add(nameof(RB_Assist_ViewModel.AssistIntro), model.AssistIntro);
fileds.Add(nameof(RB_Assist.Teacher_Id), model.Teacher_Id); fileds.Add(nameof(RB_Assist_ViewModel.Teacher_Id), model.Teacher_Id);
fileds.Add(nameof(RB_Assist.School_Id), model.School_Id); fileds.Add(nameof(RB_Assist_ViewModel.School_Id), model.School_Id);
} }
else else
{ {
...@@ -133,15 +133,15 @@ namespace Edu.Module.User ...@@ -133,15 +133,15 @@ namespace Edu.Module.User
{ {
model.LeaveTime = null; model.LeaveTime = null;
} }
fileds.Add(nameof(RB_Assist.IDCard), model.IDCard); fileds.Add(nameof(RB_Assist_ViewModel.IDCard), model.IDCard);
fileds.Add(nameof(RB_Assist.Sex),model.Sex); fileds.Add(nameof(RB_Assist_ViewModel.Sex),model.Sex);
fileds.Add(nameof(RB_Assist.EntryTime),model.EntryTime); fileds.Add(nameof(RB_Assist_ViewModel.EntryTime),model.EntryTime);
fileds.Add(nameof(RB_Assist.Address),model.Address); fileds.Add(nameof(RB_Assist_ViewModel.Address),model.Address);
fileds.Add(nameof(RB_Assist.BirthDate),model.BirthDate); fileds.Add(nameof(RB_Assist_ViewModel.BirthDate),model.BirthDate);
fileds.Add(nameof(RB_Assist.LeaveStatus),model.LeaveStatus); fileds.Add(nameof(RB_Assist_ViewModel.LeaveStatus),model.LeaveStatus);
fileds.Add(nameof(RB_Assist.LeaveTime),model.LeaveTime); fileds.Add(nameof(RB_Assist_ViewModel.LeaveTime),model.LeaveTime);
fileds.Add(nameof(RB_Assist.Education),model.Education); fileds.Add(nameof(RB_Assist_ViewModel.Education),model.Education);
fileds.Add(nameof(RB_Assist.Email), model.Email); fileds.Add(nameof(RB_Assist_ViewModel.Email), model.Email);
} }
string logContent = ""; string logContent = "";
if (model.AssistName != oldModel.AssistName) if (model.AssistName != oldModel.AssistName)
...@@ -209,28 +209,26 @@ namespace Edu.Module.User ...@@ -209,28 +209,26 @@ namespace Edu.Module.User
model.AId = newId; model.AId = newId;
userChangeLogModule.SetUserChangeLogModule(model.CreateBy, model.Group_Id, model.School_Id, "新建助教用户", newId, AccountTypeEnum.Assist); userChangeLogModule.SetUserChangeLogModule(model.CreateBy, model.Group_Id, model.School_Id, "新建助教用户", newId, AccountTypeEnum.Assist);
flag = newId > 0; flag = newId > 0;
}
var accountList = accountModule.GetAccountListExtModule(new RB_Account_ViewModel() if (flag)
{ {
Account = model.AssistTel, var account= accountModule.GetAccountListModule(new RB_Account_ViewModel() { AccountType = AccountTypeEnum.Assist, AccountId = model.AId })?.FirstOrDefault();
AccountType = AccountTypeEnum.Assist int Id = account?.Id??0;
flag = accountModule.SetAccountModule(new RB_Account_ViewModel()
{
Id = Id,
Account = model.AssistAccount,
Password = Common.DES.Encrypt(Common.Config.DefaultPwd),
AccountType = AccountTypeEnum.Assist,
AccountId = model.AId,
CreateBy = model.CreateBy,
UpdateBy = model.CreateBy,
CreateTime = DateTime.Now,
UpdateTime = DateTime.Now,
Group_Id = model.Group_Id,
School_Id = model.School_Id,
DirectSupervisor = model.DirectSupervisor
}); });
if (accountList == null || (accountList != null && accountList.Count == 0))
{
flag = accountModule.SetAccountModule(new RB_Account_ViewModel()
{
Account = model.AssistTel,
Password = Common.DES.Encrypt(Common.Config.DefaultPwd),
AccountType = AccountTypeEnum.Assist,
AccountId = model.AId,
CreateBy = model.CreateBy,
UpdateBy = model.CreateBy,
CreateTime = DateTime.Now,
UpdateTime = DateTime.Now,
Group_Id = model.Group_Id,
School_Id = model.School_Id,
});
}
} }
return flag; return flag;
} }
......
...@@ -164,6 +164,8 @@ namespace Edu.Module.User ...@@ -164,6 +164,8 @@ namespace Edu.Module.User
LeaveTime = extModel.LeaveTime, LeaveTime = extModel.LeaveTime,
Education = extModel.Education, Education = extModel.Education,
Email=extModel.Email, Email=extModel.Email,
DirectSupervisor = extModel.DirectSupervisor,
ManagerAccount=extModel.Account,
}); });
break; break;
case Common.Enum.User.AccountTypeEnum.Teacher: case Common.Enum.User.AccountTypeEnum.Teacher:
...@@ -191,10 +193,12 @@ namespace Edu.Module.User ...@@ -191,10 +193,12 @@ namespace Edu.Module.User
LeaveTime = extModel.LeaveTime, LeaveTime = extModel.LeaveTime,
Education = extModel.Education, Education = extModel.Education,
Email=extModel.Email, Email=extModel.Email,
DirectSupervisor = extModel.DirectSupervisor,
TeacherAccount=extModel.Account,
}); });
break; break;
case Common.Enum.User.AccountTypeEnum.Assist: case Common.Enum.User.AccountTypeEnum.Assist:
flag = assistModule.SetAssistModule(new Model.Entity.User.RB_Assist() flag = assistModule.SetAssistModule(new RB_Assist_ViewModel()
{ {
AId = extModel.AccountId, AId = extModel.AccountId,
School_Id = extModel.School_Id, School_Id = extModel.School_Id,
...@@ -217,12 +221,19 @@ namespace Edu.Module.User ...@@ -217,12 +221,19 @@ namespace Edu.Module.User
LeaveTime = extModel.LeaveTime, LeaveTime = extModel.LeaveTime,
Education = extModel.Education, Education = extModel.Education,
Email=extModel.Email, Email=extModel.Email,
DirectSupervisor=extModel.DirectSupervisor,
AssistAccount=extModel.Account,
}); });
break; break;
} }
return flag; return flag;
} }
/// <summary>
/// 判断手机号码是否存在
/// </summary>
/// <param name="extModel"></param>
/// <returns></returns>
public virtual bool ExistPhone(Employee_ViewModel extModel) public virtual bool ExistPhone(Employee_ViewModel extModel)
{ {
bool flag = false; bool flag = false;
...@@ -230,7 +241,7 @@ namespace Edu.Module.User ...@@ -230,7 +241,7 @@ namespace Edu.Module.User
switch (extModel.AccountType) switch (extModel.AccountType)
{ {
case Common.Enum.User.AccountTypeEnum.Admin: case Common.Enum.User.AccountTypeEnum.Admin:
var list = managerModule.GetManagerListModule(new RB_Manager_ViewModel { Group_Id = extModel.Group_Id, MTel = extModel.EmployeeTel }); var list = managerModule.GetManagerListModule(new RB_Manager_ViewModel { Group_Id = extModel.Group_Id, MTel = extModel.Account });
if (extModel.AccountId == 0) if (extModel.AccountId == 0)
{ {
flag = list.Count() > 0; flag = list.Count() > 0;
...@@ -241,7 +252,7 @@ namespace Edu.Module.User ...@@ -241,7 +252,7 @@ namespace Edu.Module.User
} }
break; break;
case Common.Enum.User.AccountTypeEnum.Teacher: case Common.Enum.User.AccountTypeEnum.Teacher:
var teacherList = teacherModule.GetTeacherListModule(new RB_Teacher_ViewModel { Group_Id = extModel.Group_Id, TeacherTel = extModel.EmployeeTel }); var teacherList = teacherModule.GetTeacherListModule(new RB_Teacher_ViewModel { Group_Id = extModel.Group_Id, TeacherTel = extModel.Account });
if (extModel.AccountId == 0) if (extModel.AccountId == 0)
{ {
flag = teacherList.Count() > 0; flag = teacherList.Count() > 0;
...@@ -252,7 +263,7 @@ namespace Edu.Module.User ...@@ -252,7 +263,7 @@ namespace Edu.Module.User
} }
break; break;
case Common.Enum.User.AccountTypeEnum.Assist: case Common.Enum.User.AccountTypeEnum.Assist:
var assistList = assistModule.GetAssistListModule(new RB_Assist_ViewModel { Group_Id = extModel.Group_Id, AssistTel = extModel.EmployeeTel }); var assistList = assistModule.GetAssistListModule(new RB_Assist_ViewModel { Group_Id = extModel.Group_Id, AssistTel = extModel.Account });
if (extModel.AccountId == 0) if (extModel.AccountId == 0)
{ {
flag = assistList.Count() > 0; flag = assistList.Count() > 0;
......
...@@ -92,6 +92,8 @@ namespace Edu.Module.User ...@@ -92,6 +92,8 @@ namespace Edu.Module.User
{ nameof(RB_Manager_ViewModel.Education),model.Education }, { nameof(RB_Manager_ViewModel.Education),model.Education },
{ nameof(RB_Manager_ViewModel.Email),model.Email }, { nameof(RB_Manager_ViewModel.Email),model.Email },
}; };
#region 日志
string logContent = ""; string logContent = "";
if (model.MName != oldModel.MName) if (model.MName != oldModel.MName)
{ {
...@@ -101,26 +103,6 @@ namespace Edu.Module.User ...@@ -101,26 +103,6 @@ namespace Edu.Module.User
{ {
logContent += string.Format(",将电话由【{0}】修改为【{1}】。", oldModel.MTel, oldModel.MTel); logContent += string.Format(",将电话由【{0}】修改为【{1}】。", oldModel.MTel, oldModel.MTel);
} }
#region 注释
//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.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);
//}
#endregion
if (model.IDCard != oldModel.IDCard) if (model.IDCard != oldModel.IDCard)
{ {
logContent += string.Format(",将身份证由【{0}】修改为【{1}】。", oldModel.IDCard, model.IDCard); logContent += string.Format(",将身份证由【{0}】修改为【{1}】。", oldModel.IDCard, model.IDCard);
...@@ -162,35 +144,39 @@ namespace Edu.Module.User ...@@ -162,35 +144,39 @@ namespace Edu.Module.User
//新增日志 //新增日志
userChangeLogModule.SetUserChangeLogModule(model.CreateBy, model.Group_Id, model.School_Id, logContent, model.MId, AccountTypeEnum.Admin); userChangeLogModule.SetUserChangeLogModule(model.CreateBy, model.Group_Id, model.School_Id, logContent, model.MId, AccountTypeEnum.Admin);
} }
#endregion
flag = managerRepository.Update(fileds, new WhereHelper(nameof(RB_Manager_ViewModel.MId), model.MId)); flag = managerRepository.Update(fileds, new WhereHelper(nameof(RB_Manager_ViewModel.MId), model.MId));
} }
else else
{ {
var newId = managerRepository.Insert(model); var newId = managerRepository.Insert(model);
model.MId = newId; model.MId = newId;
if (newId > 0)
{
accountModule.SetAccountModule(new RB_Account_ViewModel
{
Id = 0,
Account = model.MTel,
Password = model.Password,
AccountType = AccountTypeEnum.Admin,
AccountId = newId,
CreateBy = model.CreateBy,
CreateTime = model.CreateTime,
UpdateBy = model.UpdateBy,
UpdateTime = model.UpdateTime,
Group_Id = model.Group_Id,
School_Id = model.School_Id,
Status = 0,
AnnualLeaveDay = 0
});
model.MId = newId;
}
flag = newId > 0; flag = newId > 0;
userChangeLogModule.SetUserChangeLogModule(model.CreateBy, model.Group_Id, model.School_Id, "新建用户", newId, AccountTypeEnum.Admin); userChangeLogModule.SetUserChangeLogModule(model.CreateBy, model.Group_Id, model.School_Id, "新建用户", newId, AccountTypeEnum.Admin);
} }
if (flag)
{
var account = accountModule.GetAccountListModule(new RB_Account_ViewModel() { AccountType = AccountTypeEnum.Admin, AccountId = model.MId })?.FirstOrDefault();
int Id = account?.Id ?? 0;
flag = accountModule.SetAccountModule(new RB_Account_ViewModel
{
Id = Id,
Account = model.ManagerAccount,
Password = model.Password,
AccountType = AccountTypeEnum.Admin,
AccountId = model.MId,
CreateBy = model.CreateBy,
CreateTime = model.CreateTime,
UpdateBy = model.UpdateBy,
UpdateTime = model.UpdateTime,
Group_Id = model.Group_Id,
School_Id = model.School_Id,
Status = 0,
AnnualLeaveDay = 0,
DirectSupervisor = model.DirectSupervisor
});
}
return flag; return flag;
} }
......
...@@ -164,6 +164,7 @@ namespace Edu.Module.User ...@@ -164,6 +164,7 @@ namespace Edu.Module.User
fileds.Add(nameof(RB_Teacher_ViewModel.Education), model.Education); fileds.Add(nameof(RB_Teacher_ViewModel.Education), model.Education);
fileds.Add(nameof(RB_Teacher_ViewModel.Email), model.Email); fileds.Add(nameof(RB_Teacher_ViewModel.Email), model.Email);
} }
#region 修改日志
string logContent = ""; string logContent = "";
if (model.TeacherName != oldModel.TeacherName) if (model.TeacherName != oldModel.TeacherName)
{ {
...@@ -226,6 +227,7 @@ namespace Edu.Module.User ...@@ -226,6 +227,7 @@ namespace Edu.Module.User
//新增日志 //新增日志
userChangeLogModule.SetUserChangeLogModule(model.CreateBy, model.Group_Id, model.School_Id, logContent, model.TId, AccountTypeEnum.Teacher); userChangeLogModule.SetUserChangeLogModule(model.CreateBy, model.Group_Id, model.School_Id, logContent, model.TId, AccountTypeEnum.Teacher);
} }
#endregion
flag = teacherRepository.Update(fileds, new WhereHelper(nameof(RB_Teacher_ViewModel.TId), model.TId)); flag = teacherRepository.Update(fileds, new WhereHelper(nameof(RB_Teacher_ViewModel.TId), model.TId));
} }
else else
...@@ -234,30 +236,26 @@ namespace Edu.Module.User ...@@ -234,30 +236,26 @@ namespace Edu.Module.User
model.TId = newId; model.TId = newId;
userChangeLogModule.SetUserChangeLogModule(model.CreateBy, model.Group_Id, model.School_Id, "新建教师用户", newId, AccountTypeEnum.Teacher); userChangeLogModule.SetUserChangeLogModule(model.CreateBy, model.Group_Id, model.School_Id, "新建教师用户", newId, AccountTypeEnum.Teacher);
flag = newId > 0; flag = newId > 0;
if (model.AuditStatus == AccountStatusEnum.Pass && flag) }
{ if (flag)
var accountList = accountModule.GetAccountListExtModule(new RB_Account_ViewModel() {
{ var account = accountModule.GetAccountListModule(new RB_Account_ViewModel() { AccountType = AccountTypeEnum.Teacher, AccountId = model.TId })?.FirstOrDefault();
Account = model.TeacherTel, int Id = account?.Id ?? 0;
AccountType = AccountTypeEnum.Teacher flag = accountModule.SetAccountModule(new RB_Account_ViewModel()
}); {
if (accountList == null || (accountList != null && accountList.Count == 0)) Id = Id,
{ Account = model.TeacherAccount,
flag = accountModule.SetAccountModule(new RB_Account_ViewModel() Password = Common.DES.Encrypt(Common.Config.DefaultPwd),
{ AccountType = AccountTypeEnum.Teacher,
Account = model.TeacherTel, AccountId = model.TId,
Password = Common.DES.Encrypt(Common.Config.DefaultPwd), CreateBy = model.CreateBy,
AccountType = AccountTypeEnum.Teacher, UpdateBy = model.CreateBy,
AccountId = model.TId, CreateTime = DateTime.Now,
CreateBy = model.CreateBy, UpdateTime = DateTime.Now,
UpdateBy = model.CreateBy, Group_Id = model.Group_Id,
CreateTime = DateTime.Now, School_Id = model.School_Id,
UpdateTime = DateTime.Now, DirectSupervisor = model.DirectSupervisor
Group_Id = model.Group_Id, });
School_Id = model.School_Id,
});
}
}
} }
return flag; return flag;
} }
......
...@@ -52,53 +52,12 @@ WHERE 1=1 ...@@ -52,53 +52,12 @@ WHERE 1=1
{ {
builder.AppendFormat(" AND a.{0}={1} ", nameof(RB_Account_ViewModel.Id), query.Id); builder.AppendFormat(" AND a.{0}={1} ", nameof(RB_Account_ViewModel.Id), query.Id);
} }
} if (query.AccountId > 0)
return Get<RB_Account_ViewModel>(builder.ToString(), parameters).ToList();
}
/// <summary>
/// 获取账号分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Account_ViewModel> GetAccountPageListRepository(int pageIndex, int pageSize, out long rowsCount, RB_Account_ViewModel query)
{
var parameters = new DynamicParameters();
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.*
FROM rb_account AS A
WHERE 1=1
");
builder.AppendFormat(" AND a.{0}={1} ", nameof(RB_Account_ViewModel.Status), (int)DateStateEnum.Normal);
if (query != null)
{
if (!string.IsNullOrWhiteSpace(query.Account))
{
builder.AppendFormat(" AND a.{0} LIKE @Account ", nameof(RB_Account_ViewModel.Account));
parameters.Add("Account", "%" + query.Account.Trim() + "%");
}
if (query.AccountType > 0)
{
builder.AppendFormat(" AND a.{0}={1} ", nameof(RB_Account_ViewModel.AccountType), (int)query.AccountType);
}
if (query.School_Id > 0)
{
builder.AppendFormat(" AND a.{0}={1} ", nameof(RB_Account_ViewModel.School_Id), query.School_Id);
}
if (query.Group_Id > 0)
{
builder.AppendFormat(" AND a.{0}={1} ", nameof(RB_Account_ViewModel.Group_Id), query.Group_Id);
}
if (query.Id > 0)
{ {
builder.AppendFormat(" AND a.{0}={1} ", nameof(RB_Account_ViewModel.Id), query.Id); builder.AppendFormat(" AND a.{0}={1} ", nameof(RB_Account_ViewModel.AccountId), query.AccountId);
} }
} }
return GetPage<RB_Account_ViewModel>(pageIndex, pageSize, out rowsCount, builder.ToString(), parameters).ToList(); return Get<RB_Account_ViewModel>(builder.ToString(), parameters).ToList();
} }
/// <summary> /// <summary>
...@@ -413,21 +372,12 @@ FROM ...@@ -413,21 +372,12 @@ FROM
{ {
where.AppendFormat($@" AND STR_TO_DATE( CONCAT(DATE_FORMAT(now(),'%Y'),'-',DATE_FORMAT(b.BirthDate,'%m-%d')), '%Y-%m-%d') <= DATE_FORMAT('{query.EndBirthDate}' , '%Y-%m-%d') "); where.AppendFormat($@" AND STR_TO_DATE( CONCAT(DATE_FORMAT(now(),'%Y'),'-',DATE_FORMAT(b.BirthDate,'%m-%d')), '%Y-%m-%d') <= DATE_FORMAT('{query.EndBirthDate}' , '%Y-%m-%d') ");
} }
//if (!string.IsNullOrEmpty(query.StartBirthDate) && !string.IsNullOrEmpty(query.EndBirthDate))
//{
// //OR前面是不跨年,OR后面是跨年
// where.AppendFormat(@"AND (
// (CONCAT(DATE_FORMAT(now(),'%Y'),'-',DATE_FORMAT(b.BirthDate,'%m-%d')) BETWEEN '{0}' AND '{1}')
// OR (CONCAT(YEAR(NOW())+1, '-',DATE_FORMAT(b.BirthDate,'%m-%d')) BETWEEN '{0}' AND '{1}')
// )", query.StartBirthDate, query.EndBirthDate);
//}
} }
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
builder.AppendFormat(@" builder.AppendFormat(@"
SELECT ar.AccountRemark,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 SELECT ar.AccountRemark,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,A.Email,A.DirectSupervisor ,A.LeaveStatus,A.LeaveTime,A.EmployeeTel,A.AccountType,A.Email,IFNULL(A.DirectSupervisor,0) AS DirectSupervisor
,IFNULL(G.GroupName,'') AS GroupName,IFNULL(s.SName,'') AS SchoolName ,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 ,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') ,(CASE WHEN CONCAT(DATE_FORMAT(now(),'%Y'),'-',DATE_FORMAT(BirthDate,'%m-%d')) >= DATE_FORMAT(now(),'%Y-%m-%d')
......
...@@ -781,7 +781,10 @@ namespace Edu.WebApi.Controllers.Course ...@@ -781,7 +781,10 @@ namespace Edu.WebApi.Controllers.Course
public ApiResult GetCourseJobPageList() public ApiResult GetCourseJobPageList()
{ {
var pageModel = Common.Plugin.JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString()); var pageModel = Common.Plugin.JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString());
var query = Common.Plugin.JsonHelper.DeserializeObject<RB_Course_Job_ViewModel>(RequestParm.Msg.ToString()); var query = new RB_Course_Job_ViewModel()
{
JobName=base.ParmJObj.GetStringValue("JobName")
};
query.Group_Id = base.UserInfo.Group_Id; query.Group_Id = base.UserInfo.Group_Id;
query.School_Id = base.UserInfo.School_Id; query.School_Id = base.UserInfo.School_Id;
var list = courseModule.GetCourseJobPageListModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query); var list = courseModule.GetCourseJobPageListModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query);
...@@ -820,6 +823,8 @@ namespace Edu.WebApi.Controllers.Course ...@@ -820,6 +823,8 @@ namespace Edu.WebApi.Controllers.Course
{ {
Common.Plugin.LogHelper.Write(ex, "SetCourseJob"); Common.Plugin.LogHelper.Write(ex, "SetCourseJob");
} }
extModel.Group_Id = base.UserInfo.Group_Id;
extModel.School_Id = base.UserInfo.School_Id;
extModel.CreateTime = DateTime.Now; extModel.CreateTime = DateTime.Now;
extModel.CreateBy = base.UserInfo.Id; extModel.CreateBy = base.UserInfo.Id;
extModel.UpdateBy = base.UserInfo.Id; extModel.UpdateBy = base.UserInfo.Id;
......
...@@ -711,7 +711,8 @@ namespace Edu.WebApi.Controllers.User ...@@ -711,7 +711,8 @@ namespace Edu.WebApi.Controllers.User
qitem.AccountRemark, qitem.AccountRemark,
qitem.Email, qitem.Email,
EmAccountId = qitem.Id, EmAccountId = qitem.Id,
qitem.DirectSupervisor qitem.DirectSupervisor,
DirectSupervisorName= qitem.DirectSupervisor>0?base.GetUserInfo(qitem.DirectSupervisor)?.AccountName??"":"",
}); });
return ApiResult.Success(data: pageModel); return ApiResult.Success(data: pageModel);
} }
...@@ -756,6 +757,8 @@ namespace Edu.WebApi.Controllers.User ...@@ -756,6 +757,8 @@ namespace Edu.WebApi.Controllers.User
Education = (EducationEnum)base.ParmJObj.GetInt("Education"), Education = (EducationEnum)base.ParmJObj.GetInt("Education"),
School_Id = base.ParmJObj.GetInt("School_Id"), School_Id = base.ParmJObj.GetInt("School_Id"),
Email = base.ParmJObj.GetStringValue("Email"), Email = base.ParmJObj.GetStringValue("Email"),
DirectSupervisor=base.ParmJObj.GetInt("DirectSupervisor"),
Account=base.ParmJObj.GetStringValue("Account")
}; };
extModel.CreateBy = base.UserInfo.Id; extModel.CreateBy = base.UserInfo.Id;
extModel.CreateTime = DateTime.Now; extModel.CreateTime = DateTime.Now;
...@@ -866,7 +869,6 @@ namespace Edu.WebApi.Controllers.User ...@@ -866,7 +869,6 @@ namespace Edu.WebApi.Controllers.User
return ApiResult.Failed(message: "密码重置失败"); return ApiResult.Failed(message: "密码重置失败");
} }
} }
} }
/// <summary> /// <summary>
...@@ -918,8 +920,8 @@ namespace Edu.WebApi.Controllers.User ...@@ -918,8 +920,8 @@ namespace Edu.WebApi.Controllers.User
UserIcon = extModel?.UserIcon ?? "", UserIcon = extModel?.UserIcon ?? "",
Status = extModel?.Status ?? 0, Status = extModel?.Status ?? 0,
Email = extModel?.Email ?? "", Email = extModel?.Email ?? "",
//DirectSupervisor = extModel?.DirectSupervisor ?? 0, DirectSupervisor = extModel?.DirectSupervisor ?? 0,
//DirectSupervisorName = base.GetUserInfo(extModel?.DirectSupervisor ?? 0)?.AccountName ?? "" DirectSupervisorName = base.GetUserInfo(extModel?.DirectSupervisor ?? 0)?.AccountName ?? ""
}; };
return ApiResult.Success(data: obj); return ApiResult.Success(data: obj);
} }
......
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