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

页面修改

parent eeae4f19
using System;
using Edu.Common.Enum.Customer;
using System;
using System.Collections.Generic;
using System.Text;
......@@ -38,5 +39,10 @@ namespace Edu.Model.ViewModel.DataStatistics
/// 订单业绩金额
/// </summary>
public decimal OrderIncome { get; set; }
/// <summary>
/// 客户类型
/// </summary>
public CatetoryTypeEnum CustomerType { get; set; }
}
}
......@@ -1333,9 +1333,9 @@ namespace Edu.Module.Customer
/// <param name="StartTime"></param>
/// <param name="EndTime"></param>
/// <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 dataList = studentRepository.GetStudentChannelStaticRepository(new RB_Student_ViewModel()
{
......@@ -1348,14 +1348,14 @@ namespace Edu.Module.Customer
foreach (var item in channelList)
{
var channelTempList = dataList?.Where(qitem => qitem.CreateType == StuCreateTypeEnum.EmployeeInput && qitem.StuChannel == item.Id)?.ToList();
list.Add(new
list.Add(new MarketChannelStaticModel()
{
ChannelName = item.Name,
ChannelId = item.Id,
ClueCount = channelTempList?.Count(),
VisitCount = channelTempList?.Sum(qitem => qitem.VisitCount),
OrderCount = channelTempList?.Sum(qitem => qitem.OrderCount),
OrderIncome = channelTempList?.Sum(qitem => qitem.OrderIncome)
ClueCount = channelTempList?.Count()??0,
VisitCount = channelTempList?.Sum(qitem => qitem.VisitCount)??0,
OrderCount = channelTempList?.Sum(qitem => qitem.OrderCount)??0,
OrderIncome = channelTempList?.Sum(qitem => qitem.OrderIncome)??0
});
}
}
......@@ -1382,29 +1382,29 @@ namespace Edu.Module.Customer
//企业同行
if (sItem.CustomerType == Common.Enum.Customer.CatetoryTypeEnum.Company)
{
list.Add(new
list.Add(new MarketChannelStaticModel()
{
ChannelName = "(企业)" + (customerList?.FirstOrDefault(qitem => qitem.CustomerId == subItem.StuSourceId)?.CustomerName ?? ""),
ChannelId= subItem.StuSourceId,
sItem.CustomerType,
ClueCount = tempCusList?.Count(),
VisitCount = tempCusList?.Sum(qitem => qitem.VisitCount),
OrderCount = tempCusList?.Sum(qitem => qitem.OrderCount),
OrderIncome = tempCusList?.Sum(qitem => qitem.OrderIncome)
CustomerType= sItem.CustomerType,
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
});
}
//校代同行
if (sItem.CustomerType == Common.Enum.Customer.CatetoryTypeEnum.School)
{
list.Add(new
list.Add(new MarketChannelStaticModel()
{
ChannelName = "(校代)" + (customerList?.FirstOrDefault(qitem => qitem.CustomerId == subItem.StuSourceId)?.CustomerName ?? ""),
ChannelId=subItem.StuSourceId,
sItem.CustomerType,
ClueCount = tempCusList?.Count(),
VisitCount = tempCusList?.Sum(qitem => qitem.VisitCount),
OrderCount = tempCusList?.Sum(qitem => qitem.OrderCount),
OrderIncome = tempCusList?.Sum(qitem => qitem.OrderIncome)
CustomerType=sItem.CustomerType,
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
});
}
}
......@@ -1423,14 +1423,14 @@ namespace Edu.Module.Customer
foreach (var sItem in groupDataList)
{
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 ?? ""),
ChannelId=sItem.StuSourceId,
ClueCount = tempInnerList?.Count(),
VisitCount = tempInnerList?.Sum(qitem => qitem.VisitCount),
OrderCount = tempInnerList?.Sum(qitem => qitem.OrderCount),
OrderIncome = tempInnerList?.Sum(qitem => qitem.OrderIncome)
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
});
}
......@@ -1446,25 +1446,25 @@ namespace Edu.Module.Customer
foreach (var sItem in transTypeList)
{
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 ?? "",
ChannelId = sItem.StuSourceId,
ClueCount = tempTransList?.Count(),
VisitCount = tempTransList?.Sum(qitem => qitem.VisitCount),
OrderCount = tempTransList?.Sum(qitem => qitem.OrderCount),
OrderIncome = tempTransList?.Sum(qitem => qitem.OrderIncome)
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
});
}
list.Add(new
list.Add(new MarketChannelStaticModel()
{
ChannelName = "合计",
ChannelId = 10005,
ClueCount = dataList?.Count(),
VisitCount = dataList?.Sum(qitem => qitem.VisitCount),
OrderCount = dataList?.Sum(qitem => qitem.OrderCount),
OrderIncome = dataList?.Sum(qitem => qitem.OrderIncome)
ClueCount = dataList?.Count() ?? 0,
VisitCount = dataList?.Sum(qitem => qitem.VisitCount) ?? 0,
OrderCount = dataList?.Sum(qitem => qitem.OrderCount) ?? 0,
OrderIncome = dataList?.Sum(qitem => qitem.OrderIncome) ?? 0
});
return list;
}
......
......@@ -623,18 +623,18 @@ namespace Edu.WebApi.Controllers.Customer
ExcelDataSource header = new ExcelDataSource();
header.ExcelRows = new List<ExcelColumn>()
{
new ExcelColumn("联系人名称"),
new ExcelColumn("类型"),
new ExcelColumn("同行名称"),
new ExcelColumn("电话"),
new ExcelColumn("QQ号"),
new ExcelColumn("微信号"),
new ExcelColumn("客户数量"),
new ExcelColumn("订单数量"),
new ExcelColumn("交易额"),
new ExcelColumn("审核状态"),
new ExcelColumn("加入时间"),
new ExcelColumn("负责人"),
new ExcelColumn("联系人名称"){ CellWidth=20},
new ExcelColumn("类型"){ CellWidth=20},
new ExcelColumn("同行名称"){ CellWidth=20},
new ExcelColumn("电话"){ CellWidth=20},
new ExcelColumn("QQ号"){ 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},
new ExcelColumn("负责人"){ CellWidth=20},
};
slist.Add(header);
foreach (var item in list)
......@@ -949,6 +949,73 @@ namespace Edu.WebApi.Controllers.Customer
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>
......
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