forked from Trustie/forgeplus
Merge remote-tracking branch 'origin/standalone_develop' into dev_osredm_server
This commit is contained in:
commit
f304b9d890
|
|
@ -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
|
||||
# 具有对仓库的管理权限
|
||||
|
|
|
|||
|
|
@ -284,11 +284,18 @@ 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
|
||||
|
||||
# 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|
|
||||
|
|
@ -315,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
|
||||
|
||||
|
|
@ -327,6 +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, :enterprise_identifier,
|
||||
issue_tag_ids: [],
|
||||
assigner_ids: [],
|
||||
attachment_ids: [],
|
||||
|
|
|
|||
|
|
@ -0,0 +1,82 @@
|
|||
class Api::Pm::WeeklyIssuesController < Api::Pm::BaseController
|
||||
|
||||
def personal
|
||||
@enterprise_identifier = params[:enterprise_identifier] || ''
|
||||
return render_error('请输入正确的用户ID.') if params[:user_id].blank?
|
||||
@all_issues = Issue.joins(:issue_participants).where(issue_participants: {participant_id: params[:user_id], participant_type: ['assigned']})
|
||||
@all_issues = @all_issues.where(enterprise_identifier: @enterprise_identifier, pm_issue_type: [1,2,3])
|
||||
@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).distinct
|
||||
@this_week_all_issues = @this_week_all_issues.order('created_on desc')
|
||||
@next_week_all_issues = @all_issues.where("due_date >= ? and start_date <=?", (Date.today.beginning_of_week+1.week).to_s, (Date.today.end_of_week+1.week).to_s).distinct
|
||||
@next_week_all_issues = @next_week_all_issues.order('created_on desc')
|
||||
@this_week_requirement_issues = @this_week_all_issues.where(pm_issue_type: 1)
|
||||
@this_week_task_issues = @this_week_all_issues.where(pm_issue_type: 2)
|
||||
@this_week_bug_issues = @this_week_all_issues.where(pm_issue_type: 3)
|
||||
@close_requirement_issues = @this_week_requirement_issues.where(status_id: [3,5])
|
||||
@close_task_issues = @this_week_task_issues.where(status_id: [3,5])
|
||||
@close_bug_issues = @this_week_bug_issues.where(status_id: [3,5])
|
||||
this_week_page = params[:this_week_page] || 1
|
||||
this_week_limit = params[:this_week_limit] || 15
|
||||
@this_week_all_issues = @this_week_all_issues.page(this_week_page).per(this_week_limit)
|
||||
next_week_page = params[:next_week_page] || 1
|
||||
next_week_limit = params[:next_week_limit] || 15
|
||||
@next_week_all_issues = @next_week_all_issues.page(next_week_page).per(next_week_limit)
|
||||
end
|
||||
|
||||
def group
|
||||
@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?
|
||||
@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_group_count = @this_week_all_issues.group(:pm_project_id).count
|
||||
data = {}
|
||||
@this_week_all_issues_group_count.keys.each do |pm_project_id|
|
||||
this_project_id_requirements = @this_week_all_issues.where(pm_project_id: pm_project_id, pm_issue_type: 1)
|
||||
this_project_id_tasks = @this_week_all_issues.where(pm_project_id: pm_project_id, pm_issue_type: 2)
|
||||
this_project_id_bugs = @this_week_all_issues.where(pm_project_id: pm_project_id, pm_issue_type: 3)
|
||||
this_project_id_close_requirements = this_project_id_requirements.where(status_id: [3,5])
|
||||
this_project_id_close_tasks = this_project_id_tasks.where(status_id: [3,5])
|
||||
this_project_id_close_bugs = this_project_id_bugs.where(status_id: [3,5])
|
||||
data[pm_project_id] = {
|
||||
this_week_requirement_issues_count: this_project_id_requirements.count,
|
||||
this_week_task_issues_count: this_project_id_tasks.count,
|
||||
this_week_bug_issues_count: this_project_id_bugs.count,
|
||||
close_requirement_issues_count: this_project_id_close_requirements.count,
|
||||
close_task_issues_count: this_project_id_close_tasks.count,
|
||||
close_bug_issues_count: this_project_id_close_bugs.count,
|
||||
this_week_task_issues: this_project_id_tasks
|
||||
}
|
||||
|
||||
|
||||
end
|
||||
|
||||
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
|
||||
def personal_issues
|
||||
@enterprise_identifier = params[:enterprise_identifier] || ''
|
||||
return render_error('请输入正确的用户ID.') if params[:user_id].blank?
|
||||
@all_issues = Issue.joins(:issue_participants).where(issue_participants: {participant_id: params[:user_id], participant_type: ['assigned']})
|
||||
@all_issues = @all_issues.where(enterprise_identifier: @enterprise_identifier, pm_issue_type: [1,2,3])
|
||||
@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).distinct
|
||||
@this_week_all_issues = @this_week_all_issues.order('created_on desc')
|
||||
@next_week_all_issues = @all_issues.where("due_date >= ? and start_date <=?", (Date.today.beginning_of_week+1.week).to_s, (Date.today.end_of_week+1.week).to_s).distinct
|
||||
@next_week_all_issues = @next_week_all_issues.order('created_on desc')
|
||||
this_week_page = params[:this_week_page] || 1
|
||||
this_week_limit = params[:this_week_limit] || 15
|
||||
@this_week_all_issues = @this_week_all_issues.page(this_week_page).per(this_week_limit)
|
||||
next_week_page = params[:next_week_page] || 1
|
||||
next_week_limit = params[:next_week_limit] || 15
|
||||
@next_week_all_issues = @next_week_all_issues.page(next_week_page).per(next_week_limit)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -35,7 +35,6 @@ module LaboratoryHelper
|
|||
end
|
||||
|
||||
def default_course_links
|
||||
|
||||
{
|
||||
# new_syllabuses: "https://www.trustie.net/syllabuses/new",
|
||||
# new_course: "https://www.trustie.net/courses/new",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
class SettingsController < ApplicationController
|
||||
def show
|
||||
@old_projects_url = nil
|
||||
get_navbar
|
||||
#site_page_deploy_domain
|
||||
get_add_menu
|
||||
|
|
@ -8,7 +7,7 @@ class SettingsController < ApplicationController
|
|||
#get_sub_competitions
|
||||
get_other_setting
|
||||
get_personal_menu
|
||||
get_third_party
|
||||
# get_third_party
|
||||
get_third_party_new
|
||||
get_professional_fields
|
||||
get_top_system_notification
|
||||
|
|
|
|||
|
|
@ -161,6 +161,7 @@ module RepositoriesHelper
|
|||
s_content = s_content.starts_with?("/") ? s_content[1..-1] : s_content[0..-1]
|
||||
s_content = File.expand_path(s_content, file_path)
|
||||
s_content = s_content.split("#{Rails.root}/")[1]
|
||||
next if s_content.blank?
|
||||
# content = content.gsub(s[0], "/#{s_content}")
|
||||
join_xxx = s_content.include?("?") ? "&" : "?"
|
||||
s_content = [base_url, "/api/#{owner&.login}/#{repo.identifier}/raw/#{s_content}#{join_xxx}ref=#{ref}"].join
|
||||
|
|
@ -190,6 +191,7 @@ module RepositoriesHelper
|
|||
path = [owner&.login, repo&.identifier, 'tree', ref, file_path].join("/")
|
||||
s_content = File.expand_path(s_content, path)
|
||||
s_content = s_content.split("#{Rails.root}")[1]
|
||||
next if s_content.blank?
|
||||
case k.to_s
|
||||
when 'ss_src'
|
||||
content = content.gsub("src=\"#{s[0]}\"", "src=\"/#{s_content}\"")
|
||||
|
|
@ -201,8 +203,8 @@ module RepositoriesHelper
|
|||
content = content.gsub("href=\"#{s[0]}\"", "href=\"#{s_content}\"")
|
||||
when 'ss_href_1'
|
||||
content = content.gsub("href=\'#{s[0]}\'", "href=\'#{s_content}\'")
|
||||
else
|
||||
content = content.gsub("(#{s[0]})", "(/#{s_content})")
|
||||
else
|
||||
content = content.gsub("(#{s[0]})", "(#{s_content})")
|
||||
end
|
||||
end
|
||||
rescue
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
class CommitLog < ApplicationRecord
|
||||
belongs_to :user
|
||||
belongs_to :project
|
||||
belongs_to :repository
|
||||
# belongs_to :repository
|
||||
|
||||
has_many :project_trends, as: :trend, dependent: :destroy
|
||||
|
||||
|
|
|
|||
|
|
@ -299,6 +299,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
|
||||
|
|
@ -56,10 +57,10 @@ class Api::Pm::Issues::CreateService < ApplicationService
|
|||
try_lock("Api::Pm::Issues::CreateService:#{project.id}") # 开始写数据,加锁
|
||||
@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)
|
||||
if @root_subject.present? && [4, 5].include?(@pm_issue_type.to_i)
|
||||
@root_issue = Issue.find_by(subject: @root_subject, pm_issue_type: [4,5], 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: @pm_issue_type.to_i, 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
|
||||
|
|
@ -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?
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ class Api::Pm::Issues::UpdateService < ApplicationService
|
|||
include Api::V1::Issues::Concerns::Loadable
|
||||
|
||||
attr_reader :project, :issue, :current_user, :operate_by
|
||||
attr_reader :status_id, :priority_id, :milestone_id, :branch_name, :start_date, :due_date, :subject, :description, :blockchain_token_num
|
||||
attr_reader :status_id, :priority_id, :milestone_id, :branch_name, :start_date, :due_date, :subject, :description, :blockchain_token_num,:status_msg
|
||||
attr_reader :target_pm_project_id, :pm_sprint_id, :pm_issue_type, :root_id, :time_scale
|
||||
attr_reader :issue_tag_ids, :assigner_ids, :attachment_ids, :receivers_login, :before_issue_tag_ids, :before_assigner_ids, :project_id
|
||||
attr_accessor :add_assigner_ids, :previous_issue_changes, :updated_issue, :atme_receivers
|
||||
|
|
@ -18,6 +18,7 @@ class Api::Pm::Issues::UpdateService < ApplicationService
|
|||
@current_user = current_user
|
||||
@operate_by = operate_by
|
||||
@status_id = params[:status_id]
|
||||
@status_msg = params[:status_msg]
|
||||
@priority_id = params[:priority_id]
|
||||
@milestone_id = params[:milestone_id]
|
||||
@branch_name = params[:branch_name]
|
||||
|
|
@ -201,7 +202,12 @@ class Api::Pm::Issues::UpdateService < ApplicationService
|
|||
# 修改状态
|
||||
if @updated_issue.previous_changes["status_id"].present?
|
||||
journal = @updated_issue.journals.create!({user_id: current_user.id, operate_by: @operate_by})
|
||||
journal.journal_details.create!({property: @updated_issue.pm_issue_type_string, prop_key: "status_id", old_value: @updated_issue.previous_changes["status_id"][0], value: @updated_issue.previous_changes["status_id"][1]})
|
||||
journal.journal_details.create!({property: @updated_issue.pm_issue_type_string,
|
||||
prop_key: "status_id",
|
||||
status_msg: @status_msg,
|
||||
old_value: @updated_issue.previous_changes["status_id"][0],
|
||||
value: @updated_issue.previous_changes["status_id"][1]}
|
||||
)
|
||||
end
|
||||
|
||||
# 修改优先级
|
||||
|
|
|
|||
|
|
@ -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,8 @@ class Api::V1::Issues::ListService < ApplicationService
|
|||
end
|
||||
end
|
||||
|
||||
issues = issues.where(enterprise_identifier: enterprise_identifier) if enterprise_identifier.present? && ([4,5].include?(pm_issue_type.to_i) || pm_issue_types.present?)
|
||||
|
||||
#pm相关
|
||||
# root_id# -1 查一级目录
|
||||
issues = if root_id.to_i == -1
|
||||
|
|
@ -148,7 +151,7 @@ class Api::V1::Issues::ListService < ApplicationService
|
|||
end
|
||||
|
||||
if update_begin_date&.present? || update_end_date&.present?
|
||||
issues = issues.where('issues.updated_on between ? and ?', update_begin_date&.present? ? update_begin_date.to_time : Time.now.beginning_of_day, update_end_date&.present? ? update_end_date.to_time.end_of_day : Time.now.end_of_day)
|
||||
issues = issues.where('issues.updated_on between ? and ?', update_begin_date&.present? ? update_begin_date.to_time.beginning_of_week : Time.now.beginning_of_week, update_end_date&.present? ? update_end_date.to_time.end_of_week : Time.now.end_of_week)
|
||||
end
|
||||
|
||||
# keyword
|
||||
|
|
|
|||
|
|
@ -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 @updated_issue.status_id == 5 && @due_date.blank?
|
||||
@updated_issue.save!
|
||||
|
||||
build_after_issue_journal_details if @updated_issue.previous_changes.present? # 操作记录
|
||||
|
|
|
|||
|
|
@ -23,8 +23,8 @@ class Api::V1::Users::DeleteUserService < ApplicationService
|
|||
end
|
||||
@user.destroy!
|
||||
del_user_data_by_sql(@user.id)
|
||||
Gitea::User::DeleteService.call(@user.login, true)
|
||||
end
|
||||
Gitea::User::DeleteService.call(@user.login, true)
|
||||
return true
|
||||
rescue
|
||||
raise Error, "服务器错误,请联系系统管理员!"
|
||||
|
|
@ -32,7 +32,11 @@ class Api::V1::Users::DeleteUserService < ApplicationService
|
|||
end
|
||||
|
||||
def del_user_data_by_sql(user_id)
|
||||
sql1 = "delete from memos where author_id=#{user_id}"
|
||||
ActiveRecord::Base.connection.execute(sql1)
|
||||
if ActiveRecord::Base.connection.table_exists?("memos")
|
||||
sql1 = "delete from memos where author_id=#{user_id}"
|
||||
ActiveRecord::Base.connection.execute(sql1)
|
||||
else
|
||||
Rails.logger.info "memos table does not exist"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -13,6 +13,7 @@ if journal.is_journal_detail?
|
|||
detail = journal.journal_details.take
|
||||
json.operate_category journal.pm_operate_category
|
||||
json.operate_content journal.is_journal_detail? ? journal.pm_operate_content : nil
|
||||
json.status_msg detail.status_msg
|
||||
else
|
||||
json.notes journal.notes
|
||||
json.comments_count journal.comments_count
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
json.this_week_all_issues @this_week_all_issues.each do |issue|
|
||||
json.partial! "api/v1/issues/simple_detail", locals: {issue: issue}
|
||||
end
|
||||
json.this_week_total_count @this_week_all_issues.total_count
|
||||
json.next_week_all_issues @next_week_all_issues.each do |issue|
|
||||
json.partial! "api/v1/issues/simple_detail", locals: {issue: issue}
|
||||
end
|
||||
json.next_week_total_count @next_week_all_issues.total_count
|
||||
json.this_week_requirement_issues_count @this_week_requirement_issues.count
|
||||
json.this_week_task_issues_count @this_week_task_issues.count
|
||||
json.this_week_bug_issues_count @this_week_bug_issues.count
|
||||
json.close_requirement_issues_count @close_requirement_issues.count
|
||||
json.close_task_issues_count @close_task_issues.count
|
||||
json.close_bug_issues_count @close_bug_issues.count
|
||||
json.unclose_count @this_week_all_issues.count - @close_requirement_issues.count - @close_task_issues.count - @close_bug_issues.count
|
||||
json.close_task_issues @close_task_issues.each do |issue|
|
||||
json.partial! "api/v1/issues/simple_detail", locals: {issue: issue}
|
||||
end
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
json.this_week_all_issues @this_week_all_issues.each do |issue|
|
||||
json.partial! "api/v1/issues/simple_detail", locals: {issue: issue}
|
||||
end
|
||||
json.this_week_total_count @this_week_all_issues.total_count
|
||||
json.next_week_all_issues @next_week_all_issues.each do |issue|
|
||||
json.partial! "api/v1/issues/simple_detail", locals: {issue: issue}
|
||||
end
|
||||
json.next_week_total_count @next_week_all_issues.total_count
|
||||
|
|
@ -30,7 +30,11 @@ json.pm_issue_type issue.pm_issue_type
|
|||
json.pm_sprint_id issue.pm_sprint_id
|
||||
json.pm_project_id issue.pm_project_id
|
||||
json.time_scale issue.time_scale
|
||||
json.child_count issue.child_count
|
||||
if params[:pm_issue_types].present?
|
||||
json.child_count issue.children_issues.where(pm_issue_type: 4).count
|
||||
else
|
||||
json.child_count issue.child_count
|
||||
end
|
||||
|
||||
json.author do
|
||||
json.partial! "api/v1/users/simple_user", locals: {user: issue.user}
|
||||
|
|
|
|||
|
|
@ -11,11 +11,11 @@ json.setting do
|
|||
json.site_page_deploy_domain @deploy_domain
|
||||
|
||||
json.subject_banner_url default_setting.subject_banner_url&.[](1..-1)
|
||||
json.course_banner_url default_setting.course_banner_url&.[](1..-1)
|
||||
# json.course_banner_url default_setting.course_banner_url&.[](1..-1)
|
||||
json.competition_banner_url EduSetting.get("competition_banner_url").to_s
|
||||
json.competition_banner_href EduSetting.get("competition_banner_href").to_s
|
||||
json.moop_cases_banner_url default_setting.moop_cases_banner_url&.[](1..-1)
|
||||
json.oj_banner_url default_setting.oj_banner_url&.[](1..-1)
|
||||
# json.moop_cases_banner_url default_setting.moop_cases_banner_url&.[](1..-1)
|
||||
# json.oj_banner_url default_setting.oj_banner_url&.[](1..-1)
|
||||
|
||||
json.navbar nav_bar
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,21 @@ defaults format: :json do
|
|||
get :todo
|
||||
get :my_issues
|
||||
get :my_pm_projects
|
||||
end
|
||||
end
|
||||
resources :weekly_issues, only: [:index] do
|
||||
collection do
|
||||
get :personal
|
||||
get :group
|
||||
get :group_issues
|
||||
get :personal_issues
|
||||
end
|
||||
end
|
||||
resources :dashboards,only: [:index] do
|
||||
collection do
|
||||
get :todo
|
||||
get :my_issues
|
||||
get :my_pm_projects
|
||||
get :my_projects
|
||||
get :my_operate_journals
|
||||
end
|
||||
|
|
|
|||
|
|
@ -0,0 +1,5 @@
|
|||
class AddJournalDetailMsg < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
add_column :journal_details, :status_msg, :string
|
||||
end
|
||||
end
|
||||
|
|
@ -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
|
||||
Loading…
Reference in New Issue