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
1fb8a42e
Commit
1fb8a42e
authored
Jan 28, 2021
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
教师课时费调整
parent
8ab77fd5
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
76 additions
and
3 deletions
+76
-3
RB_Teaching_BonusDetail.cs
Edu.Model/Entity/Course/RB_Teaching_BonusDetail.cs
+5
-0
TeachingRewardsModule.cs
Edu.Module.Course/TeachingRewardsModule.cs
+63
-2
RB_Teaching_BonusDetailRepository.cs
Edu.Repository/Course/RB_Teaching_BonusDetailRepository.cs
+1
-0
TeachingRewardsController.cs
Edu.WebApi/Controllers/Course/TeachingRewardsController.cs
+7
-1
No files found.
Edu.Model/Entity/Course/RB_Teaching_BonusDetail.cs
View file @
1fb8a42e
...
...
@@ -97,5 +97,10 @@ namespace Edu.Model.Entity.Course
/// 更新时间
/// </summary>
public
DateTime
UpdateTime
{
get
;
set
;
}
/// <summary>
/// 抵基础课时
/// </summary>
public
int
DeductionHour
{
get
;
set
;
}
}
}
Edu.Module.Course/TeachingRewardsModule.cs
View file @
1fb8a42e
...
...
@@ -568,7 +568,6 @@ namespace Edu.Module.Course
},
trans
);
TotalMoney
+=
ksNum
*
unitPrice
;
}
#
region
更新状态为待确认
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Teaching_Bonus_ViewModel
.
State
),
BonusStateEnum
.
Wait
},
...
...
@@ -599,6 +598,68 @@ namespace Edu.Module.Course
});
}
teaching_BonusDetailRepository
.
DBSession
.
Commit
();
#
region
基础课时处理
decimal
DeductionMoney
=
0
;
if
(
configModel
.
BasicHours
>
0
)
{
var
blist
=
teaching_BonusDetailRepository
.
GetList
(
new
RB_Teaching_BonusDetail_ViewModel
()
{
Group_Id
=
userInfo
.
Group_Id
,
BonusId
=
bonusId
});
//遍历所有老师
List
<
int
>
TeacherIdList
=
blist
.
Select
(
x
=>
x
.
TeacherId
).
Distinct
().
ToList
();
foreach
(
var
item
in
TeacherIdList
)
{
var
qblist
=
blist
.
Where
(
x
=>
x
.
TeacherId
==
item
).
OrderBy
(
x
=>
x
.
UnitPrice
).
ThenBy
(
x
=>
x
.
Date
).
ToList
();
int
BasicHours
=
configModel
.
BasicHours
;
foreach
(
var
qitem
in
qblist
)
{
int
CourseHour
=
0
,
DeductionHour
=
0
;
if
(
BasicHours
>
qitem
.
CourseHour
)
{
DeductionHour
=
qitem
.
CourseHour
;
BasicHours
-=
qitem
.
CourseHour
;
DeductionMoney
+=
qitem
.
CourseHour
*
qitem
.
UnitPrice
;
}
else
{
DeductionHour
=
BasicHours
;
CourseHour
=
qitem
.
CourseHour
-
BasicHours
;
DeductionMoney
+=
BasicHours
*
qitem
.
UnitPrice
;
BasicHours
=
0
;
}
Dictionary
<
string
,
object
>
keyValues1
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Teaching_BonusDetail_ViewModel
.
CourseHour
),
CourseHour
},
{
nameof
(
RB_Teaching_BonusDetail_ViewModel
.
DeductionHour
),
DeductionHour
},
{
nameof
(
RB_Teaching_BonusDetail_ViewModel
.
Money
),
CourseHour
*
qitem
.
UnitPrice
}
};
List
<
WhereHelper
>
wheres1
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Teaching_BonusDetail_ViewModel
.
Id
),
FiledValue
=
qitem
.
Id
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
teaching_BonusDetailRepository
.
Update
(
keyValues1
,
wheres1
);
if
(
BasicHours
<=
0
)
{
break
;
}
}
}
#
region
更新总金额
Dictionary
<
string
,
object
>
keyValues2
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Teaching_Bonus_ViewModel
.
Money
),
TotalMoney
-
DeductionMoney
}
};
List
<
WhereHelper
>
wheres2
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Teaching_Bonus_ViewModel
.
Id
),
FiledValue
=
bonusId
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
teaching_BonusRepository
.
Update
(
keyValues2
,
wheres2
);
#
endregion
}
#
endregion
return
""
;
}
catch
(
Exception
ex
)
...
...
@@ -677,7 +738,7 @@ namespace Edu.Module.Course
Number
=
(
qitem
.
CourseHour
+
qitem
.
DCourseHour
),
OriginalMoney
=
qitem
.
Money
,
qitem
.
UnitPrice
,
Remark
=
"带班"
+
qitem
.
CourseHour
+
"课时,代课"
+
qitem
.
DCourseHour
+
"课程"
Remark
=
"带班"
+
qitem
.
CourseHour
+
"课时,代课"
+
qitem
.
DCourseHour
+
"课程
,基础"
+
qitem
.
DeductionHour
+
"课时
"
});
TotalMoney
+=
qitem
.
Money
;
}
...
...
Edu.Repository/Course/RB_Teaching_BonusDetailRepository.cs
View file @
1fb8a42e
...
...
@@ -199,6 +199,7 @@ where {where} order by b.TeacherId asc,b.Date asc";
string
sql
=
$@" select b.TeacherId,t.TeacherName,b.UnitPrice,
SUM(CASE WHEN b.Type =1 THEN b.CourseHour ELSE 0 END) AS CourseHour,
SUM(CASE WHEN b.Type =2 THEN b.CourseHour ELSE 0 END) AS DCourseHour,
SUM(b.DeductionHour) AS DeductionHour,
SUM(b.Money) AS Money
from RB_Teaching_BonusDetail b
left join rb_teacher t on b.TeacherId = t.TId
...
...
Edu.WebApi/Controllers/Course/TeachingRewardsController.cs
View file @
1fb8a42e
...
...
@@ -268,6 +268,7 @@ namespace Edu.WebApi.Controllers.Course
x
.
ClassName
,
x
.
Type
,
x
.
CourseHour
,
x
.
DeductionHour
,
x
.
UnitPrice
,
x
.
CheckInNum
,
x
.
Money
...
...
@@ -279,6 +280,7 @@ namespace Edu.WebApi.Controllers.Course
x
.
UnitPrice
,
x
.
CourseHour
,
x
.
DCourseHour
,
x
.
DeductionHour
,
x
.
Money
})
});
...
...
@@ -308,7 +310,8 @@ namespace Edu.WebApi.Controllers.Course
new
ExcelColumn
(
value
:
"老师"
)
{
CellWidth
=
15
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"班级"
)
{
CellWidth
=
25
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"类型"
)
{
CellWidth
=
15
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"课时"
)
{
CellWidth
=
15
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"基础课时"
)
{
CellWidth
=
15
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"带班课时"
)
{
CellWidth
=
15
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"课单价"
)
{
CellWidth
=
15
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"签到人数"
)
{
CellWidth
=
15
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
},
new
ExcelColumn
(
value
:
"小计"
)
{
CellWidth
=
15
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
}
...
...
@@ -330,6 +333,7 @@ namespace Edu.WebApi.Controllers.Course
new
ExcelColumn
(
value
:
item
.
TeacherName
){
},
new
ExcelColumn
(
value
:
item
.
ClassName
){
},
new
ExcelColumn
(
value
:
item
.
Type
==
1
?
"带班"
:
"代课"
){
},
new
ExcelColumn
(
value
:
item
.
DeductionHour
.
ToString
()){
},
new
ExcelColumn
(
value
:
item
.
CourseHour
.
ToString
()){
},
new
ExcelColumn
(
value
:
item
.
UnitPrice
.
ToString
(
"#0.00"
)){
},
new
ExcelColumn
(
value
:
item
.
CheckInNum
.
ToString
()){
},
...
...
@@ -358,6 +362,7 @@ namespace Edu.WebApi.Controllers.Course
{
ExcelRows
=
new
List
<
ExcelColumn
>(
30
)
{
new
ExcelColumn
(
value
:
"老师"
){
},
new
ExcelColumn
(
value
:
"基础课时"
){
},
new
ExcelColumn
(
value
:
"带班课时"
){
},
new
ExcelColumn
(
value
:
"代课课时"
){
},
new
ExcelColumn
(
value
:
"课时单价"
){
},
...
...
@@ -374,6 +379,7 @@ namespace Edu.WebApi.Controllers.Course
{
ExcelRows
=
new
List
<
ExcelColumn
>(
30
)
{
new
ExcelColumn
(
value
:
item
.
TeacherName
){
},
new
ExcelColumn
(
value
:
item
.
DeductionHour
.
ToString
()){
},
new
ExcelColumn
(
value
:
item
.
CourseHour
.
ToString
()){
},
new
ExcelColumn
(
value
:
item
.
DCourseHour
.
ToString
()){
},
new
ExcelColumn
(
value
:
item
.
UnitPrice
.
ToString
(
"#0.00"
)){
},
...
...
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