Commit ddd6e110 authored by 黄奎's avatar 黄奎

页面修改

parent 61f5984f
......@@ -1173,38 +1173,102 @@ namespace Edu.Module.Customer
});
}
}
var customerList = dataList?.Where(qitem => qitem.CreateType == StuCreateTypeEnum.CustomerInput)?.ToList();
list.Add(new
var cusIds = string.Join(",", dataList.Where(qitem => qitem.CreateType == StuCreateTypeEnum.CustomerInput).Select(qitem => qitem.StuSourceId));
List<RB_Customer_Extend> customerList = new List<RB_Customer_Extend>();
if (!string.IsNullOrEmpty(cusIds))
{
ChannelName = "同行介绍",
ChannelId = 10001,
ClueCount = customerList?.Count(),
VisitCount = customerList?.Sum(qitem => qitem.VisitCount),
OrderCount = customerList?.Sum(qitem => qitem.OrderCount),
OrderIncome = customerList?.Sum(qitem => qitem.OrderIncome)
});
customerList = customerRepository.GetCustomerListRepository(new RB_Customer_Extend() { CustomerIds = cusIds });
}
var sourceTypeList = dataList?.Where(qitem => qitem.CreateType == StuCreateTypeEnum.CustomerInput)
?.GroupBy(qitem => new { qitem.CustomerSourceType })
?.Select(qitem => new { qitem.Key.CustomerSourceType });
var innerList = dataList?.Where(qitem => qitem.CreateType == StuCreateTypeEnum.InternalIntroduction)?.ToList();
list.Add(new
foreach (var sItem in sourceTypeList)
{
ChannelName = "内部介绍",
ChannelId = 10002,
ClueCount = innerList?.Count(),
VisitCount = innerList?.Sum(qitem => qitem.VisitCount),
OrderCount = innerList?.Sum(qitem => qitem.OrderCount),
OrderIncome = innerList?.Sum(qitem => qitem.OrderIncome)
});
var sourceIdList = dataList?.Where(qitem => qitem.CreateType == StuCreateTypeEnum.CustomerInput && qitem.CustomerSourceType == sItem.CustomerSourceType)
?.GroupBy(qitem => new { qitem.StuSourceId })
?.Select(qitem => new { qitem.Key.StuSourceId });
foreach (var subItem in sourceIdList)
{
var tempCusList = dataList?.Where(qitem => qitem.CreateType == StuCreateTypeEnum.CustomerInput && qitem.StuSourceId == subItem.StuSourceId)?.ToList();
//企业同行
if (sItem.CustomerSourceType == 1)
{
list.Add(new
{
ChannelName ="(企业)"+( customerList?.FirstOrDefault(qitem => qitem.CustomerId == subItem.StuSourceId)?.CustomerName ?? ""),
subItem.StuSourceId,
ClueCount = tempCusList?.Count(),
VisitCount = tempCusList?.Sum(qitem => qitem.VisitCount),
OrderCount = tempCusList?.Sum(qitem => qitem.OrderCount),
OrderIncome = tempCusList?.Sum(qitem => qitem.OrderIncome)
});
}
//校代同行
else if (sItem.CustomerSourceType == 2)
{
list.Add(new
{
ChannelName = "(校代)" + (customerList?.FirstOrDefault(qitem => qitem.CustomerId == subItem.StuSourceId)?.CustomerName ?? ""),
subItem.StuSourceId,
ClueCount = tempCusList?.Count(),
VisitCount = tempCusList?.Sum(qitem => qitem.VisitCount),
OrderCount = tempCusList?.Sum(qitem => qitem.OrderCount),
OrderIncome = tempCusList?.Sum(qitem => qitem.OrderIncome)
});
}
}
}
var transList = dataList?.Where(qitem => qitem.CreateType == StuCreateTypeEnum.TransIntroduction)?.ToList();
list.Add(new
var empIds = string.Join(",", dataList.Where(qitem => qitem.CreateType == StuCreateTypeEnum.InternalIntroduction).Select(qitem => qitem.StuSourceId));
List<Employee_ViewModel> empList = new List<Employee_ViewModel>();
if (!string.IsNullOrEmpty(empIds))
{
ChannelName = "学员转介绍",
ChannelId = 10003,
ClueCount = transList?.Count(),
VisitCount = transList?.Sum(qitem => qitem.VisitCount),
OrderCount = transList?.Sum(qitem => qitem.OrderCount),
OrderIncome = transList?.Sum(qitem => qitem.OrderIncome)
});
empList = accountRepository.GetEmployeeListRepository(new Employee_ViewModel() { QIds = empIds });
}
var groupDataList = dataList?.Where(qitem => qitem.CreateType == StuCreateTypeEnum.InternalIntroduction)
?.GroupBy(qitem => new { qitem.StuSourceId })
?.Select(qitem => new { qitem.Key.StuSourceId });
foreach (var sItem in groupDataList)
{
var tempInnerList = dataList?.Where(qitem => qitem.CreateType == StuCreateTypeEnum.CustomerInput && qitem.StuSourceId == sItem.StuSourceId)?.ToList();
list.Add(new
{
ChannelName = "(内部介绍)" + (empList?.FirstOrDefault(qitem => qitem.Id == sItem.StuSourceId)?.EmployeeName ?? ""),
sItem.StuSourceId,
ClueCount = tempInnerList?.Count(),
VisitCount = tempInnerList?.Sum(qitem => qitem.VisitCount),
OrderCount = tempInnerList?.Sum(qitem => qitem.OrderCount),
OrderIncome = tempInnerList?.Sum(qitem => qitem.OrderIncome)
});
}
var stuIds = string.Join(",", dataList.Where(qitem => qitem.CreateType == StuCreateTypeEnum.TransIntroduction).Select(qitem => qitem.StuSourceId));
List<RB_Student_ViewModel> stuList = new List<RB_Student_ViewModel>();
if (!string.IsNullOrEmpty(stuIds))
{
stuList = studentRepository.GetStudentListRepository(new RB_Student_ViewModel() { StuIds = stuIds });
}
var transTypeList = dataList?.Where(qitem => qitem.CreateType == StuCreateTypeEnum.InternalIntroduction)
?.GroupBy(qitem => new { qitem.StuSourceId })
?.Select(qitem => new { qitem.Key.StuSourceId });
foreach (var sItem in transTypeList)
{
var tempTransList = dataList?.Where(qitem => qitem.CreateType == StuCreateTypeEnum.InternalIntroduction && qitem.StuSourceId == sItem.StuSourceId)?.ToList();
list.Add(new
{
ChannelName = "(学员转介绍)" + stuList?.FirstOrDefault(qitem => qitem.StuId == sItem.StuSourceId)?.StuName ?? "",
sItem.StuSourceId,
ClueCount = tempTransList?.Count(),
VisitCount = tempTransList?.Sum(qitem => qitem.VisitCount),
OrderCount = tempTransList?.Sum(qitem => qitem.OrderCount),
OrderIncome = tempTransList?.Sum(qitem => qitem.OrderIncome)
});
}
list.Add(new
{
ChannelName = "合计",
......
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