【新增】 监控管理下载学生文件
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.controller.admin.monitor.vo.*;
|
||||||
import pc.exam.pp.module.exam.dal.dataobject.EducationPaperTask;
|
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.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.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_SESSION_EXISTS;
|
||||||
import static pc.exam.pp.module.infra.enums.ErrorCodeConstants.DEMO03_MONITOR_TIME_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 {
|
public class MonitorController {
|
||||||
@Resource
|
@Resource
|
||||||
private MonitorService monitorService;
|
private MonitorService monitorService;
|
||||||
|
@Resource
|
||||||
|
StuPaperFileService stuPaperFileService;
|
||||||
|
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
@Operation(summary = "创建监控管理")
|
@Operation(summary = "创建监控管理")
|
||||||
@@ -137,4 +141,13 @@ public class MonitorController {
|
|||||||
return success(monitorService.updateMonitorStatus(stuMonitorStatusVo));
|
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;
|
package pc.exam.pp.module.exam.controller.admin.monitor.vo;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
import com.alibaba.excel.annotation.*;
|
import com.alibaba.excel.annotation.*;
|
||||||
|
|
||||||
@Schema(description = "管理后台 - 监控管理 Response VO")
|
@Schema(description = "管理后台 - 监控管理 Response VO")
|
||||||
@@ -11,46 +16,48 @@ import com.alibaba.excel.annotation.*;
|
|||||||
@ExcelIgnoreUnannotated
|
@ExcelIgnoreUnannotated
|
||||||
public class MonitorRespVO {
|
public class MonitorRespVO {
|
||||||
|
|
||||||
private String monitorId;
|
private String monitorId;
|
||||||
|
|
||||||
@ExcelProperty("用户账号")
|
@ExcelProperty("用户账号")
|
||||||
private String username;
|
private String username;
|
||||||
|
|
||||||
@ExcelProperty("用户姓名")
|
@ExcelProperty("用户姓名")
|
||||||
private String nickname;
|
private String nickname;
|
||||||
|
|
||||||
@ExcelProperty("班级")
|
@ExcelProperty("班级")
|
||||||
private String className;
|
private String className;
|
||||||
|
|
||||||
@ExcelProperty("考试状态")
|
@ExcelProperty("考试状态")
|
||||||
private String examStatus;
|
private String examStatus;
|
||||||
|
|
||||||
@Schema(description = "成绩")
|
@Schema(description = "成绩")
|
||||||
@ExcelProperty("成绩")
|
@ExcelProperty("成绩")
|
||||||
private String score;
|
private String score;
|
||||||
|
|
||||||
@Schema(description = "试卷编号")
|
@Schema(description = "试卷编号")
|
||||||
@ExcelProperty("试卷编号")
|
@ExcelProperty("试卷编号")
|
||||||
private String paperNum;
|
private String paperNum;
|
||||||
|
|
||||||
@Schema(description = "任务名称")
|
@Schema(description = "任务名称")
|
||||||
@ExcelProperty("任务名称")
|
@ExcelProperty("任务名称")
|
||||||
private String taskName;
|
private String taskName;
|
||||||
|
|
||||||
@Schema(description = "任务类别")
|
@Schema(description = "任务类别")
|
||||||
@ExcelProperty("任务类别")
|
@ExcelProperty("任务类别")
|
||||||
private String taskType;
|
private String taskType;
|
||||||
|
|
||||||
@Schema(description = "机器ip")
|
@Schema(description = "机器ip")
|
||||||
@ExcelProperty("机器ip")
|
@ExcelProperty("机器ip")
|
||||||
private String ip;
|
private String ip;
|
||||||
|
|
||||||
@Schema(description = "剩余时间")
|
private String temporaryId;
|
||||||
@ExcelProperty("剩余时间")
|
|
||||||
private String remainingTime;
|
|
||||||
|
|
||||||
@Schema(description = "创建时间")
|
@Schema(description = "剩余时间")
|
||||||
@ExcelProperty("创建时间")
|
@ExcelProperty("剩余时间")
|
||||||
private LocalDateTime createTime;
|
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> 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);
|
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())) {
|
if (StringUtils.isNotBlank(monitorDO.getScore())) {
|
||||||
try {
|
try {
|
||||||
double oldScore = Double.parseDouble(monitorDO.getScore());
|
double oldScore = Double.parseDouble(monitorDO.getScore());
|
||||||
if (score.doubleValue() > oldScore) {
|
if (score.doubleValue() >= oldScore) {
|
||||||
info.setScore(String.valueOf(score));
|
info.setScore(String.valueOf(score));
|
||||||
info.setTemporaryId(stuMonitorPaperEndVo.getTemporaryId());
|
info.setTemporaryId(stuMonitorPaperEndVo.getTemporaryId());
|
||||||
} else {
|
} else {
|
||||||
|
@@ -21,4 +21,6 @@ public interface StuPaperFileService {
|
|||||||
void insertStuPaperFile(StuPaperFileDO stuPaperFileDO);
|
void insertStuPaperFile(StuPaperFileDO stuPaperFileDO);
|
||||||
|
|
||||||
void updateStuPaperFile(StuPaperFileDO stuPaperFileDO);
|
void updateStuPaperFile(StuPaperFileDO stuPaperFileDO);
|
||||||
|
|
||||||
|
StuPaperFileDO selectByTemporaryId(String temporaryId);
|
||||||
}
|
}
|
@@ -34,4 +34,9 @@ public class StuPaperFileServiceImpl implements StuPaperFileService {
|
|||||||
public void updateStuPaperFile(StuPaperFileDO stuPaperFileDO) {
|
public void updateStuPaperFile(StuPaperFileDO stuPaperFileDO) {
|
||||||
stuPaperFileMapper.updateById(stuPaperFileDO);
|
stuPaperFileMapper.updateById(stuPaperFileDO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StuPaperFileDO selectByTemporaryId(String temporaryId) {
|
||||||
|
return stuPaperFileMapper.findByTemporaryId(temporaryId);
|
||||||
|
}
|
||||||
}
|
}
|
@@ -23,5 +23,10 @@
|
|||||||
AND paper_id = #{paperId}
|
AND paper_id = #{paperId}
|
||||||
and type = #{type}
|
and type = #{type}
|
||||||
</select>
|
</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>
|
</mapper>
|
Reference in New Issue
Block a user