|
|
|
@ -64,24 +64,51 @@ public class TeaGradeManageController {
|
|
|
|
|
@AnonymousAccess
|
|
|
|
|
@PostMapping("/getExamInfo")
|
|
|
|
|
@ApiOperation("考试模式--页面展示(学生端实战考核复用)")
|
|
|
|
|
public ResultEntity<PageInfo> getExamInfo(@RequestParam Integer index,
|
|
|
|
|
public ResultEntity<PageInfo<TeaExamManageCountDto>> getExamInfo(@RequestParam Integer index,
|
|
|
|
|
@RequestParam Integer size,
|
|
|
|
|
@ApiParam("ManyAnswer为考试时间,JudgeAnswer为发布人") @RequestParam String schoolId) {
|
|
|
|
|
PageHelper.startPage(index, size);
|
|
|
|
|
TeaExamManageExample teaExamManageExample = new TeaExamManageExample();
|
|
|
|
|
teaExamManageExample.createCriteria().andSchoolIdEqualTo(schoolId);
|
|
|
|
|
List<TeaExamManage> teaExamManages = teaExamManageMapper.selectByExample(teaExamManageExample);
|
|
|
|
|
List<TeaExamManageCountDto> teaExamManageCountDtos = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
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 startTime = teaExamManage.getStartTime();
|
|
|
|
|
Date endTime = teaExamManage.getEndTime();
|
|
|
|
|
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
String startTimeString = formatter.format(startTime);
|
|
|
|
|
String endTimeString = formatter.format(endTime);
|
|
|
|
|
|
|
|
|
|
Date date = new Date(); // 当前日期
|
|
|
|
|
Date endtimeDtae = teaExamManage.getEndTime(); // 从 teaExamManage 对象中获取的日期
|
|
|
|
|
Date startTimeDtae = teaExamManage.getStartTime();
|
|
|
|
|
long now = date.getTime();
|
|
|
|
|
long end = endtimeDtae.getTime();
|
|
|
|
|
long start = startTimeDtae.getTime();
|
|
|
|
|
if (now > end) {
|
|
|
|
|
// 当前 大于 结束时间
|
|
|
|
|
copyexamManageWithBLOBs.setExamStatus("已结束");
|
|
|
|
|
} else if (now < start) {
|
|
|
|
|
// 当前 小于 开始时间
|
|
|
|
|
copyexamManageWithBLOBs.setExamStatus("未开始");
|
|
|
|
|
} else {
|
|
|
|
|
copyexamManageWithBLOBs.setExamStatus("进行中");
|
|
|
|
|
}
|
|
|
|
|
String concatenatedTimeString = startTimeString + " -- " + endTimeString;
|
|
|
|
|
copyexamManageWithBLOBs.setExamTime(concatenatedTimeString); //考试时间
|
|
|
|
|
String userId = teaExamManage.getUserId();
|
|
|
|
@ -89,7 +116,8 @@ public class TeaGradeManageController {
|
|
|
|
|
copyexamManageWithBLOBs.setName(stuUser.getName()); //发布人
|
|
|
|
|
teaExamManageCountDtos.add(copyexamManageWithBLOBs);
|
|
|
|
|
}
|
|
|
|
|
return new ResultEntity<>(new PageInfo(teaExamManageCountDtos));
|
|
|
|
|
PageUtil.pageHelper(teaExamManageCountDtos, index, size);
|
|
|
|
|
return new ResultEntity<>(new PageInfo<>(teaExamManageCountDtos));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@AnonymousAccess
|
|
|
|
@ -300,7 +328,7 @@ public class TeaGradeManageController {
|
|
|
|
|
public ResultEntity<PageInfo<StuUserDto>> getReportCorrect(@RequestParam String schoolId,
|
|
|
|
|
@RequestParam Integer index,
|
|
|
|
|
@RequestParam Integer size,
|
|
|
|
|
@RequestParam String module,
|
|
|
|
|
@RequestParam(required = false) String module,
|
|
|
|
|
@RequestParam(required = false) String classId,
|
|
|
|
|
@RequestParam(required = false) String keyWord) {
|
|
|
|
|
|
|
|
|
@ -333,7 +361,7 @@ public class TeaGradeManageController {
|
|
|
|
|
SysWeightExample sysWeightExample = new SysWeightExample();
|
|
|
|
|
sysWeightExample.createCriteria().andCourseIdEqualTo(sysWeight.getCourseId());
|
|
|
|
|
List<SysWeight> sysWeights = sysWeightMapper.selectByExample(sysWeightExample);
|
|
|
|
|
if (sysWeights.isEmpty()) {//有 update
|
|
|
|
|
if (!sysWeights.isEmpty()) {//有 update
|
|
|
|
|
sysWeightMapper.updateByPrimaryKey(sysWeight);
|
|
|
|
|
} else { //没有 insert
|
|
|
|
|
sysWeightMapper.insert(sysWeight);
|
|
|
|
@ -349,6 +377,21 @@ public class TeaGradeManageController {
|
|
|
|
|
return new ResultEntity<>(moduleBySchoolId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@AnonymousAccess
|
|
|
|
|
@PostMapping("/getModuleByCourseId")
|
|
|
|
|
@ApiOperation("练习模式--权重回显")
|
|
|
|
|
public ResultEntity<SysWeight> getModuleBySchoolId(@RequestParam String courseId,
|
|
|
|
|
@RequestParam String schoolId) {
|
|
|
|
|
SysWeightExample sysWeightExample = new SysWeightExample();
|
|
|
|
|
sysWeightExample.createCriteria().andSchoolIdEqualTo(schoolId).andCourseIdEqualTo(courseId);
|
|
|
|
|
List<SysWeight> sysWeights = sysWeightMapper.selectByExample(sysWeightExample);
|
|
|
|
|
if (sysWeights.isEmpty()) {
|
|
|
|
|
//todo 是否需要设置默认权重
|
|
|
|
|
return new ResultEntity<>(new SysWeight());
|
|
|
|
|
}
|
|
|
|
|
return new ResultEntity<>(sysWeights.get(0));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@AnonymousAccess
|
|
|
|
|
@PostMapping("/getTheoryInfo")
|
|
|
|
|