Browse Source

Merge remote-tracking branch 'origin/standalone_develop' into standalone_develop

# Conflicts:
#	app/services/api/v1/issues/update_service.rb
pull/348/head^2^2
xxq250 1 year ago
parent
commit
def1f4adf2
4 changed files with 10 additions and 8 deletions
  1. +2
    -2
      app/controllers/api/pm/base_controller.rb
  2. +3
    -3
      app/controllers/api/pm/issues_controller.rb
  3. +2
    -2
      app/services/api/pm/issues/create_service.rb
  4. +3
    -1
      app/services/api/v1/issues/list_service.rb

+ 2
- 2
app/controllers/api/pm/base_controller.rb View File

@@ -30,8 +30,8 @@ class Api::Pm::BaseController < ApplicationController
end

def load_issue
return render_parameter_missing if params[:pm_project_id].blank?
@issue = Issue.issue_issue.where(pm_project_id: params[:pm_project_id]).find_by_id(params[:issue_id])
# return render_parameter_missing if params[:pm_project_id].blank?
@issue = Issue.issue_issue.find_by_id(params[:issue_id])
render_not_found('疑修不存在!') if @issue.blank?
end
# 具有对仓库的管理权限


+ 3
- 3
app/controllers/api/pm/issues_controller.rb View File

@@ -284,8 +284,8 @@ class Api::Pm::IssuesController < Api::Pm::BaseController
end

def load_issue
return render_parameter_missing if params[:pm_project_id].blank?
@issue = Issue.issue_issue.where(pm_project_id: params[:pm_project_id]).find_by_id(params[:id])
# return render_parameter_missing if params[:pm_project_id].blank?
@issue = Issue.issue_issue.find_by_id(params[:id])
render_not_found('疑修不存在!') if @issue.blank?
end

@@ -322,7 +322,7 @@ class Api::Pm::IssuesController < Api::Pm::BaseController
:update_begin_date, :update_end_date,
:sort_by, :sort_direction, :root_id,
:issue_tag_ids, :pm_project_id, :pm_sprint_id, :pm_issue_type, :pm_project_ids,
:status_ids, :ids, :exclude_ids, :pm_issue_types, :participator_id
:status_ids, :ids, :exclude_ids, :pm_issue_types, :participator_id, :enterprise_identifier
)
end



+ 2
- 2
app/services/api/pm/issues/create_service.rb View File

@@ -58,9 +58,9 @@ class Api::Pm::Issues::CreateService < ApplicationService
@created_issue = Issue.new(issue_attributes)
@created_issue.pm_issue_type = @pm_issue_type
if @root_subject.present? && @pm_issue_type.to_i == 4
@root_issue = Issue.find_by(subject: @root_subject, pm_issue_type: 4, pm_project_id: @pm_project_id)
@root_issue = Issue.find_by(subject: @root_subject, pm_issue_type: 4, pm_project_id: @pm_project_id,enterprise_identifier: @enterprise_identifier)
unless @root_issue.present?
@root_issue = Issue.create(subject: @root_subject, pm_issue_type: 4, pm_project_id: @pm_project_id, status_id: 1, priority_id: 1, tracker_id: Tracker.first.id, project_id: @project.id, author_id: current_user.id)
@root_issue = Issue.create(subject: @root_subject, pm_issue_type: 4, pm_project_id: @pm_project_id, enterprise_identifier: @enterprise_identifier, status_id: 1, priority_id: 1, tracker_id: Tracker.first.id, project_id: @project.id, author_id: current_user.id)
end
@created_issue.root_id = @root_issue.id
else


+ 3
- 1
app/services/api/v1/issues/list_service.rb View File

@@ -3,7 +3,7 @@ class Api::V1::Issues::ListService < ApplicationService

attr_reader :project, :only_name, :category, :participant_category, :keyword, :author_id, :issue_tag_ids
attr_reader :begin_date, :end_date, :update_begin_date, :update_end_date
attr_reader :milestone_id, :assigner_id, :status_id, :priority_id, :sort_by, :sort_direction, :current_user
attr_reader :milestone_id, :assigner_id, :status_id, :priority_id, :sort_by, :sort_direction, :current_user, :enterprise_identifier
attr_reader :pm_project_id, :pm_project_ids, :pm_sprint_id, :root_id, :pm_issue_type, :status_ids, :ids, :exclude_ids, :pm_issue_types
attr_accessor :queried_issues, :total_issues_count, :closed_issues_count, :opened_issues_count, :complete_issues_count, :participator

@@ -30,6 +30,7 @@ class Api::V1::Issues::ListService < ApplicationService
@update_begin_date = params[:update_begin_date]
@update_end_date = params[:update_end_date]
@sort_by = params[:sort_by].present? ? params[:sort_by] : 'issues.updated_on'
@enterprise_identifier = params[:enterprise_identifier]
@pm_project_id = params[:pm_project_id]
@pm_project_ids = params[:pm_project_ids]
@pm_sprint_id = params[:pm_sprint_id]
@@ -96,6 +97,7 @@ class Api::V1::Issues::ListService < ApplicationService
end
end

issues = issues.where(enterprise_identifier: enterprise_identifier) if enterprise_identifier.present?
#pm相关
# root_id# -1 查一级目录
issues = if root_id.to_i == -1


Loading…
Cancel
Save