|
|
@ -6,14 +6,17 @@ import com.github.pagehelper.PageInfo;
|
|
|
|
import com.sztzjy.financial_bigdata.annotation.AnonymousAccess;
|
|
|
|
import com.sztzjy.financial_bigdata.annotation.AnonymousAccess;
|
|
|
|
import com.sztzjy.financial_bigdata.entity.*;
|
|
|
|
import com.sztzjy.financial_bigdata.entity.*;
|
|
|
|
import com.sztzjy.financial_bigdata.entity.resource_entity.SysObjectiveQuestions;
|
|
|
|
import com.sztzjy.financial_bigdata.entity.resource_entity.SysObjectiveQuestions;
|
|
|
|
|
|
|
|
import com.sztzjy.financial_bigdata.entity.resource_entity.SysThreeCatalog;
|
|
|
|
import com.sztzjy.financial_bigdata.entity.resource_entity.SysTwoCatalog;
|
|
|
|
import com.sztzjy.financial_bigdata.entity.resource_entity.SysTwoCatalog;
|
|
|
|
import com.sztzjy.financial_bigdata.entity.resource_entity.TestTestSysCaseQuestionStepWithBLOBs;
|
|
|
|
import com.sztzjy.financial_bigdata.entity.resource_entity.TestTestSysCaseQuestionStepWithBLOBs;
|
|
|
|
|
|
|
|
import com.sztzjy.financial_bigdata.entity.stu_dto.StuTrainingDto;
|
|
|
|
import com.sztzjy.financial_bigdata.entity.stu_dto.StuUserDto;
|
|
|
|
import com.sztzjy.financial_bigdata.entity.stu_dto.StuUserDto;
|
|
|
|
import com.sztzjy.financial_bigdata.entity.tea_dto.*;
|
|
|
|
import com.sztzjy.financial_bigdata.entity.tea_dto.*;
|
|
|
|
import com.sztzjy.financial_bigdata.mapper.*;
|
|
|
|
import com.sztzjy.financial_bigdata.mapper.*;
|
|
|
|
import com.sztzjy.financial_bigdata.resourceCenterAPI.CaseApi;
|
|
|
|
import com.sztzjy.financial_bigdata.resourceCenterAPI.CaseApi;
|
|
|
|
import com.sztzjy.financial_bigdata.resourceCenterAPI.CourseAPI;
|
|
|
|
import com.sztzjy.financial_bigdata.resourceCenterAPI.CourseAPI;
|
|
|
|
import com.sztzjy.financial_bigdata.resourceCenterAPI.ObjectiveApi;
|
|
|
|
import com.sztzjy.financial_bigdata.resourceCenterAPI.ObjectiveApi;
|
|
|
|
|
|
|
|
import com.sztzjy.financial_bigdata.service.stu.StuScoreService;
|
|
|
|
import com.sztzjy.financial_bigdata.service.tea.ITeaGradeManageService;
|
|
|
|
import com.sztzjy.financial_bigdata.service.tea.ITeaGradeManageService;
|
|
|
|
import com.sztzjy.financial_bigdata.service.tea.impl.TeaGradeManageServiceImpl;
|
|
|
|
import com.sztzjy.financial_bigdata.service.tea.impl.TeaGradeManageServiceImpl;
|
|
|
|
import com.sztzjy.financial_bigdata.util.PageUtil;
|
|
|
|
import com.sztzjy.financial_bigdata.util.PageUtil;
|
|
|
@ -71,6 +74,11 @@ public class TeaGradeManageController {
|
|
|
|
private SysWeightMapper sysWeightMapper;
|
|
|
|
private SysWeightMapper sysWeightMapper;
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private StuTheoryExamMapper stuTheoryExamMapper;
|
|
|
|
private StuTheoryExamMapper stuTheoryExamMapper;
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
|
|
|
private StuTrainingMapper stuTrainingMapper;
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
|
|
|
StuScoreService stuScoreService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@AnonymousAccess
|
|
|
|
@AnonymousAccess
|
|
|
|
@PostMapping("/getExamInfo")
|
|
|
|
@PostMapping("/getExamInfo")
|
|
|
@ -85,20 +93,20 @@ public class TeaGradeManageController {
|
|
|
|
return null;
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
List<TeaExamManageCountDto> teaExamManageCountDtos = new ArrayList<>();
|
|
|
|
List<TeaExamManageCountDto> teaExamManageCountDtos = new ArrayList<>();
|
|
|
|
Map<String, StuUser> userMap = new HashMap<>();
|
|
|
|
Map<Integer, StuUser> userMap = new HashMap<>();
|
|
|
|
|
|
|
|
|
|
|
|
List<String> userIds = new ArrayList<>();
|
|
|
|
List<Integer> userIds = new ArrayList<>();
|
|
|
|
for (TeaExamManage teaExamManage : teaExamManages) {
|
|
|
|
for (TeaExamManage teaExamManage : teaExamManages) {
|
|
|
|
String userId = teaExamManage.getUserId();
|
|
|
|
Integer zyUserId = Integer.parseInt(teaExamManage.getUserId()); //这里是智云 zyUserId
|
|
|
|
userIds.add(userId);
|
|
|
|
userIds.add(zyUserId);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//存储用户信息
|
|
|
|
//存储用户信息
|
|
|
|
StuUserExample example =new StuUserExample();
|
|
|
|
StuUserExample example = new StuUserExample();
|
|
|
|
example.createCriteria().andSystemOnwerEqualTo(systemOwner).andUseridIn(userIds);
|
|
|
|
example.createCriteria().andSystemOnwerEqualTo(systemOwner).andZyUseridIn(userIds);
|
|
|
|
List<StuUser> stuUsers = userMapper.selectByExample(example);
|
|
|
|
List<StuUser> stuUsers = userMapper.selectByExample(example);
|
|
|
|
for (StuUser stuUser : stuUsers) {
|
|
|
|
for (StuUser stuUser : stuUsers) {
|
|
|
|
userMap.put(stuUser.getUserid(), stuUser);
|
|
|
|
userMap.put(stuUser.getZyUserid(), stuUser);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
for (TeaExamManage teaExamManage : teaExamManages) {
|
|
|
|
for (TeaExamManage teaExamManage : teaExamManages) {
|
|
|
@ -132,7 +140,7 @@ public class TeaGradeManageController {
|
|
|
|
copyexamManageWithBLOBs.setExamTime(concatenatedTimeString); //考试时间
|
|
|
|
copyexamManageWithBLOBs.setExamTime(concatenatedTimeString); //考试时间
|
|
|
|
|
|
|
|
|
|
|
|
String userId = teaExamManage.getUserId();
|
|
|
|
String userId = teaExamManage.getUserId();
|
|
|
|
StuUser stuUser = userMap.get(userId);
|
|
|
|
StuUser stuUser = userMap.get(Integer.parseInt(userId));
|
|
|
|
copyexamManageWithBLOBs.setName(stuUser.getName()); //发布人
|
|
|
|
copyexamManageWithBLOBs.setName(stuUser.getName()); //发布人
|
|
|
|
teaExamManageCountDtos.add(copyexamManageWithBLOBs);
|
|
|
|
teaExamManageCountDtos.add(copyexamManageWithBLOBs);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -363,8 +371,7 @@ public class TeaGradeManageController {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// 构建班级ID列表
|
|
|
|
// 构建班级ID列表
|
|
|
|
List<String> classIds = stuUsers.stream()
|
|
|
|
List<String> classIds = stuUsers.stream()
|
|
|
|
.map(StuUser::getClassId)
|
|
|
|
.map(StuUser::getClassId).distinct().collect(Collectors.toList());
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 批量查询学生分数
|
|
|
|
// 批量查询学生分数
|
|
|
|
StuStudentExamExample studentExamExample = new StuStudentExamExample();
|
|
|
|
StuStudentExamExample studentExamExample = new StuStudentExamExample();
|
|
|
@ -397,7 +404,7 @@ public class TeaGradeManageController {
|
|
|
|
teaExamAndUserDto.setName(stuUser.getName());
|
|
|
|
teaExamAndUserDto.setName(stuUser.getName());
|
|
|
|
teaExamAndUserDto.setStudentId(stuUser.getStudentId());
|
|
|
|
teaExamAndUserDto.setStudentId(stuUser.getStudentId());
|
|
|
|
// 从映射关系中获取班级对象
|
|
|
|
// 从映射关系中获取班级对象
|
|
|
|
if (classMap.get(stuUser.getClassId())==null){
|
|
|
|
if (classMap.get(stuUser.getClassId()) == null) {
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
StuClass classdata = classMap.get(stuUser.getClassId());
|
|
|
|
StuClass classdata = classMap.get(stuUser.getClassId());
|
|
|
@ -574,7 +581,7 @@ public class TeaGradeManageController {
|
|
|
|
@ApiOperation("练习模式--成绩详情页面设置权重")
|
|
|
|
@ApiOperation("练习模式--成绩详情页面设置权重")
|
|
|
|
public void updateWeightByModule(@ApiParam("所有框必须传") @RequestBody SysWeight sysWeight) {
|
|
|
|
public void updateWeightByModule(@ApiParam("所有框必须传") @RequestBody SysWeight sysWeight) {
|
|
|
|
SysWeightExample sysWeightExample = new SysWeightExample();
|
|
|
|
SysWeightExample sysWeightExample = new SysWeightExample();
|
|
|
|
sysWeightExample.createCriteria().andCourseIdEqualTo(sysWeight.getCourseId()).andSystemOwnerEqualTo(sysWeight.getSystemOwner());
|
|
|
|
sysWeightExample.createCriteria().andCourseIdEqualTo(sysWeight.getCourseId()).andSystemOwnerEqualTo(sysWeight.getSystemOwner()).andSchoolIdEqualTo(sysWeight.getSchoolId());
|
|
|
|
List<SysWeight> sysWeights = sysWeightMapper.selectByExample(sysWeightExample);
|
|
|
|
List<SysWeight> sysWeights = sysWeightMapper.selectByExample(sysWeightExample);
|
|
|
|
if (!sysWeights.isEmpty()) {//有 update
|
|
|
|
if (!sysWeights.isEmpty()) {//有 update
|
|
|
|
sysWeightMapper.updateByPrimaryKey(sysWeight);
|
|
|
|
sysWeightMapper.updateByPrimaryKey(sysWeight);
|
|
|
@ -610,14 +617,7 @@ public class TeaGradeManageController {
|
|
|
|
public ResultEntity<SysWeight> getModuleByCourseId(@RequestParam String courseId,
|
|
|
|
public ResultEntity<SysWeight> getModuleByCourseId(@RequestParam String courseId,
|
|
|
|
@RequestParam String schoolId,
|
|
|
|
@RequestParam String schoolId,
|
|
|
|
@RequestParam String systemOwner) {
|
|
|
|
@RequestParam String systemOwner) {
|
|
|
|
SysWeightExample sysWeightExample = new SysWeightExample();
|
|
|
|
return new ResultEntity<SysWeight>(iTeaGradeManageService.getSysWeightResultEntity(courseId, schoolId, systemOwner));
|
|
|
|
sysWeightExample.createCriteria().andSchoolIdEqualTo(schoolId).andCourseIdEqualTo(courseId).andSystemOwnerEqualTo(systemOwner);
|
|
|
|
|
|
|
|
List<SysWeight> sysWeights = sysWeightMapper.selectByExample(sysWeightExample);
|
|
|
|
|
|
|
|
if (sysWeights.isEmpty()) {
|
|
|
|
|
|
|
|
//todo 是否需要设置默认权重
|
|
|
|
|
|
|
|
return new ResultEntity<>(new SysWeight());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return new ResultEntity<>(sysWeights.get(0));
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -659,6 +659,67 @@ public class TeaGradeManageController {
|
|
|
|
return new ResultEntity<>(pageInfo);
|
|
|
|
return new ResultEntity<>(pageInfo);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// @AnonymousAccess
|
|
|
|
|
|
|
|
// @ApiOperation("老师端/练习模式得分详情展示")
|
|
|
|
|
|
|
|
// @PostMapping("getScoreInfo")
|
|
|
|
|
|
|
|
// public ResultEntity<List<StuTrainingDto>> getScoreInfo(@RequestParam String userId,
|
|
|
|
|
|
|
|
// @RequestParam String schoolId,
|
|
|
|
|
|
|
|
// @RequestParam String systemOwner) {
|
|
|
|
|
|
|
|
// List<StuTrainingDto> list = new ArrayList<>();
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// StuTrainingExample stuTrainingExample = new StuTrainingExample();
|
|
|
|
|
|
|
|
// stuTrainingExample.createCriteria().andUserIdEqualTo(userId);
|
|
|
|
|
|
|
|
// List<StuTrainingWithBLOBs> stuTrainings = stuTrainingMapper.selectByExampleWithBLOBs(stuTrainingExample);
|
|
|
|
|
|
|
|
// //根据章节ID拿到课程ID 再去拿权重
|
|
|
|
|
|
|
|
// try {
|
|
|
|
|
|
|
|
// for (StuTrainingWithBLOBs stuTraining : stuTrainings) {
|
|
|
|
|
|
|
|
// StuTrainingDto stuTrainingDto = new StuTrainingDto();
|
|
|
|
|
|
|
|
// String chapterId = stuTraining.getChapterId();
|
|
|
|
|
|
|
|
// SysThreeCatalog sysCourseChapter = CourseAPI.selectChapterByChapterId(chapterId);
|
|
|
|
|
|
|
|
// stuTrainingDto.setTaskModule(sysCourseChapter.getThreeName());
|
|
|
|
|
|
|
|
// stuTrainingDto = stuScoreService.getScoreByChapterId(schoolId, systemOwner, stuTraining, stuTrainingDto, sysCourseChapter);
|
|
|
|
|
|
|
|
// list.add(stuTrainingDto);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// } catch (IOException e) {
|
|
|
|
|
|
|
|
// return new ResultEntity<>(HttpStatus.BAD_REQUEST, "资源中心根据章节ID查询章节信息失败");
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// return new ResultEntity<>(list);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@AnonymousAccess
|
|
|
|
|
|
|
|
@ApiOperation("老师端/练习模式得分详情展示")
|
|
|
|
|
|
|
|
@PostMapping("getScoreInfo")
|
|
|
|
|
|
|
|
public ResultEntity<List<StuTrainingDto>> getScoreInfo(@RequestParam String userId,
|
|
|
|
|
|
|
|
@RequestParam String schoolId,
|
|
|
|
|
|
|
|
@RequestParam String systemOwner) {
|
|
|
|
|
|
|
|
List<StuTrainingDto> list = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
StuTrainingExample stuTrainingExample = new StuTrainingExample();
|
|
|
|
|
|
|
|
stuTrainingExample.createCriteria().andUserIdEqualTo(userId);
|
|
|
|
|
|
|
|
List<StuTrainingWithBLOBs> stuTrainings = stuTrainingMapper.selectByExampleWithBLOBs(stuTrainingExample);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, SysThreeCatalog> chapterMap = new HashMap<>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
for (StuTrainingWithBLOBs stuTraining : stuTrainings) {
|
|
|
|
|
|
|
|
String chapterId = stuTraining.getChapterId();
|
|
|
|
|
|
|
|
SysThreeCatalog sysCourseChapter = chapterMap.get(chapterId);
|
|
|
|
|
|
|
|
if (sysCourseChapter == null) {
|
|
|
|
|
|
|
|
sysCourseChapter = CourseAPI.selectChapterByChapterId(chapterId);
|
|
|
|
|
|
|
|
chapterMap.put(chapterId, sysCourseChapter);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
StuTrainingDto stuTrainingDto = new StuTrainingDto();
|
|
|
|
|
|
|
|
stuTrainingDto.setTaskModule(sysCourseChapter.getThreeName());
|
|
|
|
|
|
|
|
list.add(stuScoreService.getScoreByChapterId(schoolId, systemOwner, stuTraining, stuTrainingDto, sysCourseChapter));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} catch (IOException e) {
|
|
|
|
|
|
|
|
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "资源中心根据章节ID查询章节信息失败");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return new ResultEntity<>(list);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|