From fd57c8510934444df5320029653d530a1abeff67 Mon Sep 17 00:00:00 2001
From: lyh <925863403@qq.com>
Date: 星期五, 11 七月 2025 17:57:18 +0800
Subject: [PATCH] 修改查询

---
 lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamMaintenanceStandardServiceImpl.java |  494 +++++++++++++++++++++++++++++++++---------------------
 1 files changed, 304 insertions(+), 190 deletions(-)

diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamMaintenanceStandardServiceImpl.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamMaintenanceStandardServiceImpl.java
index 356394f..0f997e7 100644
--- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamMaintenanceStandardServiceImpl.java
+++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamMaintenanceStandardServiceImpl.java
@@ -554,31 +554,31 @@
 
             // 1. 鎻愬彇璁惧淇℃伅
             EamMaintenanceStandard eamMaintenanceStandard = extractDeviceInfo(sheet);
-            if (eamMaintenanceStandard == null) {
+            if (eamMaintenanceStandard == null || eamMaintenanceStandard.getEquipmentId() == null) {
                 return Result.error("璁惧淇℃伅鎻愬彇澶辫触");
-            } else {
-                if (eamMaintenanceStandard.getEquipmentId() == null) {
-                    return Result.error("璁惧淇℃伅鎻愬彇澶辫触");
-                }
             }
 
             eamMaintenanceStandard.setStandardName(name);
 
-            EamMaintenanceStandard exist = checkDuplicate(eamMaintenanceStandard.getEquipmentId(), eamMaintenanceStandard.getMaintenanceCategory(), MaintenanceStandardStatusEnum.START.name());
+            // 妫�鏌ラ噸澶�
+            EamMaintenanceStandard exist = checkDuplicate(eamMaintenanceStandard.getEquipmentId(),
+                    eamMaintenanceStandard.getMaintenanceCategory(), MaintenanceStandardStatusEnum.START.name());
             if (exist != null) {
                 return Result.error(name + ": 璁惧鏍囧噯宸插瓨鍦紝涓嶈兘閲嶅娣诲姞");
             }
 
             eamMaintenanceStandardMapper.insert(eamMaintenanceStandard);
 
-            // 2. 鎻愬彇姣忔棩鐐规椤圭洰
-            List<EamMaintenanceStandardDetail> dailyDetails = extractDailyItems(sheet, eamMaintenanceStandard);
+            Map<Integer, String> rowErrors = new HashMap<>();
+
+            // 2. 鎻愬彇姣忔棩鐐规椤圭洰锛堜紭鍖栫┖琛屽拰缁撴潫鏍囪澶勭悊锛�
+            List<EamMaintenanceStandardDetail> dailyDetails = extractDailyItems(sheet, eamMaintenanceStandard, rowErrors);
             if (dailyDetails.isEmpty()) {
                 return Result.error("鏈壘鍒版瘡鏃ョ偣妫�椤圭洰");
             }
 
             // 3. 鎻愬彇鍛ㄤ繚鍏婚」鐩�
-            List<EamMaintenanceStandardDetail> weeklyDetails = extractWeeklyItems(sheet, eamMaintenanceStandard);
+            List<EamMaintenanceStandardDetail> weeklyDetails = extractWeeklyItems(sheet, eamMaintenanceStandard, rowErrors);
             if (weeklyDetails.isEmpty()) {
                 return Result.error("鏈壘鍒板懆淇濆吇椤圭洰");
             }
@@ -592,14 +592,11 @@
                 eamMaintenanceStandardDetailService.saveBatch(allDetails);
             }
 
+            // 瑙﹀彂淇濆吇娴佺▼
             SysParams sysParams = sysParamsService.getSysPramBySettingKey("maintenance_import_type");
