|
@@ -10,9 +10,11 @@ import com.qmth.distributed.print.business.entity.TSyncExamStudentScore;
|
|
|
import com.qmth.distributed.print.business.enums.ImageTrajectoryEnum;
|
|
|
import com.qmth.distributed.print.business.mapper.TSyncExamStudentScoreMapper;
|
|
|
import com.qmth.distributed.print.business.service.TSyncExamStudentScoreService;
|
|
|
+import com.qmth.distributed.print.business.service.TeachCourseService;
|
|
|
import com.qmth.teachcloud.common.bean.dto.DataPermissionRule;
|
|
|
import com.qmth.teachcloud.common.config.DictionaryConfig;
|
|
|
import com.qmth.teachcloud.common.contant.SystemConstant;
|
|
|
+import com.qmth.teachcloud.common.entity.BasicCourse;
|
|
|
import com.qmth.teachcloud.common.entity.BasicRoleDataPermission;
|
|
|
import com.qmth.teachcloud.common.entity.SysUser;
|
|
|
import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
|
|
@@ -59,6 +61,9 @@ public class TSyncExamStudentScoreServiceImpl extends ServiceImpl<TSyncExamStude
|
|
|
@Resource
|
|
|
BasicRoleDataPermissionService basicRoleDataPermissionService;
|
|
|
|
|
|
+ @Resource
|
|
|
+ TeachCourseService teachCourseService;
|
|
|
+
|
|
|
/**
|
|
|
* 同步成绩查询列表
|
|
|
*
|
|
@@ -73,15 +78,13 @@ public class TSyncExamStudentScoreServiceImpl extends ServiceImpl<TSyncExamStude
|
|
|
if (semesterId == null) {
|
|
|
throw ExceptionResultEnum.ERROR.exception("请选择学期");
|
|
|
}
|
|
|
- if (examId == null) {
|
|
|
- throw ExceptionResultEnum.ERROR.exception("请选择考试");
|
|
|
- }
|
|
|
- if (StringUtils.isBlank(courseCode)) {
|
|
|
- throw ExceptionResultEnum.ERROR.exception("请选择课程");
|
|
|
- }
|
|
|
SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
|
|
|
- DataPermissionRule dpr = basicRoleDataPermissionService.findDataPermission(sysUser.getSchoolId(), sysUser.getId(), ServletUtil.getRequest().getServletPath());
|
|
|
- IPage<TSyncExamStudentScoreResult> list = tSyncExamStudentScoreMapper.list(iPage, sysUser.getSchoolId(), semesterId, examId, clazzId, courseCode, dpr);
|
|
|
+ List<BasicCourse> basicCourses = teachCourseService.findTeachCourseByUserId(sysUser.getId());
|
|
|
+ DataPermissionRule dpr = null;
|
|
|
+ if (basicCourses.isEmpty()) {
|
|
|
+ dpr = basicRoleDataPermissionService.findDataPermission(sysUser.getSchoolId(), sysUser.getId(), ServletUtil.getRequest().getServletPath());
|
|
|
+ }
|
|
|
+ IPage<TSyncExamStudentScoreResult> list = tSyncExamStudentScoreMapper.list(iPage, sysUser.getSchoolId(), semesterId, examId, clazzId, courseCode, basicCourses, dpr);
|
|
|
list.getRecords().stream().map(m -> {
|
|
|
String localSheetUrls = m.getLocalSheetUrls();
|
|
|
if (StringUtils.isNotBlank(localSheetUrls)) {
|
|
@@ -101,17 +104,21 @@ public class TSyncExamStudentScoreServiceImpl extends ServiceImpl<TSyncExamStude
|
|
|
/**
|
|
|
* 成绩导出
|
|
|
*
|
|
|
- * @param schoolId
|
|
|
+ * @param sysUser
|
|
|
* @param semesterId
|
|
|
* @param clazzId
|
|
|
* @param courseCode
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
- public List<TSyncExamStudentScoreResult> export(Long schoolId, Long semesterId, Long examId, Long clazzId, String courseCode) {
|
|
|
- SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
|
|
|
- DataPermissionRule dpr = basicRoleDataPermissionService.findDataPermission(schoolId, sysUser.getId(), ServletUtil.getRequest().getServletPath());
|
|
|
- return tSyncExamStudentScoreMapper.export(schoolId, semesterId, examId, clazzId, courseCode, dpr);
|
|
|
+ public List<TSyncExamStudentScoreResult> export(SysUser sysUser, Long semesterId, Long examId, Long clazzId, String courseCode, String servletPath) {
|
|
|
+ Long schoolId = sysUser.getSchoolId();
|
|
|
+ List<BasicCourse> basicCourses = teachCourseService.findTeachCourseByUserId(sysUser.getId());
|
|
|
+ DataPermissionRule dpr = null;
|
|
|
+ if (basicCourses.isEmpty()) {
|
|
|
+ dpr = basicRoleDataPermissionService.findDataPermission(schoolId, sysUser.getId(), servletPath);
|
|
|
+ }
|
|
|
+ return tSyncExamStudentScoreMapper.export(schoolId, semesterId, examId, clazzId, courseCode, basicCourses, dpr);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -126,8 +133,12 @@ public class TSyncExamStudentScoreServiceImpl extends ServiceImpl<TSyncExamStude
|
|
|
@Override
|
|
|
public int exportCount(Long schoolId, Long semesterId, Long examId, Long clazzId, String courseCode) {
|
|
|
SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
|
|
|
- DataPermissionRule dpr = basicRoleDataPermissionService.findDataPermission(schoolId, sysUser.getId(), ServletUtil.getRequest().getServletPath());
|
|
|
- return tSyncExamStudentScoreMapper.exportCount(schoolId, semesterId, examId, clazzId, courseCode, dpr);
|
|
|
+ List<BasicCourse> basicCourses = teachCourseService.findTeachCourseByUserId(sysUser.getId());
|
|
|
+ DataPermissionRule dpr = null;
|
|
|
+ if (basicCourses.isEmpty()) {
|
|
|
+ dpr = basicRoleDataPermissionService.findDataPermission(schoolId, sysUser.getId(), ServletUtil.getRequest().getServletPath());
|
|
|
+ }
|
|
|
+ return tSyncExamStudentScoreMapper.exportCount(schoolId, semesterId, examId, clazzId, courseCode, basicCourses, dpr);
|
|
|
}
|
|
|
|
|
|
/**
|