From 9ec3f4655e85215cedc655830be31f2b60065926 Mon Sep 17 00:00:00 2001 From: yystopf Date: Tue, 3 Sep 2024 10:40:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/tasks/import_issues_from_chandao.rake | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/lib/tasks/import_issues_from_chandao.rake b/lib/tasks/import_issues_from_chandao.rake index c4a787a57..d8cc4b89d 100644 --- a/lib/tasks/import_issues_from_chandao.rake +++ b/lib/tasks/import_issues_from_chandao.rake @@ -24,8 +24,8 @@ namespace :import_from_chandao do end desc "bug数据" - # 执行示例 bundle exec rake "import_from_chandao:bugs[企业内部工时管理系统.csv, 3]" - # RAILS_ENV=production bundle exec rake "import_from_chandao:bugs[企业内部工时管理系统.csv, 3]" + # 执行示例 bundle exec rake "import_from_chandao:bugs[企业内部工时管理系统.csv, 3, ceshi_org]" + # RAILS_ENV=production bundle exec rake "import_from_chandao:bugs[企业内部工时管理系统.csv, 3, ceshi_org]" task :bugs, [:name, :pm_project_id, :org_login] => :environment do |t, args| org = Organization.find_by(login: args.org_login) if org.present? @@ -59,8 +59,7 @@ namespace :import_from_chandao do issue.project_id = 0 issue.pm_project_id = args.pm_project_id issue.pm_issue_type = 3 - sprint_name = randd_field_hash['所属迭代'].split('(#')[0] - sprint = get_sprint_data(sprint_name, args.pm_project_id, org) + sprint = get_sprint_data(randd_field_hash['所属迭代'].split('(#')[0], args.pm_project_id, org) rescue nil issue.pm_sprint_id = sprint['id'] if sprint.present? issue.save! requirement_issue = Issue.find_by(project_issues_index: randd_field_hash['相关需求'].split('(#')[1].split(')')[0], pm_project_id: args.pm_project_id, pm_issue_type: 1) rescue nil @@ -77,8 +76,8 @@ namespace :import_from_chandao do end end - # 执行示例 bundle exec rake "import_from_chandao:tasks[复杂智能软件项目-所有任务.csv, 365]" - # RAILS_ENV=production bundle exec rake "import_from_chandao:tasks[复杂智能软件项目-所有任务.csv, 365]" + # 执行示例 bundle exec rake "import_from_chandao:tasks[复杂智能软件项目-所有任务.csv, 365, ceshi_org]" + # RAILS_ENV=production bundle exec rake "import_from_chandao:tasks[复杂智能软件项目-所有任务.csv, 365, ceshi_org]" task :tasks, [:name, :pm_project_id, :org_login] => :environment do |t, args| org = Organization.find_by(login: args.org_login) if org.present? @@ -117,8 +116,7 @@ namespace :import_from_chandao do issue.project_id = 0 issue.pm_project_id = pm_project_id issue.pm_issue_type = 2 - sprint_name = randd_field_hash['所属迭代'].split('(#')[0] - sprint = get_sprint_data(sprint_name, args.pm_project_id, org) + sprint = get_sprint_data(randd_field_hash['所属迭代'].split('(#')[0], args.pm_project_id, org) rescue nil issue.pm_sprint_id = sprint['id'] if sprint.present? issue.save! requirement_issue = Issue.find_by(project_issues_index: randd_field_hash['相关需求'].split('(#')[1].split(')')[0], pm_project_id: pm_project_id, pm_issue_type: 1) rescue nil @@ -131,8 +129,8 @@ namespace :import_from_chandao do end end - # 执行示例 bundle exec rake "import_from_chandao:requirements[企业网站第二期.csv, 3]" - # RAILS_ENV=production bundle exec rake "import_from_chandao:requirements[企业网站第二期.csv, 3]" + # 执行示例 bundle exec rake "import_from_chandao:requirements[企业网站第二期.csv, 3, ceshi_org]" + # RAILS_ENV=production bundle exec rake "import_from_chandao:requirements[企业网站第二期.csv, 3, ceshi_org]" task :requirements, [:name, :pm_project_id, :org_login] => :environment do |t, args| org = Organization.find_by(login: args.org_login) if org.present?