Commit 694fbd54462ec5e9a892ca47f569a81311b34191

Authored by 孙向锦
1 parent be2f84a1

添加作业管理模块

resources/mybatis1/sunvote/HomeworkMapper.xml
@@ -20,6 +20,7 @@ @@ -20,6 +20,7 @@
20 MODIFY_DATE, 20 MODIFY_DATE,
21 COMPLETE_COUNT, 21 COMPLETE_COUNT,
22 ALL_SCORE, 22 ALL_SCORE,
  23 + TEACHER_ID,
23 HOMEWORK_ID 24 HOMEWORK_ID
24 </sql> 25 </sql>
25 26
@@ -36,6 +37,7 @@ @@ -36,6 +37,7 @@
36 #{MODIFY_DATE}, 37 #{MODIFY_DATE},
37 #{COMPLETE_COUNT}, 38 #{COMPLETE_COUNT},
38 #{ALL_SCORE}, 39 #{ALL_SCORE},
  40 + #{TEACHER_ID},
39 #{HOMEWORK_ID} 41 #{HOMEWORK_ID}
40 </sql> 42 </sql>
41 43
@@ -74,6 +76,7 @@ @@ -74,6 +76,7 @@
74 MODIFY_DATE = #{MODIFY_DATE}, 76 MODIFY_DATE = #{MODIFY_DATE},
75 COMPLETE_COUNT = #{COMPLETE_COUNT}, 77 COMPLETE_COUNT = #{COMPLETE_COUNT},
76 ALL_SCORE = #{ALL_SCORE}, 78 ALL_SCORE = #{ALL_SCORE},
  79 + TEACHER_ID = #{TEACHER_ID},
77 HOMEWORK_ID = HOMEWORK_ID 80 HOMEWORK_ID = HOMEWORK_ID
78 where 81 where
79 HOMEWORK_ID = #{HOMEWORK_ID} 82 HOMEWORK_ID = #{HOMEWORK_ID}
@@ -114,6 +117,27 @@ @@ -114,6 +117,27 @@
114 <include refid="Field"></include> 117 <include refid="Field"></include>
115 from 118 from
116 <include refid="tableName"></include> 119 <include refid="tableName"></include>
  120 + where 1 = 1
  121 + <if test="pd.SUBJECT_ID != null and pd.SUBJECT_ID != ''"><!-- 关键词检索 -->
  122 + and SUBJECT_ID = #{SUBJECT_ID}
  123 + </if>
  124 + <if test="pd.CLASS_ID != null and pd.CLASS_ID != ''"><!-- 关键词检索 -->
  125 + and CLASS_ID = #{CLASS_ID}
  126 + </if>
  127 + <if test="pd.GRADE_ID != null and pd.GRADE_ID != ''"><!-- 关键词检索 -->
  128 + and GRADE_ID = #{GRADE_ID}
  129 + </if>
  130 + <if test="pd.SCHOOL_ID != null and pd.SCHOOL_ID != ''"><!-- 关键词检索 -->
  131 + and SCHOOL_ID = #{SCHOOL_ID}
  132 + </if>
  133 + <if test="pd.TEACHER_ID != null and pd.TEACHER_ID != ''"><!-- 关键词检索 -->
  134 + and TEACHER_ID = #{TEACHER_ID}
  135 + </if>
  136 + <if test="pd.COMPLETE != null and pd.COMPLETE != ''"><!-- 关键词检索 -->
  137 + and COMPLETE_DATE &gt; #{COMPLETE_DATE}
  138 + </if>
  139 +
  140 +
117 </select> 141 </select>
118 142
119 <!-- 批量删除 --> 143 <!-- 批量删除 -->
resources/mybatis1/sunvote/TeacherMapper.xml
@@ -19,6 +19,7 @@ @@ -19,6 +19,7 @@
19 SEX, 19 SEX,
20 SUBJECT_IDS, 20 SUBJECT_IDS,
21 KEYPAD_ID, 21 KEYPAD_ID,
  22 + HEADMASTER,
22 ID 23 ID
23 </sql> 24 </sql>
24 25
@@ -34,6 +35,7 @@ @@ -34,6 +35,7 @@
34 #{SEX}, 35 #{SEX},
35 #{SUBJECT_IDS}, 36 #{SUBJECT_IDS},
36 #{KEYPAD_ID}, 37 #{KEYPAD_ID},
  38 + #{HEADMASTER},
37 #{ID} 39 #{ID}
38 </sql> 40 </sql>
39 41
@@ -52,6 +54,7 @@ @@ -52,6 +54,7 @@
52 PASSWORD, 54 PASSWORD,
53 SEX, 55 SEX,
54 SUBJECT_IDS, 56 SUBJECT_IDS,
  57 + HEADMASTER,
55 KEYPAD_ID 58 KEYPAD_ID
56 ) values ( 59 ) values (
57 #{ID}, 60 #{ID},
@@ -64,6 +67,7 @@ @@ -64,6 +67,7 @@
64 #{PASSWORD}, 67 #{PASSWORD},
65 #{SEX}, 68 #{SEX},
66 #{SUBJECT_IDS}, 69 #{SUBJECT_IDS},
  70 + #{HEADMASTER},
67 #{KEYPAD_ID} 71 #{KEYPAD_ID}
68 ) 72 )
69 </insert> 73 </insert>
@@ -91,6 +95,7 @@ @@ -91,6 +95,7 @@
91 SEX = #{SEX}, 95 SEX = #{SEX},
92 SUBJECT_IDS = #{SUBJECT_IDS}, 96 SUBJECT_IDS = #{SUBJECT_IDS},
93 KEYPAD_ID = #{KEYPAD_ID}, 97 KEYPAD_ID = #{KEYPAD_ID},
  98 + HEADMASTER = #{HEADMASTER},
