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
758
  			List<String> classId = new ArrayList();
  			PageData sclass = new PageData();
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
806
807
808
809
810
  						if(!classId.contains(item.getString("CLASS_ID"))){
  							classId.add(item.getString("CLASS_ID"));
  							sclass.put("CLASS_ID", item.get("CLASS_ID"));
  							sclass.put("CLASS_NAME", item.get("CLASS_NAME"));
  							sclass_list.add(sclass);
  						}
  						
782f81b0   jack   1.增加未知学生的判断
811
812
813
814
815
816
817
818
819
820
821
822
  						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.修改年级分析报表内容
823
824
  						stu.put("STUDENT_NUMBER", item.get("STUDENT_NUMBER"));
  						stu.put("STUDENT_PADID", item.get("STUDENT_PADID"));
782f81b0   jack   1.增加未知学生的判断
825
826
827
828
829
  						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.增加老师端可以看到年级卷
830
  						
89ac0783   jack   1.添加年级卷分析功能
831
  					}
58e024ae   jack   1.修改logo
832
  				}
58e024ae   jack   1.修改logo
833
834
  			}
  		}
782f81b0   jack   1.增加未知学生的判断
835
  		Collections.sort(temp, new Comparator<PageData>() {
89ac0783   jack   1.添加年级卷分析功能
836
837
838
  
  			@Override
  			public int compare(PageData o1, PageData o2) {
782f81b0   jack   1.增加未知学生的判断
839
840
841
842
843
844
845
  
  				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.添加年级卷分析功能
846
847
  				return o2GetScore.compareTo(o1GetScore);
  			}
782f81b0   jack   1.增加未知学生的判断
848
  
89ac0783   jack   1.添加年级卷分析功能
849
  		});
78353cf9   jack   1.增加老师端可以看到年级卷
850
  		
58e024ae   jack   1.修改logo
851
  		mv.setViewName("sunvote/paper/test_list3");
78353cf9   jack   1.增加老师端可以看到年级卷
852
  		mv.addObject("sclass", sclass_list);
89ac0783   jack   1.添加年级卷分析功能
853
  		mv.addObject("varList", temp);
782f81b0   jack   1.增加未知学生的判断
854
  		mv.addObject("pd", pd);
58e024ae   jack   1.修改logo
855
856
857
  		res.setData(saveData);
  		return mv;
  	}
782f81b0   jack   1.增加未知学生的判断
858
859
860
  
  	@RequestMapping(value = "/export3")
  	public ModelAndView export3() throws Exception {
89ac0783   jack   1.添加年级卷分析功能
861
862
863
864
  		ModelAndView mv = this.getModelAndView();
  		PageData pd = new PageData();
  		List<PageData> temp = new ArrayList<PageData>();
  		PageData saveData = new PageData();
782f81b0   jack   1.增加未知学生的判断
865
  
89ac0783   jack   1.添加年级卷分析功能
866
867
  		ResponseGson<PageData> res = new ResponseGson();
  		pd = this.getPageData();
782f81b0   jack   1.增加未知学生的判断
868
869
  		if (pd.containsKey("PAPER_ID")) {
  
89ac0783   jack   1.添加年级卷分析功能
870
871
  			List<PageData> list = studenttestService.findTestInfoByPid(pd);
  			PageData paper = paperService.findById(pd);
782f81b0   jack   1.增加未知学生的判断
872
  			if (paper != null) {
89ac0783   jack   1.添加年级卷分析功能
873
874
875
876
877
878
  				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.增加未知学生的判断
879
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
  			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.添加年级卷分析功能
918
919
920
921
922
923
  					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.增加未知学生的判断
924
  					if (item.getString("LOST_TEST").isEmpty()) {
89ac0783   jack   1.添加年级卷分析功能
925
  						test.put("SCORE", item.get("SCORE"));
782f81b0   jack   1.增加未知学生的判断
926
  					} else {
89ac0783   jack   1.添加年级卷分析功能
927
928
929
930
931
  						test.put("SCORE", "--");
  						lost_num++;
  					}
  					test.put("AVG_SCORE", item.get("AVG_SCORE"));
  					testList.add(test);
782f81b0   jack   1.增加未知学生的判断
932
  					stu.put("STUDENT_TOTAL", item.get("SCORE"));
89ac0783   jack   1.添加年级卷分析功能
933
  					stu.put("TEST_LIST", testList);
41772c65   jack   1.修改bug
934
935
  					stu.put("STUDENT_NUMBER", item.get("STUDENT_NUMBER"));
  					stu.put("STUDENT_PADID", item.get("STUDENT_PADID"));
782f81b0   jack   1.增加未知学生的判断
936
  					stu.put("TEST_NUM", testList.size() - lost_num);
89ac0783   jack   1.添加年级卷分析功能
937
938
939
940
  					stu.put("LOST_NUM", lost_num);
  					sid.add(item.getString("STUDENT_ID"));
  					temp.add(stu);
  				}
782f81b0   jack   1.增加未知学生的判断
941
  				}
89ac0783   jack   1.添加年级卷分析功能
942
943
  			}
  		}
