Commit 67b330b6 authored by liudong1993's avatar liudong1993

1

parent 0f220e41
......@@ -111,7 +111,10 @@ namespace Edu.Module.Course
/// 助教
/// </summary>
private readonly RB_AssistRepository assistRepository = new RB_AssistRepository();
/// <summary>
/// 学员协助人员仓储层对象
/// </summary>
private readonly RB_Student_AssistRepository student_AssistRepository = new RB_Student_AssistRepository();
/// <summary>
/// 学生
/// </summary>
......@@ -1174,6 +1177,50 @@ namespace Edu.Module.Course
}
#endregion
#region 更新客人协助人员
if (demodel.OrderIdentify == 2 && (demodel.HelpEnterId > 0 || demodel.CourseConsultantId > 0)) {
//客户转订单这种适配
int StuId = StuList.FirstOrDefault().StuId;
//更新协助人员
var list = student_AssistRepository.GetStudentAssistListRepository(new RB_Student_Assist_Extend()
{
StuId = StuId
});
if (demodel.HelpEnterId > 0) {
var assModel = list.Where(x => x.AssistType == Common.Enum.User.AssistTypeEnum.Teacher).FirstOrDefault();
if (assModel == null) {
student_AssistRepository.Insert(new Model.Entity.Customer.RB_Student_Assist()
{
Id = 0,
AssistId = demodel.HelpEnterId,
AssistType = Common.Enum.User.AssistTypeEnum.Teacher,
CreateBy = userInfo.Id,
CreateTime = DateTime.Now,
Status = DateStateEnum.Normal,
StuId = StuId
});
}
}
//更新课程顾问
if (demodel.CourseConsultantId > 0) {
var assModel = list.Where(x => x.AssistType == Common.Enum.User.AssistTypeEnum.CourseAdviser).FirstOrDefault();
if (assModel == null)
{
student_AssistRepository.Insert(new Model.Entity.Customer.RB_Student_Assist()
{
Id = 0,
AssistId = demodel.CourseConsultantId,
AssistType = Common.Enum.User.AssistTypeEnum.CourseAdviser,
CreateBy = userInfo.Id,
CreateTime = DateTime.Now,
Status = DateStateEnum.Normal,
StuId = StuId
});
}
}
}
#endregion
#region 推送订单报入日志
var queryNotifyManager = accountRepository.GetWorkUserIdByDictRepository("Push_NewOrder");
var param = new RB_Class_ViewModel()
......
......@@ -332,6 +332,29 @@ namespace Edu.Module.Course
}
int RenewNum = glist.Select(x => x.Mobile).Distinct().Count();//续费订单数量
//获取该学生的负责人
int EnterId = 0;
string EnterName = "";
var empModel = accountRepository.GetEmployeeInfo(userInfo.Id);
if (empModel.UserRole == UserRoleEnum.MarketPersion)
{
EnterId = empModel.Id;
EnterName = empModel.EmployeeName;
}
else {
int SaleId = StuList.FirstOrDefault().CreateBy;
if (SaleId != userInfo.Id)
{
//自己负责的
empModel = accountRepository.GetEmployeeInfo(SaleId);
if (empModel.UserRole == UserRoleEnum.MarketPersion)
{
EnterId = empModel.Id;
EnterName = empModel.EmployeeName;
}
}
}
return new
{
CustomerId,
......@@ -342,7 +365,9 @@ namespace Edu.Module.Course
x.StuName,
x.StuTel,
x.IsRenewGuest
})
}),
EnterId,
EnterName
};
}
......
......@@ -537,6 +537,7 @@ namespace Edu.WebApi.Controllers.Course
StuIds = base.ParmJObj.GetStringValue("StuIds"),
OrderIdentify = base.ParmJObj.GetInt("OrderIdentify"),
CourseConsultantId = base.ParmJObj.GetInt("CourseConsultantId"),
EnterID = base.ParmJObj.GetInt("EnterID")
};
var IsInsertClass = base.ParmJObj.GetInt("IsChaBan");
if (IsInsertClass == 1)
......@@ -574,7 +575,10 @@ namespace Edu.WebApi.Controllers.Course
demodel.School_Id = userInfo.School_Id;
demodel.Dept_Id = userInfo.DeptId;
demodel.OrderForm = OrderFormEnum.Computer;
demodel.EnterID = userInfo.Id;
if (demodel.OrderIdentify != 2)
{
demodel.EnterID = userInfo.Id; //由前端传递了, 可能会不存在 (此字段为市场人员)
}
demodel.OrderState = OrderStateEnum.Normal;
demodel.TradeWay = TradeWayEnum.OnLine;
demodel.CreateBy = userInfo.Id;
......
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