更改:读取文件形式
This commit is contained in:
parent
6f0afffb3b
commit
97685bf68c
|
@ -147,7 +147,7 @@ class Api::Pm::IssuesController < Api::Pm::BaseController
|
||||||
return render_error('请输入正确的项目ID.') if params[:pm_project_id].blank?
|
return render_error('请输入正确的项目ID.') if params[:pm_project_id].blank?
|
||||||
return render_error('请输入正确的组织ID.') if params[:organization_id].blank?
|
return render_error('请输入正确的组织ID.') if params[:organization_id].blank?
|
||||||
types = {requirement: 1, task: 2, bug: 3}
|
types = {requirement: 1, task: 2, bug: 3}
|
||||||
doc = SimpleXlsxReader.parse(params[:file].to_io)
|
doc = SimpleXlsxReader.open(params[:file].tempfile)
|
||||||
doc.sheets.each do |sheet|
|
doc.sheets.each do |sheet|
|
||||||
type = types["#{sheet.name}".to_sym]
|
type = types["#{sheet.name}".to_sym]
|
||||||
sheet.rows.each.with_index do |row, index|
|
sheet.rows.each.with_index do |row, index|
|
||||||
|
|
Loading…
Reference in New Issue