From 9ac8bac7774b3b4c0f636343da58942fc7cbeaf1 Mon Sep 17 00:00:00 2001 From: yystopf Date: Sat, 12 Oct 2024 14:54:01 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E6=9B=B4?= =?UTF-8?q?=E6=96=B0issue=20protrend=E6=9C=AA=E6=AD=A3=E5=B8=B8=E5=88=9B?= =?UTF-8?q?=E5=BB=BA=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/api/pm/issues/update_service.rb | 2 +- app/services/api/v1/issues/update_service.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/services/api/pm/issues/update_service.rb b/app/services/api/pm/issues/update_service.rb index 78d62fb2b..bfce0430e 100644 --- a/app/services/api/pm/issues/update_service.rb +++ b/app/services/api/pm/issues/update_service.rb @@ -64,7 +64,6 @@ class Api::Pm::Issues::UpdateService < ApplicationService build_assigner_issue_journal_details unless assigner_ids.nil?# 操作记录 build_attachment_issue_journal_details unless attachment_ids.nil? build_issue_tag_issue_journal_details unless issue_tag_ids.nil? - build_issue_project_trends if status_id.present? # 开关时间记录 build_assigner_participants unless assigner_ids.nil? # 负责人 build_edit_participants build_atme_participants if @atme_receivers.present? @@ -92,6 +91,7 @@ class Api::Pm::Issues::UpdateService < ApplicationService build_after_issue_journal_details if @updated_issue.previous_changes.present? # 操作记录 build_previous_issue_changes + build_issue_project_trends if status_id.present? # 开关时间记录 build_cirle_blockchain_token if blockchain_token_num.present? unless @project.id.zero? # @信息发送 diff --git a/app/services/api/v1/issues/update_service.rb b/app/services/api/v1/issues/update_service.rb index 5f040b25f..935eb3b2f 100644 --- a/app/services/api/v1/issues/update_service.rb +++ b/app/services/api/v1/issues/update_service.rb @@ -64,7 +64,6 @@ class Api::V1::Issues::UpdateService < ApplicationService build_assigner_issue_journal_details unless assigner_ids.nil?# 操作记录 build_attachment_issue_journal_details unless attachment_ids.nil? build_issue_tag_issue_journal_details unless issue_tag_ids.nil? - build_issue_project_trends if status_id.present? # 开关时间记录 build_assigner_participants unless assigner_ids.nil? # 负责人 build_edit_participants build_atme_participants if @atme_receivers.present? @@ -92,6 +91,7 @@ class Api::V1::Issues::UpdateService < ApplicationService build_after_issue_journal_details if @updated_issue.previous_changes.present? # 操作记录 build_previous_issue_changes + build_issue_project_trends if status_id.present? # 开关时间记录 build_cirle_blockchain_token if blockchain_token_num.present? unless @project.id.zero? # @信息发送 From 359f1c40f604587e6cb6e68ff77007e5c01f461e Mon Sep 17 00:00:00 2001 From: yystopf Date: Sat, 12 Oct 2024 15:03:43 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E6=9B=B4?= =?UTF-8?q?=E6=96=B0issue=20protrend=E6=9C=AA=E6=AD=A3=E5=B8=B8=E5=88=9B?= =?UTF-8?q?=E5=BB=BA=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/api/pm/issues/update_service.rb | 2 +- app/services/api/v1/issues/update_service.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/services/api/pm/issues/update_service.rb b/app/services/api/pm/issues/update_service.rb index bfce0430e..661bd211f 100644 --- a/app/services/api/pm/issues/update_service.rb +++ b/app/services/api/pm/issues/update_service.rb @@ -172,7 +172,7 @@ class Api::Pm::Issues::UpdateService < ApplicationService def build_issue_project_trends if @updated_issue.previous_changes["status_id"].present? && @updated_issue.previous_changes["status_id"][1] == 5 - @updated_issue.project_trends.new({user_id: current_user.id, project_id: @project.id, action_type: ProjectTrend::CLOSE}) + @updated_issue.project_trends.create!({user_id: current_user.id, project_id: @project.id, action_type: ProjectTrend::CLOSE}) end if @updated_issue.previous_changes["status_id"].present? && @updated_issue.previous_changes["status_id"][0] == 5 @updated_issue.project_trends.where(action_type: ProjectTrend::CLOSE).each(&:destroy!) diff --git a/app/services/api/v1/issues/update_service.rb b/app/services/api/v1/issues/update_service.rb index 935eb3b2f..10f814300 100644 --- a/app/services/api/v1/issues/update_service.rb +++ b/app/services/api/v1/issues/update_service.rb @@ -172,7 +172,7 @@ class Api::V1::Issues::UpdateService < ApplicationService def build_issue_project_trends if @updated_issue.previous_changes["status_id"].present? && @updated_issue.previous_changes["status_id"][1] == 5 - @updated_issue.project_trends.new({user_id: current_user.id, project_id: @project.id, action_type: ProjectTrend::CLOSE}) + @updated_issue.project_trends.create!({user_id: current_user.id, project_id: @project.id, action_type: ProjectTrend::CLOSE}) end if @updated_issue.previous_changes["status_id"].present? && @updated_issue.previous_changes["status_id"][0] == 5 @updated_issue.project_trends.where(action_type: ProjectTrend::CLOSE).each(&:destroy!)