Browse Source

扫描答题卡时直接上传base64

答题卡模块转pdf
ywx
王宁 2 months ago
parent
commit
73463a09cf

+ 6
- 0
sapi/src/main/java/com/xhkjedu/sapi/mapper/scantron/ScantronMapper.java View File

@@ -2,6 +2,7 @@ package com.xhkjedu.sapi.mapper.scantron;
2 2
 
3 3
 import com.xhkjedu.base.TkMapper;
4 4
 import com.xhkjedu.sapi.model.scantron.TScantron;
5
+import com.xhkjedu.sapi.model.system.TSchool;
5 6
 import org.apache.ibatis.annotations.Param;
6 7
 
7 8
 import java.util.List;
@@ -20,4 +21,9 @@ public interface ScantronMapper extends TkMapper<TScantron> {
20 21
     //修改答题卡公开状态
21 22
     int updateScantronPubliched(@Param("sid")int sid, @Param("publiched")int publiched);
22 23
 
24
+    //获取答题卡所在学校区域信息
25
+    TSchool getSchoolCloudByScanid(@Param("sid")int sid);
26
+
27
+    //更改pdf地址
28
+    Integer updatePdfpath(@Param("sid")int sid, @Param("pdfpath")String pdfpath);
23 29
 }

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

@@ -1,8 +1,13 @@
1 1
 package com.xhkjedu.sapi.service.scantron;
2 2
 
3
+import com.alibaba.fastjson.JSON;
4
+import com.alibaba.fastjson.JSONArray;
5
+import com.xhkjedu.sapi.config.ConfigKey;
3 6
 import com.xhkjedu.sapi.mapper.scantron.ScantronMapper;
4 7
 import com.xhkjedu.sapi.model.scantron.TScantron;
8
+import com.xhkjedu.sapi.model.system.TSchool;
5 9
 import com.xhkjedu.utils.N_Utils;
10
+import com.xhkjedu.vo.ResultVo;
6 11
 import org.springframework.stereotype.Service;
7 12
 
8 13
 import javax.annotation.Resource;
@@ -38,8 +43,30 @@ public class ScantronService {
38 43
         }else{
39 44
             tScantron.setPapertype(2);
40 45
         }
46
+        String base64Path = tScantron.getPdfpath();
47
+        tScantron.setPdfpath(null);
41 48
         scantronMapper.insertSelective(tScantron);
49
+
50
+        Integer sid = tScantron.getId();
51
+        String pdfpath = saveScantronPdf(base64Path,sid,tScantron.getSlayout());
52
+        scantronMapper.updatePdfpath(sid,pdfpath);//更改转为路径的pdf地址
53
+    }
54
+
55
+    //答题卡-保存pdf
56
+    private String saveScantronPdf(String pdfpath,Integer sid,Integer column){
57
+        TSchool school = scantronMapper.getSchoolCloudByScanid(sid);
58
+        List<String> imgList = JSONArray.parseArray(pdfpath, String.class);
59
+        String savefloder = school.getCloudcode() + "/" + school.getSchoolid() + "/scantron/";
60
+        String params = "filepaths=" + imgList + "&savefloder=" + savefloder + "&column=" + column + "&filename=" + sid;
61
+        String fileInfoStr = N_Utils.sendPost(ConfigKey.fileapi + "ba/topdf", params);
62
+        ResultVo fileResult = JSON.parseObject(fileInfoStr, ResultVo.class);
63
+        if (fileResult.getCode() == 0 && N_Utils.isNotEmpty(fileResult.getObj())) {
64
+            return fileResult.getObj().toString();
65
+        }else{
66
+            return "";
67
+        }
42 68
     }
69
+
43 70
     //答题卡-修改
