Commit 83d730e9 authored by 黄奎's avatar 黄奎

页面修改

parent 49cb1511
...@@ -1267,15 +1267,76 @@ namespace Edu.Module.User ...@@ -1267,15 +1267,76 @@ namespace Edu.Module.User
var list = student_AppointmentRepository.GetStudentAppointmentPageRepository(pageIndex, pageSize, out rowsCount, query); var list = student_AppointmentRepository.GetStudentAppointmentPageRepository(pageIndex, pageSize, out rowsCount, query);
if (list != null && list.Count > 0) if (list != null && list.Count > 0)
{ {
string createByIds = string.Join(",", list.Select(qitem => qitem.CreateBy)); //客户阶段列表
List<RB_Account_ViewModel> empList = new List<RB_Account_ViewModel>(); var stageList = stageRepository.GetStageListRepostory(new Model.Entity.System.RB_Stage()
if (!string.IsNullOrEmpty(createByIds)) {
Group_Id = list[0].Group_Id
});
//学员类型列表
var stuTypeList = student_TypeRepository.GetStudentTypeListRepository(new RB_Student_Type_Extend());
//学习目的
var goalList = learningGoalsRepository.GetLearningGoalsListRepository(new Model.ViewModel.System.RB_LearningGoals_Extend());
//渠道列表
var channelList = channelRepository.GetChannelListRepository(new Model.ViewModel.System.RB_Channel_Extend());
//客户需求
var needList = needsRepository.GetNeedsListRepository(new Model.ViewModel.System.RB_Needs_Extend());
string stuIds = string.Join(",", list.Select(qitem => qitem.StuId));
var stuList = studentRepository.GetStudentListRepository(new RB_Student_ViewModel() { StuIds = stuIds }, isQueryCreateType: true, isQueryAssist: false);
//协助人员列表
var assistList = student_AssistRepository.GetStudentAssistListRepository(new RB_Student_Assist_Extend()
{
QStuIds = stuIds
});
List<int> empIds = new List<int>();
//内部介绍人
List<int> stuSourceIdList = Common.ConvertHelper.StringToList(string.Join(",", stuList.Where(qitem => qitem.CreateType == StuCreateTypeEnum.InternalIntroduction).Select(qitem => qitem.StuSourceId)));
if (stuSourceIdList != null && stuSourceIdList.Count > 0)
{
empIds.AddRange(stuSourceIdList);
}
//协助人员
List<int> assistIdList = Common.ConvertHelper.StringToList(string.Join(",", assistList.Select(qitem => qitem.AssistId)));
if (assistIdList != null && assistIdList.Count > 0)
{
empIds.AddRange(assistIdList);
}
//跟进人员创建人
List<int> createByIdList = Common.ConvertHelper.StringToList(string.Join(",", list.Select(qitem => qitem.CreateBy)));
if (createByIdList != null && createByIdList.Count > 0)
{
empIds.AddRange(createByIdList);
}
//学员负责人
List<int> stuCreateByList = Common.ConvertHelper.StringToList(string.Join(",", stuList.Select(qitem => qitem.CreateBy)));
if (stuCreateByList != null && stuCreateByList.Count > 0)
{
empIds.AddRange(stuCreateByList);
}
string createIds = string.Join(",", empIds);
var empList = new List<RB_Account_ViewModel>();
if (!string.IsNullOrEmpty(createIds))
{ {
empList = accountModule.GetAccountListExtModule(new RB_Account_ViewModel() { QIds = createByIds }); empList = accountModule.GetAccountListExtModule(new RB_Account_ViewModel() { QIds = createIds });
} }
foreach (var item in list) foreach (var item in list)
{ {
var tempEmp = empList?.FirstOrDefault(qitem => qitem.Id == item.CreateBy); var tempEmp = empList?.FirstOrDefault(qitem => qitem.Id == item.CreateBy);
var tempStudent = stuList?.FirstOrDefault(qitem => qitem.StuId == item.StuId);
if (tempStudent != null)
{
var tempAssistList = assistList?.Where(qitem => qitem.StuId == item.StuId)?.ToList();
if (tempAssistList != null && tempAssistList.Count > 0)
{
foreach (var subItem in tempAssistList)
{
subItem.AssistName = empList?.FirstOrDefault(qitem => qitem.Id == subItem.AssistId)?.AccountName ?? "";
}
}
tempStudent.AssistList = tempAssistList;
}
result.Add(new result.Add(new
{ {
item.Id, item.Id,
...@@ -1285,6 +1346,22 @@ namespace Edu.Module.User ...@@ -1285,6 +1346,22 @@ namespace Edu.Module.User
EmployeeName = tempEmp?.AccountName, EmployeeName = tempEmp?.AccountName,
CreateTime = Common.ConvertHelper.FormatTime(item.CreateTime), CreateTime = Common.ConvertHelper.FormatTime(item.CreateTime),
item.Feedback, item.Feedback,
CreateTypeName = tempStudent?.CreateType.ToName() ?? "",
StuSourceId = tempStudent?.StuSourceId ?? 0,
StuSourceIdName = tempStudent?.StuSourceIdName ?? "",
AssistList = tempStudent?.AssistList?.Select(qitem => new
{
qitem.AssistType,
AssistTypeName = qitem.AssistType.ToName(),
qitem.AssistId,
qitem.AssistName,
}),
StuStageName = stageList?.FirstOrDefault(qitem => qitem.Id == tempStudent.StuStage)?.StageName ?? "",
StuTypeName = stuTypeList?.FirstOrDefault(qitem => qitem.Id == tempStudent.StuType)?.Name ?? "",
StuCreateByName = empList?.FirstOrDefault(qitem => qitem.Id == tempStudent.CreateBy)?.AccountName ?? "",
StuChannelName = channelList?.FirstOrDefault(qitem => qitem.Id == tempStudent.StuChannel)?.Name ?? "",
StuPurposeName = goalList?.FirstOrDefault(qitem => qitem.Id == tempStudent.StuPurpose)?.Name ?? "",
StuNeedsName = needList?.FirstOrDefault(qitem => qitem.Id == tempStudent.StuNeeds)?.Name ?? "",
}); });
} }
} }
...@@ -1306,22 +1383,100 @@ namespace Edu.Module.User ...@@ -1306,22 +1383,100 @@ namespace Edu.Module.User
var list = student_AppointmentRepository.GetTodayConnectPageRepository(pageIndex, pageSize, out rowsCount, Common.ConvertHelper.FormatDate(DateTime.Now), CreateBy); var list = student_AppointmentRepository.GetTodayConnectPageRepository(pageIndex, pageSize, out rowsCount, Common.ConvertHelper.FormatDate(DateTime.Now), CreateBy);
if (list != null && list.Count > 0) if (list != null && list.Count > 0)
{ {
string createByIds = string.Join(",", list.Select(qitem => qitem.CreateBy)); //客户阶段列表
List<RB_Account_ViewModel> empList = new List<RB_Account_ViewModel>(); var stageList = stageRepository.GetStageListRepostory(new Model.Entity.System.RB_Stage()
if (!string.IsNullOrEmpty(createByIds))
{ {
empList = accountModule.GetAccountListExtModule(new RB_Account_ViewModel() { QIds = createByIds }); Group_Id = list[0].Group_Id
});
//学员类型列表
var stuTypeList = student_TypeRepository.GetStudentTypeListRepository(new RB_Student_Type_Extend());
//学习目的
var goalList = learningGoalsRepository.GetLearningGoalsListRepository(new Model.ViewModel.System.RB_LearningGoals_Extend());
//渠道列表
var channelList = channelRepository.GetChannelListRepository(new Model.ViewModel.System.RB_Channel_Extend());
//客户需求
var needList = needsRepository.GetNeedsListRepository(new Model.ViewModel.System.RB_Needs_Extend());
string stuIds = string.Join(",", list.Select(qitem => qitem.StuId));
var stuList = studentRepository.GetStudentListRepository(new RB_Student_ViewModel() { StuIds = stuIds }, isQueryCreateType: true, isQueryAssist: false);
//协助人员列表
var assistList = student_AssistRepository.GetStudentAssistListRepository(new RB_Student_Assist_Extend()
{
QStuIds = stuIds
});
List<int> empIds = new List<int>();
//内部介绍人
List<int> stuSourceIdList = Common.ConvertHelper.StringToList(string.Join(",", stuList.Where(qitem => qitem.CreateType == StuCreateTypeEnum.InternalIntroduction).Select(qitem => qitem.StuSourceId)));
if (stuSourceIdList != null && stuSourceIdList.Count > 0)
{
empIds.AddRange(stuSourceIdList);
}
//协助人员
List<int> assistIdList = Common.ConvertHelper.StringToList(string.Join(",", assistList.Select(qitem => qitem.AssistId)));
if (assistIdList != null && assistIdList.Count > 0)
{
empIds.AddRange(assistIdList);
}
//跟进人员创建人
List<int> createByIdList = Common.ConvertHelper.StringToList(string.Join(",", list.Select(qitem => qitem.CreateBy)));
if (createByIdList != null && createByIdList.Count > 0)
{
empIds.AddRange(createByIdList);
}
//学员负责人
List<int> stuCreateByList = Common.ConvertHelper.StringToList(string.Join(",", stuList.Select(qitem => qitem.CreateBy)));
if (stuCreateByList != null && stuCreateByList.Count > 0)
{
empIds.AddRange(stuCreateByList);
} }
string createIds = string.Join(",", empIds);
var empList = new List<RB_Account_ViewModel>();
if (!string.IsNullOrEmpty(createIds))
{
empList = accountModule.GetAccountListExtModule(new RB_Account_ViewModel() { QIds = createIds });
}
foreach (var item in list) foreach (var item in list)
{ {
var tempEmp = empList?.FirstOrDefault(qitem => qitem.Id == item.CreateBy); var tempEmp = empList?.FirstOrDefault(qitem => qitem.Id == item.CreateBy);
var tempStudent = stuList?.FirstOrDefault(qitem => qitem.StuId == item.StuId);
if (tempStudent != null)
{
var tempAssistList = assistList?.Where(qitem => qitem.StuId == item.StuId)?.ToList();
if (tempAssistList != null && tempAssistList.Count > 0)
{
foreach (var subItem in tempAssistList)
{
subItem.AssistName = empList?.FirstOrDefault(qitem => qitem.Id == subItem.AssistId)?.AccountName ?? "";
}
}
tempStudent.AssistList = tempAssistList;
}
result.Add(new result.Add(new
{ {
item.StuId, item.StuId,
item.StuName, item.StuName,
item.CreateBy, item.CreateBy,
EmployeeName = tempEmp?.AccountName, CreateByName = tempEmp?.AccountName,
CreateTime = Common.ConvertHelper.FormatTime(item.CreateTime), CreateTime = Common.ConvertHelper.FormatTime(item.CreateTime),
CreateTypeName = tempStudent?.CreateType.ToName() ?? "",
StuSourceId = tempStudent?.StuSourceId ?? 0,
StuSourceIdName = tempStudent?.StuSourceIdName ?? "",
AssistList = tempStudent?.AssistList?.Select(qitem => new
{
qitem.AssistType,
AssistTypeName = qitem.AssistType.ToName(),
qitem.AssistId,
qitem.AssistName,
}),
StuStageName = stageList?.FirstOrDefault(qitem => qitem.Id == tempStudent.StuStage)?.StageName ?? "",
StuTypeName = stuTypeList?.FirstOrDefault(qitem => qitem.Id == tempStudent.StuType)?.Name ?? "",
StuCreateByName = empList?.FirstOrDefault(qitem => qitem.Id == tempStudent.CreateBy)?.AccountName ?? "",
StuChannelName = channelList?.FirstOrDefault(qitem => qitem.Id == tempStudent.StuChannel)?.Name ?? "",
StuPurposeName = goalList?.FirstOrDefault(qitem => qitem.Id == tempStudent.StuPurpose)?.Name ?? "",
StuNeedsName = needList?.FirstOrDefault(qitem => qitem.Id == tempStudent.StuNeeds)?.Name ?? "",
}); });
} }
} }
...@@ -2050,7 +2205,6 @@ namespace Edu.Module.User ...@@ -2050,7 +2205,6 @@ namespace Edu.Module.User
var list = followRepository.GetStudentFollowPageRepository(pageIndex, pageSize, out rowsCount, query); var list = followRepository.GetStudentFollowPageRepository(pageIndex, pageSize, out rowsCount, query);
if (list != null) if (list != null)
{ {
//客户阶段列表 //客户阶段列表
var stageList = stageRepository.GetStageListRepostory(new Model.Entity.System.RB_Stage() var stageList = stageRepository.GetStageListRepostory(new Model.Entity.System.RB_Stage()
{ {
......
...@@ -3326,7 +3326,7 @@ namespace Edu.WebApi.Controllers.User ...@@ -3326,7 +3326,7 @@ namespace Edu.WebApi.Controllers.User
{ {
var pageModel = Common.Plugin.JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString()); var pageModel = Common.Plugin.JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString());
var userId = 0; var userId = 0;
userId = base.UserInfo.Id; //userId = base.UserInfo.Id;
var list = studentModule.GetStudentAppointmentPageModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, userId); var list = studentModule.GetStudentAppointmentPageModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, userId);
pageModel.PageData = list; pageModel.PageData = list;
pageModel.Count = rowsCount; pageModel.Count = rowsCount;
......
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