Browse Source

feat: 修改睿行车辆越界报警日数据入库定时任务删除空白字符逻辑

weijianghai 1 year ago
parent
commit
47db03baf6

+ 5 - 2
src/main/java/com/nokia/finance/tasks/jobs/car/ruixing/CarYueJieJob.java

@@ -154,16 +154,19 @@ public class CarYueJieJob {
                 Map<String, String> rowMap = new LinkedHashMap<>();
                 // 遍历列
                 for (int j = 0; j < columnCount; j++) {
+                    String header = headers.get(j);
                     String cellValue = "";
-                    rowMap.put(headers.get(j), cellValue);
+                    rowMap.put(header, cellValue);
                     Cell cell = row.getCell(j);
                     if (cell == null) {
                         continue;
                     }
                     switch (cell.getCellType()) {
                         case STRING:
+                            boolean skipTrim = "yue_jie_shi_jian".equals(header);
                             // 删除字符串空白字符
-                            cellValue = StringUtils.trimAllWhitespace(cell.getStringCellValue());
+                            cellValue = skipTrim ? cell.getStringCellValue()
+                                    : StringUtils.trimAllWhitespace(cell.getStringCellValue());
                             break;
                         case NUMERIC:
                             if (DateUtil.isCellDateFormatted(cell)) {