44 71
     public void update(TScantron tScantron){
45 72
         if(N_Utils.isTrueInteger(tScantron.getSlayout()) && tScantron.getSlayout() > 1){
@@ -47,6 +74,14 @@ public class ScantronService {
47 74
         }else{
48 75
             tScantron.setPapertype(2);
49 76
         }
77
+
78
+        TScantron oldScantron = scantronMapper.selectByPrimaryKey(tScantron.getSid());
79
+        if(!oldScantron.getPdfpath().equals(tScantron.getPdfpath())){
80
+            String base64Path = tScantron.getPdfpath();
81
+            String pdfpath = saveScantronPdf(base64Path,tScantron.getSid(),tScantron.getSlayout());
82
+            tScantron.setPdfpath(pdfpath);
83
+        }
84
+
50 85
         scantronMapper.updateByPrimaryKeySelective(tScantron);
51 86
     }
52 87
 

+ 12
- 0
sapi/src/main/resources/mapper/scantron/ScantronMapper.xml View File

@@ -27,4 +27,16 @@
27 27
     <update id="updateScantronPubliched">
28 28
         update t_scantron set publiched=#{publiched} where sid=#{sid}
29 29
     </update>
30
+
31
+    <!--获取答题卡所在学校区域信息-->
32
+    <select id="getSchoolCloudByScanid" resultType="com.xhkjedu.sapi.model.system.TSchool">
33
+        select schoolid,(select cloudcode from t_cloud order by cloudid limit 1) cloudcode
34
+        from t_scantron where sid=#{sid}
35
+    </select>
36
+
37
+    <!--更改pdf地址-->
38
+    <update id="updatePdfpath">
39
+        update t_scantron set pdfpath=#{pdfpath} where sid=#{sid}
40
+    </update>
41
+
30 42
 </mapper>

+ 6
- 0
smarking/src/main/java/com/xhkjedu/smarking/config/ConfigKey.java View File

@@ -53,4 +53,10 @@ public class ConfigKey {
53 53
         //Spring Boot注解读取application.properties或者application-{profile}.properties文件时默认的是ISO_8859_1编码,中文会乱码
54 54
         ConfigKey.signName = new String(signName.getBytes("ISO_8859_1"),"UTF-8");
55 55
     }
56
+
57
+    public static String fileapi;//文件服务地址
58
+    @Value("${fileapi}")
59
+    public void setFileapi(String fileapi) {
60
+        ConfigKey.fileapi = fileapi;
61
+    }
56 62
 }

+ 37
- 26
smarking/src/main/java/com/xhkjedu/smarking/listener/MessageConsumer.java View File

@@ -1,16 +1,27 @@
1 1
 package com.xhkjedu.smarking.listener;
2 2
 
3
+import com.alibaba.fastjson.JSON;
4
+import com.xhkjedu.smarking.mapper.stupaper.MsPaperStudentQuestionMapper;
5
+import com.xhkjedu.smarking.model.stupaper.MsPaperStudentQuestion;
3 6
 import com.xhkjedu.smarking.utils.ConvertUtil;
4 7
 import lombok.extern.slf4j.Slf4j;
8
+import org.springframework.amqp.core.Message;
9
+import org.springframework.amqp.rabbit.annotation.RabbitHandler;
10
+import org.springframework.amqp.rabbit.annotation.RabbitListener;
5 11
 import org.springframework.beans.factory.annotation.Autowired;
6 12
 import org.springframework.stereotype.Component;
7 13
 
14
+import javax.annotation.Resource;
15
+import java.time.LocalDateTime;
16
+
8 17
 /**
9 18
  * 消息到达消费者监听类
10 19
  */
11 20
 @Component
12 21
 @Slf4j
