Browse Source

原卷切割相关

ywx
王宁 3 weeks ago
parent
commit
6eb0b29da0

+ 65
- 0
smarking/src/main/java/com/xhkjedu/smarking/controller/paper/MsPaperController.java View File

@@ -4,8 +4,11 @@ import com.github.pagehelper.PageHelper;
4 4
 import com.github.pagehelper.PageInfo;
5 5
 import com.xhkjedu.annotation.Action;
6 6
 import com.xhkjedu.smarking.model.exam.MsSubject;
7
+import com.xhkjedu.smarking.model.paper.MsPaper;
7 8
 import com.xhkjedu.smarking.model.paper.MsPaperBack;
9
+import com.xhkjedu.smarking.model.paper.MsPaperFile;
8 10
 import com.xhkjedu.smarking.service.paper.MsPaperService;
11
+import com.xhkjedu.smarking.vo.paper.MsPaperParams;
9 12
 import com.xhkjedu.utils.N_Utils;
10 13
 import com.xhkjedu.utils.PageUtil;
11 14
 import com.xhkjedu.vo.PageResult;
@@ -76,4 +79,66 @@ public class MsPaperController {
76 79
         List<Map<String,Object>> list = msPaperService.listPaperBacksByEpid(paperBack.getMpid());
77 80
         return new ResultVo(0,"成功获取试卷退回原因",list);
78 81
     }
82
+
83
+    /*
84
+     * @Description 试卷试题-原卷试题及切割坐标
85
+     * @Date 2024/12/4 14:41:19
86
+     * @Author WN
87
+     * @Param [paperBack]
88
+     * @Return com.xhkjedu.vo.ResultVo
89
+     **/
90
+    @PostMapping("/que_coor")
91
+    public ResultVo listPaperQuestions(@RequestBody MsPaperBack paperBack){
92
+        N_Utils.validation(new Object[]{paperBack.getMpid(),"试卷id",1});
93
+        List<Map<String,Object>> list = msPaperService.listPaperQuestionCoors(paperBack.getMpid());
94
+        return new ResultVo(0,"成功获取试题",list);
95
+    }
96
+
97
+    /*
98
+     * @Description 试卷试题-保存切割
99
+     * @Date 2024/12/4 15:21:19
100
+     * @Author WN
101
+     * @Param [paperBack]
102
+     * @Return com.xhkjedu.vo.ResultVo
103
+     **/
104
+    @PostMapping("/que_cut")
105
+    public ResultVo updatePaperQuestionCoor(@RequestBody MsPaperParams params){
106
+        N_Utils.validation(new Object[]{params.getMpid(),"试卷id",1});
107
+        if(params.getQuestions() == null || params.getQuestions().size() == 0){
108
+            return new ResultVo(1,"未切割试题");
109
+        }
110
+        msPaperService.savePaperQuestionCoors(params);
111
+        return new ResultVo(0,"保存成功");
112
+    }
113
+
114
+    /*
115
+     * @Description 试卷文件-保存
116
+     * @Date 2024/10/17 16:01:07
117
+     * @Author WN
118
+     * @Param [paper]
119
+     * @Return com.xhkjedu.vo.ResultVo
120
+     **/
121
+    @PostMapping("/file_save")
122
+    public ResultVo savePaperFiles(@RequestBody MsPaper paper){
123
+        N_Utils.validation(new Object[]{paper.getMpid(),"试卷id",1});
124
+        List<MsPaperFile> pfiles = paper.getPfiles();
125
+        if(pfiles == null || pfiles.isEmpty()){
126
+            return new ResultVo(1,"未上传文件");
127
+        }
128
+        msPaperService.savePaperFiles(paper);
129
+        return new ResultVo(0,"保存成功");
130
+    }
131
+    /*
132
+     * @Description 试卷文件-删除
133
+     * @Date 2024/12/4 15:35:16
134
+     * @Author WN
135
+     * @Param [paper]
136
+     * @Return com.xhkjedu.vo.ResultVo
137
+     **/
138
+    @PostMapping("/file_del")
139
+    public ResultVo deletePaperFiles(@RequestBody MsPaper paper){
140
+        N_Utils.validation(new Object[]{paper.getMpid(),"试卷id",1});
141
+        msPaperService.deletePaperFiles(paper.getMpid());
142
+        return new ResultVo(0,"删除成功");
143
+    }
79 144
 }

