Commit 01d0e242 authored by 黄奎's avatar 黄奎

页面修改

parent 67813ac8
using Edu.Common; using Edu.Common;
using Edu.Common.Enum.Course; using Edu.Common.Enum.Course;
using Edu.Common.Enum.Customer;
using Edu.Model.ViewModel.Customer; using Edu.Model.ViewModel.Customer;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
...@@ -231,7 +232,7 @@ namespace Edu.Model.ViewModel.User ...@@ -231,7 +232,7 @@ namespace Edu.Model.ViewModel.User
/// <summary> /// <summary>
/// 同行客户来源(1-企业,2-学校) /// 同行客户来源(1-企业,2-学校)
/// </summary> /// </summary>
public int CustomerSourceType { get; set; } public CatetoryTypeEnum CustomerType { get; set; }
/// <summary> /// <summary>
/// 来源人名称 /// 来源人名称
......
...@@ -1196,12 +1196,13 @@ namespace Edu.Module.Customer ...@@ -1196,12 +1196,13 @@ namespace Edu.Module.Customer
/// <param name="StartTime"></param> /// <param name="StartTime"></param>
/// <param name="EndTime"></param> /// <param name="EndTime"></param>
/// <returns></returns> /// <returns></returns>
public object MarketCreateTypeStaticModule(string StartTime, string EndTime) public object MarketCreateTypeStaticModule(List<int> queryEmployeeIds,string StartTime, string EndTime)
{ {
var dataList = studentRepository.GetStudentChannelStaticRepository(new RB_Student_ViewModel() var dataList = studentRepository.GetStudentChannelStaticRepository(new RB_Student_ViewModel()
{ {
StartTime = StartTime, StartTime = StartTime,
EndTime = EndTime EndTime = EndTime,
CreateIds = queryEmployeeIds,
}); });
var enumList = Common.Plugin.EnumHelper.EnumToList(typeof(StuCreateTypeEnum)); var enumList = Common.Plugin.EnumHelper.EnumToList(typeof(StuCreateTypeEnum));
//企业同行 //企业同行
...@@ -1225,19 +1226,19 @@ namespace Edu.Module.Customer ...@@ -1225,19 +1226,19 @@ namespace Edu.Module.Customer
customerList = customerRepository.GetCustomerListRepository(new RB_Customer_Extend() { CustomerIds = cusIds }); customerList = customerRepository.GetCustomerListRepository(new RB_Customer_Extend() { CustomerIds = cusIds });
} }
var sourceTypeList = dataList?.Where(qitem => qitem.CreateType == StuCreateTypeEnum.CustomerInput) var sourceTypeList = dataList?.Where(qitem => qitem.CreateType == StuCreateTypeEnum.CustomerInput)
?.GroupBy(qitem => new { qitem.CustomerSourceType }) ?.GroupBy(qitem => new { qitem.CustomerType })
?.Select(qitem => new { qitem.Key.CustomerSourceType }); ?.Select(qitem => new { qitem.Key.CustomerType });
foreach (var sItem in sourceTypeList) foreach (var sItem in sourceTypeList)
{ {
var sourceIdList = dataList?.Where(qitem => qitem.CreateType == StuCreateTypeEnum.CustomerInput && qitem.CustomerSourceType == sItem.CustomerSourceType) var sourceIdList = dataList?.Where(qitem => qitem.CreateType == StuCreateTypeEnum.CustomerInput && qitem.CustomerType == sItem.CustomerType)
?.GroupBy(qitem => new { qitem.StuSourceId }) ?.GroupBy(qitem => new { qitem.StuSourceId })
?.Select(qitem => new { qitem.Key.StuSourceId }); ?.Select(qitem => new { qitem.Key.StuSourceId });
foreach (var subItem in sourceIdList) foreach (var subItem in sourceIdList)
{ {
var tempCusList = dataList?.Where(qitem => qitem.CreateType == StuCreateTypeEnum.CustomerInput && qitem.StuSourceId == subItem.StuSourceId)?.ToList(); var tempCusList = dataList?.Where(qitem => qitem.CreateType == StuCreateTypeEnum.CustomerInput && qitem.StuSourceId == subItem.StuSourceId)?.ToList();
//企业同行 //企业同行
if (sItem.CustomerSourceType == 1) if (sItem.CustomerType == Common.Enum.Customer.CatetoryTypeEnum.Company)
{ {
customerDataList.Add(new MarketChannelStaticModel() customerDataList.Add(new MarketChannelStaticModel()
{ {
...@@ -1250,7 +1251,7 @@ namespace Edu.Module.Customer ...@@ -1250,7 +1251,7 @@ namespace Edu.Module.Customer
}); });
} }
//校代同行 //校代同行
else if (sItem.CustomerSourceType == 2) else if (sItem.CustomerType == Common.Enum.Customer.CatetoryTypeEnum.School)
{ {
schoolDataList.Add(new MarketChannelStaticModel() schoolDataList.Add(new MarketChannelStaticModel()
{ {
...@@ -1366,19 +1367,19 @@ namespace Edu.Module.Customer ...@@ -1366,19 +1367,19 @@ namespace Edu.Module.Customer
customerList = customerRepository.GetCustomerListRepository(new RB_Customer_Extend() { CustomerIds = cusIds }); customerList = customerRepository.GetCustomerListRepository(new RB_Customer_Extend() { CustomerIds = cusIds });
} }
var sourceTypeList = dataList?.Where(qitem => qitem.CreateType == StuCreateTypeEnum.CustomerInput) var sourceTypeList = dataList?.Where(qitem => qitem.CreateType == StuCreateTypeEnum.CustomerInput)
?.GroupBy(qitem => new { qitem.CustomerSourceType }) ?.GroupBy(qitem => new { qitem.CustomerType })
?.Select(qitem => new { qitem.Key.CustomerSourceType }); ?.Select(qitem => new { qitem.Key.CustomerType });
foreach (var sItem in sourceTypeList) foreach (var sItem in sourceTypeList)
{ {
var sourceIdList = dataList?.Where(qitem => qitem.CreateType == StuCreateTypeEnum.CustomerInput && qitem.CustomerSourceType == sItem.CustomerSourceType) var sourceIdList = dataList?.Where(qitem => qitem.CreateType == StuCreateTypeEnum.CustomerInput && qitem.CustomerType == sItem.CustomerType)
?.GroupBy(qitem => new { qitem.StuSourceId }) ?.GroupBy(qitem => new { qitem.StuSourceId })
?.Select(qitem => new { qitem.Key.StuSourceId }); ?.Select(qitem => new { qitem.Key.StuSourceId });
foreach (var subItem in sourceIdList) foreach (var subItem in sourceIdList)
{ {
var tempCusList = dataList?.Where(qitem => qitem.CreateType == StuCreateTypeEnum.CustomerInput && qitem.StuSourceId == subItem.StuSourceId)?.ToList(); var tempCusList = dataList?.Where(qitem => qitem.CreateType == StuCreateTypeEnum.CustomerInput && qitem.StuSourceId == subItem.StuSourceId)?.ToList();
//企业同行 //企业同行
if (sItem.CustomerSourceType == 1) if (sItem.CustomerType == Common.Enum.Customer.CatetoryTypeEnum.Company)
{ {
list.Add(new list.Add(new
{ {
...@@ -1391,7 +1392,7 @@ namespace Edu.Module.Customer ...@@ -1391,7 +1392,7 @@ namespace Edu.Module.Customer
}); });
} }
//校代同行 //校代同行
else if (sItem.CustomerSourceType == 2) else if (sItem.CustomerType == Common.Enum.Customer.CatetoryTypeEnum.School)
{ {
list.Add(new list.Add(new
{ {
......
...@@ -1033,7 +1033,7 @@ WHERE 1=1 ...@@ -1033,7 +1033,7 @@ WHERE 1=1
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
builder.AppendFormat(@" builder.AppendFormat(@"
SELECT A.StuId,A.CreateBy,A.StuChannel,A.CreateType,IFNULL(B.VisitCount,0) AS VisitCount,IFNULL(C.CourseOrderCount,0) AS OrderCount,IFNULL(c.Income,0) AS OrderInCome SELECT A.StuId,A.CreateBy,A.StuChannel,A.CreateType,IFNULL(B.VisitCount,0) AS VisitCount,IFNULL(C.CourseOrderCount,0) AS OrderCount,IFNULL(c.Income,0) AS OrderInCome
,A.CustomerId,A.StuSourceId,IFNULL(D.CustomerSourceType,0) AS CustomerSourceType ,A.CustomerId,A.StuSourceId,IFNULL(D.CustomerType,0) AS CustomerType
FROM RB_Student AS A FROM RB_Student AS A
LEFT JOIN(SELECT StuId,Count(1) AS VisitCount FROM rb_student_visit WHERE Status=0 GROUP BY StuId) AS B ON A.StuId=B.StuId LEFT JOIN(SELECT StuId,Count(1) AS VisitCount FROM rb_student_visit WHERE Status=0 GROUP BY StuId) AS B ON A.StuId=B.StuId
LEFT JOIN(SELECT og.Student_Id,COUNT(1) AS CourseOrderCount,SUM(o.Income) AS Income FROM rb_student_orderguest AS og INNER JOIN rb_order AS o ON og.OrderId=o.OrderId WHERE O.OrderState NOT IN(3,4) GROUP BY og.Student_Id ) AS C ON A.StuId=C.Student_Id LEFT JOIN(SELECT og.Student_Id,COUNT(1) AS CourseOrderCount,SUM(o.Income) AS Income FROM rb_student_orderguest AS og INNER JOIN rb_order AS o ON og.OrderId=o.OrderId WHERE O.OrderState NOT IN(3,4) GROUP BY og.Student_Id ) AS C ON A.StuId=C.Student_Id
......
...@@ -2819,12 +2819,8 @@ namespace Edu.WebApi.Controllers.User ...@@ -2819,12 +2819,8 @@ namespace Edu.WebApi.Controllers.User
{ {
empList = JsonHelper.DeserializeObject<List<int>>(empIds); empList = JsonHelper.DeserializeObject<List<int>>(empIds);
} }
string qEmpIds = "";
if (empList != null && empList.Count > 0) var data = marketConsultantModule.MarketCreateTypeStaticModule(empList, startTime, endTime);
{
qEmpIds = string.Join(",", empList);
}
var data = marketConsultantModule.MarketCreateTypeStaticModule(startTime, endTime);
return ApiResult.Success(data: data); return ApiResult.Success(data: data);
} }
......
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