Browse Source

添加获取附件文件

tags/正式版本
王宁 2 years ago
parent
commit
7f6dcda8e3

+ 9
- 2
sexam/src/main/java/com/xhkjedu/sexam/controller/paper/EPaperController.java View File

5
 import com.xhkjedu.sexam.model.exam.ESubject;
5
 import com.xhkjedu.sexam.model.exam.ESubject;
6
 import com.xhkjedu.sexam.model.paper.EPaper;
6
 import com.xhkjedu.sexam.model.paper.EPaper;
7
 import com.xhkjedu.sexam.model.paper.EPaperBack;
7
 import com.xhkjedu.sexam.model.paper.EPaperBack;
8
+import com.xhkjedu.sexam.model.paperstudent.EPaperStudent;
8
 import com.xhkjedu.sexam.service.paper.EPaperService;
9
 import com.xhkjedu.sexam.service.paper.EPaperService;
9
 import com.xhkjedu.utils.N_Utils;
10
 import com.xhkjedu.utils.N_Utils;
10
 import com.xhkjedu.utils.PageUtil;
11
 import com.xhkjedu.utils.PageUtil;
59
         return new ResultVo(0,"成功获取试卷退回原因",list);
60
         return new ResultVo(0,"成功获取试卷退回原因",list);
60
     }
61
     }
61
 
62
 
62
-
63
-
64
     //教师出卷列表
63
     //教师出卷列表
65
     @PostMapping("/listt")
64
     @PostMapping("/listt")
66
     public ResultVo examTeacherPaperList(@RequestBody ESubject subject){
65
     public ResultVo examTeacherPaperList(@RequestBody ESubject subject){
73
         return new ResultVo(0,"成功获取教师出卷信息",pageResult);
72
         return new ResultVo(0,"成功获取教师出卷信息",pageResult);
74
     }
73
     }
75
 
74
 
75
+    //获取试卷文件
76
+    @PostMapping("/files")
77
+    public ResultVo listPaperFiles(@RequestBody EPaperStudent ePaperStudent){
78
+        N_Utils.validation(new Object[]{ePaperStudent.getEpsid(),"学生试卷id",1});
79
+        List<Map> list = ePaperService.listExamPaperFiles(ePaperStudent.getEpsid());
80
+        return new ResultVo(0,"成功获取试卷文件",list);
81
+    }
82
+
76
 
83
 
77
 }
84
 }

+ 2
- 0
sexam/src/main/java/com/xhkjedu/sexam/mapper/paper/EPaperFileMapper.java View File

18
 
18
 
19
     //删除附件
19
     //删除附件
20
     void deleteByEpid(@Param("epid") Integer epid);
20
     void deleteByEpid(@Param("epid") Integer epid);
21
+
22
+    List<Map> listPaperFilesByEpsid(@Param("epsid") Integer epsid);
21
 }
23
 }

+ 3
- 0
sexam/src/main/java/com/xhkjedu/sexam/service/paper/EPaperQtypeService.java View File

179
     //设置附件
179
     //设置附件
180
     private void setPaperFiles(EPaper paper,List<EPaperFile> pfiles) {
180
     private void setPaperFiles(EPaper paper,List<EPaperFile> pfiles) {
181
         if(paper.getHasfile() == 1){
181
         if(paper.getHasfile() == 1){
182
+            int order= 1;
182
             for(EPaperFile pf :pfiles){
183
             for(EPaperFile pf :pfiles){
183
                 pf.setCreateid(paper.getCreateid());
184
                 pf.setCreateid(paper.getCreateid());
184
                 pf.setCreatetime(paper.getHandletime());
185
                 pf.setCreatetime(paper.getHandletime());
185
                 pf.setEpid(paper.getEpid());
186
                 pf.setEpid(paper.getEpid());
187
+                pf.setFileorder(order);
188
+                order ++;
186
             }
189
             }
187
         }
190
         }
188
     }
191
     }

+ 8
- 0
sexam/src/main/java/com/xhkjedu/sexam/service/paper/EPaperService.java View File

4
 import com.xhkjedu.sexam.mapper.exam.ESubjectMapper;
4
 import com.xhkjedu.sexam.mapper.exam.ESubjectMapper;
5
 import com.xhkjedu.sexam.mapper.paper.EPaperAnalyzeMapper;
5
 import com.xhkjedu.sexam.mapper.paper.EPaperAnalyzeMapper;
6
 import com.xhkjedu.sexam.mapper.paper.EPaperBackMapper;
6
 import com.xhkjedu.sexam.mapper.paper.EPaperBackMapper;
7
+import com.xhkjedu.sexam.mapper.paper.EPaperFileMapper;
7
 import com.xhkjedu.sexam.mapper.paper.EPaperMapper;
8
 import com.xhkjedu.sexam.mapper.paper.EPaperMapper;
8
 import com.xhkjedu.sexam.model.paper.EPaper;
9
 import com.xhkjedu.sexam.model.paper.EPaper;
9
 import com.xhkjedu.sexam.model.paper.EPaperAnalyze;
10
 import com.xhkjedu.sexam.model.paper.EPaperAnalyze;
