Commit 7f0bd183 authored by 黄奎's avatar 黄奎

页面修改

parent c978ba72
......@@ -1394,130 +1394,6 @@ namespace Edu.Module.User
return result;
}
/// <summary>
/// 获取马上要毕业的学生
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="UserId"></param>
/// <returns></returns>
public List<object> GetStraightwayGraduateStudentModule(int pageIndex, int pageSize, out long rowsCount, int UserId)
{
List<object> result = new List<object>();
var list = order_GuestRepository.GetAllStudentPageRepository(pageIndex, pageSize, out rowsCount, new Model.ViewModel.Sell.RB_Order_Guest_Extend()
{
IsImmediatelyGraduate = 1,
CreateBy = UserId
});
if (list != null && list.Count > 0)
{
foreach (var item in list)
{
result.Add(new
{
item.Id,
item.GuestName,
Mobile = item.StuRealMobile,
item.ContractId,
item.ContractNo,
item.ClassId,
item.ClassName,
item.CourseId,
item.CourseName,
item.Teacher_Id,
item.TeacherName,
item.OrderId,
OrderTime = Common.ConvertHelper.FormatTime(item.OrderTime),
item.EnterID,
item.EnterName,
item.PreferPrice,
item.Income,
item.Refund,
item.TotalHours,
item.ValidClassHours,
item.CompleteHours,
item.SurplusHours,
item.MakeUpHours,
item.AbsenceNum,
item.LeaveNum,
item.EventlogNum,
item.GuestState,
item.GuestStateStr,
GraduationTime = Common.ConvertHelper.FormatDate(item.GraduationTime),
item.School_Id,
item.JoinType,
item.JoinTypeStr,
item.Student_Id,
item.CourseRate,
CourseRateName = item.CourseRate.ToName().Replace("课程", ""),
item.StuCreateBy,
item.StuCreateByName,
AssistList = item.AssistList.Select(qitem => new
{
qitem.Id,
qitem.StuId,
qitem.AssistId,
qitem.AssistName,
qitem.AssistType,
AssistTypeName = qitem.AssistType.ToName()
}),
item.StuChannelId,
item.StuChannelName,
item.CreateType,
CreateTypeName = item.CreateType.ToName(),
item.StuSourceId,
item.StuSourceIdName,
item.EnterpriseName,
item.CourseChapterNo,
item.AppointNum
});
}
}
return result;
}
/// <summary>
/// 今日被跟进学员(被跟进的学员所有协助人可见)
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <returns></returns>
public List<object> GetTodayFollowStudentModule(int pageIndex, int pageSize, out long rowsCount, int UserId)
{
List<object> result = new List<object>();
var query = new RB_Student_Follow_Extend()
{
QueryDate = Common.ConvertHelper.FormatDate(DateTime.Now),
CreateBy = UserId
};
var list = followRepository.GetStudentFollowPageRepository(pageIndex, pageSize, out rowsCount, query);
if (list != null)
{
string createIds = string.Join(",", list.Select(qitem => qitem.CreateBy));
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)
{
var tempEmp = empList?.FirstOrDefault(qitem => qitem.Id == item.CreateBy)?.AccountName ?? "";
result.Add(new
{
item.Id,
item.StuId,
item.StuName,
item.Remark,
CreateByName = tempEmp,
CreateTime = Common.ConvertHelper.FormatTime(item.CreateTime)
});
}
}
return result;
}
/// <summary>
/// 获取未完成的订单
/// </summary>
......@@ -1673,5 +1549,207 @@ namespace Edu.Module.User
}
return result;
}
/// <summary>
/// 今日被跟进学员(被跟进的学员所有协助人可见)
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <returns></returns>
public List<object> GetTodayFollowStudentModule(int pageIndex, int pageSize, out long rowsCount, int UserId)
{
List<object> result = new List<object>();
var query = new RB_Student_Follow_Extend()
{
QueryDate = Common.ConvertHelper.FormatDate(DateTime.Now),
CreateBy = UserId
};
var list = followRepository.GetStudentFollowPageRepository(pageIndex, pageSize, out rowsCount, query);
if (list != null)
{
//客户阶段列表
var stageList = stageRepository.GetStageListRepostory(new Model.Entity.System.RB_Stage()
{
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)
{
var tempEmp = empList?.FirstOrDefault(qitem => qitem.Id == item.CreateBy)?.AccountName ?? "";
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
{
item.Id,
item.StuId,
item.StuName,
item.Remark,
CreateByName = tempEmp,
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 ?? "",
});
}
}
return result;
}
/// <summary>
/// 获取马上要毕业的学生
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="UserId"></param>
/// <returns></returns>
public List<object> GetStraightwayGraduateStudentModule(int pageIndex, int pageSize, out long rowsCount, int UserId)
{
List<object> result = new List<object>();
var list = order_GuestRepository.GetAllStudentPageRepository(pageIndex, pageSize, out rowsCount, new Model.ViewModel.Sell.RB_Order_Guest_Extend()
{
IsImmediatelyGraduate = 1,
CreateBy = UserId
});
if (list != null && list.Count > 0)
{
foreach (var item in list)
{
result.Add(new
{
item.Id,
item.GuestName,
Mobile = item.StuRealMobile,
item.ContractId,
item.ContractNo,
item.ClassId,
item.ClassName,
item.CourseId,
item.CourseName,
item.Teacher_Id,
item.TeacherName,
item.OrderId,
OrderTime = Common.ConvertHelper.FormatTime(item.OrderTime),
item.EnterID,
item.EnterName,
item.PreferPrice,
item.Income,
item.Refund,
item.TotalHours,
item.ValidClassHours,
item.CompleteHours,
item.SurplusHours,
item.MakeUpHours,
item.AbsenceNum,
item.LeaveNum,
item.EventlogNum,
item.GuestState,
item.GuestStateStr,
GraduationTime = Common.ConvertHelper.FormatDate(item.GraduationTime),
item.School_Id,
item.JoinType,
item.JoinTypeStr,
item.Student_Id,
item.CourseRate,
CourseRateName = item.CourseRate.ToName().Replace("课程", ""),
item.StuCreateBy,
item.StuCreateByName,
AssistList = item.AssistList.Select(qitem => new
{
qitem.Id,
qitem.StuId,
qitem.AssistId,
qitem.AssistName,
qitem.AssistType,
AssistTypeName = qitem.AssistType.ToName()
}),
item.StuChannelId,
item.StuChannelName,
item.CreateType,
CreateTypeName = item.CreateType.ToName(),
item.StuSourceId,
item.StuSourceIdName,
item.EnterpriseName,
item.CourseChapterNo,
item.AppointNum
});
}
}
return result;
}
}
}
......@@ -911,7 +911,7 @@ WHERE 1=1 AND A.Status=0 AND class.Status=0 AND class.ClassStatus <>4 AND b.Or
//查询快毕业的学生 HK 2022-05-09新增
if (demodel.IsImmediatelyGraduate == 1)
{
builder.AppendFormat(" AND A.GuestState<>7 AND (A.TotalHours-A.CompleteHours)<=100 ");
builder.AppendFormat(" AND A.GuestState<>7 AND (A.TotalHours-A.CompleteHours)<=20 ");
if (demodel.CreateBy > 0)
{
builder.AppendFormat(" AND(st.CreateBy = {0} OR EXISTS(SELECT 1 FROM rb_student_assist WHERE StuId = st.StuId AND AssistId = {0})) ", demodel.CreateBy);
......
......@@ -3438,28 +3438,13 @@ namespace Edu.WebApi.Controllers.User
/// <returns></returns>
public ApiResult NotBusinessBill()
{
var pageModel = Common.Plugin.JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString());
var pageModel = JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString());
var query = new EducationReceiptQuery()
{
Group_Id = base.UserInfo.Group_Id,
StartTime = base.ParmJObj.GetStringValue("StartTime"),
EndTime = base.ParmJObj.GetStringValue("EndTime"),
Conditon = (EduReceiptConditionEnum)base.ParmJObj.GetInt("Conditon"),
ReceiptType = base.ParmJObj.GetInt("ReceiptType"),
Title = base.ParmJObj.GetStringValue("Title"),
RelationId = base.ParmJObj.GetInt("RelationId")
Conditon = EduReceiptConditionEnum.WaitAgree,
};
if (!string.IsNullOrEmpty(base.ParmJObj.GetStringValue("VerifyStatus")))
{
query.VerifyStatus = base.ParmJObj.GetInt("VerifyStatus", -1);
}
var id = base.ParmJObj.GetInt("Id");
if (id > 0)
{
query.QIds = id.ToString();
}
query.CreateBy = 0;
//query.CreateBy = base.UserInfo.Id;
query.CreateBy = base.UserInfo.Id;
var list = educationReceiptModule.GetEducationReceiptPageModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query);
pageModel.PageData = list;
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