-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
leona
authored and
leona
committed
May 2, 2023
1 parent
0cb7fde
commit 924005a
Showing
14 changed files
with
412 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17"> | ||
<attributes> | ||
<attribute name="module" value="true"/> | ||
</attributes> | ||
</classpathentry> | ||
<classpathentry kind="src" path="src"/> | ||
<classpathentry kind="output" path="bin"/> | ||
</classpath> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/bin/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>GerenciaDePatrimonio</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.eclipse.jdt.core.javabuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.eclipse.jdt.core.javanature</nature> | ||
</natures> | ||
</projectDescription> |
2 changes: 2 additions & 0 deletions
2
GerenciaDePatrimonio/.settings/org.eclipse.core.resources.prefs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
eclipse.preferences.version=1 | ||
encoding/<project>=UTF-8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
eclipse.preferences.version=1 | ||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled | ||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=17 | ||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve | ||
org.eclipse.jdt.core.compiler.compliance=17 | ||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate | ||
org.eclipse.jdt.core.compiler.debug.localVariable=generate | ||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate | ||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error | ||
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled | ||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error | ||
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning | ||
org.eclipse.jdt.core.compiler.release=enabled | ||
org.eclipse.jdt.core.compiler.source=17 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package modelo; | ||
public abstract class Bem{ | ||
|
||
private String nome; | ||
private String descricao; | ||
private String dataAquisicao; | ||
private int numeroSerie; | ||
|
||
public Bem(String nome, String descricao, int numeroSerie, String dataAquisicao) { | ||
this.nome= nome; | ||
this.descricao= descricao; | ||
this.dataAquisicao= dataAquisicao; | ||
this.numeroSerie= numeroSerie; | ||
} | ||
|
||
|
||
public int getNumeroSerie() { | ||
return numeroSerie; | ||
} | ||
public void setNumeroSerie(int numeroSerie) { | ||
this.numeroSerie = numeroSerie; | ||
} | ||
public String getNome() { | ||
return nome; | ||
} | ||
public void setNome(String nome) { | ||
this.nome = nome; | ||
} | ||
public String getDescricao() { | ||
return descricao; | ||
} | ||
public void setDescricao(String descricao) { | ||
this.descricao = descricao; | ||
} | ||
public String getDataAquisicao() { | ||
return dataAquisicao; | ||
} | ||
public void setDataAquisicao(String String) { | ||
this.dataAquisicao = String; | ||
} | ||
@Override | ||
public String toString() { | ||
return this.nome+" "+this.numeroSerie+" "+this.descricao+" "+this.dataAquisicao; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package modelo; | ||
|
||
public class Consumivel extends Bem { | ||
private int depreciacao; | ||
public Consumivel(String nome, String descricao, int numeroSerie, String dataAquisicao, int depreciacao) { | ||
super(nome, descricao, numeroSerie, dataAquisicao); | ||
this.depreciacao=depreciacao; | ||
} | ||
|
||
public int getDepreciacao() { | ||
return depreciacao; | ||
} | ||
public void setDepreciacao(int depreciacao) { | ||
this.depreciacao = depreciacao; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package modelo; | ||
|
||
public class Eletronico extends Bem { | ||
private int voltagem; | ||
private boolean necessitaTomada; | ||
public Eletronico(boolean necessitaTomada,int voltagem,String nome, String descricao, int numeroSerie, String dataAquisicao) { | ||
super(nome, descricao, numeroSerie, dataAquisicao); | ||
this.necessitaTomada=necessitaTomada; | ||
} | ||
|
||
public int getVoltagem() { | ||
return voltagem; | ||
} | ||
public void setVoltagem(int voltagem) { | ||
this.voltagem = voltagem; | ||
} | ||
public boolean isNecessitaTomada() { | ||
return necessitaTomada; | ||
} | ||
public void setNecessitaTomada(boolean necessitaTomada) { | ||
this.necessitaTomada = necessitaTomada; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
package modelo; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public class Filial { | ||
private String nome; | ||
private String endereco; | ||
private List<Funcionario> funcionarios; | ||
private List<Bem> bensFilial; | ||
|
||
public Filial(String nome, String endereco) { | ||
this.nome = nome; | ||
this.endereco = endereco; | ||
this.funcionarios = new ArrayList<>(); | ||
this.bensFilial= new ArrayList<>(); | ||
} | ||
|
||
public String getNome() { | ||
return nome; | ||
} | ||
|
||
public void setNome(String nome) { | ||
this.nome = nome; | ||
} | ||
|
||
public String getEndereco() { | ||
return endereco; | ||
} | ||
|
||
public void setEndereco(String endereco) { | ||
this.endereco = endereco; | ||
} | ||
|
||
public List<Funcionario> getFuncionarios() { | ||
return funcionarios; | ||
} | ||
|
||
public void setPatrimonios(List<Funcionario> funcionarios) { | ||
this.funcionarios = funcionarios; | ||
} | ||
|
||
public void listarPatrimonioFilial() { | ||
for(Bem bensFilial: bensFilial ) { | ||
System.out.println("Patrimonios da filial "+getNome()+": "+bensFilial.getNome()+"\n"); | ||
} | ||
} | ||
public void anexarFuncionarioFilial(Funcionario funcionario) { | ||
funcionarios.add(funcionario); | ||
} | ||
public void anexarBemFilial(Bem patrimonio) { | ||
bensFilial.add(patrimonio); | ||
} | ||
@Override | ||
public String toString() { | ||
return this.nome+" "+this.endereco+" "+this.funcionarios+" "+this.bensFilial; | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
package modelo; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
public class Funcionario{ | ||
private String nome; | ||
private String cpf; | ||
private String cargo; | ||
private String telefone; | ||
private List<Bem> patrimonios; | ||
|
||
public Funcionario(String nome, String cpf, String cargo, String telefone) { | ||
//super(nomeFilial, enderecoFilial); | ||
this.nome = nome; | ||
this.cpf = cpf; | ||
this.cargo = cargo; | ||
this.telefone = telefone; | ||
this.patrimonios = new ArrayList<>(); | ||
} | ||
|
||
public String getNome() { | ||
return nome; | ||
} | ||
|
||
public void setNome(String nome) { | ||
this.nome = nome; | ||
} | ||
|
||
public String getCpf() { | ||
return cpf; | ||
} | ||
|
||
public void setCpf(String cpf) { | ||
this.cpf = cpf; | ||
} | ||
|
||
public String getCargo() { | ||
return cargo; | ||
} | ||
|
||
public void setCargo(String cargo) { | ||
this.cargo = cargo; | ||
} | ||
|
||
public String getTelefone() { | ||
return telefone; | ||
} | ||
|
||
public void setTelefone(String telefone) { | ||
this.telefone = telefone; | ||
} | ||
public void anexarPatrimonioFuncionario(Bem patrimonio) { | ||
patrimonios.add(patrimonio); | ||
} | ||
public void listarBemFuncionario() { | ||
for(Bem patrimonios: patrimonios) { | ||
System.out.println("O patrimonio em posse do funcionario "+getNome() +" é "+ patrimonios.getNome()); | ||
} | ||
} | ||
@Override | ||
public String toString() { | ||
return this.nome+" "+this.cpf+" "+this.cargo+" "+this.telefone+" "+this.patrimonios; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package modelo; | ||
|
||
public class Imovel extends Bem { | ||
private int tamanhoTerreno; | ||
private int valor; | ||
private String endereco; | ||
|
||
public Imovel(String nome,int tamanhoTerreno,int valor,String endereco, String descricao, int numeroSerie, String dataAquisicao) { | ||
super(nome, descricao, numeroSerie, dataAquisicao); | ||
this.tamanhoTerreno=tamanhoTerreno; | ||
this.valor=valor; | ||
this.endereco=endereco; | ||
} | ||
|
||
public int getTamanhoTerreno() { | ||
return tamanhoTerreno; | ||
} | ||
public void setTamanhoTerreno(int tamanhoTerreno) { | ||
this.tamanhoTerreno = tamanhoTerreno; | ||
} | ||
public int getValor() { | ||
return valor; | ||
} | ||
public void setValor(int valor) { | ||
this.valor = valor; | ||
} | ||
public String getEndereco() { | ||
return endereco; | ||
} | ||
public void setEndereco(String endereco) { | ||
this.endereco = endereco; | ||
} | ||
|
||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
package modelo; | ||
|
||
public class Teste { | ||
|
||
public static void main(String[] args) { | ||
Filial filial1=new Filial(null, null); | ||
filial1.setNome("Bom Demais"); | ||
filial1.setEndereco("Brasilia"); | ||
|
||
Filial filial2=new Filial(null, null); | ||
filial2.setNome("Bom Demais"); | ||
filial2.setEndereco("Goiania"); | ||
|
||
Funcionario funcionario1=new Funcionario(null, null, null, null); | ||
funcionario1.setNome("Francisco"); | ||
funcionario1.setCpf("113348856"); | ||
funcionario1.setCargo("Gerente"); | ||
funcionario1.setTelefone("982350421"); | ||
|
||
Funcionario funcionario2=new Funcionario(null, null, null, null); | ||
funcionario2.setNome("Angelina"); | ||
funcionario2.setCpf("11399829"); | ||
funcionario2.setCargo("Contadora"); | ||
funcionario2.setTelefone("982392612"); | ||
|
||
|
||
Consumivel patrimonio1= new Consumivel(null, null, 0, null, 0); | ||
patrimonio1.setNome("Lapis"); | ||
patrimonio1.setDataAquisicao("01/04/2022"); | ||
patrimonio1.setNumeroSerie(334551); | ||
patrimonio1.setDescricao("Lapis azul"); | ||
patrimonio1.setDepreciacao(3); | ||
|
||
Eletronico patrimonio2= new Eletronico(false, 0, null, null, 0, null); | ||
patrimonio2.setNome("Computador"); | ||
patrimonio2.setDataAquisicao("07/08/2019"); | ||
patrimonio2.setNumeroSerie(334551); | ||
patrimonio2.setDescricao("Computador na sala de reuniao"); | ||
patrimonio2.setVoltagem(120); | ||
patrimonio2.setNecessitaTomada(true); | ||
|
||
Imovel patrimonio3= new Imovel(null, 0, 0, null, null, 0, null); | ||
patrimonio3.setNome("Edifico Larangeiras"); | ||
patrimonio3.setDataAquisicao("02/06/1997"); | ||
patrimonio3.setNumeroSerie(523836871); | ||
patrimonio3.setDescricao("Predio azul na esquina"); | ||
patrimonio3.setTamanhoTerreno(190); | ||
patrimonio3.setValor(1200000); | ||
|
||
Veiculo patrimonio4= new Veiculo(null, null, null, null, null, 0, null); | ||
patrimonio4.setNome("Carro de Serviço"); | ||
patrimonio4.setDataAquisicao("01/01/2023"); | ||
patrimonio4.setNumeroSerie(529836777); | ||
patrimonio4.setDescricao("Carro para entregas"); | ||
patrimonio4.setMarca("Ford"); | ||
patrimonio4.setModelo("Renegade"); | ||
patrimonio4.setPlaca("ABC-2861"); | ||
|
||
funcionario2.anexarPatrimonioFuncionario(patrimonio1); | ||
funcionario1.anexarPatrimonioFuncionario(patrimonio4); | ||
funcionario1.anexarPatrimonioFuncionario(patrimonio3); | ||
funcionario1.listarBemFuncionario(); | ||
filial2.anexarBemFilial(patrimonio4); | ||
filial2.anexarBemFilial(patrimonio3); | ||
filial2.anexarBemFilial(patrimonio2); | ||
filial1.anexarBemFilial(patrimonio1); | ||
filial2.anexarFuncionarioFilial(funcionario2); | ||
filial1.anexarFuncionarioFilial(funcionario1); | ||
filial2.listarPatrimonioFilial(); | ||
filial1.listarPatrimonioFilial(); | ||
System.out.print(funcionario1+"\n\n"); | ||
System.out.print(funcionario2+"\n\n"); | ||
System.out.print(filial1+"\n\n"); | ||
System.out.print(filial2+"\n\n"); | ||
System.out.print(patrimonio1+"\n\n"); | ||
System.out.print(patrimonio2+"\n\n"); | ||
System.out.print(patrimonio3+"\n\n"); | ||
System.out.print(patrimonio4+"\n\n"); | ||
|
||
} | ||
|
||
} |
Oops, something went wrong.