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
0c5cfc40
Commit
0c5cfc40
authored
Apr 14, 2022
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
5c6c067b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
66 additions
and
19 deletions
+66
-19
RB_Teacher_Assessment_Details.cs
...el/Entity/DataStatistics/RB_Teacher_Assessment_Details.cs
+8
-2
TeacherAssessmentModule.cs
Edu.Module.User/TeacherAssessmentModule.cs
+19
-9
RB_Teacher_Assessment_DetailsRepository.cs
...DataStatistics/RB_Teacher_Assessment_DetailsRepository.cs
+8
-0
TeacherAssessmentController.cs
...pi/Controllers/DataService/TeacherAssessmentController.cs
+31
-8
No files found.
Edu.Model/Entity/DataStatistics/RB_Teacher_Assessment_Details.cs
View file @
0c5cfc40
using
System
;
using
Edu.Common.Enum.User
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
VT.FW.DB
;
...
...
@@ -40,7 +41,7 @@ namespace Edu.Model.Entity.DataStatistics
/// <summary>
/// 考核类型(1-教学主管,2-教务主管)
/// </summary>
public
int
CheckType
{
get
;
set
;
}
public
CheckTypeEnum
CheckType
{
get
;
set
;
}
/// <summary>
/// 得分
...
...
@@ -52,5 +53,10 @@ namespace Edu.Model.Entity.DataStatistics
/// </summary>
public
DateTime
CreateTime
{
get
;
set
;
}
/// <summary>
/// 创建人
/// </summary>
public
int
CreateBy
{
get
;
set
;
}
}
}
Edu.Module.User/TeacherAssessmentModule.cs
View file @
0c5cfc40
using
Edu.AOP.CustomerAttribute
;
using
Edu.Common.Enum
;
using
Edu.Common.Enum.User
;
using
Edu.Model.CacheModel
;
using
Edu.Model.ViewModel.DataStatistics
;
using
Edu.Model.ViewModel.User
;
...
...
@@ -265,20 +266,20 @@ namespace Edu.Module.User
public
object
GetTeacherAssessmentModule
(
int
TeacherAccountId
,
int
YearStr
,
int
MonthStr
,
UserInfo
userInfo
)
{
object
result
=
new
object
();
int
CheckType
=
0
;
CheckTypeEnum
CheckType
=
0
;
//获取字典配置的教学主管和教务主管
var
dicModel
=
GetDictValueListModule
(
userInfo
.
Group_Id
,
"TEACHER_ASSESSMENT"
).
FirstOrDefault
();
if
(
dicModel
!=
null
)
{
//教学主管
if
(
dicModel
.
Code
.
Equals
(
userInfo
.
Id
))
if
(
dicModel
.
Code
.
Equals
(
userInfo
.
Id
.
ToString
()
))
{
CheckType
=
1
;
CheckType
=
CheckTypeEnum
.
JiaoXueManager
;
}
//教务主管
if
(
dicModel
.
Content
.
Equals
(
userInfo
.
Id
))
if
(
dicModel
.
Content
.
Equals
(
userInfo
.
Id
.
ToString
()
))
{
CheckType
=
2
;
CheckType
=
CheckTypeEnum
.
JiaoWuManager
;
}
}
var
extModel
=
teacher_AssessmentRepository
.
GetTeacherAssessmentEntityRepository
(
new
RB_Teacher_Assessment_Extend
()
...
...
@@ -289,7 +290,9 @@ namespace Edu.Module.User
});
var
detailsList
=
teacher_Assessment_DetailsRepository
.
GetTeacherAssessmentDetailsListRepository
(
new
RB_Teacher_Assessment_Details_Extend
()
{
TeacherAssessmentId
=
(
extModel
?.
Id
??
0
)
TeacherAssessmentId
=
(
extModel
?.
Id
??
0
),
CreateBy
=
userInfo
.
Id
,
CheckType
=
CheckType
});
var
typeList
=
GetAssessmentTypeListModule
(
new
RB_Assessment_Type_Extend
()
{
});
List
<
object
>
list
=
new
List
<
object
>();
...
...
@@ -298,22 +301,29 @@ namespace Edu.Module.User
List
<
object
>
subList
=
new
List
<
object
>();
foreach
(
var
subItem
in
item
.
SubtypeList
)
{
var
tempDetail
=
detailsList
.
Where
(
qitem
=>
qitem
.
AssessmentTypeId
==
item
.
Id
&&
qitem
.
AssessmentSubTypeId
==
subItem
.
Id
&&
qitem
.
CheckType
==
CheckType
)?.
FirstOrDefault
();
List
<
object
>
optionList
=
new
List
<
object
>();
foreach
(
var
tItem
in
subItem
.
OptionList
)
{
bool
IsCheck
=
false
;
if
((
tempDetail
?.
CheckId
??
0
)
==
tItem
.
LevelId
)
{
IsCheck
=
true
;
}
optionList
.
Add
(
new
{
tItem
.
LevelId
,
tItem
.
LevelTitle
,
tItem
.
LevelDesc
,
tItem
.
IsCheck
,
IsCheck
,
tItem
.
LevelScore
,
});
}
var
sObj
=
new
{
CheckId
=
0
,
CheckScore
=
0
,
Id
=
tempDetail
?.
Id
??
0
,
CheckId
=
tempDetail
?.
CheckId
??
0
,
CheckScore
=
tempDetail
?.
CheckScore
??
0
,
AssessmentSubtypeId
=
subItem
.
Id
,
subItem
.
SubTypeName
,
OptionList
=
optionList
,
...
...
Edu.Repository/DataStatistics/RB_Teacher_Assessment_DetailsRepository.cs
View file @
0c5cfc40
...
...
@@ -35,6 +35,14 @@ WHERE 1=1
{
builder
.
AppendFormat
(
@" AND A.{0} IN({1}) "
,
nameof
(
RB_Teacher_Assessment_Details_Extend
.
TeacherAssessmentId
),
query
.
QTeacherAssessmentIds
);
}
if
(
query
.
CreateBy
>
0
)
{
builder
.
AppendFormat
(
@" AND A.{0} IN({1}) "
,
nameof
(
RB_Teacher_Assessment_Details_Extend
.
CreateBy
),
query
.
CreateBy
);
}
if
(
query
.
CheckType
>
0
)
{
builder
.
AppendFormat
(
@" AND A.{0} IN({1}) "
,
nameof
(
RB_Teacher_Assessment_Details_Extend
.
CheckType
),
(
int
)
query
.
CheckType
);
}
}
return
Get
<
RB_Teacher_Assessment_Details_Extend
>(
builder
.
ToString
()).
ToList
();
}
...
...
Edu.WebApi/Controllers/DataService/TeacherAssessmentController.cs
View file @
0c5cfc40
using
Edu.Cache.User
;
using
Edu.Common.API
;
using
Edu.Common.Enum.User
;
using
Edu.Common.Plugin
;
using
Edu.Model.ViewModel.DataStatistics
;
using
Edu.Module.User
;
...
...
@@ -85,7 +86,7 @@ namespace Edu.WebApi.Controllers.DataService
JObject
sObj
=
JObject
.
Parse
(
subItem
.
ToString
());
subModel
.
OptionList
.
Add
(
new
SubtypeItem
()
{
LevelId
=
LevelId
,
LevelId
=
LevelId
,
LevelTitle
=
sObj
.
GetStringValue
(
"LevelTitle"
),
LevelDesc
=
sObj
.
GetStringValue
(
"LevelDesc"
),
LevelScore
=
sObj
.
GetDecimal
(
"LevelScore"
),
...
...
@@ -215,10 +216,22 @@ namespace Edu.WebApi.Controllers.DataService
var
model
=
new
RB_Teacher_Assessment_Extend
()
{
Id
=
base
.
ParmJObj
.
GetInt
(
"Id"
),
YearStr
=
base
.
ParmJObj
.
GetInt
(
"YearStr"
),
MonthStr
=
base
.
ParmJObj
.
GetInt
(
"MonthStr"
),
TeacherAccountId
=
base
.
ParmJObj
.
GetInt
(
"TeacherAccountId"
),
YearStr
=
base
.
ParmJObj
.
GetInt
(
"YearStr"
),
MonthStr
=
base
.
ParmJObj
.
GetInt
(
"MonthStr"
),
TeacherAccountId
=
base
.
ParmJObj
.
GetInt
(
"TeacherAccountId"
),
TeacherScore
=
base
.
ParmJObj
.
GetDecimal
(
"TeacherScore"
),
JiaoWuScore
=
base
.
ParmJObj
.
GetDecimal
(
"JiaoWuScore"
),
};
if
(
model
.
YearStr
<=
0
||
model
.
MonthStr
<=
0
)
{
return
ApiResult
.
Failed
(
message
:
"请选择时间!"
);
}
if
(
model
.
TeacherAccountId
<=
0
)
{
return
ApiResult
.
Failed
(
message
:
"请选择老师!"
);
}
CheckTypeEnum
CheckType
=
(
CheckTypeEnum
)
base
.
ParmJObj
.
GetInt
(
"CheckType"
);
model
.
DetailsList
=
new
List
<
RB_Teacher_Assessment_Details_Extend
>();
var
detailsLists
=
base
.
ParmJObj
.
GetStringValue
(
"DetailsList"
);
if
(!
string
.
IsNullOrEmpty
(
detailsLists
))
...
...
@@ -245,8 +258,9 @@ namespace Edu.WebApi.Controllers.DataService
AssessmentSubTypeId
=
tObj
.
GetInt
(
"AssessmentSubtypeId"
),
CheckId
=
tObj
.
GetInt
(
"CheckId"
),
CheckScore
=
tObj
.
GetDecimal
(
"CheckScore"
),
CheckType
=
base
.
ParmJObj
.
GetInt
(
"CheckType"
),
CreateTime
=
DateTime
.
Now
CheckType
=
CheckType
,
CreateTime
=
DateTime
.
Now
,
CreateBy
=
base
.
UserInfo
.
Id
,
};
model
.
DetailsList
.
Add
(
dModel
);
}
...
...
@@ -255,6 +269,17 @@ namespace Edu.WebApi.Controllers.DataService
}
}
}
if
(
CheckType
==
CheckTypeEnum
.
JiaoXueManager
)
{
model
.
TeacherScore
=
model
.
DetailsList
.
Where
(
qitem
=>
qitem
.
CheckType
==
CheckTypeEnum
.
JiaoXueManager
).
Sum
(
qitem
=>
qitem
.
CheckScore
);
}
else
if
(
CheckType
==
CheckTypeEnum
.
JiaoWuManager
)
{
model
.
JiaoWuScore
=
model
.
DetailsList
.
Where
(
qitem
=>
qitem
.
CheckType
==
CheckTypeEnum
.
JiaoWuManager
).
Sum
(
qitem
=>
qitem
.
CheckScore
);
}
//总分=(教學主管考核*30%+教务主管考核*70%)
model
.
TotalScore
=
model
.
TeacherScore
*
Convert
.
ToDecimal
(
0.3
)
+
model
.
JiaoWuScore
*
Convert
.
ToDecimal
(
0.7
);
model
.
Group_Id
=
base
.
UserInfo
.
Group_Id
;
model
.
School_Id
=
base
.
UserInfo
.
School_Id
;
model
.
CreateBy
=
base
.
UserInfo
.
Id
;
...
...
@@ -262,8 +287,6 @@ namespace Edu.WebApi.Controllers.DataService
var
flag
=
teacherAssessmentModule
.
SaveTeacherAssessmentModule
(
model
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
#
endregion
}
}
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