定时任务支持并发控制
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
package com.ruoyi.common.utils;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
import java.io.StringWriter;
|
||||
import org.apache.commons.lang3.exception.ExceptionUtils;
|
||||
|
||||
/**
|
||||
* 错误信息处理类。
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class ExceptionUtil
|
||||
{
|
||||
|
||||
/**
|
||||
* 获取exception的详细错误信息。
|
||||
*/
|
||||
public static String getExceptionMessage(Throwable e)
|
||||
{
|
||||
StringWriter sw = new StringWriter();
|
||||
e.printStackTrace(new PrintWriter(sw, true));
|
||||
String str = sw.toString();
|
||||
return str;
|
||||
}
|
||||
|
||||
public static String getRootErrorMseeage(Exception e)
|
||||
{
|
||||
Throwable root = ExceptionUtils.getRootCause(e);
|
||||
root = (root == null ? e : root);
|
||||
if (root == null)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
String msg = root.getMessage();
|
||||
if (msg == null)
|
||||
{
|
||||
return "null";
|
||||
}
|
||||
return StringUtils.defaultString(msg);
|
||||
}
|
||||
}
|
@@ -40,7 +40,7 @@ public class YamlUtil
|
||||
if (map != null && !map.isEmpty() && qualifiedKey != null)
|
||||
{
|
||||
String input = String.valueOf(qualifiedKey);
|
||||
if (!input.equals(""))
|
||||
if (!"".equals(input))
|
||||
{
|
||||
if (input.contains("."))
|
||||
{
|
||||
|
@@ -647,7 +647,9 @@ public class ExcelUtil<T>
|
||||
{
|
||||
tempClass = tempClass.getSuperclass();
|
||||
if (tempClass != null)
|
||||
{
|
||||
tempFields.addAll(Arrays.asList(tempClass.getDeclaredFields()));
|
||||
}
|
||||
}
|
||||
putToFields(tempFields);
|
||||
}
|
||||
|
Reference in New Issue
Block a user