|
@@ -18,6 +18,7 @@ import com.qmth.distributed.print.business.entity.*;
|
|
import com.qmth.distributed.print.business.enums.*;
|
|
import com.qmth.distributed.print.business.enums.*;
|
|
import com.qmth.distributed.print.business.mapper.ExamDetailMapper;
|
|
import com.qmth.distributed.print.business.mapper.ExamDetailMapper;
|
|
import com.qmth.distributed.print.business.service.*;
|
|
import com.qmth.distributed.print.business.service.*;
|
|
|
|
+import com.qmth.teachcloud.common.bean.dto.DataPermissionRule;
|
|
import com.qmth.teachcloud.common.bean.dto.MqDto;
|
|
import com.qmth.teachcloud.common.bean.dto.MqDto;
|
|
import com.qmth.teachcloud.common.bean.params.BasicStudentExtrasParam;
|
|
import com.qmth.teachcloud.common.bean.params.BasicStudentExtrasParam;
|
|
import com.qmth.teachcloud.common.contant.SystemConstant;
|
|
import com.qmth.teachcloud.common.contant.SystemConstant;
|
|
@@ -39,7 +40,6 @@ import org.apache.poi.xssf.usermodel.*;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.BeanUtils;
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
@@ -94,19 +94,19 @@ public class ExamDetailServiceImpl extends ServiceImpl<ExamDetailMapper, ExamDet
|
|
@Resource
|
|
@Resource
|
|
ConvertUtil convertUtil;
|
|
ConvertUtil convertUtil;
|
|
|
|
|
|
- @Autowired
|
|
|
|
|
|
+ @Resource
|
|
private ClientPrintDataService clientPrintDataService;
|
|
private ClientPrintDataService clientPrintDataService;
|
|
|
|
|
|
- @Autowired
|
|
|
|
|
|
+ @Resource
|
|
ClientStatusService clientStatusService;
|
|
ClientStatusService clientStatusService;
|
|
|
|
|
|
@Resource
|
|
@Resource
|
|
TeachcloudCommonService teachcloudCommonService;
|
|
TeachcloudCommonService teachcloudCommonService;
|
|
|
|
|
|
- @Autowired
|
|
|
|
|
|
+ @Resource
|
|
BasicCampusService basicCampusService;
|
|
BasicCampusService basicCampusService;
|
|
|
|
|
|
- @Autowired
|
|
|
|
|
|
+ @Resource
|
|
ExamTaskService examTaskService;
|
|
ExamTaskService examTaskService;
|
|
|
|
|
|
@Resource
|
|
@Resource
|
|
@@ -118,6 +118,9 @@ public class ExamDetailServiceImpl extends ServiceImpl<ExamDetailMapper, ExamDet
|
|
@Resource
|
|
@Resource
|
|
TeachClazzService teachClazzService;
|
|
TeachClazzService teachClazzService;
|
|
|
|
|
|
|
|
+ @Resource
|
|
|
|
+ BasicRoleDataPermissionService basicRoleDataPermissionService;
|
|
|
|
+
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Override
|
|
@Override
|
|
public double calculateTotalSubjects(Long printPlanId) {
|
|
public double calculateTotalSubjects(Long printPlanId) {
|
|
@@ -135,20 +138,22 @@ public class ExamDetailServiceImpl extends ServiceImpl<ExamDetailMapper, ExamDet
|
|
@Override
|
|
@Override
|
|
public IPage<PrintTaskDto> listPrintTask(Long semesterId, Long examId, Long printPlanId, String status, String courseCode, String paperNumber, String examPlace, String examRoom, Long examStartTime, Long examEndTime, Long printStartTime, Long printEndTime, Long printHouseId, Integer pageNumber, Integer pageSize) {
|
|
public IPage<PrintTaskDto> listPrintTask(Long semesterId, Long examId, Long printPlanId, String status, String courseCode, String paperNumber, String examPlace, String examRoom, Long examStartTime, Long examEndTime, Long printStartTime, Long printEndTime, Long printHouseId, Integer pageNumber, Integer pageSize) {
|
|
Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
|
|
Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
|
|
- Set<Long> orgIds = teachcloudCommonService.listSubOrgIds(null);
|
|
|
|
|
|
+ SysUser requestUser = (SysUser) ServletUtil.getRequestUser();
|
|
|
|
+ DataPermissionRule dpr = basicRoleDataPermissionService.findDataPermission(schoolId,requestUser.getId(),ServletUtil.getRequest().getServletPath());
|
|
Page<PrintTaskDto> page = new Page<>(pageNumber, pageSize);
|
|
Page<PrintTaskDto> page = new Page<>(pageNumber, pageSize);
|
|
- return this.baseMapper.listPrintTask(page, schoolId, semesterId, examId, printPlanId, status, courseCode, paperNumber, examPlace, examRoom, examStartTime, examEndTime, printStartTime, printEndTime, printHouseId, orgIds);
|
|
|
|
|
|
+ return this.baseMapper.listPrintTask(page, schoolId, semesterId, examId, printPlanId, status, courseCode, paperNumber, examPlace, examRoom, examStartTime, examEndTime, printStartTime, printEndTime, printHouseId, dpr);
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public PrintTaskTotalDto taskTotalData(Long printPlanId, String status, String courseCode, String paperNumber, String examPlace, String examRoom, Long examStartTime, Long examEndTime, Long printStartTime, Long printEndTime, Long printHouseId) {
|
|
public PrintTaskTotalDto taskTotalData(Long printPlanId, String status, String courseCode, String paperNumber, String examPlace, String examRoom, Long examStartTime, Long examEndTime, Long printStartTime, Long printEndTime, Long printHouseId) {
|
|
Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
|
|
Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
|
|
- Set<Long> orgIds = teachcloudCommonService.listSubOrgIds(null);
|
|
|
|
- PrintTaskTotalDto printTaskTotalDto = this.baseMapper.taskTotalData(schoolId, printPlanId, status, courseCode, paperNumber, examPlace, examRoom, examStartTime, examEndTime, printStartTime, printEndTime, printHouseId, orgIds);
|
|
|
|
|
|
+ SysUser requestUser = (SysUser) ServletUtil.getRequestUser();
|
|
|
|
+ DataPermissionRule dpr = basicRoleDataPermissionService.findDataPermission(schoolId,requestUser.getId(),ServletUtil.getRequest().getServletPath());
|
|
|
|
+ PrintTaskTotalDto printTaskTotalDto = this.baseMapper.taskTotalData(schoolId, printPlanId, status, courseCode, paperNumber, examPlace, examRoom, examStartTime, examEndTime, printStartTime, printEndTime, printHouseId, dpr);
|
|
|
|
|
|
if (printTaskTotalDto != null) {
|
|
if (printTaskTotalDto != null) {
|
|
// 试卷总计
|
|
// 试卷总计
|
|
- Integer paperCount = this.baseMapper.selectPaperCount(schoolId, printPlanId, status, courseCode, paperNumber, examPlace, examRoom, examStartTime, examEndTime, printHouseId, orgIds);
|
|
|
|
|
|
+ Integer paperCount = this.baseMapper.selectPaperCount(schoolId, printPlanId, status, courseCode, paperNumber, examPlace, examRoom, examStartTime, examEndTime, printHouseId, dpr);
|
|
printTaskTotalDto.setPaperCount(paperCount == null ? 0 : paperCount);
|
|
printTaskTotalDto.setPaperCount(paperCount == null ? 0 : paperCount);
|
|
}
|
|
}
|
|
return printTaskTotalDto;
|
|
return printTaskTotalDto;
|
|
@@ -263,8 +268,8 @@ public class ExamDetailServiceImpl extends ServiceImpl<ExamDetailMapper, ExamDet
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Override
|
|
@Override
|
|
- public IPage<ExaminationResult> findExaminationBriefPage(Long schoolId, Long semesterId, Long examId, List<Long> printPlanIdList, String courseCode, String paperNumber, String examPlace, String examRoom, String packageCode, Long startDate, Long endDate, int pageNumber, int pageSize, Set<Long> orgIds) {
|
|
|
|
- IPage<ExaminationResult> page = examDetailMapper.findBriefPage(new Page<>(pageNumber, pageSize), schoolId, semesterId, examId, printPlanIdList, courseCode, paperNumber, examPlace, examRoom, packageCode, startDate, endDate, orgIds);
|
|
|
|
|
|
+ public IPage<ExaminationResult> findExaminationBriefPage(Long schoolId, Long semesterId, Long examId, List<Long> printPlanIdList, String courseCode, String paperNumber, String examPlace, String examRoom, String packageCode, Long startDate, Long endDate, int pageNumber, int pageSize, DataPermissionRule dpr) {
|
|
|
|
+ IPage<ExaminationResult> page = examDetailMapper.findBriefPage(new Page<>(pageNumber, pageSize), schoolId, semesterId, examId, printPlanIdList, courseCode, paperNumber, examPlace, examRoom, packageCode, startDate, endDate, dpr);
|
|
List<ExaminationResult> list = page.getRecords();
|
|
List<ExaminationResult> list = page.getRecords();
|
|
for (ExaminationResult examinationResult : list) {
|
|
for (ExaminationResult examinationResult : list) {
|
|
String examDetailCourseIds = examinationResult.getExamDetailCourseIds();
|
|
String examDetailCourseIds = examinationResult.getExamDetailCourseIds();
|
|
@@ -303,8 +308,8 @@ public class ExamDetailServiceImpl extends ServiceImpl<ExamDetailMapper, ExamDet
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Override
|
|
@Override
|
|
- public SummarizedDataResult findSummarizedData(Long schoolId, Long semesterId, Long examId, List<Long> printPlanIdList, String courseCode, String paperNumber, String examPlace, String examRoom, String packageCode, Long startDate, Long endDate, Set<Long> orgIds) {
|
|
|
|
- IPage<ExaminationResult> page = this.findExaminationBriefPage(schoolId, semesterId, examId, printPlanIdList, courseCode, paperNumber, examPlace, examRoom, packageCode, startDate, endDate, SystemConstant.PAGE_NUMBER, SystemConstant.PAGE_SIZE, orgIds);
|
|
|
|
|
|
+ public SummarizedDataResult findSummarizedData(Long schoolId, Long semesterId, Long examId, List<Long> printPlanIdList, String courseCode, String paperNumber, String examPlace, String examRoom, String packageCode, Long startDate, Long endDate, DataPermissionRule dpr) {
|
|
|
|
+ IPage<ExaminationResult> page = this.findExaminationBriefPage(schoolId, semesterId, examId, printPlanIdList, courseCode, paperNumber, examPlace, examRoom, packageCode, startDate, endDate, SystemConstant.PAGE_NUMBER, SystemConstant.PAGE_SIZE, dpr);
|
|
List<ExaminationResult> list = page.getRecords();
|
|
List<ExaminationResult> list = page.getRecords();
|
|
int totalSubjects = 0;
|
|
int totalSubjects = 0;
|
|
for (ExaminationResult examinationResult : list) {
|
|
for (ExaminationResult examinationResult : list) {
|
|
@@ -707,7 +712,7 @@ public class ExamDetailServiceImpl extends ServiceImpl<ExamDetailMapper, ExamDet
|
|
}
|
|
}
|
|
List<Long> printPlanIdList = null;
|
|
List<Long> printPlanIdList = null;
|
|
if (map.get("printPlanIdList") != null) {
|
|
if (map.get("printPlanIdList") != null) {
|
|
- printPlanIdList = (List<Long>) map.get("printPlanIdList");
|
|
|
|
|
|
+ printPlanIdList = JSON.parseArray(map.get("printPlanIdList").toString(),Long.class);
|
|
}
|
|
}
|
|
String courseCode = null;
|
|
String courseCode = null;
|
|
if (map.get("courseCode") != null) {
|
|
if (map.get("courseCode") != null) {
|
|
@@ -737,17 +742,16 @@ public class ExamDetailServiceImpl extends ServiceImpl<ExamDetailMapper, ExamDet
|
|
if (map.get("endDate") != null) {
|
|
if (map.get("endDate") != null) {
|
|
endDate = Long.valueOf(String.valueOf(map.get("endDate")));
|
|
endDate = Long.valueOf(String.valueOf(map.get("endDate")));
|
|
}
|
|
}
|
|
- Set<Long> orgIds = new HashSet<>();
|
|
|
|
- if (Objects.nonNull(map.get("orgIds"))) {
|
|
|
|
- orgIds = (Set<Long>) map.get("orgIds");
|
|
|
|
|
|
+ DataPermissionRule dpr = new DataPermissionRule();
|
|
|
|
+ if (Objects.nonNull(map.get("dpr"))) {
|
|
|
|
+ dpr = (DataPermissionRule) map.get("dpr");
|
|
}
|
|
}
|
|
TBTask tbTask = (TBTask) map.get(SystemConstant.TASK);
|
|
TBTask tbTask = (TBTask) map.get(SystemConstant.TASK);
|
|
- Long userId = tbTask.getCreateId();
|
|
|
|
Long schoolId = tbTask.getSchoolId();
|
|
Long schoolId = tbTask.getSchoolId();
|
|
|
|
|
|
List<ExaminationResult> examinationResultList = this.findExaminationBriefPage(schoolId, semesterId, examId,
|
|
List<ExaminationResult> examinationResultList = this.findExaminationBriefPage(schoolId, semesterId, examId,
|
|
printPlanIdList, courseCode, paperNumber, examPlace, examRoom, packageCode, startDate, endDate,
|
|
printPlanIdList, courseCode, paperNumber, examPlace, examRoom, packageCode, startDate, endDate,
|
|
- SystemConstant.PAGE_NUMBER, SystemConstant.PAGE_SIZE, orgIds).getRecords();
|
|
|
|
|
|
+ SystemConstant.PAGE_NUMBER, SystemConstant.PAGE_SIZE, dpr).getRecords();
|
|
int index = 0;
|
|
int index = 0;
|
|
List<ExaminationExportDto> examinationExportDtoList = new ArrayList<>();
|
|
List<ExaminationExportDto> examinationExportDtoList = new ArrayList<>();
|
|
for (ExaminationResult examinationResult : examinationResultList) {
|
|
for (ExaminationResult examinationResult : examinationResultList) {
|