-
-            if (sysParams != null) {
-                if (sysParams.getSettingValue().equals("1")) {
-                    //瑙﹀彂淇濆吇娴佺▼
-                    eamMaintenanceStandard.setStandardStatus(MaintenanceStandardStatusEnum.WAIT_SUBMIT.name());
-                    eamMaintenanceStandardMapper.updateById(eamMaintenanceStandard);
-                }
+            if (sysParams != null && sysParams.getSettingValue().equals("1")) {
+                eamMaintenanceStandard.setStandardStatus(MaintenanceStandardStatusEnum.WAIT_SUBMIT.name());
+                eamMaintenanceStandardMapper.updateById(eamMaintenanceStandard);
             } else {
                 return Result.error("鏈壘鍒颁繚鍏绘祦绋嬪鍏ョ浉鍏抽厤缃�,璇疯仈绯荤鐞嗗憳");
             }
@@ -728,171 +725,6 @@
     }
 
     /**
-     * 鎻愬彇姣忔棩鐐规椤圭洰
-     */
-    private List<EamMaintenanceStandardDetail> extractDailyItems(Sheet sheet, EamMaintenanceStandard standard) {
-        return extractItems(sheet, standard, "鐐规椤圭洰", "瀹屾垚鏁版嵁/瑕佹眰", "DAY_INSPECTION");
-    }
-
-    /**
-     * 鎻愬彇鍛ㄤ繚鍏婚」鐩�
-     */
-    private List<EamMaintenanceStandardDetail> extractWeeklyItems(Sheet sheet, EamMaintenanceStandard standard) {
-        return extractItems(sheet, standard, "鍛ㄤ繚鍏婚」鐩�", "妫�鏌ユ爣鍑�", "WEEK_INSPECTION");
-    }
-
-    /**
-     * 閫氱敤椤圭洰鎻愬彇鏂规硶
-     */
-    private List<EamMaintenanceStandardDetail> extractItems(Sheet sheet, EamMaintenanceStandard standard,
-                                                            String primaryHeader, String secondaryHeader,
-                                                            String itemCategory) {
-        int[] section = findTableSection(sheet, primaryHeader, secondaryHeader);
-        if (section == null) {
-            return Collections.emptyList();
-        }
-
-        List<EamMaintenanceStandardDetail> details = new ArrayList<>();
-        for (int rowIdx = section[0]; rowIdx <= section[1]; rowIdx++) {
-            Row row = sheet.getRow(rowIdx);
-            if (row == null || isEmptyRow(row)) {
-                continue;
-            }
-
-            // 纭繚绗竴鍒楁槸搴忓彿锛堟暟瀛楋級
-            Cell seqCell = row.getCell(0);
-            if (seqCell == null || seqCell.getCellType() != CellType.NUMERIC) {
-                continue;
-            }
-
-            // 鍒涘缓椤圭洰璇︽儏
-            EamMaintenanceStandardDetail detail = new EamMaintenanceStandardDetail();
-            detail.setStandardId(standard.getId());
-            detail.setItemCode(Integer.parseInt(getCellStringValue(row.getCell(0))));
-            detail.setItemName(getCellStringValue(row.getCell(1)));
-            detail.setItemCategory(itemCategory);
-
-            // 鏍规嵁椤圭洰绫诲瀷璁剧疆闇�姹傚瓧娈�
-            if ("DAY_INSPECTION".equals(itemCategory)) {
-                detail.setItemDemand(getCellStringValue(row.getCell(2)));
-            } else if ("WEEK_INSPECTION".equals(itemCategory)) {
-                detail.setItemDemand(getCellStringValue(row.getCell(2)));
-            }
-
-            details.add(detail);
-        }
-
-        return details;
-    }
-
-    /**
-     * 鏌ユ壘琛ㄦ牸鍖哄煙
-     */
-    private int[] findTableSection(Sheet sheet, String primaryHeader, String secondaryHeader) {
-        for (int rowIdx = 0; rowIdx <= sheet.getLastRowNum(); rowIdx++) {
-            Row row = sheet.getRow(rowIdx);
-            if (row == null) continue;
-
-            if (isHeaderRow(row, primaryHeader, secondaryHeader)) {
-                int startRow = rowIdx + 1;
-                int endRow = findDataEnd(sheet, startRow);
-                return new int[]{startRow, endRow};
-            }
-        }
-        return null;
-    }
-
-    /**
-     * 妫�鏌ユ槸鍚︿负琛ㄥご琛�
-     */
-    private boolean isHeaderRow(Row row, String header1, String header2) {
-        boolean foundHeader1 = false;
-        boolean foundHeader2 = false;
-
-        for (int colIdx = 0; colIdx < row.getLastCellNum(); colIdx++) {
-            Cell cell = row.getCell(colIdx);
-            if (cell == null) continue;
-
-            String cellValue = getCellStringValue(cell);
-            if (cellValue.contains(header1)) foundHeader1 = true;
-            if (cellValue.contains(header2)) foundHeader2 = true;
-        }
-
-        return foundHeader1 && foundHeader2;
-    }
-
-    /**
-     * 鏌ユ壘鏁版嵁缁撴潫浣嶇疆
-     */
-    private int findDataEnd(Sheet sheet, int startRow) {
-        for (int rowIdx = startRow; rowIdx <= sheet.getLastRowNum(); rowIdx++) {
-            Row row = sheet.getRow(rowIdx);
-            if (row == null) return rowIdx - 1;
-
-            // 妫�鏌ユ槸鍚︾粨鏉熸爣蹇楄锛堝绛惧瓧琛岋級
-            if (isSignatureRow(row)) {
-                return rowIdx - 1;
-            }
-
-            // 妫�鏌ユ槸鍚︽柊鐨勮〃澶村紑濮�
-            if (isNewHeaderStart(row)) {
-                return rowIdx - 1;
-            }
-        }
-        return sheet.getLastRowNum();
-    }
-
-    /**
-     * 璇嗗埆绛惧瓧琛岀壒寰�
-     */
-    private boolean isSignatureRow(Row row) {
-        for (int colIdx = 0; colIdx < row.getLastCellNum(); colIdx++) {
-            Cell cell = row.getCell(colIdx);
-            if (cell == null) continue;
-
-            String value = getCellStringValue(cell);
-            if (value.contains("绛惧瓧") || value.contains("璐d换浜�") ||
-                    value.contains("鎵ц") || value.contains("纭")) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    /**
-     * 璇嗗埆鏂拌〃澶村紑濮�
-     */
-    private boolean isNewHeaderStart(Row row) {
-        for (int colIdx = 0; colIdx < row.getLastCellNum(); colIdx++) {
-            Cell cell = row.getCell(colIdx);
-            if (cell == null) continue;
-
-            String value = getCellStringValue(cell);
-            if ("搴忓彿".equals(value) || "鐐规椤圭洰".equals(value) || "鍛ㄤ繚鍏婚」鐩�".equals(value)) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    /**
-     * 妫�鏌ヨ鏄惁涓虹┖
-     */
-    private boolean isEmptyRow(Row row) {
-        if (row == null) return true;
-        for (int colIdx = 0; colIdx < row.getLastCellNum(); colIdx++) {
-            Cell cell = row.getCell(colIdx);
-            if (cell != null && cell.getCellType() != CellType.BLANK) {
-                String value = getCellStringValue(cell);
-                if (StringUtils.isNotBlank(value)) {
-                    return false;
-                }
-            }
-        }
-        return true;
-    }
-
-    /**
      * 浣跨敤姝e垯鎻愬彇瀛楁
      */
     private String extractField(String text, String regex) {
@@ -903,10 +735,139 @@
     }
 
     /**
-     * 鑾峰彇鍗曞厓鏍煎瓧绗︿覆鍊�
+            * 鎻愬彇姣忔棩鐐规椤圭洰
+     */
+    private List<EamMaintenanceStandardDetail> extractDailyItems(Sheet sheet, EamMaintenanceStandard standard, Map<Integer, String> rowErrors) {
+        // 浣跨敤澶氬叧閿瘝鍖归厤
+        String[] primaryHeaders = {"鐐规椤圭洰", "鏃ュ父鐐规", "姣忔棩妫�鏌�"};
+        String[] secondaryHeaders = {"瀹屾垚鏁版嵁/瑕佹眰", "妫�鏌ユ爣鍑�", "瑕佹眰"};
+        return extractItems(sheet, standard, primaryHeaders, secondaryHeaders, "DAY_INSPECTION", rowErrors);
+    }
+
+    /**
+            * 鎻愬彇鍛ㄤ繚鍏婚」鐩�
+     */
+    private List<EamMaintenanceStandardDetail> extractWeeklyItems(Sheet sheet, EamMaintenanceStandard standard, Map<Integer, String> rowErrors) {
+        // 浣跨敤澶氬叧閿瘝鍖归厤
+        String[] primaryHeaders = {"鍛ㄤ繚鍏婚」鐩�", "鍛ㄤ繚鍏�", "姣忓懆淇濆吇"};
+        String[] secondaryHeaders = {"妫�鏌ユ爣鍑�", "淇濆吇瑕佹眰", "鏍囧噯"};
+        return extractItems(sheet, standard, primaryHeaders, secondaryHeaders, "WEEK_INSPECTION", rowErrors);
+    }
+
+    /**
+     * 鏍稿績鏀硅繘锛氫紭鍖栬〃鏍煎尯鍩熻瘑鍒拰鏁版嵁鎻愬彇
+    */
+    private List<EamMaintenanceStandardDetail> extractItems(Sheet sheet,
+                                                            EamMaintenanceStandard standard,
+                                                            String[] primaryHeaders,
+                                                            String[] secondaryHeaders,
+                                                            String itemCategory,
+                                                            Map<Integer, String> rowErrors) {
+
+        // 1. 瀹氫綅琛ㄦ牸鍖哄煙锛堢簿纭尮閰嶈〃澶达級
+        int startRow = findHeaderRow(sheet, primaryHeaders, secondaryHeaders);
+        if (startRow == -1) {
+            rowErrors.put(-1, "鏈壘鍒�" + Arrays.toString(primaryHeaders) + "琛ㄥご鍖哄煙");
+            return Collections.emptyList();
+        }
+
+        int endRow = findDataEnd(sheet, startRow + 1, "鍛ㄤ繚鍏婚」鐩�");
+
+        // 鎻愬彇鏃ュ織锛堝疄闄呬娇鐢ㄦ椂鍙互鍘绘帀锛�
+        System.out.println("鎻愬彇鍖哄煙: " + (startRow + 1) + "琛屽埌" + (endRow + 1) + "琛�");
+
+        // 2. 鎻愬彇鏁版嵁琛�
+        List<EamMaintenanceStandardDetail> details = new ArrayList<>();
+        for (int rowIdx = startRow + 1; rowIdx <= endRow; rowIdx++) {
+            Row row = sheet.getRow(rowIdx);
+            if (row == null) continue;
+
+            try {
+                // 搴忓彿鍒楀鐞�
+                Cell seqCell = row.getCell(0);
+                if (seqCell == null || seqCell.getCellType() == CellType.BLANK) {
+                    continue;
+                }
+
+                // 鑾峰彇搴忓彿鍊硷紙鏀寔鏁板瓧鍜屾枃鏈牸寮忥級
+                int seqValue = 0;
+                try {
+                    if (seqCell.getCellType() == CellType.NUMERIC) {
+                        seqValue = (int) seqCell.getNumericCellValue();
+                    } else if (seqCell.getCellType() == CellType.STRING) {
+                        seqValue = Integer.parseInt(seqCell.getStringCellValue().trim());
+                    }
+                } catch (NumberFormatException e) {
+                    rowErrors.put(rowIdx + 1, "搴忓彿鏍煎紡閿欒");
+                    continue;
+                }
+
+                // 椤圭洰鍚嶇О鍒楋紙绗簩鍒楋級
+                Cell nameCell = row.getCell(1);
+                if (nameCell == null || nameCell.getCellType() == CellType.BLANK) {
+                    continue;
+                }
+                String itemName = getCellStringValue(nameCell).trim();
+
+                // 瑕佹眰/鏍囧噯鍒楋紙绗笁鍒楋級
+                String demand = "";
+                if (row.getLastCellNum() >= 3) {
+                    Cell demandCell = row.getCell(2);
+                    if (demandCell != null) {
+                        demand = getCellStringValue(demandCell).trim();
+                    }
+                }
+
+                // 鍒涘缓璇︽儏瀵硅薄
+                EamMaintenanceStandardDetail detail = new EamMaintenanceStandardDetail();
+                detail.setStandardId(standard.getId());
+                detail.setItemCode(seqValue);
+                detail.setItemName(itemName);
+                detail.setItemDemand(demand);
+                detail.setItemCategory(itemCategory);
+                details.add(detail);
+
+            } catch (Exception e) {
+                rowErrors.put(rowIdx + 1, "瑙f瀽閿欒: " + e.getMessage());
+            }
+        }
+        return details;
+    }
+
+    /**
+     * 鑾峰彇琛屼腑鎵�鏈夊崟鍏冩牸鐨勫瓧绗︿覆鍊�
+     */
+    private List<String> getRowStringValues(Row row) {
+        List<String> values = new ArrayList<>();
+        if (row == null) return values;
+
+        for (int cellIdx = 0; cellIdx < row.getLastCellNum(); cellIdx++) {
+            Cell cell = row.getCell(cellIdx);
+            if (cell != null) {
+                values.add(getCellStringValue(cell));
+            } else {
+                values.add(""); // 瀵逛簬绌哄崟鍏冩牸娣诲姞绌哄瓧绗︿覆
+            }
+        }
+        return values;
+    }
+
+    /**
+     * 鑾峰彇鍗曞厓鏍煎瓧绗︿覆鍊硷紙澧炲己鍏紡澶勭悊锛�
      */
     private String getCellStringValue(Cell cell) {
-        if (cell == null) return "";
+        if (cell == null) {
+            return "";
+        }
+        // 淇濇寔涓嶅彉锛屼絾娣诲姞鏁板瓧绫诲瀷澶勭悊
+        if (cell.getCellType() == CellType.NUMERIC) {
+            // 鏁存暟澶勭悊
+            double num = cell.getNumericCellValue();
+            if (num == (int) num) {
+                return String.valueOf((int) num);
+            }
+            return String.valueOf(num);
+        }
         switch (cell.getCellType()) {
             case STRING:
                 return cell.getStringCellValue().trim();
@@ -918,22 +879,117 @@
             case BOOLEAN:
                 return String.valueOf(cell.getBooleanCellValue());
             case FORMULA:
-                return handleFormulaCell(cell);
+                return getFormulaCellValue(cell);
             default:
                 return "";
         }
     }
 
     /**
-     * 澶勭悊鍏紡鍗曞厓鏍�
+     * 绮剧‘鏌ユ壘琛ㄥご琛�
+    */
+    private int findHeaderRow(Sheet sheet, String[] primaryHeaders, String[] secondaryHeaders) {
+        for (int rowIdx = 0; rowIdx <= sheet.getLastRowNum(); rowIdx++) {
+            Row row = sheet.getRow(rowIdx);
+            if (row == null) continue;
+
+            String rowText = getRowStringValues(row).stream().collect(Collectors.joining());
+
+            // 妫�鏌ヤ富鏍囬鍜屽壇鏍囬
+            boolean hasPrimary = false;
+            boolean hasSecondary = false;
+
+            for (String header : primaryHeaders) {
+                if (rowText.contains(header)) {
+                    hasPrimary = true;
+                    break;
+                }
+            }
+
+            for (String header : secondaryHeaders) {
+                if (rowText.contains(header)) {
+                    hasSecondary = true;
+                    break;
+                }
+            }
+
+            if (hasPrimary && hasSecondary) {
+                return rowIdx;
+            }
+        }
+        return -1;
+    }
+
+    /**
+     * 鏌ユ壘鏁版嵁缁撴潫浣嶇疆锛堟牴鎹偍鐨凟xcel缁撴瀯浼樺寲锛�
      */
-    private String handleFormulaCell(Cell cell) {
+    private int findDataEnd(Sheet sheet, int startRow, String nextSectionKeyword) {
+        int consecutiveEmptyRows = 0;
+        final int MAX_EMPTY_ROWS = 3;
+
+        for (int rowIdx = startRow; rowIdx <= sheet.getLastRowNum(); rowIdx++) {
+            Row row = sheet.getRow(rowIdx);
+
+            // 鍏抽敭鏀硅繘1锛氱┖琛屽鐞�
+            if (isEssentiallyEmpty(row)) {
+                consecutiveEmptyRows++;
+                if (consecutiveEmptyRows >= MAX_EMPTY_ROWS) {
+                    return rowIdx - consecutiveEmptyRows;
+                }
+                continue;
+            } else {
+                consecutiveEmptyRows = 0;
+            }
+
+            // 鍏抽敭鏀硅繘2锛氱粨鏉熸爣璁版娴�
+            String rowText = getRowStringValues(row).stream().collect(Collectors.joining());
+
+            // 鏍规嵁鎮ㄧ殑Excel缁撴瀯锛岀瀛楄鏈夌壒瀹氭牸寮�
+            if (rowText.contains("缁存姢璐d换浜虹瀛�")) {
+                return rowIdx - 1;
+            }
+
+            // 妫�娴嬩笅涓�涓尯鍩熺殑寮�濮嬶紙濡傚懆淇濆吇椤圭洰锛�
+            if (StringUtils.isNotBlank(nextSectionKeyword) &&
+                    rowText.contains(nextSectionKeyword)) {
+                return rowIdx - 1;
+            }
+        }
+        return sheet.getLastRowNum();
+    }
+
+    /**
+     * 鍒ゆ柇鏉′欢锛氬墠涓ゅ垪涓虹┖鍗宠涓虹┖琛�
+     */
+    private boolean isEssentiallyEmpty(Row row) {
+        if (row == null) return true;
+
+        // 妫�鏌ュ簭鍙峰垪
+        Cell indexCell = row.getCell(0);
+        if (indexCell != null && indexCell.getCellType() != CellType.BLANK) {
+            return false;
+        }
+
+        // 妫�鏌ラ」鐩悕绉板垪
+        Cell nameCell = row.getCell(1);
+        if (nameCell != null && nameCell.getCellType() != CellType.BLANK) {
+            return false;
+        }
+
+        return true;
+    }
+
+    /**
+            * 鑾峰彇鍏紡鍗曞厓鏍煎��
+     */
+    private String getFormulaCellValue(Cell cell) {
         try {
-            FormulaEvaluator evaluator = cell.getSheet().getWorkbook().getCreationHelper().createFormulaEvaluator();
+            Workbook workbook = cell.getSheet().getWorkbook();
+            FormulaEvaluator evaluator = workbook.getCreationHelper().createFormulaEvaluator();
             CellValue cellValue = evaluator.evaluate(cell);
-
-            if (cellValue == null) return "";
-
+            if (cellValue == null) {
+                return "";
+            }
             switch (cellValue.getCellType()) {
                 case STRING:
                     return cellValue.getStringValue();
@@ -945,9 +1001,67 @@
                     return "";
             }
         } catch (Exception e) {
+            log.warn("瑙f瀽鍏紡鍗曞厓鏍煎け璐�");
             return "";
         }
     }
+
+
+    private int findDataEnd(Sheet sheet, int startRow) {
+        int consecutiveEmptyRows = 0;
+        final int MAX_EMPTY_ROWS = 2;
+        boolean foundData = false;
+
+        for (int rowIdx = startRow; rowIdx <= sheet.getLastRowNum(); rowIdx++) {
+            Row row = sheet.getRow(rowIdx);
+
+            // 鍏抽敭浼樺寲1锛氬厛妫�鏌ユ槸鍚︿负绌鸿
+            if (isEmptyRow(row)) {
+                consecutiveEmptyRows++;
+                if (consecutiveEmptyRows >= MAX_EMPTY_ROWS) {
+                    return foundData ? rowIdx - consecutiveEmptyRows : startRow;
+                }
+                continue;
+            } else {
+                consecutiveEmptyRows = 0;
+            }
+
+            // 鍏抽敭浼樺寲2锛氫弗鏍奸檺瀹氱粨鏉熸爣璁扮殑璇嗗埆鏉′欢
+            if (isStrongEndMarker(row)) {
+                return foundData ? rowIdx - 1 : startRow;
+            }
+
+            // 鍏抽敭浼樺寲3锛氭爣璁板凡鎵惧埌鏈夋晥鏁版嵁
+            foundData = true;
+        }
+        return sheet.getLastRowNum();
+    }
+
+    // 澧炲己鐗堢粨鏉熸爣璁拌瘑鍒�
+    private boolean isStrongEndMarker(Row row) {
+        String rowText = String.join("", getRowStringValues(row)).toLowerCase();
+
+        return
+                // 绮剧‘鍖归厤绛惧瓧鐗瑰緛锛堝嚭鐜板湪琛岄锛�
+                (rowText.startsWith("缁存姢璐d换浜虹瀛�") ||
+                        rowText.startsWith("鎵ц浜虹瀛�")) ||
+                        // 绮剧‘鍖归厤鏂版澘鍧楁爣棰�
+                        rowText.matches("^\\s*鍛ㄤ繚鍏婚」鐩甛\s*$") ||
+                        rowText.contains("骞村害淇濆吇椤圭洰");
+    }
+
+    // 绌鸿妫�娴嬩紭鍖栵紙鍏佽閮ㄥ垎鍒椾负绌猴級
+    private boolean isEmptyRow(Row row) {
+        if (row == null) return true;
+        // 鍙鏌ュ墠3鍒楋紙搴忓彿鍒�+椤圭洰鍚�+瑕佹眰锛�
+        for (int cellIdx = 0; cellIdx < Math.min(3, row.getLastCellNum()); cellIdx++) {
+            Cell cell = row.getCell(cellIdx);
+            if (cell != null && cell.getCellType() != CellType.BLANK) {
+                return false;
+            }
+        }
+        return true;
+    }
     /*瀵煎叆鐐规鏂囦欢Excel--------------------------缁撴潫*/
 
     /*瀵煎叆浜屼繚涓変繚鏂囦欢Excel--------------------------寮�濮�*/

--
Gitblit v1.9.3