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
Show 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
...
@@ -103,19 +103,22 @@ namespace Edu.Module.Course
...
@@ -103,19 +103,22 @@ namespace Edu.Module.Course
/// <param name="demodel"></param>
/// <param name="demodel"></param>
/// <param name="userInfo"></param>
/// <param name="userInfo"></param>
/// <returns></returns>
/// <returns></returns>
public
List
<
RB_Teaching_Rewards_Rate_ViewModel
>
GetTeachimgRewardsList
(
RB_Teaching_Rewards_Rate_ViewModel
demodel
,
UserInfo
userInfo
,
out
List
<
RB_Teaching_Rewards_Rate_ViewModel
>
fclist
)
public
List
<
RB_Teaching_Rewards_Rate_ViewModel
>
GetTeachimgRewardsList
(
RB_Teaching_Rewards_Rate_ViewModel
demodel
,
UserInfo
userInfo
,
out
List
<
RB_Teaching_Rewards_Rate_ViewModel
>
fclist
)
{
{
var
rlist
=
teaching_Rewards_RateRepository
.
GetList
(
new
RB_Teaching_Rewards_Rate_ViewModel
()
{
Group_Id
=
userInfo
.
Group_Id
,
Type
=
demodel
.
Type
});
var
rlist
=
teaching_Rewards_RateRepository
.
GetList
(
new
RB_Teaching_Rewards_Rate_ViewModel
()
{
Group_Id
=
userInfo
.
Group_Id
,
Type
=
demodel
.
Type
});
var
relist
=
rlist
.
Where
(
x
=>
x
.
RateType
==
2
).
OrderBy
(
x
=>
x
.
StartValue
).
ToList
();
var
relist
=
rlist
.
Where
(
x
=>
x
.
RateType
==
2
).
OrderBy
(
x
=>
x
.
StartValue
).
ToList
();
fclist
=
rlist
.
Where
(
x
=>
x
.
RateType
==
1
).
OrderBy
(
x
=>
x
.
StartValue
).
ToList
();
fclist
=
rlist
.
Where
(
x
=>
x
.
RateType
==
1
).
OrderBy
(
x
=>
x
.
StartValue
).
ToList
();
var
vlist
=
new
List
<
RB_Teaching_Rewards_ViewModel
>();
var
vlist
=
new
List
<
RB_Teaching_Rewards_ViewModel
>();
if
(
relist
.
Any
())
{
if
(
relist
.
Any
())
{
string
TackClassRateIds
=
string
.
Join
(
","
,
relist
.
Select
(
x
=>
x
.
Id
));
string
TackClassRateIds
=
string
.
Join
(
","
,
relist
.
Select
(
x
=>
x
.
Id
));
vlist
=
teaching_RewardsRepository
.
GetList
(
new
RB_Teaching_Rewards_ViewModel
()
{
TackClassRateIds
=
TackClassRateIds
});
vlist
=
teaching_RewardsRepository
.
GetList
(
new
RB_Teaching_Rewards_ViewModel
()
{
TackClassRateIds
=
TackClassRateIds
});
}
}
foreach
(
var
item
in
relist
)
{
foreach
(
var
item
in
relist
)
{
var
clist
=
new
List
<
RB_Teaching_Rewards_Rate_ViewModel
>();
var
clist
=
new
List
<
RB_Teaching_Rewards_Rate_ViewModel
>();
foreach
(
var
qitem
in
fclist
)
{
foreach
(
var
qitem
in
fclist
)
{
var
vmodel
=
vlist
.
Where
(
x
=>
x
.
FullClassRateId
==
qitem
.
Id
&&
x
.
TackClassRateId
==
item
.
Id
).
FirstOrDefault
();
var
vmodel
=
vlist
.
Where
(
x
=>
x
.
FullClassRateId
==
qitem
.
Id
&&
x
.
TackClassRateId
==
item
.
Id
).
FirstOrDefault
();
clist
.
Add
(
new
RB_Teaching_Rewards_Rate_ViewModel
()
clist
.
Add
(
new
RB_Teaching_Rewards_Rate_ViewModel
()
{
{
...
@@ -138,7 +141,7 @@ namespace Edu.Module.Course
...
@@ -138,7 +141,7 @@ namespace Edu.Module.Course
/// <param name="deList"></param>
/// <param name="deList"></param>
/// <param name="userInfo"></param>
/// <param name="userInfo"></param>
/// <returns></returns>
/// <returns></returns>
public
bool
SetTeachingRewardsInfo
(
int
type
,
List
<
RB_Teaching_Rewards_Rate_ViewModel
>
deList
,
UserInfo
userInfo
)
public
bool
SetTeachingRewardsInfo
(
int
type
,
List
<
RB_Teaching_Rewards_Rate_ViewModel
>
deList
,
UserInfo
userInfo
)
{
{
var
rlist
=
teaching_Rewards_RateRepository
.
GetList
(
new
RB_Teaching_Rewards_Rate_ViewModel
()
{
Group_Id
=
userInfo
.
Group_Id
,
Type
=
type
});
var
rlist
=
teaching_Rewards_RateRepository
.
GetList
(
new
RB_Teaching_Rewards_Rate_ViewModel
()
{
Group_Id
=
userInfo
.
Group_Id
,
Type
=
type
});
var
trans
=
teaching_Rewards_RateRepository
.
DbTransaction
;
var
trans
=
teaching_Rewards_RateRepository
.
DbTransaction
;
...
@@ -242,7 +245,8 @@ namespace Edu.Module.Course
...
@@ -242,7 +245,8 @@ namespace Edu.Module.Course
}
}
};
};
var
flag
=
teaching_Rewards_BaseRepository
.
Update
(
keyValues
,
wheres
);
var
flag
=
teaching_Rewards_BaseRepository
.
Update
(
keyValues
,
wheres
);
if
(
flag
)
{
if
(
flag
)
{
//记录日志
//记录日志
changeLogRepository
.
Insert
(
new
Model
.
Entity
.
Log
.
RB_User_ChangeLog
()
changeLogRepository
.
Insert
(
new
Model
.
Entity
.
Log
.
RB_User_ChangeLog
()
{
{
...
@@ -258,14 +262,16 @@ namespace Edu.Module.Course
...
@@ -258,14 +262,16 @@ namespace Edu.Module.Course
}
}
return
flag
;
return
flag
;
}
}
else
{
else
{
var
list
=
teaching_Rewards_BaseRepository
.
GetList
(
new
RB_Teaching_Rewards_Base_ViewModel
()
{
Group_Id
=
userInfo
.
Group_Id
,
Type
=
demodel
.
Type
});
var
list
=
teaching_Rewards_BaseRepository
.
GetList
(
new
RB_Teaching_Rewards_Base_ViewModel
()
{
Group_Id
=
userInfo
.
Group_Id
,
Type
=
demodel
.
Type
});
if
(
list
.
Any
())
if
(
list
.
Any
())
{
{
return
false
;
return
false
;
}
}
int
Id
=
teaching_Rewards_BaseRepository
.
Insert
(
demodel
);
int
Id
=
teaching_Rewards_BaseRepository
.
Insert
(
demodel
);
if
(
Id
>
0
)
{
if
(
Id
>
0
)
{
//记录日志
//记录日志
changeLogRepository
.
Insert
(
new
Model
.
Entity
.
Log
.
RB_User_ChangeLog
()
changeLogRepository
.
Insert
(
new
Model
.
Entity
.
Log
.
RB_User_ChangeLog
()
{
{
...
@@ -316,7 +322,8 @@ namespace Edu.Module.Course
...
@@ -316,7 +322,8 @@ namespace Edu.Module.Course
public
List
<
RB_Teaching_Bonus_ViewModel
>
GetTeachingBonusPageList
(
int
pageIndex
,
int
pageSize
,
out
long
count
,
RB_Teaching_Bonus_ViewModel
dmodel
)
public
List
<
RB_Teaching_Bonus_ViewModel
>
GetTeachingBonusPageList
(
int
pageIndex
,
int
pageSize
,
out
long
count
,
RB_Teaching_Bonus_ViewModel
dmodel
)
{
{
var
list
=
teaching_BonusRepository
.
GetPageList
(
pageIndex
,
pageSize
,
out
count
,
dmodel
);
var
list
=
teaching_BonusRepository
.
GetPageList
(
pageIndex
,
pageSize
,
out
count
,
dmodel
);
if
(
list
.
Any
())
{
if
(
list
.
Any
())
{
string
bonusIds
=
string
.
Join
(
","
,
list
.
Select
(
x
=>
x
.
Id
));
string
bonusIds
=
string
.
Join
(
","
,
list
.
Select
(
x
=>
x
.
Id
));
//获取所有的明细
//获取所有的明细
var
dlist
=
teaching_BonusDetailRepository
.
GetList
(
new
RB_Teaching_BonusDetail_ViewModel
()
{
Group_Id
=
dmodel
.
Group_Id
,
BonusIds
=
bonusIds
});
var
dlist
=
teaching_BonusDetailRepository
.
GetList
(
new
RB_Teaching_BonusDetail_ViewModel
()
{
Group_Id
=
dmodel
.
Group_Id
,
BonusIds
=
bonusIds
});
...
@@ -328,7 +335,8 @@ namespace Edu.Module.Course
...
@@ -328,7 +335,8 @@ namespace Edu.Module.Course
{
{
item
.
TeacherList
=
new
List
<
RB_Teaching_BonusDetail_ViewModel
>();
item
.
TeacherList
=
new
List
<
RB_Teaching_BonusDetail_ViewModel
>();
string
[]
teacherIdArr
=
item
.
TeacherIds
.
Split
(
","
);
string
[]
teacherIdArr
=
item
.
TeacherIds
.
Split
(
","
);
foreach
(
var
qitem
in
teacherIdArr
)
{
foreach
(
var
qitem
in
teacherIdArr
)
{
int
teacherId
=
Convert
.
ToInt32
(
qitem
);
int
teacherId
=
Convert
.
ToInt32
(
qitem
);
string
teacherName
=
tlist
.
Where
(
x
=>
x
.
TId
==
teacherId
).
FirstOrDefault
()?.
TeacherName
??
""
;
string
teacherName
=
tlist
.
Where
(
x
=>
x
.
TId
==
teacherId
).
FirstOrDefault
()?.
TeacherName
??
""
;
//教师累计奖励金额
//教师累计奖励金额
...
@@ -386,7 +394,8 @@ namespace Edu.Module.Course
...
@@ -386,7 +394,8 @@ namespace Edu.Module.Course
if
(
type
==
1
)
if
(
type
==
1
)
{
{
LogContent
=
"教务奖励确认"
;
LogContent
=
"教务奖励确认"
;
if
(
model
.
State
!=
BonusStateEnum
.
Wait
)
{
if
(
model
.
State
!=
BonusStateEnum
.
Wait
)
{
return
false
;
return
false
;
}
}
keyValues
.
Add
(
nameof
(
RB_Teaching_Bonus_ViewModel
.
State
),
BonusStateEnum
.
Confirmed
);
keyValues
.
Add
(
nameof
(
RB_Teaching_Bonus_ViewModel
.
State
),
BonusStateEnum
.
Confirmed
);
...
@@ -409,7 +418,8 @@ namespace Edu.Module.Course
...
@@ -409,7 +418,8 @@ namespace Edu.Module.Course
}
}
};
};
bool
flag
=
teaching_BonusRepository
.
Update
(
keyValues
,
wheres
);
bool
flag
=
teaching_BonusRepository
.
Update
(
keyValues
,
wheres
);
if
(
flag
)
{
if
(
flag
)
{
//记录日志
//记录日志
changeLogRepository
.
Insert
(
new
Model
.
Entity
.
Log
.
RB_User_ChangeLog
()
changeLogRepository
.
Insert
(
new
Model
.
Entity
.
Log
.
RB_User_ChangeLog
()
{
{
...
@@ -436,10 +446,13 @@ namespace Edu.Module.Course
...
@@ -436,10 +446,13 @@ namespace Edu.Module.Course
{
{
//验证当月教师是否已存在奖励
//验证当月教师是否已存在奖励
var
tlist
=
teaching_BonusRepository
.
GetList
(
new
RB_Teaching_Bonus_ViewModel
()
{
Group_Id
=
userInfo
.
Group_Id
,
Month
=
Convert
.
ToDateTime
(
dmodel
.
Month
).
ToString
(
"yyyy-MM"
)
}).
Where
(
x
=>
x
.
State
!=
BonusStateEnum
.
Cancel
).
ToList
();
var
tlist
=
teaching_BonusRepository
.
GetList
(
new
RB_Teaching_Bonus_ViewModel
()
{
Group_Id
=
userInfo
.
Group_Id
,
Month
=
Convert
.
ToDateTime
(
dmodel
.
Month
).
ToString
(
"yyyy-MM"
)
}).
Where
(
x
=>
x
.
State
!=
BonusStateEnum
.
Cancel
).
ToList
();
if
(
tlist
.
Any
())
{
if
(
tlist
.
Any
())
{
string
[]
teacherArr
=
dmodel
.
TeacherIds
.
Split
(
','
);
string
[]
teacherArr
=
dmodel
.
TeacherIds
.
Split
(
','
);
foreach
(
var
item
in
tlist
)
{
foreach
(
var
item
in
tlist
)
foreach
(
var
qitem
in
teacherArr
)
{
{
foreach
(
var
qitem
in
teacherArr
)
{
if
((
","
+
item
.
TeacherIds
+
","
).
Contains
(
","
+
qitem
+
","
))
if
((
","
+
item
.
TeacherIds
+
","
).
Contains
(
","
+
qitem
+
","
))
{
{
return
"教师 "
+
(
teacherRepository
.
GetEntity
(
qitem
)?.
TeacherName
??
""
)
+
"【"
+
qitem
+
"】"
+
"已存在当月奖励"
;
return
"教师 "
+
(
teacherRepository
.
GetEntity
(
qitem
)?.
TeacherName
??
""
)
+
"【"
+
qitem
+
"】"
+
"已存在当月奖励"
;
...
@@ -464,7 +477,8 @@ namespace Edu.Module.Course
...
@@ -464,7 +477,8 @@ namespace Edu.Module.Course
List
<
RB_Class_Type_ViewModel
>
typeList
=
new
List
<
RB_Class_Type_ViewModel
>();
List
<
RB_Class_Type_ViewModel
>
typeList
=
new
List
<
RB_Class_Type_ViewModel
>();
List
<
RB_Class_Check_ViewModel
>
checkList
=
new
List
<
RB_Class_Check_ViewModel
>();
List
<
RB_Class_Check_ViewModel
>
checkList
=
new
List
<
RB_Class_Check_ViewModel
>();
List
<
RB_Teacher_ViewModel
>
teacherList
=
new
List
<
RB_Teacher_ViewModel
>();
List
<
RB_Teacher_ViewModel
>
teacherList
=
new
List
<
RB_Teacher_ViewModel
>();
if
(
plist
.
Any
())
{
if
(
plist
.
Any
())
{
string
pids
=
string
.
Join
(
","
,
plist
.
Select
(
x
=>
x
.
ClassPlanId
));
string
pids
=
string
.
Join
(
","
,
plist
.
Select
(
x
=>
x
.
ClassPlanId
));
timeList
=
class_TimeRepository
.
GetClassTimeListRepository
(
new
RB_Class_Time_ViewModel
()
{
Group_Id
=
userInfo
.
Group_Id
,
QClassPlanIds
=
pids
});
timeList
=
class_TimeRepository
.
GetClassTimeListRepository
(
new
RB_Class_Time_ViewModel
()
{
Group_Id
=
userInfo
.
Group_Id
,
QClassPlanIds
=
pids
});
...
@@ -537,7 +551,8 @@ namespace Edu.Module.Course
...
@@ -537,7 +551,8 @@ namespace Edu.Module.Course
};
};
bool
flag
=
teaching_BonusRepository
.
Update
(
keyValues
,
wheres
,
trans
);
bool
flag
=
teaching_BonusRepository
.
Update
(
keyValues
,
wheres
,
trans
);
#
endregion
#
endregion
if
(
flag
)
{
if
(
flag
)
{
//记录日志
//记录日志
changeLogRepository
.
Insert
(
new
Model
.
Entity
.
Log
.
RB_User_ChangeLog
()
changeLogRepository
.
Insert
(
new
Model
.
Entity
.
Log
.
RB_User_ChangeLog
()
{
{
...
@@ -709,6 +724,20 @@ namespace Edu.Module.Course
...
@@ -709,6 +724,20 @@ namespace Edu.Module.Course
return
msg
;
return
msg
;
}
}
/// <summary>
/// 获取列表
/// </summary>
/// <param name="demodel"></param>
/// <returns></returns>
public
List
<
RB_Teaching_BonusDetail_ViewModel
>
GetBonusDetailList
(
RB_Teaching_BonusDetail_ViewModel
demodel
)
{
return
teaching_BonusDetailRepository
.
GetList
(
demodel
);
}
#
endregion
#
endregion
#
region
教师绩效
#
region
教师绩效
...
@@ -724,11 +753,13 @@ namespace Edu.Module.Course
...
@@ -724,11 +753,13 @@ namespace Edu.Module.Course
public
List
<
RB_Teaching_Perf_ViewModel
>
GetTeachingPerfPageList
(
int
pageIndex
,
int
pageSize
,
out
long
count
,
RB_Teaching_Perf_ViewModel
dmodel
)
public
List
<
RB_Teaching_Perf_ViewModel
>
GetTeachingPerfPageList
(
int
pageIndex
,
int
pageSize
,
out
long
count
,
RB_Teaching_Perf_ViewModel
dmodel
)
{
{
var
list
=
teaching_PerfRepository
.
GetPageList
(
pageIndex
,
pageSize
,
out
count
,
demodel
:
dmodel
);
var
list
=
teaching_PerfRepository
.
GetPageList
(
pageIndex
,
pageSize
,
out
count
,
demodel
:
dmodel
);
if
(
list
.
Any
())
{
if
(
list
.
Any
())
{
string
perfIds
=
string
.
Join
(
","
,
list
.
Select
(
x
=>
x
.
Id
));
string
perfIds
=
string
.
Join
(
","
,
list
.
Select
(
x
=>
x
.
Id
));
var
rlist
=
teaching_PerfRemarkRepository
.
GetList
(
new
RB_Teaching_PerfRemark_ViewModel
()
{
PerfIds
=
perfIds
});
var
rlist
=
teaching_PerfRemarkRepository
.
GetList
(
new
RB_Teaching_PerfRemark_ViewModel
()
{
PerfIds
=
perfIds
});
foreach
(
var
item
in
list
)
{
foreach
(
var
item
in
list
)
{
item
.
RemarkList
=
rlist
.
Where
(
x
=>
x
.
PerfId
==
item
.
Id
).
ToList
();
item
.
RemarkList
=
rlist
.
Where
(
x
=>
x
.
PerfId
==
item
.
Id
).
ToList
();
item
.
JJList
=
new
List
<
RB_Teaching_Rewards_Rate_ViewModel
>();
item
.
JJList
=
new
List
<
RB_Teaching_Rewards_Rate_ViewModel
>();
...
@@ -769,7 +800,8 @@ namespace Edu.Module.Course
...
@@ -769,7 +800,8 @@ namespace Edu.Module.Course
})
>
0
;
})
>
0
;
return
flag
;
return
flag
;
}
}
else
{
else
{
return
true
;
return
true
;
}
}
}
}
...
@@ -784,10 +816,11 @@ namespace Edu.Module.Course
...
@@ -784,10 +816,11 @@ namespace Edu.Module.Course
public
string
SetTeachingPerfState
(
int
perfId
,
int
type
,
UserInfo
userInfo
)
public
string
SetTeachingPerfState
(
int
perfId
,
int
type
,
UserInfo
userInfo
)
{
{
var
perfModel
=
teaching_PerfRepository
.
GetEntity
(
perfId
);
var
perfModel
=
teaching_PerfRepository
.
GetEntity
(
perfId
);
if
(
perfModel
==
null
||
perfModel
.
Status
!=
0
)
{
return
"绩效不存在"
;
}
if
(
perfModel
==
null
||
perfModel
.
Status
!=
0
)
{
return
"绩效不存在"
;
}
if
(
type
==
1
)
if
(
type
==
1
)
{
{
if
(
perfModel
.
PerfState
!=
PerfStateEnum
.
Wait
)
{
if
(
perfModel
.
PerfState
!=
PerfStateEnum
.
Wait
)
{
return
"状态不正确"
;
return
"状态不正确"
;
}
}
var
teacherModel
=
teacherRepository
.
GetEntity
(
perfModel
.
TeacherId
);
var
teacherModel
=
teacherRepository
.
GetEntity
(
perfModel
.
TeacherId
);
...
@@ -806,7 +839,8 @@ namespace Edu.Module.Course
...
@@ -806,7 +839,8 @@ namespace Edu.Module.Course
}
}
};
};
bool
flag
=
teaching_PerfRepository
.
Update
(
keyValues
,
wheres
);
bool
flag
=
teaching_PerfRepository
.
Update
(
keyValues
,
wheres
);
if
(
flag
)
{
if
(
flag
)
{
//更新教师课时费 更新带班人数
//更新教师课时费 更新带班人数
Dictionary
<
string
,
object
>
keyValues1
=
new
Dictionary
<
string
,
object
>()
{
Dictionary
<
string
,
object
>
keyValues1
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Teacher_ViewModel
.
BaseHourFee
),
teacherModel
.
BaseHourFee
+
perfModel
.
AddHourFee
},
{
nameof
(
RB_Teacher_ViewModel
.
BaseHourFee
),
teacherModel
.
BaseHourFee
+
perfModel
.
AddHourFee
},
...
@@ -977,13 +1011,14 @@ namespace Edu.Module.Course
...
@@ -977,13 +1011,14 @@ namespace Edu.Module.Course
/// </summary>
/// </summary>
/// <param name="classId"></param>
/// <param name="classId"></param>
/// <returns></returns>
/// <returns></returns>
public
string
SetTeachingPerfCreate
(
int
classId
,
RB_Class_ViewModel
classModel
=
null
)
public
string
SetTeachingPerfCreate
(
int
classId
,
RB_Class_ViewModel
classModel
=
null
)
{
{
if
(
classModel
==
null
)
if
(
classModel
==
null
)
{
{
classModel
=
classRepository
.
GetEntity
<
RB_Class_ViewModel
>(
classId
);
classModel
=
classRepository
.
GetEntity
<
RB_Class_ViewModel
>(
classId
);
}
}
else
{
else
{
classId
=
classModel
.
ClassId
;
classId
=
classModel
.
ClassId
;
}
}
if
(
classModel
.
Status
==
DateStateEnum
.
Delete
)
{
return
"班级不存在"
;
}
if
(
classModel
.
Status
==
DateStateEnum
.
Delete
)
{
return
"班级不存在"
;
}
...
@@ -1068,14 +1103,16 @@ namespace Edu.Module.Course
...
@@ -1068,14 +1103,16 @@ namespace Edu.Module.Course
//查询奖金金额
//查询奖金金额
decimal
UnitPrice
=
0
;
decimal
UnitPrice
=
0
;
var
jjModel
=
JJrelist
.
Where
(
x
=>
x
.
StartValue
<=
AvgTakeClassRate
&&
AvgTakeClassRate
<=
x
.
EndValue
).
FirstOrDefault
();
var
jjModel
=
JJrelist
.
Where
(
x
=>
x
.
StartValue
<=
AvgTakeClassRate
&&
AvgTakeClassRate
<=
x
.
EndValue
).
FirstOrDefault
();
if
(
jjModel
!=
null
)
{
if
(
jjModel
!=
null
)
{
UnitPrice
=
jjModel
.
FullClassList
.
Where
(
x
=>
x
.
StartValue
<=
FullClassRate
&&
FullClassRate
<=
x
.
EndValue
).
FirstOrDefault
()?.
ClassMoney
??
0
;
UnitPrice
=
jjModel
.
FullClassList
.
Where
(
x
=>
x
.
StartValue
<=
FullClassRate
&&
FullClassRate
<=
x
.
EndValue
).
FirstOrDefault
()?.
ClassMoney
??
0
;
}
}
//查询 增加课时费 带班人数
//查询 增加课时费 带班人数
decimal
ClassMoney
=
0
;
decimal
ClassMoney
=
0
;
int
StuNum
=
0
;
int
StuNum
=
0
;
var
ksModel
=
KSrelist
.
Where
(
x
=>
x
.
StartValue
<=
AvgTakeClassRate
&&
AvgTakeClassRate
<=
x
.
EndValue
).
FirstOrDefault
();
var
ksModel
=
KSrelist
.
Where
(
x
=>
x
.
StartValue
<=
AvgTakeClassRate
&&
AvgTakeClassRate
<=
x
.
EndValue
).
FirstOrDefault
();
if
(
ksModel
!=
null
)
{
if
(
ksModel
!=
null
)
{
var
ks2Model
=
ksModel
.
FullClassList
.
Where
(
x
=>
x
.
StartValue
<=
FullClassRate
&&
FullClassRate
<=
x
.
EndValue
).
FirstOrDefault
();
var
ks2Model
=
ksModel
.
FullClassList
.
Where
(
x
=>
x
.
StartValue
<=
FullClassRate
&&
FullClassRate
<=
x
.
EndValue
).
FirstOrDefault
();
ClassMoney
=
ks2Model
?.
ClassMoney
??
0
;
ClassMoney
=
ks2Model
?.
ClassMoney
??
0
;
StuNum
=
ks2Model
?.
PeopelNum
??
0
;
StuNum
=
ks2Model
?.
PeopelNum
??
0
;
...
@@ -1107,11 +1144,13 @@ namespace Edu.Module.Course
...
@@ -1107,11 +1144,13 @@ namespace Edu.Module.Course
UnitPrice
=
UnitPrice
,
UnitPrice
=
UnitPrice
,
UpdateBy
=
0
,
UpdateBy
=
0
,
UpdateTime
=
DateTime
.
Now
,
UpdateTime
=
DateTime
.
Now
,
BonusJson
=
JsonHelper
.
Serialize
(
JJrelist
.
Select
(
x
=>
new
{
BonusJson
=
JsonHelper
.
Serialize
(
JJrelist
.
Select
(
x
=>
new
{
x
.
Id
,
x
.
Id
,
x
.
StartValue
,
x
.
StartValue
,
x
.
EndValue
,
x
.
EndValue
,
FullClassList
=
x
.
FullClassList
.
Select
(
z
=>
new
{
FullClassList
=
x
.
FullClassList
.
Select
(
z
=>
new
{
z
.
Id
,
z
.
Id
,
z
.
StartValue
,
z
.
StartValue
,
z
.
EndValue
,
z
.
EndValue
,
...
@@ -1119,11 +1158,13 @@ namespace Edu.Module.Course
...
@@ -1119,11 +1158,13 @@ namespace Edu.Module.Course
z
.
PeopelNum
z
.
PeopelNum
})
})
})),
})),
ClassFeeJson
=
JsonHelper
.
Serialize
(
KSrelist
.
Select
(
x
=>
new
{
ClassFeeJson
=
JsonHelper
.
Serialize
(
KSrelist
.
Select
(
x
=>
new
{
x
.
Id
,
x
.
Id
,
x
.
StartValue
,
x
.
StartValue
,
x
.
EndValue
,
x
.
EndValue
,
FullClassList
=
x
.
FullClassList
.
Select
(
z
=>
new
{
FullClassList
=
x
.
FullClassList
.
Select
(
z
=>
new
{
z
.
Id
,
z
.
Id
,
z
.
StartValue
,
z
.
StartValue
,
z
.
EndValue
,
z
.
EndValue
,
...
@@ -1139,7 +1180,8 @@ namespace Edu.Module.Course
...
@@ -1139,7 +1180,8 @@ namespace Edu.Module.Course
/// 获取集团列表
/// 获取集团列表
/// </summary>
/// </summary>
/// <returns></returns>
/// <returns></returns>
public
List
<
RB_Group_ViewModel
>
GetGroupList
()
{
public
List
<
RB_Group_ViewModel
>
GetGroupList
()
{
return
groupRepository
.
GetGroupListRepository
(
new
RB_Group_ViewModel
()
{
});
return
groupRepository
.
GetGroupListRepository
(
new
RB_Group_ViewModel
()
{
});
}
}
...
@@ -1148,7 +1190,8 @@ namespace Edu.Module.Course
...
@@ -1148,7 +1190,8 @@ namespace Edu.Module.Course
/// </summary>
/// </summary>
/// <param name="GroupId"></param>
/// <param name="GroupId"></param>
/// <returns></returns>
/// <returns></returns>
public
List
<
RB_Class_ViewModel
>
GetTeachingPerfClassList
(
int
GroupId
)
{
public
List
<
RB_Class_ViewModel
>
GetTeachingPerfClassList
(
int
GroupId
)
{
return
classRepository
.
GetTeachingPerfClassList
(
GroupId
);
return
classRepository
.
GetTeachingPerfClassList
(
GroupId
);
}
}
...
@@ -1175,7 +1218,8 @@ namespace Edu.Module.Course
...
@@ -1175,7 +1218,8 @@ namespace Edu.Module.Course
#
region
新增财务单据
#
region
新增财务单据
//银行账户
//银行账户
var
clientModel
=
clientBankAccountRepository
.
GetList
(
new
RB_ClientBankAccount_Extend
()
{
RB_Group_Id
=
userInfo
.
Group_Id
,
Type
=
Common
.
Enum
.
Finance
.
ClientTypeEnum
.
Employee
,
ObjIdStr
=
teacherModel
.
AccountId
.
ToString
()
}).
FirstOrDefault
();
var
clientModel
=
clientBankAccountRepository
.
GetList
(
new
RB_ClientBankAccount_Extend
()
{
RB_Group_Id
=
userInfo
.
Group_Id
,
Type
=
Common
.
Enum
.
Finance
.
ClientTypeEnum
.
Employee
,
ObjIdStr
=
teacherModel
.
AccountId
.
ToString
()
}).
FirstOrDefault
();
if
(
clientModel
==
null
)
{
if
(
clientModel
==
null
)
{
return
"教师未添加账户信息"
;
return
"教师未添加账户信息"
;
}
}
var
detailList
=
new
List
<
object
>
var
detailList
=
new
List
<
object
>
...
@@ -1300,6 +1344,18 @@ namespace Edu.Module.Course
...
@@ -1300,6 +1344,18 @@ namespace Edu.Module.Course
return
""
;
return
""
;
}
}
/// <summary>
/// 获取列表
/// </summary>
/// <param name="demodel"></param>
/// <returns></returns>
public
List
<
RB_Teaching_Perf_ViewModel
>
GetTeachingPerfList
(
RB_Teaching_Perf_ViewModel
demodel
)
{
return
teaching_PerfRepository
.
GetList
(
demodel
);
}
#
endregion
#
endregion
}
}
}
}
Edu.WebApi/Controllers/Finance/FinanceController.cs
View file @
0a3380d6
...
@@ -27,6 +27,7 @@ namespace Edu.WebApi.Controllers.Finance
...
@@ -27,6 +27,7 @@ namespace Edu.WebApi.Controllers.Finance
private
readonly
FinanceModule
financeModule
=
AOP
.
AOPHelper
.
CreateAOPObject
<
FinanceModule
>();
private
readonly
FinanceModule
financeModule
=
AOP
.
AOPHelper
.
CreateAOPObject
<
FinanceModule
>();
private
readonly
OrderModule
orderModule
=
AOP
.
AOPHelper
.
CreateAOPObject
<
OrderModule
>();
private
readonly
OrderModule
orderModule
=
AOP
.
AOPHelper
.
CreateAOPObject
<
OrderModule
>();
private
readonly
ClassModule
classModule
=
AOP
.
AOPHelper
.
CreateAOPObject
<
ClassModule
>();
private
readonly
ClassModule
classModule
=
AOP
.
AOPHelper
.
CreateAOPObject
<
ClassModule
>();
private
readonly
TeachingRewardsModule
teachingRewardsModule
=
AOP
.
AOPHelper
.
CreateAOPObject
<
TeachingRewardsModule
>();
/// <summary>
/// <summary>
/// 获取班级收支明细
/// 获取班级收支明细
...
@@ -48,7 +49,7 @@ namespace Edu.WebApi.Controllers.Finance
...
@@ -48,7 +49,7 @@ namespace Edu.WebApi.Controllers.Finance
//收入
//收入
decimal
IncomeReceive
=
0
;
//应收
decimal
IncomeReceive
=
0
;
//应收
decimal
IncomeActual
=
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
;
IncomeReceive
=
(
orderList
!=
null
&&
orderList
.
Any
())
?
orderList
.
Sum
(
x
=>
x
.
PreferPrice
)
:
0
;
IncomeActual
=
(
orderList
!=
null
&&
orderList
.
Any
())
?
orderList
.
Sum
(
x
=>
x
.
Income
)
:
0
;
IncomeActual
=
(
orderList
!=
null
&&
orderList
.
Any
())
?
orderList
.
Sum
(
x
=>
x
.
Income
)
:
0
;
...
@@ -60,19 +61,22 @@ namespace Edu.WebApi.Controllers.Finance
...
@@ -60,19 +61,22 @@ namespace Edu.WebApi.Controllers.Finance
//支出
//支出
decimal
PayReceive
=
0
;
//应付
decimal
PayReceive
=
0
;
//应付
decimal
PayActual
=
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
;
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
&&
x
.
OrderID
<=
0
).
Sum
(
x
=>
x
.
PayMoney
??
0
)
:
0
;
PayActual
=
(
financeList
!=
null
&&
financeList
.
Any
())
?
financeList
.
Where
(
x
=>
x
.
Type
==
WFTempLateClassEnum
.
OUT
).
Sum
(
x
=>
x
.
PayMoney
??
0
)
:
0
;
//利润
//利润
decimal
ProfitActual
=
0
;
//实际利润
decimal
ProfitActual
=
0
;
//实际利润
decimal
ProfitNow
=
0
;
//当前利润
decimal
ProfitNow
=
0
;
//当前利润
ProfitActual
=
(
Income
Actual
+
OtherIncomeActual
)
-
PayReceive
;
ProfitActual
=
(
Income
Receive
+
OtherIncomeReceive
)
-
PayReceive
;
ProfitNow
=
(
IncomeActual
+
OtherIncomeActual
)
-
PayActual
;
ProfitNow
=
(
IncomeActual
+
OtherIncomeActual
)
-
PayActual
;
//提成
//提成
decimal
SaleCommission
=
0
;
//销售提成
decimal
SaleCommission
=
(
orderList
!=
null
&&
orderList
.
Any
())
?
orderList
.
Sum
(
x
=>
x
.
CommissionMoney
)
:
0
;
;
//销售提成
decimal
TeacherProfitNow
=
0
;
//老师提成
var
teacherProfitList
=
teachingRewardsModule
.
GetBonusDetailList
(
new
RB_Teaching_BonusDetail_ViewModel
{
Group_Id
=
base
.
UserInfo
.
Group_Id
,
ClassId
=
classId
,
School_Id
=
schoolId
});
decimal
MeritsProfit
=
0
;
//绩效提成
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
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
var
recultFiniceList
=
financeList
.
Select
(
x
=>
new
...
@@ -169,19 +173,23 @@ namespace Edu.WebApi.Controllers.Finance
...
@@ -169,19 +173,23 @@ namespace Edu.WebApi.Controllers.Finance
//支出
//支出
decimal
PayReceive
=
0
;
//应付
decimal
PayReceive
=
0
;
//应付
decimal
PayActual
=
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
;
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
&&
x
.
OrderID
<=
0
).
Sum
(
x
=>
x
.
PayMoney
??
0
)
:
0
;
PayActual
=
(
financeList
!=
null
&&
financeList
.
Any
())
?
financeList
.
Where
(
x
=>
x
.
Type
==
WFTempLateClassEnum
.
OUT
).
Sum
(
x
=>
x
.
PayMoney
??
0
)
:
0
;
//利润
//利润
decimal
ProfitActual
=
0
;
//实际利润
decimal
ProfitActual
=
0
;
//实际利润
decimal
ProfitNow
=
0
;
//当前利润
decimal
ProfitNow
=
0
;
//当前利润
ProfitActual
=
(
Income
Actual
+
OtherIncomeActual
)
-
PayReceive
;
ProfitActual
=
(
Income
Receive
+
OtherIncomeReceive
)
-
PayReceive
;
ProfitNow
=
(
IncomeActual
+
OtherIncomeActual
)
-
PayActual
;
ProfitNow
=
(
IncomeActual
+
OtherIncomeActual
)
-
PayActual
;
//提成
//提成
decimal
SaleCommission
=
0
;
//销售提成
//提成
decimal
TeacherProfitNow
=
0
;
//老师提成
decimal
SaleCommission
=
(
orderList
!=
null
&&
orderList
.
Any
())
?
orderList
.
Sum
(
x
=>
x
.
CommissionMoney
)
:
0
;
;
//销售提成
decimal
MeritsProfit
=
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
>
financeReciveList
=
financeList
.
Where
(
t
=>
t
.
Type
==
WFTempLateClassEnum
.
IN
).
ToList
();
List
<
RB_Finance_Extend
>
financePayList
=
financeList
.
Where
(
t
=>
t
.
Type
==
WFTempLateClassEnum
.
OUT
).
ToList
();
List
<
RB_Finance_Extend
>
financePayList
=
financeList
.
Where
(
t
=>
t
.
Type
==
WFTempLateClassEnum
.
OUT
).
ToList
();
//var recultFiniceList = financeList.Select(x => new
//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