【修改】 任务编号:添加逻辑为年月日+任务数量+1
This commit is contained in:
@@ -46,7 +46,7 @@ import java.util.stream.Collectors;
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/tool")
|
||||
@Tag( name = "测试判分")
|
||||
@Tag(name = "测试判分")
|
||||
@Validated
|
||||
public class AutoToolsController {
|
||||
@Resource
|
||||
@@ -70,14 +70,14 @@ public class AutoToolsController {
|
||||
|
||||
@GetMapping("/getStuScoreInfo")
|
||||
@Operation(summary = "通过学生ID、试卷ID获取")
|
||||
public CommonResult<StuPaperScoreInfoVo> getStuScore(StuPaperReqVo stuPaperReqVo){
|
||||
public CommonResult<StuPaperScoreInfoVo> getStuScore(StuPaperReqVo stuPaperReqVo) {
|
||||
// 1、创建对象
|
||||
StuPaperScoreInfoVo stuPaperScoreInfoVos = new StuPaperScoreInfoVo();
|
||||
// 2、查询学生试卷信息
|
||||
StuScoreVo stuScoreVo = stuPaperScoreService.getStuScore(stuPaperReqVo.getStuId(),stuPaperReqVo.getPaperId(), stuPaperReqVo.getTemporaryId());
|
||||
StuScoreVo stuScoreVo = stuPaperScoreService.getStuScore(stuPaperReqVo.getStuId(), stuPaperReqVo.getPaperId(), stuPaperReqVo.getTemporaryId());
|
||||
stuPaperScoreInfoVos.setStuInfoReqVo(stuScoreVo);
|
||||
// 3、查询学生试卷得分信息
|
||||
stuPaperScoreInfoVos.setStuPaperScoreDOList(stuPaperScoreService.findByStuIDAndPaperId(stuPaperReqVo.getStuId(),stuPaperReqVo.getPaperId(), stuPaperReqVo.getTemporaryId()));
|
||||
stuPaperScoreInfoVos.setStuPaperScoreDOList(stuPaperScoreService.findByStuIDAndPaperId(stuPaperReqVo.getStuId(), stuPaperReqVo.getPaperId(), stuPaperReqVo.getTemporaryId()));
|
||||
// 4、查询学生试卷内容信息
|
||||
List<String> quIds = educationPaperQuMapper.selectPaperQuByPaperId(stuPaperReqVo.getPaperId());
|
||||
List<ExamQuestion> examQuestionList = examQuestionMapper.selectExamQuestionListByQuIds(quIds);
|
||||
@@ -90,7 +90,7 @@ public class AutoToolsController {
|
||||
// 一条一条进行查询试题,防止顺序错乱
|
||||
stuPaperScoreInfoVos.setExamQuestionList(examQuestionList);
|
||||
// 5、查询学生试卷分析
|
||||
List<StuPaperScoreDO> scoreDOS = stuPaperScoreService.findByStuIDAndPaperId(stuPaperReqVo.getStuId(),stuPaperReqVo.getPaperId(), stuPaperReqVo.getTemporaryId());
|
||||
List<StuPaperScoreDO> scoreDOS = stuPaperScoreService.findByStuIDAndPaperId(stuPaperReqVo.getStuId(), stuPaperReqVo.getPaperId(), stuPaperReqVo.getTemporaryId());
|
||||
String judgementStr = "<p>试卷分析</p>";
|
||||
for (StuPaperScoreDO scoreDO : scoreDOS) {
|
||||
judgementStr += "<p>---------------------------------------</p>";
|
||||
@@ -102,6 +102,7 @@ public class AutoToolsController {
|
||||
|
||||
/**
|
||||
* 开始考试 通过websocket进行传输时间
|
||||
*
|
||||
* @param stuInTheExam 信息
|
||||
* @return true
|
||||
*/
|
||||
@@ -116,7 +117,7 @@ public class AutoToolsController {
|
||||
// 获取登录用户
|
||||
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
||||
// 通过token获取用户redis信息,获取refreshToken
|
||||
OAuth2AccessTokenDO oAuth2AccessTokenDO = JsonUtils.parseObject(stringRedisTemplate.opsForValue().get("oauth2_access_token:"+token), OAuth2AccessTokenDO.class);
|
||||
OAuth2AccessTokenDO oAuth2AccessTokenDO = JsonUtils.parseObject(stringRedisTemplate.opsForValue().get("oauth2_access_token:" + token), OAuth2AccessTokenDO.class);
|
||||
int startTime = 0;
|
||||
if (oAuth2AccessTokenDO != null) {
|
||||
String refreshToken = oAuth2AccessTokenDO.getRefreshToken();
|
||||
@@ -178,6 +179,7 @@ public class AutoToolsController {
|
||||
|
||||
/**
|
||||
* 停止考试
|
||||
*
|
||||
* @return true
|
||||
*/
|
||||
@GetMapping("/stopExam")
|
||||
@@ -187,7 +189,7 @@ public class AutoToolsController {
|
||||
if (request != null) {
|
||||
token = SecurityFrameworkUtils.obtainAuthorization(request,
|
||||
securityProperties.getTokenHeader(), securityProperties.getTokenParameter());
|
||||
OAuth2AccessTokenDO oAuth2AccessTokenDO = JsonUtils.parseObject(stringRedisTemplate.opsForValue().get("oauth2_access_token:"+token), OAuth2AccessTokenDO.class);
|
||||
OAuth2AccessTokenDO oAuth2AccessTokenDO = JsonUtils.parseObject(stringRedisTemplate.opsForValue().get("oauth2_access_token:" + token), OAuth2AccessTokenDO.class);
|
||||
if (oAuth2AccessTokenDO != null) {
|
||||
// 删除对应的线程池
|
||||
String refreshToken = oAuth2AccessTokenDO.getRefreshToken();
|
||||
@@ -198,6 +200,7 @@ public class AutoToolsController {
|
||||
return CommonResult.success(false);
|
||||
}
|
||||
|
||||
// 时间转换
|
||||
public static String formatLongDuration(int totalSeconds) {
|
||||
int hours = totalSeconds / 3600;
|
||||
int minutes = (totalSeconds % 3600) / 60;
|
||||
|
Reference in New Issue
Block a user