Commit 96632ce4 authored by liudong1993's avatar liudong1993

1

parent 79ef765a
......@@ -269,6 +269,26 @@ namespace Edu.Model.ViewModel.Grade
/// 直客续费优惠比例
/// </summary>
public decimal B2CReNewRatio { get; set; }
/// <summary>
/// 一般同行首次报名返佣比例
/// </summary>
public decimal B2BRebateRatio { get; set; }
/// <summary>
/// 一般同行续费返佣比例
/// </summary>
public decimal B2BReNewRatio { get; set; }
/// <summary>
/// 校代同行首次报名返佣比例
/// </summary>
public decimal SchoolRebateRatio { get; set; }
/// <summary>
/// 校代同行续费返佣比例
/// </summary>
public decimal SchoolReNewRatio { get; set; }
}
/// <summary>
......
......@@ -294,5 +294,15 @@ namespace Edu.Model.ViewModel.Sell
/// 预计续费返佣
/// </summary>
public decimal RenewCommission { get; set; }
/// <summary>
/// 同行名称
/// </summary>
public string CustomerName { get; set; }
/// <summary>
/// 同行电话
/// </summary>
public string CustomerTel { get; set; }
}
}
\ No newline at end of file
......@@ -202,5 +202,10 @@ namespace Edu.Model.ViewModel.User
/// 是否添加到访记录
/// </summary>
public int IsCreateVisit { get; set; }
/// <summary>
/// 同行
/// </summary>
public string CustomerName { get; set; }
}
}
\ No newline at end of file
......@@ -117,6 +117,10 @@ namespace Edu.Module.Course
/// </summary>
private readonly RB_StudentRepository studentRepository = new RB_StudentRepository();
/// <summary>
/// 同行
/// </summary>
private readonly RB_CustomerRepository customerRepository = new RB_CustomerRepository();
/// <summary>
/// 同业返佣
/// </summary>
private readonly RB_Customer_BalanceDetailRepository customer_BalanceDetailRepository = new RB_Customer_BalanceDetailRepository();
......@@ -431,8 +435,9 @@ namespace Edu.Module.Course
if (demodel.CustomerId > 0) {
if (demodel.GuestNum > 0)
{
string Description = "续费返佣;课程售价:" + courseModel.SellPrice + ";优惠比例:" + courseModel.B2CReNewRatio + "%;返佣比例:" + courseModel.B2BReNewRatio + "%";
decimal RenewCommission = Math.Round(courseModel.SellPrice * (courseModel.B2CReNewRatio / 100) * (courseModel.B2BReNewRatio / 100) * demodel.GuestNum, 2, MidpointRounding.AwayFromZero);
var customerModel = customerRepository.GetEntity(demodel.CustomerId);
string Description = "续费返佣;课程售价:" + courseModel.SellPrice + ";优惠比例:" + courseModel.B2CReNewRatio + "%;返佣比例:" + (customerModel.CustomerType == 2 ? courseModel.SchoolReNewRatio : courseModel.B2BReNewRatio) + "%";
decimal RenewCommission = Math.Round(courseModel.SellPrice * (courseModel.B2CReNewRatio / 100) * ((customerModel.CustomerType == 2 ? courseModel.SchoolReNewRatio : courseModel.B2BReNewRatio) / 100) * demodel.GuestNum, 2, MidpointRounding.AwayFromZero);
BalanceList.Add(new RB_Customer_BalanceDetail_ViewModel()
{
Id = 0,
......@@ -466,8 +471,9 @@ namespace Edu.Module.Course
//生成待返佣记录表
if (demodel.GuestNum > 0)
{
string Description = "首次返佣;课程售价:" + courseModel.SellPrice + ";优惠比例:" + courseModel.B2CRatio + "%;返佣比例:" + courseModel.B2BRebateRatio + "%";
decimal NormalCommission = Math.Round(courseModel.SellPrice * (courseModel.B2CRatio / 100) * (courseModel.B2BRebateRatio / 100) * demodel.GuestNum, 2, MidpointRounding.AwayFromZero);
var customerModel = customerRepository.GetEntity(demodel.CustomerId);
string Description = "首次返佣;课程售价:" + courseModel.SellPrice + ";优惠比例:" + courseModel.B2CRatio + "%;返佣比例:" + (customerModel.CustomerType == 2 ? courseModel.SchoolRebateRatio : courseModel.B2BRebateRatio) + "%";
decimal NormalCommission = Math.Round(courseModel.SellPrice * (courseModel.B2CRatio / 100) * ((customerModel.CustomerType == 2 ? courseModel.SchoolRebateRatio : courseModel.B2BRebateRatio) / 100) * demodel.GuestNum, 2, MidpointRounding.AwayFromZero);
BalanceList.Add(new RB_Customer_BalanceDetail_ViewModel()
{
Id = 0,
......@@ -523,12 +529,13 @@ namespace Edu.Module.Course
}
if (demodel.CustomerId > 0)
{
var customerModel = customerRepository.GetEntity(demodel.CustomerId);
//生成待返佣记录表
decimal RenewCommission = 0, NormalCommission = 0;
if (RenewNum > 0)
{
string Description = "续费返佣;课程售价:" + courseModel.SellPrice + ";优惠比例:" + courseModel.B2CReNewRatio + "%;返佣比例:" + courseModel.B2BReNewRatio + "%";
RenewCommission = Math.Round(courseModel.SellPrice * (courseModel.B2CReNewRatio / 100) * (courseModel.B2BReNewRatio / 100) * RenewNum, 2, MidpointRounding.AwayFromZero);
string Description = "续费返佣;课程售价:" + courseModel.SellPrice + ";优惠比例:" + courseModel.B2CReNewRatio + "%;返佣比例:" + (customerModel.CustomerType == 2 ? courseModel.SchoolReNewRatio : courseModel.B2BReNewRatio) + "%";
RenewCommission = Math.Round(courseModel.SellPrice * (courseModel.B2CReNewRatio / 100) * ((customerModel.CustomerType == 2 ? courseModel.SchoolReNewRatio : courseModel.B2BReNewRatio) / 100) * RenewNum, 2, MidpointRounding.AwayFromZero);
BalanceList.Add(new RB_Customer_BalanceDetail_ViewModel()
{
Id = 0,
......@@ -549,8 +556,8 @@ namespace Edu.Module.Course
}
if (NormalNum > 0)
{
string Description = "首次返佣;课程售价:" + courseModel.SellPrice + ";优惠比例:" + courseModel.B2CRatio + "%;返佣比例:" + courseModel.B2BRebateRatio + "%";
NormalCommission = Math.Round(courseModel.SellPrice * (courseModel.B2CRatio / 100) * (courseModel.B2BRebateRatio / 100) * NormalNum, 2, MidpointRounding.AwayFromZero);
string Description = "首次返佣;课程售价:" + courseModel.SellPrice + ";优惠比例:" + courseModel.B2CRatio + "%;返佣比例:" + (customerModel.CustomerType == 2 ? courseModel.SchoolRebateRatio : courseModel.B2BRebateRatio) + "%";
NormalCommission = Math.Round(courseModel.SellPrice * (courseModel.B2CRatio / 100) * ((customerModel.CustomerType == 2 ? courseModel.SchoolRebateRatio : courseModel.B2BRebateRatio) / 100) * NormalNum, 2, MidpointRounding.AwayFromZero);
BalanceList.Add(new RB_Customer_BalanceDetail_ViewModel()
{
Id = 0,
......
......@@ -335,7 +335,7 @@ WHERE A.ClassId={0}
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.*,B.CourseName,B.CourseFeature,D.TeacherName,IFNULL(D.TeacherHead,'') AS TeacherHead,E.SName AS SchoolName,R.RoomName
,IFNULL(t.GuestNum,0) AS OrderStudentCount,IFNULL(B.SellPrice,0) AS CourseSellPrice,IFNULL(B.OriginalPrice,0) AS CourseOriginalPrice ,B.B2CRatio,B.B2CReNewRatio
,IFNULL(t.GuestNum,0) AS OrderStudentCount,IFNULL(B.SellPrice,0) AS CourseSellPrice,IFNULL(B.OriginalPrice,0) AS CourseOriginalPrice ,B.B2CRatio,B.B2CReNewRatio,B.B2BRebateRatio,B.B2BReNewRatio,B.SchoolRebateRatio,B.SchoolReNewRatio
,B.CourseSubject,IFNULL(csubject.SubjectName,'') AS CourseSubjectName
FROM rb_class AS A LEFT JOIN rb_course AS B ON A.CouseId=B.CourseId
LEFT JOIN rb_teacher AS D ON A.Teacher_Id=D.TId
......
......@@ -275,12 +275,13 @@ ORDER BY {orderBy}
SELECT o.*,c.ClassName,c.ClassNo,c.School_Id as ClassSchoolId,t.TeacherName,t.TeacherIcon,IFNULL(course.CourseName,'') AS CourseName
,C.OpenTime,course.CourseSubject,IFNULL(csubject.SubjectName,'') AS CourseSubjectName,IFNULL(school.SName,'') AS SchoolName
,IFNULL(c.ClassStatus,0) AS ClassStatus,IFNULL(course.CoverImg,'') AS CourseImg,IFNULL(course.B2BBackground,'') AS B2BBackground
,IFNULL(course.B2BIcon,'') AS B2BIcon
,IFNULL(course.B2BIcon,'') AS B2BIcon,cu.CustomerName,cu.ContactNumber as CustomerTel
FROM RB_Order o LEFT JOIN rb_class c on o.ClassId = c.ClassId
LEFT JOIN rb_teacher t on c.Teacher_Id = t.TId
LEFT JOIN rb_course AS course ON (o.CourseId=course.CourseId AND o.CourseId>0 AND o.OrderType=1)
LEFT JOIN rb_course_subject AS csubject ON course.CourseSubject=csubject.Id
LEFT JOIN rb_school AS school ON c.School_Id=school.SId
left join rb_customer cu on cu.CustomerId = o.CustomerId
WHERE {where} ORDER BY {orderBy}
";
return GetPage<RB_Order_ViewModel>(pageIndex, pageSize, out rowsCount, sql).ToList();
......
......@@ -100,9 +100,10 @@ WHERE 1=1
var parameters = new DynamicParameters();
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT t.*,g.GroupName,s.SName,IFNULL(a.Account,'') AS StudentAccount
SELECT t.*,g.GroupName,s.SName,IFNULL(a.Account,'') AS StudentAccount ,c.CustomerName
FROM rb_student AS t LEFT JOIN rb_group AS g ON t.Group_Id=g.GId
LEFT JOIN rb_school AS s ON t.School_Id=s.SId
left join rb_customer c on c.CustomerId = t.CustomerId
LEFT JOIN rb_account as a ON (t.StuId=a.AccountId AND a.AccountType=4 )
WHERE 1=1
");
......
......@@ -116,7 +116,11 @@ namespace Edu.WebApi.Controllers.Course
x.CourseSubject,
x.CourseSubjectName,
x.B2CRatio,
x.B2CReNewRatio
x.B2CReNewRatio,
x.B2BRebateRatio,
x.B2BReNewRatio,
x.SchoolRebateRatio,
x.SchoolReNewRatio
};
result.Add(obj);
}
......@@ -255,6 +259,9 @@ namespace Edu.WebApi.Controllers.Course
x.FirstOrderId,
x.IsBackClass,
x.LXConfirmState,
x.CustomerId,
x.CustomerName,
x.CustomerTel,
SplitDetailsList = x?.SplitDetailsList?.Select(qitem => new
{
qitem.S_ClassId,
......@@ -357,6 +364,9 @@ namespace Edu.WebApi.Controllers.Course
x.EduOccupation,
x.IsLessPrice,
x.LessPrice,
x.CustomerId,
x.CustomerName,
x.CustomerTel,
SaleRemarkList = x.SaleRemarkList.Select(z => new
{
z.Id,
......@@ -1364,6 +1374,9 @@ namespace Edu.WebApi.Controllers.Course
x.IsBackClass,
x.CourseSubject,
x.CourseSubjectName,
x.CustomerId,
x.CustomerName,
x.CustomerTel,
SplitDetailsList = x?.SplitDetailsList?.Select(qitem => new
{
qitem.S_ClassId,
......@@ -1549,6 +1562,9 @@ namespace Edu.WebApi.Controllers.Course
x.IsBackClass,
x.CourseSubject,
x.CourseSubjectName,
x.CustomerId,
x.CustomerName,
x.CustomerTel,
SplitDetailsList = x?.SplitDetailsList?.Select(qitem => new
{
qitem.S_ClassId,
......
......@@ -697,6 +697,7 @@ namespace Edu.WebApi.Controllers.User
StuChannelName= item.StuChannel.ToName(),
item.PlatformName,
item.CustomerId,
item.CustomerName,
AssistList = item.AssistList.Select(qitem => new
{
qitem.Id,
......
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