Commit ed357cd2 authored by 黄奎's avatar 黄奎

页面修改

parent 229f9772
......@@ -67,14 +67,15 @@ namespace Edu.Module.Customer
/// <summary>
/// 生成市场部统计数据
/// </summary>
public void CreateDataModule(DateTime StartTime)
public void CreateMarketDataModule(DateTime StartTime)
{
var newTime = StartTime.AddDays(-1);
string start = Common.ConvertHelper.FormatDate(newTime);
var empList = accountRepository.GetEmployeeListRepository(new Employee_ViewModel()
{
QDeptIds = "4,13",
//市场部编号4,课程顾问部编号13
QDeptIds = "4",
Group_Id = 100000,
IsLeave = 1
});
......@@ -270,6 +271,214 @@ namespace Edu.Module.Customer
}
}
/// <summary>
/// 生成课程顾问部数据
/// </summary>
/// <param name="StartTime"></param>
public void CreateConsultantDataModule(DateTime StartTime)
{
var newTime = StartTime.AddDays(-1);
string start = Common.ConvertHelper.FormatDate(newTime);
var empList = accountRepository.GetEmployeeListRepository(new Employee_ViewModel()
{
//市场部编号4,课程顾问部编号13
QDeptIds = "13",
Group_Id = 100000,
IsLeave = 1
});
if (empList != null && empList.Count > 0)
{
foreach (var item in empList)
{
RB_MarketConsultant_Extend model = new RB_MarketConsultant_Extend()
{
CreateBy = item.Id,
Group_Id = item.Group_Id,
Date = newTime,
DeptId = item.Dept_Id,
};
//1.条数(资源量)
var dicList = studentRepository.GetStudentClueRepository(new RB_Student_ViewModel() { StartTime = start });
if (dicList != null && dicList.Count > 0)
{
foreach (var sItem in dicList)
{
if (sItem.Key == "today")
{
model.ClueCount = sItem.Value?.Where(qitem => qitem.CreateBy == item.Id)?.FirstOrDefault()?.ClueCount ?? 0;
}
else if (sItem.Key == "yestoday")
{
model.YestodayClue = sItem.Value?.Where(qitem => qitem.CreateBy == item.Id)?.FirstOrDefault()?.ClueCount ?? 0;
}
else if (sItem.Key == "currentWeek")
{
model.CurWeekClue = sItem.Value?.Where(qitem => qitem.CreateBy == item.Id)?.FirstOrDefault()?.ClueCount ?? 0;
}
else if (sItem.Key == "lastWeek")
{
model.LastWeekClue = sItem.Value?.Where(qitem => qitem.CreateBy == item.Id)?.FirstOrDefault()?.ClueCount ?? 0;
}
else if (sItem.Key == "curMonth")
{
model.CurMonthClue = sItem.Value?.Where(qitem => qitem.CreateBy == item.Id)?.FirstOrDefault()?.ClueCount ?? 0;
}
else if (sItem.Key == "lastMonth")
{
model.LastMonthClue = sItem.Value?.Where(qitem => qitem.CreateBy == item.Id)?.FirstOrDefault()?.ClueCount ?? 0;
}
}
}
var followList = student_FollowRepository.GetStudentFollowStaticRepository(new RB_Student_Follow_Extend()
{
STime = start
});
//2.有效数据量 (第一次跟进且不等于流失)
if (followList != null && followList.Count > 0)
{
foreach (var sItem in followList)
{
if (sItem.Key == "today")
{
model.FollowCount = sItem.Value?.Where(qitem => qitem.CreateBy == item.Id)?.FirstOrDefault()?.FollowCount ?? 0;
}
else if (sItem.Key == "yestoday")
{
model.YestodayFollow = sItem.Value?.Where(qitem => qitem.CreateBy == item.Id)?.FirstOrDefault()?.FollowCount ?? 0;
}
else if (sItem.Key == "currentWeek")
{
model.CurWeekFollow = sItem.Value?.Where(qitem => qitem.CreateBy == item.Id)?.FirstOrDefault()?.FollowCount ?? 0;
}
else if (sItem.Key == "lastWeek")
{
model.LastWeekFollow = sItem.Value?.Where(qitem => qitem.CreateBy == item.Id)?.FirstOrDefault()?.FollowCount ?? 0;
}
else if (sItem.Key == "curMonth")
{
model.CurMonthFollow = sItem.Value?.Where(qitem => qitem.CreateBy == item.Id)?.FirstOrDefault()?.FollowCount ?? 0;
}
else if (sItem.Key == "lastMonth")
{
model.LastMonthFollow = sItem.Value?.Where(qitem => qitem.CreateBy == item.Id)?.FirstOrDefault()?.FollowCount ?? 0;
}
}
}
//3.上门咨询
var visitList = student_VisitRepository.GetVisitStaticRepository(new RB_Student_Visit_Extend()
{
StartDate = start
});
if (visitList != null && visitList.Count > 0)
{
foreach (var sItem in visitList)
{
if (sItem.Key == "today")
{
model.VisitCount = sItem.Value?.Where(qitem => qitem.CreateBy == item.Id)?.FirstOrDefault()?.VisitCount ?? 0;
}
else if (sItem.Key == "yestoday")
{
model.YestodayVisit = sItem.Value?.Where(qitem => qitem.CreateBy == item.Id)?.FirstOrDefault()?.VisitCount ?? 0;
}
else if (sItem.Key == "currentWeek")
{
model.CurWeekVisit = sItem.Value?.Where(qitem => qitem.CreateBy == item.Id)?.FirstOrDefault()?.VisitCount ?? 0;
}
else if (sItem.Key == "lastWeek")
{
model.LastWeekVisit = sItem.Value?.Where(qitem => qitem.CreateBy == item.Id)?.FirstOrDefault()?.VisitCount ?? 0;
}
else if (sItem.Key == "curMonth")
{
model.CurMonthVisit = sItem.Value?.Where(qitem => qitem.CreateBy == item.Id)?.FirstOrDefault()?.VisitCount ?? 0;
}
else if (sItem.Key == "lastMonth")
{
model.LastMonthVisit = sItem.Value?.Where(qitem => qitem.CreateBy == item.Id)?.FirstOrDefault()?.VisitCount ?? 0;
}
}
}
//4.试听邀约
var trialLessonList = visitor_ReserveRepository.GetVisitorStaticRepository(new RB_Visitor_Reserve_Extend()
{
StartClassDate = start
});
if (trialLessonList != null && trialLessonList.Count > 0)
{
foreach (var sItem in trialLessonList)
{
if (sItem.Key == "today")
{
model.TrialLessonCount = sItem.Value?.Where(qitem => qitem.CreateBy == item.Id)?.FirstOrDefault()?.TrialLessonCount ?? 0;
}
else if (sItem.Key == "yestoday")
{
model.YestodayTrialLesson = sItem.Value?.Where(qitem => qitem.CreateBy == item.Id)?.FirstOrDefault()?.TrialLessonCount ?? 0;
}
else if (sItem.Key == "currentWeek")
{
model.CurWeekTrialLesson = sItem.Value?.Where(qitem => qitem.CreateBy == item.Id)?.FirstOrDefault()?.TrialLessonCount ?? 0;
}
else if (sItem.Key == "lastWeek")
{
model.LastWeekTrialLesson = sItem.Value?.Where(qitem => qitem.CreateBy == item.Id)?.FirstOrDefault()?.TrialLessonCount ?? 0;
}
else if (sItem.Key == "curMonth")
{
model.CurMonthTrialLesson = sItem.Value?.Where(qitem => qitem.CreateBy == item.Id)?.FirstOrDefault()?.TrialLessonCount ?? 0;
}
else if (sItem.Key == "lastMonth")
{
model.LastMonthTrialLesson = sItem.Value?.Where(qitem => qitem.CreateBy == item.Id)?.FirstOrDefault()?.TrialLessonCount ?? 0;
}
}
}
//5.销售额(签约量)
var orderList = orderRepository.GetMarketMarketConsultantStaticRepository(new RB_Order_ViewModel()
{
StartTime = start
});
if (orderList != null && orderList.Count > 0)
{
foreach (var sItem in orderList)
{
if (sItem.Key == "today")
{
model.SaleMoney = sItem.Value?.Where(qitem => (qitem.EnterID == item.Id || qitem.CourseConsultantId == item.Id))?.Sum(qitem => qitem.Income) ?? 0;
}
else if (sItem.Key == "yestoday")
{
model.YestodaySale = sItem.Value?.Where(qitem => (qitem.EnterID == item.Id || qitem.CourseConsultantId == item.Id))?.Sum(qitem => qitem.Income) ?? 0;
}
else if (sItem.Key == "currentWeek")
{
model.CurWeekSale = sItem.Value?.Where(qitem => (qitem.EnterID == item.Id || qitem.CourseConsultantId == item.Id))?.Sum(qitem => qitem.Income) ?? 0;
}
else if (sItem.Key == "lastWeek")
{
model.LastWeekSale = sItem.Value?.Where(qitem => (qitem.EnterID == item.Id || qitem.CourseConsultantId == item.Id))?.Sum(qitem => qitem.Income) ?? 0;
}
else if (sItem.Key == "curMonth")
{
model.CurMonrhSale = sItem.Value?.Where(qitem => (qitem.EnterID == item.Id || qitem.CourseConsultantId == item.Id))?.Sum(qitem => qitem.Income) ?? 0;
}
else if (sItem.Key == "lastMonth")
{
model.LastMonthSale = sItem.Value?.Where(qitem => (qitem.EnterID == item.Id || qitem.CourseConsultantId == item.Id))?.Sum(qitem => qitem.Income) ?? 0;
}
}
}
marketConsultantRepository.InsertMarketConsultantRepository(model);
}
}
}
/// <summary>
/// 市场人员统计
/// </summary>
......
......@@ -2530,7 +2530,7 @@ namespace Edu.WebApi.Controllers.User
[HttpPost]
public ApiResult CreateMarketData()
{
string startTime = "2022-01-01";
string startTime = "2022-01-02";
string endTime = Common.ConvertHelper.FormatDate(DateTime.Now);
var start = Convert.ToDateTime(startTime);
var end = Convert.ToDateTime(endTime);
......@@ -2540,7 +2540,8 @@ namespace Edu.WebApi.Controllers.User
{
for (var i = 0; i < days; i++)
{
marketConsultantModule.CreateDataModule(start.AddDays(i));
marketConsultantModule.CreateMarketDataModule(start.AddDays(i));
marketConsultantModule.CreateConsultantDataModule(start.AddDays(i));
}
});
return ApiResult.Success();
......@@ -2554,12 +2555,12 @@ namespace Edu.WebApi.Controllers.User
public ApiResult MarketStatic()
{
string startTime = base.ParmJObj.GetStringValue("startTime");
if (!string.IsNullOrEmpty(startTime))
if (string.IsNullOrEmpty(startTime))
{
startTime = "2022-01-01";
}
string endTime = base.ParmJObj.GetStringValue("endTime");
if (!string.IsNullOrEmpty(endTime))
if (string.IsNullOrEmpty(endTime))
{
endTime = Common.ConvertHelper.FormatDate(DateTime.Now);
}
......
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