springdoc

This commit is contained in:
2026-08-31 11:37:21 +08:00
parent c27dde7a52
commit bf5277ef7c
13 changed files with 214 additions and 61 deletions
+1 -1
View File
@@ -183,7 +183,7 @@
<artifactId>spring-boot-starter-aop</artifactId> <artifactId>spring-boot-starter-aop</artifactId>
</dependency> </dependency>
<!-- SpringDoc OpenAPI UI (compatible with Spring Boot 2.7) --> <!-- SpringDoc OpenAPI UI:为 Spring Boot 2.7 提供 OpenAPI 文档和 Swagger UI -->
<dependency> <dependency>
<groupId>org.springdoc</groupId> <groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-ui</artifactId> <artifactId>springdoc-openapi-ui</artifactId>
@@ -1,10 +1,17 @@
package com.yunhai.bschclassmanage.controller.oapi.oa; package com.yunhai.bschclassmanage.controller.oapi.oa;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import com.yunhai.bschclassmanage.Repository.SchInfoRepository;
import com.yunhai.bschclassmanage.Repository.SchTeacherGroupRepository;
import com.yunhai.bschclassmanage.Repository.SchTeacherRepository;
import com.yunhai.bschclassmanage.config.Config; import com.yunhai.bschclassmanage.config.Config;
import com.yunhai.bschclassmanage.entity.SchInfo;
import com.yunhai.bschclassmanage.entity.SchTeacher; import com.yunhai.bschclassmanage.entity.SchTeacher;
import com.yunhai.bschclassmanage.entity.SchTeacherGroup;
import com.yunhai.bschclassmanage.model.vo.oa.SchInfoVO; import com.yunhai.bschclassmanage.model.vo.oa.SchInfoVO;
import com.yunhai.bschclassmanage.service.ISchInfoService; import com.yunhai.bschclassmanage.service.ISchInfoService;
import com.yunhai.bschclassmanage.service.ISchTeacherService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.CrossOrigin; import org.springframework.web.bind.annotation.CrossOrigin;
@@ -16,36 +23,60 @@ import org.springframework.web.bind.annotation.RestController;
import java.util.Collections; import java.util.Collections;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
import java.util.ArrayList;
import java.util.Map; import java.util.Map;
import java.util.Optional;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** Compatibility endpoints used by BestSchool.IBaseClass.BLL.DbClass consumers. */ /** Compatibility endpoints used by BestSchool.IBaseClass.BLL.DbClass consumers. */
@Tag(name = "DbClass", description = "基础班级数据接口")
@RestController @RestController
@RequestMapping(Config.OAPI + "/DbClass/") @RequestMapping(Config.OAPI + "/DbClass/")
@CrossOrigin(originPatterns = {"*"}, allowCredentials = "true") @CrossOrigin(originPatterns = {"*"}, allowCredentials = "true")
public class DbClassController { public class DbClassController {
@Autowired private ISchTeacherService schTeacherService;
@Autowired private ISchInfoService schInfoService; @Autowired private ISchInfoService schInfoService;
@Autowired private SchTeacherGroupRepository schTeacherGroupRepository;
@Autowired private SchTeacherRepository schTeacherRepository;
@Autowired private SchInfoRepository schInfoRepository;
@GetMapping("GetSchteaList") @GetMapping("GetSchteaList")
public ResponseEntity<List<Map<String, Object>>> getSchteaList(@RequestParam("Group") Integer group) { @Operation(summary = "获取学校教师列表", description = "根据学校 ID 查询学校下的全部教师信息;教师属于多个组时,每个组返回一条记录")
public ResponseEntity<List<Map<String, Object>>> getSchteaList(
@Parameter(description = "学校 ID", required = true, example = "950")
@RequestParam("Group") Integer group) {
if (group == null || group <= 0) return ResponseEntity.badRequest().build(); if (group == null || group <= 0) return ResponseEntity.badRequest().build();
SchInfoVO school = schInfoService.GetSchFirst(group); SchInfoVO school = schInfoService.GetSchFirst(group);
String schSerId = school == null ? null : school.getSchSerId(); String schSerId = school == null ? schInfoRepository.findBySchId(group).map(SchInfo::getSchSerId).orElse(null) : school.getSchSerId();
List<SchTeacher> teachers = schTeacherService.getSchTeacherList(group); List<SchTeacherGroup> memberships = schTeacherGroupRepository.findBySchIdAndTransferStatus(group, 0);
if (teachers == null || teachers.isEmpty()) return ResponseEntity.ok(Collections.emptyList()); if (memberships == null || memberships.isEmpty()) return ResponseEntity.ok(Collections.emptyList());
List<Map<String, Object>> result = teachers.stream().map(teacher -> { Map<Integer, List<Integer>> teacherGroupIds = memberships.stream()
Map<String, Object> row = new LinkedHashMap<>(); .filter(m -> m.getTeaId() != null && m.getGroupId() != null)
row.put("SchSerID", schSerId); .collect(Collectors.groupingBy(SchTeacherGroup::getTeaId, LinkedHashMap::new,
row.put("TeaTel", teacher.getTel()); Collectors.mapping(SchTeacherGroup::getGroupId, Collectors.toList())));
row.put("TeaName", teacher.getName());
row.put("UserTeaSerID", teacher.getTeaId()); // Keep one output row per school-group membership, including duplicate teachers.
row.put("TeaIDCard", teacher.getIdCard()); List<Map<String, Object>> result = memberships.stream()
row.put("TeaNo", teacher.getSort()); .map(SchTeacherGroup::getTeaId)
return row; .filter(java.util.Objects::nonNull)
}).collect(Collectors.toList()); .map(schTeacherRepository::findByTeaId)
.filter(Optional::isPresent)
.map(Optional::get)
.map(teacher -> teacherRow(teacher, schSerId, teacherGroupIds.getOrDefault(teacher.getTeaId(), Collections.emptyList())))
.collect(Collectors.toList());
return ResponseEntity.ok(result); return ResponseEntity.ok(result);
} }
private Map<String, Object> teacherRow(SchTeacher teacher, String schSerId, List<Integer> groupIds) {
Map<String, Object> row = new LinkedHashMap<>();
row.put("SchSerID", schSerId);
row.put("TeaTel", teacher.getTel());
row.put("TeaName", teacher.getName());
row.put("UserTeaSerID", teacher.getTeaId());
row.put("TeaIDCard", teacher.getIdCard());
row.put("TeaNo", teacher.getSort());
row.put("GroupIds", groupIds);
return row;
}
} }
@@ -1,19 +1,25 @@
package com.yunhai.bschclassmanage.controller.oapi.oa; package com.yunhai.bschclassmanage.controller.oapi.oa;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import com.yunhai.bschclassmanage.config.Config; import com.yunhai.bschclassmanage.config.Config;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.*; import java.util.*;
@Tag(name = "FamilyCompat", description = "FamilyCompat related APIs")
@RestController @RestController
@RequestMapping(Config.OAPI+"/Common/FamCom/") @RequestMapping(Config.OAPI+"/Common/FamCom/")
@CrossOrigin(originPatterns = {"*"}, allowCredentials = "true") @CrossOrigin(originPatterns = {"*"}, allowCredentials = "true")
public class FamilyCompatController { public class FamilyCompatController {
@PostMapping("GetStuUserFamIDList") @PostMapping("GetStuUserFamIDList")
@Operation(summary = "getStuUserFamIdList")
public ResponseEntity<List<String>> getStuUserFamIdList(@RequestBody(required=false) String stuIds) { public ResponseEntity<List<String>> getStuUserFamIdList(@RequestBody(required=false) String stuIds) {
return ResponseEntity.ok(Collections.emptyList()); return ResponseEntity.ok(Collections.emptyList());
} }
@PostMapping("GetAllStuFamMem") @PostMapping("GetAllStuFamMem")
@Operation(summary = "getAllStuFamMem")
public ResponseEntity<List<Map<String,Object>>> getAllStuFamMem(@RequestBody(required=false) String stuIds) { public ResponseEntity<List<Map<String,Object>>> getAllStuFamMem(@RequestBody(required=false) String stuIds) {
return ResponseEntity.ok(Collections.emptyList()); return ResponseEntity.ok(Collections.emptyList());
} }
@@ -1,5 +1,8 @@
package com.yunhai.bschclassmanage.controller.oapi.oa; package com.yunhai.bschclassmanage.controller.oapi.oa;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import com.yunhai.bschclassmanage.config.Config; import com.yunhai.bschclassmanage.config.Config;
import com.yunhai.bschclassmanage.model.vo.oa.SchInfoVO; import com.yunhai.bschclassmanage.model.vo.oa.SchInfoVO;
import com.yunhai.bschclassmanage.service.ISchInfoService; import com.yunhai.bschclassmanage.service.ISchInfoService;
@@ -9,6 +12,7 @@ import org.springframework.web.bind.annotation.*;
import java.util.List; import java.util.List;
@Tag(name = "SchGroup", description = "SchGroup related APIs")
@RestController @RestController
@RequestMapping(Config.OAPI+"/SchGroup/") @RequestMapping(Config.OAPI+"/SchGroup/")
@CrossOrigin(originPatterns = {"*"}, allowCredentials = "true") @CrossOrigin(originPatterns = {"*"}, allowCredentials = "true")
@@ -1,5 +1,8 @@
package com.yunhai.bschclassmanage.controller.oapi.oa; package com.yunhai.bschclassmanage.controller.oapi.oa;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import com.yunhai.bschclassmanage.Repository.SchInfoRepository; import com.yunhai.bschclassmanage.Repository.SchInfoRepository;
import com.yunhai.bschclassmanage.config.Config; import com.yunhai.bschclassmanage.config.Config;
import com.yunhai.bschclassmanage.entity.SchInfo; import com.yunhai.bschclassmanage.entity.SchInfo;
@@ -12,6 +15,7 @@ import org.springframework.web.bind.annotation.*;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Tag(name = "SchInfo", description = "SchInfo related APIs")
@RestController @RestController
@RequestMapping(Config.OAPI+"/SchInfo/") @RequestMapping(Config.OAPI+"/SchInfo/")
@CrossOrigin(originPatterns = {"*"}, allowCredentials = "true") @CrossOrigin(originPatterns = {"*"}, allowCredentials = "true")
@@ -20,24 +24,29 @@ public class SchInfoController {
@Autowired private SchInfoRepository schInfoRepository; @Autowired private SchInfoRepository schInfoRepository;
@GetMapping("GetSchlist") @GetMapping("GetSchlist")
@Operation(summary = "获取学校列表", description = "根据多个学校 ID 查询学校")
public ResponseEntity<List<SchInfoVO>> GetSchlist(@RequestParam(required = false) String SchIDArr) { public ResponseEntity<List<SchInfoVO>> GetSchlist(@RequestParam(required = false) String SchIDArr) {
return ResponseEntity.ok(schInfoService.getSchVOList(SchIDArr)); return ResponseEntity.ok(schInfoService.getSchVOList(SchIDArr));
} }
@GetMapping("AllList") @GetMapping("AllList")
@Operation(summary = "获取全部学校列表", description = "查询全部学校")
public ResponseEntity<List<SchInfoVO>> AllList() { return ResponseEntity.ok(schInfoService.getSchVOList(null)); } public ResponseEntity<List<SchInfoVO>> AllList() { return ResponseEntity.ok(schInfoService.getSchVOList(null)); }
@GetMapping("GetSchFirst") @GetMapping("GetSchFirst")
@Operation(summary = "获取单个学校校", description = "根据单个学校 ID 查询学校")
public ResponseEntity<SchInfoVO> GetSchFirst(@RequestParam(required = false) String SchID) { public ResponseEntity<SchInfoVO> GetSchFirst(@RequestParam(required = false) String SchID) {
return ResponseEntity.ok(SchID == null ? null : schInfoService.GetSchFirst(SchID)); return ResponseEntity.ok(SchID == null ? null : schInfoService.GetSchFirst(SchID));
} }
@GetMapping("GetUserSchFirst") @GetMapping("GetUserSchFirst")
@Operation(summary = "获取学校", description = "根据用户中心 ID 查询学校")
public ResponseEntity<SchInfoVO> GetUserSchFirst(@RequestParam(required = false) Integer UserSchID) { public ResponseEntity<SchInfoVO> GetUserSchFirst(@RequestParam(required = false) Integer UserSchID) {
return ResponseEntity.ok(UserSchID == null ? null : schInfoService.GetSchFirst(UserSchID)); return ResponseEntity.ok(UserSchID == null ? null : schInfoService.GetSchFirst(UserSchID));
} }
@GetMapping("GetUserSchlist") @GetMapping("GetUserSchlist")
@Operation(summary = "获取学校列表", description = "根据用户中心多个 ID 查询学校")
public ResponseEntity<List<SchInfoVO>> GetUserSchlist(@RequestParam(required = false) String UserSchIds) { public ResponseEntity<List<SchInfoVO>> GetUserSchlist(@RequestParam(required = false) String UserSchIds) {
if (UserSchIds == null || UserSchIds.trim().isEmpty()) return ResponseEntity.ok(Collections.emptyList()); if (UserSchIds == null || UserSchIds.trim().isEmpty()) return ResponseEntity.ok(Collections.emptyList());
Set<Integer> ids = parseInts(UserSchIds); Set<Integer> ids = parseInts(UserSchIds);
@@ -47,6 +56,7 @@ public class SchInfoController {
} }
@GetMapping("GetSchoolByGroupId") @GetMapping("GetSchoolByGroupId")
@Operation(summary = "获取学校列表", description = "根据用户中心组 ID 查询学校")
public ResponseEntity<List<SchInfoVO>> GetSchoolByGroupId(@RequestParam(required = false) Integer groupId) { public ResponseEntity<List<SchInfoVO>> GetSchoolByGroupId(@RequestParam(required = false) Integer groupId) {
if (groupId == null || groupId == 0) return ResponseEntity.ok(Collections.emptyList()); if (groupId == null || groupId == 0) return ResponseEntity.ok(Collections.emptyList());
return ResponseEntity.ok(schInfoRepository.findAll().stream() return ResponseEntity.ok(schInfoRepository.findAll().stream()
@@ -54,6 +64,7 @@ public class SchInfoController {
} }
@GetMapping("GetSchoolBySchoolenId") @GetMapping("GetSchoolBySchoolenId")
@Operation(summary = "获取学校学制", description = "根据用户中心组 ID 查询学校学制")
public ResponseEntity<List<Map<String, Object>>> GetSchoolBySchoolenId(@RequestParam(required = false) Integer groupId) { public ResponseEntity<List<Map<String, Object>>> GetSchoolBySchoolenId(@RequestParam(required = false) Integer groupId) {
return ResponseEntity.ok(Collections.emptyList()); return ResponseEntity.ok(Collections.emptyList());
} }
@@ -1,5 +1,8 @@
package com.yunhai.bschclassmanage.controller.oapi.oa; package com.yunhai.bschclassmanage.controller.oapi.oa;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import com.yunhai.bschclassmanage.Repository.*; import com.yunhai.bschclassmanage.Repository.*;
import com.yunhai.bschclassmanage.config.Config; import com.yunhai.bschclassmanage.config.Config;
import com.yunhai.bschclassmanage.entity.*; import com.yunhai.bschclassmanage.entity.*;
@@ -10,6 +13,7 @@ import org.springframework.web.bind.annotation.*;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Tag(name = "SchSub", description = "SchSub related APIs")
@RestController @RestController
@RequestMapping(Config.OAPI+"/SubInfo/") @RequestMapping(Config.OAPI+"/SubInfo/")
@CrossOrigin(originPatterns = {"*"}, allowCredentials = "true") @CrossOrigin(originPatterns = {"*"}, allowCredentials = "true")
@@ -19,6 +23,7 @@ public class SchSubController {
@Autowired private SchClassTeachRepository teachRepository; @Autowired private SchClassTeachRepository teachRepository;
@GetMapping("GetSchSublist") @GetMapping("GetSchSublist")
@Operation(summary = "GetSchSublist")
public ResponseEntity<List<Map<String,Object>>> GetSchSublist(@RequestParam(required=false) String SchID, @RequestParam(required=false) Integer schooling, @RequestParam(required=false) Integer gradeId) { public ResponseEntity<List<Map<String,Object>>> GetSchSublist(@RequestParam(required=false) String SchID, @RequestParam(required=false) Integer schooling, @RequestParam(required=false) Integer gradeId) {
if (SchID == null || SchID.trim().isEmpty()) return ResponseEntity.ok(Collections.emptyList()); if (SchID == null || SchID.trim().isEmpty()) return ResponseEntity.ok(Collections.emptyList());
Optional<SchInfo> school = schInfoRepository.findBySchSerId(SchID); Optional<SchInfo> school = schInfoRepository.findBySchSerId(SchID);
@@ -27,6 +32,7 @@ public class SchSubController {
} }
@GetMapping("GetSchIdsSublist") @GetMapping("GetSchIdsSublist")
@Operation(summary = "GetSchIdsSublist")
public ResponseEntity<List<Map<String,Object>>> GetSchIdsSublist(@RequestParam(required=false) String SchIds) { public ResponseEntity<List<Map<String,Object>>> GetSchIdsSublist(@RequestParam(required=false) String SchIds) {
if (SchIds == null || SchIds.trim().isEmpty()) return ResponseEntity.ok(Collections.emptyList()); if (SchIds == null || SchIds.trim().isEmpty()) return ResponseEntity.ok(Collections.emptyList());
List<String> ids = OaCompatSupport.strings(SchIds); List<String> ids = OaCompatSupport.strings(SchIds);
@@ -36,6 +42,7 @@ public class SchSubController {
} }
@GetMapping("GetSchTeaSublist") @GetMapping("GetSchTeaSublist")
@Operation(summary = "GetSchTeaSublist")
public ResponseEntity<List<String>> GetSchTeaSublist(@RequestParam(required=false) String UserTeaSerID) { public ResponseEntity<List<String>> GetSchTeaSublist(@RequestParam(required=false) String UserTeaSerID) {
if (UserTeaSerID == null) return ResponseEntity.ok(Collections.emptyList()); if (UserTeaSerID == null) return ResponseEntity.ok(Collections.emptyList());
try { try {
@@ -45,6 +52,7 @@ public class SchSubController {
} }
@GetMapping("GetSchTeachSublist") @GetMapping("GetSchTeachSublist")
@Operation(summary = "GetSchTeachSublist")
public ResponseEntity<List<String>> GetSchTeachSublist(@RequestParam(required=false) String SchID) { public ResponseEntity<List<String>> GetSchTeachSublist(@RequestParam(required=false) String SchID) {
if (SchID == null) return ResponseEntity.ok(Collections.emptyList()); if (SchID == null) return ResponseEntity.ok(Collections.emptyList());
Optional<SchInfo> school = schInfoRepository.findBySchSerId(SchID); Optional<SchInfo> school = schInfoRepository.findBySchSerId(SchID);
@@ -1,5 +1,8 @@
package com.yunhai.bschclassmanage.controller.oapi.oa; package com.yunhai.bschclassmanage.controller.oapi.oa;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import com.yunhai.bschclassmanage.Repository.*; import com.yunhai.bschclassmanage.Repository.*;
import com.yunhai.bschclassmanage.config.Config; import com.yunhai.bschclassmanage.config.Config;
import com.yunhai.bschclassmanage.entity.*; import com.yunhai.bschclassmanage.entity.*;
@@ -10,6 +13,7 @@ import org.springframework.web.bind.annotation.*;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Tag(name = "Schooling", description = "Schooling related APIs")
@RestController @RestController
@RequestMapping(Config.OAPI+"/Schoolen/") @RequestMapping(Config.OAPI+"/Schoolen/")
@CrossOrigin(originPatterns = {"*"}, allowCredentials = "true") @CrossOrigin(originPatterns = {"*"}, allowCredentials = "true")
@@ -25,6 +29,7 @@ public class SchoolingController {
@Autowired private SchDicSubjectRepository subjectRepository; @Autowired private SchDicSubjectRepository subjectRepository;
@GetMapping("GetSchLenLevellist") @GetMapping("GetSchLenLevellist")
@Operation(summary = "获取学校学制列表", description = "根据用 SchSerID 查询学校学制")
public ResponseEntity<List<Map<String,Object>>> GetSchLenLevellist(@RequestParam(required=false) String SchSerID) { public ResponseEntity<List<Map<String,Object>>> GetSchLenLevellist(@RequestParam(required=false) String SchSerID) {
if (SchSerID == null || SchSerID.trim().isEmpty()) return ResponseEntity.ok(Collections.emptyList()); if (SchSerID == null || SchSerID.trim().isEmpty()) return ResponseEntity.ok(Collections.emptyList());
SchInfoVOHolder school = findSchool(SchSerID); SchInfoVOHolder school = findSchool(SchSerID);
@@ -33,12 +38,14 @@ public class SchoolingController {
} }
@GetMapping("GetLevelIdlist") @GetMapping("GetLevelIdlist")
@Operation(summary = "获取学校学制列表", description = "根据用 Schooling 查询学校学制")
public ResponseEntity<List<Map<String,Object>>> GetLevelIdlist(@RequestParam(required=false) Integer Schooling) { public ResponseEntity<List<Map<String,Object>>> GetLevelIdlist(@RequestParam(required=false) Integer Schooling) {
if (Schooling == null || Schooling == 0) return ResponseEntity.ok(Collections.emptyList()); if (Schooling == null || Schooling == 0) return ResponseEntity.ok(Collections.emptyList());
return ResponseEntity.ok(gradeRepository.findBySchSystemId(Schooling).stream().map(this::grade).collect(Collectors.toList())); return ResponseEntity.ok(gradeRepository.findBySchSystemId(Schooling).stream().map(this::grade).collect(Collectors.toList()));
} }
@GetMapping("GetSchLenLevelFirst") @GetMapping("GetSchLenLevelFirst")
@Operation(summary = "获取学校学制列表", description = "根据用 年级id 查询学校学制")
public ResponseEntity<Map<String,Object>> GetSchLenLevelFirst(@RequestParam(required=false) String GradeId) { public ResponseEntity<Map<String,Object>> GetSchLenLevelFirst(@RequestParam(required=false) String GradeId) {
if (GradeId == null) return ResponseEntity.ok(null); if (GradeId == null) return ResponseEntity.ok(null);
try { try {
@@ -48,6 +55,7 @@ public class SchoolingController {
} }
@GetMapping("GetSchLenlist") @GetMapping("GetSchLenlist")
@Operation(summary = "获取学校学制长度", description = "根据用 SchSerID 查询学校学制长度")
public ResponseEntity<List<Map<String,Object>>> GetSchLenlist(@RequestParam(required=false) String SchSerID) { public ResponseEntity<List<Map<String,Object>>> GetSchLenlist(@RequestParam(required=false) String SchSerID) {
if (SchSerID == null || SchSerID.trim().isEmpty()) return ResponseEntity.ok(Collections.emptyList()); if (SchSerID == null || SchSerID.trim().isEmpty()) return ResponseEntity.ok(Collections.emptyList());
SchInfoVOHolder school = findSchool(SchSerID); SchInfoVOHolder school = findSchool(SchSerID);
@@ -57,6 +65,7 @@ public class SchoolingController {
} }
@GetMapping("GetAllClassSubject") @GetMapping("GetAllClassSubject")
@Operation(summary = "获取全部", description = "根据用 SchSerID 查询学校学制长度")
public ResponseEntity<List<Map<String,Object>>> GetAllClassSubject(@RequestParam(required=false) Integer schId, @RequestParam(required=false) String schserid, @RequestParam(required=false) String startTime) { public ResponseEntity<List<Map<String,Object>>> GetAllClassSubject(@RequestParam(required=false) Integer schId, @RequestParam(required=false) String schserid, @RequestParam(required=false) String startTime) {
return ResponseEntity.ok(Collections.emptyList()); return ResponseEntity.ok(Collections.emptyList());
} }
@@ -1,5 +1,8 @@
package com.yunhai.bschclassmanage.controller.oapi.oa; package com.yunhai.bschclassmanage.controller.oapi.oa;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import com.yunhai.bschclassmanage.Repository.*; import com.yunhai.bschclassmanage.Repository.*;
import com.yunhai.bschclassmanage.config.Config; import com.yunhai.bschclassmanage.config.Config;
import com.yunhai.bschclassmanage.entity.*; import com.yunhai.bschclassmanage.entity.*;
@@ -9,6 +12,7 @@ import org.springframework.web.bind.annotation.*;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Tag(name = "StuInfo", description = "StuInfo related APIs")
@RestController @RestController
@RequestMapping(Config.OAPI+"/OAStu/") @RequestMapping(Config.OAPI+"/OAStu/")
@CrossOrigin(originPatterns = {"*"}, allowCredentials = "true") @CrossOrigin(originPatterns = {"*"}, allowCredentials = "true")
@@ -18,60 +22,79 @@ public class StuInfoController {
@Autowired private SchStudentHistoryRepository historyRepository; @Autowired private SchStudentHistoryRepository historyRepository;
@GetMapping("GetAllStulist") @GetMapping("GetAllStulist")
@Operation(summary = "GetAllStulist")
public ResponseEntity<List<Map<String,Object>>> GetAllStulist() { return ResponseEntity.ok(students(studentRepository.findAll(), null)); } public ResponseEntity<List<Map<String,Object>>> GetAllStulist() { return ResponseEntity.ok(students(studentRepository.findAll(), null)); }
@GetMapping("GetEleAllStulist") @GetMapping("GetEleAllStulist")
@Operation(summary = "GetEleAllStulist")
public ResponseEntity<List<Map<String,Object>>> GetEleAllStulist() { return ResponseEntity.ok(studentRepository.findAll().stream().map(s -> OaCompatSupport.electiveStudent(s, schoolSer(s.getSchId()), String.valueOf(s.getClassId()))).collect(Collectors.toList())); } public ResponseEntity<List<Map<String,Object>>> GetEleAllStulist() { return ResponseEntity.ok(studentRepository.findAll().stream().map(s -> OaCompatSupport.electiveStudent(s, schoolSer(s.getSchId()), String.valueOf(s.getClassId()))).collect(Collectors.toList())); }
@GetMapping("GetSchStulist") @GetMapping("GetSchStulist")
@Operation(summary = "GetSchStulist")
public ResponseEntity<List<Map<String,Object>>> GetSchStulist(@RequestParam(required=false) String schserid, @RequestParam(required=false) String schgroupid) { public ResponseEntity<List<Map<String,Object>>> GetSchStulist(@RequestParam(required=false) String schserid, @RequestParam(required=false) String schgroupid) {
return ResponseEntity.ok(filter(schserid, schgroupid, null, null)); return ResponseEntity.ok(filter(schserid, schgroupid, null, null));
} }
@GetMapping("GetEleSchStulist") @GetMapping("GetEleSchStulist")
@Operation(summary = "GetEleSchStulist")
public ResponseEntity<List<Map<String,Object>>> GetEleSchStulist(@RequestParam(required=false) String schserid, @RequestParam(required=false) String schgroupid) { public ResponseEntity<List<Map<String,Object>>> GetEleSchStulist(@RequestParam(required=false) String schserid, @RequestParam(required=false) String schgroupid) {
return ResponseEntity.ok(filter(schserid, schgroupid, null, null).stream().map(m -> m).collect(Collectors.toList())); return ResponseEntity.ok(filter(schserid, schgroupid, null, null).stream().map(m -> m).collect(Collectors.toList()));
} }
@GetMapping("GetClaStulist") @GetMapping("GetClaStulist")
@Operation(summary = "GetClaStulist")
public ResponseEntity<List<Map<String,Object>>> GetClaStulist(@RequestParam(required=false) String ClassID, @RequestParam(required=false) String clagroupid) { return ResponseEntity.ok(filter(null, null, ClassID, clagroupid)); } public ResponseEntity<List<Map<String,Object>>> GetClaStulist(@RequestParam(required=false) String ClassID, @RequestParam(required=false) String clagroupid) { return ResponseEntity.ok(filter(null, null, ClassID, clagroupid)); }
@GetMapping("GetEleClaStulist") @GetMapping("GetEleClaStulist")
@Operation(summary = "GetEleClaStulist")
public ResponseEntity<List<Map<String,Object>>> GetEleClaStulist(@RequestParam(required=false) String ClassID, @RequestParam(required=false) String clagroupid) { return ResponseEntity.ok(filter(null, null, ClassID, clagroupid)); } public ResponseEntity<List<Map<String,Object>>> GetEleClaStulist(@RequestParam(required=false) String ClassID, @RequestParam(required=false) String clagroupid) { return ResponseEntity.ok(filter(null, null, ClassID, clagroupid)); }
@GetMapping("GetClaArrStulist") @GetMapping("GetClaArrStulist")
@Operation(summary = "GetClaArrStulist")
public ResponseEntity<List<Map<String,Object>>> GetClaArrStulist(@RequestParam(required=false) String ClassIDs, @RequestParam(required=false) String clagroupids) { return ResponseEntity.ok(filterArrays(ClassIDs, clagroupids)); } public ResponseEntity<List<Map<String,Object>>> GetClaArrStulist(@RequestParam(required=false) String ClassIDs, @RequestParam(required=false) String clagroupids) { return ResponseEntity.ok(filterArrays(ClassIDs, clagroupids)); }
@GetMapping("GetEleClaArrStulist") @GetMapping("GetEleClaArrStulist")
@Operation(summary = "GetEleClaArrStulist")
public ResponseEntity<List<Map<String,Object>>> GetEleClaArrStulist(@RequestParam(required=false) String ClassIDs, @RequestParam(required=false) String clagroupids) { return ResponseEntity.ok(filterArrays(ClassIDs, clagroupids)); } public ResponseEntity<List<Map<String,Object>>> GetEleClaArrStulist(@RequestParam(required=false) String ClassIDs, @RequestParam(required=false) String clagroupids) { return ResponseEntity.ok(filterArrays(ClassIDs, clagroupids)); }
@GetMapping("GetStuIdslist") @GetMapping("GetStuIdslist")
@Operation(summary = "GetStuIdslist")
public ResponseEntity<List<Map<String,Object>>> GetStuIdslist(@RequestParam(required=false) String stuids) { public ResponseEntity<List<Map<String,Object>>> GetStuIdslist(@RequestParam(required=false) String stuids) {
Set<Integer> ids = new HashSet<>(OaCompatSupport.ints(stuids)); Set<Integer> ids = new HashSet<>(OaCompatSupport.ints(stuids));
return ResponseEntity.ok(students(studentRepository.findAll().stream().filter(s -> ids.contains(s.getStuId())).collect(Collectors.toList()), null)); return ResponseEntity.ok(students(studentRepository.findAll().stream().filter(s -> ids.contains(s.getStuId())).collect(Collectors.toList()), null));
} }
@GetMapping("GetEleStuIdslist") @GetMapping("GetEleStuIdslist")
@Operation(summary = "GetEleStuIdslist")
public ResponseEntity<List<Map<String,Object>>> GetEleStuIdslist(@RequestParam(required=false) String stuids) { return GetStuIdslist(stuids); } public ResponseEntity<List<Map<String,Object>>> GetEleStuIdslist(@RequestParam(required=false) String stuids) { return GetStuIdslist(stuids); }
@GetMapping("GetStuUserFamIDList") @GetMapping("GetStuUserFamIDList")
@Operation(summary = "GetStuUserFamIDList")
public ResponseEntity<List<String>> GetStuUserFamIDList(@RequestParam(required=false) String stuids) { return ResponseEntity.ok(Collections.emptyList()); } public ResponseEntity<List<String>> GetStuUserFamIDList(@RequestParam(required=false) String stuids) { return ResponseEntity.ok(Collections.emptyList()); }
@GetMapping("GetFamStulist") @GetMapping("GetFamStulist")
@Operation(summary = "GetFamStulist")
public ResponseEntity<List<Map<String,Object>>> GetFamStulist(@RequestParam(required=false) String invitecodes) { public ResponseEntity<List<Map<String,Object>>> GetFamStulist(@RequestParam(required=false) String invitecodes) {
Set<String> codes = new HashSet<>(OaCompatSupport.strings(invitecodes)); Set<String> codes = new HashSet<>(OaCompatSupport.strings(invitecodes));
return ResponseEntity.ok(students(studentRepository.findAll().stream().filter(s -> codes.contains(s.getInvitationCode())).collect(Collectors.toList()), null)); return ResponseEntity.ok(students(studentRepository.findAll().stream().filter(s -> codes.contains(s.getInvitationCode())).collect(Collectors.toList()), null));
} }
@GetMapping("GetStuFamMem") @GetMapping("GetStuFamMem")
@Operation(summary = "GetAllStuFamMem")
public ResponseEntity<List<Map<String,Object>>> GetAllStuFamMem(@RequestParam(required=false) String SchSerID) { return ResponseEntity.ok(Collections.emptyList()); } public ResponseEntity<List<Map<String,Object>>> GetAllStuFamMem(@RequestParam(required=false) String SchSerID) { return ResponseEntity.ok(Collections.emptyList()); }
@GetMapping("GetSchBySchIds") @GetMapping("GetSchBySchIds")
@Operation(summary = "GetSchIdsStulist")
public ResponseEntity<List<Map<String,Object>>> GetSchIdsStulist(@RequestParam(required=false) String schserids) { public ResponseEntity<List<Map<String,Object>>> GetSchIdsStulist(@RequestParam(required=false) String schserids) {
Set<Integer> ids = new HashSet<>(); for (String id : OaCompatSupport.strings(schserids)) schoolRepository.findBySchSerId(id).ifPresent(s -> ids.add(s.getSchId())); Set<Integer> ids = new HashSet<>(); for (String id : OaCompatSupport.strings(schserids)) schoolRepository.findBySchSerId(id).ifPresent(s -> ids.add(s.getSchId()));
return ResponseEntity.ok(students(studentRepository.findAll().stream().filter(s -> ids.contains(s.getSchId())).collect(Collectors.toList()), null)); return ResponseEntity.ok(students(studentRepository.findAll().stream().filter(s -> ids.contains(s.getSchId())).collect(Collectors.toList()), null));
} }
@GetMapping("GetEleSchIdsStulist") @GetMapping("GetEleSchIdsStulist")
@Operation(summary = "GetEleSchIdsStulist")
public ResponseEntity<List<Map<String,Object>>> GetEleSchIdsStulist(@RequestParam(required=false) String schserids) { return GetSchIdsStulist(schserids); } public ResponseEntity<List<Map<String,Object>>> GetEleSchIdsStulist(@RequestParam(required=false) String schserids) { return GetSchIdsStulist(schserids); }
@GetMapping("GetEleSchBySchIds") @GetMapping("GetEleSchBySchIds")
@Operation(summary = "GetEleSchBySchIds")
public ResponseEntity<List<Map<String,Object>>> GetEleSchBySchIds(@RequestParam(required=false) String schserids) { return GetSchIdsStulist(schserids); } public ResponseEntity<List<Map<String,Object>>> GetEleSchBySchIds(@RequestParam(required=false) String schserids) { return GetSchIdsStulist(schserids); }
@GetMapping("GetStudentsByElectiveId") @GetMapping("GetStudentsByElectiveId")
@Operation(summary = "GetStudentsByElectiveId")
public ResponseEntity<List<Map<String,Object>>> GetStudentsByElectiveId(@RequestParam(required=false) Integer electiveIds) { return ResponseEntity.ok(Collections.emptyList()); } public ResponseEntity<List<Map<String,Object>>> GetStudentsByElectiveId(@RequestParam(required=false) Integer electiveIds) { return ResponseEntity.ok(Collections.emptyList()); }
@GetMapping("getHistoryStudentsBySchoolId") @GetMapping("getHistoryStudentsBySchoolId")
@Operation(summary = "getHistoryStudentsBySchoolId")
public ResponseEntity<List<Map<String,Object>>> getHistoryStudentsBySchoolId(@RequestParam Integer schoolId, @RequestParam Integer year) { public ResponseEntity<List<Map<String,Object>>> getHistoryStudentsBySchoolId(@RequestParam Integer schoolId, @RequestParam Integer year) {
return ResponseEntity.ok(historyRepository.findAll().stream().filter(h -> Objects.equals(h.getSchId(), schoolId) && Objects.equals(h.getYear(), year)).map(this::history).collect(Collectors.toList())); return ResponseEntity.ok(historyRepository.findAll().stream().filter(h -> Objects.equals(h.getSchId(), schoolId) && Objects.equals(h.getYear(), year)).map(this::history).collect(Collectors.toList()));
} }
@GetMapping("getHistoryClass") @GetMapping("getHistoryClass")
@Operation(summary = "getHistoryClass")
public ResponseEntity<List<Map<String,Object>>> getHistoryClass(@RequestParam Integer schoolId, @RequestParam Integer year) { return ResponseEntity.ok(Collections.emptyList()); } public ResponseEntity<List<Map<String,Object>>> getHistoryClass(@RequestParam Integer schoolId, @RequestParam Integer year) { return ResponseEntity.ok(Collections.emptyList()); }
private List<Map<String,Object>> filter(String schserid, String schgroupid, String classId, String classGroupId) { private List<Map<String,Object>> filter(String schserid, String schgroupid, String classId, String classGroupId) {
@@ -1,5 +1,8 @@
package com.yunhai.bschclassmanage.controller.oapi.oa; package com.yunhai.bschclassmanage.controller.oapi.oa;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import com.yunhai.bschclassmanage.Repository.*; import com.yunhai.bschclassmanage.Repository.*;
import com.yunhai.bschclassmanage.config.Config; import com.yunhai.bschclassmanage.config.Config;
import com.yunhai.bschclassmanage.entity.*; import com.yunhai.bschclassmanage.entity.*;
@@ -9,6 +12,7 @@ import org.springframework.web.bind.annotation.*;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Tag(name = "TeaChes", description = "TeaChes related APIs")
@RestController @RestController
@RequestMapping(Config.OAPI+"/TeachInfo/") @RequestMapping(Config.OAPI+"/TeachInfo/")
@CrossOrigin(originPatterns = {"*"}, allowCredentials = "true") @CrossOrigin(originPatterns = {"*"}, allowCredentials = "true")
@@ -17,26 +21,34 @@ public class TeaChesController {
@Autowired private SchInfoRepository schoolRepository; @Autowired private SchInfoRepository schoolRepository;
@GetMapping("GetSchTeachlist") @GetMapping("GetSchTeachlist")
@Operation(summary = "GetSchTeach")
public ResponseEntity<List<Map<String,Object>>> GetSchTeach(@RequestParam(required=false) String SchID, @RequestParam(required=false) Integer UserTeaSerID) { public ResponseEntity<List<Map<String,Object>>> GetSchTeach(@RequestParam(required=false) String SchID, @RequestParam(required=false) Integer UserTeaSerID) {
Integer schId = SchID == null ? null : schoolRepository.findBySchSerId(SchID).map(SchInfo::getSchId).orElse(null); Integer schId = SchID == null ? null : schoolRepository.findBySchSerId(SchID).map(SchInfo::getSchId).orElse(null);
return ResponseEntity.ok(teachingRepository.findAll().stream().filter(t -> (schId == null || Objects.equals(t.getSchId(), schId)) && (UserTeaSerID == null || Objects.equals(t.getTeaId(), UserTeaSerID))).map(t -> OaCompatSupport.teaching(t, schoolSer(t.getSchId()))).collect(Collectors.toList())); return ResponseEntity.ok(teachingRepository.findAll().stream().filter(t -> (schId == null || Objects.equals(t.getSchId(), schId)) && (UserTeaSerID == null || Objects.equals(t.getTeaId(), UserTeaSerID))).map(t -> OaCompatSupport.teaching(t, schoolSer(t.getSchId()))).collect(Collectors.toList()));
} }
@GetMapping("GetEleSchTeachlist") @GetMapping("GetEleSchTeachlist")
@Operation(summary = "GetEleSchTeachlist")
public ResponseEntity<List<Map<String,Object>>> GetEleSchTeachlist(@RequestParam(required=false) String SchID, @RequestParam(required=false) Integer UserTeaSerID) { return GetSchTeach(SchID, UserTeaSerID); } public ResponseEntity<List<Map<String,Object>>> GetEleSchTeachlist(@RequestParam(required=false) String SchID, @RequestParam(required=false) Integer UserTeaSerID) { return GetSchTeach(SchID, UserTeaSerID); }
@GetMapping("GetSchArrTeachlist") @GetMapping("GetSchArrTeachlist")
@Operation(summary = "GetSchArrTeach")
public ResponseEntity<List<Map<String,Object>>> GetSchArrTeach(@RequestParam(required=false) String SchIDArr) { return bySchools(SchIDArr); } public ResponseEntity<List<Map<String,Object>>> GetSchArrTeach(@RequestParam(required=false) String SchIDArr) { return bySchools(SchIDArr); }
@GetMapping("GetEleSchArrTeachList") @GetMapping("GetEleSchArrTeachList")
@Operation(summary = "GetEleSchArrTeachList")
public ResponseEntity<List<Map<String,Object>>> GetEleSchArrTeachList(@RequestParam(required=false) String SchIDArr) { return bySchools(SchIDArr); } public ResponseEntity<List<Map<String,Object>>> GetEleSchArrTeachList(@RequestParam(required=false) String SchIDArr) { return bySchools(SchIDArr); }
@GetMapping("GetSchClaTeachlist") @GetMapping("GetSchClaTeachlist")
@Operation(summary = "GetClassTeach")
public ResponseEntity<List<Map<String,Object>>> GetClassTeach(@RequestParam(required=false) String ClassID) { public ResponseEntity<List<Map<String,Object>>> GetClassTeach(@RequestParam(required=false) String ClassID) {
Integer classId = intValue(ClassID); Integer classId = intValue(ClassID);
return ResponseEntity.ok(teachingRepository.findAll().stream().filter(t -> classId != null && Objects.equals(t.getClassId(), classId)).map(t -> OaCompatSupport.teaching(t, schoolSer(t.getSchId()))).collect(Collectors.toList())); return ResponseEntity.ok(teachingRepository.findAll().stream().filter(t -> classId != null && Objects.equals(t.getClassId(), classId)).map(t -> OaCompatSupport.teaching(t, schoolSer(t.getSchId()))).collect(Collectors.toList()));
} }
@GetMapping("GetEleSchClaTeachlist") @GetMapping("GetEleSchClaTeachlist")
@Operation(summary = "GetEleSchClaTeachlist")
public ResponseEntity<List<Map<String,Object>>> GetEleSchClaTeachlist(@RequestParam(required=false) String ClassID) { return GetClassTeach(ClassID); } public ResponseEntity<List<Map<String,Object>>> GetEleSchClaTeachlist(@RequestParam(required=false) String ClassID) { return GetClassTeach(ClassID); }
@GetMapping("GetElectiveClassByGrade") @GetMapping("GetElectiveClassByGrade")
@Operation(summary = "GetElectiveClassByGrade")
public ResponseEntity<List<Map<String,Object>>> GetElectiveClassByGrade(@RequestParam(required=false) Integer schoolId, @RequestParam(required=false) Integer gradeId) { return ResponseEntity.ok(Collections.emptyList()); } public ResponseEntity<List<Map<String,Object>>> GetElectiveClassByGrade(@RequestParam(required=false) Integer schoolId, @RequestParam(required=false) Integer gradeId) { return ResponseEntity.ok(Collections.emptyList()); }
@PostMapping("GetElectiveClassByTeachers") @PostMapping("GetElectiveClassByTeachers")
@Operation(summary = "GetElectiveClassByTeachers")
public ResponseEntity<List<Map<String,Object>>> GetElectiveClassByTeachers(@RequestBody(required=false) String teacherIds) { return ResponseEntity.ok(Collections.emptyList()); } public ResponseEntity<List<Map<String,Object>>> GetElectiveClassByTeachers(@RequestBody(required=false) String teacherIds) { return ResponseEntity.ok(Collections.emptyList()); }
private ResponseEntity<List<Map<String,Object>>> bySchools(String value) { private ResponseEntity<List<Map<String,Object>>> bySchools(String value) {
@@ -1,5 +1,8 @@
package com.yunhai.bschclassmanage.controller.oapi.oa; package com.yunhai.bschclassmanage.controller.oapi.oa;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import com.yunhai.bschclassmanage.Repository.SchTeacherRepository; import com.yunhai.bschclassmanage.Repository.SchTeacherRepository;
import com.yunhai.bschclassmanage.config.Config; import com.yunhai.bschclassmanage.config.Config;
import com.yunhai.bschclassmanage.entity.SchTeacher; import com.yunhai.bschclassmanage.entity.SchTeacher;
@@ -22,6 +25,7 @@ import java.util.List;
import java.util.Optional; import java.util.Optional;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Tag(name = "Teainfo", description = "Teainfo related APIs")
@RestController @RestController
@RequestMapping(Config.OAPI+"/OATea/") @RequestMapping(Config.OAPI+"/OATea/")
@CrossOrigin(originPatterns = {"*"}, allowCredentials = "true") @CrossOrigin(originPatterns = {"*"}, allowCredentials = "true")
@@ -37,15 +41,16 @@ public class TeainfoController {
private ISchInfoService schInfoService; private ISchInfoService schInfoService;
@GetMapping("GetTeainfo") @GetMapping("GetTeainfo")
@Operation(summary = "getTeainfo")
public ResponseEntity<TeaInfoVO> getTeainfo(@RequestParam Integer uid) { public ResponseEntity<TeaInfoVO> getTeainfo(@RequestParam Integer uid) {
// 1. 参数校验 // 1. 鍙傛暟鏍¢獙
if (uid == null) { if (uid == null) {
return ResponseEntity.badRequest().build(); return ResponseEntity.badRequest().build();
} }
// 2. 直接使用 uid 查询 // 2. 鐩存帴浣跨敤 uid 鏌ヨ
return schTeacherRepository.findByTeaId(uid) // 假设 findByTeaId 返回 Optional<SchTeacher> return schTeacherRepository.findByTeaId(uid) // 鍋囪 findByTeaId 杩斿洖 Optional<SchTeacher>
.map(this::convertToTeaInfoVO) // 将 SchTeacher 转为 TeaInfoVO .map(this::convertToTeaInfoVO) // 灏?SchTeacher 杞负 TeaInfoVO
.map(ResponseEntity::ok) .map(ResponseEntity::ok)
.orElse(ResponseEntity.notFound().build()); .orElse(ResponseEntity.notFound().build());
} }
@@ -56,7 +61,7 @@ public class TeainfoController {
} }
TeaInfoVO vo = new TeaInfoVO(); TeaInfoVO vo = new TeaInfoVO();
// 直接映射 // 鐩存帴鏄犲皠
vo.setAccount(teacher.getAccount()); vo.setAccount(teacher.getAccount());
vo.setName(teacher.getName()); vo.setName(teacher.getName());
vo.setTeaIDCard(teacher.getIdCard()); vo.setTeaIDCard(teacher.getIdCard());
@@ -69,7 +74,7 @@ public class TeainfoController {
vo.setTeaSex(sex); vo.setTeaSex(sex);
} }
// TeaSerID 使用 teaId(转为字符串)或 id // TeaSerID 浣跨敤 teaId锛堣浆涓哄瓧绗︿覆锛夋垨 id
if (teacher.getTeaId() != null) { if (teacher.getTeaId() != null) {
vo.setTeaSerID(teacher.getTeaId().toString()); vo.setTeaSerID(teacher.getTeaId().toString());
} else { } else {
@@ -80,7 +85,7 @@ public class TeainfoController {
if(groupList==null||groupList.isEmpty()) if(groupList==null||groupList.isEmpty())
return null; return null;
// 其他字段默认 null(或根据业务设置默认值) // 鍏朵粬瀛楁榛樿 null锛堟垨鏍规嵁涓氬姟璁剧疆榛樿鍊硷級
SchInfoVO schInfoVO= schInfoService.GetSchFirst(groupList.stream().findFirst().get().getSchId()); SchInfoVO schInfoVO= schInfoService.GetSchFirst(groupList.stream().findFirst().get().getSchId());
vo.setSchSerID(schInfoVO==null?null:schInfoVO.getSchSerId()); vo.setSchSerID(schInfoVO==null?null:schInfoVO.getSchSerId());
@@ -90,8 +95,9 @@ public class TeainfoController {
} }
@PostMapping("GetArrTeainfo") @PostMapping("GetArrTeainfo")
@Operation(summary = "根据教师id数组 获取教师列表")
public ResponseEntity<List<TeaInfoVO>> getArrTeainfo(@RequestBody String userIds) { public ResponseEntity<List<TeaInfoVO>> getArrTeainfo(@RequestBody String userIds) {
// 1. 参数校验 // 1. 鍙傛暟鏍¢獙
if (userIds == null) { if (userIds == null) {
return ResponseEntity.badRequest().build(); return ResponseEntity.badRequest().build();
} }
@@ -106,21 +112,35 @@ public class TeainfoController {
return voList.isEmpty() ? ResponseEntity.noContent().build() : ResponseEntity.ok(voList); return voList.isEmpty() ? ResponseEntity.noContent().build() : ResponseEntity.ok(voList);
} }
/**
* 解析学校ID:支持直接传 schId,或传 SchSerID 反查 schId,二者至少提供一个。
*
* @param schId 学校内部ID(优先使用)
* @param schSerID 学校外部序列号
* @return 学校内部ID,参数非法或查不到时返回 null
*/
private Integer resolveSchId(Integer schId, String schSerID) {
if (schId != null) {
return schId;
}
if (schSerID == null || schSerID.trim().isEmpty()) {
return null;
}
SchInfoVO schInfoVO = schInfoService.GetSchFirst(schSerID);
return schInfoVO == null ? null : schInfoVO.getUserSchSerId();
}
@GetMapping("GetSchTeainfo") @GetMapping("GetSchTeainfo")
public ResponseEntity<List<TeaInfoVO>> getSchTeainfo(@RequestParam String SchSerID) { @Operation(summary = "根据学校ID 获取教师列表(SchSerID 与 schId 二选一)")
// 1. 参数校验 public ResponseEntity<List<TeaInfoVO>> getSchTeainfo(@RequestParam(value = "SchSerID", required = false) String SchSerID,
if (SchSerID == null) { @RequestParam(value = "schId", required = false) Integer schId) {
// 1. 参数校验:SchSerID 与 schId 至少传一个
Integer resolvedSchId = resolveSchId(schId, SchSerID);
if (resolvedSchId == null) {
return ResponseEntity.badRequest().build(); return ResponseEntity.badRequest().build();
} }
SchInfoVO schInfoVO= schInfoService.GetSchFirst(SchSerID); List<SchTeacher> teachers = schTeacherService.getSchTeacherList(resolvedSchId);
if(schInfoVO==null)
{
return ResponseEntity.badRequest().build();
}
Integer schId=schInfoVO.getUserSchSerId();
List<SchTeacher> teachers = schTeacherService.getSchTeacherList(schId);
List<TeaInfoVO> voList = teachers.stream() List<TeaInfoVO> voList = teachers.stream()
.map(this::convertToTeaInfoVO) .map(this::convertToTeaInfoVO)
@@ -130,8 +150,10 @@ public class TeainfoController {
} }
@GetMapping("GetSchTeaList") @GetMapping("GetSchTeaList")
public ResponseEntity<List<TeaInfoVO>> getSchTeaList(@RequestParam String SchSerID) { @Operation(summary = "getSchTeaList(SchSerID 与 schId 二选一)")
return getSchTeainfo(SchSerID); public ResponseEntity<List<TeaInfoVO>> getSchTeaList(@RequestParam(value = "SchSerID", required = false) String SchSerID,
@RequestParam(value = "schId", required = false) Integer schId) {
return getSchTeainfo(SchSerID, schId);
} }
@@ -1,5 +1,8 @@
package com.yunhai.bschclassmanage.controller.oapi.oa; package com.yunhai.bschclassmanage.controller.oapi.oa;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import com.yunhai.bschclassmanage.Repository.SchStudentRepository; import com.yunhai.bschclassmanage.Repository.SchStudentRepository;
import com.yunhai.bschclassmanage.Repository.SchTeacherRepository; import com.yunhai.bschclassmanage.Repository.SchTeacherRepository;
import com.yunhai.bschclassmanage.config.Config; import com.yunhai.bschclassmanage.config.Config;
@@ -23,6 +26,7 @@ import java.util.List;
import java.util.Optional; import java.util.Optional;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Tag(name = "UserInfo", description = "UserInfo related APIs")
@RestController @RestController
@RequestMapping(Config.OAPI + "/UserInfo/") @RequestMapping(Config.OAPI + "/UserInfo/")
@CrossOrigin(originPatterns = {"*"}, allowCredentials = "true") @CrossOrigin(originPatterns = {"*"}, allowCredentials = "true")
@@ -44,8 +48,9 @@ public class UserInfoController {
private ISchInfoService schInfoService; private ISchInfoService schInfoService;
@GetMapping("GetUserList") @GetMapping("GetUserList")
@Operation(summary = "getUserList")
public ResponseEntity<List<UserInfoVO>> getUserList(@RequestParam String SchSerID) { public ResponseEntity<List<UserInfoVO>> getUserList(@RequestParam String SchSerID) {
// 1. 参数校验 // 1. 鍙傛暟鏍¢獙
if (SchSerID == null || SchSerID.trim().isEmpty()) { if (SchSerID == null || SchSerID.trim().isEmpty()) {
return ResponseEntity.badRequest().build(); return ResponseEntity.badRequest().build();
} }
@@ -56,16 +61,16 @@ public class UserInfoController {
} }
Integer schId = schInfoVO.getUserSchSerId(); Integer schId = schInfoVO.getUserSchSerId();
// 2. 获取教师和学生列表(判空) // 2. 鑾峰彇鏁欏笀鍜屽鐢熷垪琛紙鍒ょ┖锛?
List<SchTeacher> teachers = schTeacherService.getSchTeacherCacheList(schId); List<SchTeacher> teachers = schTeacherService.getSchTeacherCacheList(schId);
List<SchStudent> students = schStudentService.getSchGradeClassStudentCacheList(schId, null, null, null); List<SchStudent> students = schStudentService.getSchGradeClassStudentCacheList(schId, null, null, null);
// 3. 转换为 UserInfoVO // 3. 杞崲涓?UserInfoVO
List<UserInfoVO> voList = new ArrayList<>(); List<UserInfoVO> voList = new ArrayList<>();
if (teachers != null) { if (teachers != null) {
voList.addAll(teachers.stream() voList.addAll(teachers.stream()
.map(this::convertToUserInfoVO) .map(this::convertToUserInfoVO)
.filter(vo -> vo != null) // 过滤转换失败的 .filter(vo -> vo != null) // 杩囨护杞崲澶辫触鐨?
.collect(Collectors.toList())); .collect(Collectors.toList()));
} }
if (students != null) { if (students != null) {
@@ -75,51 +80,51 @@ public class UserInfoController {
.collect(Collectors.toList())); .collect(Collectors.toList()));
} }
// 4. 返回结果 // 4. 杩斿洖缁撴灉
return voList.isEmpty() ? ResponseEntity.noContent().build() : ResponseEntity.ok(voList); return voList.isEmpty() ? ResponseEntity.noContent().build() : ResponseEntity.ok(voList);
} }
// ===== 转换教师 ===== // ===== 杞崲鏁欏笀 =====
private UserInfoVO convertToUserInfoVO(SchTeacher teacher) { private UserInfoVO convertToUserInfoVO(SchTeacher teacher) {
if (teacher == null) { if (teacher == null) {
return null; return null;
} }
UserInfoVO vo = new UserInfoVO(); UserInfoVO vo = new UserInfoVO();
// 基础字段 // 鍩虹瀛楁
vo.setUids(teacher.getAccount()); vo.setUids(teacher.getAccount());
vo.setName(teacher.getName()); vo.setName(teacher.getName());
vo.setIDCard(teacher.getIdCard()); vo.setIDCard(teacher.getIdCard());
vo.setTel(teacher.getTel()); vo.setTel(teacher.getTel());
vo.setNo(teacher.getSort()); vo.setNo(teacher.getSort());
vo.setSex(teacher.getGender()); vo.setSex(teacher.getGender());
vo.setUserID(teacher.getTeaId()); // 教师用户ID vo.setUserID(teacher.getTeaId()); // 鏁欏笀鐢ㄦ埛ID
vo.setUsertype(1); // 假设教师类型为1 vo.setUsertype(1); // 鍋囪鏁欏笀绫诲瀷涓?
// 获取学校ID和组ID // 鑾峰彇瀛︽牎ID鍜岀粍ID
List<SchTeacherGroup> groupList = teacher.getGroupList(); List<SchTeacherGroup> groupList = teacher.getGroupList();
if (groupList != null && !groupList.isEmpty()) { if (groupList != null && !groupList.isEmpty()) {
SchTeacherGroup firstGroup = groupList.get(0); SchTeacherGroup firstGroup = groupList.get(0);
vo.setGroupID(firstGroup.getGroupId()); vo.setGroupID(firstGroup.getGroupId());
// 通过组获取学校信息 // 閫氳繃缁勮幏鍙栧鏍′俊鎭?
SchInfoVO schInfo = schInfoService.GetSchFirst(firstGroup.getSchId()); SchInfoVO schInfo = schInfoService.GetSchFirst(firstGroup.getSchId());
// 若没有直接按组查学校的方法,可改为通过组的schId查 // 鑻ユ病鏈夌洿鎺ユ寜缁勬煡瀛︽牎鐨勬柟娉曪紝鍙敼涓洪€氳繃缁勭殑schId鏌?
if (schInfo != null) { if (schInfo != null) {
vo.setSchSerID(schInfo.getSchSerId()); vo.setSchSerID(schInfo.getSchSerId());
} }
} else { } else {
// 无分组,可能是管理员或特殊用户,可设置默认或 null // 鏃犲垎缁勶紝鍙兘鏄鐞嗗憳鎴栫壒娈婄敤鎴凤紝鍙缃粯璁ゆ垨 null
vo.setGroupID(null); vo.setGroupID(null);
vo.setSchSerID(null); vo.setSchSerID(null);
} }
// 其他字段(如 Photo, SerID 等)如果 SchTeacher 没有,可置 null 或从别处获取 // 鍏朵粬瀛楁锛堝 Photo, SerID 绛夛級濡傛灉 SchTeacher 娌℃湁锛屽彲缃?null 鎴栦粠鍒鑾峰彇
vo.setPhoto(null); // 可根据 teacher 的某字段补充 vo.setPhoto(null); // 鍙牴鎹?teacher 鐨勬煇瀛楁琛ュ厖
vo.setSerID(null); vo.setSerID(null);
return vo; return vo;
} }
// ===== 转换学生 ===== // ===== 杞崲瀛︾敓 =====
private UserInfoVO convertToUserInfoVO(SchStudent student) { private UserInfoVO convertToUserInfoVO(SchStudent student) {
if (student == null) { if (student == null) {
return null; return null;
@@ -129,16 +134,16 @@ public class UserInfoController {
vo.setUids(student.getAccount()); vo.setUids(student.getAccount());
vo.setName(student.getName()); vo.setName(student.getName());
vo.setIDCard(student.getIdCard()); vo.setIDCard(student.getIdCard());
vo.setTel(null); // 学生表可能无电话,如有则补充 vo.setTel(null); // 瀛︾敓琛ㄥ彲鑳芥棤鐢佃瘽锛屽鏈夊垯琛ュ厖
vo.setNo(null); // 学生表没有 No 字段,可置 null 或从 stuClassNo 转换 vo.setNo(null); // 瀛︾敓琛ㄦ病鏈?No 瀛楁锛屽彲缃?null 鎴栦粠 stuClassNo 杞崲
vo.setSex(student.getGender()); vo.setSex(student.getGender());
vo.setUserID(student.getStuId()); // 学生用户ID vo.setUserID(student.getStuId()); // 瀛︾敓鐢ㄦ埛ID
vo.setUsertype(UserRole.STU_USER.getValue()); // 假设学生类型为2 vo.setUsertype(UserRole.STU_USER.getValue()); // 鍋囪瀛︾敓绫诲瀷涓?
vo.setGroupID(student.getGroupId()); vo.setGroupID(student.getGroupId());
SchInfoVO schInfo = schInfoService.GetSchFirst(student.getSchId()); SchInfoVO schInfo = schInfoService.GetSchFirst(student.getSchId());
// 若没有直接按组查学校的方法,可改为通过组的schId查 // 鑻ユ病鏈夌洿鎺ユ寜缁勬煡瀛︽牎鐨勬柟娉曪紝鍙敼涓洪€氳繃缁勭殑schId鏌?
if (schInfo != null) { if (schInfo != null) {
vo.setSchSerID(schInfo.getSchSerId()); vo.setSchSerID(schInfo.getSchSerId());
} }
@@ -149,6 +154,7 @@ public class UserInfoController {
} }
@GetMapping("getUserIdList") @GetMapping("getUserIdList")
@Operation(summary = "getUserIdList")
public ResponseEntity<List<UserInfoVO>> getUserIdList(@RequestParam Integer userid) { public ResponseEntity<List<UserInfoVO>> getUserIdList(@RequestParam Integer userid) {
if (userid == null) { if (userid == null) {
return ResponseEntity.badRequest().build(); return ResponseEntity.badRequest().build();
@@ -1,5 +1,8 @@
package com.yunhai.bschclassmanage.controller.oapi.oa; package com.yunhai.bschclassmanage.controller.oapi.oa;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import com.yunhai.bschclassmanage.Repository.*; import com.yunhai.bschclassmanage.Repository.*;
import com.yunhai.bschclassmanage.config.Config; import com.yunhai.bschclassmanage.config.Config;
import com.yunhai.bschclassmanage.entity.*; import com.yunhai.bschclassmanage.entity.*;
@@ -9,6 +12,7 @@ import org.springframework.web.bind.annotation.*;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Tag(name = "VClass", description = "VClass related APIs")
@RestController @RestController
@RequestMapping(Config.OAPI+"/VSchClass/") @RequestMapping(Config.OAPI+"/VSchClass/")
@CrossOrigin(originPatterns = {"*"}, allowCredentials = "true") @CrossOrigin(originPatterns = {"*"}, allowCredentials = "true")
@@ -18,44 +22,61 @@ public class VClassController {
@Autowired private SchClassTeachRepository teachingRepository; @Autowired private SchClassTeachRepository teachingRepository;
@GetMapping("GetVClassList") @GetMapping("GetVClassList")
@Operation(summary = "GetVClassList")
public ResponseEntity<List<Map<String,Object>>> GetVClassList(@RequestParam(required=false) String SchSerID) { return bySchool(SchSerID, false); } public ResponseEntity<List<Map<String,Object>>> GetVClassList(@RequestParam(required=false) String SchSerID) { return bySchool(SchSerID, false); }
@GetMapping("GetEleVClassList") @GetMapping("GetEleVClassList")
@Operation(summary = "GetEleVClassList")
public ResponseEntity<List<Map<String,Object>>> GetEleVClassList(@RequestParam(required=false) String SchSerID) { return bySchool(SchSerID, true); } public ResponseEntity<List<Map<String,Object>>> GetEleVClassList(@RequestParam(required=false) String SchSerID) { return bySchool(SchSerID, true); }
@GetMapping("GetSchArrVClassList") @GetMapping("GetSchArrVClassList")
@Operation(summary = "GetSchArrVClassList")
public ResponseEntity<List<Map<String,Object>>> GetSchArrVClassList(@RequestParam(required=false) String SchIDArr) { return bySchools(SchIDArr, false); } public ResponseEntity<List<Map<String,Object>>> GetSchArrVClassList(@RequestParam(required=false) String SchIDArr) { return bySchools(SchIDArr, false); }
@GetMapping("GetEleSchArrVClassList") @GetMapping("GetEleSchArrVClassList")
@Operation(summary = "GetEleSchArrVClassList")
public ResponseEntity<List<Map<String,Object>>> GetEleSchArrVClassList(@RequestParam(required=false) String SchIDArr) { return bySchools(SchIDArr, true); } public ResponseEntity<List<Map<String,Object>>> GetEleSchArrVClassList(@RequestParam(required=false) String SchIDArr) { return bySchools(SchIDArr, true); }
@GetMapping("GetFunTimeSchClass") @GetMapping("GetFunTimeSchClass")
@Operation(summary = "GetFunTimeSchClass")
public ResponseEntity<List<Map<String,Object>>> GetFunTimeSchClass(@RequestParam(required=false) String time, @RequestParam(required=false) String SchSerID) { return bySchool(SchSerID, false); } public ResponseEntity<List<Map<String,Object>>> GetFunTimeSchClass(@RequestParam(required=false) String time, @RequestParam(required=false) String SchSerID) { return bySchool(SchSerID, false); }
@GetMapping("GetVClassFirst") @GetMapping("GetVClassFirst")
@Operation(summary = "GetVClassFirst")
public ResponseEntity<Map<String,Object>> GetVClassFirst(@RequestParam(required=false) String ClassID) { return one(ClassID); } public ResponseEntity<Map<String,Object>> GetVClassFirst(@RequestParam(required=false) String ClassID) { return one(ClassID); }
@GetMapping("GetEleVClassFirst") @GetMapping("GetEleVClassFirst")
@Operation(summary = "GetEleVClassFirst")
public ResponseEntity<Map<String,Object>> GetEleVClassFirst(@RequestParam(required=false) String ClassID) { return one(ClassID); } public ResponseEntity<Map<String,Object>> GetEleVClassFirst(@RequestParam(required=false) String ClassID) { return one(ClassID); }
@GetMapping("GetVClassIdsList") @GetMapping("GetVClassIdsList")
@Operation(summary = "GetVClassIdsList")
public ResponseEntity<List<Map<String,Object>>> GetVClassIdsList(@RequestParam(required=false) String ClassIds) { return byClassIds(ClassIds); } public ResponseEntity<List<Map<String,Object>>> GetVClassIdsList(@RequestParam(required=false) String ClassIds) { return byClassIds(ClassIds); }
@GetMapping("GetEleVClassIdsList") @GetMapping("GetEleVClassIdsList")
@Operation(summary = "GetEleVClassIdsList")
public ResponseEntity<List<Map<String,Object>>> GetEleVClassIdsList(@RequestParam(required=false) String ClassIds) { return byClassIds(ClassIds); } public ResponseEntity<List<Map<String,Object>>> GetEleVClassIdsList(@RequestParam(required=false) String ClassIds) { return byClassIds(ClassIds); }
@GetMapping("GetGradeClassList") @GetMapping("GetGradeClassList")
@Operation(summary = "GetGradeClassList")
public ResponseEntity<List<Map<String,Object>>> GetGradeClassList(@RequestParam(required=false) String SchSerID, @RequestParam(required=false) Integer Schooling, @RequestParam(required=false) Integer GradeId) { public ResponseEntity<List<Map<String,Object>>> GetGradeClassList(@RequestParam(required=false) String SchSerID, @RequestParam(required=false) Integer Schooling, @RequestParam(required=false) Integer GradeId) {
Integer schId = schoolId(SchSerID); if (schId == null) return ResponseEntity.ok(Collections.emptyList()); Integer schId = schoolId(SchSerID); if (schId == null) return ResponseEntity.ok(Collections.emptyList());
return ResponseEntity.ok(classRepository.findAll().stream().filter(c -> Objects.equals(c.getSchId(), schId) && (GradeId == null || Objects.equals(c.getGradeId(), GradeId)) && (Schooling == null || Objects.equals(c.getGradeId(), Schooling)) && !Boolean.TRUE.equals(c.getGraduate())).map(c -> OaCompatSupport.classInfo(c, SchSerID)).collect(Collectors.toList())); return ResponseEntity.ok(classRepository.findAll().stream().filter(c -> Objects.equals(c.getSchId(), schId) && (GradeId == null || Objects.equals(c.getGradeId(), GradeId)) && (Schooling == null || Objects.equals(c.getGradeId(), Schooling)) && !Boolean.TRUE.equals(c.getGraduate())).map(c -> OaCompatSupport.classInfo(c, SchSerID)).collect(Collectors.toList()));
} }
@GetMapping("GetTeachClassArr") @GetMapping("GetTeachClassArr")
@Operation(summary = "GetTeachClassArr")
public ResponseEntity<List<String>> GetTeachClassArr(@RequestParam(required=false) Integer UserTeaSerID) { public ResponseEntity<List<String>> GetTeachClassArr(@RequestParam(required=false) Integer UserTeaSerID) {
if (UserTeaSerID == null) return ResponseEntity.ok(Collections.emptyList()); if (UserTeaSerID == null) return ResponseEntity.ok(Collections.emptyList());
return ResponseEntity.ok(teachingRepository.findAll().stream().filter(t -> Objects.equals(t.getTeaId(), UserTeaSerID)).map(SchClassTeach::getClassId).filter(Objects::nonNull).map(String::valueOf).distinct().collect(Collectors.toList())); return ResponseEntity.ok(teachingRepository.findAll().stream().filter(t -> Objects.equals(t.getTeaId(), UserTeaSerID)).map(SchClassTeach::getClassId).filter(Objects::nonNull).map(String::valueOf).distinct().collect(Collectors.toList()));
} }
@GetMapping("GetSchArrVClassListAll") @GetMapping("GetSchArrVClassListAll")
@Operation(summary = "GetSchArrVClassListAll")
public ResponseEntity<List<Map<String,Object>>> GetSchArrVClassListAll() { return ResponseEntity.ok(classRepository.findAll().stream().filter(c -> !Boolean.TRUE.equals(c.getGraduate())).map(c -> OaCompatSupport.classInfo(c, schoolSer(c.getSchId()))).collect(Collectors.toList())); } public ResponseEntity<List<Map<String,Object>>> GetSchArrVClassListAll() { return ResponseEntity.ok(classRepository.findAll().stream().filter(c -> !Boolean.TRUE.equals(c.getGraduate())).map(c -> OaCompatSupport.classInfo(c, schoolSer(c.getSchId()))).collect(Collectors.toList())); }
@GetMapping("GetEleSchArrVClassListAll") @GetMapping("GetEleSchArrVClassListAll")
@Operation(summary = "GetEleSchArrVClassListAll")
public ResponseEntity<List<Map<String,Object>>> GetEleSchArrVClassListAll() { return GetSchArrVClassListAll(); } public ResponseEntity<List<Map<String,Object>>> GetEleSchArrVClassListAll() { return GetSchArrVClassListAll(); }
@PostMapping("GetSchArrVClassListPost") @PostMapping("GetSchArrVClassListPost")
@Operation(summary = "GetSchArrVClassListPost")
public ResponseEntity<List<Map<String,Object>>> GetSchArrVClassListPost(@RequestBody(required=false) String body) { return bySchools(body, false); } public ResponseEntity<List<Map<String,Object>>> GetSchArrVClassListPost(@RequestBody(required=false) String body) { return bySchools(body, false); }
@GetMapping("GetElectiveClassById") @GetMapping("GetElectiveClassById")
@Operation(summary = "GetElectiveClassById")
public ResponseEntity<Map<String,Object>> GetElectiveClassById(@RequestParam(required=false) Integer electiveId) { return ResponseEntity.ok(null); } public ResponseEntity<Map<String,Object>> GetElectiveClassById(@RequestParam(required=false) Integer electiveId) { return ResponseEntity.ok(null); }
@GetMapping("GetElectiveClassByGrade") @GetMapping("GetElectiveClassByGrade")
@Operation(summary = "GetElectiveClassByGrade")
public ResponseEntity<List<Map<String,Object>>> GetElectiveClassByGrade(@RequestParam(required=false) Integer schoolId, @RequestParam(required=false) Integer gradeId) { return ResponseEntity.ok(Collections.emptyList()); } public ResponseEntity<List<Map<String,Object>>> GetElectiveClassByGrade(@RequestParam(required=false) Integer schoolId, @RequestParam(required=false) Integer gradeId) { return ResponseEntity.ok(Collections.emptyList()); }
@PostMapping("GetElectiveClassByTeachers") @PostMapping("GetElectiveClassByTeachers")
@Operation(summary = "GetElectiveClassByTeachers")
public ResponseEntity<List<Map<String,Object>>> GetElectiveClassByTeachers(@RequestBody(required=false) String teacherIds) { return ResponseEntity.ok(Collections.emptyList()); } public ResponseEntity<List<Map<String,Object>>> GetElectiveClassByTeachers(@RequestBody(required=false) String teacherIds) { return ResponseEntity.ok(Collections.emptyList()); }
private ResponseEntity<List<Map<String,Object>>> bySchool(String ser, boolean elective) { private ResponseEntity<List<Map<String,Object>>> bySchool(String ser, boolean elective) {
+1 -1
View File
@@ -95,4 +95,4 @@ springdoc:
path: /swagger-ui.html path: /swagger-ui.html
operations-sorter: method operations-sorter: method
tags-sorter: alpha tags-sorter: alpha
packages-to-scan: com.yunhai.bschclassmanage.controller packages-to-scan: com.yunhai.bschclassmanage.controller # 扫描 Controller 包