Commit 1563abc7 authored by 黄奎's avatar 黄奎

页面修改

parent eaa9aa9d
......@@ -18,6 +18,8 @@ using Edu.Repository.Grade;
using Edu.Repository.Customer;
using Edu.Model.ViewModel.User;
using Edu.Common.Plugin;
using Edu.Model.ViewModel.Customer;
using Edu.Model.Entity.Customer;
namespace Edu.Module.Duty
{
......@@ -46,6 +48,21 @@ namespace Edu.Module.Duty
/// </summary>
private readonly RB_AccountRepository accountRepository = new RB_AccountRepository();
/// <summary>
/// 学员仓储层对象
/// </summary>
private readonly RB_StudentRepository studentRepository = new RB_StudentRepository();
/// <summary>
/// 学员协助人员
/// </summary>
private readonly RB_Student_AssistRepository student_AssistRepository = new RB_Student_AssistRepository();
/// <summary>
/// 学员日志仓储层对象
/// </summary>
private readonly RB_Student_LogRepository student_LogRepository = new RB_Student_LogRepository();
/// <summary>
/// 获取访客约课分页列表
/// </summary>
......@@ -128,35 +145,51 @@ namespace Edu.Module.Duty
var newId = visitor_ReserveRepository.Insert(model);
model.Id = newId;
flag = newId > 0;
if (flag) {
if (flag)
{
//获取学生信息
//var smodel = studentRepository.GetEntity(model.Visitor_Id);
//if (smodel != null && smodel.StuStage <= Common.Enum.User.StuStageEnum.PreliminaryCommunication)
//{
// Dictionary<string, object> keyValues = new Dictionary<string, object>() {
// { nameof(RB_Student_ViewModel.StuStage), Common.Enum.User.StuStageEnum.Audition}
// };
// List<WhereHelper> wheres = new List<WhereHelper>() {
// new WhereHelper(){
// FiledName = nameof (RB_Student_ViewModel.StuId),
// FiledValue = model.Visitor_Id,
// OperatorEnum =OperatorEnum.Equal
// }
// };
// studentRepository.Update(keyValues, wheres);
// student_LogRepository.Insert(new Model.Entity.Customer.RB_Student_Log()
// {
// LogId = 0,
// CreateBy = model.CreateBy,
// CreateTime = DateTime.Now,
// CreateType = 1,
// Group_Id = model.Group_Id,
// LogContent = "首次试听,客户阶段由'" + (smodel.StuStage.ToName()) + "'自动转换为'" + (Common.Enum.User.StuStageEnum.Audition.ToName()) + "'",
// LogTitle = "客户阶段变更",
// LogType = Common.Enum.Log.StudentLogTypeEnum.BasicInfo,
// StuId = model.Visitor_Id
// });
//}
var smodel = studentRepository.GetEntity(model.Visitor_Id);
if (smodel != null && smodel.StuId > 0)
{
var assistTeacher = student_AssistRepository.GetStudentAssistListRepository(new RB_Student_Assist_Extend()
{
StuId = smodel.StuId
})?.FirstOrDefault(qitem => qitem.AssistType == Common.Enum.User.AssistTypeEnum.Teacher);
string logTitle = "新增协同人员";
string logContent = "";
var empModel = accountRepository.GetEmployeeListRepository(new Employee_ViewModel()
{
AccountType = Common.Enum.User.AccountTypeEnum.Teacher,
AccountId = model.TeacherId
})?.FirstOrDefault();
if (assistTeacher == null)
{
logTitle = "新增协同人员";
student_AssistRepository.Insert(new RB_Student_Assist()
{
CreateBy = model.UpdateBy,
CreateTime = DateTime.Now,
Id = 0,
Status = DateStateEnum.Normal,
StuId = smodel.StuId,
AssistId = empModel?.Id ?? 0,
AssistType = Common.Enum.User.AssistTypeEnum.Teacher,
});
logContent += string.Format("新增协同人员:" + empModel?.EmployeeName);
}
else
{
logTitle = "修改协同人员";
string oldName = accountRepository.GetEmployeeInfo(assistTeacher.AssistId)?.EmployeeName ?? "";
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Student_Assist.AssistId),(empModel?.Id??0) }
};
student_AssistRepository.Update(fileds, new WhereHelper(nameof(RB_Student_Assist.Id), assistTeacher.Id));
logContent += string.Format("修改协同人员:由【{0}】=>【{1}】", oldName, empModel?.EmployeeName);
}
student_LogRepository.AddStuLogRepository(smodel.StuId, Common.Enum.Log.StudentLogTypeEnum.BasicInfo, logTitle, logContent, model.UpdateBy);
}
}
}
return flag;
......
......@@ -340,7 +340,7 @@ FROM
/// <param name="query"></param>
/// <param name="parameters"></param>
/// <returns></returns>
public string GetEmployeeSqlReposiroty(Employee_ViewModel query, DynamicParameters parameters)
private string GetEmployeeSqlReposiroty(Employee_ViewModel query, DynamicParameters parameters)
{
StringBuilder where = new StringBuilder();
StringBuilder where2 = new StringBuilder();
......
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