|
@@ -62,13 +62,14 @@ Dir["#{config_path}/*"].each do |path|
|
|
table.fields << field
|
|
table.fields << field
|
|
end
|
|
end
|
|
# 验证 Id 列
|
|
# 验证 Id 列
|
|
- next if field_id.nil?
|
|
|
|
table.id_field = field_id
|
|
table.id_field = field_id
|
|
# 处理条目形成引用表
|
|
# 处理条目形成引用表
|
|
while !csv.eof?
|
|
while !csv.eof?
|
|
line = csv.readline
|
|
line = csv.readline
|
|
next if field_id_name.nil?
|
|
next if field_id_name.nil?
|
|
- table.name2id[line[field_id_name.column_id]] = line[field_id.column_id].upcase
|
|
|
|
|
|
+ id = line[field_id.column_id]
|
|
|
|
+ next if id.nil? || id.empty?
|
|
|
|
+ table.name2id[line[field_id_name.column_id]] = id.upcase
|
|
end
|
|
end
|
|
# 回滚 csv 状态至表头读取后
|
|
# 回滚 csv 状态至表头读取后
|
|
csv.rewind
|
|
csv.rewind
|