Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
Z
zhengyuan-danger-chemistry-manage
Project
Project
Details
Activity
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
耿迪迪
zhengyuan-danger-chemistry-manage
Commits
238a296c
Commit
238a296c
authored
Feb 02, 2023
by
吴卿华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
考试统计修改
parent
1b5cb4a7
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
206 additions
and
72 deletions
+206
-72
TTrainCourseController.java
...m/zehong/web/controller/train/TTrainCourseController.java
+13
-0
TTrainUserCourse.java
.../main/java/com/zehong/system/domain/TTrainUserCourse.java
+62
-39
TTrainUserCourseMapper.java
...java/com/zehong/system/mapper/TTrainUserCourseMapper.java
+15
-8
ITTrainCourseService.java
.../java/com/zehong/system/service/ITTrainCourseService.java
+7
-0
TTrainCourseServiceImpl.java
...m/zehong/system/service/impl/TTrainCourseServiceImpl.java
+10
-0
TTrainUserCourseMapper.xml
...c/main/resources/mapper/system/TTrainUserCourseMapper.xml
+31
-6
lessonsProgram.js
...er-manage-web/src/api/educationPlanExam/lessonsProgram.js
+9
-0
index.vue
...manage-web/src/views/educationPlanExam/testStat/index.vue
+54
-14
index.vue
...web/src/views/educationPlanExam/visitorTestStat/index.vue
+5
-5
No files found.
danger-manage-admin/src/main/java/com/zehong/web/controller/train/TTrainCourseController.java
View file @
238a296c
...
@@ -12,6 +12,7 @@ import com.zehong.common.utils.ServletUtils;
...
@@ -12,6 +12,7 @@ import com.zehong.common.utils.ServletUtils;
import
com.zehong.common.utils.poi.ExcelUtil
;
import
com.zehong.common.utils.poi.ExcelUtil
;
import
com.zehong.framework.web.service.TokenService
;
import
com.zehong.framework.web.service.TokenService
;
import
com.zehong.system.domain.StatisticsTrainCourse
;
import
com.zehong.system.domain.StatisticsTrainCourse
;
import
com.zehong.system.domain.TDeviceInfo
;
import
com.zehong.system.domain.TTrainCourse
;
import
com.zehong.system.domain.TTrainCourse
;
import
com.zehong.system.domain.TTrainUserCourse
;
import
com.zehong.system.domain.TTrainUserCourse
;
import
com.zehong.system.domain.vo.UserCourseVo
;
import
com.zehong.system.domain.vo.UserCourseVo
;
...
@@ -193,4 +194,16 @@ public class TTrainCourseController extends BaseController
...
@@ -193,4 +194,16 @@ public class TTrainCourseController extends BaseController
List
<
TTrainUserCourse
>
persons
=
tTrainCourseService
.
testPersonDetailByCourseId
(
courseId
);
List
<
TTrainUserCourse
>
persons
=
tTrainCourseService
.
testPersonDetailByCourseId
(
courseId
);
return
getDataTable
(
persons
);
return
getDataTable
(
persons
);
}
}
/**
* 导出所有考试详细数据项
*/
@Log
(
title
=
"设备信息管理"
,
businessType
=
BusinessType
.
EXPORT
)
@GetMapping
(
"/examDetails"
)
public
AjaxResult
examDetails
(
@RequestParam
(
value
=
"courseId"
)
Long
courseId
)
{
List
<
TTrainUserCourse
>
persons
=
tTrainCourseService
.
examDetails
(
courseId
);
ExcelUtil
<
TTrainUserCourse
>
util
=
new
ExcelUtil
<
TTrainUserCourse
>(
TTrainUserCourse
.
class
);
return
util
.
exportExcel
(
persons
,
"考试详细数据"
);
}
}
}
danger-manage-system/src/main/java/com/zehong/system/domain/TTrainUserCourse.java
View file @
238a296c
...
@@ -21,42 +21,60 @@ public class TTrainUserCourse extends BaseEntity
...
@@ -21,42 +21,60 @@ public class TTrainUserCourse extends BaseEntity
private
Long
userCourseId
;
private
Long
userCourseId
;
/** 用户id */
/** 用户id */
@Excel
(
name
=
"用户id"
)
private
Long
userId
;
private
Long
userId
;
/** 课程id */
/** 课程id */
@Excel
(
name
=
"课程id"
)
private
Long
courseId
;
private
Long
courseId
;
/** 0未学习 1未通过 2已通过 */
@Excel
(
name
=
"0未学习 1未通过 2已通过"
)
/**人员名称**/
private
Integer
state
;
@Excel
(
name
=
"考试人员"
)
private
String
staffName
;
/** 创建人 */
private
String
createUser
;
/**人员部门**/
@Excel
(
name
=
"所属部门"
)
private
String
deptName
;
/** 最后一次考试时间 */
/** 最后一次考试时间 */
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@Excel
(
name
=
"
最后一次
考试时间"
,
width
=
30
,
dateFormat
=
"yyyy-MM-dd"
)
@Excel
(
name
=
"考试时间"
,
width
=
30
,
dateFormat
=
"yyyy-MM-dd"
)
private
Date
examinationTime
;
private
Date
examinationTime
;
/** 最后一次考试结果(答对数量) */
/** 最后一次考试结果(答对数量) */
@Excel
(
name
=
"
最后一次考试结果"
,
readConverterExp
=
"答=对数量
"
)
@Excel
(
name
=
"
得分
"
)
private
Integer
examinationResult
;
private
Integer
examinationResult
;
/** 创建人 */
@Excel
(
name
=
"创建人"
)
private
String
createUser
;
/**
人员名称*
*/
/**
0未学习 1未通过 2已通过
*/
private
String
staffNam
e
;
private
Integer
stat
e
;
/**人员部门**/
/** 0未学习 1未通过 2已通过 */
private
String
deptName
;
@Excel
(
name
=
"考试结果"
)
private
String
states
;
private
Integer
personnelType
;
private
Integer
personnelType
;
private
Integer
finishDuration
;
private
Integer
finishDuration
;
private
Integer
trainState
;
private
Integer
trainState
;
public
static
long
getSerialVersionUID
()
{
return
serialVersionUID
;
}
public
String
getStates
()
{
return
states
;
}
public
void
setStates
(
String
states
)
{
this
.
states
=
states
;
}
public
Integer
getFinishDuration
()
{
public
Integer
getFinishDuration
()
{
return
finishDuration
;
return
finishDuration
;
}
}
...
@@ -163,15 +181,20 @@ public class TTrainUserCourse extends BaseEntity
...
@@ -163,15 +181,20 @@ public class TTrainUserCourse extends BaseEntity
@Override
@Override
public
String
toString
()
{
public
String
toString
()
{
return
new
ToStringBuilder
(
this
,
ToStringStyle
.
MULTI_LINE_STYLE
)
return
"TTrainUserCourse{"
+
.
append
(
"userCourseId"
,
getUserCourseId
())
"userCourseId="
+
userCourseId
+
.
append
(
"userId"
,
getUserId
())
", userId="
+
userId
+
.
append
(
"courseId"
,
getCourseId
())
", courseId="
+
courseId
+
.
append
(
"state"
,
getState
())
", staffName='"
+
staffName
+
'\''
+
.
append
(
"examinationTime"
,
getExaminationTime
())
", createUser='"
+
createUser
+
'\''
+
.
append
(
"examinationResult"
,
getExaminationResult
())
", deptName='"
+
deptName
+
'\''
+
.
append
(
"createTime"
,
getCreateTime
())
", examinationTime="
+
examinationTime
+
.
append
(
"createUser"
,
getCreateUser
())
", examinationResult="
+
examinationResult
+
.
toString
();
", state="
+
state
+
", states='"
+
states
+
'\''
+
", personnelType="
+
personnelType
+
", finishDuration="
+
finishDuration
+
", trainState="
+
trainState
+
'}'
;
}
}
}
}
danger-manage-system/src/main/java/com/zehong/system/mapper/TTrainUserCourseMapper.java
View file @
238a296c
...
@@ -65,4 +65,11 @@ public interface TTrainUserCourseMapper
...
@@ -65,4 +65,11 @@ public interface TTrainUserCourseMapper
* @return List<TTrainUserCourse>
* @return List<TTrainUserCourse>
*/
*/
List
<
TTrainUserCourse
>
testPersonDetailByCourseId
(
Long
courseId
);
List
<
TTrainUserCourse
>
testPersonDetailByCourseId
(
Long
courseId
);
/**
* 导出所有考试详细数据项
* @param courseId
* @return
*/
List
<
TTrainUserCourse
>
examDetails
(
Long
courseId
);
}
}
danger-manage-system/src/main/java/com/zehong/system/service/ITTrainCourseService.java
View file @
238a296c
...
@@ -107,5 +107,12 @@ public interface ITTrainCourseService
...
@@ -107,5 +107,12 @@ public interface ITTrainCourseService
* @return List<TTrainUserCourse>
* @return List<TTrainUserCourse>
*/
*/
List
<
TTrainUserCourse
>
testPersonDetailByCourseId
(
Long
courseId
);
List
<
TTrainUserCourse
>
testPersonDetailByCourseId
(
Long
courseId
);
/**
* 导出所有考试详细数据项
* @param courseId
* @return
*/
List
<
TTrainUserCourse
>
examDetails
(
Long
courseId
);
}
}
danger-manage-system/src/main/java/com/zehong/system/service/impl/TTrainCourseServiceImpl.java
View file @
238a296c
...
@@ -332,6 +332,16 @@ public class TTrainCourseServiceImpl implements ITTrainCourseService
...
@@ -332,6 +332,16 @@ public class TTrainCourseServiceImpl implements ITTrainCourseService
return
tTrainUserCourseMapper
.
testPersonDetailByCourseId
(
courseId
);
return
tTrainUserCourseMapper
.
testPersonDetailByCourseId
(
courseId
);
}
}
/**
* 导出所有考试详细数据项
* @param courseId
* @return
*/
@Override
public
List
<
TTrainUserCourse
>
examDetails
(
Long
courseId
)
{
return
tTrainUserCourseMapper
.
examDetails
(
courseId
);
}
@Override
@Override
public
TTrainUserCourse
getUserCourse
(
Long
userCourseId
){
public
TTrainUserCourse
getUserCourse
(
Long
userCourseId
){
TTrainUserCourse
userCourse
=
tTrainUserCourseMapper
.
selectTTrainUserCourseById
(
userCourseId
);
TTrainUserCourse
userCourse
=
tTrainUserCourseMapper
.
selectTTrainUserCourseById
(
userCourseId
);
...
...
danger-manage-system/src/main/resources/mapper/system/TTrainUserCourseMapper.xml
View file @
238a296c
...
@@ -18,6 +18,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -18,6 +18,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result
property=
"deptName"
column=
"dept_name"
/>
<result
property=
"deptName"
column=
"dept_name"
/>
<result
property=
"finishDuration"
column=
"finish_duration"
/>
<result
property=
"finishDuration"
column=
"finish_duration"
/>
<result
property=
"trainState"
column=
"train_state"
/>
<result
property=
"trainState"
column=
"train_state"
/>
<result
property=
"states"
column=
"states"
/>
</resultMap>
</resultMap>
<sql
id=
"selectTTrainUserCourseVo"
>
<sql
id=
"selectTTrainUserCourseVo"
>
...
@@ -102,7 +103,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -102,7 +103,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
sys.staff_name,
sys.staff_name,
d.dept_name,
d.dept_name,
train.examination_result,
train.examination_result,
train.state,train.examination_time
train.state,
train.examination_time
FROM
t_train_user_course train
LEFT JOIN sys_user sys ON train.user_id = sys.user_id
left join sys_dept d on sys.dept_id = d.dept_id
WHERE train.course_id = #{courseId}
</select>
<!--导出所有考试详细数据项-->
<select
id=
"examDetails"
parameterType=
"Long"
resultMap=
"TTrainUserCourseResult"
>
SELECT
sys.staff_name,
d.dept_name,
train.examination_result,
train.examination_result,
CASE
WHEN train.state = 0 THEN
'未考试'
WHEN train.state = 1 THEN
'未通过'
WHEN train.state = 2 THEN
'已通过'
END AS states ,
train.examination_time
FROM
FROM
t_train_user_course train
t_train_user_course train
LEFT JOIN sys_user sys ON train.user_id = sys.user_id
LEFT JOIN sys_user sys ON train.user_id = sys.user_id
...
...
danger-manage-web/src/api/educationPlanExam/lessonsProgram.js
View file @
238a296c
...
@@ -193,3 +193,12 @@ export function bachAddTopicGuest(data) {
...
@@ -193,3 +193,12 @@ export function bachAddTopicGuest(data) {
data
:
data
data
:
data
})
})
}
}
export
function
exportDeviceInfo
(
query
)
{
return
request
({
url
:
'/system/course/examDetails'
,
method
:
'get'
,
params
:
query
})
}
danger-manage-web/src/views/educationPlanExam/testStat/index.vue
View file @
238a296c
...
@@ -60,22 +60,22 @@
...
@@ -60,22 +60,22 @@
<el-table-column
label=
"应参加人数"
align=
"center"
prop=
"count"
/>
<el-table-column
label=
"应参加人数"
align=
"center"
prop=
"count"
/>
<el-table-column
label=
"实际考试人数"
align=
"center"
prop=
"test"
/>
<el-table-column
label=
"实际考试人数"
align=
"center"
prop=
"test"
/>
<el-table-column
label=
"合格人数"
align=
"center"
prop=
"pass"
/>
<el-table-column
label=
"合格人数"
align=
"center"
prop=
"pass"
/>
<el-table-column
label=
"合格率"
align=
"center"
prop=
"rate"
>
<!-- <el-table-column label="合格率" align="center" prop="rate">--
>
<
template
slot-scope=
"scope"
>
<!-- <template slot-scope="scope">--
>
{{
scope
.
row
.
rate
}}
%
<!-- {{scope.row.rate}}%-->
</
template
>
<!-- </template>--
>
</el-table-column
>
<!-- </el-table-column>--
>
<el-table-column
<el-table-column
label=
"操作"
label=
"操作"
align=
"center"
align=
"center"
class-name=
"small-padding fixed-width"
class-name=
"small-padding fixed-width"
>
>
<
template
v-slot=
"{ row: { courseId
}
}"
>
<
template
v-slot=
"{ row: { courseId
,courseName}
}"
>
<el-button
<el-button
size=
"mini"
size=
"mini"
type=
"text"
type=
"text"
icon=
"el-icon-edit"
icon=
"el-icon-edit"
@
click=
"courseDetail(courseId)"
@
click=
"courseDetail(courseId
,courseName
)"
>
查看详情
</el-button>
>
查看详情
</el-button>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
...
@@ -89,13 +89,33 @@
...
@@ -89,13 +89,33 @@
/>
/>
<!--考试详情 -->
<!--考试详情 -->
<el-dialog
title=
"考试详情"
:visible
.
sync=
"testStatDetailOpen"
append-to-body
:close-on-click-modal=
"false"
>
<el-dialog
:title=
"'考试详情:'+courseName"
:visible
.
sync=
"testStatDetailOpen"
append-to-body
:close-on-click-modal=
"false"
>
<el-button
type=
"warning"
plain
icon=
"el-icon-download"
size=
"mini"
:loading=
"exportLoading"
@
click=
"handleExport"
style=
"position: relative;left: 16px;top: -17px;"
>
导出
</el-button>
<el-table
v-loading=
"loading"
:data=
"testStatDetailData"
>
<el-table
v-loading=
"loading"
:data=
"testStatDetailData"
>
<el-table-column
label=
"序号"
width=
'100'
align=
"center"
prop=
"detailNum"
/>
<el-table-column
label=
"序号"
width=
'100'
align=
"center"
prop=
"detailNum"
/>
<el-table-column
label=
"考试人员"
align=
"center"
prop=
"staffName"
/>
<el-table-column
label=
"考试人员"
align=
"center"
prop=
"staffName"
/>
<el-table-column
label=
"所属部门"
align=
"center"
prop=
"deptName"
/>
<el-table-column
label=
"所属部门"
align=
"center"
prop=
"deptName"
>
<el-table-column
label=
"考试时间"
align=
"center"
prop=
"examinationTime"
/>
<span
slot-scope=
"scope"
v-if=
"scope.row.deptName"
>
{{scope.row.deptName}}
</span>
<el-table-column
label=
"答对个数"
align=
"center"
prop=
"examinationResult"
/>
<span
v-else
>
-
</span>
</el-table-column>
<el-table-column
label=
"考试时间"
align=
"center"
prop=
"examinationTime"
>
<span
slot-scope=
"scope"
v-if=
"scope.row.examinationTime"
>
{{scope.row.examinationTime}}
</span>
<span
v-else
>
-
</span>
</el-table-column>
<el-table-column
label=
"得分"
align=
"center"
prop=
"examinationResult"
>
<span
slot-scope=
"scope"
v-if=
"scope.row.examinationResult"
>
{{scope.row.examinationResult}}
</span>
<span
v-else
>
-
</span>
</el-table-column>
<el-table-column
label=
"考试结果"
align=
"center"
prop=
"state"
>
<el-table-column
label=
"考试结果"
align=
"center"
prop=
"state"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<span
v-if=
"scope.row.state == 0"
>
未考试
</span>
<span
v-if=
"scope.row.state == 0"
>
未考试
</span>
...
@@ -104,6 +124,7 @@
...
@@ -104,6 +124,7 @@
</
template
>
</
template
>
</el-table-column>
</el-table-column>
</el-table>
</el-table>
<pagination
<pagination
v-show=
"totalDetail > 0"
v-show=
"totalDetail > 0"
:total=
"totalDetail"
:total=
"totalDetail"
...
@@ -116,7 +137,7 @@
...
@@ -116,7 +137,7 @@
</template>
</template>
<
script
>
<
script
>
import
{
statisticsTrainCourse
,
testPersonDetailByCourseId
}
from
"@/api/educationPlanExam/lessonsProgram.js"
;
import
{
statisticsTrainCourse
,
testPersonDetailByCourseId
,
exportDeviceInfo
}
from
"@/api/educationPlanExam/lessonsProgram.js"
;
export
default
{
export
default
{
name
:
"testStat"
,
name
:
"testStat"
,
data
(){
data
(){
...
@@ -126,6 +147,7 @@
...
@@ -126,6 +147,7 @@
// 总条数
// 总条数
total
:
0
,
total
:
0
,
releaseTime
:
""
,
releaseTime
:
""
,
courseName
:
""
,
queryParams
:{
queryParams
:{
pageNum
:
1
,
pageNum
:
1
,
pageSize
:
10
,
pageSize
:
10
,
...
@@ -134,6 +156,8 @@
...
@@ -134,6 +156,8 @@
releaseTimeBegin
:
""
,
releaseTimeBegin
:
""
,
releaseTimeEnd
:
""
releaseTimeEnd
:
""
},
},
// 导出遮罩层
exportLoading
:
false
,
testStatData
:[],
testStatData
:[],
testStatDetailOpen
:
false
,
testStatDetailOpen
:
false
,
testStatDetailData
:
[],
testStatDetailData
:
[],
...
@@ -141,7 +165,7 @@
...
@@ -141,7 +165,7 @@
queryDetailParams
:{
queryDetailParams
:{
pageNum
:
1
,
pageNum
:
1
,
pageSize
:
10
,
pageSize
:
10
,
courseId
:
""
courseId
:
0
}
}
}
}
},
},
...
@@ -149,6 +173,20 @@
...
@@ -149,6 +173,20 @@
this
.
getTestList
();
this
.
getTestList
();
},
},
methods
:
{
methods
:
{
/** 导出按钮操作 */
handleExport
()
{
this
.
$confirm
(
'是否确认导出所有考试详细数据项?'
,
"警告"
,
{
confirmButtonText
:
"确定"
,
cancelButtonText
:
"取消"
,
type
:
"warning"
}).
then
(()
=>
{
this
.
exportLoading
=
true
;
return
exportDeviceInfo
(
this
.
queryDetailParams
);
}).
then
(
response
=>
{
this
.
download
(
response
.
msg
);
this
.
exportLoading
=
false
;
}).
catch
(()
=>
{});
},
getTestList
(){
getTestList
(){
console
.
log
(
"this.queryParams:"
,
this
.
queryParams
)
console
.
log
(
"this.queryParams:"
,
this
.
queryParams
)
statisticsTrainCourse
(
this
.
queryParams
).
then
(
res
=>
{
statisticsTrainCourse
(
this
.
queryParams
).
then
(
res
=>
{
...
@@ -185,8 +223,10 @@
...
@@ -185,8 +223,10 @@
};
};
this
.
getTestList
();
this
.
getTestList
();
},
},
courseDetail
(
courseId
){
courseDetail
(
courseId
,
courseName
){
this
.
testStatDetailOpen
=
true
;
this
.
testStatDetailOpen
=
true
;
this
.
courseName
=
courseName
;
this
.
queryDetailParams
.
courseId
=
courseId
;
this
.
getTestStatDetails
(
courseId
);
this
.
getTestStatDetails
(
courseId
);
},
},
getTestStatDetails
(
courseId
){
getTestStatDetails
(
courseId
){
...
...
danger-manage-web/src/views/educationPlanExam/visitorTestStat/index.vue
View file @
238a296c
...
@@ -62,11 +62,11 @@
...
@@ -62,11 +62,11 @@
<
span
>
{{
parseTime
(
scope
.
row
.
testEndTime
,
'{y
}
-{m
}
-{d
}
{h
}
:{i
}
:{s
}
'
)
}}
<
/span
>
<
span
>
{{
parseTime
(
scope
.
row
.
testEndTime
,
'{y
}
-{m
}
-{d
}
{h
}
:{i
}
:{s
}
'
)
}}
<
/span
>
<
/template
>
<
/template
>
<
/el-table-column
>
<
/el-table-column
>
<!--
<
el
-
table
-
column
label
=
"正确率"
align
=
"center"
prop
=
"score"
>--
>
<
el
-
table
-
column
label
=
"答题得分"
align
=
"center"
prop
=
"score"
>
<!--
<
template
slot
-
scope
=
"scope"
>--
>
<
template
slot
-
scope
=
"scope"
>
<!--
<
span
>
{{
Math
.
round
(
scope
.
row
.
score
/
topicNum
*
100
)
}}
%<
/span>--
>
<
span
>
{{
scope
.
row
.
score
}}
<
/span
>
<!--
<
/template>--
>
<
/template
>
<!--
<
/el-table-column>--
>
<
/el-table-column
>
<
el
-
table
-
column
label
=
"是否合格"
align
=
"center"
prop
=
"isQualified"
>
<
el
-
table
-
column
label
=
"是否合格"
align
=
"center"
prop
=
"isQualified"
>
<
template
slot
-
scope
=
"scope"
>
<
template
slot
-
scope
=
"scope"
>
<
span
v
-
if
=
"scope.row.isQualified == '0'"
>
合格
<
/span
>
<
span
v
-
if
=
"scope.row.isQualified == '0'"
>
合格
<
/span
>
...
...
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