Commit 237bd5ca authored by 黄奎's avatar 黄奎

新增实体类

parent ed2d5887
using System;
using System.Collections.Generic;
using System.Text;
namespace Edu.Model.ViewModel.DataStatistics
{
/// <summary>
/// 市场渠道统计实体类
/// </summary>
public class MarketChannelStaticModel
{
/// <summary>
/// 渠道名称
/// </summary>
public string ChannelName { get; set; }
/// <summary>
/// 渠道编号
/// </summary>
public int ChannelId { get; set; }
/// <summary>
/// 回单(新增学员数量)
/// </summary>
public int ClueCount { get; set; }
/// <summary>
/// 到访数量
/// </summary>
public int VisitCount { get; set; }
/// <summary>
/// 订单数量
/// </summary>
public int OrderCount { get; set; }
/// <summary>
/// 订单业绩金额
/// </summary>
public decimal OrderIncome { get; set; }
}
}
......@@ -1026,11 +1026,11 @@ namespace Edu.Module.Customer
});
var enumList = Common.Plugin.EnumHelper.EnumToList(typeof(StuCreateTypeEnum));
//企业同行
List<object> customerDataList = new List<object>();
List<MarketChannelStaticModel> customerDataList = new List<MarketChannelStaticModel>();
//校代同行
List<object> schoolDataList = new List<object>();
List<object> innerDataList = new List<object>();
List<object> transDataList = new List<object>();
List<MarketChannelStaticModel> schoolDataList = new List<MarketChannelStaticModel>();
List<MarketChannelStaticModel> innerDataList = new List<MarketChannelStaticModel>();
List<MarketChannelStaticModel> transDataList = new List<MarketChannelStaticModel>();
foreach (var item in enumList)
{
if (item.Id == (int)StuCreateTypeEnum.EmployeeInput)
......@@ -1060,27 +1060,27 @@ namespace Edu.Module.Customer
//企业同行
if (sItem.CustomerSourceType == 1)
{
customerDataList.Add(new
customerDataList.Add(new MarketChannelStaticModel()
{
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)
ChannelId= subItem.StuSourceId,
ClueCount = tempCusList?.Count()??0,
VisitCount = tempCusList?.Sum(qitem => qitem.VisitCount)??0,
OrderCount = tempCusList?.Sum(qitem => qitem.OrderCount)??0,
OrderIncome = tempCusList?.Sum(qitem => qitem.OrderIncome)??0
});
}
//校代同行
else if (sItem.CustomerSourceType == 2)
{
schoolDataList.Add(new
schoolDataList.Add(new MarketChannelStaticModel()
{
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)
ChannelId= subItem.StuSourceId,
ClueCount = tempCusList?.Count()??0,
VisitCount = tempCusList?.Sum(qitem => qitem.VisitCount)??0,
OrderCount = tempCusList?.Sum(qitem => qitem.OrderCount)??0,
OrderIncome = tempCusList?.Sum(qitem => qitem.OrderIncome)??0
});
}
}
......@@ -1101,14 +1101,14 @@ namespace Edu.Module.Customer
foreach (var sItem in groupDataList)
{
var tempInnerList = dataList?.Where(qitem => qitem.CreateType == StuCreateTypeEnum.CustomerInput && qitem.StuSourceId == sItem.StuSourceId)?.ToList();
innerDataList.Add(new
innerDataList.Add(new MarketChannelStaticModel()
{
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)
ChannelId= sItem.StuSourceId,
ClueCount = tempInnerList?.Count()??0,
VisitCount = tempInnerList?.Sum(qitem => qitem.VisitCount)??0,
OrderCount = tempInnerList?.Sum(qitem => qitem.OrderCount)??0,
OrderIncome = tempInnerList?.Sum(qitem => qitem.OrderIncome)??0
});
}
}
......@@ -1126,14 +1126,14 @@ namespace Edu.Module.Customer
foreach (var sItem in sourceTypeList)
{
var tempTransList = dataList?.Where(qitem => qitem.CreateType == StuCreateTypeEnum.InternalIntroduction && qitem.StuSourceId == sItem.StuSourceId)?.ToList();
transDataList.Add(new
transDataList.Add(new MarketChannelStaticModel()
{
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)
ChannelId= sItem.StuSourceId,
ClueCount = tempTransList?.Count()??0,
VisitCount = tempTransList?.Sum(qitem => qitem.VisitCount)??0,
OrderCount = tempTransList?.Sum(qitem => qitem.OrderCount)??0,
OrderIncome = tempTransList?.Sum(qitem => qitem.OrderIncome)??0
});
}
}
......
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