Browse Source

扫描记录相关内容

wn
王宁 2 months ago
parent
commit
510f9453ac
20 changed files with 344 additions and 244 deletions
  1. 5
    0
      sapi/src/main/java/com/xhkjedu/sapi/service/scantron/ScantronService.java
  2. 81
    1
      smarking/src/main/java/com/xhkjedu/smarking/controller/scan/MsScanbatchController.java
  3. 0
    57
      smarking/src/main/java/com/xhkjedu/smarking/controller/scan/MsScanbatchPaperBlockController.java
  4. 0
    57
      smarking/src/main/java/com/xhkjedu/smarking/controller/scan/MsScanbatchPaperBlockQuestionController.java
  5. 20
    33
      smarking/src/main/java/com/xhkjedu/smarking/controller/scan/MsScanbatchPaperController.java
  6. 10
    0
      smarking/src/main/java/com/xhkjedu/smarking/mapper/scan/MsScanbatchMapper.java
  7. 10
    0
      smarking/src/main/java/com/xhkjedu/smarking/mapper/scan/MsScanbatchPaperBlockMapper.java
  8. 4
    0
      smarking/src/main/java/com/xhkjedu/smarking/mapper/scan/MsScanbatchPaperMapper.java
  9. 6
    0
      smarking/src/main/java/com/xhkjedu/smarking/model/scan/MsScanbatchPaper.java
  10. 7
    1
      smarking/src/main/java/com/xhkjedu/smarking/model/scan/MsScanbatchPaperBlock.java
  11. 1
    1
      smarking/src/main/java/com/xhkjedu/smarking/model/scan/MsScanbatchPaperBlockQuestion.java
  12. 3
    1
      smarking/src/main/java/com/xhkjedu/smarking/model/stupaper/MsPaperStudent.java
  13. 0
    41
      smarking/src/main/java/com/xhkjedu/smarking/service/scan/MsScanbatchPaperBlockQuestionService.java
  14. 0
    41
      smarking/src/main/java/com/xhkjedu/smarking/service/scan/MsScanbatchPaperBlockService.java
  15. 53
    9
      smarking/src/main/java/com/xhkjedu/smarking/service/scan/MsScanbatchPaperService.java
  16. 35
    2
      smarking/src/main/java/com/xhkjedu/smarking/service/scan/MsScanbatchService.java
  17. 24
    0
      smarking/src/main/java/com/xhkjedu/smarking/vo/scan/ScanParams.java
  18. 53
    0
      smarking/src/main/resources/mapper/scan/MsScanbatchMapper.xml
  19. 27
    0
      smarking/src/main/resources/mapper/scan/MsScanbatchPaperBlockMapper.xml
  20. 5
    0
      smarking/src/main/resources/mapper/scan/MsScanbatchPaperMapper.xml

+ 5
- 0
sapi/src/main/java/com/xhkjedu/sapi/service/scantron/ScantronService.java View File

