Skip to content

Commit

Permalink
bugfix: 单据撤销终止流程
Browse files Browse the repository at this point in the history
  • Loading branch information
hanshuaikang committed Dec 18, 2023
1 parent cacb503 commit 3e751eb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions itsm/ticket/models/ticket.py
Original file line number Diff line number Diff line change
Expand Up @@ -2975,6 +2975,7 @@ def set_finished(
ticket, message, operator, detail_message=desc
)

self.close_moa_ticket(operator=operator)
self.callback_request()

def get_last_approver(self):
Expand Down Expand Up @@ -4239,8 +4240,8 @@ def close(self, close_status, desc="", operator=""):
self.do_before_end_pipeline(operator, close_status, desc, source=WEB)
# 直接终止后台流程
task_service.revoke_pipeline(self.id)

self.stop_all_sla()

return

def do_before_end_pipeline(
Expand Down Expand Up @@ -4397,7 +4398,8 @@ def terminate(self, state_id, operator="", terminate_message="--"):
name=node_status.name,
detail_message=terminate_message,
)
self.close_moa_ticket(state_id, operator)
# 终止单据关闭所有待办
self.close_moa_ticket(operator)

self.callback_request()
self.notify(
Expand Down Expand Up @@ -4479,7 +4481,6 @@ def withdraw(self, operator, source):
node_status = self.status(state_id)

message = "{operator} 撤销单据."

with transaction.atomic():
end_at = datetime.now()
node_status.set_status(TERMINATED, operator, terminate_message=message)
Expand All @@ -4502,8 +4503,8 @@ def withdraw(self, operator, source):

# 更新状态
self.update_current_status("REVOKED")
self.close_moa_ticket(state_id, operator)

self.close_moa_ticket(operator=operator)
task_service.revoke_pipeline(self.id)
self.callback_request()
self.stop_all_sla()
# 撤销单据触发信号发送
Expand Down
2 changes: 1 addition & 1 deletion platform_config/open/moa/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ class BaseMoaConfig:
def create_moa_ticket(self, state_id):
pass

def close_moa_ticket(self, state_id, operator):
def close_moa_ticket(self, state_id=None, operator=None):
pass

0 comments on commit 3e751eb

Please sign in to comment.