Explorar el Código

Merge branch 'dev' of http://219.151.181.73:3000/zhuwei/bladex into lihb

LHB hace 2 meses
padre
commit
ac6f725ed2

+ 2 - 2
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ExcelTabController.java

@@ -547,7 +547,7 @@ public class ExcelTabController extends BladeController {
         // 复制模版htmlURL
         File file_in = ResourceUtil.getFile(excelTab.getHtmlUrl());
         String filecode = SnowFlakeUtil.getId() + "";
-        String thmlUrl = file_path + "/privateUrlCopy/" + aPrivate.getProjectId()+"/"+filecode + ".html";
+        String thmlUrl = file_path + "privateUrlCopy/" + aPrivate.getProjectId()+"/"+filecode + ".html";
         File file_out = ResourceUtil.getFile(thmlUrl);
         if(!file_out.exists()){
             FileUtils.ensureFileExists(thmlUrl);
@@ -2865,7 +2865,7 @@ public class ExcelTabController extends BladeController {
                                             reData.put(key + "__" + tabData[1], strings);
                                         } else {
                                             if (tabVal.contains("[") && tabVal.contains("]")) {
-                                                reData.put(key + "__" + tabData[1], tabData);
+                                                reData.put(key + "__" + tabData[1], tabData[0]);
                                             } else {
                                                 reData.put(key + "__" + tabData[1], tabData[0]);
                                             }

+ 22 - 1
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ExcelTabServiceImpl.java

@@ -3107,8 +3107,29 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                         }
 
                         if (cellValue != null && !cellValue.isEmpty()) {
-                            if (cellValue.contains(oldContext)) {
+                            if (cellValue.equals(oldContext) && j + 1 < cellNum) {
+                                Cell nextCell = row.getCell(j + 1);
+                                String nextCellValue;
+                                if (nextCell.getCellType() == 0) {
+                                    double numValue = cell.getNumericCellValue();
+                                    nextCellValue = String.valueOf(numValue);
+                                } else {
+                                    nextCellValue = nextCell.getStringCellValue();
+                                }
+                                if (nextCellValue == null || nextCellValue.isEmpty()) {
+                                    nextCell.setCellValue(newContext.replace(oldContext, ""));
+                                    CellStyle cellStyle = cell.getCellStyle();
+                                    // 设置自动换行
+                                    cellStyle.setWrapText(true);
+                                    cell.setCellStyle(cellStyle);
+                                    return true;
+                                }
+                            } else if (cellValue.contains(oldContext)) {
                                 cell.setCellValue(newContext);
+                                CellStyle cellStyle = cell.getCellStyle();
+                                cellStyle.setWrapText(true);
+                                cell.setCellStyle(cellStyle);
+                                row.setHeight((short) (row.getHeight() * 1.5));
                                 return true;
                             }
                         }