@@ -33,6 +33,11 @@ public class ScantronService {
33 33
     //答题卡-保存
34 34
     public void save(TScantron tScantron){
35 35
         tScantron.setCreatetime(N_Utils.getSecondTimestamp());
36
+        if(tScantron.getSlayout() > 1){
37
+            tScantron.setPapertype(1);
38
+        }else{
39
+            tScantron.setPapertype(2);
40
+        }
36 41
         scantronMapper.insertSelective(tScantron);
37 42
     }
38 43
     //答题卡-修改

+ 81
- 1
smarking/src/main/java/com/xhkjedu/smarking/controller/scan/MsScanbatchController.java View File

@@ -5,6 +5,7 @@ import com.github.pagehelper.PageInfo;
5 5
 import com.xhkjedu.smarking.model.scan.MsScanbatch;
6 6
 import com.xhkjedu.smarking.model.scan.MsScanbatchPaper;
7 7
 import com.xhkjedu.smarking.service.scan.MsScanbatchService;
8
+import com.xhkjedu.smarking.vo.scan.ScanParams;
8 9
 import com.xhkjedu.utils.N_Utils;
9 10
 import com.xhkjedu.utils.PageUtil;
10 11
 import com.xhkjedu.vo.PageResult;
@@ -30,7 +31,7 @@ public class MsScanbatchController {
30 31
     private MsScanbatchService msScanbatchService;
31 32
 
32 33
     /**
33
-     * @Description 新增
34
+     * @Description 新增扫描试卷
34 35
      * @Param [msScanbatch]
35 36
      * @Author auto
36 37
      * @Date 2024-10-15
@@ -75,4 +76,83 @@ public class MsScanbatchController {
75 76
         Map<String, Object> map = msScanbatchService.getExamPaperScanInfo(mpid);
76 77
         return new ResultVo(0, "查询成功", map);
77 78
     }
79
+
80
+    /*
81
+     * @Description 扫描记录-扫描信息、考试班级、扫描批次
82
+     * @Date 2024/10/25 14:49:07
83
+     * @Author WN
84
+     * @Param [msScanbatch]
85
+     * @Return com.xhkjedu.vo.ResultVo
86
+     **/
87
+    @PostMapping("/record_info")
88
+    public ResultVo getScanPaperRecordInfo(@RequestBody MsScanbatch msScanbatch) {
89
+        Integer mpid = msScanbatch.getMpid();
90
+        N_Utils.validation(new Object[]{mpid, "试卷id", 1});
91
+        Map<String, Object> map = msScanbatchService.getScanRecordAndClass(mpid);
92
+        return new ResultVo(0, "查询成功", map);
93
+    }
94
+
95
+    /*
96
+     * @Description 扫描记录-按班级
97
+     * @Date 2024/10/25 16:51:59
98
+     * @Author WN
99
+     * @Param [params]
100
+     * @Return com.xhkjedu.vo.ResultVo
101
+     **/
102
+    @PostMapping("/record_class")
103
+    public ResultVo listRecordClassStudents(@RequestBody ScanParams params) {
104
+        Integer page = params.getPage();
105
+        Integer pageSize = params.getPageSize();
106
+        N_Utils.validation(new Object[]{params.getMpid(), "试卷id", 1,params.getExamid(),"考试id",1,page, "显示页码", 1, pageSize, "显示条数", 1});
107
+        PageHelper.startPage(page, pageSize);
108
+        List<Map<String, Object>> list = msScanbatchService.listRecordClassStudents(params);
109
+        PageResult pageResult = PageUtil.getPageResult(new PageInfo<>(list));
110
+        return new ResultVo(0, "查询成功", pageResult);
111
+    }
112
+
113
+    /*
114
+     * @Description 扫描记录-按班级-导出
115
+     * @Date 2024/10/25 17:00:23
116
+     * @Author WN
117
+     * @Param [params]
118
+     * @Return com.xhkjedu.vo.ResultVo
119
+     **/
120
+    @PostMapping("/record_class_export")
121
+    public ResultVo listRecordClassStudentsExpport(@RequestBody ScanParams params) {
122
+        N_Utils.validation(new Object[]{params.getMpid(), "试卷id", 1,params.getExamid(),"考试id",1});
123
+        List<Map<String, Object>> list = msScanbatchService.listRecordClassStudents(params);
124
+        return new ResultVo(0, "查询成功", list);
125
+    }
126
+
127
+    /*
128
+     * @Description 扫描记录-按班级
129
+     * @Date 2024/10/25 16:55:40
130
+     * @Author WN
131
+     * @Param [params]
132
+     * @Return com.xhkjedu.vo.ResultVo
133
+     **/
134
+    @PostMapping("/record_batch")
135
+    public ResultVo listRecordBatchStudents(@RequestBody ScanParams params) {
136
+        Integer page = params.getPage();
137
+        Integer pageSize = params.getPageSize();
138
+        N_Utils.validation(new Object[]{params.getMpid(), "试卷id", 1,params.getExamid(),"考试id",1,page, "显示页码", 1, pageSize, "显示条数", 1});
139
+        PageHelper.startPage(page, pageSize);
140
+        List<Map<String, Object>> list = msScanbatchService.listRecordBatchStudents(params);
141
+        PageResult pageResult = PageUtil.getPageResult(new PageInfo<>(list));
142
+        return new ResultVo(0, "查询成功", pageResult);
143
+    }
144
+
145
+    /*
146
+     * @Description 扫描记录-按班级-导出
147
+     * @Date 2024/10/25 17:01:09
148
+     * @Author WN
149
+     * @Param [params]
150
+     * @Return com.xhkjedu.vo.ResultVo
151
+     **/
152
+    @PostMapping("/record_batch_export")
153
+    public ResultVo listRecordBatchStudentsExport(@RequestBody ScanParams params) {
154
+        N_Utils.validation(new Object[]{params.getMpid(), "试卷id", 1,params.getExamid(),"考试id",1});
155
+        List<Map<String, Object>> list = msScanbatchService.listRecordBatchStudents(params);
156
+        return new ResultVo(0, "查询成功", list);
157
+    }
78 158
 }

+ 0
- 57
smarking/src/main/java/com/xhkjedu/smarking/controller/scan/MsScanbatchPaperBlockController.java View File

@@ -1,57 +0,0 @@
1
-package com.xhkjedu.smarking.controller.scan;
2
-
3
-import com.github.pagehelper.PageHelper;
4
-import com.github.pagehelper.PageInfo;
5
-import com.xhkjedu.smarking.model.scan.MsScanbatchPaperBlock;
6
-import com.xhkjedu.smarking.service.scan.MsScanbatchPaperBlockService;
7
-import com.xhkjedu.utils.N_Utils;
8
-import com.xhkjedu.utils.PageUtil;
9
-import com.xhkjedu.vo.PageResult;
10
-import com.xhkjedu.vo.ResultVo;
11
-import org.springframework.web.bind.annotation.*;
12
-
13
-import javax.annotation.Resource;
14
-import java.util.List;
15
-
16
-/**
17
- * @Description 阅卷扫描客试卷题块表相关操作
18
- * @Author auto
19
- * @Date 2024-10-15
20
- */
21
-@RestController
22
-@RequestMapping("/msScanbatchPaperBlock")
23
-public class MsScanbatchPaperBlockController {
24
-    @Resource
25
-    private MsScanbatchPaperBlockService msScanbatchPaperBlockService;
26
-
27
-    /**
28
-     * @Description 新增
29
-     * @Param [msScanbatchPaperBlock]
30
-     * @Author auto
31
-     * @Date 2024-10-15
32
-     * @return com.xhkjedu.vo.ResultVo
33
-     **/
34
-    @PostMapping("/save")
35
-    public ResultVo save(@RequestBody MsScanbatchPaperBlock msScanbatchPaperBlock) {
36
-        msScanbatchPaperBlockService.add(msScanbatchPaperBlock);
37
-        return new ResultVo(0, "保存成功!");
38
-    }
39
-
40
-    /**
41
-     * @Description 列表
42
-     * @Param [msScanbatchPaperBlock]
43
-     * @Author auto
44
-     * @Date 2024-10-15
45
-     * @return com.xhkjedu.vo.ResultVo
46
-     **/
47
-    @PostMapping("/list")
48
-    public ResultVo queryList(@RequestBody MsScanbatchPaperBlock msScanbatchPaperBlock) {
49
-        Integer page = msScanbatchPaperBlock.getPage();
50
-        Integer size = msScanbatchPaperBlock.getPageSize();
51
-        N_Utils.validation(new Object[]{page, "显示页码", 1, size, "显示条数", 1});
52
-        PageHelper.startPage(page, size);
53
-        List<MsScanbatchPaperBlock> list = msScanbatchPaperBlockService.queryList(msScanbatchPaperBlock);
54
-        PageResult pageResult = PageUtil.getPageResult(new PageInfo<>(list));
55
-        return new ResultVo(0, "查询成功!", pageResult);
56
-    }
57
-}

+ 0
- 57
smarking/src/main/java/com/xhkjedu/smarking/controller/scan/MsScanbatchPaperBlockQuestionController.java View File

@@ -1,57 +0,0 @@
1
-package com.xhkjedu.smarking.controller.scan;
2
-
3
-import com.github.pagehelper.PageHelper;
4
-import com.github.pagehelper.PageInfo;
5
-import com.xhkjedu.smarking.model.scan.MsScanbatchPaperBlockQuestion;
6
-import com.xhkjedu.smarking.service.scan.MsScanbatchPaperBlockQuestionService;
7
-import com.xhkjedu.utils.N_Utils;
8
-import com.xhkjedu.utils.PageUtil;
9
-import com.xhkjedu.vo.PageResult;
10
-import com.xhkjedu.vo.ResultVo;
11
-import org.springframework.web.bind.annotation.*;
12
-
13
-import javax.annotation.Resource;
14
-import java.util.List;
15
-
16
-/**
17
- * @Description 阅卷扫描试卷题块试题识别表相关操作
18
- * @Author auto
19
- * @Date 2024-10-15
20
- */
21
-@RestController
22
-@RequestMapping("/msScanbatchPaperBlockQuestion")
23
-public class MsScanbatchPaperBlockQuestionController {
24
-    @Resource
25
-    private MsScanbatchPaperBlockQuestionService msScanbatchPaperBlockQuestionService;
26
-
27
-    /**
28
-     * @Description 新增
29
-     * @Param [msScanbatchPaperBlockQuestion]
30
-     * @Author auto
31
-     * @Date 2024-10-15
32
-     * @return com.xhkjedu.vo.ResultVo
33
-     **/
34
-    @PostMapping("/save")
35
-    public ResultVo save(@RequestBody MsScanbatchPaperBlockQuestion msScanbatchPaperBlockQuestion) {
36
-        msScanbatchPaperBlockQuestionService.add(msScanbatchPaperBlockQuestion);
37
-        return new ResultVo(0, "保存成功!");
38
-    }
39
-
40
-    /**
41
-     * @Description 列表
42
-     * @Param [msScanbatchPaperBlockQuestion]
43
-     * @Author auto
44
-     * @Date 2024-10-15
45
-     * @return com.xhkjedu.vo.ResultVo
46
-     **/
47
-    @PostMapping("/list")
48
-    public ResultVo queryList(@RequestBody MsScanbatchPaperBlockQuestion msScanbatchPaperBlockQuestion) {
49
-        Integer page = msScanbatchPaperBlockQuestion.getPage();
50
-        Integer size = msScanbatchPaperBlockQuestion.getPageSize();
51
-        N_Utils.validation(new Object[]{page, "显示页码", 1, size, "显示条数", 1});
52
-        PageHelper.startPage(page, size);
53
-        List<MsScanbatchPaperBlockQuestion> list = msScanbatchPaperBlockQuestionService.queryList(msScanbatchPaperBlockQuestion);
54
-        PageResult pageResult = PageUtil.getPageResult(new PageInfo<>(list));
55
-        return new ResultVo(0, "查询成功!", pageResult);
56
-    }
57
-}

+ 20
- 33
smarking/src/main/java/com/xhkjedu/smarking/controller/scan/MsScanbatchPaperController.java View File

@@ -1,17 +1,16 @@
1 1
 package com.xhkjedu.smarking.controller.scan;
2 2
 
3
-import com.github.pagehelper.PageHelper;
4
-import com.github.pagehelper.PageInfo;
5 3
 import com.xhkjedu.smarking.model.scan.MsScanbatchPaper;
6 4
 import com.xhkjedu.smarking.service.scan.MsScanbatchPaperService;
7 5
 import com.xhkjedu.utils.N_Utils;
8
-import com.xhkjedu.utils.PageUtil;
9
-import com.xhkjedu.vo.PageResult;
10 6
 import com.xhkjedu.vo.ResultVo;
11
-import org.springframework.web.bind.annotation.*;
7
+import org.springframework.web.bind.annotation.PostMapping;
8
+import org.springframework.web.bind.annotation.RequestBody;
9
+import org.springframework.web.bind.annotation.RequestMapping;
10
+import org.springframework.web.bind.annotation.RestController;
12 11
 
13 12
 import javax.annotation.Resource;
14
-import java.util.List;
13
+import java.util.Map;
15 14
 
16 15
 /**
17 16
  * @Description 批阅扫描试卷表相关操作
@@ -19,39 +18,27 @@ import java.util.List;
19 18
  * @Date 2024-10-15
20 19
  */
21 20
 @RestController
22
-@RequestMapping("/msScanbatchPaper")
21
+@RequestMapping("/mscanp")
23 22
 public class MsScanbatchPaperController {
24 23
     @Resource
25 24
     private MsScanbatchPaperService msScanbatchPaperService;
26 25
 
27
-    /**
28
-     * @Description 新增
29
-     * @Param [msScanbatchPaper]
30
-     * @Author auto
31
-     * @Date 2024-10-15
32
-     * @return com.xhkjedu.vo.ResultVo
33
-     **/
34
-    @PostMapping("/save")
35
-    public ResultVo save(@RequestBody MsScanbatchPaper msScanbatchPaper) {
36
-        msScanbatchPaperService.add(msScanbatchPaper);
37
-        return new ResultVo(0, "保存成功!");
38
-    }
39 26
 
40
-    /**
41
-     * @Description 列表
27
+
28
+
29
+    /*
30
+     * @Description 扫描记录-查看原卷
31
+     * @Date 2024/10/25 17:24:18
32
+     * @Author WN
42 33
      * @Param [msScanbatchPaper]
43
-     * @Author auto
44
-     * @Date 2024-10-15
45
-     * @return com.xhkjedu.vo.ResultVo
34
+     * @Return com.xhkjedu.vo.ResultVo
46 35
      **/
47
-    @PostMapping("/list")
48
-    public ResultVo queryList(@RequestBody MsScanbatchPaper msScanbatchPaper) {
49
-        Integer page = msScanbatchPaper.getPage();
50
-        Integer size = msScanbatchPaper.getPageSize();
51
-        N_Utils.validation(new Object[]{page, "显示页码", 1, size, "显示条数", 1});
52
-        PageHelper.startPage(page, size);
53
-        List<MsScanbatchPaper> list = msScanbatchPaperService.queryList(msScanbatchPaper);
54
-        PageResult pageResult = PageUtil.getPageResult(new PageInfo<>(list));
55
-        return new ResultVo(0, "查询成功!", pageResult);
36
+    @PostMapping("/paper")
37
+    public ResultVo getScanPaper(@RequestBody MsScanbatchPaper msScanbatchPaper) {
38
+        Integer mspid = msScanbatchPaper.getMspid();
39
+        N_Utils.validation(new Object[]{mspid, "扫描试卷id", 1});
40
+        Map<String, Object> map = msScanbatchPaperService.getScanPaperQuestion(mspid);
41
+        return new ResultVo(0, "获取成功", map);
56 42
     }
43
+
57 44
 }

+ 10
- 0
smarking/src/main/java/com/xhkjedu/smarking/mapper/scan/MsScanbatchMapper.java View File

@@ -2,6 +2,7 @@ package com.xhkjedu.smarking.mapper.scan;
2 2
 
3 3
 import com.xhkjedu.base.TkMapper;
4 4
 import com.xhkjedu.smarking.model.scan.MsScanbatch;
5
+import com.xhkjedu.smarking.vo.scan.ScanParams;
5 6
 import org.apache.ibatis.annotations.Param;
6 7
 
7 8
 import java.util.List;
@@ -25,4 +26,13 @@ public interface MsScanbatchMapper extends TkMapper<MsScanbatch> {
25 26
 
26 27
     //获取试卷所有扫描批次
27 28
     List<Map<String,Object>> listScanBatchByMpidForSel(@Param("mpid")Integer mpid);
29
+
30
+    //扫描记录-扫描信息
31
+    Map<String,Object> getScanPaperRecord(@Param("mpid")Integer mpid);
32
+
33
+    //扫描记录-按班级
34
+    List<Map<String,Object>> listRecordClassStudents(@Param("params")ScanParams params);
35
+
36
+    //扫描记录-按批次
37
+    List<Map<String,Object>> listRecordBatchStudents(@Param("params")ScanParams params);
28 38
 }

+ 10
- 0
smarking/src/main/java/com/xhkjedu/smarking/mapper/scan/MsScanbatchPaperBlockMapper.java View File

@@ -2,6 +2,10 @@ package com.xhkjedu.smarking.mapper.scan;
2 2
 
3 3
 import com.xhkjedu.base.TkMapper;
4 4
 import com.xhkjedu.smarking.model.scan.MsScanbatchPaperBlock;
5
+import org.apache.ibatis.annotations.Param;
6
+
7
+import java.util.List;
8
+import java.util.Map;
5 9
 
6 10
 /**
7 11
  * @Description 阅卷扫描客试卷题块表 Mapper 接口
@@ -9,4 +13,10 @@ import com.xhkjedu.smarking.model.scan.MsScanbatchPaperBlock;
9 13
  * @Date 2024-10-15
10 14
  */
11 15
 public interface MsScanbatchPaperBlockMapper extends TkMapper<MsScanbatchPaperBlock> {
16
+
17
+    //扫描记录-查看原卷-客观题
18
+    List<Map<String,Object>> listObjectiveQuestions(@Param("mspid")Integer mspid);
19
+
20
+    //扫描记录-查看原卷-主观题
21
+    List<Map<String,Object>> listSubjectiveQuestions(@Param("mspid")Integer mspid);
12 22
 }

+ 4
- 0
smarking/src/main/java/com/xhkjedu/smarking/mapper/scan/MsScanbatchPaperMapper.java View File

@@ -5,6 +5,7 @@ import com.xhkjedu.smarking.model.scan.MsScanbatchPaper;
5 5
 import org.apache.ibatis.annotations.Param;
6 6
 
7 7
 import java.util.List;
8
+import java.util.Map;
8 9
 
9 10
 /**
10 11
  * @Description 批阅扫描试卷表 Mapper 接口
@@ -15,4 +16,7 @@ public interface MsScanbatchPaperMapper extends TkMapper<MsScanbatchPaper> {
15 16
 
16 17
     //获取批次下所有试卷
17 18
     List<MsScanbatchPaper> listPaperByBatchid(@Param("batchid") Integer batchid);
19
+
20
+    //查看原卷-试卷信息
21
+    Map<String,Object> getScanPaperByMspid(@Param("mspid") Integer mspid);
18 22
 }

+ 6
- 0
smarking/src/main/java/com/xhkjedu/smarking/model/scan/MsScanbatchPaper.java View File

@@ -5,6 +5,8 @@ import lombok.Data;
5 5
 
6 6
 import javax.persistence.Id;
7 7
 import javax.persistence.Table;
8
+import javax.persistence.Transient;
9
+import java.util.List;
8 10
 
9 11
 /**
10 12
  * @Description 批阅扫描试卷表
@@ -43,4 +45,8 @@ public class MsScanbatchPaper extends BaseBean {
43 45
     private Integer mspstate;
44 46
     //保存时间
45 47
     private Integer createtime;
48
+
49
+    //扫描试卷块表
50
+    @Transient
51
+    private List<MsScanbatchPaperBlock> spblocks;
46 52
 }

+ 7
- 1
smarking/src/main/java/com/xhkjedu/smarking/model/scan/MsScanbatchPaperBlock.java View File

@@ -5,6 +5,8 @@ import lombok.Data;
5 5
 
6 6
 import javax.persistence.Id;
7 7
 import javax.persistence.Table;
8
+import javax.persistence.Transient;
9
+import java.util.List;
8 10
 
9 11
 /**
10 12
  * @Description 阅卷扫描客试卷题块表
@@ -28,7 +30,11 @@ public class MsScanbatchPaperBlock extends BaseBean {
28 30
     //扩展图片
29 31
     private String extendpath;
30 32
     //识别结果
31
-    private String identify;
33
+    private String identifycont;
32 34
     //题块试题类型1客观题 2主观题
33 35
     private Integer msptype;
36
+
37
+    //扫描试卷客观题
38
+    @Transient
39
+    private List<MsScanbatchPaperBlockQuestion> spbquestions;
34 40
 }

+ 1
- 1
smarking/src/main/java/com/xhkjedu/smarking/model/scan/MsScanbatchPaperBlockQuestion.java View File

@@ -22,5 +22,5 @@ public class MsScanbatchPaperBlockQuestion extends BaseBean {
22 22
     //合并试题ID
23 23
     private Integer mpsqmid;
24 24
     //识别结果
25
-    private String identify;
25
+    private String identifycont;
26 26
 }

+ 3
- 1
smarking/src/main/java/com/xhkjedu/smarking/model/stupaper/MsPaperStudent.java View File

@@ -51,8 +51,10 @@ public class MsPaperStudent extends BaseBean {
51 51
     private Integer hasbad;
52 52
     //创建时间
53 53
     private Integer createtime;
54
-    //扫描批次id
54
+    //扫描批次ID
55 55
     private Integer batchid;
56
+    //扫描批次下试卷ID
57
+    private Integer mspid;
56 58
     //学生答题卡图片
57 59
     private String stupic;
58 60
     //扫码时第几张

+ 0
- 41
smarking/src/main/java/com/xhkjedu/smarking/service/scan/MsScanbatchPaperBlockQuestionService.java View File

@@ -1,41 +0,0 @@
1
-package com.xhkjedu.smarking.service.scan;
2
-
3
-import com.xhkjedu.smarking.mapper.scan.MsScanbatchPaperBlockQuestionMapper;
4
-import com.xhkjedu.smarking.model.scan.MsScanbatchPaperBlockQuestion;
5
-import org.springframework.stereotype.Service;
6
-
7
-import javax.annotation.Resource;
8
-import java.util.List;
9
-
10
-/**
11
- * @Description 阅卷扫描试卷题块试题识别表 服务实现类
12
- * @Author auto
13
- * @Date 2024-10-15
14
- */
15
-@Service
16
-public class MsScanbatchPaperBlockQuestionService {
17
-    @Resource
18
-    private MsScanbatchPaperBlockQuestionMapper msScanbatchPaperBlockQuestionMapper;
19
-
20
-    /**
21
-     * @Description 新增
22
-     * @Param [msScanbatchPaperBlockQuestion]
23
-     * @Author auto
24
-     * @Date 2024-10-15
25
-     * @return void
26
-     **/
27
-    public void add(MsScanbatchPaperBlockQuestion msScanbatchPaperBlockQuestion){
28
-        msScanbatchPaperBlockQuestionMapper.insert(msScanbatchPaperBlockQuestion);
29
-    }
30
-
31
-    /**
32
-     * @Description 列表
33
-     * @Param [msScanbatchPaperBlockQuestion]
34
-     * @Author auto
35
-     * @Date 2024-10-15
36
-     * @return java.util.List<com.xhkjedu.smarking.model.scan.MsScanbatchPaperBlockQuestion>
37
-     **/
38
-    public List<MsScanbatchPaperBlockQuestion> queryList(MsScanbatchPaperBlockQuestion msScanbatchPaperBlockQuestion){
39
-        return msScanbatchPaperBlockQuestionMapper.selectAll();
40
-    }
41
-}

+ 0
- 41
smarking/src/main/java/com/xhkjedu/smarking/service/scan/MsScanbatchPaperBlockService.java View File

@@ -1,41 +0,0 @@
1
-package com.xhkjedu.smarking.service.scan;
2
-
3
-import com.xhkjedu.smarking.mapper.scan.MsScanbatchPaperBlockMapper;
4
-import com.xhkjedu.smarking.model.scan.MsScanbatchPaperBlock;
5
-import org.springframework.stereotype.Service;
6
-
7
-import javax.annotation.Resource;
8
-import java.util.List;
9
-
10
-/**
11
- * @Description 阅卷扫描客试卷题块表 服务实现类
12
- * @Author auto
13
- * @Date 2024-10-15
14
- */
15
-@Service
16
-public class MsScanbatchPaperBlockService {
17
-    @Resource
18
-    private MsScanbatchPaperBlockMapper msScanbatchPaperBlockMapper;
19
-
20
-    /**
21
-     * @Description 新增
22
-     * @Param [msScanbatchPaperBlock]
23
-     * @Author auto
24
-     * @Date 2024-10-15
25
-     * @return void
26
-     **/
27
-    public void add(MsScanbatchPaperBlock msScanbatchPaperBlock){
28
-        msScanbatchPaperBlockMapper.insert(msScanbatchPaperBlock);
29
-    }
30
-
31
-    /**
32
-     * @Description 列表
33
-     * @Param [msScanbatchPaperBlock]
34
-     * @Author auto
35
-     * @Date 2024-10-15
36
-     * @return java.util.List<com.xhkjedu.smarking.model.scan.MsScanbatchPaperBlock>
37
-     **/
38
-    public List<MsScanbatchPaperBlock> queryList(MsScanbatchPaperBlock msScanbatchPaperBlock){
39
-        return msScanbatchPaperBlockMapper.selectAll();
40
-    }
41
-}

+ 53
- 9
smarking/src/main/java/com/xhkjedu/smarking/service/scan/MsScanbatchPaperService.java View File

@@ -1,11 +1,19 @@
1 1
 package com.xhkjedu.smarking.service.scan;
2 2
 
3
+import com.xhkjedu.smarking.mapper.scan.MsScanbatchPaperBlockMapper;
4
+import com.xhkjedu.smarking.mapper.scan.MsScanbatchPaperBlockQuestionMapper;
3 5
 import com.xhkjedu.smarking.mapper.scan.MsScanbatchPaperMapper;
4 6
 import com.xhkjedu.smarking.model.scan.MsScanbatchPaper;
7
+import com.xhkjedu.smarking.model.scan.MsScanbatchPaperBlock;
8
+import com.xhkjedu.smarking.model.scan.MsScanbatchPaperBlockQuestion;
9
+import com.xhkjedu.utils.N_Utils;
5 10
 import org.springframework.stereotype.Service;
11
+import org.springframework.transaction.annotation.Transactional;
6 12
 
7 13
 import javax.annotation.Resource;
14
+import java.util.ArrayList;
8 15
 import java.util.List;
16
+import java.util.Map;
9 17
 
10 18
 /**
11 19
  * @Description 批阅扫描试卷表 服务实现类
@@ -16,6 +24,10 @@ import java.util.List;
16 24
 public class MsScanbatchPaperService {
17 25
     @Resource
18 26
     private MsScanbatchPaperMapper msScanbatchPaperMapper;
27
+    @Resource
28
+    private MsScanbatchPaperBlockMapper msScanbatchPaperBlockMapper;
29
+    @Resource
30
+    private MsScanbatchPaperBlockQuestionMapper msScanbatchPaperBlockQuestionMapper;
19 31
 
20 32
     /**
21 33
      * @Description 新增
@@ -24,18 +36,50 @@ public class MsScanbatchPaperService {
24 36
      * @Date 2024-10-15
25 37
      * @return void
26 38
      **/
39
+    @Transactional(rollbackFor = Exception.class)
27 40
     public void add(MsScanbatchPaper msScanbatchPaper){
28
-        msScanbatchPaperMapper.insert(msScanbatchPaper);
41
+
42
+        msScanbatchPaper.setCreatetime(N_Utils.getSecondTimestamp());
43
+        msScanbatchPaperMapper.insertUseGeneratedKeys(msScanbatchPaper);
44
+        Integer mspid = msScanbatchPaper.getId();
45
+
46
+        //保存试题
47
+        List<MsScanbatchPaperBlock> spblocks = msScanbatchPaper.getSpblocks();
48
+        for (MsScanbatchPaperBlock spblock : spblocks) {
49
+            spblock.setMspid(mspid);
50
+            spblock.setBatchid(msScanbatchPaper.getBatchid());
51
+        }
52
+
53
+        msScanbatchPaperBlockMapper.insertList(spblocks);
54
+        List<MsScanbatchPaperBlockQuestion> saveQuestions = new ArrayList<>();
55
+        for (MsScanbatchPaperBlock spblock : spblocks) {
56
+            Integer spbid = spblock.getId();
57
+            List<MsScanbatchPaperBlockQuestion> spbquestions = spblock.getSpbquestions();
58
+            for (MsScanbatchPaperBlockQuestion spbquestion : spbquestions) {
59
+                spbquestion.setMspbid(spbid);
60
+                saveQuestions.add(spbquestion);
61
+            }
62
+        }
63
+        msScanbatchPaperBlockQuestionMapper.insertList(saveQuestions);
29 64
     }
30 65
 
31
-    /**
32
-     * @Description 列表
33
-     * @Param [msScanbatchPaper]
34
-     * @Author auto
35
-     * @Date 2024-10-15
36
-     * @return java.util.List<com.xhkjedu.smarking.model.scan.MsScanbatchPaper>
66
+
67
+    /*
68
+     * @Description 扫描记录-查看原卷
69
+     * @Date 2024/10/25 17:22:45
70
+     * @Author WN
71
+     * @Param [mspid]
72
+     * @Return java.util.Map<java.lang.String,java.lang.Object>
37 73
      **/
38
-    public List<MsScanbatchPaper> queryList(MsScanbatchPaper msScanbatchPaper){
39
-        return msScanbatchPaperMapper.selectAll();
74
+    public Map<String,Object> getScanPaperQuestion(Integer mspid){
75
+        Map<String,Object> map = msScanbatchPaperMapper.getScanPaperByMspid(mspid);
76
+        //获取试卷中客观题
77
+        List<Map<String,Object>> objectives = msScanbatchPaperBlockMapper.listObjectiveQuestions(mspid);
78
+        map.put("objectives",objectives);
79
+        //获取试卷中主观题
80
+        List<Map<String,Object>> subjectives = msScanbatchPaperBlockMapper.listSubjectiveQuestions(mspid);
81
+        map.put("subjectives",subjectives);
82
+
83
+        return map;
40 84
     }
41 85
 }

+ 35
- 2
smarking/src/main/java/com/xhkjedu/smarking/service/scan/MsScanbatchService.java View File

@@ -6,6 +6,7 @@ import com.xhkjedu.smarking.mapper.scan.MsScanbatchMapper;
6 6
 import com.xhkjedu.smarking.mapper.scan.MsScanbatchPaperMapper;
7 7
 import com.xhkjedu.smarking.model.scan.MsScanbatch;
8 8
 import com.xhkjedu.smarking.model.scan.MsScanbatchPaper;
9
+import com.xhkjedu.smarking.vo.scan.ScanParams;
9 10
 import com.xhkjedu.utils.N_Utils;
10 11
 import org.springframework.stereotype.Service;
11 12
 
@@ -74,7 +75,7 @@ public class MsScanbatchService {
74 75
     }
75 76
 
76 77
     /*
77
-     * @Description 扫描答题卡
78
+     * @Description 扫描答
78 79
      * @Date 2024/10/24 15:09:33
79 80
      * @Author WN
80 81
      * @Param [mpid]
@@ -88,14 +89,46 @@ public class MsScanbatchService {
88 89
         return rtnMap;
89 90
     }
90 91
 
92
+    /*
93
+     * @Description 扫描记录-扫描信息、考试班级、扫描批次
94
+     * @Date 2024/10/25 14:47:51
95
+     * @Author WN
96
+     * @Param [mpid]
97
+     * @Return java.util.Map<java.lang.String,java.lang.Object>
98
+     **/
91 99
     public Map<String,Object> getScanRecordAndClass(Integer mpid){
92
-        Map<String,Object> map = null;
100
+        Map<String,Object> map = msScanbatchMapper.getScanPaperRecord(mpid);
93 101
 
94 102
         //试卷扫描批次集合
95 103
         List<Map<String,Object>> scans = msScanbatchMapper.listScanBatchByMpidForSel(mpid);
96 104
         //参加考试的班级
105
+        List<Map> classes = msClassMapper.listByExamId(Integer.parseInt(map.get("examid").toString()), map.get("subjectid").toString());
106
+        map.put("scans",scans);
107
+        map.put("classes",classes);
97 108
 
98 109
         return map;
99 110
     }
100 111
 
112
+    /*
113
+     * @Description 扫描记录-按班级
114
+     * @Date 2024/10/25 16:50:44
115
+     * @Author WN
116
+     * @Param [params]
117
+     * @Return java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
118
+     **/
119
+    public List<Map<String,Object>> listRecordClassStudents(ScanParams params){
120
+        return msScanbatchMapper.listRecordClassStudents(params);
121
+    }
122
+
123
+    /*
124
+     * @Description 扫描记录-按批次
125
+     * @Date 2024/10/25 16:54:57
126
+     * @Author WN
127
+     * @Param [params]
128
+     * @Return java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
129
+     **/
130
+    public List<Map<String,Object>> listRecordBatchStudents(ScanParams params){
131
+        return msScanbatchMapper.listRecordBatchStudents(params);
132
+    }
133
+
101 134
 }

+ 24
- 0
smarking/src/main/java/com/xhkjedu/smarking/vo/scan/ScanParams.java View File

@@ -0,0 +1,24 @@
1
+package com.xhkjedu.smarking.vo.scan;
2
+
3
+import com.xhkjedu.model.BaseBean;
4
+import lombok.Data;
5
+
6
+/**
7
+ * @Description:扫描参数
8
+ * @Author: WN
9
+ * @Date: 2024/10/25 15:00:20
10
+ **/
11
+@Data
12
+public class ScanParams extends BaseBean {
13
+    private Integer examid;//考试ID
14
+
15
+    private Integer mpid;//试卷ID
16
+
17
+    private Integer classid;//班级ID
18
+
19
+    private Integer batchid;//批次ID
20
+
21
+    private Integer hasscan;//是否扫描1已扫2未扫
22
+
23
+    private Integer hasidentify;//是否识别1已识别2未识别
24
+}

+ 53
- 0
smarking/src/main/resources/mapper/scan/MsScanbatchMapper.xml View File

@@ -27,4 +27,57 @@
27 27
         select batchid,batchname from ms_scanbatch where mpid=#{mpid} order by batchid
28 28
     </select>
29 29
 
30
+    <!--扫描记录-扫描信息-->
31
+    <select id="getScanPaperRecord" resultType="java.util.Map">
32
+        select e.examid,e.examname,e.gradeid,e.exammode,s.subjectid,s.subjectname,s.msid,sum(b.scannum) scannum,
33
+        (select count(*) from ms_class_student where examid=e.examid and subjectid=s.subjectid) stunum,
34
+        (select count(*) from ms_paper_student where mpid=b.mpid and batchid is not null) identifynum
35
+        from ms_exam e left join ms_subject s on e.examid=s.examid
36
+        left join ms_paper p on s.msid=p.msid
37
+        left join  ms_scanbatch b on e.examid and p.mpid=b.mpid
38
+        where b.mpid=#{mpid} group by b.mpid
39
+    </select>
40
+
41
+    <!--扫描记录-按班级-->
42
+    <select id="listRecordClassStudents" resultType="java.util.Map">
43
+        select distinct cs.studentid,cs.classid,s.classname,u.username studentname,u.examno,
44
+        ps.batchid,ps.mspid,ps.stuscore,b.batchname
45
+        from ms_class_student cs left join ms_class s on cs.classid=s.classid and cs.examid=s.examid
46
+        left join t_user u on cs.studentid=u.userid
47
+        left join ms_paper_student ps on cs.studentid=ps.studentid and cs.subjectid=ps.subjectid
48
+        and cs.examid=ps.examid
49
+        left join ms_scanbatch b on ps.batchid=b.batchid and b.mpid=ps.mpid
50
+        where cs.examid=#{params.examid} and ps.mpid=#{params.mpid}
51
+        <if test="params.classid!=null and params.classid!=0">
52
+            and cs.classid=#{params.classid}
53
+        </if>
54
+        <if test="params.hasscan!=null and params.hasscan!=0 and params.hasscan==1">
55
+            and ps.batchid is not null
56
+        </if>
57
+        <if test="params.hasscan!=null and params.hasscan!=0 and params.hasscan==2">
58
+            and ps.batchid is null
59
+        </if>
60
+        order by cs.mcsid
61
+    </select>
62
+    <!--扫描记录-按批次-->
63
+    <select id="listRecordBatchStudents" resultType="java.util.Map">
64
+        select b.batchid,b.batchname,sp.mspid,sp.examno,c.classid,c.classname,u.username studentname
65
+        from ms_scanbatch_paper sp left join ms_scanbatch b on sp.batchid=b.batchid
66
+        left join ms_paper_student ps on ps.batchid=b.batchid
67
+        left join ms_class_student cs on cs.subjectid=ps.subjectid and ps.studentid=cs.studentid
68
+        left join ms_class c on cs.examid=c.examid and cs.subjectid=c.subjectid and cs.classid=c.classid
69
+        left join t_user u on ps.studentid=u.userid
70
+        where b.mpid=#{params.mpid}
71
+        <if test="params.batchid!=null and params.batchid!=0">
72
+            and b.batchid=#{params.batchid}
73
+        </if>
74
+        <if test="params.hasidentify!=null and params.hasidentify!=0 and params.hasidentify==1">
75
+            and sp.identified=1
76
+        </if>
77
+        <if test="params.hasidentify!=null and params.hasidentify!=0 and params.hasidentify==2">
78
+            and sp.identified=0
79
+        </if>
80
+        order by b.batchid,sp.mspid
81
+    </select>
82
+
30 83
 </mapper>

+ 27
- 0
smarking/src/main/resources/mapper/scan/MsScanbatchPaperBlockMapper.xml View File

@@ -1,4 +1,31 @@
1 1
 <?xml version="1.0" encoding="UTF-8"?>
2 2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3 3
 <mapper namespace="com.xhkjedu.smarking.mapper.scan.MsScanbatchPaperBlockMapper">
4
+    
5
+    <!--扫描记录-查看原卷-客观题-->
6
+    <resultMap id="objectiveQuestions" type="java.util.Map">
7
+        <result property="mspbid" column="mspbid"/>
8
+        <result property="mpblockid" column="mpblockid"/>
9
+        <result property="picpath" column="picpath"/>
10
+        <result property="extendpath" column="extendpath"/>
11
+        <result property="identifycont" column="identifycont"/>
12
+        <result property="msptype" column="msptype"/>
13
+        <collection property="questions" ofType="java.util.Map" javaType="java.util.ArrayList">
14
+            <result property="mspbqid" column="mspbqid"/>
15
+            <result property="mpsqmid" column="mpsqmid"/>
16
+            <result property="identifycont" column="identifycont"/>
17
+        </collection>
18
+    </resultMap>
19
+    <select id="listObjectiveQuestions" resultMap="objectiveQuestions">
20
+        select b.mspbid,b.mpblockid,b.picpath,b.extendpath,b.identifycont,b.msptype
21
+        ,q.mspbqid,q.mpsqmid,q.identifycont
22
+        from ms_scanbatch_paper_block b
23
+        left join ms_scanbatch_paper_block_question q on b.mspbid=q.mspbid
24
+        where b.mspid=#{mspid} and b.msptype=1 order by b.mspbid,q.mspbqid
25
+    </select>
26
+    <!--扫描记录-查看原卷-主观题-->
27
+    <select id="listSubjectiveQuestions" resultType="java.util.Map">
28
+        select b.mspbid,b.mpblockid,b.picpath,b.extendpath,b.identifycont,b.msptype
29
+        from ms_scanbatch_paper_block b where b.mspid=#{mspid} and b.msptype=2 order by b.mspbid
30
+    </select>
4 31
 </mapper>

+ 5
- 0
smarking/src/main/resources/mapper/scan/MsScanbatchPaperMapper.xml View File

@@ -5,4 +5,9 @@
5 5
     <select id="listPaperByBatchid" resultType="com.xhkjedu.smarking.model.scan.MsScanbatchPaper">
6 6
         select * from ms_scanbatch_paper where batchid = #{batchid} order by mspid
7 7
     </select>
8
+
9
+    <!--查看原卷-试卷信息-->
10
+    <select id="getScanPaperByMspid" resultType="java.util.Map">
11
+        select * from ms_scanbatch_paper where mspid = #{mspid}
12
+    </select>
8 13
 </mapper>

Loading…
Cancel
Save