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
0a3380d6
Commit
0a3380d6
authored
Dec 22, 2020
by
吴春
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交代码
parent
62988872
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
126 additions
and
62 deletions
+126
-62
TeachingRewardsModule.cs
Edu.Module.Course/TeachingRewardsModule.cs
+105
-49
FinanceController.cs
Edu.WebApi/Controllers/Finance/FinanceController.cs
+21
-13
No files found.
Edu.Module.Course/TeachingRewardsModule.cs
View file @
0a3380d6
This diff is collapsed.
Click to expand it.
Edu.WebApi/Controllers/Finance/FinanceController.cs
View file @
0a3380d6
...
...
@@ -27,6 +27,7 @@ namespace Edu.WebApi.Controllers.Finance
private
readonly
FinanceModule
financeModule
=
AOP
.
AOPHelper
.
CreateAOPObject
<
FinanceModule
>();
private
readonly
OrderModule
orderModule
=
AOP
.
AOPHelper
.
CreateAOPObject
<
OrderModule
>();
private
readonly
ClassModule
classModule
=
AOP
.
AOPHelper
.
CreateAOPObject
<
ClassModule
>();
private
readonly
TeachingRewardsModule
teachingRewardsModule
=
AOP
.
AOPHelper
.
CreateAOPObject
<
TeachingRewardsModule
>();
/// <summary>
/// 获取班级收支明细
...
...
@@ -48,7 +49,7 @@ namespace Edu.WebApi.Controllers.Finance
//收入
decimal
IncomeReceive
=
0
;
//应收
decimal
IncomeActual
=
0
;
//实收
var
orderList
=
orderModule
.
GetClassOrderList_V2
(
classId
,
base
.
UserInfo
.
Group_Id
);
var
orderList
=
orderModule
.
GetClassOrderList_V2
(
classId
,
base
.
UserInfo
.
Group_Id
)
.
Where
(
x
=>
(
int
)
x
.
OrderState
<
3
)
;
IncomeReceive
=
(
orderList
!=
null
&&
orderList
.
Any
())
?
orderList
.
Sum
(
x
=>
x
.
PreferPrice
)
:
0
;
IncomeActual
=
(
orderList
!=
null
&&
orderList
.
Any
())
?
orderList
.
Sum
(
x
=>
x
.
Income
)
:
0
;
...
...
@@ -60,19 +61,22 @@ namespace Edu.WebApi.Controllers.Finance
//支出
decimal
PayReceive
=
0
;
//应付
decimal
PayActual
=
0
;
//实付
PayReceive
=
(
financeList
!=
null
&&
financeList
.
Any
())
?
financeList
.
Where
(
x
=>
x
.
Type
==
WFTempLateClassEnum
.
OUT
&&
x
.
OrderID
<=
0
).
Sum
(
x
=>
x
.
Money
??
0
)
:
0
;
PayActual
=
(
financeList
!=
null
&&
financeList
.
Any
())
?
financeList
.
Where
(
x
=>
x
.
Type
==
WFTempLateClassEnum
.
OUT
&&
x
.
OrderID
<=
0
).
Sum
(
x
=>
x
.
PayMoney
??
0
)
:
0
;
PayReceive
=
(
financeList
!=
null
&&
financeList
.
Any
())
?
financeList
.
Where
(
x
=>
x
.
Type
==
WFTempLateClassEnum
.
OUT
).
Sum
(
x
=>
x
.
Money
??
0
)
:
0
;
PayActual
=
(
financeList
!=
null
&&
financeList
.
Any
())
?
financeList
.
Where
(
x
=>
x
.
Type
==
WFTempLateClassEnum
.
OUT
).
Sum
(
x
=>
x
.
PayMoney
??
0
)
:
0
;
//利润
decimal
ProfitActual
=
0
;
//实际利润
decimal
ProfitNow
=
0
;
//当前利润
ProfitActual
=
(
Income
Actual
+
OtherIncomeActual
)
-
PayReceive
;
ProfitActual
=
(
Income
Receive
+
OtherIncomeReceive
)
-
PayReceive
;
ProfitNow
=
(
IncomeActual
+
OtherIncomeActual
)
-
PayActual
;
//提成
decimal
SaleCommission
=
0
;
//销售提成
decimal
TeacherProfitNow
=
0
;
//老师提成
decimal
MeritsProfit
=
0
;
//绩效提成
decimal
SaleCommission
=
(
orderList
!=
null
&&
orderList
.
Any
())
?
orderList
.
Sum
(
x
=>
x
.
CommissionMoney
)
:
0
;
;
//销售提成
var
teacherProfitList
=
teachingRewardsModule
.
GetBonusDetailList
(
new
RB_Teaching_BonusDetail_ViewModel
{
Group_Id
=
base
.
UserInfo
.
Group_Id
,
ClassId
=
classId
,
School_Id
=
schoolId
});
decimal
TeacherProfitNow
=
(
teacherProfitList
!=
null
&&
teacherProfitList
.
Any
())
?
teacherProfitList
.
Sum
(
x
=>
x
.
Money
)
:
0
;
//老师提成
var
meritsProfitList
=
teachingRewardsModule
.
GetTeachingPerfList
(
new
RB_Teaching_Perf_ViewModel
{
Group_Id
=
base
.
UserInfo
.
Group_Id
,
ClassId
=
classId
,
School_Id
=
schoolId
});
decimal
MeritsProfit
=
(
meritsProfitList
!=
null
&&
meritsProfitList
.
Any
())
?
(
meritsProfitList
.
OrderByDescending
(
x
=>
x
.
CreateTime
).
FirstOrDefault
()?.
Money
??
0
)
:
0
;
//绩效提成
var
classInfo
=
classModule
.
GetClassAndCourseListRepository
(
new
Model
.
ViewModel
.
Course
.
RB_Class_ViewModel
{
Group_Id
=
base
.
UserInfo
.
Group_Id
,
ClassId
=
classId
,
School_Id
=
schoolId
}).
FirstOrDefault
();
var
recultFiniceList
=
financeList
.
Select
(
x
=>
new
...
...
@@ -169,19 +173,23 @@ namespace Edu.WebApi.Controllers.Finance
//支出
decimal
PayReceive
=
0
;
//应付
decimal
PayActual
=
0
;
//实付
PayReceive
=
(
financeList
!=
null
&&
financeList
.
Any
())
?
financeList
.
Where
(
x
=>
x
.
Type
==
WFTempLateClassEnum
.
OUT
&&
x
.
OrderID
<=
0
).
Sum
(
x
=>
x
.
Money
??
0
)
:
0
;
PayActual
=
(
financeList
!=
null
&&
financeList
.
Any
())
?
financeList
.
Where
(
x
=>
x
.
Type
==
WFTempLateClassEnum
.
OUT
&&
x
.
OrderID
<=
0
).
Sum
(
x
=>
x
.
PayMoney
??
0
)
:
0
;
PayReceive
=
(
financeList
!=
null
&&
financeList
.
Any
())
?
financeList
.
Where
(
x
=>
x
.
Type
==
WFTempLateClassEnum
.
OUT
).
Sum
(
x
=>
x
.
Money
??
0
)
:
0
;
PayActual
=
(
financeList
!=
null
&&
financeList
.
Any
())
?
financeList
.
Where
(
x
=>
x
.
Type
==
WFTempLateClassEnum
.
OUT
).
Sum
(
x
=>
x
.
PayMoney
??
0
)
:
0
;
//利润
decimal
ProfitActual
=
0
;
//实际利润
decimal
ProfitNow
=
0
;
//当前利润
ProfitActual
=
(
Income
Actual
+
OtherIncomeActual
)
-
PayReceive
;
ProfitActual
=
(
Income
Receive
+
OtherIncomeReceive
)
-
PayReceive
;
ProfitNow
=
(
IncomeActual
+
OtherIncomeActual
)
-
PayActual
;
//提成
decimal
SaleCommission
=
0
;
//销售提成
decimal
TeacherProfitNow
=
0
;
//老师提成
decimal
MeritsProfit
=
0
;
//绩效提成
//提成
decimal
SaleCommission
=
(
orderList
!=
null
&&
orderList
.
Any
())
?
orderList
.
Sum
(
x
=>
x
.
CommissionMoney
)
:
0
;
;
//销售提成
var
teacherProfitList
=
teachingRewardsModule
.
GetBonusDetailList
(
new
RB_Teaching_BonusDetail_ViewModel
{
Group_Id
=
base
.
UserInfo
.
Group_Id
,
ClassId
=
classId
});
decimal
TeacherProfitNow
=
(
teacherProfitList
!=
null
&&
teacherProfitList
.
Any
())
?
teacherProfitList
.
Sum
(
x
=>
x
.
Money
)
:
0
;
//老师提成
var
meritsProfitList
=
teachingRewardsModule
.
GetTeachingPerfList
(
new
RB_Teaching_Perf_ViewModel
{
Group_Id
=
base
.
UserInfo
.
Group_Id
,
ClassId
=
classId
});
decimal
MeritsProfit
=
(
meritsProfitList
!=
null
&&
meritsProfitList
.
Any
())
?
(
meritsProfitList
.
OrderByDescending
(
x
=>
x
.
CreateTime
).
FirstOrDefault
()?.
Money
??
0
)
:
0
;
//绩效提成
List
<
RB_Finance_Extend
>
financeReciveList
=
financeList
.
Where
(
t
=>
t
.
Type
==
WFTempLateClassEnum
.
IN
).
ToList
();
List
<
RB_Finance_Extend
>
financePayList
=
financeList
.
Where
(
t
=>
t
.
Type
==
WFTempLateClassEnum
.
OUT
).
ToList
();
//var recultFiniceList = financeList.Select(x => new
...
...
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