From 1f0e742710af7917ecde23a761acd7c28ea3dd53 Mon Sep 17 00:00:00 2001
From: RuoYi <yzz_ivy@163.com>
Date: 星期三, 20 七月 2022 09:39:58 +0800
Subject: [PATCH] Excel注解支持backgroundColor属性设置背景色
---
ruoyi-common/src/main/java/com/ruoyi/common/core/text/Convert.java | 34 +++++++++++++++++++---------------
1 files changed, 19 insertions(+), 15 deletions(-)
diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/text/Convert.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/text/Convert.java
index 8108c0c..4578a04 100644
--- a/ruoyi-common/src/main/java/com/ruoyi/common/core/text/Convert.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/text/Convert.java
@@ -562,17 +562,12 @@
switch (valueStr)
{
case "true":
- return true;
- case "false":
- return false;
case "yes":
- return true;
case "ok":
- return true;
- case "no":
- return false;
case "1":
return true;
+ case "false":
+ case "no":
case "0":
return false;
default:
@@ -785,19 +780,28 @@
* @param charset 字符集
* @return 字符串
*/
- public static String str(Object obj, Charset charset) {
- if (null == obj) {
+ public static String str(Object obj, Charset charset)
+ {
+ if (null == obj)
+ {
return null;
}
- if (obj instanceof String) {
+ if (obj instanceof String)
+ {
return (String) obj;
- } else if (obj instanceof byte[]) {
+ }
+ else if (obj instanceof byte[])
+ {
return str((byte[]) obj, charset);
- } else if (obj instanceof Byte[]) {
+ }
+ else if (obj instanceof Byte[])
+ {
byte[] bytes = ArrayUtils.toPrimitive((Byte[]) obj);
return str(bytes, charset);
- } else if (obj instanceof ByteBuffer) {
+ }
+ else if (obj instanceof ByteBuffer)
+ {
return str((ByteBuffer) obj, charset);
}
return obj.toString();
@@ -890,7 +894,7 @@
*/
public static String toSBC(String input, Set<Character> notConvertSet)
{
- char c[] = input.toCharArray();
+ char[] c = input.toCharArray();
for (int i = 0; i < c.length; i++)
{
if (null != notConvertSet && notConvertSet.contains(c[i]))
@@ -932,7 +936,7 @@
*/
public static String toDBC(String text, Set<Character> notConvertSet)
{
- char c[] = text.toCharArray();
+ char[] c = text.toCharArray();
for (int i = 0; i < c.length; i++)
{
if (null != notConvertSet && notConvertSet.contains(c[i]))
--
Gitblit v1.9.2