|
@@ -1,6 +1,7 @@
|
|
|
package com.xjrsoft.module.xycxedu.controller;
|
|
|
|
|
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
|
+import cn.dev33.satoken.stp.StpUtil;
|
|
|
import com.alibaba.excel.support.ExcelTypeEnum;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.xjrsoft.common.annotation.XjrLog;
|
|
@@ -98,9 +99,15 @@ public class ExamSubjectScoreController {
|
|
|
@SaCheckPermission("examsubjectscore:detail")
|
|
|
@XjrLog("班级成绩查询(分页)")
|
|
|
public RT<PageOutput<ClassStudentScorePageVo>> classStudentScorePage(@Valid ClassStudentScorePageDto dto){
|
|
|
- if((dto.getTreeType() != null && dto.getTreeType() != 4) || dto.getTreeId() == null ){
|
|
|
- return RT.ok(new PageOutput<>());
|
|
|
+ List<String> roleList = StpUtil.getRoleList();
|
|
|
+ if(roleList.size() == 2 && roleList.contains("TEACHER") && roleList.contains("CLASSTE")){
|
|
|
+ dto.setTeacherId(StpUtil.getLoginIdAsLong());
|
|
|
+ }else{
|
|
|
+ if((dto.getTreeType() != null && dto.getTreeType() != 4) || dto.getTreeId() == null ){
|
|
|
+ return RT.ok(new PageOutput<>());
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
PageOutput<ClassStudentScorePageVo> pageOutput = scoreService.getClassStudentScorePage(dto);
|
|
|
return RT.ok(pageOutput);
|
|
|
}
|
|
@@ -121,8 +128,14 @@ public class ExamSubjectScoreController {
|
|
|
@XjrLog("导出考试成绩")
|
|
|
public ResponseEntity<byte[]> classStudentScoreExportQuery(@Valid @RequestBody ClassStudentScorePageDto dto) throws IOException {
|
|
|
String fileName = "class-student-export-query" + ExcelTypeEnum.XLSX.getValue();
|
|
|
- if((dto.getTreeType() != null && dto.getTreeType() != 4) || dto.getTreeId() == null ){
|
|
|
- return RT.fileStream(new byte[0], fileName);
|
|
|
+
|
|
|
+ List<String> roleList = StpUtil.getRoleList();
|
|
|
+ if(roleList.size() == 2 && roleList.contains("TEACHER") && roleList.contains("CLASSTE")){
|
|
|
+ dto.setTeacherId(StpUtil.getLoginIdAsLong());
|
|
|
+ }else{
|
|
|
+ if((dto.getTreeType() != null && dto.getTreeType() != 4) || dto.getTreeId() == null ){
|
|
|
+ return RT.fileStream(new byte[0], fileName);
|
|
|
+ }
|
|
|
}
|
|
|
//查询列头
|
|
|
byte[] bytes = scoreService.getClassStudentScoreExportQuery(dto);
|