修改班级相关代码

master
xiaoCJ
parent 3686624e5b
commit 32c559cd51

@ -128,6 +128,7 @@ public class StuIndexController {
StuUserDto stuUserDto = new StuUserDto(); StuUserDto stuUserDto = new StuUserDto();
BeanUtils.copyProperties(stuUser, stuUserDto); BeanUtils.copyProperties(stuUser, stuUserDto);
StuClassExample example =new StuClassExample(); StuClassExample example =new StuClassExample();
example.createCriteria().andClassIdEqualTo(stuUser.getClassId());
List<StuClass> stuClassList = stuClassMapper.selectByExample(example); List<StuClass> stuClassList = stuClassMapper.selectByExample(example);
StuClass stuClass = stuClassList.get(0); StuClass stuClass = stuClassList.get(0);
stuUserDto.setClassName(stuClass.getClassName()); stuUserDto.setClassName(stuClass.getClassName());

@ -156,7 +156,7 @@ public class TeaExamManageController {
} }
StuClassExample example =new StuClassExample(); StuClassExample example =new StuClassExample();
example.createCriteria().andClassIdIn(list); example.createCriteria().andClassIdIn(list).andSystemOwnerEqualTo(systemOwner);
List<StuClass> stuClasslist = stuClassMapper.selectByExample(example); List<StuClass> stuClasslist = stuClassMapper.selectByExample(example);
String s = ""; String s = "";
for (StuClass stuClass : stuClasslist) { for (StuClass stuClass : stuClasslist) {

@ -212,7 +212,8 @@ public class TeaGradeManageController {
@AnonymousAccess @AnonymousAccess
@PostMapping("/getClassByExamManageId") @PostMapping("/getClassByExamManageId")
@ApiOperation("考试模式--图表统计接口班级下拉框返回classID和班级名") //只显示新建实训时添加的班级 @ApiOperation("考试模式--图表统计接口班级下拉框返回classID和班级名") //只显示新建实训时添加的班级
public ResultEntity<List<Map<String, String>>> getClassByExamManageId(@RequestParam String examManageId) { public ResultEntity<List<Map<String, String>>> getClassByExamManageId(@RequestParam String examManageId,
@RequestParam String systemOwner) {
TeaAndStudentExamExample teaAndStudentExamExample = new TeaAndStudentExamExample(); TeaAndStudentExamExample teaAndStudentExamExample = new TeaAndStudentExamExample();
teaAndStudentExamExample.createCriteria().andExamManageIdEqualTo(examManageId); teaAndStudentExamExample.createCriteria().andExamManageIdEqualTo(examManageId);
List<TeaAndStudentExam> teaAndStudentExams = teaAndStudentExamMapper.selectByExample(teaAndStudentExamExample); List<TeaAndStudentExam> teaAndStudentExams = teaAndStudentExamMapper.selectByExample(teaAndStudentExamExample);
@ -226,8 +227,8 @@ public class TeaGradeManageController {
String[] split = classId.split(","); String[] split = classId.split(",");
List<String> idlist = Arrays.asList(split); List<String> idlist = Arrays.asList(split);
StuClassExample example =new StuClassExample(); StuClassExample example = new StuClassExample();
example.createCriteria().andClassIdIn(idlist); example.createCriteria().andClassIdIn(idlist).andSystemOwnerEqualTo(systemOwner);
List<StuClass> stuClassList = stuClassMapper.selectByExample(example); List<StuClass> stuClassList = stuClassMapper.selectByExample(example);
for (StuClass stuClass : stuClassList) { for (StuClass stuClass : stuClassList) {
@ -381,7 +382,7 @@ public class TeaGradeManageController {
.collect(Collectors.toMap(StuStudentExamWithBLOBs::getUserid, Function.identity())); .collect(Collectors.toMap(StuStudentExamWithBLOBs::getUserid, Function.identity()));
StuClassExample example = new StuClassExample(); StuClassExample example = new StuClassExample();
example.createCriteria().andClassIdIn(classIds); example.createCriteria().andClassIdIn(classIds).andSystemOwnerEqualTo(systemOwner);
List<StuClass> stuClass = stuClassMapper.selectByExample(example); List<StuClass> stuClass = stuClassMapper.selectByExample(example);
// 构建班级ID与班级对象的映射关系 // 构建班级ID与班级对象的映射关系
@ -393,9 +394,12 @@ public class TeaGradeManageController {
TeaExamAndUserDto teaExamAndUserDto = new TeaExamAndUserDto(); TeaExamAndUserDto teaExamAndUserDto = new TeaExamAndUserDto();
teaExamAndUserDto.setName(stuUser.getName()); teaExamAndUserDto.setName(stuUser.getName());
teaExamAndUserDto.setStudentId(stuUser.getStudentId()); teaExamAndUserDto.setStudentId(stuUser.getStudentId());
// 从映射关系中获取班级对象 // 从映射关系中获取班级对象
if (classMap.get(stuUser.getClassId())==null){
continue;
}
StuClass classdata = classMap.get(stuUser.getClassId()); StuClass classdata = classMap.get(stuUser.getClassId());
teaExamAndUserDto.setClassName(classdata.getClassName()); teaExamAndUserDto.setClassName(classdata.getClassName());
StuStudentExamWithBLOBs stuStudentExam = userExamMap.get(stuUser.getUserid()); StuStudentExamWithBLOBs stuStudentExam = userExamMap.get(stuUser.getUserid());
@ -482,7 +486,8 @@ public class TeaGradeManageController {
StuUser user = userMapper.selectByPrimaryKey(trainingReport.getUserId()); StuUser user = userMapper.selectByPrimaryKey(trainingReport.getUserId());
trainingReportDto.setName(user.getName()); trainingReportDto.setName(user.getName());
trainingReportDto.setStudentId(user.getStudentId()); trainingReportDto.setStudentId(user.getStudentId());
StuClassExample example =new StuClassExample(); StuClassExample example = new StuClassExample();
example.createCriteria().andClassIdEqualTo(user.getClassId());
List<StuClass> stuClassList = stuClassMapper.selectByExample(example); List<StuClass> stuClassList = stuClassMapper.selectByExample(example);
StuClass stuClass = stuClassList.get(0); StuClass stuClass = stuClassList.get(0);
trainingReportDto.setClassName(stuClass.getClassName()); trainingReportDto.setClassName(stuClass.getClassName());

Loading…
Cancel
Save