diff --git a/src/main/java/cn/teammodel/controller/admin/service/impl/AdminIndexDutyServiceImpl.java b/src/main/java/cn/teammodel/controller/admin/service/impl/AdminIndexDutyServiceImpl.java index 715acba..155363e 100644 --- a/src/main/java/cn/teammodel/controller/admin/service/impl/AdminIndexDutyServiceImpl.java +++ b/src/main/java/cn/teammodel/controller/admin/service/impl/AdminIndexDutyServiceImpl.java @@ -229,6 +229,12 @@ public class AdminIndexDutyServiceImpl implements AdminIndexDutyService { Map mapper = new HashMap<>(); String apiUrl = env.getProperty("ies.server-url"); + if(lessonRecordDto.isClassMeeting()) { + List subjects = schoolRepository.findSubjectById(lessonRecordDto.getSchool(), lessonRecordDto.getPeriodId()); + List subjectIds = subjects.stream().filter(subject -> "班会".equals(subject.getName())) + .map(School.Subject::getId).collect(Collectors.toList()); + lessonRecordDto.setSubjectId(subjectIds); + } try (CloseableHttpClient httpClient = HttpClients.createDefault()) { // 创建HttpPost对象 diff --git a/src/main/java/cn/teammodel/model/dto/weekDuty/LessonRecordDto.java b/src/main/java/cn/teammodel/model/dto/weekDuty/LessonRecordDto.java index 1e4140e..a274df5 100644 --- a/src/main/java/cn/teammodel/model/dto/weekDuty/LessonRecordDto.java +++ b/src/main/java/cn/teammodel/model/dto/weekDuty/LessonRecordDto.java @@ -3,6 +3,7 @@ package cn.teammodel.model.dto.weekDuty; import lombok.Data; import java.util.ArrayList; +import java.util.List; @Data public class LessonRecordDto { @@ -13,9 +14,9 @@ public class LessonRecordDto { private String periodId; private Long stime; private Long etime; - private ArrayList category; - private ArrayList subjectId; - private ArrayList grade; + private List category; + private List subjectId; + private List grade; private boolean doubleGreen = false; private boolean singleGreen = false; private boolean isOk = false; @@ -24,4 +25,5 @@ public class LessonRecordDto { private int pageCount; private String continuationToken; private boolean managePage = true; + private boolean classMeeting; } diff --git a/src/main/java/cn/teammodel/model/entity/school/School.java b/src/main/java/cn/teammodel/model/entity/school/School.java index 507cfe1..d038d6a 100644 --- a/src/main/java/cn/teammodel/model/entity/school/School.java +++ b/src/main/java/cn/teammodel/model/entity/school/School.java @@ -88,6 +88,8 @@ public class School extends BaseItem { } @Data + @AllArgsConstructor + @NoArgsConstructor public static class Subject { private String id; private String name; diff --git a/src/main/java/cn/teammodel/repository/SchoolRepository.java b/src/main/java/cn/teammodel/repository/SchoolRepository.java index 108f044..5a200de 100644 --- a/src/main/java/cn/teammodel/repository/SchoolRepository.java +++ b/src/main/java/cn/teammodel/repository/SchoolRepository.java @@ -21,6 +21,8 @@ public interface SchoolRepository extends CosmosRepository { List findPeriodById(@Param("schoolId") String schoolId, @Param("periodId") String periodId); @Query("select value p.semesters from School as s join p in s.period where s.id = @schoolId and s.code = 'Base' and p.id = @periodId") List findSemestersById(@Param("schoolId") String schoolId, @Param("periodId") String periodId); + @Query("select value p.subjects from School as s join p in s.period where s.id = @schoolId and s.code = 'Base' and p.id = @periodId") + List findSubjectById(@Param("schoolId") String schoolId, @Param("periodId") String periodId); School findSchoolByIdAndCode(String schoolId, String code); } diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 2a3fe23..18cfc64 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -23,9 +23,9 @@ spring: cloud: azure: cosmos: - endpoint: https://cdhabookdep-free.documents.azure.cn:443 + endpoint: https://teammodelos.documents.azure.cn:443 database: TEAMModelOS - key: JTUVk92Gjsx17L0xqxn0X4wX2thDPMKiw4daeTyV1HzPb6JmBeHdtFY1MF1jdctW1ofgzqkDMFOtcqS46by31A== + key: clF73GwPECfP1lKZTCvs8gLMMyCZig1HODFbhDUsarsAURO7TcOjVz6ZFfPqr1HzYrfjCXpMuVD5TlEG5bFGGg== populate-query-metrics: true security: