From f50da3afc73bc458640677c198bb7c99de5b2fe5 Mon Sep 17 00:00:00 2001
From: buhuazhen <hua100783@gmail.com>
Date: 星期一, 09 三月 2026 17:33:45 +0800
Subject: [PATCH] fix(mybatis): 修正createUser和updateUser填充值类型空值处理
---
src/main/java/com/ruoyi/staff/utils/StyleYearUtils.java | 89 ++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 89 insertions(+), 0 deletions(-)
diff --git a/src/main/java/com/ruoyi/staff/utils/StyleYearUtils.java b/src/main/java/com/ruoyi/staff/utils/StyleYearUtils.java
new file mode 100644
index 0000000..961420e
--- /dev/null
+++ b/src/main/java/com/ruoyi/staff/utils/StyleYearUtils.java
@@ -0,0 +1,89 @@
+package com.ruoyi.staff.utils;
+
+import com.alibaba.excel.write.metadata.style.WriteCellStyle;
+import com.alibaba.excel.write.metadata.style.WriteFont;
+import org.apache.poi.ss.usermodel.BorderStyle;
+import org.apache.poi.ss.usermodel.FillPatternType;
+import org.apache.poi.ss.usermodel.HorizontalAlignment;
+import org.apache.poi.ss.usermodel.VerticalAlignment;
+
+public class StyleYearUtils {
+ /**
+ * 鏍囬鏍峰紡
+ *
+ * @return
+ */
+ public static WriteCellStyle getHeadStyle() {
+ // 澶寸殑绛栫暐
+ WriteCellStyle headWriteCellStyle = new WriteCellStyle();
+ // 鑳屾櫙棰滆壊
+// headWriteCellStyle.setFillForegroundColor(IndexedColors.GREEN.getIndex());
+ headWriteCellStyle.setFillPatternType(FillPatternType.SOLID_FOREGROUND);
+
+ // 瀛椾綋
+ WriteFont headWriteFont = new WriteFont();
+ headWriteFont.setFontName("浠垮畫");//璁剧疆瀛椾綋鍚嶅瓧
+ headWriteFont.setFontHeightInPoints((short) 9);//璁剧疆瀛椾綋澶у皬
+ headWriteFont.setBold(true);//瀛椾綋鍔犵矖
+ headWriteFont.setColor((short) 1);
+ headWriteCellStyle.setWriteFont(headWriteFont); //鍦ㄦ牱寮忕敤搴旂敤璁剧疆鐨勫瓧浣�;
+
+ // 鏍峰紡
+ headWriteCellStyle.setBorderBottom(BorderStyle.THIN);//璁剧疆搴曡竟妗�;
+ headWriteCellStyle.setBottomBorderColor((short) 1);//璁剧疆搴曡竟妗嗛鑹�;
+ headWriteCellStyle.setBorderLeft(BorderStyle.THIN); //璁剧疆宸﹁竟妗�;
+ headWriteCellStyle.setLeftBorderColor((short) 1);//璁剧疆宸﹁竟妗嗛鑹�;
+ headWriteCellStyle.setBorderRight(BorderStyle.THIN);//璁剧疆鍙宠竟妗�;
+ headWriteCellStyle.setRightBorderColor((short) 1);//璁剧疆鍙宠竟妗嗛鑹�;
+ headWriteCellStyle.setBorderTop(BorderStyle.THIN);//璁剧疆椤惰竟妗�;
+ headWriteCellStyle.setTopBorderColor((short) 1); //璁剧疆椤惰竟妗嗛鑹�;
+
+ headWriteCellStyle.setWrapped(false); //璁剧疆鑷姩鎹㈣;
+
+ headWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER);//璁剧疆姘村钩瀵归綈鐨勬牱寮忎负灞呬腑瀵归綈;
+ headWriteCellStyle.setVerticalAlignment(VerticalAlignment.CENTER); //璁剧疆鍨傜洿瀵归綈鐨勬牱寮忎负灞呬腑瀵归綈;
+ headWriteCellStyle.setShrinkToFit(true);//璁剧疆鏂囨湰鏀剁缉鑷冲悎閫�
+
+ return headWriteCellStyle;
+ }
+
+
+ /**
+ * 鍐呭鏍峰紡
+ *
+ * @return
+ */
+ public static WriteCellStyle getContentStyle() {
+ // 鍐呭鐨勭瓥鐣�
+ WriteCellStyle contentWriteCellStyle = new WriteCellStyle();
+
+ // 杩欓噷闇�瑕佹寚瀹� FillPatternType 涓篎illPatternType.SOLID_FOREGROUND 涓嶇劧鏃犳硶鏄剧ず鑳屾櫙棰滆壊.澶撮粯璁や簡 FillPatternType鎵�浠ュ彲浠ヤ笉鎸囧畾
+// contentWriteCellStyle.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex());
+ contentWriteCellStyle.setFillPatternType(FillPatternType.SOLID_FOREGROUND);
+
+ // 璁剧疆瀛椾綋
+ WriteFont contentWriteFont = new WriteFont();
+ contentWriteFont.setFontHeightInPoints((short) 9);//璁剧疆瀛椾綋澶у皬
+ contentWriteFont.setFontName("浠垮畫"); //璁剧疆瀛椾綋鍚嶅瓧
+ contentWriteCellStyle.setWriteFont(contentWriteFont);//鍦ㄦ牱寮忕敤搴旂敤璁剧疆鐨勫瓧浣�;
+
+ //璁剧疆鏍峰紡;
+ contentWriteCellStyle.setBorderBottom(BorderStyle.THIN);//璁剧疆搴曡竟妗�;
+ contentWriteCellStyle.setBottomBorderColor((short) 0);//璁剧疆搴曡竟妗嗛鑹�;
+ contentWriteCellStyle.setBorderLeft(BorderStyle.THIN); //璁剧疆宸﹁竟妗�;
+ contentWriteCellStyle.setLeftBorderColor((short) 0);//璁剧疆宸﹁竟妗嗛鑹�;
+ contentWriteCellStyle.setBorderRight(BorderStyle.THIN);//璁剧疆鍙宠竟妗�;
+ contentWriteCellStyle.setRightBorderColor((short) 0);//璁剧疆鍙宠竟妗嗛鑹�;
+ contentWriteCellStyle.setBorderTop(BorderStyle.THIN);//璁剧疆椤惰竟妗�;
+ contentWriteCellStyle.setTopBorderColor((short) 0); ///璁剧疆椤惰竟妗嗛鑹�;
+
+ contentWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER);// 姘村钩灞呬腑
+ contentWriteCellStyle.setVerticalAlignment(VerticalAlignment.CENTER);// 鍨傜洿灞呬腑
+ contentWriteCellStyle.setWrapped(false); //璁剧疆鑷姩鎹㈣;
+
+// contentWriteCellStyle.setShrinkToFit(true);//璁剧疆鏂囨湰鏀剁缉鑷冲悎閫�
+
+ return contentWriteCellStyle;
+ }
+
+}
--
Gitblit v1.9.3