Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
邬吉朋
practical_train
Commits
39ea4860
Commit
39ea4860
authored
Aug 14, 2026
by
wujipeng
Browse files
仿真考试数据接收
parent
e5c0e307
Changes
6
Show whitespace changes
Inline
Side-by-side
practical-api/practical-business-api/src/main/java/com/platform/business/model/vo/ExamStudentVO.java
View file @
39ea4860
package
com.platform.business.model.vo
;
package
com.platform.business.model.vo
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
com.platform.business.model.entity.ExamStudentEntity
;
import
com.platform.business.model.entity.ExamStudentEntity
;
...
@@ -8,6 +9,7 @@ import lombok.Data;
...
@@ -8,6 +9,7 @@ import lombok.Data;
import
lombok.EqualsAndHashCode
;
import
lombok.EqualsAndHashCode
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
@Data
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@EqualsAndHashCode
(
callSuper
=
true
)
...
@@ -68,4 +70,15 @@ public class ExamStudentVO extends ExamStudentEntity {
...
@@ -68,4 +70,15 @@ public class ExamStudentVO extends ExamStudentEntity {
@ApiModelProperty
(
value
=
"得分率"
)
@ApiModelProperty
(
value
=
"得分率"
)
private
String
scoreRate
;
private
String
scoreRate
;
@ApiModelProperty
(
value
=
"禁止交卷时长"
)
private
Integer
forbid
;
@ApiModelProperty
(
value
=
"首席考评员id"
)
private
String
chiefId
;
@ApiModelProperty
(
value
=
"监考教师id"
)
private
String
invigilationId
;
private
List
<
ExamStudentVO
>
data
;
}
}
practical-business/src/main/java/com/platform/business/controller/ExamStudentController.java
View file @
39ea4860
package
com.platform.business.controller
;
package
com.platform.business.controller
;
import
com.platform.business.model.dto.ExamStudentDTO
;
import
com.platform.business.model.dto.ExamStudentDTO
;
import
com.platform.business.model.vo.ExamStudentVO
;
import
com.platform.business.service.ExamStudentService
;
import
com.platform.business.service.ExamStudentService
;
import
com.platform.controller.BaseController
;
import
com.platform.controller.BaseController
;
import
com.platform.model.resp.Result
;
import
com.platform.model.resp.Result
;
...
@@ -31,4 +32,11 @@ public class ExamStudentController extends BaseController {
...
@@ -31,4 +32,11 @@ public class ExamStudentController extends BaseController {
public
Result
<
Map
<
String
,
String
>>
summary
(
@PathVariable
String
studentId
)
{
public
Result
<
Map
<
String
,
String
>>
summary
(
@PathVariable
String
studentId
)
{
return
Result
.
data
(
examStudentService
.
summary
(
studentId
));
return
Result
.
data
(
examStudentService
.
summary
(
studentId
));
}
}
@ApiOperation
(
value
=
"根据学生id查询最近的一场考试"
)
@GetMapping
(
"/recent/{studentId}"
)
public
Result
<
ExamStudentVO
>
recent
(
@PathVariable
String
studentId
)
{
return
Result
.
data
(
examStudentService
.
recent
(
studentId
));
}
}
}
practical-business/src/main/java/com/platform/business/mapper/ExamStudentMapper.java
View file @
39ea4860
...
@@ -27,4 +27,7 @@ public interface ExamStudentMapper extends BaseMapper<ExamStudentEntity> {
...
@@ -27,4 +27,7 @@ public interface ExamStudentMapper extends BaseMapper<ExamStudentEntity> {
Map
<
String
,
String
>
summary
(
@Param
(
"studentId"
)
String
studentId
);
Map
<
String
,
String
>
summary
(
@Param
(
"studentId"
)
String
studentId
);
ExamStudentVO
recent
(
@Param
(
"studentId"
)
String
studentId
);
List
<
ExamStudentVO
>
theSameEvent
(
@Param
(
"examId"
)
Integer
examId
);
}
}
practical-business/src/main/java/com/platform/business/service/ExamStudentService.java
View file @
39ea4860
...
@@ -30,4 +30,6 @@ public interface ExamStudentService extends IService<ExamStudentEntity> {
...
@@ -30,4 +30,6 @@ public interface ExamStudentService extends IService<ExamStudentEntity> {
Map
<
String
,
String
>
summary
(
String
studentId
);
Map
<
String
,
String
>
summary
(
String
studentId
);
ExamStudentVO
recent
(
String
studentId
);
}
}
practical-business/src/main/java/com/platform/business/service/impl/ExamStaudentServiceImpl.java
View file @
39ea4860
...
@@ -63,4 +63,13 @@ public class ExamStaudentServiceImpl extends ServiceImpl<ExamStudentMapper, Exam
...
@@ -63,4 +63,13 @@ public class ExamStaudentServiceImpl extends ServiceImpl<ExamStudentMapper, Exam
}
}
return
result
;
return
result
;
}
}
@Override
public
ExamStudentVO
recent
(
String
studentId
)
{
ExamStudentVO
examStudentVO
=
baseMapper
.
recent
(
studentId
);
//获取同一场考试的学生
List
<
ExamStudentVO
>
data
=
baseMapper
.
theSameEvent
(
examStudentVO
.
getExamId
());
examStudentVO
.
setData
(
data
);
return
examStudentVO
;
}
}
}
practical-business/src/main/resources/com/platform/business/mapper/ExamStudentMapper.xml
View file @
39ea4860
...
@@ -127,4 +127,29 @@
...
@@ -127,4 +127,29 @@
GROUP BY
GROUP BY
es.class_id;
es.class_id;
</select>
</select>
<select
id=
"recent"
resultType=
"com.platform.business.model.vo.ExamStudentVO"
>
select u.level as lev,
e.type,
e.name as examName,
es.start_time as startTime,
es.duration,
e.forbid,
e.chief_id as chiefId,
e.invigilation_id as invigilationId,
es.exam_id as examId,
c.name as className
from exam_student es
left join exam e on es.exam_id = e.id
left join user u on es.student_id = u.id
left join class c on e.class_id = c.id
where u.id = #{studentId}
order by es.start_time desc
limit 1
</select>
<select
id=
"theSameEvent"
resultType=
"com.platform.business.model.vo.ExamStudentVO"
>
select es.student_id as studentId, u.nick_name as studentName
from exam_student es
left join user u on es.student_id = u.id
where es.exam_id = #{examId}
</select>
</mapper>
</mapper>
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