Commit 63c18fb2 authored by 黄奎's avatar 黄奎

页面修改

parent 6d0e6e3f
......@@ -90,11 +90,6 @@ namespace Edu.Model.ViewModel.Course
/// </summary>
public List<RB_Education_Contract_ViewModel> ContractList { get; set; }
/// <summary>
/// 合同状态(1-正常)
/// </summary>
public int ContractStatus { get; set; }
/// <summary>
/// 报名开始时间
/// </summary>
......
......@@ -1692,11 +1692,8 @@ namespace Edu.Module.Course
item.DirectorRemarkList = remarkList.Where(x => x.OrderId == item.OrderId && x.Type == 4).ToList();
item.GuestList = guestList.Where(x => x.OrderId == item.OrderId).ToList();
item.ContractList = clist.Where(x => x.OrderId == item.OrderId).ToList();
item.ContractStatus = 0;
if (item.GuestList != null && item.GuestList.Count > 0)
{
int guestContractCount = 0;
foreach (var subItem in item.GuestList)
{
var contractModel = clist.Where(x => x.OrderId == item.OrderId && x.GuestId == subItem.Id)?.FirstOrDefault();
......@@ -1715,7 +1712,6 @@ namespace Edu.Module.Course
else if (subItem.ContractStatus == 2)
{
ContractStatusStr = "审核通过";
guestContractCount++;
}
else if (subItem.ContractStatus == 3)
{
......@@ -1727,10 +1723,6 @@ namespace Edu.Module.Course
}
subItem.ContractStatusStr = ContractStatusStr;
}
if (guestContractCount == item.GuestList.Count)
{
item.ContractStatus = 1;
}
}
}
}
......
......@@ -75,7 +75,7 @@ namespace Edu.Module.User
/// <returns></returns>
public List<RB_Assist_ViewModel> GetAssistPageListModule(int pageIndex, int pageSize, out long rowsCount, RB_Assist_ViewModel query)
{
var list= 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));
......@@ -100,7 +100,7 @@ namespace Edu.Module.User
}
/// <summary>
/// 添加修改助教
///【员工管理端】添加修改助教
/// </summary>
/// <param name="model"></param>
/// <param name="isUpdateBasic">是否更新基础资料</param>
......@@ -134,13 +134,13 @@ namespace Edu.Module.User
model.LeaveTime = null;
}
fileds.Add(nameof(RB_Assist_ViewModel.IDCard), model.IDCard);
fileds.Add(nameof(RB_Assist_ViewModel.Sex),model.Sex);
fileds.Add(nameof(RB_Assist_ViewModel.EntryTime),model.EntryTime);
fileds.Add(nameof(RB_Assist_ViewModel.Address),model.Address);
fileds.Add(nameof(RB_Assist_ViewModel.BirthDate),model.BirthDate);
fileds.Add(nameof(RB_Assist_ViewModel.LeaveStatus),model.LeaveStatus);
fileds.Add(nameof(RB_Assist_ViewModel.LeaveTime),model.LeaveTime);
fileds.Add(nameof(RB_Assist_ViewModel.Education),model.Education);
fileds.Add(nameof(RB_Assist_ViewModel.Sex), model.Sex);
fileds.Add(nameof(RB_Assist_ViewModel.EntryTime), model.EntryTime);
fileds.Add(nameof(RB_Assist_ViewModel.Address), model.Address);
fileds.Add(nameof(RB_Assist_ViewModel.BirthDate), model.BirthDate);
fileds.Add(nameof(RB_Assist_ViewModel.LeaveStatus), model.LeaveStatus);
fileds.Add(nameof(RB_Assist_ViewModel.LeaveTime), model.LeaveTime);
fileds.Add(nameof(RB_Assist_ViewModel.Education), model.Education);
fileds.Add(nameof(RB_Assist_ViewModel.Email), model.Email);
}
string logContent = "";
......@@ -212,8 +212,8 @@ namespace Edu.Module.User
}
if (flag)
{
var account= accountModule.GetAccountListModule(new RB_Account_ViewModel() { AccountType = AccountTypeEnum.Assist, AccountId = model.AId })?.FirstOrDefault();
int Id = account?.Id??0;
var account = accountModule.GetAccountListModule(new RB_Account_ViewModel() { AccountType = AccountTypeEnum.Assist, AccountId = model.AId })?.FirstOrDefault();
int Id = account?.Id ?? 0;
flag = accountModule.SetAccountModule(new RB_Account_ViewModel()
{
Id = Id,
......@@ -233,6 +233,89 @@ namespace Edu.Module.User
return flag;
}
/// <summary>
/// 【助教端】添加修改助教
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public bool SetAssistModule_V2(RB_Assist_ViewModel model)
{
bool flag;
if (model.AId > 0)
{
var oldModel = GetAssistModule(model.AId);
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Assist_ViewModel.AssistName),model.AssistName.Trim() },
{nameof(RB_Assist_ViewModel.AssistTel),model.AssistTel },
{nameof(RB_Assist_ViewModel.AssistIcon),model.AssistIcon },
{nameof(RB_Assist_ViewModel.UpdateBy),model.UpdateBy },
{nameof(RB_Assist_ViewModel.UpdateTime),model.UpdateTime },
};
fileds.Add(nameof(RB_Assist_ViewModel.Dept_Id), model.Dept_Id);
fileds.Add(nameof(RB_Assist_ViewModel.Post_Id), model.Post_Id);
fileds.Add(nameof(RB_Assist_ViewModel.AssistIntro), model.AssistIntro);
fileds.Add(nameof(RB_Assist_ViewModel.Teacher_Id), model.Teacher_Id);
fileds.Add(nameof(RB_Assist_ViewModel.School_Id), model.School_Id);
string logContent = "";
if (model.AssistName != oldModel.AssistName)
{
logContent += string.Format(",将姓名由【{0}】修改为【{1}】。", oldModel.AssistName, model.AssistName);
}
if (model.AssistTel != oldModel.AssistTel)
{
logContent += string.Format(",将电话由【{0}】修改为【{1}】。", oldModel.AssistTel, model.AssistTel);
}
if (model.AssistIntro != oldModel.AssistIntro)
{
logContent += string.Format(",将简介由【{0}】修改为【{1}】。", oldModel.AssistIntro, model.AssistIntro);
}
if (model.AssistIcon != oldModel.AssistIcon)
{
logContent += string.Format(",将头像由【{0}】修改为【{1}】。", oldModel.AssistIcon, model.AssistIcon);
}
if (!string.IsNullOrEmpty(logContent))
{
//新增日志
userChangeLogModule.SetUserChangeLogModule(model.CreateBy, model.Group_Id, model.School_Id, logContent, model.AId, AccountTypeEnum.Assist);
}
flag = assistRepository.Update(fileds, new WhereHelper(nameof(RB_Assist.AId), model.AId));
}
else
{
var newId = assistRepository.Insert(model);
model.AId = newId;
userChangeLogModule.SetUserChangeLogModule(model.CreateBy, model.Group_Id, model.School_Id, "新建助教用户", newId, AccountTypeEnum.Assist);
flag = newId > 0;
}
if (flag)
{
var account = accountModule.GetAccountListModule(new RB_Account_ViewModel() { AccountType = AccountTypeEnum.Assist, AccountId = model.AId })?.FirstOrDefault();
int Id = account?.Id ?? 0;
if (Id == 0)
{
flag = accountModule.SetAccountModule(new RB_Account_ViewModel()
{
Id = Id,
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,
DirectSupervisor = model.DirectSupervisor
});
}
}
return flag;
}
/// <summary>
/// 添加修改助教部门
/// </summary>
......@@ -352,7 +435,7 @@ namespace Edu.Module.User
{nameof(RB_Assist.LeaveTime),model.LeaveTime },
{nameof(RB_Assist.UpdateBy),model.UpdateBy },
{nameof(RB_Assist.UpdateTime),model.UpdateTime },
};
string logContent = "";
if (model.LeaveStatus != oldModel.LeaveStatus)
......@@ -409,7 +492,7 @@ namespace Edu.Module.User
flag = assistRepository.Update(fileds, new WhereHelper(nameof(RB_Assist.AId), AId));
var accountList = accountModule.GetAccountListExtModule(new RB_Account_ViewModel()
{
AccountId=model.AId,
AccountId = model.AId,
Account = model.AssistTel,
AccountType = AccountTypeEnum.Assist
});
......
......@@ -114,7 +114,7 @@ namespace Edu.Module.User
}
/// <summary>
/// 新增修改讲师
/// 员工管理端(新增修改讲师)
/// </summary>
/// <param name="model"></param>
/// <param name="isUpdateBasic">是否更新基础资料</param>
......@@ -238,13 +238,129 @@ namespace Edu.Module.User
flag = newId > 0;
}
if (flag)
{
var account = accountModule.GetAccountListModule(new RB_Account_ViewModel() { AccountType = AccountTypeEnum.Teacher, AccountId = model.TId })?.FirstOrDefault();
int Id = account?.Id ?? 0;
if (Id == 0)
{
flag = accountModule.SetAccountModule(new RB_Account_ViewModel()
{
Id = Id,
Account = model.TeacherAccount,
Password = Common.DES.Encrypt(Common.Config.DefaultPwd),
AccountType = AccountTypeEnum.Teacher,
AccountId = model.TId,
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
});
}
}
return flag;
}
/// <summary>
/// 教师端(新增修改讲师)
/// </summary>
/// <param name="model"></param>
/// <param name="isUpdateBasic">是否更新基础资料</param>
/// <returns></returns>
public bool SetTeacherModule_V2(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.UpdateBy),model.UpdateBy },
{nameof(RB_Teacher_ViewModel.UpdateTime),model.UpdateTime },
{nameof(RB_Teacher_ViewModel.School_Id),model.School_Id },
};
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);
fileds.Add(nameof(RB_Teacher_ViewModel.Dept_Id), model.Dept_Id);
fileds.Add(nameof(RB_Teacher_ViewModel.Post_Id), model.Post_Id);
fileds.Add(nameof(RB_Teacher_ViewModel.BaseStuNum), model.BaseStuNum);
fileds.Add(nameof(RB_Teacher_ViewModel.BaseHourFee), model.BaseHourFee);
#region 修改日志
string logContent = "";
if (model.TeacherName != oldModel.TeacherName)
{
logContent += string.Format(",将姓名由【{0}】修改为【{1}】。", oldModel.TeacherName, model.TeacherName);
}
if (model.TeacherTel != oldModel.TeacherTel)
{
logContent += string.Format(",将电话由【{0}】修改为【{1}】。", oldModel.TeacherTel, model.TeacherTel);
}
if (model.BaseStuNum != oldModel.BaseStuNum)
{
logContent += string.Format(",将带班基础人数由【{0}】修改为【{1}】。", oldModel.BaseStuNum, model.BaseStuNum);
}
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.Education != oldModel.Education)
{
logContent += string.Format(",将学历由【{0}】修改为【{1}】。", oldModel.Education.ToName(), model.Education.ToName());
}
if (model.Email != oldModel.Email)
{
logContent += string.Format(",将邮箱由【{0}】修改为【{1}】。", oldModel.Email, model.Email);
}
if (model.BaseHourFee != oldModel.BaseHourFee)
{
logContent += string.Format(",将基础课时费由【{0}】修改为【{1}】。", oldModel.BaseHourFee, model.BaseHourFee);
}
if (model.BaseStuNum != oldModel.BaseStuNum)
{
logContent += string.Format(",将基础带班人数由【{0}】修改为【{1}】。", oldModel.BaseStuNum, model.BaseStuNum);
}
if (!string.IsNullOrEmpty(logContent))
{
//新增日志
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));
}
else
{
var newId = teacherRepository.Insert(model);
model.TId = newId;
userChangeLogModule.SetUserChangeLogModule(model.CreateBy, model.Group_Id, model.School_Id, "新建教师用户", newId, AccountTypeEnum.Teacher);
flag = newId > 0;
}
if (flag)
{
var account = accountModule.GetAccountListModule(new RB_Account_ViewModel() { AccountType = AccountTypeEnum.Teacher, AccountId = model.TId })?.FirstOrDefault();
int Id = account?.Id ?? 0;
flag = accountModule.SetAccountModule(new RB_Account_ViewModel()
{
Id = Id,
Account = model.TeacherAccount,
Account = model.TeacherTel,
Password = Common.DES.Encrypt(Common.Config.DefaultPwd),
AccountType = AccountTypeEnum.Teacher,
AccountId = model.TId,
......
......@@ -1071,7 +1071,6 @@ namespace Edu.WebApi.Controllers.Course
z.ContractStatus,
z.ContractStatusStr,
}),
x.ContractStatus,
ContractList = x?.ContractList.Select(z => new {
z.Id,
z.StudentName,
......@@ -1337,7 +1336,6 @@ namespace Edu.WebApi.Controllers.Course
z.GuestName,
z.GuestState
}),
ContractStatus=1,//留学就业订单还没有合同(默认1)
})
};
return ApiResult.Success("", pageModel);
......
......@@ -400,7 +400,7 @@ namespace Edu.WebApi.Controllers.User
extModel.UpdateBy = base.UserInfo.Id;
extModel.UpdateTime = DateTime.Now;
extModel.Group_Id = base.UserInfo.Group_Id;
bool flag = teacherModule.SetTeacherModule(extModel, isUpdateBasic: true);
bool flag = teacherModule.SetTeacherModule_V2(extModel, isUpdateBasic: true);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
......@@ -548,7 +548,7 @@ namespace Edu.WebApi.Controllers.User
extModel.UpdateTime = DateTime.Now;
extModel.Group_Id = base.UserInfo.Group_Id;
bool flag = assistModule.SetAssistModule(extModel, isUpdateBasic: true);
bool flag = assistModule.SetAssistModule_V2(extModel);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
......
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