REQ-3502: 过滤流程按钮

This commit is contained in:
yanglin 2025-01-14 14:03:24 +08:00
parent 903a2401b2
commit 42e8be3fcf
2 changed files with 8 additions and 12 deletions

View File

@ -22,7 +22,6 @@ import cn.axzo.msg.center.service.enums.CardBizState;
import cn.axzo.msg.center.service.enums.CodeDefinition;
import cn.axzo.msg.center.service.enums.MessageChannel;
import cn.axzo.msg.center.service.enums.PendingMessageStateEnum;
import cn.axzo.msg.center.service.pending.request.CardContent;
import cn.axzo.msg.center.service.pending.request.CardSendRequest;
import cn.axzo.msg.center.service.pending.request.CardUpdateStateRequest;
import cn.axzo.msg.center.service.pending.request.PresetButtonPressedRequest;
@ -228,14 +227,7 @@ public class TodoSyncCardService {
return CodeDefinition.findByCode(BizCategoryEnum.class, category);
}
public Optional<Todo> findTodo(CardContent card) {
String identityCode = TodoSyncCardService.findTodoIdentityCode(card.getBizParam()).orElse(null);
if (identityCode == null)
return Optional.empty();
return todoDao.findTodoByCode(identityCode);
}
private static Optional<String> findTodoIdentityCode(JSONObject bizParam) {
public static Optional<String> findTodoIdentityCode(JSONObject bizParam) {
if (bizParam == null)
return Optional.empty();
String identityCode = new CardExtInfo(bizParam)

View File

@ -2,6 +2,7 @@ package cn.axzo.msg.center.message.service.todo.card.workflow;
import cn.axzo.msg.center.common.utils.BizAssertions;
import cn.axzo.msg.center.dal.TodoBusinessDao;
import cn.axzo.msg.center.dal.TodoDao;
import cn.axzo.msg.center.domain.entity.Todo;
import cn.axzo.msg.center.domain.entity.TodoBusiness;
import cn.axzo.msg.center.message.service.card.interceptor.CardButtonInterceptor;
@ -27,7 +28,7 @@ import javax.annotation.Nullable;
class WorkflowTodoCardButtonInterceptorFactory implements CardButtonInterceptorFactory {
private final TodoBusinessDao todoBusinessDao;
private final TodoSyncCardService todoSyncCardService;
private final TodoDao todoDao;
private final WorkflowCoreService workflowCoreService;
@Override @Nullable
@ -35,7 +36,10 @@ class WorkflowTodoCardButtonInterceptorFactory implements CardButtonInterceptorF
BizCategoryEnum category = TodoSyncCardService.findTodoBizCategory(card.getBizParam()).orElse(null);
if (category != BizCategoryEnum.FLOW)
return null;
Todo todo = todoSyncCardService.findTodo(card).orElse(null);
String identityCode = TodoSyncCardService.findTodoIdentityCode(card.getBizParam()).orElse(null);
if (identityCode == null)
return null;
Todo todo = todoDao.findTodoByCode(identityCode).orElse(null);
if (todo == null) {
log.warn("todo not found. identityCode={}", card.getBizParam());
return null;
@ -43,7 +47,7 @@ class WorkflowTodoCardButtonInterceptorFactory implements CardButtonInterceptorF
return new WorkflowTodoCardButtonInterceptor(this, todo);
}
BpmnTaskButtonVo fetchWorkflowButtons(Todo todo) {
BpmnTaskButtonVo fetchWorkflowButtons(Todo todo) {
TodoBusiness business = todoBusinessDao.getBusinesses(todo).findBusiness(todo).orElse(null);
BizAssertions.assertNotNull(business, "todo business not found. todoIdentityCode={}", todo.getIdentityCode());
BpmnTaskButtonSearchDTO workflowRequest = new BpmnTaskButtonSearchDTO();