简体中文
| English
- 一款分布式的任务调度及分布式计算框架,除了具备常规的任务调度功能外,还提供:暂停/取消运行中的任务、恢复执行被暂停的任务、任务分片、失败重试、广播任务、任务依赖、工作流任务(DAG)、管理器与执行器分离部署、Web管理后台等能力。
+ 一款分布式的任务调度与分布式计算框架,除了具备常规的任务调度功能外,还提供:暂停/取消运行中的任务、恢复执行被暂停的任务、任务分片、失败重试、广播任务、任务依赖、工作流任务(DAG)、管理器与执行器分离部署、Web管理后台等能力。
轻量级,简单易用,特别适合长任务的执行。有较好的伸缩性、扩展性、稳定性,历经生产检验。
Architecture
diff --git a/disjob-admin/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java b/disjob-admin/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java
index b427a63a3..b40e7ad4c 100644
--- a/disjob-admin/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java
+++ b/disjob-admin/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java
@@ -26,7 +26,7 @@ public class SysUser extends BaseEntity
private static final long serialVersionUID = 1L;
/** 用户ID */
- @Excel(name = "用户序号", cellType = ColumnType.NUMERIC, prompt = "用户编号")
+ @Excel(name = "用户序号", type = Type.EXPORT, cellType = ColumnType.NUMERIC, prompt = "用户编号")
private Long userId;
/** 部门ID */
diff --git a/disjob-admin/ruoyi-common/src/main/java/com/ruoyi/common/utils/DictUtils.java b/disjob-admin/ruoyi-common/src/main/java/com/ruoyi/common/utils/DictUtils.java
index 54f29107b..1ce896f6e 100644
--- a/disjob-admin/ruoyi-common/src/main/java/com/ruoyi/common/utils/DictUtils.java
+++ b/disjob-admin/ruoyi-common/src/main/java/com/ruoyi/common/utils/DictUtils.java
@@ -55,6 +55,10 @@ public static List getDictCache(String key)
*/
public static String getDictLabel(String dictType, String dictValue)
{
+ if (StringUtils.isEmpty(dictValue))
+ {
+ return StringUtils.EMPTY;
+ }
return getDictLabel(dictType, dictValue, SEPARATOR);
}
@@ -67,6 +71,10 @@ public static String getDictLabel(String dictType, String dictValue)
*/
public static String getDictValue(String dictType, String dictLabel)
{
+ if (StringUtils.isEmpty(dictLabel))
+ {
+ return StringUtils.EMPTY;
+ }
return getDictValue(dictType, dictLabel, SEPARATOR);
}
diff --git a/disjob-admin/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java b/disjob-admin/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java
index 3e7aa9163..3b26eac04 100644
--- a/disjob-admin/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java
+++ b/disjob-admin/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java
@@ -424,7 +424,12 @@ else if (Boolean.TYPE == fieldType || Boolean.class == fieldType)
}
else if (StringUtils.isNotEmpty(attr.dictType()))
{
- val = reverseDictByExp(Convert.toStr(val), attr.dictType(), attr.separator());
+ if (!sysDictMap.containsKey(attr.dictType() + val))
+ {
+ String dictValue = reverseDictByExp(Convert.toStr(val), attr.dictType(), attr.separator());
+ sysDictMap.put(attr.dictType() + val, dictValue);
+ }
+ val = sysDictMap.get(attr.dictType() + val);
}
else if (!attr.handler().equals(ExcelHandlerAdapter.class))
{
diff --git a/disjob-admin/ruoyi-common/src/main/java/com/ruoyi/common/xss/XssFilter.java b/disjob-admin/ruoyi-common/src/main/java/com/ruoyi/common/xss/XssFilter.java
index 424036f59..518196715 100644
--- a/disjob-admin/ruoyi-common/src/main/java/com/ruoyi/common/xss/XssFilter.java
+++ b/disjob-admin/ruoyi-common/src/main/java/com/ruoyi/common/xss/XssFilter.java
@@ -7,6 +7,7 @@
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.List;
/**
@@ -27,11 +28,7 @@ public void init(FilterConfig filterConfig) throws ServletException
String tempExcludes = filterConfig.getInitParameter("excludes");
if (StringUtils.isNotEmpty(tempExcludes))
{
- String[] url = tempExcludes.split(",");
- for (int i = 0; url != null && i < url.length; i++)
- {
- excludes.add(url[i]);
- }
+ excludes.addAll(Arrays.asList(tempExcludes.split(",")));
}
}
diff --git a/disjob-admin/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/CacheService.java b/disjob-admin/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/CacheService.java
index e2102dd9e..550708877 100644
--- a/disjob-admin/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/CacheService.java
+++ b/disjob-admin/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/CacheService.java
@@ -6,6 +6,7 @@
import org.springframework.stereotype.Service;
import java.util.Set;
+import java.util.TreeSet;
/**
* 缓存操作处理
@@ -34,7 +35,7 @@ public String[] getCacheNames()
*/
public Set getCacheKeys(String cacheName)
{
- return CacheUtils.getCache(cacheName).keys();
+ return new TreeSet<>(CacheUtils.getCache(cacheName).keys());
}
/**
diff --git a/disjob-admin/ruoyi-generator/src/main/java/com/ruoyi/generator/domain/GenTable.java b/disjob-admin/ruoyi-generator/src/main/java/com/ruoyi/generator/domain/GenTable.java
index f8e3a432b..82de40ddd 100644
--- a/disjob-admin/ruoyi-generator/src/main/java/com/ruoyi/generator/domain/GenTable.java
+++ b/disjob-admin/ruoyi-generator/src/main/java/com/ruoyi/generator/domain/GenTable.java
@@ -62,6 +62,9 @@ public class GenTable extends BaseEntity
@NotBlank(message = "作者不能为空")
private String functionAuthor;
+ /** 表单布局(单列 双列 三列) */
+ private int formColNum;
+
/** 生成代码方式(0zip压缩包 1自定义路径) */
private String genType;
@@ -216,6 +219,16 @@ public void setFunctionAuthor(String functionAuthor)
this.functionAuthor = functionAuthor;
}
+ public int getFormColNum()
+ {
+ return formColNum;
+ }
+
+ public void setFormColNum(int formColNum)
+ {
+ this.formColNum = formColNum;
+ }
+
public String getGenType()
{
return genType;
diff --git a/disjob-admin/ruoyi-generator/src/main/java/com/ruoyi/generator/util/VelocityUtils.java b/disjob-admin/ruoyi-generator/src/main/java/com/ruoyi/generator/util/VelocityUtils.java
index 55395d567..7a882f331 100644
--- a/disjob-admin/ruoyi-generator/src/main/java/com/ruoyi/generator/util/VelocityUtils.java
+++ b/disjob-admin/ruoyi-generator/src/main/java/com/ruoyi/generator/util/VelocityUtils.java
@@ -51,6 +51,8 @@ public static VelocityContext prepareContext(GenTable genTable)
velocityContext.put("basePackage", getPackagePrefix(packageName));
velocityContext.put("packageName", packageName);
velocityContext.put("author", genTable.getFunctionAuthor());
+ velocityContext.put("colXsNum", getColXsNum(genTable.getFormColNum()));
+ velocityContext.put("colSmNum", getColSmNum(genTable.getFormColNum()));
velocityContext.put("datetime", DateUtils.getDate());
velocityContext.put("pkColumn", genTable.getPkColumn());
velocityContext.put("importList", getImportList(genTable));
@@ -382,4 +384,41 @@ public static int getExpandColumn(GenTable genTable)
}
return num;
}
+
+ /**
+ * 获取表单排列网格
+ *
+ * @param formColNum 表单布局方式
+ * @return 排列类样式
+ */
+ public static String getColXsNum(int formColNum)
+ {
+ String colXsNum = "col-xs-12";
+ if (formColNum == 2)
+ {
+ return "col-xs-6";
+ }
+ else if (formColNum == 3)
+ {
+ return "col-xs-4";
+ }
+ return colXsNum;
+ }
+
+ /**
+ * 获取表单label网格
+ *
+ * @param formColNum 表单布局方式
+ * @return 网格类样式
+ */
+ public static String getColSmNum(int formColNum)
+ {
+ String colSmNum = "col-sm-3";
+ if (formColNum == 2 || formColNum == 3)
+ {
+ return "col-sm-4";
+ }
+ return colSmNum;
+ }
+
}
diff --git a/disjob-admin/ruoyi-generator/src/main/resources/generator.yml b/disjob-admin/ruoyi-generator/src/main/resources/generator.yml
index 3111cabe0..e5327b6e9 100644
--- a/disjob-admin/ruoyi-generator/src/main/resources/generator.yml
+++ b/disjob-admin/ruoyi-generator/src/main/resources/generator.yml
@@ -8,4 +8,4 @@ gen:
# 自动去除表前缀,默认是false
autoRemovePre: false
# 表前缀(生成类名不会包含表前缀,多个用逗号分隔)
- tablePrefix: sched_
\ No newline at end of file
+ tablePrefix: sched_
diff --git a/disjob-admin/ruoyi-generator/src/main/resources/mapper/generator/GenTableMapper.xml b/disjob-admin/ruoyi-generator/src/main/resources/mapper/generator/GenTableMapper.xml
index bc7cf5277..5b7a08c1e 100644
--- a/disjob-admin/ruoyi-generator/src/main/resources/mapper/generator/GenTableMapper.xml
+++ b/disjob-admin/ruoyi-generator/src/main/resources/mapper/generator/GenTableMapper.xml
@@ -17,6 +17,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+
@@ -54,7 +55,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
- select table_id, table_name, table_comment, sub_table_name, sub_table_fk_name, class_name, tpl_category, package_name, module_name, business_name, function_name, function_author, gen_type, gen_path, options, create_by, create_time, update_by, update_time, remark from gen_table
+ select table_id, table_name, table_comment, sub_table_name, sub_table_fk_name, class_name, tpl_category, package_name, module_name, business_name, function_name, function_author, form_col_num, gen_type, gen_path, options, create_by, create_time, update_by, update_time, remark from gen_table