Commit 0d2ff303 authored by 黄奎's avatar 黄奎

页面修改

parent ab51663f
......@@ -75,5 +75,10 @@ namespace Edu.Model.ViewModel.Customer
/// 到访次数
/// </summary>
public int VisitCount { get; set; }
/// <summary>
/// 创建人【查询使用】
/// </summary>
public string QCreateByIds { get; set; }
}
}
......@@ -180,5 +180,10 @@ namespace Edu.Model.ViewModel.Reserve
/// 查询日期
/// </summary>
public string QDate { get; set; }
/// <summary>
/// 创建人
/// </summary>
public string QCreateByIds { get; set; }
}
}
using Edu.Repository.User;
using Edu.Repository.Customer;
using Edu.Repository.Reserve;
using Edu.Repository.User;
using System;
using System.Collections.Generic;
using System.Text;
using System.Linq;
using Edu.Model.ViewModel.Customer;
using Edu.Repository.Sell;
namespace Edu.Module.Customer
{
......@@ -15,6 +20,27 @@ namespace Edu.Module.Customer
/// </summary>
private readonly RB_StudentRepository studentRepository = new RB_StudentRepository();
/// <summary>
/// 学员跟进仓储层对象
/// </summary>
private readonly RB_Student_FollowRepository student_FollowRepository = new RB_Student_FollowRepository();
/// <summary>
/// 学员试听仓储层对象
/// </summary>
private readonly RB_Visitor_ReserveRepository visitor_ReserveRepository = new RB_Visitor_ReserveRepository();
/// <summary>
/// 学员到访仓储层对象
/// </summary>
private readonly RB_Student_VisitRepository student_VisitRepository = new RB_Student_VisitRepository();
/// <summary>
/// 订单仓储层对象
/// </summary>
private readonly RB_OrderRepository orderRepository = new RB_OrderRepository();
/// <summary>
/// 市场人员统计
/// </summary>
......@@ -22,9 +48,51 @@ namespace Edu.Module.Customer
public object MarketStaticModule(string EmpIds,string StartTime,string EndTime)
{
object obj = new object();
var totalTotal =studentRepository.GetStudentClueRepository(EmpIds, StartTime, EndTime);
DateTime start = Convert.ToDateTime(StartTime);
DateTime end = Convert.ToDateTime(EndTime);
var days = (end - start).Days;
//线索列表
var studentList =studentRepository.GetStudentClueRepository(EmpIds, StartTime, EndTime);
//试听列表
var trialLessonList = visitor_ReserveRepository.GetVisitorReserveStaticRepository(new Model.ViewModel.Reserve.RB_Visitor_Reserve_Extend()
{
QCreateByIds = EmpIds,
StartClassDate = StartTime,
EndClassDate = EndTime
});
//到访列表
var visitList = student_VisitRepository.GetStudentVisitStaticRepository(new RB_Student_Visit_Extend()
{
QCreateByIds = EmpIds,
StartDate = StartTime,
EndDate = EndTime
});
List<object> dayList = new List<object>();
for (var i = 0; i < days; i++)
{
DateTime newDate = start.AddDays(i);
var tempStuList = studentList?.Where(qitem => Common.ConvertHelper.FormatMonthDay(qitem.CreateTime) == Common.ConvertHelper.FormatMonthDay(newDate))?.ToList();
var tempTrialLessonList = trialLessonList?.Where(qitem => Common.ConvertHelper.FormatMonthDay(qitem.CreateTime) == Common.ConvertHelper.FormatMonthDay(newDate))?.ToList();
var tempVisitList= visitList?.Where(qitem => Common.ConvertHelper.FormatMonthDay(qitem.CreateTime) == Common.ConvertHelper.FormatMonthDay(newDate))?.ToList();
dayList.Add(new
{
DayStr = Common.ConvertHelper.FormatMonthDay(newDate),
//新增线索条数
ClueCount = tempStuList?.FirstOrDefault()?.ClueCount ?? 0,
//试听人数
TrialLessonCount = tempTrialLessonList?.Sum(qitem => qitem.TrialLessonCount) ?? 0,
//到访人数
VisitCount = tempVisitList?.Sum(qitem => qitem.VisitCount) ?? 0,
});
}
obj = new
{
dayList
};
return obj;
}
......@@ -35,7 +103,7 @@ namespace Edu.Module.Customer
public object ConsultantStaticModule(string EmpIds, string StartTime, string EndTime)
{
object obj = new object();
var totalTotal = studentRepository.GetStudentClueRepository(EmpIds, StartTime, EndTime);
return obj;
}
}
......
......@@ -116,6 +116,10 @@ WHERE 1=1
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Student_Visit_Extend.CreateBy), query.CreateBy);
}
if (!string.IsNullOrEmpty(query.QCreateByIds))
{
builder.AppendFormat(" AND A.{0} IN({1}) ", nameof(RB_Student_Visit_Extend.CreateBy), query.QCreateByIds);
}
if (!string.IsNullOrEmpty(query.StartDate))
{
builder.AppendFormat(" AND A.{0}>='{1}' ", nameof(RB_Student_Visit_Extend.CreateTime), Common.ConvertHelper.FormatDate(query.StartDate));
......
......@@ -283,6 +283,10 @@ WHERE 1=1
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Visitor_Reserve_Extend.CreateBy), query.CreateBy);
}
if (!string.IsNullOrEmpty(query.QCreateByIds))
{
builder.AppendFormat(" AND A.{0} IN({1}) ", nameof(RB_Visitor_Reserve_Extend.CreateBy), query.QCreateByIds);
}
if (!string.IsNullOrEmpty(query.QDate))
{
//指定日期的试听课数量
......
......@@ -2531,8 +2531,8 @@ namespace Edu.WebApi.Controllers.User
public ApiResult MarketStatic()
{
string employeeIds = "";
string startTime = "";
string endTime = "";
string startTime = "2022-01-01";
string endTime = "2022-01-30";
var obj = marketConsultantModule.MarketStaticModule(employeeIds, startTime, endTime);
return ApiResult.Success(data: obj);
}
......
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