From 2f1ae9c10a1751438d09b3d848677deb883631aa Mon Sep 17 00:00:00 2001
From: fei <791364011@qq.com>
Date: 星期三, 14 一月 2026 11:28:16 +0800
Subject: [PATCH] 修改了对应代码

---
 ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtilManySheetFour.java |   58 +++++++++++++++++++++++++++++++++++++---------------------
 1 files changed, 37 insertions(+), 21 deletions(-)

diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtilManySheetFour.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtilManySheetFour.java
index 6d3021f..99871c7 100644
--- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtilManySheetFour.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtilManySheetFour.java
@@ -307,7 +307,6 @@
                 int column = 0;
                 if(index == 0) {
                     // 鍚堝苟绗竴琛岀殑鍓�5涓崟鍏冩牸
-                    sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, 8));
 
                     // 蹇呴』鍏堣缃负true
                     // 椤甸潰甯冨眬璁剧疆
@@ -333,33 +332,49 @@
                     {
                         row.setHeight((short)(55.8 * 20));
 
-                        Cell cell = row.createCell(6);
+                        Cell cell = row.createCell(0);
+//                        for(int cl = 1 ; cl <=8; cl++)
+//                            cell = row.createCell(cl);
+//
+//
+//                        for (int col = 4; col <= 7; col++) {
+//                            row.getSheet().setColumnWidth(col, 15 * 256); // 姣忓垪15瀛楃瀹�
+                //        }
+
+                        int margin = -40* 9525;
+                        int mary = -11 * 9525;
+                        XSSFClientAnchor anchor = new XSSFClientAnchor(
+                                0,          // dx1
+                                0,          // dy1
+                                margin,     // dx2锛氬彸杈圭晫宸︾Щ10鍍忕礌
+                                mary,          // dy2
+                                (short)5,   // col1
+                                0,          // row1
+                                (short)9,   // col2
+                                1          // row2
+                        );
                         // 璁剧疆鍥剧墖澶у皬鍜屼綅缃�
-                        ClientAnchor anchor = new XSSFClientAnchor(0, 0, 0, 0, (short) (cell.getColumnIndex()+1), cell.getRow().getRowNum(), (short) (cell.getColumnIndex() +2),
-                                cell.getRow().getRowNum() + 1);
+                     //   ClientAnchor anchor = new XSSFClientAnchor(0, 0, 600, 150, (short)0, 0, (short)6, 1);
+                    //   anchor.setDx2(488);
+                    //   anchor.setDy2(10);
+                   //     anchor.setAnchorType(ClientAnchor.AnchorType.MOVE_AND_RESIZE);
                         // 璁$畻灞呬腑浣嶇疆
-//                    int col1 = 0; // 涓棿鍒�
-//                    int col2 = col1 + 2;
-//                    anchor.setCol1(col1);
-//                    anchor.setCol2(col2);
-//                    anchor.setDx1(100);
-//                    anchor.setDy1(0);
-//                    anchor.setDx2(255); // 瀹藉害
-//                    anchor.setDy2(255); // 楂樺害
-                        anchor.setAnchorType(ClientAnchor.AnchorType.MOVE_AND_RESIZE);
+
+
                         // 璁$畻灞呬腑浣嶇疆
-                        int col1 = 4; // 涓棿鍒�
-                        int col2 = col1 + 3;
-                        anchor.setCol1(col1);
-                        anchor.setCol2(col2);
-                        anchor.setRow1(0);
-                        anchor.setRow2(1);
+//                        int col1 = 4; // 涓棿鍒�
+//                        int col2 = col1 + 3;
+//                        anchor.setCol1(col1);
+//                        anchor.setCol2(col2);
+//                        anchor.setRow1(0);
+//                        anchor.setRow2(1);
+
                         byte[] data = bt;
                  
                         // 鑾峰彇鍥剧墖鍘熷灏哄
                         BufferedImage image = ImageIO.read(new ByteArrayInputStream(data));
-                        double widthInEMU = image.getWidth() * 9525 * 0.2;
-                        double heightInEMU = image.getHeight() * 9525;
+//                        double widthInEMU = image.getWidth() * 9525 * 0.2;
+//                        double heightInEMU = image.getHeight() * 9525;
 
                         // 璁剧疆鍥剧墖鍘熷灏哄
                     //    anchor.setDx2(-100000); // 鍘熷瀹藉害
@@ -378,6 +393,7 @@
                     }
                     else
                         row.setHeight((short)(33 * 20));
+                  //  sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, 8));
 
                     //  sheet.addMergedRegion(new CellRangeAddress(1, 1, 0, 7));
                     if(firow==1)

--
Gitblit v1.9.1