782f81b0   jack   1.增加未知学生的判断
944
  		Collections.sort(temp, new Comparator<PageData>() {
89ac0783   jack   1.添加年级卷分析功能
945
946
947
  
  			@Override
  			public int compare(PageData o1, PageData o2) {
782f81b0   jack   1.增加未知学生的判断
948
949
950
951
952
953
954
  
  				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.添加年级卷分析功能
955
956
  				return o2GetScore.compareTo(o1GetScore);
  			}
782f81b0   jack   1.增加未知学生的判断
957
  
89ac0783   jack   1.添加年级卷分析功能
958
959
960
  		});
  
  		mv.addObject("varList", temp);
782f81b0   jack   1.增加未知学生的判断
961
962
963
  		mv.addObject("pd", pd);
  
  		Map<String, Object> dataMap = new HashMap<String, Object>();
89ac0783   jack   1.添加年级卷分析功能
964
  		List<String> titles = new ArrayList<String>();
782f81b0   jack   1.增加未知学生的判断
965
  		titles.add("学生姓名"); // 1
41772c65   jack   1.修改bug
966
967
968
969
970
971
  		titles.add("学号"); // 2
  		titles.add("键盘号"); // 3
  		titles.add("班级"); // 4
  		titles.add("综合排名"); // 5
  		//titles.add("个人平均得分"); // 4
  		//titles.add("个人平均得分率"); // 5
782f81b0   jack   1.增加未知学生的判断
972
  		titles.add("个人得分"); // 6
41772c65   jack   1.修改bug
973
974
  		//titles.add("测验平均分"); // 7
  		titles.add("测验时间"); // 7
782f81b0   jack   1.增加未知学生的判断
975
  
89ac0783   jack   1.添加年级卷分析功能
976
977
978
  		dataMap.put("titles", titles);
  		List<PageData> varOList = temp;
  		List<PageData> varList = new ArrayList<PageData>();
782f81b0   jack   1.增加未知学生的判断
979
980
981
  		DecimalFormat decimalFormat = new DecimalFormat("0.00");
  		
  		for (int i = 0; i < varOList.size(); i++) {
89ac0783   jack   1.添加年级卷分析功能
982
  			PageData vpd = new PageData();
782f81b0   jack   1.增加未知学生的判断
983
984
  
  			vpd.put("var1", varOList.get(i).getString("STUDENT_NAME")); // 1
41772c65   jack   1.修改bug
985
986
987
988
  			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.增加未知学生的判断
989
990
991
  			List<PageData> test_list = (List<PageData>) varOList.get(i).get(
  					"TEST_LIST");
  
89ac0783   jack   1.添加年级卷分析功能
992
  			List<String> score = new ArrayList<String>();
41772c65   jack   1.修改bug
993
  			
89ac0783   jack   1.添加年级卷分析功能
994
  			List<String> CREATE_DATE = new ArrayList<String>();
782f81b0   jack   1.增加未知学生的判断
995
  			for (int x = 0; x < test_list.size(); x++) {
89ac0783   jack   1.添加年级卷分析功能
996
  				score.add(test_list.get(x).getString("SCORE"));
89ac0783   jack   1.添加年级卷分析功能
997
  				CREATE_DATE.add(test_list.get(x).getString("CREATE_DATE"));
782f81b0   jack   1.增加未知学生的判断
998
  
89ac0783   jack   1.添加年级卷分析功能
999
1000
  			}
  			vpd.put("var6", score);
41772c65   jack   1.修改bug
1001
  			vpd.put("var7", CREATE_DATE);
89ac0783   jack   1.添加年级卷分析功能
1002
  			varList.add(vpd);
782f81b0   jack   1.增加未知学生的判断
1003
  			
89ac0783   jack   1.添加年级卷分析功能
1004
1005
1006
  		}
  		dataMap.put("varList", varList);
  		ObjectExcelView2 erv = new ObjectExcelView2();
782f81b0   jack   1.增加未知学生的判断
1007
  		mv = new ModelAndView(erv, dataMap);
89ac0783   jack   1.添加年级卷分析功能
1008
1009
1010
  
  		return mv;
  	}
782f81b0   jack   1.增加未知学生的判断
1011
1012
1013
1014
1015
1016
  
  	@RequestMapping(value = "/iteminfo")
  	public ModelAndView iteminfo() throws Exception {
  		logBefore(logger, Jurisdiction.getUsername() + "Paper详细信息");
  		// if(!Jurisdiction.buttonJurisdiction(menuUrl, "cha")){return null;}
  		// //校验权限(无权查看时页面会有提示,如果不注释掉这句代码就无法进入列表页面,所以根据情况是否加入本句代码)
338594c8   孙向锦   添加教师端页面
1017
1018
1019
  		ModelAndView mv = this.getModelAndView();
  		PageData pd = new PageData();
  		pd = this.getPageData();
782f81b0   jack   1.增加未知学生的判断
1020
1021
1022
  
  		if (pd.containsKey("PAPER_ID")) {
  			try {
338594c8   孙向锦   添加教师端页面
1023
1024
  				Paper paper = new Paper();
  				PageData ppd = paperService.findById(pd);
782f81b0   jack   1.增加未知学生的判断
1025
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
  				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   孙向锦   添加教师端页面
1092
1093
  						}
  					}
782f81b0   jack   1.增加未知学生的判断
1094
1095
1096
  					pd.put("JSON", paper.toJson());
  					logger.info(paper.toJson());
  
338594c8   孙向锦   添加教师端页面
1097
  				}
