Browse Source

完善对接接口

ywx
王宁 1 week ago
parent
commit
134efea1cb

+ 1
- 1
smarking/src/main/java/com/xhkjedu/smarking/controller/paper/MsPaperBlockController.java View File

@@ -48,7 +48,7 @@ public class MsPaperBlockController {
48 48
      **/
49 49
     @PostMapping("/save")
50 50
     public ResultVo save(@RequestBody MsPaperParams params) {
51
-        N_Utils.validation(new Object[]{params.getMsid(), "考试科目id",1});
51
+        N_Utils.validation(new Object[]{params.getMpid(), "试卷id",1});
52 52
         if (params.getBlocks() == null || params.getBlocks().isEmpty()) {
53 53
             return new ResultVo(1, "题块不能为空!");
54 54
         }

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

@@ -43,7 +43,7 @@ public interface MsPaperMapper extends TkMapper<MsPaper> {
43 43
 
44 44
 
45 45
     //获取试卷ID及考试模式
46
-    PExamSubjectVo getPaperAndMxammodeByMsid(@Param("msid") Integer msid);
46
+    PExamSubjectVo getPaperAndMxammodeByMpid(@Param("mpid") Integer mpid);
47 47
 
48 48
     //根据考试id和科目id获取试卷信息
49 49
     MsPaper getPaperByExamIdAndSubjectId(@Param("examId") Integer examId, @Param("subjectId") String subjectId);

+ 3
- 0
smarking/src/main/java/com/xhkjedu/smarking/mapper/paper/MsTemplateMapper.java View File

@@ -31,4 +31,7 @@ public interface MsTemplateMapper extends TkMapper<MsTemplate> {
31 31
 
32 32
     //试卷所有模板信息
33 33
     List<MsTemplate> listTemplateBlockQueByMpid(@Param("mpid") Integer mpid);
34
+
35
+    //获取模版详情和考试id
36
+    MsTemplate getTemplateAndExamidByMtid(@Param("mtid") Integer mtid);
34 37
 }

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

@@ -64,5 +64,7 @@ public class MsTemplate extends BaseBean {
64 64
     private List<MsTemplateBlock> tblocks;
65 65
     @Transient
66 66
     private Integer mttype;//类型1客观题2主观题
67
+    @Transient
68
+    private Integer examid;
67 69
 
68 70
 }

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

@@ -48,7 +48,7 @@ public class MsSubjectBadstudentService {
48 48
     public void add(MsSubjectBadstudent msSubjectBadstudent){
49 49
         //获取学校对应区域码,
50 50
         SchoolCloudVo schoolCloudVo = schoolMapper.getSchoolCloudcode(msSubjectBadstudent.getMpid());
51
-        String saveFloder = schoolCloudVo.getCloudcode() + "/" + schoolCloudVo.getSchoolid() + "/marking/invigilate/";
51
+        String saveFloder = schoolCloudVo.getCloudcode() + "/" + schoolCloudVo.getSchoolid() + "/marking/invigilate";
52 52
 
53 53
         String picpath = MarkingUtil.uploadBase64Img(msSubjectBadstudent.getPicpath(), 1, saveFloder);
54 54
         if(N_Utils.isNotEmpty(picpath)){

+ 1
- 1
smarking/src/main/java/com/xhkjedu/smarking/service/paper/MsPaperBlockService.java View File

@@ -63,7 +63,7 @@ public class MsPaperBlockService {
63 63
      **/
64 64
     @Transactional(rollbackFor = Exception.class)
65 65
     public Integer save(MsPaperParams params){
66
-        PExamSubjectVo paper = msPaperMapper.getPaperAndMxammodeByMsid(params.getMsid());
66
+        PExamSubjectVo paper = msPaperMapper.getPaperAndMxammodeByMpid(params.getMpid());
67 67
         Integer mpid = paper.getMpid();
68 68
 
69 69
         Integer createid = params.getCreateid();

+ 1
- 1
smarking/src/main/java/com/xhkjedu/smarking/service/paper/MsPaperQtypeService.java View File

@@ -400,7 +400,7 @@ public class MsPaperQtypeService {
400 400
         if (imgs.get(0).contains("base64")) {// 说明上传的是base64图片
401 401
             // 获取试卷对应学校区域码,base64转为图片
402 402
             SchoolCloudVo schoolCloudVo = schoolMapper.getSchoolCloudcode(mpid);
403
-            String saveFloder = schoolCloudVo.getCloudcode() + "/" + schoolCloudVo.getSchoolid() + "/marking/paper/";
403
+            String saveFloder = schoolCloudVo.getCloudcode() + "/" + schoolCloudVo.getSchoolid() + "/marking/paper";
404 404
             paperFileVo = MarkingUtil.uploadBatchBase64ImgPdf(imgs, saveFloder);
405 405
         }
406 406
 

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

@@ -138,7 +138,7 @@ public class MsPaperService {
138 138
             List<String> base64list = pfiles.stream().map(MsPaperFile::getFilepath).collect(Collectors.toList());
139 139
 
140 140
             SchoolCloudVo schoolCloudVo = schoolMapper.getSchoolCloudcode(mpid);
141
-            String saveFloder = schoolCloudVo.getCloudcode() + "/" + schoolCloudVo.getSchoolid() + "/marking/paper/";
141
+            String saveFloder = schoolCloudVo.getCloudcode() + "/" + schoolCloudVo.getSchoolid() + "/marking/paper";
142 142
             paperFileVo = MarkingUtil.uploadBatchBase64ImgPdf(base64list, saveFloder);
143 143
         }
144 144
 

+ 3
- 3
smarking/src/main/java/com/xhkjedu/smarking/service/paper/MsTemplateService.java View File

@@ -92,7 +92,7 @@ public class MsTemplateService {
92 92
         msTemplate.setBlankindex(-1);
93 93
 
94 94
         SchoolCloudVo school = schoolMapper.getSchoolCloudcode(msTemplate.getMpid());
95
-        String savefloder = school.getCloudcode() + "/" + school.getSchoolid() + "/marking/paper/";
95
+        String savefloder = school.getCloudcode() + "/" + school.getSchoolid() + "/marking/paper";
96 96
         String tfront = MarkingUtil.uploadBase64Img(msTemplate.getTfront(),1, savefloder);
97 97
         if(N_Utils.isNotEmpty(tfront)){
98 98
             msTemplate.setTfront(tfront);
@@ -128,7 +128,7 @@ public class MsTemplateService {
128 128
         //定位区选择
129 129
         if(msTemplate.getCurrstep() == 3){
130 130
             SchoolCloudVo school = schoolMapper.getSchoolCloudcode(msTemplate.getMpid());
131
-            String savefloder = school.getCloudcode() + "/" + school.getSchoolid() + "/marking/paper/";
131
+            String savefloder = school.getCloudcode() + "/" + school.getSchoolid() + "/marking/paper";
132 132
             if(N_Utils.isNotEmpty(msTemplate.getDwtfront())){
133 133
                 //定位区正面图片
134 134
                 String dwtfront = MarkingUtil.uploadBase64Img(msTemplate.getDwtfront(),1, savefloder);
@@ -428,7 +428,7 @@ public class MsTemplateService {
428 428
      * @Return com.xhkjedu.smarking.model.paper.MsTemplate
429 429
      **/
430 430
     public MsTemplate getTemplateDetailByMtid(MsTemplate mt){
431
-        MsTemplate msTemplate = msTemplateMapper.selectByPrimaryKey(mt.getMtid());
431
+        MsTemplate msTemplate = msTemplateMapper.getTemplateAndExamidByMtid(mt.getMtid());
432 432
         msTemplate.setTblocks(msTemplateBlockMapper.listTemplateBlockQuestions(mt.getMtid(),mt.getMttype()));
433 433
         return msTemplate;
434 434
     }

+ 7
- 1
smarking/src/main/java/com/xhkjedu/smarking/service/scan/MsScanbatchPaperService.java View File

@@ -177,7 +177,7 @@ public class MsScanbatchPaperService {
177 177
     private void savePaperBlockQuestions(MsScanbatchPaper msScanbatchPaper){
178 178
         //获取学校对应区域码,
179 179
         SchoolCloudVo schoolCloudVo = schoolMapper.getSchoolCloudcode(msScanbatchPaper.getMpid());
180
-        String saveFloder = schoolCloudVo.getCloudcode() + "/" + schoolCloudVo.getSchoolid() + "/marking/scan/";
180
+        String saveFloder = schoolCloudVo.getCloudcode() + "/" + schoolCloudVo.getSchoolid() + "/marking/scan";
181 181
 
182 182
         String paperfront = MarkingUtil.uploadBase64Img(msScanbatchPaper.getPaperfront(),1,saveFloder);
183 183
         if(N_Utils.isNotEmpty(paperfront)){
@@ -632,4 +632,10 @@ public class MsScanbatchPaperService {
632 632
         msScanbatchPaperMapper.updateBatchScanPaperMspstate(list);
633 633
     }
634 634
 
635
+    public void reIdentifyPaper(Integer examid,String subjectid,Integer mpid) {
636
+        //获取考试对应的试卷模板及坐标信息
637
+        List<MsTemplate> templates = msTemplateMapper.listTemplateBlockQueByMpid(mpid);
638
+
639
+    }
640
+
635 641
 }

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

@@ -69,7 +69,8 @@
69 69
     </select>
70 70
     <!--获取考试下所有科目名称-->
71 71
     <select id="listSubjectNameByExamId" resultType="java.util.Map">
72
-        select subjectid,subjectname from ms_subject where examid=#{examid}
72
+        select distinct s.subjectid,s.subjectname,p.mpid from ms_subject s
73
+        left join ms_paper p on s.msid=p.msid where s.examid=#{examid} order by s.msid
73 74
     </select>
74 75
     <!--根据考试科目id获取阅卷状态-->
75 76
     <select id="getCheckStateByMsId" resultType="java.lang.Integer">

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

@@ -78,8 +78,8 @@
78 78
     </select>
79 79
 
80 80
     <!--获取试卷ID及考试模式-->
81
-    <select id="getPaperAndMxammodeByMsid" resultType="com.xhkjedu.smarking.vo.paper.PExamSubjectVo">
82
-        select p.mpid,e.exammode from ms_paper p left join ms_exam e on p.examid=e.examid where p.msid=#{msid}
81
+    <select id="getPaperAndMxammodeByMpid" resultType="com.xhkjedu.smarking.vo.paper.PExamSubjectVo">
82
+        select p.mpid,e.exammode from ms_paper p left join ms_exam e on p.examid=e.examid where p.mpid=#{mpid}
83 83
     </select>
84 84
     <!--根据考试id和科目id获取试卷信息-->
85 85
     <select id="getPaperByExamIdAndSubjectId" resultType="com.xhkjedu.smarking.model.paper.MsPaper">

+ 8
- 4
smarking/src/main/resources/mapper/paper/MsTemplateMapper.xml View File

@@ -2,11 +2,10 @@
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.paper.MsTemplateMapper">
4 4
 
5
-    <!--根据msid查询试卷模板列表-->
5
+    <!--根据mpid查询试卷模板列表-->
6 6
     <select id="listTemplatesByMpid" resultType="java.util.Map">
7
-        select t.mtid,t.mpid,t.currstep,t.tstate,t.createtime,t.tfront,t.tback,t.blankindex,t.anglefront,t.angleback from ms_template t
8
-        left join ms_paper p on t.mpid=p.mpid
9
-        where p.mpid=#{mpid} order by t.createtime desc
7
+        select t.mtid,t.mpid,t.currstep,t.tstate,t.createtime,t.tfront,t.tback,t.blankindex,t.anglefront,t.angleback
8
+        from ms_template t where t.mpid=#{mpid} order by t.createtime desc
10 9
     </select>
11 10
 
12 11
     <!--设置试卷模板信息-->
@@ -94,4 +93,9 @@
94 93
         left join ms_template_block_question q on tb.mtbid=q.mtbid
95 94
         where t.mpid=#{mpid} order by t.mtid,tb.mtborder,q.mtbqorder
96 95
     </select>
96
+
97
+    <!--获取模版详情和考试id-->
98
+    <select id="getTemplateAndExamidByMtid" resultType="com.xhkjedu.smarking.model.paper.MsTemplate">
99
+        select t.*,p.examid from ms_template t left join ms_paper p on t.mpid=p.mpid where t.mtid=#{mtid}
100
+    </select>
97 101
 </mapper>

Loading…
Cancel
Save