| | |
| | | import com.gkhy.exam.common.utils.PageUtils; |
| | | import com.gkhy.exam.common.utils.SecurityUtils; |
| | | import com.gkhy.exam.system.domain.ExExamRecord; |
| | | import com.gkhy.exam.system.domain.ExStudent; |
| | | import com.gkhy.exam.system.domain.RecordFile; |
| | | import com.gkhy.exam.system.mapper.ExExamRecordMapper; |
| | | import com.gkhy.exam.system.mapper.ExStudentMapper; |
| | | import com.gkhy.exam.system.service.ExExamRecordService; |
| | | import org.ehcache.core.util.CollectionUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | public class ExExamRecordServiceImpl extends ServiceImpl<ExExamRecordMapper, ExExamRecord> implements ExExamRecordService { |
| | | |
| | | |
| | | @Autowired |
| | | private ExStudentMapper studentMapper; |
| | | |
| | | |
| | | @Override |
| | | public CommonPage selectExamRecordList(ExExamRecord examRecord) { |
| | | SysUser user= SecurityUtils.getLoginUser().getUser(); |
| | |
| | | for (ExExamRecord exExamRecord : recordList) { |
| | | List<RecordFile> recordFiles = baseMapper.selectFiles(exExamRecord.getId()); |
| | | exExamRecord.setFiles(recordFiles); |
| | | List<ExStudent> exStudents = new ArrayList<>(); |
| | | String[] split = exExamRecord.getStudentId().split(","); |
| | | for (String studentId : split) { |
| | | ExStudent exStudent = studentMapper.selectStudentById(Long.valueOf(studentId)); |
| | | exStudents.add(exStudent); |
| | | } |
| | | exExamRecord.setStudents(exStudents); |
| | | } |
| | | return CommonPage.restPage(recordList); |
| | | } |
| | |
| | | ExExamRecord exExamRecord = baseMapper.selectExamRecordById(recordId); |
| | | List<RecordFile> recordFiles = baseMapper.selectFiles(exExamRecord.getId()); |
| | | exExamRecord.setFiles(recordFiles); |
| | | List<ExStudent> exStudents = new ArrayList<>(); |
| | | String[] split = exExamRecord.getStudentId().split(","); |
| | | for (String studentId : split) { |
| | | ExStudent exStudent = studentMapper.selectStudentById(Long.valueOf(studentId)); |
| | | exStudents.add(exStudent); |
| | | } |
| | | exExamRecord.setStudents(exStudents); |
| | | return exExamRecord; |
| | | } |
| | | |