| | |
| | | } |
| | | if (name == null || name.trim().isEmpty()) continue; |
| | | String nt = name.trim().replaceAll("[\r\n]+", ""); |
| | | if (nt.contains("å计") || nt.contains("æ»è®¡")) continue; |
| | | String ntFlat = nt.replaceAll("\\s+", ""); |
| | | if (ntFlat.contains("å计") || ntFlat.contains("æ»è®¡") || ntFlat.contains("å°è®¡")) continue; |
| | | if (nt.matches("^[ä¸äºä¸åäºå
ä¸å
«ä¹å]+ã.*")) continue; |
| | | if (nt.matches("^ï¼[ä¸äºä¸åäºå
ä¸å
«ä¹å]+ï¼.*")) continue; |
| | | if (nt.replace(" ", "").matches(".*å°\\s*计.*")) continue; |
| | | if (nt.startsWith("å¡«æ¥") || nt.startsWith("åä½è´è´£äºº") || nt.matches("^\\d+ã.*")) continue; |
| | | if (hasSeq) { |
| | | if (seq == null || seq.trim().isEmpty()) { |
| | |
| | | } |
| | | if (!hasName) continue; |
| | | Map<Integer, String> colTexts = new HashMap<>(); |
| | | for (int rr = r; rr <= Math.min(r + 3, sh.getLastRowNum()); rr++) { |
| | | int scanEnd = investHeaderScanEnd(sh, r, row); |
| | | for (int rr = r; rr <= scanEnd; rr++) { |
| | | Row rr2 = sh.getRow(rr); |
| | | if (rr2 == null) continue; |
| | | for (int c = 0; c <= rr2.getLastCellNum(); c++) { |
| | |
| | | else if (v.contains("èªå¹´å累计")) col.putIfAbsent("yearcum", c); |
| | | else if (v.contains("æ¬æå®æ")) col.putIfAbsent("monthdone", c); |
| | | else if (v.contains("å»ºè®¾é¶æ®µ")) col.putIfAbsent("stage", c); |
| | | else if (v.contains("形象è¿åº¦")) col.putIfAbsent("desc", c); |
| | | else if (v.contains("形象è¿åº¦") || v.contains("建设è¿å±")) col.putIfAbsent("desc", c); |
| | | else if (v.contains("å·¥å¯") && !v.contains("项ç®åç§°")) col.putIfAbsent("gk", c); |
| | | else if (v.contains("å设") && !v.contains("项ç®åç§°")) col.putIfAbsent("cs", c); |
| | | else if (v.contains("建çé¢ç§¯") && !v.contains("æ°å¢")) col.putIfAbsent("area", c); |
| | |
| | | int md = col.get("yearcum") + 1; |
| | | if (md <= row.getLastCellNum()) col.put("monthdone", md); |
| | | } |
| | | // desc ç¼ºå¤±æ¶æ stage+1 å
åºï¼çæ ã项ç®å»ºè®¾é¶æ®µãè¿åº¦æ
åµãæ¯ L/M åå¹¶è¡¨å¤´ï¼ |
| | | // åæ/æ©æ½/æåº/éå·çå¸å·åªå¨ L åãå»ºè®¾é¶æ®µããM ç´æ¥åè¿åº¦æåèä¸åæ é¢ |
| | | if (!col.containsKey("desc") && col.containsKey("stage") && col.get("stage") >= 0) { |
| | | int dc = col.get("stage") + 1; |
| | | if (dc <= row.getLastCellNum()) col.put("desc", dc); |
| | | } |
| | | for (String k : new String[]{"builder", "nature", "start", "end", "total", "startcum", |
| | | "yearplan", "yearcum", "monthdone", "stage", "desc", "gk", "cs", "area"}) { |
| | | col.putIfAbsent(k, -1); |
| | |
| | | return col; |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** è¡¨å¤´ææ¬æ«æä¸çï¼é»è®¤è¡¨å¤´è¡ +3ï¼è¥ã项ç®åç§°ãåé¦ä¸ªæ°æ®è¡æ´é ä¸ï¼åæ©å±å°æ°æ®è¡åä¸è¡ï¼ä¸é +12ï¼ã |
| | | * èæ¯ï¼å¸å®/åå °çå¸å·æãå»ºè®¾é¶æ®µ/形象è¿åº¦ãæ ç¾åå¨è¡¨å¤´ä¸ç¬¬ 4~8 è¡ï¼åºå® +3 伿¼åï¼å½¢è±¡è¿åº¦è¯»ä¸å°ï¼ã */ |
| | | private int investHeaderScanEnd(Sheet sh, int headerRow, Row headerRowObj) { |
| | | int hardEnd = Math.min(headerRow + 12, sh.getLastRowNum()); |
| | | int nameCol = -1; |
| | | if (headerRowObj != null) { |
| | | for (int c = 0; c <= headerRowObj.getLastCellNum(); c++) { |
| | | String v = cellStr(headerRowObj, c); |
| | | if (v != null && v.contains("项ç®åç§°")) { nameCol = c; break; } |
| | | } |
| | | } |
| | | int firstData = findFirstInvestDataRow(sh, headerRow, nameCol); |
| | | int scanEnd = (firstData > headerRow) |
| | | ? Math.min(hardEnd, firstData - 1) |
| | | : Math.min(headerRow + 3, sh.getLastRowNum()); |
| | | if (scanEnd < headerRow) scanEnd = headerRow; |
| | | return scanEnd; |
| | | } |
| | | |
| | | /** ã项ç®åç§°ãåé¦ä¸ªæ°æ®è¡ä¸æ ï¼è·³è¿è¡¨å¤´ç»è¡ä¸ç©ºè¡ï¼ï¼æ¾ä¸å°è¿å -1 */ |
| | | private int findFirstInvestDataRow(Sheet sh, int headerRow, int nameCol) { |
| | | if (nameCol < 0) return -1; |
| | | for (int r = headerRow + 1; r <= sh.getLastRowNum(); r++) { |
| | | Row row = sh.getRow(r); |
| | | if (row == null) continue; |
| | | String name = cellStr(row, nameCol); |
| | | if (name == null || name.trim().isEmpty()) continue; |
| | | String nt = name.trim().replaceAll("[\r\n]+", ""); |
| | | if (nt.contains("项ç®åç§°")) continue; |
| | | String flat = nt.replaceAll("\\s+", ""); |
| | | if (flat.contains("å计") || flat.contains("æ»è®¡") || flat.contains("å°è®¡")) continue; |
| | | if (nt.matches("^[ä¸äºä¸åäºå
ä¸å
«ä¹å]+ã.*")) continue; |
| | | if (nt.matches("^ï¼[ä¸äºä¸åäºå
ä¸å
«ä¹å]+ï¼.*")) continue; |
| | | if (nt.startsWith("å¡«æ¥") || nt.startsWith("åä½è´è´£äºº") || nt.matches("^\\d+ã.*")) continue; |
| | | if (investmentCity(nt) != null) continue; |
| | | return r; |
| | | } |
| | | return -1; |
| | | } |
| | | |
| | | /** ç»è®¡ sheet å
é¡¹ç®æ°æ®è¡æ°ï¼ç¨äºå¤ sheet å岿件é彿 sheetï¼ */ |
| | |
| | | String name = cellStr(row, nameCol); |
| | | if (name == null || name.trim().isEmpty()) continue; |
| | | String nt = name.trim().replaceAll("[\r\n]+", ""); |
| | | if (nt.contains("å计") || nt.contains("æ»è®¡")) continue; |
| | | String ntFlat = nt.replaceAll("\\s+", ""); |
| | | if (ntFlat.contains("å计") || ntFlat.contains("æ»è®¡") || ntFlat.contains("å°è®¡")) continue; |
| | | if (nt.matches("^[ä¸äºä¸åäºå
ä¸å
«ä¹å]+ã.*")) continue; |
| | | if (nt.replace(" ", "").matches(".*å°\\s*计.*")) continue; |
| | | if (nt.startsWith("å¡«æ¥") || nt.startsWith("åä½è´è´£äºº") || nt.matches("^\\d+ã.*")) continue; |
| | | if (!hasSeq) { |
| | | if (nt.length() > 4) count++; |