Commit c01fe8c6 authored by 黄奎's avatar 黄奎

页面修改

parent c4dab0dc
...@@ -347,7 +347,7 @@ namespace Edu.Model.Entity.Sell ...@@ -347,7 +347,7 @@ namespace Edu.Model.Entity.Sell
public int IsBackClass { get; set; } public int IsBackClass { get; set; }
/// <summary> /// <summary>
/// 同业ID /// 同业联系人编号ID
/// </summary> /// </summary>
public int CustomerId { get; set; } public int CustomerId { get; set; }
......
...@@ -118,7 +118,7 @@ namespace Edu.Model.Entity.User ...@@ -118,7 +118,7 @@ namespace Edu.Model.Entity.User
public GuestBasicsEnum JapanBaseInfo { get; set; } public GuestBasicsEnum JapanBaseInfo { get; set; }
/// <summary> /// <summary>
/// 同业客户编号 /// 同业联系人编号
/// </summary> /// </summary>
public int CustomerId { get; set; } public int CustomerId { get; set; }
......
...@@ -335,5 +335,10 @@ namespace Edu.Model.ViewModel.Sell ...@@ -335,5 +335,10 @@ namespace Edu.Model.ViewModel.Sell
/// </summary> /// </summary>
public string StuSourceIdName { get; set; } public string StuSourceIdName { get; set; }
/// <summary>
/// 同业编号
/// </summary>
public int CategoryId { get; set; }
} }
} }
\ No newline at end of file
...@@ -375,5 +375,10 @@ namespace Edu.Model.ViewModel.User ...@@ -375,5 +375,10 @@ namespace Edu.Model.ViewModel.User
/// 订单编号 /// 订单编号
/// </summary> /// </summary>
public int OrderId { get; set; } public int OrderId { get; set; }
/// <summary>
/// 同业编号
/// </summary>
public int CategoryId { get; set; }
} }
} }
\ No newline at end of file
...@@ -268,9 +268,9 @@ namespace Edu.Module.Course ...@@ -268,9 +268,9 @@ namespace Edu.Module.Course
/// <param name="commissionType"></param> /// <param name="commissionType"></param>
/// <param name="userInfo"></param> /// <param name="userInfo"></param>
/// <returns></returns> /// <returns></returns>
public object GetCustomerCommissionStat(int orderSourceType, int orderSourceId, int commissionType, UserInfo userInfo) public object GetCustomerCommissionStat(int orderSourceType, int orderSourceId,int CategoryId, int commissionType, UserInfo userInfo)
{ {
var model = user_ReturnComissionRepository.GetCustomerCommissionStat(userInfo.Group_Id, orderSourceType, orderSourceId, commissionType); var model = user_ReturnComissionRepository.GetCustomerCommissionStat(userInfo.Group_Id, orderSourceType, orderSourceId, CategoryId, commissionType);
return new return new
{ {
model?.UnSettlementMoney, model?.UnSettlementMoney,
......
...@@ -378,10 +378,10 @@ namespace Edu.Module.Customer ...@@ -378,10 +378,10 @@ namespace Edu.Module.Customer
/// <param name="customerId"></param> /// <param name="customerId"></param>
/// <param name="group_Id"></param> /// <param name="group_Id"></param>
/// <returns></returns> /// <returns></returns>
public object GetCustomerStuStageStatistics(int customerId, int group_Id) public object GetCustomerStuStageStatistics(int customerId,int CategoryId, int group_Id)
{ {
List<object> RList = new List<object>(); List<object> RList = new List<object>();
var list = studentRepository.GetCustomerStuStageStatistics(customerId, group_Id); var list = studentRepository.GetCustomerStuStageStatistics(customerId, CategoryId, group_Id);
var elist = stageRepository.GetStageListRepostory(new Model.Entity.System.RB_Stage() var elist = stageRepository.GetStageListRepostory(new Model.Entity.System.RB_Stage()
{ {
Group_Id = group_Id Group_Id = group_Id
......
...@@ -1386,6 +1386,7 @@ namespace Edu.Module.Customer ...@@ -1386,6 +1386,7 @@ namespace Edu.Module.Customer
{ {
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,
ClueCount = tempCusList?.Count(), ClueCount = tempCusList?.Count(),
VisitCount = tempCusList?.Sum(qitem => qitem.VisitCount), VisitCount = tempCusList?.Sum(qitem => qitem.VisitCount),
OrderCount = tempCusList?.Sum(qitem => qitem.OrderCount), OrderCount = tempCusList?.Sum(qitem => qitem.OrderCount),
...@@ -1399,6 +1400,7 @@ namespace Edu.Module.Customer ...@@ -1399,6 +1400,7 @@ namespace Edu.Module.Customer
{ {
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,
ClueCount = tempCusList?.Count(), ClueCount = tempCusList?.Count(),
VisitCount = tempCusList?.Sum(qitem => qitem.VisitCount), VisitCount = tempCusList?.Sum(qitem => qitem.VisitCount),
OrderCount = tempCusList?.Sum(qitem => qitem.OrderCount), OrderCount = tempCusList?.Sum(qitem => qitem.OrderCount),
......
...@@ -91,6 +91,10 @@ WHERE 1=1 ...@@ -91,6 +91,10 @@ WHERE 1=1
builder.AppendFormat(" AND B.{0} LIKE @CategoryName ", nameof(RB_Customer_Extend.CategoryName)); builder.AppendFormat(" AND B.{0} LIKE @CategoryName ", nameof(RB_Customer_Extend.CategoryName));
parameters.Add("CategoryName", "%" + query.CategoryName.Trim() + "%"); parameters.Add("CategoryName", "%" + query.CategoryName.Trim() + "%");
} }
if (query.CategoryId > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Customer_Extend.CategoryId), query.CategoryId);
}
} }
builder.AppendFormat(" ORDER BY A.{0} DESC ", nameof(RB_Customer_Extend.CustomerId)); builder.AppendFormat(" ORDER BY A.{0} DESC ", nameof(RB_Customer_Extend.CustomerId));
return GetPage<RB_Customer_Extend>(pageIndex, pageSize, out rowsCount, builder.ToString(), parameters).ToList(); return GetPage<RB_Customer_Extend>(pageIndex, pageSize, out rowsCount, builder.ToString(), parameters).ToList();
......
...@@ -271,6 +271,10 @@ ORDER BY {orderBy} ...@@ -271,6 +271,10 @@ ORDER BY {orderBy}
{ {
where += $@" and o.{nameof(RB_Order_ViewModel.CreateBy)} = {demodel.CreateBy}"; where += $@" and o.{nameof(RB_Order_ViewModel.CreateBy)} = {demodel.CreateBy}";
} }
if (demodel.CategoryId > 0)
{
where += $@" and cu.{nameof(RB_Order_ViewModel.CategoryId)} = {demodel.CategoryId}";
}
string orderBy = " o.OrderId asc"; string orderBy = " o.OrderId asc";
if (demodel.Q_OrderBy == 1) if (demodel.Q_OrderBy == 1)
{ {
...@@ -401,6 +405,10 @@ WHERE {where} ORDER BY {orderBy} ...@@ -401,6 +405,10 @@ WHERE {where} ORDER BY {orderBy}
{ {
where += $@" and course.{nameof(RB_Order_ViewModel.CourseSubject)} = {(int)demodel.CourseSubject}"; where += $@" and course.{nameof(RB_Order_ViewModel.CourseSubject)} = {(int)demodel.CourseSubject}";
} }
if (demodel.CategoryId > 0)
{
where += $@" and cus.{nameof(RB_Order_ViewModel.CategoryId)} = {demodel.CategoryId}";
}
string sql = $@" string sql = $@"
SELECT SUM(CASE WHEN o.OrderState <> 3 THEN o.PreferPrice ELSE 0 END) AS PreferPrice, SELECT SUM(CASE WHEN o.OrderState <> 3 THEN o.PreferPrice ELSE 0 END) AS PreferPrice,
SUM(CASE WHEN o.OrderState <> 3 THEN o.Income ELSE 0 END) AS Income, SUM(CASE WHEN o.OrderState <> 3 THEN o.Income ELSE 0 END) AS Income,
...@@ -411,10 +419,9 @@ SELECT SUM(CASE WHEN o.OrderState <> 3 THEN o.PreferPrice ELSE 0 END) AS PreferP ...@@ -411,10 +419,9 @@ SELECT SUM(CASE WHEN o.OrderState <> 3 THEN o.PreferPrice ELSE 0 END) AS PreferP
CASE WHEN o.CommissionMoney <> -1 AND o.OrderState <> 3 THEN o.CommissionMoney ELSE 0 END END) AS CommissionMoney, CASE WHEN o.CommissionMoney <> -1 AND o.OrderState <> 3 THEN o.CommissionMoney ELSE 0 END END) AS CommissionMoney,
SUM(CASE WHEN o.OrderState <> 3 THEN o.ExtraRewardMoney - o.ExtraDeductMoney ELSE 0 END) AS ExtraRewardMoney SUM(CASE WHEN o.OrderState <> 3 THEN o.ExtraRewardMoney - o.ExtraDeductMoney ELSE 0 END) AS ExtraRewardMoney
FROM RB_Order o LEFT JOIN rb_class c on o.ClassId = c.ClassId FROM RB_Order o LEFT JOIN rb_class c on o.ClassId = c.ClassId
LEFT JOIN rb_course AS course ON (o.CourseId=course.CourseId AND o.CourseId>0 AND o.OrderType=1) LEFT JOIN rb_course AS course ON (o.CourseId=course.CourseId AND o.CourseId>0 AND o.OrderType=1)
LEFT JOIN ( LEFT JOIN (SELECT em.OrderId,SUM(em.GiveOutMoney) as GiveOutMoney FROM rb_sell_achievements_emp em GROUP BY em.OrderId) ea on ea.OrderId = o.OrderId
SELECT em.OrderId,SUM(em.GiveOutMoney) as GiveOutMoney FROM rb_sell_achievements_emp em GROUP BY em.OrderId LEFT JOIN rb_customer AS cus ON O.CustomerId=cus.CustomerId
) ea on ea.OrderId = o.OrderId
WHERE {where} WHERE {where}
"; ";
return Get<RB_Order_ViewModel>(sql).FirstOrDefault(); return Get<RB_Order_ViewModel>(sql).FirstOrDefault();
......
...@@ -396,6 +396,10 @@ WHERE 1=1 ...@@ -396,6 +396,10 @@ WHERE 1=1
builder.AppendFormat(" AND NOT Exists (SELECT StuId FROM rb_student_assist WHERE AssistType=2 AND `Status`=0 AND t.StuId=StuId) "); builder.AppendFormat(" AND NOT Exists (SELECT StuId FROM rb_student_assist WHERE AssistType=2 AND `Status`=0 AND t.StuId=StuId) ");
} }
} }
if (query.CategoryId > 0)
{
builder.AppendFormat(" AND C.{0}={1} ", nameof(RB_Student_ViewModel.CategoryId), query.CategoryId);
}
} }
builder.AppendFormat(" ORDER BY t.{0} DESC ", nameof(RB_Student_ViewModel.StuId)); builder.AppendFormat(" ORDER BY t.{0} DESC ", nameof(RB_Student_ViewModel.StuId));
return GetPage<RB_Student_ViewModel>(pageIndex, pageSize, out rowsCount, builder.ToString(), parameters).ToList(); return GetPage<RB_Student_ViewModel>(pageIndex, pageSize, out rowsCount, builder.ToString(), parameters).ToList();
...@@ -771,9 +775,22 @@ WHERE o.OrderState=1 and og.`Status`=0 and sog.`Status`=0 and og.GuestState <>2 ...@@ -771,9 +775,22 @@ WHERE o.OrderState=1 and og.`Status`=0 and sog.`Status`=0 and og.GuestState <>2
/// <param name="customerId"></param> /// <param name="customerId"></param>
/// <param name="group_Id"></param> /// <param name="group_Id"></param>
/// <returns></returns> /// <returns></returns>
public List<RB_Student_ViewModel> GetCustomerStuStageStatistics(int customerId, int group_Id) public List<RB_Student_ViewModel> GetCustomerStuStageStatistics(int customerId,int CategoryId, int group_Id)
{ {
string sql = $@"SELECT StuStage,COUNT(0) AS OrderCount FROM rb_student WHERE Group_Id ={group_Id} and CustomerId ={customerId} GROUP BY StuStage"; StringBuilder builder = new StringBuilder();
if (customerId > 0)
{
builder.AppendFormat(" AND A.StuSourceId = {0}", customerId);
}
if (CategoryId > 0)
{
builder.AppendFormat(" AND B.CategoryId = {0}", CategoryId);
}
string sql = $@"
SELECT A.StuStage,COUNT(0) AS OrderCount
FROM rb_student AS A INNER JOIN rb_customer AS B ON (A.CreateType=2 AND A.StuSourceId=B.CustomerId)
WHERE A.Group_Id ={group_Id} AND A.CreateType=2 {builder.ToString()}
GROUP BY A.StuStage ";
return Get<RB_Student_ViewModel>(sql).ToList(); return Get<RB_Student_ViewModel>(sql).ToList();
} }
......
...@@ -52,14 +52,36 @@ from RB_User_ReturnCommission where GroupId ={group_Id} and UserId={id} and User ...@@ -52,14 +52,36 @@ from RB_User_ReturnCommission where GroupId ={group_Id} and UserId={id} and User
/// <param name="orderSourceId"></param> /// <param name="orderSourceId"></param>
/// <param name="commissionType"></param> /// <param name="commissionType"></param>
/// <returns></returns> /// <returns></returns>
public RB_User_ReturnComission_ViewModel GetCustomerCommissionStat(int group_Id, int orderSourceType, int orderSourceId, int commissionType) public RB_User_ReturnComission_ViewModel GetCustomerCommissionStat(int group_Id, int orderSourceType, int orderSourceId,int CategoryId, int commissionType)
{ {
string sql = $@"select sum(UnSettlementMoney)as UnSettlementMoney, StringBuilder builder = new StringBuilder();
sum(SttlementMoney)as SttlementMoney, builder.AppendFormat(@"
sum(CashOutMoney)as CashOutMoney, SELECT sum(A.UnSettlementMoney)as UnSettlementMoney,sum(A.SttlementMoney) as SttlementMoney
sum(CanCashOutMoney)as CanCashOutMoney ,sum(A.CashOutMoney)as CashOutMoney,sum(A.CanCashOutMoney)as CanCashOutMoney
from RB_User_ReturnCommission where GroupId ={group_Id} and UserId={orderSourceId} and UserType ={orderSourceType} and CommissionType ={commissionType}"; FROM RB_User_ReturnCommission AS A INNER JOIN rb_customer AS B ON (A.UserType=2 AND A.UserId=B.CustomerId)
return Get<RB_User_ReturnComission_ViewModel>(sql).FirstOrDefault(); WHERE 1=1
");
if (group_Id > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_User_ReturnComission_ViewModel.GroupId), group_Id);
}
if (orderSourceType > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_User_ReturnComission_ViewModel.UserType), orderSourceType);
}
if (commissionType > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_User_ReturnComission_ViewModel.CommissionType), commissionType);
}
if (orderSourceId > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_User_ReturnComission_ViewModel.UserId), orderSourceId);
}
if (CategoryId > 0)
{
builder.AppendFormat(" AND B.CategoryId={0} ", CategoryId);
}
return Get<RB_User_ReturnComission_ViewModel>(builder.ToString()).FirstOrDefault();
} }
/// <summary> /// <summary>
......
...@@ -1548,7 +1548,8 @@ namespace Edu.WebApi.Controllers.Course ...@@ -1548,7 +1548,8 @@ namespace Edu.WebApi.Controllers.Course
HelpEnterId = base.ParmJObj.GetInt("HelpEnterId", 0), HelpEnterId = base.ParmJObj.GetInt("HelpEnterId", 0),
ClassNo = base.ParmJObj.GetStringValue("ClassNo"), ClassNo = base.ParmJObj.GetStringValue("ClassNo"),
CourseSubject = base.ParmJObj.GetInt("CourseSubject"), CourseSubject = base.ParmJObj.GetInt("CourseSubject"),
CustomerId = base.ParmJObj.GetInt("CustomerId", 0) CustomerId = base.ParmJObj.GetInt("CustomerId", 0),
CategoryId=base.ParmJObj.GetInt("CategoryId"),
}; };
demodel.Group_Id = userInfo.Group_Id; demodel.Group_Id = userInfo.Group_Id;
......
...@@ -634,13 +634,14 @@ namespace Edu.WebApi.Controllers.Customer ...@@ -634,13 +634,14 @@ namespace Edu.WebApi.Controllers.Customer
public ApiResult GetCustomerStuStageStatistics() public ApiResult GetCustomerStuStageStatistics()
{ {
var userInfo = base.UserInfo; var userInfo = base.UserInfo;
int CustomerId = base.ParmJObj.GetInt("CustomerId", 0);//同业ID int CustomerId = base.ParmJObj.GetInt("CustomerId", 0);//同业联系人编号ID
if (CustomerId <= 0) int CategoryId = base.ParmJObj.GetInt("CategoryId", 0);//同业编号
if (CustomerId <= 0&& CategoryId<=0)
{ {
return ApiResult.ParamIsNull(); return ApiResult.ParamIsNull();
} }
var Robj = customerModule.GetCustomerStuStageStatistics(CustomerId, userInfo.Group_Id); var Robj = customerModule.GetCustomerStuStageStatistics(CustomerId, CategoryId, userInfo.Group_Id);
return ApiResult.Success("", Robj); return ApiResult.Success("", Robj);
} }
...@@ -972,7 +973,14 @@ namespace Edu.WebApi.Controllers.Customer ...@@ -972,7 +973,14 @@ namespace Edu.WebApi.Controllers.Customer
{ {
var CategoryId = base.ParmJObj.GetInt("CategoryId"); var CategoryId = base.ParmJObj.GetInt("CategoryId");
var extModel = customerModule.GetCustomerCategoryModule(CategoryId); var extModel = customerModule.GetCustomerCategoryModule(CategoryId);
return ApiResult.Success(data: extModel); var obj = new
{
extModel?.CategoryId,
extModel?.CategoryName,
extModel?.CatetoryType,
CatetoryTypeName=extModel?.CatetoryType.ToName()??"",
};
return ApiResult.Success(data: obj);
} }
/// <summary> /// <summary>
......
...@@ -268,13 +268,14 @@ namespace Edu.WebApi.Controllers.Course ...@@ -268,13 +268,14 @@ namespace Edu.WebApi.Controllers.Course
var userInfo = base.UserInfo; var userInfo = base.UserInfo;
JObject parms = JObject.Parse(base.RequestParm.Msg.ToString()); JObject parms = JObject.Parse(base.RequestParm.Msg.ToString());
int OrderSourceType = parms.GetInt("OrderSourceType", 1);//来源 int OrderSourceType = parms.GetInt("OrderSourceType", 1);//来源
int OrderSourceId = parms.GetInt("OrderSourceId", 0);//来源对应ID (内部 同行 学生) int OrderSourceId = parms.GetInt("OrderSourceId", 0);//来源对应ID (内部 同行联系人 学生)
int CategoryId = parms.GetInt("CategoryId",0);//同行编号
int CommissionType = parms.GetInt("CommissionType", 0);//类型 int CommissionType = parms.GetInt("CommissionType", 0);//类型
if (OrderSourceType <= 0 || OrderSourceId <= 0 || CommissionType <= 0) { if (OrderSourceType <= 0 || OrderSourceId <= 0 || CommissionType <= 0)
{
return ApiResult.ParamIsNull(); return ApiResult.ParamIsNull();
} }
var Robj = customerCommissionModule.GetCustomerCommissionStat(OrderSourceType, OrderSourceId, CategoryId, CommissionType, userInfo);
var Robj = customerCommissionModule.GetCustomerCommissionStat(OrderSourceType, OrderSourceId, CommissionType, userInfo);
return ApiResult.Success("", Robj); return ApiResult.Success("", Robj);
} }
......
...@@ -679,6 +679,7 @@ namespace Edu.WebApi.Controllers.User ...@@ -679,6 +679,7 @@ namespace Edu.WebApi.Controllers.User
WeChatNo = base.ParmJObj.GetStringValue("WeChatNo"), WeChatNo = base.ParmJObj.GetStringValue("WeChatNo"),
StuType = base.ParmJObj.GetInt("StuType"), StuType = base.ParmJObj.GetInt("StuType"),
ExistCourseConsultant=base.ParmJObj.GetInt("ExistCourseConsultant"), ExistCourseConsultant=base.ParmJObj.GetInt("ExistCourseConsultant"),
CategoryId=base.ParmJObj.GetInt("CategoryId"),
}; };
if (query.IsQueryMyStu == 1) if (query.IsQueryMyStu == 1)
{ {
......
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