Blame view

src/com/fh/controller/sunvote/paper/PaperController.java 49.3 KB
bed6e1fc   孙向锦   添加其他功能
1
2
3
4
  package com.fh.controller.sunvote.paper;
  
  import java.io.PrintWriter;
  import java.text.DateFormat;
f4a73594   jack   1.增加班级统计报表和导出
5
  import java.text.DecimalFormat;
bed6e1fc   孙向锦   添加其他功能
6
7
  import java.text.SimpleDateFormat;
  import java.util.ArrayList;
f4a73594   jack   1.增加班级统计报表和导出
8
9
10
  import java.util.Arrays;
  import java.util.Collections;
  import java.util.Comparator;
bed6e1fc   孙向锦   添加其他功能
11
12
13
14
  import java.util.Date;
  import java.util.HashMap;
  import java.util.List;
  import java.util.Map;
338594c8   孙向锦   添加教师端页面
15
  
bed6e1fc   孙向锦   添加其他功能
16
  import javax.annotation.Resource;
338594c8   孙向锦   添加教师端页面
17
18
  
  import org.apache.shiro.session.Session;
bed6e1fc   孙向锦   添加其他功能
19
20
21
22
23
24
25
  import org.springframework.beans.propertyeditors.CustomDateEditor;
  import org.springframework.stereotype.Controller;
  import org.springframework.web.bind.WebDataBinder;
  import org.springframework.web.bind.annotation.InitBinder;
  import org.springframework.web.bind.annotation.RequestMapping;
  import org.springframework.web.bind.annotation.ResponseBody;
  import org.springframework.web.servlet.ModelAndView;
338594c8   孙向锦   添加教师端页面
26
  
f4a73594   jack   1.增加班级统计报表和导出
27
  import com.alibaba.druid.support.json.JSONUtils;
338594c8   孙向锦   添加教师端页面
28
29
  import com.fh.bean.Paper;
  import com.fh.bean.Question;
f4a73594   jack   1.增加班级统计报表和导出
30
  import com.fh.controller.api.ResponseGson;
bed6e1fc   孙向锦   添加其他功能
31
  import com.fh.controller.base.BaseController;
f4a73594   jack   1.增加班级统计报表和导出
32
  import com.fh.controller.sunvote.Myelfun;
bed6e1fc   孙向锦   添加其他功能
33
  import com.fh.entity.Page;
338594c8   孙向锦   添加教师端页面
34
  import com.fh.entity.system.User;
4f32cbf7   孙向锦   更新新东方服务界面维护文档
35
  import com.fh.service.api.V1Manager;
83b5ddeb   孙向锦   模板添加
36
  import com.fh.service.sunvote.pagetemplate.PageTemplateManager;
4f32cbf7   孙向锦   更新新东方服务界面维护文档
37
38
  import com.fh.service.sunvote.paper.PaperManager;
  import com.fh.service.sunvote.paperquestion.PaperQuestionManager;
107fa3a0   孙向锦   修改试卷单选多远混合出题
39
  import com.fh.service.sunvote.question.QuestionManager;
837ae11d   孙向锦   添加班長管理
40
  import com.fh.service.sunvote.schoolgradesubject.SchoolGradeSubjectManager;
f4a73594   jack   1.增加班级统计报表和导出
41
42
43
44
45
46
  import com.fh.service.sunvote.sclass.SClassManager;
  import com.fh.service.sunvote.sclass.impl.SClassService;
  import com.fh.service.sunvote.student.StudentManager;
  import com.fh.service.sunvote.studenttest.StudentTestManager;
  import com.fh.service.sunvote.testpaper.TestPaperManager;
  import com.fh.service.sunvote.testpaperinfo.TestPaperInfoManager;
bed6e1fc   孙向锦   添加其他功能
47
  import com.fh.util.AppUtil;
338594c8   孙向锦   添加教师端页面
48
  import com.fh.util.Const;
4f32cbf7   孙向锦   更新新东方服务界面维护文档
49
  import com.fh.util.Jurisdiction;
bed6e1fc   孙向锦   添加其他功能
50
  import com.fh.util.ObjectExcelView;
89ac0783   jack   1.添加年级卷分析功能
51
  import com.fh.util.ObjectExcelView2;
bed6e1fc   孙向锦   添加其他功能
52
  import com.fh.util.PageData;
bed6e1fc   孙向锦   添加其他功能
53
  
782f81b0   jack   1.增加未知学生的判断
54
55
  /**
   * 说明:试卷 创建时间:2018-05-17
bed6e1fc   孙向锦   添加其他功能
56
57
   */
  @Controller
782f81b0   jack   1.增加未知学生的判断
58
  @RequestMapping(value = "/paper")
