mirror of
https://github.com/yangzongzhuan/RuoYi-Vue.git
synced 2025-09-07 13:52:06 +00:00
优化代码
This commit is contained in:
@@ -56,6 +56,7 @@ public @interface Excel
|
||||
/**
|
||||
* BigDecimal 舍入规则 默认:BigDecimal.ROUND_HALF_EVEN
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public int roundingMode() default BigDecimal.ROUND_HALF_EVEN;
|
||||
|
||||
/**
|
||||
|
@@ -541,7 +541,7 @@ public class Convert
|
||||
|
||||
/**
|
||||
* 转换为boolean<br>
|
||||
* String支持的值为:true、false、yes、ok、no,1,0 如果给定的值为空,或者转换失败,返回默认值<br>
|
||||
* String支持的值为:true、false、yes、ok、no、1、0、是、否, 如果给定的值为空,或者转换失败,返回默认值<br>
|
||||
* 转换失败不会报错
|
||||
*
|
||||
* @param value 被转换的值
|
||||
@@ -570,10 +570,12 @@ public class Convert
|
||||
case "yes":
|
||||
case "ok":
|
||||
case "1":
|
||||
case "是":
|
||||
return true;
|
||||
case "false":
|
||||
case "no":
|
||||
case "0":
|
||||
case "否":
|
||||
return false;
|
||||
default:
|
||||
return defaultValue;
|
||||
|
@@ -1119,6 +1119,7 @@ public class ExcelUtil<T>
|
||||
/**
|
||||
* 添加单元格
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public Cell addCell(Excel attr, Row row, T vo, Field field, int column)
|
||||
{
|
||||
Cell cell = null;
|
||||
|
@@ -310,6 +310,7 @@ public class ReflectUtils
|
||||
/**
|
||||
* 改变private/protected的方法为public,尽量不调用实际改动的语句,避免JDK的SecurityManager抱怨。
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public static void makeAccessible(Method method)
|
||||
{
|
||||
if ((!Modifier.isPublic(method.getModifiers()) || !Modifier.isPublic(method.getDeclaringClass().getModifiers()))
|
||||
@@ -322,6 +323,7 @@ public class ReflectUtils
|
||||
/**
|
||||
* 改变private/protected的成员变量为public,尽量不调用实际改动的语句,避免JDK的SecurityManager抱怨。
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public static void makeAccessible(Field field)
|
||||
{
|
||||
if ((!Modifier.isPublic(field.getModifiers()) || !Modifier.isPublic(field.getDeclaringClass().getModifiers())
|
||||
|
@@ -1,5 +1,6 @@
|
||||
package com.ruoyi.common.utils.spring;
|
||||
|
||||
import org.springframework.aop.framework.Advised;
|
||||
import org.springframework.aop.framework.AopContext;
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
|
||||
@@ -120,7 +121,12 @@ public final class SpringUtils implements BeanFactoryPostProcessor, ApplicationC
|
||||
@SuppressWarnings("unchecked")
|
||||
public static <T> T getAopProxy(T invoker)
|
||||
{
|
||||
return (T) AopContext.currentProxy();
|
||||
Object proxy = AopContext.currentProxy();
|
||||
if (((Advised) proxy).getTargetSource().getTargetClass() == invoker.getClass())
|
||||
{
|
||||
return (T) proxy;
|
||||
}
|
||||
return invoker;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user