diff --git a/inside-notices/src/main/java/cn/axzo/msg/center/message/service/todo/card/TodoSyncCardService.java b/inside-notices/src/main/java/cn/axzo/msg/center/message/service/todo/card/TodoSyncCardService.java index b880340b..bb0594ea 100644 --- a/inside-notices/src/main/java/cn/axzo/msg/center/message/service/todo/card/TodoSyncCardService.java +++ b/inside-notices/src/main/java/cn/axzo/msg/center/message/service/todo/card/TodoSyncCardService.java @@ -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 findTodo(CardContent card) { - String identityCode = TodoSyncCardService.findTodoIdentityCode(card.getBizParam()).orElse(null); - if (identityCode == null) - return Optional.empty(); - return todoDao.findTodoByCode(identityCode); - } - - private static Optional findTodoIdentityCode(JSONObject bizParam) { + public static Optional findTodoIdentityCode(JSONObject bizParam) { if (bizParam == null) return Optional.empty(); String identityCode = new CardExtInfo(bizParam) diff --git a/inside-notices/src/main/java/cn/axzo/msg/center/message/service/todo/card/workflow/WorkflowTodoCardButtonInterceptorFactory.java b/inside-notices/src/main/java/cn/axzo/msg/center/message/service/todo/card/workflow/WorkflowTodoCardButtonInterceptorFactory.java index 9712550a..e655813c 100644 --- a/inside-notices/src/main/java/cn/axzo/msg/center/message/service/todo/card/workflow/WorkflowTodoCardButtonInterceptorFactory.java +++ b/inside-notices/src/main/java/cn/axzo/msg/center/message/service/todo/card/workflow/WorkflowTodoCardButtonInterceptorFactory.java @@ -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();