782f81b0   jack   1.增加未知学生的判断
1098
  			} catch (Exception ex) {
338594c8   孙向锦   添加教师端页面
1099
1100
1101
  				ex.printStackTrace();
  			}
  		}
782f81b0   jack   1.增加未知学生的判断
1102
  		if (isChineseLanguageClient()) {
fd0087a8   孙向锦   添加英语语言
1103
  			mv.setViewName("sunvote/teacher/creat_question");
782f81b0   jack   1.增加未知学生的判断
1104
  		} else {
fd0087a8   孙向锦   添加英语语言
1105
1106
  			mv.setViewName("sunvote/teacher/en_creat_question");
  		}
338594c8   孙向锦   添加教师端页面
1107
  		mv.addObject("pd", pd);
782f81b0   jack   1.增加未知学生的判断
1108
  		mv.addObject("QX", Jurisdiction.getHC()); // 按钮权限
338594c8   孙向锦   添加教师端页面
1109
1110
  		return mv;
  	}
782f81b0   jack   1.增加未知学生的判断
1111
1112
1113
1114
  
  	@RequestMapping(value = "/npaper")
  	public ModelAndView newpaper() throws Exception {
  		logBefore(logger, Jurisdiction.getUsername() + "Paper详细信息");
338594c8   孙向锦   添加教师端页面
1115
1116
1117
  		ModelAndView mv = this.getModelAndView();
  		PageData pd = new PageData();
  		pd = this.getPageData();
782f81b0   jack   1.增加未知学生的判断
1118
  		String paperType = pd.getString("PAPER_TYPE");
338594c8   孙向锦   添加教师端页面
1119
1120
1121
1122
  		Paper paper = new Paper();
  		paper.setTitle(pd.getString("NAME"));
  		paper.setExam_time(pd.getString("TIME"));
  		Session session = Jurisdiction.getSession();
782f81b0   jack   1.增加未知学生的判断
1123
  		User user = (User) session.getAttribute(Const.SESSION_USER);
338594c8   孙向锦   添加教师端页面
1124
  		paper.setUser_id(user.getUSER_ID());
782f81b0   jack   1.增加未知学生的判断
1125
1126
  		paper.setPaper_type(paperType == null || "".equals(paperType.trim()) ? "1"
  				: paperType);
eca4feb5   孙向锦   管理员功能完善
1127
  		String subjectId = pd.getString("SUBJECT_ID");
782f81b0   jack   1.增加未知学生的判断
1128
1129
  		paper.setSubject_id(subjectId == null || "".equals(subjectId.trim()) ? getSubjectId()
  				: subjectId);
eca4feb5   孙向锦   管理员功能完善
1130
  		String gradeId = pd.getString("GRADE_ID");
782f81b0   jack   1.增加未知学生的判断
1131
1132
1133
1134
1135
  		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   孙向锦   添加教师端页面
1136
  		paper.setQuestions(new ArrayList<Question>());
782f81b0   jack   1.增加未知学生的判断
1137
  
338594c8   孙向锦   添加教师端页面
1138
1139
  		pd.put("JSON", paper.toJson());
  		logger.info(paper.toJson());
782f81b0   jack   1.增加未知学生的判断
1140
  
83b5ddeb   孙向锦   模板添加
1141
  		String TEMPLATE_ID = pd.getString("TEMPLATE_ID");
782f81b0   jack   1.增加未知学生的判断
1142
  		if (TEMPLATE_ID != null && !"".equals(TEMPLATE_ID)) {
83b5ddeb   孙向锦   模板添加
1143
1144
1145
1146
  			pd.put("PAGETEMPLATE_ID", TEMPLATE_ID);
  			PageData template = pagetemplateService.findById(pd);
  			mv.addObject("TEMPLEATE", template);
  		}
782f81b0   jack   1.增加未知学生的判断
1147
1148
  
  		if (isChineseLanguageClient()) {
fd0087a8   孙向锦   添加英语语言
1149
  			mv.setViewName("sunvote/teacher/creat_question");
782f81b0   jack   1.增加未知学生的判断
1150
  		} else {
fd0087a8   孙向锦   添加英语语言
1151
1152
  			mv.setViewName("sunvote/teacher/en_creat_question");
  		}
338594c8   孙向锦   添加教师端页面
1153
  		mv.addObject("pd", pd);
782f81b0   jack   1.增加未知学生的判断
1154
  		if (paperType != null && "2".equals(paperType)) {
4b6a5239   孙向锦   管理员界面
1155
  			mv.addObject("JUMP_URL", "/main/admin");
782f81b0   jack   1.增加未知学生的判断
1156
  		} else {
4b6a5239   孙向锦   管理员界面
1157
1158
  			mv.addObject("JUMP_URL", "/main/teacher");
  		}
782f81b0   jack   1.增加未知学生的判断
1159
  		mv.addObject("QX", Jurisdiction.getHC()); // 按钮权限
338594c8   孙向锦   添加教师端页面
1160
1161
  		return mv;
  	}
