Skip to content

Commit

Permalink
sync ruoyi code
Browse files Browse the repository at this point in the history
  • Loading branch information
ponfee committed Jun 2, 2024
1 parent 80471d3 commit 1655819
Show file tree
Hide file tree
Showing 34 changed files with 398 additions and 304 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<img src="docs/images/logo.png" width="160" alt="Logo" />
</p>
<p align="center">
<strong>一款分布式的任务调度及分布式计算框架</strong>
<strong>一款分布式的任务调度与分布式计算框架</strong>
</p>
<p align="center">
<a href="https://www.apache.org/licenses/LICENSE-2.0.html"><img src="https://img.shields.io/badge/license-Apache--2.0-green.svg?logo=apache" alt="License"></a>
Expand All @@ -19,7 +19,7 @@

**`简体中文`** | [English](README.en.md)

一款分布式的任务调度及分布式计算框架,除了具备常规的任务调度功能外,还提供暂停/取消运行中的任务、恢复执行被暂停的任务、任务分片、失败重试、广播任务、任务依赖、工作流任务(DAG)、管理器与执行器分离部署、Web管理后台等能力。
一款分布式的任务调度与分布式计算框架,除了具备常规的任务调度功能外,还提供暂停/取消运行中的任务、恢复执行被暂停的任务、任务分片、失败重试、广播任务、任务依赖、工作流任务(DAG)、管理器与执行器分离部署、Web管理后台等能力。

轻量级,简单易用,特别适合长任务的执行。有较好的伸缩性、扩展性、稳定性,历经生产检验。

Expand Down
2 changes: 1 addition & 1 deletion disjob-admin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<druid-spring-boot-starter.version>1.2.23</druid-spring-boot-starter.version>
<UserAgentUtils.version>1.21</UserAgentUtils.version>
<kaptcha.version>2.3.3</kaptcha.version>
<pagehelper-spring-boot-starter.version>1.4.7</pagehelper-spring-boot-starter.version>
<pagehelper-spring-boot-starter.version>2.1.0</pagehelper-spring-boot-starter.version>
<fastjson.version>1.2.83</fastjson.version>
<oshi-core.version>6.6.1</oshi-core.version>
<commons-io.version>2.16.1</commons-io.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() + "'失败,登录账号已存在");
Expand Down Expand Up @@ -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() + "'失败,登录账号已存在");
Expand Down Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ <h2 class="Box-title">
<div data-target="readme-toc.content" class="Box-body px-5 pb-5">
<article class="markdown-body entry-content container-lg" itemprop="text"><h1 tabindex="-1" dir="auto"><a id="user-content-----" class="anchor" aria-hidden="true" tabindex="-1" href="#----"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a><a target="_blank" rel="noopener noreferrer" href="https://github.com/dromara/disjob/blob/master/docs/images/logo.png"><img src="https://raw.githubusercontent.com/dromara/disjob/master/docs/images/logo.png" width="125" alt="Logo" style="max-width: 100%;"></a> <a href="https://www.apache.org/licenses/LICENSE-2.0.html" rel="nofollow"><img src="https://camo.githubusercontent.com/336cf44c90c3018c78147c01ada6f5c7df315065322173b9a3445403facf1f83/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4170616368652d2d322e302d677265656e2e737667" alt="License" data-canonical-src="https://img.shields.io/badge/license-Apache--2.0-green.svg" style="max-width: 100%;"></a> <a href="https://www.oracle.com/java/technologies/downloads/#java8" rel="nofollow"><img src="https://camo.githubusercontent.com/6c6fa7212b17e341c023148966e6e1f496d477d2d6a2ebc3bcd0273b1314f456/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6a646b2d382b2d677265656e2e737667" alt="JDK" data-canonical-src="https://img.shields.io/badge/jdk-8+-green.svg" style="max-width: 100%;"></a> <a href="https://central.sonatype.com/namespace/cn.ponfee" rel="nofollow"><img src="https://camo.githubusercontent.com/2e483a7517cb5932cb7803b24c8f4b0df627ed68da5c0f3a07b436d14bad6218/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6d6176656e2d2d63656e7472616c2d322e302e362d6f72616e67652e7376673f7374796c653d706c6173746963266c6f676f3d6170616368656d6176656e" alt="Maven Central" data-canonical-src="https://img.shields.io/badge/maven--central-2.1.0-orange.svg?style=plastic&amp;logo=apachemaven" style="max-width: 100%;"></a> <a href="https://github.com/dromara/disjob/actions"><img src="https://github.com/dromara/disjob/workflows/build/badge.svg" alt="Build status" style="max-width: 100%;"></a></h1>
<p dir="auto"><strong><code>简体中文</code></strong> | <a href="https://github.com/dromara/disjob/blob/master/README.en.md">English</a></p>
<p dir="auto">一款分布式的任务调度及分布式计算框架,除了具备常规的任务调度功能外,还提供:暂停/取消运行中的任务、恢复执行被暂停的任务、任务分片、失败重试、广播任务、任务依赖、工作流任务(DAG)、管理器与执行器分离部署、Web管理后台等能力。</p>
<p dir="auto">一款分布式的任务调度与分布式计算框架,除了具备常规的任务调度功能外,还提供:暂停/取消运行中的任务、恢复执行被暂停的任务、任务分片、失败重试、广播任务、任务依赖、工作流任务(DAG)、管理器与执行器分离部署、Web管理后台等能力。</p>
<p dir="auto">轻量级,简单易用,特别适合长任务的执行。有较好的伸缩性、扩展性、稳定性,历经生产检验。</p>
<h2 tabindex="-1" dir="auto"><a id="user-content-architecture" class="anchor" aria-hidden="true" tabindex="-1" href="#architecture"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a>Architecture</h2>
<ul dir="auto">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ public static List<SysDictData> getDictCache(String key)
*/
public static String getDictLabel(String dictType, String dictValue)
{
if (StringUtils.isEmpty(dictValue))
{
return StringUtils.EMPTY;
}
return getDictLabel(dictType, dictValue, SEPARATOR);
}

