diff --git a/README.md b/README.md index 25961ed98..e7a8c134c 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Logo

- 一款分布式的任务调度及分布式计算框架 + 一款分布式的任务调度与分布式计算框架

License @@ -19,7 +19,7 @@ **`简体中文`** | [English](README.en.md) -一款分布式的任务调度及分布式计算框架,除了具备常规的任务调度功能外,还提供暂停/取消运行中的任务、恢复执行被暂停的任务、任务分片、失败重试、广播任务、任务依赖、工作流任务(DAG)、管理器与执行器分离部署、Web管理后台等能力。 +一款分布式的任务调度与分布式计算框架,除了具备常规的任务调度功能外,还提供暂停/取消运行中的任务、恢复执行被暂停的任务、任务分片、失败重试、广播任务、任务依赖、工作流任务(DAG)、管理器与执行器分离部署、Web管理后台等能力。 轻量级,简单易用,特别适合长任务的执行。有较好的伸缩性、扩展性、稳定性,历经生产检验。 diff --git a/disjob-admin/pom.xml b/disjob-admin/pom.xml index 593f06f2b..1ee162291 100644 --- a/disjob-admin/pom.xml +++ b/disjob-admin/pom.xml @@ -40,7 +40,7 @@ 1.2.23 1.21 2.3.3 - 1.4.7 + 2.1.0 1.2.83 6.6.1 2.16.1 diff --git a/disjob-admin/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java b/disjob-admin/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java index 8605b01a3..3b2ce102a 100644 --- a/disjob-admin/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java +++ b/disjob-admin/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java @@ -127,6 +127,9 @@ public String add(ModelMap mmap) @ResponseBody public AjaxResult addSave(@Validated SysUser user) { + deptService.checkDeptDataScope(user.getDeptId()); + roleService.checkRoleDataScope(user.getRoleIds()); + if (!userService.checkLoginNameUnique(user)) { return error("新增用户'" + user.getLoginName() + "'失败,登录账号已存在"); @@ -186,6 +189,8 @@ public AjaxResult editSave(@Validated SysUser user) { userService.checkUserAllowed(user); userService.checkUserDataScope(user.getUserId()); + deptService.checkDeptDataScope(user.getDeptId()); + roleService.checkRoleDataScope(user.getRoleIds()); if (!userService.checkLoginNameUnique(user)) { return error("修改用户'" + user.getLoginName() + "'失败,登录账号已存在"); @@ -256,6 +261,7 @@ public String authRole(@PathVariable("userId") Long userId, ModelMap mmap) public AjaxResult insertAuthRole(Long userId, Long[] roleIds) { userService.checkUserDataScope(userId); + roleService.checkRoleDataScope(roleIds); userService.insertUserAuth(userId, roleIds); AuthorizationUtils.clearAllCachedAuthorizationInfo(); return success(); diff --git a/disjob-admin/ruoyi-admin/src/main/resources/static/ruoyi/css/ry-ui.css b/disjob-admin/ruoyi-admin/src/main/resources/static/ruoyi/css/ry-ui.css index 5abfbb3b4..a3b08b768 100644 --- a/disjob-admin/ruoyi-admin/src/main/resources/static/ruoyi/css/ry-ui.css +++ b/disjob-admin/ruoyi-admin/src/main/resources/static/ruoyi/css/ry-ui.css @@ -384,12 +384,12 @@ label.error { position: relative; padding-left: 25px; padding-right: 15px; - padding-top: 8px; + padding-top: 7px; } .icheckbox, .icheckbox-blue, .iradio, .iradio-blue, .iradio-purple { position: absolute; - top: 8px; + top: 7px; left: 0 } diff --git a/disjob-admin/ruoyi-admin/src/main/resources/templates/main.html b/disjob-admin/ruoyi-admin/src/main/resources/templates/main.html index c4803d9cf..8e735e091 100644 --- a/disjob-admin/ruoyi-admin/src/main/resources/templates/main.html +++ b/disjob-admin/ruoyi-admin/src/main/resources/templates/main.html @@ -106,7 +106,7 @@

Logo License JDK Maven Central Build status

简体中文 | 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
@@ -135,13 +135,13 @@
- +
- -
- - -
+
@@ -156,6 +156,18 @@ +
+
+ +
+ +
+ + +
+
+
+