782f81b0   jack   1.增加未知学生的判断
1162
1163
1164
1165
  
  	/**
  	 * 列表
  	 * 
338594c8   孙向锦   添加教师端页面
1166
1167
1168
  	 * @param page
  	 * @throws Exception
  	 */
782f81b0   jack   1.增加未知学生的判断
1169
1170
1171
1172
1173
  	@RequestMapping(value = "/list2")
  	public ModelAndView list2(Page page) throws Exception {
  		logBefore(logger, Jurisdiction.getUsername() + "列表Paper");
  		// if(!Jurisdiction.buttonJurisdiction(menuUrl, "cha")){return null;}
  		// //校验权限(无权查看时页面会有提示,如果不注释掉这句代码就无法进入列表页面,所以根据情况是否加入本句代码)
338594c8   孙向锦   添加教师端页面
1174
1175
1176
  		ModelAndView mv = this.getModelAndView();
  		PageData pd = new PageData();
  		pd = this.getPageData();
782f81b0   jack   1.增加未知学生的判断
1177
1178
  		String keywords = pd.getString("keywords"); // 关键词检索条件
  		if (null != keywords && !"".equals(keywords)) {
338594c8   孙向锦   添加教师端页面
1179
1180
  			pd.put("keywords", keywords.trim());
  		}
a51b67cf   孙向锦   交互第一个版本
1181
1182
  		String userID = getUserID();
  		pd.put("USER_ID", userID);
782f81b0   jack   1.增加未知学生的判断
1183
  		pd.put("PAPER_TYPE", "1");
c617106f   孙向锦   添加即时测功能
1184
  		page.setPd(pd);
78353cf9   jack   1.增加老师端可以看到年级卷
1185
  		List<PageData> varList = paperService.listAllBySidAndTid(pd); // 列出Paper列表
fd0087a8   孙向锦   添加英语语言
1186
  		page.setLangIsChina(isChineseLanguageClient());
782f81b0   jack   1.增加未知学生的判断
1187
  		if (isChineseLanguageClient()) {
fd0087a8   孙向锦   添加英语语言
1188
  			mv.setViewName("sunvote/paper/paper_list2");
782f81b0   jack   1.增加未知学生的判断
1189
  		} else {
fd0087a8   孙向锦   添加英语语言
1190
1191
  			mv.setViewName("sunvote/paper/en_paper_list2");
  		}
782f81b0   jack   1.增加未知学生的判断
1192
1193
  
  		for (PageData p : varList) {
c617106f   孙向锦   添加即时测功能
1194
  			String examTime = p.getString("EXAM_TIME");
579f3266   jack   1.studenttest增加增加...
1195
1196
1197
  			PageData temp = new PageData();
  			temp.put("PAPER_ID", p.getString("PAPER_ID"));
  			List<PageData> li = testpaperService.listAll(temp);
782f81b0   jack   1.增加未知学生的判断
1198
1199
  			if (examTime != null) {
  				try {
c617106f   孙向锦   添加即时测功能
1200
  					int et = Integer.parseInt(examTime);
782f81b0   jack   1.增加未知学生的判断
1201
1202
1203
1204
1205
1206
1207
  					String min = (et / 60) + "";
  					// if(min.length() < 2){
  					// min = "0" + min ;
  					// }
  					String sec = (et % 60) + "";
  					if (sec.length() < 2) {
  						sec = "0" + sec;
c617106f   孙向锦   添加即时测功能
1208
  					}
782f81b0   jack   1.增加未知学生的判断
1209
1210
1211
1212
  					if (et >= 60) {
  						examTime = min + "时" + sec + "分";
  					} else {
  						examTime = "0时" + sec + "分";
c617106f   孙向锦   添加即时测功能
1213
  					}
782f81b0   jack   1.增加未知学生的判断
1214
  				} catch (Exception e) {
c617106f   孙向锦   添加即时测功能
1215
1216
1217
  					e.printStackTrace();
  				}
  			}
782f81b0   jack   1.增加未知学生的判断
1218
  			if (examTime == null) {
c617106f   孙向锦   添加即时测功能
1219
1220
1221
  				examTime = "00:00";
  			}
  			p.put("EXAM_TIME", examTime);
579f3266   jack   1.studenttest增加增加...
1222
  			p.put("TEST_NUM", li.size());
c617106f   孙向锦   添加即时测功能
1223
  		}
782f81b0   jack   1.增加未知学生的判断
1224
  
c617106f   孙向锦   添加即时测功能
1225
1226
  		mv.addObject("varList", varList);
  		mv.addObject("pd", pd);
782f81b0   jack   1.增加未知学生的判断
1227
  		mv.addObject("QX", Jurisdiction.getHC()); // 按钮权限
c617106f   孙向锦   添加即时测功能
1228
1229
  		return mv;
  	}