37
     private EPaperAnalyzeMapper ePaperAnalyzeMapper;
38
     private EPaperAnalyzeMapper ePaperAnalyzeMapper;
38
     @Resource
39
     @Resource
39
     private EBaseMapper eBaseMapper;
40
     private EBaseMapper eBaseMapper;
41
+    @Resource
42
+    private EPaperFileMapper ePaperFileMapper;
40
 
43
 
41
 
44
 
42
 
45
 
89
         return ePaperMapper.listExamPapersByTeacherid(teacherid,esstate);
92
         return ePaperMapper.listExamPapersByTeacherid(teacherid,esstate);
90
     }
93
     }
91
 
94
 
95
+    //根据试卷学生id获取附件文件
96
+    public List<Map> listExamPaperFiles(Integer epsid){
97
+        return ePaperFileMapper.listPaperFilesByEpsid(epsid);
98
+    }
99
+
92
 
100
 
93
 
101
 
94
 }
102
 }

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

1
 package com.xhkjedu.sexam.service.paperstudent;
1
 package com.xhkjedu.sexam.service.paperstudent;
2
 
2
 
3
 import com.alibaba.fastjson.JSON;
3
 import com.alibaba.fastjson.JSON;
4
+import com.xhkjedu.sexam.mapper.paper.EPaperFileMapper;
4
 import com.xhkjedu.sexam.mapper.paper.EPaperQtypeMapper;
5
 import com.xhkjedu.sexam.mapper.paper.EPaperQtypeMapper;
5
 import com.xhkjedu.sexam.mapper.paperstudent.EPaperStudentMapper;
6
 import com.xhkjedu.sexam.mapper.paperstudent.EPaperStudentMapper;
6
 import com.xhkjedu.sexam.mapper.paperstudent.EPaperStudentQuestionMapper;
7
 import com.xhkjedu.sexam.mapper.paperstudent.EPaperStudentQuestionMapper;
7
 import com.xhkjedu.sexam.mapper.system.UserMapper;
8
 import com.xhkjedu.sexam.mapper.system.UserMapper;
9
+import com.xhkjedu.sexam.model.paper.EPaperFile;
8
 import com.xhkjedu.sexam.model.paper.EPaperQtype;
10
 import com.xhkjedu.sexam.model.paper.EPaperQtype;
9
 import com.xhkjedu.sexam.model.paper.EPaperQtypeQuestion;
11
 import com.xhkjedu.sexam.model.paper.EPaperQtypeQuestion;
10
 import com.xhkjedu.sexam.model.paperstudent.EPaperStudent;
12
 import com.xhkjedu.sexam.model.paperstudent.EPaperStudent;
41
     private EPaperStudentQuestionMapper ePaperStudentQuestionMapper;
43
     private EPaperStudentQuestionMapper ePaperStudentQuestionMapper;
42
     @Resource
44
     @Resource
43
     private UserMapper userMapper;
45
     private UserMapper userMapper;
46
+    @Resource
47
+    private EPaperFileMapper ePaperFileMapper;
44
     @Autowired
48
     @Autowired
45
     private ConvertUtil convertUtil;
49
     private ConvertUtil convertUtil;
46
 
50
 
112
                 questions = ePaperStudentMapper.listStuPaperFjQuestionsForAndroid(epsid);
116
                 questions = ePaperStudentMapper.listStuPaperFjQuestionsForAndroid(epsid);
113
             }
117
             }
114
         }
118
         }
119
+
115
         return questions;
120
         return questions;
116
     }
121
     }
117
 
122
 
174
             }
179
             }
175
         }
180
         }
176
 
181
 
182
+        if(ptype==2){
183
+            List<Map> files = ePaperFileMapper.listPaperFiles(psvo.getEpid());
184
+            psvo.setFiles(files);
185
+        }
186
+
177
         psvo.setQtypelist(questions);
187
         psvo.setQtypelist(questions);
178
         return psvo;
188
         return psvo;
179
     }
189
     }

+ 3
- 0
sexam/src/main/java/com/xhkjedu/sexam/vo/paperstudent/EPaperStudentVo.java View File

51
 
51
 
52
     //试题集合
52
     //试题集合
53
     private List<EPaperQtype> qtypelist;
53
     private List<EPaperQtype> qtypelist;
54
+
55
+    //附件
56
+    private List<Map> files;
54
 }
57
 }

+ 7
- 0
sexam/src/main/resources/mapper/paper/EPaperFileMapper.xml View File

10
     <delete id="deleteByEpid">
10
     <delete id="deleteByEpid">
11
         delete from e_paper_file where epid=#{epid}
11
         delete from e_paper_file where epid=#{epid}
12
     </delete>
12
     </delete>
13
+
14
+    <!--获取文件信息-->
15
+    <select id="listPaperFilesByEpsid" resultType="java.util.Map">
16
+        select f.* from e_paper_file f
17
+        left join e_paper_student ps on f.epid=ps.epid
18
+        where ps.epsid=99 group by f.epfid order by fileorder
19
+    </select>
13
 </mapper>
20
 </mapper>

Loading…
Cancel
Save