Browse Source

fix(flow): 修复流程任务信息获取中的空指针异常

- 修复 FlowOperationController 中当工作订单为空时创建新的 FlowEntry 对象避免空指针异常
- 简化 ListDataOrmService 中过滤器合并逻辑,使用 and 方法替代循环遍历
feature/2026-07-ccc-dev
chenchuchuan 3 days ago
parent
commit
4cce9a9c11
  1. 12
      common/common-flow/src/main/java/apelet/common/flow/controller/FlowOperationController.java
  2. 6
      common/common-online/src/main/java/apelet/common/online/abstractplugin/ListDataOrmService.java

12
common/common-flow/src/main/java/apelet/common/flow/controller/FlowOperationController.java

@ -5,7 +5,10 @@ import apelet.common.core.annotation.MyRequestBody; @@ -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; @@ -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 { @@ -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);

6
common/common-online/src/main/java/apelet/common/online/abstractplugin/ListDataOrmService.java

@ -97,11 +97,7 @@ public class ListDataOrmService extends ListDataService { @@ -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();

Loading…
Cancel
Save