diff --git a/src/main/java/cn/teammodel/controller/admin/service/impl/CommonServiceImpl.java b/src/main/java/cn/teammodel/controller/admin/service/impl/CommonServiceImpl.java index 87f5769..6c9d0f6 100644 --- a/src/main/java/cn/teammodel/controller/admin/service/impl/CommonServiceImpl.java +++ b/src/main/java/cn/teammodel/controller/admin/service/impl/CommonServiceImpl.java @@ -60,14 +60,33 @@ public class CommonServiceImpl implements CommonService { } List grades = period.get(0).getGrades(); int index = 0; + //根据当前时间去判定各个年级的入学年 + int time = 0; + if(period.get(0).getId().equalsIgnoreCase(gcDto.getPeriodId())) { + for (School.Semester semester : period.get(0).getSemesters()) { + if(semester.getStart() == 1) { + if (mon == semester.getMonth()) + { + time = day >= semester.getDay() ? 0 : 1; + } + else + { + time = mon > semester.getMonth() ? 0 : 1; + } + } + } + + } for (String grade : grades) { GradeAndClassVo gradeAndClassVo = new GradeAndClassVo(); gradeAndClassVo.setGradeId(index); + gradeAndClassVo.setYear(year - time - index); gradeAndClassVo.setGradeName(grade); classes.stream().filter(classInfo -> classInfo.getGrade() == gradeAndClassVo.getGradeId()).forEach(classInfo -> { GradeAndClassVo.CI ci = new GradeAndClassVo.CI(); ci.setClassId(classInfo.getId()); ci.setClassName(classInfo.getName()); + ci.setYear(classInfo.getYear()); gradeAndClassVo.AddClass(ci); }); index ++; 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 26b0387..fb2b4aa 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 @@ -29,9 +29,13 @@ public class ExamServiceImpl implements ExamService { public Map getAnalysis(OverViewDto overViewDto, HttpServletRequest request) { Map overView; + Map examRate; String url = env.getProperty("ies.server-url-overview"); + String url_exam = env.getProperty("ies.server-url-exam-rate"); try { overView = GroupUtil.getGroupId(overViewDto,new GroupUtil(env), request,url); + examRate = GroupUtil.getGroupId(overViewDto,new GroupUtil(env), request,url_exam); + overView.putAll(examRate); //获取所有考试数据 //List exams = examRepository.findExamByClassId("Exam-"+overViewDto.getSchool(),overViewDto.getClassId(),overViewDto.getPeriodId()); diff --git a/src/main/java/cn/teammodel/model/entity/common/Comment.java b/src/main/java/cn/teammodel/model/entity/common/Comment.java new file mode 100644 index 0000000..edd4885 --- /dev/null +++ b/src/main/java/cn/teammodel/model/entity/common/Comment.java @@ -0,0 +1,30 @@ +package cn.teammodel.model.entity.common; + +import cn.teammodel.model.entity.BaseItem; +import com.azure.spring.data.cosmos.core.mapping.Container; +import com.fasterxml.jackson.annotation.JsonInclude; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +@EqualsAndHashCode(callSuper = true) +@Container(containerName = "Common") +@Data +@JsonInclude(JsonInclude.Include.NON_NULL) +public class Comment extends BaseItem { + private String content; + private String creatorId; + private String creatorName; + private String school; + private String studentId; + private String activityId; + @ApiModelProperty("活动类型") + private String activityType; + @ApiModelProperty("评论类型") + private String contentType; + private String pk = "comment"; + //private int ttl = -1; + private Long createTime; + private Long updateTime; + +} diff --git a/src/main/java/cn/teammodel/model/vo/admin/GradeAndClassVo.java b/src/main/java/cn/teammodel/model/vo/admin/GradeAndClassVo.java index 7ceafc2..9d6857a 100644 --- a/src/main/java/cn/teammodel/model/vo/admin/GradeAndClassVo.java +++ b/src/main/java/cn/teammodel/model/vo/admin/GradeAndClassVo.java @@ -7,6 +7,7 @@ import java.util.List; @Data public class GradeAndClassVo { + private int year; private int gradeId; private String gradeName; private List classes = new ArrayList<>(); @@ -19,5 +20,6 @@ public class GradeAndClassVo { public static class CI { private String classId; private String className; + private int year; } } diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 2dc1d12..fd0b32c 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -72,4 +72,5 @@ ies: server-url-group: /grouplist/get-members-listids server-url-pdf-data: /school/art/get-pdf-data server-url-update-custom-comment: /school/art/update-custom-comment - server-url-overview: /overall-education/overview \ No newline at end of file + server-url-overview: /overall-education/overview + server-url-exam-rate: /common/exam/get-exam-point \ No newline at end of file