From 0e5267f2ca71afbfafe0ee55134b514887be1e62 Mon Sep 17 00:00:00 2001 From: "zhouj1203@hotmail.com" Date: Wed, 18 Sep 2024 10:02:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/service/impl/ExamServiceImpl.java | 13 ------------- src/main/java/cn/teammodel/utils/GroupUtil.java | 6 ++++-- 2 files changed, 4 insertions(+), 15 deletions(-) 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; }