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
a1d1750a
Commit
a1d1750a
authored
Jun 22, 2021
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
订单增加 同行返佣
parent
fd68c329
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
80 additions
and
14 deletions
+80
-14
RB_Order.cs
Edu.Model/Entity/Course/RB_Order.cs
+10
-0
CourseOfferModule.cs
Edu.Module.Course/CourseOfferModule.cs
+3
-1
OrderModule.cs
Edu.Module.Course/OrderModule.cs
+8
-2
SellCommissionModule.cs
Edu.Module.Course/SellCommissionModule.cs
+26
-5
StudentBillModule.cs
Edu.Module.Course/StudentBillModule.cs
+3
-1
OrderController.cs
Edu.WebApi/Controllers/Course/OrderController.cs
+30
-5
No files found.
Edu.Model/Entity/Course/RB_Order.cs
View file @
a1d1750a
...
@@ -225,6 +225,16 @@ namespace Edu.Model.Entity.Course
...
@@ -225,6 +225,16 @@ namespace Edu.Model.Entity.Course
/// </summary>
/// </summary>
public
decimal
CommissionRate
{
get
;
set
;
}
public
decimal
CommissionRate
{
get
;
set
;
}
/// <summary>
/// 销售返佣类型 0百分比 1固定值 (同行)
/// </summary>
public
decimal
CommissionTypeTH
{
get
;
set
;
}
/// <summary>
/// 提成比例/固定值 (同行)
/// </summary>
public
decimal
CommissionRateTH
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 提成补交
/// 提成补交
/// </summary>
/// </summary>
...
...
Edu.Module.Course/CourseOfferModule.cs
View file @
a1d1750a
...
@@ -424,9 +424,11 @@ namespace Edu.Module.Course
...
@@ -424,9 +424,11 @@ namespace Edu.Module.Course
}
}
orderModel
.
CommissionType
=
coursePreferentialModel
?.
SaleCommissionType
??
0
;
orderModel
.
CommissionType
=
coursePreferentialModel
?.
SaleCommissionType
??
0
;
orderModel
.
CommissionRate
=
coursePreferentialModel
?.
SaleCommissionMoney
??
0
;
orderModel
.
CommissionRate
=
coursePreferentialModel
?.
SaleCommissionMoney
??
0
;
orderModel
.
CommissionTypeTH
=
coursePreferentialModel
?.
B2BCommissionType
??
0
;
orderModel
.
CommissionRateTH
=
coursePreferentialModel
?.
B2BCommissionMoney
??
0
;
if
(
coursePreferentialModel
!=
null
)
if
(
coursePreferentialModel
!=
null
)
{
{
orderModel
.
CommissionRemark
=
"使用优惠Id:"
+
coursePreferentialModel
.
Id
+
" 返佣类型:"
+
orderModel
.
CommissionType
+
" 返佣比例/金额:"
+
orderModel
.
CommissionRate
;
orderModel
.
CommissionRemark
=
"使用优惠Id:"
+
coursePreferentialModel
.
Id
+
" 返佣类型:"
+
orderModel
.
CommissionType
+
" 返佣比例/金额:"
+
orderModel
.
CommissionRate
+
" 同行返佣类型:"
+
orderModel
.
CommissionTypeTH
+
" 同行返佣比例/金额:"
+
orderModel
.
CommissionRateTH
;
}
}
#
endregion
#
endregion
}
}
...
...
Edu.Module.Course/OrderModule.cs
View file @
a1d1750a
...
@@ -368,9 +368,11 @@ namespace Edu.Module.Course
...
@@ -368,9 +368,11 @@ namespace Edu.Module.Course
}
}
demodel
.
CommissionType
=
coursePreferentialModel
?.
SaleCommissionType
??
0
;
demodel
.
CommissionType
=
coursePreferentialModel
?.
SaleCommissionType
??
0
;
demodel
.
CommissionRate
=
coursePreferentialModel
?.
SaleCommissionMoney
??
0
;
demodel
.
CommissionRate
=
coursePreferentialModel
?.
SaleCommissionMoney
??
0
;
demodel
.
CommissionTypeTH
=
coursePreferentialModel
?.
B2BCommissionType
??
0
;
demodel
.
CommissionRateTH
=
coursePreferentialModel
?.
B2BCommissionMoney
??
0
;
if
(
coursePreferentialModel
!=
null
)
if
(
coursePreferentialModel
!=
null
)
{
{
demodel
.
CommissionRemark
=
"使用优惠Id:"
+
coursePreferentialModel
.
Id
+
" 返佣类型:"
+
demodel
.
CommissionType
+
" 返佣比例/金额:"
+
demodel
.
CommissionRate
;
demodel
.
CommissionRemark
=
"使用优惠Id:"
+
coursePreferentialModel
.
Id
+
" 返佣类型:"
+
demodel
.
CommissionType
+
" 返佣比例/金额:"
+
demodel
.
CommissionRate
+
" 同行返佣类型:"
+
demodel
.
CommissionTypeTH
+
" 同行返佣比例/金额:"
+
demodel
.
CommissionRateTH
;
}
}
#
endregion
#
endregion
}
}
...
@@ -703,13 +705,17 @@ namespace Edu.Module.Course
...
@@ -703,13 +705,17 @@ namespace Edu.Module.Course
#
region
记录提成信息
#
region
记录提成信息
item
.
CommissionType
=
coursePreferentialModel
?.
SaleCommissionType
??
0
;
item
.
CommissionType
=
coursePreferentialModel
?.
SaleCommissionType
??
0
;
item
.
CommissionRate
=
coursePreferentialModel
?.
SaleCommissionMoney
??
0
;
item
.
CommissionRate
=
coursePreferentialModel
?.
SaleCommissionMoney
??
0
;
item
.
CommissionTypeTH
=
coursePreferentialModel
?.
B2BCommissionType
??
0
;
item
.
CommissionRateTH
=
coursePreferentialModel
?.
B2BCommissionMoney
??
0
;
if
(
coursePreferentialModel
!=
null
)
if
(
coursePreferentialModel
!=
null
)
{
{
item
.
CommissionRemark
=
"初始化使用优惠Id:"
+
coursePreferentialModel
.
Id
+
" 返佣类型:"
+
item
.
CommissionType
+
" 返佣比例/金额:"
+
item
.
CommissionRate
;
item
.
CommissionRemark
=
"初始化使用优惠Id:"
+
coursePreferentialModel
.
Id
+
" 返佣类型:"
+
item
.
CommissionType
+
" 返佣比例/金额:"
+
item
.
CommissionRate
+
" 同行返佣类型:"
+
item
.
CommissionTypeTH
+
" 同行返佣比例/金额:"
+
item
.
CommissionRateTH
;
}
}
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Order_ViewModel
.
CommissionType
),
item
.
CommissionType
},
{
nameof
(
RB_Order_ViewModel
.
CommissionType
),
item
.
CommissionType
},
{
nameof
(
RB_Order_ViewModel
.
CommissionRate
),
item
.
CommissionRate
},
{
nameof
(
RB_Order_ViewModel
.
CommissionRate
),
item
.
CommissionRate
},
{
nameof
(
RB_Order_ViewModel
.
CommissionTypeTH
),
item
.
CommissionTypeTH
},
{
nameof
(
RB_Order_ViewModel
.
CommissionRateTH
),
item
.
CommissionRateTH
},
{
nameof
(
RB_Order_ViewModel
.
CommissionRemark
),
item
.
CommissionRemark
},
{
nameof
(
RB_Order_ViewModel
.
CommissionRemark
),
item
.
CommissionRemark
},
};
};
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
...
...
Edu.Module.Course/SellCommissionModule.cs
View file @
a1d1750a
...
@@ -399,13 +399,34 @@ namespace Edu.Module.Course
...
@@ -399,13 +399,34 @@ namespace Edu.Module.Course
#
region
订单应发提成
(
不包括
额外提成
)
#
region
订单应发提成
(
不包括
额外提成
)
decimal
YFCommission
=
0
;
decimal
YFCommission
=
0
;
if
(
item
.
CommissionType
==
1
)
if
(
item
.
CommissionType
==
item
.
CommissionTypeTH
)
{
{
YFCommission
=
item
.
CommissionRate
;
// 固定金额 暂时只做人民币;
if
(
item
.
CommissionType
==
1
)
{
YFCommission
=
item
.
CommissionRate
+
item
.
CommissionRateTH
;
// 固定金额 暂时只做人民币;
}
else
{
YFCommission
=
Math
.
Round
((
item
.
PreferPrice
-
item
.
DiscountMoney
+
item
.
LessPrice
)
*
(
item
.
CommissionRate
+
item
.
CommissionRateTH
)
/
100
,
2
,
MidpointRounding
.
AwayFromZero
);
}
}
}
else
else
{
{
if
(
item
.
CommissionType
==
1
)
YFCommission
=
Math
.
Round
((
item
.
PreferPrice
-
item
.
DiscountMoney
+
item
.
LessPrice
)
*
item
.
CommissionRate
/
100
,
2
,
MidpointRounding
.
AwayFromZero
);
{
YFCommission
=
item
.
CommissionRate
;
// 固定金额 暂时只做人民币;
}
else
{
YFCommission
=
Math
.
Round
((
item
.
PreferPrice
-
item
.
DiscountMoney
+
item
.
LessPrice
)
*
item
.
CommissionRate
/
100
,
2
,
MidpointRounding
.
AwayFromZero
);
}
if
(
item
.
CommissionTypeTH
==
1
)
{
YFCommission
+=
item
.
CommissionRateTH
;
// 固定金额 暂时只做人民币;
}
else
{
YFCommission
+=
Math
.
Round
((
item
.
PreferPrice
-
item
.
DiscountMoney
+
item
.
LessPrice
)
*
item
.
CommissionRateTH
/
100
,
2
,
MidpointRounding
.
AwayFromZero
);
}
}
}
if
(
item
.
LessPrice
>
0
)
if
(
item
.
LessPrice
>
0
)
{
{
...
...
Edu.Module.Course/StudentBillModule.cs
View file @
a1d1750a
...
@@ -1026,9 +1026,11 @@ namespace Edu.Module.Course
...
@@ -1026,9 +1026,11 @@ namespace Edu.Module.Course
}
}
orderModel
.
CommissionType
=
coursePreferentialModel
?.
SaleCommissionType
??
0
;
orderModel
.
CommissionType
=
coursePreferentialModel
?.
SaleCommissionType
??
0
;
orderModel
.
CommissionRate
=
coursePreferentialModel
?.
SaleCommissionMoney
??
0
;
orderModel
.
CommissionRate
=
coursePreferentialModel
?.
SaleCommissionMoney
??
0
;
orderModel
.
CommissionTypeTH
=
coursePreferentialModel
?.
B2BCommissionType
??
0
;
orderModel
.
CommissionRateTH
=
coursePreferentialModel
?.
B2BCommissionMoney
??
0
;
if
(
coursePreferentialModel
!=
null
)
if
(
coursePreferentialModel
!=
null
)
{
{
orderModel
.
CommissionRemark
=
"使用优惠Id:"
+
coursePreferentialModel
.
Id
+
" 返佣类型:"
+
orderModel
.
CommissionType
+
" 返佣比例/金额:"
+
orderModel
.
CommissionRate
;
orderModel
.
CommissionRemark
=
"使用优惠Id:"
+
coursePreferentialModel
.
Id
+
" 返佣类型:"
+
orderModel
.
CommissionType
+
" 返佣比例/金额:"
+
orderModel
.
CommissionRate
+
" 同行返佣类型:"
+
orderModel
.
CommissionTypeTH
+
" 同行返佣比例/金额:"
+
orderModel
.
CommissionRateTH
;
}
}
#
endregion
#
endregion
}
}
...
...
Edu.WebApi/Controllers/Course/OrderController.cs
View file @
a1d1750a
...
@@ -203,7 +203,7 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -203,7 +203,7 @@ namespace Edu.WebApi.Controllers.Course
OrderSourceName
=
x
.
OrderSource
.
ToName
(),
OrderSourceName
=
x
.
OrderSource
.
ToName
(),
x
.
EnterID
,
x
.
EnterID
,
EnterName
=
UserReidsCache
.
GetUserLoginInfo
(
x
.
EnterID
)?.
AccountName
??
""
,
EnterName
=
UserReidsCache
.
GetUserLoginInfo
(
x
.
EnterID
)?.
AccountName
??
""
,
YFCommissionMoney
=
x
.
CommissionType
==
1
?
x
.
CommissionRate
:
Math
.
Round
((
x
.
PreferPrice
-
x
.
DiscountMoney
)
*
x
.
CommissionRate
/
100
,
2
,
MidpointRounding
.
AwayFromZero
),
YFCommissionMoney
=
GetOrderYFCommission
(
x
),
x
.
CommissionMoney
,
x
.
CommissionMoney
,
x
.
ExtraCommissionMoney
,
x
.
ExtraCommissionMoney
,
x
.
ExtraRewardMoney
,
x
.
ExtraRewardMoney
,
...
@@ -222,7 +222,7 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -222,7 +222,7 @@ namespace Edu.WebApi.Controllers.Course
x
.
EduOccupation
,
x
.
EduOccupation
,
x
.
IsLessPrice
,
x
.
IsLessPrice
,
x
.
LessPrice
,
x
.
LessPrice
,
OpenTime
=
Common
.
ConvertHelper
.
FormatDate
(
x
.
OpenTime
),
OpenTime
=
Common
.
ConvertHelper
.
FormatDate
(
x
.
OpenTime
),
x
.
EffectStatus
,
x
.
EffectStatus
,
x
.
EffectStatusStr
,
x
.
EffectStatusStr
,
EffectTime
=
Common
.
ConvertHelper
.
FormatDate
(
x
.
EffectTime
),
EffectTime
=
Common
.
ConvertHelper
.
FormatDate
(
x
.
EffectTime
),
...
@@ -289,7 +289,7 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -289,7 +289,7 @@ namespace Edu.WebApi.Controllers.Course
OrderStateName
=
x
.
OrderState
.
ToName
(),
OrderStateName
=
x
.
OrderState
.
ToName
(),
x
.
EnterID
,
x
.
EnterID
,
EnterName
=
UserReidsCache
.
GetUserLoginInfo
(
x
.
EnterID
)?.
AccountName
??
""
,
EnterName
=
UserReidsCache
.
GetUserLoginInfo
(
x
.
EnterID
)?.
AccountName
??
""
,
YFCommissionMoney
=
x
.
CommissionType
==
1
?
x
.
CommissionRate
:
Math
.
Round
((
x
.
PreferPrice
-
x
.
DiscountMoney
)
*
x
.
CommissionRate
/
100
,
2
,
MidpointRounding
.
AwayFromZero
),
YFCommissionMoney
=
GetOrderYFCommission
(
x
),
x
.
CommissionMoney
,
x
.
CommissionMoney
,
x
.
ExtraCommissionMoney
,
x
.
ExtraCommissionMoney
,
x
.
ExtraRewardMoney
,
x
.
ExtraRewardMoney
,
...
@@ -354,6 +354,31 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -354,6 +354,31 @@ namespace Edu.WebApi.Controllers.Course
});
});
}
}
/// <summary>
/// 获取订单应发提成
/// </summary>
/// <param name="x"></param>
/// <returns></returns>
private
static
decimal
GetOrderYFCommission
(
RB_Order_ViewModel
x
)
{
if
(
x
.
CommissionType
==
x
.
CommissionTypeTH
)
{
if
(
x
.
CommissionType
==
1
)
{
return
x
.
CommissionRate
+
x
.
CommissionRateTH
-
x
.
LessPrice
;
}
else
{
return
Math
.
Round
((
x
.
PreferPrice
-
x
.
DiscountMoney
+
x
.
LessPrice
)
*
(
x
.
CommissionRate
+
x
.
CommissionRateTH
)
/
100
,
2
,
MidpointRounding
.
AwayFromZero
)
-
x
.
LessPrice
;
}
}
else
{
decimal
commission1
=
x
.
CommissionType
==
1
?
x
.
CommissionRate
:
Math
.
Round
((
x
.
PreferPrice
-
x
.
DiscountMoney
+
x
.
LessPrice
)
*
x
.
CommissionRate
/
100
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
commission2
=
x
.
CommissionTypeTH
==
1
?
x
.
CommissionRateTH
:
Math
.
Round
((
x
.
PreferPrice
-
x
.
DiscountMoney
+
x
.
LessPrice
)
*
x
.
CommissionRateTH
/
100
,
2
,
MidpointRounding
.
AwayFromZero
);
return
commission1
+
commission2
-
x
.
LessPrice
;
}
}
/// <summary>
/// <summary>
/// 获取班级订单下拉列表
/// 获取班级订单下拉列表
/// </summary>
/// </summary>
...
@@ -1165,7 +1190,7 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -1165,7 +1190,7 @@ namespace Edu.WebApi.Controllers.Course
OrderSourceName
=
x
.
OrderSource
.
ToName
(),
OrderSourceName
=
x
.
OrderSource
.
ToName
(),
x
.
EnterID
,
x
.
EnterID
,
EnterName
=
UserReidsCache
.
GetUserLoginInfo
(
x
.
EnterID
)?.
AccountName
??
""
,
EnterName
=
UserReidsCache
.
GetUserLoginInfo
(
x
.
EnterID
)?.
AccountName
??
""
,
YFCommissionMoney
=
x
.
CommissionType
==
1
?
x
.
CommissionRate
:
Math
.
Round
((
x
.
PreferPrice
-
x
.
DiscountMoney
)
*
x
.
CommissionRate
/
100
,
2
,
MidpointRounding
.
AwayFromZero
),
YFCommissionMoney
=
GetOrderYFCommission
(
x
),
x
.
CommissionMoney
,
x
.
CommissionMoney
,
x
.
ExtraCommissionMoney
,
x
.
ExtraCommissionMoney
,
x
.
ExtraRewardMoney
,
x
.
ExtraRewardMoney
,
...
@@ -1315,7 +1340,7 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -1315,7 +1340,7 @@ namespace Edu.WebApi.Controllers.Course
OrderSourceName
=
x
.
OrderSource
.
ToName
(),
OrderSourceName
=
x
.
OrderSource
.
ToName
(),
x
.
EnterID
,
x
.
EnterID
,
EnterName
=
UserReidsCache
.
GetUserLoginInfo
(
x
.
EnterID
)?.
AccountName
??
""
,
EnterName
=
UserReidsCache
.
GetUserLoginInfo
(
x
.
EnterID
)?.
AccountName
??
""
,
YFCommissionMoney
=
x
.
CommissionType
==
1
?
x
.
CommissionRate
:
Math
.
Round
((
x
.
PreferPrice
-
x
.
DiscountMoney
)
*
x
.
CommissionRate
/
100
,
2
,
MidpointRounding
.
AwayFromZero
),
YFCommissionMoney
=
GetOrderYFCommission
(
x
),
x
.
CommissionMoney
,
x
.
CommissionMoney
,
x
.
ExtraCommissionMoney
,
x
.
ExtraCommissionMoney
,
x
.
ExtraRewardMoney
,
x
.
ExtraRewardMoney
,
...
...
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