|
@@ -2,13 +2,8 @@ package com.ssj.sys.controller;
|
|
|
|
|
|
import java.io.IOException;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.Date;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.Iterator;
|
|
|
-import java.util.LinkedHashMap;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
+import java.util.*;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
import javax.servlet.ServletOutputStream;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
@@ -261,11 +256,17 @@ public class ImLibUserController extends BaseController {
|
|
|
iserror=true;
|
|
|
break;
|
|
|
}
|
|
|
-// if(StringUtils.isEmpty(tbLibImStudentTemp.getGrade())){
|
|
|
-// response.failure("年级不能为空");
|
|
|
-// iserror=true;
|
|
|
-// break;
|
|
|
-// }
|
|
|
+ if(StringUtils.isEmpty(tbLibImStudentTemp.getGrade())){
|
|
|
+ response.failure("年级不能为空");
|
|
|
+ iserror=true;
|
|
|
+ break;
|
|
|
+ }else{
|
|
|
+ if(!checkGrade(tbLibImStudentTemp.getGrade())){
|
|
|
+ response.failure("年级输入不正确,请输入类似一年级、二年级等");
|
|
|
+ iserror=true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
if(StringUtils.isEmpty(tbLibImStudentTemp.getLeagueName())){
|
|
|
response.failure("机构不能为空");
|
|
|
iserror=true;
|
|
@@ -343,7 +344,17 @@ public class ImLibUserController extends BaseController {
|
|
|
return response;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
+ private boolean checkGrade(String grade){
|
|
|
+ boolean check = true;
|
|
|
+ String[] gradeArr = new String[]{"一年级","二年级","三年级","四年级","五年级","六年级","七年级","八年级","九年级"};
|
|
|
+ List<String> list = Arrays.stream(gradeArr).collect(Collectors.toList());
|
|
|
+ if(!list.contains(grade)){
|
|
|
+ check = false;
|
|
|
+ }
|
|
|
+ return check;
|
|
|
+ }
|
|
|
+
|
|
|
//学生列表
|
|
|
@RequestMapping(value="/student/list/{libId}")
|
|
|
public String studentList(Model model,@PathVariable String libId,
|