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
be661f15
Commit
be661f15
authored
Sep 06, 2024
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
cac1edbe
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
10 deletions
+48
-10
OrderModule.cs
Edu.Module.Course/OrderModule.cs
+46
-9
FinanceController.cs
Edu.WebApi/Controllers/Finance/FinanceController.cs
+2
-1
No files found.
Edu.Module.Course/OrderModule.cs
View file @
be661f15
...
...
@@ -5249,8 +5249,9 @@ namespace Edu.Module.Course
/// </summary>
/// <param name="guestId"></param>
/// <param name="money"></param>
/// <param name="isRefund">是否退费单据</param>
/// <returns></returns>
public
bool
UpdateStudentValidClassHours
(
int
guestId
,
decimal
money
)
public
bool
UpdateStudentValidClassHours
(
int
guestId
,
decimal
money
,
int
isRefund
)
{
var
gmodel
=
order_GuestRepository
.
GetEntity
(
guestId
);
if
(
gmodel
==
null
)
{
return
false
;
}
...
...
@@ -5259,16 +5260,16 @@ namespace Edu.Module.Course
if
(
omodel
.
OrderType
==
OrderTypeEnum
.
CourseOrder
)
{
//有合同
omodel
.
Income
=
money
>=
0
?
money
:
0
;
omodel
.
Income
-=
(
omodel
.
CoursewareFee
+
omodel
.
TextbookFee
);
if
(
omodel
.
Income
<
0
)
{
omodel
.
Income
=
0
;
}
decimal
HourseMoeny
=
money
>=
0
?
money
:
0
;
HourseMoeny
-=
(
omodel
.
CoursewareFee
+
omodel
.
TextbookFee
);
if
(
HourseMoeny
<
0
)
{
HourseMoeny
=
0
;
}
omodel
.
Unit_Price
=
0
;
if
(
gmodel
.
TotalHours
>
0
)
omodel
.
Unit_Price
=
gmodel
.
ClassUnitPrice
;
if
(
omodel
.
Unit_Price
<=
0
&&
gmodel
.
TotalHours
>
0
)
{
omodel
.
Unit_Price
=
Math
.
Round
((
omodel
.
PreferPrice
-
omodel
.
DiscountMoney
-
omodel
.
CoursewareFee
-
omodel
.
TextbookFee
)
/
gmodel
.
TotalHours
,
6
,
MidpointRounding
.
AwayFromZero
);
//根据合同计算
}
decimal
validClassHours
=
omodel
.
Unit_Price
>
0
?
Math
.
Round
(
omodel
.
Income
/
omodel
.
Unit_Price
,
2
,
MidpointRounding
.
AwayFromZero
)
:
0
;
decimal
validClassHours
=
omodel
.
Unit_Price
>
0
?
Math
.
Round
(
HourseMoeny
/
omodel
.
Unit_Price
,
2
,
MidpointRounding
.
AwayFromZero
)
:
0
;
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
...
...
@@ -5276,12 +5277,21 @@ namespace Edu.Module.Course
};
//HK2021-07-19新增【有效课时大于完成课时修改学员状态为正常】
string
LogContent
=
""
;
if
(
gmodel
.
CompleteHours
<=
validClassHours
)
if
(
gmodel
.
CompleteHours
<=
validClassHours
&&
gmodel
.
GuestState
!=
GuestStateEnum
.
Normal
)
{
keyValues
.
Add
(
nameof
(
RB_Order_Guest
.
GuestState
),
(
int
)
GuestStateEnum
.
Normal
);
keyValues
.
Add
(
nameof
(
RB_Order_Guest
.
DropOutRemark
),
"有效课时大于完成课时,恢复学员状态!"
);
LogContent
=
gmodel
.
GuestName
+
"有效课时大于完成课时,系统恢复学员状态!"
;
}
if
(
isRefund
==
1
)
{
if
(
gmodel
.
GuestState
!=
GuestStateEnum
.
DropOut
)
{
keyValues
.
Add
(
nameof
(
RB_Order_Guest
.
GuestState
),
(
int
)
GuestStateEnum
.
DropOut
);
}
keyValues
.
Add
(
nameof
(
RB_Order_Guest
.
TotalHours
),
validClassHours
);
LogContent
+=
gmodel
.
GuestName
+
$"学员退费,修改学员状态为退学!总课时由【
{
gmodel
.
TotalHours
}
】变更为【
{
validClassHours
}
】"
;
}
if
(!
string
.
IsNullOrEmpty
(
LogContent
))
{
changeLogRepository
.
Insert
(
new
Model
.
Entity
.
Log
.
RB_User_ChangeLog
()
...
...
@@ -5305,7 +5315,34 @@ namespace Edu.Module.Course
OperatorEnum
=
OperatorEnum
.
Equal
}
};
order_GuestRepository
.
Update
(
keyValues
,
wheres
);
bool
gflag
=
order_GuestRepository
.
Update
(
keyValues
,
wheres
);
if
(
isRefund
==
1
&&
gflag
)
{
decimal
NewPreferPrice
=
omodel
.
Income
+
omodel
.
PlatformTax
-
omodel
.
Refund
+
omodel
.
DiscountMoney
;
Dictionary
<
string
,
object
>
keyValues1
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Order
.
OrderState
),(
int
)
OrderStateEnum
.
DropOut
},
{
nameof
(
RB_Order
.
PreferPrice
),
NewPreferPrice
},
};
List
<
WhereHelper
>
wheres1
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Order
.
OrderId
),
FiledValue
=
omodel
.
OrderId
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
orderRepository
.
Update
(
keyValues1
,
wheres1
);
changeLogRepository
.
Insert
(
new
Model
.
Entity
.
Log
.
RB_User_ChangeLog
()
{
Id
=
0
,
Type
=
2
,
CreateBy
=
omodel
.
CreateBy
,
CreateTime
=
DateTime
.
Now
,
Group_Id
=
omodel
.
Group_Id
,
LogContent
=
$"学员退费,自动更新订单应收由【
{
omodel
.
PreferPrice
}
】修改为【
{
NewPreferPrice
}
】"
,
School_Id
=
omodel
.
School_Id
,
SourceId
=
omodel
.
OrderId
});
}
}
//培训/留学订单 直接验证 订单的应收 大于等于实收
...
...
Edu.WebApi/Controllers/Finance/FinanceController.cs
View file @
be661f15
...
...
@@ -1781,8 +1781,9 @@ namespace Edu.WebApi.Controllers.Finance
JObject
jObj
=
JObject
.
Parse
(
RequestParm
.
Msg
.
ToString
());
int
GuestId
=
jObj
.
GetInt
(
"GuestId"
,
0
);
decimal
Money
=
jObj
.
GetDecimal
(
"Money"
);
int
IsRefund
=
jObj
.
GetInt
(
"IsRefund"
,
0
);
//是否退费单据 1是
bool
flag
=
orderModule
.
UpdateStudentValidClassHours
(
GuestId
,
Money
);
bool
flag
=
orderModule
.
UpdateStudentValidClassHours
(
GuestId
,
Money
,
IsRefund
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
...
...
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