From 4cce9a9c11c1cd6ee34507a8fb5f554a725c27b0 Mon Sep 17 00:00:00 2001 From: chenchuchuan <13554600537@163.com> Date: Wed, 5 Aug 2026 18:12:11 +0800 Subject: [PATCH] =?UTF-8?q?fix(flow):=20=E4=BF=AE=E5=A4=8D=E6=B5=81?= =?UTF-8?q?=E7=A8=8B=E4=BB=BB=E5=8A=A1=E4=BF=A1=E6=81=AF=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E7=A9=BA=E6=8C=87=E9=92=88=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修复 FlowOperationController 中当工作订单为空时创建新的 FlowEntry 对象避免空指针异常 - 简化 ListDataOrmService 中过滤器合并逻辑,使用 and 方法替代循环遍历 --- .../common/flow/controller/FlowOperationController.java | 12 +++++++++--- .../common/online/abstractplugin/ListDataOrmService.java | 6 +----- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/common/common-flow/src/main/java/apelet/common/flow/controller/FlowOperationController.java b/common/common-flow/src/main/java/apelet/common/flow/controller/FlowOperationController.java index 5c3f344..82a2258 100644 --- a/common/common-flow/src/main/java/apelet/common/flow/controller/FlowOperationController.java +++ b/common/common-flow/src/main/java/apelet/common/flow/controller/FlowOperationController.java @@ -5,7 +5,10 @@ import apelet.common.core.annotation.MyRequestBody; import apelet.common.core.constant.ErrorCodeEnum; import apelet.common.core.object.*; import apelet.common.core.util.MyPageUtil; -import apelet.common.flow.constant.*; +import apelet.common.flow.constant.FlowApprovalType; +import apelet.common.flow.constant.FlowBackType; +import apelet.common.flow.constant.FlowConstant; +import apelet.common.flow.constant.FlowTaskStatus; import apelet.common.flow.exception.FlowOperationException; import apelet.common.flow.model.*; import apelet.common.flow.model.constant.FlowMessageType; @@ -13,7 +16,10 @@ import apelet.common.flow.object.FlowEntryExtensionData; import apelet.common.flow.service.*; import apelet.common.flow.util.FlowCustomExtFactory; import apelet.common.flow.util.FlowOperationHelper; -import apelet.common.flow.vo.*; +import apelet.common.flow.vo.FlowTaskCommentVo; +import apelet.common.flow.vo.FlowTaskVo; +import apelet.common.flow.vo.FlowUserInfoVo; +import apelet.common.flow.vo.TaskInfoVo; import apelet.common.log.annotation.OperationLog; import apelet.common.log.model.constant.SysOperationLogType; import cn.hutool.core.bean.BeanUtil; @@ -212,7 +218,7 @@ public class FlowOperationController { taskInfoVo.setVariableList(JSON.parseArray(flowTaskExt.getVariableListJson(), JSONObject.class)); } FlowWorkOrder workOrder = flowWorkOrderService.getFlowWorkOrderByProcessInstanceId(processInstanceId); - FlowEntry flowEntry = workOrder == null ? null : flowEntryService.getFlowEntryFromCache(workOrder.getProcessDefinitionKey()); + FlowEntry flowEntry = workOrder == null ? new FlowEntry() : flowEntryService.getFlowEntryFromCache(workOrder.getProcessDefinitionKey()); taskInfoVo.setTitle(flowApiService.resolveTitle(flowTaskExt.getTitleTemplate(), processInstanceId, workOrder, flowEntry)); } return ResponseResult.success(taskInfoVo); diff --git a/common/common-online/src/main/java/apelet/common/online/abstractplugin/ListDataOrmService.java b/common/common-online/src/main/java/apelet/common/online/abstractplugin/ListDataOrmService.java index a261e3c..c6a2f5d 100644 --- a/common/common-online/src/main/java/apelet/common/online/abstractplugin/ListDataOrmService.java +++ b/common/common-online/src/main/java/apelet/common/online/abstractplugin/ListDataOrmService.java @@ -97,11 +97,7 @@ public class ListDataOrmService extends ListDataService { // 解析 conditionExpression 中的 ${字段名} 占位符,从 tokenData 中取值填充 conditionExpression = resolvePlaceholders(conditionExpression, tokenData); Filter parsed = FilterParser.parse(conditionExpression); - if (CollUtil.isNotEmpty(parsed.getItems())) { - for (FilterItem item : parsed.getItems()) { - filter.add(item); - } - } + filter = filter.and(parsed); } Sorter sorter = new Sorter();