|
|
|
@ -65,54 +65,12 @@ public class TeaGradeManageController {
|
|
|
|
|
private SysWeightMapper sysWeightMapper;
|
|
|
|
|
@Autowired
|
|
|
|
|
private StuTheoryExamMapper stuTheoryExamMapper;
|
|
|
|
|
|
|
|
|
|
// @AnonymousAccess
|
|
|
|
|
// @PostMapping("/getExamInfo")
|
|
|
|
|
// @ApiOperation("考试模式--页面展示(学生端实战考核复用)")
|
|
|
|
|
// public ResultEntity<PageInfo<TeaExamManageCountDto>> getExamInfo(@RequestParam Integer index,
|
|
|
|
|
// @RequestParam Integer size,
|
|
|
|
|
// @ApiParam("ManyAnswer为考试时间,JudgeAnswer为发布人") @RequestParam String schoolId) {
|
|
|
|
|
//
|
|
|
|
|
// List<TeaExamManage> teaExamManages = teaExamManageMapper.selectBySchoolId(schoolId);
|
|
|
|
|
// List<TeaExamManageCountDto>teaExamManageCountDtos =new AstList();
|
|
|
|
|
// for (TeaExamManage teaExamManage : teaExamManages) {
|
|
|
|
|
// List<String> nameList = new ArrayList<>();
|
|
|
|
|
// TeaExamManageCountDto copyexamManageWithBLOBs = new TeaExamManageCountDto();
|
|
|
|
|
// int num = 0;
|
|
|
|
|
// //获取班级和考试人数
|
|
|
|
|
// String classId = teaAndStudentExamMapper.selectByExamId(teaExamManage.getExamManageId());
|
|
|
|
|
// String[] split = classId.split(",");
|
|
|
|
|
// for (String s : split) {
|
|
|
|
|
// StuClass stuClass = stuClassMapper.selectByPrimaryKey(s);
|
|
|
|
|
// String className = stuClass.getClassName();
|
|
|
|
|
// nameList.add(className);
|
|
|
|
|
// int count = userMapper.selectNumByClass(s);
|
|
|
|
|
// num = num + count;
|
|
|
|
|
// }
|
|
|
|
|
// copyexamManageWithBLOBs.setExamClass(nameList);
|
|
|
|
|
// copyexamManageWithBLOBs.setExamNum(num);
|
|
|
|
|
// BeanUtils.copyProperties(teaExamManage, copyexamManageWithBLOBs);
|
|
|
|
|
// Date now = new Date(); // 当前日期
|
|
|
|
|
// Date endTime = teaExamManage.getEndTime(); // 从 teaExamManage 对象中获取的日期
|
|
|
|
|
// Date startTime = teaExamManage.getStartTime();
|
|
|
|
|
//
|
|
|
|
|
// if (now.compareTo(endTime) > 0) {
|
|
|
|
|
// copyexamManageWithBLOBs.setExamStatus("已结束");
|
|
|
|
|
// } else if (now.compareTo(startTime) < 0) {
|
|
|
|
|
// copyexamManageWithBLOBs.setExamStatus("未开始");
|
|
|
|
|
// } else {
|
|
|
|
|
// copyexamManageWithBLOBs.setExamStatus("进行中");
|
|
|
|
|
// }
|
|
|
|
|
// String concatenatedTimeString = startTime + " -- " + endTime;
|
|
|
|
|
// copyexamManageWithBLOBs.setExamTime(concatenatedTimeString); //考试时间
|
|
|
|
|
// String userId = teaExamManage.getUserId();
|
|
|
|
|
// StuUser stuUser = userMapper.selectByPrimaryKey(userId);
|
|
|
|
|
// copyexamManageWithBLOBs.setName(stuUser.getName()); //发布人
|
|
|
|
|
// teaExamManageCountDtos.add(copyexamManageWithBLOBs);
|
|
|
|
|
// }
|
|
|
|
|
// PageUtil.pageHelper(teaExamManageCountDtos, index, size);
|
|
|
|
|
// return new ResultEntity<>(new PageInfo<>(teaExamManageCountDtos));
|
|
|
|
|
// }
|
|
|
|
|
@Autowired
|
|
|
|
|
private SysCaseQuestionMapper sysCaseQuestionMapper;
|
|
|
|
|
@Autowired
|
|
|
|
|
private SysCaseQuestionStepMapper sysCaseQuestionStepMapper;
|
|
|
|
|
@Autowired
|
|
|
|
|
private SysObjectiveQuestionMapper sysObjectiveQuestionMapper;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@AnonymousAccess
|
|
|
|
@ -124,23 +82,61 @@ public class TeaGradeManageController {
|
|
|
|
|
|
|
|
|
|
List<TeaExamManage> teaExamManages = teaExamManageMapper.selectBySchoolId(schoolId);
|
|
|
|
|
List<TeaExamManageCountDto> teaExamManageCountDtos = new ArrayList<>();
|
|
|
|
|
Map<String, StuUser> userMap = new HashMap<>();
|
|
|
|
|
|
|
|
|
|
// 批量查询班级信息
|
|
|
|
|
List<String> examIds = new ArrayList<>();
|
|
|
|
|
List<String> userIds = new ArrayList<>();
|
|
|
|
|
for (TeaExamManage teaExamManage : teaExamManages) {
|
|
|
|
|
examIds.add(teaExamManage.getExamManageId());
|
|
|
|
|
String userId = teaExamManage.getUserId();
|
|
|
|
|
userIds.add(userId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//存储用户信息
|
|
|
|
|
List<StuUser> stuUsers = userMapper.selectByPrimaryKeys(userIds);
|
|
|
|
|
for (StuUser stuUser : stuUsers) {
|
|
|
|
|
userMap.put(stuUser.getUserid(), stuUser);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (TeaExamManage teaExamManage : teaExamManages) {
|
|
|
|
|
TeaExamManageCountDto copyexamManageWithBLOBs = new TeaExamManageCountDto();
|
|
|
|
|
|
|
|
|
|
//获取班级和考试人数
|
|
|
|
|
TeaAndStudentExam teaAndStudentExam = teaAndStudentExamMapper.selectByExamMangeId(teaExamManage.getExamManageId());
|
|
|
|
|
|
|
|
|
|
String classId = teaAndStudentExam.getClassId();
|
|
|
|
|
String[] split = classId.split(",");
|
|
|
|
|
List<String> ids = new ArrayList<>(Arrays.asList(split));
|
|
|
|
|
int num = userMapper.selectNumByClass(ids);
|
|
|
|
|
copyexamManageWithBLOBs.setExamClass(teaAndStudentExam.getClassName());
|
|
|
|
|
copyexamManageWithBLOBs.setExamNum(num);
|
|
|
|
|
BeanUtils.copyProperties(teaExamManage, copyexamManageWithBLOBs);
|
|
|
|
|
Date now = new Date(); // 当前日期
|
|
|
|
|
Date endTime = teaExamManage.getEndTime(); // 从 teaExamManage 对象中获取的日期
|
|
|
|
|
Date startTime = teaExamManage.getStartTime();
|
|
|
|
|
|
|
|
|
|
if (now.compareTo(endTime) > 0) {
|
|
|
|
|
copyexamManageWithBLOBs.setExamStatus("已结束");
|
|
|
|
|
} else if (now.compareTo(startTime) < 0) {
|
|
|
|
|
copyexamManageWithBLOBs.setExamStatus("未开始");
|
|
|
|
|
} else {
|
|
|
|
|
copyexamManageWithBLOBs.setExamStatus("进行中");
|
|
|
|
|
}
|
|
|
|
|
String concatenatedTimeString = startTime + " -- " + endTime;
|
|
|
|
|
copyexamManageWithBLOBs.setExamTime(concatenatedTimeString); //考试时间
|
|
|
|
|
|
|
|
|
|
String userId = teaExamManage.getUserId();
|
|
|
|
|
StuUser stuUser = userMap.get(userId);
|
|
|
|
|
copyexamManageWithBLOBs.setName(stuUser.getName()); //发布人
|
|
|
|
|
teaExamManageCountDtos.add(copyexamManageWithBLOBs);
|
|
|
|
|
}
|
|
|
|
|
PageInfo pageInfo = PageUtil.pageHelper(teaExamManageCountDtos, index, size);
|
|
|
|
|
return new ResultEntity<PageInfo<TeaExamManageCountDto>>(pageInfo);
|
|
|
|
|
return new ResultEntity<>(pageInfo);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@AnonymousAccess
|
|
|
|
|
@PostMapping("/getExamInfoAndRank")
|
|
|
|
|
@ApiOperation("考试模式--成绩排名和成绩情况展示") //TODO 图片可能需要一个接口去取
|
|
|
|
|
public ResultEntity<PageInfo> getExamInfoAndRank(@RequestParam Integer index,
|
|
|
|
|
public ResultEntity<PageInfo<TeaExamAndUserDto>> getExamInfoAndRank(@RequestParam Integer index,
|
|
|
|
|
@RequestParam Integer size,
|
|
|
|
|
@RequestParam String schoolId,
|
|
|
|
|
@ApiParam("学号或姓名搜索框") @RequestParam(required = false) String keyWord,
|
|
|
|
@ -152,6 +148,14 @@ public class TeaGradeManageController {
|
|
|
|
|
return new ResultEntity<>(pageInfo);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@AnonymousAccess
|
|
|
|
|
@PostMapping("/getExamNameAndId")
|
|
|
|
|
@ApiOperation("考试模式--考试名称下拉框") //TODO 图片可能需要一个接口去取
|
|
|
|
|
public ResultEntity<List<Map<String, String>>> getExamNameAndId(@RequestParam String schoolId) {
|
|
|
|
|
List<Map<String, String>> list = teaExamManageMapper.selectNameAndIdBySchoolId(schoolId);
|
|
|
|
|
return new ResultEntity<>(list);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/exportExam")
|
|
|
|
|
@ApiOperation("考试模式--页面单个考试导出")
|
|
|
|
@ -210,11 +214,54 @@ public class TeaGradeManageController {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@AnonymousAccess
|
|
|
|
|
@PostMapping("/getGradeReport")
|
|
|
|
|
@ApiOperation("考试模式--成绩报告接口") //TODO 待写 成绩报告接口 需要计算题目的正确率,暂时没想好
|
|
|
|
|
public void getGradeReport() {
|
|
|
|
|
@PostMapping("/getGradeReportCase")
|
|
|
|
|
@ApiOperation("考试模式--成绩报告案例题questionOriginal所属章节,contentOriginal为考核点数量") //TODO 案例题正确率字段暂无
|
|
|
|
|
public ResultEntity<PageInfo<SysCaseQuestion>> getGradeReportCase(@RequestParam Integer index,
|
|
|
|
|
@RequestParam Integer size,
|
|
|
|
|
@RequestParam String examManageId) {
|
|
|
|
|
TeaExamManageWithBLOBs teaExamManageWithBLOBs = teaExamManageMapper.selectByPrimaryKey(examManageId);
|
|
|
|
|
String caseIdList = teaExamManageWithBLOBs.getCaseIdlist();
|
|
|
|
|
List<String> list = Arrays.asList(caseIdList.split(","));
|
|
|
|
|
PageHelper.startPage(index, size);
|
|
|
|
|
List<SysCaseQuestion> resultList = sysCaseQuestionStepMapper.getGradeReportCase(list);
|
|
|
|
|
PageInfo pageInfo = new PageInfo(resultList);
|
|
|
|
|
return new ResultEntity(pageInfo);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@AnonymousAccess
|
|
|
|
|
@PostMapping("/getGradeReportObjective")
|
|
|
|
|
@ApiOperation("考试模式--成绩报告客观题") //TODO 客观题正确率字段暂无
|
|
|
|
|
public ResultEntity<PageInfo<SysCaseQuestion>> getGradeReportObjective(@RequestParam Integer index,
|
|
|
|
|
@RequestParam Integer size,
|
|
|
|
|
@RequestParam String examManageId) {
|
|
|
|
|
TeaExamManageWithBLOBs teaExamManageWithBLOBs = teaExamManageMapper.selectByPrimaryKey(examManageId);
|
|
|
|
|
if (teaExamManageWithBLOBs == null) {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
List<String> list = new ArrayList();
|
|
|
|
|
if (StringUtils.isNotBlank(teaExamManageWithBLOBs.getSingleIdlist())) {
|
|
|
|
|
String singleIdList = teaExamManageWithBLOBs.getSingleIdlist();
|
|
|
|
|
String[] split = singleIdList.split(",");
|
|
|
|
|
list.addAll(Arrays.asList(split));
|
|
|
|
|
}
|
|
|
|
|
if (StringUtils.isNotBlank(teaExamManageWithBLOBs.getManyIdlist())) {
|
|
|
|
|
String manyIdList = teaExamManageWithBLOBs.getManyIdlist();
|
|
|
|
|
String[] split = manyIdList.split(",");
|
|
|
|
|
list.addAll(Arrays.asList(split));
|
|
|
|
|
}
|
|
|
|
|
if (StringUtils.isNotBlank(teaExamManageWithBLOBs.getJudgeIdlist())) {
|
|
|
|
|
String judgeIdList = teaExamManageWithBLOBs.getJudgeIdlist();
|
|
|
|
|
String[] split = judgeIdList.split(",");
|
|
|
|
|
list.addAll(Arrays.asList(split));
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
PageHelper.startPage(index, size);
|
|
|
|
|
List<SysCaseQuestion> resultList = sysObjectiveQuestionMapper.getGradeReportObjective(list);
|
|
|
|
|
PageInfo pageInfo = new PageInfo(resultList);
|
|
|
|
|
return new ResultEntity(pageInfo);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@AnonymousAccess
|
|
|
|
|
@GetMapping("/exportRank")
|
|
|
|
|