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

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<>();
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()) {
// 创建HttpPost对象

@ -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<String> category;
private ArrayList<String> subjectId;
private ArrayList<String> grade;
private List<String> category;
private List<String> subjectId;
private List<String> 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;
}

@ -88,6 +88,8 @@ public class School extends BaseItem {
}
@Data
@AllArgsConstructor
@NoArgsConstructor
public static class Subject {
private String id;
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);
@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);
@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);
}

@ -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:

Loading…
Cancel
Save