新增班会科目逻辑代码,配置文件改为正式地址

11111
zhouj1203@hotmail.com 5 months ago
parent db6c7d402f
commit a1aa8c7187

@ -229,6 +229,12 @@ public class AdminIndexDutyServiceImpl implements AdminIndexDutyService {
Map<String, Object> mapper = new HashMap<>(); Map<String, Object> mapper = new HashMap<>();
String apiUrl = env.getProperty("ies.server-url"); String apiUrl = env.getProperty("ies.server-url");
if(lessonRecordDto.isClassMeeting()) {
List<School.Subject> subjects = schoolRepository.findSubjectById(lessonRecordDto.getSchool(), lessonRecordDto.getPeriodId());
List<String> subjectIds = subjects.stream().filter(subject -> "班会".equals(subject.getName()))
.map(School.Subject::getId).collect(Collectors.toList());
lessonRecordDto.setSubjectId(subjectIds);
}
try (CloseableHttpClient httpClient = HttpClients.createDefault()) { try (CloseableHttpClient httpClient = HttpClients.createDefault()) {
// 创建HttpPost对象 // 创建HttpPost对象

@ -3,6 +3,7 @@ package cn.teammodel.model.dto.weekDuty;
import lombok.Data; import lombok.Data;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List;
@Data @Data
public class LessonRecordDto { public class LessonRecordDto {
@ -13,9 +14,9 @@ public class LessonRecordDto {
private String periodId; private String periodId;
private Long stime; private Long stime;
private Long etime; private Long etime;
private ArrayList<String> category; private List<String> category;
private ArrayList<String> subjectId; private List<String> subjectId;
private ArrayList<String> grade; private List<String> grade;
private boolean doubleGreen = false; private boolean doubleGreen = false;
private boolean singleGreen = false; private boolean singleGreen = false;
private boolean isOk = false; private boolean isOk = false;
@ -24,4 +25,5 @@ public class LessonRecordDto {
private int pageCount; private int pageCount;
private String continuationToken; private String continuationToken;
private boolean managePage = true; private boolean managePage = true;
private boolean classMeeting;
} }

@ -88,6 +88,8 @@ public class School extends BaseItem {
} }
@Data @Data
@AllArgsConstructor
@NoArgsConstructor
public static class Subject { public static class Subject {
private String id; private String id;
private String name; private String name;

@ -21,6 +21,8 @@ public interface SchoolRepository extends CosmosRepository<School, String> {
List<School.Period> findPeriodById(@Param("schoolId") String schoolId, @Param("periodId") String periodId); List<School.Period> 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") @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<School.Semester> findSemestersById(@Param("schoolId") String schoolId, @Param("periodId") String periodId); List<School.Semester> 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<School.Subject> findSubjectById(@Param("schoolId") String schoolId, @Param("periodId") String periodId);
School findSchoolByIdAndCode(String schoolId, String code); School findSchoolByIdAndCode(String schoolId, String code);
} }

@ -23,9 +23,9 @@ spring:
cloud: cloud:
azure: azure:
cosmos: cosmos:
endpoint: https://cdhabookdep-free.documents.azure.cn:443 endpoint: https://teammodelos.documents.azure.cn:443
database: TEAMModelOS database: TEAMModelOS
key: JTUVk92Gjsx17L0xqxn0X4wX2thDPMKiw4daeTyV1HzPb6JmBeHdtFY1MF1jdctW1ofgzqkDMFOtcqS46by31A== key: clF73GwPECfP1lKZTCvs8gLMMyCZig1HODFbhDUsarsAURO7TcOjVz6ZFfPqr1HzYrfjCXpMuVD5TlEG5bFGGg==
populate-query-metrics: true populate-query-metrics: true
security: security:

Loading…
Cancel
Save