782f81b0   jack   1.增加未知学生的判断
1230
1231
1232
1233
  
  	/**
  	 * 列表
  	 * 
4b6a5239   孙向锦   管理员界面
1234
1235
1236
  	 * @param page
  	 * @throws Exception
  	 */
782f81b0   jack   1.增加未知学生的判断
1237
1238
  	@RequestMapping(value = "/list4")
  	public ModelAndView list4(Page page) throws Exception {
4b6a5239   孙向锦   管理员界面
1239
1240
1241
  		ModelAndView mv = this.getModelAndView();
  		PageData pd = new PageData();
  		pd = this.getPageData();
782f81b0   jack   1.增加未知学生的判断
1242
1243
  		String keywords = pd.getString("keywords"); // 关键词检索条件
  		if (null != keywords && !"".equals(keywords)) {
4b6a5239   孙向锦   管理员界面
1244
1245
  			pd.put("keywords", keywords.trim());
  		}
782f81b0   jack   1.增加未知学生的判断
1246
  		pd.put("PAPER_TYPE", "1");
4b6a5239   孙向锦   管理员界面
1247
  		page.setPd(pd);
8f88069a   jack   1.英文翻译(4)
1248
  		page.setLangIsChina(isChineseLanguageClient());
782f81b0   jack   1.增加未知学生的判断
1249
1250
1251
1252
1253
  		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.英文翻译
1254
  			mv.setViewName("sunvote/paper/paper_list4");
782f81b0   jack   1.增加未知学生的判断
1255
  		} else {
54a5b6ad   jack   1.英文翻译
1256
1257
  			mv.setViewName("sunvote/paper/en_paper_list4");
  		}
782f81b0   jack   1.增加未知学生的判断
1258
1259
  
  		for (PageData p : varList) {
4b6a5239   孙向锦   管理员界面
1260
  			String examTime = p.getString("EXAM_TIME");
4926e3fd   jack   1.修复bug
1261
1262
1263
  			PageData temp = new PageData();
  			temp.put("PAPER_ID", p.getString("PAPER_ID"));
  			List<PageData> li = testpaperService.listAll(temp);
782f81b0   jack   1.增加未知学生的判断
1264
1265
  			if (examTime != null) {
  				try {
4b6a5239   孙向锦   管理员界面
1266
  					int et = Integer.parseInt(examTime);
782f81b0   jack   1.增加未知学生的判断
1267
1268
1269
1270
1271
1272
1273
  					String min = (et / 60) + "";
  					// if(min.length() < 2){
  					// min = "0" + min ;
  					// }
  					String sec = (et % 60) + "";
  					if (sec.length() < 2) {
  						sec = "0" + sec;
4b6a5239   孙向锦   管理员界面
1274
  					}
782f81b0   jack   1.增加未知学生的判断
1275
1276
1277
1278
  					if (et >= 60) {
  						examTime = min + "时" + sec + "分";
  					} else {
  						examTime = "0时" + sec + "分";
4b6a5239   孙向锦   管理员界面
1279
  					}
782f81b0   jack   1.增加未知学生的判断
1280
  				} catch (Exception e) {
4b6a5239   孙向锦   管理员界面
1281
1282
1283
  					e.printStackTrace();
  				}
  			}
782f81b0   jack   1.增加未知学生的判断
1284
  			if (examTime == null) {
f4a73594   jack   1.增加班级统计报表和导出
1285
  				examTime = "0";
4b6a5239   孙向锦   管理员界面
1286
1287
  			}
  			p.put("EXAM_TIME", examTime);
4926e3fd   jack   1.修复bug
1288
  			p.put("TEST_NUM", li.size());
4b6a5239   孙向锦   管理员界面
1289
  		}
782f81b0   jack   1.增加未知学生的判断
1290
  
8cac9719   孙向锦   试卷题目过滤
1291
1292
  		PageData tpd = new PageData();
  		tpd.put("ID", getUserID());
837ae11d   孙向锦   添加班長管理
1293
  		PageData adminInfos = v1Service.getAdminInfo(tpd);
782f81b0   jack   1.增加未知学生的判断
1294
1295
1296
1297
1298
  		List<PageData> gradeInfos = schoolgradesubjectService
  				.listAllGrade(adminInfos);
  		List<PageData> subjectInfos = schoolgradesubjectService
  				.listAllSubject(adminInfos);
  
8cac9719   孙向锦   试卷题目过滤
1299
1300
  		mv.addObject("gradeInfos", gradeInfos);
  		mv.addObject("subjectInfos", subjectInfos);
782f81b0   jack   1.增加未知学生的判断
1301
  
4b6a5239   孙向锦   管理员界面
1302
1303
  		mv.addObject("varList", varList);
  		mv.addObject("pd", pd);
