优化代码

develop
zhouj1203@hotmail.com 3 months ago
parent 26e7574eec
commit 0e5267f2ca

@ -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<Exam> exams = examRepository.findExamByClassId("Exam-"+overViewDto.getSchool(),overViewDto.getClassId(),overViewDto.getPeriodId());
//List<RMember> rMembers = new ArrayList<>();
/*for (Map.Entry<String, Object> 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<List<RGroupList>>() {});
}
}*/
}catch (Exception e) {
throw new ServiceException(ErrorCode.SYSTEM_ERROR.getCode(), "数据转换错误");

@ -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;
}

Loading…
Cancel
Save