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
      **/
48
      **/
49
     @PostMapping("/save")
49
     @PostMapping("/save")
50
     public ResultVo save(@RequestBody MsPaperParams params) {
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
         if (params.getBlocks() == null || params.getBlocks().isEmpty()) {
52
         if (params.getBlocks() == null || params.getBlocks().isEmpty()) {
53
             return new ResultVo(1, "题块不能为空!");
53
             return new ResultVo(1, "题块不能为空!");
54
         }
54
         }

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

43
 
43
 
44
 
44
 
45
     //获取试卷ID及考试模式
45
     //获取试卷ID及考试模式
46
-    PExamSubjectVo getPaperAndMxammodeByMsid(@Param("msid") Integer msid);
46
+    PExamSubjectVo getPaperAndMxammodeByMpid(@Param("mpid") Integer mpid);
47
 
47
 
48
     //根据考试id和科目id获取试卷信息
48
     //根据考试id和科目id获取试卷信息
49
     MsPaper getPaperByExamIdAndSubjectId(@Param("examId") Integer examId, @Param("subjectId") String subjectId);
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
 
31
 
32
     //试卷所有模板信息
32
     //试卷所有模板信息
33
     List<MsTemplate> listTemplateBlockQueByMpid(@Param("mpid") Integer mpid);
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
     private List<MsTemplateBlock> tblocks;
64
     private List<MsTemplateBlock> tblocks;
65
     @Transient
65
     @Transient
66
     private Integer mttype;//类型1客观题2主观题
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
     public void add(MsSubjectBadstudent msSubjectBadstudent){
48
     public void add(MsSubjectBadstudent msSubjectBadstudent){
49
         //获取学校对应区域码,
49
         //获取学校对应区域码,
50
         SchoolCloudVo schoolCloudVo = schoolMapper.getSchoolCloudcode(msSubjectBadstudent.getMpid());
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
         String picpath = MarkingUtil.uploadBase64Img(msSubjectBadstudent.getPicpath(), 1, saveFloder);
53
         String picpath = MarkingUtil.uploadBase64Img(msSubjectBadstudent.getPicpath(), 1, saveFloder);
54
         if(N_Utils.isNotEmpty(picpath)){
54
         if(N_Utils.isNotEmpty(picpath)){

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

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

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

400
         if (imgs.get(0).contains("base64")) {// 说明上传的是base64图片
400
         if (imgs.get(0).contains("base64")) {// 说明上传的是base64图片
401
             // 获取试卷对应学校区域码,base64转为图片
401
             // 获取试卷对应学校区域码,base64转为图片
402
             SchoolCloudVo schoolCloudVo = schoolMapper.getSchoolCloudcode(mpid);
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
             paperFileVo = MarkingUtil.uploadBatchBase64ImgPdf(imgs, saveFloder);
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
             List<String> base64list = pfiles.stream().map(MsPaperFile::getFilepath).collect(Collectors.toList());
138
             List<String> base64list = pfiles.stream().map(MsPaperFile::getFilepath).collect(Collectors.toList());
139
 
139
 
140
             SchoolCloudVo schoolCloudVo = schoolMapper.getSchoolCloudcode(mpid);
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
             paperFileVo = MarkingUtil.uploadBatchBase64ImgPdf(base64list, saveFloder);
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
         msTemplate.setBlankindex(-1);
92
         msTemplate.setBlankindex(-1);
93
 
93
 
94
         SchoolCloudVo school = schoolMapper.getSchoolCloudcode(msTemplate.getMpid());
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
         String tfront = MarkingUtil.uploadBase64Img(msTemplate.getTfront(),1, savefloder);
96
         String tfront = MarkingUtil.uploadBase64Img(msTemplate.getTfront(),1, savefloder);
97
         if(N_Utils.isNotEmpty(tfront)){
97
         if(N_Utils.isNotEmpty(tfront)){
98
             msTemplate.setTfront(tfront);
98
             msTemplate.setTfront(tfront);
128
         //定位区选择
128
         //定位区选择
129
         if(msTemplate.getCurrstep() == 3){
129
         if(msTemplate.getCurrstep() == 3){
130
             SchoolCloudVo school = schoolMapper.getSchoolCloudcode(msTemplate.getMpid());
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
             if(N_Utils.isNotEmpty(msTemplate.getDwtfront())){
132
             if(N_Utils.isNotEmpty(msTemplate.getDwtfront())){
133
                 //定位区正面图片
133
                 //定位区正面图片
134
                 String dwtfront = MarkingUtil.uploadBase64Img(msTemplate.getDwtfront(),1, savefloder);
134
                 String dwtfront = MarkingUtil.uploadBase64Img(msTemplate.getDwtfront(),1, savefloder);
428
      * @Return com.xhkjedu.smarking.model.paper.MsTemplate
428
      * @Return com.xhkjedu.smarking.model.paper.MsTemplate
429
      **/
429
      **/
430
     public MsTemplate getTemplateDetailByMtid(MsTemplate mt){
430
     public MsTemplate getTemplateDetailByMtid(MsTemplate mt){
431
-        MsTemplate msTemplate = msTemplateMapper.selectByPrimaryKey(mt.getMtid());
431
+        MsTemplate msTemplate = msTemplateMapper.getTemplateAndExamidByMtid(mt.getMtid());
432
         msTemplate.setTblocks(msTemplateBlockMapper.listTemplateBlockQuestions(mt.getMtid(),mt.getMttype()));
432
         msTemplate.setTblocks(msTemplateBlockMapper.listTemplateBlockQuestions(mt.getMtid(),mt.getMttype()));
433
         return msTemplate;
433
         return msTemplate;
434
     }
434
     }

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

177
     private void savePaperBlockQuestions(MsScanbatchPaper msScanbatchPaper){
177
     private void savePaperBlockQuestions(MsScanbatchPaper msScanbatchPaper){
178
         //获取学校对应区域码,
178
         //获取学校对应区域码,
179
         SchoolCloudVo schoolCloudVo = schoolMapper.getSchoolCloudcode(msScanbatchPaper.getMpid());
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
         String paperfront = MarkingUtil.uploadBase64Img(msScanbatchPaper.getPaperfront(),1,saveFloder);
182
         String paperfront = MarkingUtil.uploadBase64Img(msScanbatchPaper.getPaperfront(),1,saveFloder);
183
         if(N_Utils.isNotEmpty(paperfront)){
183
         if(N_Utils.isNotEmpty(paperfront)){
632
         msScanbatchPaperMapper.updateBatchScanPaperMspstate(list);
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
     </select>
69
     </select>
70
     <!--获取考试下所有科目名称-->
70
     <!--获取考试下所有科目名称-->
71
     <select id="listSubjectNameByExamId" resultType="java.util.Map">
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
     </select>
74
     </select>
74
     <!--根据考试科目id获取阅卷状态-->
75
     <!--根据考试科目id获取阅卷状态-->
75
     <select id="getCheckStateByMsId" resultType="java.lang.Integer">
76
     <select id="getCheckStateByMsId" resultType="java.lang.Integer">

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

78
     </select>
78
     </select>
79
 
79
 
80
     <!--获取试卷ID及考试模式-->
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
     </select>
83
     </select>
84
     <!--根据考试id和科目id获取试卷信息-->
84
     <!--根据考试id和科目id获取试卷信息-->
85
     <select id="getPaperByExamIdAndSubjectId" resultType="com.xhkjedu.smarking.model.paper.MsPaper">
85
     <select id="getPaperByExamIdAndSubjectId" resultType="com.xhkjedu.smarking.model.paper.MsPaper">

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

2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
 <mapper namespace="com.xhkjedu.smarking.mapper.paper.MsTemplateMapper">
3
 <mapper namespace="com.xhkjedu.smarking.mapper.paper.MsTemplateMapper">
4
 
4
 
5
-    <!--根据msid查询试卷模板列表-->
5
+    <!--根据mpid查询试卷模板列表-->
6
     <select id="listTemplatesByMpid" resultType="java.util.Map">
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
     </select>
9
     </select>
11
 
10
 
12
     <!--设置试卷模板信息-->
11
     <!--设置试卷模板信息-->
94
         left join ms_template_block_question q on tb.mtbid=q.mtbid
93
         left join ms_template_block_question q on tb.mtbid=q.mtbid
95
         where t.mpid=#{mpid} order by t.mtid,tb.mtborder,q.mtbqorder
94
         where t.mpid=#{mpid} order by t.mtid,tb.mtborder,q.mtbqorder
96
     </select>
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
 </mapper>
101
 </mapper>

Loading…
Cancel
Save