Browse Source

试卷模板完善

ywx
王宁 2 weeks ago
parent
commit
c0a9c746b6

+ 2
- 0
smarking/src/main/java/com/xhkjedu/smarking/mapper/exam/MsSubjectMapper.java View File

37
     int updatePtstateByMpid(@Param("mpid")Integer mpid,@Param("ptstate")Integer ptstate);
37
     int updatePtstateByMpid(@Param("mpid")Integer mpid,@Param("ptstate")Integer ptstate);
38
     //更改科目试卷题块设置状
38
     //更改科目试卷题块设置状
39
     int updatePbstateByMpid(@Param("mpid")Integer mpid,@Param("pbstate")Integer pbstate);
39
     int updatePbstateByMpid(@Param("mpid")Integer mpid,@Param("pbstate")Integer pbstate);
40
+    //重置试卷模板和题块状态
41
+    int updateTempAndBlockStateByMpid(@Param("mpid")Integer mpid);
40
 
42
 
41
     //获取考试下所有科目名称
43
     //获取考试下所有科目名称
42
     List<Map<String,String>> listSubjectNameByExamId(@Param("examid") Integer examid);
44
     List<Map<String,String>> listSubjectNameByExamId(@Param("examid") Integer examid);

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

26
 
26
 
27
     //修改模板题块框选状态
27
     //修改模板题块框选状态
28
     int updateTemplateTbstate(@Param("mtid")Integer mtid, @Param("tbstate")Integer tbstate);
28
     int updateTemplateTbstate(@Param("mtid")Integer mtid, @Param("tbstate")Integer tbstate);
29
+    //恢复模板状态
30
+    int updateTemplateAllState(@Param("mtid")Integer mtid);
29
 
31
 
30
     //获取试卷未框选主观题模板数量
32
     //获取试卷未框选主观题模板数量
31
     int getUnSelTemplateCount(@Param("mpid")Integer mpid);
33
     int getUnSelTemplateCount(@Param("mpid")Integer mpid);

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

49
     private String misscoor;
49
     private String misscoor;
50
     //违规标记坐标
50
     //违规标记坐标
51
     private String violatecoor;
51
     private String violatecoor;
52
+    //考号类型1涂卡 2条形码 3手写1 4手写2
53
+    private Integer enumtype;
52
     //考号定位坐标
54
     //考号定位坐标
53
     private String examnocoor;
55
     private String examnocoor;
54
     //涂卡数字坐标列表
56
     //涂卡数字坐标列表

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

123
 
123
 
124
         //根据模板ID获取模板信息
124
         //根据模板ID获取模板信息
125
         MsTemplate oldTemplate = msTemplateMapper.selectByPrimaryKey(msTemplate.getMtid());
125
         MsTemplate oldTemplate = msTemplateMapper.selectByPrimaryKey(msTemplate.getMtid());
126
-        if(!msTemplate.getCurrstep().equals(oldTemplate.getCurrstep())) throw new ServiceException("请按顺序操作");
127
 
126
 
127
+        if(msTemplate.getCurrstep() < 6 && oldTemplate.getTstate() == 1){
128
+            msTemplateMapper.updateTemplateAllState(msTemplate.getMtid());
129
+            //当模板当前步骤不是6选择答题区7选择违纪区时,需要清空所有题块和模板框选
130
+            msTemplateBlockMapper.deleteByMtidAndMtype(msTemplate.getMtid(),null);
131
+            msPaperBlockMapper.deleteObjByMpidAndBlocktype(oldTemplate.getMpid(),null);
132
+            msSubjectMapper.updateTempAndBlockStateByMpid(oldTemplate.getMpid());
133
+        }
128
         //定位区选择
134
         //定位区选择
