Browse Source

3.3.1 update

xiaofei 1 year ago
parent
commit
9911a2cb08

+ 8 - 3
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/BasicExamStudentServiceImpl.java

@@ -158,7 +158,7 @@ public class BasicExamStudentServiceImpl extends ServiceImpl<BasicExamStudentMap
             // 同步更新扫描阅卷考生表
             markStudentService.updateByBasicExamStudent(basicExamStudent, markPaper, new HashSet<>());
             markPaperService.updateStudentCountByExamIdAndPaperNumberAndPaperType(basicExamStudent.getExamId(), basicExamStudent.getPaperNumber(), SystemConstant.DEFAULT_PAPER_TYPE_A);
-            if(basicExamStudentOld != null){
+            if (basicExamStudentOld != null) {
                 markPaperService.updateStudentCountByExamIdAndPaperNumberAndPaperType(basicExamStudent.getExamId(), basicExamStudentOld.getPaperNumber(), SystemConstant.DEFAULT_PAPER_TYPE_A);
             }
         }
@@ -292,7 +292,7 @@ public class BasicExamStudentServiceImpl extends ServiceImpl<BasicExamStudentMap
 
         // 校验2 试卷编号存在时,任课教师,考试时间,考点考场均必填;
         BasicSchool basicSchool = commonCacheService.schoolCache(schoolId);
-        boolean needPaperNumber = basicSchool.getHasPaperNumber() != null && basicSchool.getHasPaperNumber();
+        boolean needPaperNumber = (basicSchool.getHasPaperNumber() != null && basicSchool.getHasPaperNumber()) || ExamModelEnum.MODEL4.equals(basicExam.getExamModel());
         if (SystemConstant.strNotNull(paperNumber)) {
             String hasPaperNumberError = "试卷编号不为空时: ";
             if (!SystemConstant.strNotNull(teacherCode) || !SystemConstant.strNotNull(teacherName)) {
@@ -307,7 +307,7 @@ public class BasicExamStudentServiceImpl extends ServiceImpl<BasicExamStudentMap
             if (!SystemConstant.strNotNull(examRoom)) {
                 errorMsgList.add(hasPaperNumberError + "考场(考试教室)必填");
             }
-        } else if (needPaperNumber || ExamModelEnum.MODEL4.equals(basicExam.getExamModel())) {
+        } else if (needPaperNumber) {
             errorMsgList.add("试卷编号必填");
         }
 
@@ -345,6 +345,11 @@ public class BasicExamStudentServiceImpl extends ServiceImpl<BasicExamStudentMap
             if (!studentCode.equals(dbBasicExamStudent.getStudentCode())) {
                 throw ExceptionResultEnum.ERROR.exception("编辑考生时,学号不可更改");
             }
+            MarkStudent markStudent = markStudentService.findByExamIdAndPaperNumberAndStudentCode(dbBasicExamStudent.getExamId(), dbBasicExamStudent.getPaperNumber(), dbBasicExamStudent.getStudentCode());
+            if (markStudent != null && markStudent.getUpload() && StringUtils.isNotBlank(paperNumber) && !paperNumber.equals(dbBasicExamStudent.getPaperNumber())) {
+                throw ExceptionResultEnum.ERROR.exception("考生已扫描,不能修改试卷编号");
+            }
+
             basicExamStudent.setId(id);
             basicExamStudent.updateInfo(requestUserId);
         } else {

+ 4 - 0
distributed-print/install/mysql/upgrade/3.3.1.sql

@@ -771,3 +771,7 @@ ALTER TABLE t_r_basic_info MODIFY COLUMN teaching_object varchar(1000) NULL COMM
 
 INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `enable`, `default_auth`, `front_display`) VALUES ('1139', '轨迹图查询题卡内容', '/api/admin/mark/track/getCard', 'URL', '946', '12', 'AUTH', '1', '1', '1');
 UPDATE `sys_privilege` SET `related` = '953,954,955,956,957,958,959,960,969,1139' WHERE (`id` = '950');
+
+
+delete from basic_operation_log where customized_operation_type = 'SEARCH';
+update basic_operation_log set customized_operation_type = 'SYNC',iperation_type='EDIT'  where customized_operation_type = 'PUSH';

+ 1 - 1
distributed-print/src/main/java/com/qmth/distributed/print/api/TBSyncTaskController.java

@@ -67,7 +67,7 @@ public class TBSyncTaskController {
     @ApiOperation(value = "重新同步")
     @RequestMapping(value = "/resync", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "重新同步", response = TaskListResult.class)})
