Commit 4fd2e08c8ffb9361c6450441d247956c30b7693c
1 parent
91a745c9
修复接口中的bug
Showing
9 changed files
with
227 additions
and
23 deletions
WebRoot/WEB-INF/jsp/sunvote/teacher/teacher_main.jsp
@@ -170,7 +170,7 @@ | @@ -170,7 +170,7 @@ | ||
170 | <div class="modal-content"> | 170 | <div class="modal-content"> |
171 | <div class="modal-header"> | 171 | <div class="modal-header"> |
172 | <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> | 172 | <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> |
173 | - <h4 class="modal-title">考试时间</h4> | 173 | + <h4 class="modal-title">新建试卷</h4> |
174 | </div> | 174 | </div> |
175 | <div class="modal-body"> | 175 | <div class="modal-body"> |
176 | <div class="form-group"> | 176 | <div class="form-group"> |
resources/mybatis1/api/V1Mapper.xml
@@ -35,6 +35,11 @@ | @@ -35,6 +35,11 @@ | ||
35 | SELECT | 35 | SELECT |
36 | STUDENT_ID, | 36 | STUDENT_ID, |
37 | sv_student.`NAME`, | 37 | sv_student.`NAME`, |
38 | + sv_student.`SNO`, | ||
39 | + sv_student.`NUMBER`, | ||
40 | + sv_student.`GROUPID`, | ||
41 | + sv_student.`SIGN_NO`, | ||
42 | + sv_student.`SEX`, | ||
38 | sv_student.`KEYPAD_ID` | 43 | sv_student.`KEYPAD_ID` |
39 | FROM | 44 | FROM |
40 | sv_classroster | 45 | sv_classroster |
@@ -76,8 +81,8 @@ | @@ -76,8 +81,8 @@ | ||
76 | <select id="getTestPaperInfo" parameterType="pd" resultType="pd"> | 81 | <select id="getTestPaperInfo" parameterType="pd" resultType="pd"> |
77 | SELECT | 82 | SELECT |
78 | sv_question.OPTION_NUM, | 83 | sv_question.OPTION_NUM, |
79 | - sv_paperquestion.SCORE, | ||
80 | sv_paperquestion.PART_SCORE, | 84 | sv_paperquestion.PART_SCORE, |
85 | + sv_paperquestion.SCORE, | ||
81 | sv_paperquestion.RANK, | 86 | sv_paperquestion.RANK, |
82 | sv_paperquestion.NO_NAME, | 87 | sv_paperquestion.NO_NAME, |
83 | sv_question.ANALYSIS, | 88 | sv_question.ANALYSIS, |
@@ -86,6 +91,7 @@ | @@ -86,6 +91,7 @@ | ||
86 | sv_question.CONTENT, | 91 | sv_question.CONTENT, |
87 | sv_question.ANSWER, | 92 | sv_question.ANSWER, |
88 | sv_question.OPTION_CONTENT, | 93 | sv_question.OPTION_CONTENT, |
94 | + sv_question.PROBLEM_TYPE_ID, | ||
89 | sv_question.P_ID | 95 | sv_question.P_ID |
90 | FROM | 96 | FROM |
91 | sv_paperquestion | 97 | sv_paperquestion |
@@ -110,6 +116,7 @@ | @@ -110,6 +116,7 @@ | ||
110 | sv_question.DIFFICULTY, | 116 | sv_question.DIFFICULTY, |
111 | sv_question.QUESTION_ID, | 117 | sv_question.QUESTION_ID, |
112 | sv_question.CONTENT, | 118 | sv_question.CONTENT, |
119 | + sv_question.PROBLEM_TYPE_ID, | ||
113 | sv_question.ANSWER, | 120 | sv_question.ANSWER, |
114 | sv_question.OPTION_CONTENT | 121 | sv_question.OPTION_CONTENT |
115 | FROM | 122 | FROM |
resources/mybatis1/sunvote/PaperMapper.xml
@@ -21,6 +21,7 @@ | @@ -21,6 +21,7 @@ | ||
21 | PAPER_STATE, | 21 | PAPER_STATE, |
22 | REMARK, | 22 | REMARK, |
23 | SCORE, | 23 | SCORE, |
24 | + QUESTION_NUM, | ||
24 | PAPER_ID | 25 | PAPER_ID |
25 | </sql> | 26 | </sql> |
26 | 27 | ||
@@ -38,6 +39,7 @@ | @@ -38,6 +39,7 @@ | ||
38 | #{PAPER_STATE}, | 39 | #{PAPER_STATE}, |
39 | #{REMARK}, | 40 | #{REMARK}, |
40 | #{SCORE}, | 41 | #{SCORE}, |
42 | + #{QUESTION_NUM}, | ||
41 | #{PAPER_ID} | 43 | #{PAPER_ID} |
42 | </sql> | 44 | </sql> |
43 | 45 | ||
@@ -77,6 +79,7 @@ | @@ -77,6 +79,7 @@ | ||
77 | PAPER_STATE = #{PAPER_STATE}, | 79 | PAPER_STATE = #{PAPER_STATE}, |
78 | REMARK = #{REMARK}, | 80 | REMARK = #{REMARK}, |
79 | SCORE = #{SCORE}, | 81 | SCORE = #{SCORE}, |
82 | + QUESTION_NUM = #{QUESTION_NUM}, | ||
80 | PAPER_ID = PAPER_ID | 83 | PAPER_ID = PAPER_ID |
81 | where | 84 | where |
82 | PAPER_ID = #{PAPER_ID} | 85 | PAPER_ID = #{PAPER_ID} |
resources/mybatis1/sunvote/SClassMapper.xml
@@ -91,15 +91,14 @@ | @@ -91,15 +91,14 @@ | ||
91 | from | 91 | from |
92 | <include refid="tableName"></include> | 92 | <include refid="tableName"></include> |
93 | where 1=1 | 93 | where 1=1 |
94 | - <if test="pd.keywords!= null and pd.keywords != ''"><!-- 关键词检索 --> | ||
95 | - and | ||
96 | - ( | ||
97 | - <!-- 根据需求自己加检索条件 | ||
98 | - 字段1 LIKE CONCAT(CONCAT('%', #{pd.keywords}),'%') | ||
99 | - or | ||
100 | - 字段2 LIKE CONCAT(CONCAT('%', #{pd.keywords}),'%') | ||
101 | - --> | ||
102 | - ) | 94 | + <if test="SCHOOL_ID != null and SCHOOL_ID != ''"> |
95 | + and ( SCHOOL_ID = #{SCHOOL_ID} ) | ||
96 | + </if> | ||
97 | + <if test="GRADE_ID != null and GRADE_ID != ''"> | ||
98 | + and ( GRADE_ID = #{GRADE_ID} ) | ||
99 | + </if> | ||
100 | + <if test="CLASS_TYPE != null and CLASS_TYPE != ''"> | ||
101 | + and ( CLASS_TYPE = #{CLASS_TYPE} ) | ||
103 | </if> | 102 | </if> |
104 | </select> | 103 | </select> |
105 | 104 | ||
@@ -109,6 +108,17 @@ | @@ -109,6 +108,17 @@ | ||
109 | <include refid="Field"></include> | 108 | <include refid="Field"></include> |
110 | from | 109 | from |
111 | <include refid="tableName"></include> | 110 | <include refid="tableName"></include> |
111 | + where 1=1 | ||
112 | + <if test="SCHOOL_ID != null and SCHOOL_ID != ''"> | ||
113 | + and ( SCHOOL_ID = #{SCHOOL_ID} ) | ||
114 | + </if> | ||
115 | + <if test="GRADE_ID != null and GRADE_ID != ''"> | ||
116 | + and ( GRADE_ID = #{GRADE_ID} ) | ||
117 | + </if> | ||
118 | + <if test="CLASS_TYPE != null and CLASS_TYPE != ''"> | ||
119 | + and ( CLASS_TYPE = #{CLASS_TYPE} ) | ||
120 | + </if> | ||
121 | + | ||
112 | </select> | 122 | </select> |
113 | 123 | ||
114 | <!-- 批量删除 --> | 124 | <!-- 批量删除 --> |
resources/mybatis1/sunvote/SchoolGradeSubjectMapper.xml
@@ -90,6 +90,55 @@ | @@ -90,6 +90,55 @@ | ||
90 | <include refid="Field"></include> | 90 | <include refid="Field"></include> |
91 | from | 91 | from |
92 | <include refid="tableName"></include> | 92 | <include refid="tableName"></include> |
93 | + where 1=1 | ||
94 | + | ||
95 | + <if test=" SCHOOL_ID != null and SCHOOL_ID != ''"> | ||
96 | + and ( SCHOOL_ID = #{SCHOOL_ID} ) | ||
97 | + </if> | ||
98 | + <if test=" GRADE_ID != null and GRADE_ID != ''"> | ||
99 | + and ( GRADE_ID = #{GRADE_ID} ) | ||
100 | + </if> | ||
101 | + <if test=" SUBJECT_ID != null and SUBJECT_ID != ''"> | ||
102 | + and ( SUBJECT_ID = #{SUBJECT_ID} ) | ||
103 | + </if> | ||
104 | + | ||
105 | + </select> | ||
106 | + | ||
107 | + <!-- 列表(所有年级) --> | ||
108 | + <select id="listAllGrade" parameterType="pd" resultType="pd"> | ||
109 | + select | ||
110 | + SV_GRADE.NAME,SV_GRADE.DESC,REMARK,ID | ||
111 | + from | ||
112 | + SV_SCHOOLGRADESUBJECT inner join SV_GRADE on SV_SCHOOLGRADESUBJECT.GRADE_ID = SV_GRADE.ID | ||
113 | + where 1=1 | ||
114 | + | ||
115 | + <if test=" SCHOOL_ID != null and SCHOOL_ID != ''"> | ||
116 | + and ( SCHOOL_ID = #{SCHOOL_ID} ) | ||
117 | + </if> | ||
118 | + | ||
119 | + group by GRADE_ID | ||
120 | + </select> | ||
121 | + | ||
122 | + <!-- 列表(所有科目) --> | ||
123 | + <select id="listAllSubject" parameterType="pd" resultType="pd"> | ||
124 | + select | ||
125 | + SV_SUBJECT.CNAME, | ||
126 | + SV_SUBJECT.ENAME, | ||
127 | + SV_SUBJECT.REMARK, | ||
128 | + SV_SUBJECT.ID | ||
129 | + from | ||
130 | + SV_SCHOOLGRADESUBJECT inner join SV_SUBJECT on SV_SCHOOLGRADESUBJECT.SUBJECT_ID = SV_SUBJECT.ID | ||
131 | + where 1=1 | ||
132 | + <if test=" SCHOOL_ID != null and SCHOOL_ID != ''"> | ||
133 | + and ( SCHOOL_ID = #{SCHOOL_ID} ) | ||
134 | + </if> | ||
135 | + | ||
136 | + <if test=" GRADE_ID != null and GRADE_ID != ''"> | ||
137 | + and ( GRADE_ID = #{GRADE_ID} ) | ||
138 | + </if> | ||
139 | + | ||
140 | + group by SUBJECT_ID | ||
141 | + | ||
93 | </select> | 142 | </select> |
94 | 143 | ||
95 | <!-- 批量删除 --> | 144 | <!-- 批量删除 --> |
src/com/fh/bean/Question.java
@@ -41,6 +41,8 @@ public class Question { | @@ -41,6 +41,8 @@ public class Question { | ||
41 | private String sug_score; | 41 | private String sug_score; |
42 | 42 | ||
43 | private String sug_part_score; | 43 | private String sug_part_score; |
44 | + | ||
45 | + private String questionType = "" ; | ||
44 | 46 | ||
45 | private List<Question> questions; | 47 | private List<Question> questions; |
46 | 48 | ||
@@ -204,4 +206,13 @@ public class Question { | @@ -204,4 +206,13 @@ public class Question { | ||
204 | return this.questions; | 206 | return this.questions; |
205 | } | 207 | } |
206 | 208 | ||
209 | + public String getQuestionType() { | ||
210 | + return questionType; | ||
211 | + } | ||
212 | + | ||
213 | + public void setQuestionType(String questionType) { | ||
214 | + this.questionType = questionType; | ||
215 | + } | ||
216 | + | ||
217 | + | ||
207 | } | 218 | } |
src/com/fh/controller/api/V1.java
@@ -186,8 +186,8 @@ public class V1 extends BaseController { | @@ -186,8 +186,8 @@ public class V1 extends BaseController { | ||
186 | @ResponseBody | 186 | @ResponseBody |
187 | public Object sclass() throws Exception { | 187 | public Object sclass() throws Exception { |
188 | PageData pd = this.getPageData(); | 188 | PageData pd = this.getPageData(); |
189 | - ResponseGson<PageData> res = new ResponseGson(); | ||
190 | if (pd.containsKey("ID")) { | 189 | if (pd.containsKey("ID")) { |
190 | + ResponseGson<PageData> res = new ResponseGson(); | ||
191 | PageData pageData = sclassService.findById(pd); | 191 | PageData pageData = sclassService.findById(pd); |
192 | if (pageData != null && pageData.containsKey("ID")) { | 192 | if (pageData != null && pageData.containsKey("ID")) { |
193 | PageData pt = new PageData(); | 193 | PageData pt = new PageData(); |
@@ -198,11 +198,67 @@ public class V1 extends BaseController { | @@ -198,11 +198,67 @@ public class V1 extends BaseController { | ||
198 | } else { | 198 | } else { |
199 | res.set2Error(); | 199 | res.set2Error(); |
200 | } | 200 | } |
201 | + return res.toJson(); | ||
202 | + } else { | ||
203 | + ResponseGson<List<PageData>> res = new ResponseGson(); | ||
204 | + List<PageData> list = sclassService.listAll(pd); | ||
205 | + res.setData(list); | ||
206 | + return res.toJson(); | ||
207 | + | ||
208 | + } | ||
209 | + } | ||
210 | + | ||
211 | + @RequestMapping(value = "/questiontype", produces = "application/json;charset=UTF-8") | ||
212 | + @ResponseBody | ||
213 | + public Object questiontype() throws Exception { | ||
214 | + PageData pd = this.getPageData(); | ||
215 | + ResponseGson<List<PageData>> res = new ResponseGson(); | ||
216 | + List<PageData> list = questiontypeService.listAll(pd); | ||
217 | + res.setData(list); | ||
218 | + return res.toJson(); | ||
219 | + } | ||
220 | + | ||
221 | + @RequestMapping(value = "/classtype", produces = "application/json;charset=UTF-8") | ||
222 | + @ResponseBody | ||
223 | + public Object classtype() throws Exception { | ||
224 | + PageData pd = this.getPageData(); | ||
225 | + ResponseGson<List<PageData>> res = new ResponseGson(); | ||
226 | + List<PageData> list = classtypeService.listAll(pd); | ||
227 | + res.setData(list); | ||
228 | + return res.toJson(); | ||
229 | + } | ||
230 | + | ||
231 | + @RequestMapping(value = "/grade", produces = "application/json;charset=UTF-8") | ||
232 | + @ResponseBody | ||
233 | + public Object grade() throws Exception { | ||
234 | + PageData pd = this.getPageData(); | ||
235 | + ResponseGson<List<PageData>> res = new ResponseGson(); | ||
236 | + if (!pd.containsKey("SCHOOL_ID")) { | ||
237 | + List<PageData> list = gradeService.listAll(pd); | ||
238 | + res.setData(list); | ||
201 | } else { | 239 | } else { |
202 | - res.set2Error(); | 240 | + List<PageData> list = schoolgradesubjectService.listAllGrade(pd); |
241 | + res.setData(list); | ||
203 | } | 242 | } |
204 | return res.toJson(); | 243 | return res.toJson(); |
205 | } | 244 | } |
245 | + | ||
246 | + @RequestMapping(value = "/subject", produces = "application/json;charset=UTF-8") | ||
247 | + @ResponseBody | ||
248 | + public Object subject() throws Exception { | ||
249 | + PageData pd = this.getPageData(); | ||
250 | + ResponseGson<List<PageData>> res = new ResponseGson(); | ||
251 | + if (!pd.containsKey("SCHOOL_ID")) { | ||
252 | + List<PageData> list = subjectService.listAll(pd); | ||
253 | + res.setData(list); | ||
254 | + } else { | ||
255 | + List<PageData> list = schoolgradesubjectService.listAllSubject(pd); | ||
256 | + res.setData(list); | ||
257 | + } | ||
258 | + return res.toJson(); | ||
259 | + } | ||
260 | + | ||
261 | + | ||
206 | 262 | ||
207 | @RequestMapping(value = "/keypadscan", produces = "application/json;charset=UTF-8") | 263 | @RequestMapping(value = "/keypadscan", produces = "application/json;charset=UTF-8") |
208 | @ResponseBody | 264 | @ResponseBody |
@@ -296,9 +352,10 @@ public class V1 extends BaseController { | @@ -296,9 +352,10 @@ public class V1 extends BaseController { | ||
296 | question.setAnalysis(qpd.getString("ANALYSIS")); | 352 | question.setAnalysis(qpd.getString("ANALYSIS")); |
297 | question.setQuestion_from(qpd | 353 | question.setQuestion_from(qpd |
298 | .getString("QUESTION_FROM")); | 354 | .getString("QUESTION_FROM")); |
299 | - question.setSug_score(qpd.getString("SUG_SCORE")); | ||
300 | - question.setSug_part_score(qpd | ||
301 | - .getString("SUG_PART_SCORE")); | 355 | + question.setScore(qpd.getString("SCORE")); |
356 | + question.setPart_score(qpd | ||
357 | + .getString("PART_SCORE")); | ||
358 | + question.setQuestionType(qpd.getString("PROBLEM_TYPE_ID")); | ||
302 | question.setRank(qpd.getString("RANK")); | 359 | question.setRank(qpd.getString("RANK")); |
303 | question.setNo_name(qpd.getString("NO_NAME")); | 360 | question.setNo_name(qpd.getString("NO_NAME")); |
304 | if ("-1".equals("" + qpd.getString("P_ID"))) { | 361 | if ("-1".equals("" + qpd.getString("P_ID"))) { |
@@ -326,9 +383,10 @@ public class V1 extends BaseController { | @@ -326,9 +383,10 @@ public class V1 extends BaseController { | ||
326 | qq.setAnalysis(q.getString("ANALYSIS")); | 383 | qq.setAnalysis(q.getString("ANALYSIS")); |
327 | qq.setQuestion_from(q | 384 | qq.setQuestion_from(q |
328 | .getString("QUESTION_FROM")); | 385 | .getString("QUESTION_FROM")); |
329 | - qq.setSug_score(q.getString("SUG_SCORE")); | ||
330 | - qq.setSug_part_score(q | ||
331 | - .getString("SUG_PART_SCORE")); | 386 | + qq.setScore(q.getString("SCORE")); |
387 | + qq.setPart_score(q | ||
388 | + .getString("PART_SCORE")); | ||
389 | + qq.setQuestionType(qpd.getString("PROBLEM_TYPE_ID")); | ||
332 | qq.setRank(q.getString("RANK")); | 390 | qq.setRank(q.getString("RANK")); |
333 | qq.setNo_name(q.getString("NO_NAME")); | 391 | qq.setNo_name(q.getString("NO_NAME")); |
334 | question.getQuestions().add(qq); | 392 | question.getQuestions().add(qq); |
@@ -365,7 +423,32 @@ public class V1 extends BaseController { | @@ -365,7 +423,32 @@ public class V1 extends BaseController { | ||
365 | 423 | ||
366 | return res.toJson(); | 424 | return res.toJson(); |
367 | } | 425 | } |
368 | - | 426 | + |
427 | + @RequestMapping(value = "/question", produces = "application/json;charset=UTF-8") | ||
428 | + @ResponseBody | ||
429 | + public Object question() throws Exception { | ||
430 | + PageData pd = this.getPageData(); | ||
431 | + ResponseGson<PageData> res = new ResponseGson(); | ||
432 | + if(pd.containsKey("ID")){ | ||
433 | + pd.put("QUESTION_ID", pd.get("ID")); | ||
434 | + PageData data = questionService.findById(pd); | ||
435 | + res.setData(data); | ||
436 | + }else{ | ||
437 | + res.setDataError(); | ||
438 | + } | ||
439 | + return res.toJson(); | ||
440 | + } | ||
441 | + | ||
442 | + @RequestMapping(value = "/question/add", produces = "application/json;charset=UTF-8") | ||
443 | + @ResponseBody | ||
444 | + public Object questionAdd() throws Exception { | ||
445 | + PageData pd = this.getPageData(); | ||
446 | + ResponseGson<PageData> res = new ResponseGson(); | ||
447 | + pd.put("QUESTION_ID", this.get32UUID()); | ||
448 | + questionService.save(pd); | ||
449 | + return res.toJson(); | ||
450 | + } | ||
451 | + | ||
369 | @RequestMapping(value = "/uploadpaper", produces = "application/json;charset=UTF-8") | 452 | @RequestMapping(value = "/uploadpaper", produces = "application/json;charset=UTF-8") |
370 | @ResponseBody | 453 | @ResponseBody |
371 | public Object uploadpaper() throws Exception { | 454 | public Object uploadpaper() throws Exception { |
@@ -373,6 +456,7 @@ public class V1 extends BaseController { | @@ -373,6 +456,7 @@ public class V1 extends BaseController { | ||
373 | ResponseGson<String> res = new ResponseGson(); | 456 | ResponseGson<String> res = new ResponseGson(); |
374 | 457 | ||
375 | if (!StringUtils.isEmpty(pd.getJsonString())) { | 458 | if (!StringUtils.isEmpty(pd.getJsonString())) { |
459 | + logger.info(pd.getJsonString()); | ||
376 | Paper paper = Paper.parse(pd.getJsonString()); | 460 | Paper paper = Paper.parse(pd.getJsonString()); |
377 | PageData paperPd = new PageData(); | 461 | PageData paperPd = new PageData(); |
378 | String paperID = this.get32UUID(); | 462 | String paperID = this.get32UUID(); |
@@ -392,7 +476,8 @@ public class V1 extends BaseController { | @@ -392,7 +476,8 @@ public class V1 extends BaseController { | ||
392 | paperPd.put("CREATE_DATE", Tools.date2Str(new Date())); | 476 | paperPd.put("CREATE_DATE", Tools.date2Str(new Date())); |
393 | paperPd.put("MODIFY_DATE", Tools.date2Str(new Date())); | 477 | paperPd.put("MODIFY_DATE", Tools.date2Str(new Date())); |
394 | 478 | ||
395 | - paperService.save(paperPd); | 479 | + int questionNum = 0 ; |
480 | + | ||
396 | 481 | ||
397 | List<Question> questions = paper.getQuestions(); | 482 | List<Question> questions = paper.getQuestions(); |
398 | if (questions != null) { | 483 | if (questions != null) { |
@@ -404,11 +489,12 @@ public class V1 extends BaseController { | @@ -404,11 +489,12 @@ public class V1 extends BaseController { | ||
404 | && question.getQuestions().size() > 0) { | 489 | && question.getQuestions().size() > 0) { |
405 | qPd.put("P_ID", "-1"); | 490 | qPd.put("P_ID", "-1"); |
406 | } else { | 491 | } else { |
492 | + questionNum ++ ; | ||
407 | qPd.put("P_ID", "0"); | 493 | qPd.put("P_ID", "0"); |
408 | } | 494 | } |
409 | qPd.put("SUBJECT_ID", paper.getSubject_id()); | 495 | qPd.put("SUBJECT_ID", paper.getSubject_id()); |
410 | qPd.put("CHAPTER_ID", question.getChapter_id()); | 496 | qPd.put("CHAPTER_ID", question.getChapter_id()); |
411 | - qPd.put("PROBLEM_TYPE_ID", question.getProblem_type_id()); | 497 | + qPd.put("PROBLEM_TYPE_ID", question.getProblem_type_id() == null ? "1" : question.getProblem_type_id()); |
412 | qPd.put("TEACHER_ID", paper.getUser_id()); | 498 | qPd.put("TEACHER_ID", paper.getUser_id()); |
413 | qPd.put("SCHOOL_ID", schoolID); | 499 | qPd.put("SCHOOL_ID", schoolID); |
414 | qPd.put("KNOWLEDGE_ID", question.getKnowledge_id()); | 500 | qPd.put("KNOWLEDGE_ID", question.getKnowledge_id()); |
@@ -445,7 +531,7 @@ public class V1 extends BaseController { | @@ -445,7 +531,7 @@ public class V1 extends BaseController { | ||
445 | cqPd.put("P_ID", questionID); | 531 | cqPd.put("P_ID", questionID); |
446 | cqPd.put("SUBJECT_ID", paper.getSubject_id()); | 532 | cqPd.put("SUBJECT_ID", paper.getSubject_id()); |
447 | cqPd.put("CHAPTER_ID", q.getChapter_id()); | 533 | cqPd.put("CHAPTER_ID", q.getChapter_id()); |
448 | - cqPd.put("PROBLEM_TYPE_ID", q.getProblem_type_id()); | 534 | + cqPd.put("PROBLEM_TYPE_ID", question.getProblem_type_id() == null ? "1" : question.getProblem_type_id()); |
449 | cqPd.put("TEACHER_ID", paper.getUser_id()); | 535 | cqPd.put("TEACHER_ID", paper.getUser_id()); |
450 | cqPd.put("SCHOOL_ID", schoolID); | 536 | cqPd.put("SCHOOL_ID", schoolID); |
451 | cqPd.put("KNOWLEDGE_ID", q.getKnowledge_id()); | 537 | cqPd.put("KNOWLEDGE_ID", q.getKnowledge_id()); |
@@ -474,10 +560,13 @@ public class V1 extends BaseController { | @@ -474,10 +560,13 @@ public class V1 extends BaseController { | ||
474 | cpqPd.put("PAPERQUESTION_ID", this.get32UUID()); | 560 | cpqPd.put("PAPERQUESTION_ID", this.get32UUID()); |
475 | 561 | ||
476 | paperquestionService.save(cpqPd); | 562 | paperquestionService.save(cpqPd); |
563 | + questionNum ++ ; | ||
477 | } | 564 | } |
478 | } | 565 | } |
479 | } | 566 | } |
480 | } | 567 | } |
568 | + paperPd.put("QUESTION_NUM", "" + questionNum); | ||
569 | + paperService.save(paperPd); | ||
481 | 570 | ||
482 | } else { | 571 | } else { |
483 | res.setDataError(); | 572 | res.setDataError(); |
@@ -490,9 +579,11 @@ public class V1 extends BaseController { | @@ -490,9 +579,11 @@ public class V1 extends BaseController { | ||
490 | @RequestMapping(value = "/uploadtestpaper", produces = "application/json;charset=UTF-8") | 579 | @RequestMapping(value = "/uploadtestpaper", produces = "application/json;charset=UTF-8") |
491 | @ResponseBody | 580 | @ResponseBody |
492 | public Object uploadTestpaper() { | 581 | public Object uploadTestpaper() { |
582 | + long cur = System.currentTimeMillis(); | ||
493 | PageData pd = this.getPageData(); | 583 | PageData pd = this.getPageData(); |
494 | ResponseGson<String> res = new ResponseGson(); | 584 | ResponseGson<String> res = new ResponseGson(); |
495 | if (!StringUtils.isEmpty(pd.getJsonString())) { | 585 | if (!StringUtils.isEmpty(pd.getJsonString())) { |
586 | + logger.info(pd.getJsonString()); | ||
496 | TestPaper testPaper = TestPaper.parse(pd.getJsonString()); | 587 | TestPaper testPaper = TestPaper.parse(pd.getJsonString()); |
497 | try { | 588 | try { |
498 | PageData testPd = new PageData(); | 589 | PageData testPd = new PageData(); |
@@ -576,6 +667,7 @@ public class V1 extends BaseController { | @@ -576,6 +667,7 @@ public class V1 extends BaseController { | ||
576 | } else { | 667 | } else { |
577 | res.setDataError(); | 668 | res.setDataError(); |
578 | } | 669 | } |
670 | + logger.info("uploadtestpaper cost time:" + (System.currentTimeMillis() - cur)); | ||
579 | 671 | ||
580 | return res.toJson(); | 672 | return res.toJson(); |
581 | 673 | ||
@@ -704,4 +796,15 @@ public class V1 extends BaseController { | @@ -704,4 +796,15 @@ public class V1 extends BaseController { | ||
704 | return res.toJson(); | 796 | return res.toJson(); |
705 | 797 | ||
706 | } | 798 | } |
799 | + | ||
800 | + | ||
801 | + @RequestMapping(value = "/schooladmin", produces = "application/json;charset=UTF-8") | ||
802 | + @ResponseBody | ||
803 | + public void schoolAdmin(){ | ||
804 | + PageData pd = this.getPageData(); | ||
805 | + this.getUserID(); | ||
806 | + | ||
807 | + | ||
808 | + } | ||
809 | + | ||
707 | } | 810 | } |
src/com/fh/service/sunvote/schoolgradesubject/SchoolGradeSubjectManager.java
1 | package com.fh.service.sunvote.schoolgradesubject; | 1 | package com.fh.service.sunvote.schoolgradesubject; |
2 | 2 | ||
3 | import java.util.List; | 3 | import java.util.List; |
4 | + | ||
4 | import com.fh.entity.Page; | 5 | import com.fh.entity.Page; |
5 | import com.fh.util.PageData; | 6 | import com.fh.util.PageData; |
6 | 7 | ||
@@ -53,5 +54,9 @@ public interface SchoolGradeSubjectManager{ | @@ -53,5 +54,9 @@ public interface SchoolGradeSubjectManager{ | ||
53 | */ | 54 | */ |
54 | public void deleteAll(String[] ArrayDATA_IDS)throws Exception; | 55 | public void deleteAll(String[] ArrayDATA_IDS)throws Exception; |
55 | 56 | ||
57 | + public List<PageData> listAllGrade(PageData pd)throws Exception; | ||
58 | + | ||
59 | + public List<PageData> listAllSubject(PageData pd)throws Exception; | ||
60 | + | ||
56 | } | 61 | } |
57 | 62 |
src/com/fh/service/sunvote/schoolgradesubject/impl/SchoolGradeSubjectService.java
@@ -60,6 +60,22 @@ public class SchoolGradeSubjectService implements SchoolGradeSubjectManager{ | @@ -60,6 +60,22 @@ public class SchoolGradeSubjectService implements SchoolGradeSubjectManager{ | ||
60 | public List<PageData> listAll(PageData pd)throws Exception{ | 60 | public List<PageData> listAll(PageData pd)throws Exception{ |
61 | return (List<PageData>)dao.findForList("SchoolGradeSubjectMapper.listAll", pd); | 61 | return (List<PageData>)dao.findForList("SchoolGradeSubjectMapper.listAll", pd); |
62 | } | 62 | } |
63 | + /**列表(年级) | ||
64 | + * @param pd | ||
65 | + * @throws Exception | ||
66 | + */ | ||
67 | + @SuppressWarnings("unchecked") | ||
68 | + public List<PageData> listAllGrade(PageData pd)throws Exception{ | ||
69 | + return (List<PageData>)dao.findForList("SchoolGradeSubjectMapper.listAllGrade", pd); | ||
70 | + } | ||
71 | + /**列表(科目) | ||
72 | + * @param pd | ||
73 | + * @throws Exception | ||
74 | + */ | ||
75 | + @SuppressWarnings("unchecked") | ||
76 | + public List<PageData> listAllSubject(PageData pd)throws Exception{ | ||
77 | + return (List<PageData>)dao.findForList("SchoolGradeSubjectMapper.listAllSubject", pd); | ||
78 | + } | ||
63 | 79 | ||
64 | /**通过id获取数据 | 80 | /**通过id获取数据 |
65 | * @param pd | 81 | * @param pd |