فهرست منبع

Merge branch 'dev'
1

wangliang 4 سال پیش
والد
کامیت
3c5899961d

+ 2 - 7
themis-backend/src/main/java/com/qmth/themis/backend/api/TBOrgController.java

@@ -18,6 +18,7 @@ import com.qmth.themis.common.exception.BusinessException;
 import com.qmth.themis.common.util.Result;
 import com.qmth.themis.common.util.ResultUtil;
 import io.swagger.annotations.*;
+import org.springframework.cache.annotation.CachePut;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
 
@@ -41,16 +42,10 @@ public class TBOrgController {
     @Resource
     TBOrgService tbOrgService;
 
-    @Resource
-    SystemConfig systemConfig;
-
-//    @Resource
-//    private CacheManager cacheManager;
-
     @Resource
     RedisUtil redisUtil;
 
-    //    @CachePut(value = "org_cache", key = "'orgCacheQuery'")
+//    @CachePut(value = "org_cache", key = "'orgCacheQuery'")
 //    @Cacheable(value = "org_cache", key = "#p0")
     @ApiOperation(value = "机构查询分页接口")
     @RequestMapping(value = "/query", method = RequestMethod.POST)

+ 1 - 1
themis-backend/src/main/java/com/qmth/themis/backend/api/TEExamActivityController.java

@@ -73,10 +73,10 @@ public class TEExamActivityController {
                     s.setCreateId(tbUser.getId());
                     s.setCode(String.valueOf(redisUtil.getRedisActivityCodeSequence(s.getExamId())));
                 }
+                teExamActivityService.saveOrUpdate(s);
             });
             examId = teExamActivityList.get(0).getExamId();
             for(TEExamActivity ac:teExamActivityList){
-            	teExamActivityService.saveOrUpdate(ac);
                 teExamActivityService.updateExamActivityCacheBean(ac.getId());
             }
             TEExam teExam = teExamService.getById(teExamActivityList.get(0).getExamId());

+ 1 - 1
themis-backend/src/main/java/com/qmth/themis/backend/api/TEExamController.java