782f81b0   jack   1.增加未知学生的判断
1304
  		mv.addObject("QX", Jurisdiction.getHC()); // 按钮权限
4b6a5239   孙向锦   管理员界面
1305
1306
  		return mv;
  	}
782f81b0   jack   1.增加未知学生的判断
1307
1308
1309
1310
  
  	/**
  	 * 列表
  	 * 
4b6a5239   孙向锦   管理员界面
1311
1312
1313
  	 * @param page
  	 * @throws Exception
  	 */
782f81b0   jack   1.增加未知学生的判断
1314
1315
  	@RequestMapping(value = "/list5")
  	public ModelAndView list5(Page page) throws Exception {
4b6a5239   孙向锦   管理员界面
1316
1317
1318
  		ModelAndView mv = this.getModelAndView();
  		PageData pd = new PageData();
  		pd = this.getPageData();
782f81b0   jack   1.增加未知学生的判断
1319
1320
  		String keywords = pd.getString("keywords"); // 关键词检索条件
  		if (null != keywords && !"".equals(keywords)) {
4b6a5239   孙向锦   管理员界面
1321
1322
  			pd.put("keywords", keywords.trim());
  		}
782f81b0   jack   1.增加未知学生的判断
1323
  		pd.put("PAPER_TYPE", "2");
4b6a5239   孙向锦   管理员界面
1324
1325
  		pd.put("USER_ID", this.getUserID());
  		page.setPd(pd);
54a5b6ad   jack   1.英文翻译
1326
  		page.setLangIsChina(isChineseLanguageClient());
782f81b0   jack   1.增加未知学生的判断
1327
1328
  		List<PageData> varList = paperService.list(page); // 列出Paper列表
  		if (isChineseLanguageClient()) {
54a5b6ad   jack   1.英文翻译
1329
  			mv.setViewName("sunvote/paper/paper_list5");
782f81b0   jack   1.增加未知学生的判断
1330
  		} else {
54a5b6ad   jack   1.英文翻译
1331
1332
  			mv.setViewName("sunvote/paper/en_paper_list5");
  		}
782f81b0   jack   1.增加未知学生的判断
1333
1334
  
  		for (PageData p : varList) {
4b6a5239   孙向锦   管理员界面
1335
  			String examTime = p.getString("EXAM_TIME");
4926e3fd   jack   1.修复bug
1336
1337
1338
  			PageData temp = new PageData();
  			temp.put("PAPER_ID", p.getString("PAPER_ID"));
  			List<PageData> li = testpaperService.listAll(temp);
782f81b0   jack   1.增加未知学生的判断
1339
1340
1341
  
  			if (examTime != null) {
  				try {
4b6a5239   孙向锦   管理员界面
1342
  					int et = Integer.parseInt(examTime);
782f81b0   jack   1.增加未知学生的判断
1343
1344
1345
1346
1347
1348
1349
  					String min = (et / 60) + "";
  					// if(min.length() < 2){
  					// min = "0" + min ;
  					// }
  					String sec = (et % 60) + "";
  					if (sec.length() < 2) {
  						sec = "0" + sec;
4b6a5239   孙向锦   管理员界面
1350
  					}
782f81b0   jack   1.增加未知学生的判断
1351
1352
1353
1354
  					if (et >= 60) {
  						examTime = min + "时" + sec + "分";
  					} else {
  						examTime = "0时" + sec + "分";
4b6a5239   孙向锦   管理员界面
1355
  					}
782f81b0   jack   1.增加未知学生的判断
1356
  				} catch (Exception e) {
4b6a5239   孙向锦   管理员界面
1357
1358
1359
  					e.printStackTrace();
  				}
  			}
782f81b0   jack   1.增加未知学生的判断
1360
  			if (examTime == null) {
f4a73594   jack   1.增加班级统计报表和导出
1361
  				examTime = "0";
4b6a5239   孙向锦   管理员界面
1362
1363
  			}
  			p.put("EXAM_TIME", examTime);
4926e3fd   jack   1.修复bug
1364
  			p.put("TEST_NUM", li.size());
4b6a5239   孙向锦   管理员界面
1365
  		}
782f81b0   jack   1.增加未知学生的判断
1366
  
4b6a5239   孙向锦   管理员界面
1367
1368
  		mv.addObject("varList", varList);
  		mv.addObject("pd", pd);
782f81b0   jack   1.增加未知学生的判断
1369
  		mv.addObject("QX", Jurisdiction.getHC()); // 按钮权限
4b6a5239   孙向锦   管理员界面
1370
1371
  		return mv;
  	}
782f81b0   jack   1.增加未知学生的判断
1372
1373
1374
1375
  
  	/**
  	 * 列表
  	 * 
c617106f   孙向锦   添加即时测功能
1376
1377
1378
  	 * @param page
  	 * @throws Exception
  	 */
