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
bbd50152
Commit
bbd50152
authored
Apr 06, 2022
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
4085149a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
191 additions
and
135 deletions
+191
-135
OrderModule.cs
Edu.Module.Course/OrderModule.cs
+9
-0
SellAchievementsModule.cs
Edu.Module.Course/SellAchievementsModule.cs
+165
-129
SellCommissionModule.cs
Edu.Module.Course/SellCommissionModule.cs
+5
-0
RB_OrderRepository.cs
Edu.Repository/Sell/RB_OrderRepository.cs
+8
-5
OrderController.cs
Edu.WebApi/Controllers/Course/OrderController.cs
+4
-1
No files found.
Edu.Module.Course/OrderModule.cs
View file @
bbd50152
...
...
@@ -3394,6 +3394,8 @@ namespace Edu.Module.Course
var
guestList
=
order_GuestRepository
.
GetOrderGuestListRepository
(
new
RB_Order_Guest_ViewModel
()
{
OrderIds
=
orderIds
});
//获取合同列表
var
clist
=
education_ContractRepository
.
GetList
(
new
RB_Education_Contract_ViewModel
()
{
Group_Id
=
demodel
.
Group_Id
,
OrderIds
=
orderIds
,
Status
=
-
1
}).
Where
(
x
=>
x
.
Status
!=
4
).
ToList
();
//获取新的业绩提成
var
achList
=
sell_Achievements_EmpRepository
.
GetList
(
new
RB_Sell_Achievements_Emp_ViewModel
()
{
Group_Id
=
demodel
.
Group_Id
,
OrderIds
=
orderIds
});
foreach
(
var
item
in
orderList
)
{
item
.
SaleRemarkList
=
remarkList
.
Where
(
x
=>
x
.
OrderId
==
item
.
OrderId
&&
x
.
Type
==
1
).
ToList
();
...
...
@@ -3417,6 +3419,13 @@ namespace Edu.Module.Course
});
}
}
var
achievementList
=
achList
.
Where
(
x
=>
x
.
OrderId
==
item
.
OrderId
).
ToList
();
if
(
achievementList
.
Any
())
{
item
.
CommissionMoney
=
achievementList
.
Sum
(
x
=>
x
.
GiveOutMoney
);
item
.
YFCommission
=
achievementList
.
Sum
(
x
=>
x
.
PushMoney
);
}
}
}
return
orderList
;
...
...
Edu.Module.Course/SellAchievementsModule.cs
View file @
bbd50152
This diff is collapsed.
Click to expand it.
Edu.Module.Course/SellCommissionModule.cs
View file @
bbd50152
...
...
@@ -571,6 +571,8 @@ namespace Edu.Module.Course
//查询这几个学生累计课时
decimal
TotalLearn
=
CheckList
.
Where
(
x
=>
x
.
OrderId
==
item
.
OrderId
&&
x
.
MonthDate
<=
Convert
.
ToDateTime
(
EDate
)).
Sum
(
x
=>
x
.
CurrentDeductionHours
);
//累计消费课时 (要查询当前发放提成日期) ld 07-02调整
decimal
TotalHours
=
g3list
.
Sum
(
x
=>
x
.
TotalHours
);
// 直接根据学生表 总课时计算 (必须签到课时 = 总课时 才发完最后一个月的)
TotalLearn
=
TotalHours
;
// 2022 -03-31 次月全额发放提成 ld;
#
endregion
#
region
额外提成
...
...
@@ -1558,6 +1560,9 @@ namespace Edu.Module.Course
decimal
currentHours
=
CheckList
.
Where
(
x
=>
x
.
OrderId
==
item
.
OrderId
&&
x
.
MonthDate
>=
STime
&&
x
.
MonthDate
<=
ETime
).
Sum
(
x
=>
x
.
CurrentDeductionHours
);
//当期累计消费课时
decimal
currentTHours
=
CheckList
.
Where
(
x
=>
x
.
OrderId
==
item
.
OrderId
&&
x
.
MonthDate
<=
ETime
).
Sum
(
x
=>
x
.
CurrentDeductionHours
);
currentTHours
=
TotalHours
;
// 2022 -04-06 次月全额发放提成 ld;
if
(
currentTHours
>=
TotalHours
)
{
//课已完成 发放剩余所有的提成
...
...
Edu.Repository/Sell/RB_OrderRepository.cs
View file @
bbd50152
...
...
@@ -631,9 +631,11 @@ SELECT SUM(CASE WHEN o.OrderState <> 3 THEN o.PreferPrice ELSE 0 END) AS PreferP
SUM(CASE WHEN o.OrderState <> 3 THEN o.PreferPrice - o.Income + o.Refund - o.DiscountMoney - o.PlatformTax ELSE 0 END) AS DueInMoney,
SUM(CASE WHEN o.OrderState <> 3 THEN o.GuestNum ELSE 0 END) AS GuestNum,
SUM(CASE WHEN o.OrderState = 3 THEN o.GuestNum ELSE 0 END) AS CancelNum,
SUM(CASE WHEN o.CommissionMoney <> -1 AND o.OrderState <> 3 THEN o.CommissionMoney ELSE 0 END) AS CommissionMoney,
SUM(CASE WHEN ea.GiveOutMoney > 0 THEN ea.GiveOutMoney ELSE
CASE WHEN o.CommissionMoney <> -1 AND o.OrderState <> 3 THEN o.CommissionMoney ELSE 0 END END) AS CommissionMoney,
SUM(CASE WHEN o.OrderState <> 3 THEN o.ExtraRewardMoney - o.ExtraDeductMoney ELSE 0 END) AS ExtraRewardMoney
FROM RB_Order o left join rb_studyabroad c on o.SourceId = c.Id
LEFT JOIN (SELECT em.OrderId,SUM(em.GiveOutMoney) as GiveOutMoney FROM rb_sell_achievements_emp em GROUP BY em.OrderId) ea on ea.OrderId = o.OrderId
WHERE
{
where
}
"
;
return
Get
<
RB_Order_ViewModel
>(
sql
).
FirstOrDefault
();
...
...
@@ -1175,20 +1177,21 @@ ORDER BY {orderBy}
{
if
(
courseType
==
1
)
{
where
+=
$" and
c.CourseId in (
{
courseIds
}
)"
;
where
+=
$" and
(o.CourseId in (
{
courseIds
}
) or o.OrderType =2
)"
;
}
else
{
where
+=
$" and
c
.CourseId not in (
{
courseIds
}
)"
;
where
+=
$" and
o
.CourseId not in (
{
courseIds
}
)"
;
}
}
if
(!
string
.
IsNullOrEmpty
(
schoolIds
))
{
where
+=
$" and
c.School_Id in (
{
schoolIds
}
)
"
;
where
+=
$" and
(c.School_Id in (
{
schoolIds
}
) or (s.School_Id in (
{
schoolIds
}
)))
"
;
}
string
sql
=
$@"SELECT o.*,
c.School_Id
as ClassSchoolId FROM rb_order o
string
sql
=
$@"SELECT o.*,
IF(o.OrderType =1,c.School_Id,s.School_Id)
as ClassSchoolId FROM rb_order o
left join rb_class c on o.ClassId = c.ClassId
left join rb_studyabroad s on o.SourceId = s.Id
left join rb_sell_achievements_emp e on o.OrderId = e.OrderId
WHERE o.Group_Id =
{
group_Id
}
and o.OrderState =1 and o.Income >0 and o.CreateTime >='
{
sDate
}
' and o.CreateTime <= '
{
eDate
}
23:59:59'
and e.Id is null
...
...
Edu.WebApi/Controllers/Course/OrderController.cs
View file @
bbd50152
...
...
@@ -2100,10 +2100,13 @@ namespace Edu.WebApi.Controllers.Course
CreateByName
=
UserReidsCache
.
GetUserLoginInfo
(
x
.
CreateBy
)?.
AccountName
??
""
,
x
.
CourseConsultantId
,
ConsultantName
=
UserReidsCache
.
GetUserLoginInfo
(
x
.
CourseConsultantId
)?.
AccountName
??
""
,
IsAchievements
=
x
.
YFCommission
>
0
?
1
:
2
,
YFCommissionMoney
=
x
.
YFCommission
>
0
?
x
.
YFCommission
:
GetOrderYFCommission
(
x
),
x
.
CommissionMoney
,
x
.
ExtraCommissionMoney
,
x
.
ExtraRewardMoney
,
x
.
ExtraDeductMoney
,
x
.
IsCommissionGive
,
IsCommissionGive
=
x
.
YFCommission
>
0
?
1
:
x
.
IsCommissionGive
,
CreateTime
=
x
.
CreateTime
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
),
x
.
SaleRemark
,
x
.
TeacherRemark
,
...
...
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