@@ -148,9 +148,9 @@ public class TEExamController {
                         s.setStartTime(finalTeExam.getStartTime());
                         s.setFinishTime(finalTeExam.getEndTime());
                         s.setUpdateId(tbUser.getId());
+                        teExamActivityService.saveOrUpdate(s);
                     });
                     for(TEExamActivity ac:teExamActivityList){
-                    	teExamActivityService.saveOrUpdate(ac);
                         teExamActivityService.updateExamActivityCacheBean(ac.getId());
                     }
                     if (Objects.nonNull(teExam.getForceFinish()) && teExam.getForceFinish().intValue() == 1) {

+ 15 - 46
themis-backend/src/main/java/com/qmth/themis/backend/api/TEExamPaperController.java

@@ -1,57 +1,28 @@
 package com.qmth.themis.backend.api;
 
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-
-import javax.annotation.Resource;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.dao.DuplicateKeyException;
-import org.springframework.transaction.annotation.Transactional;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-import org.springframework.web.multipart.MultipartFile;
-
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.qmth.themis.business.cache.bean.ExamPaperCacheBean;
 import com.qmth.themis.business.config.SystemConfig;
 import com.qmth.themis.business.constant.SystemConstant;
 import com.qmth.themis.business.dto.MqDto;
-import com.qmth.themis.business.entity.TBAttachment;
-import com.qmth.themis.business.entity.TBTaskHistory;
-import com.qmth.themis.business.entity.TBUser;
-import com.qmth.themis.business.entity.TEExam;
-import com.qmth.themis.business.entity.TEExamActivity;
-import com.qmth.themis.business.entity.TEExamPaper;
-import com.qmth.themis.business.enums.FieldUniqueEnum;
-import com.qmth.themis.business.enums.MqTagEnum;
-import com.qmth.themis.business.enums.MqTopicEnum;
-import com.qmth.themis.business.enums.TaskStatusEnum;
-import com.qmth.themis.business.enums.TaskTypeEnum;
-import com.qmth.themis.business.service.MqDtoService;
-import com.qmth.themis.business.service.TBAttachmentService;
-import com.qmth.themis.business.service.TBTaskHistoryService;
-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.entity.*;
+import com.qmth.themis.business.enums.*;
+import com.qmth.themis.business.service.*;
 import com.qmth.themis.business.util.ServletUtil;
 import com.qmth.themis.common.enums.ExceptionResultEnum;
 import com.qmth.themis.common.exception.BusinessException;
 import com.qmth.themis.common.util.Result;
 import com.qmth.themis.common.util.ResultUtil;
+import io.swagger.annotations.*;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.dao.DuplicateKeyException;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
 
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
-import io.swagger.annotations.ApiResponse;
-import io.swagger.annotations.ApiResponses;
+import javax.annotation.Resource;
+import java.util.*;
 
 /**
  * @Description: 考试试卷 前端控制器
@@ -83,7 +54,7 @@ public class TEExamPaperController {
 
     @Resource
     SystemConfig systemConfig;
-    
+
     @Resource
     TEExamCourseService examCourseService;
 
@@ -114,10 +85,8 @@ public class TEExamPaperController {
             TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
             teExamPaperList.forEach(s -> {
                 s.setUpdateId(tbUser.getId());
+                teExamPaperService.saveOrUpdate(s);
             });
-            for(TEExamPaper ep:teExamPaperList){
-            	teExamPaperService.saveOrUpdate(ep);
-            }
         } catch (Exception e) {
             log.error("请求出错", e);
             if (e instanceof DuplicateKeyException) {
@@ -132,7 +101,7 @@ public class TEExamPaperController {
         }
         teExamPaperList.forEach(s -> {
             teExamPaperService.updateExamPaperCacheBean(s.getId());
-            ExamPaperCacheBean paper=teExamPaperService.getExamPaperCacheBean(s.getId());
+            ExamPaperCacheBean paper = teExamPaperService.getExamPaperCacheBean(s.getId());
             examCourseService.deleteExamCourseCacheBean(paper.getExamId(), paper.getCourseCode());
         });
         return ResultUtil.ok(Collections.singletonMap("success", true));

+ 1 - 1
themis-backend/src/main/java/com/qmth/themis/backend/api/TEExamStudentController.java

@@ -230,9 +230,9 @@ public class TEExamStudentController {
                 }
                 s.setRoomName(roomCodeQueryDtoMap.get(s.getRoomCode()).getRoomName());
             }
+            teExamStudentService.saveOrUpdate(s);
         });
         for(TEExamStudent es:teExamStudentList){
-        	teExamStudentService.saveOrUpdate(es);
             teExamStudentService.updateExamStudentCacheBean(es.getId());
         }
         return ResultUtil.ok(Collections.singletonMap("success", true));

+ 8 - 9
themis-business/src/main/java/com/qmth/themis/business/templete/TaskExportCommon.java

@@ -138,20 +138,20 @@ public class TaskExportCommon {
             fileWriter.write(txtStr);
             JSONObject json = new JSONObject();
             if (Objects.equals(this.type, SystemConstant.OSS)) {
-            	json.put("path", file.getPath().replaceAll("\\\\", "/"));
-            }else {
-            	json.put("path", file.getPath());
+                json.put("path", file.getPath().replaceAll("\\\\", "/"));
+            } else {
+                json.put("path", file.getPath());
             }
             json.put("type", this.type);
             this.tbTaskHistory.setReportFilePath(json.toJSONString());
             if (Objects.nonNull(excelFile)) {
                 JSONObject excelJson = new JSONObject();
                 if (Objects.equals(this.type, SystemConstant.OSS)) {
-                	excelJson.put("path", excelFile.getPath().replaceAll("\\\\", "/"));
-                }else {
-                	excelJson.put("path", excelFile.getPath());
+                    excelJson.put("path", excelFile.getPath().replaceAll("\\\\", "/"));
+                } else {
+                    excelJson.put("path", excelFile.getPath());
                 }
-                
+
                 excelJson.put("type", this.type);
                 this.tbTaskHistory.setResultFilePath(excelJson.toJSONString());
             }
@@ -181,10 +181,9 @@ public class TaskExportCommon {
      */
     public List<String> exception(int min, int y, Exception e, List<String> txtList) {
         this.exception = true;
-        String exceptionStr = "数据导出到第" + (y == 0 ? y + 1 : y) + "条时发生异常:" + e.getMessage();
+        String exceptionStr = "数据导出到第" + (y == 0 ? y + 1 : y) + "条时发生异常,请联系系统管理员处理!";
         txtList.add(DateUtil.format(new Date(), this.timeFormat) + "->" + exceptionStr);
         this.tbTaskHistory.setSummary(exceptionStr);
-//        this.tbTaskHistoryService.updateById(this.tbTaskHistory);
         return txtList;
     }
 

+ 1 - 2
themis-business/src/main/java/com/qmth/themis/business/templete/TaskImportCommon.java

@@ -154,10 +154,9 @@ public class TaskImportCommon {
      */
     public List<String> exception(int min, int y, Exception e, List<String> txtList) {
         this.exception = true;
-        String exceptionStr = "数据处理到第" + (y == 0 ? y + 1 : y) + "条时发生异常:" + e.getMessage();
+        String exceptionStr = "数据处理到第" + (y == 0 ? y + 1 : y) + "条时发生异常,请联系系统管理员处理!";
         txtList.add(DateUtil.format(new Date(), this.timeFormat) + "->" + exceptionStr);
         this.tbTaskHistory.setSummary(exceptionStr);
-//        this.tbTaskHistoryService.updateById(this.tbTaskHistory);
         return txtList;
     }