|
@@ -99,6 +99,9 @@ public class SysController {
|
|
|
@Resource
|
|
|
BasicStudentService basicStudentService;
|
|
|
|
|
|
+ @Resource
|
|
|
+ BasicCourseService basicCourseService;
|
|
|
+
|
|
|
@Resource
|
|
|
BasicSemesterService basicSemesterService;
|
|
|
|
|
@@ -666,131 +669,136 @@ public class SysController {
|
|
|
Long schoolId = SystemConstant.convertIdToLong(ServletUtil.getRequestHeaderSchoolId().toString());
|
|
|
List<DictionaryResult> dictionaryResultList = new ArrayList<>();
|
|
|
switch (dictionaryEnum) {
|
|
|
- case SEMESTER:
|
|
|
- List<BasicSemester> basicSemesterList = basicSemesterService.list(new QueryWrapper<BasicSemester>()
|
|
|
- .lambda()
|
|
|
- .eq(BasicSemester::getSchoolId, schoolId)
|
|
|
- .eq(BasicSemester::getEnable, true)
|
|
|
- .orderByDesc(BasicSemester::getCreateTime));
|
|
|
- dictionaryResultList = basicSemesterList.stream().map(e -> {
|
|
|
- DictionaryResult dictionaryResult = new DictionaryResult();
|
|
|
- dictionaryResult.setId(e.getId());
|
|
|
- dictionaryResult.setCode(e.getCode());
|
|
|
- dictionaryResult.setName(e.getName());
|
|
|
- return dictionaryResult;
|
|
|
- }).collect(Collectors.toList());
|
|
|
- break;
|
|
|
- case COLLEGE:
|
|
|
- List<SysOrg> sysOrgs = conditionService.listCollege();
|
|
|
- dictionaryResultList = sysOrgs.stream().map(e -> {
|
|
|
- DictionaryResult dictionaryResult = new DictionaryResult();
|
|
|
- dictionaryResult.setId(e.getId());
|
|
|
- dictionaryResult.setName(e.getName());
|
|
|
- return dictionaryResult;
|
|
|
- }).collect(Collectors.toList());
|
|
|
- break;
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- case MAJOR:
|
|
|
- QueryWrapper<BasicMajor> majorQueryWrapper = new QueryWrapper<>();
|
|
|
- majorQueryWrapper.lambda()
|
|
|
- .eq(BasicMajor::getSchoolId, schoolId)
|
|
|
- .eq(BasicMajor::getEnable, true);
|
|
|
-
|
|
|
- if (SystemConstant.longNotNull(SystemConstant.convertIdToLong(collegeId))) {
|
|
|
- majorQueryWrapper.lambda().eq(BasicMajor::getBelongOrgId, collegeId);
|
|
|
- }
|
|
|
- List<BasicMajor> basicMajorList = basicMajorService.list(majorQueryWrapper);
|
|
|
- dictionaryResultList = basicMajorList.stream().map(e -> {
|
|
|
- DictionaryResult dictionaryResult = new DictionaryResult();
|
|
|
- dictionaryResult.setId(e.getId());
|
|
|
- dictionaryResult.setCode(e.getCode());
|
|
|
- dictionaryResult.setName(e.getName());
|
|
|
- return dictionaryResult;
|
|
|
- }).collect(Collectors.toList());
|
|
|
- break;
|
|
|
- case CLAZZ:
|
|
|
- QueryWrapper<BasicTeachClazz> clazzQueryWrapper = new QueryWrapper<>();
|
|
|
- clazzQueryWrapper.lambda().eq(BasicTeachClazz::getSchoolId, schoolId).eq(BasicTeachClazz::getExamId, examId);
|
|
|
- List<BasicTeachClazz> basicTeachClazzList = basicTeachClazzService.list(clazzQueryWrapper);
|
|
|
- List<DictionaryResult> resultBasicClazzList = basicTeachClazzList.stream().map(e -> {
|
|
|
- DictionaryResult dictionaryResult = new DictionaryResult();
|
|
|
- dictionaryResult.setId(e.getId());
|
|
|
- dictionaryResult.setName(e.getClazzName());
|
|
|
- return dictionaryResult;
|
|
|
- }).collect(Collectors.toList());
|
|
|
- dictionaryResultList.addAll(resultBasicClazzList);
|
|
|
- break;
|
|
|
- case ALL_CLAZZ:
|
|
|
- throw ExceptionResultEnum.ERROR.exception("使用枚举[CLAZZ]");
|
|
|
- case STUDENT:
|
|
|
- QueryWrapper<BasicExamStudent> studentQueryWrapper = new QueryWrapper<>();
|
|
|
- studentQueryWrapper.lambda().eq(BasicExamStudent::getSchoolId, schoolId);
|
|
|
- if (SystemConstant.longNotNull(SystemConstant.convertIdToLong(clazzId))) {
|
|
|
- studentQueryWrapper.lambda().eq(BasicExamStudent::getClazzId, clazzId);
|
|
|
- }
|
|
|
- if (SystemConstant.longNotNull(SystemConstant.convertIdToLong(studentId))) {
|
|
|
- studentQueryWrapper.lambda().eq(BasicExamStudent::getId, studentId);
|
|
|
- }
|
|
|
- List<BasicExamStudent> basicExamStudentList = basicExamStudentService.list(studentQueryWrapper);
|
|
|
- dictionaryResultList = basicExamStudentList.stream().map(e -> {
|
|
|
- DictionaryResult dictionaryResult = new DictionaryResult();
|
|
|
- dictionaryResult.setId(e.getId());
|
|
|
- dictionaryResult.setCode(e.getStudentCode());
|
|
|
- dictionaryResult.setName(e.getStudentName());
|
|
|
- return dictionaryResult;
|
|
|
- }).collect(Collectors.toList());
|
|
|
- break;
|
|
|
- default:
|
|
|
- break;
|
|
|
+ case SEMESTER:
|
|
|
+ List<BasicSemester> basicSemesterList = basicSemesterService.list(
|
|
|
+ new QueryWrapper<BasicSemester>().lambda().eq(BasicSemester::getSchoolId, schoolId).eq(BasicSemester::getEnable, true).orderByDesc(BasicSemester::getCreateTime));
|
|
|
+ dictionaryResultList = basicSemesterList.stream().map(e -> {
|
|
|
+ DictionaryResult dictionaryResult = new DictionaryResult();
|
|
|
+ dictionaryResult.setId(e.getId());
|
|
|
+ dictionaryResult.setCode(e.getCode());
|
|
|
+ dictionaryResult.setName(e.getName());
|
|
|
+ return dictionaryResult;
|
|
|
+ }).collect(Collectors.toList());
|
|
|
+ break;
|
|
|
+ case COLLEGE:
|
|
|
+ List<SysOrg> sysOrgs = conditionService.listCollege();
|
|
|
+ dictionaryResultList = sysOrgs.stream().map(e -> {
|
|
|
+ DictionaryResult dictionaryResult = new DictionaryResult();
|
|
|
+ dictionaryResult.setId(e.getId());
|
|
|
+ dictionaryResult.setName(e.getName());
|
|
|
+ return dictionaryResult;
|
|
|
+ }).collect(Collectors.toList());
|
|
|
+ break;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ case MAJOR:
|
|
|
+ QueryWrapper<BasicMajor> majorQueryWrapper = new QueryWrapper<>();
|
|
|
+ majorQueryWrapper.lambda().eq(BasicMajor::getSchoolId, schoolId).eq(BasicMajor::getEnable, true);
|
|
|
+
|
|
|
+ if (SystemConstant.longNotNull(SystemConstant.convertIdToLong(collegeId))) {
|
|
|
+ majorQueryWrapper.lambda().eq(BasicMajor::getBelongOrgId, collegeId);
|
|
|
+ }
|
|
|
+ List<BasicMajor> basicMajorList = basicMajorService.list(majorQueryWrapper);
|
|
|
+ dictionaryResultList = basicMajorList.stream().map(e -> {
|
|
|
+ DictionaryResult dictionaryResult = new DictionaryResult();
|
|
|
+ dictionaryResult.setId(e.getId());
|
|
|
+ dictionaryResult.setCode(e.getCode());
|
|
|
+ dictionaryResult.setName(e.getName());
|
|
|
+ return dictionaryResult;
|
|
|
+ }).collect(Collectors.toList());
|
|
|
+ break;
|
|
|
+ case CLAZZ:
|
|
|
+ QueryWrapper<BasicTeachClazz> clazzQueryWrapper = new QueryWrapper<>();
|
|
|
+ clazzQueryWrapper.lambda().eq(BasicTeachClazz::getSchoolId, schoolId).eq(BasicTeachClazz::getExamId, examId);
|
|
|
+ List<BasicTeachClazz> basicTeachClazzList = basicTeachClazzService.list(clazzQueryWrapper);
|
|
|
+ List<DictionaryResult> resultBasicClazzList = basicTeachClazzList.stream().map(e -> {
|
|
|
+ DictionaryResult dictionaryResult = new DictionaryResult();
|
|
|
+ dictionaryResult.setId(e.getId());
|
|
|
+ dictionaryResult.setName(e.getClazzName());
|
|
|
+ return dictionaryResult;
|
|
|
+ }).collect(Collectors.toList());
|
|
|
+ dictionaryResultList.addAll(resultBasicClazzList);
|
|
|
+ break;
|
|
|
+ case ALL_CLAZZ:
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("使用枚举[CLAZZ]");
|
|
|
+ case COURSE:
|
|
|
+ dictionaryResultList = basicCourseService.list(
|
|
|
+ new QueryWrapper<BasicCourse>().lambda().eq(BasicCourse::getSchoolId, schoolId)).stream().flatMap(e -> {
|
|
|
+ DictionaryResult dictionaryResult = new DictionaryResult();
|
|
|
+ dictionaryResult.setId(e.getId());
|
|
|
+ dictionaryResult.setCode(e.getCode());
|
|
|
+ dictionaryResult.setName(e.getName());
|
|
|
+ return Stream.of(dictionaryResult);
|
|
|
+ }).collect(Collectors.toList());
|
|
|
+ break;
|
|
|
+ case STUDENT:
|
|
|
+ QueryWrapper<BasicExamStudent> studentQueryWrapper = new QueryWrapper<>();
|
|
|
+ studentQueryWrapper.lambda().eq(BasicExamStudent::getSchoolId, schoolId);
|
|
|
+ if (SystemConstant.longNotNull(SystemConstant.convertIdToLong(clazzId))) {
|
|
|
+ studentQueryWrapper.lambda().eq(BasicExamStudent::getClazzId, clazzId);
|
|
|
+ }
|
|
|
+ if (SystemConstant.longNotNull(SystemConstant.convertIdToLong(studentId))) {
|
|
|
+ studentQueryWrapper.lambda().eq(BasicExamStudent::getId, studentId);
|
|
|
+ }
|
|
|
+ List<BasicExamStudent> basicExamStudentList = basicExamStudentService.list(studentQueryWrapper);
|
|
|
+ dictionaryResultList = basicExamStudentList.stream().map(e -> {
|
|
|
+ DictionaryResult dictionaryResult = new DictionaryResult();
|
|
|
+ dictionaryResult.setId(e.getId());
|
|
|
+ dictionaryResult.setCode(e.getStudentCode());
|
|
|
+ dictionaryResult.setName(e.getStudentName());
|
|
|
+ return dictionaryResult;
|
|
|
+ }).collect(Collectors.toList());
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
}
|
|
|
return ResultUtil.ok(dictionaryResultList);
|
|
|
}
|