Commit e4d8afbd authored by 黄奎's avatar 黄奎

页面修改

parent d53d0f91
...@@ -316,7 +316,6 @@ namespace Edu.Education.Helper ...@@ -316,7 +316,6 @@ namespace Edu.Education.Helper
/// <returns></returns> /// <returns></returns>
public async Task EduCreateScrollClassTimer() public async Task EduCreateScrollClassTimer()
{ {
string cronExpression = "0 10 0 1 * ?"; //每月1号凌晨10分
NameValueCollection props = new NameValueCollection NameValueCollection props = new NameValueCollection
{ {
{ "quartz.serializer.type", "binary" } { "quartz.serializer.type", "binary" }
......
...@@ -58,7 +58,7 @@ namespace Edu.Model.Entity.Customer ...@@ -58,7 +58,7 @@ namespace Edu.Model.Entity.Customer
public string Image { get; set; } public string Image { get; set; }
/// <summary> /// <summary>
/// 客户来源 /// 同行客户来源(1-企业,2-学校)
/// </summary> /// </summary>
public int CustomerSourceType { get; set; } public int CustomerSourceType { get; set; }
......
...@@ -223,6 +223,11 @@ namespace Edu.Model.ViewModel.User ...@@ -223,6 +223,11 @@ namespace Edu.Model.ViewModel.User
/// </summary> /// </summary>
public string CustomerName { get; set; } public string CustomerName { get; set; }
/// <summary>
/// 同行客户来源(1-企业,2-学校)
/// </summary>
public int CustomerSourceType { get; set; }
/// <summary> /// <summary>
/// 来源人名称 /// 来源人名称
/// </summary> /// </summary>
......
...@@ -1003,7 +1003,10 @@ namespace Edu.Module.Customer ...@@ -1003,7 +1003,10 @@ namespace Edu.Module.Customer
EndTime = EndTime EndTime = EndTime
}); });
var enumList = Common.Plugin.EnumHelper.EnumToList(typeof(StuCreateTypeEnum)); var enumList = Common.Plugin.EnumHelper.EnumToList(typeof(StuCreateTypeEnum));
//企业同行
List<object> customerDataList = new List<object>(); List<object> customerDataList = new List<object>();
//校代同行
List<object> schoolDataList = new List<object>();
List<object> innerDataList = new List<object>(); List<object> innerDataList = new List<object>();
List<object> transDataList = new List<object>(); List<object> transDataList = new List<object>();
foreach (var item in enumList) foreach (var item in enumList)
...@@ -1071,10 +1074,10 @@ namespace Edu.Module.Customer ...@@ -1071,10 +1074,10 @@ namespace Edu.Module.Customer
{ {
stuList = studentRepository.GetStudentListRepository(new RB_Student_ViewModel() { StuIds= stuIds }); stuList = studentRepository.GetStudentListRepository(new RB_Student_ViewModel() { StuIds= stuIds });
} }
var groupDataList = dataList?.Where(qitem => qitem.CreateType == StuCreateTypeEnum.InternalIntroduction) var sourceTypeList = dataList?.Where(qitem => qitem.CreateType == StuCreateTypeEnum.InternalIntroduction)
?.GroupBy(qitem => new { qitem.StuSourceId }) ?.GroupBy(qitem => new { qitem.StuSourceId })
?.Select(qitem => new { qitem.Key.StuSourceId }); ?.Select(qitem => new { qitem.Key.StuSourceId });
foreach (var sItem in groupDataList) foreach (var sItem in sourceTypeList)
{ {
var tempCusList = dataList?.Where(qitem => qitem.CreateType == StuCreateTypeEnum.InternalIntroduction && qitem.StuSourceId == sItem.StuSourceId)?.ToList(); var tempCusList = dataList?.Where(qitem => qitem.CreateType == StuCreateTypeEnum.InternalIntroduction && qitem.StuSourceId == sItem.StuSourceId)?.ToList();
transDataList.Add(new transDataList.Add(new
...@@ -1089,14 +1092,30 @@ namespace Edu.Module.Customer ...@@ -1089,14 +1092,30 @@ namespace Edu.Module.Customer
} }
} }
} }
return new
return new { {
customerDataList, customerDataList,
innerDataList, innerDataList,
transDataList, transDataList,
}; };
} }
/// <summary>
/// 渠道统计汇总
/// </summary>
/// <param name="StartTime"></param>
/// <param name="EndTime"></param>
/// <returns></returns>
public object MarketChannelStaticModule(string StartTime, string EndTime)
{
var dataList = studentRepository.GetStudentChannelStaticRepository(new RB_Student_ViewModel()
{
StartTime = StartTime,
EndTime = EndTime
});
return null;
}
#endregion #endregion
} }
} }
\ No newline at end of file
...@@ -941,11 +941,12 @@ WHERE 1=1 ...@@ -941,11 +941,12 @@ WHERE 1=1
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
builder.AppendFormat(@" builder.AppendFormat(@"
SELECT A.StuId,A.CreateBy,A.StuChannel,A.CreateType,IFNULL(B.VisitCount,0) AS VisitCount,IFNULL(C.CourseOrderCount,0) AS OrderCount,IFNULL(c.Income,0) AS OrderInCome SELECT A.StuId,A.CreateBy,A.StuChannel,A.CreateType,IFNULL(B.VisitCount,0) AS VisitCount,IFNULL(C.CourseOrderCount,0) AS OrderCount,IFNULL(c.Income,0) AS OrderInCome
,A.CustomerId,A.StuSourceId ,A.CustomerId,A.StuSourceId,IFNULL(D.CustomerSourceType,0) AS CustomerSourceType
FROM RB_Student AS A FROM RB_Student AS A
LEFT JOIN(SELECT StuId,Count(1) AS VisitCount FROM rb_student_visit WHERE Status=0 GROUP BY StuId) AS B ON A.StuId=B.StuId LEFT JOIN(SELECT StuId,Count(1) AS VisitCount FROM rb_student_visit WHERE Status=0 GROUP BY StuId) AS B ON A.StuId=B.StuId
LEFT JOIN(SELECT og.Student_Id,COUNT(1) AS CourseOrderCount,SUM(o.Income) AS Income FROM rb_student_orderguest AS og INNER JOIN rb_order AS o ON og.OrderId=o.OrderId WHERE O.OrderState NOT IN(3,4) GROUP BY og.Student_Id ) AS C ON A.StuId=C.Student_Id LEFT JOIN(SELECT og.Student_Id,COUNT(1) AS CourseOrderCount,SUM(o.Income) AS Income FROM rb_student_orderguest AS og INNER JOIN rb_order AS o ON og.OrderId=o.OrderId WHERE O.OrderState NOT IN(3,4) GROUP BY og.Student_Id ) AS C ON A.StuId=C.Student_Id
WHERE A.Status=0 LEFT JOIN rb_customer AS D ON A.StuSourceId=D.CustomerId AND A.CreateType=2
WHERE A.Status=0
"); ");
if (query != null) if (query != null)
{ {
......
...@@ -2827,6 +2827,38 @@ namespace Edu.WebApi.Controllers.User ...@@ -2827,6 +2827,38 @@ namespace Edu.WebApi.Controllers.User
return ApiResult.Success(data: data); return ApiResult.Success(data: data);
} }
/// <summary>
/// 市场渠道统计汇总
/// </summary>
/// <returns></returns>
[HttpPost]
[AllowRepeatAttribute]
public ApiResult MarketChannelStatic1()
{
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 data = marketConsultantModule.MarketChannelStaticModule(startTime, endTime);
return ApiResult.Success(data: data);
}
#endregion #endregion
} }
} }
\ No newline at end of file
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