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