update 升级warm-flow1.7.4->1.7.5-m2 优化流程图悬浮窗
This commit is contained in:
parent
1ad0d5387b
commit
8f5d60f543
2
pom.xml
2
pom.xml
@ -48,7 +48,7 @@
|
||||
<!-- 面向运行时的D-ORM依赖 -->
|
||||
<anyline.version>8.7.2-20250603</anyline.version>
|
||||
<!-- 工作流配置 -->
|
||||
<warm-flow.version>1.7.4</warm-flow.version>
|
||||
<warm-flow.version>1.7.5-m2</warm-flow.version>
|
||||
|
||||
<!-- 插件版本 -->
|
||||
<maven-jar-plugin.version>3.4.2</maven-jar-plugin.version>
|
||||
|
@ -13,6 +13,7 @@ import org.dromara.common.mybatis.helper.DataBaseHelper;
|
||||
import org.dromara.common.satoken.utils.LoginHelper;
|
||||
import org.dromara.warm.flow.core.service.DefService;
|
||||
import org.dromara.warm.flow.orm.entity.FlowDefinition;
|
||||
import org.dromara.warm.flow.ui.service.CategoryService;
|
||||
import org.dromara.workflow.common.ConditionalOnEnable;
|
||||
import org.dromara.workflow.common.constant.FlowConstant;
|
||||
import org.dromara.workflow.domain.FlowCategory;
|
||||
@ -35,7 +36,7 @@ import java.util.List;
|
||||
@ConditionalOnEnable
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class FlwCategoryServiceImpl implements IFlwCategoryService {
|
||||
public class FlwCategoryServiceImpl implements IFlwCategoryService, CategoryService {
|
||||
|
||||
private final DefService defService;
|
||||
private final FlwCategoryMapper baseMapper;
|
||||
@ -102,22 +103,37 @@ public class FlwCategoryServiceImpl implements IFlwCategoryService {
|
||||
}
|
||||
// 获取当前列表中每一个节点的parentId,然后在列表中查找是否有id与其parentId对应,若无对应,则表明此时节点列表中,该节点在当前列表中属于顶级节点
|
||||
List<Tree<String>> treeList = CollUtil.newArrayList();
|
||||
for (FlowCategoryVo d : categorys) {
|
||||
String parentId = d.getParentId().toString();
|
||||
for (FlowCategoryVo current : categorys) {
|
||||
String parentId = current.getParentId().toString();
|
||||
FlowCategoryVo categoryVo = StreamUtils.findFirst(categorys, it -> it.getCategoryId().toString().equals(parentId));
|
||||
if (ObjectUtil.isNull(categoryVo)) {
|
||||
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<String> tree = StreamUtils.findFirst(trees, it -> it.getId().equals(d.getCategoryId().toString()));
|
||||
List<Tree<String>> trees = TreeBuildUtils.build(categorys, parentId, (node, tree) ->
|
||||
tree.setId(node.getCategoryId().toString())
|
||||
.setParentId(node.getParentId().toString())
|
||||
.setName(node.getCategoryName())
|
||||
.setWeight(node.getOrderNum()));
|
||||
Tree<String> tree = StreamUtils.findFirst(trees, it -> it.getId().equals(current.getCategoryId().toString()));
|
||||
treeList.add(tree);
|
||||
}
|
||||
}
|
||||
return treeList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 工作流查询分类
|
||||
*
|
||||
* @return 分类树结构列表
|
||||
*/
|
||||
@Override
|
||||
public List<org.dromara.warm.flow.core.dto.Tree> queryCategory() {
|
||||
List<FlowCategoryVo> list = this.queryList(new FlowCategoryBo());
|
||||
return StreamUtils.toList(list, category -> new org.dromara.warm.flow.core.dto.Tree()
|
||||
.setId(String.valueOf(category.getCategoryId()))
|
||||
.setName(category.getCategoryName())
|
||||
.setParentId(String.valueOf(category.getParentId()))
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验流程分类是否有数据权限
|
||||
*
|
||||
|
@ -12,7 +12,6 @@ import org.dromara.common.core.service.DeptService;
|
||||
import org.dromara.common.core.service.DictService;
|
||||
import org.dromara.common.core.service.UserService;
|
||||
import org.dromara.common.core.utils.DateUtils;
|
||||
import org.dromara.common.core.utils.ServletUtils;
|
||||
import org.dromara.common.core.utils.StreamUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.warm.flow.core.dto.DefJson;
|
||||
@ -53,12 +52,8 @@ public class FlwChartExtServiceImpl implements ChartExtService {
|
||||
*/
|
||||
@Override
|
||||
public void execute(DefJson defJson) {
|
||||
// 临时修复 后续版本将通过defjson获取流程实例ID
|
||||
String[] parts = ServletUtils.getRequest().getRequestURI().split("/");
|
||||
Long instanceId = Convert.toLong(parts[parts.length - 1]);
|
||||
|
||||
// 根据流程实例ID查询所有相关的历史任务列表
|
||||
List<FlowHisTask> flowHisTasks = this.getHisTaskGroupedByNode(instanceId);
|
||||
List<FlowHisTask> flowHisTasks = this.getHisTaskGroupedByNode(defJson.getInstance().getId());
|
||||
if (CollUtil.isEmpty(flowHisTasks)) {
|
||||
return;
|
||||
}
|
||||
@ -74,14 +69,12 @@ public class FlwChartExtServiceImpl implements ChartExtService {
|
||||
|
||||
Map<String, String> dictType = dictService.getAllDictByDictType(FlowConstant.WF_TASK_STATUS);
|
||||
|
||||
// 遍历流程定义中的每个节点,调用处理方法,将对应节点的任务列表及用户信息传入,生成扩展提示内容
|
||||
for (NodeJson nodeJson : defJson.getNodeList()) {
|
||||
// 获取当前节点对应的历史任务列表,如果没有则返回空列表避免空指针
|
||||
List<FlowHisTask> taskList = groupedByNode.get(nodeJson.getNodeCode());
|
||||
if (CollUtil.isEmpty(taskList)) {
|
||||
continue;
|
||||
}
|
||||
// 处理当前节点的扩展信息,包括构建审批人提示内容等
|
||||
// 处理当前节点的扩展信息
|
||||
this.processNodeExtInfo(nodeJson, taskList, userMap, dictType);
|
||||
}
|
||||
}
|
||||
@ -96,44 +89,44 @@ public class FlwChartExtServiceImpl implements ChartExtService {
|
||||
defJson.setTopText("流程名称: " + defJson.getFlowName());
|
||||
defJson.getNodeList().forEach(nodeJson -> {
|
||||
nodeJson.setPromptContent(
|
||||
new PromptContent()
|
||||
// 提示信息
|
||||
.setInfo(
|
||||
CollUtil.newArrayList(
|
||||
new PromptContent.InfoItem()
|
||||
.setPrefix("任务名称: ")
|
||||
.setContent(nodeJson.getNodeName())
|
||||
.setContentStyle(Map.of(
|
||||
"border", "1px solid #d1e9ff",
|
||||
"backgroundColor", "#e8f4ff",
|
||||
"padding", "4px 8px",
|
||||
"borderRadius", "4px"
|
||||
))
|
||||
.setRowStyle(Map.of(
|
||||
"fontWeight", "bold",
|
||||
"margin", "0 0 6px 0",
|
||||
"padding", "0 0 8px 0",
|
||||
"borderBottom", "1px solid #ccc"
|
||||
))
|
||||
)
|
||||
)
|
||||
// 弹窗样式
|
||||
.setDialogStyle(MapUtil.mergeAll(
|
||||
"position", "absolute",
|
||||
"backgroundColor", "#fff",
|
||||
"border", "1px solid #ccc",
|
||||
"borderRadius", "4px",
|
||||
"boxShadow", "0 2px 8px rgba(0, 0, 0, 0.15)",
|
||||
"padding", "8px 12px",
|
||||
"fontSize", "14px",
|
||||
"zIndex", "1000",
|
||||
"maxWidth", "500px",
|
||||
"overflowY", "visible",
|
||||
"overflowX", "hidden",
|
||||
"color", "#333",
|
||||
"pointerEvents", "auto",
|
||||
"scrollbarWidth", "thin"
|
||||
))
|
||||
new PromptContent()
|
||||
// 提示信息主体内容样式
|
||||
.setInfo(
|
||||
CollUtil.newArrayList(
|
||||
new PromptContent.InfoItem()
|
||||
.setPrefix("任务名称: ")
|
||||
.setContent(nodeJson.getNodeName())
|
||||
.setContentStyle(Map.of(
|
||||
"border", "1px solid #d1e9ff",
|
||||
"backgroundColor", "#e8f4ff",
|
||||
"padding", "4px 8px",
|
||||
"borderRadius", "4px"
|
||||
))
|
||||
.setRowStyle(Map.of(
|
||||
"fontWeight", "bold",
|
||||
"margin", "0 0 6px 0",
|
||||
"padding", "0 0 8px 0",
|
||||
"borderBottom", "1px solid #ccc"
|
||||
))
|
||||
))
|
||||
// 弹窗容器样式(包含滚动条设置)
|
||||
.setDialogStyle(MapUtil.mergeAll(
|
||||
"position", "absolute",
|
||||
"backgroundColor", "#fff",
|
||||
"border", "1px solid #ccc",
|
||||
"borderRadius", "4px",
|
||||
"boxShadow", "0 2px 8px rgba(0, 0, 0, 0.15)",
|
||||
"padding", "8px 12px",
|
||||
"fontSize", "14px",
|
||||
"zIndex", "1000",
|
||||
"maxWidth", "500px",
|
||||
"maxHeight", "300px", // 设置最大高度,超过触发滚动
|
||||
"overflowY", "auto", // 允许垂直滚动
|
||||
"overflowX", "hidden", // 禁止横向滚动
|
||||
"color", "#333",
|
||||
"pointerEvents", "auto",
|
||||
"scrollbarWidth", "thin" // 滚动条宽度细化(部分浏览器支持)
|
||||
))
|
||||
);
|
||||
});
|
||||
}
|
||||
|
@ -6,6 +6,7 @@ CREATE TABLE `flow_definition`
|
||||
`id` bigint NOT NULL COMMENT '主键id',
|
||||
`flow_code` varchar(40) NOT NULL COMMENT '流程编码',
|
||||
`flow_name` varchar(100) NOT NULL COMMENT '流程名称',
|
||||
`mode` varchar(40) NOT NULL DEFAULT 'CLASSICS' COMMENT '设计器模式(CLASSICS经典模式 MIMIC仿钉钉模式)',
|
||||
`category` varchar(100) DEFAULT NULL COMMENT '流程类别',
|
||||
`version` varchar(20) NOT NULL COMMENT '流程版本',
|
||||
`is_publish` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否发布(0未发布 1已发布 9失效)',
|
||||
|
@ -7,6 +7,9 @@ ALTER TABLE `flow_instance`
|
||||
ALTER TABLE `flow_his_task`
|
||||
MODIFY COLUMN `flow_status` varchar(20) NOT NULL COMMENT '流程状态(0待提交 1审批中 2审批通过 4终止 5作废 6撤销 8已完成 9已退回 10失效 11拿回)' AFTER `skip_type`;
|
||||
|
||||
ALTER TABLE `flow_definition`
|
||||
ADD COLUMN `mode` varchar(40) NOT NULL DEFAULT 'CLASSICS' COMMENT '设计器模式(CLASSICS经典模式 MIMIC仿钉钉模式)' AFTER `flow_name`;
|
||||
|
||||
ALTER TABLE `sys_social`
|
||||
MODIFY COLUMN `access_token` varchar(2000) NOT NULL COMMENT '用户的授权令牌' AFTER `avatar`;
|
||||
ALTER TABLE `sys_social`
|
||||
|
Loading…
Reference in New Issue
Block a user