|
@@ -222,6 +222,9 @@ public class WelcomeBuildController implements WelcomeBuildControllerAPI {
|
|
|
WelcomeBuild buildData = new WelcomeBuild();
|
|
WelcomeBuild buildData = new WelcomeBuild();
|
|
|
|
|
|
|
|
String school = dataFormatter.formatCellValue(row.getCell(1));//校区名称
|
|
String school = dataFormatter.formatCellValue(row.getCell(1));//校区名称
|
|
|
|
|
+ if (ObjectUtils.isEmpty(school)) {
|
|
|
|
|
+ continue;
|
|
|
|
|
+ }
|
|
|
Optional<WelcomeSchool> wos = ws.stream().filter(e -> e.getSchool().equals(school)).findFirst();
|
|
Optional<WelcomeSchool> wos = ws.stream().filter(e -> e.getSchool().equals(school)).findFirst();
|
|
|
if (wos != null && wos.isPresent()) {
|
|
if (wos != null && wos.isPresent()) {
|
|
|
buildData.setSchoolId(wos.get().getId()+"");
|
|
buildData.setSchoolId(wos.get().getId()+"");
|
|
@@ -283,6 +286,7 @@ public class WelcomeBuildController implements WelcomeBuildControllerAPI {
|
|
|
|
|
|
|
|
XSSFRow row = sheetAt.getRow(rowNum);
|
|
XSSFRow row = sheetAt.getRow(rowNum);
|
|
|
|
|
|
|
|
|
|
+
|
|
|
if (row != null) {
|
|
if (row != null) {
|
|
|
//使用了getStringCellValue()方法来获取值,POI会判断单元格的类型,如果非字符串类型就会抛出上面的异常。
|
|
//使用了getStringCellValue()方法来获取值,POI会判断单元格的类型,如果非字符串类型就会抛出上面的异常。
|
|
|
//所以先使用setCellType()方法先将该单元格的类型设置为STRING
|
|
//所以先使用setCellType()方法先将该单元格的类型设置为STRING
|
|
@@ -321,6 +325,9 @@ public class WelcomeBuildController implements WelcomeBuildControllerAPI {
|
|
|
WelcomeBuild buildData = new WelcomeBuild();
|
|
WelcomeBuild buildData = new WelcomeBuild();
|
|
|
|
|
|
|
|
String school = dataFormatter.formatCellValue(row.getCell(1));//校区名称
|
|
String school = dataFormatter.formatCellValue(row.getCell(1));//校区名称
|
|
|
|
|
+ if (ObjectUtils.isEmpty(school)) {
|
|
|
|
|
+ continue;
|
|
|
|
|
+ }
|
|
|
Optional<WelcomeSchool> wos = ws.stream().filter(e -> e.getSchool().equals(school)).findFirst();
|
|
Optional<WelcomeSchool> wos = ws.stream().filter(e -> e.getSchool().equals(school)).findFirst();
|
|
|
if (wos != null && wos.isPresent()) {
|
|
if (wos != null && wos.isPresent()) {
|
|
|
buildData.setSchoolId(wos.get().getId()+"");
|
|
buildData.setSchoolId(wos.get().getId()+"");
|