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
457ebe8a
Commit
457ebe8a
authored
Jul 09, 2021
by
吴春
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/Kui2/education
parents
6163ad93
1ab733be
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
96 additions
and
84 deletions
+96
-84
FinanceModule.cs
Edu.Module.Finance/FinanceModule.cs
+89
-82
RB_OrderRepository.cs
Edu.Repository/Course/RB_OrderRepository.cs
+5
-1
OrderController.cs
Edu.WebApi/Controllers/Course/OrderController.cs
+2
-1
No files found.
Edu.Module.Finance/FinanceModule.cs
View file @
457ebe8a
...
@@ -3888,106 +3888,113 @@ namespace Edu.Module.Finance
...
@@ -3888,106 +3888,113 @@ namespace Edu.Module.Finance
string
EndTime
=
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd"
);
string
EndTime
=
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd"
);
#
region
班级下老师的课时费
#
region
班级下老师的课时费
List
<
RB_Teaching_BonusDetail_ViewModel
>
TeacherHoursList
=
new
List
<
RB_Teaching_BonusDetail_ViewModel
>();
List
<
RB_Teaching_BonusDetail_ViewModel
>
TeacherHoursList
=
new
List
<
RB_Teaching_BonusDetail_ViewModel
>();
var
TeacherAlist
=
class_CheckRepository
.
GetTeacherConsumptionHoursDetialList
(
""
,
-
1
,
classId
,
StartTime
,
EndTime
,
userInfo
.
Group_Id
);
//根据学生签到表 查询
if
(
TeacherAlist
.
Any
())
var
list
=
class_CheckRepository
.
GetTeacherConsumptionHoursDetialList
(
""
,
-
1
,
classId
,
StartTime
,
EndTime
,
userInfo
.
Group_Id
);
if
(
list
.
Any
())
{
{
//班级类型查询
//上这班的老师
var
cTypeList
=
class_TypeRepository
.
GetClassTypeListRepository
(
new
RB_Class_Type_ViewModel
()
{
Group_Id
=
userInfo
.
Group_Id
});
string
teacherIds
=
string
.
Join
(
","
,
TeacherAlist
.
Select
(
x
=>
x
.
TeacherId
).
Distinct
());
//基础配置
//根据学生签到表 查询
var
configModel
=
class_ConfigRepository
.
GetClassConfigRepository
(
new
RB_Class_Config_ViewModel
()
{
Group_Id
=
userInfo
.
Group_Id
});
var
list
=
class_CheckRepository
.
GetTeacherConsumptionHoursDetialList
(
teacherIds
,
-
1
,
0
,
StartTime
,
EndTime
,
userInfo
.
Group_Id
);
if
(
configModel
==
null
||
configModel
.
BasicHourFee
<=
0
||
configModel
.
BasicMinutes
<=
0
)
{
return
TeacherHoursList
;
}
if
(
list
.
Any
())
foreach
(
var
item
in
list
)
{
{
int
Minutes
=
(
int
)(
Convert
.
ToDateTime
(
"2021-06-29 "
+
item
.
EndDate
)
-
Convert
.
ToDateTime
(
"2021-06-29 "
+
item
.
StartDate
)).
TotalMinutes
;
//班级类型查询
decimal
Hours
=
Math
.
Round
(
Convert
.
ToDecimal
(
Minutes
)
/
60
,
2
,
MidpointRounding
.
AwayFromZero
);
//小时
var
cTypeList
=
class_TypeRepository
.
GetClassTypeListRepository
(
new
RB_Class_Type_ViewModel
()
{
Group_Id
=
userInfo
.
Group_Id
});
//上课课时
//基础配置
decimal
KSNum
=
item
.
CurrentDeductionHours
;
//签到课时长度
var
configModel
=
class_ConfigRepository
.
GetClassConfigRepository
(
new
RB_Class_Config_ViewModel
()
{
Group_Id
=
userInfo
.
Group_Id
});
if
(
configModel
==
null
||
configModel
.
BasicHourFee
<=
0
||
configModel
.
BasicMinutes
<=
0
)
{
return
TeacherHoursList
;
}
var
typeModel
=
cTypeList
.
Where
(
x
=>
x
.
CTypeId
==
item
.
ClassType
).
FirstOrDefault
();
foreach
(
var
item
in
list
)
{
//上课课时
decimal
KSNum
=
item
.
CurrentDeductionHours
;
//签到课时长度
if
(
item
.
ClassId
==
18
)
{
KSNum
=
0
;
}
// 18班 特殊处理
decimal
unitPrice
=
configModel
.
BasicHourFee
+
(
typeModel
?.
AddHourFee
??
0
)
+
(
item
?.
BaseHourFee
??
0
);
decimal
ClassHourMinute
=
configModel
.
BasicMinutes
;
//课时分钟数
//课时费 需要每个班级 单独计算 因为 班级有附加费用
//if (item.ClassHourMinute > 0) { ClassHourMinute = item.ClassHourMinute; }
decimal
KSMoney
=
KSNum
*
unitPrice
;
decimal
Hours
=
Math
.
Round
(
KSNum
*
ClassHourMinute
/
60
,
2
,
MidpointRounding
.
AwayFromZero
);
//小时
decimal
ClassHourMinute
=
configModel
.
BasicMinutes
;
//课时分钟数
var
typeModel
=
cTypeList
.
Where
(
x
=>
x
.
CTypeId
==
item
.
ClassType
).
FirstOrDefault
();
if
(
item
.
ClassHourMinute
>
0
)
{
ClassHourMinute
=
item
.
ClassHourMinute
;
}
decimal
HourMoney
=
Math
.
Round
(
unitPrice
/
ClassHourMinute
*
60
,
2
,
MidpointRounding
.
AwayFromZero
);
//每小时课时费
decimal
unitPrice
=
configModel
.
BasicHourFee
+
(
typeModel
?.
AddHourFee
??
0
)
+
(
item
?.
BaseHourFee
??
0
);
//课时费 需要每个班级 单独计算 因为 班级有附加费用
decimal
KSMoney
=
KSNum
*
unitPrice
;
TeacherHoursList
.
Add
(
new
RB_Teaching_BonusDetail_ViewModel
decimal
HourMoney
=
Math
.
Round
(
unitPrice
/
ClassHourMinute
*
60
,
2
,
MidpointRounding
.
AwayFromZero
);
//每小时课时费
{
Date
=
item
.
ClassDate
,
TimeBucket
=
item
.
StartDate
+
"~"
+
item
.
EndDate
,
TeacherId
=
item
.
TeacherId
,
TeacherName
=
item
.
TeacherName
,
ClassId
=
item
.
ClassId
,
ClassName
=
item
.
ClassName
,
ClassNo
=
item
.
ClassNo
,
CouseId
=
item
.
CouseId
,
CourseName
=
item
.
CourseName
,
KSNum
=
KSNum
,
Hours
=
Hours
,
HourMoney
=
HourMoney
,
UnitPrice
=
unitPrice
,
Money
=
KSMoney
,
BaseHoursEnabled
=
item
.
BaseHoursEnabled
,
EnableTime
=
item
.
EnableTime
});
}
//初始化 基础课时
DateTime
STime
=
Convert
.
ToDateTime
(
Convert
.
ToDateTime
(
StartTime
).
ToString
(
"yyyy-MM"
)
+
"-01"
);
TeacherHoursList
.
Add
(
new
RB_Teaching_BonusDetail_ViewModel
while
(
true
)
{
{
Date
=
item
.
ClassDate
,
DateTime
ETime
=
STime
.
AddMonths
(
1
).
AddDays
(-
1
);
TimeBucket
=
item
.
StartDate
+
"~"
+
item
.
EndDate
,
var
mlist
=
TeacherHoursList
.
Where
(
x
=>
x
.
Date
>=
STime
&&
x
.
Date
<=
ETime
&&
x
.
BaseHoursEnabled
==
1
&&
STime
>=
Convert
.
ToDateTime
(
x
.
EnableTime
)).
ToList
();
TeacherId
=
item
.
TeacherId
,
#
region
基础课时处理
TeacherName
=
item
.
TeacherName
,
decimal
DeductionMoney
=
0
;
ClassId
=
item
.
ClassId
,
if
(
configModel
.
BasicHours
>
0
&&
mlist
.
Any
())
ClassName
=
item
.
ClassName
,
ClassNo
=
item
.
ClassNo
,
CouseId
=
item
.
CouseId
,
CourseName
=
item
.
CourseName
,
KSNum
=
KSNum
,
Hours
=
Hours
,
HourMoney
=
HourMoney
,
UnitPrice
=
unitPrice
,
Money
=
KSMoney
,
BaseHoursEnabled
=
item
.
BaseHoursEnabled
,
EnableTime
=
item
.
EnableTime
});
}
//初始化 基础课时
DateTime
STime
=
Convert
.
ToDateTime
(
Convert
.
ToDateTime
(
StartTime
).
ToString
(
"yyyy-MM"
)
+
"-01"
);
while
(
true
)
{
{
//遍历所有老师
DateTime
ETime
=
STime
.
AddMonths
(
1
).
AddDays
(-
1
);
List
<
int
>
TeacherIdList
=
mlist
.
Select
(
x
=>
x
.
TeacherId
).
Distinct
().
ToList
();
var
mlist
=
TeacherHoursList
.
Where
(
x
=>
x
.
Date
>=
STime
&&
x
.
Date
<=
ETime
&&
x
.
BaseHoursEnabled
==
1
&&
STime
>=
Convert
.
ToDateTime
(
x
.
EnableTime
)).
ToList
();
foreach
(
var
item
in
TeacherIdList
)
#
region
基础课时处理
decimal
DeductionMoney
=
0
;
if
(
configModel
.
BasicHours
>
0
&&
mlist
.
Any
())
{
{
var
qblist
=
mlist
.
Where
(
x
=>
x
.
TeacherId
==
item
).
OrderBy
(
x
=>
x
.
Date
).
ThenBy
(
x
=>
x
.
UnitPrice
).
ToList
();
//遍历所有老师
decimal
BasicHours
=
(
decimal
)
configModel
.
BasicHours
;
List
<
int
>
TeacherIdList
=
mlist
.
Select
(
x
=>
x
.
TeacherId
).
Distinct
().
ToList
()
;
foreach
(
var
qitem
in
qbl
ist
)
foreach
(
var
item
in
TeacherIdL
ist
)
{
{
decimal
CourseHour
=
0
,
DeductionHour
=
0
;
var
qblist
=
mlist
.
Where
(
x
=>
x
.
TeacherId
==
item
).
OrderBy
(
x
=>
x
.
Date
).
ThenBy
(
x
=>
x
.
UnitPrice
).
ToList
();
if
(
BasicHours
>
qitem
.
KSNum
)
decimal
BasicHours
=
(
decimal
)
configModel
.
BasicHours
;
{
foreach
(
var
qitem
in
qblist
)
DeductionHour
=
qitem
.
KSNum
;
BasicHours
-=
qitem
.
KSNum
;
DeductionMoney
+=
qitem
.
KSNum
*
qitem
.
UnitPrice
;
}
else
{
DeductionHour
=
BasicHours
;
CourseHour
=
qitem
.
KSNum
-
BasicHours
;
DeductionMoney
+=
BasicHours
*
qitem
.
UnitPrice
;
BasicHours
=
0
;
}
qitem
.
KSNum
=
CourseHour
;
qitem
.
DKNum
=
DeductionHour
;
qitem
.
Money
=
CourseHour
*
qitem
.
UnitPrice
;
if
(
BasicHours
<=
0
)
{
{
break
;
decimal
CourseHour
=
0
,
DeductionHour
=
0
;
if
(
BasicHours
>
qitem
.
KSNum
)
{
DeductionHour
=
qitem
.
KSNum
;
BasicHours
-=
qitem
.
KSNum
;
DeductionMoney
+=
qitem
.
KSNum
*
qitem
.
UnitPrice
;
}
else
{
DeductionHour
=
BasicHours
;
CourseHour
=
qitem
.
KSNum
-
BasicHours
;
DeductionMoney
+=
BasicHours
*
qitem
.
UnitPrice
;
BasicHours
=
0
;
}
qitem
.
KSNum
=
CourseHour
;
qitem
.
DKNum
=
DeductionHour
;
qitem
.
Money
=
CourseHour
*
qitem
.
UnitPrice
;
if
(
BasicHours
<=
0
)
{
break
;
}
}
}
}
}
}
}
}
#
endregion
#
endregion
if
(
STime
.
ToString
(
"yyyy-MM"
)
==
Convert
.
ToDateTime
(
EndTime
).
ToString
(
"yyyy-MM"
))
if
(
STime
.
ToString
(
"yyyy-MM"
)
==
Convert
.
ToDateTime
(
EndTime
).
ToString
(
"yyyy-MM"
))
{
{
break
;
break
;
}
STime
=
STime
.
AddMonths
(
1
);
}
}
STime
=
STime
.
AddMonths
(
1
);
}
}
TeacherHoursList
=
TeacherHoursList
.
Where
(
x
=>
x
.
ClassId
==
classId
).
ToList
();
}
}
#
endregion
#
endregion
...
...
Edu.Repository/Course/RB_OrderRepository.cs
View file @
457ebe8a
...
@@ -195,7 +195,7 @@ ORDER BY {orderBy}
...
@@ -195,7 +195,7 @@ ORDER BY {orderBy}
}
}
if
(!
string
.
IsNullOrEmpty
(
demodel
.
ClassNo
))
if
(!
string
.
IsNullOrEmpty
(
demodel
.
ClassNo
))
{
{
where
+=
$@" and c.
{
nameof
(
RB_Class
.
ClassNo
)}
=
{
demodel
.
ClassNo
}
"
;
where
+=
$@" and c.
{
nameof
(
RB_Class
.
ClassNo
)}
=
'
{
demodel
.
ClassNo
}
'
"
;
}
}
if
(!
string
.
IsNullOrEmpty
(
demodel
.
GuestName
))
if
(!
string
.
IsNullOrEmpty
(
demodel
.
GuestName
))
{
{
...
@@ -310,6 +310,10 @@ where {where} order by {orderBy}
...
@@ -310,6 +310,10 @@ where {where} order by {orderBy}
{
{
where
+=
$@" and c.
{
nameof
(
RB_Class
.
ClassName
)}
like '%
{
demodel
.
ClassName
}
%'"
;
where
+=
$@" and c.
{
nameof
(
RB_Class
.
ClassName
)}
like '%
{
demodel
.
ClassName
}
%'"
;
}
}
if
(!
string
.
IsNullOrEmpty
(
demodel
.
ClassNo
))
{
where
+=
$@" and c.
{
nameof
(
RB_Class
.
ClassNo
)}
='
{
demodel
.
ClassNo
}
'"
;
}
if
(!
string
.
IsNullOrEmpty
(
demodel
.
GuestName
))
if
(!
string
.
IsNullOrEmpty
(
demodel
.
GuestName
))
{
{
if
(
demodel
.
Group_Id
>
0
)
if
(
demodel
.
Group_Id
>
0
)
...
...
Edu.WebApi/Controllers/Course/OrderController.cs
View file @
457ebe8a
...
@@ -1310,7 +1310,8 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -1310,7 +1310,8 @@ namespace Edu.WebApi.Controllers.Course
Q_OrderBy
=
base
.
ParmJObj
.
GetInt
(
"Q_OrderBy"
),
Q_OrderBy
=
base
.
ParmJObj
.
GetInt
(
"Q_OrderBy"
),
PlatformTax
=
base
.
ParmJObj
.
GetDecimal
(
"PlatformTax"
),
PlatformTax
=
base
.
ParmJObj
.
GetDecimal
(
"PlatformTax"
),
EnterID
=
base
.
ParmJObj
.
GetInt
(
"EnterID"
),
EnterID
=
base
.
ParmJObj
.
GetInt
(
"EnterID"
),
HelpEnterId
=
base
.
ParmJObj
.
GetInt
(
"HelpEnterId"
,
0
)
HelpEnterId
=
base
.
ParmJObj
.
GetInt
(
"HelpEnterId"
,
0
),
ClassNo
=
base
.
ParmJObj
.
GetStringValue
(
"ClassNo"
),
};
};
demodel
.
Group_Id
=
userInfo
.
Group_Id
;
demodel
.
Group_Id
=
userInfo
.
Group_Id
;
...
...
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