94 ID = ID 99 ID = ID
95 where 100 where
96 ID = #{ID} 101 ID = #{ID}
src/com/fh/controller/api/V1.java
@@ -45,6 +45,7 @@ import com.fh.service.sunvote.classtype.ClassTypeManager; @@ -45,6 +45,7 @@ import com.fh.service.sunvote.classtype.ClassTypeManager;
45 import com.fh.service.sunvote.coursemanagement.CourseManagementManager; 45 import com.fh.service.sunvote.coursemanagement.CourseManagementManager;
46 import com.fh.service.sunvote.event.EventManager; 46 import com.fh.service.sunvote.event.EventManager;
47 import com.fh.service.sunvote.grade.GradeManager; 47 import com.fh.service.sunvote.grade.GradeManager;
  48 +import com.fh.service.sunvote.homework.HomeworkManager;
48 import com.fh.service.sunvote.keypad.KeypadManager; 49 import com.fh.service.sunvote.keypad.KeypadManager;
49 import com.fh.service.sunvote.keypadcheck.KeypadCheckManager; 50 import com.fh.service.sunvote.keypadcheck.KeypadCheckManager;
50 import com.fh.service.sunvote.knowledge.KnowledgeManager; 51 import com.fh.service.sunvote.knowledge.KnowledgeManager;
@@ -135,7 +136,10 @@ public class V1 extends BaseController { @@ -135,7 +136,10 @@ public class V1 extends BaseController {
135 136
136 @Resource(name = "sclassService") 137 @Resource(name = "sclassService")
137 private SClassManager sclassService; 138 private SClassManager sclassService;
138 - 139 +
  140 + @Resource(name="homeworkService")
  141 + private HomeworkManager homeworkService;
  142 +
139 @Resource(name = "studentService") 143 @Resource(name = "studentService")
140 private StudentManager studentService; 144 private StudentManager studentService;
141 145
@@ -2792,6 +2796,24 @@ public class V1 extends BaseController { @@ -2792,6 +2796,24 @@ public class V1 extends BaseController {
2792 return res.toJson(); 2796 return res.toJson();
2793 2797
2794 } 2798 }
  2799 +
  2800 + /**
  2801 + * 获取作业列表
  2802 + *
  2803 + * @param id
  2804 + * @return
  2805 + * @throws Exception
  2806 + */
  2807 + @RequestMapping(value = "/listhomework", produces = "application/json;charset=UTF-8")
  2808 + @ResponseBody
  2809 + public String listhomework() throws Exception {
  2810 + ResponseGson<List<PageData>> res = new ResponseGson<List<PageData>>();
  2811 + PageData pageData = this.getPageData();
  2812 + List<PageData> list = homeworkService.listAll(pageData);
  2813 + res.setData(list);
  2814 + return res.toJson();
  2815 +
  2816 + }
2795 2817
2796 /** 2818 /**
2797 * 根据ID班级名称 2819 * 根据ID班级名称
src/com/fh/controller/sunvote/headmaster/HeadmasterController.java
@@ -8,7 +8,9 @@ import java.util.Date; @@ -8,7 +8,9 @@ import java.util.Date;
8 import java.util.HashMap; 8 import java.util.HashMap;
9 import java.util.List; 9 import java.util.List;
10 import java.util.Map; 10 import java.util.Map;
  11 +
11 import javax.annotation.Resource; 12 import javax.annotation.Resource;
  13 +
12 import org.springframework.beans.propertyeditors.CustomDateEditor; 14 import org.springframework.beans.propertyeditors.CustomDateEditor;
13 import org.springframework.stereotype.Controller; 15 import org.springframework.stereotype.Controller;
14 import org.springframework.web.bind.WebDataBinder; 16 import org.springframework.web.bind.WebDataBinder;
@@ -16,14 +18,14 @@ import org.springframework.web.bind.annotation.InitBinder; @@ -16,14 +18,14 @@ import org.springframework.web.bind.annotation.InitBinder;
16 import org.springframework.web.bind.annotation.RequestMapping; 18 import org.springframework.web.bind.annotation.RequestMapping;
17 import org.springframework.web.bind.annotation.ResponseBody; 19 import org.springframework.web.bind.annotation.ResponseBody;
18 import org.springframework.web.servlet.ModelAndView; 20 import org.springframework.web.servlet.ModelAndView;
  21 +
19 import com.fh.controller.base.BaseController; 22 import com.fh.controller.base.BaseController;
20 import com.fh.entity.Page; 23 import com.fh.entity.Page;
  24 +import com.fh.service.sunvote.headmaster.HeadmasterManager;
21 import com.fh.util.AppUtil; 25 import com.fh.util.AppUtil;
  26 +import com.fh.util.Jurisdiction;
22 import com.fh.util.ObjectExcelView; 27 import com.fh.util.ObjectExcelView;
23 import com.fh.util.PageData; 28 import com.fh.util.PageData;
24 -import com.fh.util.Jurisdiction;  
25 -import com.fh.util.Tools;  
26 -import com.fh.service.sunvote.headmaster.HeadmasterManager;  
27 29
28 /** 30 /**
29 * 说明:班主任 31 * 说明:班主任