|
@@ -12,6 +12,7 @@ import com.google.common.collect.Lists;
|
|
|
import com.qmth.boot.api.exception.ApiException;
|
|
|
import com.qmth.distributed.print.business.bean.dto.ExamPaperObjectiveStructureDto;
|
|
|
import com.qmth.distributed.print.business.bean.dto.ExamPaperStructureDto;
|
|
|
+import com.qmth.distributed.print.business.bean.dto.ExamPaperStructurePageDto;
|
|
|
import com.qmth.distributed.print.business.bean.dto.ExamPaperSubjectiveStructureDto;
|
|
|
import com.qmth.distributed.print.business.bean.marking.*;
|
|
|
import com.qmth.distributed.print.business.entity.*;
|
|
@@ -100,12 +101,12 @@ public class ExamPaperStructureServiceImpl extends ServiceImpl<ExamPaperStructur
|
|
|
private BasicRoleDataPermissionService basicRoleDataPermissionService;
|
|
|
|
|
|
@Override
|
|
|
- public IPage<ExamPaperStructure> listByPropositionTeacherId(Long semesterId, Long examId, Integer pageNumber, Integer pageSize, String[] structureStatusEnums, Boolean ready) {
|
|
|
+ public IPage<ExamPaperStructurePageDto> listByPropositionTeacherId(Long semesterId, Long examId, Integer pageNumber, Integer pageSize, String[] structureStatusEnums, Boolean ready) {
|
|
|
Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
|
|
|
SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
|
|
|
DataPermissionRule dpr = basicRoleDataPermissionService.findDataPermission(schoolId, sysUser.getId(), ServletUtil.getRequest().getServletPath());
|
|
|
Page<ExamPaperStructure> page = new Page<>(pageNumber, pageSize);
|
|
|
- IPage<ExamPaperStructure> examPaperStructureIPage = this.baseMapper.listByPropositionTeacherId(page, schoolId, semesterId, examId, sysUser.getId(), ExamTaskSyncStatusEnum.FINISH.name(), structureStatusEnums, ready, dpr);
|
|
|
+ IPage<ExamPaperStructurePageDto> examPaperStructureIPage = this.baseMapper.listByPropositionTeacherId(page, schoolId, semesterId, examId, sysUser.getId(), ExamTaskSyncStatusEnum.FINISH.name(), structureStatusEnums, ready, dpr);
|
|
|
examPaperStructureIPage.getRecords().forEach(m -> {
|
|
|
m.setStatusStr(ExamPaperStructureStatusEnum.INIT.equals(m.getStatus()) ? "未提交" : "已提交");
|
|
|
|
|
@@ -116,6 +117,16 @@ public class ExamPaperStructureServiceImpl extends ServiceImpl<ExamPaperStructur
|
|
|
TBSyncTask tbSyncTask = tbSyncTaskService.getOne(queryWrapper);
|
|
|
m.setTaskStatus(tbSyncTask == null ? null : tbSyncTask.getStatus().name());
|
|
|
}
|
|
|
+
|
|
|
+ ExamTaskDetail examTaskDetail = examTaskDetailService.getOne(new QueryWrapper<ExamTaskDetail>().lambda()
|
|
|
+ .eq(ExamTaskDetail::getExamTaskId, m.getExamTaskId()));
|
|
|
+ if(StringUtils.isNotBlank(examTaskDetail.getPaperAttachmentIds())){
|
|
|
+ List<JSONObject> jsonObjectList = JSON.parseArray(examTaskDetail.getPaperAttachmentIds(), JSONObject.class);
|
|
|
+ Optional<JSONObject> objectOptional = jsonObjectList.stream().filter(t->m.getPaperType().equals(t.getString("name"))).findFirst();
|
|
|
+ if(objectOptional.isPresent()){
|
|
|
+ m.setCardId(objectOptional.get().getString("cardId"));
|
|
|
+ }
|
|
|
+ }
|
|
|
});
|
|
|
return examPaperStructureIPage;
|
|
|
}
|