|
@@ -8,8 +8,10 @@ import com.qmth.boot.api.exception.ApiException;
|
|
|
import com.qmth.distributed.print.business.bean.params.LoginParam;
|
|
|
import com.qmth.distributed.print.business.bean.result.DictionaryResult;
|
|
|
import com.qmth.distributed.print.business.bean.result.EditResult;
|
|
|
+import com.qmth.distributed.print.business.entity.ExamPrintPlan;
|
|
|
import com.qmth.distributed.print.business.enums.DictionaryEnum;
|
|
|
import com.qmth.distributed.print.business.service.BasicVerifyCodeService;
|
|
|
+import com.qmth.distributed.print.business.service.ExamPrintPlanService;
|
|
|
import com.qmth.distributed.print.business.service.PrintCommonService;
|
|
|
import com.qmth.teachcloud.common.bean.auth.AuthBean;
|
|
|
import com.qmth.teachcloud.common.bean.result.LoginResult;
|
|
@@ -75,12 +77,6 @@ public class SysController {
|
|
|
@Resource
|
|
|
TeachcloudCommonService teachcloudCommonService;
|
|
|
|
|
|
- @Resource
|
|
|
- BasicCampusService basicCampusService;
|
|
|
-
|
|
|
- @Resource
|
|
|
- BasicCourseService basicCourseService;
|
|
|
-
|
|
|
@Resource
|
|
|
SysOrgService sysOrgService;
|
|
|
|
|
@@ -93,6 +89,12 @@ public class SysController {
|
|
|
@Resource
|
|
|
BasicStudentService basicStudentService;
|
|
|
|
|
|
+ @Resource
|
|
|
+ BasicSemesterService basicSemesterService;
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ ExamPrintPlanService examPrintPlanService;
|
|
|
+
|
|
|
/**
|
|
|
* 登录
|
|
|
*
|
|
@@ -320,14 +322,15 @@ public class SysController {
|
|
|
// @Aac(auth = BOOL.FALSE)
|
|
|
public Result getCode(@ApiParam(value = "编码类型", required = true) @RequestParam SystemCodeEnum type) {
|
|
|
SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
|
|
|
- String number = teachcloudCommonService.getSysIncrCode(type,sysUser);
|
|
|
+ String number = teachcloudCommonService.getSysIncrCode(type, sysUser);
|
|
|
return ResultUtil.ok((Object) number);
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "共用接口-查询字典")
|
|
|
@RequestMapping(value = "/get_dictionary", method = RequestMethod.POST)
|
|
|
@ApiResponses({@ApiResponse(code = 200, message = "查询成功", response = Result.class)})
|
|
|
- public Result findDictionaryList(@ApiParam(value = "学院id") @RequestParam(required = false) String collegeId,
|
|
|
+ public Result findDictionaryList(@ApiParam(value = "学期id") @RequestParam(required = false) String semesterId,
|
|
|
+ @ApiParam(value = "学院id") @RequestParam(required = false) String collegeId,
|
|
|
@ApiParam(value = "专业id") @RequestParam(required = false) String majorId,
|
|
|
@ApiParam(value = "班级id") @RequestParam(required = false) String clazzId,
|
|
|
@ApiParam(value = "学生id") @RequestParam(required = false) String studentId,
|
|
@@ -335,9 +338,9 @@ public class SysController {
|
|
|
Long schoolId = SystemConstant.convertIdToLong(ServletUtil.getRequestHeaderSchoolId().toString());
|
|
|
List<DictionaryResult> dictionaryResultList = new ArrayList<>();
|
|
|
switch (dictionaryEnum) {
|
|
|
- case COLLEGE:
|
|
|
- List<SysOrg> sysOrgList = sysOrgService.list(new QueryWrapper<SysOrg>().lambda().eq(SysOrg::getSchoolId, schoolId).eq(SysOrg::getEnable, true));
|
|
|
- dictionaryResultList = sysOrgList.stream().map(e -> {
|
|
|
+ case SEMESTER:
|
|
|
+ List<BasicSemester> basicSemesterList = basicSemesterService.list(new QueryWrapper<BasicSemester>().lambda().eq(BasicSemester::getSchoolId, schoolId).eq(BasicSemester::getEnable, true));
|
|
|
+ dictionaryResultList = basicSemesterList.stream().map(e -> {
|
|
|
DictionaryResult dictionaryResult = new DictionaryResult();
|
|
|
dictionaryResult.setId(e.getId());
|
|
|
dictionaryResult.setCode(e.getCode());
|
|
@@ -345,6 +348,35 @@ public class SysController {
|
|
|
return dictionaryResult;
|
|
|
}).collect(Collectors.toList());
|
|
|
break;
|
|
|
+ case COLLEGE:
|
|
|
+ if (Objects.nonNull(semesterId)) {
|
|
|
+ QueryWrapper<ExamPrintPlan> examPrintPlanQueryWrapper = new QueryWrapper<>();
|
|
|
+ examPrintPlanQueryWrapper.select(" DISTINCT org_id as orgId ")
|
|
|
+ .eq("semester_id", SystemConstant.convertIdToLong(semesterId));
|
|
|
+ List<ExamPrintPlan> examPrintPlanList = examPrintPlanService.list(examPrintPlanQueryWrapper);
|
|
|
+ Set<Long> orgIdSet = examPrintPlanList.stream().map(s -> s.getOrgId()).collect(Collectors.toSet());
|
|
|
+
|
|
|
+ QueryWrapper<SysOrg> sysOrgQueryWrapper = new QueryWrapper<>();
|
|
|
+ sysOrgQueryWrapper.lambda().in(SysOrg::getId, orgIdSet);
|
|
|
+ List<SysOrg> sysOrgList = sysOrgService.list(sysOrgQueryWrapper);
|
|
|
+ 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());
|
|
|
+ } 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()
|
|
@@ -408,6 +440,7 @@ public class SysController {
|
|
|
|
|
|
/**
|
|
|
* 获取用户阅卷角色
|
|
|
+ *
|
|
|
* @return
|
|
|
*/
|
|
|
@ApiOperation(value = "获取用户阅卷角色")
|