Commit 934d0810 authored by 黄奎's avatar 黄奎

页面修改

parent eeae4f19
using System; using Edu.Common.Enum.Customer;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text; using System.Text;
...@@ -38,5 +39,10 @@ namespace Edu.Model.ViewModel.DataStatistics ...@@ -38,5 +39,10 @@ namespace Edu.Model.ViewModel.DataStatistics
/// 订单业绩金额 /// 订单业绩金额
/// </summary> /// </summary>
public decimal OrderIncome { get; set; } public decimal OrderIncome { get; set; }
/// <summary>
/// 客户类型
/// </summary>
public CatetoryTypeEnum CustomerType { get; set; }
} }
} }
...@@ -1333,9 +1333,9 @@ namespace Edu.Module.Customer ...@@ -1333,9 +1333,9 @@ 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 MarketChannelStaticModule(List<int> queryEmployeeList,string StartTime, string EndTime) public List<MarketChannelStaticModel> MarketChannelStaticModule(List<int> queryEmployeeList,string StartTime, string EndTime)
{ {
List<object> list = new List<object>(); List<MarketChannelStaticModel> list = new List<MarketChannelStaticModel>();
var channelList = channelRepository.GetChannelListRepository(new RB_Channel_Extend() { }); var channelList = channelRepository.GetChannelListRepository(new RB_Channel_Extend() { });
var dataList = studentRepository.GetStudentChannelStaticRepository(new RB_Student_ViewModel() var dataList = studentRepository.GetStudentChannelStaticRepository(new RB_Student_ViewModel()
{ {
...@@ -1348,14 +1348,14 @@ namespace Edu.Module.Customer ...@@ -1348,14 +1348,14 @@ namespace Edu.Module.Customer
foreach (var item in channelList) foreach (var item in channelList)
{ {
var channelTempList = dataList?.Where(qitem => qitem.CreateType == StuCreateTypeEnum.EmployeeInput && qitem.StuChannel == item.Id)?.ToList(); var channelTempList = dataList?.Where(qitem => qitem.CreateType == StuCreateTypeEnum.EmployeeInput && qitem.StuChannel == item.Id)?.ToList();
list.Add(new list.Add(new MarketChannelStaticModel()
{ {
ChannelName = item.Name, ChannelName = item.Name,
ChannelId = item.Id, ChannelId = item.Id,
ClueCount = channelTempList?.Count(), ClueCount = channelTempList?.Count()??0,
VisitCount = channelTempList?.Sum(qitem => qitem.VisitCount), VisitCount = channelTempList?.Sum(qitem => qitem.VisitCount)??0,
OrderCount = channelTempList?.Sum(qitem => qitem.OrderCount), OrderCount = channelTempList?.Sum(qitem => qitem.OrderCount)??0,
OrderIncome = channelTempList?.Sum(qitem => qitem.OrderIncome) OrderIncome = channelTempList?.Sum(qitem => qitem.OrderIncome)??0
}); });
} }
} }
...@@ -1382,29 +1382,29 @@ namespace Edu.Module.Customer ...@@ -1382,29 +1382,29 @@ namespace Edu.Module.Customer
//企业同行 //企业同行
if (sItem.CustomerType == Common.Enum.Customer.CatetoryTypeEnum.Company) if (sItem.CustomerType == Common.Enum.Customer.CatetoryTypeEnum.Company)
{ {
list.Add(new list.Add(new MarketChannelStaticModel()
{ {
ChannelName = "(企业)" + (customerList?.FirstOrDefault(qitem => qitem.CustomerId == subItem.StuSourceId)?.CustomerName ?? ""), ChannelName = "(企业)" + (customerList?.FirstOrDefault(qitem => qitem.CustomerId == subItem.StuSourceId)?.CustomerName ?? ""),
ChannelId= subItem.StuSourceId, ChannelId= subItem.StuSourceId,
sItem.CustomerType, CustomerType= sItem.CustomerType,
ClueCount = tempCusList?.Count(), ClueCount = tempCusList?.Count()??0,
VisitCount = tempCusList?.Sum(qitem => qitem.VisitCount), VisitCount = tempCusList?.Sum(qitem => qitem.VisitCount)??0,
OrderCount = tempCusList?.Sum(qitem => qitem.OrderCount), OrderCount = tempCusList?.Sum(qitem => qitem.OrderCount)??0,
OrderIncome = tempCusList?.Sum(qitem => qitem.OrderIncome) OrderIncome = tempCusList?.Sum(qitem => qitem.OrderIncome)??0
}); });
} }
//校代同行 //校代同行
if (sItem.CustomerType == Common.Enum.Customer.CatetoryTypeEnum.School) if (sItem.CustomerType == Common.Enum.Customer.CatetoryTypeEnum.School)
{ {
list.Add(new list.Add(new MarketChannelStaticModel()
{ {
ChannelName = "(校代)" + (customerList?.FirstOrDefault(qitem => qitem.CustomerId == subItem.StuSourceId)?.CustomerName ?? ""), ChannelName = "(校代)" + (customerList?.FirstOrDefault(qitem => qitem.CustomerId == subItem.StuSourceId)?.CustomerName ?? ""),
ChannelId=subItem.StuSourceId, ChannelId=subItem.StuSourceId,
sItem.CustomerType, CustomerType=sItem.CustomerType,
ClueCount = tempCusList?.Count(), ClueCount = tempCusList?.Count()??0,
VisitCount = tempCusList?.Sum(qitem => qitem.VisitCount), VisitCount = tempCusList?.Sum(qitem => qitem.VisitCount)??0,
OrderCount = tempCusList?.Sum(qitem => qitem.OrderCount), OrderCount = tempCusList?.Sum(qitem => qitem.OrderCount)??0,
OrderIncome = tempCusList?.Sum(qitem => qitem.OrderIncome) OrderIncome = tempCusList?.Sum(qitem => qitem.OrderIncome)??0
}); });
} }
} }
...@@ -1423,14 +1423,14 @@ namespace Edu.Module.Customer ...@@ -1423,14 +1423,14 @@ namespace Edu.Module.Customer
foreach (var sItem in groupDataList) foreach (var sItem in groupDataList)
{ {
var tempInnerList = dataList?.Where(qitem => qitem.CreateType == StuCreateTypeEnum.InternalIntroduction && qitem.StuSourceId == sItem.StuSourceId)?.ToList(); var tempInnerList = dataList?.Where(qitem => qitem.CreateType == StuCreateTypeEnum.InternalIntroduction && qitem.StuSourceId == sItem.StuSourceId)?.ToList();
list.Add(new list.Add(new MarketChannelStaticModel()
{ {
ChannelName = "(内部介绍)" + (empList?.FirstOrDefault(qitem => qitem.Id == sItem.StuSourceId)?.EmployeeName ?? ""), ChannelName = "(内部介绍)" + (empList?.FirstOrDefault(qitem => qitem.Id == sItem.StuSourceId)?.EmployeeName ?? ""),
ChannelId=sItem.StuSourceId, ChannelId=sItem.StuSourceId,
ClueCount = tempInnerList?.Count(), ClueCount = tempInnerList?.Count()??0,
VisitCount = tempInnerList?.Sum(qitem => qitem.VisitCount), VisitCount = tempInnerList?.Sum(qitem => qitem.VisitCount)??0,
OrderCount = tempInnerList?.Sum(qitem => qitem.OrderCount), OrderCount = tempInnerList?.Sum(qitem => qitem.OrderCount)??0,
OrderIncome = tempInnerList?.Sum(qitem => qitem.OrderIncome) OrderIncome = tempInnerList?.Sum(qitem => qitem.OrderIncome)??0
}); });
} }
...@@ -1446,25 +1446,25 @@ namespace Edu.Module.Customer ...@@ -1446,25 +1446,25 @@ namespace Edu.Module.Customer
foreach (var sItem in transTypeList) foreach (var sItem in transTypeList)
{ {
var tempTransList = dataList?.Where(qitem => qitem.CreateType == StuCreateTypeEnum.TransIntroduction && qitem.StuSourceId == sItem.StuSourceId)?.ToList(); var tempTransList = dataList?.Where(qitem => qitem.CreateType == StuCreateTypeEnum.TransIntroduction && qitem.StuSourceId == sItem.StuSourceId)?.ToList();
list.Add(new list.Add(new MarketChannelStaticModel()
{ {
ChannelName = "(学员转介绍)" + stuList?.FirstOrDefault(qitem => qitem.StuId == sItem.StuSourceId)?.StuName ?? "", ChannelName = "(学员转介绍)" + stuList?.FirstOrDefault(qitem => qitem.StuId == sItem.StuSourceId)?.StuName ?? "",
ChannelId = sItem.StuSourceId, ChannelId = sItem.StuSourceId,
ClueCount = tempTransList?.Count(), ClueCount = tempTransList?.Count()??0,
VisitCount = tempTransList?.Sum(qitem => qitem.VisitCount), VisitCount = tempTransList?.Sum(qitem => qitem.VisitCount)??0,
OrderCount = tempTransList?.Sum(qitem => qitem.OrderCount), OrderCount = tempTransList?.Sum(qitem => qitem.OrderCount)??0,
OrderIncome = tempTransList?.Sum(qitem => qitem.OrderIncome) OrderIncome = tempTransList?.Sum(qitem => qitem.OrderIncome)??0
}); });
} }
list.Add(new list.Add(new MarketChannelStaticModel()
{ {
ChannelName = "合计", ChannelName = "合计",
ChannelId = 10005, ChannelId = 10005,
ClueCount = dataList?.Count(), ClueCount = dataList?.Count() ?? 0,
VisitCount = dataList?.Sum(qitem => qitem.VisitCount), VisitCount = dataList?.Sum(qitem => qitem.VisitCount) ?? 0,
OrderCount = dataList?.Sum(qitem => qitem.OrderCount), OrderCount = dataList?.Sum(qitem => qitem.OrderCount) ?? 0,
OrderIncome = dataList?.Sum(qitem => qitem.OrderIncome) OrderIncome = dataList?.Sum(qitem => qitem.OrderIncome) ?? 0
}); });
return list; return list;
} }
......
...@@ -623,18 +623,18 @@ namespace Edu.WebApi.Controllers.Customer ...@@ -623,18 +623,18 @@ namespace Edu.WebApi.Controllers.Customer
ExcelDataSource header = new ExcelDataSource(); ExcelDataSource header = new ExcelDataSource();
header.ExcelRows = new List<ExcelColumn>() header.ExcelRows = new List<ExcelColumn>()
{ {
new ExcelColumn("联系人名称"), new ExcelColumn("联系人名称"){ CellWidth=20},
new ExcelColumn("类型"), new ExcelColumn("类型"){ CellWidth=20},
new ExcelColumn("同行名称"), new ExcelColumn("同行名称"){ CellWidth=20},
new ExcelColumn("电话"), new ExcelColumn("电话"){ CellWidth=20},
new ExcelColumn("QQ号"), new ExcelColumn("QQ号"){ CellWidth=20},
new ExcelColumn("微信号"), new ExcelColumn("微信号"){ CellWidth=20},
new ExcelColumn("客户数量"), new ExcelColumn("客户数量"){ CellWidth=20},
new ExcelColumn("订单数量"), new ExcelColumn("订单数量"){ CellWidth=20},
new ExcelColumn("交易额"), new ExcelColumn("交易额"){ CellWidth=20},
new ExcelColumn("审核状态"), new ExcelColumn("审核状态"){ CellWidth=20},
new ExcelColumn("加入时间"), new ExcelColumn("加入时间"){ CellWidth=20},
new ExcelColumn("负责人"), new ExcelColumn("负责人"){ CellWidth=20},
}; };
slist.Add(header); slist.Add(header);
foreach (var item in list) foreach (var item in list)
...@@ -949,6 +949,73 @@ namespace Edu.WebApi.Controllers.Customer ...@@ -949,6 +949,73 @@ namespace Edu.WebApi.Controllers.Customer
return ApiResult.Success(data: pageModel); return ApiResult.Success(data: pageModel);
} }
/// <summary>
/// 同行信息下载
/// </summary>
/// <returns></returns>
[HttpPost]
[Obsolete]
public FileContentResult DownLoadCustomer()
{
var query = new RB_Customer_Category_Extend()
{
Group_Id = base.UserInfo.Group_Id,
CategoryName = base.ParmJObj.GetStringValue("CategoryName"),
CatetoryType = (CatetoryTypeEnum)base.ParmJObj.GetInt("CatetoryType"),
};
int IsQueryAll = base.ParmJObj.GetInt("IsQueryAll");
if (IsQueryAll == 0)
{
query.CreateBy = base.UserInfo.Id;
}
var list = customerModule.GetCustomerCategoryPageModule(1, 100000, out long rowsCount, query);
string excelName = "同行资料.xls";
List<ExcelDataSource> slist = new List<ExcelDataSource>();
try
{
ExcelDataSource header = new ExcelDataSource();
header.ExcelRows = new List<ExcelColumn>()
{
new ExcelColumn("同业名称"){ CellWidth=20},
new ExcelColumn("类型"){ CellWidth=20},
new ExcelColumn("联系人数量"){ CellWidth=20},
new ExcelColumn("客户数量"){ CellWidth=20},
new ExcelColumn("订单数量"){ CellWidth=20},
new ExcelColumn("加入时间"){ CellWidth=20},
new ExcelColumn("负责人"){ CellWidth=20},
};
slist.Add(header);
foreach (var item in list)
{
var dataRow = new ExcelDataSource()
{
ExcelRows = new List<ExcelColumn>()
{
new ExcelColumn(item.CategoryName),
new ExcelColumn(item.CatetoryType.ToName()),
new ExcelColumn(item.LinkManCount.ToString()),
new ExcelColumn(item.StudentCount.ToString()),
new ExcelColumn(item.OrderCount.ToString()),
new ExcelColumn(Common.ConvertHelper.FormatTime(item.CreateTime)),
new ExcelColumn(UserReidsCache.GetUserLoginInfo(item.CreateBy)?.AccountName ?? ""),
}
};
slist.Add(dataRow);
}
var byteData = ExcelTempLateHelper.ToExcelExtend(slist);
return File(byteData, "application/octet-stream", excelName);
}
catch (Exception ex)
{
LogHelper.Write(ex, "OutToExcelOrderStudentClassHoursList");
var byteData1 = ExcelTempLateHelper.ToExcelExtend(slist);
return File(byteData1, "application/octet-stream", excelName);
}
}
/// <summary> /// <summary>
/// 获取同行列表 /// 获取同行列表
/// </summary> /// </summary>
......
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