|
@@ -83,18 +83,16 @@ public class SysController {
|
|
|
BasicAttachmentService basicAttachmentService;
|
|
|
@Resource
|
|
|
SysUserRoleService sysUserRoleService;
|
|
|
-
|
|
|
@Resource
|
|
|
TeachcloudCommonService teachcloudCommonService;
|
|
|
-
|
|
|
@Resource
|
|
|
BasicMajorService basicMajorService;
|
|
|
@Resource
|
|
|
BasicCourseService basicCourseService;
|
|
|
-
|
|
|
@Resource
|
|
|
BasicSemesterService basicSemesterService;
|
|
|
-
|
|
|
+ @Resource
|
|
|
+ private FileUploadService fileUploadService;
|
|
|
@Resource
|
|
|
TBSyncTaskService tbSyncTaskService;
|
|
|
|
|
@@ -446,6 +444,15 @@ public class SysController {
|
|
|
authInfoService.appHasExpired(code);
|
|
|
SysConfig sysConfig = commonCacheService.addSysConfigCache(basicSchool.getId(), SystemConstant.ACCOUNT_SMS_VERIFY);
|
|
|
map.put(SystemConstant.LOGO, basicSchool.getLogo());
|
|
|
+ String backgroundImageUrl = null;
|
|
|
+ if (StringUtils.isNotBlank(basicSchool.getBackgroundImage())) {
|
|
|
+ try {
|
|
|
+ backgroundImageUrl = fileUploadService.filePreview(basicSchool.getBackgroundImage());
|
|
|
+ } catch (Exception e) {
|
|
|
+ // 不处理,返回null
|
|
|
+ }
|
|
|
+ }
|
|
|
+ map.put("backgroundImageUrl", backgroundImageUrl);
|
|
|
map.put("name", basicSchool.getName());
|
|
|
map.put("accountSmsVerify", Objects.nonNull(sysConfig) ? Boolean.valueOf(sysConfig.getConfigValue()) : false);
|
|
|
// 若为在线激活,则允许手机号登录
|
|
@@ -454,6 +461,7 @@ public class SysController {
|
|
|
} else {
|
|
|
SysConfig sysConfig = commonCacheService.addSysConfigCache(SystemConstant.ADMIN_LOGO_URL);
|
|
|
map.put(SystemConstant.LOGO, Objects.nonNull(sysConfig) ? sysConfig.getConfigValue() : null);
|
|
|
+ map.put("backgroundImageUrl", null);
|
|
|
map.put("name", null);
|
|
|
map.put("accountSmsVerify", false);
|
|
|
// 若为在线激活,则允许手机号登录,超管默认false
|
|
@@ -659,136 +667,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 COLLEGE:
|
|
|
- // if (Objects.nonNull(semesterId)) {
|
|
|
- // QueryWrapper<BasicExam> basicExamQueryWrapper = new QueryWrapper<>();
|
|
|
- // basicExamQueryWrapper.lambda().eq(BasicExam::getSemesterId, SystemConstant.convertIdToLong(semesterId));
|
|
|
- // List<BasicExam> basicExamList = basicExamService.list(basicExamQueryWrapper);
|
|
|
- // if (Objects.nonNull(basicExamList) && basicExamList.size() > 0) {
|
|
|
- // List<Long> examIdList = basicExamList.stream().map(BaseEntity::getId).collect(Collectors.toList());
|
|
|
- // QueryWrapper<ExamPrintPlan> examPrintPlanQueryWrapper = new QueryWrapper<>();
|
|
|
- // examPrintPlanQueryWrapper.lambda().in(ExamPrintPlan::getExamId, examIdList);
|
|
|
- // List<ExamPrintPlan> examPrintPlanList = examPrintPlanService.list(examPrintPlanQueryWrapper);
|
|
|
- // if (Objects.nonNull(examPrintPlanList) && examPrintPlanList.size() > 0) {
|
|
|
- // Set<Long> orgIdSet = examPrintPlanList.stream().map(ExamPrintPlan::getOrgId).collect(Collectors.toSet());
|
|
|
- // QueryWrapper<SysOrg> sysOrgQueryWrapper = new QueryWrapper<>();
|
|
|
- // sysOrgQueryWrapper.lambda().in(SysOrg::getId, orgIdSet);
|
|
|
- // List<SysOrg> sysOrgList = sysOrgService.list(sysOrgQueryWrapper);
|
|
|
- // List<SysOrg> newSysOrgList = new ArrayList<>(sysOrgList);
|
|
|
- // for (SysOrg s : sysOrgList) {
|
|
|
- // if (s.getType() == OrgTypeEnum.SCHOOL) {
|
|
|
- // newSysOrgList.addAll(sysOrgService.findByConnectByRootOrgId(s.getId()));
|
|
|
- // } else if (s.getType() == OrgTypeEnum.TEACHING_ROOM || s.getType() == OrgTypeEnum.FACULTY || s.getType() == OrgTypeEnum.PRINTING_HOUSE) {
|
|
|
- // newSysOrgList.addAll(sysOrgService.findByConnectByParentId(s.getId(), true, false));
|
|
|
- // }
|
|
|
- // }
|
|
|
- // Map<Long, SysOrg> sysOrgMap = new LinkedHashMap<>();
|
|
|
- // for (SysOrg s : newSysOrgList) {
|
|
|
- // if (s.getType() == OrgTypeEnum.COLLEGE) {
|
|
|
- // sysOrgMap.put(s.getId(), s);
|
|
|
- // }
|
|
|
- // }
|
|
|
- // List<DictionaryResult> finalDictionaryResultList = dictionaryResultList;
|
|
|
- // sysOrgMap.forEach((k, v) -> {
|
|
|
- // DictionaryResult dictionaryResult = new DictionaryResult();
|
|
|
- // dictionaryResult.setId(v.getId());
|
|
|
- // dictionaryResult.setCode(v.getCode());
|
|
|
- // dictionaryResult.setName(v.getName());
|
|
|
- // finalDictionaryResultList.add(dictionaryResult);
|
|
|
- // });
|
|
|
- // }
|
|
|
- // }
|
|
|
- // } else {
|
|
|
- // List<SysOrg> sysOrgList = sysOrgService.list(new QueryWrapper<SysOrg>().lambda().eq(SysOrg::getSchoolId, schoolId).eq(SysOrg::getEnable, true));
|
|
|
- // dictionaryResultList = sysOrgList.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 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;
|
|
|
+ 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 COLLEGE:
|
|
|
+ // if (Objects.nonNull(semesterId)) {
|
|
|
+ // QueryWrapper<BasicExam> basicExamQueryWrapper = new QueryWrapper<>();
|
|
|
+ // basicExamQueryWrapper.lambda().eq(BasicExam::getSemesterId, SystemConstant.convertIdToLong(semesterId));
|
|
|
+ // List<BasicExam> basicExamList = basicExamService.list(basicExamQueryWrapper);
|
|
|
+ // if (Objects.nonNull(basicExamList) && basicExamList.size() > 0) {
|
|
|
+ // List<Long> examIdList = basicExamList.stream().map(BaseEntity::getId).collect(Collectors.toList());
|
|
|
+ // QueryWrapper<ExamPrintPlan> examPrintPlanQueryWrapper = new QueryWrapper<>();
|
|
|
+ // examPrintPlanQueryWrapper.lambda().in(ExamPrintPlan::getExamId, examIdList);
|
|
|
+ // List<ExamPrintPlan> examPrintPlanList = examPrintPlanService.list(examPrintPlanQueryWrapper);
|
|
|
+ // if (Objects.nonNull(examPrintPlanList) && examPrintPlanList.size() > 0) {
|
|
|
+ // Set<Long> orgIdSet = examPrintPlanList.stream().map(ExamPrintPlan::getOrgId).collect(Collectors.toSet());
|
|
|
+ // QueryWrapper<SysOrg> sysOrgQueryWrapper = new QueryWrapper<>();
|
|
|
+ // sysOrgQueryWrapper.lambda().in(SysOrg::getId, orgIdSet);
|
|
|
+ // List<SysOrg> sysOrgList = sysOrgService.list(sysOrgQueryWrapper);
|
|
|
+ // List<SysOrg> newSysOrgList = new ArrayList<>(sysOrgList);
|
|
|
+ // for (SysOrg s : sysOrgList) {
|
|
|
+ // if (s.getType() == OrgTypeEnum.SCHOOL) {
|
|
|
+ // newSysOrgList.addAll(sysOrgService.findByConnectByRootOrgId(s.getId()));
|
|
|
+ // } else if (s.getType() == OrgTypeEnum.TEACHING_ROOM || s.getType() == OrgTypeEnum.FACULTY || s.getType() == OrgTypeEnum.PRINTING_HOUSE) {
|
|
|
+ // newSysOrgList.addAll(sysOrgService.findByConnectByParentId(s.getId(), true, false));
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // Map<Long, SysOrg> sysOrgMap = new LinkedHashMap<>();
|
|
|
+ // for (SysOrg s : newSysOrgList) {
|
|
|
+ // if (s.getType() == OrgTypeEnum.COLLEGE) {
|
|
|
+ // sysOrgMap.put(s.getId(), s);
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // List<DictionaryResult> finalDictionaryResultList = dictionaryResultList;
|
|
|
+ // sysOrgMap.forEach((k, v) -> {
|
|
|
+ // DictionaryResult dictionaryResult = new DictionaryResult();
|
|
|
+ // dictionaryResult.setId(v.getId());
|
|
|
+ // dictionaryResult.setCode(v.getCode());
|
|
|
+ // dictionaryResult.setName(v.getName());
|
|
|
+ // finalDictionaryResultList.add(dictionaryResult);
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // } else {
|
|
|
+ // List<SysOrg> sysOrgList = sysOrgService.list(new QueryWrapper<SysOrg>().lambda().eq(SysOrg::getSchoolId, schoolId).eq(SysOrg::getEnable, true));
|
|
|
+ // dictionaryResultList = sysOrgList.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 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);
|
|
|
}
|