新增:项目组本周工作项接口

This commit is contained in:
yystopf 2025-05-23 10:20:16 +08:00
parent def1f4adf2
commit d91b7da82c
4 changed files with 17 additions and 1 deletions

View File

@ -47,4 +47,14 @@ class Api::Pm::WeeklyIssuesController < ApplicationController
render :json => data
end
def group_issues
@enterprise_identifier = params[:enterprise_identifier] || ''
@all_issues = Issue.where(enterprise_identifier: @enterprise_identifier, pm_issue_type: [1,2,3])
@all_issues = @all_issues.where(pm_project_id: params[:pm_project_ids].split(",")) if params[:pm_project_ids].present?
@all_issues = @all_issues.where(pm_issue_type: params[:pm_issue_type].to_i) if params[:pm_issue_type].present?
@this_week_all_issues = @all_issues.where("due_date >= ? and start_date <= ?", Date.today.beginning_of_week.to_s, Date.today.end_of_week.to_s)
@this_week_all_issues = @this_week_all_issues.order('created_on desc')
@this_week_all_issues = kaminari_paginate(@this_week_all_issues)
end
end

View File

@ -97,7 +97,8 @@ class Api::V1::Issues::ListService < ApplicationService
end
end
issues = issues.where(enterprise_identifier: enterprise_identifier) if enterprise_identifier.present?
issues = issues.where(enterprise_identifier: enterprise_identifier) if enterprise_identifier.present? && [4,5].include?(pm_issue_type.to_i)
#pm相关
# root_id# -1 查一级目录
issues = if root_id.to_i == -1

View File

@ -0,0 +1,4 @@
json.total_count @this_week_all_issues.total_count
json.issues @this_week_all_issues.each do |issue|
json.partial! "api/v1/issues/simple_detail", locals: {issue: issue}
end

View File

@ -5,6 +5,7 @@ defaults format: :json do
collection do
get :personal
get :group
get :group_issues
end
end
resources :dashboards,only: [:index] do