4 Commits

6 changed files with 30 additions and 10 deletions

View File

@ -259,5 +259,7 @@ warm-flow:
ui: true
# 是否显示流程图顶部文字
top-text-show: true
# 是否渲染节点悬浮提示默认true
node-tooltip: true
# 默认Authorization如果有多个token用逗号分隔
token-name: ${sa-token.token-name},clientid

View File

@ -1,7 +1,8 @@
package org.dromara.common.web.config;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import org.dromara.common.core.utils.StringUtils;
import org.dromara.common.core.utils.ObjectUtils;
import org.dromara.common.web.handler.GlobalExceptionHandler;
import org.dromara.common.web.interceptor.PlusWebInvokeTimeInterceptor;
import org.springframework.boot.autoconfigure.AutoConfiguration;
@ -34,10 +35,11 @@ public class ResourcesConfig implements WebMvcConfigurer {
public void addFormatters(FormatterRegistry registry) {
// 全局日期格式转换配置
registry.addConverter(String.class, Date.class, source -> {
if (StringUtils.isBlank(source)) {
DateTime parse = DateUtil.parse(source);
if (ObjectUtils.isNull(parse)) {
return null;
}
return DateUtil.parse(source);
return parse.toJdkDate();
});
}

View File

@ -32,7 +32,7 @@ public interface SysDeptMapper extends BaseMapperPlus<SysDept, SysDeptVo> {
return """
select srd.dept_id from sys_role_dept srd
left join sys_role sr on sr.role_id = srd.role_id
where srd.role_id = %d and sr.status = 0
where srd.role_id = %d and sr.status = '0'
""".formatted(roleId);
}
@ -51,7 +51,7 @@ public interface SysDeptMapper extends BaseMapperPlus<SysDept, SysDeptVo> {
select parent_id from sys_dept where dept_id in (
select srd.dept_id from sys_role_dept srd
left join sys_role sr on sr.role_id = srd.role_id
where srd.role_id = %d and sr.status = 0
where srd.role_id = %d and sr.status = '0'
)
""".formatted(roleId);
}

View File

@ -34,7 +34,7 @@ public interface SysMenuMapper extends BaseMapperPlus<SysMenu, SysMenuVo> {
select menu_id from sys_role_menu where role_id in (
select sur.role_id from sys_user_role sur
left join sys_role sr on sr.role_id = sur.role_id
where sur.user_id = %d and sr.status = 0
where sur.user_id = %d and sr.status = '0'
)
""".formatted(userId);
}
@ -54,7 +54,7 @@ public interface SysMenuMapper extends BaseMapperPlus<SysMenu, SysMenuVo> {
return """
select srm.menu_id from sys_role_menu srm
left join sys_role sr on sr.role_id = srm.role_id
where srm.role_id = %d and sr.status = 0
where srm.role_id = %d and sr.status = '0'
""".formatted(roleId);
}
@ -74,7 +74,7 @@ public interface SysMenuMapper extends BaseMapperPlus<SysMenu, SysMenuVo> {
select parent_id from sys_menu where menu_id in (
select srm.menu_id from sys_role_menu srm
left join sys_role sr on sr.role_id = srm.role_id
where srm.role_id = %d and sr.status = 0
where srm.role_id = %d and sr.status = '0'
)
""".formatted(roleId);
}

View File

@ -161,6 +161,7 @@ public class SysMenuServiceImpl implements ISysMenuService {
});
}
return baseMapper.selectObjs(new LambdaQueryWrapper<SysMenu>()
.select(SysMenu::getMenuId)
.in(SysMenu::getMenuId, menuIds)
.notIn(CollUtil.isNotEmpty(parentIds), SysMenu::getMenuId, parentIds), x -> {
return Convert.toLong(x);

View File

@ -24,6 +24,7 @@ import org.dromara.warm.flow.orm.mapper.FlowHisTaskMapper;
import org.dromara.warm.flow.ui.service.ChartExtService;
import org.dromara.workflow.common.ConditionalOnEnable;
import org.dromara.workflow.common.constant.FlowConstant;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
@ -48,6 +49,8 @@ public class FlwChartExtServiceImpl implements ChartExtService {
private final DeptService deptService;
private final FlowHisTaskMapper flowHisTaskMapper;
private final DictService dictService;
@Value("${warm-flow.node-tooltip:true}")
private boolean nodeTooltip;
/**
* 设置流程图提示信息
@ -56,6 +59,11 @@ public class FlwChartExtServiceImpl implements ChartExtService {
*/
@Override
public void execute(DefJson defJson) {
// 配置关闭,直接返回,不渲染悬浮窗
if (!nodeTooltip) {
return;
}
// 根据流程实例ID查询所有相关的历史任务列表
List<FlowHisTask> flowHisTasks = this.getHisTaskGroupedByNode(defJson.getInstance().getId());
if (CollUtil.isEmpty(flowHisTasks)) {
@ -103,6 +111,11 @@ public class FlwChartExtServiceImpl implements ChartExtService {
*/
@Override
public void initPromptContent(DefJson defJson) {
// 配置关闭,直接返回,不渲染悬浮窗
if (!nodeTooltip) {
return;
}
defJson.setTopText("流程名称: " + defJson.getFlowName());
defJson.getNodeList().forEach(nodeJson -> {
nodeJson.setPromptContent(
@ -152,8 +165,10 @@ public class FlwChartExtServiceImpl implements ChartExtService {
/**
* 处理节点的扩展信息,构建用于流程图悬浮提示的内容
*
* @param nodeJson 当前节点对象
* @param taskList 当前节点对应的历史审批任务列表
* @param nodeJson 当前流程节点对象,包含节点基础信息和提示内容容器
* @param taskList 当前节点关联的历史审批任务列表,用于生成提示信息
* @param userMap 用户信息映射表key 为用户IDvalue 为用户DTO对象用于获取审批人信息
* @param dictType 数据字典映射表key 为字典项编码value 为对应显示值,用于翻译审批状态等
*/
private void processNodeExtInfo(NodeJson nodeJson, List<FlowHisTask> taskList, Map<Long, UserDTO> userMap, Map<String, String> dictType) {