782f81b0   jack   1.增加未知学生的判断
1379
1380
1381
1382
1383
  	@RequestMapping(value = "/list3")
  	public ModelAndView list3(Page page) throws Exception {
  		logBefore(logger, Jurisdiction.getUsername() + "列表Paper");
  		// if(!Jurisdiction.buttonJurisdiction(menuUrl, "cha")){return null;}
  		// //校验权限(无权查看时页面会有提示,如果不注释掉这句代码就无法进入列表页面,所以根据情况是否加入本句代码)
c617106f   孙向锦   添加即时测功能
1384
1385
1386
  		ModelAndView mv = this.getModelAndView();
  		PageData pd = new PageData();
  		pd = this.getPageData();
782f81b0   jack   1.增加未知学生的判断
1387
1388
  		String keywords = pd.getString("keywords"); // 关键词检索条件
  		if (null != keywords && !"".equals(keywords)) {
c617106f   孙向锦   添加即时测功能
1389
1390
1391
1392
  			pd.put("keywords", keywords.trim());
  		}
  		String userID = getUserID();
  		pd.put("USER_ID", userID);
782f81b0   jack   1.增加未知学生的判断
1393
  		pd.put("PAPER_TYPE", "101");
338594c8   孙向锦   添加教师端页面
1394
  		page.setPd(pd);
782f81b0   jack   1.增加未知学生的判断
1395
  		List<PageData> varList = paperService.list(page); // 列出Paper列表
338594c8   孙向锦   添加教师端页面
1396
  		mv.setViewName("sunvote/paper/paper_list2");
782f81b0   jack   1.增加未知学生的判断
1397
1398
  
  		for (PageData p : varList) {
338594c8   孙向锦   添加教师端页面
1399
  			String examTime = p.getString("EXAM_TIME");
782f81b0   jack   1.增加未知学生的判断
1400
1401
  			if (examTime != null) {
  				try {
338594c8   孙向锦   添加教师端页面
1402
  					int et = Integer.parseInt(examTime);
782f81b0   jack   1.增加未知学生的判断
1403
1404
1405
1406
1407
1408
1409
  					String min = (et / 60) + "";
  					// if(min.length() < 2){
  					// min = "0" + min ;
  					// }
  					String sec = (et % 60) + "";
  					if (sec.length() < 2) {
  						sec = "0" + sec;
338594c8   孙向锦   添加教师端页面
1410
  					}
782f81b0   jack   1.增加未知学生的判断
1411
1412
1413
1414
  					if (et > 60) {
  						examTime = min + "时" + sec + "分";
  					} else {
  						examTime = "0时" + sec + "分";
338594c8   孙向锦   添加教师端页面
1415
  					}
782f81b0   jack   1.增加未知学生的判断
1416
  				} catch (Exception e) {
338594c8   孙向锦   添加教师端页面
1417
1418
1419
  					e.printStackTrace();
  				}
  			}
782f81b0   jack   1.增加未知学生的判断
1420
  			if (examTime == null) {
f4a73594   jack   1.增加班级统计报表和导出
1421
  				examTime = "0";
338594c8   孙向锦   添加教师端页面
1422
1423
1424
  			}
  			p.put("EXAM_TIME", examTime);
  		}
782f81b0   jack   1.增加未知学生的判断
1425
  
338594c8   孙向锦   添加教师端页面
1426
1427
  		mv.addObject("varList", varList);
  		mv.addObject("pd", pd);
782f81b0   jack   1.增加未知学生的判断
1428
  		mv.addObject("QX", Jurisdiction.getHC()); // 按钮权限
338594c8   孙向锦   添加教师端页面
1429
1430
  		return mv;
  	}
782f81b0   jack   1.增加未知学生的判断
1431
1432
1433
1434
  
  	/**
  	 * 去新增页面
  	 * 
bed6e1fc   孙向锦   添加其他功能
1435
1436
1437
  	 * @param
  	 * @throws Exception
  	 */
782f81b0   jack   1.增加未知学生的判断
1438
1439
  	@RequestMapping(value = "/goAdd")
  	public ModelAndView goAdd() throws Exception {
bed6e1fc   孙向锦   添加其他功能
1440
1441
1442
1443
1444
1445
1446
  		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.增加未知学生的判断
1447
1448
1449
1450
1451
  	}
  
  	/**
  	 * 去新增页面
  	 * 
338594c8   孙向锦   添加教师端页面
1452
1453
1454
  	 * @param
  	 * @throws Exception
  	 */
782f81b0   jack   1.增加未知学生的判断
1455
1456
  	@RequestMapping(value = "/goAddTest")
  	public ModelAndView goAddTest() throws Exception {
338594c8   孙向锦   添加教师端页面
1457
1458
1459
1460
1461
1462
1463
  		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.增加未知学生的判断
1464
1465
1466
1467
1468
  	}
  
  	/**
  	 * 去修改页面
  	 * 
bed6e1fc   孙向锦   添加其他功能
1469
1470
1471
  	 * @param
  	 * @throws Exception
  	 */
