Commit a479f295e5e175b66c97a7c6a5419a3f838299db
1 parent
8246d00c
添加了报表逻辑
Showing
26 changed files
with
997 additions
and
172 deletions
WebRoot/WEB-INF/jsp/sunvote/admin/admin_main.jsp
@@ -99,57 +99,84 @@ | @@ -99,57 +99,84 @@ | ||
99 | </ul> | 99 | </ul> |
100 | </div> | 100 | </div> |
101 | <div class="testpaper tab1"> | 101 | <div class="testpaper tab1"> |
102 | - <p>试卷管理<span class="right jiao"></span></p> | 102 | + <p>轻松考<span class="right jiao"></span></p> |
103 | <ul class="menu_1"> | 103 | <ul class="menu_1"> |
104 | <li > | 104 | <li > |
105 | - <p >轻松考试卷管理</p> | 105 | + <p >试卷管理</p> |
106 | <ul class="menu_2"> | 106 | <ul class="menu_2"> |
107 | <li ><p id="new_paper">出卷</p></li> | 107 | <li ><p id="new_paper">出卷</p></li> |
108 | <li ><p id="qingsongkao_paper">查看所有试卷</p></li> | 108 | <li ><p id="qingsongkao_paper">查看所有试卷</p></li> |
109 | 109 | ||
110 | </ul> | 110 | </ul> |
111 | </li> | 111 | </li> |
112 | - <li> | ||
113 | - <p id="jishice_paper">即时测试卷管理</p> | 112 | + <li > |
113 | + <p>考试情况</p> | ||
114 | + <ul class="menu_2"> | ||
115 | + <c:forEach items="${gradeInfos}" var="var" varStatus="vs"> | ||
116 | + <c:forEach items="${var.classInfos}" var="var1" varStatus="vs1"> | ||
117 | + <li onclick="event.stopPropagation();report('${var1.ID}')"> | ||
118 | + <p>${ var1.CLASS_NAME }</p> | ||
119 | + </li> | ||
120 | + </c:forEach> | ||
121 | + </c:forEach> | ||
122 | + </ul> | ||
114 | </li> | 123 | </li> |
124 | + | ||
115 | </ul> | 125 | </ul> |
116 | 126 | ||
117 | </div> | 127 | </div> |
118 | <div class="analyse tab1"> | 128 | <div class="analyse tab1"> |
119 | <p> | 129 | <p> |
120 | - 测验分析<span class="right jiao"></span> | 130 | + 即时测<span class="right jiao"></span> |
121 | </p> | 131 | </p> |
122 | 132 | ||
123 | <ul class="menu_1"> | 133 | <ul class="menu_1"> |
124 | - <li > | ||
125 | - <p>轻松考统考</p> | 134 | + <li> |
135 | + <p id="jishice_paper">试卷管理</p> | ||
126 | </li> | 136 | </li> |
127 | - <li > | ||
128 | - <p>轻松考班级情况</p> | 137 | + <li> |
138 | + <p>测验分析</p> | ||
129 | <ul class="menu_2"> | 139 | <ul class="menu_2"> |
130 | - <c:forEach items="${gradeInfos}" var="var" varStatus="vs"> | ||
131 | - <c:forEach items="${var.classInfos}" var="var1" varStatus="vs1"> | ||
132 | - <li onclick="event.stopPropagation();report('${var1.ID}')"> | ||
133 | - <p>${ var1.CLASS_NAME }</p> | ||
134 | - </li> | ||
135 | - </c:forEach> | 140 | + <c:forEach items="${gradeInfos}" var="var" varStatus="vs"> |
141 | + <c:forEach items="${var.classInfos}" var="var1" varStatus="vs1"> | ||
142 | + <li onclick="event.stopPropagation();report2('${var1.ID}')"> | ||
143 | + <p>${ var1.CLASS_NAME }</p> | ||
144 | + </li> | ||
136 | </c:forEach> | 145 | </c:forEach> |
146 | + </c:forEach> | ||
137 | </ul> | 147 | </ul> |
138 | </li> | 148 | </li> |
149 | + </ul> | ||
150 | + </div> | ||
151 | + | ||
152 | + | ||
153 | + <div class="analyse tab1"> | ||
154 | + <p> | ||
155 | + 课后练<span class="right jiao"></span> | ||
156 | + </p> | ||
157 | + | ||
158 | + <ul class="menu_1"> | ||
139 | <li> | 159 | <li> |
140 | - <p>即时测测验分析</p> | ||
141 | - <ul class="menu_2"> | ||
142 | - <c:forEach items="${gradeInfos}" var="var" varStatus="vs"> | ||
143 | - <c:forEach items="${var.classInfos}" var="var1" varStatus="vs1"> | ||
144 | - <li onclick="event.stopPropagation();report2('${var1.ID}')"> | ||
145 | - <p>${ var1.CLASS_NAME }</p> | ||
146 | - </li> | ||
147 | - </c:forEach> | 160 | + <p onclick="event.stopPropagation();monitor('${SCHOOL_ID}')">班长管理</p> |
161 | + </li> | ||
162 | + <li> | ||
163 | + <p id="jishice_paper">作业管理</p> | ||
164 | + </li> | ||
165 | + <li> | ||
166 | + <p>作业分析</p> | ||
167 | + <ul class="menu_2"> | ||
168 | + <c:forEach items="${gradeInfos}" var="var" varStatus="vs"> | ||
169 | + <c:forEach items="${var.classInfos}" var="var1" varStatus="vs1"> | ||
170 | + <li onclick="event.stopPropagation();report2('${var1.ID}')"> | ||
171 | + <p>${ var1.CLASS_NAME }</p> | ||
172 | + </li> | ||
148 | </c:forEach> | 173 | </c:forEach> |
174 | + </c:forEach> | ||
149 | </ul> | 175 | </ul> |
150 | </li> | 176 | </li> |
151 | </ul> | 177 | </ul> |
152 | </div> | 178 | </div> |
179 | + | ||
153 | <div class="analyse tab1"> | 180 | <div class="analyse tab1"> |
154 | <p> | 181 | <p> |
155 | 系统设置<span class="right jiao"></span> | 182 | 系统设置<span class="right jiao"></span> |
@@ -166,9 +193,7 @@ | @@ -166,9 +193,7 @@ | ||
166 | <li> | 193 | <li> |
167 | <p onclick="event.stopPropagation();pagetemplate('${SCHOOL_ID}')">模板设置</p> | 194 | <p onclick="event.stopPropagation();pagetemplate('${SCHOOL_ID}')">模板设置</p> |
168 | </li> | 195 | </li> |
169 | - <li> | ||
170 | - <p onclick="event.stopPropagation();monitor('${SCHOOL_ID}')">班长管理</p> | ||
171 | - </li> | 196 | + |
172 | <li> | 197 | <li> |
173 | <p onclick="event.stopPropagation();other('${SCHOOL_ID}')">其他配置</p> | 198 | <p onclick="event.stopPropagation();other('${SCHOOL_ID}')">其他配置</p> |
174 | </li> | 199 | </li> |
WebRoot/WEB-INF/jsp/sunvote/student/student_edit2.jsp
@@ -88,7 +88,7 @@ input[type="text"],select { | @@ -88,7 +88,7 @@ input[type="text"],select { | ||
88 | method="post"> | 88 | method="post"> |
89 | <input type="hidden" name="ID" id="ID" value="${pd.ID}" /> <input | 89 | <input type="hidden" name="ID" id="ID" value="${pd.ID}" /> <input |
90 | type="hidden" name="CLASS_ID" id="CLASS_ID" value="${pd.CLASS_ID}" /> | 90 | type="hidden" name="CLASS_ID" id="CLASS_ID" value="${pd.CLASS_ID}" /> |
91 | - <input type="hidden" name="TERM_ID" id="TERM_ID" value="${pd.TERM_ID}" /> | 91 | + <input type="hidden" name="TERM_ID" id="TERM_ID" value="${pd.TERM_ID}" /> |
92 | <div id="zhongxin"> | 92 | <div id="zhongxin"> |
93 | <li> | 93 | <li> |
94 | <p><span style="color:#f00">*</span>学生姓名:</p> | 94 | <p><span style="color:#f00">*</span>学生姓名:</p> |
WebRoot/WEB-INF/jsp/sunvote/student/student_list2.jsp
@@ -162,7 +162,7 @@ | @@ -162,7 +162,7 @@ | ||
162 | function edit(Id){ | 162 | function edit(Id){ |
163 | window.top.modal.init({ | 163 | window.top.modal.init({ |
164 | 'title':'添加学生', | 164 | 'title':'添加学生', |
165 | - 'url':'<%=basePath%>student/goEdit2.do?ID='+Id, | 165 | + 'url':'<%=basePath%>student/goEdit2.do?class_id=${pd.CLASS_ID}&term_id=${pd.TERM_ID}&ID='+Id, |
166 | func:function() { | 166 | func:function() { |
167 | tosearch(); | 167 | tosearch(); |
168 | } | 168 | } |
resources/mybatis1/sunvote/CourseManagementMapper.xml
@@ -154,6 +154,17 @@ | @@ -154,6 +154,17 @@ | ||
154 | 154 | ||
155 | </select> | 155 | </select> |
156 | 156 | ||
157 | + <select id="listTeacherClass" parameterType="pd" resultType="pd"> | ||
158 | + SELECT | ||
159 | + sv_sclass.* | ||
160 | + FROM | ||
161 | + sv_coursemanagement | ||
162 | + LEFT JOIN sv_sclass ON sv_coursemanagement.CLASS_ID = sv_sclass.ID | ||
163 | + WHERE | ||
164 | + sv_coursemanagement.TEACHER_ID = #{TEACHER_ID} | ||
165 | + | ||
166 | + </select> | ||
167 | + | ||
157 | <!-- 列表(全部) --> | 168 | <!-- 列表(全部) --> |
158 | <select id="listCourselistPage" parameterType="page" resultType="pd"> | 169 | <select id="listCourselistPage" parameterType="page" resultType="pd"> |
159 | SELECT | 170 | SELECT |
resources/mybatis1/sunvote/HeadmasterMapper.xml
@@ -84,10 +84,10 @@ | @@ -84,10 +84,10 @@ | ||
84 | from | 84 | from |
85 | <include refid="tableName"></include> | 85 | <include refid="tableName"></include> |
86 | where | 86 | where |
87 | - <if test="pd.KEYPAD_ID != null and pd.KEYPAD_ID != ''"> | 87 | + <if test="KEYPAD_ID != null and KEYPAD_ID != ''"> |
88 | KEYPAD_ID = #{KEYPAD_ID} | 88 | KEYPAD_ID = #{KEYPAD_ID} |
89 | </if> | 89 | </if> |
90 | - <if test="pd.KEYPAD_ID == null or pd.KEYPAD_ID != ''"> | 90 | + <if test="KEYPAD_ID == null or KEYPAD_ID == ''"> |
91 | USERNAME = #{USERNAME} and | 91 | USERNAME = #{USERNAME} and |
92 | PASSWORD = #{PASSWORD} | 92 | PASSWORD = #{PASSWORD} |
93 | </if> | 93 | </if> |
resources/mybatis1/sunvote/HomeworkMapper.xml
@@ -21,6 +21,12 @@ | @@ -21,6 +21,12 @@ | ||
21 | COMPLETE_COUNT, | 21 | COMPLETE_COUNT, |
22 | ALL_SCORE, | 22 | ALL_SCORE, |
23 | TEACHER_ID, | 23 | TEACHER_ID, |
24 | + HOMEWORK_DESC, | ||
25 | + COMPLETE_DESC, | ||
26 | + SUMBIT_DATE, | ||
27 | + GET_SCORE, | ||
28 | + GET_SCORE_PERSENT, | ||
29 | + GET_MAX_SCORE, | ||
24 | HOMEWORK_ID | 30 | HOMEWORK_ID |
25 | </sql> | 31 | </sql> |
26 | 32 | ||
@@ -38,6 +44,12 @@ | @@ -38,6 +44,12 @@ | ||
38 | #{COMPLETE_COUNT}, | 44 | #{COMPLETE_COUNT}, |
39 | #{ALL_SCORE}, | 45 | #{ALL_SCORE}, |
40 | #{TEACHER_ID}, | 46 | #{TEACHER_ID}, |
47 | + #{HOMEWORK_DESC}, | ||
48 | + #{COMPLETE_DESC}, | ||
49 | + #{SUMBIT_DATE}, | ||
50 | + #{GET_SCORE}, | ||
51 | + #{GET_SCORE_PERSENT}, | ||
52 | + #{GET_MAX_SCORE}, | ||
41 | #{HOMEWORK_ID} | 53 | #{HOMEWORK_ID} |
42 | </sql> | 54 | </sql> |
43 | 55 | ||
@@ -65,18 +77,43 @@ | @@ -65,18 +77,43 @@ | ||
65 | update | 77 | update |
66 | <include refid="tableName"></include> | 78 | <include refid="tableName"></include> |
67 | set | 79 | set |
80 | + <if test="CODE != null and CODE != ''"> | ||
68 | CODE = #{CODE}, | 81 | CODE = #{CODE}, |
82 | + </if><if test="NAME != null and NAME != ''"> | ||
69 | NAME = #{NAME}, | 83 | NAME = #{NAME}, |
84 | + </if><if test="SUBJECT_ID != null and SUBJECT_ID != ''"> | ||
70 | SUBJECT_ID = #{SUBJECT_ID}, | 85 | SUBJECT_ID = #{SUBJECT_ID}, |
86 | + </if><if test="CLASS_ID != null and CLASS_ID != ''"> | ||
71 | CLASS_ID = #{CLASS_ID}, | 87 | CLASS_ID = #{CLASS_ID}, |
88 | + </if><if test="GRADE_ID != null and GRADE_ID != ''"> | ||
72 | GRADE_ID = #{GRADE_ID}, | 89 | GRADE_ID = #{GRADE_ID}, |
90 | + </if><if test="SCHOOL_ID != null and SCHOOL_ID != ''"> | ||
73 | SCHOOL_ID = #{SCHOOL_ID}, | 91 | SCHOOL_ID = #{SCHOOL_ID}, |
92 | + </if><if test="COMPLETE_DATE != null and COMPLETE_DATE != ''"> | ||
74 | COMPLETE_DATE = #{COMPLETE_DATE}, | 93 | COMPLETE_DATE = #{COMPLETE_DATE}, |
94 | + </if><if test="CREATE_DATE != null and CREATE_DATE != ''"> | ||
75 | CREATE_DATE = #{CREATE_DATE}, | 95 | CREATE_DATE = #{CREATE_DATE}, |
96 | + </if><if test="MODIFY_DATE != null and MODIFY_DATE != ''"> | ||
76 | MODIFY_DATE = #{MODIFY_DATE}, | 97 | MODIFY_DATE = #{MODIFY_DATE}, |
98 | + </if><if test="COMPLETE_COUNT != null and COMPLETE_COUNT != ''"> | ||
77 | COMPLETE_COUNT = #{COMPLETE_COUNT}, | 99 | COMPLETE_COUNT = #{COMPLETE_COUNT}, |
100 | + </if><if test="ALL_SCORE != null and ALL_SCORE != ''"> | ||
78 | ALL_SCORE = #{ALL_SCORE}, | 101 | ALL_SCORE = #{ALL_SCORE}, |
102 | + </if><if test="TEACHER_ID != null and TEACHER_ID != ''"> | ||
79 | TEACHER_ID = #{TEACHER_ID}, | 103 | TEACHER_ID = #{TEACHER_ID}, |
104 | + </if><if test="HOMEWORK_DESC != null and HOMEWORK_DESC != ''"> | ||
105 | + HOMEWORK_DESC = #{HOMEWORK_DESC}, | ||
106 | + </if><if test="COMPLETE_DESC != null and COMPLETE_DESC != ''"> | ||
107 | + COMPLETE_DESC = #{COMPLETE_DESC}, | ||
108 | + </if><if test="SUMBIT_DATE != null and SUMBIT_DATE != ''"> | ||
109 | + SUMBIT_DATE = #{SUMBIT_DATE}, | ||
110 | + </if><if test="GET_SCORE != null and GET_SCORE != ''"> | ||
111 | + GET_SCORE = #{GET_SCORE}, | ||
112 | + </if><if test="GET_SCORE_PERSENT != null and GET_SCORE_PERSENT != ''"> | ||
113 | + GET_SCORE_PERSENT = #{GET_SCORE_PERSENT}, | ||
114 | + </if><if test="GET_MAX_SCORE != null and GET_MAX_SCORE != ''"> | ||
115 | + GET_MAX_SCORE = #{GET_MAX_SCORE}, | ||
116 | + </if> | ||
80 | HOMEWORK_ID = HOMEWORK_ID | 117 | HOMEWORK_ID = HOMEWORK_ID |
81 | where | 118 | where |
82 | HOMEWORK_ID = #{HOMEWORK_ID} | 119 | HOMEWORK_ID = #{HOMEWORK_ID} |
@@ -118,22 +155,22 @@ | @@ -118,22 +155,22 @@ | ||
118 | from | 155 | from |
119 | <include refid="tableName"></include> | 156 | <include refid="tableName"></include> |
120 | where 1 = 1 | 157 | where 1 = 1 |
121 | - <if test="pd.SUBJECT_ID != null and pd.SUBJECT_ID != ''"><!-- 关键词检索 --> | 158 | + <if test="SUBJECT_ID != null and SUBJECT_ID != ''"><!-- 关键词检索 --> |
122 | and SUBJECT_ID = #{SUBJECT_ID} | 159 | and SUBJECT_ID = #{SUBJECT_ID} |
123 | </if> | 160 | </if> |
124 | - <if test="pd.CLASS_ID != null and pd.CLASS_ID != ''"><!-- 关键词检索 --> | 161 | + <if test="CLASS_ID != null and CLASS_ID != ''"><!-- 关键词检索 --> |
125 | and CLASS_ID = #{CLASS_ID} | 162 | and CLASS_ID = #{CLASS_ID} |
126 | </if> | 163 | </if> |
127 | - <if test="pd.GRADE_ID != null and pd.GRADE_ID != ''"><!-- 关键词检索 --> | 164 | + <if test="GRADE_ID != null and GRADE_ID != ''"><!-- 关键词检索 --> |
128 | and GRADE_ID = #{GRADE_ID} | 165 | and GRADE_ID = #{GRADE_ID} |
129 | </if> | 166 | </if> |
130 | - <if test="pd.SCHOOL_ID != null and pd.SCHOOL_ID != ''"><!-- 关键词检索 --> | 167 | + <if test="SCHOOL_ID != null and SCHOOL_ID != ''"><!-- 关键词检索 --> |
131 | and SCHOOL_ID = #{SCHOOL_ID} | 168 | and SCHOOL_ID = #{SCHOOL_ID} |
132 | </if> | 169 | </if> |
133 | - <if test="pd.TEACHER_ID != null and pd.TEACHER_ID != ''"><!-- 关键词检索 --> | 170 | + <if test="TEACHER_ID != null and TEACHER_ID != ''"><!-- 关键词检索 --> |
134 | and TEACHER_ID = #{TEACHER_ID} | 171 | and TEACHER_ID = #{TEACHER_ID} |
135 | </if> | 172 | </if> |
136 | - <if test="pd.COMPLETE != null and pd.COMPLETE != ''"><!-- 关键词检索 --> | 173 | + <if test="COMPLETE != null and COMPLETE != ''"><!-- 关键词检索 --> |
137 | and COMPLETE_DATE > #{COMPLETE_DATE} | 174 | and COMPLETE_DATE > #{COMPLETE_DATE} |
138 | </if> | 175 | </if> |
139 | 176 | ||
@@ -148,29 +185,27 @@ | @@ -148,29 +185,27 @@ | ||
148 | SUBJECT_ID, | 185 | SUBJECT_ID, |
149 | CLASS_ID, | 186 | CLASS_ID, |
150 | COMPLETE_DATE, | 187 | COMPLETE_DATE, |
151 | - COMPLETE_COUNT, | ||
152 | ALL_SCORE, | 188 | ALL_SCORE, |
153 | - TEACHER_ID, | ||
154 | HOMEWORK_ID | 189 | HOMEWORK_ID |
155 | from | 190 | from |
156 | <include refid="tableName"></include> | 191 | <include refid="tableName"></include> |
157 | where 1 = 1 | 192 | where 1 = 1 |
158 | - <if test="pd.SUBJECT_ID != null and pd.SUBJECT_ID != ''"><!-- 关键词检索 --> | 193 | + <if test="SUBJECT_ID != null and SUBJECT_ID != ''"><!-- 关键词检索 --> |
159 | and SUBJECT_ID = #{SUBJECT_ID} | 194 | and SUBJECT_ID = #{SUBJECT_ID} |
160 | </if> | 195 | </if> |
161 | - <if test="pd.CLASS_ID != null and pd.CLASS_ID != ''"><!-- 关键词检索 --> | 196 | + <if test="CLASS_ID != null and CLASS_ID != ''"><!-- 关键词检索 --> |
162 | and CLASS_ID = #{CLASS_ID} | 197 | and CLASS_ID = #{CLASS_ID} |
163 | </if> | 198 | </if> |
164 | - <if test="pd.GRADE_ID != null and pd.GRADE_ID != ''"><!-- 关键词检索 --> | 199 | + <if test="GRADE_ID != null and GRADE_ID != ''"><!-- 关键词检索 --> |
165 | and GRADE_ID = #{GRADE_ID} | 200 | and GRADE_ID = #{GRADE_ID} |
166 | </if> | 201 | </if> |
167 | - <if test="pd.SCHOOL_ID != null and pd.SCHOOL_ID != ''"><!-- 关键词检索 --> | 202 | + <if test="SCHOOL_ID != null and SCHOOL_ID != ''"><!-- 关键词检索 --> |
168 | and SCHOOL_ID = #{SCHOOL_ID} | 203 | and SCHOOL_ID = #{SCHOOL_ID} |
169 | </if> | 204 | </if> |
170 | - <if test="pd.TEACHER_ID != null and pd.TEACHER_ID != ''"><!-- 关键词检索 --> | 205 | + <if test="TEACHER_ID != null and TEACHER_ID != ''"><!-- 关键词检索 --> |
171 | and TEACHER_ID = #{TEACHER_ID} | 206 | and TEACHER_ID = #{TEACHER_ID} |
172 | </if> | 207 | </if> |
173 | - <if test="pd.COMPLETE != null and pd.COMPLETE != ''"><!-- 关键词检索 --> | 208 | + <if test="COMPLETE != null and COMPLETE != ''"><!-- 关键词检索 --> |
174 | and COMPLETE_DATE > #{COMPLETE_DATE} | 209 | and COMPLETE_DATE > #{COMPLETE_DATE} |
175 | </if> | 210 | </if> |
176 | 211 |
resources/mybatis1/sunvote/HomeworkProblemMapper.xml
@@ -129,18 +129,22 @@ | @@ -129,18 +129,22 @@ | ||
129 | <!-- 列表(全部) --> | 129 | <!-- 列表(全部) --> |
130 | <select id="listProblem" parameterType="pd" resultType="pd"> | 130 | <select id="listProblem" parameterType="pd" resultType="pd"> |
131 | select | 131 | select |
132 | - <include refid="Field"></include> | 132 | + RANK, |
133 | + NAME, | ||
134 | + OPTION_NUM, | ||
135 | + SCORE, | ||
136 | + RIGHT_ANSWER | ||
133 | from | 137 | from |
134 | <include refid="tableName"></include> | 138 | <include refid="tableName"></include> |
135 | where 1 = 1 | 139 | where 1 = 1 |
136 | - <if test="pd.HOMEWORK_ID != null and pd.HOMEWORK_ID != ''"> | ||
137 | - and HOMEWORK_ID = #{pd.HOMEWORK_ID} | 140 | + <if test="HOMEWORK_ID != null and HOMEWORK_ID != ''"> |
141 | + and HOMEWORK_ID = #{HOMEWORK_ID} | ||
138 | </if> | 142 | </if> |
139 | - <if test="pd.P_HOMEWORK_PROBLEM_ID == null or pd.P_HOMEWORK_PROBLEM_ID == ''"> | 143 | + <if test="P_HOMEWORK_PROBLEM_ID == null or P_HOMEWORK_PROBLEM_ID == ''"> |
140 | and P_HOMEWORK_PROBLEM_ID is NULL | 144 | and P_HOMEWORK_PROBLEM_ID is NULL |
141 | </if> | 145 | </if> |
142 | - <if test="pd.P_HOMEWORK_PROBLEM_ID != null and pd.P_HOMEWORK_PROBLEM_ID != ''"> | ||
143 | - and P_HOMEWORK_PROBLEM_ID = #{pd.P_HOMEWORK_PROBLEM_ID} | 146 | + <if test="P_HOMEWORK_PROBLEM_ID != null and P_HOMEWORK_PROBLEM_ID != ''"> |
147 | + and P_HOMEWORK_PROBLEM_ID = #{P_HOMEWORK_PROBLEM_ID} | ||
144 | </if> | 148 | </if> |
145 | ORDER BY RANK | 149 | ORDER BY RANK |
146 | </select> | 150 | </select> |
resources/mybatis1/sunvote/HomeworkReportMapper.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="HomeworkReportMapper"> | ||
4 | + | ||
5 | + <!--表名 --> | ||
6 | + <sql id="tableName"> | ||
7 | + SV_HOMEWORKREPORT | ||
8 | + </sql> | ||
9 | + | ||
10 | + <!-- 字段 --> | ||
11 | + <sql id="Field"> | ||
12 | + HOMEWORK_REPORT_ID, | ||
13 | + RANK, | ||
14 | + STUDENT_NAME, | ||
15 | + STUDNET_NO, | ||
16 | + KEYBOARD, | ||
17 | + RIGHT_PERSENT, | ||
18 | + GET_SCORE, | ||
19 | + ANSWER, | ||
20 | + HOMEWORK_ID | ||
21 | + </sql> | ||
22 | + | ||
23 | + <!-- 字段值 --> | ||
24 | + <sql id="FieldValue"> | ||
25 | + #{HOMEWORK_REPORT_ID}, | ||
26 | + #{RANK}, | ||
27 | + #{STUDENT_NAME}, | ||
28 | + #{STUDNET_NO}, | ||
29 | + #{KEYBOARD}, | ||
30 | + #{RIGHT_PERSENT}, | ||
31 | + #{GET_SCORE}, | ||
32 | + #{ANSWER}, | ||
33 | + #{HOMEWORK_ID} | ||
34 | + </sql> | ||
35 | + | ||
36 | + <!-- 新增--> | ||
37 | + <insert id="save" parameterType="pd"> | ||
38 | + insert into | ||
39 | + <include refid="tableName"></include> | ||
40 | + ( | ||
41 | + <include refid="Field"></include> | ||
42 | + ) values ( | ||
43 | + <include refid="FieldValue"></include> | ||
44 | + ) | ||
45 | + </insert> | ||
46 | + | ||
47 | + <!-- 删除--> | ||
48 | + <delete id="delete" parameterType="pd"> | ||
49 | + delete from | ||
50 | + <include refid="tableName"></include> | ||
51 | + where | ||
52 | + HOMEWORK_REPORT_ID = #{HOMEWORK_REPORT_ID} | ||
53 | + </delete> | ||
54 | + | ||
55 | + <!-- 修改 --> | ||
56 | + <update id="edit" parameterType="pd"> | ||
57 | + update | ||
58 | + <include refid="tableName"></include> | ||
59 | + set | ||
60 | + RANK = #{RANK}, | ||
61 | + STUDENT_NAME = #{STUDENT_NAME}, | ||
62 | + STUDNET_NO = #{STUDNET_NO}, | ||
63 | + KEYBOARD = #{KEYBOARD}, | ||
64 | + RIGHT_PERSENT = #{RIGHT_PERSENT}, | ||
65 | + GET_SCORE = #{GET_SCORE}, | ||
66 | + ANSWER = #{ANSWER}, | ||
67 | + HOMEWORK_ID = #{HOMEWORK_ID} | ||
68 | + where | ||
69 | + HOMEWORK_REPORT_ID = #{HOMEWORK_REPORT_ID} | ||
70 | + </update> | ||
71 | + <!-- 修改 --> | ||
72 | + <update id="update" parameterType="pd"> | ||
73 | + update | ||
74 | + <include refid="tableName"></include> | ||
75 | + set | ||
76 | + RANK = #{RANK}, | ||
77 | + STUDENT_NAME = #{STUDENT_NAME}, | ||
78 | + STUDNET_NO = #{STUDNET_NO}, | ||
79 | + KEYBOARD = #{KEYBOARD}, | ||
80 | + RIGHT_PERSENT = #{RIGHT_PERSENT}, | ||
81 | + GET_SCORE = #{GET_SCORE}, | ||
82 | + ANSWER = #{ANSWER}, | ||
83 | + HOMEWORK_ID = #{HOMEWORK_ID} | ||
84 | + where | ||
85 | + HOMEWORK_ID = #{HOMEWORK_ID} | ||
86 | + and | ||
87 | + STUDNET_NO = #{STUDNET_NO} | ||
88 | + </update> | ||
89 | + | ||
90 | + <!-- 通过ID获取数据 --> | ||
91 | + <select id="findById" parameterType="pd" resultType="pd"> | ||
92 | + select | ||
93 | + <include refid="Field"></include> | ||
94 | + from | ||
95 | + <include refid="tableName"></include> | ||
96 | + where | ||
97 | + HOMEWORK_REPORT_ID = #{HOMEWORK_REPORT_ID} | ||
98 | + </select> | ||
99 | + | ||
100 | + <select id="findByHomeworkID" parameterType="pd" resultType="pd"> | ||
101 | + select | ||
102 | + <include refid="Field"></include> | ||
103 | + from | ||
104 | + <include refid="tableName"></include> | ||
105 | + where | ||
106 | + HOMEWORK_ID = #{HOMEWORK_ID} | ||
107 | + </select> | ||
108 | + | ||
109 | + <!-- 列表 --> | ||
110 | + <select id="datalistPage" parameterType="page" resultType="pd"> | ||
111 | + select | ||
112 | + <include refid="Field"></include> | ||
113 | + from | ||
114 | + <include refid="tableName"></include> | ||
115 | + where 1=1 | ||
116 | + <if test="pd.keywords!= null and pd.keywords != ''"><!-- 关键词检索 --> | ||
117 | + and | ||
118 | + ( | ||
119 | + <!-- 根据需求自己加检索条件 | ||
120 | + 字段1 LIKE CONCAT(CONCAT('%', #{pd.keywords}),'%') | ||
121 | + or | ||
122 | + 字段2 LIKE CONCAT(CONCAT('%', #{pd.keywords}),'%') | ||
123 | + --> | ||
124 | + ) | ||
125 | + </if> | ||
126 | + </select> | ||
127 | + | ||
128 | + <!-- 列表(全部) --> | ||
129 | + <select id="listAll" parameterType="pd" resultType="pd"> | ||
130 | + select | ||
131 | + <include refid="Field"></include> | ||
132 | + from | ||
133 | + <include refid="tableName"></include> | ||
134 | + </select> | ||
135 | + | ||
136 | + | ||
137 | + | ||
138 | + <!-- 批量删除 --> | ||
139 | + <delete id="deleteAll" parameterType="String"> | ||
140 | + delete from | ||
141 | + <include refid="tableName"></include> | ||
142 | + where | ||
143 | + HOMEWORK_REPORT_ID in | ||
144 | + <foreach item="item" index="index" collection="array" open="(" separator="," close=")"> | ||
145 | + #{item} | ||
146 | + </foreach> | ||
147 | + </delete> | ||
148 | + | ||
149 | + <!-- fh313596790qq(青苔) --> | ||
150 | + | ||
151 | + <!-- 新增--> | ||
152 | + <insert id="batchSave" parameterType="java.util.List"> | ||
153 | + insert into | ||
154 | + <include refid="tableName"></include> | ||
155 | + ( | ||
156 | + <include refid="Field"></include> | ||
157 | + ) values | ||
158 | + | ||
159 | + <foreach collection="list" index="index" item="item" separator=","> | ||
160 | + ( | ||
161 | + #{item.HOMEWORK_REPORT_ID}, | ||
162 | + #{item.RANK}, | ||
163 | + #{item.STUDENT_NAME}, | ||
164 | + #{item.STUDNET_NO}, | ||
165 | + #{item.KEYBOARD}, | ||
166 | + #{item.RIGHT_PERSENT}, | ||
167 | + #{item.GET_SCORE}, | ||
168 | + #{item.ANSWER}, | ||
169 | + #{item.HOMEWORK_ID} | ||
170 | + ) | ||
171 | + </foreach> | ||
172 | + </insert> | ||
173 | + | ||
174 | +</mapper> | ||
0 | \ No newline at end of file | 175 | \ No newline at end of file |
resources/mybatis1/sunvote/StudentMapper.xml
@@ -19,6 +19,7 @@ | @@ -19,6 +19,7 @@ | ||
19 | PARENT_PHONE, | 19 | PARENT_PHONE, |
20 | KEYPAD_ID, | 20 | KEYPAD_ID, |
21 | REMARK, | 21 | REMARK, |
22 | + CLASS_ID, | ||
22 | ID | 23 | ID |
23 | </sql> | 24 | </sql> |
24 | 25 | ||
@@ -34,6 +35,7 @@ | @@ -34,6 +35,7 @@ | ||
34 | #{PARENT_PHONE}, | 35 | #{PARENT_PHONE}, |
35 | #{KEYPAD_ID}, | 36 | #{KEYPAD_ID}, |
36 | #{REMARK}, | 37 | #{REMARK}, |
38 | + #{CLASS_ID}, | ||
37 | #{ID} | 39 | #{ID} |
38 | </sql> | 40 | </sql> |
39 | 41 | ||
@@ -69,6 +71,7 @@ | @@ -69,6 +71,7 @@ | ||
69 | PARENT_PHONE = #{PARENT_PHONE}, | 71 | PARENT_PHONE = #{PARENT_PHONE}, |
70 | KEYPAD_ID = #{KEYPAD_ID}, | 72 | KEYPAD_ID = #{KEYPAD_ID}, |
71 | REMARK = #{REMARK}, | 73 | REMARK = #{REMARK}, |
74 | + CLASS_ID = #{CLASS_ID}, | ||
72 | ID = #{ID} | 75 | ID = #{ID} |
73 | where | 76 | where |
74 | ID = #{ID} | 77 | ID = #{ID} |
@@ -85,6 +88,16 @@ | @@ -85,6 +88,16 @@ | ||
85 | </select> | 88 | </select> |
86 | 89 | ||
87 | <!-- 通过ID获取数据 --> | 90 | <!-- 通过ID获取数据 --> |
91 | + <select id="findByClassId" parameterType="pd" resultType="pd"> | ||
92 | + select | ||
93 | + <include refid="Field"></include> | ||
94 | + from | ||
95 | + <include refid="tableName"></include> | ||
96 | + where | ||
97 | + CLASS_ID = #{CLASS_ID} | ||
98 | + </select> | ||
99 | + | ||
100 | + <!-- 通过ID获取数据 --> | ||
88 | <select id="findByName" parameterType="pd" resultType="pd"> | 101 | <select id="findByName" parameterType="pd" resultType="pd"> |
89 | select | 102 | select |
90 | <include refid="Field"></include> | 103 | <include refid="Field"></include> |
resources/mybatis1/sunvote/TermMapper.xml
@@ -68,6 +68,17 @@ | @@ -68,6 +68,17 @@ | ||
68 | TERM_ID = #{TERM_ID} | 68 | TERM_ID = #{TERM_ID} |
69 | </select> | 69 | </select> |
70 | 70 | ||
71 | + <!-- 通过ID获取数据 --> | ||
72 | + <select id="findCurrentId" parameterType="pd" resultType="pd"> | ||
73 | + select | ||
74 | + <include refid="Field"></include> | ||
75 | + from | ||
76 | + <include refid="tableName"></include> | ||
77 | + where | ||
78 | + START_DATE < NOW() | ||
79 | + AND sv_term.END_DATE > NOW() | ||
80 | + </select> | ||
81 | + | ||
71 | <!-- 列表 --> | 82 | <!-- 列表 --> |
72 | <select id="datalistPage" parameterType="page" resultType="pd"> | 83 | <select id="datalistPage" parameterType="page" resultType="pd"> |
73 | select | 84 | select |
src/com/fh/bean/ResultHomework.java
0 → 100644
1 | +package com.fh.bean; | ||
2 | + | ||
3 | +import java.util.List; | ||
4 | + | ||
5 | +import com.google.gson.Gson; | ||
6 | + | ||
7 | +public class ResultHomework { | ||
8 | + | ||
9 | + private String HOMEWORK_ID; | ||
10 | + private String CLASS_ID; | ||
11 | + private String GET_SCORE; | ||
12 | + private String GET_SCORE_PERSENT; | ||
13 | + private String COMPLETE_DESC; | ||
14 | + private String GET_MAX_SCORE; | ||
15 | + private List<ResultStudent> STUDENTS; | ||
16 | + | ||
17 | + public void setHOMEWORK_ID(String HOMEWORK_ID) { | ||
18 | + this.HOMEWORK_ID = HOMEWORK_ID; | ||
19 | + } | ||
20 | + | ||
21 | + public String getHOMEWORK_ID() { | ||
22 | + return HOMEWORK_ID; | ||
23 | + } | ||
24 | + | ||
25 | + public void setCLASS_ID(String CLASS_ID) { | ||
26 | + this.CLASS_ID = CLASS_ID; | ||
27 | + } | ||
28 | + | ||
29 | + public String getCLASS_ID() { | ||
30 | + return CLASS_ID; | ||
31 | + } | ||
32 | + | ||
33 | + public void setGET_SCORE(String GET_SCORE) { | ||
34 | + this.GET_SCORE = GET_SCORE; | ||
35 | + } | ||
36 | + | ||
37 | + public String getGET_SCORE() { | ||
38 | + return GET_SCORE; | ||
39 | + } | ||
40 | + | ||
41 | + public void setGET_SCORE_PERSENT(String GET_SCORE_PERSENT) { | ||
42 | + this.GET_SCORE_PERSENT = GET_SCORE_PERSENT; | ||
43 | + } | ||
44 | + | ||
45 | + public String getGET_SCORE_PERSENT() { | ||
46 | + return GET_SCORE_PERSENT; | ||
47 | + } | ||
48 | + | ||
49 | + public void setCOMPLETE_DESC(String COMPLETE_DESC) { | ||
50 | + this.COMPLETE_DESC = COMPLETE_DESC; | ||
51 | + } | ||
52 | + | ||
53 | + public String getCOMPLETE_DESC() { | ||
54 | + return COMPLETE_DESC; | ||
55 | + } | ||
56 | + | ||
57 | + public void setGET_MAX_SCORE(String GET_MAX_SCORE) { | ||
58 | + this.GET_MAX_SCORE = GET_MAX_SCORE; | ||
59 | + } | ||
60 | + | ||
61 | + public String getGET_MAX_SCORE() { | ||
62 | + return GET_MAX_SCORE; | ||
63 | + } | ||
64 | + | ||
65 | + public void setSTUDENTS(List<ResultStudent> STUDENTS) { | ||
66 | + this.STUDENTS = STUDENTS; | ||
67 | + } | ||
68 | + | ||
69 | + public List<ResultStudent> getSTUDENTS() { | ||
70 | + return STUDENTS; | ||
71 | + } | ||
72 | + | ||
73 | + public static ResultHomework parse(String json){ | ||
74 | + Gson gson = new Gson(); | ||
75 | + return gson.fromJson(json, ResultHomework.class); | ||
76 | + } | ||
77 | + | ||
78 | + public static class ResultStudent { | ||
79 | + private String STUDENT_NO; | ||
80 | + private String STUDENT_NAME; | ||
81 | + private String KEYBOARD; | ||
82 | + private String RIGHT_PERSENT; | ||
83 | + private String GET_SCORE; | ||
84 | + private String RANK; | ||
85 | + private String ANSWER; | ||
86 | + | ||
87 | + public void setSTUDENT_NO(String STUDENT_NO) { | ||
88 | + this.STUDENT_NO = STUDENT_NO; | ||
89 | + } | ||
90 | + | ||
91 | + public String getSTUDENT_NO() { | ||
92 | + return STUDENT_NO; | ||
93 | + } | ||
94 | + | ||
95 | + public void setSTUDENT_NAME(String STUDENT_NAME) { | ||
96 | + this.STUDENT_NAME = STUDENT_NAME; | ||
97 | + } | ||
98 | + | ||
99 | + public String getSTUDENT_NAME() { | ||
100 | + return STUDENT_NAME; | ||
101 | + } | ||
102 | + | ||
103 | + public void setKEYBOARD(String KEYBOARD) { | ||
104 | + this.KEYBOARD = KEYBOARD; | ||
105 | + } | ||
106 | + | ||
107 | + public String getKEYBOARD() { | ||
108 | + return KEYBOARD; | ||
109 | + } | ||
110 | + | ||
111 | + public void setRIGHT_PERSENT(String RIGHT_PERSENT) { | ||
112 | + this.RIGHT_PERSENT = RIGHT_PERSENT; | ||
113 | + } | ||
114 | + | ||
115 | + public String getRIGHT_PERSENT() { | ||
116 | + return RIGHT_PERSENT; | ||
117 | + } | ||
118 | + | ||
119 | + public void setGET_SCORE(String GET_SCORE) { | ||
120 | + this.GET_SCORE = GET_SCORE; | ||
121 | + } | ||
122 | + | ||
123 | + public String getGET_SCORE() { | ||
124 | + return GET_SCORE; | ||
125 | + } | ||
126 | + | ||
127 | + public void setRANK(String RANK) { | ||
128 | + this.RANK = RANK; | ||
129 | + } | ||
130 | + | ||
131 | + public String getRANK() { | ||
132 | + return RANK; | ||
133 | + } | ||
134 | + | ||
135 | + public void setANSWER(String ANSWER) { | ||
136 | + this.ANSWER = ANSWER; | ||
137 | + } | ||
138 | + | ||
139 | + public String getANSWER() { | ||
140 | + return ANSWER; | ||
141 | + } | ||
142 | + } | ||
143 | +} |
src/com/fh/controller/api/V1.java
@@ -26,6 +26,8 @@ import org.springframework.web.multipart.MultipartFile; | @@ -26,6 +26,8 @@ import org.springframework.web.multipart.MultipartFile; | ||
26 | import com.fh.bean.Paper; | 26 | import com.fh.bean.Paper; |
27 | import com.fh.bean.Point; | 27 | import com.fh.bean.Point; |
28 | import com.fh.bean.Question; | 28 | import com.fh.bean.Question; |
29 | +import com.fh.bean.ResultHomework; | ||
30 | +import com.fh.bean.ResultHomework.ResultStudent; | ||
29 | import com.fh.bean.StudentAnswer; | 31 | import com.fh.bean.StudentAnswer; |
30 | import com.fh.bean.TestPaper; | 32 | import com.fh.bean.TestPaper; |
31 | import com.fh.bean.TestPaperInfo; | 33 | import com.fh.bean.TestPaperInfo; |
@@ -47,6 +49,7 @@ import com.fh.service.sunvote.event.EventManager; | @@ -47,6 +49,7 @@ import com.fh.service.sunvote.event.EventManager; | ||
47 | import com.fh.service.sunvote.grade.GradeManager; | 49 | import com.fh.service.sunvote.grade.GradeManager; |
48 | import com.fh.service.sunvote.headmaster.HeadmasterManager; | 50 | import com.fh.service.sunvote.headmaster.HeadmasterManager; |
49 | import com.fh.service.sunvote.homework.HomeworkManager; | 51 | import com.fh.service.sunvote.homework.HomeworkManager; |
52 | +import com.fh.service.sunvote.homework.HomeworkReportManager; | ||
50 | import com.fh.service.sunvote.homeworkproblem.HomeworkProblemManager; | 53 | import com.fh.service.sunvote.homeworkproblem.HomeworkProblemManager; |
51 | import com.fh.service.sunvote.keypad.KeypadManager; | 54 | import com.fh.service.sunvote.keypad.KeypadManager; |
52 | import com.fh.service.sunvote.keypadcheck.KeypadCheckManager; | 55 | import com.fh.service.sunvote.keypadcheck.KeypadCheckManager; |
@@ -199,6 +202,9 @@ public class V1 extends BaseController { | @@ -199,6 +202,9 @@ public class V1 extends BaseController { | ||
199 | @Resource(name="homeworkproblemService") | 202 | @Resource(name="homeworkproblemService") |
200 | private HomeworkProblemManager homeworkproblemService; | 203 | private HomeworkProblemManager homeworkproblemService; |
201 | 204 | ||
205 | + @Resource(name="homeworkReporService") | ||
206 | + private HomeworkReportManager homeworkReporkService; | ||
207 | + | ||
202 | /** | 208 | /** |
203 | * 登录 可以通过账号密码登录、 可以通过教师卡登录 | 209 | * 登录 可以通过账号密码登录、 可以通过教师卡登录 |
204 | * | 210 | * |
@@ -259,7 +265,7 @@ public class V1 extends BaseController { | @@ -259,7 +265,7 @@ public class V1 extends BaseController { | ||
259 | headerMaster.put("role", "headermaster"); | 265 | headerMaster.put("role", "headermaster"); |
260 | List<PageData> classInfoList = sclassService.listAll(headerMaster); | 266 | List<PageData> classInfoList = sclassService.listAll(headerMaster); |
261 | headerMaster.put("classInfoList", classInfoList); | 267 | headerMaster.put("classInfoList", classInfoList); |
262 | - | 268 | + res.setData(headerMaster); |
263 | 269 | ||
264 | }else{ | 270 | }else{ |
265 | res.set1Error(); | 271 | res.set1Error(); |
@@ -2872,12 +2878,117 @@ public class V1 extends BaseController { | @@ -2872,12 +2878,117 @@ public class V1 extends BaseController { | ||
2872 | 2878 | ||
2873 | PageData pd = this.getPageData(); | 2879 | PageData pd = this.getPageData(); |
2874 | if (!StringUtils.isEmpty(pd.getJsonString())) { | 2880 | if (!StringUtils.isEmpty(pd.getJsonString())) { |
2875 | - | ||
2876 | - | ||
2877 | - | ||
2878 | - res.setData("success"); | 2881 | + ResultHomework resultHomework = ResultHomework.parse(pd.getJsonString()); |
2882 | + PageData homePd = new PageData(); | ||
2883 | + homePd.put("HOMEWORK_ID", resultHomework.getHOMEWORK_ID()); | ||
2884 | + homePd.put("CLASS_ID", resultHomework.getCLASS_ID()); | ||
2885 | + homePd.put("GET_SCORE", resultHomework.getGET_SCORE()); | ||
2886 | + homePd.put("GET_SCORE_PERSENT", resultHomework.getGET_SCORE_PERSENT()); | ||
2887 | + homePd.put("COMPLETE_DESC", resultHomework.getCOMPLETE_DESC()); | ||
2888 | + homePd.put("GET_MAX_SCORE", resultHomework.getGET_MAX_SCORE()); | ||
2889 | + homeworkService.edit(homePd); | ||
2890 | + List<PageData> list = homeworkReporkService.findByHomeworkID(homePd); | ||
2891 | + if(list == null || list.size() == 0){ | ||
2892 | + // 初始化班級作业数据 | ||
2893 | + // 1. 根据班级id 查询班级学生列表 | ||
2894 | + List<PageData> student = studentService.findByClassId(homePd); | ||
2895 | + for(PageData ptd : student){ | ||
2896 | + ptd.put("STUDENT_NAME", ptd.get("NAME")); | ||
2897 | + ptd.put("STUDENT_NO", ptd.get("SNO")); | ||
2898 | + ptd.put("RANK", student.size() + ""); | ||
2899 | + ptd.put("KEYBOARD", ptd.get("KEYPAD_ID")); | ||
2900 | + ptd.put("RIGHT_PERSENT", "0%"); | ||
2901 | + ptd.put("GET_SCORE", "0"); | ||
2902 | + ptd.put("ANSWER", ""); | ||
2903 | + ptd.put("HOMEWORK_ID", resultHomework.getHOMEWORK_ID()); | ||
2904 | + } | ||
2905 | + // 2. 根据学生列表生成初始化成绩 | ||
2906 | + homeworkReporkService.batchSave(student); | ||
2907 | + } | ||
2908 | + List<ResultStudent> students = resultHomework.getSTUDENTS(); | ||
2909 | + for(ResultStudent student:students){ | ||
2910 | + // update 学生作业情况 | ||
2911 | + PageData tpd = new PageData(); | ||
2912 | + tpd.put("STUDENT_NAME", student.getSTUDENT_NAME()); | ||
2913 | + tpd.put("STUDENT_NO", student.getSTUDENT_NO()); | ||
2914 | + tpd.put("RANK", student.getRANK()); | ||
2915 | + tpd.put("KEYBOARD", student.getKEYBOARD()); | ||
2916 | + tpd.put("RIGHT_PERSENT", student.getRIGHT_PERSENT()); | ||
2917 | + tpd.put("GET_SCORE", student.getGET_SCORE()); | ||
2918 | + tpd.put("ANSWER", student.getANSWER()); | ||
2919 | + tpd.put("HOMEWORK_ID", resultHomework.getHOMEWORK_ID()); | ||
2920 | + homeworkReporkService.update(tpd); | ||
2921 | + } | ||
2922 | + res.setData(resultHomework.getHOMEWORK_ID()); | ||
2923 | + }else{ | ||
2924 | + res.setDataError(); | ||
2925 | + } | ||
2926 | + | ||
2927 | + return res.toJson(); | ||
2928 | + | ||
2929 | + } | ||
2930 | + | ||
2931 | + | ||
2932 | + /** | ||
2933 | + * 更新学生详情 | ||
2934 | + * | ||
2935 | + * @param id | ||
2936 | + * @return | ||
2937 | + * @throws Exception | ||
2938 | + */ | ||
2939 | + @RequestMapping(value = "/uploadshomework", produces = "application/json;charset=UTF-8") | ||
2940 | + @ResponseBody | ||
2941 | + public String uploadshomework() throws Exception { | ||
2942 | + ResponseGson<String> res = new ResponseGson<String>(); | ||
2943 | + | ||
2944 | + PageData pd = this.getPageData(); | ||
2945 | + if (!StringUtils.isEmpty(pd.getJsonString())) { | ||
2946 | + ResultHomework resultHomework = ResultHomework.parse(pd.getJsonString()); | ||
2947 | + PageData homePd = new PageData(); | ||
2948 | + homePd.put("HOMEWORK_ID", resultHomework.getHOMEWORK_ID()); | ||
2949 | + homePd.put("CLASS_ID", resultHomework.getCLASS_ID()); | ||
2950 | + homePd.put("GET_SCORE", resultHomework.getGET_SCORE()); | ||
2951 | + homePd.put("GET_SCORE_PERSENT", resultHomework.getGET_SCORE_PERSENT()); | ||
2952 | + homePd.put("COMPLETE_DESC", resultHomework.getCOMPLETE_DESC()); | ||
2953 | + homePd.put("GET_MAX_SCORE", resultHomework.getGET_MAX_SCORE()); | ||
2954 | + homeworkService.edit(homePd); | ||
2955 | + List<PageData> list = homeworkReporkService.findByHomeworkID(homePd); | ||
2956 | + if(list == null || list.size() == 0){ | ||
2957 | + // 初始化班級作业数据 | ||
2958 | + // 1. 根据班级id 查询班级学生列表 | ||
2959 | + List<PageData> student = studentService.findByClassId(homePd); | ||
2960 | + for(PageData ptd : student){ | ||
2961 | + ptd.put("STUDENT_NAME", ptd.get("NAME")); | ||
2962 | + ptd.put("STUDENT_NO", ptd.get("SNO")); | ||
2963 | + ptd.put("RANK", student.size() + ""); | ||
2964 | + ptd.put("KEYBOARD", ptd.get("KEYPAD_ID")); | ||
2965 | + ptd.put("RIGHT_PERSENT", "0%"); | ||
2966 | + ptd.put("GET_SCORE", "0"); | ||
2967 | + ptd.put("ANSWER", ""); | ||
2968 | + ptd.put("HOMEWORK_ID", resultHomework.getHOMEWORK_ID()); | ||
2969 | + } | ||
2970 | + // 2. 根据学生列表生成初始化成绩 | ||
2971 | + homeworkReporkService.batchSave(student); | ||
2972 | + } | ||
2973 | + List<ResultStudent> students = resultHomework.getSTUDENTS(); | ||
2974 | + for(ResultStudent student:students){ | ||
2975 | + // update 学生作业情况 | ||
2976 | + PageData tpd = new PageData(); | ||
2977 | + tpd.put("STUDENT_NAME", student.getSTUDENT_NAME()); | ||
2978 | + tpd.put("STUDENT_NO", student.getSTUDENT_NO()); | ||
2979 | + tpd.put("RANK", student.getRANK()); | ||
2980 | + tpd.put("KEYBOARD", student.getKEYBOARD()); | ||
2981 | + tpd.put("RIGHT_PERSENT", student.getRIGHT_PERSENT()); | ||
2982 | + tpd.put("GET_SCORE", student.getGET_SCORE()); | ||
2983 | + tpd.put("ANSWER", student.getANSWER()); | ||
2984 | + tpd.put("HOMEWORK_ID", resultHomework.getHOMEWORK_ID()); | ||
2985 | + homeworkReporkService.update(tpd); | ||
2986 | + } | ||
2987 | + res.setData(resultHomework.getHOMEWORK_ID()); | ||
2988 | + }else{ | ||
2989 | + res.setDataError(); | ||
2879 | } | 2990 | } |
2880 | - res.setDataError(); | 2991 | + |
2881 | return res.toJson(); | 2992 | return res.toJson(); |
2882 | 2993 | ||
2883 | } | 2994 | } |
src/com/fh/controller/base/BaseController.java
src/com/fh/controller/sunvote/coursemanagement/CourseManagementController.java
@@ -19,6 +19,7 @@ import org.springframework.web.bind.annotation.RequestMapping; | @@ -19,6 +19,7 @@ import org.springframework.web.bind.annotation.RequestMapping; | ||
19 | import org.springframework.web.bind.annotation.ResponseBody; | 19 | import org.springframework.web.bind.annotation.ResponseBody; |
20 | import org.springframework.web.servlet.ModelAndView; | 20 | import org.springframework.web.servlet.ModelAndView; |
21 | 21 | ||
22 | +import com.fh.controller.api.ResponseGson; | ||
22 | import com.fh.controller.base.BaseController; | 23 | import com.fh.controller.base.BaseController; |
23 | import com.fh.entity.Page; | 24 | import com.fh.entity.Page; |
24 | import com.fh.service.sunvote.coursemanagement.CourseManagementManager; | 25 | import com.fh.service.sunvote.coursemanagement.CourseManagementManager; |
@@ -192,6 +193,25 @@ public class CourseManagementController extends BaseController { | @@ -192,6 +193,25 @@ public class CourseManagementController extends BaseController { | ||
192 | return mv; | 193 | return mv; |
193 | } | 194 | } |
194 | 195 | ||
196 | + | ||
197 | + /** | ||
198 | + * 获取作业详情 | ||
199 | + * | ||
200 | + * @param id | ||
201 | + * @return | ||
202 | + * @throws Exception | ||
203 | + */ | ||
204 | + @RequestMapping(value = "/teacherClass", produces = "application/json;charset=UTF-8") | ||
205 | + @ResponseBody | ||
206 | + public String homework() throws Exception { | ||
207 | + ResponseGson<List<PageData>> res = new ResponseGson<List<PageData>>(); | ||
208 | + PageData pageData = this.getPageData(); | ||
209 | + List<PageData> list = coursemanagementService.listTeacherClass(pageData); | ||
210 | + res.setData(list); | ||
211 | + return res.toJson(); | ||
212 | + | ||
213 | + } | ||
214 | + | ||
195 | /**去新增页面 | 215 | /**去新增页面 |
196 | * @param | 216 | * @param |
197 | * @throws Exception | 217 | * @throws Exception |
src/com/fh/controller/sunvote/homework/HomeworkController.java
@@ -8,7 +8,9 @@ import java.util.Date; | @@ -8,7 +8,9 @@ import java.util.Date; | ||
8 | import java.util.HashMap; | 8 | import java.util.HashMap; |
9 | import java.util.List; | 9 | import java.util.List; |
10 | import java.util.Map; | 10 | import java.util.Map; |
11 | + | ||
11 | import javax.annotation.Resource; | 12 | import javax.annotation.Resource; |
13 | + | ||
12 | import org.springframework.beans.propertyeditors.CustomDateEditor; | 14 | import org.springframework.beans.propertyeditors.CustomDateEditor; |
13 | import org.springframework.stereotype.Controller; | 15 | import org.springframework.stereotype.Controller; |
14 | import org.springframework.web.bind.WebDataBinder; | 16 | import org.springframework.web.bind.WebDataBinder; |
@@ -16,108 +18,124 @@ import org.springframework.web.bind.annotation.InitBinder; | @@ -16,108 +18,124 @@ import org.springframework.web.bind.annotation.InitBinder; | ||
16 | import org.springframework.web.bind.annotation.RequestMapping; | 18 | import org.springframework.web.bind.annotation.RequestMapping; |
17 | import org.springframework.web.bind.annotation.ResponseBody; | 19 | import org.springframework.web.bind.annotation.ResponseBody; |
18 | import org.springframework.web.servlet.ModelAndView; | 20 | import org.springframework.web.servlet.ModelAndView; |
21 | + | ||
19 | import com.fh.controller.base.BaseController; | 22 | import com.fh.controller.base.BaseController; |
20 | import com.fh.entity.Page; | 23 | import com.fh.entity.Page; |
24 | +import com.fh.service.sunvote.homework.HomeworkManager; | ||
25 | +import com.fh.service.sunvote.homework.HomeworkReportManager; | ||
21 | import com.fh.util.AppUtil; | 26 | import com.fh.util.AppUtil; |
27 | +import com.fh.util.Jurisdiction; | ||
22 | import com.fh.util.ObjectExcelView; | 28 | import com.fh.util.ObjectExcelView; |
23 | import com.fh.util.PageData; | 29 | import com.fh.util.PageData; |
24 | -import com.fh.util.Jurisdiction; | ||
25 | -import com.fh.util.Tools; | ||
26 | -import com.fh.service.sunvote.homework.HomeworkManager; | 30 | +import com.google.gson.Gson; |
27 | 31 | ||
28 | -/** | ||
29 | - * 说明:作业 | ||
30 | - * 创建人:FH Q313596790 | ||
31 | - * 创建时间:2019-03-07 | 32 | +/** |
33 | + * 说明:作业 创建人:FH Q313596790 创建时间:2019-03-07 | ||
32 | */ | 34 | */ |
33 | @Controller | 35 | @Controller |
34 | -@RequestMapping(value="/homework") | 36 | +@RequestMapping(value = "/homework") |
35 | public class HomeworkController extends BaseController { | 37 | public class HomeworkController extends BaseController { |
36 | - | ||
37 | - String menuUrl = "homework/list.do"; //菜单地址(权限用) | ||
38 | - @Resource(name="homeworkService") | 38 | + |
39 | + String menuUrl = "homework/list.do"; // 菜单地址(权限用) | ||
40 | + @Resource(name = "homeworkService") | ||
39 | private HomeworkManager homeworkService; | 41 | private HomeworkManager homeworkService; |
40 | - | ||
41 | - /**保存 | 42 | + @Resource(name = "homeworkReporService") |
43 | + private HomeworkReportManager homeworkReporService; | ||
44 | + | ||
45 | + /** | ||
46 | + * 保存 | ||
47 | + * | ||
42 | * @param | 48 | * @param |
43 | * @throws Exception | 49 | * @throws Exception |
44 | */ | 50 | */ |
45 | - @RequestMapping(value="/save") | ||
46 | - public ModelAndView save() throws Exception{ | ||
47 | - logBefore(logger, Jurisdiction.getUsername()+"新增Homework"); | ||
48 | - if(!Jurisdiction.buttonJurisdiction(menuUrl, "add")){return null;} //校验权限 | 51 | + @RequestMapping(value = "/save") |
52 | + public ModelAndView save() throws Exception { | ||
53 | + logBefore(logger, Jurisdiction.getUsername() + "新增Homework"); | ||
54 | + if (!Jurisdiction.buttonJurisdiction(menuUrl, "add")) { | ||
55 | + return null; | ||
56 | + } // 校验权限 | ||
49 | ModelAndView mv = this.getModelAndView(); | 57 | ModelAndView mv = this.getModelAndView(); |
50 | PageData pd = new PageData(); | 58 | PageData pd = new PageData(); |
51 | pd = this.getPageData(); | 59 | pd = this.getPageData(); |
52 | - pd.put("HOMEWORK_ID", this.get32UUID()); //主键 | 60 | + pd.put("HOMEWORK_ID", this.get32UUID()); // 主键 |
53 | homeworkService.save(pd); | 61 | homeworkService.save(pd); |
54 | - mv.addObject("msg","success"); | 62 | + mv.addObject("msg", "success"); |
55 | mv.setViewName("save_result"); | 63 | mv.setViewName("save_result"); |
56 | return mv; | 64 | return mv; |
57 | } | 65 | } |
58 | - | ||
59 | - /**删除 | 66 | + |
67 | + /** | ||
68 | + * 删除 | ||
69 | + * | ||
60 | * @param out | 70 | * @param out |
61 | * @throws Exception | 71 | * @throws Exception |
62 | */ | 72 | */ |
63 | - @RequestMapping(value="/delete") | ||
64 | - public void delete(PrintWriter out) throws Exception{ | ||
65 | - logBefore(logger, Jurisdiction.getUsername()+"删除Homework"); | ||
66 | - if(!Jurisdiction.buttonJurisdiction(menuUrl, "del")){return;} //校验权限 | 73 | + @RequestMapping(value = "/delete") |
74 | + public void delete(PrintWriter out) throws Exception { | ||
75 | + logBefore(logger, Jurisdiction.getUsername() + "删除Homework"); | ||
67 | PageData pd = new PageData(); | 76 | PageData pd = new PageData(); |
68 | pd = this.getPageData(); | 77 | pd = this.getPageData(); |
69 | homeworkService.delete(pd); | 78 | homeworkService.delete(pd); |
70 | out.write("success"); | 79 | out.write("success"); |
71 | out.close(); | 80 | out.close(); |
72 | } | 81 | } |
73 | - | ||
74 | - /**修改 | 82 | + |
83 | + /** | ||
84 | + * 修改 | ||
85 | + * | ||
75 | * @param | 86 | * @param |
76 | * @throws Exception | 87 | * @throws Exception |
77 | */ | 88 | */ |
78 | - @RequestMapping(value="/edit") | ||
79 | - public ModelAndView edit() throws Exception{ | ||
80 | - logBefore(logger, Jurisdiction.getUsername()+"修改Homework"); | ||
81 | - if(!Jurisdiction.buttonJurisdiction(menuUrl, "edit")){return null;} //校验权限 | 89 | + @RequestMapping(value = "/edit") |
90 | + public ModelAndView edit() throws Exception { | ||
91 | + logBefore(logger, Jurisdiction.getUsername() + "修改Homework"); | ||
92 | + if (!Jurisdiction.buttonJurisdiction(menuUrl, "edit")) { | ||
93 | + return null; | ||
94 | + } // 校验权限 | ||
82 | ModelAndView mv = this.getModelAndView(); | 95 | ModelAndView mv = this.getModelAndView(); |
83 | PageData pd = new PageData(); | 96 | PageData pd = new PageData(); |
84 | pd = this.getPageData(); | 97 | pd = this.getPageData(); |
85 | homeworkService.edit(pd); | 98 | homeworkService.edit(pd); |
86 | - mv.addObject("msg","success"); | 99 | + mv.addObject("msg", "success"); |
87 | mv.setViewName("save_result"); | 100 | mv.setViewName("save_result"); |
88 | return mv; | 101 | return mv; |
89 | } | 102 | } |
90 | - | ||
91 | - /**列表 | 103 | + |
104 | + /** | ||
105 | + * 列表 | ||
106 | + * | ||
92 | * @param page | 107 | * @param page |
93 | * @throws Exception | 108 | * @throws Exception |
94 | */ | 109 | */ |
95 | - @RequestMapping(value="/list") | ||
96 | - public ModelAndView list(Page page) throws Exception{ | ||
97 | - logBefore(logger, Jurisdiction.getUsername()+"列表Homework"); | ||
98 | - //if(!Jurisdiction.buttonJurisdiction(menuUrl, "cha")){return null;} //校验权限(无权查看时页面会有提示,如果不注释掉这句代码就无法进入列表页面,所以根据情况是否加入本句代码) | 110 | + @RequestMapping(value = "/list") |
111 | + public ModelAndView list(Page page) throws Exception { | ||
112 | + logBefore(logger, Jurisdiction.getUsername() + "列表Homework"); | ||
113 | + // if(!Jurisdiction.buttonJurisdiction(menuUrl, "cha")){return null;} | ||
114 | + // //校验权限(无权查看时页面会有提示,如果不注释掉这句代码就无法进入列表页面,所以根据情况是否加入本句代码) | ||
99 | ModelAndView mv = this.getModelAndView(); | 115 | ModelAndView mv = this.getModelAndView(); |
100 | PageData pd = new PageData(); | 116 | PageData pd = new PageData(); |
101 | pd = this.getPageData(); | 117 | pd = this.getPageData(); |
102 | - String keywords = pd.getString("keywords"); //关键词检索条件 | ||
103 | - if(null != keywords && !"".equals(keywords)){ | 118 | + String keywords = pd.getString("keywords"); // 关键词检索条件 |
119 | + if (null != keywords && !"".equals(keywords)) { | ||
104 | pd.put("keywords", keywords.trim()); | 120 | pd.put("keywords", keywords.trim()); |
105 | } | 121 | } |
106 | page.setPd(pd); | 122 | page.setPd(pd); |
107 | - List<PageData> varList = homeworkService.list(page); //列出Homework列表 | 123 | + List<PageData> varList = homeworkService.list(page); // 列出Homework列表 |
108 | mv.setViewName("sunvote/homework/homework_list"); | 124 | mv.setViewName("sunvote/homework/homework_list"); |
109 | mv.addObject("varList", varList); | 125 | mv.addObject("varList", varList); |
110 | mv.addObject("pd", pd); | 126 | mv.addObject("pd", pd); |
111 | - mv.addObject("QX",Jurisdiction.getHC()); //按钮权限 | 127 | + mv.addObject("QX", Jurisdiction.getHC()); // 按钮权限 |
112 | return mv; | 128 | return mv; |
113 | } | 129 | } |
114 | - | ||
115 | - /**去新增页面 | 130 | + |
131 | + /** | ||
132 | + * 去新增页面 | ||
133 | + * | ||
116 | * @param | 134 | * @param |
117 | * @throws Exception | 135 | * @throws Exception |
118 | */ | 136 | */ |
119 | - @RequestMapping(value="/goAdd") | ||
120 | - public ModelAndView goAdd()throws Exception{ | 137 | + @RequestMapping(value = "/goAdd") |
138 | + public ModelAndView goAdd() throws Exception { | ||
121 | ModelAndView mv = this.getModelAndView(); | 139 | ModelAndView mv = this.getModelAndView(); |
122 | PageData pd = new PageData(); | 140 | PageData pd = new PageData(); |
123 | pd = this.getPageData(); | 141 | pd = this.getPageData(); |
@@ -125,101 +143,129 @@ public class HomeworkController extends BaseController { | @@ -125,101 +143,129 @@ public class HomeworkController extends BaseController { | ||
125 | mv.addObject("msg", "save"); | 143 | mv.addObject("msg", "save"); |
126 | mv.addObject("pd", pd); | 144 | mv.addObject("pd", pd); |
127 | return mv; | 145 | return mv; |
128 | - } | ||
129 | - | ||
130 | - /**去修改页面 | 146 | + } |
147 | + | ||
148 | + /** | ||
149 | + * 去修改页面 | ||
150 | + * | ||
131 | * @param | 151 | * @param |
132 | * @throws Exception | 152 | * @throws Exception |
133 | */ | 153 | */ |
134 | - @RequestMapping(value="/goEdit") | ||
135 | - public ModelAndView goEdit()throws Exception{ | 154 | + @RequestMapping(value = "/goEdit") |
155 | + public ModelAndView goEdit() throws Exception { | ||
136 | ModelAndView mv = this.getModelAndView(); | 156 | ModelAndView mv = this.getModelAndView(); |
137 | PageData pd = new PageData(); | 157 | PageData pd = new PageData(); |
138 | pd = this.getPageData(); | 158 | pd = this.getPageData(); |
139 | - pd = homeworkService.findById(pd); //根据ID读取 | 159 | + pd = homeworkService.findById(pd); // 根据ID读取 |
140 | mv.setViewName("sunvote/homework/homework_edit"); | 160 | mv.setViewName("sunvote/homework/homework_edit"); |
141 | mv.addObject("msg", "edit"); | 161 | mv.addObject("msg", "edit"); |
142 | mv.addObject("pd", pd); | 162 | mv.addObject("pd", pd); |
143 | return mv; | 163 | return mv; |
144 | - } | ||
145 | - | ||
146 | - /**批量删除 | 164 | + } |
165 | + | ||
166 | + /** | ||
167 | + * 批量删除 | ||
168 | + * | ||
147 | * @param | 169 | * @param |
148 | * @throws Exception | 170 | * @throws Exception |
149 | */ | 171 | */ |
150 | - @RequestMapping(value="/deleteAll") | 172 | + @RequestMapping(value = "/deleteAll") |
151 | @ResponseBody | 173 | @ResponseBody |
152 | - public Object deleteAll() throws Exception{ | ||
153 | - logBefore(logger, Jurisdiction.getUsername()+"批量删除Homework"); | ||
154 | - if(!Jurisdiction.buttonJurisdiction(menuUrl, "del")){return null;} //校验权限 | ||
155 | - PageData pd = new PageData(); | ||
156 | - Map<String,Object> map = new HashMap<String,Object>(); | 174 | + public Object deleteAll() throws Exception { |
175 | + logBefore(logger, Jurisdiction.getUsername() + "批量删除Homework"); | ||
176 | + if (!Jurisdiction.buttonJurisdiction(menuUrl, "del")) { | ||
177 | + return null; | ||
178 | + } // 校验权限 | ||
179 | + PageData pd = new PageData(); | ||
180 | + Map<String, Object> map = new HashMap<String, Object>(); | ||
157 | pd = this.getPageData(); | 181 | pd = this.getPageData(); |
158 | List<PageData> pdList = new ArrayList<PageData>(); | 182 | List<PageData> pdList = new ArrayList<PageData>(); |
159 | String DATA_IDS = pd.getString("DATA_IDS"); | 183 | String DATA_IDS = pd.getString("DATA_IDS"); |
160 | - if(null != DATA_IDS && !"".equals(DATA_IDS)){ | 184 | + if (null != DATA_IDS && !"".equals(DATA_IDS)) { |
161 | String ArrayDATA_IDS[] = DATA_IDS.split(","); | 185 | String ArrayDATA_IDS[] = DATA_IDS.split(","); |
162 | homeworkService.deleteAll(ArrayDATA_IDS); | 186 | homeworkService.deleteAll(ArrayDATA_IDS); |
163 | pd.put("msg", "ok"); | 187 | pd.put("msg", "ok"); |
164 | - }else{ | 188 | + } else { |
165 | pd.put("msg", "no"); | 189 | pd.put("msg", "no"); |
166 | } | 190 | } |
167 | pdList.add(pd); | 191 | pdList.add(pd); |
168 | map.put("list", pdList); | 192 | map.put("list", pdList); |
169 | return AppUtil.returnObject(pd, map); | 193 | return AppUtil.returnObject(pd, map); |
170 | } | 194 | } |
171 | - | ||
172 | - /**导出到excel | 195 | + |
196 | + /** | ||
197 | + * 导出到excel | ||
198 | + * | ||
173 | * @param | 199 | * @param |
174 | * @throws Exception | 200 | * @throws Exception |
175 | */ | 201 | */ |
176 | - @RequestMapping(value="/excel") | ||
177 | - public ModelAndView exportExcel() throws Exception{ | ||
178 | - logBefore(logger, Jurisdiction.getUsername()+"导出Homework到excel"); | ||
179 | - if(!Jurisdiction.buttonJurisdiction(menuUrl, "cha")){return null;} | 202 | + @RequestMapping(value = "/excel") |
203 | + public ModelAndView exportExcel() throws Exception { | ||
204 | + logBefore(logger, Jurisdiction.getUsername() + "导出Homework到excel"); | ||
205 | + if (!Jurisdiction.buttonJurisdiction(menuUrl, "cha")) { | ||
206 | + return null; | ||
207 | + } | ||
180 | ModelAndView mv = new ModelAndView(); | 208 | ModelAndView mv = new ModelAndView(); |
181 | PageData pd = new PageData(); | 209 | PageData pd = new PageData(); |
182 | pd = this.getPageData(); | 210 | pd = this.getPageData(); |
183 | - Map<String,Object> dataMap = new HashMap<String,Object>(); | 211 | + Map<String, Object> dataMap = new HashMap<String, Object>(); |
184 | List<String> titles = new ArrayList<String>(); | 212 | List<String> titles = new ArrayList<String>(); |
185 | - titles.add("作业代码"); //1 | ||
186 | - titles.add("作业名称"); //2 | ||
187 | - titles.add("科目ID"); //3 | ||
188 | - titles.add("班级ID"); //4 | ||
189 | - titles.add("年级ID"); //5 | ||
190 | - titles.add("学校ID"); //6 | ||
191 | - titles.add("需要完成时间"); //7 | ||
192 | - titles.add("创建时间"); //8 | ||
193 | - titles.add("修改时间"); //9 | ||
194 | - titles.add("完成次数"); //10 | ||
195 | - titles.add("总分"); //11 | 213 | + titles.add("作业代码"); // 1 |
214 | + titles.add("作业名称"); // 2 | ||
215 | + titles.add("科目ID"); // 3 | ||
216 | + titles.add("班级ID"); // 4 | ||
217 | + titles.add("年级ID"); // 5 | ||
218 | + titles.add("学校ID"); // 6 | ||
219 | + titles.add("需要完成时间"); // 7 | ||
220 | + titles.add("创建时间"); // 8 | ||
221 | + titles.add("修改时间"); // 9 | ||
222 | + titles.add("完成次数"); // 10 | ||
223 | + titles.add("总分"); // 11 | ||
196 | dataMap.put("titles", titles); | 224 | dataMap.put("titles", titles); |
197 | List<PageData> varOList = homeworkService.listAll(pd); | 225 | List<PageData> varOList = homeworkService.listAll(pd); |
198 | List<PageData> varList = new ArrayList<PageData>(); | 226 | List<PageData> varList = new ArrayList<PageData>(); |
199 | - for(int i=0;i<varOList.size();i++){ | 227 | + for (int i = 0; i < varOList.size(); i++) { |
200 | PageData vpd = new PageData(); | 228 | PageData vpd = new PageData(); |
201 | - vpd.put("var1", varOList.get(i).getString("CODE")); //1 | ||
202 | - vpd.put("var2", varOList.get(i).getString("NAME")); //2 | ||
203 | - vpd.put("var3", varOList.get(i).getString("SUBJECT_ID")); //3 | ||
204 | - vpd.put("var4", varOList.get(i).getString("CLASS_ID")); //4 | ||
205 | - vpd.put("var5", varOList.get(i).getString("GRADE_ID")); //5 | ||
206 | - vpd.put("var6", varOList.get(i).getString("SCHOOL_ID")); //6 | ||
207 | - vpd.put("var7", varOList.get(i).getString("COMPLETE_DATE")); //7 | ||
208 | - vpd.put("var8", varOList.get(i).getString("CREATE_DATE")); //8 | ||
209 | - vpd.put("var9", varOList.get(i).getString("MODIFY_DATE")); //9 | ||
210 | - vpd.put("var10", varOList.get(i).get("COMPLETE_COUNT").toString()); //10 | ||
211 | - vpd.put("var11", varOList.get(i).get("ALL_SCORE").toString()); //11 | 229 | + vpd.put("var1", varOList.get(i).getString("CODE")); // 1 |
230 | + vpd.put("var2", varOList.get(i).getString("NAME")); // 2 | ||
231 | + vpd.put("var3", varOList.get(i).getString("SUBJECT_ID")); // 3 | ||
232 | + vpd.put("var4", varOList.get(i).getString("CLASS_ID")); // 4 | ||
233 | + vpd.put("var5", varOList.get(i).getString("GRADE_ID")); // 5 | ||
234 | + vpd.put("var6", varOList.get(i).getString("SCHOOL_ID")); // 6 | ||
235 | + vpd.put("var7", varOList.get(i).getString("COMPLETE_DATE")); // 7 | ||
236 | + vpd.put("var8", varOList.get(i).getString("CREATE_DATE")); // 8 | ||
237 | + vpd.put("var9", varOList.get(i).getString("MODIFY_DATE")); // 9 | ||
238 | + vpd.put("var10", varOList.get(i).get("COMPLETE_COUNT").toString()); // 10 | ||
239 | + vpd.put("var11", varOList.get(i).get("ALL_SCORE").toString()); // 11 | ||
212 | varList.add(vpd); | 240 | varList.add(vpd); |
213 | } | 241 | } |
214 | dataMap.put("varList", varList); | 242 | dataMap.put("varList", varList); |
215 | ObjectExcelView erv = new ObjectExcelView(); | 243 | ObjectExcelView erv = new ObjectExcelView(); |
216 | - mv = new ModelAndView(erv,dataMap); | 244 | + mv = new ModelAndView(erv, dataMap); |
217 | return mv; | 245 | return mv; |
218 | } | 246 | } |
219 | - | 247 | + |
220 | @InitBinder | 248 | @InitBinder |
221 | - public void initBinder(WebDataBinder binder){ | 249 | + public void initBinder(WebDataBinder binder) { |
222 | DateFormat format = new SimpleDateFormat("yyyy-MM-dd"); | 250 | DateFormat format = new SimpleDateFormat("yyyy-MM-dd"); |
223 | - binder.registerCustomEditor(Date.class, new CustomDateEditor(format,true)); | 251 | + binder.registerCustomEditor(Date.class, new CustomDateEditor(format, |
252 | + true)); | ||
253 | + } | ||
254 | + | ||
255 | + /** | ||
256 | + * 批量删除 | ||
257 | + * | ||
258 | + * @param | ||
259 | + * @throws Exception | ||
260 | + */ | ||
261 | + @RequestMapping(value = "/homereport", produces = "application/json;charset=UTF-8") | ||
262 | + @ResponseBody | ||
263 | + public String getHomeReport() throws Exception { | ||
264 | + PageData pd = this.getPageData(); | ||
265 | + pd = homeworkService.findById(pd); | ||
266 | + List<PageData> data = homeworkReporService.findByHomeworkID(pd); | ||
267 | + pd.put("STUDENTS", data); | ||
268 | + Gson gson = new Gson(); | ||
269 | + return gson.toJson(pd); | ||
224 | } | 270 | } |
225 | } | 271 | } |
src/com/fh/controller/sunvote/report/ReportController.java
@@ -68,22 +68,22 @@ public class ReportController extends BaseController { | @@ -68,22 +68,22 @@ public class ReportController extends BaseController { | ||
68 | if( role != null && "admin".equals(role)){ | 68 | if( role != null && "admin".equals(role)){ |
69 | PageData tpd = new PageData(); | 69 | PageData tpd = new PageData(); |
70 | tpd.put("ID", getUserID()); | 70 | tpd.put("ID", getUserID()); |
71 | - List<PageData> adminInfos = v1Service.getAdminInfo(tpd); | 71 | + PageData adminInfos = v1Service.getAdminInfo(tpd); |
72 | List<PageData> subjectInfos = new ArrayList<PageData>(); | 72 | List<PageData> subjectInfos = new ArrayList<PageData>(); |
73 | - for(PageData pad : adminInfos){ | ||
74 | - PageData tmpd = new PageData(); | ||
75 | - Object gradeId = pad.get("GRADE_ID"); | ||
76 | - tmpd.put("SNAME", pad.get("SNAME"));// 学校名称 | ||
77 | - tmpd.put("SCHOOL_ID", pad.get("SCHOOL_ID"));//学校ID | ||
78 | - tmpd.put("GRADE_ID", pad.get("GRADE_ID"));//年级id | ||
79 | - tmpd.put("GNAME", pad.get("GNAME"));//年级名称 | ||
80 | - tmpd.put("SUBJECT_ID", pad.get("SUBJECT_ID"));// 科目id | ||
81 | - tmpd.put("SCNAME", pad.get("SCNAME"));// 科目名称 | ||
82 | - if(gradeId != null && !"".equals(gradeId)){ | ||
83 | - }else{ | ||
84 | - subjectInfos.add(tmpd); | ||
85 | - } | ||
86 | - } | 73 | +// for(PageData pad : adminInfos){ |
74 | +// PageData tmpd = new PageData(); | ||
75 | +// Object gradeId = pad.get("GRADE_ID"); | ||
76 | +// tmpd.put("SNAME", pad.get("SNAME"));// 学校名称 | ||
77 | +// tmpd.put("SCHOOL_ID", pad.get("SCHOOL_ID"));//学校ID | ||
78 | +// tmpd.put("GRADE_ID", pad.get("GRADE_ID"));//年级id | ||
79 | +// tmpd.put("GNAME", pad.get("GNAME"));//年级名称 | ||
80 | +// tmpd.put("SUBJECT_ID", pad.get("SUBJECT_ID"));// 科目id | ||
81 | +// tmpd.put("SCNAME", pad.get("SCNAME"));// 科目名称 | ||
82 | +// if(gradeId != null && !"".equals(gradeId)){ | ||
83 | +// }else{ | ||
84 | +// subjectInfos.add(tmpd); | ||
85 | +// } | ||
86 | +// } | ||
87 | mv.addObject("subjectInfos", subjectInfos); | 87 | mv.addObject("subjectInfos", subjectInfos); |
88 | }else{ | 88 | }else{ |
89 | pd.put("TEACHER_ID", getUserID()); | 89 | pd.put("TEACHER_ID", getUserID()); |
src/com/fh/controller/sunvote/student/StudentController.java
@@ -34,6 +34,7 @@ import com.fh.util.PathUtil; | @@ -34,6 +34,7 @@ import com.fh.util.PathUtil; | ||
34 | import com.fh.util.Tools; | 34 | import com.fh.util.Tools; |
35 | import com.fh.service.sunvote.classroster.ClassRosterManager; | 35 | import com.fh.service.sunvote.classroster.ClassRosterManager; |
36 | import com.fh.service.sunvote.student.StudentManager; | 36 | import com.fh.service.sunvote.student.StudentManager; |
37 | +import com.fh.service.sunvote.term.TermManager; | ||
37 | 38 | ||
38 | /** | 39 | /** |
39 | * 说明:学生管理 | 40 | * 说明:学生管理 |
@@ -51,6 +52,9 @@ public class StudentController extends BaseController { | @@ -51,6 +52,9 @@ public class StudentController extends BaseController { | ||
51 | @Resource(name="classrosterService") | 52 | @Resource(name="classrosterService") |
52 | private ClassRosterManager classrosterService; | 53 | private ClassRosterManager classrosterService; |
53 | 54 | ||
55 | + @Resource(name="termService") | ||
56 | + private TermManager termService; | ||
57 | + | ||
54 | /**保存 | 58 | /**保存 |
55 | * @param | 59 | * @param |
56 | * @throws Exception | 60 | * @throws Exception |
@@ -80,6 +84,7 @@ public class StudentController extends BaseController { | @@ -80,6 +84,7 @@ public class StudentController extends BaseController { | ||
80 | String studentID = this.get32UUID(); | 84 | String studentID = this.get32UUID(); |
81 | pd.put("ID", studentID); | 85 | pd.put("ID", studentID); |
82 | pd.put("STUDENT_ID", studentID); | 86 | pd.put("STUDENT_ID", studentID); |
87 | + pd.put("SNO", pd.get("NUMBER")); | ||
83 | studentService.save(pd); | 88 | studentService.save(pd); |
84 | 89 | ||
85 | String termID = pd.getString("TERM_ID"); | 90 | String termID = pd.getString("TERM_ID"); |
@@ -296,6 +301,7 @@ public class StudentController extends BaseController { | @@ -296,6 +301,7 @@ public class StudentController extends BaseController { | ||
296 | ModelAndView mv = this.getModelAndView(); | 301 | ModelAndView mv = this.getModelAndView(); |
297 | PageData pd = new PageData(); | 302 | PageData pd = new PageData(); |
298 | pd = this.getPageData(); | 303 | pd = this.getPageData(); |
304 | + pd.put("TERM_ID", getTermId()); | ||
299 | if(isChineseLanguageClient()){ | 305 | if(isChineseLanguageClient()){ |
300 | mv.setViewName("sunvote/student/student_edit2"); | 306 | mv.setViewName("sunvote/student/student_edit2"); |
301 | }else{ | 307 | }else{ |
@@ -329,9 +335,7 @@ public class StudentController extends BaseController { | @@ -329,9 +335,7 @@ public class StudentController extends BaseController { | ||
329 | ModelAndView mv = this.getModelAndView(); | 335 | ModelAndView mv = this.getModelAndView(); |
330 | PageData pd = new PageData(); | 336 | PageData pd = new PageData(); |
331 | pd = this.getPageData(); | 337 | pd = this.getPageData(); |
332 | - String classID = pd.getString("CLASS_ID"); | ||
333 | pd = studentService.findById(pd); //根据ID读取 | 338 | pd = studentService.findById(pd); //根据ID读取 |
334 | - pd.put("CLASS_ID", classID); | ||
335 | if(isChineseLanguageClient()){ | 339 | if(isChineseLanguageClient()){ |
336 | mv.setViewName("sunvote/student/student_edit2"); | 340 | mv.setViewName("sunvote/student/student_edit2"); |
337 | }else{ | 341 | }else{ |
@@ -413,6 +417,14 @@ public class StudentController extends BaseController { | @@ -413,6 +417,14 @@ public class StudentController extends BaseController { | ||
413 | return mv; | 417 | return mv; |
414 | } | 418 | } |
415 | 419 | ||
420 | + public String getTermId() throws Exception{ | ||
421 | + PageData pd = termService.findCurrentId(); | ||
422 | + if(pd != null){ | ||
423 | + return pd.getString("TERM_ID"); | ||
424 | + } | ||
425 | + return null; | ||
426 | + } | ||
427 | + | ||
416 | @InitBinder | 428 | @InitBinder |
417 | public void initBinder(WebDataBinder binder){ | 429 | public void initBinder(WebDataBinder binder){ |
418 | DateFormat format = new SimpleDateFormat("yyyy-MM-dd"); | 430 | DateFormat format = new SimpleDateFormat("yyyy-MM-dd"); |
src/com/fh/service/sunvote/coursemanagement/CourseManagementManager.java
@@ -57,7 +57,10 @@ public interface CourseManagementManager{ | @@ -57,7 +57,10 @@ public interface CourseManagementManager{ | ||
57 | 57 | ||
58 | 58 | ||
59 | public List<PageData> listCourse(PageData pd)throws Exception; | 59 | public List<PageData> listCourse(PageData pd)throws Exception; |
60 | + | ||
61 | + | ||
60 | public List<PageData> listCourse(Page pd)throws Exception; | 62 | public List<PageData> listCourse(Page pd)throws Exception; |
63 | + public List<PageData> listTeacherClass(PageData pd)throws Exception; | ||
61 | 64 | ||
62 | } | 65 | } |
63 | 66 |
src/com/fh/service/sunvote/coursemanagement/impl/CourseManagementService.java
@@ -71,6 +71,12 @@ public class CourseManagementService implements CourseManagementManager{ | @@ -71,6 +71,12 @@ public class CourseManagementService implements CourseManagementManager{ | ||
71 | return (List<PageData>)dao.findForList("CourseManagementMapper.listCourselistPage", pd); | 71 | return (List<PageData>)dao.findForList("CourseManagementMapper.listCourselistPage", pd); |
72 | } | 72 | } |
73 | 73 | ||
74 | + | ||
75 | + @SuppressWarnings("unchecked") | ||
76 | + public List<PageData> listTeacherClass(PageData pd)throws Exception{ | ||
77 | + return (List<PageData>)dao.findForList("CourseManagementMapper.listTeacherClass", pd); | ||
78 | + } | ||
79 | + | ||
74 | /**通过id获取数据 | 80 | /**通过id获取数据 |
75 | * @param pd | 81 | * @param pd |
76 | * @throws Exception | 82 | * @throws Exception |
src/com/fh/service/sunvote/homework/HomeworkReportManager.java
0 → 100644
1 | +package com.fh.service.sunvote.homework; | ||
2 | + | ||
3 | +import java.util.List; | ||
4 | + | ||
5 | +import com.fh.entity.Page; | ||
6 | +import com.fh.util.PageData; | ||
7 | + | ||
8 | +/** | ||
9 | + * 说明: 作业接口 | ||
10 | + * 创建人:FH Q313596790 | ||
11 | + * 创建时间:2019-03-07 | ||
12 | + * @version | ||
13 | + */ | ||
14 | +public interface HomeworkReportManager{ | ||
15 | + | ||
16 | + /**新增 | ||
17 | + * @param pd | ||
18 | + * @throws Exception | ||
19 | + */ | ||
20 | + public void save(PageData pd)throws Exception; | ||
21 | + | ||
22 | + /**新增 | ||
23 | + * @param pd | ||
24 | + * @throws Exception | ||
25 | + */ | ||
26 | + public void batchSave(List<PageData> pd)throws Exception; | ||
27 | + | ||
28 | + /**删除 | ||
29 | + * @param pd | ||
30 | + * @throws Exception | ||
31 | + */ | ||
32 | + public void delete(PageData pd)throws Exception; | ||
33 | + | ||
34 | + /**修改 | ||
35 | + * @param pd | ||
36 | + * @throws Exception | ||
37 | + */ | ||
38 | + public void edit(PageData pd)throws Exception; | ||
39 | + | ||
40 | + /** | ||
41 | + * | ||
42 | + * @param pd | ||
43 | + * @throws Exception | ||
44 | + */ | ||
45 | + public void update(PageData pd)throws Exception; | ||
46 | + | ||
47 | + /**列表 | ||
48 | + * @param page | ||
49 | + * @throws Exception | ||
50 | + */ | ||
51 | + public List<PageData> list(Page page)throws Exception; | ||
52 | + | ||
53 | + /** | ||
54 | + * | ||
55 | + * @param pd | ||
56 | + * @return | ||
57 | + * @throws Exception | ||
58 | + */ | ||
59 | + public List<PageData> findByHomeworkID(PageData pd)throws Exception; | ||
60 | + | ||
61 | + /**列表(全部) | ||
62 | + * @param pd | ||
63 | + * @throws Exception | ||
64 | + */ | ||
65 | + public List<PageData> listAll(PageData pd)throws Exception; | ||
66 | + | ||
67 | + /**通过id获取数据 | ||
68 | + * @param pd | ||
69 | + * @throws Exception | ||
70 | + */ | ||
71 | + public PageData findById(PageData pd)throws Exception; | ||
72 | + | ||
73 | + /**批量删除 | ||
74 | + * @param ArrayDATA_IDS | ||
75 | + * @throws Exception | ||
76 | + */ | ||
77 | + public void deleteAll(String[] ArrayDATA_IDS)throws Exception; | ||
78 | + | ||
79 | +} | ||
80 | + |
src/com/fh/service/sunvote/homework/impl/HomeworkReportService.java
0 → 100644
1 | +package com.fh.service.sunvote.homework.impl; | ||
2 | + | ||
3 | +import java.util.List; | ||
4 | + | ||
5 | +import javax.annotation.Resource; | ||
6 | + | ||
7 | +import org.springframework.stereotype.Service; | ||
8 | + | ||
9 | +import com.fh.dao.DaoSupport; | ||
10 | +import com.fh.entity.Page; | ||
11 | +import com.fh.service.sunvote.homework.HomeworkReportManager; | ||
12 | +import com.fh.util.PageData; | ||
13 | + | ||
14 | +/** | ||
15 | + * 说明: 作业 | ||
16 | + * 创建人:FH Q313596790 | ||
17 | + * 创建时间:2019-03-07 | ||
18 | + * @version | ||
19 | + */ | ||
20 | +@Service("homeworkReporService") | ||
21 | +public class HomeworkReportService implements HomeworkReportManager{ | ||
22 | + | ||
23 | + @Resource(name = "daoSupport") | ||
24 | + private DaoSupport dao; | ||
25 | + | ||
26 | + /**新增 | ||
27 | + * @param pd | ||
28 | + * @throws Exception | ||
29 | + */ | ||
30 | + public void save(PageData pd)throws Exception{ | ||
31 | + dao.save("HomeworkReportMapper.save", pd); | ||
32 | + } | ||
33 | + | ||
34 | + /**删除 | ||
35 | + * @param pd | ||
36 | + * @throws Exception | ||
37 | + */ | ||
38 | + public void delete(PageData pd)throws Exception{ | ||
39 | + dao.delete("HomeworkReportMapper.delete", pd); | ||
40 | + } | ||
41 | + | ||
42 | + /**修改 | ||
43 | + * @param pd | ||
44 | + * @throws Exception | ||
45 | + */ | ||
46 | + public void edit(PageData pd)throws Exception{ | ||
47 | + dao.update("HomeworkReportMapper.edit", pd); | ||
48 | + } | ||
49 | + | ||
50 | + /**修改 | ||
51 | + * @param pd | ||
52 | + * @throws Exception | ||
53 | + */ | ||
54 | + public void update(PageData pd)throws Exception{ | ||
55 | + dao.update("HomeworkReportMapper.update", pd); | ||
56 | + } | ||
57 | + | ||
58 | + /**列表 | ||
59 | + * @param page | ||
60 | + * @throws Exception | ||
61 | + */ | ||
62 | + @SuppressWarnings("unchecked") | ||
63 | + public List<PageData> list(Page page)throws Exception{ | ||
64 | + return (List<PageData>)dao.findForList("HomeworkReportMapper.datalistPage", page); | ||
65 | + } | ||
66 | + | ||
67 | + /**列表(全部) | ||
68 | + * @param pd | ||
69 | + * @throws Exception | ||
70 | + */ | ||
71 | + @SuppressWarnings("unchecked") | ||
72 | + public List<PageData> listAll(PageData pd)throws Exception{ | ||
73 | + return (List<PageData>)dao.findForList("HomeworkReportMapper.listAll", pd); | ||
74 | + } | ||
75 | + | ||
76 | + /**列表(全部) | ||
77 | + * @param pd | ||
78 | + * @throws Exception | ||
79 | + */ | ||
80 | + @SuppressWarnings("unchecked") | ||
81 | + public List<PageData> findByHomeworkID(PageData pd)throws Exception{ | ||
82 | + return (List<PageData>)dao.findForList("HomeworkReportMapper.findByHomeworkID", pd); | ||
83 | + } | ||
84 | + | ||
85 | + /**通过id获取数据 | ||
86 | + * @param pd | ||
87 | + * @throws Exception | ||
88 | + */ | ||
89 | + public PageData findById(PageData pd)throws Exception{ | ||
90 | + return (PageData)dao.findForObject("HomeworkReportMapper.findById", pd); | ||
91 | + } | ||
92 | + | ||
93 | + /**批量删除 | ||
94 | + * @param ArrayDATA_IDS | ||
95 | + * @throws Exception | ||
96 | + */ | ||
97 | + public void deleteAll(String[] ArrayDATA_IDS)throws Exception{ | ||
98 | + dao.delete("HomeworkReportMapper.deleteAll", ArrayDATA_IDS); | ||
99 | + } | ||
100 | + | ||
101 | + @Override | ||
102 | + public void batchSave(List<PageData> pd) throws Exception { | ||
103 | + dao.save("HomeworkReportMapper.batchSave", pd); | ||
104 | + } | ||
105 | + | ||
106 | +} | ||
107 | + |
src/com/fh/service/sunvote/homework/impl/HomeworkService.java
@@ -68,7 +68,7 @@ public class HomeworkService implements HomeworkManager{ | @@ -68,7 +68,7 @@ public class HomeworkService implements HomeworkManager{ | ||
68 | */ | 68 | */ |
69 | @SuppressWarnings("unchecked") | 69 | @SuppressWarnings("unchecked") |
70 | public List<PageData> qlistAll(PageData pd)throws Exception{ | 70 | public List<PageData> qlistAll(PageData pd)throws Exception{ |
71 | - return (List<PageData>)dao.findForList("HomeworkMapper.listAll", pd); | 71 | + return (List<PageData>)dao.findForList("HomeworkMapper.qlistAll", pd); |
72 | } | 72 | } |
73 | 73 | ||
74 | /**通过id获取数据 | 74 | /**通过id获取数据 |
src/com/fh/service/sunvote/student/StudentManager.java
@@ -49,6 +49,8 @@ public interface StudentManager{ | @@ -49,6 +49,8 @@ public interface StudentManager{ | ||
49 | */ | 49 | */ |
50 | public List<PageData> listAll(PageData pd)throws Exception; | 50 | public List<PageData> listAll(PageData pd)throws Exception; |
51 | 51 | ||
52 | + public List<PageData> findByClassId(PageData pd)throws Exception; | ||
53 | + | ||
52 | /**通过id获取数据 | 54 | /**通过id获取数据 |
53 | * @param pd | 55 | * @param pd |
54 | * @throws Exception | 56 | * @throws Exception |
src/com/fh/service/sunvote/student/impl/StudentService.java
@@ -71,6 +71,11 @@ public class StudentService implements StudentManager{ | @@ -71,6 +71,11 @@ public class StudentService implements StudentManager{ | ||
71 | return (List<PageData>)dao.findForList("StudentMapper.listAll", pd); | 71 | return (List<PageData>)dao.findForList("StudentMapper.listAll", pd); |
72 | } | 72 | } |
73 | 73 | ||
74 | + @SuppressWarnings("unchecked") | ||
75 | + public List<PageData> findByClassId(PageData pd)throws Exception{ | ||
76 | + return (List<PageData>)dao.findForList("StudentMapper.findByClassId", pd); | ||
77 | + } | ||
78 | + | ||
74 | 79 | ||
75 | @SuppressWarnings("unchecked") | 80 | @SuppressWarnings("unchecked") |
76 | public List<PageData> listAllClass(PageData pd)throws Exception{ | 81 | public List<PageData> listAllClass(PageData pd)throws Exception{ |
src/com/fh/service/sunvote/term/TermManager.java
@@ -46,6 +46,11 @@ public interface TermManager{ | @@ -46,6 +46,11 @@ public interface TermManager{ | ||
46 | * @throws Exception | 46 | * @throws Exception |
47 | */ | 47 | */ |
48 | public PageData findById(PageData pd)throws Exception; | 48 | public PageData findById(PageData pd)throws Exception; |
49 | + /**通过id获取数据 | ||
50 | + * @param pd | ||
51 | + * @throws Exception | ||
52 | + */ | ||
53 | + public PageData findCurrentId()throws Exception; | ||
49 | 54 | ||
50 | /**批量删除 | 55 | /**批量删除 |
51 | * @param ArrayDATA_IDS | 56 | * @param ArrayDATA_IDS |
src/com/fh/service/sunvote/term/impl/TermService.java
1 | package com.fh.service.sunvote.term.impl; | 1 | package com.fh.service.sunvote.term.impl; |
2 | 2 | ||
3 | import java.util.List; | 3 | import java.util.List; |
4 | + | ||
4 | import javax.annotation.Resource; | 5 | import javax.annotation.Resource; |
6 | + | ||
5 | import org.springframework.stereotype.Service; | 7 | import org.springframework.stereotype.Service; |
8 | + | ||
6 | import com.fh.dao.DaoSupport; | 9 | import com.fh.dao.DaoSupport; |
7 | import com.fh.entity.Page; | 10 | import com.fh.entity.Page; |
8 | import com.fh.util.PageData; | 11 | import com.fh.util.PageData; |
@@ -69,6 +72,14 @@ public class TermService implements TermManager{ | @@ -69,6 +72,14 @@ public class TermService implements TermManager{ | ||
69 | return (PageData)dao.findForObject("TermMapper.findById", pd); | 72 | return (PageData)dao.findForObject("TermMapper.findById", pd); |
70 | } | 73 | } |
71 | 74 | ||
75 | + /**通过id获取数据 | ||
76 | + * @param pd | ||
77 | + * @throws Exception | ||
78 | + */ | ||
79 | + public PageData findCurrentId()throws Exception{ | ||
80 | + return (PageData)dao.findForObject("TermMapper.findCurrentId",null); | ||
81 | + } | ||
82 | + | ||
72 | /**批量删除 | 83 | /**批量删除 |
73 | * @param ArrayDATA_IDS | 84 | * @param ArrayDATA_IDS |
74 | * @throws Exception | 85 | * @throws Exception |
@@ -76,6 +87,6 @@ public class TermService implements TermManager{ | @@ -76,6 +87,6 @@ public class TermService implements TermManager{ | ||
76 | public void deleteAll(String[] ArrayDATA_IDS)throws Exception{ | 87 | public void deleteAll(String[] ArrayDATA_IDS)throws Exception{ |
77 | dao.delete("TermMapper.deleteAll", ArrayDATA_IDS); | 88 | dao.delete("TermMapper.deleteAll", ArrayDATA_IDS); |
78 | } | 89 | } |
79 | - | 90 | + |
80 | } | 91 | } |
81 | 92 |