Commit 14f7a305640fa4da9e4edece6d29435b7d515ec1

Authored by 徐烜
1 parent 1de6f89b

Update

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