mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-16 17:55:56 +08:00
Merge branch 'standalone_develop' into pm_project_develop
This commit is contained in:
@@ -105,7 +105,7 @@ class Issue < ApplicationRecord
|
||||
scope :opened, ->{where.not(status_id: 5)}
|
||||
after_create :incre_project_common, :incre_user_statistic, :incre_platform_statistic
|
||||
before_save :check_pm_and_update_due_date
|
||||
after_save :change_versions_count, :send_update_message_to_notice_system, :associate_attachment_container, :generate_uuid
|
||||
after_save :incre_or_decre_closed_issues_count, :change_versions_count, :send_update_message_to_notice_system, :associate_attachment_container, :generate_uuid
|
||||
after_destroy :update_closed_issues_count_in_project!, :decre_project_common, :decre_user_statistic, :decre_platform_statistic
|
||||
|
||||
def check_pm_and_update_due_date
|
||||
@@ -126,20 +126,35 @@ class Issue < ApplicationRecord
|
||||
end
|
||||
end
|
||||
|
||||
def is_issuely_issue?
|
||||
self.issue_classify.nil? || self.issue_classify == 'issue'
|
||||
end
|
||||
|
||||
def incre_or_decre_closed_issues_count
|
||||
if previous_changes[:status_id].present? && is_issuely_issue?
|
||||
if previous_changes[:status_id][1] == 5
|
||||
CacheAsyncSetJob.perform_later("project_common_service", {closed_issues: 1}, self.project_id)
|
||||
end
|
||||
if previous_changes[:status_id][0] == 5
|
||||
CacheAsyncSetJob.perform_later("project_common_service", {closed_issues: -1}, self.project_id)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def incre_project_common
|
||||
CacheAsyncSetJob.perform_later('project_common_service', {issues: 1}, self.project_id)
|
||||
CacheAsyncSetJob.perform_later('project_common_service', {issues: 1}, self.project_id) if is_issuely_issue?
|
||||
end
|
||||
|
||||
def decre_project_common
|
||||
CacheAsyncSetJob.perform_later('project_common_service', {issues: -1}, self.project_id)
|
||||
CacheAsyncSetJob.perform_later('project_common_service', {issues: -1}, self.project_id) if is_issuely_issue?
|
||||
end
|
||||
|
||||
def incre_user_statistic
|
||||
CacheAsyncSetJob.perform_later('user_statistic_service', {issue_count: 1}, self.author_id)
|
||||
CacheAsyncSetJob.perform_later('user_statistic_service', {issue_count: 1}, self.author_id) if is_issuely_issue?
|
||||
end
|
||||
|
||||
def decre_user_statistic
|
||||
CacheAsyncSetJob.perform_later('user_statistic_service', {issue_count: -1}, self.author_id)
|
||||
CacheAsyncSetJob.perform_later('user_statistic_service', {issue_count: -1}, self.author_id) if is_issuely_issue?
|
||||
end
|
||||
|
||||
def refresh_root_issue_count
|
||||
@@ -150,11 +165,12 @@ class Issue < ApplicationRecord
|
||||
end
|
||||
|
||||
def incre_platform_statistic
|
||||
CacheAsyncSetJob.perform_later('platform_statistic_service', {issue_count: 1})
|
||||
CacheAsyncSetJob.perform_later('platform_statistic_service', {issue_count: 1}) if is_issuely_issue?
|
||||
end
|
||||
|
||||
def decre_platform_statistic
|
||||
CacheAsyncSetJob.perform_later('platform_statistic_service', {issue_count: -1})
|
||||
CacheAsyncSetJob.perform_later('platform_statistic_service', {issue_count: -1}) if is_issuely_issue?
|
||||
end
|
||||
end
|
||||
|
||||
def get_assign_user
|
||||
|
||||
Reference in New Issue
Block a user