Commit ee71389f authored by 黄奎's avatar 黄奎

页面修改

parent 0f91ea8f
using Edu.Model.Entity.DataStatistics; using Edu.Model.Entity.DataStatistics;
using Edu.Model.ViewModel.User;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text; using System.Text;
...@@ -24,5 +25,15 @@ namespace Edu.Model.ViewModel.DataStatistics ...@@ -24,5 +25,15 @@ namespace Edu.Model.ViewModel.DataStatistics
/// 创建人 /// 创建人
/// </summary> /// </summary>
public string QCreateByIds { get; set; } public string QCreateByIds { get; set; }
/// <summary>
/// 本周学员名单
/// </summary>
public List<RB_Student_ViewModel> CurWeekStuList { get; set; }
/// <summary>
/// 本月学员名单
/// </summary>
public List<RB_Student_ViewModel> CurMonthStuList { get; set; }
} }
} }
...@@ -352,15 +352,18 @@ namespace Edu.Module.Customer ...@@ -352,15 +352,18 @@ namespace Edu.Module.Customer
var empName = UserReidsCache.GetUserLoginInfo(empId)?.AccountName ?? ""; var empName = UserReidsCache.GetUserLoginInfo(empId)?.AccountName ?? "";
foreach (var item in clist) foreach (var item in clist)
{ {
Dictionary<string, object> keyValues = new Dictionary<string, object>() { Dictionary<string, object> keyValues = new Dictionary<string, object>()
{
{ nameof(RB_Customer_Extend.CreateBy), empId}, { nameof(RB_Customer_Extend.CreateBy), empId},
{ nameof(RB_Customer_Extend.UpdateTime), DateTime.Now}, { nameof(RB_Customer_Extend.UpdateTime), DateTime.Now},
}; };
List<WhereHelper> wheres = new List<WhereHelper>() { List<WhereHelper> wheres = new List<WhereHelper>()
new WhereHelper(){ {
new WhereHelper()
{
FiledName = nameof(RB_Customer_Extend.CustomerId), FiledName = nameof(RB_Customer_Extend.CustomerId),
FiledValue = item.CustomerId, FiledValue = item.CustomerId,
OperatorEnum =OperatorEnum.Equal OperatorEnum =OperatorEnum.Equal
} }
}; };
bool flag = customerRepository.Update(keyValues, wheres); bool flag = customerRepository.Update(keyValues, wheres);
...@@ -576,6 +579,42 @@ namespace Edu.Module.Customer ...@@ -576,6 +579,42 @@ namespace Edu.Module.Customer
return list; return list;
} }
/// <summary>
/// 检测同行联系人是否存在
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public bool CheckCustomerModule(RB_Customer_Extend model,int checkType)
{
List<WhereHelper> list = new List<WhereHelper>
{
new WhereHelper(nameof(RB_Customer_Extend.Status), 0),
new WhereHelper(nameof(RB_Customer_Extend.Group_Id), model.Group_Id)
};
if (checkType==1&&!string.IsNullOrEmpty(model.ContactNumber))
{
list.Add(new WhereHelper(nameof(RB_Customer_Extend.ContactNumber), model.ContactNumber));
}
if (checkType == 2 && !string.IsNullOrEmpty(model.QQ))
{
list.Add(new WhereHelper(nameof(RB_Customer_Extend.QQ), model.QQ));
}
if (checkType == 3 && !string.IsNullOrEmpty(model.WeChatNo))
{
list.Add(new WhereHelper(nameof(RB_Customer_Extend.WeChatNo), model.WeChatNo));
}
if (model.CustomerId > 0)
{
list.Add(new WhereHelper()
{
FiledName = nameof(RB_Customer_Category_Extend.CategoryId),
FiledValue = model.CustomerId,
OperatorEnum = OperatorEnum.NotEqual
});
}
return customerRepository.Exists(list);
}
/// <summary> /// <summary>
/// 检测同行是否存在 /// 检测同行是否存在
/// </summary> /// </summary>
......
...@@ -111,7 +111,7 @@ namespace Edu.Module.Customer ...@@ -111,7 +111,7 @@ namespace Edu.Module.Customer
QDeptIds = "4", QDeptIds = "4",
Group_Id = 100000, Group_Id = 100000,
IsLeave = 1, IsLeave = 1,
UserRole= UserRoleEnum.MarketPersion, UserRole = UserRoleEnum.MarketPersion,
}); });
if (empList != null && empList.Count > 0) if (empList != null && empList.Count > 0)
{ {
...@@ -324,7 +324,7 @@ namespace Edu.Module.Customer ...@@ -324,7 +324,7 @@ namespace Edu.Module.Customer
QDeptIds = "13", QDeptIds = "13",
Group_Id = 100000, Group_Id = 100000,
IsLeave = 1, IsLeave = 1,
UserRole= UserRoleEnum.CourseConsultant, UserRole = UserRoleEnum.CourseConsultant,
}); });
if (empList != null && empList.Count > 0) if (empList != null && empList.Count > 0)
{ {
...@@ -785,21 +785,37 @@ namespace Edu.Module.Customer ...@@ -785,21 +785,37 @@ namespace Edu.Module.Customer
public object ConsultantStaticModule(string EmpIds, string StartTime, string EndTime) public object ConsultantStaticModule(string EmpIds, string StartTime, string EndTime)
{ {
object obj = new object(); object obj = new object();
DateTime start = Convert.ToDateTime(StartTime);
DateTime end = Convert.ToDateTime(EndTime); DateTime end = Convert.ToDateTime(EndTime);
var days = (end - start).Days; string newStart = Common.ConvertHelper.FormatDate(end.AddMonths(-1));
var studentList= studentRepository.GetStudentListRepository(new RB_Student_ViewModel() if (string.IsNullOrEmpty(EmpIds))
{ {
StartTime = StartTime, var empList = accountRepository.GetEmployeeListRepository(new Employee_ViewModel()
{
//市场部编号4,课程顾问部编号13
QDeptIds = "13",
Group_Id = 100000,
IsLeave = 1,
UserRole = UserRoleEnum.CourseConsultant,
});
EmpIds = string.Join(",", empList.Select(qitem => qitem.Id));
}
var studentList = studentRepository.GetStudentListRepository(new RB_Student_ViewModel()
{
StartTime = newStart,
EndTime = EndTime, EndTime = EndTime,
QCreateBys=EmpIds, QCreateBys = EmpIds,
}); }, isQueryAssist: true);
var lastList = consultant_DataRepository.GetConsultantListRepository(new RB_Consultant_Data_Extend() var lastList = consultant_DataRepository.GetConsultantListRepository(new RB_Consultant_Data_Extend()
{ {
StartTime = StartTime, StartTime = StartTime,
EndTime = EndTime, EndTime = EndTime,
QCreateByIds = EmpIds QCreateByIds = EmpIds
}); });
var curWeekStuList = studentList?.Where(qitem => Common.ConvertHelper.WeekOfYear(qitem.CreateTime) == Common.ConvertHelper.WeekOfYear(end.AddDays(-1)))?.ToList();
var curMonthStuList = studentList?.Where(qitem => qitem.CreateTime.Year == end.AddDays(-1).Year && qitem.CreateTime.Month == end.AddDays(-1).Month)?.ToList();
var consultantGoal = GetConsultantGoalListModule(new RB_Consultant_Goal_Extend() { Group_Id = 100000, Dept_Id = 13, YearStr = end.Year, MonthStr = end.Month })?.FirstOrDefault(); var consultantGoal = GetConsultantGoalListModule(new RB_Consultant_Goal_Extend() { Group_Id = 100000, Dept_Id = 13, YearStr = end.Year, MonthStr = end.Month })?.FirstOrDefault();
var yesDataList = lastList?.Where(qitem => qitem.Date.Year == end.AddDays(-1).Year && qitem.Date.Month == end.AddDays(-1).Month)?.ToList(); var yesDataList = lastList?.Where(qitem => qitem.Date.Year == end.AddDays(-1).Year && qitem.Date.Month == end.AddDays(-1).Month)?.ToList();
//当前周 //当前周
...@@ -838,21 +854,21 @@ namespace Edu.Module.Customer ...@@ -838,21 +854,21 @@ namespace Edu.Module.Customer
var LastMonthFollow = tempDataList?.Sum(qitem => qitem.LastMonthFollow) ?? 0; var LastMonthFollow = tempDataList?.Sum(qitem => qitem.LastMonthFollow) ?? 0;
decimal AgFollow = 0; decimal AgFollow = 0;
if (yesDataList != null && yesDataList.Where(qitem=>qitem.AgFollow>0).Count() > 0) if (yesDataList != null && yesDataList.Where(qitem => qitem.AgFollow > 0).Count() > 0)
{ {
AgFollow = Math.Round(yesDataList?.Average(qitem => qitem.AgFollow) ?? 0, 2); AgFollow = Math.Round(yesDataList?.Average(qitem => qitem.AgFollow) ?? 0, 2);
} }
decimal YestodayAgFollow = 0; decimal YestodayAgFollow = 0;
if (yesDataList != null && yesDataList.Where(qitem => qitem.YestodayAgFollow > 0).Count() > 0) if (yesDataList != null && yesDataList.Where(qitem => qitem.YestodayAgFollow > 0).Count() > 0)
{ {
YestodayAgFollow= Math.Round(yesDataList?.Average(qitem => qitem.YestodayAgFollow) ?? 0, 2); YestodayAgFollow = Math.Round(yesDataList?.Average(qitem => qitem.YestodayAgFollow) ?? 0, 2);
} }
decimal CurWeekAgFollow = 0; decimal CurWeekAgFollow = 0;
if (curWeekList != null && curWeekList.Where(qitem => qitem.CurWeekAgFollow > 0).Count() > 0) if (curWeekList != null && curWeekList.Where(qitem => qitem.CurWeekAgFollow > 0).Count() > 0)
{ {
CurWeekAgFollow= Math.Round(curWeekList?.Average(qitem => qitem.CurWeekAgFollow) ?? 0, 2); CurWeekAgFollow = Math.Round(curWeekList?.Average(qitem => qitem.CurWeekAgFollow) ?? 0, 2);
} }
...@@ -930,10 +946,62 @@ namespace Edu.Module.Customer ...@@ -930,10 +946,62 @@ namespace Edu.Module.Customer
CurMonthOrderNum, CurMonthOrderNum,
LastMonthOrderNum, LastMonthOrderNum,
CurWeekStu = curWeekStuList?.Select(qitem => new { qitem.StuId, qitem.StuName }),
CurMonthStu = curWeekStuList?.Select(qitem => new { qitem.StuId, qitem.StuName }),
}; };
return obj; return obj;
} }
/// <summary>
/// 课程顾问数据统计下载
/// </summary>
/// <param name="EmpIds"></param>
/// <param name="StartTime"></param>
/// <param name="EndTime"></param>
/// <returns></returns>
public List<RB_Consultant_Data_Extend> DownLoadConsultantStaticModule(string EmpIds, string StartTime, string EndTime)
{
List<RB_Consultant_Data_Extend> list = new List<RB_Consultant_Data_Extend>();
DateTime end = Convert.ToDateTime(EndTime);
string newStart = Common.ConvertHelper.FormatDate(end.AddMonths(-1));
if (string.IsNullOrEmpty(EmpIds))
{
var empList = accountRepository.GetEmployeeListRepository(new Employee_ViewModel()
{
//市场部编号4,课程顾问部编号13
QDeptIds = "13",
Group_Id = 100000,
IsLeave = 1,
UserRole = UserRoleEnum.CourseConsultant,
});
EmpIds = string.Join(",", empList.Select(qitem => qitem.Id));
}
var studentList = studentRepository.GetStudentListRepository(new RB_Student_ViewModel()
{
StartTime = newStart,
EndTime = EndTime,
QCreateBys = EmpIds,
},isQueryAssist:true);
var lastList = consultant_DataRepository.GetConsultantListRepository(new RB_Consultant_Data_Extend()
{
StartTime = StartTime,
EndTime = EndTime,
QCreateByIds = EmpIds
});
if (lastList != null && lastList.Count>0)
{
foreach (var item in lastList.Where(qitem=>Common.ConvertHelper.FormatDate(qitem.Date) == Common.ConvertHelper.FormatDate(end.AddDays(-1))))
{
var tempList = studentList?.Where(qitem => (qitem.CreateBy == item.CreateBy || qitem?.AssistList?.Where(sItem => sItem.AssistId == item.CreateBy).Count() > 0))?.ToList();
item.CurWeekStuList = tempList?.Where(qitem => Common.ConvertHelper.WeekOfYear(qitem.CreateTime) == Common.ConvertHelper.WeekOfYear(end.AddDays(-1)))?.ToList();
item.CurMonthStuList = tempList?.Where(qitem => qitem.CreateTime.Year == end.AddDays(-1).Year && qitem.CreateTime.Month == end.AddDays(-1).Month)?.ToList();
list.Add(item);
}
}
return list;
}
#region 课程顾问部目标设置 #region 课程顾问部目标设置
/// <summary> /// <summary>
...@@ -1087,7 +1155,7 @@ namespace Edu.Module.Customer ...@@ -1087,7 +1155,7 @@ namespace Edu.Module.Customer
{ {
//市场部编号4,课程顾问部编号13 //市场部编号4,课程顾问部编号13
QDeptIds = "4", QDeptIds = "4",
UserRole= UserRoleEnum.MarketPersion, UserRole = UserRoleEnum.MarketPersion,
Group_Id = 100000, Group_Id = 100000,
IsLeave = 1, IsLeave = 1,
QIds = qEmpIds QIds = qEmpIds
...@@ -1223,7 +1291,7 @@ namespace Edu.Module.Customer ...@@ -1223,7 +1291,7 @@ 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(List<int> queryEmployeeIds,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()
{ {
...@@ -1253,7 +1321,7 @@ namespace Edu.Module.Customer ...@@ -1253,7 +1321,7 @@ namespace Edu.Module.Customer
customerList = customerRepository.GetCustomerListRepository(new RB_Customer_Extend() { CustomerIds = cusIds }); customerList = customerRepository.GetCustomerListRepository(new RB_Customer_Extend() { CustomerIds = cusIds });
} }
var categoryTypeList = dataList?.Where(qitem => qitem.CreateType == StuCreateTypeEnum.CustomerInput) var categoryTypeList = dataList?.Where(qitem => qitem.CreateType == StuCreateTypeEnum.CustomerInput)
?.GroupBy(qitem => new { qitem.CatetoryType}) ?.GroupBy(qitem => new { qitem.CatetoryType })
?.Select(qitem => new { qitem.Key.CatetoryType }); ?.Select(qitem => new { qitem.Key.CatetoryType });
foreach (var sItem in categoryTypeList) foreach (var sItem in categoryTypeList)
...@@ -1266,7 +1334,7 @@ namespace Edu.Module.Customer ...@@ -1266,7 +1334,7 @@ namespace Edu.Module.Customer
var tempCusList = dataList?.Where(qitem => qitem.CreateType == StuCreateTypeEnum.CustomerInput && qitem.CategoryId == subItem.CategoryId)?.ToList(); var tempCusList = dataList?.Where(qitem => qitem.CreateType == StuCreateTypeEnum.CustomerInput && qitem.CategoryId == subItem.CategoryId)?.ToList();
var tempCustomer = customerList?.FirstOrDefault(qitem => qitem.CategoryId == subItem.CategoryId); var tempCustomer = customerList?.FirstOrDefault(qitem => qitem.CategoryId == subItem.CategoryId);
string channelName = tempCustomer?.CategoryName ?? "其他"; string channelName = tempCustomer?.CategoryName ?? "其他";
if (sItem.CatetoryType == CatetoryTypeEnum.Company) if (sItem.CatetoryType == CatetoryTypeEnum.Company)
{ {
customerDataList.Add(new MarketChannelStaticModel() customerDataList.Add(new MarketChannelStaticModel()
...@@ -1360,7 +1428,7 @@ namespace Edu.Module.Customer ...@@ -1360,7 +1428,7 @@ 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 List<MarketChannelStaticModel> MarketChannelStaticModule(List<int> queryEmployeeList,string StartTime, string EndTime) public List<MarketChannelStaticModel> MarketChannelStaticModule(List<int> queryEmployeeList, string StartTime, string EndTime)
{ {
List<MarketChannelStaticModel> list = new List<MarketChannelStaticModel>(); List<MarketChannelStaticModel> list = new List<MarketChannelStaticModel>();
var channelList = channelRepository.GetChannelListRepository(new RB_Channel_Extend() { }); var channelList = channelRepository.GetChannelListRepository(new RB_Channel_Extend() { });
...@@ -1368,7 +1436,7 @@ namespace Edu.Module.Customer ...@@ -1368,7 +1436,7 @@ namespace Edu.Module.Customer
{ {
StartTime = StartTime, StartTime = StartTime,
EndTime = EndTime, EndTime = EndTime,
CreateIds= queryEmployeeList CreateIds = queryEmployeeList
}); });
if (channelList != null && channelList.Count > 0) if (channelList != null && channelList.Count > 0)
{ {
...@@ -1379,11 +1447,11 @@ namespace Edu.Module.Customer ...@@ -1379,11 +1447,11 @@ namespace Edu.Module.Customer
{ {
ChannelName = item.Name, ChannelName = item.Name,
ChannelId = item.Id, ChannelId = item.Id,
ChannelType =1, ChannelType = 1,
ClueCount = channelTempList?.Count()??0, ClueCount = channelTempList?.Count() ?? 0,
VisitCount = channelTempList?.Sum(qitem => qitem.VisitCount)??0, VisitCount = channelTempList?.Sum(qitem => qitem.VisitCount) ?? 0,
OrderCount = channelTempList?.Sum(qitem => qitem.OrderCount)??0, OrderCount = channelTempList?.Sum(qitem => qitem.OrderCount) ?? 0,
OrderIncome = channelTempList?.Sum(qitem => qitem.OrderIncome)??0 OrderIncome = channelTempList?.Sum(qitem => qitem.OrderIncome) ?? 0
}); });
} }
} }
...@@ -1412,13 +1480,13 @@ namespace Edu.Module.Customer ...@@ -1412,13 +1480,13 @@ namespace Edu.Module.Customer
list.Add(new MarketChannelStaticModel() list.Add(new MarketChannelStaticModel()
{ {
ChannelName = "(企业)" + (tempCustomer?.CustomerName ?? ""), ChannelName = "(企业)" + (tempCustomer?.CustomerName ?? ""),
ChannelId= subItem.CategoryId, ChannelId = subItem.CategoryId,
CustomerType= sItem.CatetoryType, CustomerType = sItem.CatetoryType,
ChannelType = 2, ChannelType = 2,
ClueCount = tempCusList?.Count()??0, ClueCount = tempCusList?.Count() ?? 0,
VisitCount = tempCusList?.Sum(qitem => qitem.VisitCount)??0, VisitCount = tempCusList?.Sum(qitem => qitem.VisitCount) ?? 0,
OrderCount = tempCusList?.Sum(qitem => qitem.OrderCount)??0, OrderCount = tempCusList?.Sum(qitem => qitem.OrderCount) ?? 0,
OrderIncome = tempCusList?.Sum(qitem => qitem.OrderIncome)??0 OrderIncome = tempCusList?.Sum(qitem => qitem.OrderIncome) ?? 0
}); });
} }
//校代同行 //校代同行
...@@ -1427,13 +1495,13 @@ namespace Edu.Module.Customer ...@@ -1427,13 +1495,13 @@ namespace Edu.Module.Customer
list.Add(new MarketChannelStaticModel() list.Add(new MarketChannelStaticModel()
{ {
ChannelName = "(校代)" + (tempCustomer?.CustomerName ?? ""), ChannelName = "(校代)" + (tempCustomer?.CustomerName ?? ""),
ChannelId=subItem.CategoryId, ChannelId = subItem.CategoryId,
CustomerType=sItem.CatetoryType, CustomerType = sItem.CatetoryType,
ChannelType = 2, ChannelType = 2,
ClueCount = tempCusList?.Count()??0, ClueCount = tempCusList?.Count() ?? 0,
VisitCount = tempCusList?.Sum(qitem => qitem.VisitCount)??0, VisitCount = tempCusList?.Sum(qitem => qitem.VisitCount) ?? 0,
OrderCount = tempCusList?.Sum(qitem => qitem.OrderCount)??0, OrderCount = tempCusList?.Sum(qitem => qitem.OrderCount) ?? 0,
OrderIncome = tempCusList?.Sum(qitem => qitem.OrderIncome)??0 OrderIncome = tempCusList?.Sum(qitem => qitem.OrderIncome) ?? 0
}); });
} }
} }
...@@ -1454,12 +1522,12 @@ namespace Edu.Module.Customer ...@@ -1454,12 +1522,12 @@ namespace Edu.Module.Customer
list.Add(new MarketChannelStaticModel() 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,
ChannelType = 3, ChannelType = 3,
ClueCount = tempInnerList?.Count()??0, ClueCount = tempInnerList?.Count() ?? 0,
VisitCount = tempInnerList?.Sum(qitem => qitem.VisitCount)??0, VisitCount = tempInnerList?.Sum(qitem => qitem.VisitCount) ?? 0,
OrderCount = tempInnerList?.Sum(qitem => qitem.OrderCount)??0, OrderCount = tempInnerList?.Sum(qitem => qitem.OrderCount) ?? 0,
OrderIncome = tempInnerList?.Sum(qitem => qitem.OrderIncome)??0 OrderIncome = tempInnerList?.Sum(qitem => qitem.OrderIncome) ?? 0
}); });
} }
...@@ -1480,10 +1548,10 @@ namespace Edu.Module.Customer ...@@ -1480,10 +1548,10 @@ namespace Edu.Module.Customer
ChannelName = "(学员转介绍)" + stuList?.FirstOrDefault(qitem => qitem.StuId == sItem.StuSourceId)?.StuName ?? "", ChannelName = "(学员转介绍)" + stuList?.FirstOrDefault(qitem => qitem.StuId == sItem.StuSourceId)?.StuName ?? "",
ChannelId = sItem.StuSourceId, ChannelId = sItem.StuSourceId,
ChannelType = 4, ChannelType = 4,
ClueCount = tempTransList?.Count()??0, ClueCount = tempTransList?.Count() ?? 0,
VisitCount = tempTransList?.Sum(qitem => qitem.VisitCount)??0, VisitCount = tempTransList?.Sum(qitem => qitem.VisitCount) ?? 0,
OrderCount = tempTransList?.Sum(qitem => qitem.OrderCount)??0, OrderCount = tempTransList?.Sum(qitem => qitem.OrderCount) ?? 0,
OrderIncome = tempTransList?.Sum(qitem => qitem.OrderIncome)??0 OrderIncome = tempTransList?.Sum(qitem => qitem.OrderIncome) ?? 0
}); });
} }
......
...@@ -60,12 +60,17 @@ namespace Edu.Repository.User ...@@ -60,12 +60,17 @@ namespace Edu.Repository.User
/// </summary> /// </summary>
private readonly RB_NeedsRepository needsRepository = new RB_NeedsRepository(); private readonly RB_NeedsRepository needsRepository = new RB_NeedsRepository();
/// <summary>
/// 学员协助人员仓储层对象
/// </summary>
private readonly RB_Student_AssistRepository student_AssistRepository = new RB_Student_AssistRepository();
/// <summary> /// <summary>
/// 获取学生列表 /// 获取学生列表
/// </summary> /// </summary>
/// <param name="query"></param> /// <param name="query"></param>
/// <returns></returns> /// <returns></returns>
public List<RB_Student_ViewModel> GetStudentListRepository(RB_Student_ViewModel query,bool isQueryCreateType=false) public List<RB_Student_ViewModel> GetStudentListRepository(RB_Student_ViewModel query,bool isQueryCreateType=false,bool isQueryAssist=false)
{ {
var parameters = new DynamicParameters(); var parameters = new DynamicParameters();
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
...@@ -139,8 +144,8 @@ WHERE 1=1 ...@@ -139,8 +144,8 @@ WHERE 1=1
builder.AppendFormat(" AND t.{0}={1} ", nameof(RB_Student_ViewModel.CreateBy), query.CreateBy); builder.AppendFormat(" AND t.{0}={1} ", nameof(RB_Student_ViewModel.CreateBy), query.CreateBy);
} }
if (!string.IsNullOrEmpty(query.QCreateBys)) if (!string.IsNullOrEmpty(query.QCreateBys))
{ {
builder.AppendFormat(@" AND (t.CreateBy IN({0}) OR t.StuId IN(SELECT StuId FROM rb_student_assist WHERE AssistId IN({0}) AND `Status`= 0) ) ", query.QCreateBys);
} }
//根据订单编号查询学员 //根据订单编号查询学员
if (!string.IsNullOrEmpty(query.QOrderIds)) if (!string.IsNullOrEmpty(query.QOrderIds))
...@@ -167,7 +172,6 @@ WHERE 1=1 ...@@ -167,7 +172,6 @@ WHERE 1=1
List<RB_Account_ViewModel> accountList = new List<RB_Account_ViewModel>(); List<RB_Account_ViewModel> accountList = new List<RB_Account_ViewModel>();
if (stuList != null && stuList.Count > 0) if (stuList != null && stuList.Count > 0)
{ {
List<int> customerIdList = Common.ConvertHelper.StringToList(string.Join(",", stuList.Where(qitem => qitem.CreateType == StuCreateTypeEnum.CustomerInput).Select(qitem => qitem.StuSourceId))); List<int> customerIdList = Common.ConvertHelper.StringToList(string.Join(",", stuList.Where(qitem => qitem.CreateType == StuCreateTypeEnum.CustomerInput).Select(qitem => qitem.StuSourceId)));
if (customerIdList != null && customerIdList.Count > 0) if (customerIdList != null && customerIdList.Count > 0)
{ {
...@@ -223,6 +227,18 @@ WHERE 1=1 ...@@ -223,6 +227,18 @@ WHERE 1=1
} }
} }
} }
if (isQueryAssist)
{
if (stuList != null && stuList.Count > 0)
{
string stuIds = string.Join(",", stuList.Select(qitem => qitem.StuId));
List<RB_Student_Assist_Extend> assistList = student_AssistRepository.GetStudentAssistListRepository(new RB_Student_Assist_Extend() { QStuIds = stuIds });
foreach (var item in stuList)
{
item.AssistList = assistList?.Where(qitem => qitem.StuId == item.StuId)?.ToList() ?? new List<RB_Student_Assist_Extend>();
}
}
}
return stuList; return stuList;
} }
...@@ -290,7 +306,7 @@ WHERE 1=1 ...@@ -290,7 +306,7 @@ WHERE 1=1
} }
if (!string.IsNullOrWhiteSpace(query.StuTel)) if (!string.IsNullOrWhiteSpace(query.StuTel))
{ {
builder.AppendFormat(" AND t.{0} LIKE @StuTel ", nameof(RB_Student_ViewModel.StuTel)); builder.AppendFormat(" AND t.{0} LIKE @StuTel ", nameof(RB_Student_ViewModel.StuRealMobile));
parameters.Add("StuTel", "%" + query.StuTel.Trim() + "%"); parameters.Add("StuTel", "%" + query.StuTel.Trim() + "%");
} }
if (!string.IsNullOrWhiteSpace(query.QQ)) if (!string.IsNullOrWhiteSpace(query.QQ))
......
...@@ -102,9 +102,9 @@ namespace Edu.WebApi.Controllers.Customer ...@@ -102,9 +102,9 @@ namespace Edu.WebApi.Controllers.Customer
{ {
CustomerId = base.ParmJObj.GetInt("CustomerId"), CustomerId = base.ParmJObj.GetInt("CustomerId"),
CustomerName = base.ParmJObj.GetStringValue("CustomerName"), CustomerName = base.ParmJObj.GetStringValue("CustomerName"),
ContactNumber = base.ParmJObj.GetStringValue("ContactNumber"), ContactNumber = base.ParmJObj.GetStringValue("ContactNumber").Trim(),
Fax = base.ParmJObj.GetStringValue("Fax"), Fax = base.ParmJObj.GetStringValue("Fax"),
QQ = base.ParmJObj.GetStringValue("QQ"), QQ = base.ParmJObj.GetStringValue("QQ").Trim(),
Email = base.ParmJObj.GetStringValue("Email"), Email = base.ParmJObj.GetStringValue("Email"),
Address = base.ParmJObj.GetStringValue("Address"), Address = base.ParmJObj.GetStringValue("Address"),
Sex = base.ParmJObj.GetInt("Sex"), Sex = base.ParmJObj.GetInt("Sex"),
...@@ -120,9 +120,19 @@ namespace Edu.WebApi.Controllers.Customer ...@@ -120,9 +120,19 @@ namespace Edu.WebApi.Controllers.Customer
Remark = base.ParmJObj.GetStringValue("Remark"), Remark = base.ParmJObj.GetStringValue("Remark"),
EnterpriseName = base.ParmJObj.GetStringValue("EnterpriseName"), EnterpriseName = base.ParmJObj.GetStringValue("EnterpriseName"),
CustomerType = (CatetoryTypeEnum)base.ParmJObj.GetInt("CustomerType"), CustomerType = (CatetoryTypeEnum)base.ParmJObj.GetInt("CustomerType"),
WeChatNo = base.ParmJObj.GetStringValue("WeChatNo"), WeChatNo = base.ParmJObj.GetStringValue("WeChatNo").Trim(),
CategoryId=base.ParmJObj.GetInt("CategoryId"), CategoryId=base.ParmJObj.GetInt("CategoryId"),
}; };
model.Status = Common.Enum.DateStateEnum.Normal;
model.CreateBy = base.UserInfo.Id;
model.CreateTime = DateTime.Now;
model.UpdateTime = DateTime.Now;
model.Group_Id = base.UserInfo.Group_Id;
model.School_Id = base.UserInfo.School_Id;
model.ApproveState = 1;
model.ApproveId = base.UserInfo.Id;
model.ApproveTime = DateTime.Now;
model.CustomerState = CustomerStateEnum.Normal;
if (string.IsNullOrEmpty(model.CustomerName)) if (string.IsNullOrEmpty(model.CustomerName))
{ {
return ApiResult.ParamIsNull(message: "请填写客户名称!"); return ApiResult.ParamIsNull(message: "请填写客户名称!");
...@@ -133,6 +143,18 @@ namespace Edu.WebApi.Controllers.Customer ...@@ -133,6 +143,18 @@ namespace Edu.WebApi.Controllers.Customer
return ApiResult.Failed("手机号码、QQ号码、微信号码至少填写一项!"); return ApiResult.Failed("手机号码、QQ号码、微信号码至少填写一项!");
} }
if (!string.IsNullOrEmpty(model.ContactNumber) && customerModule.CheckCustomerModule(model,1))
{
return ApiResult.Failed("此联系人手机号码已注册!");
}
if (!string.IsNullOrEmpty(model.QQ) && customerModule.CheckCustomerModule(model, 2))
{
return ApiResult.Failed("此联系人QQ号码已注册!");
}
if (!string.IsNullOrEmpty(model.WeChatNo) && customerModule.CheckCustomerModule(model, 3))
{
return ApiResult.Failed("此联系人微信号已注册!");
}
var categoryModel = new RB_Customer_Category_Extend() var categoryModel = new RB_Customer_Category_Extend()
{ {
CategoryId = 0, CategoryId = 0,
...@@ -152,16 +174,7 @@ namespace Edu.WebApi.Controllers.Customer ...@@ -152,16 +174,7 @@ namespace Edu.WebApi.Controllers.Customer
model.CategoryId = categoryModel.CategoryId; model.CategoryId = categoryModel.CategoryId;
} }
model.Status = Common.Enum.DateStateEnum.Normal;
model.CreateBy = base.UserInfo.Id;
model.CreateTime = DateTime.Now;
model.UpdateTime = DateTime.Now;
model.Group_Id = base.UserInfo.Group_Id;
model.School_Id = base.UserInfo.School_Id;
model.ApproveState = 1;
model.ApproveId = base.UserInfo.Id;
model.ApproveTime = DateTime.Now;
model.CustomerState = CustomerStateEnum.Normal;
var flag = customerModule.SetCustomerModule(model); var flag = customerModule.SetCustomerModule(model);
return flag ? ApiResult.Success() : ApiResult.Failed(); return flag ? ApiResult.Success() : ApiResult.Failed();
} }
...@@ -928,6 +941,7 @@ namespace Edu.WebApi.Controllers.Customer ...@@ -928,6 +941,7 @@ namespace Edu.WebApi.Controllers.Customer
{ {
item.CategoryId, item.CategoryId,
item.CategoryName, item.CategoryName,
item.CreateBy,
CreateByName=item.CreateByName, CreateByName=item.CreateByName,
item.CatetoryType, item.CatetoryType,
item.LinkManCount, item.LinkManCount,
...@@ -1053,7 +1067,7 @@ namespace Edu.WebApi.Controllers.Customer ...@@ -1053,7 +1067,7 @@ namespace Edu.WebApi.Controllers.Customer
var extModel = new RB_Customer_Category_Extend() var extModel = new RB_Customer_Category_Extend()
{ {
CategoryId= CategoryId, CategoryId= CategoryId,
CategoryName = base.ParmJObj.GetStringValue("CategoryName"), CategoryName = base.ParmJObj.GetStringValue("CategoryName").Trim(),
CatetoryType = (CatetoryTypeEnum)base.ParmJObj.GetInt("CatetoryType"), CatetoryType = (CatetoryTypeEnum)base.ParmJObj.GetInt("CatetoryType"),
}; };
var linkMan = base.ParmJObj.GetStringValue("linkMan"); var linkMan = base.ParmJObj.GetStringValue("linkMan");
......
...@@ -171,7 +171,7 @@ namespace Edu.WebApi.Controllers.User ...@@ -171,7 +171,7 @@ namespace Edu.WebApi.Controllers.User
public ApiResult GetDictvalue() public ApiResult GetDictvalue()
{ {
string Key = base.ParmJObj.GetStringValue("Key"); string Key = base.ParmJObj.GetStringValue("Key");
var model= attendancemodule.GetDictValueList(base.UserInfo.Group_Id, Key)?.FirstOrDefault(); var model = attendancemodule.GetDictValueList(base.UserInfo.Group_Id, Key)?.FirstOrDefault();
return ApiResult.Success(data: model); return ApiResult.Success(data: model);
} }
...@@ -523,7 +523,7 @@ namespace Edu.WebApi.Controllers.User ...@@ -523,7 +523,7 @@ namespace Edu.WebApi.Controllers.User
path = $"/administration/document"; path = $"/administration/document";
} }
path = HttpUtility.UrlEncode(path); path = HttpUtility.UrlEncode(path);
string markdownContent = $"<font color='{(ReviewStatus == 2 ? "warning" : "info")}'>`审批{(ReviewStatus == 1 ? "通过" : "驳回")}`</font> 公告审批结果\n\n>**概要信息** \n>公告标题:{noticeModel.Title}\n>审 核 人:{userInfo.AccountName}\n>审核时间:<font color='comment'>{Common.ConvertHelper.FormatTimeStr2(DateTime.Now)}</font>\n>\n>请 点 击:[查看详情]({Config.ErpUrl}/autologin?loginId={noticeModel.CreateBy}&target={path}#target=out)"; string markdownContent = $"<font color='{(ReviewStatus == 2 ? "warning" : "info")}'>`审批{(ReviewStatus == 1 ? "通过" : "驳回")}`</font> 公告审批结果\n\n>**概要信息** \n>公告标题:{noticeModel.Title}\n>审 核 人:{userInfo.AccountName}\n>审核时间:<font color='comment'>{Common.ConvertHelper.FormatTimeStr2(DateTime.Now)}</font>\n>\n>请 点 击:[查看详情]({Config.ErpUrl}/autologin?loginId={noticeModel.CreateBy}&target={path}#target=out)";
Common.Message.PushMessageModel modelWork = new Common.Message.PushMessageModel() Common.Message.PushMessageModel modelWork = new Common.Message.PushMessageModel()
{ {
...@@ -2587,14 +2587,14 @@ namespace Edu.WebApi.Controllers.User ...@@ -2587,14 +2587,14 @@ namespace Edu.WebApi.Controllers.User
{ {
endTime = Common.ConvertHelper.FormatDate(DateTime.Now); endTime = Common.ConvertHelper.FormatDate(DateTime.Now);
} }
string empIds= base.ParmJObj.GetStringValue("empList"); string empIds = base.ParmJObj.GetStringValue("empList");
List<int> empList = new List<int>(); List<int> empList = new List<int>();
if (!string.IsNullOrEmpty(empIds)) if (!string.IsNullOrEmpty(empIds))
{ {
empList = JsonHelper.DeserializeObject<List<int>>(empIds); empList = JsonHelper.DeserializeObject<List<int>>(empIds);
} }
string qEmpIds = ""; string qEmpIds = "";
if (empList != null&&empList.Count>0) if (empList != null && empList.Count > 0)
{ {
qEmpIds = string.Join(",", empList); qEmpIds = string.Join(",", empList);
} }
...@@ -2634,6 +2634,130 @@ namespace Edu.WebApi.Controllers.User ...@@ -2634,6 +2634,130 @@ namespace Edu.WebApi.Controllers.User
var obj = marketConsultantModule.ConsultantStaticModule(qEmpIds, startTime, endTime); var obj = marketConsultantModule.ConsultantStaticModule(qEmpIds, startTime, endTime);
return ApiResult.Success(data: obj); return ApiResult.Success(data: obj);
} }
/// <summary>
/// 下载课程顾问部数据统计
/// </summary>
/// <returns></returns>
[HttpPost]
[Obsolete]
public FileContentResult DownLoadConsultantStatic()
{
List<ExcelDataSource> slist = new List<ExcelDataSource>();
string startTime = base.ParmJObj.GetStringValue("startTime");
if (string.IsNullOrEmpty(startTime))
{
startTime = "2022-01-01";
}
string endTime = base.ParmJObj.GetStringValue("endTime");
if (string.IsNullOrEmpty(endTime))
{
endTime = Common.ConvertHelper.FormatDate(DateTime.Now);
}
string empIds = base.ParmJObj.GetStringValue("empList");
List<int> empList = new List<int>();
if (!string.IsNullOrEmpty(empIds))
{
empList = JsonHelper.DeserializeObject<List<int>>(empIds);
}
string qEmpIds = "";
if (empList != null && empList.Count > 0)
{
qEmpIds = string.Join(",", empList);
}
var list = marketConsultantModule.DownLoadConsultantStaticModule(qEmpIds, startTime, endTime);
string excelName = "课程顾问部数据统计.xls";
ExcelDataSource header = new ExcelDataSource() { ExcelRows = new List<ExcelColumn>() };
ExcelDataSource subHeader = new ExcelDataSource() { ExcelRows = new List<ExcelColumn>() };
header.ExcelRows.Add(new ExcelColumn("员工") { Rowspan = 2, CellWidth = 15 });
subHeader.ExcelRows.Add(new ExcelColumn());
header.ExcelRows.Add(new ExcelColumn("名单") { CellWidth = 15,Colspan=2 });
subHeader.ExcelRows.Add(new ExcelColumn("本周"));
subHeader.ExcelRows.Add(new ExcelColumn("本月"));
header.ExcelRows.Add(new ExcelColumn("试听") { CellWidth = 15, Colspan = 2 });
subHeader.ExcelRows.Add(new ExcelColumn("本周"));
subHeader.ExcelRows.Add(new ExcelColumn("本月"));
header.ExcelRows.Add(new ExcelColumn("到访") { CellWidth = 15, Colspan = 2 });
subHeader.ExcelRows.Add(new ExcelColumn("本周"));
subHeader.ExcelRows.Add(new ExcelColumn("本月"));
header.ExcelRows.Add(new ExcelColumn("转化率") { CellWidth = 15, Colspan = 2 });
subHeader.ExcelRows.Add(new ExcelColumn("本周"));
subHeader.ExcelRows.Add(new ExcelColumn("本月"));
header.ExcelRows.Add(new ExcelColumn("有效回访总量") { CellWidth = 15, Colspan = 2 });
subHeader.ExcelRows.Add(new ExcelColumn("本周"));
subHeader.ExcelRows.Add(new ExcelColumn("本月"));
header.ExcelRows.Add(new ExcelColumn("单资源回访平均数") { CellWidth = 15, Colspan = 2 });
subHeader.ExcelRows.Add(new ExcelColumn("本周"));
subHeader.ExcelRows.Add(new ExcelColumn("本月"));
header.ExcelRows.Add(new ExcelColumn("签单") { CellWidth = 15, Colspan = 2 });
subHeader.ExcelRows.Add(new ExcelColumn("本周"));
subHeader.ExcelRows.Add(new ExcelColumn("本月"));
header.ExcelRows.Add(new ExcelColumn("签单金额") { CellWidth = 15, Colspan = 2 });
subHeader.ExcelRows.Add(new ExcelColumn("本周"));
subHeader.ExcelRows.Add(new ExcelColumn("本月"));
slist.Add(header);
slist.Add(subHeader);
try
{
if (list != null)
{
foreach (var item in list)
{
var excelRows = new List<ExcelColumn>();
excelRows.Add(new ExcelColumn(UserReidsCache.GetUserLoginInfo(item.CreateBy)?.AccountName));
string curWeekStu = string.Join(",", item?.CurWeekStuList?.Select(qitem => qitem.StuName));
string curMonthStu = string.Join(",", item?.CurMonthStuList?.Select(qitem => qitem.StuName));
excelRows.Add(new ExcelColumn(curWeekStu));
excelRows.Add(new ExcelColumn(curWeekStu));
excelRows.Add(new ExcelColumn(item.CurWeekTrialLesson.ToString()));
excelRows.Add(new ExcelColumn(item.CurMonthTrialLesson.ToString()));
excelRows.Add(new ExcelColumn(item.CurWeekVisit.ToString()));
excelRows.Add(new ExcelColumn(item.CurMonthVisit.ToString()));
excelRows.Add(new ExcelColumn(item.CurWeekRates.ToString()));
excelRows.Add(new ExcelColumn(item.CurMonthRates.ToString()));
excelRows.Add(new ExcelColumn(item.CurWeekFollow.ToString()));
excelRows.Add(new ExcelColumn(item.CurMonthFollow.ToString()));
excelRows.Add(new ExcelColumn(item.CurWeekAgFollow.ToString()));
excelRows.Add(new ExcelColumn(item.CurMonthAgFollow.ToString()));
excelRows.Add(new ExcelColumn(item.CurWeekOrderNum.ToString()));
excelRows.Add(new ExcelColumn(item.CurMonthOrderNum.ToString()));
excelRows.Add(new ExcelColumn(item.CurWeekOrderSale.ToString()));
excelRows.Add(new ExcelColumn(item.CurMonthOrderSale.ToString()));
var dataRow = new ExcelDataSource()
{
ExcelRows = excelRows,
};
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);
}
}
#endregion #endregion
#region 课程顾问部目标 #region 课程顾问部目标
...@@ -2648,12 +2772,12 @@ namespace Edu.WebApi.Controllers.User ...@@ -2648,12 +2772,12 @@ namespace Edu.WebApi.Controllers.User
var pageModel = Common.Plugin.JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString()); var pageModel = Common.Plugin.JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString());
var query = new RB_Consultant_Goal_Extend() var query = new RB_Consultant_Goal_Extend()
{ {
YearStr=base.ParmJObj.GetInt("YearStr"), YearStr = base.ParmJObj.GetInt("YearStr"),
MonthStr=base.ParmJObj.GetInt("MonthStr"), MonthStr = base.ParmJObj.GetInt("MonthStr"),
}; };
query.Group_Id = base.UserInfo.Group_Id; query.Group_Id = base.UserInfo.Group_Id;
List<object> list = new List<object>(); List<object> list = new List<object>();
var data= marketConsultantModule.GetConsultantGoalPageModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query); var data = marketConsultantModule.GetConsultantGoalPageModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query);
if (data != null && data.Count > 0) if (data != null && data.Count > 0)
{ {
foreach (var item in data) foreach (var item in data)
...@@ -2688,11 +2812,11 @@ namespace Edu.WebApi.Controllers.User ...@@ -2688,11 +2812,11 @@ namespace Edu.WebApi.Controllers.User
{ {
var model = new RB_Consultant_Goal_Extend() var model = new RB_Consultant_Goal_Extend()
{ {
Id=base.ParmJObj.GetInt("Id"), Id = base.ParmJObj.GetInt("Id"),
YearStr=base.ParmJObj.GetInt("YearStr"), YearStr = base.ParmJObj.GetInt("YearStr"),
MonthStr=base.ParmJObj.GetInt("MonthStr"), MonthStr = base.ParmJObj.GetInt("MonthStr"),
GoalMoney=base.ParmJObj.GetDecimal("GoalMoney"), GoalMoney = base.ParmJObj.GetDecimal("GoalMoney"),
Dept_Id=base.ParmJObj.GetInt("Dept_Id"), Dept_Id = base.ParmJObj.GetInt("Dept_Id"),
}; };
model.CreateBy = base.UserInfo.Id; model.CreateBy = base.UserInfo.Id;
model.CreateTime = DateTime.Now; model.CreateTime = DateTime.Now;
...@@ -2742,11 +2866,11 @@ namespace Edu.WebApi.Controllers.User ...@@ -2742,11 +2866,11 @@ namespace Edu.WebApi.Controllers.User
list.Add(model); list.Add(model);
} }
} }
} }
} }
} }
bool flag = marketConsultantModule.AddConsultantGoalModule(list); bool flag = marketConsultantModule.AddConsultantGoalModule(list);
return flag ? ApiResult.Success() : ApiResult.Failed(); return flag ? ApiResult.Success() : ApiResult.Failed();
} }
...@@ -2852,7 +2976,7 @@ namespace Edu.WebApi.Controllers.User ...@@ -2852,7 +2976,7 @@ namespace Edu.WebApi.Controllers.User
try try
{ {
JObject headerObj = JObject.Parse(Common.Plugin.JsonHelper.Serialize(list[0])); JObject headerObj = JObject.Parse(Common.Plugin.JsonHelper.Serialize(list[0]));
var headerArray = JsonHelper.DeserializeObject<List< MarketChannelStaticModel >>(headerObj.GetStringValue("subList")); var headerArray = JsonHelper.DeserializeObject<List<MarketChannelStaticModel>>(headerObj.GetStringValue("subList"));
ExcelDataSource header = new ExcelDataSource() { ExcelRows = new List<ExcelColumn>() }; ExcelDataSource header = new ExcelDataSource() { ExcelRows = new List<ExcelColumn>() };
var subHeader = new ExcelDataSource() { ExcelRows = new List<ExcelColumn>() }; var subHeader = new ExcelDataSource() { ExcelRows = new List<ExcelColumn>() };
header.ExcelRows.Add(new ExcelColumn("员工") { Rowspan = 2, CellWidth = 20 }); header.ExcelRows.Add(new ExcelColumn("员工") { Rowspan = 2, CellWidth = 20 });
...@@ -2862,7 +2986,7 @@ namespace Edu.WebApi.Controllers.User ...@@ -2862,7 +2986,7 @@ namespace Edu.WebApi.Controllers.User
{ {
foreach (var item in headerArray) foreach (var item in headerArray)
{ {
header.ExcelRows.Add(new ExcelColumn(item.ChannelName) {Colspan=3 }); header.ExcelRows.Add(new ExcelColumn(item.ChannelName) { Colspan = 3 });
subHeader.ExcelRows.Add(new ExcelColumn("回单") { CellWidth = 10 }); subHeader.ExcelRows.Add(new ExcelColumn("回单") { CellWidth = 10 });
subHeader.ExcelRows.Add(new ExcelColumn("到访") { CellWidth = 10 }); subHeader.ExcelRows.Add(new ExcelColumn("到访") { CellWidth = 10 });
subHeader.ExcelRows.Add(new ExcelColumn("转化率") { CellWidth = 10 }); subHeader.ExcelRows.Add(new ExcelColumn("转化率") { CellWidth = 10 });
...@@ -2875,8 +2999,8 @@ namespace Edu.WebApi.Controllers.User ...@@ -2875,8 +2999,8 @@ namespace Edu.WebApi.Controllers.User
{ {
var excelRows = new List<ExcelColumn>(); var excelRows = new List<ExcelColumn>();
var dataObj = JObject.Parse(Common.Plugin.JsonHelper.Serialize(item)); var dataObj = JObject.Parse(Common.Plugin.JsonHelper.Serialize(item));
var dataArray= JsonHelper.DeserializeObject<List<MarketChannelStaticModel>>(dataObj.GetStringValue("subList")); var dataArray = JsonHelper.DeserializeObject<List<MarketChannelStaticModel>>(dataObj.GetStringValue("subList"));
excelRows.Add(new ExcelColumn(dataObj.GetStringValue("EmployeeName"))); excelRows.Add(new ExcelColumn(dataObj.GetStringValue("EmployeeName")));
if (dataArray != null && dataArray.Count > 0) if (dataArray != null && dataArray.Count > 0)
{ {
...@@ -2889,7 +3013,7 @@ namespace Edu.WebApi.Controllers.User ...@@ -2889,7 +3013,7 @@ namespace Edu.WebApi.Controllers.User
} }
excelRows.Add(new ExcelColumn(subItem.ClueCount.ToString())); excelRows.Add(new ExcelColumn(subItem.ClueCount.ToString()));
excelRows.Add(new ExcelColumn(subItem.VisitCount.ToString())); excelRows.Add(new ExcelColumn(subItem.VisitCount.ToString()));
excelRows.Add(new ExcelColumn(rate.ToString()+"%")); excelRows.Add(new ExcelColumn(rate.ToString() + "%"));
} }
} }
var dataRow = new ExcelDataSource() var dataRow = new ExcelDataSource()
...@@ -2934,7 +3058,7 @@ namespace Edu.WebApi.Controllers.User ...@@ -2934,7 +3058,7 @@ namespace Edu.WebApi.Controllers.User
{ {
empList = JsonHelper.DeserializeObject<List<int>>(empIds); empList = JsonHelper.DeserializeObject<List<int>>(empIds);
} }
var data = marketConsultantModule.MarketCreateTypeStaticModule(empList, startTime, endTime); var data = marketConsultantModule.MarketCreateTypeStaticModule(empList, startTime, endTime);
return ApiResult.Success(data: data); return ApiResult.Success(data: data);
} }
...@@ -2982,7 +3106,7 @@ namespace Edu.WebApi.Controllers.User ...@@ -2982,7 +3106,7 @@ namespace Edu.WebApi.Controllers.User
try try
{ {
JObject dataObj = JObject.Parse(JsonHelper.Serialize(data)); JObject dataObj = JObject.Parse(JsonHelper.Serialize(data));
List<MarketChannelStaticModel> list = new List<MarketChannelStaticModel>(); List<MarketChannelStaticModel> list = new List<MarketChannelStaticModel>();
//同行渠道 //同行渠道
if (queryType == 1) if (queryType == 1)
...@@ -3030,7 +3154,7 @@ namespace Edu.WebApi.Controllers.User ...@@ -3030,7 +3154,7 @@ namespace Edu.WebApi.Controllers.User
orderRate = Math.Round(Convert.ToDecimal(item.OrderCount) / Convert.ToDecimal(item.VisitCount) * Convert.ToDecimal(100), 2); orderRate = Math.Round(Convert.ToDecimal(item.OrderCount) / Convert.ToDecimal(item.VisitCount) * Convert.ToDecimal(100), 2);
} }
excelRows.Add(new ExcelColumn(rate.ToString()+"%")); excelRows.Add(new ExcelColumn(rate.ToString() + "%"));
excelRows.Add(new ExcelColumn(orderRate.ToString() + "%")); excelRows.Add(new ExcelColumn(orderRate.ToString() + "%"));
var dataRow = new ExcelDataSource() var dataRow = new ExcelDataSource()
...@@ -3080,7 +3204,7 @@ namespace Edu.WebApi.Controllers.User ...@@ -3080,7 +3204,7 @@ namespace Edu.WebApi.Controllers.User
{ {
qEmpIds = string.Join(",", empList); qEmpIds = string.Join(",", empList);
} }
var data = marketConsultantModule.MarketChannelStaticModule(empList,startTime, endTime); var data = marketConsultantModule.MarketChannelStaticModule(empList, 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