Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tallty_import_export
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open-source
tallty_import_export
Commits
fac6e334
Commit
fac6e334
authored
May 14, 2022
by
liyijie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 更新支持xls格式
parent
3c1be135
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
2 deletions
+4
-2
excel.rb
lib/tallty_import_export/excel.rb
+1
-0
import.rb
lib/tallty_import_export/import.rb
+2
-1
version.rb
lib/tallty_import_export/version.rb
+1
-1
No files found.
lib/tallty_import_export/excel.rb
View file @
fac6e334
...
@@ -2,6 +2,7 @@ module TalltyImportExport
...
@@ -2,6 +2,7 @@ module TalltyImportExport
class
Excel
class
Excel
require
'redis-objects'
require
'redis-objects'
require
'roo'
require
'roo'
require
'roo-xls'
attr_reader
:uid
,
:cache
attr_reader
:uid
,
:cache
...
...
lib/tallty_import_export/import.rb
View file @
fac6e334
module
TalltyImportExport
module
TalltyImportExport
class
Import
class
Import
require
'roo'
require
'roo'
require
'roo-xls'
attr_reader
:klass
,
:context
,
:primary_keys
,
:associations
attr_reader
:klass
,
:context
,
:primary_keys
,
:associations
def
initialize
klass
def
initialize
klass
...
@@ -53,7 +54,7 @@ module TalltyImportExport
...
@@ -53,7 +54,7 @@ module TalltyImportExport
end
end
else
else
file_path
=
xlsx_file
.
is_a?
(
String
)
?
xlsx_file
:
xlsx_file
.
path
file_path
=
xlsx_file
.
is_a?
(
String
)
?
xlsx_file
:
xlsx_file
.
path
xlsx
=
::
Roo
::
Excelx
.
new
(
file_path
)
xlsx
=
::
Roo
::
Spreadsheet
.
open
(
file_path
,
extension:
File
.
extname
(
file_path
)
==
'.xls'
?
:
xls
:
:xlsx
)
xlsx
.
each_with_pagename
do
|
_sheetname
,
sheet
|
xlsx
.
each_with_pagename
do
|
_sheetname
,
sheet
|
sheet
.
each
(
**
@excel_hash
).
with_index
do
|
line_info
,
index
|
sheet
.
each
(
**
@excel_hash
).
with_index
do
|
line_info
,
index
|
next
if
index
==
0
next
if
index
==
0
...
...
lib/tallty_import_export/version.rb
View file @
fac6e334
module
TalltyImportExport
module
TalltyImportExport
VERSION
=
"1.
0.35
"
VERSION
=
"1.
1.1
"
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment