From f9ddeb748da46dc7341b7608f64435695601f4b6 Mon Sep 17 00:00:00 2001
From: sgj <1442489573@qq.com>
Date: 星期三, 01 四月 2026 11:31:05 +0800
Subject: [PATCH] 登录页,对密码进行加密

---
 fzzy-igdss-core/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java |  109 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 109 insertions(+), 0 deletions(-)

diff --git a/fzzy-igdss-core/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java b/fzzy-igdss-core/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java
index 0cd1c0b..36289d0 100644
--- a/fzzy-igdss-core/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java
+++ b/fzzy-igdss-core/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java
@@ -48,6 +48,7 @@
  * @author ruoyi
  */
 public class ExcelUtil<T> {
+
     public static final String FORMULA_REGEX_STR = "=|-|\\+|@";
     public static final String[] FORMULA_STR = {"=", "-", "+", "@"};
     /**
@@ -107,6 +108,19 @@
      * 鏍囬
      */
     private String title;
+    /**
+     * 鎼滅储鏃堕棿
+     */
+    private String timeDesc;
+    /**
+     * 鍒惰〃浜�
+     */
+    private String createUser;
+    /**
+     * 鍒惰〃鏃堕棿
+     */
+    private Date createTime;
+
     /**
      * 鏈�澶ч珮搴�
      */
@@ -306,6 +320,24 @@
         createSubHead();
     }
 
+    public void init(List<T> list, String sheetName, String title, Type type, String timeDesc, String createUser, Date createTime) {
+        if (list == null) {
+            list = new ArrayList<T>();
+        }
+        this.list = list;
+        this.sheetName = sheetName;
+        this.type = type;
+        this.title = title;
+        this.timeDesc = timeDesc;
+        this.createUser = createUser;
+        this.createTime = createTime;
+        createExcelField();
+        createWorkbook();
+        createTitle();
+        createSecondHead();
+        createSubHead();
+    }
+
     /**
      * 鍒涘缓excel绗竴琛屾爣棰�
      */
@@ -325,6 +357,52 @@
             sheet.addMergedRegion(new CellRangeAddress(titleRow.getRowNum(), titleRow.getRowNum(), titleRow.getRowNum(), titleLastCol));
         }
     }
+
+    /**
+     * 鍒涘缓绗簩琛岃嚜瀹氫箟鍐呭
+     *
+     * @author sgj
+     * @since 2026/03/09
+     */
+    public void createSecondHead() {
+        if (StringUtils.isNotBlank(timeDesc) && StringUtils.isNotBlank(createUser) && createTime != null) {
+            subMergedFirstRowNum++;
+            subMergedLastRowNum++;
+            //绗簩琛岋紝娣诲姞鎼滅储鏃堕棿锛屽垱寤轰汉锛� 鍒涘缓鏃堕棿淇℃伅
+            Row secondRow = sheet.createRow(rownum);
+            secondRow.setHeightInPoints(30);
+            int titleLastCol = this.fields.size() - 1;
+            if (isSubList()) {
+                titleLastCol = titleLastCol + subFields.size() - 1;
+            }
+
+            // 鍒涘缓涓変釜鍗曞厓鏍硷紝鍒嗗埆鐢ㄤ簬鎼滅储鏃堕棿銆佸垱寤轰汉銆佸垱寤烘椂闂�
+            // 绗竴鍒楋細鎼滅储鏃堕棿
+            Cell timeDescCell = secondRow.createCell(0);
+            timeDescCell.setCellValue("鏌ヨ鏃堕棿锛�"+timeDesc);
+            timeDescCell.setCellStyle(styles.get("secTitle"));
+
+            // 涓棿鍒楋細鍒涘缓浜�
+            int createUserCol = (titleLastCol + 1) / 2;
+            Cell createUserCell = secondRow.createCell(createUserCol);
+            createUserCell.setCellValue("鍒惰〃浜猴細"+createUser);
+            createUserCell.setCellStyle(styles.get("secTitle"));
+
+            // 鏈�鍚庝竴鍒楋細鍒涘缓鏃堕棿
+            Cell createTimeCell = secondRow.createCell(titleLastCol - 1);
+            createTimeCell.setCellValue("鍒惰〃鏃堕棿锛�"+parseDateToStr("yyyy-MM-dd HH:mm:ss", createTime));
+            createTimeCell.setCellStyle(styles.get("secTitle"));
+
+            // 鍚堝苟鍗曞厓鏍�
+            sheet.addMergedRegion(new CellRangeAddress(secondRow.getRowNum(), secondRow.getRowNum(), 0, 1));
+            sheet.addMergedRegion(new CellRangeAddress(secondRow.getRowNum(), secondRow.getRowNum(), createUserCol, createUserCol + 1));
+            sheet.addMergedRegion(new CellRangeAddress(secondRow.getRowNum(), secondRow.getRowNum(), titleLastCol - 1, titleLastCol));
+
+            rownum++;
+        }
+
+    }
+
 
     /**
      * 鍒涘缓瀵硅薄鐨勫瓙鍒楄〃鍚嶇О
@@ -532,6 +610,27 @@
         this.init(list, sheetName, title, Type.EXPORT);
         return exportExcel();
     }
+
+    /**
+     * 瀵筶ist鏁版嵁婧愬皢鍏堕噷闈㈢殑鏁版嵁瀵煎叆鍒癳xcel琛ㄥ崟
+     *
+     * @param list       瀵煎嚭鏁版嵁闆嗗悎
+     * @param sheetName  宸ヤ綔琛ㄧ殑鍚嶇О
+     * @param title      鏍囬
+     * @param timeDesc   鏌ヨ鏃堕棿
+     * @param createUser 鍒惰〃浜�
+     * @param createTime 鍒惰〃鏃堕棿
+     * @return 缁撴灉
+     */
+    public AjaxResult exportExcel(List<T> list, String sheetName, String title, String timeDesc, String createUser, Date createTime) {
+        if (StringUtils.isBlank(timeDesc) || StringUtils.isBlank(createUser) || createTime == null) {
+            this.init(list, sheetName, title, Type.EXPORT);
+        } else {
+            this.init(list, sheetName, title, Type.EXPORT, timeDesc, createUser, createTime);
+        }
+        return exportExcel();
+    }
+
 
     /**
      * 瀵筶ist鏁版嵁婧愬皢鍏堕噷闈㈢殑鏁版嵁瀵煎叆鍒癳xcel琛ㄥ崟
@@ -770,6 +869,16 @@
         style.setFont(dataFont);
         styles.put("data", style);
 
+
+        style = wb.createCellStyle();
+        style.setAlignment(HorizontalAlignment.CENTER);
+        style.setVerticalAlignment(VerticalAlignment.CENTER);
+        Font dataFontTwo = wb.createFont();
+        dataFontTwo.setFontName("Arial");
+        dataFontTwo.setFontHeightInPoints((short) 10);
+        style.setFont(dataFontTwo);
+        styles.put("secTitle", style);
+
         style = wb.createCellStyle();
         style.setAlignment(HorizontalAlignment.CENTER);
         style.setVerticalAlignment(VerticalAlignment.CENTER);

--
Gitblit v1.9.3