├── gerenciamento ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── src │ ├── main │ │ ├── resources │ │ │ ├── static │ │ │ │ ├── imagens │ │ │ │ │ ├── logo │ │ │ │ │ │ └── logo.png │ │ │ │ │ └── banner │ │ │ │ │ │ └── banner_teste.png │ │ │ │ └── css │ │ │ │ │ ├── universal.css │ │ │ │ │ ├── gerenciamento.css │ │ │ │ │ ├── lista.css │ │ │ │ │ ├── cadastro-oficina.css │ │ │ │ │ ├── cadastro-sala.css │ │ │ │ │ ├── cadastro-manutencao.css │ │ │ │ │ ├── cadastro-estoque.css │ │ │ │ │ ├── interna-funcionario.css │ │ │ │ │ ├── cadastro-patrimonio.css │ │ │ │ │ ├── header.css │ │ │ │ │ ├── edit.css │ │ │ │ │ ├── manutencoes.css │ │ │ │ │ ├── footer.css │ │ │ │ │ ├── cadastro-funcionario.css │ │ │ │ │ └── style-login.css │ │ │ ├── application.properties │ │ │ └── templates │ │ │ │ ├── fragmentos │ │ │ │ ├── header_deslogado.html │ │ │ │ ├── header_logado.html │ │ │ │ └── footer.html │ │ │ │ ├── interna │ │ │ │ └── interna-funcionario.html │ │ │ │ ├── crud │ │ │ │ ├── sala │ │ │ │ │ ├── edit-sala.html │ │ │ │ │ └── cadastro-sala.html │ │ │ │ ├── oficina │ │ │ │ │ ├── edit-oficina.html │ │ │ │ │ └── cadastro-oficina.html │ │ │ │ ├── estoque │ │ │ │ │ ├── cadastro-estoque.html │ │ │ │ │ └── edit-estoque.html │ │ │ │ └── patrimonio │ │ │ │ │ ├── edit-patrimonio.html │ │ │ │ │ └── cadastro-patrimonio.html │ │ │ │ ├── gerenciamento │ │ │ │ ├── gerenciamento-estoque.html │ │ │ │ ├── gerenciamento-patrimonio.html │ │ │ │ ├── gerenciamento-oficina.html │ │ │ │ └── gerenciamento-sala.html │ │ │ │ ├── cadastro │ │ │ │ ├── cadastro-manutencaoPatrimonio.html │ │ │ │ ├── cadastro-funcionario.html │ │ │ │ └── cadastro-manutencaoEstoque.html │ │ │ │ ├── index.html │ │ │ │ └── manutencoes │ │ │ │ └── manutencoes.html │ │ └── java │ │ │ └── com │ │ │ └── example │ │ │ └── gerenciamento │ │ │ ├── Repository │ │ │ ├── MovEstoqueRepository.java │ │ │ ├── EstoqueRepository.java │ │ │ ├── MovPatrimonioRepository.java │ │ │ ├── OficinaRepository.java │ │ │ ├── PatrimonioRepository.java │ │ │ ├── FuncionarioRepository.java │ │ │ └── SalaRepository.java │ │ │ ├── GerenciamentoApplication.java │ │ │ ├── Services │ │ │ ├── SalaService.java │ │ │ ├── OficinaService.java │ │ │ ├── EstoqueService.java │ │ │ ├── FuncionarioService.java │ │ │ ├── PatrimonioService.java │ │ │ ├── MovEstoqueService.java │ │ │ └── MovPatrimonioService.java │ │ │ ├── Model │ │ │ ├── Sala.java │ │ │ ├── Oficina.java │ │ │ ├── Funcionario.java │ │ │ ├── Estoque.java │ │ │ ├── Movimentacao_Estoque.java │ │ │ ├── Patrimonio.java │ │ │ └── Movimentacao_Patrimonio.java │ │ │ ├── Controller │ │ │ ├── IndexController.java │ │ │ ├── indexController.java │ │ │ ├── EstoqueController.java │ │ │ ├── PatrimonioController.java │ │ │ ├── OficinaController.java │ │ │ ├── SalaController.java │ │ │ └── FuncionarioController.java │ │ │ └── RestController │ │ │ ├── SalaRestController.java │ │ │ ├── OficinaRestController.java │ │ │ ├── EstoqueRestController.java │ │ │ ├── FuncionarioRestController.java │ │ │ ├── MovEstoqueRestController.java │ │ │ ├── MovPatrimonioRestController.java │ │ │ └── PatrimonioRestController.java │ └── test │ │ └── java │ │ └── com │ │ └── example │ │ └── gerenciamento │ │ └── GerenciamentoApplicationTests.java ├── anotacoes.txt ├── .gitignore ├── pom.xml ├── mvnw.cmd └── mvnw ├── Dockerfile └── .vscode └── launch.json /gerenciamento/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epicestudar/Gerenciamento_de_Estoque/HEAD/gerenciamento/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /gerenciamento/src/main/resources/static/imagens/logo/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epicestudar/Gerenciamento_de_Estoque/HEAD/gerenciamento/src/main/resources/static/imagens/logo/logo.png -------------------------------------------------------------------------------- /gerenciamento/src/main/resources/static/imagens/banner/banner_teste.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/epicestudar/Gerenciamento_de_Estoque/HEAD/gerenciamento/src/main/resources/static/imagens/banner/banner_teste.png -------------------------------------------------------------------------------- /gerenciamento/src/main/resources/static/css/universal.css: -------------------------------------------------------------------------------- 1 | * { 2 | padding: 0; 3 | margin: 0; 4 | box-sizing: border-box; 5 | list-style: none; 6 | text-decoration: none; 7 | font-family: "Poppins"; 8 | } 9 | 10 | body{ 11 | background: #e3e9f7; 12 | } -------------------------------------------------------------------------------- /gerenciamento/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.6/apache-maven-3.9.6-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar 3 | -------------------------------------------------------------------------------- /gerenciamento/src/test/java/com/example/gerenciamento/GerenciamentoApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.example.gerenciamento; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class GerenciamentoApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /gerenciamento/src/main/java/com/example/gerenciamento/Repository/MovEstoqueRepository.java: -------------------------------------------------------------------------------- 1 | package com.example.gerenciamento.Repository; 2 | 3 | import org.springframework.data.repository.CrudRepository; 4 | 5 | import com.example.gerenciamento.Model.Movimentacao_Estoque; 6 | 7 | public interface MovEstoqueRepository extends CrudRepository{ 8 | 9 | } 10 | -------------------------------------------------------------------------------- /gerenciamento/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.application.name=gerenciamento 2 | spring.jpa.database=POSTGRESQL 3 | spring.sql.init.platform=postgres 4 | spring.jpa.show-sql=true 5 | spring.jpa.hibernate.ddl-auto=update 6 | spring.datasource.url=jdbc:postgresql://localhost:5432/gerenciamento_senai 7 | spring.datasource.username=postgres 8 | spring.datasource.password=postgres -------------------------------------------------------------------------------- /gerenciamento/src/main/java/com/example/gerenciamento/Repository/EstoqueRepository.java: -------------------------------------------------------------------------------- 1 | package com.example.gerenciamento.Repository; 2 | 3 | import org.springframework.data.repository.CrudRepository; 4 | 5 | import com.example.gerenciamento.Model.Estoque; 6 | 7 | public interface EstoqueRepository extends CrudRepository{ 8 | Estoque findByIdEstoque(Long idEstoque); 9 | } 10 | -------------------------------------------------------------------------------- /gerenciamento/src/main/java/com/example/gerenciamento/Repository/MovPatrimonioRepository.java: -------------------------------------------------------------------------------- 1 | package com.example.gerenciamento.Repository; 2 | 3 | import org.springframework.data.repository.CrudRepository; 4 | 5 | import com.example.gerenciamento.Model.Movimentacao_Patrimonio; 6 | 7 | public interface MovPatrimonioRepository extends CrudRepository{ 8 | 9 | } 10 | -------------------------------------------------------------------------------- /gerenciamento/src/main/java/com/example/gerenciamento/Repository/OficinaRepository.java: -------------------------------------------------------------------------------- 1 | package com.example.gerenciamento.Repository; 2 | 3 | import org.springframework.data.repository.CrudRepository; 4 | 5 | import com.example.gerenciamento.Model.Oficina; 6 | 7 | 8 | public interface OficinaRepository extends CrudRepository{ 9 | Oficina findByIdOficina(Long idOficina); 10 | } 11 | -------------------------------------------------------------------------------- /gerenciamento/src/main/java/com/example/gerenciamento/Repository/PatrimonioRepository.java: -------------------------------------------------------------------------------- 1 | package com.example.gerenciamento.Repository; 2 | import org.springframework.data.repository.CrudRepository; 3 | 4 | import com.example.gerenciamento.Model.Patrimonio; 5 | 6 | public interface PatrimonioRepository extends CrudRepository{ 7 | Patrimonio findByIdPatrimonio(Long idPatrimonio); 8 | } 9 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | # Use uma imagem base do OpenJDK 2 | FROM openjdk:11-jre-slim 3 | 4 | # Defina o diretório de trabalho dentro do contêiner 5 | WORKDIR /app 6 | 7 | # Copie o arquivo JAR da sua aplicação para o contêiner 8 | COPY target/gerenciamento-3.9.7.jar /app/gerenciamento-3.9.7.jar 9 | 10 | # Comando para executar a aplicação quando o contêiner for iniciado 11 | CMD ["java", "-jar", "gerenciamento-3.9.7.jar"] -------------------------------------------------------------------------------- /gerenciamento/src/main/java/com/example/gerenciamento/Repository/FuncionarioRepository.java: -------------------------------------------------------------------------------- 1 | package com.example.gerenciamento.Repository; 2 | 3 | import org.springframework.data.repository.CrudRepository; 4 | 5 | import com.example.gerenciamento.Model.Funcionario; 6 | 7 | 8 | public interface FuncionarioRepository extends CrudRepository{ 9 | Funcionario findByCpf(String cpf); 10 | } 11 | -------------------------------------------------------------------------------- /gerenciamento/anotacoes.txt: -------------------------------------------------------------------------------- 1 | O QUE FALTA PARA O PROJETO: 2 | 3 | 1 - Fazer os Controladores para o Front - CHECK 4 | 2 - Fazer Formulário de Cadastro de Funcionário - FEITO 5 | 3 - Fazer página Home -EM PROGRESSO 6 | 4 - Fazer páginas de salas e oficinas - Vinicius - EM PROGRESSO 7 | 5 - Fazer páginas de manutenções (entradas e saídas de patrimonios e consumíveis) - CHECK 8 | 6 - Fazer formulário de Oficina e Sala - Paiva - EM PROGRESSO -------------------------------------------------------------------------------- /gerenciamento/src/main/java/com/example/gerenciamento/GerenciamentoApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.gerenciamento; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class GerenciamentoApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(GerenciamentoApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /gerenciamento/src/main/java/com/example/gerenciamento/Repository/SalaRepository.java: -------------------------------------------------------------------------------- 1 | package com.example.gerenciamento.Repository; 2 | 3 | import java.util.Optional; 4 | 5 | import org.springframework.data.repository.CrudRepository; 6 | 7 | import com.example.gerenciamento.Model.Sala; 8 | 9 | 10 | public interface SalaRepository extends CrudRepository { 11 | Optional findBynSala(String nSala); 12 | void deleteBynSala(String nSala); 13 | } 14 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "configurations": [ 3 | { 4 | "type": "java", 5 | "name": "Spring Boot-GerenciamentoApplication", 6 | "request": "launch", 7 | "cwd": "${workspaceFolder}", 8 | "mainClass": "com.example.gerenciamento.GerenciamentoApplication", 9 | "projectName": "gerenciamento", 10 | "args": "", 11 | "envFile": "${workspaceFolder}/.env" 12 | } 13 | ] 14 | } -------------------------------------------------------------------------------- /gerenciamento/src/main/resources/static/css/gerenciamento.css: -------------------------------------------------------------------------------- 1 | .card { 2 | border: 1px solid #dee2e6; 3 | border-radius: 10px; 4 | box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); 5 | transition: transform 0.3s ease; 6 | } 7 | 8 | .card:hover { 9 | transform: scale(1.05); 10 | } 11 | 12 | .card-body { 13 | text-align: center; 14 | } 15 | 16 | .card-title { 17 | font-size: 1.5rem; 18 | margin-bottom: 1rem; 19 | } 20 | 21 | .btn { 22 | margin: 0.25rem 0; 23 | width: 100%; 24 | } -------------------------------------------------------------------------------- /gerenciamento/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/**/target/ 5 | !**/src/test/**/target/ 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | !**/src/main/**/build/ 30 | !**/src/test/**/build/ 31 | 32 | ### VS Code ### 33 | .vscode/ 34 | -------------------------------------------------------------------------------- /gerenciamento/src/main/resources/static/css/lista.css: -------------------------------------------------------------------------------- 1 | .container { 2 | width: 80%; 3 | margin: 0 auto; 4 | padding: 20px; 5 | background-color: #ffffff; 6 | box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); 7 | border-radius: 5px; 8 | } 9 | 10 | h1, 11 | h2 { 12 | text-align: center; 13 | color: #333; 14 | } 15 | 16 | table { 17 | width: 100%; 18 | border-collapse: collapse; 19 | margin-bottom: 20px; 20 | } 21 | 22 | table th, 23 | table td { 24 | padding: 10px; 25 | text-align: left; 26 | } 27 | 28 | table thead { 29 | background-color: #ff0000; 30 | color: white; 31 | } 32 | 33 | table tbody tr:nth-child(even) { 34 | background-color: #f2f2f2; 35 | } 36 | 37 | table tbody tr:hover { 38 | background-color: #ddd; 39 | } 40 | 41 | th, 42 | td { 43 | border-bottom: 1px solid #ddd; 44 | } 45 | 46 | th { 47 | cursor: pointer; 48 | } -------------------------------------------------------------------------------- /gerenciamento/src/main/java/com/example/gerenciamento/Services/SalaService.java: -------------------------------------------------------------------------------- 1 | package com.example.gerenciamento.Services; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Service; 5 | 6 | import com.example.gerenciamento.Model.Sala; 7 | import com.example.gerenciamento.Repository.SalaRepository; 8 | 9 | import java.util.Optional; 10 | 11 | @Service 12 | public class SalaService { 13 | 14 | @Autowired 15 | private SalaRepository salaRepository; 16 | 17 | public Iterable findAll() { 18 | return salaRepository.findAll(); 19 | } 20 | 21 | public Optional findByNSala(String nSala) { 22 | return salaRepository.findBynSala(nSala); 23 | } 24 | 25 | public Sala save(Sala sala) { 26 | return salaRepository.save(sala); 27 | } 28 | 29 | public void deleteByNSala(String nSala) { 30 | salaRepository.deleteBynSala(nSala); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /gerenciamento/src/main/resources/templates/fragmentos/header_deslogado.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Navbar 8 | 9 | 10 | 11 |
12 | 15 | 16 | 26 | 31 |
32 | 33 | 34 | -------------------------------------------------------------------------------- /gerenciamento/src/main/java/com/example/gerenciamento/Services/OficinaService.java: -------------------------------------------------------------------------------- 1 | package com.example.gerenciamento.Services; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Service; 5 | 6 | import com.example.gerenciamento.Model.Oficina; 7 | import com.example.gerenciamento.Repository.OficinaRepository; 8 | 9 | import java.util.Optional; 10 | 11 | @Service 12 | public class OficinaService { 13 | 14 | @Autowired 15 | private OficinaRepository oficinaRepository; 16 | 17 | public Iterable findAll() { 18 | return oficinaRepository.findAll(); 19 | } 20 | 21 | public Optional findById(Long idOficina) { 22 | return oficinaRepository.findById(idOficina); 23 | } 24 | 25 | public Oficina save(Oficina oficina) { 26 | return oficinaRepository.save(oficina); 27 | } 28 | 29 | public void deleteById(Long idOficina) { 30 | oficinaRepository.deleteById(idOficina); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /gerenciamento/src/main/java/com/example/gerenciamento/Services/EstoqueService.java: -------------------------------------------------------------------------------- 1 | package com.example.gerenciamento.Services; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Service; 5 | 6 | import com.example.gerenciamento.Model.Estoque; 7 | import com.example.gerenciamento.Repository.EstoqueRepository; 8 | 9 | import java.util.Optional; 10 | 11 | @Service 12 | public class EstoqueService { 13 | 14 | @Autowired 15 | private EstoqueRepository estoqueRepository; 16 | 17 | public Iterable findAll() { 18 | return estoqueRepository.findAll(); 19 | } 20 | 21 | public Optional findById(Long idEstoque) { 22 | return estoqueRepository.findById(idEstoque); 23 | } 24 | 25 | public Estoque save(Estoque estoque) { 26 | return estoqueRepository.save(estoque); 27 | } 28 | 29 | public void deleteById(Long idEstoque) { 30 | estoqueRepository.deleteById(idEstoque); 31 | } 32 | } 33 | 34 | -------------------------------------------------------------------------------- /gerenciamento/src/main/java/com/example/gerenciamento/Services/FuncionarioService.java: -------------------------------------------------------------------------------- 1 | package com.example.gerenciamento.Services; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Service; 5 | 6 | import com.example.gerenciamento.Model.Funcionario; 7 | import com.example.gerenciamento.Repository.FuncionarioRepository; 8 | 9 | import java.util.Optional; 10 | 11 | @Service 12 | public class FuncionarioService { 13 | 14 | @Autowired 15 | private FuncionarioRepository funcionarioRepository; 16 | 17 | public Iterable findAll() { 18 | return funcionarioRepository.findAll(); 19 | } 20 | 21 | public Optional findById(String cpf) { 22 | return funcionarioRepository.findById(cpf); 23 | } 24 | 25 | public Funcionario save(Funcionario funcionario) { 26 | return funcionarioRepository.save(funcionario); 27 | } 28 | 29 | public void deleteById(String cpf) { 30 | funcionarioRepository.deleteById(cpf); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /gerenciamento/src/main/resources/static/css/cadastro-oficina.css: -------------------------------------------------------------------------------- 1 | .container { 2 | max-width: 600px; 3 | margin: 0 auto; 4 | margin-top: 12vh; 5 | padding: 20px; 6 | border: 1px solid #ccc; 7 | border-radius: 20px; 8 | background: #dd5e5e; 9 | } 10 | 11 | h2 { 12 | text-align: center; 13 | margin-bottom: 20px; 14 | } 15 | 16 | .form-group { 17 | margin-bottom: 15px; 18 | } 19 | 20 | label { 21 | display: block; 22 | margin-bottom: 5px; 23 | font-weight: bold; 24 | } 25 | 26 | input[type="text"], 27 | button[type="submit"] { 28 | width: 100%; 29 | padding: 10px; 30 | border: 1px solid #ccc; 31 | border-radius: 5px; 32 | box-sizing: border-box; 33 | } 34 | 35 | button[type="submit"] { 36 | background-color: #ff0000; 37 | color: white; 38 | border: none; 39 | cursor: pointer; 40 | transition: 0.3s; 41 | } 42 | 43 | button[type="submit"]:hover { 44 | background-color: #be1818; 45 | } 46 | 47 | .error-message { 48 | color: red; 49 | text-align: center; 50 | margin-bottom: 20px; 51 | } 52 | -------------------------------------------------------------------------------- /gerenciamento/src/main/resources/static/css/cadastro-sala.css: -------------------------------------------------------------------------------- 1 | .container { 2 | max-width: 600px; 3 | margin: 0 auto; 4 | margin-top: 12vh; 5 | padding: 20px; 6 | border: 1px solid #ccc; 7 | border-radius: 20px; 8 | background: #dd5e5e; 9 | } 10 | 11 | h2 { 12 | text-align: center; 13 | margin-bottom: 20px; 14 | } 15 | 16 | .form-group { 17 | margin-bottom: 15px; 18 | } 19 | 20 | label { 21 | display: block; 22 | margin-bottom: 5px; 23 | font-weight: bold; 24 | } 25 | 26 | input[type="text"], 27 | button[type="submit"] { 28 | width: 100%; 29 | padding: 10px; 30 | border: 1px solid #ccc; 31 | border-radius: 5px; 32 | box-sizing: border-box; 33 | } 34 | 35 | button[type="submit"] { 36 | background-color: #ff0000; 37 | color: white; 38 | border: none; 39 | cursor: pointer; 40 | transition: 0.3s; 41 | } 42 | 43 | button[type="submit"]:hover { 44 | background-color: #be1818; 45 | } 46 | 47 | .error-message { 48 | color: red; 49 | text-align: center; 50 | margin-bottom: 20px; 51 | } 52 | -------------------------------------------------------------------------------- /gerenciamento/src/main/resources/static/css/cadastro-manutencao.css: -------------------------------------------------------------------------------- 1 | .container { 2 | max-width: 600px; 3 | margin: 0 auto; 4 | margin-top: 12vh; 5 | padding: 20px; 6 | border: 1px solid #ccc; 7 | border-radius: 20px; 8 | background: #dd5e5e; 9 | } 10 | 11 | h2 { 12 | text-align: center; 13 | margin-bottom: 20px; 14 | } 15 | 16 | .form-group { 17 | margin-bottom: 15px; 18 | } 19 | 20 | label { 21 | display: block; 22 | margin-bottom: 5px; 23 | font-weight: bold; 24 | } 25 | 26 | input[type="text"], 27 | button[type="submit"] { 28 | width: 100%; 29 | padding: 10px; 30 | border: 1px solid #ccc; 31 | border-radius: 5px; 32 | box-sizing: border-box; 33 | } 34 | 35 | button[type="submit"] { 36 | background-color: #ff0000; 37 | color: white; 38 | border: none; 39 | cursor: pointer; 40 | transition: 0.3s; 41 | } 42 | 43 | button[type="submit"]:hover { 44 | background-color: #be1818; 45 | } 46 | 47 | .error-message { 48 | color: red; 49 | text-align: center; 50 | margin-bottom: 20px; 51 | } 52 | -------------------------------------------------------------------------------- /gerenciamento/src/main/java/com/example/gerenciamento/Services/PatrimonioService.java: -------------------------------------------------------------------------------- 1 | package com.example.gerenciamento.Services; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Service; 5 | 6 | import com.example.gerenciamento.Model.Patrimonio; 7 | import com.example.gerenciamento.Repository.PatrimonioRepository; 8 | 9 | import java.util.Optional; 10 | 11 | @Service 12 | public class PatrimonioService { 13 | 14 | @Autowired 15 | private PatrimonioRepository patrimonioRepository; 16 | 17 | public Iterable findAll() { 18 | return patrimonioRepository.findAll(); 19 | } 20 | 21 | public Optional findByIdPatrimonio(Long idPatrimonio) { 22 | return patrimonioRepository.findById(idPatrimonio); 23 | } 24 | 25 | public Patrimonio save(Patrimonio patrimonio) { 26 | return patrimonioRepository.save(patrimonio); 27 | } 28 | 29 | public void deleteByIdPatrimonio(Long idPatrimonio) { 30 | patrimonioRepository.deleteById(idPatrimonio); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /gerenciamento/src/main/resources/static/css/cadastro-estoque.css: -------------------------------------------------------------------------------- 1 | .container { 2 | max-width: 600px; 3 | margin: 0 auto; 4 | margin-top: 2vh; 5 | padding: 20px; 6 | background: #dd5e5e; 7 | border-radius: 8px; 8 | box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); 9 | margin-top: 10%; 10 | } 11 | 12 | h2 { 13 | text-align: center; 14 | margin-bottom: 20px; 15 | } 16 | 17 | .form-group { 18 | margin-bottom: 15px; 19 | } 20 | 21 | .form-group label { 22 | display: block; 23 | margin-bottom: 5px; 24 | font-weight: bold; 25 | } 26 | 27 | .form-group input[type="text"], 28 | .form-group input[type="number"] { 29 | width: 100%; 30 | padding: 8px; 31 | border: 1px solid #ccc; 32 | border-radius: 4px; 33 | } 34 | 35 | .form-group button { 36 | display: block; 37 | width: 100%; 38 | padding: 10px; 39 | background-color: #ff0000; 40 | color: white; 41 | border: none; 42 | border-radius: 4px; 43 | cursor: pointer; 44 | font-size: 16px; 45 | transition: 0.3s; 46 | } 47 | 48 | .form-group button:hover { 49 | background-color: #ca3e3e; 50 | } 51 | -------------------------------------------------------------------------------- /gerenciamento/src/main/java/com/example/gerenciamento/Services/MovEstoqueService.java: -------------------------------------------------------------------------------- 1 | package com.example.gerenciamento.Services; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Service; 5 | 6 | import com.example.gerenciamento.Model.Movimentacao_Estoque; 7 | import com.example.gerenciamento.Repository.MovEstoqueRepository; 8 | 9 | import java.util.Optional; 10 | 11 | @Service 12 | public class MovEstoqueService { 13 | 14 | @Autowired 15 | private MovEstoqueRepository movEstoqueRepository; 16 | 17 | public Iterable findAll() { 18 | return movEstoqueRepository.findAll(); 19 | } 20 | 21 | public Optional findById(Long idMovimentacaoEstoque) { 22 | return movEstoqueRepository.findById(idMovimentacaoEstoque); 23 | } 24 | 25 | public Movimentacao_Estoque save(Movimentacao_Estoque movimentacao_Estoque) { 26 | return movEstoqueRepository.save(movimentacao_Estoque); 27 | } 28 | 29 | public void deleteById(Long idMovimentacaoEstoque) { 30 | movEstoqueRepository.deleteById(idMovimentacaoEstoque); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /gerenciamento/src/main/java/com/example/gerenciamento/Services/MovPatrimonioService.java: -------------------------------------------------------------------------------- 1 | package com.example.gerenciamento.Services; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Service; 5 | 6 | import com.example.gerenciamento.Model.Movimentacao_Patrimonio; 7 | import com.example.gerenciamento.Repository.MovPatrimonioRepository; 8 | 9 | import java.util.Optional; 10 | 11 | @Service 12 | public class MovPatrimonioService { 13 | 14 | @Autowired 15 | private MovPatrimonioRepository movPatrimonioRepository; 16 | 17 | public Iterable findAll() { 18 | return movPatrimonioRepository.findAll(); 19 | } 20 | 21 | public Optional findById(Long idMovimentacaoPatrimonio) { 22 | return movPatrimonioRepository.findById(idMovimentacaoPatrimonio); 23 | } 24 | 25 | public Movimentacao_Patrimonio save(Movimentacao_Patrimonio movimentacao_Patrimonio) { 26 | return movPatrimonioRepository.save(movimentacao_Patrimonio); 27 | } 28 | 29 | public void deleteById(Long idMovimentacaoPatrimonio) { 30 | movPatrimonioRepository.deleteById(idMovimentacaoPatrimonio); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /gerenciamento/src/main/resources/static/css/interna-funcionario.css: -------------------------------------------------------------------------------- 1 | @import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap'); 2 | .banner{ 3 | margin-top: 10%; 4 | display: flex; 5 | justify-content: center; 6 | align-items: center; 7 | } 8 | 9 | .banner img{ 10 | width: 800px; 11 | } 12 | .title-cadastro{ 13 | margin-top: 10%; 14 | margin-left: 5%; 15 | font-family: "Poppins", sans-serif; 16 | font-weight: 500; 17 | } 18 | .cadastro-sala{ 19 | margin-top: 5%; 20 | display: flex; 21 | justify-content: center; 22 | align-items: center; 23 | } 24 | .cadastro-sala button { 25 | width: 260px; 26 | display: inline-block; 27 | padding: 10px 20px; 28 | margin: 20px; 29 | background-color: #f50e0e; 30 | color: #fff; 31 | border: none; 32 | border-radius: 5px; 33 | cursor: pointer; 34 | text-decoration: none; 35 | transition: background-color 0.3s; 36 | } 37 | 38 | .cadastro-sala button:hover { 39 | background-color: #e03636; 40 | } 41 | 42 | /* Estilos para os links dentro dos botões */ 43 | .cadastro-sala button a { 44 | color: inherit; 45 | text-decoration: none; 46 | } -------------------------------------------------------------------------------- /gerenciamento/src/main/java/com/example/gerenciamento/Model/Sala.java: -------------------------------------------------------------------------------- 1 | package com.example.gerenciamento.Model; 2 | 3 | import java.io.Serializable; 4 | import jakarta.persistence.Entity; 5 | import jakarta.persistence.Id; 6 | import jakarta.persistence.JoinColumn; 7 | import jakarta.persistence.ManyToOne; 8 | import jakarta.persistence.Table; 9 | 10 | @Table(name = "salas") 11 | @Entity 12 | public class Sala implements Serializable { 13 | @Id 14 | private String nSala; 15 | 16 | @ManyToOne 17 | @JoinColumn(name = "cpf", referencedColumnName = "cpf", nullable = false) 18 | private Funcionario funcionario; 19 | 20 | private String categoriaSala; 21 | 22 | public String getnSala() { 23 | return nSala; 24 | } 25 | 26 | public void setnSala(String nSala) { 27 | this.nSala = nSala; 28 | } 29 | 30 | 31 | 32 | public String getCategoriaSala() { 33 | return categoriaSala; 34 | } 35 | 36 | public void setCategoriaSala(String categoriaSala) { 37 | this.categoriaSala = categoriaSala; 38 | } 39 | 40 | public Funcionario getFuncionario() { 41 | return funcionario; 42 | } 43 | 44 | public void setFuncionario(Funcionario funcionario) { 45 | this.funcionario = funcionario; 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /gerenciamento/src/main/java/com/example/gerenciamento/Controller/IndexController.java: -------------------------------------------------------------------------------- 1 | package com.example.gerenciamento.Controller; 2 | 3 | import org.springframework.stereotype.Controller; 4 | import org.springframework.web.bind.annotation.GetMapping; 5 | import org.springframework.web.bind.annotation.RequestParam; 6 | 7 | 8 | @Controller 9 | public class IndexController { 10 | @GetMapping("/") 11 | public String acessoHomePage() { 12 | return "index"; 13 | } 14 | 15 | // @GetMapping("/patrimonio") 16 | // public String acessoPatrimonio() { 17 | // return "patrimonio"; 18 | // } 19 | @GetMapping("/login") 20 | public String acessoLoginFuncionario() { 21 | return "login/login-funcionario"; 22 | } 23 | 24 | @GetMapping("/cadastro-funcionario") 25 | public String acessoCadastroFuncionario() { 26 | return "cadastro/cadastro-funcionario"; 27 | } 28 | 29 | @GetMapping("/manutencoes") 30 | public String acessoManutencoes() { 31 | return "manutencoes/manutencoes"; 32 | } 33 | 34 | @GetMapping("/cadastro-estoque") 35 | public String acessoCadEstoque() { 36 | return "crud/estoque/cadastro-estoque"; 37 | } 38 | 39 | @GetMapping("/cadastro-patrimonio") 40 | public String acessoCadPatrimonio() { 41 | return "crud/patrimonio/cadastro-patrimonio"; 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /gerenciamento/src/main/resources/static/css/cadastro-patrimonio.css: -------------------------------------------------------------------------------- 1 | .container { 2 | max-width: 600px; 3 | margin: 0 auto; 4 | margin-top: 2vh; 5 | padding: 20px; 6 | background: #dd5e5e; 7 | border-radius: 8px; 8 | box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); 9 | margin-top: 10%; 10 | } 11 | 12 | h2 { 13 | text-align: center; 14 | margin-bottom: 20px; 15 | } 16 | 17 | .form-group { 18 | margin-bottom: 15px; 19 | } 20 | 21 | .form-group input[type="text"], 22 | .form-group input[type="number"] { 23 | width: 100%; 24 | padding: 8px; 25 | border: 1px solid #ccc; 26 | border-radius: 4px; 27 | } 28 | 29 | .form-group div ul { 30 | list-style-type: none; 31 | padding: 0; 32 | } 33 | 34 | .form-group div ul li { 35 | margin-bottom: 5px; 36 | } 37 | 38 | .form-group button { 39 | display: block; 40 | width: 100%; 41 | padding: 10px; 42 | background-color: #ff0000; 43 | color: white; 44 | border: none; 45 | border-radius: 4px; 46 | cursor: pointer; 47 | font-size: 16px; 48 | transition: 0.3s; 49 | } 50 | 51 | .form-group button:hover { 52 | background-color: #ca3e3e; 53 | } 54 | 55 | .form-group select { 56 | width: 100%; 57 | padding: 10px; 58 | font-size: 16px; 59 | border-radius: 4px; 60 | border: 1px solid #ccc; 61 | } 62 | 63 | .form-group label { 64 | display: block; 65 | font-weight: bold; 66 | margin-bottom: 5px; 67 | } -------------------------------------------------------------------------------- /gerenciamento/src/main/java/com/example/gerenciamento/Model/Oficina.java: -------------------------------------------------------------------------------- 1 | package com.example.gerenciamento.Model; 2 | 3 | import java.io.Serializable; 4 | 5 | import jakarta.persistence.Column; 6 | import jakarta.persistence.Entity; 7 | import jakarta.persistence.GeneratedValue; 8 | import jakarta.persistence.GenerationType; 9 | import jakarta.persistence.Id; 10 | import jakarta.persistence.JoinColumn; 11 | import jakarta.persistence.ManyToOne; 12 | import jakarta.persistence.Table; 13 | 14 | @Table(name = "oficinas") 15 | @Entity 16 | public class Oficina implements Serializable { 17 | @Id 18 | @GeneratedValue(strategy = GenerationType.IDENTITY) 19 | private Long idOficina; 20 | 21 | @ManyToOne 22 | @JoinColumn(name = "cpf", referencedColumnName = "cpf", nullable = false) 23 | private Funcionario funcionario; 24 | 25 | 26 | @Column(length = 100) 27 | private String nomeOficina; 28 | 29 | public Long getIdOficina() { 30 | return idOficina; 31 | } 32 | 33 | 34 | 35 | public void setIdOficina(Long idOficina) { 36 | this.idOficina = idOficina; 37 | } 38 | 39 | 40 | 41 | public Funcionario getFuncionario() { 42 | return funcionario; 43 | } 44 | 45 | 46 | 47 | public void setFuncionario(Funcionario funcionario) { 48 | this.funcionario = funcionario; 49 | } 50 | 51 | 52 | 53 | public String getNomeOficina() { 54 | return nomeOficina; 55 | } 56 | 57 | public void setNomeOficina(String nomeOficina) { 58 | this.nomeOficina = nomeOficina; 59 | } 60 | 61 | 62 | 63 | } 64 | -------------------------------------------------------------------------------- /gerenciamento/src/main/java/com/example/gerenciamento/Model/Funcionario.java: -------------------------------------------------------------------------------- 1 | package com.example.gerenciamento.Model; 2 | 3 | import java.io.Serializable; 4 | import jakarta.persistence.Column; 5 | import jakarta.persistence.Entity; 6 | import jakarta.persistence.Id; 7 | import jakarta.persistence.Table; 8 | 9 | @Table(name = "funcionarios") 10 | @Entity 11 | public class Funcionario implements Serializable { 12 | public Funcionario() {} 13 | @Id 14 | private String cpf; 15 | 16 | @Column(length = 200) 17 | private String nomeFuncionario; 18 | 19 | @Column(length = 100) 20 | private String cargo; 21 | 22 | @Column(length = 100) 23 | private String email; 24 | 25 | @Column(length = 30) 26 | private String senha; 27 | 28 | public String getEmail() { 29 | return email; 30 | } 31 | 32 | public void setEmail(String email) { 33 | this.email = email; 34 | } 35 | 36 | public String getSenha() { 37 | return senha; 38 | } 39 | 40 | public void setSenha(String senha) { 41 | this.senha = senha; 42 | } 43 | 44 | public String getCpf() { 45 | return cpf; 46 | } 47 | 48 | public void setCpf(String cpf) { 49 | this.cpf = cpf; 50 | } 51 | 52 | public String getNomeFuncionario() { 53 | return nomeFuncionario; 54 | } 55 | 56 | public void setNomeFuncionario(String nomeFuncionario) { 57 | this.nomeFuncionario = nomeFuncionario; 58 | } 59 | 60 | public String getCargo() { 61 | return cargo; 62 | } 63 | 64 | public void setCargo(String cargo) { 65 | this.cargo = cargo; 66 | } 67 | 68 | } 69 | -------------------------------------------------------------------------------- /gerenciamento/src/main/resources/templates/fragmentos/header_logado.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Navbar com usuário logado 8 | 9 | 10 | 11 |
12 | 15 | 16 | 44 | 49 |
50 | 51 | 52 | -------------------------------------------------------------------------------- /gerenciamento/src/main/resources/templates/interna/interna-funcionario.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Página interna do funcionario 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 22 |
23 |

Registre salas e oficinas novas:

24 |
25 | 31 |
32 | 33 | -------------------------------------------------------------------------------- /gerenciamento/src/main/java/com/example/gerenciamento/Model/Estoque.java: -------------------------------------------------------------------------------- 1 | package com.example.gerenciamento.Model; 2 | 3 | import java.io.Serializable; 4 | 5 | import jakarta.persistence.Column; 6 | import jakarta.persistence.Entity; 7 | import jakarta.persistence.GeneratedValue; 8 | import jakarta.persistence.GenerationType; 9 | import jakarta.persistence.Id; 10 | import jakarta.persistence.Table; 11 | 12 | @Table(name = "estoque") 13 | @Entity 14 | public class Estoque implements Serializable { 15 | @Id 16 | @GeneratedValue(strategy = GenerationType.IDENTITY) 17 | private Long idEstoque; 18 | 19 | 20 | @Column(length = 200) 21 | private String nome; 22 | 23 | 24 | @Column(length = 200) 25 | private String descricao; 26 | 27 | 28 | @Column(length = 50) 29 | private String categoria; 30 | 31 | 32 | private int quantidade; 33 | 34 | public Long getIdEstoque() { 35 | return idEstoque; 36 | } 37 | 38 | public void setIdEstoque(Long idEstoque) { 39 | this.idEstoque = idEstoque; 40 | } 41 | 42 | public String getNome() { 43 | return nome; 44 | } 45 | 46 | public void setNome(String nome) { 47 | this.nome = nome; 48 | } 49 | 50 | public String getDescricao() { 51 | return descricao; 52 | } 53 | 54 | public void setDescricao(String descricao) { 55 | this.descricao = descricao; 56 | } 57 | 58 | public String getCategoria() { 59 | return categoria; 60 | } 61 | 62 | public void setCategoria(String categoria) { 63 | this.categoria = categoria; 64 | } 65 | 66 | public int getQuantidade() { 67 | return quantidade; 68 | } 69 | 70 | public void setQuantidade(int quantidade) { 71 | this.quantidade = quantidade; 72 | } 73 | } 74 | 75 | -------------------------------------------------------------------------------- /gerenciamento/src/main/java/com/example/gerenciamento/Controller/indexController.java: -------------------------------------------------------------------------------- 1 | package com.example.gerenciamento.Controller; 2 | 3 | import org.springframework.stereotype.Controller; 4 | import org.springframework.web.bind.annotation.GetMapping; 5 | 6 | 7 | @Controller 8 | public class IndexController { 9 | @GetMapping("/") 10 | public String acessoHomePage() { 11 | return "index"; 12 | } 13 | 14 | // @GetMapping("/patrimonio") 15 | // public String acessoPatrimonio() { 16 | // return "patrimonio"; 17 | // } 18 | 19 | 20 | @GetMapping("/cadastro-funcionario") 21 | public String acessoCadastroFuncionario() { 22 | return "cadastro/cadastro-funcionario"; 23 | } 24 | 25 | @GetMapping("/cadastro-manutencaoEstoque") 26 | public String acessoCadastroManutencaoEstoque() { 27 | return "cadastro/cadastro-manutencaoEstoque"; 28 | } 29 | 30 | @GetMapping("/cadastro-manutencaoPatrimonio") 31 | public String acessoCadastroManutencaoPatrimonio() { 32 | return "cadastro/cadastro-manutencaoPatrimonio"; 33 | } 34 | 35 | @GetMapping("/manutencoes") 36 | public String acessoManutencoes() { 37 | return "manutencoes/manutencoes"; 38 | } 39 | 40 | @GetMapping("/cadastro-estoque") 41 | public String acessoCadEstoque() { 42 | return "crud/estoque/cadastro-estoque"; 43 | } 44 | 45 | @GetMapping("/cadastro-patrimonio") 46 | public String acessoCadPatrimonio() { 47 | return "crud/patrimonio/cadastro-patrimonio"; 48 | } 49 | 50 | @GetMapping("/cadastro-oficina") 51 | public String acessoCadOficina() { 52 | return "crud/oficina/cadastro-oficina"; 53 | } 54 | 55 | @GetMapping("/cadastro-sala") 56 | public String acessoCadSala() { 57 | return "crud/sala/cadastro-sala"; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /gerenciamento/src/main/resources/templates/crud/sala/edit-sala.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Formulario 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 |
18 |
19 |

Editar Sala

20 |
21 | 22 |
23 | 24 | 25 |
26 | 27 |
28 | 29 | 30 |
31 | 32 |
33 | 34 |
35 |
36 |
37 |
38 |
39 | 40 | -------------------------------------------------------------------------------- /gerenciamento/src/main/resources/templates/gerenciamento/gerenciamento-estoque.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Gerenciamento de Estoques 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 |
14 |

Lista de Estoques

15 |
16 |
17 |
18 |
19 |
Nome
20 |

Categoria: Categoria

21 |

Quantidade: Quantidade

22 | Editar 23 | Excluir 24 | 25 |
26 |
27 |
28 |
29 |
30 |
31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /gerenciamento/src/main/resources/templates/gerenciamento/gerenciamento-patrimonio.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Gerenciamento de Oficinas 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 |
14 |

Lista de Patrimônios

15 |
16 |
17 |
18 |
19 |
ID
20 |

Sala: Nome da Sala

21 |

Oficina: ID da Oficina

22 | Editar 23 | Excluir 24 |
25 |
26 |
27 |
28 |
29 |
30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /gerenciamento/src/main/resources/templates/crud/oficina/edit-oficina.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Formulario 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 |
20 |
21 |

Editar Oficina

22 |
23 | 24 |
25 | 26 | 27 |
28 |
29 | 30 | 31 |
32 | 33 |
34 | 35 |
36 |
37 |
38 |
39 |
40 | 41 | 42 | -------------------------------------------------------------------------------- /gerenciamento/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | org.springframework.boot 7 | spring-boot-starter-parent 8 | 3.2.5 9 | 10 | 11 | com.example 12 | gerenciamento 13 | 0.0.1-SNAPSHOT 14 | gerenciamento 15 | Demo project for Spring Boot 16 | 17 | 17 18 | 19 | 20 | 21 | org.springframework.boot 22 | spring-boot-starter-data-jpa 23 | 24 | 25 | org.springframework.boot 26 | spring-boot-starter-thymeleaf 27 | 28 | 29 | org.springframework.boot 30 | spring-boot-starter-web 31 | 32 | 33 | 34 | org.springframework.boot 35 | spring-boot-devtools 36 | runtime 37 | true 38 | 39 | 40 | org.postgresql 41 | postgresql 42 | runtime 43 | 44 | 45 | org.springframework.boot 46 | spring-boot-starter-test 47 | test 48 | 49 | 50 | 51 | 52 | 53 | 54 | org.springframework.boot 55 | spring-boot-maven-plugin 56 | 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /gerenciamento/src/main/resources/templates/crud/estoque/cadastro-estoque.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Registrar Item de Estoque 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 |
20 |

Registrar Item de Estoque

21 |
22 |
23 | 24 | 25 |
26 |
27 | 28 | 29 |
30 |
31 | 32 | 33 |
34 |
35 | 36 | 37 |
38 |
39 | 40 |
41 |
42 |
43 | 44 |
45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /gerenciamento/src/main/resources/templates/gerenciamento/gerenciamento-oficina.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Gerenciamento de Oficinas 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 |
14 |

Lista de Oficinas

15 |
16 |
17 |
18 |
19 |
Nome da Oficina
20 |

Responsável: Nome do Funcionário

21 |

CPF: CPF do Funcionário

22 | Editar 23 | Excluir 24 | Cadastrar Ativo Patrimonial 25 | Cadastrar Estoque 26 |
27 |
28 |
29 |
30 |
31 |
32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /gerenciamento/src/main/resources/templates/gerenciamento/gerenciamento-sala.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Gerenciamento de Oficinas 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 |
14 |

Lista de Salas

15 |
16 |
17 |
18 |
19 |
Nome da Sala
20 |

Responsável: Nome do Funcionário

21 |

CPF: CPF do Funcionário

22 | Editar 23 | Excluir 24 | Cadastrar Ativo Patrimonial 25 | Cadastrar Estoque 26 | 27 |
28 |
29 |
30 |
31 |
32 |
33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /gerenciamento/src/main/resources/templates/crud/oficina/cadastro-oficina.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Registrar Oficina 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 21 | 22 | 23 | 24 |
25 | 26 |
27 |

Registrar Oficina

28 |
29 |
30 | 31 | 32 |
33 |
34 | 35 | 36 |
37 |
38 | 39 |
40 |
41 |
42 | 43 | 44 | 45 | 46 |
47 | 48 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /gerenciamento/src/main/java/com/example/gerenciamento/RestController/SalaRestController.java: -------------------------------------------------------------------------------- 1 | package com.example.gerenciamento.RestController; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.http.ResponseEntity; 5 | import org.springframework.web.bind.annotation.*; 6 | 7 | import com.example.gerenciamento.Model.Sala; 8 | import com.example.gerenciamento.Services.SalaService; 9 | 10 | import java.util.Optional; 11 | 12 | @RestController 13 | @RequestMapping("/api/salas") 14 | public class SalaRestController { 15 | 16 | @Autowired 17 | private SalaService salaService; 18 | 19 | @GetMapping 20 | public Iterable getAllSalas() { 21 | return salaService.findAll(); 22 | } 23 | 24 | @GetMapping("/{nSala}") 25 | public ResponseEntity getSalaByNSala(@PathVariable String nSala) { 26 | Optional sala = salaService.findByNSala(nSala); 27 | if (sala.isPresent()) { 28 | return ResponseEntity.ok(sala.get()); 29 | } else { 30 | return ResponseEntity.notFound().build(); 31 | } 32 | } 33 | 34 | @PostMapping 35 | public Sala createSala(@RequestBody Sala sala) { 36 | return salaService.save(sala); 37 | } 38 | 39 | @PutMapping("/{nSala}") 40 | public ResponseEntity updateSala(@PathVariable String nSala, @RequestBody Sala salaDetails) { 41 | Optional optionalSala = salaService.findByNSala(nSala); 42 | if (optionalSala.isPresent()) { 43 | Sala sala = optionalSala.get(); 44 | sala.setFuncionario(salaDetails.getFuncionario()); 45 | sala.setCategoriaSala(salaDetails.getCategoriaSala()); 46 | Sala updatedSala = salaService.save(sala); 47 | return ResponseEntity.ok(updatedSala); 48 | } else { 49 | return ResponseEntity.notFound().build(); 50 | } 51 | } 52 | 53 | @DeleteMapping("/{nSala}") 54 | public ResponseEntity deleteSala(@PathVariable String nSala) { 55 | Optional optionalSala = salaService.findByNSala(nSala); 56 | if (optionalSala.isPresent()) { 57 | salaService.deleteByNSala(nSala); 58 | return ResponseEntity.noContent().build(); 59 | } else { 60 | return ResponseEntity.notFound().build(); 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /gerenciamento/src/main/resources/templates/fragmentos/footer.html: -------------------------------------------------------------------------------- 1 |
2 | 71 | 72 | 76 |
-------------------------------------------------------------------------------- /gerenciamento/src/main/resources/templates/crud/estoque/edit-estoque.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Formulario 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 |
20 |
21 |

Editar Estoque

22 |
23 | 24 |
25 | 26 | 27 |
28 | 29 |
30 | 31 | 32 |
33 | 34 |
35 | 36 | 37 |
38 | 39 |
40 | 41 | 42 |
43 | 44 |
45 | 46 |
47 |
48 |
49 |
50 |
51 | 52 | 53 | -------------------------------------------------------------------------------- /gerenciamento/src/main/java/com/example/gerenciamento/RestController/OficinaRestController.java: -------------------------------------------------------------------------------- 1 | package com.example.gerenciamento.RestController; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.http.ResponseEntity; 5 | import org.springframework.web.bind.annotation.*; 6 | 7 | import com.example.gerenciamento.Model.Oficina; 8 | import com.example.gerenciamento.Services.OficinaService; 9 | 10 | import java.util.Optional; 11 | 12 | @RestController 13 | @RequestMapping("/api/oficinas") 14 | public class OficinaRestController { 15 | 16 | @Autowired 17 | private OficinaService oficinaService; 18 | 19 | @GetMapping 20 | public Iterable getAllOficinas() { 21 | return oficinaService.findAll(); 22 | } 23 | 24 | @GetMapping("/{idOficina}") 25 | public ResponseEntity getOficinaById(@PathVariable Long idOficina) { 26 | Optional oficina = oficinaService.findById(idOficina); 27 | if (oficina.isPresent()) { 28 | return ResponseEntity.ok(oficina.get()); 29 | } else { 30 | return ResponseEntity.notFound().build(); 31 | } 32 | } 33 | 34 | @PostMapping 35 | public Oficina createOficina(@RequestBody Oficina oficina) { 36 | return oficinaService.save(oficina); 37 | } 38 | 39 | @PutMapping("/{idOficina}") 40 | public ResponseEntity updateOficina(@PathVariable Long idOficina, @RequestBody Oficina oficinaDetails) { 41 | Optional optionalOficina = oficinaService.findById(idOficina); 42 | if (optionalOficina.isPresent()) { 43 | Oficina oficina = optionalOficina.get(); 44 | oficina.setNomeOficina(oficinaDetails.getNomeOficina()); 45 | oficina.setFuncionario(oficinaDetails.getFuncionario()); 46 | Oficina updatedOficina = oficinaService.save(oficina); 47 | return ResponseEntity.ok(updatedOficina); 48 | } else { 49 | return ResponseEntity.notFound().build(); 50 | } 51 | } 52 | 53 | @DeleteMapping("/{idOficina}") 54 | public ResponseEntity deleteOficina(@PathVariable Long idOficina) { 55 | Optional optionalOficina = oficinaService.findById(idOficina); 56 | if (optionalOficina.isPresent()) { 57 | oficinaService.deleteById(idOficina); 58 | return ResponseEntity.noContent().build(); 59 | } else { 60 | return ResponseEntity.notFound().build(); 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /gerenciamento/src/main/resources/static/css/header.css: -------------------------------------------------------------------------------- 1 | @import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap'); 2 | 3 | img{ 4 | width: 100%; 5 | } 6 | 7 | header { 8 | width: 80%; 9 | height: 70px; 10 | background: #fefefe; 11 | display: flex; 12 | align-items: center; 13 | justify-content: space-between; 14 | padding: 0 40px; 15 | border-radius: 0 0 10px 10px; 16 | margin: 0 auto; 17 | font-family: "Poppins", sans-serif; 18 | font-weight: 500; 19 | } 20 | .logo { 21 | width: 120px; 22 | margin-top: 8px; 23 | } 24 | 25 | nav .logo{ 26 | display: none; 27 | } 28 | nav ul{ 29 | display: flex; 30 | } 31 | 32 | nav ul li a{ 33 | color: #212526; 34 | display: block; 35 | margin: 0 2px; 36 | font-weight: 600; 37 | padding: 8px 18px; 38 | transition: 0.2s; 39 | border-radius: 30px; 40 | } 41 | nav ul li a:hover{ 42 | background: #ca3e3e; 43 | } 44 | nav ul li a.active{ 45 | background: red; 46 | color: #fff; 47 | } 48 | .hamburger{ 49 | display: none; 50 | height: fit-content; 51 | cursor: pointer; 52 | padding: 3px 8px; 53 | border-radius: 5px; 54 | transition: 0.2s; 55 | } 56 | .hamburger:hover{ 57 | background: #f6f4ff; 58 | } 59 | .hamburger div { 60 | width: 30px; 61 | height: 2px; 62 | margin: 6px 0; 63 | background: #212526; 64 | } 65 | @media only screen and (max-width: 1100px) { 66 | header { 67 | width: 90%; 68 | padding: 0 20px; 69 | } 70 | nav { 71 | position: absolute; 72 | left: -300px; 73 | top: -10px; 74 | z-index: 999; 75 | width: 280px; 76 | height: 100vh; 77 | background-color: #fefefe; 78 | transition: 0.2s; 79 | box-shadow: 2px 0px 20px 0 rgba(0, 0, 0, 0.05); 80 | } 81 | #nav_check:checked ~ nav { 82 | left: 0; 83 | } 84 | nav .logo{ 85 | display: block; 86 | height: 70px; 87 | display: flex; 88 | /* justify-content: center; */ 89 | align-items: center; 90 | margin-left: 30px; 91 | } 92 | nav ul li a{ 93 | margin-bottom: 5px; 94 | padding: 10px 15px; 95 | border-radius: 5px; 96 | } 97 | nav ul { 98 | display: block; 99 | padding: 0 20px; 100 | margin-top: 30px; 101 | } 102 | .hamburger{ 103 | display: block; 104 | } 105 | } -------------------------------------------------------------------------------- /gerenciamento/src/main/resources/templates/crud/sala/cadastro-sala.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Registrar Sala 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 21 | 22 | 23 | 24 |
25 | 26 |
27 |

Registrar Sala

28 |
29 | 32 |
33 | 34 | 35 |
36 |
37 | 38 | 39 |
40 |
41 | 42 | 43 |
44 |
45 | 46 |
47 |
48 | 49 |
50 | 51 |
52 | 53 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /gerenciamento/src/main/java/com/example/gerenciamento/RestController/EstoqueRestController.java: -------------------------------------------------------------------------------- 1 | package com.example.gerenciamento.RestController; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.http.ResponseEntity; 5 | import org.springframework.web.bind.annotation.*; 6 | 7 | import com.example.gerenciamento.Model.Estoque; 8 | import com.example.gerenciamento.Services.EstoqueService; 9 | 10 | import java.util.Optional; 11 | 12 | @RestController 13 | @RequestMapping("/api/estoques") 14 | 15 | public class EstoqueRestController { 16 | 17 | @Autowired 18 | private EstoqueService estoqueService; 19 | 20 | @GetMapping 21 | public Iterable getAllEstoques() { 22 | return estoqueService.findAll(); 23 | } 24 | 25 | @GetMapping("/{idEstoque}") 26 | public ResponseEntity getEstoqueById(@PathVariable Long idEstoque) { 27 | Optional estoque = estoqueService.findById(idEstoque); 28 | if (estoque.isPresent()) { 29 | return ResponseEntity.ok(estoque.get()); 30 | } else { 31 | return ResponseEntity.notFound().build(); 32 | } 33 | } 34 | 35 | @PostMapping 36 | public Estoque createEstoque(@RequestBody Estoque estoque) { 37 | return estoqueService.save(estoque); 38 | } 39 | 40 | @PutMapping("/{idEstoque}") 41 | public ResponseEntity updateEstoque(@PathVariable Long idEstoque, @RequestBody Estoque estoqueDetails) { 42 | Optional optionalEstoque = estoqueService.findById(idEstoque); 43 | if (optionalEstoque.isPresent()) { 44 | Estoque estoque = optionalEstoque.get(); 45 | estoque.setNome(estoqueDetails.getNome()); 46 | estoque.setDescricao(estoqueDetails.getDescricao()); 47 | estoque.setCategoria(estoqueDetails.getCategoria()); 48 | estoque.setQuantidade(estoqueDetails.getQuantidade()); 49 | Estoque updatedEstoque = estoqueService.save(estoque); 50 | return ResponseEntity.ok(updatedEstoque); 51 | } else { 52 | return ResponseEntity.notFound().build(); 53 | } 54 | } 55 | 56 | @DeleteMapping("/{idEstoque}") 57 | public ResponseEntity deleteEstoque(@PathVariable Long idEstoque) { 58 | Optional optionalEstoque = estoqueService.findById(idEstoque); 59 | if (optionalEstoque.isPresent()) { 60 | estoqueService.deleteById(idEstoque); 61 | return ResponseEntity.noContent().build(); 62 | } else { 63 | return ResponseEntity.notFound().build(); 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /gerenciamento/src/main/resources/static/css/edit.css: -------------------------------------------------------------------------------- 1 | /* .container { 2 | display: flex; 3 | flex-direction: column; 4 | align-items: center; 5 | justify-content: center; 6 | 7 | } 8 | 9 | form { 10 | width: 300px; 11 | } 12 | 13 | .form-group { 14 | margin-bottom: 15px; 15 | } 16 | 17 | label { 18 | font-weight: bold; 19 | } 20 | 21 | input[type="text"] { 22 | flex-wrap: wrap; 23 | 24 | padding: 8px; 25 | border: 1px solid #ccc; 26 | border-radius: 5px; 27 | box-sizing: border-box; 28 | margin-top: 15px; 29 | margin: 20px; 30 | } 31 | 32 | button { 33 | background-color: #007bff; 34 | color: white; 35 | padding: 10px 20px; 36 | border: none; 37 | border-radius: 5px; 38 | cursor: pointer; 39 | } 40 | 41 | button:hover { 42 | background-color: #0056b3; 43 | } */ 44 | @import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap'); 45 | 46 | .container { 47 | margin-top: 10%; 48 | display: flex; 49 | justify-content: center; 50 | align-items: center; 51 | } 52 | .form { 53 | /* background: linear-gradient(135deg, #ff7e5f, #feb47b); */ 54 | background: #dd5e5e; 55 | width: 400px; 56 | padding: 20px; 57 | border-radius: 20px; 58 | box-shadow: 0 4px 8px rgba(0,0,0,0.1); 59 | } 60 | .input{ 61 | margin-bottom: 20px; 62 | } 63 | .input label { 64 | font-family: "Poppins", sans-serif; 65 | /* font-weight: 500; */ 66 | width: 140px; 67 | 68 | margin: 0.5cm 0; 69 | font-size: 16px; 70 | font-weight: bold; 71 | color: #000000; 72 | text-align: center; 73 | } 74 | .input input { 75 | padding: 10px; 76 | margin: 5px 0; 77 | font-size: 16px; 78 | border-radius: 5px; 79 | border: 1px solid #ccc; 80 | width: calc(100% - 22px); /* Adjusting width to account for padding and border */ 81 | } 82 | .btn input#submit { 83 | margin-top: 10px; 84 | color: white; 85 | font-weight: bold; 86 | padding: 10px; 87 | background-color: #ff7e5f; 88 | border: none; 89 | cursor: pointer; 90 | width: 100%; 91 | transition: 0.3s; 92 | border-radius: 20px; 93 | } 94 | .btn input#submit:hover { 95 | background-color: #feb47b; 96 | } 97 | h2 { 98 | text-align: center; 99 | /* text-decoration: underline; */ 100 | color: #000000; 101 | font-size: 24px; 102 | margin-bottom: 20px; 103 | font-family: "Poppins", sans-serif; 104 | font-weight: 500; 105 | } -------------------------------------------------------------------------------- /gerenciamento/src/main/java/com/example/gerenciamento/RestController/FuncionarioRestController.java: -------------------------------------------------------------------------------- 1 | package com.example.gerenciamento.RestController; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.http.ResponseEntity; 5 | import org.springframework.web.bind.annotation.*; 6 | 7 | import com.example.gerenciamento.Model.Funcionario; 8 | import com.example.gerenciamento.Services.FuncionarioService; 9 | 10 | import java.util.Optional; 11 | 12 | @RestController 13 | @RequestMapping("/api/funcionarios") 14 | public class FuncionarioRestController { 15 | 16 | @Autowired 17 | private FuncionarioService funcionarioService; 18 | 19 | @GetMapping 20 | public Iterable getAllFuncionarios() { 21 | return funcionarioService.findAll(); 22 | } 23 | 24 | @GetMapping("/{cpf}") 25 | public ResponseEntity getFuncionarioByCpf(@PathVariable String cpf) { 26 | Optional funcionario = funcionarioService.findById(cpf); 27 | if (funcionario.isPresent()) { 28 | return ResponseEntity.ok(funcionario.get()); 29 | } else { 30 | return ResponseEntity.notFound().build(); 31 | } 32 | } 33 | 34 | @PostMapping 35 | public Funcionario createFuncionario(@RequestBody Funcionario funcionario) { 36 | return funcionarioService.save(funcionario); 37 | } 38 | 39 | @PutMapping("/{cpf}") 40 | public ResponseEntity updateFuncionario(@PathVariable String cpf, @RequestBody Funcionario funcionarioDetails) { 41 | Optional optionalFuncionario = funcionarioService.findById(cpf); 42 | if (optionalFuncionario.isPresent()) { 43 | Funcionario funcionario = optionalFuncionario.get(); 44 | funcionario.setNomeFuncionario(funcionarioDetails.getNomeFuncionario()); 45 | funcionario.setCargo(funcionarioDetails.getCargo()); 46 | funcionario.setEmail(funcionarioDetails.getEmail()); 47 | funcionario.setSenha(funcionarioDetails.getSenha()); 48 | Funcionario updatedFuncionario = funcionarioService.save(funcionario); 49 | return ResponseEntity.ok(updatedFuncionario); 50 | } else { 51 | return ResponseEntity.notFound().build(); 52 | } 53 | } 54 | 55 | @DeleteMapping("/{cpf}") 56 | public ResponseEntity deleteFuncionario(@PathVariable String cpf) { 57 | Optional optionalFuncionario = funcionarioService.findById(cpf); 58 | if (optionalFuncionario.isPresent()) { 59 | funcionarioService.deleteById(cpf); 60 | return ResponseEntity.noContent().build(); 61 | } else { 62 | return ResponseEntity.notFound().build(); 63 | } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /gerenciamento/src/main/resources/templates/cadastro/cadastro-manutencaoPatrimonio.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Movimentação de Patrimonio 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 |
21 |

Movimentação de Patrimonio

22 |
23 |
24 | 25 | 26 |
27 |
28 | 29 | 30 |
31 |
32 | 33 | 34 |
35 | 36 |
37 | 38 | 39 |
40 | 41 |
42 | 43 | 44 |
45 | 46 |
47 | 48 | 49 |
50 | 51 |
52 | 53 | 54 |
55 | 56 |
57 | 58 | 59 |
60 | 61 |
62 | 63 | 64 |
65 | 66 | 67 | 68 |
69 | 70 |
71 | 72 |
73 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /gerenciamento/src/main/resources/templates/cadastro/cadastro-funcionario.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Document 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 |
23 |
Crie sua Conta
24 |
25 |
26 | 27 |
28 | Nome Completo 29 | 30 |
31 | 32 |
33 | CPF 34 | 35 |
36 | 37 |
38 | Email 39 | 40 |
41 | 42 |
43 | Cargo 44 | 45 |
46 | 47 |
48 | Senha 49 | 50 |
51 | 52 |
53 | Confirmar Senha 54 | 55 |
56 |
57 | 58 |
59 | 60 |
61 |
62 | 63 | 64 | 65 |
66 | 67 | 68 | -------------------------------------------------------------------------------- /gerenciamento/src/main/resources/static/css/manutencoes.css: -------------------------------------------------------------------------------- 1 | .container { 2 | width: 80%; 3 | margin: 40px auto; 4 | padding: 20px; 5 | background-color: #ffffff; 6 | box-shadow: 0 0 20px rgba(0, 0, 0, 0.1); 7 | border-radius: 8px; 8 | transition: box-shadow 0.3s ease-in-out; 9 | } 10 | 11 | .container:hover { 12 | box-shadow: 0 0 30px rgba(0, 0, 0, 0.2); 13 | } 14 | 15 | h1, h2 { 16 | text-align: center; 17 | color: #000000; /* Cor preta para os títulos */ 18 | margin-bottom: 20px; 19 | font-weight: 700; 20 | } 21 | 22 | table { 23 | width: 100%; 24 | border-collapse: collapse; 25 | margin-bottom: 20px; 26 | background-color: #ffffff; 27 | border-radius: 8px; 28 | overflow: hidden; 29 | box-shadow: 0 0 15px rgba(0, 0, 0, 0.1); 30 | } 31 | 32 | table th, table td { 33 | padding: 15px; 34 | text-align: left; 35 | border-bottom: 1px solid #ddd; 36 | } 37 | 38 | table thead { 39 | background: linear-gradient(90deg, #ff4d4d, #c0392b); 40 | color: white; 41 | } 42 | 43 | table tbody tr:nth-child(even) { 44 | background-color: #f2f2f2; 45 | } 46 | 47 | table tbody tr:hover { 48 | background-color: #ffe6e6; 49 | transition: background-color 0.3s ease-in-out; 50 | } 51 | 52 | th, td { 53 | border-bottom: 1px solid #ddd; 54 | } 55 | 56 | th { 57 | cursor: pointer; 58 | font-weight: 500; 59 | transition: background-color 0.3s ease-in-out; 60 | } 61 | 62 | th:hover { 63 | background-color: #ff4d4d; 64 | color: white; 65 | } 66 | 67 | @media (max-width: 768px) { 68 | .container { 69 | width: 95%; 70 | padding: 15px; 71 | } 72 | 73 | table, th, td { 74 | display: block; 75 | } 76 | 77 | table thead { 78 | display: none; 79 | } 80 | 81 | table tbody tr { 82 | margin-bottom: 10px; 83 | display: block; 84 | border-bottom: 2px solid #ddd; 85 | padding: 15px; 86 | box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); 87 | border-radius: 8px; 88 | background-color: white; 89 | } 90 | 91 | table tbody tr:nth-child(even) { 92 | background-color: white; 93 | } 94 | 95 | table td { 96 | display: flex; 97 | justify-content: space-between; 98 | padding: 10px 0; 99 | } 100 | 101 | table td::before { 102 | content: attr(data-label); 103 | font-weight: bold; 104 | text-transform: uppercase; 105 | color: #c0392b; 106 | flex-basis: 50%; 107 | } 108 | 109 | table td { 110 | flex-basis: 50%; 111 | } 112 | } 113 | 114 | /* Animations and Hover Effects */ 115 | table tbody tr { 116 | position: relative; 117 | transition: transform 0.3s ease-in-out; 118 | } 119 | 120 | table tbody tr:hover { 121 | transform: scale(1.01); 122 | } 123 | 124 | table tbody tr:active { 125 | transform: scale(0.98); 126 | } -------------------------------------------------------------------------------- /gerenciamento/src/main/resources/static/css/footer.css: -------------------------------------------------------------------------------- 1 | footer{ 2 | font-family: 'Inter', sans-serif; 3 | width: 100%; 4 | letter-spacing: 1px; 5 | color: #f5f5f5; 6 | margin-top: 35%; 7 | } 8 | 9 | #footer_content{ 10 | background-color: #171717; 11 | display: grid; 12 | grid-template-columns: repeat(4, 1fr); 13 | padding: 3rem 3.5rem; 14 | } 15 | 16 | #footer_contacts h2{ 17 | margin-bottom: 0.75rem; 18 | } 19 | 20 | #footer_social_media{ 21 | display: flex; 22 | gap: 2rem; 23 | margin-top: 1.5rem; 24 | } 25 | 26 | #footer_social_media .footer-link{ 27 | display: flex; 28 | align-items: center; 29 | justify-content: center; 30 | height: 2.5rem; 31 | width: 2.5rem; 32 | color: #f5f5f5; 33 | border-radius: 50%; 34 | transition: all 0.4s; 35 | } 36 | 37 | #instagram{ 38 | background: linear-gradient(#7f37c9, #ff2992, #ff9807); 39 | } 40 | 41 | #facebook{ 42 | background-color: #4267b3; 43 | } 44 | 45 | #twitter{ 46 | background-color: #3E8AFF; 47 | } 48 | 49 | .footer-link{ 50 | text-decoration: none; 51 | } 52 | 53 | #footer_social_media .footer-link:hover{ 54 | opacity: 0.8; 55 | text-decoration: none; 56 | } 57 | #footer_social_media .footer-link i{ 58 | font-size: 1.2rem; 59 | } 60 | .footer-list{ 61 | display: flex; 62 | flex-direction: column; 63 | gap: 0.75rem; 64 | list-style: none; 65 | } 66 | .footer-list .footer-link{ 67 | color: #a8a29e; 68 | transition: all 0.4s; 69 | } 70 | .footer-list .footer-link:hover{ 71 | color: #f7a945; 72 | text-decoration: none; 73 | } 74 | #footer_subscribe{ 75 | display: flex; 76 | flex-direction: column; 77 | gap: 1.5rem; 78 | } 79 | #footer_subscribe p{ 80 | color: #a8a29e; 81 | } 82 | 83 | #input_group{ 84 | display: flex; 85 | align-items: center; 86 | background-color: 4px; 87 | border-radius: 4px; 88 | } 89 | #input_group input{ 90 | padding: 0.75rem; 91 | width: 100%; 92 | } 93 | #input_group button{ 94 | background-color: #e6332d; 95 | border: none; 96 | color: #f5f5f5; 97 | padding: 0px 1.25rem; 98 | font-size: 1.125rem; 99 | height: 100%; 100 | border-radius: 0px 4px 4px 0px; 101 | cursor: pointer; 102 | transition: all 0.4s; 103 | } 104 | 105 | #input_group:hover{ 106 | opacity: 0.8s; 107 | text-decoration: none; 108 | } 109 | 110 | #footer_copyright{ 111 | display: flex; 112 | justify-content: center; 113 | background-color: #0e0c0c; 114 | font-size: 0.9rem; 115 | padding: 1.5rem; 116 | font-weight: 100; 117 | } 118 | @media screen and (max-width: 768px) { 119 | #footer_content{ 120 | grid-template-columns: repeat(2, 1fr); 121 | gap: 2rem; 122 | } 123 | } 124 | 125 | @media screen and (max-width: 426px) { 126 | #footer_content{ 127 | grid-template-columns: repeat(1, 1fr); 128 | padding: 3rem 2rem; 129 | } 130 | } -------------------------------------------------------------------------------- /gerenciamento/src/main/java/com/example/gerenciamento/Model/Movimentacao_Estoque.java: -------------------------------------------------------------------------------- 1 | package com.example.gerenciamento.Model; 2 | 3 | import java.io.Serializable; 4 | import java.time.ZonedDateTime; 5 | 6 | import jakarta.persistence.Column; 7 | import jakarta.persistence.Entity; 8 | import jakarta.persistence.GeneratedValue; 9 | import jakarta.persistence.GenerationType; 10 | import jakarta.persistence.Id; 11 | import jakarta.persistence.JoinColumn; 12 | import jakarta.persistence.ManyToOne; 13 | import jakarta.persistence.Table; 14 | 15 | @Table(name = "movimentacaoEstoque") 16 | @Entity 17 | public class Movimentacao_Estoque implements Serializable { 18 | @Id 19 | @GeneratedValue(strategy = GenerationType.IDENTITY) 20 | private long idMovimentacaoEstoque; 21 | 22 | @ManyToOne 23 | @JoinColumn(name = "nomeFuncionario", referencedColumnName = "nomeFuncionario", nullable = false) 24 | private Funcionario solicitante; 25 | 26 | @JoinColumn(name = "idEstoque", referencedColumnName = "idEstoque", nullable = false) 27 | private Estoque idEstoque; 28 | 29 | 30 | @Column(length = 200) 31 | private String descricao; 32 | 33 | 34 | @Column(length = 50) 35 | private String tipo; 36 | 37 | 38 | @Column(length = 20) 39 | private String status; 40 | 41 | // zoned date time é para representar a data, horario e fuso horário caso 42 | // necessário das datas 43 | 44 | private ZonedDateTime dataSolicitacao; 45 | 46 | 47 | private ZonedDateTime dataAprovacao; 48 | public long getIdMovimentacaoEstoque() { 49 | return idMovimentacaoEstoque; 50 | } 51 | public void setIdMovimentacaoEstoque(long idMovimentacaoEstoque) { 52 | this.idMovimentacaoEstoque = idMovimentacaoEstoque; 53 | } 54 | public Funcionario getSolicitante() { 55 | return solicitante; 56 | } 57 | public void setSolicitante(Funcionario solicitante) { 58 | this.solicitante = solicitante; 59 | } 60 | public String getDescricao() { 61 | return descricao; 62 | } 63 | public void setDescricao(String descricao) { 64 | this.descricao = descricao; 65 | } 66 | public String getTipo() { 67 | return tipo; 68 | } 69 | public void setTipo(String tipo) { 70 | this.tipo = tipo; 71 | } 72 | public String getStatus() { 73 | return status; 74 | } 75 | public void setStatus(String status) { 76 | this.status = status; 77 | } 78 | public ZonedDateTime getDataSolicitacao() { 79 | return dataSolicitacao; 80 | } 81 | public void setDataSolicitacao(ZonedDateTime dataSolicitacao) { 82 | this.dataSolicitacao = dataSolicitacao; 83 | } 84 | public ZonedDateTime getDataAprovacao() { 85 | return dataAprovacao; 86 | } 87 | public void setDataAprovacao(ZonedDateTime dataAprovacao) { 88 | this.dataAprovacao = dataAprovacao; 89 | } 90 | public Estoque getIdEstoque() { 91 | return idEstoque; 92 | } 93 | public void setIdEstoque(Estoque idEstoque) { 94 | this.idEstoque = idEstoque; 95 | } 96 | 97 | } 98 | -------------------------------------------------------------------------------- /gerenciamento/src/main/resources/templates/cadastro/cadastro-manutencaoEstoque.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Movimentação de Estoque 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 |
18 |

Movimentação de Estoque

19 |
20 |
21 | 22 | 23 |
24 |
25 | 26 | 27 |
28 |
29 | 30 | 31 |
32 | 33 |
34 | 35 | 36 |
37 | 38 |
39 | 40 | 41 |
42 | 43 |
44 | 45 | 46 |
47 | 48 |
49 | 50 | 51 |
52 | 53 |
54 | 55 | 56 |
57 | 58 |
59 | 60 | 61 |
62 |
63 | 64 |
65 |
66 | 67 |
68 | 69 |
70 | 71 | 72 | -------------------------------------------------------------------------------- /gerenciamento/src/main/java/com/example/gerenciamento/RestController/MovEstoqueRestController.java: -------------------------------------------------------------------------------- 1 | package com.example.gerenciamento.RestController; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.http.ResponseEntity; 5 | import org.springframework.web.bind.annotation.*; 6 | 7 | import com.example.gerenciamento.Model.Movimentacao_Estoque; 8 | import com.example.gerenciamento.Services.MovEstoqueService; 9 | 10 | import java.util.Optional; 11 | 12 | @RestController 13 | @RequestMapping("/api/mov_estoque") 14 | public class MovEstoqueRestController { 15 | 16 | @Autowired 17 | private MovEstoqueService movEstoqueService; 18 | 19 | @GetMapping 20 | public Iterable getAllMovimentacoes() { 21 | return movEstoqueService.findAll(); 22 | } 23 | 24 | @GetMapping("/{idMovimentacaoEstoque}") 25 | public ResponseEntity getMovimentacaoById(@PathVariable Long idMovimentacaoEstoque) { 26 | Optional movimentacao = movEstoqueService.findById(idMovimentacaoEstoque); 27 | if (movimentacao.isPresent()) { 28 | return ResponseEntity.ok(movimentacao.get()); 29 | } else { 30 | return ResponseEntity.notFound().build(); 31 | } 32 | } 33 | 34 | @PostMapping 35 | public Movimentacao_Estoque createMovimentacao(@RequestBody Movimentacao_Estoque movimentacaoEstoque) { 36 | return movEstoqueService.save(movimentacaoEstoque); 37 | } 38 | 39 | @PutMapping("/{idMovimentacaoEstoque}") 40 | public ResponseEntity updateMovimentacao(@PathVariable Long idMovimentacaoEstoque, @RequestBody Movimentacao_Estoque movimentacaoDetails) { 41 | Optional optionalMovimentacao = movEstoqueService.findById(idMovimentacaoEstoque); 42 | if (optionalMovimentacao.isPresent()) { 43 | Movimentacao_Estoque movimentacao = optionalMovimentacao.get(); 44 | movimentacao.setSolicitante(movimentacaoDetails.getSolicitante()); 45 | movimentacao.setIdEstoque(movimentacaoDetails.getIdEstoque()); 46 | movimentacao.setDescricao(movimentacaoDetails.getDescricao()); 47 | movimentacao.setTipo(movimentacaoDetails.getTipo()); 48 | movimentacao.setStatus(movimentacaoDetails.getStatus()); 49 | movimentacao.setDataSolicitacao(movimentacaoDetails.getDataSolicitacao()); 50 | movimentacao.setDataAprovacao(movimentacaoDetails.getDataAprovacao()); 51 | Movimentacao_Estoque updatedMovimentacao = movEstoqueService.save(movimentacao); 52 | return ResponseEntity.ok(updatedMovimentacao); 53 | } else { 54 | return ResponseEntity.notFound().build(); 55 | } 56 | } 57 | 58 | @DeleteMapping("/{idMovimentacaoEstoque}") 59 | public ResponseEntity deleteMovimentacao(@PathVariable Long idMovimentacaoEstoque) { 60 | Optional optionalMovimentacao = movEstoqueService.findById(idMovimentacaoEstoque); 61 | if (optionalMovimentacao.isPresent()) { 62 | movEstoqueService.deleteById(idMovimentacaoEstoque); 63 | return ResponseEntity.noContent().build(); 64 | } else { 65 | return ResponseEntity.notFound().build(); 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /gerenciamento/src/main/resources/templates/crud/patrimonio/edit-patrimonio.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Formulario 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 |
20 |
21 |

Editar Patrimônio

22 |
23 | 24 |
25 | 26 | 27 |
28 |
29 | 30 | 31 |
32 | 33 |
34 | 35 | 36 |
37 | 38 |
39 | 40 | 41 |
42 | 43 |
44 | 45 | 46 |
47 | 48 |
49 | 50 | 51 |
52 | 53 |
54 | 55 | 56 |
57 | 58 |
59 | 60 | 61 |
62 | 63 |
64 | 65 |
66 |
67 |
68 |
69 |
70 | 71 | 72 | -------------------------------------------------------------------------------- /gerenciamento/src/main/java/com/example/gerenciamento/Model/Patrimonio.java: -------------------------------------------------------------------------------- 1 | package com.example.gerenciamento.Model; 2 | 3 | import java.io.Serializable; 4 | 5 | import jakarta.persistence.Column; 6 | import jakarta.persistence.Entity; 7 | import jakarta.persistence.GeneratedValue; 8 | import jakarta.persistence.GenerationType; 9 | import jakarta.persistence.Id; 10 | import jakarta.persistence.JoinColumn; 11 | import jakarta.persistence.OneToOne; 12 | import jakarta.persistence.Table; 13 | 14 | @Table(name = "patrimonios") 15 | @Entity 16 | public class Patrimonio implements Serializable { 17 | @Id 18 | @GeneratedValue(strategy = GenerationType.IDENTITY) 19 | private Long idPatrimonio; 20 | 21 | 22 | @Column(length = 200) 23 | private String nPatrimonio; 24 | 25 | 26 | @Column(length = 200) 27 | private String nome; 28 | 29 | 30 | @Column(length = 150) 31 | private String descricao; 32 | 33 | 34 | @Column(length = 100) 35 | private String categoriaPatrimonio; 36 | 37 | 38 | @Column(length = 10) 39 | private String status; 40 | 41 | 42 | @Column(length = 50) 43 | private String ultimaManutencao; 44 | 45 | @OneToOne 46 | @JoinColumn(name = "nSala", referencedColumnName = "nSala", nullable = false) 47 | private Sala sala; 48 | 49 | @OneToOne 50 | @JoinColumn(name = "idOficina", referencedColumnName = "idOficina", nullable = false) 51 | private Oficina oficina; 52 | 53 | public Patrimonio() {} 54 | 55 | 56 | 57 | public String getNome() { 58 | return nome; 59 | } 60 | 61 | public void setNome(String nome) { 62 | this.nome = nome; 63 | } 64 | 65 | public String getDescricao() { 66 | return descricao; 67 | } 68 | 69 | public void setDescricao(String descricao) { 70 | this.descricao = descricao; 71 | } 72 | 73 | public String getCategoriaPatrimonio() { 74 | return categoriaPatrimonio; 75 | } 76 | 77 | public void setCategoriaPatrimonio(String categoriaPatrimonio) { 78 | this.categoriaPatrimonio = categoriaPatrimonio; 79 | } 80 | 81 | public String getStatus() { 82 | return status; 83 | } 84 | 85 | public void setStatus(String status) { 86 | this.status = status; 87 | } 88 | 89 | public String getUltimaManutencao() { 90 | return ultimaManutencao; 91 | } 92 | 93 | public void setUltimaManutencao(String ultimaManutencao) { 94 | this.ultimaManutencao = ultimaManutencao; 95 | } 96 | 97 | public Sala getSala() { 98 | return sala; 99 | } 100 | 101 | public void setSala(Sala sala) { 102 | this.sala = sala; 103 | } 104 | 105 | public Oficina getOficina() { 106 | return oficina; 107 | } 108 | 109 | public void setOficina(Oficina oficina) { 110 | this.oficina = oficina; 111 | } 112 | 113 | 114 | 115 | public Long getIdPatrimonio() { 116 | return idPatrimonio; 117 | } 118 | 119 | 120 | 121 | public void setIdPatrimonio(Long idPatrimonio) { 122 | this.idPatrimonio = idPatrimonio; 123 | } 124 | 125 | 126 | 127 | public String getnPatrimonio() { 128 | return nPatrimonio; 129 | } 130 | 131 | 132 | 133 | public void setnPatrimonio(String nPatrimonio) { 134 | this.nPatrimonio = nPatrimonio; 135 | } 136 | 137 | 138 | 139 | 140 | } -------------------------------------------------------------------------------- /gerenciamento/src/main/resources/templates/crud/patrimonio/cadastro-patrimonio.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Registrar Patrimônio 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 |
21 |

Registrar Patrimônio

22 |
23 |
24 | 25 | 26 |
27 |
28 | 29 | 30 |
31 |
32 | 33 | 34 |
35 |
36 | 37 | 38 |
39 |
40 | 41 | 42 |
43 |
44 | 45 | 46 |
47 |
48 | 49 | 50 | 58 |
59 |
60 | 61 | 62 |
63 |
64 | 65 |
66 |
67 |
68 | 69 | 70 |
71 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /gerenciamento/src/main/resources/static/css/cadastro-funcionario.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0 auto; 3 | display: flex; 4 | justify-content: center; 5 | flex-direction: column; 6 | } 7 | 8 | .container { 9 | margin: 0 auto; 10 | margin-top: 12vh; 11 | max-width: 700px; 12 | width: 100%; 13 | background: #dd5e5e; 14 | padding: 25px 30px; 15 | border-radius: 20px; 16 | } 17 | 18 | .container .title { 19 | font-size: 25px; 20 | font-weight: 500; 21 | position: relative; 22 | } 23 | 24 | .container .title::before { 25 | content: ''; 26 | position: absolute; 27 | left: 0; 28 | bottom: 0; 29 | height: 3px; 30 | width: 30px; 31 | background-color: #000000; 32 | } 33 | 34 | .container form .user-details { 35 | display: flex; 36 | flex-wrap: wrap; 37 | justify-content: space-between; 38 | margin: 20px 0 12px 0; 39 | } 40 | 41 | form .user-details .input-box { 42 | margin-bottom: 15px; 43 | width: calc(100%/ 2 - 20px); 44 | } 45 | 46 | .user-details .input-box .details { 47 | display: block; 48 | font-weight: 500; 49 | margin-bottom: 5px; 50 | } 51 | 52 | .user-details .input-box input { 53 | height: 45px; 54 | width: 100%; 55 | outline: none; 56 | border-radius: 5px; 57 | border: 1px solid #ccc; 58 | padding-left: 15px; 59 | font-size: 16px; 60 | border-bottom-width: 2px; 61 | transition: all 0.3s ease; 62 | } 63 | 64 | .user-details .input-box input:focus, 65 | .user-details .input-box input:valid { 66 | border-color: #9b59b6; 67 | 68 | } 69 | 70 | form .detalhes-de-genero .gender-title { 71 | font-size: 20px; 72 | font-weight: 500; 73 | } 74 | 75 | form .detalhes-de-genero .categoria { 76 | display: flex; 77 | width: 80%; 78 | margin: 14px 0; 79 | justify-content: space-between; 80 | } 81 | 82 | .detalhes-de-genero .categoria label { 83 | display: flex; 84 | align-items: center; 85 | } 86 | 87 | .detalhes-de-genero .categoria .dot { 88 | height: 18px; 89 | width: 18px; 90 | background: #d9d9d9; 91 | border-radius: 50%; 92 | margin-right: 10px; 93 | border: 5px solid transparent; 94 | transition: all 0.3s ease; 95 | } 96 | 97 | #dot-1:checked~.categoria label .one, 98 | #dot-2:checked~.categoria label .two, 99 | #dot-3:checked~.categoria label .three { 100 | border-color: #d9d9d9; 101 | background: #9b59b6; 102 | } 103 | form input[type="radio"]{ 104 | display: none; 105 | } 106 | form .button{ 107 | height: 45px; 108 | margin: 45px 0; 109 | } 110 | form .button input{ 111 | height: 100%; 112 | width: 100%; 113 | outline: none; 114 | color: #fff; 115 | border: none; 116 | font-size: 18px; 117 | font-weight: 500; 118 | border-radius: 20px; 119 | letter-spacing: 1px; 120 | background-color: #ff0000; 121 | cursor: pointer; 122 | } 123 | form .button input:hover{ 124 | transition: 0.3s; 125 | background-color: #a01515; 126 | } 127 | 128 | @media (max-width:584px){ 129 | .container { 130 | max-width: 100%; 131 | } 132 | 133 | form .user-details .input-box { 134 | margin-bottom: 15px; 135 | width: 100%; 136 | } 137 | 138 | form .detalhes-de-genero .categoria { 139 | width: 100%; 140 | } 141 | .container form .user-details { 142 | max-height: 300px; 143 | overflow-y: scroll; 144 | } 145 | .user-details::-webkit-scrollbar{ 146 | width: 0; 147 | } 148 | } -------------------------------------------------------------------------------- /gerenciamento/src/main/java/com/example/gerenciamento/Controller/EstoqueController.java: -------------------------------------------------------------------------------- 1 | package com.example.gerenciamento.Controller; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Controller; 7 | import org.springframework.ui.Model; 8 | import org.springframework.web.bind.annotation.GetMapping; 9 | import org.springframework.web.bind.annotation.PathVariable; 10 | import org.springframework.web.bind.annotation.PostMapping; 11 | import org.springframework.web.bind.annotation.RequestMapping; 12 | import org.springframework.web.bind.annotation.RequestMethod; 13 | import org.springframework.web.bind.annotation.RequestParam; 14 | import org.springframework.web.servlet.ModelAndView; 15 | 16 | import com.example.gerenciamento.Model.Estoque; 17 | import com.example.gerenciamento.Repository.EstoqueRepository; 18 | 19 | @Controller 20 | public class EstoqueController { 21 | @Autowired 22 | private EstoqueRepository estoqueRepository; 23 | 24 | @PostMapping("/cadastrar-estoque") 25 | public String cadastrarEstoque(Estoque estoque, Model model) { 26 | try { 27 | estoqueRepository.save(estoque); 28 | System.out.println("Cadastro realizado com sucesso!"); 29 | return "/interna/interna-funcionario"; 30 | } catch (Exception e) { 31 | System.out.println("Erro ao cadastrar estoque: " + e.getMessage()); 32 | return "/crud/estoque/cadastro-estoque"; 33 | } 34 | } 35 | 36 | @GetMapping("/gerenciamento-estoque") 37 | public String listarEstoques(Model model) { 38 | List estoques = (List) estoqueRepository.findAll(); 39 | model.addAttribute("estoques", estoques); 40 | return "gerenciamento/gerenciamento-estoque"; 41 | } 42 | 43 | @RequestMapping(value = "/delete-estoque/{idEstoque}", method = RequestMethod.GET) 44 | public String excluirEstoque(@PathVariable("idEstoque") Long idEstoque) { 45 | try { 46 | Estoque estoque = estoqueRepository.findByIdEstoque(idEstoque); 47 | if (estoque != null) { 48 | estoqueRepository.delete(estoque); 49 | System.out.println("Estoque excluído com sucesso!"); 50 | } else { 51 | System.out.println("Estoque não encontrado para exclusão"); 52 | } 53 | } catch (Exception e) { 54 | System.out.println("Erro ao excluir Estoque: " + e.getMessage()); 55 | } 56 | return "redirect:/gerenciamento-estoque"; 57 | } 58 | 59 | @RequestMapping(value = "/edit-estoque/{idEstoque}", method = RequestMethod.GET) 60 | public ModelAndView editarEstoque(@PathVariable("idEstoque") Long idEstoque) { 61 | ModelAndView mv = new ModelAndView("crud/estoque/edit-estoque"); 62 | Estoque estoque = estoqueRepository.findByIdEstoque(idEstoque); 63 | mv.addObject("idEstoque", idEstoque); 64 | mv.addObject("estoque", estoque); 65 | return mv; 66 | } 67 | 68 | @PostMapping("/atualizar-estoque") 69 | public String atualizarEstoque(@RequestParam("idEstoque") Long idEstoque, Estoque estoque) { 70 | Estoque estoqueExistente = estoqueRepository.findByIdEstoque(idEstoque); 71 | if (estoqueExistente != null) { 72 | estoqueExistente.setIdEstoque(estoque.getIdEstoque()); 73 | estoqueExistente.setNome(estoque.getNome()); 74 | estoqueExistente.setCategoria(estoque.getCategoria()); 75 | estoqueExistente.setQuantidade(estoque.getQuantidade()); 76 | estoqueRepository.save(estoqueExistente); 77 | return "redirect:/gerenciamento-estoque"; 78 | } else { 79 | return "redirect:/gerenciamento-estoque"; 80 | } 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /gerenciamento/src/main/java/com/example/gerenciamento/Model/Movimentacao_Patrimonio.java: -------------------------------------------------------------------------------- 1 | package com.example.gerenciamento.Model; 2 | 3 | import java.io.Serializable; 4 | import java.time.ZonedDateTime; 5 | 6 | import jakarta.persistence.Column; 7 | import jakarta.persistence.Entity; 8 | import jakarta.persistence.GeneratedValue; 9 | import jakarta.persistence.GenerationType; 10 | import jakarta.persistence.Id; 11 | import jakarta.persistence.JoinColumn; 12 | import jakarta.persistence.ManyToOne; 13 | import jakarta.persistence.Table; 14 | 15 | @Table(name = "movimentacaoPatrimonio") 16 | @Entity 17 | public class Movimentacao_Patrimonio implements Serializable { 18 | @Id 19 | @GeneratedValue(strategy = GenerationType.IDENTITY) 20 | private long idMovimentacaoPatrimonio; 21 | 22 | @ManyToOne 23 | @JoinColumn(name = "nomeFuncionario", referencedColumnName = "nomeFuncionario", nullable = false) 24 | private Funcionario solicitante; 25 | 26 | @JoinColumn(name = "idPatrimonio", referencedColumnName = "idPatrimonio", nullable = false) 27 | private Patrimonio idPatrimonio; 28 | 29 | 30 | @Column(length = 100) 31 | private String origem; 32 | 33 | 34 | @Column(length = 100) 35 | private String destino; 36 | 37 | 38 | @Column(length = 200) 39 | private String descricao; 40 | 41 | 42 | @Column(length = 50) 43 | private String tipo; 44 | 45 | 46 | @Column(length = 10) 47 | private String status; 48 | 49 | // zoned date time é para representar a data, horario e fuso horário caso 50 | // necessário das datas 51 | 52 | private ZonedDateTime dataSolicitacao; 53 | 54 | 55 | private ZonedDateTime dataAprovacao; 56 | 57 | public long getIdMovimentacaoPatrimonio() { 58 | return idMovimentacaoPatrimonio; 59 | } 60 | 61 | public void setIdMovimentacaoPatrimonio(long idMovimentacaoPatrimonio) { 62 | this.idMovimentacaoPatrimonio = idMovimentacaoPatrimonio; 63 | } 64 | 65 | public Funcionario getSolicitante() { 66 | return solicitante; 67 | } 68 | 69 | public void setSolicitante(Funcionario solicitante) { 70 | this.solicitante = solicitante; 71 | } 72 | 73 | public String getOrigem() { 74 | return origem; 75 | } 76 | 77 | public void setOrigem(String origem) { 78 | this.origem = origem; 79 | } 80 | 81 | public String getDestino() { 82 | return destino; 83 | } 84 | 85 | public void setDestino(String destino) { 86 | this.destino = destino; 87 | } 88 | 89 | public String getDescricao() { 90 | return descricao; 91 | } 92 | 93 | public void setDescricao(String descricao) { 94 | this.descricao = descricao; 95 | } 96 | 97 | public String getTipo() { 98 | return tipo; 99 | } 100 | 101 | public void setTipo(String tipo) { 102 | this.tipo = tipo; 103 | } 104 | 105 | public String getStatus() { 106 | return status; 107 | } 108 | 109 | public void setStatus(String status) { 110 | this.status = status; 111 | } 112 | 113 | public ZonedDateTime getDataSolicitacao() { 114 | return dataSolicitacao; 115 | } 116 | 117 | public void setDataSolicitacao(ZonedDateTime dataSolicitacao) { 118 | this.dataSolicitacao = dataSolicitacao; 119 | } 120 | 121 | public ZonedDateTime getDataAprovacao() { 122 | return dataAprovacao; 123 | } 124 | 125 | public void setDataAprovacao(ZonedDateTime dataAprovacao) { 126 | this.dataAprovacao = dataAprovacao; 127 | } 128 | 129 | public Patrimonio getIdPatrimonio() { 130 | return idPatrimonio; 131 | } 132 | 133 | public void setIdPatrimonio(Patrimonio idPatrimonio) { 134 | this.idPatrimonio = idPatrimonio; 135 | } 136 | 137 | 138 | 139 | } 140 | -------------------------------------------------------------------------------- /gerenciamento/src/main/java/com/example/gerenciamento/Controller/PatrimonioController.java: -------------------------------------------------------------------------------- 1 | package com.example.gerenciamento.Controller; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Controller; 7 | import org.springframework.ui.Model; 8 | import org.springframework.web.bind.annotation.GetMapping; 9 | import org.springframework.web.bind.annotation.PathVariable; 10 | import org.springframework.web.bind.annotation.PostMapping; 11 | import org.springframework.web.bind.annotation.RequestMapping; 12 | import org.springframework.web.bind.annotation.RequestMethod; 13 | import org.springframework.web.bind.annotation.RequestParam; 14 | import org.springframework.web.servlet.ModelAndView; 15 | import com.example.gerenciamento.Model.Patrimonio; 16 | import com.example.gerenciamento.Repository.PatrimonioRepository; 17 | 18 | @Controller 19 | public class PatrimonioController { 20 | @Autowired 21 | private PatrimonioRepository patrimonioRepository; 22 | 23 | @PostMapping("/cadastrar-patrimonio") 24 | public String cadastrarPatrimonio(Patrimonio patrimonio, Model model) { 25 | try { 26 | patrimonioRepository.save(patrimonio); 27 | System.out.println("Cadastro realizado com sucesso!"); 28 | return "/interna/interna-funcionario"; 29 | } catch (Exception e) { 30 | System.out.println("Erro ao cadastrar patrimonio: " + e.getMessage()); 31 | return "/crud/patrimonio/cadastro-patrimonio"; 32 | } 33 | } 34 | 35 | @GetMapping("/gerenciamento-patrimonio") 36 | public String listarPatrimonios(Model model) { 37 | List patrimonios = (List) patrimonioRepository.findAll(); 38 | model.addAttribute("patrimonios", patrimonios); 39 | return "gerenciamento/gerenciamento-patrimonio"; 40 | } 41 | 42 | @RequestMapping(value = "/delete-patrimonio/{idPatrimonio}", method = RequestMethod.GET) 43 | public String excluirPatrimonio(@PathVariable("idPatrimonio") Long idPatrimonio) { 44 | try { 45 | Patrimonio patrimonio = patrimonioRepository.findByIdPatrimonio(idPatrimonio); 46 | if (patrimonio != null) { 47 | patrimonioRepository.delete(patrimonio); 48 | System.out.println("Patrimonio excluído com sucesso!"); 49 | } else { 50 | System.out.println("Patrimonio não encontrado para exclusão"); 51 | } 52 | } catch (Exception e) { 53 | System.out.println("Erro ao excluir Patrimonio: " + e.getMessage()); 54 | } 55 | return "redirect:/gerenciamento-patrimonio"; 56 | } 57 | 58 | @RequestMapping(value = "/edit-patrimonio/{idPatrimonio}", method = RequestMethod.GET) 59 | public ModelAndView editarPatrimonio(@PathVariable("idPatrimonio") Long idPatrimonio) { 60 | ModelAndView mv = new ModelAndView("crud/patrimonio/edit-patrimonio"); 61 | Patrimonio patrimonio = patrimonioRepository.findByIdPatrimonio(idPatrimonio); 62 | mv.addObject("idPatrimonio", idPatrimonio); 63 | mv.addObject("patrimonio", patrimonio); 64 | return mv; 65 | } 66 | 67 | @PostMapping("/atualizar-patrimonio") 68 | public String atualizarPatrimonio(@RequestParam("idPatrimonio") Long idPatrimonio, Patrimonio patrimonio) { 69 | Patrimonio patrimonioExistente = patrimonioRepository.findByIdPatrimonio(idPatrimonio); 70 | if (patrimonioExistente != null) { 71 | patrimonioExistente.setnPatrimonio(patrimonio.getnPatrimonio()); 72 | patrimonioExistente.setNome(patrimonio.getNome()); 73 | patrimonioExistente.setCategoriaPatrimonio(patrimonio.getCategoriaPatrimonio()); 74 | patrimonioExistente.setStatus(patrimonio.getStatus()); 75 | patrimonioExistente.setSala(patrimonio.getSala()); 76 | patrimonioExistente.setOficina(patrimonio.getOficina()); 77 | patrimonioRepository.save(patrimonioExistente); 78 | return "redirect:/gerenciamento-patrimonio"; 79 | } else { 80 | return "redirect:/gerenciamento-patrimonio"; 81 | } 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /gerenciamento/src/main/resources/templates/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Página de Funcionario 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 80 |
81 | 82 | 83 | -------------------------------------------------------------------------------- /gerenciamento/src/main/java/com/example/gerenciamento/Controller/OficinaController.java: -------------------------------------------------------------------------------- 1 | package com.example.gerenciamento.Controller; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Controller; 7 | import org.springframework.ui.Model; 8 | import org.springframework.web.bind.annotation.GetMapping; 9 | import org.springframework.web.bind.annotation.PathVariable; 10 | import org.springframework.web.bind.annotation.PostMapping; 11 | import org.springframework.web.bind.annotation.RequestMapping; 12 | import org.springframework.web.bind.annotation.RequestMethod; 13 | import org.springframework.web.bind.annotation.RequestParam; 14 | import org.springframework.web.servlet.ModelAndView; 15 | 16 | import com.example.gerenciamento.Model.Funcionario; 17 | import com.example.gerenciamento.Model.Oficina; 18 | import com.example.gerenciamento.Repository.FuncionarioRepository; 19 | import com.example.gerenciamento.Repository.OficinaRepository; 20 | 21 | @Controller 22 | public class OficinaController { 23 | @Autowired 24 | private OficinaRepository oficinaRepository; 25 | 26 | @Autowired 27 | private FuncionarioRepository funcionarioRepository; 28 | 29 | @PostMapping("/cadastrar-oficina") 30 | public String cadastrarOficina(@RequestParam("funcionario.cpf") String cpf, @RequestParam("nomeOficina") String nomeOficina, Model model) { 31 | try { 32 | // Verifique se o Funcionario já existe 33 | Funcionario funcionarioExistente = funcionarioRepository.findByCpf(cpf); 34 | if (funcionarioExistente == null) { 35 | model.addAttribute("erro", "Erro ao cadastrar oficina: Funcionário não encontrado"); 36 | return "crud/oficina/cadastro-oficina"; 37 | } 38 | 39 | Oficina oficina = new Oficina(); 40 | oficina.setNomeOficina(nomeOficina); 41 | oficina.setFuncionario(funcionarioExistente); 42 | 43 | oficinaRepository.save(oficina); 44 | System.out.println("Cadastro realizado com sucesso!"); 45 | return "redirect:/interna-funcionario"; 46 | } catch (Exception e) { 47 | model.addAttribute("erro", "Erro ao cadastrar oficina: " + e.getMessage()); 48 | return "crud/oficina/cadastro-oficina"; 49 | } 50 | } 51 | 52 | @GetMapping("/gerenciamento-oficina") 53 | public String listarOficinas(Model model) { 54 | List oficinas = (List) oficinaRepository.findAll(); 55 | model.addAttribute("oficinas", oficinas); 56 | return "gerenciamento/gerenciamento-oficina"; 57 | } 58 | 59 | @RequestMapping(value = "/delete-oficina/{idOficina}", method = RequestMethod.GET) 60 | public String excluirOficina(@PathVariable("idOficina") Long idOficina) { 61 | try { 62 | Oficina oficina = oficinaRepository.findByIdOficina(idOficina); 63 | if (oficina != null) { 64 | oficinaRepository.delete(oficina); 65 | System.out.println("Oficina excluída com sucesso!"); 66 | } else { 67 | System.out.println("Oficina não encontrada para exclusão"); 68 | } 69 | } catch (Exception e) { 70 | System.out.println("Erro ao excluir Oficina: " + e.getMessage()); 71 | } 72 | return "redirect:/gerenciamento-oficina"; 73 | } 74 | 75 | @RequestMapping(value = "/edit-oficina/{idOficina}", method = RequestMethod.GET) 76 | public ModelAndView editarOficina(@PathVariable("idOficina") Long idOficina) { 77 | ModelAndView mv = new ModelAndView("crud/oficina/edit-oficina"); 78 | Oficina oficina = oficinaRepository.findByIdOficina(idOficina); 79 | mv.addObject("idOficina", idOficina); 80 | mv.addObject("oficina", oficina); 81 | return mv; 82 | } 83 | 84 | @PostMapping("/atualizar-oficina") 85 | public String atualizarOficina(@RequestParam("idOficina") Long idOficina, Oficina oficina) { 86 | Oficina oficinaExistente = oficinaRepository.findByIdOficina(idOficina); 87 | if (oficinaExistente != null) { 88 | oficinaExistente.setFuncionario(oficina.getFuncionario()); 89 | oficinaExistente.setNomeOficina(oficina.getNomeOficina()); 90 | oficinaRepository.save(oficinaExistente); 91 | return "redirect:/gerenciamento-oficina"; 92 | } else { 93 | return "redirect:/gerenciamento-oficina"; 94 | } 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /gerenciamento/src/main/java/com/example/gerenciamento/RestController/MovPatrimonioRestController.java: -------------------------------------------------------------------------------- 1 | package com.example.gerenciamento.RestController; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.http.ResponseEntity; 5 | import org.springframework.web.bind.annotation.*; 6 | 7 | import com.example.gerenciamento.Model.Funcionario; 8 | import com.example.gerenciamento.Model.Movimentacao_Patrimonio; 9 | import com.example.gerenciamento.Services.FuncionarioService; 10 | import com.example.gerenciamento.Services.MovPatrimonioService; 11 | 12 | import java.util.Optional; 13 | 14 | @RestController 15 | @RequestMapping("/api/mov_patrimonio") 16 | public class MovPatrimonioRestController { 17 | 18 | @Autowired 19 | private MovPatrimonioService movPatrimonioService; 20 | 21 | @Autowired 22 | private FuncionarioService funcionarioService; 23 | 24 | @GetMapping 25 | public Iterable getAllMovimentacoes() { 26 | return movPatrimonioService.findAll(); 27 | } 28 | 29 | @GetMapping("/{idMovimentacaoPatrimonio}") 30 | public ResponseEntity getMovimentacaoById(@PathVariable Long idMovimentacaoPatrimonio) { 31 | Optional movimentacao = movPatrimonioService.findById(idMovimentacaoPatrimonio); 32 | if (movimentacao.isPresent()) { 33 | return ResponseEntity.ok(movimentacao.get()); 34 | } else { 35 | return ResponseEntity.notFound().build(); 36 | } 37 | } 38 | 39 | @PostMapping 40 | public ResponseEntity createMovimentacao(@RequestBody Movimentacao_Patrimonio movimentacaoPatrimonio) { 41 | // Verifica se o solicitante da movimentação não é nulo e tem um ID válido 42 | if (movimentacaoPatrimonio.getSolicitante() == null || movimentacaoPatrimonio.getSolicitante().getCpf() == null) { 43 | // Se o solicitante ou o ID do solicitante forem nulos, retorna um erro com uma mensagem adequada 44 | return ResponseEntity.badRequest().body("O solicitante da movimentação não foi especificado ou tem um ID inválido."); 45 | } 46 | 47 | // Verifica se o funcionário associado à movimentação já existe no banco de dados 48 | Optional optionalFuncionario = funcionarioService.findById(movimentacaoPatrimonio.getSolicitante().getCpf()); 49 | if (optionalFuncionario.isEmpty()) { 50 | // Se o funcionário não existe, retorna um erro com uma mensagem adequada 51 | return ResponseEntity.badRequest().body("O funcionário associado à movimentação não existe no banco de dados."); 52 | } 53 | 54 | // Se o funcionário existe, prossegue com a criação da movimentação 55 | Movimentacao_Patrimonio novaMovimentacao = movPatrimonioService.save(movimentacaoPatrimonio); 56 | return ResponseEntity.ok(novaMovimentacao); 57 | } 58 | 59 | 60 | @PutMapping("/{idMovimentacaoPatrimonio}") 61 | public ResponseEntity updateMovimentacao(@PathVariable Long idMovimentacaoPatrimonio, 62 | @RequestBody Movimentacao_Patrimonio movimentacaoDetails) { 63 | Optional optionalMovimentacao = movPatrimonioService 64 | .findById(idMovimentacaoPatrimonio); 65 | if (optionalMovimentacao.isPresent()) { 66 | Movimentacao_Patrimonio movimentacao = optionalMovimentacao.get(); 67 | movimentacao.setSolicitante(movimentacaoDetails.getSolicitante()); 68 | movimentacao.setIdPatrimonio(movimentacaoDetails.getIdPatrimonio()); 69 | movimentacao.setOrigem(movimentacaoDetails.getOrigem()); 70 | movimentacao.setDestino(movimentacaoDetails.getDestino()); 71 | movimentacao.setDescricao(movimentacaoDetails.getDescricao()); 72 | movimentacao.setTipo(movimentacaoDetails.getTipo()); 73 | movimentacao.setStatus(movimentacaoDetails.getStatus()); 74 | movimentacao.setDataSolicitacao(movimentacaoDetails.getDataSolicitacao()); 75 | movimentacao.setDataAprovacao(movimentacaoDetails.getDataAprovacao()); 76 | Movimentacao_Patrimonio updatedMovimentacao = movPatrimonioService.save(movimentacao); 77 | return ResponseEntity.ok(updatedMovimentacao); 78 | } else { 79 | return ResponseEntity.notFound().build(); 80 | } 81 | } 82 | 83 | @DeleteMapping("/{idMovimentacaoPatrimonio}") 84 | public ResponseEntity deleteMovimentacao(@PathVariable Long idMovimentacaoPatrimonio) { 85 | Optional optionalMovimentacao = movPatrimonioService 86 | .findById(idMovimentacaoPatrimonio); 87 | if (optionalMovimentacao.isPresent()) { 88 | movPatrimonioService.deleteById(idMovimentacaoPatrimonio); 89 | return ResponseEntity.noContent().build(); 90 | } else { 91 | return ResponseEntity.notFound().build(); 92 | } 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /gerenciamento/src/main/java/com/example/gerenciamento/Controller/SalaController.java: -------------------------------------------------------------------------------- 1 | package com.example.gerenciamento.Controller; 2 | 3 | import java.util.List; 4 | import java.util.Optional; 5 | 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Controller; 8 | import org.springframework.ui.Model; 9 | import org.springframework.web.bind.annotation.GetMapping; 10 | import org.springframework.web.bind.annotation.PathVariable; 11 | import org.springframework.web.bind.annotation.PostMapping; 12 | import org.springframework.web.bind.annotation.RequestMapping; 13 | import org.springframework.web.bind.annotation.RequestMethod; 14 | import org.springframework.web.bind.annotation.RequestParam; 15 | import org.springframework.web.servlet.ModelAndView; 16 | 17 | import com.example.gerenciamento.Model.Funcionario; 18 | import com.example.gerenciamento.Model.Sala; 19 | import com.example.gerenciamento.Repository.FuncionarioRepository; 20 | import com.example.gerenciamento.Repository.SalaRepository; 21 | 22 | @Controller 23 | public class SalaController { 24 | @Autowired 25 | private SalaRepository salaRepository; 26 | 27 | @Autowired 28 | private FuncionarioRepository funcionarioRepository; 29 | 30 | @PostMapping("/cadastrar-sala") 31 | public String cadastrarSala(@RequestParam("funcionario.cpf") String cpf, @RequestParam("nSala") String nSala, 32 | @RequestParam("categoriaSala") String categoriaSala, Model model) { 33 | try { 34 | Funcionario funcionarioExistente = funcionarioRepository.findByCpf(cpf); 35 | if (funcionarioExistente == null) { 36 | model.addAttribute("erro", "Erro ao cadastrar sala: Funcionário não encontrado"); 37 | return "crud/oficina/cadastro-oficina"; 38 | } 39 | 40 | Sala sala = new Sala(); 41 | sala.setnSala(nSala); 42 | sala.setCategoriaSala(categoriaSala); 43 | sala.setFuncionario(funcionarioExistente); 44 | 45 | salaRepository.save(sala); 46 | System.out.println("Sala cadastrada com sucesso!"); 47 | return "redirect:/interna-funcionario"; 48 | } catch (Exception e) { 49 | model.addAttribute("erro", "Erro ao cadastrar sala: " + e.getMessage()); 50 | return "/crud/sala/cadastro-sala"; 51 | } 52 | } 53 | 54 | @GetMapping("/gerenciamento-sala") 55 | public String listarSalas(Model model) { 56 | List salas = (List) salaRepository.findAll(); 57 | model.addAttribute("salas", salas); 58 | return "gerenciamento/gerenciamento-sala"; 59 | } 60 | 61 | @RequestMapping(value = "/delete-sala/{nSala}", method = RequestMethod.GET) 62 | public String excluirSala(@PathVariable("nSala") String nSala) { 63 | try { 64 | Optional sala = salaRepository.findBynSala(nSala); 65 | if (sala.isPresent()) { 66 | salaRepository.delete(sala.get()); 67 | System.out.println("Sala excluída com sucesso!"); 68 | } else { 69 | System.out.println("Sala não encontrada para exclusão"); 70 | } 71 | } catch (Exception e) { 72 | System.out.println("Erro ao excluir Sala: " + e.getMessage()); 73 | } 74 | return "redirect:/gerenciamento-sala"; 75 | } 76 | 77 | @GetMapping("/edit-sala/{nSala}") 78 | public ModelAndView editarSala(@PathVariable("nSala") String nSala) { 79 | ModelAndView mv = new ModelAndView("crud/sala/edit-sala"); 80 | Optional sala = salaRepository.findBynSala(nSala); 81 | if (sala.isPresent()) { 82 | mv.addObject("nSala", nSala); 83 | mv.addObject("sala", sala.get()); 84 | } else { 85 | // Lógica para lidar com sala não encontrada, se necessário 86 | } 87 | return mv; 88 | } 89 | 90 | @PostMapping("/atualizar-sala") 91 | public String atualizarSala(@RequestParam("nSala") String nSala, @RequestParam("cpf") String cpf, @RequestParam("categoria_sala") String categoriaSala) { 92 | Optional salaExistente = salaRepository.findBynSala(nSala); 93 | if (salaExistente.isPresent()) { 94 | Sala salaAtualizada = salaExistente.get(); 95 | salaAtualizada.setCategoriaSala(categoriaSala); 96 | 97 | Optional funcionario = funcionarioRepository.findById(cpf); 98 | if (funcionario.isPresent()) { 99 | salaAtualizada.setFuncionario(funcionario.get()); 100 | } else { 101 | // Lógica para lidar com funcionário não encontrado, se necessário 102 | } 103 | 104 | salaRepository.save(salaAtualizada); 105 | return "redirect:/gerenciamento-sala"; 106 | } else { 107 | return "redirect:/gerenciamento-sala"; 108 | } 109 | } 110 | 111 | } -------------------------------------------------------------------------------- /gerenciamento/src/main/resources/static/css/style-login.css: -------------------------------------------------------------------------------- 1 | @import url("reset.css"); 2 | 3 | @import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap'); 4 | 5 | body { 6 | font-family: 'Poppins', sans-serif; 7 | /* min-height: 100vh; 8 | background: linear-gradient(to right, #333399, #ff00cc); */ 9 | /* display: flex; 10 | justify-content: center; 11 | align-items: center; */ 12 | } 13 | .login-card-container{ 14 | margin-top: 10%; 15 | flex-direction: column; 16 | display: flex; 17 | justify-content: center; 18 | align-items: center; 19 | } 20 | 21 | /* Login Card */ 22 | .login-card { 23 | width: 450px; 24 | background: rgba(146, 32, 32, 0.5); 25 | padding: 4rem; 26 | border-radius: 10px; 27 | position: relative; 28 | } 29 | 30 | .login-card::before { 31 | content: ''; 32 | position: absolute; 33 | inset: 0; 34 | background: rgba(255, 255, 255, 0.15); 35 | transform: rotate(-6deg); 36 | border-radius: 10px; 37 | z-index: -1; 38 | } 39 | /* ---------- */ 40 | 41 | /* Login Card Logo */ 42 | .login-card-logo { 43 | margin-bottom: 2rem; 44 | } 45 | 46 | .login-card-logo i .ri-admin-fill{ 47 | width: 160px; 48 | } 49 | /* ---------- */ 50 | 51 | /* Login Card Standard */ 52 | .login-card-logo, 53 | .login-card-header, 54 | .login-card-footer { 55 | text-align: center; 56 | } 57 | 58 | .login-card a { 59 | text-decoration: none; 60 | color: #35339a; 61 | } 62 | 63 | .login-card a:hover { 64 | text-decoration: underline; 65 | } 66 | /* ---------- */ 67 | 68 | /* Login Card Header */ 69 | .login-card-header { 70 | margin-bottom: 2rem; 71 | } 72 | 73 | .login-card-header h1 { 74 | font-size: 2rem; 75 | font-weight: 600; 76 | margin-bottom: .5rem; 77 | } 78 | 79 | .login-card-header h1+div { 80 | font-size: calc(1rem * .8); 81 | opacity: .8; 82 | } 83 | /* ---------- */ 84 | 85 | /* Login Card Form */ 86 | .login-card-form { 87 | display: flex; 88 | flex-direction: column; 89 | gap: 1.5rem; 90 | } 91 | 92 | .login-card-form .form-item { 93 | position: relative; 94 | } 95 | 96 | .login-card-form .form-item .form-item-icon { 97 | position: absolute; 98 | top: .82rem; 99 | left: 1.4rem; 100 | font-size: 1.3rem; 101 | opacity: .4; 102 | } 103 | 104 | .login-card-form .checkbox { 105 | display: flex; 106 | align-items: center; 107 | gap: 7px; 108 | } 109 | 110 | .login-card-form .form-item-other { 111 | display: flex; 112 | align-items: center; 113 | justify-content: space-between; 114 | font-size: calc(1rem * .8); 115 | margin-bottom: .5rem; 116 | } 117 | /* ---------- */ 118 | 119 | /* Login Card Footer */ 120 | .login-card-footer { 121 | margin-top: 1.5rem; 122 | font-size: calc(1rem * .8); 123 | } 124 | /* ---------- */ 125 | 126 | /* Login Card Form Elements */ 127 | .login-card input[type="text"], 128 | .login-card input[type="password"], 129 | .login-card input[type="email"] { 130 | border: none; 131 | outline: none; 132 | background: rgba(255, 255, 255, .3); 133 | padding: 1rem 1.5rem; 134 | padding-left: calc(1rem * 3.5); 135 | border-radius: 100px; 136 | width: 100%; 137 | transition: background .5s; 138 | } 139 | 140 | .login-card input:focus { 141 | background: white; 142 | } 143 | 144 | 145 | 146 | .login-card button { 147 | background: rgb(231, 32, 32); 148 | color: white; 149 | padding: 1rem; 150 | border-radius: 100px; 151 | text-align: center; 152 | text-transform: uppercase; 153 | letter-spacing: 2px; 154 | transition: background .5s; 155 | } 156 | 157 | .login-card button:hover { 158 | background-color: rgba(0, 0, 0, 0.85); 159 | cursor: pointer; 160 | } 161 | /* ---------- */ 162 | 163 | /* Login Card Social Buttons */ 164 | .login-card-social { 165 | display: flex; 166 | flex-direction: column; 167 | gap: 1.5rem; 168 | text-align: center; 169 | margin-top: 3rem; 170 | } 171 | 172 | .login-card-social>div { 173 | opacity: .8; 174 | text-transform: uppercase; 175 | letter-spacing: 1px; 176 | font-size: calc(1rem * .8); 177 | } 178 | 179 | .login-card-social-btns { 180 | display: flex; 181 | align-items: center; 182 | justify-content: center; 183 | gap: 1rem; 184 | } 185 | 186 | .login-card-social-btns a { 187 | display: flex; 188 | align-items: center; 189 | justify-content: center; 190 | color: black; 191 | width: 50px; 192 | height: 50px; 193 | background-color: rgba(255, 255, 255, .6); 194 | border-radius: 100px; 195 | transition: all .5s; 196 | } 197 | 198 | .login-card-social-btns a:hover { 199 | background-color: white; 200 | transform: scale(1.1); 201 | } 202 | 203 | .error-message { 204 | margin-top: 1vh; 205 | color: whitesmoke; 206 | } 207 | /* ---------- */ 208 | 209 | 210 | /* Responsive */ 211 | @media (max-width: 768px) { 212 | 213 | body { 214 | padding: 2rem 0; 215 | } 216 | 217 | .login-card { 218 | width: 280px; 219 | padding: 2rem; 220 | } 221 | 222 | } 223 | /* ---------- */ -------------------------------------------------------------------------------- /gerenciamento/src/main/java/com/example/gerenciamento/RestController/PatrimonioRestController.java: -------------------------------------------------------------------------------- 1 | package com.example.gerenciamento.RestController; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.http.ResponseEntity; 5 | import org.springframework.web.bind.annotation.*; 6 | 7 | import com.example.gerenciamento.Model.Oficina; 8 | import com.example.gerenciamento.Model.Patrimonio; 9 | import com.example.gerenciamento.Model.Sala; 10 | import com.example.gerenciamento.Services.OficinaService; 11 | import com.example.gerenciamento.Services.PatrimonioService; 12 | import com.example.gerenciamento.Services.SalaService; 13 | 14 | import java.util.Optional; 15 | 16 | import org.slf4j.Logger; 17 | import org.slf4j.LoggerFactory; 18 | 19 | @RestController 20 | @RequestMapping("/api/patrimonios") 21 | public class PatrimonioRestController { 22 | 23 | private static final Logger logger = LoggerFactory.getLogger(PatrimonioRestController.class); 24 | 25 | @Autowired 26 | private PatrimonioService patrimonioService; 27 | 28 | @Autowired 29 | private SalaService salaService; 30 | 31 | @Autowired 32 | private OficinaService oficinaService; 33 | 34 | @GetMapping 35 | public Iterable getAllPatrimonios() { 36 | return patrimonioService.findAll(); 37 | } 38 | 39 | @GetMapping("/{idPatrimonio}") 40 | public ResponseEntity getPatrimonioByIdPatrimonio(@PathVariable Long idPatrimonio) { 41 | logger.info("Recebida requisição GET para buscar patrimônio com idPatrimonio: {}", idPatrimonio); 42 | Optional patrimonio = patrimonioService.findByIdPatrimonio(idPatrimonio); 43 | if (patrimonio.isPresent()) { 44 | return ResponseEntity.ok(patrimonio.get()); 45 | } else { 46 | logger.warn("Patrimônio com idPatrimonio {} não encontrado", idPatrimonio); 47 | return ResponseEntity.notFound().build(); 48 | } 49 | } 50 | 51 | @PostMapping 52 | public ResponseEntity createPatrimonio(@RequestBody Patrimonio patrimonio) { 53 | logger.info("Recebida requisição POST para criar um novo patrimônio"); 54 | if (patrimonio.getIdPatrimonio() == null) { 55 | logger.error("Falha ao criar patrimônio: nPatrimonio ausente ou vazio"); 56 | return ResponseEntity.badRequest().body(null); 57 | } 58 | 59 | Optional salaOpt = salaService.findByNSala(patrimonio.getSala().getnSala()); 60 | Optional oficinaOpt = oficinaService.findById(patrimonio.getOficina().getIdOficina()); 61 | 62 | if (salaOpt.isPresent() && oficinaOpt.isPresent()) { 63 | patrimonio.setSala(salaOpt.get()); 64 | patrimonio.setOficina(oficinaOpt.get()); 65 | Patrimonio savedPatrimonio = patrimonioService.save(patrimonio); 66 | logger.info("Patrimônio criado com sucesso: {}", savedPatrimonio); 67 | return ResponseEntity.ok(savedPatrimonio); 68 | } else { 69 | logger.error("Falha ao criar patrimônio: Sala ou Oficina não encontrada"); 70 | return ResponseEntity.badRequest().body(null); 71 | } 72 | } 73 | 74 | @PutMapping("/{idPatrimonio}") 75 | public ResponseEntity updatePatrimonio(@PathVariable Long idPatrimonio, @RequestBody Patrimonio patrimonioDetails) { 76 | logger.info("Recebida requisição PUT para atualizar o patrimônio com idPatrimonio: {}", idPatrimonio); 77 | Optional optionalPatrimonio = patrimonioService.findByIdPatrimonio(idPatrimonio); 78 | if (optionalPatrimonio.isPresent()) { 79 | Patrimonio patrimonio = optionalPatrimonio.get(); 80 | patrimonio.setNome(patrimonioDetails.getNome()); 81 | patrimonio.setDescricao(patrimonioDetails.getDescricao()); 82 | patrimonio.setCategoriaPatrimonio(patrimonioDetails.getCategoriaPatrimonio()); 83 | patrimonio.setStatus(patrimonioDetails.getStatus()); 84 | patrimonio.setUltimaManutencao(patrimonioDetails.getUltimaManutencao()); 85 | patrimonio.setSala(patrimonioDetails.getSala()); 86 | patrimonio.setOficina(patrimonioDetails.getOficina()); 87 | Patrimonio updatedPatrimonio = patrimonioService.save(patrimonio); 88 | logger.info("Patrimônio atualizado com sucesso: {}", updatedPatrimonio); 89 | return ResponseEntity.ok(updatedPatrimonio); 90 | } else { 91 | logger.warn("Patrimônio com idPatrimonio {} não encontrado para atualização", idPatrimonio); 92 | return ResponseEntity.notFound().build(); 93 | } 94 | } 95 | 96 | @DeleteMapping("/{idPatrimonio}") 97 | public ResponseEntity deletePatrimonio(@PathVariable Long idPatrimonio) { 98 | logger.info("Recebida requisição DELETE para deletar patrimônio com idPatrimonio: {}", idPatrimonio); 99 | Optional optionalPatrimonio = patrimonioService.findByIdPatrimonio(idPatrimonio); 100 | if (optionalPatrimonio.isPresent()) { 101 | patrimonioService.deleteByIdPatrimonio(idPatrimonio); 102 | logger.info("Patrimônio com idPatrimonio {} deletado com sucesso", idPatrimonio); 103 | return ResponseEntity.noContent().build(); 104 | } else { 105 | logger.warn("Patrimônio com idPatrimonio {} não encontrado para deletar", idPatrimonio); 106 | return ResponseEntity.notFound().build(); 107 | } 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /gerenciamento/src/main/resources/templates/manutencoes/manutencoes.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Página Inicial 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 |
23 |

Movimentações de Patrimônios

24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 |
IDSolicitanteOrigemDestinoDescriçãoTipoStatusData SolicitaçãoData Aprovação
1João SilvaEscritório AEscritório BTransferência de computadorInternaAprovado01/06/202402/06/2024
2Maria OliveiraArmazém 1Loja CentralEnvio de móveisExternaPendente05/06/2024-
3Carlos PereiraDepartamento TISala de ReuniõesRealocação de projetorInternaRejeitado10/06/202411/06/2024
74 | 75 |

Movimentações de Estoque

76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 |
IDSolicitanteDescriçãoTipoStatusData SolicitaçãoData Aprovação
1Ana CostaCompra de papel A4CompraAprovado01/06/202402/06/2024
2Ricardo LimaSolicitação de cartuchos de impressoraRequisiçãoPendente05/06/2024-
3Fernanda SouzaEnvio de materiais de limpezaTransferênciaRejeitado10/06/202411/06/2024
118 |
119 | 120 |
121 | 122 | 123 | -------------------------------------------------------------------------------- /gerenciamento/src/main/java/com/example/gerenciamento/Controller/FuncionarioController.java: -------------------------------------------------------------------------------- 1 | package com.example.gerenciamento.Controller; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Controller; 7 | import org.springframework.ui.Model; 8 | import org.springframework.web.bind.annotation.GetMapping; 9 | import org.springframework.web.bind.annotation.PathVariable; 10 | import org.springframework.web.bind.annotation.PostMapping; 11 | import org.springframework.web.bind.annotation.RequestMapping; 12 | import org.springframework.web.bind.annotation.RequestMethod; 13 | import org.springframework.web.bind.annotation.RequestParam; 14 | import org.springframework.web.servlet.ModelAndView; 15 | 16 | import com.example.gerenciamento.Model.Funcionario; 17 | import com.example.gerenciamento.Repository.FuncionarioRepository; 18 | 19 | import jakarta.servlet.http.HttpSession; 20 | 21 | @Controller 22 | public class FuncionarioController { 23 | @Autowired 24 | private FuncionarioRepository funcionarioRepository; 25 | 26 | @Autowired 27 | private HttpSession httpSession; 28 | 29 | boolean acessoFuncionario = false; 30 | 31 | @PostMapping("/cadastrar-funcionario") 32 | public String cadastrarFuncionarioBD(Funcionario funcionario, Model model) { 33 | try { 34 | funcionarioRepository.save(funcionario); 35 | System.out.println("Cadastro realizado com sucesso!"); 36 | return "index"; 37 | } catch (Exception e) { 38 | System.out.println("Erro ao cadastrar funcionario: " + e.getMessage()); 39 | model.addAttribute("erroSenha", "Sua senha está incorreta"); 40 | return "/cadastro/cadastro-funcionario"; 41 | } 42 | } 43 | 44 | @GetMapping("/logout-funcionario") 45 | public String logout(HttpSession session) { 46 | session.invalidate(); 47 | return "redirect:/"; 48 | } 49 | 50 | @GetMapping("/interna-funcionario") 51 | public String acessoPageInternaFuncionario() { 52 | String vaiPara = ""; 53 | if (acessoFuncionario) { 54 | vaiPara = "interna/interna-funcionario"; 55 | } else { 56 | vaiPara = "redirect:/"; 57 | } 58 | return vaiPara; 59 | } 60 | 61 | @PostMapping("acesso-funcionario") 62 | public String acessoFuncionario(@RequestParam String cpf, @RequestParam String senha, Model model) { 63 | try { 64 | boolean verificaCpf = funcionarioRepository.existsById(cpf); 65 | boolean verificaSenha = funcionarioRepository.findByCpf(cpf).getSenha().equals(senha); 66 | String url = ""; 67 | if (verificaCpf && verificaSenha) { 68 | Funcionario funcionario = funcionarioRepository.findByCpf(cpf); 69 | httpSession.setAttribute("funcionario", funcionario); 70 | httpSession.setAttribute("loggedin", true); 71 | acessoFuncionario = true; 72 | url = "redirect:/interna-funcionario"; 73 | } else { 74 | model.addAttribute("erro", "Credenciais incorretas"); 75 | url = "/"; 76 | } 77 | return url; 78 | } catch (Exception e) { 79 | model.addAttribute("erro", "Credenciais incorretas"); 80 | return "/"; 81 | } 82 | } 83 | 84 | @GetMapping("/gerenciamento-funcionario") 85 | public String listarFuncionarios(Model model) { 86 | List funcionarios = (List) funcionarioRepository.findAll(); 87 | model.addAttribute("funcionarios", funcionarios); 88 | return "gerenciamento/gerenciamento-funcionario"; 89 | } 90 | 91 | @RequestMapping(value = "/delete-funcionario/{cpf}", method = RequestMethod.GET) 92 | public String excluirFuncionario(@PathVariable("cpf") String cpf) { 93 | try { 94 | Funcionario funcionario = funcionarioRepository.findByCpf(cpf); 95 | if (funcionario != null) { 96 | funcionarioRepository.delete(funcionario); 97 | System.out.println("Funcionario excluído com sucesso!"); 98 | } else { 99 | System.out.println("Funcionario não encontrado para exclusão"); 100 | } 101 | } catch (Exception e) { 102 | System.out.println("Erro ao excluir Funcionario: " + e.getMessage()); 103 | } 104 | return "redirect:/gerenciamento-funcionario"; 105 | } 106 | 107 | @RequestMapping(value = "/edit-funcionario/{cpf}", method = RequestMethod.GET) 108 | public ModelAndView editarFuncionario(@PathVariable("cpf") String cpf) { 109 | ModelAndView mv = new ModelAndView("crud/funcionario/edit-funcionario"); 110 | Funcionario funcionario = funcionarioRepository.findByCpf(cpf); 111 | mv.addObject("cpf", cpf); 112 | mv.addObject("funcionario", funcionario); 113 | return mv; 114 | } 115 | 116 | @PostMapping("/atualizar-funcionario") 117 | public String atualizarFuncionario(@RequestParam("cpf") String cpf, Funcionario funcionario) { 118 | Funcionario funcionarioExistente = funcionarioRepository.findByCpf(cpf); 119 | if (funcionarioExistente != null) { 120 | funcionarioExistente.setNomeFuncionario(funcionario.getNomeFuncionario()); 121 | funcionarioExistente.setCpf(funcionario.getCpf()); 122 | funcionarioExistente.setCargo(funcionario.getCargo()); 123 | funcionarioExistente.setEmail(funcionario.getEmail()); 124 | funcionarioRepository.save(funcionarioExistente); 125 | return "redirect:/gerenciamento-funcionario"; 126 | } else { 127 | return "redirect:/gerenciamento-funcionario"; 128 | } 129 | } 130 | 131 | @GetMapping("/interna-funcionario/{cpf}") 132 | public ModelAndView paginaFuncionario(@PathVariable("cpf") String cpf) { 133 | ModelAndView mv = new ModelAndView("interna/interna-funcionario"); 134 | Funcionario funcionario = funcionarioRepository.findByCpf(cpf); 135 | 136 | if (funcionario != null) { 137 | mv.addObject("funcionario", funcionario); 138 | } else { 139 | 140 | } 141 | 142 | return mv; 143 | } 144 | 145 | } 146 | -------------------------------------------------------------------------------- /gerenciamento/mvnw.cmd: -------------------------------------------------------------------------------- 1 | @REM ---------------------------------------------------------------------------- 2 | @REM Licensed to the Apache Software Foundation (ASF) under one 3 | @REM or more contributor license agreements. See the NOTICE file 4 | @REM distributed with this work for additional information 5 | @REM regarding copyright ownership. The ASF licenses this file 6 | @REM to you under the Apache License, Version 2.0 (the 7 | @REM "License"); you may not use this file except in compliance 8 | @REM with the License. You may obtain a copy of the License at 9 | @REM 10 | @REM https://www.apache.org/licenses/LICENSE-2.0 11 | @REM 12 | @REM Unless required by applicable law or agreed to in writing, 13 | @REM software distributed under the License is distributed on an 14 | @REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | @REM KIND, either express or implied. See the License for the 16 | @REM specific language governing permissions and limitations 17 | @REM under the License. 18 | @REM ---------------------------------------------------------------------------- 19 | 20 | @REM ---------------------------------------------------------------------------- 21 | @REM Apache Maven Wrapper startup batch script, version 3.2.0 22 | @REM 23 | @REM Required ENV vars: 24 | @REM JAVA_HOME - location of a JDK home dir 25 | @REM 26 | @REM Optional ENV vars 27 | @REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands 28 | @REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending 29 | @REM MAVEN_OPTS - parameters passed to the Java VM when running Maven 30 | @REM e.g. to debug Maven itself, use 31 | @REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 32 | @REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files 33 | @REM ---------------------------------------------------------------------------- 34 | 35 | @REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' 36 | @echo off 37 | @REM set title of command window 38 | title %0 39 | @REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' 40 | @if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% 41 | 42 | @REM set %HOME% to equivalent of $HOME 43 | if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") 44 | 45 | @REM Execute a user defined script before this one 46 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre 47 | @REM check for pre script, once with legacy .bat ending and once with .cmd ending 48 | if exist "%USERPROFILE%\mavenrc_pre.bat" call "%USERPROFILE%\mavenrc_pre.bat" %* 49 | if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\mavenrc_pre.cmd" %* 50 | :skipRcPre 51 | 52 | @setlocal 53 | 54 | set ERROR_CODE=0 55 | 56 | @REM To isolate internal variables from possible post scripts, we use another setlocal 57 | @setlocal 58 | 59 | @REM ==== START VALIDATION ==== 60 | if not "%JAVA_HOME%" == "" goto OkJHome 61 | 62 | echo. 63 | echo Error: JAVA_HOME not found in your environment. >&2 64 | echo Please set the JAVA_HOME variable in your environment to match the >&2 65 | echo location of your Java installation. >&2 66 | echo. 67 | goto error 68 | 69 | :OkJHome 70 | if exist "%JAVA_HOME%\bin\java.exe" goto init 71 | 72 | echo. 73 | echo Error: JAVA_HOME is set to an invalid directory. >&2 74 | echo JAVA_HOME = "%JAVA_HOME%" >&2 75 | echo Please set the JAVA_HOME variable in your environment to match the >&2 76 | echo location of your Java installation. >&2 77 | echo. 78 | goto error 79 | 80 | @REM ==== END VALIDATION ==== 81 | 82 | :init 83 | 84 | @REM Find the project base dir, i.e. the directory that contains the folder ".mvn". 85 | @REM Fallback to current working directory if not found. 86 | 87 | set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% 88 | IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir 89 | 90 | set EXEC_DIR=%CD% 91 | set WDIR=%EXEC_DIR% 92 | :findBaseDir 93 | IF EXIST "%WDIR%"\.mvn goto baseDirFound 94 | cd .. 95 | IF "%WDIR%"=="%CD%" goto baseDirNotFound 96 | set WDIR=%CD% 97 | goto findBaseDir 98 | 99 | :baseDirFound 100 | set MAVEN_PROJECTBASEDIR=%WDIR% 101 | cd "%EXEC_DIR%" 102 | goto endDetectBaseDir 103 | 104 | :baseDirNotFound 105 | set MAVEN_PROJECTBASEDIR=%EXEC_DIR% 106 | cd "%EXEC_DIR%" 107 | 108 | :endDetectBaseDir 109 | 110 | IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig 111 | 112 | @setlocal EnableExtensions EnableDelayedExpansion 113 | for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a 114 | @endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% 115 | 116 | :endReadAdditionalConfig 117 | 118 | SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" 119 | set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" 120 | set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 121 | 122 | set WRAPPER_URL="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar" 123 | 124 | FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( 125 | IF "%%A"=="wrapperUrl" SET WRAPPER_URL=%%B 126 | ) 127 | 128 | @REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central 129 | @REM This allows using the maven wrapper in projects that prohibit checking in binary data. 130 | if exist %WRAPPER_JAR% ( 131 | if "%MVNW_VERBOSE%" == "true" ( 132 | echo Found %WRAPPER_JAR% 133 | ) 134 | ) else ( 135 | if not "%MVNW_REPOURL%" == "" ( 136 | SET WRAPPER_URL="%MVNW_REPOURL%/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar" 137 | ) 138 | if "%MVNW_VERBOSE%" == "true" ( 139 | echo Couldn't find %WRAPPER_JAR%, downloading it ... 140 | echo Downloading from: %WRAPPER_URL% 141 | ) 142 | 143 | powershell -Command "&{"^ 144 | "$webclient = new-object System.Net.WebClient;"^ 145 | "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ 146 | "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ 147 | "}"^ 148 | "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%WRAPPER_URL%', '%WRAPPER_JAR%')"^ 149 | "}" 150 | if "%MVNW_VERBOSE%" == "true" ( 151 | echo Finished downloading %WRAPPER_JAR% 152 | ) 153 | ) 154 | @REM End of extension 155 | 156 | @REM If specified, validate the SHA-256 sum of the Maven wrapper jar file 157 | SET WRAPPER_SHA_256_SUM="" 158 | FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( 159 | IF "%%A"=="wrapperSha256Sum" SET WRAPPER_SHA_256_SUM=%%B 160 | ) 161 | IF NOT %WRAPPER_SHA_256_SUM%=="" ( 162 | powershell -Command "&{"^ 163 | "$hash = (Get-FileHash \"%WRAPPER_JAR%\" -Algorithm SHA256).Hash.ToLower();"^ 164 | "If('%WRAPPER_SHA_256_SUM%' -ne $hash){"^ 165 | " Write-Output 'Error: Failed to validate Maven wrapper SHA-256, your Maven wrapper might be compromised.';"^ 166 | " Write-Output 'Investigate or delete %WRAPPER_JAR% to attempt a clean download.';"^ 167 | " Write-Output 'If you updated your Maven version, you need to update the specified wrapperSha256Sum property.';"^ 168 | " exit 1;"^ 169 | "}"^ 170 | "}" 171 | if ERRORLEVEL 1 goto error 172 | ) 173 | 174 | @REM Provide a "standardized" way to retrieve the CLI args that will 175 | @REM work with both Windows and non-Windows executions. 176 | set MAVEN_CMD_LINE_ARGS=%* 177 | 178 | %MAVEN_JAVA_EXE% ^ 179 | %JVM_CONFIG_MAVEN_PROPS% ^ 180 | %MAVEN_OPTS% ^ 181 | %MAVEN_DEBUG_OPTS% ^ 182 | -classpath %WRAPPER_JAR% ^ 183 | "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^ 184 | %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* 185 | if ERRORLEVEL 1 goto error 186 | goto end 187 | 188 | :error 189 | set ERROR_CODE=1 190 | 191 | :end 192 | @endlocal & set ERROR_CODE=%ERROR_CODE% 193 | 194 | if not "%MAVEN_SKIP_RC%"=="" goto skipRcPost 195 | @REM check for post script, once with legacy .bat ending and once with .cmd ending 196 | if exist "%USERPROFILE%\mavenrc_post.bat" call "%USERPROFILE%\mavenrc_post.bat" 197 | if exist "%USERPROFILE%\mavenrc_post.cmd" call "%USERPROFILE%\mavenrc_post.cmd" 198 | :skipRcPost 199 | 200 | @REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' 201 | if "%MAVEN_BATCH_PAUSE%"=="on" pause 202 | 203 | if "%MAVEN_TERMINATE_CMD%"=="on" exit %ERROR_CODE% 204 | 205 | cmd /C exit /B %ERROR_CODE% 206 | -------------------------------------------------------------------------------- /gerenciamento/mvnw: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # ---------------------------------------------------------------------------- 3 | # Licensed to the Apache Software Foundation (ASF) under one 4 | # or more contributor license agreements. See the NOTICE file 5 | # distributed with this work for additional information 6 | # regarding copyright ownership. The ASF licenses this file 7 | # to you under the Apache License, Version 2.0 (the 8 | # "License"); you may not use this file except in compliance 9 | # with the License. You may obtain a copy of the License at 10 | # 11 | # https://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, 14 | # software distributed under the License is distributed on an 15 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | # KIND, either express or implied. See the License for the 17 | # specific language governing permissions and limitations 18 | # under the License. 19 | # ---------------------------------------------------------------------------- 20 | 21 | # ---------------------------------------------------------------------------- 22 | # Apache Maven Wrapper startup batch script, version 3.2.0 23 | # 24 | # Required ENV vars: 25 | # ------------------ 26 | # JAVA_HOME - location of a JDK home dir 27 | # 28 | # Optional ENV vars 29 | # ----------------- 30 | # MAVEN_OPTS - parameters passed to the Java VM when running Maven 31 | # e.g. to debug Maven itself, use 32 | # set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 33 | # MAVEN_SKIP_RC - flag to disable loading of mavenrc files 34 | # ---------------------------------------------------------------------------- 35 | 36 | if [ -z "$MAVEN_SKIP_RC" ] ; then 37 | 38 | if [ -f /usr/local/etc/mavenrc ] ; then 39 | . /usr/local/etc/mavenrc 40 | fi 41 | 42 | if [ -f /etc/mavenrc ] ; then 43 | . /etc/mavenrc 44 | fi 45 | 46 | if [ -f "$HOME/.mavenrc" ] ; then 47 | . "$HOME/.mavenrc" 48 | fi 49 | 50 | fi 51 | 52 | # OS specific support. $var _must_ be set to either true or false. 53 | cygwin=false; 54 | darwin=false; 55 | mingw=false 56 | case "$(uname)" in 57 | CYGWIN*) cygwin=true ;; 58 | MINGW*) mingw=true;; 59 | Darwin*) darwin=true 60 | # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home 61 | # See https://developer.apple.com/library/mac/qa/qa1170/_index.html 62 | if [ -z "$JAVA_HOME" ]; then 63 | if [ -x "/usr/libexec/java_home" ]; then 64 | JAVA_HOME="$(/usr/libexec/java_home)"; export JAVA_HOME 65 | else 66 | JAVA_HOME="/Library/Java/Home"; export JAVA_HOME 67 | fi 68 | fi 69 | ;; 70 | esac 71 | 72 | if [ -z "$JAVA_HOME" ] ; then 73 | if [ -r /etc/gentoo-release ] ; then 74 | JAVA_HOME=$(java-config --jre-home) 75 | fi 76 | fi 77 | 78 | # For Cygwin, ensure paths are in UNIX format before anything is touched 79 | if $cygwin ; then 80 | [ -n "$JAVA_HOME" ] && 81 | JAVA_HOME=$(cygpath --unix "$JAVA_HOME") 82 | [ -n "$CLASSPATH" ] && 83 | CLASSPATH=$(cygpath --path --unix "$CLASSPATH") 84 | fi 85 | 86 | # For Mingw, ensure paths are in UNIX format before anything is touched 87 | if $mingw ; then 88 | [ -n "$JAVA_HOME" ] && [ -d "$JAVA_HOME" ] && 89 | JAVA_HOME="$(cd "$JAVA_HOME" || (echo "cannot cd into $JAVA_HOME."; exit 1); pwd)" 90 | fi 91 | 92 | if [ -z "$JAVA_HOME" ]; then 93 | javaExecutable="$(which javac)" 94 | if [ -n "$javaExecutable" ] && ! [ "$(expr "\"$javaExecutable\"" : '\([^ ]*\)')" = "no" ]; then 95 | # readlink(1) is not available as standard on Solaris 10. 96 | readLink=$(which readlink) 97 | if [ ! "$(expr "$readLink" : '\([^ ]*\)')" = "no" ]; then 98 | if $darwin ; then 99 | javaHome="$(dirname "\"$javaExecutable\"")" 100 | javaExecutable="$(cd "\"$javaHome\"" && pwd -P)/javac" 101 | else 102 | javaExecutable="$(readlink -f "\"$javaExecutable\"")" 103 | fi 104 | javaHome="$(dirname "\"$javaExecutable\"")" 105 | javaHome=$(expr "$javaHome" : '\(.*\)/bin') 106 | JAVA_HOME="$javaHome" 107 | export JAVA_HOME 108 | fi 109 | fi 110 | fi 111 | 112 | if [ -z "$JAVACMD" ] ; then 113 | if [ -n "$JAVA_HOME" ] ; then 114 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 115 | # IBM's JDK on AIX uses strange locations for the executables 116 | JAVACMD="$JAVA_HOME/jre/sh/java" 117 | else 118 | JAVACMD="$JAVA_HOME/bin/java" 119 | fi 120 | else 121 | JAVACMD="$(\unset -f command 2>/dev/null; \command -v java)" 122 | fi 123 | fi 124 | 125 | if [ ! -x "$JAVACMD" ] ; then 126 | echo "Error: JAVA_HOME is not defined correctly." >&2 127 | echo " We cannot execute $JAVACMD" >&2 128 | exit 1 129 | fi 130 | 131 | if [ -z "$JAVA_HOME" ] ; then 132 | echo "Warning: JAVA_HOME environment variable is not set." 133 | fi 134 | 135 | # traverses directory structure from process work directory to filesystem root 136 | # first directory with .mvn subdirectory is considered project base directory 137 | find_maven_basedir() { 138 | if [ -z "$1" ] 139 | then 140 | echo "Path not specified to find_maven_basedir" 141 | return 1 142 | fi 143 | 144 | basedir="$1" 145 | wdir="$1" 146 | while [ "$wdir" != '/' ] ; do 147 | if [ -d "$wdir"/.mvn ] ; then 148 | basedir=$wdir 149 | break 150 | fi 151 | # workaround for JBEAP-8937 (on Solaris 10/Sparc) 152 | if [ -d "${wdir}" ]; then 153 | wdir=$(cd "$wdir/.." || exit 1; pwd) 154 | fi 155 | # end of workaround 156 | done 157 | printf '%s' "$(cd "$basedir" || exit 1; pwd)" 158 | } 159 | 160 | # concatenates all lines of a file 161 | concat_lines() { 162 | if [ -f "$1" ]; then 163 | # Remove \r in case we run on Windows within Git Bash 164 | # and check out the repository with auto CRLF management 165 | # enabled. Otherwise, we may read lines that are delimited with 166 | # \r\n and produce $'-Xarg\r' rather than -Xarg due to word 167 | # splitting rules. 168 | tr -s '\r\n' ' ' < "$1" 169 | fi 170 | } 171 | 172 | log() { 173 | if [ "$MVNW_VERBOSE" = true ]; then 174 | printf '%s\n' "$1" 175 | fi 176 | } 177 | 178 | BASE_DIR=$(find_maven_basedir "$(dirname "$0")") 179 | if [ -z "$BASE_DIR" ]; then 180 | exit 1; 181 | fi 182 | 183 | MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}; export MAVEN_PROJECTBASEDIR 184 | log "$MAVEN_PROJECTBASEDIR" 185 | 186 | ########################################################################################## 187 | # Extension to allow automatically downloading the maven-wrapper.jar from Maven-central 188 | # This allows using the maven wrapper in projects that prohibit checking in binary data. 189 | ########################################################################################## 190 | wrapperJarPath="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" 191 | if [ -r "$wrapperJarPath" ]; then 192 | log "Found $wrapperJarPath" 193 | else 194 | log "Couldn't find $wrapperJarPath, downloading it ..." 195 | 196 | if [ -n "$MVNW_REPOURL" ]; then 197 | wrapperUrl="$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar" 198 | else 199 | wrapperUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar" 200 | fi 201 | while IFS="=" read -r key value; do 202 | # Remove '\r' from value to allow usage on windows as IFS does not consider '\r' as a separator ( considers space, tab, new line ('\n'), and custom '=' ) 203 | safeValue=$(echo "$value" | tr -d '\r') 204 | case "$key" in (wrapperUrl) wrapperUrl="$safeValue"; break ;; 205 | esac 206 | done < "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.properties" 207 | log "Downloading from: $wrapperUrl" 208 | 209 | if $cygwin; then 210 | wrapperJarPath=$(cygpath --path --windows "$wrapperJarPath") 211 | fi 212 | 213 | if command -v wget > /dev/null; then 214 | log "Found wget ... using wget" 215 | [ "$MVNW_VERBOSE" = true ] && QUIET="" || QUIET="--quiet" 216 | if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then 217 | wget $QUIET "$wrapperUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath" 218 | else 219 | wget $QUIET --http-user="$MVNW_USERNAME" --http-password="$MVNW_PASSWORD" "$wrapperUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath" 220 | fi 221 | elif command -v curl > /dev/null; then 222 | log "Found curl ... using curl" 223 | [ "$MVNW_VERBOSE" = true ] && QUIET="" || QUIET="--silent" 224 | if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then 225 | curl $QUIET -o "$wrapperJarPath" "$wrapperUrl" -f -L || rm -f "$wrapperJarPath" 226 | else 227 | curl $QUIET --user "$MVNW_USERNAME:$MVNW_PASSWORD" -o "$wrapperJarPath" "$wrapperUrl" -f -L || rm -f "$wrapperJarPath" 228 | fi 229 | else 230 | log "Falling back to using Java to download" 231 | javaSource="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/MavenWrapperDownloader.java" 232 | javaClass="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/MavenWrapperDownloader.class" 233 | # For Cygwin, switch paths to Windows format before running javac 234 | if $cygwin; then 235 | javaSource=$(cygpath --path --windows "$javaSource") 236 | javaClass=$(cygpath --path --windows "$javaClass") 237 | fi 238 | if [ -e "$javaSource" ]; then 239 | if [ ! -e "$javaClass" ]; then 240 | log " - Compiling MavenWrapperDownloader.java ..." 241 | ("$JAVA_HOME/bin/javac" "$javaSource") 242 | fi 243 | if [ -e "$javaClass" ]; then 244 | log " - Running MavenWrapperDownloader.java ..." 245 | ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$wrapperUrl" "$wrapperJarPath") || rm -f "$wrapperJarPath" 246 | fi 247 | fi 248 | fi 249 | fi 250 | ########################################################################################## 251 | # End of extension 252 | ########################################################################################## 253 | 254 | # If specified, validate the SHA-256 sum of the Maven wrapper jar file 255 | wrapperSha256Sum="" 256 | while IFS="=" read -r key value; do 257 | case "$key" in (wrapperSha256Sum) wrapperSha256Sum=$value; break ;; 258 | esac 259 | done < "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.properties" 260 | if [ -n "$wrapperSha256Sum" ]; then 261 | wrapperSha256Result=false 262 | if command -v sha256sum > /dev/null; then 263 | if echo "$wrapperSha256Sum $wrapperJarPath" | sha256sum -c > /dev/null 2>&1; then 264 | wrapperSha256Result=true 265 | fi 266 | elif command -v shasum > /dev/null; then 267 | if echo "$wrapperSha256Sum $wrapperJarPath" | shasum -a 256 -c > /dev/null 2>&1; then 268 | wrapperSha256Result=true 269 | fi 270 | else 271 | echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available." 272 | echo "Please install either command, or disable validation by removing 'wrapperSha256Sum' from your maven-wrapper.properties." 273 | exit 1 274 | fi 275 | if [ $wrapperSha256Result = false ]; then 276 | echo "Error: Failed to validate Maven wrapper SHA-256, your Maven wrapper might be compromised." >&2 277 | echo "Investigate or delete $wrapperJarPath to attempt a clean download." >&2 278 | echo "If you updated your Maven version, you need to update the specified wrapperSha256Sum property." >&2 279 | exit 1 280 | fi 281 | fi 282 | 283 | MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" 284 | 285 | # For Cygwin, switch paths to Windows format before running java 286 | if $cygwin; then 287 | [ -n "$JAVA_HOME" ] && 288 | JAVA_HOME=$(cygpath --path --windows "$JAVA_HOME") 289 | [ -n "$CLASSPATH" ] && 290 | CLASSPATH=$(cygpath --path --windows "$CLASSPATH") 291 | [ -n "$MAVEN_PROJECTBASEDIR" ] && 292 | MAVEN_PROJECTBASEDIR=$(cygpath --path --windows "$MAVEN_PROJECTBASEDIR") 293 | fi 294 | 295 | # Provide a "standardized" way to retrieve the CLI args that will 296 | # work with both Windows and non-Windows executions. 297 | MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $*" 298 | export MAVEN_CMD_LINE_ARGS 299 | 300 | WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 301 | 302 | # shellcheck disable=SC2086 # safe args 303 | exec "$JAVACMD" \ 304 | $MAVEN_OPTS \ 305 | $MAVEN_DEBUG_OPTS \ 306 | -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ 307 | "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ 308 | ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" 309 | --------------------------------------------------------------------------------