bed6e1fc   孙向锦   添加其他功能
59
  public class PaperController extends BaseController {
782f81b0   jack   1.增加未知学生的判断
60
61
62
  
  	String menuUrl = "paper/list.do"; // 菜单地址(权限用)
  	@Resource(name = "paperService")
bed6e1fc   孙向锦   添加其他功能
63
  	private PaperManager paperService;
782f81b0   jack   1.增加未知学生的判断
64
65
  
  	@Resource(name = "testpaperService")
f4a73594   jack   1.增加班级统计报表和导出
66
  	private TestPaperManager testpaperService;
782f81b0   jack   1.增加未知学生的判断
67
68
  
  	@Resource(name = "testpaperinfoService")
f4a73594   jack   1.增加班级统计报表和导出
69
  	private TestPaperInfoManager testpaperinfoService;
782f81b0   jack   1.增加未知学生的判断
70
71
  
  	@Resource(name = "studentService")
f4a73594   jack   1.增加班级统计报表和导出
72
  	private StudentManager stundentService;
782f81b0   jack   1.增加未知学生的判断
73
74
  
  	@Resource(name = "paperquestionService")
338594c8   孙向锦   添加教师端页面
75
  	private PaperQuestionManager paperquestionService;
782f81b0   jack   1.增加未知学生的判断
76
77
  
  	@Resource(name = "questionService")
107fa3a0   孙向锦   修改试卷单选多远混合出题
78
  	private QuestionManager questionService;
782f81b0   jack   1.增加未知学生的判断
79
  
338594c8   孙向锦   添加教师端页面
80
  	@Resource(name = "v1Service")
782f81b0   jack   1.增加未知学生的判断
81
82
83
  	private V1Manager v1Service;
  
  	@Resource(name = "schoolgradesubjectService")
837ae11d   孙向锦   添加班長管理
84
  	private SchoolGradeSubjectManager schoolgradesubjectService;
782f81b0   jack   1.增加未知学生的判断
85
86
  
  	@Resource(name = "pagetemplateService")
83b5ddeb   孙向锦   模板添加
87
  	private PageTemplateManager pagetemplateService;
782f81b0   jack   1.增加未知学生的判断
88
89
  
  	@Resource(name = "studenttestService")
f4a73594   jack   1.增加班级统计报表和导出
90
  	private StudentTestManager studenttestService;
782f81b0   jack   1.增加未知学生的判断
91
92
  
  	@Resource(name = "sclassService")
f4a73594   jack   1.增加班级统计报表和导出
93
  	private SClassManager sclassService;
782f81b0   jack   1.增加未知学生的判断
94
95
96
97
  
  	/**
  	 * 保存
  	 * 
bed6e1fc   孙向锦   添加其他功能
98
99
100
  	 * @param
  	 * @throws Exception
  	 */
782f81b0   jack   1.增加未知学生的判断
101
102
103
104
105
106
  	@RequestMapping(value = "/save")
  	public ModelAndView save() throws Exception {
  		logBefore(logger, Jurisdiction.getUsername() + "新增Paper");
  		if (!Jurisdiction.buttonJurisdiction(menuUrl, "add")) {
  			return null;
  		} // 校验权限
bed6e1fc   孙向锦   添加其他功能
107
108
109
  		ModelAndView mv = this.getModelAndView();
  		PageData pd = new PageData();
  		pd = this.getPageData();
782f81b0   jack   1.增加未知学生的判断
110
  		pd.put("PAPER_ID", this.get32UUID()); // 主键
bed6e1fc   孙向锦   添加其他功能
111
  		paperService.save(pd);
782f81b0   jack   1.增加未知学生的判断
112
  		mv.addObject("msg", "success");
bed6e1fc   孙向锦   添加其他功能
113
114
115
  		mv.setViewName("save_result");
  		return mv;
  	}
782f81b0   jack   1.增加未知学生的判断
116
117
118
119
  
  	/**
  	 * 保存
  	 * 
338594c8   孙向锦   添加教师端页面
120
121
122
  	 * @param
  	 * @throws Exception
  	 */
782f81b0   jack   1.增加未知学生的判断
123
124
125
  	@RequestMapping(value = "/newpaper")
  	public ModelAndView newPaper() throws Exception {
  		logBefore(logger, Jurisdiction.getUsername() + "新增Paper");
338594c8   孙向锦   添加教师端页面
126
  		ModelAndView mv = this.getModelAndView();
782f81b0   jack   1.增加未知学生的判断
127
128
  
  		mv.addObject("msg", "success");
338594c8   孙向锦   添加教师端页面
129
130
131
  		mv.setViewName("save_result");
  		return mv;
  	}
782f81b0   jack   1.增加未知学生的判断
132
133
134
135
  
  	/**
  	 * 删除
  	 * 
bed6e1fc   孙向锦   添加其他功能
136
137
138
  	 * @param out
  	 * @throws Exception
  	 */
782f81b0   jack   1.增加未知学生的判断
139
140
141
  	@RequestMapping(value = "/delete")
  	public void delete(PrintWriter out) throws Exception {
  		logBefore(logger, Jurisdiction.getUsername() + "删除Paper");
bed6e1fc   孙向锦   添加其他功能
142
143
  		PageData pd = new PageData();
  		pd = this.getPageData();
782f81b0   jack   1.增加未知学生的判断
144
145
  		String[] ArrayDATA_IDS = new String[] { pd.getString("PAPER_ID") };
  		if (pd.getString("QINGSONGKAO") != null) {
107fa3a0   孙向锦   修改试卷单选多远混合出题
146
147
  			List<PageData> list = paperquestionService.listAll(pd);
  			String[] qids = new String[list.size()];
782f81b0   jack   1.增加未知学生的判断
148
149
  			int i = 0;
  			for (PageData ptd : list) {
107fa3a0   孙向锦   修改试卷单选多远混合出题
150
151
  				qids[i++] = ptd.getString("QUESTION_ID");
  			}
782f81b0   jack   1.增加未知学生的判断
152
  			if (qids.length > 0) {
107fa3a0   孙向锦   修改试卷单选多远混合出题
153
154
155
  				questionService.deleteAll(qids);
  			}
  		}
338594c8   孙向锦   添加教师端页面
156
  		paperquestionService.deleteAllPaper(ArrayDATA_IDS);
bed6e1fc   孙向锦   添加其他功能
157
158
159
160
  		paperService.delete(pd);
  		out.write("success");
  		out.close();
  	}
782f81b0   jack   1.增加未知学生的判断
161
162
163
164
  
  	/**
  	 * 修改
  	 * 
bed6e1fc   孙向锦   添加其他功能
165
166
167
  	 * @param
  	 * @throws Exception
  	 */
782f81b0   jack   1.增加未知学生的判断
168
169
170
171
172
173
  	@RequestMapping(value = "/edit")
  	public ModelAndView edit() throws Exception {
  		logBefore(logger, Jurisdiction.getUsername() + "修改Paper");
  		if (!Jurisdiction.buttonJurisdiction(menuUrl, "edit")) {
  			return null;
  		} // 校验权限
bed6e1fc   孙向锦   添加其他功能
174
175
176
177
  		ModelAndView mv = this.getModelAndView();
  		PageData pd = new PageData();
  		pd = this.getPageData();
  		paperService.edit(pd);
782f81b0   jack   1.增加未知学生的判断
178
  		mv.addObject("msg", "success");
bed6e1fc   孙向锦   添加其他功能
179
180
181
  		mv.setViewName("save_result");
  		return mv;
  	}
782f81b0   jack   1.增加未知学生的判断
182
183
184
185
  
  	/**
  	 * 列表
  	 * 
bed6e1fc   孙向锦   添加其他功能
186
187
188
  	 * @param page
  	 * @throws Exception
  	 */
782f81b0   jack   1.增加未知学生的判断
189
190
191
192
193
  	@RequestMapping(value = "/list")
  	public ModelAndView list(Page page) throws Exception {
  		logBefore(logger, Jurisdiction.getUsername() + "列表Paper");
  		// if(!Jurisdiction.buttonJurisdiction(menuUrl, "cha")){return null;}
  		// //校验权限(无权查看时页面会有提示,如果不注释掉这句代码就无法进入列表页面,所以根据情况是否加入本句代码)
bed6e1fc   孙向锦   添加其他功能
194
195
196
  		ModelAndView mv = this.getModelAndView();
  		PageData pd = new PageData();
  		pd = this.getPageData();
782f81b0   jack   1.增加未知学生的判断
197
198
  		String keywords = pd.getString("keywords"); // 关键词检索条件
  		if (null != keywords && !"".equals(keywords)) {
bed6e1fc   孙向锦   添加其他功能
199
200
201
  			pd.put("keywords", keywords.trim());
  		}
  		page.setPd(pd);
782f81b0   jack   1.增加未知学生的判断
202
  		List<PageData> varList = paperService.list(page); // 列出Paper列表
bed6e1fc   孙向锦   添加其他功能
203
204
205
  		mv.setViewName("sunvote/paper/paper_list");
  		mv.addObject("varList", varList);
  		mv.addObject("pd", pd);
782f81b0   jack   1.增加未知学生的判断
206
  		mv.addObject("QX", Jurisdiction.getHC()); // 按钮权限
bed6e1fc   孙向锦   添加其他功能
207
208
  		return mv;
  	}
782f81b0   jack   1.增加未知学生的判断
209
210
211
  
  	@RequestMapping(value = "/paperRep")
  	public ModelAndView paperRep() throws Exception {
f4a73594   jack   1.增加班级统计报表和导出
212
213
214
215
  		ModelAndView mv = this.getModelAndView();
  		PageData pd = new PageData();
  		List<PageData> templist = new ArrayList<PageData>();
  		PageData saveData = new PageData();
782f81b0   jack   1.增加未知学生的判断
216
  		DecimalFormat decimalFormat = new DecimalFormat("0.00");
4926e3fd   jack   1.修复bug
217
  		String total_score = "";
f4a73594   jack   1.增加班级统计报表和导出
218
219
  		ResponseGson<PageData> res = new ResponseGson();
  		pd = this.getPageData();
782f81b0   jack   1.增加未知学生的判断
220
  		if (pd.containsKey("PAPER_ID")) {
f4a73594   jack   1.增加班级统计报表和导出
221
  			List<PageData> list = testpaperService.listAll(pd);
4926e3fd   jack   1.修复bug
222
  			total_score = list.get(0).getString("TOTAL_SCORE");
f4a73594   jack   1.增加班级统计报表和导出
223
  			pd.put("testpaperlist", list);
782f81b0   jack   1.增加未知学生的判断
224
225
226
227
228
229
  			Integer you_sum = 0; // 优秀总人数
  			Integer liang_sum = 0; // 良好总人数
  			Integer jige_sum = 0; // 及格总人数
  			Integer difen_sum = 0; // 低分总人数
  			Integer num_sum = 0; // 年级总人数
  			Float avg_sum = (float) 0; // 平均分的和
d6389252   jack   1.增加年级卷测验统计
230
  			String testpaperList = "";
782f81b0   jack   1.增加未知学生的判断
231
232
  
  			for (int i = 0; i < list.size(); i++) {
f4a73594   jack   1.增加班级统计报表和导出
233
  				PageData data = new PageData();
782f81b0   jack   1.增加未知学生的判断
234
  
f4a73594   jack   1.增加班级统计报表和导出
235
  				PageData pdtemp = new PageData();
782f81b0   jack   1.增加未知学生的判断
236
237
238
239
240
241
242
243
244
245
246
247
  				if (!list.get(i).getString("SCLASS_ID").isEmpty()) {
  					pdtemp.put("CLASS_ID", list.get(i).get("SCLASS_ID")
  							.toString());
  				} else {
  					pdtemp.put("CLASS_ID", "");
  
  				}
  
  				List<PageData> studentlist = stundentService
  						.listAllClass(pdtemp);
  				testpaperList += list.get(i).get("TESTPAPER_ID").toString()
  						+ ",";
f4a73594   jack   1.增加班级统计报表和导出
248
249
250
251
252
253
254
  				data.put("testpaper_id", list.get(i).get("TESTPAPER_ID"));
  				data.put("student_num", studentlist.size());
  				data.put("creat_time", list.get(i).get("CREATE_DATE"));
  				data.put("avg_score", list.get(i).get("AVG_SCORE"));
  				data.put("class_id", list.get(i).get("SCLASS_ID"));
  				pdtemp.put("TEST_ID", list.get(i).get("TESTPAPER_ID"));
  				List<PageData> l = studenttestService.listAll(pdtemp);
782f81b0   jack   1.增加未知学生的判断
255
  
f4a73594   jack   1.增加班级统计报表和导出
256
257
258
259
  				Integer you = 0;
  				Integer liang = 0;
  				Integer jige = 0;
  				Integer difen = 0;
dec964f0   jack   1.修复bug
260
261
  				Float total = list.get(i).get("TOTAL_SCORE")
  						.toString().isEmpty()?0:Float.valueOf(list.get(i).get("TOTAL_SCORE")
782f81b0   jack   1.增加未知学生的判断
262
263
264
265
266
267
268
  						.toString());
  
  				for (int j = 0; j < l.size(); j++) {
  					Float score = Float.valueOf(l.get(j).get("SCORE")
  							.toString());
  					if (total != 0) {
  						if (score / total >= 0.8) {
f4a73594   jack   1.增加班级统计报表和导出
269
  							you++;
782f81b0   jack   1.增加未知学生的判断
270
  						} else if (score / total >= 0.7) {
f4a73594   jack   1.增加班级统计报表和导出
271
  							liang++;
782f81b0   jack   1.增加未知学生的判断
272
  						} else if (score / total >= 0.6) {
f4a73594   jack   1.增加班级统计报表和导出
273
  							jige++;
782f81b0   jack   1.增加未知学生的判断
274
  						} else if (score / total < 0.3) {
f4a73594   jack   1.增加班级统计报表和导出
275
276
277
  							difen++;
  						}
  					}
782f81b0   jack   1.增加未知学生的判断
278
  
f4a73594   jack   1.增加班级统计报表和导出
279
  				}
782f81b0   jack   1.增加未知学生的判断
280
  				you_sum += you;
d6389252   jack   1.增加年级卷测验统计
281
  				liang_sum += liang;
782f81b0   jack   1.增加未知学生的判断
282
283
284
  				jige_sum += jige;
  				difen_sum += difen;
  				num_sum += studentlist.size();
dec964f0   jack   1.修复bug
285
286
  				avg_sum += list.get(i).get("AVG_SCORE")
  						.toString().isEmpty()?0:Float.valueOf(list.get(i).get("AVG_SCORE")
782f81b0   jack   1.增加未知学生的判断
287
288
289
290
291
292
293
  						.toString());
  
  				data.put("you", you);
  				data.put("liang", liang);
  				data.put("jige", jige);
  				data.put("difen", difen);
  
f4a73594   jack   1.增加班级统计报表和导出
294
295
  				templist.add(data);
  			}
782f81b0   jack   1.增加未知学生的判断
296
297
298
299
300
301
302
303
304
305
306
307
308
309
  			if (list.size() > 0) {
  				PageData dataTemp = new PageData();
  				dataTemp.put("testpaper_id", "");
  				dataTemp.put("student_num", num_sum);
  				dataTemp.put("creat_time", "");
  				dataTemp.put("avg_score",
  						decimalFormat.format(avg_sum / list.size()));
  				dataTemp.put("class_id", "");
  				dataTemp.put("you", you_sum);
  				dataTemp.put("liang", liang_sum);
  				dataTemp.put("jige", jige_sum);
  				dataTemp.put("difen", difen_sum);
  				dataTemp.put("testpaperList", testpaperList);
  				templist.add(dataTemp);
d6389252   jack   1.增加年级卷测验统计
310
  			}
f4a73594   jack   1.增加班级统计报表和导出
311
  		}
782f81b0   jack   1.增加未知学生的判断
312
  
f4a73594   jack   1.增加班级统计报表和导出
313
  		saveData.put("list", templist);
4926e3fd   jack   1.修复bug
314
  		pd.put("TOTAL_SCORE", total_score);
f4a73594   jack   1.增加班级统计报表和导出
315
316
  		mv.setViewName("sunvote/paper/test_list1");
  		mv.addObject("varList", templist);
782f81b0   jack   1.增加未知学生的判断
317
  		mv.addObject("pd", pd);
f4a73594   jack   1.增加班级统计报表和导出
318
319
320
  		res.setData(saveData);
  		return mv;
  	}
782f81b0   jack   1.增加未知学生的判断
321
322
323
  
  	@RequestMapping(value = "/export1")
  	public ModelAndView export1() throws Exception {
f4a73594   jack   1.增加班级统计报表和导出
324
325
326
327
  		ModelAndView mv = this.getModelAndView();
  		PageData pd = new PageData();
  		List<PageData> templist = new ArrayList<PageData>();
  		PageData saveData = new PageData();
782f81b0   jack   1.增加未知学生的判断
328
  
f4a73594   jack   1.增加班级统计报表和导出
329
330
  		ResponseGson<PageData> res = new ResponseGson();
  		pd = this.getPageData();
782f81b0   jack   1.增加未知学生的判断
331
  		if (pd.containsKey("PAPER_ID")) {
f4a73594   jack   1.增加班级统计报表和导出
332
  			List<PageData> list = testpaperService.listAll(pd);
782f81b0   jack   1.增加未知学生的判断
333
  
f4a73594   jack   1.增加班级统计报表和导出
334
  			pd.put("testpaperlist", list);
782f81b0   jack   1.增加未知学生的判断
335
  			for (int i = 0; i < list.size(); i++) {
f4a73594   jack   1.增加班级统计报表和导出
336
  				PageData data = new PageData();
782f81b0   jack   1.增加未知学生的判断
337
  
f4a73594   jack   1.增加班级统计报表和导出
338
339
  				PageData pdtemp = new PageData();
  				pdtemp.put("CLASS_ID", list.get(i).get("SCLASS_ID").toString());
782f81b0   jack   1.增加未知学生的判断
340
341
  				List<PageData> studentlist = stundentService
  						.listAllClass(pdtemp);
f4a73594   jack   1.增加班级统计报表和导出
342
343
344
345
346
347
348
  				data.put("testpaper_id", list.get(i).get("TESTPAPER_ID"));
  				data.put("student_num", studentlist.size());
  				data.put("creat_time", list.get(i).get("CREATE_DATE"));
  				data.put("avg_score", list.get(i).get("AVG_SCORE"));
  				data.put("class_id", list.get(i).get("SCLASS_ID"));
  				pdtemp.put("TEST_ID", list.get(i).get("TESTPAPER_ID"));
  				List<PageData> l = studenttestService.listAll(pdtemp);
782f81b0   jack   1.增加未知学生的判断
349
  
f4a73594   jack   1.增加班级统计报表和导出
350
351
352
353
  				Integer you = 0;
  				Integer liang = 0;
  				Integer jige = 0;
  				Integer difen = 0;
782f81b0   jack   1.增加未知学生的判断
354
355
356
357
358
359
360
361
  				Float total = Float.valueOf(list.get(i).get("TOTAL_SCORE")
  						.toString());
  
  				for (int j = 0; j < l.size(); j++) {
  					Float score = Float.valueOf(l.get(j).get("SCORE")
  							.toString());
  					if (total != 0) {
  						if (score / total >= 0.8) {
f4a73594   jack   1.增加班级统计报表和导出
362
  							you++;
782f81b0   jack   1.增加未知学生的判断
363
  						} else if (score / total >= 0.7) {
f4a73594   jack   1.增加班级统计报表和导出
364
  							liang++;
782f81b0   jack   1.增加未知学生的判断
365
  						} else if (score / total >= 0.6) {
f4a73594   jack   1.增加班级统计报表和导出
366
  							jige++;
782f81b0   jack   1.增加未知学生的判断
367
  						} else if (score / total < 0.3) {
f4a73594   jack   1.增加班级统计报表和导出
368
369
370
  							difen++;
  						}
  					}
782f81b0   jack   1.增加未知学生的判断
371
  
f4a73594   jack   1.增加班级统计报表和导出
372
  				}
782f81b0   jack   1.增加未知学生的判断
373
374
375
376
377
378
  
  				data.put("you", you);
  				data.put("liang", liang);
  				data.put("jige", jige);
  				data.put("difen", difen);
  
f4a73594   jack   1.增加班级统计报表和导出
379
380
381
382
  				templist.add(data);
  			}
  		}
  
782f81b0   jack   1.增加未知学生的判断
383
  		Map<String, Object> dataMap = new HashMap<String, Object>();
f4a73594   jack   1.增加班级统计报表和导出
384
  		List<String> titles = new ArrayList<String>();
782f81b0   jack   1.增加未知学生的判断
385
386
387
388
389
390
391
392
393
394
395
396
397
  		titles.add("序号"); // 1
  		titles.add("班级名称"); // 2
  		titles.add("考试时间"); // 3
  		titles.add("平均分"); // 4
  		titles.add("班级总人数"); // 5
  		titles.add("优秀人数"); // 6
  		titles.add("优秀率"); // 7
  		titles.add("良好人数"); // 8
  		titles.add("良好率"); // 9
  		titles.add("及格人数"); // 10
  		titles.add("及格率"); // 11
  		titles.add("低分人数"); // 12
  		titles.add("低分率"); // 13
f4a73594   jack   1.增加班级统计报表和导出
398
399
400
  		dataMap.put("titles", titles);
  		List<PageData> varOList = templist;
  		List<PageData> varList = new ArrayList<PageData>();
782f81b0   jack   1.增加未知学生的判断
401
402
  		DecimalFormat decimalFormat = new DecimalFormat("0.00");
  		for (int i = 0; i < varOList.size(); i++) {
f4a73594   jack   1.增加班级统计报表和导出
403
404
405
406
  			PageData vpd = new PageData();
  			vpd.put("ID", varOList.get(i).getString("class_id"));
  			PageData c = sclassService.findById(vpd);
  			vpd.remove("ID");
782f81b0   jack   1.增加未知学生的判断
407
  
f4a73594   jack   1.增加班级统计报表和导出
408
409
410
411
  			Integer you = Integer.valueOf(varOList.get(i).getString("you"));
  			Integer liang = Integer.valueOf(varOList.get(i).getString("liang"));
  			Integer jige = Integer.valueOf(varOList.get(i).getString("jige"));
  			Integer difen = Integer.valueOf(varOList.get(i).getString("difen"));
782f81b0   jack   1.增加未知学生的判断
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
  			Integer student_num = Integer.valueOf(varOList.get(i).getString(
  					"student_num"));
  
  			vpd.put("var1", i + 1); // 1
  			vpd.put("var2", c.getString("CLASS_NAME")); // 2
  			vpd.put("var3", varOList.get(i).getString("creat_time")); // 3
  			vpd.put("var4", varOList.get(i).getString("avg_score")); // 4
  			vpd.put("var5", student_num); // 5
  			vpd.put("var6", you); // 6
  			vpd.put("var7",
  					student_num == 0 ? 0 : decimalFormat.format(you * 100.0
  							/ student_num)
  							+ "%"); // 7
  			vpd.put("var8", liang); // 8
  			vpd.put("var9",
  					student_num == 0 ? 0 : decimalFormat.format(liang * 100.0
  							/ student_num)
  							+ "%"); // 9
  			vpd.put("var10", jige); // 10
  			vpd.put("var11",
  					student_num == 0 ? 0 : decimalFormat.format(jige * 100.0
  							/ student_num)
  							+ "%"); // 11
  			vpd.put("var12", difen); // 12
  			vpd.put("var13",
  					student_num == 0 ? 0 : decimalFormat.format(difen * 100.0
  							/ student_num)
  							+ "%"); // 13
f4a73594   jack   1.增加班级统计报表和导出
440
441
442
443
  			varList.add(vpd);
  		}
  		dataMap.put("varList", varList);
  		ObjectExcelView erv = new ObjectExcelView();
782f81b0   jack   1.增加未知学生的判断
444
  		mv = new ModelAndView(erv, dataMap);
f4a73594   jack   1.增加班级统计报表和导出
445
446
  		return mv;
  	}
782f81b0   jack   1.增加未知学生的判断
447
448
449
  
  	@RequestMapping(value = "/paperRep2")
  	public ModelAndView paperRep2() throws Exception {
f4a73594   jack   1.增加班级统计报表和导出
450
451
452
453
  		ModelAndView mv = this.getModelAndView();
  		PageData pd = new PageData();
  		List<PageData> templist = new ArrayList<PageData>();
  		PageData saveData = new PageData();
782f81b0   jack   1.增加未知学生的判断
454
  
f4a73594   jack   1.增加班级统计报表和导出
455
456
  		ResponseGson<PageData> res = new ResponseGson();
  		pd = this.getPageData();
782f81b0   jack   1.增加未知学生的判断
457
  		if (pd.containsKey("PAPER_ID")) {
f4a73594   jack   1.增加班级统计报表和导出
458
459
460
  			List<PageData> list = paperquestionService.listAll(pd);
  			List<PageData> test = new ArrayList<PageData>();
  			int onum[] = new int[list.size()];
782f81b0   jack   1.增加未知学生的判断
461
462
  
  			for (int i = 0; i < list.size(); i++) {
f4a73594   jack   1.增加班级统计报表和导出
463
464
  				PageData temp = new PageData();
  				String questionid = list.get(i).get("QUESTION_ID").toString();
782f81b0   jack   1.增加未知学生的判断
465
466
467
  
  				if (list.get(i).get("NO_NAME") == null
  						|| list.get(i).get("NO_NAME").toString().isEmpty()) {
f4a73594   jack   1.增加班级统计报表和导出
468
469
  					continue;
  				}
782f81b0   jack   1.增加未知学生的判断
470
471
  				Float que_score = Float.valueOf(list.get(i).get("SCORE")
  						.toString());
f4a73594   jack   1.增加班级统计报表和导出
472
473
  				temp.put("QUESTION_ID", questionid);
  				PageData question = questionService.findById(temp);
782f81b0   jack   1.增加未知学生的判断
474
  				temp.put("ANSWER", question.get("ANSWER").toString());
f4a73594   jack   1.增加班级统计报表和导出
475
476
  				temp.put("QUESTION_RANK", list.get(i).get("RANK").toString());
  				temp.put("QUESTION_SCORE", que_score);
782f81b0   jack   1.增加未知学生的判断
477
  
f4a73594   jack   1.增加班级统计报表和导出
478
479
  				PageData que = questionService.findById(temp);
  				Integer option_num = 0;
782f81b0   jack   1.增加未知学生的判断
480
481
482
483
  				if (!que.get("OPTION_NUM").toString().isEmpty()) {
  					option_num = Integer.valueOf(que.get("OPTION_NUM")
  							.toString());
  					onum[i] = option_num;
f4a73594   jack   1.增加班级统计报表和导出
484
  				}
d6389252   jack   1.增加年级卷测验统计
485
486
  				String tpList = pd.get("TESTPAPER_ID").toString();
  				String tpListArray[] = tpList.split(",");
782f81b0   jack   1.增加未知学生的判断
487
  
d6389252   jack   1.增加年级卷测验统计
488
  				temp.put("TEST_ID", tpListArray);
782f81b0   jack   1.增加未知学生的判断
489
490
491
492
  
  				List<PageData> queInfo = testpaperinfoService
  						.listTestPaperQuestionIDinfo(temp);
  				int answer[] = new int[option_num + 1];
f4a73594   jack   1.增加班级统计报表和导出
493
  				int right = 0;
0a0c0f6a   jack   1.bug修复
494
  				int lost = 0;
782f81b0   jack   1.增加未知学生的判断
495
496
  				for (int j = 0; j < queInfo.size(); j++) {
  					if (queInfo.get(j).get("ANSWER").toString().isEmpty()) {
0a0c0f6a   jack   1.bug修复
497
498
  						lost++;
  					}
782f81b0   jack   1.增加未知学生的判断
499
500
501
502
  					if (queInfo.get(j).get("RIGHT") != null
  							&& !queInfo.get(j).get("RIGHT").toString()
  									.isEmpty()) {
  						if (queInfo.get(j).get("RIGHT").toString().equals("1")) {
f4a73594   jack   1.增加班级统计报表和导出
503
504
505
  							right++;
  						}
  					}
782f81b0   jack   1.增加未知学生的判断
506
507
508
509
510
511
512
  					if (queInfo.get(j).get("ANSWER") != null
  							&& !queInfo.get(j).get("ANSWER").toString()
  									.isEmpty()) {
  						for (int o = 0; o < option_num; o++) {
  							String s = String.valueOf((char) (65 + o));
  							if (queInfo.get(j).get("ANSWER").toString()
  									.indexOf(s) > -1) {
f4a73594   jack   1.增加班级统计报表和导出
513
514
  								answer[o]++;
  							}
782f81b0   jack   1.增加未知学生的判断
515
516
  						}
  					} else {
f4a73594   jack   1.增加班级统计报表和导出
517
518
519
520
  						answer[option_num]++;
  					}
  				}
  				temp.put("RIGHTNUM", right);
782f81b0   jack   1.增加未知学生的判断
521
522
  				temp.put("ANSWERNUM", (queInfo.size() - lost));
  				temp.put("ANSWERNUM2", queInfo.size());
f4a73594   jack   1.增加班级统计报表和导出
523
524
525
526
  				temp.put("optin_info", answer);
  				templist.add(temp);
  			}
  			Arrays.sort(onum);
782f81b0   jack   1.增加未知学生的判断
527
528
529
530
531
  			int max = onum[onum.length - 1];
  			pd.put("MAX", max);
  		}
  
  		Collections.sort(templist, new Comparator<PageData>() {
f4a73594   jack   1.增加班级统计报表和导出
532
533
534
  
  			@Override
  			public int compare(PageData o1, PageData o2) {
782f81b0   jack   1.增加未知学生的判断
535
536
537
538
  				Integer o1GetScore = Integer.valueOf(o1
  						.getString("QUESTION_RANK"));
  				Integer o2GetScore = Integer.valueOf(o2
  						.getString("QUESTION_RANK"));
f4a73594   jack   1.增加班级统计报表和导出
539
540
  				return o1GetScore.compareTo(o2GetScore);
  			}
782f81b0   jack   1.增加未知学生的判断
541
  
f4a73594   jack   1.增加班级统计报表和导出
542
543
544
  		});
  		mv.setViewName("sunvote/paper/test_list2");
  		mv.addObject("varList", templist);
782f81b0   jack   1.增加未知学生的判断
545
  		mv.addObject("pd", pd);
f4a73594   jack   1.增加班级统计报表和导出
546
547
548
  		res.setData(saveData);
  		return mv;
  	}
782f81b0   jack   1.增加未知学生的判断
549
550
551
  
  	@RequestMapping(value = "/export2")
  	public ModelAndView export2() throws Exception {
f4a73594   jack   1.增加班级统计报表和导出
552
553
554
555
  		ModelAndView mv = this.getModelAndView();
  		PageData pd = new PageData();
  		List<PageData> templist = new ArrayList<PageData>();
  		PageData saveData = new PageData();
782f81b0   jack   1.增加未知学生的判断
556
  
f4a73594   jack   1.增加班级统计报表和导出
557
558
  		ResponseGson<PageData> res = new ResponseGson();
  		pd = this.getPageData();
782f81b0   jack   1.增加未知学生的判断
559
  		if (pd.containsKey("PAPER_ID")) {
f4a73594   jack   1.增加班级统计报表和导出
560
561
562
  			List<PageData> list = paperquestionService.listAll(pd);
  			List<PageData> test = new ArrayList<PageData>();
  			int onum[] = new int[list.size()];
782f81b0   jack   1.增加未知学生的判断
563
564
  
  			for (int i = 0; i < list.size(); i++) {
f4a73594   jack   1.增加班级统计报表和导出
565
566
  				PageData temp = new PageData();
  				String questionid = list.get(i).get("QUESTION_ID").toString();
782f81b0   jack   1.增加未知学生的判断
567
568
569
  
  				if (list.get(i).get("NO_NAME") == null
  						|| list.get(i).get("NO_NAME").toString().isEmpty()) {
f4a73594   jack   1.增加班级统计报表和导出
570
571
  					continue;
  				}
782f81b0   jack   1.增加未知学生的判断
572
573
  				Float que_score = Float.valueOf(list.get(i).get("SCORE")
  						.toString());
f4a73594   jack   1.增加班级统计报表和导出
574
575
  				temp.put("QUESTION_ID", questionid);
  				PageData question = questionService.findById(temp);
782f81b0   jack   1.增加未知学生的判断
576
  				temp.put("ANSWER", question.get("ANSWER").toString());
f4a73594   jack   1.增加班级统计报表和导出
577
578
  				temp.put("QUESTION_RANK", list.get(i).get("RANK").toString());
  				temp.put("QUESTION_SCORE", que_score);
782f81b0   jack   1.增加未知学生的判断
579
  
f4a73594   jack   1.增加班级统计报表和导出
580
581
  				PageData que = questionService.findById(temp);
  				Integer option_num = 0;
782f81b0   jack   1.增加未知学生的判断
582
583
584
585
  				if (!que.get("OPTION_NUM").toString().isEmpty()) {
  					option_num = Integer.valueOf(que.get("OPTION_NUM")
  							.toString());
  					onum[i] = option_num;
f4a73594   jack   1.增加班级统计报表和导出
586
  				}
782f81b0   jack   1.增加未知学生的判断
587
  
d6389252   jack   1.增加年级卷测验统计
588
589
  				String tpList = pd.get("TESTPAPER_ID").toString();
  				String tpListArray[] = tpList.split(",");
782f81b0   jack   1.增加未知学生的判断
590
  
d6389252   jack   1.增加年级卷测验统计
591
  				temp.put("TEST_ID", tpListArray);
782f81b0   jack   1.增加未知学生的判断
592
593
594
  				List<PageData> queInfo = testpaperinfoService
  						.listTestPaperQuestionIDinfo(temp);
  				int answer[] = new int[option_num + 1];
f4a73594   jack   1.增加班级统计报表和导出
595
  				int right = 0;
0a0c0f6a   jack   1.bug修复
596
  				int lost = 0;
782f81b0   jack   1.增加未知学生的判断
597
598
  				for (int j = 0; j < queInfo.size(); j++) {
  					if (queInfo.get(j).get("ANSWER").toString().isEmpty()) {
0a0c0f6a   jack   1.bug修复
599
600
  						lost++;
  					}
782f81b0   jack   1.增加未知学生的判断
601
602
603
604
  					if (queInfo.get(j).get("RIGHT") != null
  							&& !queInfo.get(j).get("RIGHT").toString()
  									.isEmpty()) {
  						if (queInfo.get(j).get("RIGHT").toString().equals("1")) {
f4a73594   jack   1.增加班级统计报表和导出
605
606
607
  							right++;
  						}
  					}
782f81b0   jack   1.增加未知学生的判断
608
609
610
611
612
613
614
  					if (queInfo.get(j).get("ANSWER") != null
  							&& !queInfo.get(j).get("ANSWER").toString()
  									.isEmpty()) {
  						for (int o = 0; o < option_num; o++) {
  							String s = String.valueOf((char) (65 + o));
  							if (queInfo.get(j).get("ANSWER").toString()
  									.equals(s)) {
f4a73594   jack   1.增加班级统计报表和导出
615
616
  								answer[o]++;
  							}
782f81b0   jack   1.增加未知学生的判断
617
618
  						}
  					} else {
f4a73594   jack   1.增加班级统计报表和导出
619
620
621
622
  						answer[option_num]++;
  					}
  				}
  				temp.put("RIGHTNUM", right);
782f81b0   jack   1.增加未知学生的判断
623
624
  				temp.put("ANSWERNUM", (queInfo.size() - lost));
  				temp.put("ANSWERNUM2", queInfo.size());
f4a73594   jack   1.增加班级统计报表和导出
625
626
627
628
  				temp.put("optin_info", JSONUtils.toJSONString(answer));
  				templist.add(temp);
  			}
  			Arrays.sort(onum);
782f81b0   jack   1.增加未知学生的判断
629
630
631
632
633
  			int max = onum[onum.length - 1];
  			pd.put("MAX", max);
  		}
  
  		Collections.sort(templist, new Comparator<PageData>() {
f4a73594   jack   1.增加班级统计报表和导出
634
635
636
  
  			@Override
  			public int compare(PageData o1, PageData o2) {
782f81b0   jack   1.增加未知学生的判断
637
638
639
640
  				Integer o1GetScore = Integer.valueOf(o1
  						.getString("QUESTION_RANK"));
  				Integer o2GetScore = Integer.valueOf(o2
  						.getString("QUESTION_RANK"));
f4a73594   jack   1.增加班级统计报表和导出
641
642
  				return o1GetScore.compareTo(o2GetScore);
  			}
782f81b0   jack   1.增加未知学生的判断
643
  
f4a73594   jack   1.增加班级统计报表和导出
644
  		});
f4a73594   jack   1.增加班级统计报表和导出
645
  
782f81b0   jack   1.增加未知学生的判断
646
647
648
649
  		// mv.addObject("varList", templist);
  		// mv.addObject("pd",pd);
  
  		Map<String, Object> dataMap = new HashMap<String, Object>();
f4a73594   jack   1.增加班级统计报表和导出
650
  		List<String> titles = new ArrayList<String>();
782f81b0   jack   1.增加未知学生的判断
651
652
653
654
655
656
657
  		titles.add("题号"); // 1
  		titles.add("答案"); // 2
  		titles.add("答题人数"); // 3
  		titles.add("正确人数"); // 4
  		titles.add("正确率"); // 5
  		titles.add("满分值"); // 6
  		titles.add("平均分"); // 7
f4a73594   jack   1.增加班级统计报表和导出
658
  		Integer max = Integer.valueOf(pd.getString("MAX"));
782f81b0   jack   1.增加未知学生的判断
659
660
661
  		for (int x = 0; x < max; x++) {
  			titles.add("选" + Myelfun.jstlInt2Char(x + 1) + "人数"); // 8
  			titles.add("选" + Myelfun.jstlInt2Char(x + 1) + "比例"); // 9
f4a73594   jack   1.增加班级统计报表和导出
662
  		}
782f81b0   jack   1.增加未知学生的判断
663
664
  		titles.add("漏选人数"); // 10
  		titles.add("漏选比例"); // 11
f4a73594   jack   1.增加班级统计报表和导出
665
666
667
  		dataMap.put("titles", titles);
  		List<PageData> varOList = templist;
  		List<PageData> varList = new ArrayList<PageData>();
782f81b0   jack   1.增加未知学生的判断
668
669
  		DecimalFormat decimalFormat = new DecimalFormat("0.00");
  		for (int i = 0; i < varOList.size(); i++) {
f4a73594   jack   1.增加班级统计报表和导出
670
  			PageData vpd = new PageData();
782f81b0   jack   1.增加未知学生的判断
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
  
  			vpd.put("var1", varOList.get(i).getString("QUESTION_RANK")); // 1
  			vpd.put("var2", varOList.get(i).getString("ANSWER")); // 2
  			vpd.put("var3", varOList.get(i).getString("ANSWERNUM")); // 3
  			vpd.put("var4", varOList.get(i).getString("RIGHTNUM")); // 4
  			vpd.put("var5",
  					decimalFormat.format(Double.valueOf(varOList.get(i)
  							.getString("RIGHTNUM"))
  							* 100
  							/ Double.valueOf(varOList.get(i).getString(
  									"ANSWERNUM")))
  							+ "%"); // 5
  			vpd.put("var6", varOList.get(i).getString("QUESTION_SCORE")); // 6
  			vpd.put("var7", decimalFormat.format(Double.valueOf(varOList.get(i)
  					.getString("RIGHTNUM"))
  					* Double.valueOf(varOList.get(i)
  							.getString("QUESTION_SCORE"))
  					/ Double.valueOf(varOList.get(i).getString("ANSWERNUM")))); // 7
f4a73594   jack   1.增加班级统计报表和导出
689
690
691
  			String s = varOList.get(i).get("optin_info").toString();
  			s = s.replace("[", "");
  			s = s.replace("]", "");
782f81b0   jack   1.增加未知学生的判断
692
693
  			List<String> optoin = Arrays.asList(s.split(","));
  			for (int y = 0; y < max; y++) {
f447a06e   jack   1.修复bug
694
  				Integer nn = 0;
782f81b0   jack   1.增加未知学生的判断
695
  				if ((optoin.size() - 1) > y) {
f447a06e   jack   1.修复bug
696
  					nn = Integer.valueOf(optoin.get(y));
782f81b0   jack   1.增加未知学生的判断
697
  				} else {
f447a06e   jack   1.修复bug
698
699
  					break;
  				}
782f81b0   jack   1.增加未知学生的判断
700
701
702
703
704
705
706
707
  				vpd.put("var" + (8 + 2 * y), nn); // 8
  				vpd.put("var" + (9 + 2 * y),
  						decimalFormat.format(nn
  								* 100
  								/ Double.valueOf(varOList.get(i).getString(
  										"ANSWERNUM")))
  								+ "%"); // 9
  
f4a73594   jack   1.增加班级统计报表和导出
708
  			}
782f81b0   jack   1.增加未知学生的判断
709
710
711
712
713
714
715
716
717
718
719
  
  			vpd.put("var" + (max * 2 + 8),
  					Integer.valueOf(optoin.get(optoin.size() - 1))); // 8
  			vpd.put("var" + (max * 2 + 9),
  					decimalFormat.format(Double.valueOf(optoin.get(optoin
  							.size() - 1))
  							* 100
  							/ Double.valueOf(varOList.get(i).getString(
  									"ANSWERNUM2")))
  							+ "%"); // 9
  
f4a73594   jack   1.增加班级统计报表和导出
720
721
722
723
  			varList.add(vpd);
  		}
  		dataMap.put("varList", varList);
  		ObjectExcelView erv = new ObjectExcelView();
782f81b0   jack   1.增加未知学生的判断
724
  		mv = new ModelAndView(erv, dataMap);
f4a73594   jack   1.增加班级统计报表和导出
725
726
727
  
  		return mv;
  	}
782f81b0   jack   1.增加未知学生的判断
728
  
58e024ae   jack   1.修改logo
729
730
  	/**
  	 * 按学生分析
782f81b0   jack   1.增加未知学生的判断
731
  	 * 
58e024ae   jack   1.修改logo
732
733
734
  	 * @return
  	 * @throws Exception
  	 */
782f81b0   jack   1.增加未知学生的判断
735
736
  	@RequestMapping(value = "/paperRep3")
  	public ModelAndView paperRep3() throws Exception {
58e024ae   jack   1.修改logo
737
738
  		ModelAndView mv = this.getModelAndView();
  		PageData pd = new PageData();
78353cf9   jack   1.增加老师端可以看到年级卷
739
  		pd=this.getPageData();
89ac0783   jack   1.添加年级卷分析功能
740
  		List<PageData> temp = new ArrayList<PageData>();
78353cf9   jack   1.增加老师端可以看到年级卷
741
  		List<PageData> sclass_list = new ArrayList<PageData>();
58e024ae   jack   1.修改logo
742
  		PageData saveData = new PageData();
782f81b0   jack   1.增加未知学生的判断
743
  
58e024ae   jack   1.修改logo
744
745
  		ResponseGson<PageData> res = new ResponseGson();
  		pd = this.getPageData();
782f81b0   jack   1.增加未知学生的判断
746
747
  		if (pd.containsKey("PAPER_ID")) {
  
58e024ae   jack   1.修改logo
748
  			List<PageData> list = studenttestService.findTestInfoByPid(pd);
89ac0783   jack   1.添加年级卷分析功能
749
  			PageData paper = paperService.findById(pd);
782f81b0   jack   1.增加未知学生的判断
750
  			if (paper != null) {
89ac0783   jack   1.添加年级卷分析功能
751
752
753
  				pd.put("SCORE", paper.get("SCORE"));
  				pd.put("PAPER_NAME", paper.get("TITLE"));
  			}
58e024ae   jack   1.修改logo
754
  			List<String> sid = new ArrayList<String>();
89ac0783   jack   1.添加年级卷分析功能
755
756
  			Integer test_num = 0;
  			Integer lost_num = 0;
78353cf9   jack   1.增加老师端可以看到年级卷
757
  			List<String> classId = new ArrayList();
44243c35   jack   1.修改班级下拉bug
758
  			
782f81b0   jack   1.增加未知学生的判断
759
760
761
  			for (PageData item : list) {
  
  				PageData p = new PageData();
78353cf9   jack   1.增加老师端可以看到年级卷
762
763
  				
  				
782f81b0   jack   1.增加未知学生的判断
764
765
766
767
768
769
770
  				p.put("ID", item.getString("STUDENT_ID"));
  				PageData student = stundentService.findById(p);
  				if (student != null) {
  					Integer index = this.indexOfStrInList(sid,
  							item.getString("STUDENT_ID"));
  					if (index != -1) {
  
89ac0783   jack   1.添加年级卷分析功能
771
  						test_num++;
782f81b0   jack   1.增加未知学生的判断
772
773
  						List<PageData> test_list = (List<PageData>) temp.get(
  								index).get("TEST_LIST");
89ac0783   jack   1.添加年级卷分析功能
774
775
  						PageData test = new PageData();
  						test.put("CREATE_DATE", item.get("CREATE_DATE"));
782f81b0   jack   1.增加未知学生的判断
776
  						if (item.getString("LOST_TEST").isEmpty()) {
89ac0783   jack   1.添加年级卷分析功能
777
  							test.put("SCORE", item.get("SCORE"));
782f81b0   jack   1.增加未知学生的判断
778
  						} else {
89ac0783   jack   1.添加年级卷分析功能
779
  							test.put("SCORE", "--");
782f81b0   jack   1.增加未知学生的判断
780
781
782
783
  							temp.get(index).put(
  									"LOST_NUM",
  									Integer.valueOf(temp.get(index).getString(
  											"LOST_NUM")) + 1);
89ac0783   jack   1.添加年级卷分析功能
784
785
786
  						}
  						test.put("AVG_SCORE", item.get("AVG_SCORE"));
  						test_list.add(test);
782f81b0   jack   1.增加未知学生的判断
787
788
789
790
  						Float total = Float.valueOf(temp.get(index).getString(
  								"STUDENT_TOTAL"));
  						temp.get(index).put("STUDENT_TOTAL",
  								total + Float.valueOf(item.getString("SCORE")));
89ac0783   jack   1.添加年级卷分析功能
791
  						temp.get(index).put("TEST_LIST", test_list);
782f81b0   jack   1.增加未知学生的判断
792
793
794
795
796
797
798
799
800
801
802
803
  						temp.get(index).put(
  								"TEST_NUM",
  								test_list.size()
  										- Integer.valueOf(temp.get(index)
  												.getString("LOST_NUM")));
  
  					} else {
  						test_num = 1;
  						lost_num = 0;
  						PageData stu = new PageData();
  						stu.put("STUDENT_NAME", item.get("STUDENT_NAME"));
  						stu.put("CLASS_NAME", item.get("CLASS_NAME"));
78353cf9   jack   1.增加老师端可以看到年级卷
804
805
  						if(!classId.contains(item.getString("CLASS_ID"))){
  							classId.add(item.getString("CLASS_ID"));
44243c35   jack   1.修改班级下拉bug
806
  							PageData sclass = new PageData();
78353cf9   jack   1.增加老师端可以看到年级卷
807
808
809
810
811
  							sclass.put("CLASS_ID", item.get("CLASS_ID"));
  							sclass.put("CLASS_NAME", item.get("CLASS_NAME"));
  							sclass_list.add(sclass);
  						}
  						
782f81b0   jack   1.增加未知学生的判断
812
813
814
815
816
817
818
819
820
821
822
823
  						List<PageData> testList = new ArrayList<PageData>();
  						PageData test = new PageData();
  						test.put("CREATE_DATE", item.get("CREATE_DATE"));
  						if (item.getString("LOST_TEST").isEmpty()) {
  							test.put("SCORE", item.get("SCORE"));
  						} else {
  							test.put("SCORE", "--");
  							lost_num++;
  						}
  						test.put("AVG_SCORE", item.get("AVG_SCORE"));
  						testList.add(test);
  						stu.put("STUDENT_TOTAL", item.get("SCORE"));
001b21e2   jack   1.修改年级分析报表内容
824
825
  						stu.put("STUDENT_NUMBER", item.get("STUDENT_NUMBER"));
  						stu.put("STUDENT_PADID", item.get("STUDENT_PADID"));
782f81b0   jack   1.增加未知学生的判断
826
827
828
829
830
  						stu.put("TEST_LIST", testList);
  						stu.put("TEST_NUM", testList.size() - lost_num);
  						stu.put("LOST_NUM", lost_num);
  						sid.add(item.getString("STUDENT_ID"));
  						temp.add(stu);
78353cf9   jack   1.增加老师端可以看到年级卷
831
  						
89ac0783   jack   1.添加年级卷分析功能
832
  					}
58e024ae   jack   1.修改logo
833
  				}
58e024ae   jack   1.修改logo
834
835
  			}
  		}
782f81b0   jack   1.增加未知学生的判断
836
  		Collections.sort(temp, new Comparator<PageData>() {
89ac0783   jack   1.添加年级卷分析功能
837
838
839
  
  			@Override
  			public int compare(PageData o1, PageData o2) {
782f81b0   jack   1.增加未知学生的判断
840
841
842
843
844
845
846
  
  				Float o1GetScore = Float.valueOf(o1.getString("TEST_NUM")) == 0 ? 0
  						: Float.valueOf(o1.getString("STUDENT_TOTAL"))
  								/ Float.valueOf(o1.getString("TEST_NUM"));
  				Float o2GetScore = Float.valueOf(o2.getString("TEST_NUM")) == 0 ? 0
  						: Float.valueOf(o2.getString("STUDENT_TOTAL"))
  								/ Float.valueOf(o2.getString("TEST_NUM"));
89ac0783   jack   1.添加年级卷分析功能
847
848
  				return o2GetScore.compareTo(o1GetScore);
  			}
782f81b0   jack   1.增加未知学生的判断
849
  
89ac0783   jack   1.添加年级卷分析功能
850
  		});
78353cf9   jack   1.增加老师端可以看到年级卷
851
  		
58e024ae   jack   1.修改logo
852
  		mv.setViewName("sunvote/paper/test_list3");
78353cf9   jack   1.增加老师端可以看到年级卷
853
  		mv.addObject("sclass", sclass_list);
89ac0783   jack   1.添加年级卷分析功能
854
  		mv.addObject("varList", temp);
782f81b0   jack   1.增加未知学生的判断
855
  		mv.addObject("pd", pd);
58e024ae   jack   1.修改logo
856
857
858
  		res.setData(saveData);
  		return mv;
  	}
782f81b0   jack   1.增加未知学生的判断
859
860
861
  
  	@RequestMapping(value = "/export3")
  	public ModelAndView export3() throws Exception {
89ac0783   jack   1.添加年级卷分析功能
862
863
864
865
  		ModelAndView mv = this.getModelAndView();
  		PageData pd = new PageData();
  		List<PageData> temp = new ArrayList<PageData>();
  		PageData saveData = new PageData();
782f81b0   jack   1.增加未知学生的判断
866
  
89ac0783   jack   1.添加年级卷分析功能
867
868
  		ResponseGson<PageData> res = new ResponseGson();
  		pd = this.getPageData();
782f81b0   jack   1.增加未知学生的判断
869
870
  		if (pd.containsKey("PAPER_ID")) {
  
89ac0783   jack   1.添加年级卷分析功能
871
872
  			List<PageData> list = studenttestService.findTestInfoByPid(pd);
  			PageData paper = paperService.findById(pd);
782f81b0   jack   1.增加未知学生的判断
873
  			if (paper != null) {
89ac0783   jack   1.添加年级卷分析功能
874
875
876
877
878
879
  				pd.put("SCORE", paper.get("SCORE"));
  				pd.put("PAPER_NAME", paper.get("TITLE"));
  			}
  			List<String> sid = new ArrayList<String>();
  			Integer test_num = 0;
  			Integer lost_num = 0;
782f81b0   jack   1.增加未知学生的判断
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
  			for (PageData item : list) {
  				PageData p = new PageData();
  				p.put("ID", item.getString("STUDENT_ID"));
  				PageData student = stundentService.findById(p);
  				if (student != null) {
  				Integer index = this.indexOfStrInList(sid,
  						item.getString("STUDENT_ID"));
  				if (index != -1) {
  
  					test_num++;
  					List<PageData> test_list = (List<PageData>) temp.get(index)
  							.get("TEST_LIST");
  					PageData test = new PageData();
  					test.put("CREATE_DATE", item.get("CREATE_DATE"));
  					if (item.getString("LOST_TEST").isEmpty()) {
  						test.put("SCORE", item.get("SCORE"));
  					} else {
  						test.put("SCORE", "--");
  						temp.get(index).put(
  								"LOST_NUM",
  								Integer.valueOf(temp.get(index).getString(
  										"LOST_NUM")) + 1);
  					}
  					test.put("AVG_SCORE", item.get("AVG_SCORE"));
  					test_list.add(test);
  					Float total = Float.valueOf(temp.get(index).getString(
  							"STUDENT_TOTAL"));
  					temp.get(index).put("STUDENT_TOTAL",
  							total + Float.valueOf(item.getString("SCORE")));
  					temp.get(index).put("TEST_LIST", test_list);
  					temp.get(index).put(
  							"TEST_NUM",
  							test_list.size()
  									- Integer.valueOf(temp.get(index)
  											.getString("LOST_NUM")));
  
  				} else {
  					test_num = 1;
  					lost_num = 0;
89ac0783   jack   1.添加年级卷分析功能
919
920
921
922
923
924
  					PageData stu = new PageData();
  					stu.put("STUDENT_NAME", item.get("STUDENT_NAME"));
  					stu.put("CLASS_NAME", item.get("CLASS_NAME"));
  					List<PageData> testList = new ArrayList<PageData>();
  					PageData test = new PageData();
  					test.put("CREATE_DATE", item.get("CREATE_DATE"));
782f81b0   jack   1.增加未知学生的判断
925
  					if (item.getString("LOST_TEST").isEmpty()) {
89ac0783   jack   1.添加年级卷分析功能
926
  						test.put("SCORE", item.get("SCORE"));
782f81b0   jack   1.增加未知学生的判断
927
  					} else {
89ac0783   jack   1.添加年级卷分析功能
928
929
930
931
932
  						test.put("SCORE", "--");
  						lost_num++;
  					}
  					test.put("AVG_SCORE", item.get("AVG_SCORE"));
  					testList.add(test);
782f81b0   jack   1.增加未知学生的判断
933
  					stu.put("STUDENT_TOTAL", item.get("SCORE"));
89ac0783   jack   1.添加年级卷分析功能
934
  					stu.put("TEST_LIST", testList);
41772c65   jack   1.修改bug
935
936
  					stu.put("STUDENT_NUMBER", item.get("STUDENT_NUMBER"));
  					stu.put("STUDENT_PADID", item.get("STUDENT_PADID"));
782f81b0   jack   1.增加未知学生的判断
937
  					stu.put("TEST_NUM", testList.size() - lost_num);
89ac0783   jack   1.添加年级卷分析功能
938
939
940
941
  					stu.put("LOST_NUM", lost_num);
  					sid.add(item.getString("STUDENT_ID"));
  					temp.add(stu);
  				}
782f81b0   jack   1.增加未知学生的判断
942
  				}
89ac0783   jack   1.添加年级卷分析功能
943
944
  			}
  		}
782f81b0   jack   1.增加未知学生的判断
945
  		Collections.sort(temp, new Comparator<PageData>() {
89ac0783   jack   1.添加年级卷分析功能
946
947
948
  
  			@Override
  			public int compare(PageData o1, PageData o2) {
782f81b0   jack   1.增加未知学生的判断
949
950
951
952
953
954
955
  
  				Float o1GetScore = Float.valueOf(o1.getString("TEST_NUM")) == 0 ? 0
  						: Float.valueOf(o1.getString("STUDENT_TOTAL"))
  								/ Float.valueOf(o1.getString("TEST_NUM"));
  				Float o2GetScore = Float.valueOf(o2.getString("TEST_NUM")) == 0 ? 0
  						: Float.valueOf(o2.getString("STUDENT_TOTAL"))
  								/ Float.valueOf(o2.getString("TEST_NUM"));
89ac0783   jack   1.添加年级卷分析功能
956
957
  				return o2GetScore.compareTo(o1GetScore);
  			}
782f81b0   jack   1.增加未知学生的判断
958
  
89ac0783   jack   1.添加年级卷分析功能
959
960
961
  		});
  
  		mv.addObject("varList", temp);
782f81b0   jack   1.增加未知学生的判断
962
963
964
  		mv.addObject("pd", pd);
  
  		Map<String, Object> dataMap = new HashMap<String, Object>();
89ac0783   jack   1.添加年级卷分析功能
965
  		List<String> titles = new ArrayList<String>();
782f81b0   jack   1.增加未知学生的判断
966
  		titles.add("学生姓名"); // 1
41772c65   jack   1.修改bug
967
968
969
970
971
972
  		titles.add("学号"); // 2
  		titles.add("键盘号"); // 3
  		titles.add("班级"); // 4
  		titles.add("综合排名"); // 5
  		//titles.add("个人平均得分"); // 4
  		//titles.add("个人平均得分率"); // 5
782f81b0   jack   1.增加未知学生的判断
973
  		titles.add("个人得分"); // 6
41772c65   jack   1.修改bug
974
975
  		//titles.add("测验平均分"); // 7
  		titles.add("测验时间"); // 7
782f81b0   jack   1.增加未知学生的判断
976
  
89ac0783   jack   1.添加年级卷分析功能
977
978
979
  		dataMap.put("titles", titles);
  		List<PageData> varOList = temp;
  		List<PageData> varList = new ArrayList<PageData>();
782f81b0   jack   1.增加未知学生的判断
980
981
982
  		DecimalFormat decimalFormat = new DecimalFormat("0.00");
  		
  		for (int i = 0; i < varOList.size(); i++) {
89ac0783   jack   1.添加年级卷分析功能
983
  			PageData vpd = new PageData();
782f81b0   jack   1.增加未知学生的判断
984
985
  
  			vpd.put("var1", varOList.get(i).getString("STUDENT_NAME")); // 1
41772c65   jack   1.修改bug
986
987
988
989
  			vpd.put("var2", varOList.get(i).getString("STUDENT_NUMBER")); // 2
  			vpd.put("var3", varOList.get(i).getString("STUDENT_PADID")); // 3
  			vpd.put("var4", varOList.get(i).getString("CLASS_NAME")); // 4
  			vpd.put("var5", i + 1); // 5
782f81b0   jack   1.增加未知学生的判断
990
991
992
  			List<PageData> test_list = (List<PageData>) varOList.get(i).get(
  					"TEST_LIST");
  
89ac0783   jack   1.添加年级卷分析功能
993
  			List<String> score = new ArrayList<String>();
41772c65   jack   1.修改bug
994
  			
89ac0783   jack   1.添加年级卷分析功能
995
  			List<String> CREATE_DATE = new ArrayList<String>();
782f81b0   jack   1.增加未知学生的判断
996
  			for (int x = 0; x < test_list.size(); x++) {
89ac0783   jack   1.添加年级卷分析功能
997
  				score.add(test_list.get(x).getString("SCORE"));
89ac0783   jack   1.添加年级卷分析功能
998
  				CREATE_DATE.add(test_list.get(x).getString("CREATE_DATE"));
782f81b0   jack   1.增加未知学生的判断
999
  
89ac0783   jack   1.添加年级卷分析功能
1000
1001
  			}
  			vpd.put("var6", score);
41772c65   jack   1.修改bug
1002
  			vpd.put("var7", CREATE_DATE);
89ac0783   jack   1.添加年级卷分析功能
1003
  			varList.add(vpd);
782f81b0   jack   1.增加未知学生的判断
1004
  			
89ac0783   jack   1.添加年级卷分析功能
1005
1006
1007
  		}
  		dataMap.put("varList", varList);
  		ObjectExcelView2 erv = new ObjectExcelView2();
782f81b0   jack   1.增加未知学生的判断
1008
  		mv = new ModelAndView(erv, dataMap);
89ac0783   jack   1.添加年级卷分析功能
1009
1010
1011
  
  		return mv;
  	}
782f81b0   jack   1.增加未知学生的判断
1012
1013
1014
1015
1016
1017
  
  	@RequestMapping(value = "/iteminfo")
  	public ModelAndView iteminfo() throws Exception {
  		logBefore(logger, Jurisdiction.getUsername() + "Paper详细信息");
  		// if(!Jurisdiction.buttonJurisdiction(menuUrl, "cha")){return null;}
  		// //校验权限(无权查看时页面会有提示,如果不注释掉这句代码就无法进入列表页面,所以根据情况是否加入本句代码)
338594c8   孙向锦   添加教师端页面
1018
1019
1020
  		ModelAndView mv = this.getModelAndView();
  		PageData pd = new PageData();
  		pd = this.getPageData();
782f81b0   jack   1.增加未知学生的判断
1021
1022
1023
  
  		if (pd.containsKey("PAPER_ID")) {
  			try {
338594c8   孙向锦   添加教师端页面
1024
1025
  				Paper paper = new Paper();
  				PageData ppd = paperService.findById(pd);
782f81b0   jack   1.增加未知学生的判断
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
  				if (ppd != null) {
  					paper.setTitle(ppd.getString("TITLE"));
  					paper.setExam_time(ppd.getString("EXAM_TIME"));
  					paper.setUser_id(ppd.getString("USER_ID"));
  					paper.setPaper_type(ppd.getString("PAPER_TYPE"));
  					paper.setSubject_id(ppd.getString("SUBJECT_ID"));
  					paper.setGrade_id(ppd.getString("GRADE_ID"));
  					paper.setScore(ppd.getString("SCORE"));
  					paper.setQuestions(new ArrayList<Question>());
  
  					List<PageData> questList = v1Service.getTestPaperInfo(pd);
  					for (PageData qpd : questList) {
  						Question question = new Question();
  						question.setAnswer(qpd.getString("ANSWER"));
  						question.setQuestion_id(qpd.getString("QUESTION_ID"));
  						question.setSubject_id(qpd.getString("SUBJECT_ID"));
  						question.setChapter_id(qpd.getString("CHAPTER_ID"));
  						question.setProblem_type_id(qpd
  								.getString("PROBLEM_TYPE_ID"));
  						question.setKnowledge_id(qpd.getString("KNOWLEDGE_ID"));
  						question.setContent(qpd.getString("CONTENT")
  								.replaceAll("<fill></fill>", "______"));
  						question.setOption_num(qpd.getString("OPTION_NUM"));
  						question.setOption_content(qpd
  								.getString("OPTION_CONTENT"));
  						question.setDifficulty(qpd.getString("DIFFICULTY"));
  						question.setAnalysis(qpd.getString("ANALYSIS"));
  						question.setQuestion_from(qpd
  								.getString("QUESTION_FROM"));
  						question.setSug_score(qpd.getString("SCORE"));
  						question.setSug_part_score(qpd.getString("PART_SCORE"));
  						question.setRank(qpd.getString("RANK"));
  						question.setNo_name(qpd.getString("NO_NAME"));
  						if ("-1".equals("" + qpd.getString("P_ID"))) {
  							PageData pidPd = new PageData();
  							pidPd.put("PID", question.getQuestion_id());
  							question.setQuestions(new ArrayList<Question>());
  							List<PageData> qs = v1Service
  									.getQuestionsByPID(pidPd);
  							for (PageData q : qs) {
  								Question qq = new Question();
  								qq.setAnswer(q.getString("ANSWER"));
  								qq.setQuestion_id(q.getString("QUESTION_ID"));
  								qq.setSubject_id(q.getString("SUBJECT_ID"));
  								qq.setChapter_id(q.getString("CHAPTER_ID"));
  								qq.setProblem_type_id(q
  										.getString("PROBLEM_TYPE_ID"));
  								qq.setKnowledge_id(q.getString("KNOWLEDGE_ID"));
  								qq.setContent(q.getString("CONTENT")
  										.replaceAll("<fill></fill>", "______"));
  								qq.setOption_num(q.getString("OPTION_NUM"));
  								qq.setOption_content(q
  										.getString("OPTION_CONTENT"));
  								qq.setDifficulty(q.getString("DIFFICULTY"));
  								qq.setAnalysis(q.getString("ANALYSIS"));
  								qq.setQuestion_from(q
  										.getString("QUESTION_FROM"));
  								qq.setSug_score(q.getString("SCORE"));
  								qq.setSug_part_score(q.getString("PART_SCORE"));
  								qq.setRank(q.getString("RANK"));
  								qq.setNo_name(q.getString("NO_NAME"));
  								question.getQuestions().add(qq);
  							}
  						}
  						if ("-1".equals(qpd.getString("P_ID"))
  								|| "0".equals(qpd.getString("P_ID"))) {
  							paper.getQuestions().add(question);
338594c8   孙向锦   添加教师端页面
1093
1094
  						}
  					}
782f81b0   jack   1.增加未知学生的判断
1095
1096
1097
  					pd.put("JSON", paper.toJson());
  					logger.info(paper.toJson());
  
338594c8   孙向锦   添加教师端页面
1098
  				}
782f81b0   jack   1.增加未知学生的判断
1099
  			} catch (Exception ex) {
338594c8   孙向锦   添加教师端页面
1100
1101
1102
  				ex.printStackTrace();
  			}
  		}
782f81b0   jack   1.增加未知学生的判断
1103
  		if (isChineseLanguageClient()) {
fd0087a8   孙向锦   添加英语语言
1104
  			mv.setViewName("sunvote/teacher/creat_question");
782f81b0   jack   1.增加未知学生的判断
1105
  		} else {
fd0087a8   孙向锦   添加英语语言
1106
1107
  			mv.setViewName("sunvote/teacher/en_creat_question");
  		}
338594c8   孙向锦   添加教师端页面
1108
  		mv.addObject("pd", pd);
782f81b0   jack   1.增加未知学生的判断
1109
  		mv.addObject("QX", Jurisdiction.getHC()); // 按钮权限
338594c8   孙向锦   添加教师端页面
1110
1111
  		return mv;
  	}
782f81b0   jack   1.增加未知学生的判断
1112
1113
1114
1115
  
  	@RequestMapping(value = "/npaper")
  	public ModelAndView newpaper() throws Exception {
  		logBefore(logger, Jurisdiction.getUsername() + "Paper详细信息");
338594c8   孙向锦   添加教师端页面
1116
1117
1118
  		ModelAndView mv = this.getModelAndView();
  		PageData pd = new PageData();
  		pd = this.getPageData();
782f81b0   jack   1.增加未知学生的判断
1119
  		String paperType = pd.getString("PAPER_TYPE");
338594c8   孙向锦   添加教师端页面
1120
1121
1122
1123
  		Paper paper = new Paper();
  		paper.setTitle(pd.getString("NAME"));
  		paper.setExam_time(pd.getString("TIME"));
  		Session session = Jurisdiction.getSession();
782f81b0   jack   1.增加未知学生的判断
1124
  		User user = (User) session.getAttribute(Const.SESSION_USER);
338594c8   孙向锦   添加教师端页面
1125
  		paper.setUser_id(user.getUSER_ID());
782f81b0   jack   1.增加未知学生的判断
1126
1127
  		paper.setPaper_type(paperType == null || "".equals(paperType.trim()) ? "1"
  				: paperType);
eca4feb5   孙向锦   管理员功能完善
1128
  		String subjectId = pd.getString("SUBJECT_ID");
782f81b0   jack   1.增加未知学生的判断
1129
1130
  		paper.setSubject_id(subjectId == null || "".equals(subjectId.trim()) ? getSubjectId()
  				: subjectId);
eca4feb5   孙向锦   管理员功能完善
1131
  		String gradeId = pd.getString("GRADE_ID");
782f81b0   jack   1.增加未知学生的判断
1132
1133
1134
1135
1136
  		paper.setGrade_id(gradeId == null || "".equals(gradeId.trim()) ? getGradeID()
  				: gradeId);
  		String schoolId = pd.getString("SCHOOL_ID");
  		paper.setSchool_id(schoolId == null || "".equals(schoolId.trim()) ? getSchoolID()
  				: schoolId);
338594c8   孙向锦   添加教师端页面
1137
  		paper.setQuestions(new ArrayList<Question>());
782f81b0   jack   1.增加未知学生的判断
1138
  
338594c8   孙向锦   添加教师端页面
1139
1140
  		pd.put("JSON", paper.toJson());
  		logger.info(paper.toJson());
782f81b0   jack   1.增加未知学生的判断
1141
  
83b5ddeb   孙向锦   模板添加
1142
  		String TEMPLATE_ID = pd.getString("TEMPLATE_ID");
782f81b0   jack   1.增加未知学生的判断
1143
  		if (TEMPLATE_ID != null && !"".equals(TEMPLATE_ID)) {
83b5ddeb   孙向锦   模板添加
1144
1145
1146
1147
  			pd.put("PAGETEMPLATE_ID", TEMPLATE_ID);
  			PageData template = pagetemplateService.findById(pd);
  			mv.addObject("TEMPLEATE", template);
  		}
782f81b0   jack   1.增加未知学生的判断
1148
1149
  
  		if (isChineseLanguageClient()) {
fd0087a8   孙向锦   添加英语语言
1150
  			mv.setViewName("sunvote/teacher/creat_question");
782f81b0   jack   1.增加未知学生的判断
1151
  		} else {
fd0087a8   孙向锦   添加英语语言
1152
1153
  			mv.setViewName("sunvote/teacher/en_creat_question");
  		}
338594c8   孙向锦   添加教师端页面
1154
  		mv.addObject("pd", pd);
782f81b0   jack   1.增加未知学生的判断
1155
  		if (paperType != null && "2".equals(paperType)) {
4b6a5239   孙向锦   管理员界面
1156
  			mv.addObject("JUMP_URL", "/main/admin");
782f81b0   jack   1.增加未知学生的判断
1157
  		} else {
4b6a5239   孙向锦   管理员界面
1158
1159
  			mv.addObject("JUMP_URL", "/main/teacher");
  		}
782f81b0   jack   1.增加未知学生的判断
1160
  		mv.addObject("QX", Jurisdiction.getHC()); // 按钮权限
338594c8   孙向锦   添加教师端页面
1161
1162
  		return mv;
  	}
782f81b0   jack   1.增加未知学生的判断
1163
1164
1165
1166
  
  	/**
  	 * 列表
  	 * 
338594c8   孙向锦   添加教师端页面
1167
1168
1169
  	 * @param page
  	 * @throws Exception
  	 */
782f81b0   jack   1.增加未知学生的判断
1170
1171
1172
1173
1174
  	@RequestMapping(value = "/list2")
  	public ModelAndView list2(Page page) throws Exception {
  		logBefore(logger, Jurisdiction.getUsername() + "列表Paper");
  		// if(!Jurisdiction.buttonJurisdiction(menuUrl, "cha")){return null;}
  		// //校验权限(无权查看时页面会有提示,如果不注释掉这句代码就无法进入列表页面,所以根据情况是否加入本句代码)
338594c8   孙向锦   添加教师端页面
1175
1176
1177
  		ModelAndView mv = this.getModelAndView();
  		PageData pd = new PageData();
  		pd = this.getPageData();
782f81b0   jack   1.增加未知学生的判断
1178
1179
  		String keywords = pd.getString("keywords"); // 关键词检索条件
  		if (null != keywords && !"".equals(keywords)) {
338594c8   孙向锦   添加教师端页面
1180
1181
  			pd.put("keywords", keywords.trim());
  		}
a51b67cf   孙向锦   交互第一个版本
1182
1183
  		String userID = getUserID();
  		pd.put("USER_ID", userID);
782f81b0   jack   1.增加未知学生的判断
1184
  		pd.put("PAPER_TYPE", "1");
c617106f   孙向锦   添加即时测功能
1185
  		page.setPd(pd);
78353cf9   jack   1.增加老师端可以看到年级卷
1186
  		List<PageData> varList = paperService.listAllBySidAndTid(pd); // 列出Paper列表
fd0087a8   孙向锦   添加英语语言
1187
  		page.setLangIsChina(isChineseLanguageClient());
782f81b0   jack   1.增加未知学生的判断
1188
  		if (isChineseLanguageClient()) {
fd0087a8   孙向锦   添加英语语言
1189
  			mv.setViewName("sunvote/paper/paper_list2");
782f81b0   jack   1.增加未知学生的判断
1190
  		} else {
fd0087a8   孙向锦   添加英语语言
1191
1192
  			mv.setViewName("sunvote/paper/en_paper_list2");
  		}
782f81b0   jack   1.增加未知学生的判断
1193
1194
  
  		for (PageData p : varList) {
c617106f   孙向锦   添加即时测功能
1195
  			String examTime = p.getString("EXAM_TIME");
579f3266   jack   1.studenttest增加增加...
1196
1197
1198
  			PageData temp = new PageData();
  			temp.put("PAPER_ID", p.getString("PAPER_ID"));
  			List<PageData> li = testpaperService.listAll(temp);
782f81b0   jack   1.增加未知学生的判断
1199
1200
  			if (examTime != null) {
  				try {
c617106f   孙向锦   添加即时测功能
1201
  					int et = Integer.parseInt(examTime);
782f81b0   jack   1.增加未知学生的判断
1202
1203
1204
1205
1206
1207
1208
  					String min = (et / 60) + "";
  					// if(min.length() < 2){
  					// min = "0" + min ;
  					// }
  					String sec = (et % 60) + "";
  					if (sec.length() < 2) {
  						sec = "0" + sec;
c617106f   孙向锦   添加即时测功能
1209
  					}
782f81b0   jack   1.增加未知学生的判断
1210
1211
1212
1213
  					if (et >= 60) {
  						examTime = min + "时" + sec + "分";
  					} else {
  						examTime = "0时" + sec + "分";
c617106f   孙向锦   添加即时测功能
1214
  					}
782f81b0   jack   1.增加未知学生的判断
1215
  				} catch (Exception e) {
c617106f   孙向锦   添加即时测功能
1216
1217
1218
  					e.printStackTrace();
  				}
  			}
782f81b0   jack   1.增加未知学生的判断
1219
  			if (examTime == null) {
c617106f   孙向锦   添加即时测功能
1220
1221
1222
  				examTime = "00:00";
  			}
  			p.put("EXAM_TIME", examTime);
579f3266   jack   1.studenttest增加增加...
1223
  			p.put("TEST_NUM", li.size());
c617106f   孙向锦   添加即时测功能
1224
  		}
782f81b0   jack   1.增加未知学生的判断
1225
  
c617106f   孙向锦   添加即时测功能
1226
1227
  		mv.addObject("varList", varList);
  		mv.addObject("pd", pd);
782f81b0   jack   1.增加未知学生的判断
1228
  		mv.addObject("QX", Jurisdiction.getHC()); // 按钮权限
c617106f   孙向锦   添加即时测功能
1229
1230
  		return mv;
  	}
782f81b0   jack   1.增加未知学生的判断
1231
1232
1233
1234
  
  	/**
  	 * 列表
  	 * 
4b6a5239   孙向锦   管理员界面
1235
1236
1237
  	 * @param page
  	 * @throws Exception
  	 */
782f81b0   jack   1.增加未知学生的判断
1238
1239
  	@RequestMapping(value = "/list4")
  	public ModelAndView list4(Page page) throws Exception {
4b6a5239   孙向锦   管理员界面
1240
1241
1242
  		ModelAndView mv = this.getModelAndView();
  		PageData pd = new PageData();
  		pd = this.getPageData();
782f81b0   jack   1.增加未知学生的判断
1243
1244
  		String keywords = pd.getString("keywords"); // 关键词检索条件
  		if (null != keywords && !"".equals(keywords)) {
4b6a5239   孙向锦   管理员界面
1245
1246
  			pd.put("keywords", keywords.trim());
  		}
782f81b0   jack   1.增加未知学生的判断
1247
  		pd.put("PAPER_TYPE", "1");
4b6a5239   孙向锦   管理员界面
1248
  		page.setPd(pd);
8f88069a   jack   1.英文翻译(4)
1249
  		page.setLangIsChina(isChineseLanguageClient());
782f81b0   jack   1.增加未知学生的判断
1250
1251
1252
1253
1254
  		List<PageData> varList = paperService.list(page); // 列出Paper列表
  		// pd.put("PAPER_TYPE","2");
  		// List<PageData> varList2 = paperService.list(page); //列出Paper列表
  		// varList.addAll(varList2);
  		if (isChineseLanguageClient()) {
54a5b6ad   jack   1.英文翻译
1255
  			mv.setViewName("sunvote/paper/paper_list4");
782f81b0   jack   1.增加未知学生的判断
1256
  		} else {
54a5b6ad   jack   1.英文翻译
1257
1258
  			mv.setViewName("sunvote/paper/en_paper_list4");
  		}
782f81b0   jack   1.增加未知学生的判断
1259
1260
  
  		for (PageData p : varList) {
4b6a5239   孙向锦   管理员界面
1261
  			String examTime = p.getString("EXAM_TIME");
4926e3fd   jack   1.修复bug
1262
1263
1264
  			PageData temp = new PageData();
  			temp.put("PAPER_ID", p.getString("PAPER_ID"));
  			List<PageData> li = testpaperService.listAll(temp);
782f81b0   jack   1.增加未知学生的判断
1265
1266
  			if (examTime != null) {
  				try {
4b6a5239   孙向锦   管理员界面
1267
  					int et = Integer.parseInt(examTime);
782f81b0   jack   1.增加未知学生的判断
1268
1269
1270
1271
1272
1273
1274
  					String min = (et / 60) + "";
  					// if(min.length() < 2){
  					// min = "0" + min ;
  					// }
  					String sec = (et % 60) + "";
  					if (sec.length() < 2) {
  						sec = "0" + sec;
4b6a5239   孙向锦   管理员界面
1275
  					}
782f81b0   jack   1.增加未知学生的判断
1276
1277
1278
1279
  					if (et >= 60) {
  						examTime = min + "时" + sec + "分";
  					} else {
  						examTime = "0时" + sec + "分";
4b6a5239   孙向锦   管理员界面
1280
  					}
782f81b0   jack   1.增加未知学生的判断
1281
  				} catch (Exception e) {
4b6a5239   孙向锦   管理员界面
1282
1283
1284
  					e.printStackTrace();
  				}
  			}
782f81b0   jack   1.增加未知学生的判断
1285
  			if (examTime == null) {
f4a73594   jack   1.增加班级统计报表和导出
1286
  				examTime = "0";
4b6a5239   孙向锦   管理员界面
1287
1288
  			}
  			p.put("EXAM_TIME", examTime);
4926e3fd   jack   1.修复bug
1289
  			p.put("TEST_NUM", li.size());
4b6a5239   孙向锦   管理员界面
1290
  		}
782f81b0   jack   1.增加未知学生的判断
1291
  
8cac9719   孙向锦   试卷题目过滤
1292
1293
  		PageData tpd = new PageData();
  		tpd.put("ID", getUserID());
837ae11d   孙向锦   添加班長管理
1294
  		PageData adminInfos = v1Service.getAdminInfo(tpd);
782f81b0   jack   1.增加未知学生的判断
1295
1296
1297
1298
1299
  		List<PageData> gradeInfos = schoolgradesubjectService
  				.listAllGrade(adminInfos);
  		List<PageData> subjectInfos = schoolgradesubjectService
  				.listAllSubject(adminInfos);
  
8cac9719   孙向锦   试卷题目过滤
1300
1301
  		mv.addObject("gradeInfos", gradeInfos);
  		mv.addObject("subjectInfos", subjectInfos);
782f81b0   jack   1.增加未知学生的判断
1302
  
4b6a5239   孙向锦   管理员界面
1303
1304
  		mv.addObject("varList", varList);
  		mv.addObject("pd", pd);
782f81b0   jack   1.增加未知学生的判断
1305
  		mv.addObject("QX", Jurisdiction.getHC()); // 按钮权限
4b6a5239   孙向锦   管理员界面
1306
1307
  		return mv;
  	}
782f81b0   jack   1.增加未知学生的判断
1308
1309
1310
1311
  
  	/**
  	 * 列表
  	 * 
4b6a5239   孙向锦   管理员界面
1312
1313
1314
  	 * @param page
  	 * @throws Exception
  	 */
782f81b0   jack   1.增加未知学生的判断
1315
1316
  	@RequestMapping(value = "/list5")
  	public ModelAndView list5(Page page) throws Exception {
4b6a5239   孙向锦   管理员界面
1317
1318
1319
  		ModelAndView mv = this.getModelAndView();
  		PageData pd = new PageData();
  		pd = this.getPageData();
782f81b0   jack   1.增加未知学生的判断
1320
1321
  		String keywords = pd.getString("keywords"); // 关键词检索条件
  		if (null != keywords && !"".equals(keywords)) {
4b6a5239   孙向锦   管理员界面
1322
1323
  			pd.put("keywords", keywords.trim());
  		}
782f81b0   jack   1.增加未知学生的判断
1324
  		pd.put("PAPER_TYPE", "2");
4b6a5239   孙向锦   管理员界面
1325
1326
  		pd.put("USER_ID", this.getUserID());
  		page.setPd(pd);
54a5b6ad   jack   1.英文翻译
1327
  		page.setLangIsChina(isChineseLanguageClient());
782f81b0   jack   1.增加未知学生的判断
1328
1329
  		List<PageData> varList = paperService.list(page); // 列出Paper列表
  		if (isChineseLanguageClient()) {
54a5b6ad   jack   1.英文翻译
1330
  			mv.setViewName("sunvote/paper/paper_list5");
782f81b0   jack   1.增加未知学生的判断
1331
  		} else {
54a5b6ad   jack   1.英文翻译
1332
1333
  			mv.setViewName("sunvote/paper/en_paper_list5");
  		}
782f81b0   jack   1.增加未知学生的判断
1334
1335
  
  		for (PageData p : varList) {
4b6a5239   孙向锦   管理员界面
1336
  			String examTime = p.getString("EXAM_TIME");
4926e3fd   jack   1.修复bug
1337
1338
1339
  			PageData temp = new PageData();
  			temp.put("PAPER_ID", p.getString("PAPER_ID"));
  			List<PageData> li = testpaperService.listAll(temp);
782f81b0   jack   1.增加未知学生的判断
1340
1341
1342
  
  			if (examTime != null) {
  				try {
4b6a5239   孙向锦   管理员界面
1343
  					int et = Integer.parseInt(examTime);
782f81b0   jack   1.增加未知学生的判断
1344
1345
1346
1347
1348
1349
1350
  					String min = (et / 60) + "";
  					// if(min.length() < 2){
  					// min = "0" + min ;
  					// }
  					String sec = (et % 60) + "";
  					if (sec.length() < 2) {
  						sec = "0" + sec;
4b6a5239   孙向锦   管理员界面
1351
  					}
782f81b0   jack   1.增加未知学生的判断
1352
1353
1354
1355
  					if (et >= 60) {
  						examTime = min + "时" + sec + "分";
  					} else {
  						examTime = "0时" + sec + "分";
4b6a5239   孙向锦   管理员界面
1356
  					}
782f81b0   jack   1.增加未知学生的判断
1357
  				} catch (Exception e) {
4b6a5239   孙向锦   管理员界面
1358
1359
1360
  					e.printStackTrace();
  				}
  			}
782f81b0   jack   1.增加未知学生的判断
1361
  			if (examTime == null) {
f4a73594   jack   1.增加班级统计报表和导出
1362
  				examTime = "0";
4b6a5239   孙向锦   管理员界面
1363
1364
  			}
  			p.put("EXAM_TIME", examTime);
4926e3fd   jack   1.修复bug
1365
  			p.put("TEST_NUM", li.size());
4b6a5239   孙向锦   管理员界面
1366
  		}
782f81b0   jack   1.增加未知学生的判断
1367
  
4b6a5239   孙向锦   管理员界面
1368
1369
  		mv.addObject("varList", varList);
  		mv.addObject("pd", pd);
782f81b0   jack   1.增加未知学生的判断
1370
  		mv.addObject("QX", Jurisdiction.getHC()); // 按钮权限
4b6a5239   孙向锦   管理员界面
1371
1372
  		return mv;
  	}
782f81b0   jack   1.增加未知学生的判断
1373
1374
1375
1376
  
  	/**
  	 * 列表
  	 * 
c617106f   孙向锦   添加即时测功能
1377
1378
1379
  	 * @param page
  	 * @throws Exception
  	 */
782f81b0   jack   1.增加未知学生的判断
1380
1381
1382
1383
1384
  	@RequestMapping(value = "/list3")
  	public ModelAndView list3(Page page) throws Exception {
  		logBefore(logger, Jurisdiction.getUsername() + "列表Paper");
  		// if(!Jurisdiction.buttonJurisdiction(menuUrl, "cha")){return null;}
  		// //校验权限(无权查看时页面会有提示,如果不注释掉这句代码就无法进入列表页面,所以根据情况是否加入本句代码)
c617106f   孙向锦   添加即时测功能
1385
1386
1387
  		ModelAndView mv = this.getModelAndView();
  		PageData pd = new PageData();
  		pd = this.getPageData();
782f81b0   jack   1.增加未知学生的判断
1388
1389
  		String keywords = pd.getString("keywords"); // 关键词检索条件
  		if (null != keywords && !"".equals(keywords)) {
c617106f   孙向锦   添加即时测功能
1390
1391
1392
1393
  			pd.put("keywords", keywords.trim());
  		}
  		String userID = getUserID();
  		pd.put("USER_ID", userID);
782f81b0   jack   1.增加未知学生的判断
1394
  		pd.put("PAPER_TYPE", "101");
338594c8   孙向锦   添加教师端页面
1395
  		page.setPd(pd);
782f81b0   jack   1.增加未知学生的判断
1396
  		List<PageData> varList = paperService.list(page); // 列出Paper列表
338594c8   孙向锦   添加教师端页面
1397
  		mv.setViewName("sunvote/paper/paper_list2");
782f81b0   jack   1.增加未知学生的判断
1398
1399
  
  		for (PageData p : varList) {
338594c8   孙向锦   添加教师端页面
1400
  			String examTime = p.getString("EXAM_TIME");
782f81b0   jack   1.增加未知学生的判断
1401
1402
  			if (examTime != null) {
  				try {
338594c8   孙向锦   添加教师端页面
1403
  					int et = Integer.parseInt(examTime);
782f81b0   jack   1.增加未知学生的判断
1404
1405
1406
1407
1408
1409
1410
  					String min = (et / 60) + "";
  					// if(min.length() < 2){
  					// min = "0" + min ;
  					// }
  					String sec = (et % 60) + "";
  					if (sec.length() < 2) {
  						sec = "0" + sec;
338594c8   孙向锦   添加教师端页面
1411
  					}
782f81b0   jack   1.增加未知学生的判断
1412
1413
1414
1415
  					if (et > 60) {
  						examTime = min + "时" + sec + "分";
  					} else {
  						examTime = "0时" + sec + "分";
338594c8   孙向锦   添加教师端页面
1416
  					}
782f81b0   jack   1.增加未知学生的判断
1417
  				} catch (Exception e) {
338594c8   孙向锦   添加教师端页面
1418
1419
1420
  					e.printStackTrace();
  				}
  			}
782f81b0   jack   1.增加未知学生的判断
1421
  			if (examTime == null) {
f4a73594   jack   1.增加班级统计报表和导出
1422
  				examTime = "0";
338594c8   孙向锦   添加教师端页面
1423
1424
1425
  			}
  			p.put("EXAM_TIME", examTime);
  		}
782f81b0   jack   1.增加未知学生的判断
1426
  
338594c8   孙向锦   添加教师端页面
1427
1428
  		mv.addObject("varList", varList);
  		mv.addObject("pd", pd);
782f81b0   jack   1.增加未知学生的判断
1429
  		mv.addObject("QX", Jurisdiction.getHC()); // 按钮权限
338594c8   孙向锦   添加教师端页面
1430
1431
  		return mv;
  	}
782f81b0   jack   1.增加未知学生的判断
1432
1433
1434
1435
  
  	/**
  	 * 去新增页面
  	 * 
bed6e1fc   孙向锦   添加其他功能
1436
1437
1438
  	 * @param
  	 * @throws Exception
  	 */
782f81b0   jack   1.增加未知学生的判断
1439
1440
  	@RequestMapping(value = "/goAdd")
  	public ModelAndView goAdd() throws Exception {
bed6e1fc   孙向锦   添加其他功能
1441
1442
1443
1444
1445
1446
1447
  		ModelAndView mv = this.getModelAndView();
  		PageData pd = new PageData();
  		pd = this.getPageData();
  		mv.setViewName("sunvote/paper/paper_edit");
  		mv.addObject("msg", "save");
  		mv.addObject("pd", pd);
  		return mv;
782f81b0   jack   1.增加未知学生的判断
1448
1449
1450
1451
1452
  	}
  
  	/**
  	 * 去新增页面
  	 * 
338594c8   孙向锦   添加教师端页面
1453
1454
1455
  	 * @param
  	 * @throws Exception
  	 */
782f81b0   jack   1.增加未知学生的判断
1456
1457
  	@RequestMapping(value = "/goAddTest")
  	public ModelAndView goAddTest() throws Exception {
338594c8   孙向锦   添加教师端页面
1458
1459
1460
1461
1462
1463
1464
  		ModelAndView mv = this.getModelAndView();
  		PageData pd = new PageData();
  		pd = this.getPageData();
  		mv.setViewName("sunvote/paper/paper_edit2");
  		mv.addObject("msg", "newpaper");
  		mv.addObject("pd", pd);
  		return mv;
782f81b0   jack   1.增加未知学生的判断
1465
1466
1467
1468
1469
  	}
  
  	/**
  	 * 去修改页面
  	 * 
bed6e1fc   孙向锦   添加其他功能
1470
1471
1472
  	 * @param
  	 * @throws Exception
  	 */
782f81b0   jack   1.增加未知学生的判断
1473
1474
  	@RequestMapping(value = "/goEdit")
  	public ModelAndView goEdit() throws Exception {
bed6e1fc   孙向锦   添加其他功能
1475
1476
1477
  		ModelAndView mv = this.getModelAndView();
  		PageData pd = new PageData();
  		pd = this.getPageData();
782f81b0   jack   1.增加未知学生的判断
1478
  		pd = paperService.findById(pd); // 根据ID读取
bed6e1fc   孙向锦   添加其他功能
1479
1480
1481
1482
  		mv.setViewName("sunvote/paper/paper_edit");
  		mv.addObject("msg", "edit");
  		mv.addObject("pd", pd);
  		return mv;
782f81b0   jack   1.增加未知学生的判断
1483
1484
1485
1486
1487
  	}
  
  	/**
  	 * 批量删除
  	 * 
bed6e1fc   孙向锦   添加其他功能
1488
1489
1490
  	 * @param
  	 * @throws Exception
  	 */
782f81b0   jack   1.增加未知学生的判断
1491
  	@RequestMapping(value = "/deleteAll")
bed6e1fc   孙向锦   添加其他功能
1492
  	@ResponseBody
782f81b0   jack   1.增加未知学生的判断
1493
1494
1495
1496
1497
1498
  	public Object deleteAll() throws Exception {
  		logBefore(logger, Jurisdiction.getUsername() + "批量删除Paper");
  		// if(!Jurisdiction.buttonJurisdiction(menuUrl, "del")){return null;}
  		// //校验权限
  		PageData pd = new PageData();
  		Map<String, Object> map = new HashMap<String, Object>();
bed6e1fc   孙向锦   添加其他功能
1499
1500
1501
  		pd = this.getPageData();
  		List<PageData> pdList = new ArrayList<PageData>();
  		String DATA_IDS = pd.getString("DATA_IDS");
782f81b0   jack   1.增加未知学生的判断
1502
  		if (null != DATA_IDS && !"".equals(DATA_IDS)) {
bed6e1fc   孙向锦   添加其他功能
1503
1504
  			String ArrayDATA_IDS[] = DATA_IDS.split(",");
  			paperService.deleteAll(ArrayDATA_IDS);
338594c8   孙向锦   添加教师端页面
1505
  			paperquestionService.deleteAllPaper(ArrayDATA_IDS);
bed6e1fc   孙向锦   添加其他功能
1506
  			pd.put("msg", "ok");
782f81b0   jack   1.增加未知学生的判断
1507
  		} else {
bed6e1fc   孙向锦   添加其他功能
1508
1509
1510
1511
1512
1513
  			pd.put("msg", "no");
  		}
  		pdList.add(pd);
  		map.put("list", pdList);
  		return AppUtil.returnObject(pd, map);
  	}
782f81b0   jack   1.增加未知学生的判断
1514
1515
1516
1517
  
  	/**
  	 * 导出到excel
  	 * 
bed6e1fc   孙向锦   添加其他功能
1518
1519
1520
  	 * @param
  	 * @throws Exception
  	 */
782f81b0   jack   1.增加未知学生的判断
1521
1522
1523
1524
1525
1526
  	@RequestMapping(value = "/excel")
  	public ModelAndView exportExcel() throws Exception {
  		logBefore(logger, Jurisdiction.getUsername() + "导出Paper到excel");
  		if (!Jurisdiction.buttonJurisdiction(menuUrl, "cha")) {
  			return null;
  		}
bed6e1fc   孙向锦   添加其他功能
1527
1528
1529
  		ModelAndView mv = new ModelAndView();
  		PageData pd = new PageData();
  		pd = this.getPageData();
782f81b0   jack   1.增加未知学生的判断
1530
  		Map<String, Object> dataMap = new HashMap<String, Object>();
bed6e1fc   孙向锦   添加其他功能
1531
  		List<String> titles = new ArrayList<String>();
782f81b0   jack   1.增加未知学生的判断
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
  		titles.add("试卷标题"); // 1
  		titles.add("出卷老师"); // 2
  		titles.add("试卷类型"); // 3
  		titles.add("科目"); // 4
  		titles.add("年级"); // 5
  		titles.add("学校"); // 6
  		titles.add("创建时间"); // 7
  		titles.add("修改时间"); // 8
  		titles.add("建议考试时长"); // 9
  		titles.add("试卷状态"); // 10
  		titles.add("备注"); // 11
bed6e1fc   孙向锦   添加其他功能
1543
1544
1545
  		dataMap.put("titles", titles);
  		List<PageData> varOList = paperService.listAll(pd);
  		List<PageData> varList = new ArrayList<PageData>();
782f81b0   jack   1.增加未知学生的判断
1546
  		for (int i = 0; i < varOList.size(); i++) {
bed6e1fc   孙向锦   添加其他功能
1547
  			PageData vpd = new PageData();
782f81b0   jack   1.增加未知学生的判断
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
  			vpd.put("var1", varOList.get(i).getString("TITLE")); // 1
  			vpd.put("var2", varOList.get(i).getString("USER_ID")); // 2
  			vpd.put("var3", varOList.get(i).getString("PAPER_TYPE")); // 3
  			vpd.put("var4", varOList.get(i).getString("SUBJECT_ID")); // 4
  			vpd.put("var5", varOList.get(i).getString("GRADE_ID")); // 5
  			vpd.put("var6", varOList.get(i).getString("SCHOOL_ID")); // 6
  			vpd.put("var7", varOList.get(i).getString("CREATE_DATE")); // 7
  			vpd.put("var8", varOList.get(i).getString("MODIFY_DATE")); // 8
  			vpd.put("var9", varOList.get(i).getString("EXAM_TIME")); // 9
  			vpd.put("var10", varOList.get(i).getString("PAPER_STATE")); // 10
  			vpd.put("var11", varOList.get(i).getString("REMARK")); // 11
bed6e1fc   孙向锦   添加其他功能
1559
1560
1561
1562
  			varList.add(vpd);
  		}
  		dataMap.put("varList", varList);
  		ObjectExcelView erv = new ObjectExcelView();
782f81b0   jack   1.增加未知学生的判断
1563
  		mv = new ModelAndView(erv, dataMap);
bed6e1fc   孙向锦   添加其他功能
1564
1565
  		return mv;
  	}
782f81b0   jack   1.增加未知学生的判断
1566
  
bed6e1fc   孙向锦   添加其他功能
1567
  	@InitBinder
782f81b0   jack   1.增加未知学生的判断
1568
  	public void initBinder(WebDataBinder binder) {
bed6e1fc   孙向锦   添加其他功能
1569
  		DateFormat format = new SimpleDateFormat("yyyy-MM-dd");
782f81b0   jack   1.增加未知学生的判断
1570
1571
  		binder.registerCustomEditor(Date.class, new CustomDateEditor(format,
  				true));
bed6e1fc   孙向锦   添加其他功能
1572
1573
  	}
  }