13 22
 public class MessageConsumer {
23
+    @Resource
24
+    private MsPaperStudentQuestionMapper msPaperStudentQuestionMapper;
14 25
 
15 26
 
16 27
     @Autowired
@@ -18,29 +29,29 @@ public class MessageConsumer {
18 29
 
19 30
 
20 31
     /*
21
-     * @Description 学生题块、试题答案图片合并完处理转换状态
32
+     * @Description 学生试题答案图片合并完处理转换状态
22 33
      * @Date 2024/10/29 14:43:39
23 34
      * @Author WN
24 35
      * @Param [message]
25 36
      * @Return void
26 37
      **/
27
-    // @RabbitHandler
28
-    // @RabbitListener(queues = "${rabbitmq.markingImgMergeHandleQueue}")
29
-    // public void imgMergeHandleQueue(Message message) {
30
-    //     try {
31
-    //         String msg = new String(message.getBody(), "UTF-8");
32
-    //         System.out.println(LocalDateTime.now() + "学生题块、试题答案合并接收消息内容:" + msg);
33
-    //         EPaperStudentQuestion psq = JSON.parseObject(msg, EPaperStudentQuestion.class);
34
-    //         if (psq.getConverted() != 1) {//合并失败不修改学生答案
35
-    //             psq.setStuanswer(null);
36
-    //         } else {
37
-    //             psq.setStuanswer(JSON.toJSONString(new String[]{psq.getStuanswer()}));
38
-    //         }
39
-    //         ePaperStudentQuestionMapper.updateByPrimaryKeySelective(psq);
40
-    //     } catch (Exception e) {
41
-    //         log.error("学生试题答案合并失败:" + e.getMessage());
42
-    //     }
43
-    // }
38
+    @RabbitHandler
39
+    @RabbitListener(queues = "${rabbitmq.markingImgMergeHandleQueue}")
40
+    public void imgMergeHandleQueue(Message message) {
41
+        try {
42
+            String msg = new String(message.getBody(), "UTF-8");
43
+            System.out.println(LocalDateTime.now() + "学生试题答案合并接收消息内容:" + msg);
44
+            MsPaperStudentQuestion psq = JSON.parseObject(msg, MsPaperStudentQuestion.class);
45
+            if (psq.getConverted() != 1) {//合并失败不修改学生答案
46
+                psq.setStuanswer(null);
47
+            } else {
48
+                psq.setStuanswer(JSON.toJSONString(new String[]{psq.getStuanswer()}));
49
+            }
50
+            msPaperStudentQuestionMapper.updateByPrimaryKeySelective(psq);
51
+        } catch (Exception e) {
52
+            log.error("学生试题答案合并失败:" + e.getMessage());
53
+        }
54
+    }
44 55
 
45 56
     /**
46 57
      * @Description 修改试卷答题卡pdf
@@ -85,7 +96,7 @@ public class MessageConsumer {
85 96
     // }
86 97
 
87 98
     /**
88
-     * @Description 考试附件试卷图片转pdf
99
+     * @Description 阅卷附件试卷图片转pdf
89 100
      * @Param [message]
90 101
      * @Return void
91 102
      * @Author wn
@@ -96,13 +107,13 @@ public class MessageConsumer {
96 107
     // public void examImageToPdfHandleQueue(Message message) {
97 108
     //     try {
98 109
     //         String msg = new String(message.getBody(), "UTF-8");
99
-    //         System.out.println(LocalDateTime.now() + "考试附件试卷图片转pdf接收消息内容:" + msg);
110
+    //         System.out.println(LocalDateTime.now() + "阅卷附件试卷图片转pdf接收消息内容:" + msg);
100 111
     //         EPaperFile paperFile = JSON.parseObject(msg, EPaperFile.class);
101 112
     //         if (paperFile.getConverted() != null && paperFile.getConverted() == 1) {
102 113
     //             ePaperFileMapper.updateSourcepathByEpid(paperFile.getEpid(),paperFile.getSourcepath());
103 114
     //         }
104 115
     //     } catch (Exception e) {
105
-    //         log.error("考试附件试卷图片转pdf失败:" + e.getMessage());
116
+    //         log.error("阅卷附件试卷图片转pdf失败:" + e.getMessage());
106 117
     //     }
107 118
     // }
108 119
 
@@ -111,15 +122,15 @@ public class MessageConsumer {
111 122
     // public void examHtmlToPdfHandleQueue(Message message) {
112 123
     //     try {
113 124
     //         String msg = new String(message.getBody(), "UTF-8");
114
-    //         System.out.println(LocalDateTime.now() + "考试报告html转pdf接收消息内容:" + msg);
125
+    //         System.out.println(LocalDateTime.now() + "阅卷报告html转pdf接收消息内容:" + msg);
115 126
     //         EReportVo report = JSON.parseObject(msg, EReportVo.class);
116 127
     //         if (report.getConverted() != null && report.getConverted() != 1) return;
117
-    //         eReportGenerateMapper.updatePdf(report);//修改考试pdf地址
128
+    //         eReportGenerateMapper.updatePdf(report);//修改阅卷pdf地址
118 129
     //         Integer examid = report.getExamid();
119 130
     //         Integer type = report.getType();
120 131
     //         if (3 == type) {
121 132
     //             Integer classid = report.getClassid();
122
-    //             Integer num = eReportGenerateMapper.getNoPdfNumByExamAndClassId(examid, classid);//考试班级未生成pdf的数量
133
+    //             Integer num = eReportGenerateMapper.getNoPdfNumByExamAndClassId(examid, classid);//阅卷班级未生成pdf的数量
123 134
     //             if (0 == num) {
124 135
     //                 Map map = new HashMap();
125 136
     //                 String savefolder = eReportGenerateMapper.getSaveFolder(examid);
@@ -130,13 +141,13 @@ public class MessageConsumer {
130 141
     //                 convertUtil.htmlToPdf(map);
131 142
     //             }
132 143
     //         } else if (4 == type) {
133
-    //             Integer num = eReportGenerateMapper.getNoPdfNumByExamId(examid);//考试未生成pdf的数量
144
+    //             Integer num = eReportGenerateMapper.getNoPdfNumByExamId(examid);//阅卷未生成pdf的数量
134 145
     //             if (0 == num) {
135 146
     //                 eBaseMapper.updateExamReportState(examid, 2);
136 147
     //             }
137 148
     //         }
138 149
     //     } catch (Exception e) {
139
-    //         log.error("考试报告html转pdf失败:" + e.getMessage());
150
+    //         log.error("阅卷报告html转pdf失败:" + e.getMessage());
140 151
     //     }
141 152
     // }
142 153
 }

+ 6
- 0
smarking/src/main/java/com/xhkjedu/smarking/mapper/system/SchoolMapper.java View File

@@ -1,5 +1,8 @@
1 1
 package com.xhkjedu.smarking.mapper.system;
2 2
 
3
+import com.xhkjedu.smarking.vo.system.SchoolCloudVo;
4
+import org.apache.ibatis.annotations.Param;
5
+
3 6
 public interface SchoolMapper {
4 7
 
5 8
     //获取学校当前年份
@@ -7,4 +10,7 @@ public interface SchoolMapper {
7 10
 
8 11
     //获取用户当前年份
9 12
     Integer getYearByUserId(Integer userid);
13
+
14
+    //获取考试对应区域码和学校id
15
+    SchoolCloudVo getSchoolCloudcode(@Param("mpid")Integer mpid);
10 16
 }

+ 56
- 17
smarking/src/main/java/com/xhkjedu/smarking/service/scan/MsScanbatchPaperService.java View File

@@ -1,6 +1,8 @@
1 1
 package com.xhkjedu.smarking.service.scan;
2 2
 
3 3
 import com.alibaba.fastjson.JSON;
4
+import com.alibaba.fastjson.JSONArray;
5
+import com.xhkjedu.smarking.config.ConfigKey;
4 6
 import com.xhkjedu.smarking.mapper.scan.MsScanbatchMapper;
5 7
 import com.xhkjedu.smarking.mapper.scan.MsScanbatchPaperBlockMapper;
6 8
 import com.xhkjedu.smarking.mapper.scan.MsScanbatchPaperBlockQuestionMapper;
@@ -8,6 +10,7 @@ import com.xhkjedu.smarking.mapper.scan.MsScanbatchPaperMapper;
8 10
 import com.xhkjedu.smarking.mapper.stupaper.MsPaperStudentBlockMapper;
9 11
 import com.xhkjedu.smarking.mapper.stupaper.MsPaperStudentMapper;
10 12
 import com.xhkjedu.smarking.mapper.stupaper.MsPaperStudentQuestionMergeMapper;
13
+import com.xhkjedu.smarking.mapper.system.SchoolMapper;
11 14
 import com.xhkjedu.smarking.mapper.system.UserMapper;
12 15
 import com.xhkjedu.smarking.model.scan.MsScanbatchPaper;
13 16
 import com.xhkjedu.smarking.model.scan.MsScanbatchPaperBlock;
@@ -17,7 +20,9 @@ import com.xhkjedu.smarking.model.stupaper.MsPaperStudentBlock;
17 20
 import com.xhkjedu.smarking.model.stupaper.MsPaperStudentQuestionMerge;
18 21
 import com.xhkjedu.smarking.utils.ConvertUtil;
19 22
 import com.xhkjedu.smarking.utils.MarkingUtil;
23
+import com.xhkjedu.smarking.vo.system.SchoolCloudVo;
20 24
 import com.xhkjedu.utils.N_Utils;
25
+import com.xhkjedu.vo.ResultVo;
21 26
 import org.springframework.stereotype.Service;
22 27
 import org.springframework.transaction.annotation.Transactional;
23 28
 
@@ -51,6 +56,8 @@ public class MsScanbatchPaperService {
51 56
     private MsPaperStudentBlockMapper msPaperStudentBlockMapper;
52 57
     @Resource
53 58
     private ConvertUtil convertUtil;
59
+    @Resource
60
+    private SchoolMapper schoolMapper;
54 61
 
55 62
     /**
56 63
      * @Description 新增
@@ -113,7 +120,6 @@ public class MsScanbatchPaperService {
113 120
             return;
114 121
         }
115 122
 
116
-
117 123
         //保存扫描信息
118 124
         savePaperBlockQuestions(msScanbatchPaper);
119 125
         //学生试卷信息
@@ -129,6 +135,23 @@ public class MsScanbatchPaperService {
129 135
 
130 136
     //保存扫描试卷-保存扫描题块试题信息
131 137
     private void savePaperBlockQuestions(MsScanbatchPaper msScanbatchPaper){
138
+        //获取学校对应区域码,
139
+        SchoolCloudVo schoolCloudVo = schoolMapper.getSchoolCloudcode(msScanbatchPaper.getMpid());
140
+        String saveFloder = schoolCloudVo.getCloudcode() + "/" + schoolCloudVo.getSchoolid() + "/";
141
+
142
+        String paperfront = uploadBase64Img(msScanbatchPaper.getPaperfront(),1,saveFloder);
143
+        if(N_Utils.isNotEmpty(paperfront)){
144
+            msScanbatchPaper.setPaperfront(paperfront);
145
+        }
146
+        String paperback = uploadBase64Img(msScanbatchPaper.getPaperback(),1,saveFloder);
147
+        if(N_Utils.isNotEmpty(paperback)){
148
+            msScanbatchPaper.setPaperback(paperback);
149
+        }
150
+        String examnopic = uploadBase64Img(msScanbatchPaper.getExamnopic(),1,saveFloder);
151
+        if(N_Utils.isNotEmpty(examnopic)){
152
+            msScanbatchPaper.setExamnopic(examnopic);
153
+        }
154
+
132 155
         msScanbatchPaperMapper.insertUseGeneratedKeys(msScanbatchPaper);
133 156
         Integer mspid = msScanbatchPaper.getId();
134 157
         msScanbatchPaper.setMspid(mspid);
@@ -138,6 +161,14 @@ public class MsScanbatchPaperService {
138 161
         for (MsScanbatchPaperBlock spblock : spblocks) {
139 162
             spblock.setMspid(mspid);
140 163
             spblock.setBatchid(msScanbatchPaper.getBatchid());
164
+
165
+            //题块多图片合并比一张图片
166
+            String rtnBlock = uploadBase64Img(spblock.getPicpath(),2,saveFloder);
167
+            spblock.setPicpath(rtnBlock);
168
+
169
+            //题块多图片合并比一张图片
170
+            String extendBlock = uploadBase64Img(spblock.getExtendpath(),2,saveFloder);
171
+            spblock.setExtendpath(extendBlock);
141 172
         }
142 173
 
143 174
         msScanbatchPaperBlockMapper.insertList(spblocks);
@@ -155,7 +186,31 @@ public class MsScanbatchPaperService {
155 186
         }
156 187
         //更改识别数量
157 188
         msScanbatchMapper.updateIdentifynum(msScanbatchPaper.getBatchid());
189
+    }
158 190
 
191
+    //图片base上传
192
+    private String uploadBase64Img(String stupic,Integer merged,String saveFloder){
193
+        String apiMethod = "";
194
+        String params = "";
195
+        if(merged == 1){
196
+            //说明上传的图片为单张保存
197
+            params = "base64path=" + stupic;
198
+            apiMethod = "bs/base";
199
+        }else{
200
+            //上传的多张图片需要合并为一张
201
+            List<String> imgList =JSONArray.parseArray(stupic, String.class);
202
+            params = "filepaths=" + imgList;
203
+            apiMethod = "bs/mbase_merge";
204
+        }
205
+        //处理字段那种图片路径,base64转图片
206
+        params = params + "&savefolder=" + saveFloder + "marking/scan/";
207
+        String fileInfoStr = N_Utils.sendPost(ConfigKey.fileapi + apiMethod, params);
208
+        ResultVo fileResult = JSON.parseObject(fileInfoStr, ResultVo.class);
209
+        if (fileResult.getCode() == 0 && N_Utils.isNotEmpty(fileResult.getObj())) {
210
+            return fileResult.getObj().toString();
211
+        }else{
212
+            return "";
213
+        }
159 214
     }
160 215
 
161 216
     //保存扫描试卷-清空学生试卷题块试题信息
@@ -199,7 +254,6 @@ public class MsScanbatchPaperService {
199 254
         Double stuPaperScore = 0.0;//学生试卷得分
200 255
         List<MsPaperStudentBlock>  saveBlockList = new ArrayList<>();// 保存学生题块信息
201 256
         List<MsPaperStudentQuestionMerge> saveQuesList = new ArrayList<>();//保存学生提交试题
202
-        List<MsPaperStudentBlock> needConvertList = new ArrayList<>();//需要合并图片的题块
203 257
         Integer timestamp = N_Utils.getSecondTimestamp();
204 258
 
205 259
         for(MsScanbatchPaperBlock spblock : spblocks){
@@ -213,7 +267,6 @@ public class MsScanbatchPaperService {
213 267
             }
214 268
             studentBlock.setConverted(0);
215 269
             saveBlockList.add(studentBlock);
216
-            needConvertList.add(studentBlock);
217 270
 
218 271
             List<MsPaperStudentQuestionMerge> stuQuestions = studentBlock.getQuestions();//学生试题
219 272
             List<MsScanbatchPaperBlockQuestion> spbquestions = spblock.getSpbquestions();//扫描题块下试题
@@ -288,26 +341,12 @@ public class MsScanbatchPaperService {
288 341
         msPaperStudentBlockMapper.updateBatchStuBlock(saveBlockList);
289 342
         msPaperStudentQuestionMergeMapper.updateBatchStuQues(saveQuesList);
290 343
         msPaperStudentMapper.updateByPrimaryKeySelective(msPaperStudent);
291
-        handleStudentNeedConvert(needConvertList);
292 344
 
293 345
         rtnanswernum = saveQuesList.size();
294 346
 
295 347
         return rtnanswernum;
296 348
     }
297 349
 
298
-    private void handleStudentNeedConvert(List<MsPaperStudentBlock> needConvertList){
299
-        if(needConvertList.size() > 0){
300
-            for(MsPaperStudentBlock studentBlock : needConvertList){
301
-                String stuAnswer = studentBlock.getStuanswer();
302
-                List<String> stuPicList = JSON.parseArray(stuAnswer, String.class);
303
-                if(stuPicList != null && stuPicList.size() > 1){
304
-                    convertUtil.imgMerge(studentBlock.getMpsbid(),stuPicList,2);
305
-                }
306
-            }
307
-        }
308
-    }
309
-
310
-
311 350
     /*
312 351
      * @Description 扫描记录-查看原卷
313 352
      * @Date 2024/10/25 17:22:45

+ 15
- 0
smarking/src/main/java/com/xhkjedu/smarking/vo/system/SchoolCloudVo.java View File

@@ -0,0 +1,15 @@
1
+package com.xhkjedu.smarking.vo.system;
2
+
3
+import lombok.Data;
4
+
5
+/**
6
+ * @Description:学校区域信息
7
+ * @Author: WN
8
+ * @Date: 2024/10/29 16:00:08
9
+ **/
10
+@Data
11
+public class SchoolCloudVo {
12
+    private Integer schoolid;
13
+
14
+    private String cloudcode;
15
+}

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

@@ -92,6 +92,10 @@ cron.deleteUriMap=0/3 * * * * ?
92 92
 #\u89E3\u6790ip\u5F52\u5C5E\u5730\u6570\u636E
93 93
 ipregiondb=D:\\school\\ip2region.xdb
94 94
 
95
+#\u6587\u4EF6\u670D\u52A1\u5730\u5740
96
+fileapi=https://schoolfiletest.xhkjedu.com/
97
+
98
+
95 99
 #\u7248\u672C\u53F7
96 100
 buildnum=301
97 101
 versionname=Test_v3.14.1

+ 6
- 0
smarking/src/main/resources/mapper/system/SchoolMapper.xml View File

@@ -10,4 +10,10 @@
10 10
         select s.year from t_user u left join t_school s on u.schoolid=s.schoolid
11 11
         where u.userid=#{userid}
12 12
     </select>
13
+
14
+    <!--获取考试对应区域码和学校id-->
15
+    <select id="getSchoolCloudcode" resultType="com.xhkjedu.smarking.vo.system.SchoolCloudVo">
16
+        select e.schoolid,(select cloudcode from t_cloud order by cloudid limit 1) cloudcode from ms_paper p left join ms_exam e on p.examid=p.examid
17
+        where p.mpid=#{mpid}
18
+    </select>
13 19
 </mapper>

Loading…
Cancel
Save