Permalink
Browse files

添加打印管理页面

  • Loading branch information...
1 parent b3441eb commit 9fde10ad3e49bf092dffcee6c50663af5ed0ea12 LICH committed Apr 23, 2012
@@ -105,6 +105,7 @@
<li><a href="${ctx}/teacher/midternCheck">中期检查</a></li>
<li><a href="${ctx}/teacher/scoreInput">输入学生论文成绩和评语</a></li>
<li><a href="${ctx}/teacher/scoreSplit">分数拆分</a></li>
+ <li><a href="${ctx}/teacher/print">打印管理</a></li>
</ul></li>
</shiro:hasRole>
@@ -0,0 +1,42 @@
+<%@ page contentType="text/html;charset=UTF-8"%>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
+<c:set var="ctx" value="${pageContext.request.contextPath}" />
+<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title>主页</title>
+</head>
+<body>
+ <h2>成绩评定表打印</h2>
+
+ <table class="table table-bordered">
+ <thead>
+ <tr>
+ <th style="vertical-align: middle;">学号</th>
+ <th style="vertical-align: middle;">姓名</th>
+ <th style="vertical-align: middle;">课题名称</th>
+ <th style="vertical-align: middle;">操作</th>
+ </tr>
+ </thead>
+ <tbody>
+ <c:forEach items="${students}" var="student" varStatus="st">
+ <tr>
+ <td>${student.loginName}</td>
+ <td>${student.name}</td>
+ <td>${studentsThesises[st.index].name}</td>
+ <td><a href="${ctx}/teacher/print/${student.loginName}" class="btn btn-mini">下载</a></td>
+ </tr>
+ </c:forEach>
+ </tbody>
+ </table>
+
+ <!-- Javascript -->
+ <script type="text/javascript">
+ $(document).ready(function() {
+ $('#li-teacher_score').addClass('active');
+ });
+ </script>
+</body>
+</html>
@@ -4,16 +4,20 @@
import im.lich.gdms.core.model.student.Student;
import im.lich.gdms.core.model.teacher.Thesis;
import im.lich.gdms.core.service.student.StudentService;
+import im.lich.gdms.core.service.teacher.TeacherService;
import java.io.IOException;
import java.io.PrintWriter;
+import java.util.List;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang3.StringUtils;
+import org.apache.shiro.SecurityUtils;
import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
@@ -25,6 +29,26 @@
@Resource
private StudentService studentService;
+ @Resource
+ private TeacherService teacherService;
+
+ @RequestMapping("/print")
+ public String showStudentPrint(Model model) {
+ logger.debug("GET-showScoreInput");
+
+ String loginName = SecurityUtils.getSubject().getPrincipal().toString();
+ //获取学生信息
+ List<Student> students = teacherService.getTeachingStudents(loginName);
+ model.addAttribute("students", students);
+ logger.debug("学生:{}", StringUtils.join(students, ','));
+
+ //获取学生课题
+ List<Thesis> studentsThesises = studentService.getStudentsThesises(students);
+ model.addAttribute("studentsThesises", studentsThesises);
+
+ return "/teacher/print";
+ }
+
@RequestMapping("/print/{loginName}")
@ResponseBody
public void print(@PathVariable("loginName") String loginName, HttpServletRequest request,

0 comments on commit 9fde10a

Please sign in to comment.