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
0175aaa5
Commit
0175aaa5
authored
Apr 08, 2022
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
3263318e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
139 additions
and
50 deletions
+139
-50
OrderModule.cs
Edu.Module.Course/OrderModule.cs
+86
-49
RB_Student_OrderGuestRepository.cs
Edu.Repository/User/RB_Student_OrderGuestRepository.cs
+53
-1
No files found.
Edu.Module.Course/OrderModule.cs
View file @
0175aaa5
...
...
@@ -1155,6 +1155,21 @@ namespace Edu.Module.Course
SaleRemark
=
demodel
.
SaleRemark
;
}
#
endregion
if
(
flag
&&
demodel
.
GuestNum
==
1
&&
(
orderModel
.
PreferPrice
!=
demodel
.
PreferPrice
||
orderModel
.
DiscountMoney
!=
demodel
.
DiscountMoney
))
{
if
(
demodel
.
PreferPrice
-
demodel
.
DiscountMoney
<=
orderModel
.
Income
+
orderModel
.
PlatformTax
-
orderModel
.
Refund
&&
orderModel
.
Income
>
0
)
{
//帐平
int
guestId
=
glist
.
FirstOrDefault
().
Id
;
var
studentMapping
=
student_OrderGuestRepository
.
GetList
(
new
RB_Student_OrderGuest_ViewModel
()
{
GuestId
=
guestId
});
if
(
studentMapping
.
Any
())
{
UpdateReturnMoneyStatus
(
studentMapping
.
First
().
Student_Id
,
demodel
.
OrderId
);
}
}
}
}
else
{
...
...
@@ -1809,6 +1824,24 @@ namespace Edu.Module.Course
LogContent
+=
$",销售备注由【
{
orderModel
.
SaleRemark
}
】修改为【
{
demodel
.
SaleRemark
}
】"
;
SaleRemark
=
demodel
.
SaleRemark
;
}
if
(
demodel
.
GuestNum
==
1
&&
(
orderModel
.
PreferPrice
!=
demodel
.
PreferPrice
||
orderModel
.
DiscountMoney
!=
demodel
.
DiscountMoney
))
{
if
(
demodel
.
PreferPrice
-
demodel
.
DiscountMoney
<=
orderModel
.
Income
+
orderModel
.
PlatformTax
-
orderModel
.
Refund
&&
orderModel
.
Income
>
0
)
{
//帐平
var
glist
=
order_GuestRepository
.
GetOrderGuestListRepository
(
new
RB_Order_Guest_ViewModel
()
{
Group_Id
=
demodel
.
Group_Id
,
OrderId
=
demodel
.
OrderId
,
GuestState
=
GuestStateEnum
.
Normal
});
int
guestId
=
glist
.
FirstOrDefault
().
Id
;
var
studentMapping
=
student_OrderGuestRepository
.
GetList
(
new
RB_Student_OrderGuest_ViewModel
()
{
GuestId
=
guestId
});
if
(
studentMapping
.
Any
())
{
UpdateReturnMoneyStatus
(
studentMapping
.
First
().
Student_Id
,
demodel
.
OrderId
);
}
}
}
}
}
else
...
...
@@ -3960,52 +3993,56 @@ namespace Edu.Module.Course
{
var
gmodel
=
order_GuestRepository
.
GetEntity
(
guestId
);
if
(
gmodel
==
null
)
{
return
false
;
}
var
cmodel
=
education_ContractRepository
.
GetList
(
new
RB_Education_Contract_ViewModel
()
{
Group_Id
=
gmodel
.
Group_Id
,
GuestId
=
gmodel
.
Id
,
Status
=
-
1
}).
Where
(
x
=>
x
.
Status
!=
4
).
FirstOrDefault
();
if
(
cmodel
!=
null
)
var
omodel
=
orderRepository
.
GetEntity
(
gmodel
.
OrderId
);
if
(
omodel
==
null
)
{
return
false
;
}
if
(
omodel
.
OrderType
==
OrderTypeEnum
.
CourseOrder
)
{
//有合同
cmodel
.
Income
=
money
>=
0
?
money
:
0
;
cmodel
.
Unit_Price
=
0
;
if
(
cmodel
.
TotalClassHours
>
0
)
var
cmodel
=
education_ContractRepository
.
GetList
(
new
RB_Education_Contract_ViewModel
()
{
Group_Id
=
gmodel
.
Group_Id
,
GuestId
=
gmodel
.
Id
,
Status
=
-
1
}).
Where
(
x
=>
x
.
Status
!=
4
).
FirstOrDefault
();
if
(
cmodel
!=
null
)
{
if
(
cmodel
.
TotalDiscountMoney
>
0
)
//有合同
cmodel
.
Income
=
money
>=
0
?
money
:
0
;
cmodel
.
Unit_Price
=
0
;
if
(
cmodel
.
TotalClassHours
>
0
)
{
cmodel
.
Unit_Price
=
Math
.
Round
((
cmodel
.
TotalCourseFee
-
(
cmodel
.
TotalDiscountMoney
/
cmodel
.
TotalSub
)
*
cmodel
.
TotalCourseFee
)
/
cmodel
.
TotalClassHours
,
6
,
MidpointRounding
.
AwayFromZero
);
//根据合同计算
}
else
{
cmodel
.
Unit_Price
=
Math
.
Round
(
cmodel
.
TotalCourseFee
/
cmodel
.
TotalClassHours
,
6
,
MidpointRounding
.
AwayFromZero
);
//根据合同计算
if
(
cmodel
.
TotalDiscountMoney
>
0
)
{
cmodel
.
Unit_Price
=
Math
.
Round
((
cmodel
.
TotalCourseFee
-
(
cmodel
.
TotalDiscountMoney
/
cmodel
.
TotalSub
)
*
cmodel
.
TotalCourseFee
)
/
cmodel
.
TotalClassHours
,
6
,
MidpointRounding
.
AwayFromZero
);
//根据合同计算
}
else
{
cmodel
.
Unit_Price
=
Math
.
Round
(
cmodel
.
TotalCourseFee
/
cmodel
.
TotalClassHours
,
6
,
MidpointRounding
.
AwayFromZero
);
//根据合同计算
}
}
}
decimal
validClassHours
=
cmodel
.
Unit_Price
>
0
?
Math
.
Round
(
cmodel
.
Income
/
cmodel
.
Unit_Price
,
2
,
MidpointRounding
.
AwayFromZero
)
:
0
;
decimal
validClassHours
=
cmodel
.
Unit_Price
>
0
?
Math
.
Round
(
cmodel
.
Income
/
cmodel
.
Unit_Price
,
2
,
MidpointRounding
.
AwayFromZero
)
:
0
;
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Order_Guest
.
ValidClassHours
),
validClassHours
}
};
//HK2021-07-19新增【有效课时大于完成课时修改学员状态为正常】
string
LogContent
=
""
;
if
(
gmodel
.
CompleteHours
<=
validClassHours
)
{
keyValues
.
Add
(
nameof
(
RB_Order_Guest
.
GuestState
),
(
int
)
GuestStateEnum
.
Normal
);
keyValues
.
Add
(
nameof
(
RB_Order_Guest
.
DropOutRemark
),
"有效课时大于完成课时,恢复学员状态!"
);
LogContent
=
gmodel
.
GuestName
+
"有效课时大于完成课时,系统恢复学员状态!"
;
}
if
(!
string
.
IsNullOrEmpty
(
LogContent
))
{
changeLogRepository
.
Insert
(
new
Model
.
Entity
.
Log
.
RB_User_ChangeLog
()
//HK2021-07-19新增【有效课时大于完成课时修改学员状态为正常】
string
LogContent
=
""
;
if
(
gmodel
.
CompleteHours
<=
validClassHours
)
{
Id
=
0
,
Type
=
3
,
CreateBy
=
gmodel
.
CreateBy
,
CreateTime
=
DateTime
.
Now
,
Group_Id
=
gmodel
.
Group_Id
,
LogContent
=
LogContent
,
School_Id
=
gmodel
.
School_Id
,
SourceId
=
gmodel
.
Id
});
}
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
keyValues
.
Add
(
nameof
(
RB_Order_Guest
.
GuestState
),
(
int
)
GuestStateEnum
.
Normal
);
keyValues
.
Add
(
nameof
(
RB_Order_Guest
.
DropOutRemark
),
"有效课时大于完成课时,恢复学员状态!"
);
LogContent
=
gmodel
.
GuestName
+
"有效课时大于完成课时,系统恢复学员状态!"
;
}
if
(!
string
.
IsNullOrEmpty
(
LogContent
))
{
changeLogRepository
.
Insert
(
new
Model
.
Entity
.
Log
.
RB_User_ChangeLog
()
{
Id
=
0
,
Type
=
3
,
CreateBy
=
gmodel
.
CreateBy
,
CreateTime
=
DateTime
.
Now
,
Group_Id
=
gmodel
.
Group_Id
,
LogContent
=
LogContent
,
School_Id
=
gmodel
.
School_Id
,
SourceId
=
gmodel
.
Id
});
}
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
()
{
...
...
@@ -4014,21 +4051,21 @@ namespace Edu.Module.Course
OperatorEnum
=
OperatorEnum
.
Equal
}
};
order_GuestRepository
.
Update
(
keyValues
,
wheres
);
//如果有效课时与总课时相等代表款已收完,更新佣金为可发放状态
if
(
gmodel
.
TotalHours
<=
validClassHours
)
order_GuestRepository
.
Update
(
keyValues
,
wheres
);
}
}
//培训/留学订单 直接验证 订单的应收 大于等于实收
if
(
omodel
.
PreferPrice
-
omodel
.
DiscountMoney
<=
money
&&
money
>
0
)
{
var
studentMapping
=
student_OrderGuestRepository
.
GetList
(
new
RB_Student_OrderGuest_ViewModel
()
{
var
studentMapping
=
student_OrderGuestRepository
.
GetStrOrderGuestListRepository
(
new
RB_Student_OrderGuest_ViewModel
()
{
GuestId
=
guestId
});
if
(
studentMapping
.
Any
())
{
UpdateReturnMoneyStatus
(
studentMapping
.
First
().
Student_Id
,
gmodel
.
OrderId
);
}
GuestId
=
guestId
});
if
(
studentMapping
.
Any
())
{
UpdateReturnMoneyStatus
(
studentMapping
.
First
().
Student_Id
,
gmodel
.
OrderId
);
}
}
return
true
;
}
...
...
Edu.Repository/User/RB_Student_OrderGuestRepository.cs
View file @
0175aaa5
...
...
@@ -227,7 +227,59 @@ WHERE 1=1
}
}
return
GetPage
<
RB_Student_OrderGuest_ViewModel
>(
pageIndex
,
pageSize
,
out
rowsCount
,
builder
.
ToString
()).
ToList
();
}
}
/// <summary>
/// 获取列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Student_OrderGuest_ViewModel
>
GetList
(
RB_Student_OrderGuest_ViewModel
query
)
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@"
SELECT A.*,IFNULL(C.JoinType,0) AS StuJoinType,IFNULL(D.GuestState,0) AS StuGuestState
,C.OrderState,IFNULL(D.TotalHours,0) AS TotalHours,IFNULL(D.CompleteHours,0) AS CompleteHours,IFNULL(D.RenewState,0) AS RenewState
FROM RB_Student_OrderGuest AS A
INNER JOIN rb_order AS C ON A.OrderId=C.OrderId
INNER JOIN rb_order_guest AS D ON A.GuestId=D.Id
WHERE 1=1 AND C.OrderState<>3 AND D.Status=0
"
);
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Student_OrderGuest_ViewModel
.
Status
),
(
int
)
DateStateEnum
.
Normal
);
if
(
query
!=
null
)
{
if
(
query
.
ClassId
>
0
)
{
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Student_OrderGuest_ViewModel
.
ClassId
),
query
.
ClassId
);
}
if
(
query
.
OrderId
>
0
)
{
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Student_OrderGuest_ViewModel
.
OrderId
),
query
.
OrderId
);
}
if
(!
string
.
IsNullOrEmpty
(
query
.
QOrderIds
))
{
builder
.
AppendFormat
(
" AND A.{0} IN({1}) "
,
nameof
(
RB_Student_OrderGuest_ViewModel
.
OrderId
),
query
.
QOrderIds
);
}
if
(
query
.
GuestId
>
0
)
{
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Student_OrderGuest_ViewModel
.
GuestId
),
query
.
GuestId
);
}
if
(
query
.
Student_Id
>
0
)
{
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Student_OrderGuest_ViewModel
.
Student_Id
),
query
.
Student_Id
);
}
if
(!
string
.
IsNullOrEmpty
(
query
.
QStudentIds
))
{
builder
.
AppendFormat
(
" AND A.{0} IN({1}) "
,
nameof
(
RB_Student_OrderGuest_ViewModel
.
Student_Id
),
query
.
QStudentIds
);
}
if
(
query
.
Account_Id
>
0
)
{
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Student_OrderGuest_ViewModel
.
Account_Id
),
query
.
Account_Id
);
}
}
return
Get
<
RB_Student_OrderGuest_ViewModel
>(
builder
.
ToString
()).
ToList
();
}
/// <summary>
/// 根据退课编号查询学员信息
...
...
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