Commit b9dc59e6bc7daf0890e46293d519dc9c20f5a29f
1 parent
eef2f078
管理员过滤条件
Showing
7 changed files
with
38 additions
and
11 deletions
WebRoot/WEB-INF/jsp/sunvote/paper/paper_list4.jsp
| ... | ... | @@ -72,8 +72,7 @@ |
| 72 | 72 | <col style="width: 10%" /> |
| 73 | 73 | <col style="width: 10%" /> |
| 74 | 74 | <col style="width: 10%" /> |
| 75 | - <col style="width: 10%" /> | |
| 76 | - <col style="width: 10%" /> | |
| 75 | + <col style="width: 20%" /> | |
| 77 | 76 | <col style="width: 10%" /> |
| 78 | 77 | <col style="width: 10%" /> |
| 79 | 78 | <thead> |
| ... | ... | @@ -86,7 +85,6 @@ |
| 86 | 85 | <th>创建时间</th> |
| 87 | 86 | <th>建议考试时长</th> |
| 88 | 87 | <th>总分</th> |
| 89 | - <th>操作</th> | |
| 90 | 88 | </tr> |
| 91 | 89 | </thead> |
| 92 | 90 | </table> |
| ... | ... | @@ -99,8 +97,7 @@ |
| 99 | 97 | <col style="width: 10%" /> |
| 100 | 98 | <col style="width: 10%" /> |
| 101 | 99 | <col style="width: 10%" /> |
| 102 | - <col style="width: 10%" /> | |
| 103 | - <col style="width: 10%" /> | |
| 100 | + <col style="width: 20%" /> | |
| 104 | 101 | <col style="width: 10%" /> |
| 105 | 102 | <col style="width: 10%" /> |
| 106 | 103 | <tbody> |
| ... | ... | @@ -116,9 +113,6 @@ |
| 116 | 113 | <td >${var.CREATE_DATE}</td> |
| 117 | 114 | <td >${var.EXAM_TIME}</td> |
| 118 | 115 | <td >${var.SCORE}</td> |
| 119 | - <td> | |
| 120 | - <a href="#" onclick="del('${var.PAPER_ID}');"><img src="../static/images/remove.png" /></a> | |
| 121 | - </td> | |
| 122 | 116 | </tr> |
| 123 | 117 | |
| 124 | 118 | </c:forEach> | ... | ... |
WebRoot/WEB-INF/jsp/sunvote/teacher/teacher_report_1.jsp
| ... | ... | @@ -246,10 +246,15 @@ |
| 246 | 246 | } |
| 247 | 247 | |
| 248 | 248 | function student(classid,studentid){ |
| 249 | + | |
| 249 | 250 | var url = "<%=basePath%>report/student_report?studentid=" + studentid + "&class_id=" + classid ; |
| 250 | 251 | var startDate = $("#lastStart").val(); |
| 251 | 252 | var endDate = $("#lastEnd").val(); |
| 252 | 253 | url = url + "&start_date=" + startDate + "&end_date=" + endDate ; |
| 254 | + var SUBJECT_ID = $("#SUBJECT_ID").val(); | |
| 255 | + if(SUBJECT_ID != null && SUBJECT_ID != ''){ | |
| 256 | + url = url + "&SUBJECT_ID="+ SUBJECT_ID ; | |
| 257 | + } | |
| 253 | 258 | window.self.location.href = url; |
| 254 | 259 | window.top.loading.show(); |
| 255 | 260 | } | ... | ... |
resources/mybatis1/sunvote/StudentTestMapper.xml
| ... | ... | @@ -155,6 +155,9 @@ |
| 155 | 155 | <if test="END_DATE != null and END_DATE != ''"><!-- 关键词检索 --> |
| 156 | 156 | and (CREATE_DATE < #{END_DATE}) |
| 157 | 157 | </if> |
| 158 | + <if test="SUBJECT_ID != null and SUBJECT_ID != ''"><!-- 关键词检索 --> | |
| 159 | + and (sv_testpaper.SUBJECT_ID = #{SUBJECT_ID}) | |
| 160 | + </if> | |
| 158 | 161 | |
| 159 | 162 | order by CREATE_DATE |
| 160 | 163 | ... | ... |
src/com/fh/controller/base/BaseController.java
| ... | ... | @@ -91,6 +91,12 @@ public class BaseController { |
| 91 | 91 | return "ERROR"; |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | + public String getRole(){ | |
| 95 | + Session session = Jurisdiction.getSession(); | |
| 96 | + String role = (String)session.getAttribute(getUsername() + Const.ROLE_ID); | |
| 97 | + return role; | |
| 98 | + } | |
| 99 | + | |
| 94 | 100 | public String geTeacherID(){ |
| 95 | 101 | Session session = Jurisdiction.getSession(); |
| 96 | 102 | User user = (User)session.getAttribute(Const.SESSION_USER); | ... | ... |
src/com/fh/controller/sunvote/report/ReportController.java
| ... | ... | @@ -161,7 +161,11 @@ public class ReportController extends BaseController { |
| 161 | 161 | ModelAndView mv = this.getModelAndView(); |
| 162 | 162 | |
| 163 | 163 | PageData pd = getPageData(); |
| 164 | - mv.addObject("URL", "report/student_report_data?class_id=" +pd.getString("CLASS_ID")); | |
| 164 | + String url = "report/student_report_data?class_id=" +pd.getString("CLASS_ID"); | |
| 165 | + if(pd.getString("SUBJECT_ID") != null){ | |
| 166 | + url += "&SUBJECT_ID=" + pd.getString("SUBJECT_ID"); | |
| 167 | + } | |
| 168 | + mv.addObject("URL",url); | |
| 165 | 169 | mv.setViewName("sunvote/teacher/stduent_report"); |
| 166 | 170 | mv.addObject("start_date", pd.get("START_DATE")); |
| 167 | 171 | mv.addObject("end_date", pd.get("END_DATE")); |
| ... | ... | @@ -176,7 +180,9 @@ public class ReportController extends BaseController { |
| 176 | 180 | ResponseGson<PageData> ret = new ResponseGson(); |
| 177 | 181 | // pd.put("CLASS_ID", pd.get("CLASSID")); |
| 178 | 182 | List<PageData> studentList = studentService.listAllClass(pd); |
| 179 | - pd.put("TEACHER_ID", getUserID()); | |
| 183 | + if ("teacher".equals(getRole())) { | |
| 184 | + pd.put("TEACHER_ID", getUserID()); | |
| 185 | + } | |
| 180 | 186 | List<PageData> testpaperList = testpaperService.listAll(pd); |
| 181 | 187 | pd.put("ID", pd.get("CLASS_ID")); |
| 182 | 188 | PageData classPageData = sclassService.findById(pd); |
| ... | ... | @@ -214,7 +220,12 @@ public class ReportController extends BaseController { |
| 214 | 220 | if(pd.containsKey("END_DATE")){ |
| 215 | 221 | search.put("END_DATE", pd.getString("END_DATE")); |
| 216 | 222 | } |
| 217 | - search.put("TEACHER_ID", getUserID()); | |
| 223 | + if("teacher".equals(getRole())){ | |
| 224 | + search.put("TEACHER_ID", getUserID()); | |
| 225 | + } | |
| 226 | + if(pd.containsKey("SUBJECT_ID")){ | |
| 227 | + search.put("SUBJECT_ID", pd.getString("SUBJECT_ID")); | |
| 228 | + } | |
| 218 | 229 | List<PageData> studentTestList = studenttestService.reportListData(search); |
| 219 | 230 | studentPageData.put("testList", studentTestList); |
| 220 | 231 | ... | ... |
src/com/fh/controller/system/login/LoginController.java
| ... | ... | @@ -264,10 +264,13 @@ public class LoginController extends BaseController { |
| 264 | 264 | sData.get("SUBJECT_NAME")); |
| 265 | 265 | session.setAttribute(USERNAME + Const.TERM_ID, |
| 266 | 266 | sData.get("TERM_ID")); |
| 267 | + | |
| 267 | 268 | sData.put("USER_ID", user.getUSER_ID()); |
| 268 | 269 | List<PageData> templateInfos = pagetemplateService.listAll(sData); |
| 269 | 270 | mv.addObject("templateInfos", templateInfos); |
| 270 | 271 | } |
| 272 | + session.setAttribute(USERNAME + Const.ROLE_ID, | |
| 273 | + "teacher"); | |
| 271 | 274 | session.setAttribute(Const.SESSION_USERNAME, USERNAME); // 放入用户名到session |
| 272 | 275 | mv.setViewName("sunvote/teacher/teacher_main"); |
| 273 | 276 | mv.addObject("user", user); |
| ... | ... | @@ -301,6 +304,8 @@ public class LoginController extends BaseController { |
| 301 | 304 | mv.addObject("SNAME", pad.get("SNAME")); |
| 302 | 305 | mv.addObject("SCHOOL_ID", pad.get("SCHOOL_ID")); |
| 303 | 306 | } |
| 307 | + session.setAttribute(USERNAME + Const.ROLE_ID, | |
| 308 | + "admin"); | |
| 304 | 309 | mv.addObject("gradeInfos", gradeInfos); |
| 305 | 310 | mv.addObject("subjectInfos", subjectInfos); |
| 306 | 311 | session.setAttribute(Const.SESSION_USERNAME, USERNAME); // 放入用户名到session |
| ... | ... | @@ -328,6 +333,8 @@ public class LoginController extends BaseController { |
| 328 | 333 | session.setAttribute(USERNAME + Const.SESSION_QX2, |
| 329 | 334 | this.getUQX2(USERNAME)); // 副职角色按钮权限放到session中 |
| 330 | 335 | } |
| 336 | + session.setAttribute(USERNAME + Const.ROLE_ID, | |
| 337 | + "systemadmin"); | |
| 331 | 338 | this.getRemortIP(USERNAME); // 更新登录IP |
| 332 | 339 | menuList = this.changeMenuF(allmenuList, session, USERNAME, |
| 333 | 340 | changeMenu); // 切换菜单 | ... | ... |
src/com/fh/util/Const.java
| ... | ... | @@ -26,6 +26,7 @@ public class Const { |
| 26 | 26 | public static final String SUBJECT_ID = "SUBJECT_ID"; |
| 27 | 27 | public static final String SUBJECT_NAME = "SUBJECT_NAME"; |
| 28 | 28 | public static final String TERM_ID = "TERM_ID"; |
| 29 | + public static final String ROLE_ID = "ROLE_ID"; | |
| 29 | 30 | |
| 30 | 31 | public static final String FALSE = "F"; |
| 31 | 32 | public static final String LOGIN = "/login_toLogin.do"; //登录地址 | ... | ... |