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
e0e8d0dd
Commit
e0e8d0dd
authored
Sep 10, 2024
by
吴春
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复修改订单报错
parent
3dfe59a3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
5 deletions
+19
-5
OrderModule.cs
Edu.Module.Course/OrderModule.cs
+19
-5
No files found.
Edu.Module.Course/OrderModule.cs
View file @
e0e8d0dd
...
...
@@ -2201,10 +2201,16 @@ namespace Edu.Module.Course
{
nameof
(
RB_Order_ViewModel
.
UpOrderId
),
demodel
.
UpOrderId
},
{
nameof
(
RB_Order_ViewModel
.
CustomerId
),
demodel
.
CustomerId
},
{
nameof
(
RB_Order_ViewModel
.
CourseConsultantId
),
demodel
.
CourseConsultantId
},
{
nameof
(
RB_Order_ViewModel
.
TotalClassHours
),
demodel
.
TotalClassHours
},
{
nameof
(
RB_Order_ViewModel
.
TextbookFee
),
demodel
.
TextbookFee
},
{
nameof
(
RB_Order_ViewModel
.
CoursewareFee
),
demodel
.
CoursewareFee
},
};
if
(
demodel
.
TotalClassHours
==
0
)
//兼容之前的数据
{
demodel
.
TotalClassHours
=
(
glist
?.
FirstOrDefault
()?.
TotalHours
??
0
);
}
keyValues
.
Add
(
nameof
(
RB_Order_ViewModel
.
TotalClassHours
),
demodel
.
TotalClassHours
);
flag
=
orderRepository
.
Update
(
keyValues
,
new
WhereHelper
(
nameof
(
RB_Order_ViewModel
.
OrderId
),
demodel
.
OrderId
));
//更新订单信息
#
region
更新
Order_Guest
中的有效课时和课时单价
2024
-
09
-
06
add
by
:
W
...
...
@@ -2212,10 +2218,18 @@ namespace Edu.Module.Course
{
foreach
(
var
item
in
glist
)
{
item
.
TotalHours
=
demodel
.
TotalClassHours
;
item
.
ClassUnitPrice
=
Math
.
Round
(((
demodel
.
PreferPrice
-
demodel
.
TextbookFee
-
demodel
.
CoursewareFee
)
/
demodel
.
TotalClassHours
),
6
);
//课时单价 (应收总金额-教材费-课件费)/总课时
decimal
validClassHours
=
Math
.
Round
(((
demodel
.
Income
+
demodel
.
PlatformTax
-
demodel
.
Refund
-
demodel
.
TextbookFee
-
demodel
.
CoursewareFee
)
/
item
.
ClassUnitPrice
),
2
);
item
.
ValidClassHours
=
validClassHours
<
item
.
CompleteHours
?
item
.
CompleteHours
:
validClassHours
;
//有效课时 = (实收+手续费-退款 - 课件费 - 教材费)/课时单价 ; 如果 有效课时 < 已完成课时 ,有效课时 = 已完成课时
item
.
TotalHours
=
demodel
.
TotalClassHours
==
0
?
item
.
TotalHours
:
demodel
.
TotalClassHours
;
if
(
item
.
TotalHours
==
0
)
{
item
.
ClassUnitPrice
=
0
;
item
.
ValidClassHours
=
0
;
}
else
{
item
.
ClassUnitPrice
=
Math
.
Round
(((
demodel
.
PreferPrice
-
demodel
.
TextbookFee
-
demodel
.
CoursewareFee
)
/
demodel
.
TotalClassHours
),
6
);
//课时单价 (应收总金额-教材费-课件费)/总课时
decimal
validClassHours
=
Math
.
Round
(((
demodel
.
Income
+
demodel
.
PlatformTax
-
demodel
.
Refund
-
demodel
.
TextbookFee
-
demodel
.
CoursewareFee
)
/
item
.
ClassUnitPrice
),
2
);
item
.
ValidClassHours
=
validClassHours
<
item
.
CompleteHours
?
item
.
CompleteHours
:
validClassHours
;
//有效课时 = (实收+手续费-退款 - 课件费 - 教材费)/课时单价 ; 如果 有效课时 < 已完成课时 ,有效课时 = 已完成课时
}
Dictionary
<
string
,
object
>
keyValuesOG
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Order_Guest_ViewModel
.
TotalHours
),
item
.
TotalHours
},
...
...
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