+ 0
- 18
smarking/src/main/java/com/xhkjedu/smarking/controller/paper/MsPaperQtypeController.java View File

@@ -98,24 +98,6 @@ public class MsPaperQtypeController {
98 98
         return new ResultVo(0,"保存成功");
99 99
     }
100 100
 
101
-    /*
102
-     * @Description 试卷文件
103
-     * @Date 2024/10/17 16:01:07
104
-     * @Author WN
105
-     * @Param [paper]
106
-     * @Return com.xhkjedu.vo.ResultVo
107
-     **/
108
-    @PostMapping("/save_file")
109
-    public ResultVo savePaperFiles(@RequestBody MsPaper paper){
110
-        N_Utils.validation(new Object[]{paper.getMpid(),"试卷id",1});
111
-        List<MsPaperFile> pfiles = paper.getPfiles();
112
-        if(pfiles == null || pfiles.isEmpty()){
113
-            return new ResultVo(1,"未上传文件");
114
-        }
115
-        msPaperQtypeService.savePaperFiles(paper);
116
-        return new ResultVo(0,"保存成功");
117
-    }
118
-
119 101
     /*
120 102
      * @Description 试题知识点
121 103
      * @Date 2024/10/17 17:08:33

+ 4
- 0
smarking/src/main/java/com/xhkjedu/smarking/mapper/paper/MsPaperMapper.java View File

@@ -67,4 +67,8 @@ public interface MsPaperMapper extends TkMapper<MsPaper> {
67 67
 
68 68
     //获取试卷类型
69 69
     Integer getPaperTypeByMpsid(@Param("mpsid") Integer mpsid);
70
+    //修改试卷切割状态
71
+    int updatePaperCutState(@Param("mpid") Integer mpid, @Param("cutstate") Integer cutstate);
72
+    //获取试卷切割状态
73
+    Integer getPaperCutStateByMpid(@Param("mpid") Integer mpid);
70 74
 }

+ 7
- 0
smarking/src/main/java/com/xhkjedu/smarking/mapper/paper/MsPaperQtypeQuestionMapper.java View File

@@ -6,6 +6,7 @@ import com.xhkjedu.smarking.vo.paper.MsPaperParams;
6 6
 import org.apache.ibatis.annotations.Param;
7 7
 
8 8
 import java.util.List;
9
+import java.util.Map;
9 10
 
10 11
 /**
11 12
  * @Description 阅卷试卷题型试题表 Mapper 接口
@@ -47,5 +48,11 @@ public interface MsPaperQtypeQuestionMapper extends TkMapper<MsPaperQtypeQuestio
47 48
     int getQuesnumByMptid(@Param("mptid")Integer mptid);
48 49
     //试题移动-获取要交换位置的试题
49 50
     MsPaperQtypeQuestion getQuestionForMoverOrder(@Param("p")MsPaperParams p);
51
+    //获取试卷中所有试题-页面展示
52
+    List<Map<String,Object>> listQuestionsForShow(@Param("mpid")Integer mpid);
53
+    //批量设置试题框选坐标
54
+    int updateBatchQuestionCoor(@Param("list") List<MsPaperQtypeQuestion> list);
55
+    //清空试题切割坐标
56
+    int updateQuestionCoorByMpid(@Param("mpid")Integer mpid);
50 57
 
51 58
 }

+ 2
- 0
smarking/src/main/java/com/xhkjedu/smarking/model/paper/MsPaper.java View File

@@ -43,6 +43,8 @@ public class MsPaper extends BaseBean {
43 43
     private Integer hearnum;
44 44
     //听力题文件地址(附件试卷)
45 45
     private String hearfile;
46
+    //原卷切割状态0未切割1已切割
47
+    private Integer cutstate;
46 48
     //创建人ID
47 49
     private Integer createid;
48 50
     //创建时间

+ 7
- 0
smarking/src/main/java/com/xhkjedu/smarking/model/paper/MsPaperQtypeQuestion.java View File

@@ -49,6 +49,13 @@ public class MsPaperQtypeQuestion extends BaseBean {
49 49
     private Integer scoreset;
50 50
     //试题难易度
51 51
     private Integer complexity;
52
+    //第几张图
53
+    private Integer pagenum;
54
+    //题干区域坐标
55
+    private String stemcoor;
56
+    //试题区域坐标
57
+    private String quecoor;
58
+
52 59
 
53 60
     //试题知识点
54 61
     @Transient

+ 1
- 0
smarking/src/main/java/com/xhkjedu/smarking/service/exam/MsExamService.java View File

@@ -107,6 +107,7 @@ public class MsExamService {
107 107
             p.setHasfile(0);
108 108
             p.setHearnum(0);
109 109
             p.setCorrecttype(0);
110
+            p.setCutstate(0);
110 111
             papers.add(p);
111 112
         }
112 113
         msSubjectMapper.insertList(subjects);//考试科目

+ 578
- 593
smarking/src/main/java/com/xhkjedu/smarking/service/paper/MsPaperQtypeService.java
File diff suppressed because it is too large
View File


+ 113
- 8
smarking/src/main/java/com/xhkjedu/smarking/service/paper/MsPaperService.java View File

@@ -3,15 +3,26 @@ package com.xhkjedu.smarking.service.paper;
3 3
 import com.xhkjedu.exception.MissingParametersException;
4 4
 import com.xhkjedu.smarking.mapper.exam.MsSubjectMapper;
5 5
 import com.xhkjedu.smarking.mapper.paper.MsPaperBackMapper;
6
+import com.xhkjedu.smarking.mapper.paper.MsPaperFileMapper;
6 7
 import com.xhkjedu.smarking.mapper.paper.MsPaperMapper;
8
+import com.xhkjedu.smarking.mapper.paper.MsPaperQtypeQuestionMapper;
9
+import com.xhkjedu.smarking.mapper.system.SchoolMapper;
10
+import com.xhkjedu.smarking.model.paper.MsPaper;
7 11
 import com.xhkjedu.smarking.model.paper.MsPaperBack;
12
+import com.xhkjedu.smarking.model.paper.MsPaperFile;
13
+import com.xhkjedu.smarking.utils.MarkingUtil;
14
+import com.xhkjedu.smarking.vo.paper.MsPaperParams;
15
+import com.xhkjedu.smarking.vo.paper.PaperFileVo;
16
+import com.xhkjedu.smarking.vo.system.SchoolCloudVo;
8 17
 import com.xhkjedu.utils.N_Utils;
18
+import lombok.extern.slf4j.Slf4j;
9 19
 import org.springframework.stereotype.Service;
10 20
 import org.springframework.transaction.annotation.Transactional;
11 21
 
12 22
 import javax.annotation.Resource;
13 23
 import java.util.List;
14 24
 import java.util.Map;
25
+import java.util.stream.Collectors;
15 26
 
16 27
 /**
17 28
  * @Description 阅卷试卷表 服务实现类
@@ -19,6 +30,7 @@ import java.util.Map;
19 30
  * @Date 2024-10-15
20 31
  */