Expand All @@ -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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand All @@ -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(",")));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import org.springframework.stereotype.Service;

import java.util.Set;
import java.util.TreeSet;

/**
* 缓存操作处理
Expand Down Expand Up @@ -34,7 +35,7 @@ public String[] getCacheNames()
*/
public Set<String> getCacheKeys(String cacheName)
{
return CacheUtils.getCache(cacheName).keys();
return new TreeSet<>(CacheUtils.getCache(cacheName).keys());
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ public class GenTable extends BaseEntity
@NotBlank(message = "作者不能为空")
private String functionAuthor;

/** 表单布局(单列 双列 三列) */
private int formColNum;

/** 生成代码方式(0zip压缩包 1自定义路径) */
private String genType;

Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -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;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ gen:
# 自动去除表前缀,默认是false
autoRemovePre: false
# 表前缀(生成类名不会包含表前缀,多个用逗号分隔)
tablePrefix: sched_
tablePrefix: sched_
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="businessName" column="business_name" />
<result property="functionName" column="function_name" />
<result property="functionAuthor" column="function_author" />
<result property="formColNum" column="form_col_num" />
<result property="genType" column="gen_type" />
<result property="genPath" column="gen_path" />
<result property="options" column="options" />
Expand Down Expand Up @@ -54,7 +55,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>

<sql id="selectGenTableVo">
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
</sql>

<select id="selectGenTableList" parameterType="GenTable" resultMap="GenTableResult">
Expand Down Expand Up @@ -99,23 +100,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>

<select id="selectGenTableById" parameterType="Long" resultMap="GenTableResult">
SELECT t.table_id, t.table_name, t.table_comment, t.sub_table_name, t.sub_table_fk_name, t.class_name, t.tpl_category, t.package_name, t.module_name, t.business_name, t.function_name, t.function_author, t.gen_type, t.gen_path, t.options, t.remark,
SELECT t.table_id, t.table_name, t.table_comment, t.sub_table_name, t.sub_table_fk_name, t.class_name, t.tpl_category, t.package_name, t.module_name, t.business_name, t.function_name, t.function_author, t.form_col_num, t.gen_type, t.gen_path, t.options, t.remark,
c.column_id, c.column_name, c.column_comment, c.column_type, c.java_type, c.java_field, c.is_pk, c.is_increment, c.is_required, c.is_insert, c.is_edit, c.is_list, c.is_query, c.query_type, c.html_type, c.dict_type, c.sort
FROM gen_table t
LEFT JOIN gen_table_column c ON t.table_id = c.table_id
where t.table_id = #{tableId} order by c.sort
</select>

<select id="selectGenTableByName" parameterType="String" resultMap="GenTableResult">
SELECT t.table_id, t.table_name, t.table_comment, t.sub_table_name, t.sub_table_fk_name, t.class_name, t.tpl_category, t.package_name, t.module_name, t.business_name, t.function_name, t.function_author, t.gen_type, t.gen_path, t.options, t.remark,
SELECT t.table_id, t.table_name, t.table_comment, t.sub_table_name, t.sub_table_fk_name, t.class_name, t.tpl_category, t.package_name, t.module_name, t.business_name, t.function_name, t.function_author, t.form_col_num, t.gen_type, t.gen_path, t.options, t.remark,
c.column_id, c.column_name, c.column_comment, c.column_type, c.java_type, c.java_field, c.is_pk, c.is_increment, c.is_required, c.is_insert, c.is_edit, c.is_list, c.is_query, c.query_type, c.html_type, c.dict_type, c.sort
FROM gen_table t
LEFT JOIN gen_table_column c ON t.table_id = c.table_id
where t.table_name = #{tableName} order by c.sort
</select>

<select id="selectGenTableAll" parameterType="String" resultMap="GenTableResult">
SELECT t.table_id, t.table_name, t.table_comment, t.sub_table_name, t.sub_table_fk_name, t.class_name, t.tpl_category, t.package_name, t.module_name, t.business_name, t.function_name, t.function_author, t.gen_type, t.gen_path, t.options, t.remark,
SELECT t.table_id, t.table_name, t.table_comment, t.sub_table_name, t.sub_table_fk_name, t.class_name, t.tpl_category, t.package_name, t.module_name, t.business_name, t.function_name, t.function_author, t.form_col_num, t.gen_type, t.gen_path, t.options, t.remark,
c.column_id, c.column_name, c.column_comment, c.column_type, c.java_type, c.java_field, c.is_pk, c.is_increment, c.is_required, c.is_insert, c.is_edit, c.is_list, c.is_query, c.query_type, c.html_type, c.dict_type, c.sort
FROM gen_table t
LEFT JOIN gen_table_column c ON t.table_id = c.table_id
Expand All @@ -133,6 +134,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="businessName != null and businessName != ''">business_name,</if>
<if test="functionName != null and functionName != ''">function_name,</if>
<if test="functionAuthor != null and functionAuthor != ''">function_author,</if>
<if test="formColNum != null">form_col_num,</if>
<if test="genType != null and genType != ''">gen_type,</if>
<if test="genPath != null and genPath != ''">gen_path,</if>
<if test="remark != null and remark != ''">remark,</if>
Expand All @@ -148,6 +150,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="businessName != null and businessName != ''">#{businessName},</if>
<if test="functionName != null and functionName != ''">#{functionName},</if>
<if test="functionAuthor != null and functionAuthor != ''">#{functionAuthor},</if>
<if test="formColNum != null">#{formColNum},</if>
<if test="genType != null and genType != ''">#{genType},</if>
<if test="genPath != null and genPath != ''">#{genPath},</if>
<if test="remark != null and remark != ''">#{remark},</if>
Expand All @@ -169,6 +172,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="subTableFkName != null">sub_table_fk_name = #{subTableFkName},</if>
<if test="className != null and className != ''">class_name = #{className},</if>
<if test="functionAuthor != null and functionAuthor != ''">function_author = #{functionAuthor},</if>
<if test="formColNum != null">form_col_num = #{formColNum},</if>
<if test="genType != null and genType != ''">gen_type = #{genType},</if>
<if test="genPath != null and genPath != ''">gen_path = #{genPath},</if>
<if test="tplCategory != null and tplCategory != ''">tpl_category = #{tplCategory},</if>
Expand All @@ -191,4 +195,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach>
</delete>

</mapper>
</mapper>
Loading

0 comments on commit 1655819

Please sign in to comment.