Browse Source

修改学生分值搜索学生,修改获取试卷

tags/正式版本
王宁 2 years ago
parent
commit
145b2d234a

+ 15
- 2
sexam/src/main/java/com/xhkjedu/sexam/controller/paperstudent/EPaperStudentController.java View File

@@ -153,8 +153,8 @@ public class EPaperStudentController {
153 153
     @PostMapping("/spscore")
154 154
     public ResultVo getStudentPaperScore(@RequestBody EPaperStudent ps) {
155 155
         try {
156
-            N_Utils.validation(new Object[]{ps.getStudentid(),"学生id",1,ps.getEpid(),"试卷id",1});
157
-            Map map = ePaperStudentService.getStudentPaperScore(ps.getStudentid(),ps.getEpid());
156
+            N_Utils.validation(new Object[]{ps.getEpsid(),"学生试卷id",1});
157
+            Map map = ePaperStudentService.getStudentPaperScore(ps.getEpsid());
158 158
             return new ResultVo(0, "成功获取学生试卷作答及得分",map);
159 159
         } catch (Exception e) {
160 160
             log.error("获取学生试卷作答及得分失败:" + e.getMessage());
@@ -162,4 +162,17 @@ public class EPaperStudentController {
162 162
         }
163 163
     }
164 164
 
165
+    //搜索考试学生
166
+    @PostMapping("/searchstu")
167
+    public ResultVo getStuSubjectPaperByname(@RequestBody EPaperStudent ps) {
168
+        try {
169
+            N_Utils.validation(new Object[]{ps.getExamid(),"考试id",1,ps.getSubjectid(),"科目id",3});
170
+            List<Map> rtnlst = ePaperStudentService.getStuSubjectPaperByname(ps);
171
+            return new ResultVo(0, "成功搜索学生",rtnlst);
172
+        } catch (Exception e) {
173
+            log.error("搜索学生失败:" + e.getMessage());
174
+            return new ResultVo(1, "搜索学生失败");
175
+        }
176
+    }
177
+
165 178
 }

+ 4
- 1
sexam/src/main/java/com/xhkjedu/sexam/mapper/paperstudent/EPaperStudentMapper.java View File

@@ -62,5 +62,8 @@ public interface EPaperStudentMapper extends TkMapper<EPaperStudent> {
62 62
     void updateStuPaperscoreEpsid(@Param("epsid")Integer epsid);
63 63
 
64 64
     //获取学生试卷基础信息和得分
65
-    Map getStudentPaperScore(@Param("studentid") Integer studentid,@Param("epid") Integer epid);
65
+    Map getStudentPaperScore(@Param("epsid") Integer epsid);
66
+
67
+    //搜索考试学生获取学生试卷id
68
+    List<Map> getStuSubjectPaperByname(@Param("ps")EPaperStudent ps);
66 69
 }

+ 4
- 0
sexam/src/main/java/com/xhkjedu/sexam/model/paperstudent/EPaperStudent.java View File

@@ -5,6 +5,7 @@ import lombok.Data;
5 5
 
6 6
 import javax.persistence.Id;
7 7
 import javax.persistence.Table;
8
+import javax.persistence.Transient;
8 9
 
9 10
 @Table(name = "e_paper_student")
10 11
 @Data
@@ -69,4 +70,7 @@ public class EPaperStudent extends BaseBean {
69 70
 
70 71
     //扫描批次id
71 72
     private Integer batchid;
73
+
74
+    @Transient
75
+    private String stuname;
72 76
 }

+ 10
- 3
sexam/src/main/java/com/xhkjedu/sexam/service/paperstudent/EPaperStudentService.java View File

@@ -557,16 +557,18 @@ public class EPaperStudentService {
557 557
      * @Author wn
558 558
      * @Date 2022/8/12 10:45
559 559
      **/
560
-    public Map getStudentPaperScore(Integer studentid,Integer epid){
561
-        Map paper = ePaperStudentMapper.getStudentPaperScore(studentid,epid);
560
+    public Map getStudentPaperScore(Integer epsid){
561
+        Map paper = ePaperStudentMapper.getStudentPaperScore(epsid);
562 562
         Integer ptype = Integer.parseInt(paper.get("ptype").toString());
563
-        Integer epsid = Integer.parseInt(paper.get("epsid").toString());
563
+        Integer epid = Integer.parseInt(paper.get("epid").toString());
564 564
         List<Map> qtypeques = null;
565 565
         if(ptype == 1){
566 566
             qtypeques = ePaperStudentQuestionMapper.listQStuQuestionScore(epsid);
567 567
             setQuestionsForPaper(qtypeques);
568 568
         }else{
569 569
             qtypeques = ePaperStudentQuestionMapper.listFjStuQuestionScore(epsid);
570
+            List<Map> files = ePaperFileMapper.listPaperFiles(epid);
571
+            paper.put("files",files);
570 572
         }
571 573
         paper.put("qtypes",qtypeques);
572 574
         return paper;
@@ -609,4 +611,9 @@ public class EPaperStudentService {
609 611
         }
610 612
     }
611 613
 
614
+    //搜索考试学生获取学生试卷id
615
+    public List<Map> getStuSubjectPaperByname(EPaperStudent ps){
616
+        return ePaperStudentMapper.getStuSubjectPaperByname(ps);
617
+    }
618
+
612 619
 }

+ 13
- 1
sexam/src/main/resources/mapper/paperstudent/EPaperStudentMapper.xml View File

@@ -210,6 +210,18 @@
210 210
         left join t_user u on ps.studentid=u.userid
211 211
         left join e_class_student cs on cs.studentid=ps.studentid
212 212
         left join e_class c on cs.classid=c.classid
213
-        where ps.studentid=#{studentid} and ps.epid=#{epid} group by ps.studentid
213
+        where ps.epsid=#{epsid} group by ps.studentid
214
+    </select>
215
+
216
+    <!--搜索考试学生获取学生试卷id-->
217
+    <select id="getStuSubjectPaperByname" resultType="java.util.Map" parameterType="com.xhkjedu.sexam.model.paperstudent.EPaperStudent">
218
+        select ps.epsid, ps.studentid,u.username stuname,u.examno from e_paper_student ps
219
+        left join t_user u on ps.studentid=u.userid
220
+        where ps.examid=#{ps.examid} and ps.subjectid=#{ps.subjectid}
221
+        <if test="ps.classid!=null and ps.classid!='0'">
222
+            and ps.classid=#{ps.classid}
223
+        </if>
224
+        and u.username like concat('%',#{ps.stuname,jdbcType=VARCHAR},'%')
225
+        group by ps.studentid
214 226
     </select>
215 227
 </mapper>

Loading…
Cancel
Save