Commit d1cd8422e60b6061d7bccbbcced2f4b18c9b6a47
Merge branch 'develop' of http://120.78.57.84/Elvis/SunvoteEducation into develop
Showing
4 changed files
with
78 additions
and
33 deletions
WebRoot/WEB-INF/jsp/sunvote/homework/homework_list.jsp
... | ... | @@ -48,16 +48,20 @@ |
48 | 48 | <table class="table table-striped"> |
49 | 49 | <col style="width: 10%" /> |
50 | 50 | <col style="width: 20%" /> |
51 | - <col style="width: 20%" /> | |
52 | - <col style="width: 20%" /> | |
53 | - <col style="width: 20%" /> | |
51 | + <col style="width: 15%" /> | |
52 | + <col style="width: 15%" /> | |
53 | + <col style="width: 10%" /> | |
54 | + <col style="width: 10%" /> | |
55 | + <col style="width: 10%" /> | |
54 | 56 | <col style="width: 10%" /> |
55 | 57 | <thead> |
56 | 58 | <tr> |
57 | 59 | <th><input type="checkbox" name='ids' id="ids" />序号</th> |
58 | - <th>测验标题</th> | |
59 | - <th>创建时间</th> | |
60 | - <th>建议考试时长</th> | |
60 | + <th>练习标题</th> | |
61 | + <th>布置时间</th> | |
62 | + <th>完成时间</th> | |
63 | + <th>题目数</th> | |
64 | + <th>完成情况</th> | |
61 | 65 | <th>总分</th> |
62 | 66 | <th>操作</th> |
63 | 67 | </tr> |
... | ... | @@ -69,23 +73,27 @@ |
69 | 73 | <table class="table table-striped"> |
70 | 74 | <col style="width: 10%" /> |
71 | 75 | <col style="width: 20%" /> |
72 | - <col style="width: 20%" /> | |
73 | - <col style="width: 20%" /> | |
74 | - <col style="width: 20%" /> | |
76 | + <col style="width: 15%" /> | |
77 | + <col style="width: 15%" /> | |
78 | + <col style="width: 10%" /> | |
79 | + <col style="width: 10%" /> | |
80 | + <col style="width: 10%" /> | |
75 | 81 | <col style="width: 10%" /> |
76 | 82 | <tbody> |
77 | 83 | <c:choose> |
78 | 84 | <c:when test="${not empty varList}"> |
79 | 85 | <c:forEach items="${varList}" var="var" varStatus="vs"> |
80 | 86 | <tr> |
81 | - <td><input type="checkbox" name='ids' id="ids" value="${var.PAPER_ID}"/>${vs.index+1}</td> | |
82 | - <td ><a target="_blank" href="<%=basePath%>paper/iteminfo.do?paper_id=${var.PAPER_ID}">${var.TITLE}</a></td> | |
87 | + <td><input type="checkbox" name='ids' id="ids" value="${var.HOMEWORK_ID}"/>${vs.index+1}</td> | |
88 | + <td ><a target="_blank" href="<%=basePath%>paper/iteminfo.do?paper_id=${var.HOMEWORK_ID}">${var.NAME}</a></td> | |
83 | 89 | <td >${var.CREATE_DATE}</td> |
84 | - <td >${var.EXAM_TIME}</td> | |
85 | - <td >${var.SCORE}</td> | |
90 | + <td >${var.COMPLETE_DATE}</td> | |
91 | + <td >${var.QUESTIOM_COUNT}</td> | |
92 | + <td >${var.COMPLETE_COUNT == "0" ? "未完成":"已完成"}</td> | |
93 | + <td >${var.ALL_SCORE}</td> | |
86 | 94 | <td> |
87 | - <a onclick="del('${var.PAPER_ID}');"><img src="static/images/remove.png" /></a> | |
88 | - <a onclick="del('${var.PAPER_ID}');"><img src="static/images/eidtor.png" /></a> | |
95 | + <a onclick="del('${var.HOMEWORK_ID}');"><img src="static/images/remove.png" /></a> | |
96 | + <a onclick="del('${var.HOMEWORK_ID}');"><img src="static/images/eidtor.png" /></a> | |
89 | 97 | </td> |
90 | 98 | </tr> |
91 | 99 | ... | ... |
WebRoot/WEB-INF/jsp/sunvote/teacher/teacher_main.jsp
... | ... | @@ -179,7 +179,7 @@ |
179 | 179 | function homeWork(schoolId){ |
180 | 180 | //var path = "../school/goEdit2.do?ID=" + schoolId ; |
181 | 181 | |
182 | - var path = '<%=basePath%>homework/list.do?ID=' + schoolId ; | |
182 | + var path = '<%=basePath%>homework/list.do?teacher_id=${pd.TEACHER.ID}&ID=' + schoolId ; | |
183 | 183 | |
184 | 184 | $("#mainFrame").attr('src',path); |
185 | 185 | window.top.loading.show(); | ... | ... |
resources/mybatis1/sunvote/HomeworkMapper.xml
... | ... | @@ -27,6 +27,7 @@ |
27 | 27 | GET_SCORE, |
28 | 28 | GET_SCORE_PERSENT, |
29 | 29 | GET_MAX_SCORE, |
30 | + QUESTIOM_COUNT, | |
30 | 31 | HOMEWORK_ID |
31 | 32 | </sql> |
32 | 33 | |
... | ... | @@ -50,6 +51,7 @@ |
50 | 51 | #{GET_SCORE}, |
51 | 52 | #{GET_SCORE_PERSENT}, |
52 | 53 | #{GET_MAX_SCORE}, |
54 | + #{QUESTIOM_COUNT}, | |
53 | 55 | #{HOMEWORK_ID} |
54 | 56 | </sql> |
55 | 57 | |
... | ... | @@ -113,6 +115,8 @@ |
113 | 115 | GET_SCORE_PERSENT = #{GET_SCORE_PERSENT}, |
114 | 116 | </if><if test="GET_MAX_SCORE != null and GET_MAX_SCORE != ''"> |
115 | 117 | GET_MAX_SCORE = #{GET_MAX_SCORE}, |
118 | + </if><if test="QUESTIOM_COUNT != null and QUESTIOM_COUNT != ''"> | |
119 | + QUESTIOM_COUNT = #{QUESTIOM_COUNT}, | |
116 | 120 | </if> |
117 | 121 | HOMEWORK_ID = HOMEWORK_ID |
118 | 122 | where |
... | ... | @@ -136,15 +140,23 @@ |
136 | 140 | from |
137 | 141 | <include refid="tableName"></include> |
138 | 142 | where 1=1 |
139 | - <if test="pd.keywords!= null and pd.keywords != ''"><!-- 关键词检索 --> | |
140 | - and | |
141 | - ( | |
142 | - <!-- 根据需求自己加检索条件 | |
143 | - 字段1 LIKE CONCAT(CONCAT('%', #{pd.keywords}),'%') | |
144 | - or | |
145 | - 字段2 LIKE CONCAT(CONCAT('%', #{pd.keywords}),'%') | |
146 | - --> | |
147 | - ) | |
143 | + <if test="pd.SUBJECT_ID != null and pd.SUBJECT_ID != ''"><!-- 关键词检索 --> | |
144 | + and SUBJECT_ID = #{pd.SUBJECT_ID} | |
145 | + </if> | |
146 | + <if test="pd.CLASS_ID != null and pd.CLASS_ID != ''"><!-- 关键词检索 --> | |
147 | + and CLASS_ID = #{pd.CLASS_ID} | |
148 | + </if> | |
149 | + <if test="pd.GRADE_ID != null and pd.GRADE_ID != ''"><!-- 关键词检索 --> | |
150 | + and GRADE_ID = #{pd.GRADE_ID} | |
151 | + </if> | |
152 | + <if test="pd.SCHOOL_ID != null and pd.SCHOOL_ID != ''"><!-- 关键词检索 --> | |
153 | + and SCHOOL_ID = #{pd.SCHOOL_ID} | |
154 | + </if> | |
155 | + <if test="pd.TEACHER_ID != null and pd.TEACHER_ID != ''"><!-- 关键词检索 --> | |
156 | + and TEACHER_ID = #{pd.TEACHER_ID} | |
157 | + </if> | |
158 | + <if test="pd.COMPLETE != null and pd.COMPLETE != ''"><!-- 关键词检索 --> | |
159 | + and COMPLETE_DATE > #{pd.COMPLETE_DATE} | |
148 | 160 | </if> |
149 | 161 | </select> |
150 | 162 | ... | ... |
src/com/fh/controller/sunvote/homework/HomeworkController.java
... | ... | @@ -19,6 +19,7 @@ import org.springframework.web.bind.annotation.RequestMapping; |
19 | 19 | import org.springframework.web.bind.annotation.ResponseBody; |
20 | 20 | import org.springframework.web.servlet.ModelAndView; |
21 | 21 | |
22 | +import com.fh.controller.api.ResponseGson; | |
22 | 23 | import com.fh.controller.base.BaseController; |
23 | 24 | import com.fh.entity.Page; |
24 | 25 | import com.fh.service.sunvote.homework.HomeworkManager; |
... | ... | @@ -51,9 +52,6 @@ public class HomeworkController extends BaseController { |
51 | 52 | @RequestMapping(value = "/save") |
52 | 53 | public ModelAndView save() throws Exception { |
53 | 54 | logBefore(logger, Jurisdiction.getUsername() + "新增Homework"); |
54 | - if (!Jurisdiction.buttonJurisdiction(menuUrl, "add")) { | |
55 | - return null; | |
56 | - } // 校验权限 | |
57 | 55 | ModelAndView mv = this.getModelAndView(); |
58 | 56 | PageData pd = new PageData(); |
59 | 57 | pd = this.getPageData(); |
... | ... | @@ -89,9 +87,6 @@ public class HomeworkController extends BaseController { |
89 | 87 | @RequestMapping(value = "/edit") |
90 | 88 | public ModelAndView edit() throws Exception { |
91 | 89 | logBefore(logger, Jurisdiction.getUsername() + "修改Homework"); |
92 | - if (!Jurisdiction.buttonJurisdiction(menuUrl, "edit")) { | |
93 | - return null; | |
94 | - } // 校验权限 | |
95 | 90 | ModelAndView mv = this.getModelAndView(); |
96 | 91 | PageData pd = new PageData(); |
97 | 92 | pd = this.getPageData(); |
... | ... | @@ -110,8 +105,6 @@ public class HomeworkController extends BaseController { |
110 | 105 | @RequestMapping(value = "/list") |
111 | 106 | public ModelAndView list(Page page) throws Exception { |
112 | 107 | logBefore(logger, Jurisdiction.getUsername() + "列表Homework"); |
113 | - // if(!Jurisdiction.buttonJurisdiction(menuUrl, "cha")){return null;} | |
114 | - // //校验权限(无权查看时页面会有提示,如果不注释掉这句代码就无法进入列表页面,所以根据情况是否加入本句代码) | |
115 | 108 | ModelAndView mv = this.getModelAndView(); |
116 | 109 | PageData pd = new PageData(); |
117 | 110 | pd = this.getPageData(); |
... | ... | @@ -285,4 +278,36 @@ public class HomeworkController extends BaseController { |
285 | 278 | Gson gson = new Gson(); |
286 | 279 | return gson.toJson(pd); |
287 | 280 | } |
281 | + | |
282 | + /** | |
283 | + * 列表 | |
284 | + * | |
285 | + * @param page | |
286 | + * @throws Exception | |
287 | + */ | |
288 | + @RequestMapping(value = "/listdata", produces = "application/json;charset=UTF-8") | |
289 | + @ResponseBody | |
290 | + public String listdata(Page page) throws Exception { | |
291 | + PageData pd = new PageData(); | |
292 | + pd = this.getPageData(); | |
293 | + String keywords = pd.getString("keywords"); // 关键词检索条件 | |
294 | + if (null != keywords && !"".equals(keywords)) { | |
295 | + pd.put("keywords", keywords.trim()); | |
296 | + } | |
297 | + page.setPd(pd); | |
298 | + List<PageData> varList = homeworkService.list(page); // 列出Homework列表 | |
299 | + Gson gson = new Gson(); | |
300 | + return gson.toJson(varList); | |
301 | + } | |
302 | + | |
303 | + @RequestMapping(value = "/savedata") | |
304 | + public String savedata() throws Exception { | |
305 | + PageData pd = new PageData(); | |
306 | + pd = this.getPageData(); | |
307 | + pd.put("HOMEWORK_ID", this.get32UUID()); // 主键 | |
308 | + homeworkService.save(pd); | |
309 | + ResponseGson<String> responseGson = new ResponseGson<String>(); | |
310 | + responseGson.setData(pd.getString("HOMEWORK_ID")); | |
311 | + return responseGson.toJson(); | |
312 | + } | |
288 | 313 | } | ... | ... |