Преглед на файлове

王子文 生产日报 bug fix: 解决了excel中false数值(实际表示0)无法导入的问题

wangggziwen преди 2 години
родител
ревизия
ffac529169
променени са 2 файла, в които са добавени 5 реда и са изтрити 6 реда
  1. 4 5
      master/src/main/java/com/ruoyi/project/production/service/impl/TDailyProductionReportServiceImpl.java
  2. 1 1
      ui/package.json

+ 4 - 5
master/src/main/java/com/ruoyi/project/production/service/impl/TDailyProductionReportServiceImpl.java

@@ -831,12 +831,11 @@ public class TDailyProductionReportServiceImpl implements ITDailyProductionRepor
         // 根据列下表,获取单元格对象,如果单元格的值为空,则返回null
         Cell cell = row.getCell(cellIndex, Row.MissingCellPolicy.RETURN_BLANK_AS_NULL);
         if (cell != null) {
-            // 设置单元格格式
-            //  cell.setCellType(CellType.STRING);
-            // 获取单元格数据
+            cell.setCellType(CellType.STRING);
             String cellValue = cell.getStringCellValue();
-            // 处理数据格式
-//            cellData = this.format(cellValue, type);
+            if ("false".equalsIgnoreCase(cellValue)) {
+                cellValue = "0";
+            }
             cellData = cellValue;
         }
         return cellData;

+ 1 - 1
ui/package.json

@@ -46,7 +46,6 @@
     "axios": "^0.21.1",
     "clipboard": "2.0.4",
     "core-js": "3.6.5",
-    "compression-webpack-plugin": "5.0.2",
     "dayjs": "^1.10.6",
     "echarts": "4.2.1",
     "echarts-liquidfill": "^3.1.0",
@@ -85,6 +84,7 @@
     "babel-plugin-dynamic-import-node": "2.3.3",
     "chalk": "2.4.2",
     "chokidar": "2.1.5",
+    "compression-webpack-plugin": "^1.1.12",
     "connect": "3.6.6",
     "eslint": "6.7.2",
     "eslint-plugin-vue": "6.2.2",