Prechádzať zdrojové kódy

Merge branch 'dev' of http://git.qmth.com.cn/themis/backend-service into dev
111

wangliang 4 rokov pred
rodič
commit
db40ffd4ff

+ 6 - 2
themis-backend/src/main/java/com/qmth/themis/backend/api/TBUserController.java

@@ -551,8 +551,12 @@ public class TBUserController {
         IPage<TBUserDto> tbUserIPage = tbUserService.userQuery(new Page<>(pageNumber, pageSize), id, loginName, name, role, enable);
         List<TBUserDto> tbUserDtoList = tbUserIPage.getRecords();
         tbUserDtoList.forEach(s -> {
-            s.setRoleName(Arrays.asList(s.getRoleNameStr().split(",")));
-            s.setRoleCode(Arrays.asList(s.getRoleCodeStr().split(",")));
+            if (Objects.nonNull(s.getRoleNameStr())) {
+                s.setRoleName(Arrays.asList(s.getRoleNameStr().split(",")));
+            }
+            if (Objects.nonNull(s.getRoleCodeStr())) {
+                s.setRoleCode(Arrays.asList(s.getRoleCodeStr().split(",")));
+            }
         });
         Map map = new HashMap<>();
         map.put(SystemConstant.RECORDS, tbUserIPage);

+ 29 - 43
themis-business/src/main/java/com/qmth/themis/business/service/impl/TEExamServiceImpl.java

@@ -1,38 +1,12 @@
 package com.qmth.themis.business.service.impl;
 
-import java.io.IOException;
-import java.io.InputStream;
-import java.text.SimpleDateFormat;
-import java.util.*;
-
-import javax.annotation.Resource;
-
-import org.apache.commons.codec.digest.DigestUtils;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.BeanUtils;
-import org.springframework.cache.annotation.Cacheable;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-import org.springframework.web.multipart.MultipartFile;
-
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.qmth.themis.business.bean.exam.ExamFileUploadBean;
-import com.qmth.themis.business.bean.exam.ExamFinishBean;
-import com.qmth.themis.business.bean.exam.ExamPrepareBean;
-import com.qmth.themis.business.bean.exam.ExamResultBean;
-import com.qmth.themis.business.bean.exam.ExamResumeBean;
-import com.qmth.themis.business.bean.exam.ExamStartBean;
+import com.qmth.themis.business.bean.exam.*;
 import com.qmth.themis.business.cache.ExamActivityRecordCacheUtil;
 import com.qmth.themis.business.cache.ExamRecordCacheUtil;
 import com.qmth.themis.business.cache.RedisKeyHelper;
-import com.qmth.themis.business.cache.bean.ExamActivityCacheBean;
-import com.qmth.themis.business.cache.bean.ExamCacheBean;
-import com.qmth.themis.business.cache.bean.ExamCourseCacheBean;
-import com.qmth.themis.business.cache.bean.ExamPaperCacheBean;
-import com.qmth.themis.business.cache.bean.ExamStudentAnswerCacheBean;
-import com.qmth.themis.business.cache.bean.ExamStudentCacheBean;
-import com.qmth.themis.business.cache.bean.ExamStudentPaperStructCacheBean;
+import com.qmth.themis.business.cache.bean.*;
 import com.qmth.themis.business.config.SystemConfig;
 import com.qmth.themis.business.dao.TEExamMapper;
 import com.qmth.themis.business.dto.cache.TEStudentCacheDto;
@@ -42,15 +16,23 @@ import com.qmth.themis.business.entity.TEExam;
 import com.qmth.themis.business.entity.TOeExamRecord;
 import com.qmth.themis.business.enums.ExamRecordStatusEnum;
 import com.qmth.themis.business.enums.FinishTypeEnum;
-import com.qmth.themis.business.service.TEExamActivityService;
-import com.qmth.themis.business.service.TEExamCourseService;
-import com.qmth.themis.business.service.TEExamPaperService;
-import com.qmth.themis.business.service.TEExamService;
-import com.qmth.themis.business.service.TEExamStudentService;
-import com.qmth.themis.business.service.TOeExamRecordService;
+import com.qmth.themis.business.service.*;
 import com.qmth.themis.business.util.OssUtil;
 import com.qmth.themis.business.util.RedisUtil;
 import com.qmth.themis.common.exception.BusinessException;
+import org.apache.commons.codec.digest.DigestUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.BeanUtils;
+import org.springframework.cache.annotation.Cacheable;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.annotation.Resource;
+import java.io.IOException;
+import java.io.InputStream;
+import java.text.SimpleDateFormat;
+import java.util.*;
 
 /**
  * @Description: 考试批次 服务实现类
@@ -120,14 +102,18 @@ public class TEExamServiceImpl extends ServiceImpl<TEExamMapper, TEExam> impleme
             list.forEach(s -> {
                 List<TEExamActivityDto> teExamActivityList = teExamActivityService.getWaitingExam(studentId, s.getId(), s.getExamActivityId());
                 teExamActivityList.forEach(v -> {
-                    String[] longs = v.getInProcessLivenessFixedRangeStr().split(",");
-                    List inProcessLivenessFixedRange = new ArrayList();
-                    for (int i = 0; i < longs.length; i++) {
-                        Long l = Long.valueOf(longs[i]);
-                        inProcessLivenessFixedRange.add(l);
+                    if (Objects.nonNull(v.getInProcessLivenessFixedRangeStr())) {
+                        String[] longs = v.getInProcessLivenessFixedRangeStr().split(",");
+                        List inProcessLivenessFixedRange = new ArrayList();
+                        for (int i = 0; i < longs.length; i++) {
+                            Long l = Long.valueOf(longs[i]);
+                            inProcessLivenessFixedRange.add(l);
+                        }
+                        v.setInProcessLivenessFixedRange(inProcessLivenessFixedRange);
+                    }
+                    if (Objects.nonNull(v.getMonitorVideoSourceStr())) {
+                        v.setMonitorVideoSource(Arrays.asList(v.getMonitorVideoSourceStr()));
                     }
-                    v.setInProcessLivenessFixedRange(inProcessLivenessFixedRange);
-                    v.setMonitorVideoSource(Arrays.asList(v.getMonitorVideoSourceStr()));
                 });
                 s.setActivities(teExamActivityList);
             });
@@ -164,8 +150,8 @@ public class TEExamServiceImpl extends ServiceImpl<TEExamMapper, TEExam> impleme
             throw new BusinessException("考生Id和当前登录用户不一致");
         }
         TEStudentCacheDto teStudentCacheDto = (TEStudentCacheDto) redisUtil.getStudent(es.getStudentId());
-        if(teStudentCacheDto.getUnFinishedRecordId()!=null) {
-        	throw new BusinessException("有尚未完成的考试,不能再次开始候考");
+        if (teStudentCacheDto.getUnFinishedRecordId() != null) {
+            throw new BusinessException("有尚未完成的考试,不能再次开始候考");
         }
         if (es.getLeftExamCount() == 0) {
             throw new BusinessException("没有剩余考试次数");