21 32
 @Service
33
+@Slf4j
22 34
 public class MsPaperService {
23 35
     @Resource
24 36
     private MsPaperMapper msPaperMapper;
@@ -26,6 +38,12 @@ public class MsPaperService {
26 38
     private MsPaperBackMapper msPaperBackMapper;
27 39
     @Resource
28 40
     private MsSubjectMapper msSubjectMapper;
41
+    @Resource
42
+    private MsPaperQtypeQuestionMapper msPaperQtypeQuestionMapper;
43
+    @Resource
44
+    private MsPaperFileMapper msPaperFileMapper;
45
+    @Resource
46
+    private SchoolMapper schoolMapper;
29 47
 
30 48
     /*
31 49
      * @Description 列表--教师出卷
@@ -34,10 +52,10 @@ public class MsPaperService {
34 52
      * @Param [teacherid, esstate]
35 53
      * @Return java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
36 54
      **/
37
-    public List<Map<String,Object>> listExamPapersByTeacherid(Integer teacherid, Integer pstate){
55
+    public List<Map<String, Object>> listExamPapersByTeacherid(Integer teacherid, Integer pstate) {
38 56
         int timestamp = N_Utils.getSecondTimestamp();
39 57
         String strtime = N_Utils.getStrtimeTimestamp(timestamp, "yyyy-MM-dd HH:mm:ss");
40
-        return msPaperMapper.listExamPapersByTeacherid(teacherid,pstate,strtime);
58
+        return msPaperMapper.listExamPapersByTeacherid(teacherid, pstate, strtime);
41 59
     }
42 60
 
43 61
     /*
@@ -50,12 +68,12 @@ public class MsPaperService {
50 68
     @Transactional(rollbackFor = Exception.class)
51 69
     public void savePaperBack(MsPaperBack paperBack) {
52 70
         Integer examstate = msPaperMapper.getExamStateByMpid(paperBack.getMpid());
53
-        if (examstate == 1 ) throw new MissingParametersException("考试已开始禁止操作");
54
-        if (examstate >= 2 ) throw new MissingParametersException("考试已结束禁止操作");
71
+        if (examstate == 1) throw new MissingParametersException("考试已开始禁止操作");
72
+        if (examstate >= 2) throw new MissingParametersException("考试已结束禁止操作");
55 73
         int timestamp = N_Utils.getSecondTimestamp();
56 74
         paperBack.setCreatetime(timestamp);
57 75
         msPaperBackMapper.insertUseGeneratedKeys(paperBack);
58
-        //更改试卷科目状态
76
+        // 更改试卷科目状态
59 77
         msSubjectMapper.updatePstateByMpid(paperBack.getMpid(), 3);
60 78
     }
61 79
 
@@ -66,13 +84,100 @@ public class MsPaperService {
66 84
      * @Param [mpid]
67 85
      * @Return java.util.List<java.util.Map>
68 86
      **/
69
-    public List<Map<String,Object>> listPaperBacksByEpid(Integer mpid){
87
+    public List<Map<String, Object>> listPaperBacksByEpid(Integer mpid) {
70 88
         return msPaperBackMapper.listPaperBacksByMpid(mpid);
71 89
     }
72 90
 
73
-    //获取考试ID
74
-    public Integer getExamidByMpid(Integer mpid){
91
+    // 获取考试ID
92
+    public Integer getExamidByMpid(Integer mpid) {
75 93
         return msPaperMapper.getExamidByMpid(mpid);
76 94
     }
77 95
 
96
+    /*
97
+     * @Description 试卷试题-获取试卷中所有试题题号及坐标
98
+     * @Date 2024/12/4 14:39:15
99
+     * @Author WN
100
+     * @Param [mpid]
101
+     * @Return java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
102
+     **/
103
+    public List<Map<String, Object>> listPaperQuestionCoors(Integer mpid) {
104
+        return msPaperQtypeQuestionMapper.listQuestionsForShow(mpid);
105
+    }
106
+
107
+    /*
108
+     * @Description 试卷试题-保存切割
109
+     * @Date 2024/12/4 15:20:31
110
+     * @Author WN
111
+     * @Param [params]
112
+     * @Return void
113
+     **/
114
+    @Transactional(rollbackFor = Exception.class)
115
+    public void savePaperQuestionCoors(MsPaperParams params) {
116
+        // 保存试题切割信息
117
+        msPaperQtypeQuestionMapper.updateBatchQuestionCoor(params.getQuestions());
118
+        // 保存试卷切割状态
119
+        msPaperMapper.updatePaperCutState(params.getMpid(), 1);
120
+    }
121
+
122
+    /*
123
+     * @Description 试卷原卷-保存
124
+     * @Date 2024/10/17 16:00:37
125
+     * @Author WN
126
+     * @Param [paper]
127
+     * @Return com.xhkjedu.vo.ResultVo
128
+     **/
129
+    @Transactional(rollbackFor = Exception.class)
130
+    public void savePaperFiles(MsPaper paper) {
131
+        Integer mpid = paper.getMpid();
132
+        List<MsPaperFile> pfiles = paper.getPfiles();
133
+        // 删除已保存主观题答案图片
134
+        msPaperFileMapper.deleteByMpidAndType(mpid, 1);
135
+        Integer timestamp = N_Utils.getSecondTimestamp();
136
+        PaperFileVo paperFileVo = null;
137
+        if (pfiles.get(0).getFilepath().contains("base64,")) {
138
+            List<String> base64list = pfiles.stream().map(MsPaperFile::getFilepath).collect(Collectors.toList());
139
+
140
+            SchoolCloudVo schoolCloudVo = schoolMapper.getSchoolCloudcode(mpid);
141
+            String saveFloder = schoolCloudVo.getCloudcode() + "/" + schoolCloudVo.getSchoolid() + "/marking/paper/";
142
+            paperFileVo = MarkingUtil.uploadBatchBase64ImgPdf(base64list, saveFloder);
143
+        }
144
+
145
+        for (int i = 0; i < pfiles.size(); i++) {
146
+            MsPaperFile pf = pfiles.get(i);
147
+            pf.setMpid(mpid);
148
+            pf.setCreateid(paper.getCreateid());
149
+            pf.setCreatetime(timestamp);
150
+            pf.setFiletype(1);
151
+            pf.setFileorder(i + 1);
152
+            if (paperFileVo != null) {
153
+                pf.setSourcepath(paperFileVo.getPdfpath());
154
+                pf.setFilepath(paperFileVo.getImgs().get(i));
155
+            }
156
+        }
157
+        paper.setHasfile(1);
158
+        msPaperMapper.updateByPrimaryKeySelective(paper);
159
+        msPaperFileMapper.insertList(pfiles);
160
+    }
161
+
162
+
163
+    /*
164
+     * @Description 试卷原卷-删除
165
+     * @Date 2024/12/4 15:34:23
166
+     * @Author WN
167
+     * @Param [mpid]
168
+     * @Return void
169
+     **/
170
+    @Transactional(rollbackFor = Exception.class)
171
+    public void deletePaperFiles(Integer mpid) {
172
+        // 删除试卷文件
173
+        msPaperFileMapper.deleteByMpidAndType(mpid, 1);
174
+        // 获取试卷切割状态
175
+        Integer cutstate = msPaperMapper.getPaperCutStateByMpid(mpid);
176
+        if (N_Utils.isTrueInteger(cutstate)) {
177
+            // 说明试卷已切割,清除切割信息
178
+            msPaperMapper.updatePaperCutState(mpid, 0);// 保存试卷切割状态
179
+            msPaperQtypeQuestionMapper.updateQuestionCoorByMpid(mpid);// 清除试题切割信息
180
+        }
181
+    }
182
+
78 183
 }

+ 15
- 6
smarking/src/main/java/com/xhkjedu/smarking/utils/MarkingUtil.java View File

@@ -3,6 +3,7 @@ package com.xhkjedu.smarking.utils;
3 3
 import com.alibaba.fastjson.JSON;
4 4
 import com.alibaba.fastjson.JSONArray;
5 5
 import com.xhkjedu.smarking.config.ConfigKey;
6
+import com.xhkjedu.smarking.vo.paper.PaperFileVo;
6 7
 import com.xhkjedu.utils.N_Utils;
7 8
 import com.xhkjedu.vo.ResultVo;
8 9
 import lombok.extern.slf4j.Slf4j;
@@ -310,21 +311,29 @@ public class MarkingUtil {
310 311
     }
311 312
 
312 313
     /*
313
-     * @Description 批量上传base64图片
314
+     * @Description 批量上传base64图片,返回图片地址及合并后地址(用于试卷上传)
314 315
      * @Date 2024/10/30 15:09:05
315 316
      * @Author WN
316 317
      * @Param [stupic, saveFloder]
317 318
      * @Return java.util.List<java.lang.String>
318 319
      **/
319
-    public static List<String> uploadBatchBase64Img(List<String> imgList,String saveFloder){
320
+    public static PaperFileVo uploadBatchBase64ImgPdf(List<String> imgList, String saveFloder){
320 321
         //处理字段那种图片路径,base64转图片
321
-        String params = "filepaths=" + imgList + "&savefolder=" + saveFloder;
322
-        String fileInfoStr = N_Utils.sendPost(ConfigKey.fileapi + "bs/mbase", params);
322
+        String base64path = JSON.toJSONString(imgList);
323
+        try {
324
+            base64path = URLEncoder.encode(base64path, "UTF-8");
325
+        } catch (UnsupportedEncodingException e) {
326
+            log.error("试卷原卷base64格式化内容出错" + e.getMessage());
327
+            throw new RuntimeException(e);
328
+        }
329
+
330
+        String params = "base64path=" + base64path + "&savefolder=" + saveFloder + "&column=1";
331
+        String fileInfoStr = N_Utils.sendPost(ConfigKey.fileapi + "bs/more_pdf", params);
323 332
         ResultVo fileResult = JSON.parseObject(fileInfoStr, ResultVo.class);
324 333
         if (fileResult.getCode() == 0 && N_Utils.isNotEmpty(fileResult.getObj())) {
325
-            return JSONArray.parseArray(fileResult.getObj().toString(), String.class);
334
+            return JSONArray.parseObject(fileResult.getObj().toString(), PaperFileVo.class);
326 335
         }else{
327
-            return new ArrayList<>();
336
+            return null;
328 337
         }
329 338
     }
330 339
 

+ 3
- 0
smarking/src/main/java/com/xhkjedu/smarking/vo/paper/MsPaperParams.java View File

@@ -1,6 +1,7 @@
1 1
 package com.xhkjedu.smarking.vo.paper;
2 2
 
3 3
 import com.xhkjedu.smarking.model.paper.MsPaperBlock;
4
+import com.xhkjedu.smarking.model.paper.MsPaperQtypeQuestion;
4 5
 import com.xhkjedu.smarking.model.paper.MsTemplateBlock;
5 6
 import lombok.Data;
6 7
 
@@ -28,4 +29,6 @@ public class MsPaperParams {
28 29
 
29 30
     private Integer movetype;//移动类型1上移2下移
30 31
     private Integer movevalue;//移动值
32
+
33
+    private List<MsPaperQtypeQuestion> questions;//试题列表
31 34
 }

+ 18
- 0
smarking/src/main/java/com/xhkjedu/smarking/vo/paper/PaperFileVo.java View File

@@ -0,0 +1,18 @@
1
+package com.xhkjedu.smarking.vo.paper;
2
+
3
+import lombok.Data;
4
+
5
+import java.util.List;
6
+
7
+/**
8
+ * @Description:试卷文件
9
+ * @Author: WN
10
+ * @Date: 2024/12/4 16:12:35
11
+ **/
12
+@Data
13
+public class PaperFileVo {
14
+
15
+    private String pdfpath; //试卷pdf路径
16
+
17
+    private List<String> imgs; //试卷图片路径列表
18
+}

+ 2
- 2
smarking/src/main/resources/application.properties View File

@@ -3,8 +3,8 @@ server.port=8090
3 3
 spring.application.name=smarking
4 4
 #\u6CE8\u518C\u5230\u6211\u4EEC\u672C\u5730\u7684eureka\u6CE8\u518C\u4E2D\u5FC3\uFF0C\u7AEF\u53E38081
5 5
 eureka.client.service-url.defaultZone=http://xhschool:Xhkjedud07@127.0.0.1:8081/eureka/
6
-eureka.client.register-with-eureka=true
7
-eureka.client.fetch-registry=true
6
+eureka.client.register-with-eureka=false
7
+eureka.client.fetch-registry=false
8 8
 #\u8BBE\u7F6Eeureka\u8F93\u51FA\u65E5\u5FD7\u7EA7\u522B
9 9
 logging.level.com.netflix=error
10 10
 

+ 1
- 1
smarking/src/main/resources/mapper/exam/MsSubjectMapper.xml View File

@@ -12,7 +12,7 @@
12 12
     <!--考试进度总览-->
13 13
     <select id="examOverview" resultType="java.util.Map">
14 14
         select s.msid,s.subjectid,s.subjectname,s.sdate,s.begintime,s.endtime,s.msstate,s.pstate,s.ptstate,
15
-        s.pbstate,s.checkset,s.checkstate,s.invigilatestate,p.answered,p.ptype,s.teacherid,
15
+        s.pbstate,s.checkset,s.checkstate,s.invigilatestate,p.answered,p.ptype,p.cutstate,s.teacherid,
16 16
         u.username as teachername,p.mpid,p.hasfile,e.exammode,e.examstate,e.hashb,e.gradeid,s.leaderid,u2.username as leadername
17 17
         ,if(ps.batchid is not null,ps.mpsid,null) scannum,count(ps.mpsid) stunum
18 18
         from ms_subject s left join t_user u on s.teacherid=u.userid

+ 9
- 0
smarking/src/main/resources/mapper/paper/MsPaperMapper.xml View File

@@ -117,4 +117,13 @@
117 117
     <select id="getPaperTypeByMpsid" resultType="java.lang.Integer">
118 118
         select p.ptype from ms_paper p left join ms_paper_student ps on p.mpid=ps.mpid where ps.mpsid=#{mpsid}
119 119
     </select>
120
+
121
+    <!--修改试卷切割状态-->
122
+    <update id="updatePaperCutState">
123
+        update ms_paper set cutstate=#{cutstate} where mpid=#{mpid}
124
+    </update>
125
+    <!--获取试卷切割状态-->
126
+    <select id="getPaperCutStateByMpid" resultType="java.lang.Integer">
127
+        select cutstate from ms_paper where mpid=#{mpid}
128
+    </select>
120 129
 </mapper>

+ 22
- 2
smarking/src/main/resources/mapper/paper/MsPaperQtypeQuestionMapper.xml View File

@@ -64,7 +64,9 @@
64 64
 
65 65
     <!--试卷中所有试题基础信息-->
66 66
     <select id="listQuestionsByMpid" resultType="com.xhkjedu.smarking.model.paper.MsPaperQtypeQuestion">
67
-        select * from ms_paper_qtype_question where mpid=#{mpid} order by qorder
67
+        select q.* from ms_paper_qtype_question q
68
+        left join ms_paper_qtype t on q.mptid=t.mptid and q.mpid=t.mpid
69
+        where q.mpid=#{mpid} order by t.mptorder,q.qorder
68 70
     </select>
69 71
 
70 72
     <!--清空试题难易度-->
@@ -99,7 +101,7 @@
99 101
 
100 102
     <!--获取试卷中所有试题排序-->
101 103
     <select id="listQuesOrderByMpid" resultType="com.xhkjedu.smarking.model.paper.MsPaperQtypeQuestion">
102
-        select q.mptqid,q.qn,q.qorder from ms_paper_qtype_question q
104
+        select q.mptqid,q.qn,q.qorder,q.qscore from ms_paper_qtype_question q
103 105
         left join ms_paper_qtype t on q.mptid=t.mptid and q.mpid=t.mpid
104 106
         where q.mpid=#{mpid} order by t.mptorder,q.qorder
105 107
     </select>
@@ -114,4 +116,22 @@
114 116
         select mptqid,qorder from ms_paper_qtype_question where mpid=#{p.mpid} and qorder=(
115 117
                 (select qorder from ms_paper_qtype_question where mptqid=#{p.mptqid})+(#{p.movevalue}))
116 118
     </select>
119
+
120
+    <!--获取试卷中所有试题-页面展示-->
121
+    <select id="listQuestionsForShow" resultType="java.util.Map">
122
+        select q.mptqid,q.qn,q.qorder,q.qscore,q.pagenum,q.stemcoor,q.quecoor,t.mptqn,t.mptorder from ms_paper_qtype_question q
123
+        left join ms_paper_qtype t on q.mptid=t.mptid and q.mpid=t.mpid
124
+        where q.mpid=#{mpid} order by t.mptorder,q.qorder
125
+    </select>
126
+
127
+    <!--批量设置试题切割坐标-->
128
+    <update id="updateBatchQuestionCoor">
129
+        <foreach collection="list" item="q" separator=",">
130
+            update ms_paper_qtype_question set pagenum=#{q.pagenum},stemcoor=#{q.stemcoor},quecoor=#{q.quecoor} where mptqid=#{q.mptqid}
131
+        </foreach>
132
+    </update>
133
+    <!--清空试题切割坐标-->
134
+    <update id="updateQuestionCoorByMpid">
135
+        update ms_paper_qtype_question set pagenum=0,stemcoor=null,quecoor=null where mpid=#{mpid}
136
+    </update>
117 137
 </mapper>

Loading…
Cancel
Save