diff --git a/src/main/java/cn/teammodel/controller/admin/service/impl/ExamServiceImpl.java b/src/main/java/cn/teammodel/controller/admin/service/impl/ExamServiceImpl.java index ea87f5f..d894e0f 100644 --- a/src/main/java/cn/teammodel/controller/admin/service/impl/ExamServiceImpl.java +++ b/src/main/java/cn/teammodel/controller/admin/service/impl/ExamServiceImpl.java @@ -41,19 +41,6 @@ public class ExamServiceImpl implements ExamService { school.flatMap(value -> value.getPeriod().stream().filter(period -> period.getId().equals(overViewDto.getPeriodId())).findFirst()).ifPresent(value1 -> overView.put("semesters", value1.getSemesters())); - - //获取所有考试数据 - //List exams = examRepository.findExamByClassId("Exam-"+overViewDto.getSchool(),overViewDto.getClassId(),overViewDto.getPeriodId()); - - //List rMembers = new ArrayList<>(); - /*for (Map.Entry entry : groupId.entrySet()) { - String key = entry.getKey(); - Object value = entry.getValue(); - if (key.equals("groups")) { - String jsonGroups = JSON.toJSONString(value); - rGroupList = JSON.parseObject(jsonGroups, new TypeReference>() {}); - } - }*/ }catch (Exception e) { throw new ServiceException(ErrorCode.SYSTEM_ERROR.getCode(), "数据转换错误"); diff --git a/src/main/java/cn/teammodel/utils/GroupUtil.java b/src/main/java/cn/teammodel/utils/GroupUtil.java index b044f5a..0a75232 100644 --- a/src/main/java/cn/teammodel/utils/GroupUtil.java +++ b/src/main/java/cn/teammodel/utils/GroupUtil.java @@ -1,5 +1,7 @@ package cn.teammodel.utils; +import cn.teammodel.common.ErrorCode; +import cn.teammodel.config.exception.ServiceException; import cn.teammodel.model.dto.admin.common.GroupDto; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.type.TypeFactory; @@ -72,10 +74,10 @@ public class GroupUtil { int statusCode = response.getStatusLine().getStatusCode(); if (statusCode != 200) throw new RuntimeException("Failed : HTTP error code : " + statusCode); } catch (IOException e) { - e.printStackTrace(); + throw new ServiceException(ErrorCode.SYSTEM_ERROR.getCode(), "数据解析异常"); } } catch (IOException e) { - e.printStackTrace(); + throw new ServiceException(ErrorCode.SYSTEM_ERROR.getCode(), "请求头异常"); } return mapper; }