Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
Education
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄奎
Education
Commits
e821bfbc
Commit
e821bfbc
authored
Dec 15, 2021
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
d9f824ef
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
20 deletions
+33
-20
OrderModule.cs
Edu.Module.Course/OrderModule.cs
+32
-15
OrderController.cs
Edu.WebApi/Controllers/Course/OrderController.cs
+1
-5
No files found.
Edu.Module.Course/OrderModule.cs
View file @
e821bfbc
...
@@ -399,6 +399,7 @@ namespace Edu.Module.Course
...
@@ -399,6 +399,7 @@ namespace Edu.Module.Course
if
(
demodel
.
OrderId
>
0
)
if
(
demodel
.
OrderId
>
0
)
{
{
orderModel
=
orderRepository
.
GetEntity
(
demodel
.
OrderId
);
orderModel
=
orderRepository
.
GetEntity
(
demodel
.
OrderId
);
demodel
.
OrderIdentify
=
orderModel
.
OrderIdentify
;
}
}
//查询班级信息
//查询班级信息
var
classModel
=
classRepository
.
GetEntity
(
demodel
.
ClassId
);
var
classModel
=
classRepository
.
GetEntity
(
demodel
.
ClassId
);
...
@@ -451,12 +452,13 @@ namespace Edu.Module.Course
...
@@ -451,12 +452,13 @@ namespace Edu.Module.Course
{
{
demodel
.
DiscountMoney
=
coursePrice
*
(
courseModel
.
B2CReNewRatio
/
100
);
demodel
.
DiscountMoney
=
coursePrice
*
(
courseModel
.
B2CReNewRatio
/
100
);
demodel
.
SaleRemark
=
"续费报名优惠"
+
courseModel
.
B2CReNewRatio
+
"%"
;
demodel
.
SaleRemark
=
"续费报名优惠"
+
courseModel
.
B2CReNewRatio
+
"%"
;
if
(
demodel
.
CustomerId
>
0
)
{
if
(
demodel
.
CustomerId
>
0
)
{
if
(
demodel
.
GuestNum
>
0
)
if
(
demodel
.
GuestNum
>
0
)
{
{
var
customerModel
=
customerRepository
.
GetEntity
(
demodel
.
CustomerId
);
var
customerModel
=
customerRepository
.
GetEntity
(
demodel
.
CustomerId
);
string
Description
=
"续费返佣;课程售价:"
+
courseModel
.
SellPrice
+
";优惠比例:"
+
courseModel
.
B2CReNewRatio
+
"%;返佣比例:"
+
(
customerModel
.
CustomerType
==
2
?
courseModel
.
SchoolReNewRatio
:
courseModel
.
B2BReNewRatio
)
+
"%"
;
string
Description
=
"续费返佣;课程售价:"
+
courseModel
.
SellPrice
+
";优惠比例:"
+
courseModel
.
B2CReNewRatio
+
"%;返佣比例:"
+
(
customerModel
.
CustomerType
==
2
?
courseModel
.
SchoolReNewRatio
:
courseModel
.
B2BReNewRatio
)
+
"%"
;
decimal
RenewCommission
=
Math
.
Round
(
courseModel
.
SellPrice
*
((
100
-
courseModel
.
B2CReNewRatio
)
/
100
)
*
((
customerModel
.
CustomerType
==
2
?
courseModel
.
SchoolReNewRatio
:
courseModel
.
B2BReNewRatio
)
/
100
)
*
demodel
.
GuestNum
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
RenewCommission
=
Math
.
Round
(
courseModel
.
SellPrice
*
((
100
-
courseModel
.
B2CReNewRatio
)
/
100
)
*
((
customerModel
.
CustomerType
==
2
?
courseModel
.
SchoolReNewRatio
:
courseModel
.
B2BReNewRatio
)
/
100
)
*
demodel
.
GuestNum
,
2
,
MidpointRounding
.
AwayFromZero
);
BalanceList
.
Add
(
new
RB_Customer_BalanceDetail_ViewModel
()
BalanceList
.
Add
(
new
RB_Customer_BalanceDetail_ViewModel
()
{
{
Id
=
0
,
Id
=
0
,
...
@@ -477,11 +479,12 @@ namespace Edu.Module.Course
...
@@ -477,11 +479,12 @@ namespace Edu.Module.Course
}
}
}
}
}
}
else
if
((
demodel
.
JoinType
==
OrderJoinTypeEnum
.
Normal
||
demodel
.
JoinType
==
OrderJoinTypeEnum
.
InsertClass
)
&&
string
.
IsNullOrEmpty
(
demodel
.
StuIds
)
)
else
if
((
demodel
.
JoinType
==
OrderJoinTypeEnum
.
Normal
||
demodel
.
JoinType
==
OrderJoinTypeEnum
.
InsertClass
)
&&
demodel
.
OrderIdentify
!=
2
)
{
{
//默认都是首次报名优惠
//默认都是首次报名优惠
decimal
DiscountMoney
=
coursePrice
*
(
courseModel
.
B2CRatio
/
100
);
decimal
DiscountMoney
=
coursePrice
*
(
courseModel
.
B2CRatio
/
100
);
if
(
demodel
.
DiscountMoney
!=
DiscountMoney
*
demodel
.
GuestNum
)
{
if
(
demodel
.
DiscountMoney
!=
DiscountMoney
*
demodel
.
GuestNum
)
{
message
=
"优惠金额不正确"
;
message
=
"优惠金额不正确"
;
return
false
;
return
false
;
}
}
...
@@ -492,7 +495,7 @@ namespace Edu.Module.Course
...
@@ -492,7 +495,7 @@ namespace Edu.Module.Course
{
{
var
customerModel
=
customerRepository
.
GetEntity
(
demodel
.
CustomerId
);
var
customerModel
=
customerRepository
.
GetEntity
(
demodel
.
CustomerId
);
string
Description
=
"首次返佣;课程售价:"
+
courseModel
.
SellPrice
+
";优惠比例:"
+
courseModel
.
B2CRatio
+
"%;返佣比例:"
+
(
customerModel
.
CustomerType
==
2
?
courseModel
.
SchoolRebateRatio
:
courseModel
.
B2BRebateRatio
)
+
"%"
;
string
Description
=
"首次返佣;课程售价:"
+
courseModel
.
SellPrice
+
";优惠比例:"
+
courseModel
.
B2CRatio
+
"%;返佣比例:"
+
(
customerModel
.
CustomerType
==
2
?
courseModel
.
SchoolRebateRatio
:
courseModel
.
B2BRebateRatio
)
+
"%"
;
decimal
NormalCommission
=
Math
.
Round
(
courseModel
.
SellPrice
*
((
100
-
courseModel
.
B2CRatio
)
/
100
)
*
((
customerModel
.
CustomerType
==
2
?
courseModel
.
SchoolRebateRatio
:
courseModel
.
B2BRebateRatio
)
/
100
)
*
demodel
.
GuestNum
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
NormalCommission
=
Math
.
Round
(
courseModel
.
SellPrice
*
((
100
-
courseModel
.
B2CRatio
)
/
100
)
*
((
customerModel
.
CustomerType
==
2
?
courseModel
.
SchoolRebateRatio
:
courseModel
.
B2BRebateRatio
)
/
100
)
*
demodel
.
GuestNum
,
2
,
MidpointRounding
.
AwayFromZero
);
BalanceList
.
Add
(
new
RB_Customer_BalanceDetail_ViewModel
()
BalanceList
.
Add
(
new
RB_Customer_BalanceDetail_ViewModel
()
{
{
Id
=
0
,
Id
=
0
,
...
@@ -513,27 +516,33 @@ namespace Edu.Module.Course
...
@@ -513,27 +516,33 @@ namespace Edu.Module.Course
}
}
}
}
}
}
else
if
(
!
string
.
IsNullOrEmpty
(
demodel
.
StuIds
)
&&
demodel
.
OrderIdentify
==
2
)
else
if
(
demodel
.
OrderIdentify
==
2
&&
demodel
.
OrderId
==
0
)
{
{
//查询学生列表
//查询学生列表
StuList
=
studentRepository
.
GetStudentListRepository
(
new
RB_Student_ViewModel
()
{
Group_Id
=
demodel
.
Group_Id
,
StuIds
=
demodel
.
StuIds
,
School_Id
=
-
1
});
StuList
=
studentRepository
.
GetStudentListRepository
(
new
RB_Student_ViewModel
()
{
Group_Id
=
demodel
.
Group_Id
,
StuIds
=
demodel
.
StuIds
,
School_Id
=
-
1
});
//根据客人手机号码 验证是否是续费
//根据客人手机号码 验证是否是续费
if
(
StuList
.
Select
(
x
=>
x
.
CustomerId
).
Distinct
().
Count
()
>
1
)
{
if
(
StuList
.
Select
(
x
=>
x
.
CustomerId
).
Distinct
().
Count
()
>
1
)
{
message
=
"只能选择同一同行的客户报名"
;
message
=
"只能选择同一同行的客户报名"
;
return
false
;
return
false
;
}
}
if
(
StuList
.
Count
()
!=
demodel
.
GuestNum
)
{
if
(
StuList
.
Count
()
!=
demodel
.
GuestNum
)
{
message
=
"学生信息有误"
;
message
=
"学生信息有误"
;
return
false
;
return
false
;
}
}
if
(
StuList
.
FirstOrDefault
().
CustomerId
!=
demodel
.
CustomerId
)
{
if
(
StuList
.
FirstOrDefault
().
CustomerId
!=
demodel
.
CustomerId
)
{
message
=
"同业信息有误"
;
message
=
"同业信息有误"
;
return
false
;
return
false
;
}
}
var
glist
=
order_GuestRepository
.
GetGuestListForMobile
(
StuList
.
Select
(
x
=>
x
.
StuTel
).
ToList
(),
demodel
.
CustomerId
,
demodel
.
Group_Id
);
var
glist
=
order_GuestRepository
.
GetGuestListForMobile
(
StuList
.
Select
(
x
=>
x
.
StuTel
).
ToList
(),
demodel
.
CustomerId
,
demodel
.
Group_Id
);
if
(
glist
.
Any
())
{
if
(
glist
.
Any
())
foreach
(
var
item
in
StuList
)
{
{
if
(
glist
.
Where
(
x
=>
x
.
Mobile
==
item
.
StuTel
).
Any
())
{
foreach
(
var
item
in
StuList
)
{
if
(
glist
.
Where
(
x
=>
x
.
Mobile
==
item
.
StuTel
).
Any
())
{
item
.
IsRenewGuest
=
1
;
//是续费的
item
.
IsRenewGuest
=
1
;
//是续费的
}
}
}
}
...
@@ -554,7 +563,7 @@ namespace Edu.Module.Course
...
@@ -554,7 +563,7 @@ namespace Edu.Module.Course
if
(
RenewNum
>
0
)
if
(
RenewNum
>
0
)
{
{
string
Description
=
"续费返佣;课程售价:"
+
courseModel
.
SellPrice
+
";优惠比例:"
+
courseModel
.
B2CReNewRatio
+
"%;返佣比例:"
+
(
customerModel
.
CustomerType
==
2
?
courseModel
.
SchoolReNewRatio
:
courseModel
.
B2BReNewRatio
)
+
"%"
;
string
Description
=
"续费返佣;课程售价:"
+
courseModel
.
SellPrice
+
";优惠比例:"
+
courseModel
.
B2CReNewRatio
+
"%;返佣比例:"
+
(
customerModel
.
CustomerType
==
2
?
courseModel
.
SchoolReNewRatio
:
courseModel
.
B2BReNewRatio
)
+
"%"
;
RenewCommission
=
Math
.
Round
(
courseModel
.
SellPrice
*
((
100
-
courseModel
.
B2CReNewRatio
)
/
100
)
*
((
customerModel
.
CustomerType
==
2
?
courseModel
.
SchoolReNewRatio
:
courseModel
.
B2BReNewRatio
)
/
100
)
*
RenewNum
,
2
,
MidpointRounding
.
AwayFromZero
);
RenewCommission
=
Math
.
Round
(
courseModel
.
SellPrice
*
((
100
-
courseModel
.
B2CReNewRatio
)
/
100
)
*
((
customerModel
.
CustomerType
==
2
?
courseModel
.
SchoolReNewRatio
:
courseModel
.
B2BReNewRatio
)
/
100
)
*
RenewNum
,
2
,
MidpointRounding
.
AwayFromZero
);
BalanceList
.
Add
(
new
RB_Customer_BalanceDetail_ViewModel
()
BalanceList
.
Add
(
new
RB_Customer_BalanceDetail_ViewModel
()
{
{
Id
=
0
,
Id
=
0
,
...
@@ -576,7 +585,7 @@ namespace Edu.Module.Course
...
@@ -576,7 +585,7 @@ namespace Edu.Module.Course
if
(
NormalNum
>
0
)
if
(
NormalNum
>
0
)
{
{
string
Description
=
"首次返佣;课程售价:"
+
courseModel
.
SellPrice
+
";优惠比例:"
+
courseModel
.
B2CRatio
+
"%;返佣比例:"
+
(
customerModel
.
CustomerType
==
2
?
courseModel
.
SchoolRebateRatio
:
courseModel
.
B2BRebateRatio
)
+
"%"
;
string
Description
=
"首次返佣;课程售价:"
+
courseModel
.
SellPrice
+
";优惠比例:"
+
courseModel
.
B2CRatio
+
"%;返佣比例:"
+
(
customerModel
.
CustomerType
==
2
?
courseModel
.
SchoolRebateRatio
:
courseModel
.
B2BRebateRatio
)
+
"%"
;
NormalCommission
=
Math
.
Round
(
courseModel
.
SellPrice
*
((
100
-
courseModel
.
B2CRatio
)
/
100
)
*
((
customerModel
.
CustomerType
==
2
?
courseModel
.
SchoolRebateRatio
:
courseModel
.
B2BRebateRatio
)
/
100
)
*
NormalNum
,
2
,
MidpointRounding
.
AwayFromZero
);
NormalCommission
=
Math
.
Round
(
courseModel
.
SellPrice
*
((
100
-
courseModel
.
B2CRatio
)
/
100
)
*
((
customerModel
.
CustomerType
==
2
?
courseModel
.
SchoolRebateRatio
:
courseModel
.
B2BRebateRatio
)
/
100
)
*
NormalNum
,
2
,
MidpointRounding
.
AwayFromZero
);
BalanceList
.
Add
(
new
RB_Customer_BalanceDetail_ViewModel
()
BalanceList
.
Add
(
new
RB_Customer_BalanceDetail_ViewModel
()
{
{
Id
=
0
,
Id
=
0
,
...
@@ -595,12 +604,20 @@ namespace Edu.Module.Course
...
@@ -595,12 +604,20 @@ namespace Edu.Module.Course
UpdateTime
=
DateTime
.
Now
,
UpdateTime
=
DateTime
.
Now
,
});
});
}
}
if
(
demodel
.
NormalCommission
!=
NormalCommission
||
demodel
.
RenewCommission
!=
RenewCommission
)
{
if
(
demodel
.
NormalCommission
!=
NormalCommission
||
demodel
.
RenewCommission
!=
RenewCommission
)
{
//message = "返佣金额不正确";
//message = "返佣金额不正确";
//return false;
//return false;
}
}
}
}
}
}
else
if
(
demodel
.
OrderIdentify
==
2
&&
demodel
.
OrderId
>
0
)
{
//直接验证优惠金额
if
(
demodel
.
DiscountMoney
!=
orderModel
.
DiscountMoney
)
{
message
=
"优惠金额有误"
;
return
false
;
}
}
//获取课程优惠
//获取课程优惠
var
coursePreferentialList
=
course_PreferentialRepository
.
GetCoursePreferentialListRepostory
(
new
RB_Course_Preferential_Extend
()
var
coursePreferentialList
=
course_PreferentialRepository
.
GetCoursePreferentialListRepostory
(
new
RB_Course_Preferential_Extend
()
...
...
Edu.WebApi/Controllers/Course/OrderController.cs
View file @
e821bfbc
...
@@ -559,11 +559,7 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -559,11 +559,7 @@ namespace Edu.WebApi.Controllers.Course
{
{
return
ApiResult
.
ParamIsNull
(
"请选择客人来源"
);
return
ApiResult
.
ParamIsNull
(
"请选择客人来源"
);
}
}
if
(
demodel
.
OrderId
>
0
)
if
(
demodel
.
OrderIdentify
==
2
&&
string
.
IsNullOrEmpty
(
demodel
.
StuIds
)
&&
demodel
.
OrderId
==
0
)
{
demodel
.
OrderIdentify
=
0
;
}
if
(
demodel
.
OrderIdentify
==
2
&&
string
.
IsNullOrEmpty
(
demodel
.
StuIds
))
{
{
return
ApiResult
.
ParamIsNull
(
"请传递选择客户"
);
return
ApiResult
.
ParamIsNull
(
"请传递选择客户"
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment