Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
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
Hide 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;
import
com.zehong.common.utils.poi.ExcelUtil
;
import
com.zehong.framework.web.service.TokenService
;
import
com.zehong.system.domain.StatisticsTrainCourse
;
import
com.zehong.system.domain.TDeviceInfo
;
import
com.zehong.system.domain.TTrainCourse
;
import
com.zehong.system.domain.TTrainUserCourse
;
import
com.zehong.system.domain.vo.UserCourseVo
;
...
...
@@ -193,4 +194,16 @@ public class TTrainCourseController extends BaseController
List
<
TTrainUserCourse
>
persons
=
tTrainCourseService
.
testPersonDetailByCourseId
(
courseId
);
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
...
...
@@ -9,7 +9,7 @@ import com.zehong.common.core.domain.BaseEntity;
/**
* 用户课程对象 t_train_user_course
*
*
* @author zehong
* @date 2022-09-19
*/
...
...
@@ -21,42 +21,60 @@ public class TTrainUserCourse extends BaseEntity
private
Long
userCourseId
;
/** 用户id */
@Excel
(
name
=
"用户id"
)
private
Long
userId
;
/** 课程id */
@Excel
(
name
=
"课程id"
)
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"
)
@Excel
(
name
=
"
最后一次
考试时间"
,
width
=
30
,
dateFormat
=
"yyyy-MM-dd"
)
@Excel
(
name
=
"考试时间"
,
width
=
30
,
dateFormat
=
"yyyy-MM-dd"
)
private
Date
examinationTime
;
/** 最后一次考试结果(答对数量) */
@Excel
(
name
=
"
最后一次考试结果"
,
readConverterExp
=
"答=对数量
"
)
@Excel
(
name
=
"
得分
"
)
private
Integer
examinationResult
;
/** 创建人 */
@Excel
(
name
=
"创建人"
)
private
String
createUser
;
/**人员名称**/
private
String
staffName
;
/** 0未学习 1未通过 2已通过 */
private
Integer
state
;
/**人员部门**/
private
String
deptName
;
/** 0未学习 1未通过 2已通过 */
@Excel
(
name
=
"考试结果"
)
private
String
states
;
private
Integer
personnelType
;
private
Integer
finishDuration
;
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
()
{
return
finishDuration
;
}
...
...
@@ -86,61 +104,61 @@ public class TTrainUserCourse extends BaseEntity
this
.
userCourseId
=
userCourseId
;
}
public
Long
getUserCourseId
()
public
Long
getUserCourseId
()
{
return
userCourseId
;
}
public
void
setUserId
(
Long
userId
)
public
void
setUserId
(
Long
userId
)
{
this
.
userId
=
userId
;
}
public
Long
getUserId
()
public
Long
getUserId
()
{
return
userId
;
}
public
void
setCourseId
(
Long
courseId
)
public
void
setCourseId
(
Long
courseId
)
{
this
.
courseId
=
courseId
;
}
public
Long
getCourseId
()
public
Long
getCourseId
()
{
return
courseId
;
}
public
void
setState
(
Integer
state
)
public
void
setState
(
Integer
state
)
{
this
.
state
=
state
;
}
public
Integer
getState
()
public
Integer
getState
()
{
return
state
;
}
public
void
setExaminationTime
(
Date
examinationTime
)
public
void
setExaminationTime
(
Date
examinationTime
)
{
this
.
examinationTime
=
examinationTime
;
}
public
Date
getExaminationTime
()
public
Date
getExaminationTime
()
{
return
examinationTime
;
}
public
void
setExaminationResult
(
Integer
examinationResult
)
public
void
setExaminationResult
(
Integer
examinationResult
)
{
this
.
examinationResult
=
examinationResult
;
}
public
Integer
getExaminationResult
()
public
Integer
getExaminationResult
()
{
return
examinationResult
;
}
public
void
setCreateUser
(
String
createUser
)
public
void
setCreateUser
(
String
createUser
)
{
this
.
createUser
=
createUser
;
}
public
String
getCreateUser
()
public
String
getCreateUser
()
{
return
createUser
;
}
...
...
@@ -163,15 +181,20 @@ public class TTrainUserCourse extends BaseEntity
@Override
public
String
toString
()
{
return
new
ToStringBuilder
(
this
,
ToStringStyle
.
MULTI_LINE_STYLE
)
.
append
(
"userCourseId"
,
getUserCourseId
())
.
append
(
"userId"
,
getUserId
())
.
append
(
"courseId"
,
getCourseId
())
.
append
(
"state"
,
getState
())
.
append
(
"examinationTime"
,
getExaminationTime
())
.
append
(
"examinationResult"
,
getExaminationResult
())
.
append
(
"createTime"
,
getCreateTime
())
.
append
(
"createUser"
,
getCreateUser
())
.
toString
();
return
"TTrainUserCourse{"
+
"userCourseId="
+
userCourseId
+
", userId="
+
userId
+
", courseId="
+
courseId
+
", staffName='"
+
staffName
+
'\''
+
", createUser='"
+
createUser
+
'\''
+
", deptName='"
+
deptName
+
'\''
+
", examinationTime="
+
examinationTime
+
", examinationResult="
+
examinationResult
+
", 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
...
...
@@ -5,15 +5,15 @@ import com.zehong.system.domain.TTrainUserCourse;
/**
* 用户课程Mapper接口
*
*
* @author zehong
* @date 2022-09-19
*/
public
interface
TTrainUserCourseMapper
public
interface
TTrainUserCourseMapper
{
/**
* 查询用户课程
*
*
* @param userCourseId 用户课程ID
* @return 用户课程
*/
...
...
@@ -21,7 +21,7 @@ public interface TTrainUserCourseMapper
/**
* 查询用户课程列表
*
*
* @param tTrainUserCourse 用户课程
* @return 用户课程集合
*/
...
...
@@ -29,7 +29,7 @@ public interface TTrainUserCourseMapper
/**
* 新增用户课程
*
*
* @param tTrainUserCourse 用户课程
* @return 结果
*/
...
...
@@ -37,7 +37,7 @@ public interface TTrainUserCourseMapper
/**
* 修改用户课程
*
*
* @param tTrainUserCourse 用户课程
* @return 结果
*/
...
...
@@ -45,7 +45,7 @@ public interface TTrainUserCourseMapper
/**
* 删除用户课程
*
*
* @param userCourseId 用户课程ID
* @return 结果
*/
...
...
@@ -53,7 +53,7 @@ public interface TTrainUserCourseMapper
/**
* 批量删除用户课程
*
*
* @param userCourseIds 需要删除的数据ID
* @return 结果
*/
...
...
@@ -65,4 +65,11 @@ public interface TTrainUserCourseMapper
* @return List<TTrainUserCourse>
*/
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
* @return List<TTrainUserCourse>
*/
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
return
tTrainUserCourseMapper
.
testPersonDetailByCourseId
(
courseId
);
}
/**
* 导出所有考试详细数据项
* @param courseId
* @return
*/
@Override
public
List
<
TTrainUserCourse
>
examDetails
(
Long
courseId
)
{
return
tTrainUserCourseMapper
.
examDetails
(
courseId
);
}
@Override
public
TTrainUserCourse
getUserCourse
(
Long
userCourseId
){
TTrainUserCourse
userCourse
=
tTrainUserCourseMapper
.
selectTTrainUserCourseById
(
userCourseId
);
...
...
danger-manage-system/src/main/resources/mapper/system/TTrainUserCourseMapper.xml
View file @
238a296c
...
...
@@ -3,7 +3,7 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.zehong.system.mapper.TTrainUserCourseMapper"
>
<resultMap
type=
"TTrainUserCourse"
id=
"TTrainUserCourseResult"
>
<result
property=
"userCourseId"
column=
"user_course_id"
/>
<result
property=
"userId"
column=
"user_id"
/>
...
...
@@ -18,6 +18,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result
property=
"deptName"
column=
"dept_name"
/>
<result
property=
"finishDuration"
column=
"finish_duration"
/>
<result
property=
"trainState"
column=
"train_state"
/>
<result
property=
"states"
column=
"states"
/>
</resultMap>
<sql
id=
"selectTTrainUserCourseVo"
>
...
...
@@ -35,12 +36,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"createUser != null and createUser != ''"
>
and create_user = #{createUser}
</if>
</where>
</select>
<select
id=
"selectTTrainUserCourseById"
parameterType=
"Long"
resultMap=
"TTrainUserCourseResult"
>
<include
refid=
"selectTTrainUserCourseVo"
/>
where user_course_id = #{userCourseId}
</select>
<insert
id=
"insertTTrainUserCourse"
parameterType=
"TTrainUserCourse"
useGeneratedKeys=
"true"
keyProperty=
"userCourseId"
>
insert into t_train_user_course
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
...
...
@@ -91,7 +92,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<delete
id=
"deleteTTrainUserCourseByIds"
parameterType=
"String"
>
delete from t_train_user_course where user_course_id in
delete from t_train_user_course where user_course_id in
<foreach
item=
"userCourseId"
collection=
"array"
open=
"("
separator=
","
close=
")"
>
#{userCourseId}
</foreach>
...
...
@@ -102,11 +103,35 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
sys.staff_name,
d.dept_name,
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
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>
</mapper>
\ No newline at end of file
</mapper>
danger-manage-web/src/api/educationPlanExam/lessonsProgram.js
View file @
238a296c
...
...
@@ -193,3 +193,12 @@ export function bachAddTopicGuest(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 @@
<el-table-column
label=
"应参加人数"
align=
"center"
prop=
"count"
/>
<el-table-column
label=
"实际考试人数"
align=
"center"
prop=
"test"
/>
<el-table-column
label=
"合格人数"
align=
"center"
prop=
"pass"
/>
<el-table-column
label=
"合格率"
align=
"center"
prop=
"rate"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
rate
}}
%
</
template
>
</el-table-column
>
<!-- <el-table-column label="合格率" align="center" prop="rate">--
>
<!-- <template slot-scope="scope">--
>
<!-- {{scope.row.rate}}%-->
<!-- </template>--
>
<!-- </el-table-column>--
>
<el-table-column
label=
"操作"
align=
"center"
class-name=
"small-padding fixed-width"
>
<
template
v-slot=
"{ row: { courseId
}
}"
>
<
template
v-slot=
"{ row: { courseId
,courseName}
}"
>
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-edit"
@
click=
"courseDetail(courseId)"
@
click=
"courseDetail(courseId
,courseName
)"
>
查看详情
</el-button>
</
template
>
</el-table-column>
...
...
@@ -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-column
label=
"序号"
width=
'100'
align=
"center"
prop=
"detailNum"
/>
<el-table-column
label=
"考试人员"
align=
"center"
prop=
"staffName"
/>
<el-table-column
label=
"所属部门"
align=
"center"
prop=
"deptName"
/>
<el-table-column
label=
"考试时间"
align=
"center"
prop=
"examinationTime"
/>
<el-table-column
label=
"答对个数"
align=
"center"
prop=
"examinationResult"
/>
<el-table-column
label=
"所属部门"
align=
"center"
prop=
"deptName"
>
<span
slot-scope=
"scope"
v-if=
"scope.row.deptName"
>
{{scope.row.deptName}}
</span>
<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"
>
<
template
slot-scope=
"scope"
>
<span
v-if=
"scope.row.state == 0"
>
未考试
</span>
...
...
@@ -104,6 +124,7 @@
</
template
>
</el-table-column>
</el-table>
<pagination
v-show=
"totalDetail > 0"
:total=
"totalDetail"
...
...
@@ -116,7 +137,7 @@
</template>
<
script
>
import
{
statisticsTrainCourse
,
testPersonDetailByCourseId
}
from
"@/api/educationPlanExam/lessonsProgram.js"
;
import
{
statisticsTrainCourse
,
testPersonDetailByCourseId
,
exportDeviceInfo
}
from
"@/api/educationPlanExam/lessonsProgram.js"
;
export
default
{
name
:
"testStat"
,
data
(){
...
...
@@ -126,6 +147,7 @@
// 总条数
total
:
0
,
releaseTime
:
""
,
courseName
:
""
,
queryParams
:{
pageNum
:
1
,
pageSize
:
10
,
...
...
@@ -134,6 +156,8 @@
releaseTimeBegin
:
""
,
releaseTimeEnd
:
""
},
// 导出遮罩层
exportLoading
:
false
,
testStatData
:[],
testStatDetailOpen
:
false
,
testStatDetailData
:
[],
...
...
@@ -141,7 +165,7 @@
queryDetailParams
:{
pageNum
:
1
,
pageSize
:
10
,
courseId
:
""
courseId
:
0
}
}
},
...
...
@@ -149,6 +173,20 @@
this
.
getTestList
();
},
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
(){
console
.
log
(
"this.queryParams:"
,
this
.
queryParams
)
statisticsTrainCourse
(
this
.
queryParams
).
then
(
res
=>
{
...
...
@@ -185,8 +223,10 @@
};
this
.
getTestList
();
},
courseDetail
(
courseId
){
courseDetail
(
courseId
,
courseName
){
this
.
testStatDetailOpen
=
true
;
this
.
courseName
=
courseName
;
this
.
queryDetailParams
.
courseId
=
courseId
;
this
.
getTestStatDetails
(
courseId
);
},
getTestStatDetails
(
courseId
){
...
...
danger-manage-web/src/views/educationPlanExam/visitorTestStat/index.vue
View file @
238a296c
...
...
@@ -62,11 +62,11 @@
<
span
>
{{
parseTime
(
scope
.
row
.
testEndTime
,
'{y
}
-{m
}
-{d
}
{h
}
:{i
}
:{s
}
'
)
}}
<
/span
>
<
/template
>
<
/el-table-column
>
<!--
<
el
-
table
-
column
label
=
"正确率"
align
=
"center"
prop
=
"score"
>--
>
<!--
<
template
slot
-
scope
=
"scope"
>--
>
<!--
<
span
>
{{
Math
.
round
(
scope
.
row
.
score
/
topicNum
*
100
)
}}
%<
/span>--
>
<!--
<
/template>--
>
<!--
<
/el-table-column>--
>
<
el
-
table
-
column
label
=
"答题得分"
align
=
"center"
prop
=
"score"
>
<
template
slot
-
scope
=
"scope"
>
<
span
>
{{
scope
.
row
.
score
}}
<
/span
>
<
/template
>
<
/el-table-column
>
<
el
-
table
-
column
label
=
"是否合格"
align
=
"center"
prop
=
"isQualified"
>
<
template
slot
-
scope
=
"scope"
>
<
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