From 3fe528359e4ebaaa2a1e9fec53cfd41e9dfd26e5 Mon Sep 17 00:00:00 2001 From: yystopf Date: Thu, 22 May 2025 10:50:49 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E8=AE=BE=E7=BD=AE=E7=BB=93=E6=9D=9F=E6=97=A5=E6=9C=9F?= =?UTF-8?q?=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/api/v1/issues/update_service.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/services/api/v1/issues/update_service.rb b/app/services/api/v1/issues/update_service.rb index d92513ec5..98c50b224 100644 --- a/app/services/api/v1/issues/update_service.rb +++ b/app/services/api/v1/issues/update_service.rb @@ -92,7 +92,7 @@ class Api::V1::Issues::UpdateService < ApplicationService @updated_issue.project_id = @project_id unless @project_id.nil? @updated_issue.updated_on = Time.now @updated_issue.changer_id = @current_user.id - @updated_issue.due_date = Time.now if @due_date.blank? + # @updated_issue.due_date = Time.now if @due_date.blank? @updated_issue.save! build_after_issue_journal_details if @updated_issue.previous_changes.present? # 操作记录 From 6574ee5270213b5db9de0b56d9747e7790d85f21 Mon Sep 17 00:00:00 2001 From: yystopf Date: Thu, 22 May 2025 13:52:03 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E6=96=B0=E5=A2=9E=EF=BC=9Aissue=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E6=9F=A5=E8=AF=A2=E4=BC=81=E4=B8=9A=E6=A0=87=E8=AF=86?= =?UTF-8?q?=E4=BB=A5=E5=8F=8A=E7=A7=BB=E9=99=A4pm=5Fproject=5Fid=E9=AA=8C?= =?UTF-8?q?=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/api/pm/base_controller.rb | 2 +- app/controllers/api/pm/issues_controller.rb | 2 +- app/services/api/v1/issues/list_service.rb | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/controllers/api/pm/base_controller.rb b/app/controllers/api/pm/base_controller.rb index f9754f33d..e3d744364 100644 --- a/app/controllers/api/pm/base_controller.rb +++ b/app/controllers/api/pm/base_controller.rb @@ -30,7 +30,7 @@ class Api::Pm::BaseController < ApplicationController end def load_issue - return render_parameter_missing if params[:pm_project_id].blank? + # 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]) render_not_found('疑修不存在!') if @issue.blank? end diff --git a/app/controllers/api/pm/issues_controller.rb b/app/controllers/api/pm/issues_controller.rb index b143405d2..5bb18991a 100644 --- a/app/controllers/api/pm/issues_controller.rb +++ b/app/controllers/api/pm/issues_controller.rb @@ -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 diff --git a/app/services/api/v1/issues/list_service.rb b/app/services/api/v1/issues/list_service.rb index a86b6d875..1dcde236f 100644 --- a/app/services/api/v1/issues/list_service.rb +++ b/app/services/api/v1/issues/list_service.rb @@ -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 From bf3540c2507d9474aa60cae30cfa50fe8145bee9 Mon Sep 17 00:00:00 2001 From: yystopf Date: Thu, 22 May 2025 13:59:39 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E6=96=B0=E5=A2=9E=EF=BC=9A=E5=88=9B?= =?UTF-8?q?=E5=BB=BA=E5=91=A8=E6=8A=A5=E7=88=B6=E5=91=A8=E6=8A=A5=E5=AD=98?= =?UTF-8?q?=E5=82=A8=E4=BC=81=E4=B8=9A=E6=A0=87=E8=AF=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/api/pm/issues/create_service.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/services/api/pm/issues/create_service.rb b/app/services/api/pm/issues/create_service.rb index f527f6302..caaee3892 100644 --- a/app/services/api/pm/issues/create_service.rb +++ b/app/services/api/pm/issues/create_service.rb @@ -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 From 78c5458bb854d0c6daeb9346b8a33acc4222ae79 Mon Sep 17 00:00:00 2001 From: yystopf Date: Thu, 22 May 2025 14:11:09 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E7=BC=BA=E5=A4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/api/pm/issues_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/api/pm/issues_controller.rb b/app/controllers/api/pm/issues_controller.rb index 5bb18991a..50d75fc15 100644 --- a/app/controllers/api/pm/issues_controller.rb +++ b/app/controllers/api/pm/issues_controller.rb @@ -284,7 +284,7 @@ class Api::Pm::IssuesController < Api::Pm::BaseController end def load_issue - return render_parameter_missing if params[:pm_project_id].blank? + # 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]) render_not_found('疑修不存在!') if @issue.blank? end From ce5d5a88ba7debf1d51769e0a4981bc89a94ca00 Mon Sep 17 00:00:00 2001 From: yystopf Date: Thu, 22 May 2025 14:13:50 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E7=96=91?= =?UTF-8?q?=E4=BF=AE=E4=B8=8D=E5=AD=98=E5=9C=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/api/pm/base_controller.rb | 2 +- app/controllers/api/pm/issues_controller.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/api/pm/base_controller.rb b/app/controllers/api/pm/base_controller.rb index e3d744364..e0ebd1aca 100644 --- a/app/controllers/api/pm/base_controller.rb +++ b/app/controllers/api/pm/base_controller.rb @@ -31,7 +31,7 @@ class Api::Pm::BaseController < ApplicationController 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]) + @issue = Issue.issue_issue.find_by_id(params[:issue_id]) render_not_found('疑修不存在!') if @issue.blank? end # 具有对仓库的管理权限 diff --git a/app/controllers/api/pm/issues_controller.rb b/app/controllers/api/pm/issues_controller.rb index 50d75fc15..eef8015e0 100644 --- a/app/controllers/api/pm/issues_controller.rb +++ b/app/controllers/api/pm/issues_controller.rb @@ -285,7 +285,7 @@ class Api::Pm::IssuesController < Api::Pm::BaseController 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]) + @issue = Issue.issue_issue.find_by_id(params[:id]) render_not_found('疑修不存在!') if @issue.blank? end