782f81b0   jack   1.增加未知学生的判断
1472
1473
  	@RequestMapping(value = "/goEdit")
  	public ModelAndView goEdit() throws Exception {
bed6e1fc   孙向锦   添加其他功能
1474
1475
1476
  		ModelAndView mv = this.getModelAndView();
  		PageData pd = new PageData();
  		pd = this.getPageData();
782f81b0   jack   1.增加未知学生的判断
1477
  		pd = paperService.findById(pd); // 根据ID读取
bed6e1fc   孙向锦   添加其他功能
1478
1479
1480
1481
  		mv.setViewName("sunvote/paper/paper_edit");
  		mv.addObject("msg", "edit");
  		mv.addObject("pd", pd);
  		return mv;
782f81b0   jack   1.增加未知学生的判断
1482
1483
1484
1485
1486
  	}
  
  	/**
  	 * 批量删除
  	 * 
bed6e1fc   孙向锦   添加其他功能
1487
1488
1489
  	 * @param
  	 * @throws Exception
  	 */
782f81b0   jack   1.增加未知学生的判断
1490
  	@RequestMapping(value = "/deleteAll")
bed6e1fc   孙向锦   添加其他功能
1491
  	@ResponseBody
782f81b0   jack   1.增加未知学生的判断
1492
1493
1494
1495
1496
1497
  	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   孙向锦   添加其他功能
1498
1499
1500
  		pd = this.getPageData();
  		List<PageData> pdList = new ArrayList<PageData>();
  		String DATA_IDS = pd.getString("DATA_IDS");
782f81b0   jack   1.增加未知学生的判断
1501
  		if (null != DATA_IDS && !"".equals(DATA_IDS)) {
bed6e1fc   孙向锦   添加其他功能
1502
1503
  			String ArrayDATA_IDS[] = DATA_IDS.split(",");
  			paperService.deleteAll(ArrayDATA_IDS);
338594c8   孙向锦   添加教师端页面
1504
  			paperquestionService.deleteAllPaper(ArrayDATA_IDS);
bed6e1fc   孙向锦   添加其他功能
1505
  			pd.put("msg", "ok");
782f81b0   jack   1.增加未知学生的判断
1506
  		} else {
bed6e1fc   孙向锦   添加其他功能
1507
1508
1509
1510
1511
1512
  			pd.put("msg", "no");
  		}
  		pdList.add(pd);
  		map.put("list", pdList);
  		return AppUtil.returnObject(pd, map);
  	}
782f81b0   jack   1.增加未知学生的判断
1513
1514
1515
1516
  
  	/**
  	 * 导出到excel
  	 * 
bed6e1fc   孙向锦   添加其他功能
1517
1518
1519
  	 * @param
  	 * @throws Exception
  	 */
782f81b0   jack   1.增加未知学生的判断
1520
1521
1522
1523
1524
1525
  	@RequestMapping(value = "/excel")
  	public ModelAndView exportExcel() throws Exception {
  		logBefore(logger, Jurisdiction.getUsername() + "导出Paper到excel");
  		if (!Jurisdiction.buttonJurisdiction(menuUrl, "cha")) {
  			return null;
  		}
bed6e1fc   孙向锦   添加其他功能
1526
1527
1528
  		ModelAndView mv = new ModelAndView();
  		PageData pd = new PageData();
  		pd = this.getPageData();
782f81b0   jack   1.增加未知学生的判断
1529
  		Map<String, Object> dataMap = new HashMap<String, Object>();
bed6e1fc   孙向锦   添加其他功能
1530
  		List<String> titles = new ArrayList<String>();
782f81b0   jack   1.增加未知学生的判断
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
  		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   孙向锦   添加其他功能
1542
1543
1544
  		dataMap.put("titles", titles);
  		List<PageData> varOList = paperService.listAll(pd);
  		List<PageData> varList = new ArrayList<PageData>();
782f81b0   jack   1.增加未知学生的判断
1545
  		for (int i = 0; i < varOList.size(); i++) {
bed6e1fc   孙向锦   添加其他功能
1546
  			PageData vpd = new PageData();
782f81b0   jack   1.增加未知学生的判断
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
  			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   孙向锦   添加其他功能
1558
1559
1560
1561
  			varList.add(vpd);
  		}
  		dataMap.put("varList", varList);
  		ObjectExcelView erv = new ObjectExcelView();
782f81b0   jack   1.增加未知学生的判断
1562
  		mv = new ModelAndView(erv, dataMap);
bed6e1fc   孙向锦   添加其他功能
1563
1564
  		return mv;
  	}
782f81b0   jack   1.增加未知学生的判断
1565
  
bed6e1fc   孙向锦   添加其他功能
1566
  	@InitBinder
782f81b0   jack   1.增加未知学生的判断
1567
  	public void initBinder(WebDataBinder binder) {
bed6e1fc   孙向锦   添加其他功能
1568
  		DateFormat format = new SimpleDateFormat("yyyy-MM-dd");
782f81b0   jack   1.增加未知学生的判断
1569
1570
  		binder.registerCustomEditor(Date.class, new CustomDateEditor(format,
  				true));
bed6e1fc   孙向锦   添加其他功能
1571
1572
  	}
  }