Commit b2d6812e authored by liudong1993's avatar liudong1993

1

parents 45aa2201 faeea1b1
......@@ -36,7 +36,7 @@ namespace Edu.Model.Entity.User
public decimal AttendClassHourScore { get; set; }
/// <summary>
/// 线上与学生互动
/// 微信互动次
/// </summary>
public decimal OnLineInteractive { get; set; }
......
......@@ -29,5 +29,10 @@ namespace Edu.Model.ViewModel.Customer
/// 结束时间
/// </summary>
public string EndDate { get; set; }
/// <summary>
/// 学员姓名
/// </summary>
public string StuName { get; set; }
}
}
......@@ -10,6 +10,11 @@ namespace Edu.Model.ViewModel.Customer
/// </summary>
public class RB_Student_Follow_Extend : RB_Student_Follow
{
/// <summary>
/// 学员姓名
/// </summary>
public string StuName { get; set; }
/// <summary>
/// 学员编号【查询使用】
/// </summary>
......@@ -49,5 +54,10 @@ namespace Edu.Model.ViewModel.Customer
/// 单资源回访平均数~~~就是一条资源跟进了几次 【平均】
/// </summary>
public decimal AgFollow { get; set; }
/// <summary>
/// 查询指定日期跟进记录
/// </summary>
public string QueryDate { get; set; }
}
}
......@@ -235,5 +235,13 @@ namespace Edu.Model.ViewModel.Sell
/// 学员数量
/// </summary>
public int StudentNum { get; set; }
/// <summary>
/// 是否查询快毕业的学生
/// </summary>
public int IsImmediatelyGraduate
{
get; set;
}
}
}
......@@ -148,5 +148,10 @@ namespace Edu.Model.ViewModel.User
/// 订单创建时间
/// </summary>
public DateTime OrderCreateTime { get; set; }
/// <summary>
/// 查询未领取合同学员
/// </summary>
public int IsNotContract { get; set; }
}
}
......@@ -445,5 +445,10 @@ namespace Edu.Model.ViewModel.User
/// 查询类型(1-课程顾问,2-老师,3-市场)
/// </summary>
public int QueryTpye { get; set; }
/// <summary>
/// 查询未跟进学员
/// </summary>
public int IsQueryNotFollow { get; set; }
}
}
\ No newline at end of file
......@@ -142,6 +142,7 @@ namespace Edu.Module.Course
/// 合同
/// </summary>
private readonly RB_Education_ContractRepository education_ContractRepository = new RB_Education_ContractRepository();
/// <summary>
/// 合同协调金额
/// </summary>
......
......@@ -95,11 +95,6 @@ namespace Edu.Module.Course
/// </summary>
private readonly ClassModule classModule = new ClassModule();
/// <summary>
/// 账号处理类
/// </summary>
private readonly User.AccountModule accountModule = new User.AccountModule();
/// <summary>
/// 课程优惠信息
/// </summary>
......@@ -115,24 +110,6 @@ namespace Edu.Module.Course
/// </summary>
private readonly RB_Education_ReceiptRepository education_ReceiptRepository = new RB_Education_ReceiptRepository();
/// <summary>
/// 学员协助
/// </summary>
private readonly RB_Student_AssistRepository student_AssistRepository = new RB_Student_AssistRepository();
/// <summary>
/// 同业
/// </summary>
private readonly RB_CustomerRepository customerRepository = new RB_CustomerRepository();
/// <summary>
/// 学生仓储层对象
/// </summary>
private readonly RB_StudentRepository studentRepository = new RB_StudentRepository();
/// <summary>
/// 约课记录
/// </summary>
private readonly RB_Scroll_AppointmentRepository scroll_AppointmentRepository = new RB_Scroll_AppointmentRepository();
/// <summary>
/// 计算学员退课金额
/// </summary>
......@@ -460,93 +437,6 @@ namespace Edu.Module.Course
public List<RB_Order_Guest_Extend> GetAllStudentPageModule(int pageIndex, int pageSize, out long rowsCount, RB_Order_Guest_Extend demodel)
{
var orderstudentList = order_GuestRepository.GetAllStudentPageRepository(pageIndex, pageSize, out rowsCount, demodel);
if (orderstudentList.Any())
{
//课程顾问 协助老师 负责人; 客户来源 来源关联人
string stuIds = string.Join(",", orderstudentList.Select(x => x.StuId).Distinct().ToList());
//协助人员列表
var assistList = student_AssistRepository.GetStudentAssistListRepository(new Model.ViewModel.Customer.RB_Student_Assist_Extend()
{
QStuIds = stuIds
});
//内部介绍人
List<int> empIdList = Common.ConvertHelper.StringToList(string.Join(",", orderstudentList.Where(qitem => qitem.CreateType == StuCreateTypeEnum.InternalIntroduction).Select(qitem => qitem.StuSourceId)));
List<int> aIds = Common.ConvertHelper.StringToList(string.Join(",", assistList.Select(qitem => qitem.AssistId)));
List<RB_Account_ViewModel> accountList = new List<RB_Account_ViewModel>();
if (aIds != null && aIds.Count > 0)
{
empIdList.AddRange(aIds);
}
if (empIdList != null && empIdList.Count > 0)
{
accountList = accountModule.GetAccountListExtModule(new RB_Account_ViewModel() { QIds = string.Join(",", empIdList) });
}
//同业录入列表
List<Model.ViewModel.Customer.RB_Customer_Extend> customerList = new List<Model.ViewModel.Customer.RB_Customer_Extend>();
List<int> customerIdList = Common.ConvertHelper.StringToList(string.Join(",", orderstudentList.Where(qitem => qitem.CreateType == StuCreateTypeEnum.CustomerInput).Select(qitem => qitem.StuSourceId)));
if (customerIdList != null && customerIdList.Count > 0)
{
customerList = customerRepository.GetCustomerListRepository(new Model.ViewModel.Customer.RB_Customer_Extend()
{
CustomerIds = string.Join(",", customerIdList)
});
}
List<RB_Student_ViewModel> transStudentList = new List<RB_Student_ViewModel>();
//转介人列表
List<int> transIdList = Common.ConvertHelper.StringToList(string.Join(",", orderstudentList.Where(qitem => qitem.CreateType == StuCreateTypeEnum.TransIntroduction).Select(qitem => qitem.StuSourceId)));
if (transIdList != null && transIdList.Count > 0)
{
transStudentList = studentRepository.GetStudentListRepository(new RB_Student_ViewModel()
{
StuIds = string.Join(",", transIdList)
});
}
string GuestIds = string.Join(",", orderstudentList.Select(x => x.Id));
var appointList = scroll_AppointmentRepository.GetAppointList(new Model.ViewModel.Scroll.RB_Scroll_Appointment_ViewModel() { Group_Id = demodel.Group_Id, GuestIds = GuestIds, State = CourseAppointStateEnum.WaitCourse });
foreach (var item in orderstudentList)
{
var tempAssistList = assistList?.Where(qitem => qitem.StuId == item.StuId)?.ToList();
foreach (var sItem in tempAssistList)
{
sItem.AssistName = accountList?.FirstOrDefault(qitem => qitem.Id == sItem.AssistId)?.AccountName ?? "";
}
item.AssistList = tempAssistList;
if (item.CreateType == StuCreateTypeEnum.InternalIntroduction)
{
item.StuSourceIdName = accountList?.FirstOrDefault(qitem => qitem.Id == item.StuSourceId)?.AccountName ?? "";
}
else if (item.CreateType == StuCreateTypeEnum.CustomerInput)
{
var tempCustomer = customerList?.FirstOrDefault(qitem => qitem.CustomerId == item.StuSourceId);
item.StuSourceIdName = tempCustomer?.CustomerName ?? "";
if (tempCustomer != null)
{
if (tempCustomer.CustomerType == Common.Enum.Customer.CatetoryTypeEnum.Other)
{
item.EnterpriseName = tempCustomer?.EnterpriseName ?? "";
}
else
{
item.EnterpriseName = tempCustomer?.CategoryName ?? "";
}
}
else
{
item.EnterpriseName = "";
}
}
else if (item.CreateType == StuCreateTypeEnum.TransIntroduction)
{
item.StuSourceIdName = transStudentList?.FirstOrDefault(qitem => qitem.StuId == item.StuSourceId)?.StuName ?? "";
}
item.AppointNum = appointList.Where(x => x.GuestId == item.Id)?.Count() ?? 0;
}
}
return orderstudentList;
}
......
This diff is collapsed.
......@@ -412,8 +412,7 @@ namespace Edu.Module.User
index++;
}
item.OnLineInteractive = GetTeacherAndStudentScore(item.FinishFollow, item.TotalFollow);
item.OnLineInteractiveScore = item.OnLineInteractive;
item.OnLineInteractiveScore = GetTeacherAndStudentScore(item.FinishFollow, item.TotalFollow);
//+ item.AttendClassHourScore
item.TotalScore = (item.StudentCount + item.RenewScore
+ item.UpgradeScore + item.TransScore + item.TrialSpeakScore - item.TruancyScore - item.WithdrawsScore - item.ComplaintScore
......@@ -586,13 +585,9 @@ namespace Edu.Module.User
{
foreach (var item in list)
{
var tempAssessment = teacherAssessmentList?.Where(qitem => qitem.TeacherId == item.TeacherId)?.FirstOrDefault();
item.AssessmentScore = tempAssessment?.TotalScore ?? 0;
item.OnLineInteractive = 0;
item.OnLineInteractive = GetTeacherAndStudentScore(item.FinishFollow, item.TotalFollow);
item.OnLineInteractiveScore = item.OnLineInteractive;
//+ item.AttendClassHourScore
item.OnLineInteractiveScore = GetTeacherAndStudentScore(item.FinishFollow, item.TotalFollow);
item.TotalScore = (item.StudentCount + item.RenewScore
+ item.UpgradeScore + item.TransScore + item.TrialSpeakScore - item.TruancyScore - item.WithdrawsScore - item.ComplaintScore
- item.TeacherBeLateScore + item.MiniAppPractiseScore + item.MiniAppTimeScore
......@@ -601,10 +596,8 @@ namespace Edu.Module.User
+ item.SpeakClassScore + item.SpeakVipScore * 2 - item.SpeakFailScore + item.GradeTestScore
);
}
foreach (var item in list)
{
var tempAssessment = teacherAssessmentList?.Where(qitem => qitem.TeacherId == item.TeacherId)?.FirstOrDefault();
int teacherCount = 1;
var teacherModel = teacherList.FirstOrDefault(qitem => qitem.AccountId == item.TeacherId);
......@@ -2926,7 +2919,7 @@ namespace Edu.Module.User
//获取老师迟到早退信息
checkList = Edu.ThirdCore.QYWinXin.QYWeiXinHelper.GetWeChatCheckList(workUserIds, newDate);
//获取老师与学员沟通次数
//messageList = Edu.ThirdCore.QYWinXin.QYWeiXinHelper.GetWechatStudentStatic(workUserIds, newDate);
messageList = Edu.ThirdCore.QYWinXin.QYWeiXinHelper.GetWechatStudentStatic(workUserIds, newDate);
int times = 1;
int newDay = newDate.Day;
//本月最后一天
......@@ -2971,8 +2964,8 @@ namespace Edu.Module.User
FinishFollow= procModel?.FinishFollow??0,
TotalFollow = procModel?.TotalFollow ?? 0,
};
newModel.OnLineInteractive = GetTeacherAndStudentScore(newModel.FinishFollow, newModel.TotalFollow);
newModel.OnLineInteractive = newModel.OnLineInteractiveScore;
newModel.OnLineInteractive = messageList?.FirstOrDefault(qitem => qitem.Acctid == item.WorkUserId)?.MessageCount ?? 0;
newModel.OnLineInteractiveScore = GetTeacherAndStudentScore(newModel.FinishFollow, newModel.TotalFollow); ;
//newModel.N5ClassHours = procModel?.N5ClassHours ?? 0;
//newModel.N5ClassHoursScore = procModel?.N5ClassHoursScore ?? 0;
//newModel.N4ClassHours = procModel?.N4ClassHours ?? 0;
......@@ -3345,8 +3338,8 @@ namespace Edu.Module.User
MonthStr = newDate.Month,
TeacherId = 0,
};
newModel2.OnLineInteractive = GetTeacherAndStudentScore(newModel2.FinishFollow, newModel2.TotalFollow);
newModel2.OnLineInteractiveScore = newModel2.OnLineInteractive;
newModel2.OnLineInteractive = messageList?.Sum(qitem => qitem.MessageCount) ?? 0;
newModel2.OnLineInteractiveScore = GetTeacherAndStudentScore(newModel2.FinishFollow, newModel2.TotalFollow);
newModel2.TeacherBeLate = checkList?.Where(qitem => qitem.ExceptionCount > 0)?.Count() ?? 0;
newModel2.TeacherBeLateScore = newModel2.TeacherBeLate;
......
......@@ -338,28 +338,7 @@ left join {datebaseStr}.rb_tradeway t on f.FrID = t.FinanceId
{
where += $@" AND {nameof(RB_Education_Contract_ViewModel.Status)} NOT IN(0,4) ";
}
//if (demodel.IsAduit == 0)
//{
// if (demodel.Status >= 0)
// {
// where += $@" AND {nameof(RB_Education_Contract_ViewModel.Status)} ={demodel.Status}";
// }
// else
// {
// where += $@" AND {nameof(RB_Education_Contract_ViewModel.Status)} NOT IN(0,4) ";
// }
//}
//else
//{
// if (demodel.CreateBy > 0)
// {
// where += $@" AND {nameof(RB_Education_Contract_ViewModel.CreateBy)} ={demodel.CreateBy}";
// }
// if (demodel.Status >= 0)
// {
// where += $@" AND {nameof(RB_Education_Contract_ViewModel.Status)} ={demodel.Status}";
// }
//}
string sql = $@" SELECT * FROM RB_Education_Contract WHERE {where} ORDER BY Id DESC ";
return GetPage<RB_Education_Contract_ViewModel>(pageIndex, pageSize, out rowsCount, sql, parameters).ToList();
}
......
......@@ -25,9 +25,9 @@ namespace Edu.Repository.Customer
{
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.*
FROM RB_Student_Appointment AS A
WHERE 1=1
SELECT A.*,B.StuName
FROM RB_Student_Appointment AS A INNER JOIN rb_student AS B ON A.StuId=B.StuId
WHERE 1=1
");
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Student_Appointment_Extend.Status), (int)DateStateEnum.Normal);
if (query != null)
......@@ -44,7 +44,15 @@ WHERE 1=1
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Student_Appointment_Extend.Id), query.Id);
}
if (query.CreateBy > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Student_Appointment_Extend.CreateBy), query.CreateBy);
}
//指定日期的约访统计
if (!string.IsNullOrEmpty(query.QueryDate))
{
builder.AppendFormat(" AND ( DATE_FORMAT(A.{0},'%y/%m/%d')= DATE_FORMAT('{2}','%y/%m/%d') OR DATE_FORMAT(A.{1},'%y/%m/%d')= DATE_FORMAT('{2}','%y/%m/%d')) ", nameof(RB_Student_Appointment_Extend.CreateTime), nameof(RB_Student_Appointment_Extend.AppointmentTime), Common.ConvertHelper.FormatDate(query.QueryDate));
}
}
builder.AppendFormat(" ORDER BY A.{0} DESC ", nameof(RB_Student_Appointment_Extend.Id));
......@@ -83,19 +91,65 @@ WHERE 1=1
if (!string.IsNullOrEmpty(query.QueryDate))
{
//指定日期的约访统计
builder.AppendFormat(" AND DATE_FORMAT(A.{0},'%y/%m/%d')= DATE_FORMAT('{1}','%y/%m/%d') ", nameof(RB_Student_Visit_Extend.CreateTime), Common.ConvertHelper.FormatDate(query.QueryDate));
builder.AppendFormat(" AND DATE_FORMAT(A.{0},'%y/%m/%d')= DATE_FORMAT('{1}','%y/%m/%d') ", nameof(RB_Student_Appointment_Extend.CreateTime), Common.ConvertHelper.FormatDate(query.QueryDate));
}
if (!string.IsNullOrEmpty(query.StartDate))
{
builder.AppendFormat(" AND A.{0}>='{1}' ", nameof(RB_Student_Visit_Extend.CreateTime), Common.ConvertHelper.FormatDate(query.StartDate));
builder.AppendFormat(" AND A.{0}>='{1}' ", nameof(RB_Student_Appointment_Extend.CreateTime), Common.ConvertHelper.FormatDate(query.StartDate));
}
if (!string.IsNullOrEmpty(query.EndDate))
{
builder.AppendFormat(" AND A.{0}<='{1} 23:59:59' ", nameof(RB_Student_Visit_Extend.CreateTime), Common.ConvertHelper.FormatDate(query.EndDate));
builder.AppendFormat(" AND A.{0}<='{1} 23:59:59' ", nameof(RB_Student_Appointment_Extend.CreateTime), Common.ConvertHelper.FormatDate(query.EndDate));
}
}
builder.AppendFormat(" GROUP BY A.CreateBy,DATE_FORMAT(A.CreateTime,'%Y/%m/%d') ");
return Get<RB_Student_Appointment_Extend>(builder.ToString()).ToList();
}
/// <summary>
/// 获取约访统计列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Student_Appointment_Extend> GetStudentVisitListRepository(RB_Student_Appointment_Extend query)
{
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.*,B.StuName
FROM RB_Student_Appointment AS A INNER JOIN rb_student AS B ON A.StuId=B.StuId
WHERE 1=1
");
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Student_Appointment_Extend.Status), (int)DateStateEnum.Normal);
if (query != null)
{
if (query.Group_Id > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Student_Appointment_Extend.Group_Id), query.Group_Id);
}
if (query.StuId > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Student_Appointment_Extend.StuId), query.StuId);
}
if (query.CreateBy > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Student_Appointment_Extend.CreateBy), query.CreateBy);
}
//指定日期的约访统计
if (!string.IsNullOrEmpty(query.QueryDate))
{
builder.AppendFormat(" AND ( DATE_FORMAT(A.{0},'%y/%m/%d')= DATE_FORMAT('{2}','%y/%m/%d') OR DATE_FORMAT(A.{1},'%y/%m/%d')= DATE_FORMAT('{2}','%y/%m/%d')) ", nameof(RB_Student_Appointment_Extend.CreateTime), nameof(RB_Student_Appointment_Extend.AppointmentTime), Common.ConvertHelper.FormatDate(query.QueryDate));
}
if (!string.IsNullOrEmpty(query.StartDate))
{
builder.AppendFormat(" AND A.{0}>='{1}' ", nameof(RB_Student_Appointment_Extend.CreateTime), Common.ConvertHelper.FormatDate(query.StartDate));
}
if (!string.IsNullOrEmpty(query.EndDate))
{
builder.AppendFormat(" AND A.{0}<='{1} 23:59:59' ", nameof(RB_Student_Appointment_Extend.CreateTime), Common.ConvertHelper.FormatDate(query.EndDate));
}
}
return Get<RB_Student_Appointment_Extend>(builder.ToString()).ToList();
}
}
}
......@@ -25,8 +25,8 @@ namespace Edu.Repository.Customer
{
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.*
FROM RB_Student_Follow AS A
SELECT A.*,stu.StuName
FROM RB_Student_Follow AS A LEFT JOIN rb_student AS stu ON A.StuId=stu.StuId
WHERE 1=1
");
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Student_Follow_Extend.Status), (int)DateStateEnum.Normal);
......@@ -48,6 +48,14 @@ WHERE 1=1
{
builder.AppendFormat(" AND A.{0} <='{1} 23:59:59' ", nameof(RB_Student_Follow_Extend.CreateTime), query.ETime);
}
if (!string.IsNullOrEmpty(query.QueryDate))
{
builder.AppendFormat(" AND date_format(A.CreateTime,'%Y-%m-%d')=date_format('{0}','%Y-%m-%d') ", query.QueryDate);
if (query.CreateBy > 0)
{
builder.AppendFormat(" AND (stu.CreateBy={0} OR EXISTS(SELECT 1 FROM rb_student_assist WHERE StuId=A.StuId AND AssistId={0}) ) ", query.CreateBy);
}
}
}
builder.AppendFormat(" ORDER BY A.{0} DESC ", nameof(RB_Student_Follow_Extend.Id));
return GetPage<RB_Student_Follow_Extend>(pageIndex, pageSize, out rowsCount, builder.ToString()).ToList();
......
......@@ -1418,5 +1418,7 @@ WHERE 1=1 AND A.OrderState IN(1,2) {0}
dicList.Add("lastMonth", lastMonthList);
return dicList;
}
}
}
using Edu.Common.Enum.Course;
using Edu.Common.Enum.User;
using Edu.Model.Entity.Sell;
using Edu.Model.ViewModel.Grade;
using Edu.Model.ViewModel.Sell;
using Edu.Model.ViewModel.User;
using Edu.Repository.Customer;
using Edu.Repository.Scroll;
using Edu.Repository.User;
using System;
using System.Collections.Generic;
using System.Linq;
......@@ -20,6 +25,28 @@ namespace Edu.Repository.Sell
/// </summary>
private readonly RB_OrderRepository orderRepository = new RB_OrderRepository();
/// <summary>
/// 学员协助
/// </summary>
private readonly RB_Student_AssistRepository student_AssistRepository = new RB_Student_AssistRepository();
/// <summary>
/// 同业
/// </summary>
private readonly RB_CustomerRepository customerRepository = new RB_CustomerRepository();
/// <summary>
/// 学生仓储层对象
/// </summary>
private readonly RB_StudentRepository studentRepository = new RB_StudentRepository();
/// <summary>
/// 约课记录
/// </summary>
private readonly RB_Scroll_AppointmentRepository scroll_AppointmentRepository = new RB_Scroll_AppointmentRepository();
/// <summary>
/// 账号管理处理类对象
/// </summary>
private readonly RB_AccountRepository accountRepository = new RB_AccountRepository();
/// <summary>
/// 获取列表
/// </summary>
......@@ -845,7 +872,6 @@ WHERE 1=1 AND A.Status=0 AND class.Status=0 AND class.ClassStatus <>4 AND b.Or
}
else
{
// builder.AppendFormat($@" AND B.{nameof(RB_Order_Guest_Extend.EffectStatus)} >0");
builder.AppendFormat($@" AND A.{nameof(RB_Order_Guest_Extend.GuestState)} ={demodel.EffectStatus.Value}");
}
}
......@@ -882,9 +908,132 @@ WHERE 1=1 AND A.Status=0 AND class.Status=0 AND class.ClassStatus <>4 AND b.Or
{
builder.AppendFormat($@" AND st.StuSourceId ={demodel.StuSourceId}");
}
//查询快毕业的学生 HK 2022-05-09新增
if (demodel.IsImmediatelyGraduate == 1)
{
builder.AppendFormat(" AND A.GuestState<>7 AND (A.TotalHours-A.CompleteHours)<=100 ");
builder.AppendFormat(" AND(st.CreateBy = {0} OR EXISTS(SELECT 1 FROM rb_student_assist WHERE StuId = st.StuId AND AssistId = {0})) ", demodel.CreateBy);
}
builder.AppendFormat($@" order by A.{nameof(RB_Order_Guest_Extend.Id)} desc");
return GetPage<RB_Order_Guest_Extend>(pageIndex, pageSize, out rowsCount, builder.ToString()).ToList();
var list= GetPage<RB_Order_Guest_Extend>(pageIndex, pageSize, out rowsCount, builder.ToString()).ToList();
if (list.Any())
{
//课程顾问 协助老师 负责人; 客户来源 来源关联人
string stuIds = string.Join(",", list.Select(x => x.StuId).Distinct().ToList());
//协助人员列表
var assistList = student_AssistRepository.GetStudentAssistListRepository(new Model.ViewModel.Customer.RB_Student_Assist_Extend()
{
QStuIds = stuIds
});
//内部介绍人
List<int> empIdList = Common.ConvertHelper.StringToList(string.Join(",", list.Where(qitem => qitem.CreateType == StuCreateTypeEnum.InternalIntroduction).Select(qitem => qitem.StuSourceId)));
List<int> aIds = Common.ConvertHelper.StringToList(string.Join(",", assistList.Select(qitem => qitem.AssistId)));
List<RB_Account_ViewModel> accountList = new List<RB_Account_ViewModel>();
if (aIds != null && aIds.Count > 0)
{
empIdList.AddRange(aIds);
}
List<int> EnterIDList = Common.ConvertHelper.StringToList(string.Join(",", list.Select(qitem => qitem.EnterID)));
if (EnterIDList != null && EnterIDList.Count > 0)
{
empIdList.AddRange(EnterIDList);
}
List<int> CreateByList = Common.ConvertHelper.StringToList(string.Join(",", list.Select(qitem => qitem.CreateBy)));
if (CreateByList != null && CreateByList.Count > 0)
{
empIdList.AddRange(CreateByList);
}
List<int> StuCreateByList = Common.ConvertHelper.StringToList(string.Join(",", list.Select(qitem => qitem.StuCreateBy)));
if (StuCreateByList != null && StuCreateByList.Count > 0)
{
empIdList.AddRange(StuCreateByList);
}
if (empIdList != null && empIdList.Count > 0)
{
accountList = accountRepository.GetAccountListExtRepository(new RB_Account_ViewModel() { QIds = string.Join(",", empIdList) });
}
//同业录入列表
List<Model.ViewModel.Customer.RB_Customer_Extend> customerList = new List<Model.ViewModel.Customer.RB_Customer_Extend>();
List<int> customerIdList = Common.ConvertHelper.StringToList(string.Join(",", list.Where(qitem => qitem.CreateType == StuCreateTypeEnum.CustomerInput).Select(qitem => qitem.StuSourceId)));
if (customerIdList != null && customerIdList.Count > 0)
{
customerList = customerRepository.GetCustomerListRepository(new Model.ViewModel.Customer.RB_Customer_Extend()
{
CustomerIds = string.Join(",", customerIdList)
});
}
List<RB_Student_ViewModel> transStudentList = new List<RB_Student_ViewModel>();
//转介人列表
List<int> transIdList = Common.ConvertHelper.StringToList(string.Join(",", list.Where(qitem => qitem.CreateType == StuCreateTypeEnum.TransIntroduction).Select(qitem => qitem.StuSourceId)));
if (transIdList != null && transIdList.Count > 0)
{
transStudentList = studentRepository.GetStudentListRepository(new RB_Student_ViewModel()
{
StuIds = string.Join(",", transIdList)
});
}
string GuestIds = string.Join(",", list.Select(x => x.Id));
var appointList = scroll_AppointmentRepository.GetAppointList(new Model.ViewModel.Scroll.RB_Scroll_Appointment_ViewModel() { Group_Id = demodel.Group_Id, GuestIds = GuestIds, State = CourseAppointStateEnum.WaitCourse });
foreach (var item in list)
{
var tempAssistList = assistList?.Where(qitem => qitem.StuId == item.StuId)?.ToList();
foreach (var sItem in tempAssistList)
{
sItem.AssistName = accountList?.FirstOrDefault(qitem => qitem.Id == sItem.AssistId)?.AccountName ?? "";
}
item.AssistList = tempAssistList;
if (item.CreateType == StuCreateTypeEnum.InternalIntroduction)
{
item.StuSourceIdName = accountList?.FirstOrDefault(qitem => qitem.Id == item.StuSourceId)?.AccountName ?? "";
}
else if (item.CreateType == StuCreateTypeEnum.CustomerInput)
{
var tempCustomer = customerList?.FirstOrDefault(qitem => qitem.CustomerId == item.StuSourceId);
item.StuSourceIdName = tempCustomer?.CustomerName ?? "";
if (tempCustomer != null)
{
if (tempCustomer.CustomerType == Common.Enum.Customer.CatetoryTypeEnum.Other)
{
item.EnterpriseName = tempCustomer?.EnterpriseName ?? "";
}
else
{
item.EnterpriseName = tempCustomer?.CategoryName ?? "";
}
}
else
{
item.EnterpriseName = "";
}
}
else if (item.CreateType == StuCreateTypeEnum.TransIntroduction)
{
item.StuSourceIdName = transStudentList?.FirstOrDefault(qitem => qitem.StuId == item.StuSourceId)?.StuName ?? "";
}
item.AppointNum = appointList.Where(x => x.GuestId == item.Id)?.Count() ?? 0;
if (item.EnterID > 0)
{
item.EnterName = accountList?.FirstOrDefault(qitem=>qitem.Id==item.EnterID)?.AccountName ?? "";
}
if (item.EnterID <= 0 && item.CreateBy > 0)
{
item.EnterName = accountList?.FirstOrDefault(qitem => qitem.Id == item.CreateBy)?.AccountName ?? "";
}
if (item.StuCreateBy > 0)
{
item.StuCreateByName = accountList?.FirstOrDefault(qitem => qitem.Id == item.StuCreateBy)?.AccountName ?? "";
}
}
}
return list;
}
/// <summary>
......
......@@ -220,7 +220,7 @@ WHERE 1=1 {1}
builder.AppendFormat(@"
SELECT A.*,IFNULL(G.GroupName,'') AS GroupName,IFNULL(s.SName,'') AS SchoolName,IFNULL(G.Logo,'') AS GroupLogo
,IFNULL(B.StuName,'') AS AccountName
FROM rb_account AS A INNER JOIN rb_student AS B ON A.AccountId=B.StuId
FROM rb_account AS A INNER JOIN rb_student AS B ON A.AccountId=B.StuId AND A.AccountType=4
LEFT JOIN rb_group AS g ON A.Group_Id=g.GId
LEFT JOIN rb_school AS s ON A.School_Id=s.SId
WHERE 1=1 {0}
......
......@@ -458,6 +458,12 @@ WHERE 1=1
nameof(RB_Student_ViewModel.StuSourceId),
query.StuSourceId);
}
//查询未跟进学员
if (query.IsQueryNotFollow == 1)
{
builder.AppendFormat(" AND NOT Exists (SELECT StuId FROM rb_student_follow WHERE `Status`=0 AND t.StuId=StuId) ");
}
}
builder.AppendFormat(" ORDER BY t.{0} DESC ", nameof(RB_Student_ViewModel.StuId));
return GetPage<RB_Student_ViewModel>(pageIndex, pageSize, out rowsCount, builder.ToString(), parameters).ToList();
......
using Edu.Common.Enum;
using Edu.Model.Entity.User;
using Edu.Model.ViewModel.User;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
......@@ -57,7 +56,6 @@ WHERE 1=1 AND C.OrderState IN(1) AND D.Status=0
{
builder.AppendFormat(" AND A.{0} IN({1}) ", nameof(RB_Student_OrderGuest_ViewModel.Student_Id), query.QStudentIds);
}
if (query.Account_Id > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Student_OrderGuest_ViewModel.Account_Id), query.Account_Id);
......@@ -84,7 +82,7 @@ FROM RB_Student_OrderGuest AS A INNER JOIN rb_order AS C ON A.OrderId=C.OrderId
WHERE 1=1 AND C.OrderState<>3 AND D.Status=0
");
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Student_OrderGuest_ViewModel.Status), (int)DateStateEnum.Normal);
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Student_OrderGuest_ViewModel.Status), (int)DateStateEnum.Normal);
if (query != null)
{
if (query.ClassId > 0)
......@@ -138,6 +136,7 @@ SELECT A.*,IFNULL(B.ClassName,'') AS ClassName,IFNULL(B.ClassNo,'') AS ClassNo,I
,IFNULL(D.GuestName,'') AS GuestName,IFNULL(E.CourseName,'') AS CourseName,IFNULL(C.OrderType,0) AS OrderType,IFNULL(C.SourceId,0) AS SourceId,B.ClassScrollType
FROM RB_Student_OrderGuest AS A INNER JOIN rb_order AS C ON A.OrderId=C.OrderId
INNER JOIN rb_order_guest AS D ON A.GuestId=D.Id
LEFT JOIN RB_student AS stu ON A.Student_Id=stu.StuId
LEFT JOIN rb_course AS E ON c.CourseId=E.CourseId
LEFT JOIN rb_class AS B ON A.ClassId=B.ClassId
WHERE 1=1 AND C.OrderState<>3 AND D.Status=0
......@@ -173,6 +172,15 @@ WHERE 1=1 AND C.OrderState<>3 AND D.Status=0
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Student_OrderGuest_ViewModel.Account_Id), query.Account_Id);
}
if (query.CreateBy > 0)
{
builder.AppendFormat(" AND (C.CreateBy={0} OR C.EnterID={0} OR C.CourseConsultantId={0}) ", query.CreateBy);
}
if (query.IsNotContract == 1)
{
builder.AppendFormat(" AND C.OrderType=1 and C.CourseId<>1 ");
builder.AppendFormat(@" AND NOT EXISTS(SELECT 1 FROM rb_education_contract WHERE A.OrderId=OrderId AND A.GuestId=GuestId AND `Status` NOT IN(4)) ");
}
}
return GetPage<RB_Student_OrderGuest_ViewModel>(pageIndex, pageSize, out rowsCount, builder.ToString()).ToList();
}
......
......@@ -77,7 +77,7 @@ WHERE 1=1
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Teacher_Static_Extend> GetTeacherStaticMonthExtListRepository(RB_Teacher_Static_Extend query, bool isYear = false)
public List<RB_Teacher_Static_Extend> GetTeacherStaticMonthExtListRepository(RB_Teacher_Static_Extend query)
{
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
......
......@@ -76,6 +76,7 @@ namespace Edu.WebApi.Controllers.User
new ExcelColumn("日期"){ CellWidth=15},
new ExcelColumn("班主任与学生互动"){ CellWidth=15},
new ExcelColumn("班主任与学生互动得分"){ CellWidth=15},
new ExcelColumn("企业微信互动次数"){ CellWidth=15},
new ExcelColumn("上课时数"){ CellWidth=15},
new ExcelColumn("续约(含留学)"){ CellWidth=15},
new ExcelColumn("学生升级"){ CellWidth=15},
......@@ -111,6 +112,7 @@ namespace Edu.WebApi.Controllers.User
};
columns.Add(new ExcelColumn(dObj.GetStringValue("FinishFollow") +"/"+ dObj.GetStringValue("TotalFollow")));
columns.Add(new ExcelColumn(dObj.GetStringValue("OnLineInteractiveScore")));
columns.Add(new ExcelColumn(dObj.GetStringValue("OnLineInteractive")));
columns.Add(new ExcelColumn(dObj.GetStringValue("AttendClassHourScore")));
columns.Add(new ExcelColumn(dObj.GetStringValue("RenewScore")));
columns.Add(new ExcelColumn(dObj.GetStringValue("UpgradeScore")));
......@@ -197,6 +199,7 @@ namespace Edu.WebApi.Controllers.User
new ExcelColumn("老师"){ CellWidth=15},
new ExcelColumn("班主任学生互动"){ CellWidth=15},
new ExcelColumn("班主任学生互动得分"){ CellWidth=15},
new ExcelColumn("企业微信互动次数"){ CellWidth=15},
new ExcelColumn("上课时数"){ CellWidth=15},
new ExcelColumn("续约(含留学)"){ CellWidth=15},
new ExcelColumn("学生升级"){ CellWidth=15},
......@@ -234,6 +237,7 @@ namespace Edu.WebApi.Controllers.User
columns.Add(new ExcelColumn(dObj.GetStringValue("FinishFollow") + "/" + dObj.GetStringValue("TotalFollow")));
columns.Add(new ExcelColumn(dObj.GetStringValue("OnLineInteractiveScore")));
columns.Add(new ExcelColumn(dObj.GetStringValue("OnLineInteractive")));
columns.Add(new ExcelColumn(dObj.GetStringValue("AttendClassHourScore")));
columns.Add(new ExcelColumn(dObj.GetStringValue("RenewScore")));
columns.Add(new ExcelColumn(dObj.GetStringValue("UpgradeScore")));
......
......@@ -8,15 +8,18 @@ using Edu.AOP;
using Edu.Cache.User;
using Edu.Common;
using Edu.Common.API;
using Edu.Common.Enum.Course;
using Edu.Common.Enum.System;
using Edu.Common.Enum.User;
using Edu.Common.Plugin;
using Edu.Model.CacheModel;
using Edu.Model.Public;
using Edu.Model.ViewModel.DataStatistics;
using Edu.Model.ViewModel.EduTask;
using Edu.Model.ViewModel.User;
using Edu.Module.Course;
using Edu.Module.Customer;
using Edu.Module.EduTask;
using Edu.Module.User;
using Edu.WebApi.Filter;
using Microsoft.AspNetCore.Authorization;
......@@ -75,6 +78,11 @@ namespace Edu.WebApi.Controllers.User
/// </summary>
private readonly MarketConsultantModule marketConsultantModule = new MarketConsultantModule();
/// <summary>
/// 教务单据处理类对象
/// </summary>
private readonly EducationReceiptModule educationReceiptModule = AOP.AOPHelper.CreateAOPObject<EducationReceiptModule>();
#region 字典管理
/// <summary>
......@@ -2667,12 +2675,12 @@ namespace Edu.WebApi.Controllers.User
}
var list = marketConsultantModule.DownLoadConsultantStaticModule(qEmpIds, startTime, endTime);
string excelName = "课程顾问部数据统计.xls";
ExcelDataSource header = new ExcelDataSource() { ExcelRows = new List<ExcelColumn>() };
ExcelDataSource subHeader = new ExcelDataSource() { ExcelRows = new List<ExcelColumn>() };
header.ExcelRows.Add(new ExcelColumn("员工") { Rowspan = 2, CellWidth = 15 });
subHeader.ExcelRows.Add(new ExcelColumn());
header.ExcelRows.Add(new ExcelColumn("名单") { CellWidth = 25,Colspan=2 });
header.ExcelRows.Add(new ExcelColumn("名单") { CellWidth = 25, Colspan = 2 });
subHeader.ExcelRows.Add(new ExcelColumn("本周"));
subHeader.ExcelRows.Add(new ExcelColumn("本月"));
......@@ -2712,8 +2720,10 @@ namespace Edu.WebApi.Controllers.User
{
foreach (var item in list)
{
var excelRows = new List<ExcelColumn>();
excelRows.Add(new ExcelColumn(UserReidsCache.GetUserLoginInfo(item.CreateBy)?.AccountName));
var excelRows = new List<ExcelColumn>
{
new ExcelColumn(UserReidsCache.GetUserLoginInfo(item.CreateBy)?.AccountName)
};
string curWeekStu = (item?.CurWeekStuList?.Count ?? 0).ToString();
string curMonthStu = (item?.CurMonthStuList?.Count ?? 0).ToString();
excelRows.Add(new ExcelColumn(curWeekStu));
......@@ -3305,5 +3315,147 @@ namespace Edu.WebApi.Controllers.User
}
}
#endregion
#region 首页待办工作视图统计
/// <summary>
/// 今日需联系线索(之前预约或者24小时内收到的新线索)
/// </summary>
/// <returns></returns>
public ApiResult GetTodayClue()
{
var pageModel = Common.Plugin.JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString());
var userId = 0;
userId = base.UserInfo.Id;
var list = studentModule.GetStudentAppointmentPageModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, userId);
pageModel.PageData = list;
pageModel.Count = rowsCount;
return ApiResult.Success(data: pageModel);
}
/// <summary>
/// 今日需联系学员(之前预约的跟进学员或本周期内需要跟进的学员)
/// </summary>
public ApiResult GetTodayConnect()
{
var pageModel = Common.Plugin.JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString());
var list = studentModule.GetTodayConnectPageModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, base.UserInfo.Id);
pageModel.PageData = list;
pageModel.Count = rowsCount;
return ApiResult.Success(data: pageModel);
}
/// <summary>
/// 分配给我的线索 (分配给我,但是没有跟进的线索)
/// </summary>
/// <returns></returns>
public ApiResult MyClue()
{
var pageModel = Common.Plugin.JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString());
var list = studentModule.GetMyClueModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, base.UserInfo.Id);
pageModel.PageData = list;
pageModel.Count = rowsCount;
return ApiResult.Success(data: pageModel);
}
/// <summary>
/// 分配给我的学员 (分配给我,但是没有跟进的学员)
/// </summary>
/// <returns></returns>
public ApiResult MyStudent()
{
var pageModel = Common.Plugin.JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString());
var list = studentModule.GetMyStudentModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, base.UserInfo.Id);
pageModel.PageData = list;
pageModel.Count = rowsCount;
return ApiResult.Success(data: pageModel);
}
/// <summary>
/// 待申领合同(正常订单,没有领取电子合同)
/// </summary>
/// <returns></returns>
public ApiResult MyContract()
{
var pageModel = Common.Plugin.JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString());
var list = studentModule.GetContractNotModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, base.UserInfo.Id);
pageModel.PageData = list;
pageModel.Count = rowsCount;
return ApiResult.Success(data: pageModel);
}
/// <summary>
/// 待收款提醒(正常订单,收支款未平衡的订单)
/// </summary>
/// <returns></returns>
public ApiResult MyPay()
{
var pageModel = Common.Plugin.JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString());
var list = studentModule.GetOrderNotModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, base.UserInfo.Id);
pageModel.PageData = list;
pageModel.Count = rowsCount;
return ApiResult.Success(data: pageModel);
}
/// <summary>
///今日被跟进学员(被跟进的学员所有协助人可见)
/// </summary>
/// <returns></returns>
public ApiResult TodayFollow()
{
var pageModel = Common.Plugin.JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString());
var list = studentModule.GetTodayFollowStudentModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, base.UserInfo.Id);
pageModel.PageData = list;
pageModel.Count = rowsCount;
return ApiResult.Success(data: pageModel);
}
/// <summary>
///即将毕业学员 (学员所有协助人可见)
/// </summary>
/// <returns></returns>
public ApiResult GraduateStudent()
{
var pageModel = Common.Plugin.JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString());
var list = studentModule.GetStraightwayGraduateStudentModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, base.UserInfo.Id);
pageModel.PageData = list;
pageModel.Count = rowsCount;
return ApiResult.Success(data: pageModel);
}
/// <summary>
/// 待审核业务单据
/// </summary>
/// <returns></returns>
public ApiResult NotBusinessBill()
{
var pageModel = Common.Plugin.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")
};
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 = base.UserInfo.Id;
var list = educationReceiptModule.GetEducationReceiptPageModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query);
pageModel.PageData = list;
pageModel.Count = rowsCount;
return ApiResult.Success(data: pageModel);
}
#endregion
}
}
\ No newline at end of file
......@@ -74,6 +74,7 @@ namespace Edu.WebApi
"http://eduapi.oytour.com",
"http://mobile.kookaku.com",
"http://m.kookaku.com",
"http://lm.oytour.com",
};
services.AddCors(options => options.AddPolicy("AllowCors", policy => policy.AllowAnyHeader().AllowAnyMethod().AllowCredentials().WithOrigins(corsArray.ToArray())));
services.Configure<IISServerOptions>(options => options.AllowSynchronousIO = true);
......
......@@ -147,7 +147,7 @@ namespace Edu.WebApi.Timers
marketTimer = new System.Timers.Timer()
{
Interval = (1000 * 60) * (5) //20分钟执行一次
Interval = (1000 * 60) * (60) //1小时执行一次
};
marketTimer.Elapsed += new System.Timers.ElapsedEventHandler(DealMarketConsultantData);
marketTimer.Enabled = true;
......

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.1.32210.238
# Visual Studio Version 16
VisualStudioVersion = 16.0.31729.503
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Edu.Aop", "Edu.Aop\Edu.Aop.csproj", "{4AB3D35D-FC1D-4CB4-BB7B-0695E239C65B}"
EndProject
......
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