5b03edef
孙向锦
更新协议
|
1
2
3
4
5
6
7
|
package com.fh.controller.sunvote;
import org.springframework.stereotype.Service;
import com.fh.service.sunvote.basestation.impl.BasestationService;
import com.fh.service.sunvote.classtype.impl.ClassTypeService;
import com.fh.service.sunvote.grade.impl.GradeService;
|
bed6e1fc
孙向锦
添加其他功能
|
8
|
import com.fh.service.sunvote.questiontype.QuestionTypeManager;
|
5b03edef
孙向锦
更新协议
|
9
10
|
import com.fh.service.sunvote.school.impl.SchoolService;
import com.fh.service.sunvote.sclass.impl.SClassService;
|
cea072ff
孙向锦
更新到服务器
|
11
|
import com.fh.service.sunvote.student.StudentManager;
|
5b03edef
孙向锦
更新协议
|
12
|
import com.fh.service.sunvote.subject.impl.SubjectService;
|
338594c8
孙向锦
添加教师端页面
|
13
|
import com.fh.service.sunvote.teacher.TeacherManager;
|
5b03edef
孙向锦
更新协议
|
14
15
|
import com.fh.service.sunvote.teacher.impl.TeacherService;
import com.fh.service.sunvote.teachingmaterial.impl.TeachingMaterialService;
|
cea072ff
孙向锦
更新到服务器
|
16
|
import com.fh.service.sunvote.term.TermManager;
|
5b03edef
孙向锦
更新协议
|
17
18
19
20
21
22
23
24
25
26
27
28
|
import com.fh.util.PageData;
import com.fh.util.SpringBeanFactoryUtils;
@Service
public class Myelfun {
/**
* 根据ID 获取学校名称
* @param type
* @return
* @throws Exception
*/
|
cea072ff
孙向锦
更新到服务器
|
29
|
public static String findSchoolName(String type) throws Exception{
|
5b03edef
孙向锦
更新协议
|
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
SchoolService schoolService = (SchoolService)SpringBeanFactoryUtils.getBean("schoolService");
PageData pageData = new PageData();
pageData.put("ID", type);
pageData = schoolService.findById(pageData);
if(pageData != null){
return pageData.getString("NAME");
}else{
return "" ;
}
}
/**
* 根据ID获取年级名称
* @param type
* @return
* @throws Exception
*/
|
cea072ff
孙向锦
更新到服务器
|
47
|
public static String findGradeName(String type) throws Exception{
|
5b03edef
孙向锦
更新协议
|
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
GradeService gradeService = (GradeService)SpringBeanFactoryUtils.getBean("gradeService");
PageData pageData = new PageData();
pageData.put("ID", type);
pageData = gradeService.findById(pageData);
if(pageData != null){
return pageData.getString("NAME");
}else{
return "" ;
}
}
/**
* 根据ID或者班级类型名称
* @param type
* @return
* @throws Exception
*/
|
cea072ff
孙向锦
更新到服务器
|
65
|
public static String findClassTypeName(String type) throws Exception{
|
5b03edef
孙向锦
更新协议
|
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
|
ClassTypeService classTypeService = (ClassTypeService)SpringBeanFactoryUtils.getBean("classtypeService");
PageData pageData = new PageData();
pageData.put("ID", type);
pageData = classTypeService.findById(pageData);
if(pageData != null){
return pageData.getString("NAME");
}else{
return "" ;
}
}
/**
* 根据ID,获取科目中文名称
* @param type
* @return
* @throws Exception
*/
|
cea072ff
孙向锦
更新到服务器
|
83
|
public static String findSubjectEName(String type) throws Exception{
|
5b03edef
孙向锦
更新协议
|
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
|
SubjectService subjectService = (SubjectService)SpringBeanFactoryUtils.getBean("subjectService");
PageData pageData = new PageData();
pageData.put("ID", type);
pageData = subjectService.findById(pageData);
if(pageData != null){
return pageData.getString("ENAME");
}else{
return "" ;
}
}
/**
* 根据ID或者科目英文名称
* @param type
* @return
* @throws Exception
*/
|
cea072ff
孙向锦
更新到服务器
|
101
|
public static String findSubjectCName(String type) throws Exception{
|
5b03edef
孙向锦
更新协议
|
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
|
SubjectService subjectService = (SubjectService)SpringBeanFactoryUtils.getBean("subjectService");
PageData pageData = new PageData();
pageData.put("ID", type);
pageData = subjectService.findById(pageData);
if(pageData != null){
return pageData.getString("CNAME");
}else{
return "" ;
}
}
/**
* 根据ID查找基站名称
* @param type
* @return
* @throws Exception
*/
|
cea072ff
孙向锦
更新到服务器
|
119
|
public static String findBasestationName(String type) throws Exception{
|
5b03edef
孙向锦
更新协议
|
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
|
BasestationService basestationService = (BasestationService)SpringBeanFactoryUtils.getBean("basestationService");
PageData pageData = new PageData();
pageData.put("ID", type);
pageData = basestationService.findById(pageData);
if(pageData != null){
return pageData.getString("NAME");
}else{
return "" ;
}
}
/**
* 根据ID 老师姓名
* @param id
* @return
* @throws Exception
*/
|
cea072ff
孙向锦
更新到服务器
|
137
|
public static String findTeacherName(String id) throws Exception {
|
5b03edef
孙向锦
更新协议
|
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
|
TeacherService teacherService = (TeacherService)SpringBeanFactoryUtils.getBean("teacherService");
PageData pageData = new PageData();
pageData.put("ID", id);
pageData = teacherService.findById(pageData);
if(pageData != null){
return pageData.getString("NAME");
}else{
return "" ;
}
}
/**
* 根据ID班级名称
* @param id
* @return
* @throws Exception
*/
|
cea072ff
孙向锦
更新到服务器
|
155
|
public static String findClassName(String id) throws Exception {
|
5b03edef
孙向锦
更新协议
|
156
157
158
159
160
161
162
163
164
165
166
167
|
SClassService sclassService = (SClassService)SpringBeanFactoryUtils.getBean("sclassService");
PageData pageData = new PageData();
pageData.put("ID", id);
pageData = sclassService.findById(pageData);
if(pageData != null){
return pageData.getString("CLASS_NAME");
}else{
return "" ;
}
}
/**
|
cea072ff
孙向锦
更新到服务器
|
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
|
* 根据ID学生
* @param id
* @return
* @throws Exception
*/
public static String findStudentName(String id) throws Exception {
StudentManager studentService = (StudentManager)SpringBeanFactoryUtils.getBean("studentService");
PageData pageData = new PageData();
pageData.put("ID", id);
pageData = studentService.findById(pageData);
if(pageData != null){
return pageData.getString("NAME");
}else{
return "" ;
}
}
/**
* 根据学期名称
* @param id
* @return
* @throws Exception
*/
public static String findTermName(String id) throws Exception {
TermManager termService = (TermManager)SpringBeanFactoryUtils.getBean("termService");
PageData pageData = new PageData();
pageData.put("TERM_ID", id);
pageData = termService.findById(pageData);
if(pageData != null){
return pageData.getString("NAME");
}else{
return "" ;
}
}
/**
|
5b03edef
孙向锦
更新协议
|
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
|
* 根据ID班级名称
* @param id
* @return
* @throws Exception
*/
public static String findTeachingmaterialName(int id) throws Exception {
TeachingMaterialService teachingmaterialService = (TeachingMaterialService)SpringBeanFactoryUtils.getBean("teachingmaterialService");
PageData pageData = new PageData();
pageData.put("ID", id);
pageData = teachingmaterialService.findById(pageData);
if(pageData != null){
return pageData.getString("NAME");
}else{
return "" ;
}
}
|
bed6e1fc
孙向锦
添加其他功能
|
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
|
/**
* 根据ID查找题目类型
* @param id
* @return
* @throws Exception
*/
public static String findQuestionTypeName(int id) throws Exception {
QuestionTypeManager questiontypeService = (QuestionTypeManager)SpringBeanFactoryUtils.getBean("questiontypeService");
PageData pageData = new PageData();
pageData.put("QUESTIONTYPE_ID", id);
pageData = questiontypeService.findById(pageData);
if(pageData != null){
return pageData.getString("NAME");
}else{
return "" ;
}
}
|
338594c8
孙向锦
添加教师端页面
|
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
|
public static String getUserID(String user_id){
TeacherManager teacherService = (TeacherManager)SpringBeanFactoryUtils.getBean("teacherService");
PageData pd = new PageData();
pd.put("ID", user_id);
try {
pd = teacherService.findById(pd);
} catch (Exception e) {
e.printStackTrace();
}
if(pd != null){
return pd.getString("SCHOOL_ID");
}else{
return "" ;
}
}
|
5b03edef
孙向锦
更新协议
|
255
|
}
|