caozixuan před 8 měsíci
rodič
revize
3f05d2af35

+ 3 - 0
distributed-print-business/src/main/resources/db/log/czx.sql

@@ -71,3 +71,6 @@ INSERT INTO sys_privilege (id, name, url, type, parent_id, sequence, property, e
 INSERT INTO sys_privilege (id, name, url, type, parent_id, sequence, property, enable, default_auth, front_display) VALUES ('3074', '卷型检查任务-任务确认', '/api/scan/student/paper_type_check/confirm', 'URL', '970', '42', 'AUTH', '1', '1', '1');
 UPDATE sys_privilege SET related = '971,972,973,974,975,976,977,978,979,980,981,982,983,984,985,986,987,988,989,990,991,992,993,994,995,996,997,998,999,1000,1001,1002,1003,1004,1005,1007,1009,1010,1148,3072,3073,3074' WHERE (id = '970');
 UPDATE sys_privilege SET related = '971,972,973,974,975,976,977,978,979,980,981,982,983,984,985,986,987,988,989,990,991,992,993,994,995,996,997,998,999,1000,1001,1002,1003,1004,1005,1007,1009,1010,1148,3072,3073,3074' WHERE (id = '1006');
+
+ALTER TABLE scan_paper_page
+    CHANGE COLUMN paper_type paper_type TEXT NULL COMMENT '卷型';

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

@@ -1,5 +1,6 @@
 package com.qmth.distributed.print.api.mark;
 
+import com.alibaba.fastjson.JSON;
 import com.qmth.boot.api.constant.ApiConstant;
 import com.qmth.boot.core.exception.ParameterException;
 import com.qmth.teachcloud.common.contant.SystemConstant;
@@ -77,6 +78,7 @@ public class ScanAnswerController extends BaseController {
     @ApiOperation(value = "查询答题卡扫描详情")
     @RequestMapping(value = "query", method = RequestMethod.POST)
     public Result query(@Validated AnswerQueryDomain query) {
+        System.out.println(JSON.toJSONString(query));
         return ResultUtil.ok(markStudentService.query(query));
     }
 

+ 2 - 2
distributed-print/src/main/java/com/qmth/distributed/print/api/mark/ScanStudentController.java

@@ -98,8 +98,8 @@ public class ScanStudentController extends BaseController {
 
     @ApiOperation(value = "卷型检查任务-任务确认")
     @PostMapping("/paper_type_check/confirm")
-    public Result paperTypeCheckConfirm(@ApiParam(name = "考生id", required = true) @RequestParam Long studentId,
-            @ApiParam(name = "卷型", required = true) @RequestParam String paperType) {
+    public Result paperTypeCheckConfirm(@ApiParam(value = "考生id", required = true) @RequestParam Long studentId,
+            @ApiParam(value = "卷型", required = true) @RequestParam String paperType) {
         return ResultUtil.ok(markStudentService.disposePaperTypeCheck(studentId, paperType));
     }
 }

+ 21 - 3
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/MarkStudentServiceImpl.java

@@ -2223,10 +2223,28 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
     @Transactional
     @Override
     public UpdateTimeVo disposePaperTypeCheck(Long studentId, String paperType) {
-        UpdateWrapper<MarkStudent> updateWrapper = new UpdateWrapper<>();
-        updateWrapper.lambda().eq(MarkStudent::getId, studentId).set(MarkStudent::getPaperType, paperType)
+        SysUser requestUser = (SysUser) ServletUtil.getRequestUser();
+        // 更改试卷和考生绑定关系的卷型
+        ScanStudentPaper scanStudentPaper = scanStudentPaperService.findByStudentIdAndPaperNumber(studentId, 1);
+        if (scanStudentPaper == null) {
+            throw ExceptionResultEnum.ERROR.exception("缺少考生和试卷绑定关系");
+        }
+        Long paperId = scanStudentPaper.getPaperId();
+        ScanPaperPage scanPaperPage = scanPaperPageService.findPaperIdAndIndex(paperId, 1);
+        if (scanPaperPage == null) {
+            throw ExceptionResultEnum.ERROR.exception("缺少试卷和页面绑定关系");
+        }
+        StringResult paperTypeResult = scanPaperPage.getPaperType();
+        paperTypeResult.setResult(paperType);
+        scanPaperPage.setUpdaterId(requestUser.getId());
+        scanPaperPage.setUpdateTime(System.currentTimeMillis());
+        scanPaperPageService.updateByMultiId(scanPaperPage);
+
+        // 更改考生卷型和卷型检查状态
+        UpdateWrapper<MarkStudent> markStudentUpdateWrapper = new UpdateWrapper<>();
+        markStudentUpdateWrapper.lambda().eq(MarkStudent::getId, studentId).set(MarkStudent::getPaperType, paperType)
                 .set(MarkStudent::getPaperTypeCheckStatus, PaperTypeCheckStatus.PROCESSED);
-        this.update(updateWrapper);
+        this.update(markStudentUpdateWrapper);
         return UpdateTimeVo.create();
     }
 }

+ 2 - 2
teachcloud-mark/src/main/resources/mapper/MarkStudentMapper.xml

@@ -328,8 +328,8 @@
         <if test="query.paperType != null and query.paperType != ''">
             and t.paper_type=#{query.paperType}
         </if>
-        <if test="query.paperTypeCheckStatus != null and query.paperTypeCheckStatus != ''">
-            and t.paper_type_check_status=#{paperTypeCheckStatus}
+        <if test="query.paperTypeCheckStatus != null">
+            and t.paper_type_check_status=#{query.paperTypeCheckStatus}
         </if>
         <if test="dpr != null and dpr.requestUserId != null">
             AND t.create_id = #{dpr.requestUserId}