129
         if(msTemplate.getCurrstep() == 3){
135
         if(msTemplate.getCurrstep() == 3){
130
             SchoolCloudVo school = schoolMapper.getSchoolCloudcode(msTemplate.getMpid());
136
             SchoolCloudVo school = schoolMapper.getSchoolCloudcode(msTemplate.getMpid());
168
         Integer timestamp = N_Utils.getSecondTimestamp();
174
         Integer timestamp = N_Utils.getSecondTimestamp();
169
         Integer createid = msTemplate.getCreateid();
175
         Integer createid = msTemplate.getCreateid();
170
 
176
 
171
-        //保存之前先清除已保存的信息试卷客观题题块、模板题块
172
-        msTemplateBlockMapper.deleteByMtidAndMtype(msTemplate.getMtid(),1);
173
-        msPaperBlockMapper.deleteObjByMpidAndBlocktype(mpid,1);
177
+        // //保存之前先清除已保存的信息试卷客观题题块、模板题块
178
+        // msTemplateBlockMapper.deleteByMtidAndMtype(msTemplate.getMtid(),1);
179
+        // msPaperBlockMapper.deleteObjByMpidAndBlocktype(mpid,1);
174
         //获取试卷中所有试题信息
180
         //获取试卷中所有试题信息
175
         List<MsPaperQtypeQuestion> questions = msPaperQtypeQuestionMapper.listQuestionsByMpid(mpid);
181
         List<MsPaperQtypeQuestion> questions = msPaperQtypeQuestionMapper.listQuestionsByMpid(mpid);
176
         List<MsPaperQtypeQuestion> objQuestions = questions.stream().filter(q -> q.getQtype() == 1).collect(Collectors.toList());//客观题试题信息
182
         List<MsPaperQtypeQuestion> objQuestions = questions.stream().filter(q -> q.getQtype() == 1).collect(Collectors.toList());//客观题试题信息

+ 3
- 4
smarking/src/main/java/com/xhkjedu/smarking/service/scan/MsScanbatchPaperService.java View File

29
 import com.xhkjedu.smarking.vo.system.SchoolCloudVo;
29
 import com.xhkjedu.smarking.vo.system.SchoolCloudVo;
30
 import com.xhkjedu.utils.N_Utils;
30
 import com.xhkjedu.utils.N_Utils;
31
 import com.xhkjedu.vo.ResultVo;
31
 import com.xhkjedu.vo.ResultVo;
32
-import org.opencv.core.Core;
33
 import org.springframework.stereotype.Service;
32
 import org.springframework.stereotype.Service;
34
 import org.springframework.transaction.annotation.Transactional;
33
 import org.springframework.transaction.annotation.Transactional;
35
 
34
 
72
     @Resource
71
     @Resource
73
     private MsExamMapper msExamMapper;
72
     private MsExamMapper msExamMapper;
74
 
73
 
75
-    static {
76
-        System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
77
-    }
74
+    // static {
75
+    //     System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
76
+    // }
78
 
77
 
79
     /*
78
     /*
80
      * @Description 扫描记录-查看原卷
79
      * @Description 扫描记录-查看原卷

+ 1
- 1
smarking/src/main/java/com/xhkjedu/smarking/service/stupaper/MsPaperStudentScoreService.java View File

174
         }
174
         }
175
         //获取考试的所有科目
175
         //获取考试的所有科目
176
         List<ESubjectVo> subjects = msPaperStudentScoreMapper.listSubjectsByExamid(mpstuScore.getExamid());
176
         List<ESubjectVo> subjects = msPaperStudentScoreMapper.listSubjectsByExamid(mpstuScore.getExamid());
177
-        Map<String,ESubjectVo> subjectMap = subjects.stream().collect(HashMap::new, (m,v)->m.put(v.getSubjectid(),v), HashMap::putAll);
177
+        Map<String,ESubjectVo> subjectMap = subjects.stream().collect(HashMap::new, (m,v)->m.put(v.getSubjectname(),v), HashMap::putAll);
178
         //考试班级
178
         //考试班级
179
         List<MsClass> classes = msPaperStudentScoreMapper.listClassesByExamid(mpstuScore.getExamid());
179
         List<MsClass> classes = msPaperStudentScoreMapper.listClassesByExamid(mpstuScore.getExamid());
180
         List<String> classNames = classes.stream().map(MsClass::getClassname).collect(ArrayList::new, ArrayList::add, ArrayList::addAll);
180
         List<String> classNames = classes.stream().map(MsClass::getClassname).collect(ArrayList::new, ArrayList::add, ArrayList::addAll);

+ 1
- 1
smarking/src/main/java/com/xhkjedu/smarking/utils/ImportUtil.java View File

152
             }
152
             }
153
 
153
 
154
         } catch (Exception e) {
154
         } catch (Exception e) {
155
-            log.error("读取Excel文件失败", e.getMessage());
155
+            log.error("读取Excel文件失败 :" + e.getMessage());
156
             throw new Exception("读取Excel文件失败");
156
             throw new Exception("读取Excel文件失败");
157
         }
157
         }
158
         return rtnList;
158
         return rtnList;

+ 4
- 0
smarking/src/main/java/com/xhkjedu/smarking/vo/scan/TemplateBlockQuestionVo.java View File

13
     private Integer mtbqid;
13
     private Integer mtbqid;
14
     //题号
14
     //题号
15
     private String qn;
15
     private String qn;
16
+
17
+    //处理题型1单选题2多选题3主观题4判断对错5判断√×6判断TF7完形填空8阅读理解10任务型阅读11复合题
18
+    // 12听力题13填空题14作文(语文)15作文(英语)16完形填空、阅读理解 17任务型阅读(符合)
19
+    private Integer ctype;
16
     //试卷试题ID
20
     //试卷试题ID
17
     private Integer mptqid;
21
     private Integer mptqid;
18
     //定位坐标
22
     //定位坐标

+ 2
- 0
smarking/src/main/java/com/xhkjedu/smarking/vo/scan/TemplateVo.java View File

43
     private String misscoor;
43
     private String misscoor;
44
     //违规标记坐标
44
     //违规标记坐标
45
     private String violatecoor;
45
     private String violatecoor;
46
+    //考号类型1涂卡 2条形码 3手写1 4手写2
47
+    private Integer enumtype;
46
     //考号定位坐标
48
     //考号定位坐标
47
     private String examnocoor;
49
     private String examnocoor;
48
     //涂卡数字坐标列表
50
     //涂卡数字坐标列表

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

85
     <update id="updatePbstateByMpid">
85
     <update id="updatePbstateByMpid">
86
         update ms_subject s,ms_paper p set s.pbstate=#{pbstate} where s.msid=p.msid and p.mpid=#{mpid}
86
         update ms_subject s,ms_paper p set s.pbstate=#{pbstate} where s.msid=p.msid and p.mpid=#{mpid}
87
     </update>
87
     </update>
88
+    <!--重置试卷模板和题块状态-->
89
+    <update id="updateTempAndBlockStateByMpid">
90
+        update ms_subject s,ms_paper p set s.ptstate=0 s.pbstate=0 where s.msid=p.msid and p.mpid=#{mpid}
91
+    </update>
92
+
88
     <!--更改考试科目监考设置状态-->
93
     <!--更改考试科目监考设置状态-->
89
     <update id="updateInvigilateStateByMsId">
94
     <update id="updateInvigilateStateByMsId">
90
         update ms_subject set invigilatestate=#{invigilatestate} where msid=#{msid}
95
         update ms_subject set invigilatestate=#{invigilatestate} where msid=#{msid}

+ 10
- 3
smarking/src/main/resources/mapper/paper/MsTemplateMapper.xml View File

44
     <update id="updateTemplateTbstate">
44
     <update id="updateTemplateTbstate">
45
         update ms_template set tbstate=#{tbstate} where mtid=#{mtid}
45
         update ms_template set tbstate=#{tbstate} where mtid=#{mtid}
46
     </update>
46
     </update>
47
+    <!--恢复模板状态-->
48
+    <update id="updateTemplateAllState">
49
+        update ms_template set tstate=0, tbstate=0 where mtid=#{mtid}
50
+    </update>
47
 
51
 
48
     <!--获取试卷未框选主观题模板数量-->
52
     <!--获取试卷未框选主观题模板数量-->
49
     <select id="getUnSelTemplateCount" resultType="java.lang.Integer">
53
     <select id="getUnSelTemplateCount" resultType="java.lang.Integer">
68
         <result property="dwtback" column="dwtback"/>
72
         <result property="dwtback" column="dwtback"/>
69
         <result property="misscoor" column="misscoor"/>
73
         <result property="misscoor" column="misscoor"/>
70
         <result property="violatecoor" column="violatecoor"/>
74
         <result property="violatecoor" column="violatecoor"/>
75
+        <result property="enumtype" column="enumtype"/>
71
         <result property="examnocoor" column="examnocoor"/>
76
         <result property="examnocoor" column="examnocoor"/>
72
         <result property="cardcoor" column="cardcoor"/>
77
         <result property="cardcoor" column="cardcoor"/>
73
         <collection property="tblocks" ofType="com.xhkjedu.smarking.vo.scan.TemplateBlockVo" javaType="java.util.ArrayList">
78
         <collection property="tblocks" ofType="com.xhkjedu.smarking.vo.scan.TemplateBlockVo" javaType="java.util.ArrayList">
82
                 <result property="mtbqid" column="mtbqid"/>
87
                 <result property="mtbqid" column="mtbqid"/>
83
                 <result property="qn" column="qn"/>
88
                 <result property="qn" column="qn"/>
84
                 <result property="mptqid" column="mptqid"/>
89
                 <result property="mptqid" column="mptqid"/>
90
+                <result property="ctype" column="ctype"></result>
85
                 <result property="qlocalcoor" column="qlocalcoor"/>
91
                 <result property="qlocalcoor" column="qlocalcoor"/>
86
                 <result property="mtbqorder" column="mtbqorder"/>
92
                 <result property="mtbqorder" column="mtbqorder"/>
87
             </collection>
93
             </collection>
89
     </resultMap>
95
     </resultMap>
90
     <select id="listTemplateBlockQueByMpid" resultMap="paperTemplate">
96
     <select id="listTemplateBlockQueByMpid" resultMap="paperTemplate">
91
         select t.mtid,t.mpid,t.tsize,t.twidth,t.theight,t.tfront,t.tback,t.blankindex,t.anglefront,t.angleback,t.coorfront,t.coorback,
97
         select t.mtid,t.mpid,t.tsize,t.twidth,t.theight,t.tfront,t.tback,t.blankindex,t.anglefront,t.angleback,t.coorfront,t.coorback,
92
-        t.dwtfront,t.dwtback,t.misscoor,t.violatecoor,t.examnocoor,t.cardcoor
98
+        t.dwtfront,t.dwtback,t.misscoor,t.violatecoor,t.enumtype,t.examnocoor,t.cardcoor
93
         ,tb.mtbid,tb.mblockid,tb.mttype,tb.mtborder,tb.localcoor,tb.extendcoor,tb.scorecoor
99
         ,tb.mtbid,tb.mblockid,tb.mttype,tb.mtborder,tb.localcoor,tb.extendcoor,tb.scorecoor
94
-        ,q.mtbqid,q.qn,q.mptqid,q.qlocalcoor,q.mtbqorder
100
+        ,q.mtbqid,q.qn,q.mptqid,q.qlocalcoor,q.mtbqorder,tq.ctype
95
         from ms_template t left join ms_template_block tb on t.mtid=tb.mtid
101
         from ms_template t left join ms_template_block tb on t.mtid=tb.mtid
96
         left join ms_template_block_question q on tb.mtbid=q.mtbid
102
         left join ms_template_block_question q on tb.mtbid=q.mtbid
97
-        where t.mpid=#{mpid} order by t.mtid,tb.mtborder,q.mtbqorder
103
+        left join ms_paper_qtype_question tq on q.mptqid=tq.mptqid
104
+        where t.mpid=#{mpid} order by t.mtid,tb.mttype,tb.mtborder,q.mtbqorder
98
     </select>
105
     </select>
99
 
106
 
100
     <!--获取模版详情和考试id-->
107
     <!--获取模版详情和考试id-->

+ 2
- 2
smarking/src/main/resources/mapper/stupaper/MsPaperStudentMapper.xml View File

270
 
270
 
271
     <!--补录成绩-补录单科-->
271
     <!--补录成绩-补录单科-->
272
     <update id="updateStuScoreForFillScore">
272
     <update id="updateStuScoreForFillScore">
273
-        update ms_paper_student set stuscore=#{psc.fillscore},stuscoretype=2 where mpsid=#{psc.mpsid} and stuscoretype=0
273
+        update ms_paper_student set stuscore=#{psc.fillscore},stuscoretype=2 where mpsid=#{psc.mpsid} and stuscoretype!=1
274
     </update>
274
     </update>
275
     <!--补录成绩-补录多科-->
275
     <!--补录成绩-补录多科-->
276
     <update id="updateBatchStuScoreForFillScore">
276
     <update id="updateBatchStuScoreForFillScore">
277
         <foreach collection="list" item="p" separator=";">
277
         <foreach collection="list" item="p" separator=";">
278
-            update ms_paper_student set stuscore=#{p.fillscore},stuscoretype=2 where mpsid=#{p.mpsid} and stuscoretype=0
278
+            update ms_paper_student set stuscore=#{p.fillscore},stuscoretype=2 where mpsid=#{p.mpsid} and stuscoretype!=1
279
         </foreach>
279
         </foreach>
280
     </update>
280
     </update>
281
     <!--补录成绩-清空学生补录分数-->
281
     <!--补录成绩-清空学生补录分数-->

Loading…
Cancel
Save