|
@@ -6,27 +6,31 @@ import com.qmth.boot.api.annotation.BOOL;
|
|
|
import com.qmth.boot.api.constant.ApiConstant;
|
|
|
import com.qmth.eds.bean.params.LoginParam;
|
|
|
import com.qmth.eds.bean.result.EditResult;
|
|
|
+import com.qmth.eds.bean.result.ExamineCollegeResult;
|
|
|
import com.qmth.eds.bean.result.LoginResult;
|
|
|
+import com.qmth.eds.common.entity.CloudMarkingScore;
|
|
|
+import com.qmth.eds.common.entity.ExamSyncStudent;
|
|
|
import com.qmth.eds.common.entity.SysUser;
|
|
|
import com.qmth.eds.common.enums.AppSourceEnum;
|
|
|
import com.qmth.eds.common.enums.ExceptionResultEnum;
|
|
|
-import com.qmth.eds.service.SysUserService;
|
|
|
-import com.qmth.eds.service.TeachcloudCommonService;
|
|
|
import com.qmth.eds.common.util.Result;
|
|
|
import com.qmth.eds.common.util.ResultUtil;
|
|
|
import com.qmth.eds.common.util.ServletUtil;
|
|
|
+import com.qmth.eds.service.CloudMarkingScoreService;
|
|
|
+import com.qmth.eds.service.ExamSyncStudentService;
|
|
|
+import com.qmth.eds.service.SysUserService;
|
|
|
+import com.qmth.eds.service.TeachcloudCommonService;
|
|
|
import io.swagger.annotations.*;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
+import org.springframework.util.CollectionUtils;
|
|
|
import org.springframework.validation.BindingResult;
|
|
|
-import org.springframework.web.bind.annotation.PostMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestBody;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import javax.validation.Valid;
|
|
|
import java.security.NoSuchAlgorithmException;
|
|
|
-import java.util.List;
|
|
|
+import java.util.*;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* 系统公共Controller
|
|
@@ -35,12 +39,19 @@ import java.util.List;
|
|
|
@RestController
|
|
|
@RequestMapping(ApiConstant.DEFAULT_URI_PREFIX + "/common")
|
|
|
public class SysController {
|
|
|
+
|
|
|
@Resource
|
|
|
SysUserService sysUserService;
|
|
|
|
|
|
@Resource
|
|
|
TeachcloudCommonService teachcloudCommonService;
|
|
|
|
|
|
+ @Resource
|
|
|
+ CloudMarkingScoreService cloudMarkingScoreService;
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ ExamSyncStudentService examSyncStudentService;
|
|
|
+
|
|
|
/**
|
|
|
* 登录
|
|
|
*
|
|
@@ -99,4 +110,43 @@ public class SysController {
|
|
|
return ResultUtil.ok();
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 登出
|
|
|
+ */
|
|
|
+ @ApiOperation(value = "查询考查学院列表")
|
|
|
+ @PostMapping("/examine/college/list")
|
|
|
+ @ApiResponses({@ApiResponse(code = 200, message = "返回信息", response = ExamineCollegeResult.class)})
|
|
|
+ public Result examineCollegeList(@ApiParam(value = "学期id") @RequestParam(required = false) Long semesterId,
|
|
|
+ @ApiParam(value = "考试id") @RequestParam(required = false) Long examId,
|
|
|
+ @ApiParam(value = "科目代码") @RequestParam(required = false) String subjectCode) {
|
|
|
+ SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
|
|
|
+ Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
|
|
|
+ QueryWrapper<CloudMarkingScore> cloudMarkingScoreQueryWrapper = new QueryWrapper<>();
|
|
|
+ cloudMarkingScoreQueryWrapper.lambda().eq(CloudMarkingScore::getSchoolId, sysUser.getOrgId());
|
|
|
+ if (Objects.nonNull(semesterId) && !Objects.equals(semesterId, "")) {
|
|
|
+ cloudMarkingScoreQueryWrapper.lambda().eq(CloudMarkingScore::getSemesterId, semesterId);
|
|
|
+ }
|
|
|
+ if (Objects.nonNull(examId) && !Objects.equals(examId, "")) {
|
|
|
+ cloudMarkingScoreQueryWrapper.lambda().eq(CloudMarkingScore::getExamId, examId);
|
|
|
+ }
|
|
|
+ if (Objects.nonNull(subjectCode) && !Objects.equals(subjectCode.trim(), "")) {
|
|
|
+ cloudMarkingScoreQueryWrapper.lambda().eq(CloudMarkingScore::getSubjectCode, subjectCode);
|
|
|
+ }
|
|
|
+ //先查询云阅卷科目代码
|
|
|
+ List<CloudMarkingScore> cloudMarkingScoreList = cloudMarkingScoreService.queryBySyncCourseCode(schoolId, sysUser.getOrgId(), subjectCode);
|
|
|
+ Set<String> subjectCodeSet = null;
|
|
|
+ if (!CollectionUtils.isEmpty(cloudMarkingScoreList)) {
|
|
|
+ subjectCodeSet = new HashSet<>(cloudMarkingScoreList.size());
|
|
|
+ subjectCodeSet = cloudMarkingScoreList.stream().map(s -> s.getSubjectCode()).collect(Collectors.toSet());
|
|
|
+ }
|
|
|
+ List<ExamSyncStudent> examSyncStudentList = examSyncStudentService.queryByExamineCollegeList(schoolId, sysUser.getOrgId(), examId, subjectCode, subjectCodeSet);
|
|
|
+ List<ExamineCollegeResult> examineCollegeResultList = null;
|
|
|
+ if (!CollectionUtils.isEmpty(examSyncStudentList)) {
|
|
|
+ examineCollegeResultList = new ArrayList<>(examSyncStudentList.size());
|
|
|
+ for (ExamSyncStudent e : examSyncStudentList) {
|
|
|
+ examineCollegeResultList.add(new ExamineCollegeResult(e.getJgmc(), e.getJgmc()));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return ResultUtil.ok(examineCollegeResultList);
|
|
|
+ }
|
|
|
}
|