mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-09 22:39:50 +08:00
fixed issue增加企业标识
This commit is contained in:
@@ -289,6 +289,13 @@ class Api::Pm::IssuesController < Api::Pm::BaseController
|
||||
render_not_found('疑修不存在!') if @issue.blank?
|
||||
end
|
||||
|
||||
# def load_issue_by_index
|
||||
# return render_parameter_missing if params[:pm_project_id].blank? || params[:pm_issue_type].blank? || params[:enterprise_identifier].blank?
|
||||
# @issue = Issue.find_issues_by_pm(params[:enterprise_identifier], params[:pm_issue_type])
|
||||
# .find_by(pm_issue_type_index3: params[:index])
|
||||
# render_not_found('疑修不存在!') if @issue.blank?
|
||||
# end
|
||||
|
||||
def load_issues
|
||||
return render_error('请输入正确的ID数组!') unless params[:ids].is_a?(Array)
|
||||
params[:ids].each do |id|
|
||||
@@ -327,7 +334,7 @@ class Api::Pm::IssuesController < Api::Pm::BaseController
|
||||
:branch_name, :start_date, :due_date, :time_scale,
|
||||
:subject, :description, :blockchain_token_num, :root_subject,
|
||||
:pm_project_id, :pm_sprint_id, :pm_issue_type, :root_id, :link_able_id, :project_id,
|
||||
:status_msg,
|
||||
:status_msg, :enterprise_identifier,
|
||||
issue_tag_ids: [],
|
||||
assigner_ids: [],
|
||||
attachment_ids: [],
|
||||
|
||||
@@ -298,6 +298,38 @@ class Issue < ApplicationRecord
|
||||
self.project.decrement!(:closed_issues_count) if self.status_id == 5 && self.project.present?
|
||||
end
|
||||
|
||||
# def self.find_issues_by_pm(enterprise_identifier, pm_issue_type)
|
||||
# case pm_issue_type.to_i
|
||||
# when 1
|
||||
# Issue.issue_issue.where(enterprise_identifier: enterprise_identifier)
|
||||
# .where(pm_issue_type: pm_issue_type)
|
||||
# .where(pm_issue_type_index1: index)
|
||||
# when 2
|
||||
# Issue.issue_issue.where(enterprise_identifier: enterprise_identifier)
|
||||
# .where(pm_issue_type: pm_issue_type)
|
||||
# .where(pm_issue_type_index2: index)
|
||||
# when 3
|
||||
# Issue.issue_issue.where(enterprise_identifier: enterprise_identifier)
|
||||
# .where(pm_issue_type: pm_issue_type)
|
||||
# .where(pm_issue_type_index3: index)
|
||||
# end
|
||||
# end
|
||||
#
|
||||
# def self.build_pm_index(enterprise_identifier, pm_issue_type)
|
||||
# last_issue = Issue.find_issues_by_pm(enterprise_identifier, pm_issue_type).order("pm_issue_type_index#{pm_issue_type.to_i} asc").last
|
||||
# deleted_issue_count = ($redis_cache.hget("pm_issue_cache_delete_count", enterprise_identifier) || 0).to_i
|
||||
#
|
||||
# last_issue.send("pm_issue_type_index#{pm_issue_type.to_i}").present? ? last_issue.send("pm_issue_type_index#{pm_issue_type.to_i}") + deleted_issue_count : 0
|
||||
# end
|
||||
#
|
||||
# def incre_pm_issue_cache_delete_count(count=1)
|
||||
# $redis_cache.hincrby("pm_issue_cache_delete_count", self.enterprise_identifier, count)
|
||||
# end
|
||||
#
|
||||
# def del_pm_issue_cache_delete_count
|
||||
# $redis_cache.hdel("pm_issue_cache_delete_count", self.enterprise_identifier)
|
||||
# end
|
||||
|
||||
def send_update_message_to_notice_system
|
||||
SendTemplateMessageJob.perform_later('IssueExpire', self.id) if Site.has_notice_menu? && self.due_date == Date.today + 1.days
|
||||
end
|
||||
|
||||
@@ -5,7 +5,7 @@ class Api::Pm::Issues::CreateService < ApplicationService
|
||||
|
||||
attr_reader :project, :current_user
|
||||
attr_reader :status_id, :priority_id, :milestone_id, :branch_name, :start_date, :due_date, :subject, :description, :blockchain_token_num, :root_subject
|
||||
attr_reader :issue_tag_ids, :assigner_ids, :attachment_ids, :receivers_login
|
||||
attr_reader :issue_tag_ids, :assigner_ids, :attachment_ids, :receivers_login, :enterprise_identifier, :pm_issue_type
|
||||
attr_accessor :created_issue
|
||||
|
||||
validates :subject, presence: true
|
||||
@@ -36,6 +36,7 @@ class Api::Pm::Issues::CreateService < ApplicationService
|
||||
@time_scale = params[:time_scale]
|
||||
@linkable_id = params[:link_able_id]
|
||||
@root_subject = params[:root_subject]
|
||||
@enterprise_identifier = params[:enterprise_identifier]
|
||||
end
|
||||
|
||||
def call
|
||||
@@ -74,6 +75,7 @@ class Api::Pm::Issues::CreateService < ApplicationService
|
||||
@created_issue.attachments = @attachments unless attachment_ids.blank?
|
||||
@created_issue.issue_tags = @issue_tags unless issue_tag_ids.blank?
|
||||
@created_issue.pm_project_id = @pm_project_id
|
||||
@created_issue.enterprise_identifier = @enterprise_identifier
|
||||
@created_issue.pm_sprint_id = @pm_sprint_id
|
||||
@created_issue.time_scale = @time_scale
|
||||
@created_issue.issue_tags_value = @issue_tags.order('id asc').pluck(:id).join(',') unless issue_tag_ids.blank?
|
||||
|
||||
7
db/migrate/202505216348545_add_issue_enterprise.rb
Normal file
7
db/migrate/202505216348545_add_issue_enterprise.rb
Normal file
@@ -0,0 +1,7 @@
|
||||
class AddIssueEnterprise < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
add_column :issues, :enterprise_identifier, :string
|
||||
add_index :issues, :enterprise_identifier
|
||||
end
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user