Commit 91a745c927277652792c7e62b2759333c414a0c6
1 parent
fe1b8420
完善后台功能
Showing
21 changed files
with
2009 additions
and
219 deletions
WebRoot/WEB-INF/jsp/sunvote/classroster/classroster_edit.jsp
... | ... | @@ -33,15 +33,33 @@ |
33 | 33 | <table id="table_report" class="table table-striped table-bordered table-hover"> |
34 | 34 | <tr> |
35 | 35 | <td style="width:75px;text-align: right;padding-top: 13px;">班级:</td> |
36 | - <td><input type="number" name="SCLASS_ID" id="SCLASS_ID" value="${pd.SCLASS_ID}" maxlength="32" placeholder="这里输入班级" title="班级" style="width:98%;"/></td> | |
36 | + <td> | |
37 | + <select class="chosen-select form-control" name="SCLASS_ID" id="SCLASS_ID" data-placeholder="这里输入所属年级"> | |
38 | + <c:forEach var="item" items="${classList}"> | |
39 | + <option value="${item.ID}" <c:if test="${pd.SCLASS_ID==item.ID}">selected="true"</c:if>>${item.CLASS_NAME}</option> | |
40 | + </c:forEach> | |
41 | + </select> | |
42 | + </td> | |
37 | 43 | </tr> |
38 | 44 | <tr> |
39 | 45 | <td style="width:75px;text-align: right;padding-top: 13px;">学生:</td> |
40 | - <td><input type="number" name="STUDENT_ID" id="STUDENT_ID" value="${pd.STUDENT_ID}" maxlength="32" placeholder="这里输入学生" title="学生" style="width:98%;"/></td> | |
46 | + <td> | |
47 | + <select class="chosen-select form-control" name="STUDENT_ID" id="STUDENT_ID" data-placeholder="这里输入所属年级"> | |
48 | + <c:forEach var="item" items="${studentList}"> | |
49 | + <option value="${item.ID}" <c:if test="${pd.STUDENT_ID==item.ID}">selected="true"</c:if>>${item.NAME}</option> | |
50 | + </c:forEach> | |
51 | + </select> | |
52 | + </td> | |
41 | 53 | </tr> |
42 | 54 | <tr> |
43 | 55 | <td style="width:75px;text-align: right;padding-top: 13px;">学期名称:</td> |
44 | - <td><input type="text" name="TEAMID" id="TEAMID" value="${pd.TEAMID}" maxlength="255" placeholder="这里输入学期名称" title="学期名称" style="width:98%;"/></td> | |
56 | + <td> | |
57 | + <select class="chosen-select form-control" name="TEAMID" id="TEAMID" data-placeholder="这里输入所属年级"> | |
58 | + <c:forEach var="item" items="${termList}"> | |
59 | + <option value="${item.TERM_ID}" <c:if test="${pd.TEAMID==item.TERM_ID}">selected="true"</c:if>>${item.NAME}</option> | |
60 | + </c:forEach> | |
61 | + </select> | |
62 | + </td> | |
45 | 63 | </tr> |
46 | 64 | <tr> |
47 | 65 | <td style="text-align: center;" colspan="10"> | ... | ... |
WebRoot/WEB-INF/jsp/sunvote/paper/paper_list.jsp
1 | 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> |
2 | 2 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> |
3 | 3 | <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%> |
4 | +<%@ taglib prefix="myelfun" uri="/WEB-INF/tld/elfun.tld"%> | |
4 | 5 | <% |
5 | 6 | String path = request.getContextPath(); |
6 | 7 | String basePath = request.getScheme() + "://" |
... | ... | @@ -93,15 +94,15 @@ |
93 | 94 | </td> |
94 | 95 | <td class='center' style="width: 30px;">${vs.index+1}</td> |
95 | 96 | <td class='center'>${var.TITLE}</td> |
96 | - <td class='center'>${var.USER_ID}</td> | |
97 | - <td class='center'>${var.PAPER_TYPE}</td> | |
98 | - <td class='center'>${var.SUBJECT_ID}</td> | |
99 | - <td class='center'>${var.GRADE_ID}</td> | |
100 | - <td class='center'>${var.SCHOOL_ID}</td> | |
97 | + <td class='center'>${myelfun:findTeacherName(var.USER_ID)}</td> | |
98 | + <td class='center'>${myelfun:findPaperTypeName(var.PAPER_TYPE)}</td> | |
99 | + <td class='center'>${myelfun:findSubjectCName(var.SUBJECT_ID)}</td> | |
100 | + <td class='center'>${myelfun:findGradeName(var.GRADE_ID)}</td> | |
101 | + <td class='center'>${myelfun:findSchoolName(var.SCHOOL_ID)}</td> | |
101 | 102 | <td class='center'>${var.CREATE_DATE}</td> |
102 | 103 | <td class='center'>${var.MODIFY_DATE}</td> |
103 | 104 | <td class='center'>${var.EXAM_TIME}</td> |
104 | - <td class='center'>${var.PAPER_STATE}</td> | |
105 | + <td class='center'>${var.PAPER_STATE == 0 ? "未考":"已考试"}</td> | |
105 | 106 | <td class='center'>${var.REMARK}</td> |
106 | 107 | <td class="center"> |
107 | 108 | <c:if test="${QX.edit != 1 && QX.del != 1 }"> | ... | ... |
WebRoot/WEB-INF/jsp/sunvote/paperquestion/paperquestion_list.jsp
1 | 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> |
2 | 2 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> |
3 | 3 | <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%> |
4 | +<%@ taglib prefix="myelfun" uri="/WEB-INF/tld/elfun.tld"%> | |
4 | 5 | <% |
5 | 6 | String path = request.getContextPath(); |
6 | 7 | String basePath = request.getScheme() + "://" |
... | ... | @@ -87,7 +88,7 @@ |
87 | 88 | <label class="pos-rel"><input type='checkbox' name='ids' value="${var.PAPERQUESTION_ID}" class="ace" /><span class="lbl"></span></label> |
88 | 89 | </td> |
89 | 90 | <td class='center' style="width: 30px;">${vs.index+1}</td> |
90 | - <td class='center'>${var.PAPER_ID}</td> | |
91 | + <td class='center'>${myelfun:findPaperName(var.PAPER_ID)}</td> | |
91 | 92 | <td class='center'>${var.QUESTION_ID}</td> |
92 | 93 | <td class='center'>${var.SCORE}</td> |
93 | 94 | <td class='center'>${var.PART_SCORE}</td> | ... | ... |
WebRoot/WEB-INF/jsp/sunvote/question/question_list.jsp
... | ... | @@ -83,7 +83,6 @@ |
83 | 83 | <th class="center">题目来源</th> |
84 | 84 | <th class="center">建议试题总分</th> |
85 | 85 | <th class="center">建议部分分</th> |
86 | - <th class="center">用户ID</th> | |
87 | 86 | <th class="center">创建时间</th> |
88 | 87 | <th class="center">备注</th> |
89 | 88 | <th class="center">操作</th> |
... | ... | @@ -101,12 +100,12 @@ |
101 | 100 | <label class="pos-rel"><input type='checkbox' name='ids' value="${var.QUESTION_ID}" class="ace" /><span class="lbl"></span></label> |
102 | 101 | </td> |
103 | 102 | <td class='center' style="width: 30px;">${vs.index+1}</td> |
104 | - <td class='center'>${var.P_ID}</td> | |
105 | - <td class='center'>${var.SUBJECT_ID}</td> | |
103 | + <td class='center'>${var.P_ID.equals("-1") ? "大题":""}</td> | |
104 | + <td class='center'>${myelfun:findSubjectCName(var.SUBJECT_ID)}</td> | |
106 | 105 | <td class='center'>${var.CHAPTER_ID}</td> |
107 | - <td class='center'>${var.PROBLEM_TYPE_ID}</td> | |
108 | - <td class='center'>${var.TEACHER_ID}</td> | |
109 | - <td class='center'>${var.SCHOOL_ID}</td> | |
106 | + <td class='center'>${myelfun:findQuestionTypeName(var.PROBLEM_TYPE_ID)}</td> | |
107 | + <td class='center'>${myelfun:findTeacherName(var.TEACHER_ID)}</td> | |
108 | + <td class='center'>${myelfun:findSchoolName(var.SCHOOL_ID)}</td> | |
110 | 109 | <td class='center'>${var.KNOWLEDGE_ID}</td> |
111 | 110 | <td class='center'>${var.CONTENT}</td> |
112 | 111 | <td class='center'>${var.OPTION_NUM}</td> |
... | ... | @@ -117,7 +116,6 @@ |
117 | 116 | <td class='center'>${var.QUESTION_FROM}</td> |
118 | 117 | <td class='center'>${var.SUG_SCORE}</td> |
119 | 118 | <td class='center'>${var.SUG_PART_SCORE}</td> |
120 | - <td class='center'>${var.USER_ID}</td> | |
121 | 119 | <td class='center'>${var.CREATE_DATE}</td> |
122 | 120 | <td class='center'>${var.REMARK}</td> |
123 | 121 | <td class="center"> | ... | ... |
WebRoot/WEB-INF/jsp/sunvote/studenttest/studenttest_edit.jsp
0 → 100644
1 | +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> | |
2 | +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> | |
3 | +<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%> | |
4 | +<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> | |
5 | +<% | |
6 | + String path = request.getContextPath(); | |
7 | + String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; | |
8 | +%> | |
9 | +<!DOCTYPE html> | |
10 | +<html lang="en"> | |
11 | + <head> | |
12 | + <base href="<%=basePath%>"> | |
13 | + <!-- 下拉框 --> | |
14 | + <link rel="stylesheet" href="static/ace/css/chosen.css" /> | |
15 | + <!-- jsp文件头和头部 --> | |
16 | + <%@ include file="../../system/index/top.jsp"%> | |
17 | + <!-- 日期框 --> | |
18 | + <link rel="stylesheet" href="static/ace/css/datepicker.css" /> | |
19 | +</head> | |
20 | +<body class="no-skin"> | |
21 | +<!-- /section:basics/navbar.layout --> | |
22 | +<div class="main-container" id="main-container"> | |
23 | + <!-- /section:basics/sidebar --> | |
24 | + <div class="main-content"> | |
25 | + <div class="main-content-inner"> | |
26 | + <div class="page-content"> | |
27 | + <div class="row"> | |
28 | + <div class="col-xs-12"> | |
29 | + | |
30 | + <form action="studenttest/${msg }.do" name="Form" id="Form" method="post"> | |
31 | + <input type="hidden" name="STUDENTTEST_ID" id="STUDENTTEST_ID" value="${pd.STUDENTTEST_ID}"/> | |
32 | + <div id="zhongxin" style="padding-top: 13px;"> | |
33 | + <table id="table_report" class="table table-striped table-bordered table-hover"> | |
34 | + <tr> | |
35 | + <td style="width:75px;text-align: right;padding-top: 13px;">学生ID:</td> | |
36 | + <td><input type="text" name="STUDENT_ID" id="STUDENT_ID" value="${pd.STUDENT_ID}" maxlength="32" placeholder="这里输入学生ID" title="学生ID" style="width:98%;"/></td> | |
37 | + </tr> | |
38 | + <tr> | |
39 | + <td style="width:75px;text-align: right;padding-top: 13px;">测验ID:</td> | |
40 | + <td><input type="text" name="TEST_ID" id="TEST_ID" value="${pd.TEST_ID}" maxlength="32" placeholder="这里输入测验ID" title="测验ID" style="width:98%;"/></td> | |
41 | + </tr> | |
42 | + <tr> | |
43 | + <td style="width:75px;text-align: right;padding-top: 13px;">试卷ID:</td> | |
44 | + <td><input type="text" name="PAPER_ID" id="PAPER_ID" value="${pd.PAPER_ID}" maxlength="32" placeholder="这里输入试卷ID" title="试卷ID" style="width:98%;"/></td> | |
45 | + </tr> | |
46 | + <tr> | |
47 | + <td style="width:75px;text-align: right;padding-top: 13px;">得分:</td> | |
48 | + <td><input type="text" name="SCORE" id="SCORE" value="${pd.SCORE}" maxlength="10" placeholder="这里输入得分" title="得分" style="width:98%;"/></td> | |
49 | + </tr> | |
50 | + <tr> | |
51 | + <td style="width:75px;text-align: right;padding-top: 13px;">班级ID:</td> | |
52 | + <td><input type="text" name="CLASS_ID" id="CLASS_ID" value="${pd.CLASS_ID}" maxlength="255" placeholder="这里输入班级ID" title="班级ID" style="width:98%;"/></td> | |
53 | + </tr> | |
54 | + <tr> | |
55 | + <td style="text-align: center;" colspan="10"> | |
56 | + <a class="btn btn-mini btn-primary" onclick="save();">保存</a> | |
57 | + <a class="btn btn-mini btn-danger" onclick="top.Dialog.close();">取消</a> | |
58 | + </td> | |
59 | + </tr> | |
60 | + </table> | |
61 | + </div> | |
62 | + <div id="zhongxin2" class="center" style="display:none"><br/><br/><br/><br/><br/><img src="static/images/jiazai.gif" /><br/><h4 class="lighter block green">提交中...</h4></div> | |
63 | + </form> | |
64 | + </div> | |
65 | + <!-- /.col --> | |
66 | + </div> | |
67 | + <!-- /.row --> | |
68 | + </div> | |
69 | + <!-- /.page-content --> | |
70 | + </div> | |
71 | + </div> | |
72 | + <!-- /.main-content --> | |
73 | +</div> | |
74 | +<!-- /.main-container --> | |
75 | + | |
76 | + | |
77 | + <!-- 页面底部js¨ --> | |
78 | + <%@ include file="../../system/index/foot.jsp"%> | |
79 | + <!-- 下拉框 --> | |
80 | + <script src="static/ace/js/chosen.jquery.js"></script> | |
81 | + <!-- 日期框 --> | |
82 | + <script src="static/ace/js/date-time/bootstrap-datepicker.js"></script> | |
83 | + <!--提示框--> | |
84 | + <script type="text/javascript" src="static/js/jquery.tips.js"></script> | |
85 | + <script type="text/javascript"> | |
86 | + $(top.hangge()); | |
87 | + //保存 | |
88 | + function save(){ | |
89 | + if($("#STUDENT_ID").val()==""){ | |
90 | + $("#STUDENT_ID").tips({ | |
91 | + side:3, | |
92 | + msg:'请输入学生ID', | |
93 | + bg:'#AE81FF', | |
94 | + time:2 | |
95 | + }); | |
96 | + $("#STUDENT_ID").focus(); | |
97 | + return false; | |
98 | + } | |
99 | + if($("#TEST_ID").val()==""){ | |
100 | + $("#TEST_ID").tips({ | |
101 | + side:3, | |
102 | + msg:'请输入测验ID', | |
103 | + bg:'#AE81FF', | |
104 | + time:2 | |
105 | + }); | |
106 | + $("#TEST_ID").focus(); | |
107 | + return false; | |
108 | + } | |
109 | + if($("#PAPER_ID").val()==""){ | |
110 | + $("#PAPER_ID").tips({ | |
111 | + side:3, | |
112 | + msg:'请输入试卷ID', | |
113 | + bg:'#AE81FF', | |
114 | + time:2 | |
115 | + }); | |
116 | + $("#PAPER_ID").focus(); | |
117 | + return false; | |
118 | + } | |
119 | + if($("#SCORE").val()==""){ | |
120 | + $("#SCORE").tips({ | |
121 | + side:3, | |
122 | + msg:'请输入得分', | |
123 | + bg:'#AE81FF', | |
124 | + time:2 | |
125 | + }); | |
126 | + $("#SCORE").focus(); | |
127 | + return false; | |
128 | + } | |
129 | + if($("#CLASS_ID").val()==""){ | |
130 | + $("#CLASS_ID").tips({ | |
131 | + side:3, | |
132 | + msg:'请输入班级ID', | |
133 | + bg:'#AE81FF', | |
134 | + time:2 | |
135 | + }); | |
136 | + $("#CLASS_ID").focus(); | |
137 | + return false; | |
138 | + } | |
139 | + $("#Form").submit(); | |
140 | + $("#zhongxin").hide(); | |
141 | + $("#zhongxin2").show(); | |
142 | + } | |
143 | + | |
144 | + $(function() { | |
145 | + //日期框 | |
146 | + $('.date-picker').datepicker({autoclose: true,todayHighlight: true}); | |
147 | + }); | |
148 | + </script> | |
149 | +</body> | |
150 | +</html> | |
0 | 151 | \ No newline at end of file | ... | ... |
WebRoot/WEB-INF/jsp/sunvote/studenttest/studenttest_list.jsp
0 → 100644
1 | +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> | |
2 | +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> | |
3 | +<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%> | |
4 | +<% | |
5 | + String path = request.getContextPath(); | |
6 | + String basePath = request.getScheme() + "://" | |
7 | + + request.getServerName() + ":" + request.getServerPort() | |
8 | + + path + "/"; | |
9 | +%> | |
10 | +<!DOCTYPE html> | |
11 | +<html lang="en"> | |
12 | +<head> | |
13 | +<base href="<%=basePath%>"> | |
14 | +<!-- 下拉框 --> | |
15 | +<link rel="stylesheet" href="static/ace/css/chosen.css" /> | |
16 | +<!-- jsp文件头和头部 --> | |
17 | +<%@ include file="../../system/index/top.jsp"%> | |
18 | +<!-- 日期框 --> | |
19 | +<link rel="stylesheet" href="static/ace/css/datepicker.css" /> | |
20 | +</head> | |
21 | +<body class="no-skin"> | |
22 | + | |
23 | + <!-- /section:basics/navbar.layout --> | |
24 | + <div class="main-container" id="main-container"> | |
25 | + <!-- /section:basics/sidebar --> | |
26 | + <div class="main-content"> | |
27 | + <div class="main-content-inner"> | |
28 | + <div class="page-content"> | |
29 | + <div class="row"> | |
30 | + <div class="col-xs-12"> | |
31 | + | |
32 | + <!-- 检索 --> | |
33 | + <form action="studenttest/list.do" method="post" name="Form" id="Form"> | |
34 | + <table style="margin-top:5px;"> | |
35 | + <tr> | |
36 | + <td> | |
37 | + <div class="nav-search"> | |
38 | + <span class="input-icon"> | |
39 | + <input type="text" placeholder="这里输入关键词" class="nav-search-input" id="nav-search-input" autocomplete="off" name="keywords" value="${pd.keywords }" placeholder="这里输入关键词"/> | |
40 | + <i class="ace-icon fa fa-search nav-search-icon"></i> | |
41 | + </span> | |
42 | + </div> | |
43 | + </td> | |
44 | + <td style="padding-left:2px;"><input class="span10 date-picker" name="lastStart" id="lastStart" value="" type="text" data-date-format="yyyy-mm-dd" readonly="readonly" style="width:88px;" placeholder="开始日期" title="开始日期"/></td> | |
45 | + <td style="padding-left:2px;"><input class="span10 date-picker" name="lastEnd" name="lastEnd" value="" type="text" data-date-format="yyyy-mm-dd" readonly="readonly" style="width:88px;" placeholder="结束日期" title="结束日期"/></td> | |
46 | + <td style="vertical-align:top;padding-left:2px;"> | |
47 | + <select class="chosen-select form-control" name="name" id="id" data-placeholder="请选择" style="vertical-align:top;width: 120px;"> | |
48 | + <option value=""></option> | |
49 | + <option value="">全部</option> | |
50 | + <option value="">1</option> | |
51 | + <option value="">2</option> | |
52 | + </select> | |
53 | + </td> | |
54 | + <c:if test="${QX.cha == 1 }"> | |
55 | + <td style="vertical-align:top;padding-left:2px"><a class="btn btn-light btn-xs" onclick="tosearch();" title="检索"><i id="nav-search-icon" class="ace-icon fa fa-search bigger-110 nav-search-icon blue"></i></a></td> | |
56 | + </c:if> | |
57 | + <c:if test="${QX.toExcel == 1 }"><td style="vertical-align:top;padding-left:2px;"><a class="btn btn-light btn-xs" onclick="toExcel();" title="导出到EXCEL"><i id="nav-search-icon" class="ace-icon fa fa-download bigger-110 nav-search-icon blue"></i></a></td></c:if> | |
58 | + </tr> | |
59 | + </table> | |
60 | + <!-- 检索 --> | |
61 | + | |
62 | + <table id="simple-table" class="table table-striped table-bordered table-hover" style="margin-top:5px;"> | |
63 | + <thead> | |
64 | + <tr> | |
65 | + <th class="center" style="width:35px;"> | |
66 | + <label class="pos-rel"><input type="checkbox" class="ace" id="zcheckbox" /><span class="lbl"></span></label> | |
67 | + </th> | |
68 | + <th class="center" style="width:50px;">序号</th> | |
69 | + <th class="center">学生ID</th> | |
70 | + <th class="center">测验ID</th> | |
71 | + <th class="center">试卷ID</th> | |
72 | + <th class="center">得分</th> | |
73 | + <th class="center">班级ID</th> | |
74 | + <th class="center">操作</th> | |
75 | + </tr> | |
76 | + </thead> | |
77 | + | |
78 | + <tbody> | |
79 | + <!-- 开始循环 --> | |
80 | + <c:choose> | |
81 | + <c:when test="${not empty varList}"> | |
82 | + <c:if test="${QX.cha == 1 }"> | |
83 | + <c:forEach items="${varList}" var="var" varStatus="vs"> | |
84 | + <tr> | |
85 | + <td class='center'> | |
86 | + <label class="pos-rel"><input type='checkbox' name='ids' value="${var.STUDENTTEST_ID}" class="ace" /><span class="lbl"></span></label> | |
87 | + </td> | |
88 | + <td class='center' style="width: 30px;">${vs.index+1}</td> | |
89 | + <td class='center'>${var.STUDENT_ID}</td> | |
90 | + <td class='center'>${var.TEST_ID}</td> | |
91 | + <td class='center'>${var.PAPER_ID}</td> | |
92 | + <td class='center'>${var.SCORE}</td> | |
93 | + <td class='center'>${var.CLASS_ID}</td> | |
94 | + <td class="center"> | |
95 | + <c:if test="${QX.edit != 1 && QX.del != 1 }"> | |
96 | + <span class="label label-large label-grey arrowed-in-right arrowed-in"><i class="ace-icon fa fa-lock" title="无权限"></i></span> | |
97 | + </c:if> | |
98 | + <div class="hidden-sm hidden-xs btn-group"> | |
99 | + <c:if test="${QX.edit == 1 }"> | |
100 | + <a class="btn btn-xs btn-success" title="编辑" onclick="edit('${var.STUDENTTEST_ID}');"> | |
101 | + <i class="ace-icon fa fa-pencil-square-o bigger-120" title="编辑"></i> | |
102 | + </a> | |
103 | + </c:if> | |
104 | + <c:if test="${QX.del == 1 }"> | |
105 | + <a class="btn btn-xs btn-danger" onclick="del('${var.STUDENTTEST_ID}');"> | |
106 | + <i class="ace-icon fa fa-trash-o bigger-120" title="删除"></i> | |
107 | + </a> | |
108 | + </c:if> | |
109 | + </div> | |
110 | + <div class="hidden-md hidden-lg"> | |
111 | + <div class="inline pos-rel"> | |
112 | + <button class="btn btn-minier btn-primary dropdown-toggle" data-toggle="dropdown" data-position="auto"> | |
113 | + <i class="ace-icon fa fa-cog icon-only bigger-110"></i> | |
114 | + </button> | |
115 | + | |
116 | + <ul class="dropdown-menu dropdown-only-icon dropdown-yellow dropdown-menu-right dropdown-caret dropdown-close"> | |
117 | + <c:if test="${QX.edit == 1 }"> | |
118 | + <li> | |
119 | + <a style="cursor:pointer;" onclick="edit('${var.STUDENTTEST_ID}');" class="tooltip-success" data-rel="tooltip" title="修改"> | |
120 | + <span class="green"> | |
121 | + <i class="ace-icon fa fa-pencil-square-o bigger-120"></i> | |
122 | + </span> | |
123 | + </a> | |
124 | + </li> | |
125 | + </c:if> | |
126 | + <c:if test="${QX.del == 1 }"> | |
127 | + <li> | |
128 | + <a style="cursor:pointer;" onclick="del('${var.STUDENTTEST_ID}');" class="tooltip-error" data-rel="tooltip" title="删除"> | |
129 | + <span class="red"> | |
130 | + <i class="ace-icon fa fa-trash-o bigger-120"></i> | |
131 | + </span> | |
132 | + </a> | |
133 | + </li> | |
134 | + </c:if> | |
135 | + </ul> | |
136 | + </div> | |
137 | + </div> | |
138 | + </td> | |
139 | + </tr> | |
140 | + | |
141 | + </c:forEach> | |
142 | + </c:if> | |
143 | + <c:if test="${QX.cha == 0 }"> | |
144 | + <tr> | |
145 | + <td colspan="100" class="center">您无权查看</td> | |
146 | + </tr> | |
147 | + </c:if> | |
148 | + </c:when> | |
149 | + <c:otherwise> | |
150 | + <tr class="main_info"> | |
151 | + <td colspan="100" class="center" >没有相关数据</td> | |
152 | + </tr> | |
153 | + </c:otherwise> | |
154 | + </c:choose> | |
155 | + </tbody> | |
156 | + </table> | |
157 | + <div class="page-header position-relative"> | |
158 | + <table style="width:100%;"> | |
159 | + <tr> | |
160 | + <td style="vertical-align:top;"> | |
161 | + <c:if test="${QX.add == 1 }"> | |
162 | + <a class="btn btn-mini btn-success" onclick="add();">新增</a> | |
163 | + </c:if> | |
164 | + <c:if test="${QX.del == 1 }"> | |
165 | + <a class="btn btn-mini btn-danger" onclick="makeAll('确定要删除选中的数据吗?');" title="批量删除" ><i class='ace-icon fa fa-trash-o bigger-120'></i></a> | |
166 | + </c:if> | |
167 | + </td> | |
168 | + <td style="vertical-align:top;"><div class="pagination" style="float: right;padding-top: 0px;margin-top: 0px;">${page.pageStr}</div></td> | |
169 | + </tr> | |
170 | + </table> | |
171 | + </div> | |
172 | + </form> | |
173 | + | |
174 | + </div> | |
175 | + <!-- /.col --> | |
176 | + </div> | |
177 | + <!-- /.row --> | |
178 | + </div> | |
179 | + <!-- /.page-content --> | |
180 | + </div> | |
181 | + </div> | |
182 | + <!-- /.main-content --> | |
183 | + | |
184 | + <!-- 返回顶部 --> | |
185 | + <a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse"> | |
186 | + <i class="ace-icon fa fa-angle-double-up icon-only bigger-110"></i> | |
187 | + </a> | |
188 | + | |
189 | + </div> | |
190 | + <!-- /.main-container --> | |
191 | + | |
192 | + <!-- basic scripts --> | |
193 | + <!-- 页面底部js¨ --> | |
194 | + <%@ include file="../../system/index/foot.jsp"%> | |
195 | + <!-- 删除时确认窗口 --> | |
196 | + <script src="static/ace/js/bootbox.js"></script> | |
197 | + <!-- ace scripts --> | |
198 | + <script src="static/ace/js/ace/ace.js"></script> | |
199 | + <!-- 下拉框 --> | |
200 | + <script src="static/ace/js/chosen.jquery.js"></script> | |
201 | + <!-- 日期框 --> | |
202 | + <script src="static/ace/js/date-time/bootstrap-datepicker.js"></script> | |
203 | + <!--提示框--> | |
204 | + <script type="text/javascript" src="static/js/jquery.tips.js"></script> | |
205 | + <script type="text/javascript"> | |
206 | + $(top.hangge());//关闭加载状态 | |
207 | + //检索 | |
208 | + function tosearch(){ | |
209 | + top.jzts(); | |
210 | + $("#Form").submit(); | |
211 | + } | |
212 | + $(function() { | |
213 | + | |
214 | + //日期框 | |
215 | + $('.date-picker').datepicker({ | |
216 | + autoclose: true, | |
217 | + todayHighlight: true | |
218 | + }); | |
219 | + | |
220 | + //下拉框 | |
221 | + if(!ace.vars['touch']) { | |
222 | + $('.chosen-select').chosen({allow_single_deselect:true}); | |
223 | + $(window) | |
224 | + .off('resize.chosen') | |
225 | + .on('resize.chosen', function() { | |
226 | + $('.chosen-select').each(function() { | |
227 | + var $this = $(this); | |
228 | + $this.next().css({'width': $this.parent().width()}); | |
229 | + }); | |
230 | + }).trigger('resize.chosen'); | |
231 | + $(document).on('settings.ace.chosen', function(e, event_name, event_val) { | |
232 | + if(event_name != 'sidebar_collapsed') return; | |
233 | + $('.chosen-select').each(function() { | |
234 | + var $this = $(this); | |
235 | + $this.next().css({'width': $this.parent().width()}); | |
236 | + }); | |
237 | + }); | |
238 | + $('#chosen-multiple-style .btn').on('click', function(e){ | |
239 | + var target = $(this).find('input[type=radio]'); | |
240 | + var which = parseInt(target.val()); | |
241 | + if(which == 2) $('#form-field-select-4').addClass('tag-input-style'); | |
242 | + else $('#form-field-select-4').removeClass('tag-input-style'); | |
243 | + }); | |
244 | + } | |
245 | + | |
246 | + | |
247 | + //复选框全选控制 | |
248 | + var active_class = 'active'; | |
249 | + $('#simple-table > thead > tr > th input[type=checkbox]').eq(0).on('click', function(){ | |
250 | + var th_checked = this.checked;//checkbox inside "TH" table header | |
251 | + $(this).closest('table').find('tbody > tr').each(function(){ | |
252 | + var row = this; | |
253 | + if(th_checked) $(row).addClass(active_class).find('input[type=checkbox]').eq(0).prop('checked', true); | |
254 | + else $(row).removeClass(active_class).find('input[type=checkbox]').eq(0).prop('checked', false); | |
255 | + }); | |
256 | + }); | |
257 | + }); | |
258 | + | |
259 | + //新增 | |
260 | + function add(){ | |
261 | + top.jzts(); | |
262 | + var diag = new top.Dialog(); | |
263 | + diag.Drag=true; | |
264 | + diag.Title ="新增"; | |
265 | + diag.URL = '<%=basePath%>studenttest/goAdd.do'; | |
266 | + diag.Width = 450; | |
267 | + diag.Height = 355; | |
268 | + diag.Modal = true; //有无遮罩窗口 | |
269 | + diag. ShowMaxButton = true; //最大化按钮 | |
270 | + diag.ShowMinButton = true; //最小化按钮 | |
271 | + diag.CancelEvent = function(){ //关闭事件 | |
272 | + if(diag.innerFrame.contentWindow.document.getElementById('zhongxin').style.display == 'none'){ | |
273 | + if('${page.currentPage}' == '0'){ | |
274 | + tosearch(); | |
275 | + }else{ | |
276 | + tosearch(); | |
277 | + } | |
278 | + } | |
279 | + diag.close(); | |
280 | + }; | |
281 | + diag.show(); | |
282 | + } | |
283 | + | |
284 | + //删除 | |
285 | + function del(Id){ | |
286 | + bootbox.confirm("确定要删除吗?", function(result) { | |
287 | + if(result) { | |
288 | + top.jzts(); | |
289 | + var url = "<%=basePath%>studenttest/delete.do?STUDENTTEST_ID="+Id+"&tm="+new Date().getTime(); | |
290 | + $.get(url,function(data){ | |
291 | + tosearch(); | |
292 | + }); | |
293 | + } | |
294 | + }); | |
295 | + } | |
296 | + | |
297 | + //修改 | |
298 | + function edit(Id){ | |
299 | + top.jzts(); | |
300 | + var diag = new top.Dialog(); | |
301 | + diag.Drag=true; | |
302 | + diag.Title ="编辑"; | |
303 | + diag.URL = '<%=basePath%>studenttest/goEdit.do?STUDENTTEST_ID='+Id; | |
304 | + diag.Width = 450; | |
305 | + diag.Height = 355; | |
306 | + diag.Modal = true; //有无遮罩窗口 | |
307 | + diag. ShowMaxButton = true; //最大化按钮 | |
308 | + diag.ShowMinButton = true; //最小化按钮 | |
309 | + diag.CancelEvent = function(){ //关闭事件 | |
310 | + if(diag.innerFrame.contentWindow.document.getElementById('zhongxin').style.display == 'none'){ | |
311 | + tosearch(); | |
312 | + } | |
313 | + diag.close(); | |
314 | + }; | |
315 | + diag.show(); | |
316 | + } | |
317 | + | |
318 | + //批量操作 | |
319 | + function makeAll(msg){ | |
320 | + bootbox.confirm(msg, function(result) { | |
321 | + if(result) { | |
322 | + var str = ''; | |
323 | + for(var i=0;i < document.getElementsByName('ids').length;i++){ | |
324 | + if(document.getElementsByName('ids')[i].checked){ | |
325 | + if(str=='') str += document.getElementsByName('ids')[i].value; | |
326 | + else str += ',' + document.getElementsByName('ids')[i].value; | |
327 | + } | |
328 | + } | |
329 | + if(str==''){ | |
330 | + bootbox.dialog({ | |
331 | + message: "<span class='bigger-110'>您没有选择任何内容!</span>", | |
332 | + buttons: | |
333 | + { "button":{ "label":"确定", "className":"btn-sm btn-success"}} | |
334 | + }); | |
335 | + $("#zcheckbox").tips({ | |
336 | + side:1, | |
337 | + msg:'点这里全选', | |
338 | + bg:'#AE81FF', | |
339 | + time:8 | |
340 | + }); | |
341 | + return; | |
342 | + }else{ | |
343 | + if(msg == '确定要删除选中的数据吗?'){ | |
344 | + top.jzts(); | |
345 | + $.ajax({ | |
346 | + type: "POST", | |
347 | + url: '<%=basePath%>studenttest/deleteAll.do?tm='+new Date().getTime(), | |
348 | + data: {DATA_IDS:str}, | |
349 | + dataType:'json', | |
350 | + //beforeSend: validateData, | |
351 | + cache: false, | |
352 | + success: function(data){ | |
353 | + $.each(data.list, function(i, list){ | |
354 | + tosearch(); | |
355 | + }); | |
356 | + } | |
357 | + }); | |
358 | + } | |
359 | + } | |
360 | + } | |
361 | + }); | |
362 | + }; | |
363 | + | |
364 | + //导出excel | |
365 | + function toExcel(){ | |
366 | + window.location.href='<%=basePath%>studenttest/excel.do'; | |
367 | + } | |
368 | + </script> | |
369 | + | |
370 | + | |
371 | +</body> | |
372 | +</html> | |
0 | 373 | \ No newline at end of file | ... | ... |
WebRoot/WEB-INF/tld/elfun.tld
... | ... | @@ -90,7 +90,7 @@ |
90 | 90 | <description>根据ID查找教材名称</description><!-- 对该标签的说明 --> |
91 | 91 | <name>findTeachingmaterialName</name><!-- 定义标签名,放在短标签之后 --> |
92 | 92 | <function-class>com.fh.controller.sunvote.Myelfun</function-class><!-- 标签处理域值的类路径 --> |
93 | - <function-signature>java.lang.String findTeachingmaterialName(String)</function-signature><!-- 标签处理域值的具体的类方法 --> | |
93 | + <function-signature>java.lang.String findTeachingmaterialName(java.lang.String)</function-signature><!-- 标签处理域值的具体的类方法 --> | |
94 | 94 | <example>${myelfun:findTeachingmaterialName(obj1)}</example><!-- 自定义标签的使用示范 ,域参数会自动传递到具体的方法里面--> |
95 | 95 | </function> |
96 | 96 | |
... | ... | @@ -98,9 +98,34 @@ |
98 | 98 | <description>根据ID查找题目类型</description><!-- 对该标签的说明 --> |
99 | 99 | <name>findQuestionTypeName</name><!-- 定义标签名,放在短标签之后 --> |
100 | 100 | <function-class>com.fh.controller.sunvote.Myelfun</function-class><!-- 标签处理域值的类路径 --> |
101 | - <function-signature>java.lang.String findQuestionTypeName(String)</function-signature><!-- 标签处理域值的具体的类方法 --> | |
101 | + <function-signature>java.lang.String findQuestionTypeName(java.lang.String)</function-signature><!-- 标签处理域值的具体的类方法 --> | |
102 | 102 | <example>${myelfun:findQuestionTypeName(obj1)}</example><!-- 自定义标签的使用示范 ,域参数会自动传递到具体的方法里面--> |
103 | 103 | </function> |
104 | 104 | |
105 | + <function> | |
106 | + <description>根据ID查找试卷类型</description><!-- 对该标签的说明 --> | |
107 | + <name>findPaperTypeName</name><!-- 定义标签名,放在短标签之后 --> | |
108 | + <function-class>com.fh.controller.sunvote.Myelfun</function-class><!-- 标签处理域值的类路径 --> | |
109 | + <function-signature>java.lang.String findPaperTypeName(java.lang.String)</function-signature><!-- 标签处理域值的具体的类方法 --> | |
110 | + <example>${myelfun:findPaperTypeName(obj1)}</example><!-- 自定义标签的使用示范 ,域参数会自动传递到具体的方法里面--> | |
111 | + </function> | |
112 | + | |
113 | + <function> | |
114 | + <description>根据ID查找试卷名称</description><!-- 对该标签的说明 --> | |
115 | + <name>findPaperName</name><!-- 定义标签名,放在短标签之后 --> | |
116 | + <function-class>com.fh.controller.sunvote.Myelfun</function-class><!-- 标签处理域值的类路径 --> | |
117 | + <function-signature>java.lang.String findPaperName(java.lang.String)</function-signature><!-- 标签处理域值的具体的类方法 --> | |
118 | + <example>${myelfun:findPaperName(obj1)}</example><!-- 自定义标签的使用示范 ,域参数会自动传递到具体的方法里面--> | |
119 | + </function> | |
120 | + | |
121 | + <function> | |
122 | + <description>根据ID查找试卷名称</description><!-- 对该标签的说明 --> | |
123 | + <name>findTestPaperName</name><!-- 定义标签名,放在短标签之后 --> | |
124 | + <function-class>com.fh.controller.sunvote.Myelfun</function-class><!-- 标签处理域值的类路径 --> | |
125 | + <function-signature>java.lang.String findTestPaperName(java.lang.String)</function-signature><!-- 标签处理域值的具体的类方法 --> | |
126 | + <example>${myelfun:findTestPaperName(obj1)}</example><!-- 自定义标签的使用示范 ,域参数会自动传递到具体的方法里面--> | |
127 | + </function> | |
128 | + | |
129 | + | |
105 | 130 | |
106 | 131 | </taglib> | ... | ... |
WebRoot/afterService/document/新东方售后政策&改善说明.pdf
No preview for this file type
resources/mybatis1/sunvote/StudentTestMapper.xml
0 → 100644
1 | +<?xml version="1.0" encoding="UTF-8"?> | |
2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |
3 | +<mapper namespace="StudentTestMapper"> | |
4 | + | |
5 | + <!--表名 --> | |
6 | + <sql id="tableName"> | |
7 | + SV_STUDENTTEST | |
8 | + </sql> | |
9 | + | |
10 | + <!-- 字段 --> | |
11 | + <sql id="Field"> | |
12 | + STUDENT_ID, | |
13 | + TEST_ID, | |
14 | + PAPER_ID, | |
15 | + SCORE, | |
16 | + CLASS_ID, | |
17 | + STUDENTTEST_ID | |
18 | + </sql> | |
19 | + | |
20 | + <!-- 字段值 --> | |
21 | + <sql id="FieldValue"> | |
22 | + #{STUDENT_ID}, | |
23 | + #{TEST_ID}, | |
24 | + #{PAPER_ID}, | |
25 | + #{SCORE}, | |
26 | + #{CLASS_ID}, | |
27 | + #{STUDENTTEST_ID} | |
28 | + </sql> | |
29 | + | |
30 | + <!-- 新增--> | |
31 | + <insert id="save" parameterType="pd"> | |
32 | + insert into | |
33 | + <include refid="tableName"></include> | |
34 | + ( | |
35 | + <include refid="Field"></include> | |
36 | + ) values ( | |
37 | + <include refid="FieldValue"></include> | |
38 | + ) | |
39 | + </insert> | |
40 | + | |
41 | + <!-- 删除--> | |
42 | + <delete id="delete" parameterType="pd"> | |
43 | + delete from | |
44 | + <include refid="tableName"></include> | |
45 | + where | |
46 | + STUDENTTEST_ID = #{STUDENTTEST_ID} | |
47 | + </delete> | |
48 | + | |
49 | + <!-- 修改 --> | |
50 | + <update id="edit" parameterType="pd"> | |
51 | + update | |
52 | + <include refid="tableName"></include> | |
53 | + set | |
54 | + STUDENT_ID = #{STUDENT_ID}, | |
55 | + TEST_ID = #{TEST_ID}, | |
56 | + PAPER_ID = #{PAPER_ID}, | |
57 | + SCORE = #{SCORE}, | |
58 | + CLASS_ID = #{CLASS_ID}, | |
59 | + STUDENTTEST_ID = STUDENTTEST_ID | |
60 | + where | |
61 | + STUDENTTEST_ID = #{STUDENTTEST_ID} | |
62 | + </update> | |
63 | + | |
64 | + <!-- 通过ID获取数据 --> | |
65 | + <select id="findById" parameterType="pd" resultType="pd"> | |
66 | + select | |
67 | + <include refid="Field"></include> | |
68 | + from | |
69 | + <include refid="tableName"></include> | |
70 | + where | |
71 | + STUDENTTEST_ID = #{STUDENTTEST_ID} | |
72 | + </select> | |
73 | + | |
74 | + <!-- 列表 --> | |
75 | + <select id="datalistPage" parameterType="page" resultType="pd"> | |
76 | + select | |
77 | + <include refid="Field"></include> | |
78 | + from | |
79 | + <include refid="tableName"></include> | |
80 | + where 1=1 | |
81 | + <if test="pd.keywords!= null and pd.keywords != ''"><!-- 关键词检索 --> | |
82 | + and | |
83 | + ( | |
84 | + <!-- 根据需求自己加检索条件 | |
85 | + 字段1 LIKE CONCAT(CONCAT('%', #{pd.keywords}),'%') | |
86 | + or | |
87 | + 字段2 LIKE CONCAT(CONCAT('%', #{pd.keywords}),'%') | |
88 | + --> | |
89 | + ) | |
90 | + </if> | |
91 | + </select> | |
92 | + | |
93 | + <!-- 列表(全部) --> | |
94 | + <select id="listAll" parameterType="pd" resultType="pd"> | |
95 | + select | |
96 | + <include refid="Field"></include> | |
97 | + from | |
98 | + <include refid="tableName"></include> | |
99 | + where 1= 1 | |
100 | + <if test="TEST_ID != null and TEST_ID != ''"><!-- 关键词检索 --> | |
101 | + and (TEST_ID = #{TEST_ID}) | |
102 | + </if> | |
103 | + | |
104 | + <if test="PAPER_ID != null and PAPER_ID != ''"><!-- 关键词检索 --> | |
105 | + and (PAPER_ID = #{PAPER_ID}) | |
106 | + </if> | |
107 | + | |
108 | + <if test="CLASS_ID != null and CLASS_ID != ''"><!-- 关键词检索 --> | |
109 | + and (CLASS_ID = #{CLASS_ID}) | |
110 | + </if> | |
111 | + | |
112 | + <if test="STUDENT_ID != null and STUDENT_ID != ''"><!-- 关键词检索 --> | |
113 | + and (STUDENT_ID = #{STUDENT_ID}) | |
114 | + </if> | |
115 | + </select> | |
116 | + | |
117 | + <!-- 批量删除 --> | |
118 | + <delete id="deleteAll" parameterType="String"> | |
119 | + delete from | |
120 | + <include refid="tableName"></include> | |
121 | + where | |
122 | + STUDENTTEST_ID in | |
123 | + <foreach item="item" index="index" collection="array" open="(" separator="," close=")"> | |
124 | + #{item} | |
125 | + </foreach> | |
126 | + </delete> | |
127 | + | |
128 | + <!-- fh313596790qq(青苔) --> | |
129 | +</mapper> | |
0 | 130 | \ No newline at end of file | ... | ... |
resources/mybatis1/sunvote/TestPaperInfoMapper.xml
... | ... | @@ -23,6 +23,7 @@ |
23 | 23 | SUBJECTIVE, |
24 | 24 | NOTE, |
25 | 25 | MARK_NO, |
26 | + RANK, | |
26 | 27 | TESTPAPERINFO_ID |
27 | 28 | </sql> |
28 | 29 | |
... | ... | @@ -42,6 +43,7 @@ |
42 | 43 | #{SUBJECTIVE}, |
43 | 44 | #{NOTE}, |
44 | 45 | #{MARK_NO}, |
46 | + #{RANK}, | |
45 | 47 | #{TESTPAPERINFO_ID} |
46 | 48 | </sql> |
47 | 49 | |
... | ... | @@ -83,6 +85,7 @@ |
83 | 85 | SUBJECTIVE = #{SUBJECTIVE}, |
84 | 86 | NOTE = #{NOTE}, |
85 | 87 | MARK_NO = #{MARK_NO}, |
88 | + RANK = #{RANK}, | |
86 | 89 | TESTPAPERINFO_ID = TESTPAPERINFO_ID |
87 | 90 | where |
88 | 91 | TESTPAPERINFO_ID = #{TESTPAPERINFO_ID} |
... | ... | @@ -123,8 +126,22 @@ |
123 | 126 | <include refid="Field"></include> |
124 | 127 | from |
125 | 128 | <include refid="tableName"></include> |
129 | + where 1 =1 | |
130 | + <if test="TEST_ID != null and TEST_ID != ''"> | |
131 | + and TEST_ID = #{TEST_ID} | |
132 | + </if> | |
133 | + <if test="STUDENT_ID != null and STUDENT_ID != ''"> | |
134 | + and STUDENT_ID = #{STUDENT_ID} | |
135 | + </if> | |
136 | + <if test="PAPER_ID != null and PAPER_ID != ''"> | |
137 | + and PAPER_ID = #{PAPER_ID} | |
138 | + </if> | |
139 | + <if test="QUESTION_ID != null and QUESTION_ID != ''"> | |
140 | + and QUESTION_ID = #{QUESTION_ID} | |
141 | + </if> | |
126 | 142 | </select> |
127 | 143 | |
144 | + | |
128 | 145 | <!-- 批量删除 --> |
129 | 146 | <delete id="deleteAll" parameterType="String"> |
130 | 147 | delete from | ... | ... |
resources/mybatis1/sunvote/TestPaperMapper.xml
... | ... | @@ -117,6 +117,22 @@ |
117 | 117 | <include refid="Field"></include> |
118 | 118 | from |
119 | 119 | <include refid="tableName"></include> |
120 | + | |
121 | + where 1 =1 | |
122 | + | |
123 | + <if test="PAPER_ID != null and PAPER_ID != ''"><!-- 关键词检索 --> | |
124 | + and (PAPER_ID = #{PAPER_ID}) | |
125 | + </if> | |
126 | + <if test="CLASS_ID != null and CLASS_ID != ''"><!-- 关键词检索 --> | |
127 | + and (SCLASS_ID = #{CLASS_ID}) | |
128 | + </if> | |
129 | + <if test="TEACHER_ID != null and TEACHER_ID != ''"><!-- 关键词检索 --> | |
130 | + and (TEACHER_ID = #{TEACHER_ID}) | |
131 | + </if> | |
132 | + <if test="NAME != null and NAME != ''"><!-- 关键词检索 --> | |
133 | + and (NAME = #{NAME}) | |
134 | + </if> | |
135 | + | |
120 | 136 | </select> |
121 | 137 | |
122 | 138 | <!-- 批量删除 --> | ... | ... |
src/com/fh/bean/StudentAnswer.java
0 → 100644
1 | +package com.fh.bean; | |
2 | + | |
3 | +import java.util.ArrayList; | |
4 | +import java.util.List; | |
5 | + | |
6 | +import com.google.gson.Gson; | |
7 | + | |
8 | +public class StudentAnswer { | |
9 | + | |
10 | + private String studentId; | |
11 | + | |
12 | + private String score; | |
13 | + | |
14 | + private List<TestPaperInfo> questions = new ArrayList<TestPaperInfo>(); | |
15 | + | |
16 | + public String getStudentId() { | |
17 | + return studentId; | |
18 | + } | |
19 | + | |
20 | + public void setStudentId(String studentId) { | |
21 | + this.studentId = studentId; | |
22 | + } | |
23 | + | |
24 | + public String getScore() { | |
25 | + return score; | |
26 | + } | |
27 | + | |
28 | + public void setScore(String score) { | |
29 | + this.score = score; | |
30 | + } | |
31 | + | |
32 | + public List<TestPaperInfo> getQuestions() { | |
33 | + return questions; | |
34 | + } | |
35 | + | |
36 | + public void setQuestions(List<TestPaperInfo> questions) { | |
37 | + this.questions = questions; | |
38 | + } | |
39 | + | |
40 | + | |
41 | + public static StudentAnswer parse(String json){ | |
42 | + Gson gson = new Gson(); | |
43 | + return gson.fromJson(json, StudentAnswer.class); | |
44 | + } | |
45 | + | |
46 | + public String toJson(){ | |
47 | + Gson gson = new Gson(); | |
48 | + return gson.toJson(this); | |
49 | + } | |
50 | + | |
51 | + | |
52 | +} | ... | ... |
src/com/fh/bean/TestPaper.java
0 → 100644
1 | +package com.fh.bean; | |
2 | + | |
3 | +import java.util.ArrayList; | |
4 | +import java.util.List; | |
5 | + | |
6 | +import com.google.gson.Gson; | |
7 | + | |
8 | +public class TestPaper { | |
9 | + | |
10 | + // 测试ID | |
11 | + private String testpaperId ; | |
12 | + | |
13 | + // 测验标题 | |
14 | + private String name ; | |
15 | + | |
16 | + // 试卷ID | |
17 | + private String paperId ; | |
18 | + | |
19 | + // 班级ID | |
20 | + private String classId ; | |
21 | + | |
22 | + // 教师ID | |
23 | + private String teacherId ; | |
24 | + | |
25 | + // 开始日期 | |
26 | + private String startDate ; | |
27 | + | |
28 | + //结束日期 | |
29 | + private String endDate ; | |
30 | + | |
31 | + //创建日期 | |
32 | + private String createDate ; | |
33 | + | |
34 | + // 其他分数 | |
35 | + private String otherScore ; | |
36 | + | |
37 | + // 最高分 | |
38 | + private String highScore ; | |
39 | + | |
40 | + //最低分 | |
41 | + private String lowScore ; | |
42 | + | |
43 | + // 平均分 | |
44 | + private String avgScore ; | |
45 | + | |
46 | + // 备注 | |
47 | + private String remark ; | |
48 | + | |
49 | + private List<StudentAnswer> students = new ArrayList<StudentAnswer>(); | |
50 | + | |
51 | + public String getTestpaperId() { | |
52 | + return testpaperId; | |
53 | + } | |
54 | + | |
55 | + public void setTestpaperId(String testpaperId) { | |
56 | + this.testpaperId = testpaperId; | |
57 | + } | |
58 | + | |
59 | + public String getName() { | |
60 | + return name; | |
61 | + } | |
62 | + | |
63 | + public void setName(String name) { | |
64 | + this.name = name; | |
65 | + } | |
66 | + | |
67 | + public String getPaperId() { | |
68 | + return paperId; | |
69 | + } | |
70 | + | |
71 | + public void setPaperId(String paperId) { | |
72 | + this.paperId = paperId; | |
73 | + } | |
74 | + | |
75 | + | |
76 | + | |
77 | + public String getClassId() { | |
78 | + return classId; | |
79 | + } | |
80 | + | |
81 | + public void setClassId(String classId) { | |
82 | + this.classId = classId; | |
83 | + } | |
84 | + | |
85 | + public String getTeacherId() { | |
86 | + return teacherId; | |
87 | + } | |
88 | + | |
89 | + public void setTeacherId(String teacherId) { | |
90 | + this.teacherId = teacherId; | |
91 | + } | |
92 | + | |
93 | + public String getStartDate() { | |
94 | + return startDate; | |
95 | + } | |
96 | + | |
97 | + public void setStartDate(String startDate) { | |
98 | + this.startDate = startDate; | |
99 | + } | |
100 | + | |
101 | + public String getEndDate() { | |
102 | + return endDate; | |
103 | + } | |
104 | + | |
105 | + public void setEndDate(String endDate) { | |
106 | + this.endDate = endDate; | |
107 | + } | |
108 | + | |
109 | + public String getCreateDate() { | |
110 | + return createDate; | |
111 | + } | |
112 | + | |
113 | + public void setCreateDate(String createDate) { | |
114 | + this.createDate = createDate; | |
115 | + } | |
116 | + | |
117 | + public String getOtherScore() { | |
118 | + return otherScore; | |
119 | + } | |
120 | + | |
121 | + public void setOtherScore(String otherScore) { | |
122 | + this.otherScore = otherScore; | |
123 | + } | |
124 | + | |
125 | + public String getHighScore() { | |
126 | + return highScore; | |
127 | + } | |
128 | + | |
129 | + public void setHighScore(String highScore) { | |
130 | + this.highScore = highScore; | |
131 | + } | |
132 | + | |
133 | + public String getLowScore() { | |
134 | + return lowScore; | |
135 | + } | |
136 | + | |
137 | + public void setLowScore(String lowScore) { | |
138 | + this.lowScore = lowScore; | |
139 | + } | |
140 | + | |
141 | + public String getAvgScore() { | |
142 | + return avgScore; | |
143 | + } | |
144 | + | |
145 | + public void setAvgScore(String avgScore) { | |
146 | + this.avgScore = avgScore; | |
147 | + } | |
148 | + | |
149 | + public String getRemark() { | |
150 | + return remark; | |
151 | + } | |
152 | + | |
153 | + public void setRemark(String remark) { | |
154 | + this.remark = remark; | |
155 | + } | |
156 | + | |
157 | + | |
158 | + public List<StudentAnswer> getStudents() { | |
159 | + return students; | |
160 | + } | |
161 | + | |
162 | + public void setStudents(List<StudentAnswer> students) { | |
163 | + this.students = students; | |
164 | + } | |
165 | + | |
166 | + public static TestPaper parse(String json){ | |
167 | + Gson gson = new Gson(); | |
168 | + return gson.fromJson(json, TestPaper.class); | |
169 | + } | |
170 | + | |
171 | + public String toJson(){ | |
172 | + Gson gson = new Gson(); | |
173 | + return gson.toJson(this); | |
174 | + } | |
175 | + | |
176 | +} | ... | ... |
src/com/fh/bean/TestPaperInfo.java
0 → 100644
1 | +package com.fh.bean; | |
2 | + | |
3 | +import com.google.gson.Gson; | |
4 | + | |
5 | +public class TestPaperInfo { | |
6 | + | |
7 | + // 测试试卷ID | |
8 | + private String testPaperInfoId ; | |
9 | + | |
10 | + // 问题ID | |
11 | + private String questionId ; | |
12 | + | |
13 | + // 答案 | |
14 | + private String answer ; | |
15 | + | |
16 | + // 是否正确 | |
17 | + private String right; | |
18 | + | |
19 | + // 分数 | |
20 | + private String score ; | |
21 | + | |
22 | + | |
23 | + // 是否点赞 | |
24 | + private String likes ; | |
25 | + | |
26 | + // 回答类型 | |
27 | + private String answerType ; | |
28 | + | |
29 | + // 按键时间 | |
30 | + private String pressTime ; | |
31 | + | |
32 | + // 接收时间 | |
33 | + private String receiverDate ; | |
34 | + | |
35 | + // 是否主观题 | |
36 | + private String subjective ; | |
37 | + | |
38 | + // 笔记 | |
39 | + private String note; | |
40 | + | |
41 | + // 标记等级 | |
42 | + private String markNo ; | |
43 | + | |
44 | + // 排序 | |
45 | + private String rank ; | |
46 | + | |
47 | + | |
48 | + public String getTestPaperInfoId() { | |
49 | + return testPaperInfoId; | |
50 | + } | |
51 | + | |
52 | + public void setTestPaperInfoId(String testPaperInfoId) { | |
53 | + this.testPaperInfoId = testPaperInfoId; | |
54 | + } | |
55 | + | |
56 | + public String getQuestionId() { | |
57 | + return questionId; | |
58 | + } | |
59 | + | |
60 | + public void setQuestionId(String questionId) { | |
61 | + this.questionId = questionId; | |
62 | + } | |
63 | + | |
64 | + public String getAnswer() { | |
65 | + return answer; | |
66 | + } | |
67 | + | |
68 | + public void setAnswer(String answer) { | |
69 | + this.answer = answer; | |
70 | + } | |
71 | + | |
72 | + public String getRight() { | |
73 | + return right; | |
74 | + } | |
75 | + | |
76 | + public void setRight(String right) { | |
77 | + this.right = right; | |
78 | + } | |
79 | + | |
80 | + public String getScore() { | |
81 | + return score; | |
82 | + } | |
83 | + | |
84 | + public void setScore(String score) { | |
85 | + this.score = score; | |
86 | + } | |
87 | + | |
88 | + public String getLikes() { | |
89 | + return likes; | |
90 | + } | |
91 | + | |
92 | + public void setLikes(String likes) { | |
93 | + this.likes = likes; | |
94 | + } | |
95 | + | |
96 | + public String getAnswerType() { | |
97 | + return answerType; | |
98 | + } | |
99 | + | |
100 | + public void setAnswerType(String answerType) { | |
101 | + this.answerType = answerType; | |
102 | + } | |
103 | + | |
104 | + public String getPressTime() { | |
105 | + return pressTime; | |
106 | + } | |
107 | + | |
108 | + public void setPressTime(String pressTime) { | |
109 | + this.pressTime = pressTime; | |
110 | + } | |
111 | + | |
112 | + public String getReceiverDate() { | |
113 | + return receiverDate; | |
114 | + } | |
115 | + | |
116 | + public void setReceiverDate(String receiverDate) { | |
117 | + this.receiverDate = receiverDate; | |
118 | + } | |
119 | + | |
120 | + public String getSubjective() { | |
121 | + return subjective; | |
122 | + } | |
123 | + | |
124 | + public void setSubjective(String subjective) { | |
125 | + this.subjective = subjective; | |
126 | + } | |
127 | + | |
128 | + public String getNote() { | |
129 | + return note; | |
130 | + } | |
131 | + | |
132 | + public void setNote(String note) { | |
133 | + this.note = note; | |
134 | + } | |
135 | + | |
136 | + public String getMarkNo() { | |
137 | + return markNo; | |
138 | + } | |
139 | + | |
140 | + public void setMarkNo(String markNo) { | |
141 | + this.markNo = markNo; | |
142 | + } | |
143 | + | |
144 | + public String getRank() { | |
145 | + return rank; | |
146 | + } | |
147 | + | |
148 | + public void setRank(String rank) { | |
149 | + this.rank = rank; | |
150 | + } | |
151 | + | |
152 | + public static TestPaperInfo parse(String json){ | |
153 | + Gson gson = new Gson(); | |
154 | + return gson.fromJson(json, TestPaperInfo.class); | |
155 | + } | |
156 | + | |
157 | + public String toJson(){ | |
158 | + Gson gson = new Gson(); | |
159 | + return gson.toJson(this); | |
160 | + } | |
161 | + | |
162 | +} | ... | ... |
src/com/fh/controller/api/V1.java
... | ... | @@ -13,6 +13,9 @@ import org.springframework.web.bind.annotation.ResponseBody; |
13 | 13 | |
14 | 14 | import com.fh.bean.Paper; |
15 | 15 | import com.fh.bean.Question; |
16 | +import com.fh.bean.StudentAnswer; | |
17 | +import com.fh.bean.TestPaper; | |
18 | +import com.fh.bean.TestPaperInfo; | |
16 | 19 | import com.fh.controller.base.BaseController; |
17 | 20 | import com.fh.controller.sunvote.Myelfun; |
18 | 21 | import com.fh.entity.Page; |
... | ... | @@ -40,8 +43,10 @@ import com.fh.service.sunvote.school.SchoolManager; |
40 | 43 | import com.fh.service.sunvote.schoolgradesubject.SchoolGradeSubjectManager; |
41 | 44 | import com.fh.service.sunvote.sclass.SClassManager; |
42 | 45 | import com.fh.service.sunvote.student.StudentManager; |
46 | +import com.fh.service.sunvote.studenttest.StudentTestManager; | |
43 | 47 | import com.fh.service.sunvote.subject.SubjectManager; |
44 | 48 | import com.fh.service.sunvote.teacher.TeacherManager; |
49 | +import com.fh.service.sunvote.testpaper.TestPaperManager; | |
45 | 50 | import com.fh.service.sunvote.testpaperinfo.TestPaperInfoManager; |
46 | 51 | import com.fh.util.PageData; |
47 | 52 | import com.fh.util.Tools; |
... | ... | @@ -49,125 +54,134 @@ import com.fh.util.Tools; |
49 | 54 | @Controller |
50 | 55 | @RequestMapping(value = "/api/v1") |
51 | 56 | public class V1 extends BaseController { |
52 | - | |
57 | + | |
53 | 58 | @Resource(name = "schoolService") |
54 | 59 | private SchoolManager schoolService; |
55 | 60 | |
56 | 61 | @Resource(name = "basestationService") |
57 | 62 | private BasestationManager basestationService; |
58 | - | |
59 | - @Resource(name="chapterService") | |
63 | + | |
64 | + @Resource(name = "chapterService") | |
60 | 65 | private ChapterManager chapterService; |
61 | - | |
62 | - @Resource(name="classbasetationService") | |
66 | + | |
67 | + @Resource(name = "classbasetationService") | |
63 | 68 | private ClassBasetationManager classbasetationService; |
64 | - | |
65 | - @Resource(name="classrosterService") | |
69 | + | |
70 | + @Resource(name = "classrosterService") | |
66 | 71 | private ClassRosterManager classrosterService; |
67 | - | |
68 | - @Resource(name="classtypeService") | |
72 | + | |
73 | + @Resource(name = "classtypeService") | |
69 | 74 | private ClassTypeManager classtypeService; |
70 | - | |
71 | - @Resource(name="gradeService") | |
75 | + | |
76 | + @Resource(name = "gradeService") | |
72 | 77 | private GradeManager gradeService; |
73 | - | |
74 | - @Resource(name="coursemanagementService") | |
78 | + | |
79 | + @Resource(name = "coursemanagementService") | |
75 | 80 | private CourseManagementManager coursemanagementService; |
76 | 81 | |
77 | 82 | @Resource(name = "keypadService") |
78 | 83 | private KeypadManager keypadService; |
79 | - | |
80 | - @Resource(name="keypadcheckService") | |
84 | + | |
85 | + @Resource(name = "keypadcheckService") | |
81 | 86 | private KeypadCheckManager keypadcheckService; |
82 | - | |
83 | - @Resource(name="knowledgeService") | |
87 | + | |
88 | + @Resource(name = "knowledgeService") | |
84 | 89 | private KnowledgeManager knowledgeService; |
85 | - | |
86 | - @Resource(name="knowledgechapterService") | |
90 | + | |
91 | + @Resource(name = "knowledgechapterService") | |
87 | 92 | private KnowledgeChapterManager knowledgechapterService; |
88 | - | |
89 | - @Resource(name="paperService") | |
93 | + | |
94 | + @Resource(name = "paperService") | |
90 | 95 | private PaperManager paperService; |
91 | - | |
92 | - @Resource(name="paperclassteacherService") | |
96 | + | |
97 | + @Resource(name = "paperclassteacherService") | |
93 | 98 | private PaperClassTeacherManager paperclassteacherService; |
94 | - | |
95 | - @Resource(name="paperquestionService") | |
99 | + | |
100 | + @Resource(name = "paperquestionService") | |
96 | 101 | private PaperQuestionManager paperquestionService; |
97 | - | |
98 | - @Resource(name="papertypeService") | |
102 | + | |
103 | + @Resource(name = "papertypeService") | |
99 | 104 | private PaperTypeManager papertypeService; |
100 | - | |
101 | - @Resource(name="questionService") | |
105 | + | |
106 | + @Resource(name = "questionService") | |
102 | 107 | private QuestionManager questionService; |
103 | - | |
104 | - @Resource(name="questiontypeService") | |
108 | + | |
109 | + @Resource(name = "questiontypeService") | |
105 | 110 | private QuestionTypeManager questiontypeService; |
106 | - | |
107 | - @Resource(name="schoolgradesubjectService") | |
111 | + | |
112 | + @Resource(name = "schoolgradesubjectService") | |
108 | 113 | private SchoolGradeSubjectManager schoolgradesubjectService; |
109 | - | |
110 | - @Resource(name="sclassService") | |
114 | + | |
115 | + @Resource(name = "sclassService") | |
111 | 116 | private SClassManager sclassService; |
112 | - | |
113 | - @Resource(name="studentService") | |
117 | + | |
118 | + @Resource(name = "studentService") | |
114 | 119 | private StudentManager studentService; |
115 | - | |
116 | - @Resource(name="subjectService") | |
120 | + | |
121 | + @Resource(name = "subjectService") | |
117 | 122 | private SubjectManager subjectService; |
118 | - | |
119 | - @Resource(name="teacherService") | |
123 | + | |
124 | + @Resource(name = "teacherService") | |
120 | 125 | private TeacherManager teacherService; |
121 | - | |
122 | - @Resource(name="testpaperinfoService") | |
126 | + | |
127 | + @Resource(name = "testpaperinfoService") | |
123 | 128 | private TestPaperInfoManager testpaperinfoService; |
124 | 129 | |
130 | + @Resource(name = "testpaperService") | |
131 | + private TestPaperManager testpaperService; | |
132 | + | |
133 | + @Resource(name = "studenttestService") | |
134 | + private StudentTestManager studenttestService; | |
135 | + | |
125 | 136 | @Resource(name = "feedbackService") |
126 | 137 | private FeedbackManager feedbackService; |
127 | 138 | |
128 | 139 | @Resource(name = "problemphenomenonService") |
129 | 140 | private ProblemPhenomenonManager problemphenomenonService; |
130 | - | |
141 | + | |
131 | 142 | @Resource(name = "v1Service") |
132 | - private V1Manager v1Service ; | |
133 | - | |
143 | + private V1Manager v1Service; | |
144 | + | |
134 | 145 | @RequestMapping(value = "/login", produces = "application/json;charset=UTF-8") |
135 | 146 | @ResponseBody |
136 | 147 | public Object login() throws Exception { |
137 | 148 | PageData pd = this.getPageData(); |
138 | 149 | ResponseGson<PageData> res = new ResponseGson(); |
139 | - if(!pd.containsKey("ACCOUT")){ | |
150 | + if (!pd.containsKey("ACCOUT")) { | |
140 | 151 | pd.put("ACCOUT", pd.get("USERNAME")); |
141 | 152 | } |
142 | - if(((pd.containsKey("USERNAME") || pd.containsKey("ACCOUT")) && pd.containsKey("PASSWORD")) || pd.containsKey("KEYPAD_ID")){ | |
153 | + if (((pd.containsKey("USERNAME") || pd.containsKey("ACCOUT")) && pd | |
154 | + .containsKey("PASSWORD")) || pd.containsKey("KEYPAD_ID")) { | |
143 | 155 | PageData pageData = teacherService.getUserInfo(pd); |
144 | - if(pageData != null && pageData.getString("ID") != null){ | |
145 | - pageData.put("PASSWORD", "");//返回参数中不返回密码 | |
156 | + if (pageData != null && pageData.getString("ID") != null) { | |
157 | + pageData.put("PASSWORD", "");// 返回参数中不返回密码 | |
146 | 158 | PageData pt = new PageData(); |
147 | 159 | pt.put("TEACHER_ID", pageData.get("ID")); |
148 | 160 | // 在任课表中查找老师教哪些班级,然后查出班级信息 |
149 | - List<PageData> classInfoList = v1Service.getTeacherClassInfo(pt); | |
150 | - | |
161 | + List<PageData> classInfoList = v1Service | |
162 | + .getTeacherClassInfo(pt); | |
163 | + | |
151 | 164 | pageData.put("classInfoList", classInfoList); |
152 | 165 | // 在认可表中查找老师教哪些科目,然后查出科目信息 |
153 | - List<PageData> subjectList = v1Service.getTeacherSubjectInfo(pt); | |
166 | + List<PageData> subjectList = v1Service | |
167 | + .getTeacherSubjectInfo(pt); | |
154 | 168 | // 一个sql语句完成。 |
155 | 169 | pageData.put("subjectList", subjectList); |
156 | - | |
170 | + | |
157 | 171 | pageData.remove("SUBJECT_IDS"); |
158 | - | |
172 | + | |
159 | 173 | res.setData(pageData); |
160 | 174 | // 填充数据到返回数据中 |
161 | - }else{ | |
175 | + } else { | |
162 | 176 | res.set1Error(); |
163 | 177 | } |
164 | - }else{ | |
178 | + } else { | |
165 | 179 | res.set1Error(); |
166 | 180 | } |
167 | - | |
181 | + | |
168 | 182 | return res.toJson(); |
169 | 183 | } |
170 | - | |
184 | + | |
171 | 185 | @RequestMapping(value = "/class", produces = "application/json;charset=UTF-8") |
172 | 186 | @ResponseBody |
173 | 187 | public Object sclass() throws Exception { |
... | ... | @@ -178,193 +192,218 @@ public class V1 extends BaseController { |
178 | 192 | if (pageData != null && pageData.containsKey("ID")) { |
179 | 193 | PageData pt = new PageData(); |
180 | 194 | pt.put("SCLASS_ID", pageData.get("ID")); |
181 | - List<PageData> studentList = v1Service | |
182 | - .getClassStudent(pt); | |
195 | + List<PageData> studentList = v1Service.getClassStudent(pt); | |
183 | 196 | pageData.put("studentList", studentList); |
184 | 197 | res.setData(pageData); |
185 | 198 | } else { |
186 | 199 | res.set2Error(); |
187 | 200 | } |
188 | - }else{ | |
201 | + } else { | |
189 | 202 | res.set2Error(); |
190 | 203 | } |
191 | 204 | return res.toJson(); |
192 | 205 | } |
193 | - | |
206 | + | |
194 | 207 | @RequestMapping(value = "/keypadscan", produces = "application/json;charset=UTF-8") |
195 | 208 | @ResponseBody |
196 | 209 | public Object keypadScan() throws Exception { |
197 | 210 | PageData pd = this.getPageData(); |
198 | - ResponseGson<PageData> res = new ResponseGson(); | |
199 | - pd.put("KEYPADCHECK_ID", get32UUID()); //主键 | |
200 | - pd.put("CREATE_DATE", Tools.date2Str(new Date())); //创建时间 | |
201 | - try{ | |
211 | + ResponseGson<String> res = new ResponseGson(); | |
212 | + String ID = get32UUID(); | |
213 | + pd.put("KEYPADCHECK_ID", ID); // 主键 | |
214 | + pd.put("CREATE_DATE", Tools.date2Str(new Date())); // 创建时间 | |
215 | + try { | |
202 | 216 | keypadcheckService.save(pd); |
217 | + res.setData(ID); | |
203 | 218 | res.setSuccess(); |
204 | - }catch(Exception ex){ | |
219 | + } catch (Exception ex) { | |
205 | 220 | res.setDataError(); |
206 | 221 | } |
207 | 222 | return res.toJson(); |
208 | 223 | } |
209 | - | |
224 | + | |
210 | 225 | @RequestMapping(value = "/paper", produces = "application/json;charset=UTF-8") |
211 | 226 | @ResponseBody |
212 | 227 | public Object paper() throws Exception { |
213 | 228 | PageData pd = this.getPageData(); |
214 | 229 | ResponseGson<List<PageData>> res = new ResponseGson<List<PageData>>(); |
215 | - if(pd.containsKey("PAPER_TYPE") && pd.containsKey("USER_ID")){ | |
230 | + if (pd.containsKey("PAPER_TYPE") && pd.containsKey("USER_ID")) { | |
216 | 231 | Page page = new Page(); |
217 | 232 | page.getPd().put("PAPER_TYPE", pd.get("PAPER_TYPE")); |
218 | 233 | page.getPd().put("USER_ID", pd.get("USER_ID")); |
219 | - if(pd.containsKey("CURRENTPAGE")){ | |
234 | + if (pd.containsKey("CURRENTPAGE")) { | |
220 | 235 | String curpage = pd.getString("CURRENTPAGE"); |
221 | - try{ | |
236 | + try { | |
222 | 237 | page.setCurrentPage(Integer.parseInt(curpage)); |
223 | - }catch(Exception ex){} | |
238 | + } catch (Exception ex) { | |
239 | + } | |
224 | 240 | } |
225 | - if(pd.containsKey("SHOWCOUNT")){ | |
241 | + if (pd.containsKey("SHOWCOUNT")) { | |
226 | 242 | String showCount = pd.getString("SHOWCOUNT"); |
227 | - try{ | |
243 | + try { | |
228 | 244 | page.setShowCount(Integer.parseInt(showCount)); |
229 | - }catch(Exception ex){} | |
230 | - }else{ | |
245 | + } catch (Exception ex) { | |
246 | + } | |
247 | + } else { | |
231 | 248 | page.setShowCount(100); |
232 | 249 | } |
233 | 250 | List<PageData> pageList = paperService.listAllByType(page); |
234 | 251 | res.setData(pageList); |
235 | - }else{ | |
252 | + } else { | |
236 | 253 | res.setParmError(); |
237 | 254 | } |
238 | 255 | return res.toJson(); |
239 | 256 | } |
240 | - | |
241 | - @RequestMapping(value = "/testpaper", produces = "application/json;charset=UTF-8") | |
257 | + | |
258 | + @RequestMapping(value = "/paperinfo", produces = "application/json;charset=UTF-8") | |
242 | 259 | @ResponseBody |
243 | - public Object testpaper() throws Exception { | |
260 | + public Object paperInfo() throws Exception { | |
244 | 261 | PageData pd = this.getPageData(); |
245 | 262 | ResponseGson<Paper> res = new ResponseGson<Paper>(); |
246 | - if(pd.containsKey("PAPER_ID")){ | |
247 | - try{ | |
248 | - Paper paper = new Paper(); | |
249 | - PageData ppd = paperService.findById(pd); | |
250 | - if(ppd != null){ | |
251 | - paper.setTitle(ppd.getString("TITLE")); | |
252 | - paper.setExam_time(ppd.getString("EXAM_TIME")); | |
253 | - paper.setTitle(ppd.getString("USER_ID")); | |
254 | - paper.setPaper_type(ppd.getString("PAPER_TYPE")); | |
255 | - paper.setSubject_id(ppd.getString("SUBJECT_ID")); | |
256 | - paper.setGrade_id(ppd.getString("GRADE_ID")); | |
257 | - paper.setScore(ppd.getString("SCORE")); | |
258 | - paper.setQuestions(new ArrayList<Question>()); | |
259 | - | |
260 | - List<PageData> questList = v1Service.getTestPaperInfo(pd); | |
261 | - for(PageData qpd : questList){ | |
262 | - Question question = new Question(); | |
263 | - question.setAnswer(qpd.getString("ANSWER")); | |
264 | - question.setQuestion_id(qpd.getString("QUESTION_ID")); | |
265 | - question.setSubject_id(qpd.getString("SUBJECT_ID")); | |
266 | - question.setChapter_id(qpd.getString("CHAPTER_ID")); | |
267 | - question.setProblem_type_id(qpd.getString("PROBLEM_TYPE_ID")); | |
268 | - question.setKnowledge_id(qpd.getString("KNOWLEDGE_ID")); | |
269 | - question.setContent(qpd.getString("CONTENT")); | |
270 | - question.setOption_num(qpd.getString("OPTION_NUM")); | |
271 | - question.setOption_content(qpd.getString("OPTION_CONTENT")); | |
272 | - question.setDifficulty(qpd.getString("DIFFICULTY")); | |
273 | - question.setAnalysis(qpd.getString("ANALYSIS")); | |
274 | - question.setQuestion_from(qpd.getString("QUESTION_FROM")); | |
275 | - question.setSug_score(qpd.getString("SUG_SCORE")); | |
276 | - question.setSug_part_score(qpd.getString("SUG_PART_SCORE")); | |
277 | - question.setRank(qpd.getString("RANK")); | |
278 | - question.setNo_name(qpd.getString("NO_NAME")); | |
279 | - if("-1".equals(qpd.getString("PID"))){ | |
280 | - PageData pidPd = new PageData(); | |
281 | - pidPd.put("PID", question.getQuestion_id()); | |
282 | - question.setQuestions(new ArrayList<Question>()); | |
283 | - List<PageData> qs = v1Service.getQuestionsByPID(pidPd); | |
284 | - for(PageData q : qs){ | |
285 | - Question qq = new Question(); | |
286 | - qq.setAnswer(q.getString("ANSWER")); | |
287 | - qq.setQuestion_id(q.getString("QUESTION_ID")); | |
288 | - qq.setSubject_id(q.getString("SUBJECT_ID")); | |
289 | - qq.setChapter_id(q.getString("CHAPTER_ID")); | |
290 | - qq.setProblem_type_id(q.getString("PROBLEM_TYPE_ID")); | |
291 | - qq.setKnowledge_id(q.getString("KNOWLEDGE_ID")); | |
292 | - qq.setContent(q.getString("CONTENT")); | |
293 | - qq.setOption_num(q.getString("OPTION_NUM")); | |
294 | - qq.setOption_content(q.getString("OPTION_CONTENT")); | |
295 | - qq.setDifficulty(q.getString("DIFFICULTY")); | |
296 | - qq.setAnalysis(q.getString("ANALYSIS")); | |
297 | - qq.setQuestion_from(q.getString("QUESTION_FROM")); | |
298 | - qq.setSug_score(q.getString("SUG_SCORE")); | |
299 | - qq.setSug_part_score(q.getString("SUG_PART_SCORE")); | |
300 | - qq.setRank(q.getString("RANK")); | |
301 | - qq.setNo_name(q.getString("NO_NAME")); | |
302 | - question.getQuestions().add(qq); | |
263 | + if (pd.containsKey("PAPER_ID")) { | |
264 | + try { | |
265 | + try { | |
266 | + Paper paper = new Paper(); | |
267 | + PageData ppd = paperService.findById(pd); | |
268 | + if (ppd != null) { | |
269 | + paper.setTitle(ppd.getString("TITLE")); | |
270 | + paper.setExam_time(ppd.getString("EXAM_TIME")); | |
271 | + paper.setUser_id(ppd.getString("USER_ID")); | |
272 | + paper.setPaper_type(ppd.getString("PAPER_TYPE")); | |
273 | + paper.setSubject_id(ppd.getString("SUBJECT_ID")); | |
274 | + paper.setGrade_id(ppd.getString("GRADE_ID")); | |
275 | + paper.setScore(ppd.getString("SCORE")); | |
276 | + paper.setQuestions(new ArrayList<Question>()); | |
277 | + | |
278 | + List<PageData> questList = v1Service | |
279 | + .getTestPaperInfo(pd); | |
280 | + for (PageData qpd : questList) { | |
281 | + Question question = new Question(); | |
282 | + question.setAnswer(qpd.getString("ANSWER")); | |
283 | + question.setQuestion_id(qpd | |
284 | + .getString("QUESTION_ID")); | |
285 | + question.setSubject_id(qpd.getString("SUBJECT_ID")); | |
286 | + question.setChapter_id(qpd.getString("CHAPTER_ID")); | |
287 | + question.setProblem_type_id(qpd | |
288 | + .getString("PROBLEM_TYPE_ID")); | |
289 | + question.setKnowledge_id(qpd | |
290 | + .getString("KNOWLEDGE_ID")); | |
291 | + question.setContent(qpd.getString("CONTENT")); | |
292 | + question.setOption_num(qpd.getString("OPTION_NUM")); | |
293 | + question.setOption_content(qpd | |
294 | + .getString("OPTION_CONTENT")); | |
295 | + question.setDifficulty(qpd.getString("DIFFICULTY")); | |
296 | + question.setAnalysis(qpd.getString("ANALYSIS")); | |
297 | + question.setQuestion_from(qpd | |
298 | + .getString("QUESTION_FROM")); | |
299 | + question.setSug_score(qpd.getString("SUG_SCORE")); | |
300 | + question.setSug_part_score(qpd | |
301 | + .getString("SUG_PART_SCORE")); | |
302 | + question.setRank(qpd.getString("RANK")); | |
303 | + question.setNo_name(qpd.getString("NO_NAME")); | |
304 | + if ("-1".equals("" + qpd.getString("P_ID"))) { | |
305 | + PageData pidPd = new PageData(); | |
306 | + pidPd.put("PID", question.getQuestion_id()); | |
307 | + question.setQuestions(new ArrayList<Question>()); | |
308 | + List<PageData> qs = v1Service | |
309 | + .getQuestionsByPID(pidPd); | |
310 | + for (PageData q : qs) { | |
311 | + Question qq = new Question(); | |
312 | + qq.setAnswer(q.getString("ANSWER")); | |
313 | + qq.setQuestion_id(q | |
314 | + .getString("QUESTION_ID")); | |
315 | + qq.setSubject_id(q.getString("SUBJECT_ID")); | |
316 | + qq.setChapter_id(q.getString("CHAPTER_ID")); | |
317 | + qq.setProblem_type_id(q | |
318 | + .getString("PROBLEM_TYPE_ID")); | |
319 | + qq.setKnowledge_id(q | |
320 | + .getString("KNOWLEDGE_ID")); | |
321 | + qq.setContent(q.getString("CONTENT")); | |
322 | + qq.setOption_num(q.getString("OPTION_NUM")); | |
323 | + qq.setOption_content(q | |
324 | + .getString("OPTION_CONTENT")); | |
325 | + qq.setDifficulty(q.getString("DIFFICULTY")); | |
326 | + qq.setAnalysis(q.getString("ANALYSIS")); | |
327 | + qq.setQuestion_from(q | |
328 | + .getString("QUESTION_FROM")); | |
329 | + qq.setSug_score(q.getString("SUG_SCORE")); | |
330 | + qq.setSug_part_score(q | |
331 | + .getString("SUG_PART_SCORE")); | |
332 | + qq.setRank(q.getString("RANK")); | |
333 | + qq.setNo_name(q.getString("NO_NAME")); | |
334 | + question.getQuestions().add(qq); | |
335 | + } | |
336 | + } | |
337 | + if ("-1".equals(qpd.getString("P_ID")) | |
338 | + || "0".equals(qpd.getString("P_ID"))) { | |
339 | + paper.getQuestions().add(question); | |
340 | + } | |
303 | 341 | } |
342 | + // pd.put("JSON", paper.toJson()); | |
343 | + res.setData(paper); | |
344 | + logger.info(paper.toJson()); | |
345 | + | |
304 | 346 | } |
305 | - paper.getQuestions().add(question); | |
306 | - } | |
307 | - | |
308 | - | |
309 | - res.setData(paper); | |
347 | + } catch (Exception ex) { | |
348 | + ex.printStackTrace(); | |
310 | 349 | } |
311 | - }catch(Exception ex){ | |
350 | + } catch (Exception ex) { | |
312 | 351 | ex.printStackTrace(); |
313 | 352 | res.setError(); |
314 | 353 | } |
315 | - }else{ | |
354 | + } else { | |
316 | 355 | res.setOtherError(); |
317 | 356 | } |
318 | 357 | return res.toJson(); |
319 | 358 | } |
320 | - | |
359 | + | |
321 | 360 | @RequestMapping(value = "/paperquestion", produces = "application/json;charset=UTF-8") |
322 | 361 | @ResponseBody |
323 | 362 | public Object paperQuestion() throws Exception { |
324 | 363 | PageData pd = this.getPageData(); |
325 | 364 | ResponseGson<PageData> res = new ResponseGson(); |
326 | - | |
365 | + | |
327 | 366 | return res.toJson(); |
328 | 367 | } |
329 | 368 | |
330 | - | |
331 | 369 | @RequestMapping(value = "/uploadpaper", produces = "application/json;charset=UTF-8") |
332 | 370 | @ResponseBody |
333 | 371 | public Object uploadpaper() throws Exception { |
334 | 372 | PageData pd = this.getPageData(); |
335 | 373 | ResponseGson<String> res = new ResponseGson(); |
336 | - | |
337 | - if(!StringUtils.isEmpty(pd.getJsonString())){ | |
374 | + | |
375 | + if (!StringUtils.isEmpty(pd.getJsonString())) { | |
338 | 376 | Paper paper = Paper.parse(pd.getJsonString()); |
339 | 377 | PageData paperPd = new PageData(); |
340 | 378 | String paperID = this.get32UUID(); |
341 | 379 | res.setData(paperID); |
342 | - paperPd.put("PAPER_ID", paperID); | |
343 | - paperPd.put("TITLE", paper.getTitle()); | |
344 | - paperPd.put("USER_ID", paper.getUser_id()); | |
345 | - paperPd.put("PAPER_TYPE", paper.getPaper_type()); | |
346 | - paperPd.put("SUBJECT_ID", paper.getSubject_id()); | |
347 | - paperPd.put("GRADE_ID", paper.getGrade_id()); | |
348 | - paperPd.put("EXAM_TIME", paper.getExam_time()); | |
349 | - paperPd.put("SCORE", paper.getScore()); | |
350 | - paperPd.put("PAPER_STATE", "0"); | |
351 | - paperPd.put("REMARK", ""); | |
380 | + paperPd.put("PAPER_ID", paperID); | |
381 | + paperPd.put("TITLE", paper.getTitle()); | |
382 | + paperPd.put("USER_ID", paper.getUser_id()); | |
383 | + paperPd.put("PAPER_TYPE", paper.getPaper_type()); | |
384 | + paperPd.put("SUBJECT_ID", paper.getSubject_id()); | |
385 | + paperPd.put("GRADE_ID", paper.getGrade_id()); | |
386 | + paperPd.put("EXAM_TIME", paper.getExam_time()); | |
387 | + paperPd.put("SCORE", paper.getScore()); | |
388 | + paperPd.put("PAPER_STATE", "0"); | |
389 | + paperPd.put("REMARK", ""); | |
352 | 390 | String schoolID = Myelfun.getUserID(paper.getUser_id()); |
353 | 391 | paperPd.put("SCHOOL_ID", schoolID); |
354 | - paperPd.put("CREATE_DATE", Tools.date2Str(new Date())); | |
355 | - paperPd.put("MODIFY_DATE", Tools.date2Str(new Date())); | |
356 | - | |
392 | + paperPd.put("CREATE_DATE", Tools.date2Str(new Date())); | |
393 | + paperPd.put("MODIFY_DATE", Tools.date2Str(new Date())); | |
394 | + | |
357 | 395 | paperService.save(paperPd); |
358 | - | |
396 | + | |
359 | 397 | List<Question> questions = paper.getQuestions(); |
360 | - if(questions != null){ | |
361 | - for(Question question : questions){ | |
398 | + if (questions != null) { | |
399 | + for (Question question : questions) { | |
362 | 400 | String questionID = this.get32UUID(); |
363 | 401 | PageData qPd = new PageData(); |
364 | 402 | qPd.put("QUESTION_ID", questionID); |
365 | - if(question.getQuestions() != null && question.getQuestions().size() > 0){ | |
403 | + if (question.getQuestions() != null | |
404 | + && question.getQuestions().size() > 0) { | |
366 | 405 | qPd.put("P_ID", "-1"); |
367 | - }else{ | |
406 | + } else { | |
368 | 407 | qPd.put("P_ID", "0"); |
369 | 408 | } |
370 | 409 | qPd.put("SUBJECT_ID", paper.getSubject_id()); |
... | ... | @@ -386,21 +425,20 @@ public class V1 extends BaseController { |
386 | 425 | qPd.put("CREATE_DATE", Tools.date2Str(new Date())); |
387 | 426 | qPd.put("REMARK", ""); |
388 | 427 | questionService.save(qPd); |
389 | - | |
428 | + | |
390 | 429 | PageData pqPd = new PageData(); |
391 | - pqPd.put("PAPER_ID",paperID); | |
392 | - pqPd.put("QUESTION_ID",questionID); | |
393 | - pqPd.put("SCORE",question.getScore()); | |
394 | - pqPd.put("PART_SCORE","0"); | |
395 | - pqPd.put("RANK",question.getRank()); | |
396 | - pqPd.put("NO_NAME",question.getNo_name()); | |
397 | - pqPd.put("PAPERQUESTION_ID",this.get32UUID()); | |
430 | + pqPd.put("PAPER_ID", paperID); | |
431 | + pqPd.put("QUESTION_ID", questionID); | |
432 | + pqPd.put("SCORE", question.getScore()); | |
433 | + pqPd.put("PART_SCORE", "0"); | |
434 | + pqPd.put("RANK", question.getRank()); | |
435 | + pqPd.put("NO_NAME", question.getNo_name()); | |
436 | + pqPd.put("PAPERQUESTION_ID", this.get32UUID()); | |
398 | 437 | paperquestionService.save(pqPd); |
399 | - | |
400 | - | |
401 | - if(question.getQuestions() != null){ | |
438 | + | |
439 | + if (question.getQuestions() != null) { | |
402 | 440 | List<Question> qs = question.getQuestions(); |
403 | - for(Question q : qs){ | |
441 | + for (Question q : qs) { | |
404 | 442 | String qID = this.get32UUID(); |
405 | 443 | PageData cqPd = new PageData(); |
406 | 444 | cqPd.put("QUESTION_ID", qID); |
... | ... | @@ -423,29 +461,247 @@ public class V1 extends BaseController { |
423 | 461 | cqPd.put("USER_ID", paper.getUser_id()); |
424 | 462 | cqPd.put("CREATE_DATE", Tools.date2Str(new Date())); |
425 | 463 | cqPd.put("REMARK", ""); |
426 | - | |
464 | + | |
427 | 465 | questionService.save(cqPd); |
428 | - | |
466 | + | |
429 | 467 | PageData cpqPd = new PageData(); |
430 | - cpqPd.put("PAPER_ID",paperID); | |
431 | - cpqPd.put("QUESTION_ID",qID); | |
432 | - cpqPd.put("SCORE",q.getScore()); | |
433 | - cpqPd.put("PART_SCORE","0"); | |
434 | - cpqPd.put("RANK",q.getRank()); | |
435 | - cpqPd.put("NO_NAME",q.getNo_name()); | |
436 | - cpqPd.put("PAPERQUESTION_ID",this.get32UUID()); | |
437 | - | |
468 | + cpqPd.put("PAPER_ID", paperID); | |
469 | + cpqPd.put("QUESTION_ID", qID); | |
470 | + cpqPd.put("SCORE", q.getScore()); | |
471 | + cpqPd.put("PART_SCORE", "0"); | |
472 | + cpqPd.put("RANK", q.getRank()); | |
473 | + cpqPd.put("NO_NAME", q.getNo_name()); | |
474 | + cpqPd.put("PAPERQUESTION_ID", this.get32UUID()); | |
475 | + | |
438 | 476 | paperquestionService.save(cpqPd); |
439 | 477 | } |
440 | 478 | } |
441 | 479 | } |
442 | 480 | } |
443 | - | |
444 | - }else{ | |
481 | + | |
482 | + } else { | |
445 | 483 | res.setDataError(); |
446 | 484 | } |
447 | - | |
485 | + | |
486 | + return res.toJson(); | |
487 | + } | |
488 | + | |
489 | + // 上传测验成绩 | |
490 | + @RequestMapping(value = "/uploadtestpaper", produces = "application/json;charset=UTF-8") | |
491 | + @ResponseBody | |
492 | + public Object uploadTestpaper() { | |
493 | + PageData pd = this.getPageData(); | |
494 | + ResponseGson<String> res = new ResponseGson(); | |
495 | + if (!StringUtils.isEmpty(pd.getJsonString())) { | |
496 | + TestPaper testPaper = TestPaper.parse(pd.getJsonString()); | |
497 | + try { | |
498 | + PageData testPd = new PageData(); | |
499 | + String testPaperId = this.get32UUID(); | |
500 | + testPd.put("TESTPAPER_ID", testPaperId); | |
501 | + testPd.put("TEACHER_ID", testPaper.getTeacherId()); | |
502 | + testPd.put("NAME", testPaper.getName()); | |
503 | + testPd.put("PAPER_ID", testPaper.getPaperId()); | |
504 | + testPd.put("SCLASS_ID", testPaper.getClassId()); | |
505 | + testPd.put("START_DATE", testPaper.getStartDate()); | |
506 | + testPd.put("END_DATE", testPaper.getEndDate()); | |
507 | + testPd.put( | |
508 | + "CREATE_DATE", | |
509 | + testPaper.getCreateDate() == null ? Tools | |
510 | + .date2Str(new Date()) : testPaper | |
511 | + .getCreateDate()); | |
512 | + testPd.put("OTHER_SCORE", testPaper.getOtherScore()); | |
513 | + testPd.put("HIGHT_SCORE", testPaper.getHighScore()); | |
514 | + testPd.put("LOW_SCORE", testPaper.getLowScore()); | |
515 | + testPd.put("AVG_SCORE", testPaper.getAvgScore()); | |
516 | + testPd.put("REMARK", testPaper.getRemark()); | |
517 | + testpaperService.save(testPd); | |
518 | + if (testPaper.getStudents() != null) { | |
519 | + for (StudentAnswer studentAnswer : testPaper.getStudents()) { | |
520 | + if (studentAnswer.getQuestions() != null) { | |
521 | + PageData studentPageData = new PageData(); | |
522 | + studentPageData.put("STUDENTTEST_ID", get32UUID()); | |
523 | + studentPageData.put("STUDENT_ID", | |
524 | + studentAnswer.getStudentId()); | |
525 | + studentPageData.put("TEST_ID", testPaperId); | |
526 | + studentPageData.put("PAPER_ID", | |
527 | + testPaper.getPaperId()); | |
528 | + studentPageData.put("SCORE", | |
529 | + studentAnswer.getScore()); | |
530 | + studentPageData.put("CLASS_ID", | |
531 | + testPaper.getClassId()); | |
532 | + studenttestService.save(studentPageData); | |
533 | + | |
534 | + for (TestPaperInfo testPaperInfo : studentAnswer | |
535 | + .getQuestions()) { | |
536 | + PageData testInfoPd = new PageData(); | |
537 | + testInfoPd.put("TESTPAPERINFO_ID", | |
538 | + this.get32UUID()); | |
539 | + testInfoPd.put("PAPER_ID", | |
540 | + testPaper.getPaperId()); | |
541 | + testInfoPd.put("STUDENT_ID", | |
542 | + studentAnswer.getStudentId()); | |
543 | + testInfoPd.put("TEST_ID", testPaperId); | |
544 | + testInfoPd.put("QUESTION_ID", | |
545 | + testPaperInfo.getQuestionId()); | |
546 | + testInfoPd.put("ANSWER", | |
547 | + testPaperInfo.getAnswer()); | |
548 | + testInfoPd.put("RIGHT", | |
549 | + testPaperInfo.getRight()); | |
550 | + testInfoPd.put("SCORE", | |
551 | + testPaperInfo.getScore()); | |
552 | + testInfoPd.put("LIKES", | |
553 | + testPaperInfo.getLikes()); | |
554 | + testInfoPd.put("ANSWER_TYPE", | |
555 | + testPaperInfo.getAnswerType()); | |
556 | + testInfoPd.put("PRESS_TIME", | |
557 | + testPaperInfo.getPressTime()); | |
558 | + testInfoPd.put("RECEIVER_DATE", | |
559 | + testPaperInfo.getReceiverDate()); | |
560 | + testInfoPd.put("SUBJECTIVE", | |
561 | + testPaperInfo.getSubjective()); | |
562 | + testInfoPd.put("NOTE", testPaperInfo.getNote()); | |
563 | + testInfoPd.put("MARK_NO", | |
564 | + testPaperInfo.getMarkNo()); | |
565 | + testpaperinfoService.save(testInfoPd); | |
566 | + } | |
567 | + } | |
568 | + } | |
569 | + } | |
570 | + res.setData(testPaperId); | |
571 | + } catch (Exception e) { | |
572 | + e.printStackTrace(); | |
573 | + res.setError(); | |
574 | + res.setMessage(e.getMessage()); | |
575 | + } | |
576 | + } else { | |
577 | + res.setDataError(); | |
578 | + } | |
579 | + | |
580 | + return res.toJson(); | |
581 | + | |
582 | + } | |
583 | + | |
584 | + // 下载测验成绩 | |
585 | + @RequestMapping(value = "/downloadtestpaper", produces = "application/json;charset=UTF-8") | |
586 | + @ResponseBody | |
587 | + public Object downloadTestpaper() { | |
588 | + PageData pd = this.getPageData(); | |
589 | + ResponseGson<TestPaper> res = new ResponseGson(); | |
590 | + | |
591 | + String paperId = pd.getString("ID"); | |
592 | + | |
593 | + if (!StringUtils.isEmpty(paperId)) { | |
594 | + TestPaper testPaper = new TestPaper(); | |
595 | + try { | |
596 | + pd.put("TESTPAPER_ID", paperId); | |
597 | + PageData testPd = testpaperService.findById(pd); | |
598 | + if (testPd != null) { | |
599 | + testPaper.setTestpaperId(paperId); | |
600 | + testPaper.setTeacherId(testPd.getString("TEACHER_ID")); | |
601 | + testPaper.setName(testPd.getString("NAME")); | |
602 | + testPaper.setPaperId(testPd.getString("PAPER_ID")); | |
603 | + testPaper.setClassId(testPd.getString("SCLASS_ID")); | |
604 | + testPaper.setStartDate(testPd.getString("START_DATE")); | |
605 | + testPaper.setEndDate(testPd.getString("END_DATE")); | |
606 | + testPaper.setCreateDate(testPd.getString("CREATE_DATE")); | |
607 | + testPaper.setOtherScore(testPd.getString("OTHER_SCORE")); | |
608 | + testPaper.setHighScore(testPd.getString("HIGHT_SCORE")); | |
609 | + testPaper.setLowScore(testPd.getString("LOW_SCORE")); | |
610 | + testPaper.setAvgScore(testPd.getString("AVG_SCORE")); | |
611 | + testPaper.setRemark(testPd.getString("REMARK")); | |
612 | + PageData testInfof = new PageData(); | |
613 | + testInfof.put("TEST_ID", paperId); | |
614 | + | |
615 | + List<PageData> studentList = studenttestService | |
616 | + .listAll(testInfof); | |
617 | + | |
618 | + for (PageData sPageData : studentList) { | |
619 | + StudentAnswer studentAnswer = new StudentAnswer(); | |
620 | + testInfof.put("STDUENT_ID", | |
621 | + sPageData.getString("STDUENT_ID")); | |
622 | + studentAnswer.setScore(sPageData.getString("SCORE")); | |
623 | + List<PageData> list = testpaperinfoService | |
624 | + .listAll(testInfof); | |
625 | + for (PageData testInfoPd : list) { | |
626 | + TestPaperInfo testPaperInfo = new TestPaperInfo(); | |
627 | + testPaperInfo.setTestPaperInfoId(testInfoPd | |
628 | + .getString("TESTPAPERINFO_ID")); | |
629 | + testPaperInfo.setQuestionId(testInfoPd | |
630 | + .getString("QUESTION_ID")); | |
631 | + testPaperInfo.setAnswer(testInfoPd | |
632 | + .getString("ANSWER")); | |
633 | + testPaperInfo.setRight(testInfoPd | |
634 | + .getString("RIGHT")); | |
635 | + testPaperInfo.setScore(testInfoPd | |
636 | + .getString("SCORE")); | |
637 | + testPaperInfo.setLikes(testInfoPd | |
638 | + .getString("LIKES")); | |
639 | + testPaperInfo.setAnswerType(testInfoPd | |
640 | + .getString("ANSWER_TYPE")); | |
641 | + testPaperInfo.setPressTime(testInfoPd | |
642 | + .getString("PRESS_TIME")); | |
643 | + testPaperInfo.setReceiverDate(testInfoPd | |
644 | + .getString("RECEIVER_DATE")); | |
645 | + testPaperInfo.setSubjective(testInfoPd | |
646 | + .getString("SUBJECTIVE")); | |
647 | + testPaperInfo.setNote(testInfoPd.getString("NOTE")); | |
648 | + testPaperInfo.setMarkNo(testInfoPd | |
649 | + .getString("MARK_NO")); | |
650 | + testPaperInfo.setRank(testInfoPd.getString("RANK")); | |
651 | + studentAnswer.getQuestions().add(testPaperInfo); | |
652 | + } | |
653 | + testPaper.getStudents().add(studentAnswer); | |
654 | + } | |
655 | + } | |
656 | + | |
657 | + res.setData(testPaper); | |
658 | + } catch (Exception e) { | |
659 | + e.printStackTrace(); | |
660 | + res.setError(); | |
661 | + } | |
662 | + } | |
663 | + | |
448 | 664 | return res.toJson(); |
665 | + | |
449 | 666 | } |
450 | 667 | |
668 | + // 下载测验成绩 | |
669 | + @RequestMapping(value = "/testpaper", produces = "application/json;charset=UTF-8") | |
670 | + @ResponseBody | |
671 | + public Object testpaper() { | |
672 | + PageData pd = this.getPageData(); | |
673 | + ResponseGson<List<TestPaper>> res = new ResponseGson(); | |
674 | + pd.put("TEACHER_ID", pd.getString("USER_ID")); | |
675 | + try { | |
676 | + List<PageData> pageList = testpaperService.listAll(pd); | |
677 | + List<TestPaper> list = new ArrayList<TestPaper>(); | |
678 | + if (pageList != null) { | |
679 | + for (PageData testPd : pageList) { | |
680 | + TestPaper testPaper = new TestPaper(); | |
681 | + testPaper.setTestpaperId(testPd.getString("TESTPAPER_ID")); | |
682 | + testPaper.setTeacherId(testPd.getString("TEACHER_ID")); | |
683 | + testPaper.setName(testPd.getString("NAME")); | |
684 | + testPaper.setPaperId(testPd.getString("PAPER_ID")); | |
685 | + testPaper.setClassId(testPd.getString("SCLASS_ID")); | |
686 | + testPaper.setStartDate(testPd.getString("START_DATE")); | |
687 | + testPaper.setEndDate(testPd.getString("END_DATE")); | |
688 | + testPaper.setCreateDate(testPd.getString("CREATE_DATE")); | |
689 | + testPaper.setOtherScore(testPd.getString("OTHER_SCORE")); | |
690 | + testPaper.setHighScore(testPd.getString("HIGHT_SCORE")); | |
691 | + testPaper.setLowScore(testPd.getString("LOW_SCORE")); | |
692 | + testPaper.setAvgScore(testPd.getString("AVG_SCORE")); | |
693 | + testPaper.setRemark(testPd.getString("REMARK")); | |
694 | + list.add(testPaper); | |
695 | + } | |
696 | + } | |
697 | + res.setData(list); | |
698 | + } catch (Exception e) { | |
699 | + res.setError(); | |
700 | + res.setMessage(e.getMessage()); | |
701 | + e.printStackTrace(); | |
702 | + } | |
703 | + | |
704 | + return res.toJson(); | |
705 | + | |
706 | + } | |
451 | 707 | } | ... | ... |
src/com/fh/controller/sunvote/Myelfun.java
... | ... | @@ -5,6 +5,8 @@ import org.springframework.stereotype.Service; |
5 | 5 | import com.fh.service.sunvote.basestation.impl.BasestationService; |
6 | 6 | import com.fh.service.sunvote.classtype.impl.ClassTypeService; |
7 | 7 | import com.fh.service.sunvote.grade.impl.GradeService; |
8 | +import com.fh.service.sunvote.paper.PaperManager; | |
9 | +import com.fh.service.sunvote.papertype.PaperTypeManager; | |
8 | 10 | import com.fh.service.sunvote.questiontype.QuestionTypeManager; |
9 | 11 | import com.fh.service.sunvote.school.impl.SchoolService; |
10 | 12 | import com.fh.service.sunvote.sclass.impl.SClassService; |
... | ... | @@ -14,6 +16,7 @@ import com.fh.service.sunvote.teacher.TeacherManager; |
14 | 16 | import com.fh.service.sunvote.teacher.impl.TeacherService; |
15 | 17 | import com.fh.service.sunvote.teachingmaterial.impl.TeachingMaterialService; |
16 | 18 | import com.fh.service.sunvote.term.TermManager; |
19 | +import com.fh.service.sunvote.testpaper.TestPaperManager; | |
17 | 20 | import com.fh.util.PageData; |
18 | 21 | import com.fh.util.SpringBeanFactoryUtils; |
19 | 22 | |
... | ... | @@ -206,7 +209,7 @@ public class Myelfun { |
206 | 209 | * @return |
207 | 210 | * @throws Exception |
208 | 211 | */ |
209 | - public static String findTeachingmaterialName(int id) throws Exception { | |
212 | + public static String findTeachingmaterialName(String id) throws Exception { | |
210 | 213 | TeachingMaterialService teachingmaterialService = (TeachingMaterialService)SpringBeanFactoryUtils.getBean("teachingmaterialService"); |
211 | 214 | PageData pageData = new PageData(); |
212 | 215 | pageData.put("ID", id); |
... | ... | @@ -224,7 +227,7 @@ public class Myelfun { |
224 | 227 | * @return |
225 | 228 | * @throws Exception |
226 | 229 | */ |
227 | - public static String findQuestionTypeName(int id) throws Exception { | |
230 | + public static String findQuestionTypeName(String id) throws Exception { | |
228 | 231 | QuestionTypeManager questiontypeService = (QuestionTypeManager)SpringBeanFactoryUtils.getBean("questiontypeService"); |
229 | 232 | PageData pageData = new PageData(); |
230 | 233 | pageData.put("QUESTIONTYPE_ID", id); |
... | ... | @@ -252,4 +255,53 @@ public class Myelfun { |
252 | 255 | } |
253 | 256 | } |
254 | 257 | |
258 | + public static String findPaperTypeName(String id){ | |
259 | + PaperTypeManager papertypeService = (PaperTypeManager)SpringBeanFactoryUtils.getBean("papertypeService"); | |
260 | + PageData pageData = new PageData(); | |
261 | + pageData.put("ID", id); | |
262 | + try { | |
263 | + pageData = papertypeService.findById(pageData); | |
264 | + } catch (Exception e) { | |
265 | + e.printStackTrace(); | |
266 | + } | |
267 | + if(pageData != null){ | |
268 | + return pageData.getString("NAME"); | |
269 | + }else{ | |
270 | + return "" ; | |
271 | + } | |
272 | + } | |
273 | + | |
274 | + public static String findPaperName(String id){ | |
275 | + PaperManager paperService = (PaperManager)SpringBeanFactoryUtils.getBean("paperService"); | |
276 | + PageData pageData = new PageData(); | |
277 | + pageData.put("PAPER_ID", id); | |
278 | + try { | |
279 | + pageData = paperService.findById(pageData); | |
280 | + } catch (Exception e) { | |
281 | + e.printStackTrace(); | |
282 | + } | |
283 | + if(pageData != null){ | |
284 | + return pageData.getString("TITLE"); | |
285 | + }else{ | |
286 | + return "" ; | |
287 | + } | |
288 | + } | |
289 | + | |
290 | + public static String findTestPaperName(String id){ | |
291 | + TestPaperManager testpaperService = (TestPaperManager)SpringBeanFactoryUtils.getBean("testpaperService"); | |
292 | + PageData pageData = new PageData(); | |
293 | + pageData.put("TESTPAPER_ID", id); | |
294 | + try { | |
295 | + pageData = testpaperService.findById(pageData); | |
296 | + } catch (Exception e) { | |
297 | + e.printStackTrace(); | |
298 | + } | |
299 | + if(pageData != null){ | |
300 | + return pageData.getString("NAME"); | |
301 | + }else{ | |
302 | + return "" ; | |
303 | + } | |
304 | + } | |
305 | + | |
306 | + | |
255 | 307 | } | ... | ... |
src/com/fh/controller/sunvote/classroster/ClassRosterController.java
... | ... | @@ -137,8 +137,16 @@ public class ClassRosterController extends BaseController { |
137 | 137 | PageData pd = new PageData(); |
138 | 138 | pd = this.getPageData(); |
139 | 139 | mv.setViewName("sunvote/classroster/classroster_edit"); |
140 | + | |
141 | + List<PageData> classList = sclassService.listAll(pd); | |
142 | + List<PageData> termList = termService.listAll(pd); | |
143 | + List<PageData> studentList = studentService.listAll(pd); | |
144 | + | |
140 | 145 | mv.addObject("msg", "save"); |
141 | 146 | mv.addObject("pd", pd); |
147 | + mv.addObject("classList", classList); | |
148 | + mv.addObject("termList", termList); | |
149 | + mv.addObject("studentList", studentList); | |
142 | 150 | return mv; |
143 | 151 | } |
144 | 152 | |
... | ... | @@ -153,8 +161,15 @@ public class ClassRosterController extends BaseController { |
153 | 161 | pd = this.getPageData(); |
154 | 162 | pd = classrosterService.findById(pd); //根据ID读取 |
155 | 163 | mv.setViewName("sunvote/classroster/classroster_edit"); |
156 | - mv.addObject("msg", "edit"); | |
164 | + List<PageData> classList = sclassService.listAll(pd); | |
165 | + List<PageData> termList = termService.listAll(pd); | |
166 | + List<PageData> studentList = studentService.listAll(pd); | |
167 | + | |
168 | + mv.addObject("msg", "save"); | |
157 | 169 | mv.addObject("pd", pd); |
170 | + mv.addObject("classList", classList); | |
171 | + mv.addObject("termList", termList); | |
172 | + mv.addObject("studentList", studentList); | |
158 | 173 | return mv; |
159 | 174 | } |
160 | 175 | ... | ... |
src/com/fh/controller/sunvote/papertype/PaperTypeController.java
... | ... | @@ -45,10 +45,10 @@ public class PaperTypeController extends BaseController { |
45 | 45 | @RequestMapping(value="/save") |
46 | 46 | public ModelAndView save() throws Exception{ |
47 | 47 | logBefore(logger, Jurisdiction.getUsername()+"新增PaperType"); |
48 | - if(!Jurisdiction.buttonJurisdiction(menuUrl, "add")){return null;} //校验权限 | |
49 | 48 | ModelAndView mv = this.getModelAndView(); |
50 | 49 | PageData pd = new PageData(); |
51 | 50 | pd = this.getPageData(); |
51 | + pd.put("ID", this.get32UUID()); | |
52 | 52 | papertypeService.save(pd); |
53 | 53 | mv.addObject("msg","success"); |
54 | 54 | mv.setViewName("save_result"); |
... | ... | @@ -62,7 +62,6 @@ public class PaperTypeController extends BaseController { |
62 | 62 | @RequestMapping(value="/delete") |
63 | 63 | public void delete(PrintWriter out) throws Exception{ |
64 | 64 | logBefore(logger, Jurisdiction.getUsername()+"删除PaperType"); |
65 | - if(!Jurisdiction.buttonJurisdiction(menuUrl, "del")){return;} //校验权限 | |
66 | 65 | PageData pd = new PageData(); |
67 | 66 | pd = this.getPageData(); |
68 | 67 | papertypeService.delete(pd); |
... | ... | @@ -77,7 +76,6 @@ public class PaperTypeController extends BaseController { |
77 | 76 | @RequestMapping(value="/edit") |
78 | 77 | public ModelAndView edit() throws Exception{ |
79 | 78 | logBefore(logger, Jurisdiction.getUsername()+"修改PaperType"); |
80 | - if(!Jurisdiction.buttonJurisdiction(menuUrl, "edit")){return null;} //校验权限 | |
81 | 79 | ModelAndView mv = this.getModelAndView(); |
82 | 80 | PageData pd = new PageData(); |
83 | 81 | pd = this.getPageData(); |
... | ... | @@ -94,7 +92,6 @@ public class PaperTypeController extends BaseController { |
94 | 92 | @RequestMapping(value="/list") |
95 | 93 | public ModelAndView list(Page page) throws Exception{ |
96 | 94 | logBefore(logger, Jurisdiction.getUsername()+"列表PaperType"); |
97 | - //if(!Jurisdiction.buttonJurisdiction(menuUrl, "cha")){return null;} //校验权限(无权查看时页面会有提示,如果不注释掉这句代码就无法进入列表页面,所以根据情况是否加入本句代码) | |
98 | 95 | ModelAndView mv = this.getModelAndView(); |
99 | 96 | PageData pd = new PageData(); |
100 | 97 | pd = this.getPageData(); | ... | ... |
src/com/fh/controller/sunvote/studenttest/StudentTestController.java
0 → 100644
1 | +package com.fh.controller.sunvote.studenttest; | |
2 | + | |
3 | +import java.io.PrintWriter; | |
4 | +import java.text.DateFormat; | |
5 | +import java.text.SimpleDateFormat; | |
6 | +import java.util.ArrayList; | |
7 | +import java.util.Date; | |
8 | +import java.util.HashMap; | |
9 | +import java.util.List; | |
10 | +import java.util.Map; | |
11 | +import javax.annotation.Resource; | |
12 | +import org.springframework.beans.propertyeditors.CustomDateEditor; | |
13 | +import org.springframework.stereotype.Controller; | |
14 | +import org.springframework.web.bind.WebDataBinder; | |
15 | +import org.springframework.web.bind.annotation.InitBinder; | |
16 | +import org.springframework.web.bind.annotation.RequestMapping; | |
17 | +import org.springframework.web.bind.annotation.ResponseBody; | |
18 | +import org.springframework.web.servlet.ModelAndView; | |
19 | +import com.fh.controller.base.BaseController; | |
20 | +import com.fh.entity.Page; | |
21 | +import com.fh.util.AppUtil; | |
22 | +import com.fh.util.ObjectExcelView; | |
23 | +import com.fh.util.PageData; | |
24 | +import com.fh.util.Jurisdiction; | |
25 | +import com.fh.util.Tools; | |
26 | +import com.fh.service.sunvote.studenttest.StudentTestManager; | |
27 | + | |
28 | +/** | |
29 | + * 说明:学生报表 | |
30 | + * 创建人:FH Q313596790 | |
31 | + * 创建时间:2018-06-07 | |
32 | + */ | |
33 | +@Controller | |
34 | +@RequestMapping(value="/studenttest") | |
35 | +public class StudentTestController extends BaseController { | |
36 | + | |
37 | + String menuUrl = "studenttest/list.do"; //菜单地址(权限用) | |
38 | + @Resource(name="studenttestService") | |
39 | + private StudentTestManager studenttestService; | |
40 | + | |
41 | + /**保存 | |
42 | + * @param | |
43 | + * @throws Exception | |
44 | + */ | |
45 | + @RequestMapping(value="/save") | |
46 | + public ModelAndView save() throws Exception{ | |
47 | + logBefore(logger, Jurisdiction.getUsername()+"新增StudentTest"); | |
48 | + if(!Jurisdiction.buttonJurisdiction(menuUrl, "add")){return null;} //校验权限 | |
49 | + ModelAndView mv = this.getModelAndView(); | |
50 | + PageData pd = new PageData(); | |
51 | + pd = this.getPageData(); | |
52 | + pd.put("STUDENTTEST_ID", this.get32UUID()); //主键 | |
53 | + studenttestService.save(pd); | |
54 | + mv.addObject("msg","success"); | |
55 | + mv.setViewName("save_result"); | |
56 | + return mv; | |
57 | + } | |
58 | + | |
59 | + /**删除 | |
60 | + * @param out | |
61 | + * @throws Exception | |
62 | + */ | |
63 | + @RequestMapping(value="/delete") | |
64 | + public void delete(PrintWriter out) throws Exception{ | |
65 | + logBefore(logger, Jurisdiction.getUsername()+"删除StudentTest"); | |
66 | + if(!Jurisdiction.buttonJurisdiction(menuUrl, "del")){return;} //校验权限 | |
67 | + PageData pd = new PageData(); | |
68 | + pd = this.getPageData(); | |
69 | + studenttestService.delete(pd); | |
70 | + out.write("success"); | |
71 | + out.close(); | |
72 | + } | |
73 | + | |
74 | + /**修改 | |
75 | + * @param | |
76 | + * @throws Exception | |
77 | + */ | |
78 | + @RequestMapping(value="/edit") | |
79 | + public ModelAndView edit() throws Exception{ | |
80 | + logBefore(logger, Jurisdiction.getUsername()+"修改StudentTest"); | |
81 | + if(!Jurisdiction.buttonJurisdiction(menuUrl, "edit")){return null;} //校验权限 | |
82 | + ModelAndView mv = this.getModelAndView(); | |
83 | + PageData pd = new PageData(); | |
84 | + pd = this.getPageData(); | |
85 | + studenttestService.edit(pd); | |
86 | + mv.addObject("msg","success"); | |
87 | + mv.setViewName("save_result"); | |
88 | + return mv; | |
89 | + } | |
90 | + | |
91 | + /**列表 | |
92 | + * @param page | |
93 | + * @throws Exception | |
94 | + */ | |
95 | + @RequestMapping(value="/list") | |
96 | + public ModelAndView list(Page page) throws Exception{ | |
97 | + logBefore(logger, Jurisdiction.getUsername()+"列表StudentTest"); | |
98 | + //if(!Jurisdiction.buttonJurisdiction(menuUrl, "cha")){return null;} //校验权限(无权查看时页面会有提示,如果不注释掉这句代码就无法进入列表页面,所以根据情况是否加入本句代码) | |
99 | + ModelAndView mv = this.getModelAndView(); | |
100 | + PageData pd = new PageData(); | |
101 | + pd = this.getPageData(); | |
102 | + String keywords = pd.getString("keywords"); //关键词检索条件 | |
103 | + if(null != keywords && !"".equals(keywords)){ | |
104 | + pd.put("keywords", keywords.trim()); | |
105 | + } | |
106 | + page.setPd(pd); | |
107 | + List<PageData> varList = studenttestService.list(page); //列出StudentTest列表 | |
108 | + mv.setViewName("sunvote/studenttest/studenttest_list"); | |
109 | + mv.addObject("varList", varList); | |
110 | + mv.addObject("pd", pd); | |
111 | + mv.addObject("QX",Jurisdiction.getHC()); //按钮权限 | |
112 | + return mv; | |
113 | + } | |
114 | + | |
115 | + /**去新增页面 | |
116 | + * @param | |
117 | + * @throws Exception | |
118 | + */ | |
119 | + @RequestMapping(value="/goAdd") | |
120 | + public ModelAndView goAdd()throws Exception{ | |
121 | + ModelAndView mv = this.getModelAndView(); | |
122 | + PageData pd = new PageData(); | |
123 | + pd = this.getPageData(); | |
124 | + mv.setViewName("sunvote/studenttest/studenttest_edit"); | |
125 | + mv.addObject("msg", "save"); | |
126 | + mv.addObject("pd", pd); | |
127 | + return mv; | |
128 | + } | |
129 | + | |
130 | + /**去修改页面 | |
131 | + * @param | |
132 | + * @throws Exception | |
133 | + */ | |
134 | + @RequestMapping(value="/goEdit") | |
135 | + public ModelAndView goEdit()throws Exception{ | |
136 | + ModelAndView mv = this.getModelAndView(); | |
137 | + PageData pd = new PageData(); | |
138 | + pd = this.getPageData(); | |
139 | + pd = studenttestService.findById(pd); //根据ID读取 | |
140 | + mv.setViewName("sunvote/studenttest/studenttest_edit"); | |
141 | + mv.addObject("msg", "edit"); | |
142 | + mv.addObject("pd", pd); | |
143 | + return mv; | |
144 | + } | |
145 | + | |
146 | + /**批量删除 | |
147 | + * @param | |
148 | + * @throws Exception | |
149 | + */ | |
150 | + @RequestMapping(value="/deleteAll") | |
151 | + @ResponseBody | |
152 | + public Object deleteAll() throws Exception{ | |
153 | + logBefore(logger, Jurisdiction.getUsername()+"批量删除StudentTest"); | |
154 | + if(!Jurisdiction.buttonJurisdiction(menuUrl, "del")){return null;} //校验权限 | |
155 | + PageData pd = new PageData(); | |
156 | + Map<String,Object> map = new HashMap<String,Object>(); | |
157 | + pd = this.getPageData(); | |
158 | + List<PageData> pdList = new ArrayList<PageData>(); | |
159 | + String DATA_IDS = pd.getString("DATA_IDS"); | |
160 | + if(null != DATA_IDS && !"".equals(DATA_IDS)){ | |
161 | + String ArrayDATA_IDS[] = DATA_IDS.split(","); | |
162 | + studenttestService.deleteAll(ArrayDATA_IDS); | |
163 | + pd.put("msg", "ok"); | |
164 | + }else{ | |
165 | + pd.put("msg", "no"); | |
166 | + } | |
167 | + pdList.add(pd); | |
168 | + map.put("list", pdList); | |
169 | + return AppUtil.returnObject(pd, map); | |
170 | + } | |
171 | + | |
172 | + /**导出到excel | |
173 | + * @param | |
174 | + * @throws Exception | |
175 | + */ | |
176 | + @RequestMapping(value="/excel") | |
177 | + public ModelAndView exportExcel() throws Exception{ | |
178 | + logBefore(logger, Jurisdiction.getUsername()+"导出StudentTest到excel"); | |
179 | + if(!Jurisdiction.buttonJurisdiction(menuUrl, "cha")){return null;} | |
180 | + ModelAndView mv = new ModelAndView(); | |
181 | + PageData pd = new PageData(); | |
182 | + pd = this.getPageData(); | |
183 | + Map<String,Object> dataMap = new HashMap<String,Object>(); | |
184 | + List<String> titles = new ArrayList<String>(); | |
185 | + titles.add("学生ID"); //1 | |
186 | + titles.add("测验ID"); //2 | |
187 | + titles.add("试卷ID"); //3 | |
188 | + titles.add("得分"); //4 | |
189 | + titles.add("班级ID"); //5 | |
190 | + dataMap.put("titles", titles); | |
191 | + List<PageData> varOList = studenttestService.listAll(pd); | |
192 | + List<PageData> varList = new ArrayList<PageData>(); | |
193 | + for(int i=0;i<varOList.size();i++){ | |
194 | + PageData vpd = new PageData(); | |
195 | + vpd.put("var1", varOList.get(i).getString("STUDENT_ID")); //1 | |
196 | + vpd.put("var2", varOList.get(i).getString("TEST_ID")); //2 | |
197 | + vpd.put("var3", varOList.get(i).getString("PAPER_ID")); //3 | |
198 | + vpd.put("var4", varOList.get(i).getString("SCORE")); //4 | |
199 | + vpd.put("var5", varOList.get(i).getString("CLASS_ID")); //5 | |
200 | + varList.add(vpd); | |
201 | + } | |
202 | + dataMap.put("varList", varList); | |
203 | + ObjectExcelView erv = new ObjectExcelView(); | |
204 | + mv = new ModelAndView(erv,dataMap); | |
205 | + return mv; | |
206 | + } | |
207 | + | |
208 | + @InitBinder | |
209 | + public void initBinder(WebDataBinder binder){ | |
210 | + DateFormat format = new SimpleDateFormat("yyyy-MM-dd"); | |
211 | + binder.registerCustomEditor(Date.class, new CustomDateEditor(format,true)); | |
212 | + } | |
213 | +} | ... | ... |
src/com/fh/service/sunvote/studenttest/StudentTestManager.java
0 → 100644
1 | +package com.fh.service.sunvote.studenttest; | |
2 | + | |
3 | +import java.util.List; | |
4 | +import com.fh.entity.Page; | |
5 | +import com.fh.util.PageData; | |
6 | + | |
7 | +/** | |
8 | + * 说明: 学生报表接口 | |
9 | + * 创建人:FH Q313596790 | |
10 | + * 创建时间:2018-06-07 | |
11 | + * @version | |
12 | + */ | |
13 | +public interface StudentTestManager{ | |
14 | + | |
15 | + /**新增 | |
16 | + * @param pd | |
17 | + * @throws Exception | |
18 | + */ | |
19 | + public void save(PageData pd)throws Exception; | |
20 | + | |
21 | + /**删除 | |
22 | + * @param pd | |
23 | + * @throws Exception | |
24 | + */ | |
25 | + public void delete(PageData pd)throws Exception; | |
26 | + | |
27 | + /**修改 | |
28 | + * @param pd | |
29 | + * @throws Exception | |
30 | + */ | |
31 | + public void edit(PageData pd)throws Exception; | |
32 | + | |
33 | + /**列表 | |
34 | + * @param page | |
35 | + * @throws Exception | |
36 | + */ | |
37 | + public List<PageData> list(Page page)throws Exception; | |
38 | + | |
39 | + /**列表(全部) | |
40 | + * @param pd | |
41 | + * @throws Exception | |
42 | + */ | |
43 | + public List<PageData> listAll(PageData pd)throws Exception; | |
44 | + | |
45 | + /**通过id获取数据 | |
46 | + * @param pd | |
47 | + * @throws Exception | |
48 | + */ | |
49 | + public PageData findById(PageData pd)throws Exception; | |
50 | + | |
51 | + /**批量删除 | |
52 | + * @param ArrayDATA_IDS | |
53 | + * @throws Exception | |
54 | + */ | |
55 | + public void deleteAll(String[] ArrayDATA_IDS)throws Exception; | |
56 | + | |
57 | +} | |
58 | + | ... | ... |
src/com/fh/service/sunvote/studenttest/impl/StudentTestService.java
0 → 100644
1 | +package com.fh.service.sunvote.studenttest.impl; | |
2 | + | |
3 | +import java.util.List; | |
4 | +import javax.annotation.Resource; | |
5 | +import org.springframework.stereotype.Service; | |
6 | +import com.fh.dao.DaoSupport; | |
7 | +import com.fh.entity.Page; | |
8 | +import com.fh.util.PageData; | |
9 | +import com.fh.service.sunvote.studenttest.StudentTestManager; | |
10 | + | |
11 | +/** | |
12 | + * 说明: 学生报表 | |
13 | + * 创建人:FH Q313596790 | |
14 | + * 创建时间:2018-06-07 | |
15 | + * @version | |
16 | + */ | |
17 | +@Service("studenttestService") | |
18 | +public class StudentTestService implements StudentTestManager{ | |
19 | + | |
20 | + @Resource(name = "daoSupport") | |
21 | + private DaoSupport dao; | |
22 | + | |
23 | + /**新增 | |
24 | + * @param pd | |
25 | + * @throws Exception | |
26 | + */ | |
27 | + public void save(PageData pd)throws Exception{ | |
28 | + dao.save("StudentTestMapper.save", pd); | |
29 | + } | |
30 | + | |
31 | + /**删除 | |
32 | + * @param pd | |
33 | + * @throws Exception | |
34 | + */ | |
35 | + public void delete(PageData pd)throws Exception{ | |
36 | + dao.delete("StudentTestMapper.delete", pd); | |
37 | + } | |
38 | + | |
39 | + /**修改 | |
40 | + * @param pd | |
41 | + * @throws Exception | |
42 | + */ | |
43 | + public void edit(PageData pd)throws Exception{ | |
44 | + dao.update("StudentTestMapper.edit", pd); | |
45 | + } | |
46 | + | |
47 | + /**列表 | |
48 | + * @param page | |
49 | + * @throws Exception | |
50 | + */ | |
51 | + @SuppressWarnings("unchecked") | |
52 | + public List<PageData> list(Page page)throws Exception{ | |
53 | + return (List<PageData>)dao.findForList("StudentTestMapper.datalistPage", page); | |
54 | + } | |
55 | + | |
56 | + /**列表(全部) | |
57 | + * @param pd | |
58 | + * @throws Exception | |
59 | + */ | |
60 | + @SuppressWarnings("unchecked") | |
61 | + public List<PageData> listAll(PageData pd)throws Exception{ | |
62 | + return (List<PageData>)dao.findForList("StudentTestMapper.listAll", pd); | |
63 | + } | |
64 | + | |
65 | + /**通过id获取数据 | |
66 | + * @param pd | |
67 | + * @throws Exception | |
68 | + */ | |
69 | + public PageData findById(PageData pd)throws Exception{ | |
70 | + return (PageData)dao.findForObject("StudentTestMapper.findById", pd); | |
71 | + } | |
72 | + | |
73 | + /**批量删除 | |
74 | + * @param ArrayDATA_IDS | |
75 | + * @throws Exception | |
76 | + */ | |
77 | + public void deleteAll(String[] ArrayDATA_IDS)throws Exception{ | |
78 | + dao.delete("StudentTestMapper.deleteAll", ArrayDATA_IDS); | |
79 | + } | |
80 | + | |
81 | +} | |
82 | + | ... | ... |