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
3692b400
Commit
3692b400
authored
Sep 03, 2024
by
吴春
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/Kui2/education
parents
065557b4
9ef8c07b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
53 additions
and
65 deletions
+53
-65
OrderModule.cs
Edu.Module.Course/OrderModule.cs
+26
-53
StudentBillModule.cs
Edu.Module.Course/StudentBillModule.cs
+1
-1
RB_Education_ReceiptRepository.cs
Edu.Repository/EduTask/RB_Education_ReceiptRepository.cs
+8
-4
RB_OrderRepository.cs
Edu.Repository/Sell/RB_OrderRepository.cs
+18
-7
No files found.
Edu.Module.Course/OrderModule.cs
View file @
3692b400
...
...
@@ -464,62 +464,29 @@ namespace Edu.Module.Course
{
//检查学员是否存在有效订单
int
orderCount
=
studentRepository
.
GetStudentOrderCount
(
x
.
StuId
);
if
(
model
.
OrderCourseList
!=
null
&&
model
.
OrderCourseList
.
Any
()
)
var
commissionModel
=
new
RB_Order_ReturnComission_ViewModel
(
)
{
foreach
(
var
item
in
model
.
OrderCourseList
)
{
var
commissionModel
=
new
RB_Order_ReturnComission_ViewModel
()
{
Id
=
0
,
OrderId
=
model
.
OrderId
,
OrderSourceType
=
x
.
CreateType
,
OrderSourceId
=
x
.
CreateType
==
StuCreateTypeEnum
.
EmployeeInput
?
x
.
CreateBy
:
(
x
.
CreateType
==
StuCreateTypeEnum
.
CustomerInput
?
x
.
CustomerId
:
x
.
StuSourceId
),
Status
=
-
1
,
//下单默认为不可返佣,等待付款完成后更新为待返佣
UnionCashOutId
=
0
,
StuId
=
x
.
StuId
,
CommissionType
=
orderCount
==
0
?
1
:
2
,
SchoolId
=
model
.
School_Id
,
GroupId
=
model
.
Group_Id
,
Remark
=
""
,
};
if
(
model
.
OrderType
==
OrderTypeEnum
.
CourseOrder
)
{
FormatOrderCommissionByCourse
(
ref
commissionModel
,
item
.
CourseId
,
model
.
PreferPrice
-
model
.
DiscountMoney
);
}
else
if
(
model
.
OrderType
==
OrderTypeEnum
.
StudyabroadOrder
)
{
FormatOrderCommissionByStudyabrad
(
ref
commissionModel
,
model
.
SourceId
,
0
);
}
returnComissionRepository
.
Insert
(
commissionModel
);
}
Id
=
0
,
OrderId
=
model
.
OrderId
,
OrderSourceType
=
x
.
CreateType
,
OrderSourceId
=
x
.
CreateType
==
StuCreateTypeEnum
.
EmployeeInput
?
x
.
CreateBy
:
(
x
.
CreateType
==
StuCreateTypeEnum
.
CustomerInput
?
x
.
CustomerId
:
x
.
StuSourceId
),
Status
=
-
1
,
//下单默认为不可返佣,等待付款完成后更新为待返佣
UnionCashOutId
=
0
,
StuId
=
x
.
StuId
,
CommissionType
=
orderCount
==
0
?
1
:
2
,
SchoolId
=
model
.
School_Id
,
GroupId
=
model
.
Group_Id
,
Remark
=
""
,
};
if
(
model
.
OrderType
==
OrderTypeEnum
.
CourseOrder
)
{
FormatOrderCommissionByCourse
(
ref
commissionModel
,
model
.
CourseId
,
model
.
PreferPrice
-
model
.
DiscountMoney
);
}
else
else
if
(
model
.
OrderType
==
OrderTypeEnum
.
StudyabroadOrder
)
{
var
commissionModel
=
new
RB_Order_ReturnComission_ViewModel
()
{
Id
=
0
,
OrderId
=
model
.
OrderId
,
OrderSourceType
=
x
.
CreateType
,
OrderSourceId
=
x
.
CreateType
==
StuCreateTypeEnum
.
EmployeeInput
?
x
.
CreateBy
:
(
x
.
CreateType
==
StuCreateTypeEnum
.
CustomerInput
?
x
.
CustomerId
:
x
.
StuSourceId
),
Status
=
-
1
,
//下单默认为不可返佣,等待付款完成后更新为待返佣
UnionCashOutId
=
0
,
StuId
=
x
.
StuId
,
CommissionType
=
orderCount
==
0
?
1
:
2
,
SchoolId
=
model
.
School_Id
,
GroupId
=
model
.
Group_Id
,
Remark
=
""
,
};
if
(
model
.
OrderType
==
OrderTypeEnum
.
CourseOrder
)
{
FormatOrderCommissionByCourse
(
ref
commissionModel
,
model
.
CourseId
,
model
.
PreferPrice
-
model
.
DiscountMoney
);
}
else
if
(
model
.
OrderType
==
OrderTypeEnum
.
StudyabroadOrder
)
{
FormatOrderCommissionByStudyabrad
(
ref
commissionModel
,
model
.
SourceId
,
0
);
}
returnComissionRepository
.
Insert
(
commissionModel
);
FormatOrderCommissionByStudyabrad
(
ref
commissionModel
,
model
.
SourceId
,
0
);
}
returnComissionRepository
.
Insert
(
commissionModel
);
});
}
}
...
...
@@ -689,8 +656,14 @@ namespace Edu.Module.Course
public
void
FormatOrderCommissionByCourse
(
ref
RB_Order_ReturnComission_ViewModel
m
,
int
courseId
,
decimal
orderIncome
)
{
var
courseModel
=
courseRepository
.
GetEntity
(
courseId
);
//首先查询一下 订单是否关联多课程
var
orderCourseList
=
order_CourseRepository
.
GetOrderCourseListRepository
(
new
RB_Order_Course
()
{
Group_Id
=
m
.
GroupId
,
OrderId
=
m
.
OrderId
},
""
);
if
(
orderCourseList
.
Any
()
&&
orderCourseList
.
Count
()
>
1
)
{
//取最高等级的课程
var
courseList
=
courseRepository
.
GetCourseListRepository
(
new
RB_Course_ViewModel
()
{
Group_Id
=
m
.
GroupId
,
QCourseIds
=
string
.
Join
(
","
,
orderCourseList
.
Select
(
x
=>
x
.
CourseId
))
});
courseModel
=
courseList
.
OrderByDescending
(
x
=>
x
.
CourseRate
).
FirstOrDefault
();
}
if
(
courseModel
!=
null
)
{
var
sellPrice
=
courseModel
.
SellPrice
*
((
100
-
(
m
.
CommissionType
==
1
?
courseModel
.
B2CRatio
:
courseModel
.
B2CReNewRatio
))
/
100
);
...
...
Edu.Module.Course/StudentBillModule.cs
View file @
3692b400
...
...
@@ -142,7 +142,7 @@ namespace Edu.Module.Course
var
guestModel
=
order_GuestRepository
.
GetEntity
(
backModel
.
GuestId
);
//orderModel.CommissionMoney = returnComissionRepository.GetOrderReturnComissionListRepositpry(new RB_Order_ReturnComission_ViewModel() { GroupId = orderModel.Group_Id, QOrderIds = orderModel.OrderId.ToString() }).Sum(x => x.CommissionMoeny);
orderModel
.
TotalClassHours
=
guestModel
.
TotalHours
;
orderModel
.
Class
_Price
=
guestModel
.
ClassUnitPrice
;
orderModel
.
Unit
_Price
=
guestModel
.
ClassUnitPrice
;
decimal
backMoney
=
orderRepository
.
CalcBackMoneyRepository
(
orderModel
,
courseModel
,
FinishHours
,
out
decimal
classHourPrice
);
var
obj
=
new
{
...
...
Edu.Repository/EduTask/RB_Education_ReceiptRepository.cs
View file @
3692b400
...
...
@@ -603,7 +603,8 @@ WHERE 1=1
var
teacherModel
=
accountRepository
.
GetAccountListExtRepository
(
new
Model
.
ViewModel
.
User
.
RB_Account_ViewModel
()
{
AccountId
=
(
classModel
?.
Teacher_Id
??
0
),
AccountType
=
Common
.
Enum
.
User
.
AccountTypeEnum
.
Teacher
AccountType
=
Common
.
Enum
.
User
.
AccountTypeEnum
.
Teacher
,
IsSelectLevelNor
=
1
})?.
FirstOrDefault
();
teacherId
=
teacherModel
?.
Id
??
0
;
}
...
...
@@ -632,7 +633,8 @@ WHERE 1=1
var
headmaster
=
accountRepository
.
GetAccountListExtRepository
(
new
Model
.
ViewModel
.
User
.
RB_Account_ViewModel
()
{
Post_Id
=
Common
.
Config
.
SchoolPostId
,
Group_Id
=
GroupId
Group_Id
=
GroupId
,
IsSelectLevelNor
=
1
})?.
FirstOrDefault
();
var
headmasterId
=
(
headmaster
?.
Id
??
0
);
return
headmasterId
;
...
...
@@ -648,7 +650,8 @@ WHERE 1=1
var
headmaster
=
accountRepository
.
GetAccountListExtRepository
(
new
Model
.
ViewModel
.
User
.
RB_Account_ViewModel
()
{
Post_Id
=
Common
.
Config
.
JiaoWuZhang
,
Group_Id
=
GroupId
Group_Id
=
GroupId
,
IsSelectLevelNor
=
1
})?.
FirstOrDefault
();
var
jiaoWuZhangId
=
(
headmaster
?.
Id
??
0
);
return
jiaoWuZhangId
;
...
...
@@ -666,7 +669,8 @@ WHERE 1=1
var
list
=
accountRepository
.
GetAccountListExtRepository
(
new
Model
.
ViewModel
.
User
.
RB_Account_ViewModel
()
{
Group_Id
=
GroupId
,
QPostIds
=
PostId
QPostIds
=
PostId
,
IsSelectLevelNor
=
1
});
if
(
list
!=
null
&&
list
.
Count
>
0
)
{
...
...
Edu.Repository/Sell/RB_OrderRepository.cs
View file @
3692b400
...
...
@@ -670,18 +670,29 @@ GROUP BY ClassId;";
/// <returns></returns>
public
decimal
CalcBackMoneyRepository
(
RB_Order
orderModel
,
RB_Course
courseModel
,
decimal
FinishHours
,
out
decimal
newClassHourPrice
)
{
newClassHourPrice
=
0
;
//课时单价
decimal
classHourPrice
=
orderModel
.
Class
_Price
;
decimal
classHourPrice
=
orderModel
.
Unit
_Price
;
newClassHourPrice
=
classHourPrice
;
//预计退款金额
decimal
backMoney
=
0
;
//违约金
//decimal breakContractPrice = (orderModel.TotalClassHours - FinishHours) * classHourPrice * Convert.ToDecimal(0.1);
//可退总金额
decimal
OrderMoney
=
orderModel
.
Income
+
orderModel
.
PlatformTax
-
orderModel
.
Refund
-
orderModel
.
CoursewareFee
-
orderModel
.
TextbookFee
;
backMoney
=
OrderMoney
/
orderModel
.
GuestNum
-
FinishHours
*
classHourPrice
;
// - breakContractPrice; 违约金 先排除
if
(
orderModel
.
CreateTime
>=
Convert
.
ToDateTime
(
"2024-09-01"
))
{
//违约金
decimal
breakContractPrice
=
(
orderModel
.
TotalClassHours
-
FinishHours
)
*
classHourPrice
*
Convert
.
ToDecimal
(
0.1
);
//可退总金额
decimal
OrderMoney
=
orderModel
.
Income
+
orderModel
.
PlatformTax
-
orderModel
.
Refund
-
orderModel
.
CoursewareFee
-
orderModel
.
TextbookFee
;
backMoney
=
OrderMoney
/
orderModel
.
GuestNum
-
FinishHours
*
classHourPrice
-
breakContractPrice
;
}
else
{
//违约金
decimal
breakContractPrice
=
(
orderModel
.
TotalClassHours
-
FinishHours
)
*
classHourPrice
*
Convert
.
ToDecimal
(
0.1
);
//可退总金额
decimal
OrderMoney
=
orderModel
.
Income
+
orderModel
.
PlatformTax
-
orderModel
.
Refund
;
backMoney
=
OrderMoney
/
orderModel
.
GuestNum
-
FinishHours
*
classHourPrice
-
breakContractPrice
;
}
return
backMoney
;
}
...
...
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