Commit 9a97ed2e authored by 李博今's avatar 李博今

更新教室导入的筛选,返回正确信息

parent 7fb73128
...@@ -148,6 +148,17 @@ public class BRoomsServiceImpl implements BRoomsService { ...@@ -148,6 +148,17 @@ public class BRoomsServiceImpl implements BRoomsService {
result += "编号 " + value[1] + " 在表中重复 "; result += "编号 " + value[1] + " 在表中重复 ";
continue; continue;
} }
//Int最大值为2147483648,所以不能超过9位数
if(value[5].length() >= 9){
result += "编号 " + value[1] + " 的数据座位数不合法 ";
continue;
}
try{
int seat = Integer.valueOf(value[5]);
}catch (Exception e){
result += "编号 " + value[1] + " 的数据座位数不合法 ";
continue;
}
BRooms bRooms = new BRooms(); BRooms bRooms = new BRooms();
String classroomName = ""; String classroomName = "";
if(value[0].equals("校本部")){ if(value[0].equals("校本部")){
...@@ -192,13 +203,18 @@ public class BRoomsServiceImpl implements BRoomsService { ...@@ -192,13 +203,18 @@ public class BRoomsServiceImpl implements BRoomsService {
currentlyCode.add(value[1]); currentlyCode.add(value[1]);
list.add(bRooms); list.add(bRooms);
} }
int flag = 1;
if(!result.equals("")){
flag = 0;
}
if(list.size() != 0){ if(list.size() != 0){
int i = bRoomsRepository.addExcel(list); int i = bRoomsRepository.addExcel(list);
result += "成功插入了 " + i + "条数据"; result += "成功插入了 " + i + "条数据";
}else { }else {
result += "没有输入被插入"; result += "没有输入被插入";
} }
return new PersistModel(1, result);
return new PersistModel(flag, result);
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment