Skip to content

Commit

Permalink
!640 发布 5.3.0 新春版 祝大家新年快乐
Browse files Browse the repository at this point in the history
Merge pull request !640 from 疯狂的狮子Li/dev
  • Loading branch information
JavaLionLi authored and gitee-org committed Jan 24, 2025
2 parents 3c8d864 + b528f0b commit 296466f
Show file tree
Hide file tree
Showing 32 changed files with 285 additions and 53 deletions.
2 changes: 1 addition & 1 deletion .run/ruoyi-monitor-admin.run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<configuration default="false" name="ruoyi-monitor-admin" type="docker-deploy" factoryName="dockerfile" server-name="Docker">
<deployment type="dockerfile">
<settings>
<option name="imageTag" value="ruoyi/ruoyi-monitor-admin:5.3.0-BETA" />
<option name="imageTag" value="ruoyi/ruoyi-monitor-admin:5.3.0" />
<option name="buildOnly" value="true" />
<option name="sourceFilePath" value="ruoyi-extend/ruoyi-monitor-admin/Dockerfile" />
</settings>
Expand Down
2 changes: 1 addition & 1 deletion .run/ruoyi-server.run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<configuration default="false" name="ruoyi-server" type="docker-deploy" factoryName="dockerfile" server-name="Docker">
<deployment type="dockerfile">
<settings>
<option name="imageTag" value="ruoyi/ruoyi-server:5.3.0-BETA" />
<option name="imageTag" value="ruoyi/ruoyi-server:5.3.0" />
<option name="buildOnly" value="true" />
<option name="sourceFilePath" value="ruoyi-admin/Dockerfile" />
</settings>
Expand Down
2 changes: 1 addition & 1 deletion .run/ruoyi-snailjob-server.run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<configuration default="false" name="ruoyi-snailjob-server" type="docker-deploy" factoryName="dockerfile" server-name="Docker">
<deployment type="dockerfile">
<settings>
<option name="imageTag" value="ruoyi/ruoyi-snailjob-server:5.3.0-BETA" />
<option name="imageTag" value="ruoyi/ruoyi-snailjob-server:5.3.0" />
<option name="buildOnly" value="true" />
<option name="sourceFilePath" value="ruoyi-extend/ruoyi-snailjob-server/Dockerfile" />
</settings>
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
[![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://gitee.com/dromara/RuoYi-Vue-Plus/blob/master/LICENSE)
[![使用IntelliJ IDEA开发维护](https://img.shields.io/badge/IntelliJ%20IDEA-提供支持-blue.svg)](https://www.jetbrains.com/?from=RuoYi-Vue-Plus)
<br>
[![RuoYi-Vue-Plus](https://img.shields.io/badge/RuoYi_Vue_Plus-5.3.0--BETA-success.svg)](https://gitee.com/dromara/RuoYi-Vue-Plus)
[![RuoYi-Vue-Plus](https://img.shields.io/badge/RuoYi_Vue_Plus-5.3.0-success.svg)](https://gitee.com/dromara/RuoYi-Vue-Plus)
[![Spring Boot](https://img.shields.io/badge/Spring%20Boot-3.4-blue.svg)]()
[![JDK-17](https://img.shields.io/badge/JDK-17-green.svg)]()
[![JDK-21](https://img.shields.io/badge/JDK-21-green.svg)]()
Expand All @@ -23,7 +23,6 @@
> 系统演示: [传送门](https://plus-doc.dromara.org/#/common/demo_system)
> 官方前端项目地址: [plus-ui](https://gitee.com/JavaLionLi/plus-ui)<br>
> 成员前端项目地址: 基于vben [ruoyi-plus-vben](https://gitee.com/dapppp/ruoyi-plus-vben)<br>
> 成员前端项目地址: 基于vben5 [ruoyi-plus-vben5](https://gitee.com/dapppp/ruoyi-plus-vben5)
> 文档地址: [plus-doc](https://plus-doc.dromara.org)
Expand Down
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<description>Dromara RuoYi-Vue-Plus多租户管理系统</description>

<properties>
<revision>5.3.0-BETA</revision>
<revision>5.3.0</revision>
<spring-boot.version>3.4.1</spring-boot.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
Expand All @@ -31,7 +31,7 @@
<redisson.version>3.43.0</redisson.version>
<lock4j.version>2.2.7</lock4j.version>
<dynamic-ds.version>4.3.1</dynamic-ds.version>
<snailjob.version>1.3.0-beta1.1</snailjob.version>
<snailjob.version>1.3.0</snailjob.version>
<mapstruct-plus.version>1.4.6</mapstruct-plus.version>
<mapstruct-plus.lombok.version>0.2.0</mapstruct-plus.lombok.version>
<lombok.version>1.18.36</lombok.version>
Expand All @@ -50,7 +50,7 @@
<!-- 面向运行时的D-ORM依赖 -->
<anyline.version>8.7.2-20250101</anyline.version>
<!--工作流配置-->
<warm-flow.version>1.6.0-m5</warm-flow.version>
<warm-flow.version>1.6.6</warm-flow.version>

<!-- 插件版本 -->
<maven-jar-plugin.version>3.2.2</maven-jar-plugin.version>
Expand Down
2 changes: 1 addition & 1 deletion ruoyi-common/ruoyi-common-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</description>

<properties>
<revision>5.3.0-BETA</revision>
<revision>5.3.0</revision>
</properties>

<dependencyManagement>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package org.dromara.common.core.domain.dto;


import lombok.Data;

import java.io.Serial;
import java.io.Serializable;

/**
* 启动流程返回对象
*
* @author Lion Li
*/
@Data
public class StartProcessReturnDTO implements Serializable {

@Serial
private static final long serialVersionUID = 1L;

/**
* 流程实例id
*/
private Long processInstanceId;

/**
* 任务id
*/
private Long taskId;

}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import java.io.Serial;
import java.io.Serializable;
import java.util.Map;

/**
* 总体流程监听
Expand Down Expand Up @@ -36,6 +37,11 @@ public class ProcessEvent implements Serializable {
*/
private String status;

/**
* 办理参数
*/
private Map<String, Object> params;

/**
* 当为true时为申请人节点办理
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import org.dromara.common.core.domain.dto.CompleteTaskDTO;
import org.dromara.common.core.domain.dto.StartProcessDTO;
import org.dromara.common.core.domain.dto.StartProcessReturnDTO;

import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -45,6 +46,13 @@ public interface WorkflowService {
*/
void setVariable(Long instanceId, Map<String, Object> variable);

/**
* 获取流程变量
*
* @param instanceId 流程实例id
*/
Map<String, Object> instanceVariable(Long instanceId);

/**
* 按照业务id查询流程实例id
*
Expand All @@ -66,7 +74,7 @@ public interface WorkflowService {
* @param startProcess 参数
* @return 结果
*/
Map<String, Object> startWorkFlow(StartProcessDTO startProcess);
StartProcessReturnDTO startWorkFlow(StartProcessDTO startProcess);

/**
* 办理任务
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public R<Void> remove(@PathVariable Long categoryId) {
* @param categoryBo 流程分类
*/
@GetMapping("/categoryTree")
public R<List<Tree<Long>>> categoryTree(FlowCategoryBo categoryBo) {
public R<List<Tree<String>>> categoryTree(FlowCategoryBo categoryBo) {
return R.ok(flwCategoryService.selectCategoryTreeList(categoryBo));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public R<Map<String, Object>> flowImage(@PathVariable String businessId) {
* @param instanceId 流程实例id
*/
@GetMapping("/instanceVariable/{instanceId}")
public R<Map<String, Object>> instanceVariable(@PathVariable String instanceId) {
public R<Map<String, Object>> instanceVariable(@PathVariable Long instanceId) {
return R.ok(flwInstanceService.instanceVariable(instanceId));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import lombok.RequiredArgsConstructor;
import org.dromara.common.core.domain.R;
import org.dromara.common.core.domain.dto.StartProcessReturnDTO;
import org.dromara.common.core.domain.dto.UserDTO;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.idempotent.annotation.RepeatSubmit;
Expand All @@ -20,7 +21,6 @@
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
* 任务管理 控制层
Expand All @@ -44,9 +44,9 @@ public class FlwTaskController extends BaseController {
@Log(title = "任务管理", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping("/startWorkFlow")
public R<Map<String, Object>> startWorkFlow(@Validated(AddGroup.class) @RequestBody StartProcessBo startProcessBo) {
Map<String, Object> map = flwTaskService.startWorkFlow(startProcessBo);
return R.ok("提交成功", map);
public R<StartProcessReturnDTO> startWorkFlow(@Validated(AddGroup.class) @RequestBody StartProcessBo startProcessBo) {
StartProcessReturnDTO startProcessReturn = flwTaskService.startWorkFlow(startProcessBo);
return R.ok("提交成功", startProcessReturn);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ public class BackProcessBo implements Serializable {
@NotNull(message = "任务ID不能为空", groups = AddGroup.class)
private Long taskId;

/**
* 附件id
*/
private String fileId;

/**
* 消息类型
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
import com.alibaba.excel.annotation.ExcelProperty;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import org.dromara.common.excel.annotation.ExcelDictFormat;
import org.dromara.common.excel.convert.ExcelDictConvert;
import org.dromara.workflow.domain.FlowCategory;

import java.io.Serial;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
import org.dromara.workflow.common.ConditionalOnEnable;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
* 流程监听服务
*
Expand All @@ -28,14 +30,15 @@ public class FlowProcessEventHandler {
* @param status 状态
* @param submit 当为true时为申请人节点办理
*/
public void processHandler(String flowCode, String businessId, String status, boolean submit) {
public void processHandler(String flowCode, String businessId, String status, Map<String, Object> params, boolean submit) {
String tenantId = TenantHelper.getTenantId();
log.info("发布流程事件,租户ID: {}, 流程状态: {}, 流程编码: {}, 业务ID: {}, 是否申请人节点办理: {}", tenantId, status, flowCode, businessId, submit);
ProcessEvent processEvent = new ProcessEvent();
processEvent.setTenantId(tenantId);
processEvent.setFlowCode(flowCode);
processEvent.setBusinessId(businessId);
processEvent.setStatus(status);
processEvent.setParams(params);
processEvent.setSubmit(submit);
SpringUtils.context().publishEvent(processEvent);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
import org.dromara.workflow.service.IFlwTaskService;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
* 全局任务办理监听
Expand Down Expand Up @@ -81,10 +83,17 @@ public void finish(ListenerVariable listenerVariable) {
Definition definition = listenerVariable.getDefinition();
String businessId = instance.getBusinessId();
String flowStatus = instance.getFlowStatus();
Map<String, Object> params = new HashMap<>();
// 历史任务扩展(通常为附件)
params.put("hisTaskExt", listenerVariable.getFlowParams().getHisTaskExt());
// 办理人
params.put("handler", listenerVariable.getFlowParams().getHandler());
// 办理意见
params.put("message", listenerVariable.getFlowParams().getMessage());
// 判断流程状态(发布:撤销,退回,作废,终止,已完成事件)
String status = determineFlowStatus(instance, flowStatus);
if (StringUtils.isNotBlank(status)) {
flowProcessEventHandler.processHandler(definition.getFlowCode(), businessId, status, false);
flowProcessEventHandler.processHandler(definition.getFlowCode(), businessId, status, params, false);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public interface IFlwCategoryService {
* @param categoryId 流程分类ID
* @return 流程分类名称
*/
String selectCategoryNameById(String categoryId);
String selectCategoryNameById(Long categoryId);

/**
* 查询符合条件的流程分类列表
Expand All @@ -43,7 +43,7 @@ public interface IFlwCategoryService {
* @param category 流程分类信息
* @return 流程分类树信息集合
*/
List<Tree<Long>> selectCategoryTreeList(FlowCategoryBo category);
List<Tree<String>> selectCategoryTreeList(FlowCategoryBo category);

/**
* 校验流程分类是否有数据权限
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public interface IFlwInstanceService {
* @param instanceId 实例id
* @return 结果
*/
Map<String, Object> instanceVariable(String instanceId);
Map<String, Object> instanceVariable(Long instanceId);

/**
* 设置流程变量
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.dromara.workflow.service;

import org.dromara.common.core.domain.dto.StartProcessReturnDTO;
import org.dromara.common.core.domain.dto.UserDTO;
import org.dromara.common.mybatis.core.page.PageQuery;
import org.dromara.common.mybatis.core.page.TableDataInfo;
Expand All @@ -26,7 +27,7 @@ public interface IFlwTaskService {
* @param startProcessBo 启动流程参数
* @return 结果
*/
Map<String, Object> startWorkFlow(StartProcessBo startProcessBo);
StartProcessReturnDTO startWorkFlow(StartProcessBo startProcessBo);

/**
* 办理任务
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.dromara.workflow.service.impl;

import cn.hutool.core.convert.Convert;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.dromara.common.translation.annotation.TranslationType;
Expand All @@ -25,9 +26,12 @@ public class CategoryNameTranslationImpl implements TranslationInterface<String>

@Override
public String translation(Object key, String other) {
Long id = null;
if (key instanceof String categoryId) {
return flwCategoryService.selectCategoryNameById(categoryId);
id = Convert.toLong(categoryId);
} else if (key instanceof Long categoryId) {
id = categoryId;
}
return null;
return flwCategoryService.selectCategoryNameById(id);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ public FlowCategoryVo queryById(Long categoryId) {
*/
@Cacheable(cacheNames = FlowConstant.FLOW_CATEGORY_NAME, key = "#categoryId")
@Override
public String selectCategoryNameById(String categoryId) {
if (StringUtils.isBlank(categoryId)) {
public String selectCategoryNameById(Long categoryId) {
if (ObjectUtil.isNull(categoryId)) {
return null;
}
FlowCategory category = baseMapper.selectOne(new LambdaQueryWrapper<FlowCategory>()
Expand All @@ -94,24 +94,24 @@ public List<FlowCategoryVo> queryList(FlowCategoryBo bo) {
* @return 流程分类树信息集合
*/
@Override
public List<Tree<Long>> selectCategoryTreeList(FlowCategoryBo category) {
public List<Tree<String>> selectCategoryTreeList(FlowCategoryBo category) {
LambdaQueryWrapper<FlowCategory> lqw = buildQueryWrapper(category);
List<FlowCategoryVo> categorys = baseMapper.selectVoList(lqw);
if (CollUtil.isEmpty(categorys)) {
return CollUtil.newArrayList();
}
// 获取当前列表中每一个节点的parentId,然后在列表中查找是否有id与其parentId对应,若无对应,则表明此时节点列表中,该节点在当前列表中属于顶级节点
List<Tree<Long>> treeList = CollUtil.newArrayList();
List<Tree<String>> treeList = CollUtil.newArrayList();
for (FlowCategoryVo d : categorys) {
Long parentId = d.getParentId();
FlowCategoryVo categoryVo = StreamUtils.findFirst(categorys, it -> it.getCategoryId().longValue() == parentId);
String parentId = d.getParentId().toString();
FlowCategoryVo categoryVo = StreamUtils.findFirst(categorys, it -> it.getCategoryId().toString().equals(parentId));
if (ObjectUtil.isNull(categoryVo)) {
List<Tree<Long>> trees = TreeBuildUtils.build(categorys, parentId, (dept, tree) ->
tree.setId(dept.getCategoryId())
.setParentId(dept.getParentId())
List<Tree<String>> trees = TreeBuildUtils.build(categorys, parentId, (dept, tree) ->
tree.setId(dept.getCategoryId().toString())
.setParentId(dept.getParentId().toString())
.setName(dept.getCategoryName())
.setWeight(dept.getOrderNum()));
Tree<Long> tree = StreamUtils.findFirst(trees, it -> it.getId().longValue() == d.getCategoryId());
Tree<String> tree = StreamUtils.findFirst(trees, it -> it.getId().equals(d.getCategoryId().toString()));
treeList.add(tree);
}
}
Expand Down
Loading

0 comments on commit 296466f

Please sign in to comment.