Skip to content

refactor(data_export_workflow): streamline current step assignee logic#598

Open
winfredLIN wants to merge 1 commit intomainfrom
dashboard/move-failed-workflow-to-archived
Open

refactor(data_export_workflow): streamline current step assignee logic#598
winfredLIN wants to merge 1 commit intomainfrom
dashboard/move-failed-workflow-to-archived

Conversation

@winfredLIN
Copy link
Copy Markdown
Collaborator

@winfredLIN winfredLIN commented Apr 21, 2026

User description

  • Updated the logic for determining current step assignees in the ListDataExportWorkflow and GetGlobalWorkflowsList methods to use a new helper function, improving readability and maintainability.
  • Adjusted SQL query to handle current step assignee user ID list based on workflow status, ensuring correct assignment visibility based on workflow state.

关联的 issue

https://github.com/actiontech/sqle-ee/issues/2682?open_in_browser=true
link https://github.com/actiontech/sqle-ee/pull/2733?open_in_browser=true
link https://github.com/actiontech/sqle-ee/pull/2735

描述你的变更

  • 调整数据导出工单待处理人展示和筛选,将待导出、被驳回、失败三个状态下的工单分配给创建者、将取消和完成两个状态的工单的待处理人置为空
  • 关联到新issue:https://github.com/actiontech/dms-ee/issues/782

确认项(pr提交后操作)

Tip

请在指定复审人之前,确认并完成以下事项,完成后✅


  • 我已完成自测
  • 我已记录完整日志方便进行诊断
  • 我已在关联的issue里补充了实现方案
  • 我已在关联的issue里补充了测试影响面
  • 我已确认了变更的兼容性,如果不兼容则在issue里标记 not_compatible
  • 我已确认了是否要更新文档,如果要更新则在issue里标记 need_update_doc


Description

  • 重构获取当前步骤待处理人逻辑

  • 新增辅助函数封装状态判断

  • 更新SQL中待处理人查询表达式


Diagram Walkthrough

flowchart LR
  A["\"业务流程对象\""] --> B["\"调用辅助函数 currentStepAssigneeUIDsForList\""]
  B --> C["\"分支判断状态: finish/cancel 返回空\""]
  B --> D["\"rejected/wait_for_export/failed 返回创建者\""]
  B --> E["\"其他状态返回当前步骤 assignees\""]
  F["\"SQL查询\""] --> G["\"CASE表达式判断状态条件\""]
  G --> H["\"空数组或创建者uid或assignees\""]
Loading

File Walkthrough

Relevant files
Enhancement
data_export_workflow.go
重构服务层待处理人逻辑                                                                                           

internal/dms/service/data_export_workflow.go

  • 替换内联逻辑为辅助函数调用
  • 新增 currentStepAssigneeUIDsForList 函数
  • 优化状态下待处理人获取流程
+28/-6   
workflow.go
调整SQL查询中待处理人逻辑                                                                                     

internal/dms/storage/workflow.go

  • 更新SQL CASE表达式判断条件
  • 调整正则查询过滤待处理人
+6/-2     

- Updated the logic for determining current step assignees in the ListDataExportWorkflow and GetGlobalWorkflowsList methods to use a new helper function, improving readability and maintainability.
- Adjusted SQL query to handle current step assignee user ID list based on workflow status, ensuring correct assignment visibility based on workflow state.
@actiontech-bot
Copy link
Copy Markdown
Member

没有在复审记录中找到这个MR => https://github.com/actiontech/sqle-ee/pull/2733?open_in_browser=true

1 similar comment
@actiontech-bot
Copy link
Copy Markdown
Member

没有在复审记录中找到这个MR => https://github.com/actiontech/sqle-ee/pull/2733?open_in_browser=true

@github-actions
Copy link
Copy Markdown

PR Reviewer Guide 🔍

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ No major issues detected

@github-actions
Copy link
Copy Markdown

PR Code Suggestions ✨

No code suggestions found for the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants