【新增】 监控管理下载学生文件
This commit is contained in:
@@ -30,7 +30,9 @@ import static pc.exam.pp.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
import pc.exam.pp.module.exam.controller.admin.monitor.vo.*;
|
||||
import pc.exam.pp.module.exam.dal.dataobject.EducationPaperTask;
|
||||
import pc.exam.pp.module.exam.dal.dataobject.monitor.MonitorDO;
|
||||
import pc.exam.pp.module.exam.dal.dataobject.student.StuPaperFileDO;
|
||||
import pc.exam.pp.module.exam.service.monitor.MonitorService;
|
||||
import pc.exam.pp.module.exam.service.stu_paper_file.StuPaperFileService;
|
||||
|
||||
import static pc.exam.pp.module.infra.enums.ErrorCodeConstants.DEMO03_MONITOR_SESSION_EXISTS;
|
||||
import static pc.exam.pp.module.infra.enums.ErrorCodeConstants.DEMO03_MONITOR_TIME_EXISTS;
|
||||
@@ -42,6 +44,8 @@ import static pc.exam.pp.module.infra.enums.ErrorCodeConstants.DEMO03_MONITOR_TI
|
||||
public class MonitorController {
|
||||
@Resource
|
||||
private MonitorService monitorService;
|
||||
@Resource
|
||||
StuPaperFileService stuPaperFileService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建监控管理")
|
||||
@@ -137,4 +141,13 @@ public class MonitorController {
|
||||
return success(monitorService.updateMonitorStatus(stuMonitorStatusVo));
|
||||
}
|
||||
|
||||
@GetMapping("/getMonitorStuFileUrl")
|
||||
public CommonResult<String> getMonitorStuFileUrl(@RequestParam("temporaryId") String temporaryId) {
|
||||
StuPaperFileDO stuPaperFileDO = stuPaperFileService.selectByTemporaryId(temporaryId);
|
||||
if (stuPaperFileDO == null) {
|
||||
return error(1_1_606_003, "学生文件不存在");
|
||||
}
|
||||
return success(stuPaperFileDO.getUrl());
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,9 +1,14 @@
|
||||
package pc.exam.pp.module.exam.controller.admin.monitor.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 监控管理 Response VO")
|
||||
@@ -11,46 +16,48 @@ import com.alibaba.excel.annotation.*;
|
||||
@ExcelIgnoreUnannotated
|
||||
public class MonitorRespVO {
|
||||
|
||||
private String monitorId;
|
||||
private String monitorId;
|
||||
|
||||
@ExcelProperty("用户账号")
|
||||
private String username;
|
||||
@ExcelProperty("用户账号")
|
||||
private String username;
|
||||
|
||||
@ExcelProperty("用户姓名")
|
||||
private String nickname;
|
||||
@ExcelProperty("用户姓名")
|
||||
private String nickname;
|
||||
|
||||
@ExcelProperty("班级")
|
||||
private String className;
|
||||
@ExcelProperty("班级")
|
||||
private String className;
|
||||
|
||||
@ExcelProperty("考试状态")
|
||||
private String examStatus;
|
||||
@ExcelProperty("考试状态")
|
||||
private String examStatus;
|
||||
|
||||
@Schema(description = "成绩")
|
||||
@ExcelProperty("成绩")
|
||||
private String score;
|
||||
@Schema(description = "成绩")
|
||||
@ExcelProperty("成绩")
|
||||
private String score;
|
||||
|
||||
@Schema(description = "试卷编号")
|
||||
@ExcelProperty("试卷编号")
|
||||
private String paperNum;
|
||||
@Schema(description = "试卷编号")
|
||||
@ExcelProperty("试卷编号")
|
||||
private String paperNum;
|
||||
|
||||
@Schema(description = "任务名称")
|
||||
@ExcelProperty("任务名称")
|
||||
private String taskName;
|
||||
@Schema(description = "任务名称")
|
||||
@ExcelProperty("任务名称")
|
||||
private String taskName;
|
||||
|
||||
@Schema(description = "任务类别")
|
||||
@ExcelProperty("任务类别")
|
||||
private String taskType;
|
||||
@Schema(description = "任务类别")
|
||||
@ExcelProperty("任务类别")
|
||||
private String taskType;
|
||||
|
||||
@Schema(description = "机器ip")
|
||||
@ExcelProperty("机器ip")
|
||||
private String ip;
|
||||
@Schema(description = "机器ip")
|
||||
@ExcelProperty("机器ip")
|
||||
private String ip;
|
||||
|
||||
@Schema(description = "剩余时间")
|
||||
@ExcelProperty("剩余时间")
|
||||
private String remainingTime;
|
||||
private String temporaryId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
@Schema(description = "剩余时间")
|
||||
@ExcelProperty("剩余时间")
|
||||
private String remainingTime;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
|
@@ -18,4 +18,7 @@ public interface StuPaperFileMapper extends BaseMapperX<StuPaperFileDO> {
|
||||
List<StuPaperFileDO> findByStuIdAndPaperId(@Param("stuId") Long stuId, @Param("paperId") String paperId, @Param("temporaryId") String temporaryId);
|
||||
|
||||
List<StuPaperFileDO> findOneByStuIdAndPaperId(@Param("stuId")Long stuId, @Param("paperId")String paperId,@Param("type") int type);
|
||||
|
||||
StuPaperFileDO findByTemporaryId(@Param("temporaryId") String temporaryId);
|
||||
|
||||
}
|
@@ -376,7 +376,7 @@ public class MonitorServiceImpl implements MonitorService {
|
||||
if (StringUtils.isNotBlank(monitorDO.getScore())) {
|
||||
try {
|
||||
double oldScore = Double.parseDouble(monitorDO.getScore());
|
||||
if (score.doubleValue() > oldScore) {
|
||||
if (score.doubleValue() >= oldScore) {
|
||||
info.setScore(String.valueOf(score));
|
||||
info.setTemporaryId(stuMonitorPaperEndVo.getTemporaryId());
|
||||
} else {
|
||||
|
@@ -21,4 +21,6 @@ public interface StuPaperFileService {
|
||||
void insertStuPaperFile(StuPaperFileDO stuPaperFileDO);
|
||||
|
||||
void updateStuPaperFile(StuPaperFileDO stuPaperFileDO);
|
||||
|
||||
StuPaperFileDO selectByTemporaryId(String temporaryId);
|
||||
}
|
@@ -34,4 +34,9 @@ public class StuPaperFileServiceImpl implements StuPaperFileService {
|
||||
public void updateStuPaperFile(StuPaperFileDO stuPaperFileDO) {
|
||||
stuPaperFileMapper.updateById(stuPaperFileDO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public StuPaperFileDO selectByTemporaryId(String temporaryId) {
|
||||
return stuPaperFileMapper.findByTemporaryId(temporaryId);
|
||||
}
|
||||
}
|
@@ -23,5 +23,10 @@
|
||||
AND paper_id = #{paperId}
|
||||
and type = #{type}
|
||||
</select>
|
||||
<select id="findByTemporaryId" resultType="pc.exam.pp.module.exam.dal.dataobject.student.StuPaperFileDO">
|
||||
SELECT *
|
||||
FROM exam_stu_paper_fileurl
|
||||
WHERE temporary_id = #{temporaryId}
|
||||
</select>
|
||||
|
||||
</mapper>
|
Reference in New Issue
Block a user