Problema com importação de dados em csv

Post Reply
fpmarcos
Znuny newbie
Posts: 5
Joined: 18 May 2012, 18:57
Znuny Version: 3.1.2
Real Name: Fábio
Company: Polícia Militar de Santa Catarina

Problema com importação de dados em csv

Post by fpmarcos »

Tenho uma planilha com o cadastro do patrimônio (aprox 8500 itens) do meu local de trabalho, porém, ao realizar importação em csv, não acusa nenhum erro e também não carrega como item de configuração.
Já alterei a classe para suportar a importação, mas, até agora nada certo.
Teria como ativar outra forma de importação, pois, no banco de dados não encontrei uma tabela para dar carga nesses registros.


Segue abaixo a classe que estou utilizando:

[
{
Key => 'nr',
Name => 'nr',
Searchable => 1,
Input => {
Type => 'Text',
Size => 50,
MaxLength => 100,
},
},

{
Key => 'Orgao',
Name => 'Órgão',
Searchable => 1,
Input => {
Type => 'Text',
Size => 50,
MaxLength => 100,
},
},

{
Key => 'PIM',
Name => 'PIM',
Searchable => 1,
Input => {
Type => 'Text',
Size => 50,
MaxLength => 100,
},
},


{
Key => 'CodMat',
Name => 'Cod Mat',
Searchable => 1,
Input => {
Type => 'Text',
Size => 50,
MaxLength => 100,
},
},

{
Key => 'DescricaoDoMaterial',
Name => 'Descrição do Material',
Searchable => 1,
Input => {
Type => 'Text',
Size => 250,
MaxLength => 100,
},
},


{
Key => 'GpClasse',
Name => 'Gp Classe',
Searchable => 1,
Input => {
Type => 'Text',
Size => 50,
MaxLength => 100,
},
},

{
Key => 'DescricaoDoGrupoClasse',
Name => 'Descrição do grupo classe',
Searchable => 1,
Input => {
Type => 'Text',
Size => 50,
MaxLength => 100,
},
},

{
Key => 'Tipo',
Name => 'Tipo',
Searchable => 1,
Input => {
Type => 'GeneralCatalog',
Class => 'ITSM::ConfigItem::Hardware::Type',
Translation => 1,
},
},

{
Key => 'DDMMAAAA',
Name => 'DDMMAAAA',
Searchable => 1,
Input => {
Type => 'Date',
},
},

{
Key => 'Valor',
Name => 'Valor',
Searchable => 1,
Input => {
Type => 'Text',
Size => 50,
MaxLength => 100,
},
},

{
Key => 'Qtd',
Name => 'Quantidade',
Searchable => 1,
Input => {
Type => 'Text',
Size => 50,
MaxLength => 100,
},
},

{
Key => 'NF',
Name => 'NF',
Searchable => 1,
Input => {
Type => 'Text',
Size => 50,
MaxLength => 100,
},
},


{
Key => 'Data',
Name => 'Data',
Searchable => 1,
Input => {
Type => 'Date',
},
},

{
Key => 'Estado',
Name => 'Estado',
Searchable => 1,
Input => {
Type => 'Text',
Size => 50,
MaxLength => 100,
},
},


{
Key => 'ContaContabil',
Name => 'Conta Contábil',
Searchable => 1,
Input => {
Type => 'Text',
Size => 50,
MaxLength => 100,
},
},


{
Key => 'DescricaoContaContabil',
Name => 'Descrição Conta Contábil',
Searchable => 1,
Input => {
Type => 'Text',
Size => 50,
MaxLength => 100,
},
},

{
Key => 'CC',
Name => 'CC',
Searchable => 1,
Input => {
Type => 'Text',
Size => 50,
MaxLength => 100,
},
},

{
Key => 'NomeDoCentroDeCusto',
Name => 'Nome do Centro de Custo',
Searchable => 1,
Input => {
Type => 'Text',
Size => 50,
MaxLength => 100,
},
},

{
Key => 'Fonte',
Name => 'Fonte',
Searchable => 1,
Input => {
Type => 'Text',
Size => 50,
MaxLength => 100,
},
},

{
Key => 'NomeDaFonteDeRecursos',
Name => 'Nome Da Fonte De Recursos',
Searchable => 1,
Input => {
Type => 'Text',
Size => 50,
MaxLength => 100,
},
},

{
Key => 'Marca',
Name => 'Marca',
Searchable => 1,
Input => {
Type => 'Text',
Size => 50,
MaxLength => 100,
},
},

{
Key => 'Modelo',
Name => 'Modelo',
Searchable => 1,
Input => {
Type => 'Text',
Size => 50,
MaxLength => 50,
},
},

{
Key => 'Serie',
Name => 'Série',
Searchable => 1,
Input => {
Type => 'Text',
Size => 50,
MaxLength => 100,
},
},

{
Key => 'Descricao',
Name => 'Descrição',
Searchable => 1,
Input => {
Type => 'TextArea',
},
},

{
Key => 'Fornecedor',
Name => 'Fornecedor',
Searchable => 1,
Input => {
Type => 'Text',
Size => 50,
MaxLength => 50,
},
},


{
Key => 'Proprietario',
Name => 'Proprietário',
Searchable => 1,
Input => {
Type => 'Customer',
},
},

{
Key => 'DataExpiracaoGarantia',
Name => 'Data de Expiração da Garantia',
Searchable => 1,
Input => {
Type => 'Date',
},
},
{
Key => 'DataInstalacao',
Name => 'Data Instalação',
Searchable => 1,
Input => {
Type => 'Date',
Required => 1,
},
CountMin => 0,
CountMax => 1,
CountDefault => 0,
},
{
Key => 'Nota',
Name => 'Nota',
Searchable => 1,
Input => {
Type => 'TextArea',
Required => 1,
},
CountMin => 0,
CountMax => 1,
CountDefault => 0,
},

];
tiagostifft
Znuny newbie
Posts: 2
Joined: 29 Nov 2012, 19:40
Znuny Version: OTRS 3.2
Real Name: Tiago Stifft
Company: Reborn Tecnologia

Re: Problema com importação de dados em csv

Post by tiagostifft »

Você pode fazer a importação por csv. É importante atentar para os campos do arquivo csv, tem que ser iguais, especialmente os campos que são caixas de seleção, o conteúdo tem que ser igual.

Por exemplo, na classe Computador o conteúdo do campo Estado de Implantação não existir na lista pré-definida vai dar erro.

Recentemente tive um problema semelhante, e ao verificar constatei que o campo Estado de Implantação no arquivo csv estava como Production e o no sistema era Produção. Alterei o arquivo CSV e importou legal.

Espero ter ajudo.

Abraço,

Tiago Stifft
www.reborntecnologia.com.br
fpmarcos
Znuny newbie
Posts: 5
Joined: 18 May 2012, 18:57
Znuny Version: 3.1.2
Real Name: Fábio
Company: Polícia Militar de Santa Catarina

Re: Problema com importação de dados em csv

Post by fpmarcos »

Obrigado Tiago, estou inserindo os campos um a um.

Foi a forma que encontrei.
Post Reply