Commit 14f7a305640fa4da9e4edece6d29435b7d515ec1
1 parent
1de6f89b
Update
Showing
1 changed file
with
3 additions
and
3 deletions
src/main/java/com/bsth/service/schedule/impl/TTInfoDetailServiceImpl.java
| @@ -157,7 +157,7 @@ public class TTInfoDetailServiceImpl extends BServiceImpl<TTInfoDetail, Long> im | @@ -157,7 +157,7 @@ public class TTInfoDetailServiceImpl extends BServiceImpl<TTInfoDetail, Long> im | ||
| 157 | } else { | 157 | } else { |
| 158 | Cell[] cells = sheet.getRow(0); // 获取第一行数据列 | 158 | Cell[] cells = sheet.getRow(0); // 获取第一行数据列 |
| 159 | for (int i = 0; i < cells.length; i++) { | 159 | for (int i = 0; i < cells.length; i++) { |
| 160 | - String cell_con = cells[i].getContents(); | 160 | + String cell_con = StringUtils.trimToEmpty(cells[i].getContents()); // trimToEmpty |
| 161 | 161 | ||
| 162 | if (StringUtils.isEmpty(cell_con)) { | 162 | if (StringUtils.isEmpty(cell_con)) { |
| 163 | throw new Exception(String.format("第1行,第%d列数据不能为空", i + 1)); | 163 | throw new Exception(String.format("第1行,第%d列数据不能为空", i + 1)); |
| @@ -199,7 +199,7 @@ public class TTInfoDetailServiceImpl extends BServiceImpl<TTInfoDetail, Long> im | @@ -199,7 +199,7 @@ public class TTInfoDetailServiceImpl extends BServiceImpl<TTInfoDetail, Long> im | ||
| 199 | Map<String, Integer> gbindexmap = new HashMap<>(); // 记录每个路牌在第几行 | 199 | Map<String, Integer> gbindexmap = new HashMap<>(); // 记录每个路牌在第几行 |
| 200 | for (int i = 1; i < sheet.getRows(); i++) { // 从第2行开始验证数据 | 200 | for (int i = 1; i < sheet.getRows(); i++) { // 从第2行开始验证数据 |
| 201 | Cell bcell = sheet.getRow(i)[0]; // 获取第1列 | 201 | Cell bcell = sheet.getRow(i)[0]; // 获取第1列 |
| 202 | - String bcell_con = bcell.getContents(); | 202 | + String bcell_con = StringUtils.trimToEmpty(bcell.getContents()); // trimToEmpty |
| 203 | if (StringUtils.isEmpty(bcell_con)) { | 203 | if (StringUtils.isEmpty(bcell_con)) { |
| 204 | throw new Exception(String.format("第%d行,第1列路牌无数据", i + 1)); | 204 | throw new Exception(String.format("第%d行,第1列路牌无数据", i + 1)); |
| 205 | } else if (gbindexmap.get(bcell_con.trim()) != null) { | 205 | } else if (gbindexmap.get(bcell_con.trim()) != null) { |
| @@ -233,7 +233,7 @@ public class TTInfoDetailServiceImpl extends BServiceImpl<TTInfoDetail, Long> im | @@ -233,7 +233,7 @@ public class TTInfoDetailServiceImpl extends BServiceImpl<TTInfoDetail, Long> im | ||
| 233 | for (int i = 1; i < sheet.getRows(); i++) { // 从第2行开始验证数据 | 233 | for (int i = 1; i < sheet.getRows(); i++) { // 从第2行开始验证数据 |
| 234 | Cell[] bcells = sheet.getRow(i); | 234 | Cell[] bcells = sheet.getRow(i); |
| 235 | for (int j = 1; j < bcells.length; j++) { // 从第2列开始 | 235 | for (int j = 1; j < bcells.length; j++) { // 从第2列开始 |
| 236 | - String bcell_con = bcells[j].getContents(); | 236 | + String bcell_con = StringUtils.trimToEmpty(bcells[j].getContents()); // trimToEmpty |
| 237 | if (StringUtils.isNotEmpty(bcell_con)) { | 237 | if (StringUtils.isNotEmpty(bcell_con)) { |
| 238 | Matcher m1 = p1.matcher(bcell_con.trim()); | 238 | Matcher m1 = p1.matcher(bcell_con.trim()); |
| 239 | Matcher m2 = p2.matcher(bcell_con.trim()); | 239 | Matcher m2 = p2.matcher(bcell_con.trim()); |