-    @OperationLogDetail(customizedOperationType = CustomizedOperationTypeEnum.PUSH)
+    @OperationLogDetail(customizedOperationType = CustomizedOperationTypeEnum.SYNC)
     public Result syncQuery(@ApiParam(value = "任务ID") @RequestParam(required = false) Long id) throws IllegalAccessException {
         tbSyncTaskService.resync(id);
         return ResultUtil.ok(true);

+ 2 - 4
distributed-print/src/main/java/com/qmth/distributed/print/api/TCFinalScoreController.java

@@ -81,7 +81,6 @@ public class TCFinalScoreController {
 
     @ApiOperation(value = "导入期末成绩-模板下载")
     @RequestMapping(value = "/final_score/template_download", method = RequestMethod.POST)
-    @OperationLogDetail(customizedOperationType = CustomizedOperationTypeEnum.EXPORT)
     @ApiResponses({@ApiResponse(code = 200, message = "下载成功", response = Object.class)})
     public void finalScoreTemplateDownload(@ApiParam(value = "考试id", required = true) @RequestParam Long examId,
                                            @ApiParam(value = "科目编码", required = true) @RequestParam String courseCode,
@@ -148,7 +147,7 @@ public class TCFinalScoreController {
     @ApiOperation(value = "同步期末成绩选择试卷")
     @RequestMapping(value = "/final_score/choose_paper", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "同步成功", response = EditResult.class)})
-    @OperationLogDetail(customizedOperationType = CustomizedOperationTypeEnum.PUSH)
+    @OperationLogDetail(customizedOperationType = CustomizedOperationTypeEnum.SYNC)
     public Result finalScoreSyncChoosePaper(@ApiParam(value = "考试id", required = true) @RequestParam Long examId,
                                             @ApiParam(value = "科目编码", required = true) @RequestParam String courseCode,
                                             @ApiParam(value = "教学课程id", required = true) @RequestParam Long teachCourseId) {
@@ -158,7 +157,7 @@ public class TCFinalScoreController {
     @ApiOperation(value = "同步期末成绩")
     @RequestMapping(value = "/final_score/sync", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "同步成功", response = EditResult.class)})
-    @OperationLogDetail(customizedOperationType = CustomizedOperationTypeEnum.PUSH)
+    @OperationLogDetail(customizedOperationType = CustomizedOperationTypeEnum.SYNC)
     @Aac(rateLimit = @RateLimit(count = 1, period = 1000L))
     public Result finalScoreSync(@ApiParam(value = "考试id", required = true) @RequestParam Long examId,
                                  @ApiParam(value = "科目编码", required = true) @RequestParam String courseCode,
@@ -188,7 +187,6 @@ public class TCFinalScoreController {
 
     @ApiOperation(value = "期末成绩列表")
     @RequestMapping(value = "/final_score/list", method = RequestMethod.POST)
-    @OperationLogDetail(customizedOperationType = CustomizedOperationTypeEnum.SEARCH)
     @ApiResponses({@ApiResponse(code = 200, message = "分页查询", response = TCFinalScore.class)})
     public Result finalScoreList(@ApiParam(value = "考试id", required = true) @RequestParam Long examId,
                                  @ApiParam(value = "科目编码", required = true) @RequestParam String courseCode,

+ 1 - 2
distributed-print/src/main/java/com/qmth/distributed/print/api/TCPaperStructController.java

@@ -106,7 +106,7 @@ public class TCPaperStructController {
 
     @ApiOperation(value = "同步试卷蓝图结构")
     @RequestMapping(value = "/final_score/paper_struct_dimension/sync", method = RequestMethod.POST)
-    @OperationLogDetail(customizedOperationType = CustomizedOperationTypeEnum.PUSH)
+    @OperationLogDetail(customizedOperationType = CustomizedOperationTypeEnum.SYNC)
     @ApiResponses({@ApiResponse(code = 200, message = "同步成功", response = EditResult.class)})
     @Aac(rateLimit = @RateLimit(count = 1, period = 1000L))
     public Result finalScorePaperStructDimensionSync(@ApiParam(value = "考试id", required = true) @RequestParam Long examId,
@@ -191,7 +191,6 @@ public class TCPaperStructController {
 
     @ApiOperation(value = "期末成绩试卷蓝图查询")
     @RequestMapping(value = "/final_score/paper_struct/query", method = RequestMethod.POST)
-    @OperationLogDetail(customizedOperationType = CustomizedOperationTypeEnum.SEARCH)
     @ApiResponses({@ApiResponse(code = 200, message = "试卷蓝图查询", response = PaperStructDimensionResult.class)})
     public Result finalScorePaperStructQuery(@ApiParam(value = "考试id", required = true) @RequestParam Long examId,
                                              @ApiParam(value = "科目编码", required = true) @RequestParam String courseCode,

+ 0 - 2
distributed-print/src/main/java/com/qmth/distributed/print/api/TCUsualScoreController.java

@@ -69,7 +69,6 @@ public class TCUsualScoreController {
 
     @ApiOperation(value = "成绩管理列表")
     @RequestMapping(value = "/score/list", method = RequestMethod.POST)
-    @OperationLogDetail(customizedOperationType = CustomizedOperationTypeEnum.SEARCH)
     @ApiResponses({@ApiResponse(code = 200, message = "分页查询", response = ScoreResult.class)})
     public Result scoreList(@ApiParam(value = "考试ID", required = true) @RequestParam Long examId,
                             @ApiParam(value = "课程编码") @RequestParam(required = false) String courseCode,
@@ -119,7 +118,6 @@ public class TCUsualScoreController {
 
     @ApiOperation(value = "平时成绩列表")
     @RequestMapping(value = "/usual_score/list", method = RequestMethod.POST)
-    @OperationLogDetail(customizedOperationType = CustomizedOperationTypeEnum.SEARCH)
     @ApiResponses({@ApiResponse(code = 200, message = "分页查询", response = TCUsualScore.class)})
     public Result usualScoreList(@ApiParam(value = "考试id", required = true) @RequestParam Long examId,
                                  @ApiParam(value = "科目编码", required = true) @RequestParam String courseCode,

+ 0 - 2
distributed-print/src/main/java/com/qmth/distributed/print/api/TRBasicInfoController.java

@@ -99,7 +99,6 @@ public class TRBasicInfoController {
 
     @ApiOperation(value = "报告管理列表")
     @RequestMapping(value = "/report/list", method = RequestMethod.POST)
-    @OperationLogDetail(customizedOperationType = CustomizedOperationTypeEnum.SEARCH)
     @ApiResponses({@ApiResponse(code = 200, message = "分页查询", response = ScoreResult.class)})
     public Result reportList(@ApiParam(value = "考试ID", required = true) @RequestParam Long examId,
                              @ApiParam(value = "课程编码") @RequestParam(required = false) String courseCode,
@@ -110,7 +109,6 @@ public class TRBasicInfoController {
 
     @ApiOperation(value = "查看报告")
     @RequestMapping(value = "/report/view", method = RequestMethod.POST)
-    @OperationLogDetail(customizedOperationType = CustomizedOperationTypeEnum.SEARCH)
     @ApiResponses({@ApiResponse(code = 200, message = "查看报告", response = ReportResult.class)})
     @Transactional
     public Result reportView(@ApiParam(value = "考试id", required = true) @RequestParam Long examId,

+ 1 - 1
distributed-print/src/main/java/com/qmth/distributed/print/api/mark/MarkGroupController.java

@@ -67,7 +67,7 @@ public class MarkGroupController extends BaseController {
      */
     @ApiOperation(value = "修改")
     @RequestMapping(value = "/update", method = RequestMethod.POST)
-    @OperationLogDetail(customizedOperationType = CustomizedOperationTypeEnum.EDIT)
+    @OperationLogDetail(customizedOperationType = CustomizedOperationTypeEnum.UPDATE)
     public Result update(@RequestBody MarkGroupSingleDto markGroupSingleDto) {
         validMarkPaperForMark(markGroupSingleDto.getExamId(), markGroupSingleDto.getPaperNumber());
         return ResultUtil.ok(markGroupService.updateGroup(markGroupSingleDto));

+ 1 - 1
teachcloud-common/src/main/java/com/qmth/teachcloud/common/aspect/LogAspect.java

@@ -216,7 +216,7 @@ public class LogAspect {
                 }
             }
         }
-        return CustomizedOperationTypeEnum.EDIT;
+        return CustomizedOperationTypeEnum.UPDATE;
     }
 
     /**

+ 1 - 2
teachcloud-common/src/main/java/com/qmth/teachcloud/common/enums/log/CustomizedOperationTypeEnum.java

@@ -17,10 +17,9 @@ public enum CustomizedOperationTypeEnum {
     ADD("新增", OperationTypeEnum.EDIT),
     DELETE("删除", OperationTypeEnum.DELETE),
     UPDATE("修改", OperationTypeEnum.EDIT),
-    SEARCH("查询", OperationTypeEnum.SELECT),
     IMPORT("导入", OperationTypeEnum.EDIT),
     EXPORT("导出", OperationTypeEnum.SELECT),
-    PUSH("推送", OperationTypeEnum.UN_KNOW),
+    SYNC("同步", OperationTypeEnum.EDIT),
     PREVIEW("预览", OperationTypeEnum.UN_KNOW),
     UN_KNOW("未知", OperationTypeEnum.UN_KNOW);
     private final String desc;