diff --git a/assets/img/backend_photo.png b/assets/img/backend_photo.png new file mode 100644 index 0000000..14b63b7 Binary files /dev/null and b/assets/img/backend_photo.png differ diff --git a/backend/TMSProject/pom.xml b/backend/TMSProject/pom.xml index 5735092..35a9c86 100644 --- a/backend/TMSProject/pom.xml +++ b/backend/TMSProject/pom.xml @@ -22,7 +22,6 @@ org.springframework.boot spring-boot-starter-web - org.springframework.boot spring-boot-devtools @@ -61,6 +60,11 @@ spring-security-test test + + javax.mail + javax.mail-api + 1.6.2 + diff --git a/backend/TMSProject/src/main/java/br/com/entra21/teamroxo/TMSProject/controllers/AboutUsController.java b/backend/TMSProject/src/main/java/br/com/entra21/teamroxo/TMSProject/controllers/AboutUsController.java new file mode 100644 index 0000000..3698947 --- /dev/null +++ b/backend/TMSProject/src/main/java/br/com/entra21/teamroxo/TMSProject/controllers/AboutUsController.java @@ -0,0 +1,33 @@ +package br.com.entra21.teamroxo.TMSProject.controllers; + +import java.util.List; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CrossOrigin; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import br.com.entra21.teamroxo.TMSProject.interfaces.AboutUsRepository; +import br.com.entra21.teamroxo.TMSProject.template.AboutUs; + + + + + + @RestController + @CrossOrigin(origins = "*") + @RequestMapping("/aboutus") + public class AboutUsController { + + @Autowired + private AboutUsRepository aboutUsRepository; + + @GetMapping() + public List listAboutUs(){ + return aboutUsRepository.findAll() ; + + } + +} + diff --git a/backend/TMSProject/src/main/java/br/com/entra21/teamroxo/TMSProject/controllers/CarriersControllers.java b/backend/TMSProject/src/main/java/br/com/entra21/teamroxo/TMSProject/controllers/CarriersControllers.java index 0fe9e65..1ce3157 100644 --- a/backend/TMSProject/src/main/java/br/com/entra21/teamroxo/TMSProject/controllers/CarriersControllers.java +++ b/backend/TMSProject/src/main/java/br/com/entra21/teamroxo/TMSProject/controllers/CarriersControllers.java @@ -5,9 +5,11 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.CrossOrigin; +import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseStatus; @@ -38,9 +40,17 @@ public Carriers carrier(@PathVariable("id") int id) { @PostMapping() @ResponseStatus(code = HttpStatus.CREATED) public Carriers register(@RequestBody Carriers dados) { - return carriersRepository.save(dados); - + } + + @DeleteMapping("/{id}") + public void deleteCarrier(@PathVariable("id") int id){ + carriersRepository.deleteById(id); + } + + @PutMapping() + public Carriers attCarrier(@RequestBody Carriers body) { + return carriersRepository.save(body); } } diff --git a/backend/TMSProject/src/main/java/br/com/entra21/teamroxo/TMSProject/controllers/LoginController.java b/backend/TMSProject/src/main/java/br/com/entra21/teamroxo/TMSProject/controllers/LoginController.java index ef9bcdf..bc66695 100644 --- a/backend/TMSProject/src/main/java/br/com/entra21/teamroxo/TMSProject/controllers/LoginController.java +++ b/backend/TMSProject/src/main/java/br/com/entra21/teamroxo/TMSProject/controllers/LoginController.java @@ -11,6 +11,7 @@ import org.springframework.web.bind.annotation.CrossOrigin; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; @@ -63,6 +64,11 @@ public List listAll() { return response; } + + @PutMapping() + public Login attLogin(@RequestBody Login body) { + return loginRepository.save(body); + } @PostMapping("/init") public CountVisitors bounce(@RequestBody CountVisitors visitor) { diff --git a/backend/TMSProject/src/main/java/br/com/entra21/teamroxo/TMSProject/controllers/PessoaController.java b/backend/TMSProject/src/main/java/br/com/entra21/teamroxo/TMSProject/controllers/PessoaController.java index 814b6c5..ffb61c5 100644 --- a/backend/TMSProject/src/main/java/br/com/entra21/teamroxo/TMSProject/controllers/PessoaController.java +++ b/backend/TMSProject/src/main/java/br/com/entra21/teamroxo/TMSProject/controllers/PessoaController.java @@ -1,16 +1,21 @@ package br.com.entra21.teamroxo.TMSProject.controllers; +import java.text.SimpleDateFormat; import java.time.LocalDate; +import java.time.format.DateTimeFormatter; +import java.time.format.DateTimeFormatterBuilder; import java.time.temporal.TemporalAdjuster; import java.time.temporal.TemporalAdjusters; import java.util.ArrayList; import java.util.List; import java.util.Optional; +import java.util.logging.SimpleFormatter; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.repository.query.Param; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.CrossOrigin; +import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; @@ -27,13 +32,11 @@ import com.fasterxml.jackson.databind.SerializationFeature; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; -import br.com.entra21.teamroxo.TMSProject.TmsProjectApplication; import br.com.entra21.teamroxo.TMSProject.interfaces.CountVisitorsRepository; import br.com.entra21.teamroxo.TMSProject.interfaces.PessoaRepository; import br.com.entra21.teamroxo.TMSProject.template.CountVisitors; import br.com.entra21.teamroxo.TMSProject.template.ItemNivel3; import br.com.entra21.teamroxo.TMSProject.template.Pessoa; -import br.com.entra21.teamroxo.TMSProject.template.RegisterQuote; @RestController @CrossOrigin(origins = "*") @@ -76,8 +79,7 @@ public List birthNow(){ @GetMapping("/birthmonth") public List birthMonth(){ - return pessoaRepository.findBirthMonth(LocalDate.now().withMonth(LocalDate.now().getMonthValue()).with(TemporalAdjusters.firstDayOfMonth()), - LocalDate.now().withMonth(LocalDate.now().getMonthValue()).with(TemporalAdjusters.lastDayOfMonth())); + return pessoaRepository.findBirthMonth(LocalDate.now()); } @GetMapping("/bounce") @@ -101,7 +103,17 @@ public boolean disBounce(@PathVariable("id") int id) { public Pessoa register(@RequestBody Pessoa dados) { return pessoaRepository.save(dados); } - + + @PutMapping() + public Pessoa attPessoa(@RequestBody Pessoa body) { + return pessoaRepository.save(body); + } + + @DeleteMapping("/{id}") + public void deletePessoa(@PathVariable("id") int id){ + pessoaRepository.deleteById(id); + } + private List obterListaCompleta() { List response = pessoaRepository.findAll(); @@ -140,5 +152,7 @@ private void setMaturidadeNivel3(Pessoa pessoa) { } } + + } diff --git a/backend/TMSProject/src/main/java/br/com/entra21/teamroxo/TMSProject/controllers/QuoteController.java b/backend/TMSProject/src/main/java/br/com/entra21/teamroxo/TMSProject/controllers/QuoteController.java index 8916be7..64d4f0d 100644 --- a/backend/TMSProject/src/main/java/br/com/entra21/teamroxo/TMSProject/controllers/QuoteController.java +++ b/backend/TMSProject/src/main/java/br/com/entra21/teamroxo/TMSProject/controllers/QuoteController.java @@ -83,4 +83,6 @@ public int goingPackages() { } + + } diff --git a/backend/TMSProject/src/main/java/br/com/entra21/teamroxo/TMSProject/interfaces/AboutUsRepository.java b/backend/TMSProject/src/main/java/br/com/entra21/teamroxo/TMSProject/interfaces/AboutUsRepository.java new file mode 100644 index 0000000..cd022f7 --- /dev/null +++ b/backend/TMSProject/src/main/java/br/com/entra21/teamroxo/TMSProject/interfaces/AboutUsRepository.java @@ -0,0 +1,22 @@ +package br.com.entra21.teamroxo.TMSProject.interfaces; + +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.jpa.repository.config.EnableJpaRepositories; +import org.springframework.data.repository.query.Param; +import org.springframework.stereotype.Repository; + +import br.com.entra21.teamroxo.TMSProject.template.AboutUs; +import br.com.entra21.teamroxo.TMSProject.template.Carriers; + + +@Repository +@EnableJpaRepositories +public interface AboutUsRepository extends JpaRepository{ + + @Query("FROM AboutUs") + public void AboutUs(); + +} + + diff --git a/backend/TMSProject/src/main/java/br/com/entra21/teamroxo/TMSProject/interfaces/PessoaRepository.java b/backend/TMSProject/src/main/java/br/com/entra21/teamroxo/TMSProject/interfaces/PessoaRepository.java index 9602bc6..cc92091 100644 --- a/backend/TMSProject/src/main/java/br/com/entra21/teamroxo/TMSProject/interfaces/PessoaRepository.java +++ b/backend/TMSProject/src/main/java/br/com/entra21/teamroxo/TMSProject/interfaces/PessoaRepository.java @@ -15,10 +15,10 @@ @EnableJpaRepositories public interface PessoaRepository extends JpaRepository { - @Query("FROM Pessoa WHERE birth = :now") + @Query("FROM Pessoa WHERE MONTH(birth) = EXTRACT(MONTH FROM :now) AND DAY(birth) = EXTRACT(DAY FROM :now)") List findBirth (@Param("now") LocalDate now); - @Query("FROM Pessoa WHERE birth BETWEEN :firstDay and :lastDay") - List findBirthMonth (@Param("firstDay") LocalDate first, @Param("lastDay") LocalDate last); + @Query("FROM Pessoa WHERE MONTH(birth) = EXTRACT(MONTH FROM :now)") + List findBirthMonth (@Param("now") LocalDate now); } diff --git a/backend/TMSProject/src/main/java/br/com/entra21/teamroxo/TMSProject/template/AboutUs.java b/backend/TMSProject/src/main/java/br/com/entra21/teamroxo/TMSProject/template/AboutUs.java new file mode 100644 index 0000000..5b366d7 --- /dev/null +++ b/backend/TMSProject/src/main/java/br/com/entra21/teamroxo/TMSProject/template/AboutUs.java @@ -0,0 +1,377 @@ +package br.com.entra21.teamroxo.TMSProject.template; + +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Table; + +@Entity +@Table(name = "aboutus") +public class AboutUs { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Integer id; + private String titulo; + private String subTitulo; + private String body; + + private String brunoNome; + private String brunoFuncao; + private String brunoFoto; + private String brunoEmail; + private String brunoLinkedin; + private String brunoGithub; + + private String cristianNome; + private String cristianFuncao; + private String cristianFoto; + private String cristianEmail; + private String cristianLinkedin; + private String cristianGithub; + + private String kalilNome; + private String kalilFuncao; + private String kalilFoto; + private String kalilEmail; + private String kalilLinkedin; + private String kalilGithub; + + private String mateusNome; + private String mateusFuncao; + private String mateusFoto; + private String mateusEmail; + private String mateusLinkedin; + private String mateusGithub; + + + public AboutUs() { + super(); + // TODO Auto-generated constructor stub + } + + + public AboutUs(Integer id, String titulo, String subTitulo, String body, String brunoNome, String brunoFuncao, + String brunoFoto, String brunoEmail, String brunoLinkedin, String brunoGithub, String cristianNome, + String cristianFuncao, String cristianFoto, String cristianEmail, String cristianLinkedin, + String cristianGithub, String kalilNome, String kalilFuncao, String kalilFoto, String kalilEmail, + String kalilLinkedin, String kalilGithub, String mateusNome, String mateusFuncao, String mateusFoto, + String mateusEmail, String mateusLinkedin, String mateusGithub) { + super(); + this.id = id; + this.titulo = titulo; + this.subTitulo = subTitulo; + this.body = body; + this.brunoNome = brunoNome; + this.brunoFuncao = brunoFuncao; + this.brunoFoto = brunoFoto; + this.brunoEmail = brunoEmail; + this.brunoLinkedin = brunoLinkedin; + this.brunoGithub = brunoGithub; + this.cristianNome = cristianNome; + this.cristianFuncao = cristianFuncao; + this.cristianFoto = cristianFoto; + this.cristianEmail = cristianEmail; + this.cristianLinkedin = cristianLinkedin; + this.cristianGithub = cristianGithub; + this.kalilNome = kalilNome; + this.kalilFuncao = kalilFuncao; + this.kalilFoto = kalilFoto; + this.kalilEmail = kalilEmail; + this.kalilLinkedin = kalilLinkedin; + this.kalilGithub = kalilGithub; + this.mateusNome = mateusNome; + this.mateusFuncao = mateusFuncao; + this.mateusFoto = mateusFoto; + this.mateusEmail = mateusEmail; + this.mateusLinkedin = mateusLinkedin; + this.mateusGithub = mateusGithub; + } + + + public Integer getId() { + return id; + } + + + public void setId(Integer id) { + this.id = id; + } + + + public String getTitulo() { + return titulo; + } + + + public void setTitulo(String titulo) { + this.titulo = titulo; + } + + + public String getSubTitulo() { + return subTitulo; + } + + + public void setSubTitulo(String subTitulo) { + this.subTitulo = subTitulo; + } + + + public String getBody() { + return body; + } + + + public void setBody(String body) { + this.body = body; + } + + + public String getBrunoNome() { + return brunoNome; + } + + + public void setBrunoNome(String brunoNome) { + this.brunoNome = brunoNome; + } + + + public String getBrunoFuncao() { + return brunoFuncao; + } + + + public void setBrunoFuncao(String brunoFuncao) { + this.brunoFuncao = brunoFuncao; + } + + + public String getBrunoFoto() { + return brunoFoto; + } + + + public void setBrunoFoto(String brunoFoto) { + this.brunoFoto = brunoFoto; + } + + + public String getBrunoEmail() { + return brunoEmail; + } + + + public void setBrunoEmail(String brunoEmail) { + this.brunoEmail = brunoEmail; + } + + + public String getBrunoLinkedin() { + return brunoLinkedin; + } + + + public void setBrunoLinkedin(String brunoLinkedin) { + this.brunoLinkedin = brunoLinkedin; + } + + + public String getBrunoGithub() { + return brunoGithub; + } + + + public void setBrunoGithub(String brunoGithub) { + this.brunoGithub = brunoGithub; + } + + + public String getCristianNome() { + return cristianNome; + } + + + public void setCristianNome(String cristianNome) { + this.cristianNome = cristianNome; + } + + + public String getCristianFuncao() { + return cristianFuncao; + } + + + public void setCristianFuncao(String cristianFuncao) { + this.cristianFuncao = cristianFuncao; + } + + + public String getCristianFoto() { + return cristianFoto; + } + + + public void setCristianFoto(String cristianFoto) { + this.cristianFoto = cristianFoto; + } + + + public String getCristianEmail() { + return cristianEmail; + } + + + public void setCristianEmail(String cristianEmail) { + this.cristianEmail = cristianEmail; + } + + + public String getCristianLinkedin() { + return cristianLinkedin; + } + + + public void setCristianLinkedin(String cristianLinkedin) { + this.cristianLinkedin = cristianLinkedin; + } + + + public String getCristianGithub() { + return cristianGithub; + } + + + public void setCristianGithub(String cristianGithub) { + this.cristianGithub = cristianGithub; + } + + + public String getKalilNome() { + return kalilNome; + } + + + public void setKalilNome(String kalilNome) { + this.kalilNome = kalilNome; + } + + + public String getKalilFuncao() { + return kalilFuncao; + } + + + public void setKalilFuncao(String kalilFuncao) { + this.kalilFuncao = kalilFuncao; + } + + + public String getKalilFoto() { + return kalilFoto; + } + + + public void setKalilFoto(String kalilFoto) { + this.kalilFoto = kalilFoto; + } + + + public String getKalilEmail() { + return kalilEmail; + } + + + public void setKalilEmail(String kalilEmail) { + this.kalilEmail = kalilEmail; + } + + + public String getKalilLinkedin() { + return kalilLinkedin; + } + + + public void setKalilLinkedin(String kalilLinkedin) { + this.kalilLinkedin = kalilLinkedin; + } + + + public String getKalilGithub() { + return kalilGithub; + } + + + public void setKalilGithub(String kalilGithub) { + this.kalilGithub = kalilGithub; + } + + + public String getMateusNome() { + return mateusNome; + } + + + public void setMateusNome(String mateusNome) { + this.mateusNome = mateusNome; + } + + + public String getMateusFuncao() { + return mateusFuncao; + } + + + public void setMateusFuncao(String mateusFuncao) { + this.mateusFuncao = mateusFuncao; + } + + + public String getMateusFoto() { + return mateusFoto; + } + + + public void setMateusFoto(String mateusFoto) { + this.mateusFoto = mateusFoto; + } + + + public String getMateusEmail() { + return mateusEmail; + } + + + public void setMateusEmail(String mateusEmail) { + this.mateusEmail = mateusEmail; + } + + + public String getMateusLinkedin() { + return mateusLinkedin; + } + + + public void setMateusLinkedin(String mateusLinkedin) { + this.mateusLinkedin = mateusLinkedin; + } + + + public String getMateusGithub() { + return mateusGithub; + } + + + public void setMateusGithub(String mateusGithub) { + this.mateusGithub = mateusGithub; + } + + + + + + +} \ No newline at end of file diff --git a/frontend/main/src/app/about.service.spec.ts b/frontend/main/src/app/about.service.spec.ts new file mode 100644 index 0000000..f5fe5a0 --- /dev/null +++ b/frontend/main/src/app/about.service.spec.ts @@ -0,0 +1,16 @@ +import { TestBed } from '@angular/core/testing'; + +import { AboutService } from './about.service'; + +describe('AboutService', () => { + let service: AboutService; + + beforeEach(() => { + TestBed.configureTestingModule({}); + service = TestBed.inject(AboutService); + }); + + it('should be created', () => { + expect(service).toBeTruthy(); + }); +}); diff --git a/frontend/main/src/app/about.service.ts b/frontend/main/src/app/about.service.ts new file mode 100644 index 0000000..5d35f80 --- /dev/null +++ b/frontend/main/src/app/about.service.ts @@ -0,0 +1,24 @@ +import { HttpClient } from '@angular/common/http'; +import { Injectable } from '@angular/core'; +import { Router } from '@angular/router'; + +@Injectable({ + providedIn: 'root' +}) +export class AboutService { + + readonly API:string = "http://localhost:8080/aboutus" + + constructor(private router: Router, private http: HttpClient) { } + + + listAbout():any{ + + return this.http.get(this.API) + + } + + + + +} diff --git a/frontend/main/src/app/about/about.component.html b/frontend/main/src/app/about/about.component.html index 1ad7231..0eff63e 100644 --- a/frontend/main/src/app/about/about.component.html +++ b/frontend/main/src/app/about/about.component.html @@ -1,64 +1,64 @@ +
- -

Bruno Roberto

-
Frontend Dev.
+

{{about.bruno_nome}}

+
{{about.bruno_funcao}}

- - -
- -

Cristian Schauffert

-
Web Designer
+

{{about.cristian_nome}}

+
{{about.cristian_funcao}}

- - -
- -

Kalil J. Fakhouri

-
Lead Developer
+

{{about.kalil_nome}}

+
{{about.kalil_funcao}}

- - -
- -

Mateus Felipe

-
Lead Developer
+

{{about.mateus_nome}}

+
{{about.mateus_funcao}}

- - -
@@ -66,9 +66,9 @@

Mateus Felipe

-

Sobre o Projeto

+

{{about.titulo}}


-

Licença,Disponibilidade e finalidade

+

{{about.sub_titulo}}


Esse projeto foi desenvolvido pelo grupo Roxo da Turma Java Noturno de 2022, composto por Bruno Roberto, Cristian Schauffert, Kalil Fakhouri e Mateus Felipe com a mentoria do professor Oliota, visando apenas a diff --git a/frontend/main/src/app/about/about.component.ts b/frontend/main/src/app/about/about.component.ts index e4ae6d9..c40f34b 100644 --- a/frontend/main/src/app/about/about.component.ts +++ b/frontend/main/src/app/about/about.component.ts @@ -1,4 +1,8 @@ +import { HttpClient } from '@angular/common/http'; import { Component, OnInit } from '@angular/core'; +import { Router } from '@angular/router'; +import { catchError } from 'rxjs'; +import { AboutService } from '../about.service'; @Component({ selector: 'app-about', @@ -7,9 +11,112 @@ import { Component, OnInit } from '@angular/core'; }) export class AboutComponent implements OnInit { - constructor() { } + abouts!: Array + body!: string + bruno_funcao!: string + bruno_nome!: string + cristian_funcao!: string + cristian_nome!: string + kalil_funcao!: string + kalil_nome!: string + mateus_funcao!: string + mateus_nome!: string + sub_titulo!: string + titulo!: string + + bruno_email!: string + bruno_foto!: string + bruno_github!: string + bruno_linkedin!: string + + cristian_email!: string + cristian_foto!: string + cristian_github!: string + cristian_linkedin!: string + + kalil_email!: string + kalil_foto!: string + kalil_github!: string + kalil_linkedin!: string + + mateus_email!: string + mateus_foto!: string + mateus_github!: string + mateus_linkedin!: string + + + + + + constructor(public aboutService: AboutService, private router:Router, private http:HttpClient) { } ngOnInit(): void { + +this.abouts = new Array() + +this.aboutService.listAbout().pipe( + catchError((error)=>{ + return error + }) + +).subscribe((response: any) => { +console.log(response); + +var count = Object.keys(response).length + + for(let i=0;ibalance works!

diff --git a/frontend/main/src/app/balance/balance.component.spec.ts b/frontend/main/src/app/balance/balance.component.spec.ts deleted file mode 100644 index b6c6db2..0000000 --- a/frontend/main/src/app/balance/balance.component.spec.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { BalanceComponent } from './balance.component'; - -describe('BalanceComponent', () => { - let component: BalanceComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [ BalanceComponent ] - }) - .compileComponents(); - - fixture = TestBed.createComponent(BalanceComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/frontend/main/src/app/balance/balance.component.ts b/frontend/main/src/app/balance/balance.component.ts deleted file mode 100644 index e68d490..0000000 --- a/frontend/main/src/app/balance/balance.component.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Component, OnInit } from '@angular/core'; - -@Component({ - selector: 'app-balance', - templateUrl: './balance.component.html', - styleUrls: ['./balance.component.css'] -}) -export class BalanceComponent implements OnInit { - - constructor() { } - - ngOnInit(): void { - } - -} diff --git a/frontend/main/src/app/body/body.component.html b/frontend/main/src/app/body/body.component.html index 3718070..58f979b 100644 --- a/frontend/main/src/app/body/body.component.html +++ b/frontend/main/src/app/body/body.component.html @@ -4,7 +4,7 @@ @@ -12,7 +12,7 @@
- + + + + - See All Messages + Aniversariantes!
- \ No newline at end of file + diff --git a/frontend/main/src/app/body/body.component.ts b/frontend/main/src/app/body/body.component.ts index 5edc99e..b84ea12 100644 --- a/frontend/main/src/app/body/body.component.ts +++ b/frontend/main/src/app/body/body.component.ts @@ -3,7 +3,7 @@ import { LoginComponent } from '../login/login.component'; import { LoginserviceService } from '../loginservice.service'; import { HttpClient } from '@angular/common/http'; import { Router } from '@angular/router'; -import { Observable } from 'rxjs'; +import { catchError, Observable } from 'rxjs'; import { NotificationService } from '../notification.service'; @Component({ @@ -17,65 +17,113 @@ export class BodyComponent implements OnInit { readonly APIBirthMonth: string = "http://localhost:8080/user/birthmonth" - birthnow! : string - birthmonth! : string - aniversariantes!: Array - aniversariantesMes!: Array - notificacoes!:Array - notificationCount!:number + birthnow!: string + birthmonth!: string + aniversariantes: Array = new Array() + aniversariantesMes: Array = new Array() + notificacoes: Array = new Array() + notificationCount!: number id!: number nome!: string email!: string - birth!: Date + birth!: string document!: string - constructor(public loginService:LoginserviceService, private router:Router, private http:HttpClient, private notify:NotificationService) { } + constructor(public loginService: LoginserviceService, private router: Router, private http: HttpClient, private notify: NotificationService) { } ngOnInit(): void { - this.aniversariantes = new Array() - this.aniversariantesMes = new Array() this.notificacoes = new Array() - if(this.loginService.document == null || this.loginService.birth == null){ - this.notificacoes.push({title:"Complete seu Cadastro!", text:"Clique aqui para concluir!", route:"edit"}) - } - this.http.get(this.APIBirthNow) - .subscribe((resultado:any) => { + .subscribe((resultado: any) => { - var count = Object.keys(resultado).length + console.log(resultado); - for(let i=0;i { + .subscribe((resultado: any) => { - var count = Object.keys(resultado).length + var count = Object.keys(resultado).length - for(let i=0;i { + this.notification() + }, 450); + + } + + notification() { + + if (this.loginService.succeed == true) { + console.log(this.loginService.document, this.loginService.birth); + + setTimeout(() => { + + if (this.loginService.birth) { + console.log('DOCUMENTOS CORRETOS!'); + } else { + this.notificacoes.push({ title: "Complete seu Cadastro!", text: "Clique aqui para concluir!", route: "edit" }) + } + + if (this.loginService.document) { + console.log('DOCUMENTOS CORRETOS!'); + } else { + this.notificacoes.push({ title: "Complete seu Cadastro!", text: "Clique aqui para concluir!", route: "edit" }) + } - this.notificationCount = this.notificacoes.length + }, 500); + + this.http.get(this.APIBirthNow) + .subscribe((resultado: any) => { + + var count = Object.keys(resultado).length + + for (let i = 0; i < count; i++) { + + if (resultado[i].id === this.loginService.pessoaID) { + this.notificacoes.push({ title: "Hoje é seu Aniversário!🥳🎉", text: "Parabéns, "+this.loginService.nome.split(' ').at(0)+"! Para comemorar temos algumas ofertas especiais para você. Confira!🤩", route: "ship-quote" }) + } + } + + }) + + setTimeout(() => { + + this.notificationCount = this.notificacoes.length + + if (this.notificationCount === 0) { + this.notificacoes.push({ title: 'Tudo certo por aqui, '+this.loginService.nome.split(' ').at(0)+'!', text: 'Te avisaremos qualquer coisa! 😉', route:'#' }) + } + + }, 600); + + } + + if(this.loginService.succeed == false){ + this.ngOnInit(); + } } - sair(){ + sair() { this.loginService.succeed = false; + this.ngOnInit(); } } diff --git a/frontend/main/src/app/carriers/carriers.component.html b/frontend/main/src/app/carriers/carriers.component.html index 6d77686..6ca8fbd 100644 --- a/frontend/main/src/app/carriers/carriers.component.html +++ b/frontend/main/src/app/carriers/carriers.component.html @@ -1,4 +1,69 @@ - +
+ + + + + + + +
- - - - + + + + - - + + - + diff --git a/frontend/main/src/app/carriers/carriers.component.ts b/frontend/main/src/app/carriers/carriers.component.ts index 2901bd0..fdb555d 100644 --- a/frontend/main/src/app/carriers/carriers.component.ts +++ b/frontend/main/src/app/carriers/carriers.component.ts @@ -1,6 +1,7 @@ import { HttpClient } from '@angular/common/http'; import { Component, OnInit } from '@angular/core'; import { Router } from '@angular/router'; +import { catchError } from 'rxjs'; import { CarrierService } from '../carrier.service'; import { QuoteService } from '../quote.service'; @@ -15,7 +16,8 @@ export class CarriersComponent implements OnInit { cnpj!: string email!: string razao!: string - taxa!: number + taxa!: string + id!: number constructor(public carrierService: CarrierService, public quoteService: QuoteService, private router: Router, private http: HttpClient) { } @@ -27,7 +29,12 @@ export class CarriersComponent implements OnInit { // this.carriers.push({name:"Correios", email:"correios@correios.com", cnpj:"7897987899789", taxValorFrete:0.078}) - this.carrierService.listCarrier().pipe().subscribe((response: any) => { + this.carrierService.listCarrier().pipe( + catchError((error)=>{ + return error + }) + + ).subscribe((response: any) => { console.log(response); @@ -37,26 +44,27 @@ export class CarriersComponent implements OnInit { for (let i = 0; i < count; i++) { + + this.id = response[i].id; this.razao = response[i].razao; this.taxa = response[i].taxa; this.email = response[i].email; this.cnpj = response[i].cnpj; - this.carriers.push({ razao: this.razao, taxa: this.taxa, email: this.email, cnpj: this.cnpj}); + this.carriers.push({id: this.id, razao: this.razao, taxa: this.taxa, email: this.email, cnpj: this.cnpj}); } - this.razao = ""; - this.taxa = 0; - this.email = ""; - this.cnpj = ""; + this.razao = ""; + this.taxa = ""; + this.email = ""; + this.cnpj = ""; }) } - adicionar(razao: string, taxa: number, email: string, cnpj: string) { - + adicionar(razao: string, taxa: string, email: string, cnpj: string) { let build ={ "razao":razao, @@ -68,11 +76,22 @@ export class CarriersComponent implements OnInit { this.carrierService.adicionar(build) - this.carriers.push({razao:this.razao, taxa:this.taxa, email:this.email, cnpj:this.cnpj}); + setTimeout(() => { + this.ngOnInit(); + }, 500); + + // this.carriers.push({razao:this.razao, taxa:this.taxa, email:this.email, cnpj:this.cnpj}); } - deletar(){ + deletar(id:number){ + + console.log(id); + this.http.delete('http://localhost:8080/carriers/'+id).subscribe(); + + setTimeout(() => { + this.ngOnInit(); + }, 500); } @@ -80,4 +99,52 @@ export class CarriersComponent implements OnInit { } + openModal(){ + + var modal = document.getElementById('modal2') + + modal?.setAttribute('style', 'display:block;') + + modal?.setAttribute('class', 'portfolio-modal modal fade show') + modal?.removeAttribute('aria-hidden') + + modal?.setAttribute('arial-modal', 'true') + + } + + closeModal(){ + var modal = document.getElementById('modal2') + + modal?.setAttribute('class', 'portfolio-modal modal fade') + setTimeout(()=>{ + modal?.setAttribute('style', 'display:none;') + },500) + + } + + + openModalEdit(){ + + var modal = document.getElementById('modal3') + + modal?.setAttribute('style', 'display:block;') + + modal?.setAttribute('class', 'portfolio-modal modal fade show') + modal?.removeAttribute('aria-hidden') + + modal?.setAttribute('arial-modal', 'true') + + } + + closeModalEdit(){ + var modal = document.getElementById('modal3') + + modal?.setAttribute('class', 'portfolio-modal modal fade') + setTimeout(()=>{ + modal?.setAttribute('style', 'display:none;') + },500) + + } + + } diff --git a/frontend/main/src/app/cost/cost.component.css b/frontend/main/src/app/cost/cost.component.css deleted file mode 100644 index e69de29..0000000 diff --git a/frontend/main/src/app/cost/cost.component.html b/frontend/main/src/app/cost/cost.component.html deleted file mode 100644 index ae92bdd..0000000 --- a/frontend/main/src/app/cost/cost.component.html +++ /dev/null @@ -1 +0,0 @@ -

cost works!

diff --git a/frontend/main/src/app/cost/cost.component.spec.ts b/frontend/main/src/app/cost/cost.component.spec.ts deleted file mode 100644 index 67a6d8a..0000000 --- a/frontend/main/src/app/cost/cost.component.spec.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { CostComponent } from './cost.component'; - -describe('CostComponent', () => { - let component: CostComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [ CostComponent ] - }) - .compileComponents(); - - fixture = TestBed.createComponent(CostComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/frontend/main/src/app/cost/cost.component.ts b/frontend/main/src/app/cost/cost.component.ts deleted file mode 100644 index 47cd97c..0000000 --- a/frontend/main/src/app/cost/cost.component.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Component, OnInit } from '@angular/core'; - -@Component({ - selector: 'app-cost', - templateUrl: './cost.component.html', - styleUrls: ['./cost.component.css'] -}) -export class CostComponent implements OnInit { - - constructor() { } - - ngOnInit(): void { - } - -} diff --git a/frontend/main/src/app/edit/edit.component.ts b/frontend/main/src/app/edit/edit.component.ts index 7c0e0ca..9b9d95a 100644 --- a/frontend/main/src/app/edit/edit.component.ts +++ b/frontend/main/src/app/edit/edit.component.ts @@ -10,7 +10,7 @@ import { LoginserviceService } from '../loginservice.service'; export class EditComponent implements OnInit { name!:string user!:string -birth!:Date +birth!:string document!:string email!:string password!:string @@ -21,7 +21,7 @@ password!:string constructor( private router:Router, private login: LoginserviceService - + ) { } ngOnInit(): void { diff --git a/frontend/main/src/app/forget-password/forget-password.component.css b/frontend/main/src/app/forget-password/forget-password.component.css index e69de29..77b99f4 100644 --- a/frontend/main/src/app/forget-password/forget-password.component.css +++ b/frontend/main/src/app/forget-password/forget-password.component.css @@ -0,0 +1,290 @@ +@import url('https://fonts.googleapis.com/css?family=Poppins:400,500,600,700,800,900'); + +body{ + font-family: 'Poppins', sans-serif; + font-weight: 300; + font-size: 15px; + line-height: 1.7; + color: #c4c3ca; + background-color: #1f2029; + overflow-x: hidden; +} +a{ + cursor: pointer; + transition: all 200ms linear; +} +a:hover { + text-decoration: none; +} +.link { + color: #000000; +} +.link:hover { + color: #ffeba7; +} +p { + font-weight: 500; + font-size: 14px; + line-height: 1.7; +} +h4 { + font-weight: 600; +} +h6 span{ + padding: 0 20px; + text-transform: uppercase; + font-weight: 700; +} +.section{ + position: relative; + width: 100%; + display: block; + background-repeat: no-repeat; + background-size: cover; +} +.full-height{ + min-height: 100vh; +} +[type="checkbox"]:checked, +[type="checkbox"]:not(:checked){ + position: absolute; + left: -9999px; +} +.checkbox:checked + label, +.checkbox:not(:checked) + label{ + position: relative; + display: block; + text-align: center; + width: 60px; + height: 16px; + border-radius: 8px; + padding: 0; + margin: 10px auto; + cursor: pointer; + background-color: #ffeba7; +} +.checkbox:checked + label:before, +.checkbox:not(:checked) + label:before{ + position: absolute; + display: block; + width: 36px; + height: 36px; + border-radius: 50%; + color: #ffeba7; + background-color: #102770; + font-family: 'unicons'; + content: ''; + z-index: 20; + top: -10px; + left: -10px; + line-height: 36px; + text-align: center; + font-size: 24px; + transition: all 0.5s ease; +} +.checkbox:checked + label:before { + transform: translateX(44px) rotate(-270deg); +} + + +.card-3d-wrap { + position: relative; + width: 440px; + max-width: 100%; + height: 400px; + -webkit-transform-style: preserve-3d; + transform-style: preserve-3d; + perspective: 800px; + margin-top: 60px; +} +.card-3d-wrapper { + width: 100%; + height: 100%; + position:absolute; + top: 0; + left: 0; + -webkit-transform-style: preserve-3d; + transform-style: preserve-3d; + transition: all 600ms ease-out; +} +.card-front, .card-back { + width: 100%; + height: 100%; + background-color: #d9c19e; + background-position: bottom center; + background-repeat: no-repeat; + background-size: 300%; + position: absolute; + border-radius: 6px; + left: 0; + top: 0; + box-shadow: 10px 10px 5px #1f2029; + -webkit-transform-style: preserve-3d; + transform-style: preserve-3d; + -webkit-backface-visibility: hidden; + -moz-backface-visibility: hidden; + -o-backface-visibility: hidden; + backface-visibility: hidden; +} +.card-back { + transform: rotateY(180deg); +} +.checkbox:checked ~ .card-3d-wrap .card-3d-wrapper { + transform: rotateY(180deg); +} +.center-wrap{ + position: absolute; + width: 100%; + padding: 0 35px; + top: 50%; + left: 0; + transform: translate3d(0, -50%, 35px) perspective(100px); + z-index: 20; + display: block; +} + + +.form-group{ + position: relative; + display: block; + margin: 0; + padding: 0; +} +.form-style { + padding: 13px 20px; + padding-left: 55px; + height: 48px; + width: 100%; + font-weight: 500; + border-radius: 4px; + font-size: 14px; + line-height: 22px; + letter-spacing: 0.5px; + outline: none; + color: #c4c3ca; + background-color: #1f2029; + border: none; + -webkit-transition: all 200ms linear; + transition: all 200ms linear; + box-shadow: 0 4px 8px 0 rgba(21,21,21,.2); +} +.form-style:focus, +.form-style:active { + border: none; + outline: none; + box-shadow: 0 4px 8px 0 rgba(21,21,21,.2); +} +.input-icon { + position: absolute; + top: 0; + left: 18px; + height: 48px; + font-size: 24px; + line-height: 48px; + text-align: left; + color: #ffeba7; + -webkit-transition: all 200ms linear; + transition: all 200ms linear; +} + +.form-group input:-ms-input-placeholder { + color: #c4c3ca; + opacity: 0.7; + -webkit-transition: all 200ms linear; + transition: all 200ms linear; +} +.form-group input::-moz-placeholder { + color: #c4c3ca; + opacity: 0.7; + -webkit-transition: all 200ms linear; + transition: all 200ms linear; +} +.form-group input:-moz-placeholder { + color: #c4c3ca; + opacity: 0.7; + -webkit-transition: all 200ms linear; + transition: all 200ms linear; +} +.form-group input::-webkit-input-placeholder { + color: #c4c3ca; + opacity: 0.7; + -webkit-transition: all 200ms linear; + transition: all 200ms linear; +} +.form-group input:focus:-ms-input-placeholder { + opacity: 0; + -webkit-transition: all 200ms linear; + transition: all 200ms linear; +} +.form-group input:focus::-moz-placeholder { + opacity: 0; + -webkit-transition: all 200ms linear; + transition: all 200ms linear; +} +.form-group input:focus:-moz-placeholder { + opacity: 0; + -webkit-transition: all 200ms linear; + transition: all 200ms linear; +} +.form-group input:focus::-webkit-input-placeholder { + opacity: 0; + -webkit-transition: all 200ms linear; + transition: all 200ms linear; +} + +.btn{ + border-radius: 4px; + height: 44px; + font-size: 13px; + font-weight: 600; + text-transform: uppercase; + -webkit-transition : all 200ms linear; + transition: all 200ms linear; + padding: 0 30px; + letter-spacing: 1px; + display: -webkit-inline-flex; + display: -ms-inline-flexbox; + display: inline-flex; + -webkit-align-items: center; + -moz-align-items: center; + -ms-align-items: center; + align-items: center; + -webkit-justify-content: center; + -moz-justify-content: center; + -ms-justify-content: center; + justify-content: center; + -ms-flex-pack: center; + text-align: center; + border: none; + background-color: #ffeba7; + color: #102770; + box-shadow: 0 8px 24px 0 rgba(255,235,167,.2); +} +.btn:active, +.btn:focus{ + background-color: #102770; + color: #ffeba7; + box-shadow: 0 8px 24px 0 rgba(16,39,112,.2); +} +.btn:hover{ + background-color: #102770; + color: #ffeba7; + box-shadow: 0 8px 24px 0 rgba(16,39,112,.2); +} + + + + +.logo { + position: absolute; + top: 30px; + right: 30px; + display: block; + z-index: 100; + transition: all 250ms linear; +} +.logo img { + height: 26px; + width: auto; + display: block; +} diff --git a/frontend/main/src/app/forget-password/forget-password.component.html b/frontend/main/src/app/forget-password/forget-password.component.html index 7a8de22..878f6c6 100644 --- a/frontend/main/src/app/forget-password/forget-password.component.html +++ b/frontend/main/src/app/forget-password/forget-password.component.html @@ -1 +1,40 @@ -

forget-password works!

+
+
+
+
+
+
+
+
+
+
+

Recover Password

+
+ + +
+
+ + +
+
+ + +
+ + +

Try to login again

+
+
+
+
+
+
+
+
+
+
+ diff --git a/frontend/main/src/app/forget-password/forget-password.component.ts b/frontend/main/src/app/forget-password/forget-password.component.ts index 3a98106..a8e2518 100644 --- a/frontend/main/src/app/forget-password/forget-password.component.ts +++ b/frontend/main/src/app/forget-password/forget-password.component.ts @@ -1,4 +1,7 @@ +import { HttpClient } from '@angular/common/http'; import { Component, OnInit } from '@angular/core'; +import { Router } from '@angular/router'; +import { LoginserviceService } from '../loginservice.service'; @Component({ selector: 'app-forget-password', @@ -7,9 +10,28 @@ import { Component, OnInit } from '@angular/core'; }) export class ForgetPasswordComponent implements OnInit { - constructor() { } + readonly TMSLoginAPI: string = "http://localhost:8080" + + + + user!:string + password!:string + + constructor(private router:Router, public loginService:LoginserviceService, private http:HttpClient) { } ngOnInit(): void { } -} + submit():void{ + + if(this.user != null && this.password != null){ + + this.loginService.logging(this.user, this.password) + + }else{ + + alert('DIGITE TODOS OS CAMPOS OBRIGATÓRIOS!') + this.loginService.progress = false + + } + }} \ No newline at end of file diff --git a/frontend/main/src/app/insight/insight.component.html b/frontend/main/src/app/insight/insight.component.html index 24939fb..bc75667 100644 --- a/frontend/main/src/app/insight/insight.component.html +++ b/frontend/main/src/app/insight/insight.component.html @@ -4,7 +4,7 @@
-

{{countPacks()}}

+

{{countPackages}}

New packages

@@ -19,7 +19,7 @@

{{countPacks()}}

-

{{countBounces()}}%

+

{{countBounce}}%

Bounce Rate

@@ -30,13 +30,13 @@

{{countBounces()}}%

- +
-

{{countClients()}}

+

{{countClient}}

Registered Users

@@ -51,7 +51,7 @@

{{countClients()}}

-

{{countVisits()}}

+

{{countVisitors}}

Visits

diff --git a/frontend/main/src/app/insight/insight.component.ts b/frontend/main/src/app/insight/insight.component.ts index 1abbf46..9d3e531 100644 --- a/frontend/main/src/app/insight/insight.component.ts +++ b/frontend/main/src/app/insight/insight.component.ts @@ -24,12 +24,12 @@ export class InsightComponent implements OnInit { countPackages!:number countBounce!:number - constructor(private router:Router, private http:HttpClient) { - - } + constructor(private router:Router, private http:HttpClient) { } ngOnInit(): void { - + + console.log('NO INIT'); + this.http.get(this.APICountUsers) .subscribe((resultado:any) => { this.countClient=resultado @@ -51,10 +51,14 @@ export class InsightComponent implements OnInit { this.countBounce=response }) + setTimeout(() => { + this.attData() + }, 1500); + } register(){ - this.router.navigateByUrl('pack-register') + this.router.navigateByUrl('pack-track') } clients(){ @@ -65,20 +69,14 @@ export class InsightComponent implements OnInit { this.router.navigateByUrl('visits') } - countVisits():number{ - return this.countVisitors - } + attData(){ - countClients():number{ - return this.countClient - } + console.log('NO ATT DATA'); - countPacks():number { - return this.countPackages - } - countBounces(): number{ - return this.countBounce + setTimeout(() => { + this.ngOnInit() + }, 1500); } } diff --git a/frontend/main/src/app/loginservice.service.ts b/frontend/main/src/app/loginservice.service.ts index e9a15f5..b07cd79 100644 --- a/frontend/main/src/app/loginservice.service.ts +++ b/frontend/main/src/app/loginservice.service.ts @@ -3,7 +3,9 @@ import { Injectable } from '@angular/core'; import { InjectSetupWrapper } from '@angular/core/testing'; import { ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot, UrlTree } from '@angular/router'; import { catchError, Observable } from 'rxjs'; +import { BodyComponent } from './body/body.component'; import { LoginComponent } from './login/login.component'; +import { NotificationService } from './notification.service'; @Injectable({ providedIn: 'root' @@ -19,7 +21,7 @@ export class LoginserviceService implements CanActivate { user!: string email!: string password!: string - birth!: Date + birth!: string document!: string //DADOS DE CONTROLE @@ -40,6 +42,8 @@ export class LoginserviceService implements CanActivate { logging(user: string, password: string) { + console.log('login service iniciado'); + this.progress = true let build: any = { @@ -51,14 +55,30 @@ export class LoginserviceService implements CanActivate { .pipe( catchError((error)=>{ this.progress = false + console.log(error); return error + }) ) .subscribe((response:any)=>{ + console.log('API works'); + console.log(response); + this.admin = response[0].admin this.enterprise = response[0].enterprise this.user = response[0].user + this.pessoaID = response[0].pessoa_id + this.password = response[0].senha + + this.http.get(this.TMSLoginAPI+'/user/'+response[0].pessoa_id) + .subscribe((resp:any) =>{ + console.log(resp); + this.nome = resp.nome + this.birth = resp.birth + this.document = resp.document + this.email = resp.email + }) if(this.admin == true){ this.adminEnter = true; @@ -75,30 +95,19 @@ export class LoginserviceService implements CanActivate { new LoginComponent(this.router, this, this.http).gotoHome(); } - this.http.get(this.TMSLoginAPI+'/user/'+response[0].pessoa_id) - .subscribe((resp:any) =>{ - console.log(resp); - this.nome = resp.nome - this.pessoaID = response[0].pessoa_id - this.birth = resp.birth - this.document = resp.document - this.email = resp.email - this.password = response[0].senha - }) - let bounce: any = { "user": response[0].user } this.http.post(this.APIBounceInit, bounce) .subscribe((response: any) => { - console.log(response); this.idBounce = response.id this.userBounce = response.user this.dateBounce = response.date this.timeBounce = response.time }) }) + } registering(name: string, user: string, email: string, password: string) { diff --git a/frontend/main/src/app/packtrack/packtrack.component.html b/frontend/main/src/app/packtrack/packtrack.component.html index 65b989d..471e015 100644 --- a/frontend/main/src/app/packtrack/packtrack.component.html +++ b/frontend/main/src/app/packtrack/packtrack.component.html @@ -1 +1,60 @@ -

packtrack works!

+ + + \ No newline at end of file diff --git a/frontend/main/src/app/packtrack/packtrack.component.ts b/frontend/main/src/app/packtrack/packtrack.component.ts index 8f65b8a..56a3feb 100644 --- a/frontend/main/src/app/packtrack/packtrack.component.ts +++ b/frontend/main/src/app/packtrack/packtrack.component.ts @@ -12,4 +12,27 @@ export class PacktrackComponent implements OnInit { ngOnInit(): void { } + openModal(){ + + var modal = document.getElementById('modal2') + + modal?.setAttribute('style', 'display:block;') + + modal?.setAttribute('class', 'portfolio-modal modal fade show') + modal?.removeAttribute('aria-hidden') + + modal?.setAttribute('arial-modal', 'true') + + } + + closeModal(){ + var modal = document.getElementById('modal2') + + modal?.setAttribute('class', 'portfolio-modal modal fade') + setTimeout(()=>{ + modal?.setAttribute('style', 'display:none;') + },500) + + } + } diff --git a/frontend/main/src/app/quote.service.ts b/frontend/main/src/app/quote.service.ts index 60805db..b92f150 100644 --- a/frontend/main/src/app/quote.service.ts +++ b/frontend/main/src/app/quote.service.ts @@ -3,6 +3,7 @@ import { Injectable } from '@angular/core'; import { Router } from '@angular/router'; import { type } from 'os'; import { catchError } from 'rxjs'; +import { BodyComponent } from './body/body.component'; import { LoginserviceService } from './loginservice.service'; import { RctQtComponent } from './rct-qt/rct-qt.component'; import { ShipQtComponent } from './ship-qt/ship-qt.component'; @@ -24,7 +25,6 @@ export class QuoteService { quote(cepOrigem:string, cepDestino:string):any{ //ATUALIZA BOUNCE - new LoginserviceService(this.router, this.http) this.newBounce = { "id":this.login.idBounce, @@ -46,7 +46,6 @@ export class QuoteService { recQuote():any{ //ATUALIZA BOUNCE - new LoginserviceService(this.router, this.http) this.newBounce = { "id":this.login.idBounce, @@ -68,7 +67,6 @@ export class QuoteService { regRecentQuotes(object:any){ //ATUALIZA BOUNCE - new LoginserviceService(this.router, this.http) this.newBounce = { "id":this.login.idBounce, @@ -99,4 +97,9 @@ export class QuoteService { }) } + + deleteRecentQuote(id:number){ + this.http.delete(this.apiURL2+'/recent/'+id) + } + } diff --git a/frontend/main/src/app/rct-qt/rct-qt.component.html b/frontend/main/src/app/rct-qt/rct-qt.component.html index c64ada3..43d8946 100644 --- a/frontend/main/src/app/rct-qt/rct-qt.component.html +++ b/frontend/main/src/app/rct-qt/rct-qt.component.html @@ -11,7 +11,7 @@
- + diff --git a/frontend/main/src/app/rct-qt/rct-qt.component.ts b/frontend/main/src/app/rct-qt/rct-qt.component.ts index 717b519..3ea1273 100644 --- a/frontend/main/src/app/rct-qt/rct-qt.component.ts +++ b/frontend/main/src/app/rct-qt/rct-qt.component.ts @@ -12,8 +12,8 @@ import { QuoteService } from '../quote.service'; }) export class RctQtComponent implements OnInit { - progress!:boolean - succeed:boolean = false + progress:number = -1 + succeed:number = -1 recQuotes!: Array id!: number price!: number @@ -32,7 +32,12 @@ export class RctQtComponent implements OnInit { ngOnInit(): void { this.recQuotes = new Array() - this.quoteService.recQuote().pipe().subscribe((response: any) => { + this.progress = -1 + this.succeed = -1 + + this.quoteService.recQuote() + .pipe() + .subscribe((response: any) => { console.log(response); @@ -55,14 +60,13 @@ export class RctQtComponent implements OnInit { } - console.log(); - }) + } - regPackage(price: number, time: number, origin: string, destiny: string, carrier_id: string, cub_height: number) { + regPackage(id:number, price: number, time: number, origin: string, destiny: string, carrier_id: string, cub_height: number) { - this.progress = true + this.progress = id let build = { "price": price, @@ -75,11 +79,18 @@ export class RctQtComponent implements OnInit { } console.log(build); - this.quoteService.regPackage(build) + console.log(id); + + + this.http.delete('http://localhost:8080/quote/recent/'+id).subscribe(); + setTimeout(()=>{ - this.succeed = true + this.succeed = id + setTimeout(() => { + this.ngOnInit() + }, 3000); }, 1500) } diff --git a/frontend/main/src/app/ship-qt/ship-qt.component.html b/frontend/main/src/app/ship-qt/ship-qt.component.html index 457c158..e74ab3f 100644 --- a/frontend/main/src/app/ship-qt/ship-qt.component.html +++ b/frontend/main/src/app/ship-qt/ship-qt.component.html @@ -1,4 +1,92 @@ -
IDRazão socialTaxaItemCarrier nameTax of transport E-mail CnpjAçãoAction
{{i+1}} {{carrier.razao}} {{carrier.taxa}} {{carrier.email}} {{carrier.cnpj}} - - + + + + + + + + + + +
R${{recQuote.price}} {{recQuote.await}} dias úteis
+
+ + + + + + +

@@ -36,7 +125,7 @@ - + diff --git a/frontend/main/src/app/ship-qt/ship-qt.component.ts b/frontend/main/src/app/ship-qt/ship-qt.component.ts index 89eb84b..11f3e3c 100644 --- a/frontend/main/src/app/ship-qt/ship-qt.component.ts +++ b/frontend/main/src/app/ship-qt/ship-qt.component.ts @@ -34,6 +34,10 @@ export class ShipQtComponent implements OnInit { fatorCub!: number distance!: number carrierData = []; + destinatario!: string; + progress:number = -1 + succeed:number = -1 + id!: number APIBouncePut:string = "http://localhost:8080/user/disbounce/" newBounce!:any @@ -42,7 +46,9 @@ export class ShipQtComponent implements OnInit { constructor(public loginService: LoginserviceService, public carrierService: CarrierService, public quoteService: QuoteService, private router: Router, private http: HttpClient) { } ngOnInit(): void { - this.quotes = new Array() + + + //this.quotes.push({ precoFrete: 45.50, tempo: 3, trackid: "BR23154546TR", cepOrigem: 88058086, cepDestino: 88058086, comprimento: 50, largura: 50, altura: 50, peso: 10 }) //this.quotes.push({ precoFrete: 94.50, tempo: 6, trackid: "BR22315445TR", cepOrigem: 46513265, cepDestino: 65898454, comprimento: 100, largura: 200, altura: 10, peso: 25 }) @@ -50,8 +56,9 @@ export class ShipQtComponent implements OnInit { quote() { + this.quotes = new Array() + //ATUALIZA BOUNCE - new LoginserviceService(this.router, this.http) this.newBounce = { "id":this.loginService.idBounce, @@ -68,7 +75,11 @@ export class ShipQtComponent implements OnInit { if (this.cepOrigem != null && this.cepDestino != null && this.comprimento != null, this.altura != null, this.largura != null, this.peso != null) { this.quoteService.quote(this.cepOrigem, this.cepDestino) - .pipe() + .pipe( + catchError((error)=>{ + return error + }) + ) .subscribe((response: any) => { console.log(response); @@ -100,10 +111,7 @@ export class ShipQtComponent implements OnInit { this.precoFrete = (this.priceFix + this.distance * response[i].taxa * this.cubagem); - - this.quotes.push({ precoFrete: this.precoFrete, tempo: this.tempo, start_adress: this.start_adress, end_address: this.end_address, carrier: response[i].razao, vol: this.vol, cubagem: this.cubagem, carrierID: response[i].id, pessoaID: this.loginService.pessoaID }); - - + this.quotes.push({ precoFrete: this.precoFrete.toLocaleString('pt-BR', {minimumFractionDigits: 2, maximumFractionDigits: 2}), tempo: this.tempo, start_adress: this.start_adress, end_address: this.end_address, carrier: response[i].razao, vol: this.vol, cubagem: this.cubagem, carrierID: response[i].id, pessoaID: this.loginService.pessoaID}); } @@ -115,6 +123,7 @@ export class ShipQtComponent implements OnInit { this.largura = 0 this.altura = 0 this.peso = 0 + this.destinatario = "" }) @@ -124,10 +133,15 @@ export class ShipQtComponent implements OnInit { } - regRecentQuotes(priceQuote: number, prazo: number, origem: string, destino: string, carrierID: number, cubagem: number, pessoaID:number) { + regRecentQuotes(id:number, priceQuote: number, prazo: number, origem: string, destino: string, carrierID: number, cubagem: number, pessoaID:number) { + + this.progress = -1 + this.succeed = -1 + + console.log(priceQuote); let build ={ - "price":priceQuote, + "price":priceQuote.toLocaleString('en-US').replace('.','').replace(',','.'), "await":prazo, "origin":origem, "destiny":destino, @@ -138,7 +152,39 @@ export class ShipQtComponent implements OnInit { this.quoteService.regRecentQuotes(build) + console.log(id); + + // this.http.delete('http://localhost:8080/quote/recent/'+id).subscribe(); + + setTimeout(()=>{ + this.succeed = id + setTimeout(() => { + this.ngOnInit() + }, 3000); + }, 1500) + + } + + openModal(){ + + var modal = document.getElementById('modal2') + + modal?.setAttribute('style', 'display:block;') + + modal?.setAttribute('class', 'portfolio-modal modal fade show') + modal?.removeAttribute('aria-hidden') + + modal?.setAttribute('arial-modal', 'true') + + } + + closeModal(){ + var modal = document.getElementById('modal2') + modal?.setAttribute('class', 'portfolio-modal modal fade') + setTimeout(()=>{ + modal?.setAttribute('style', 'display:none;') + },500) } diff --git a/frontend/main/src/app/user-client/user-client.component.html b/frontend/main/src/app/user-client/user-client.component.html index abe7264..d48d2e2 100644 --- a/frontend/main/src/app/user-client/user-client.component.html +++ b/frontend/main/src/app/user-client/user-client.component.html @@ -1 +1,183 @@ -

user-client works!

+
+ + + + + + + + + + + +
+
+
{{i+1}} R${{quote.precoFrete}} {{quote.tempo}} dias úteis
+ + + + + + + + + + + + + + + + + + +
ItemNameE-mailCPFBirthdayAction
{{i+1}}{{user.name}}{{user.email}}{{user.document}}{{user.birth}} + + + + + + + + + + + + +
diff --git a/frontend/main/src/app/user-client/user-client.component.ts b/frontend/main/src/app/user-client/user-client.component.ts index e040787..700ff0d 100644 --- a/frontend/main/src/app/user-client/user-client.component.ts +++ b/frontend/main/src/app/user-client/user-client.component.ts @@ -1,4 +1,8 @@ +import { HttpClient } from '@angular/common/http'; import { Component, OnInit } from '@angular/core'; +import { Router } from '@angular/router'; +import { catchError } from 'rxjs'; +import { UsersService } from '../users.service'; @Component({ selector: 'app-user-client', @@ -7,9 +11,135 @@ import { Component, OnInit } from '@angular/core'; }) export class UserClientComponent implements OnInit { - constructor() { } + users!:Array + name!:string + email!:string + document!:string + birth!:string + id!: number + + + constructor(public usersService: UsersService, private router: Router, private http: HttpClient) { } ngOnInit(): void { + this.users = new Array() + this.usersService.listUsers().pipe( + catchError((error)=>{ + return error + }) + + ).subscribe((response: any) => { + + console.log(response); + + var count = Object.keys(response).length; + + for (let i = 0; i < count; i++) { + + this.id = response[i].id; + this.name = response[i].nome; + this.email = response[i].email; + this.document = response[i].document; + this.birth = response[i].birth; + + + this.users.push({id: this.id, name:this.name, email:this.email, document:this.document, birth:this.birth}); + + } + + this.name = ""; + this.email = ""; + this.document = ""; + this.birth = ""; + + }) + + } + + adicionar(name: string, email: string, document: string, birth: string) { + + + let build ={ + "nome":name, + "email":email, + "document":document, + // "birth":birth, + + } + + this.usersService.adicionar(build) + + setTimeout(() => { + this.ngOnInit(); + }, 500); + + // this.users.push({name:this.name, email:this.email, document:this.document, birth:this.birth}); + } + + deletar(id:number){ + + console.log(id); + + this.http.delete('http://localhost:8080/user/'+id).subscribe(); + + setTimeout(() => { + this.ngOnInit(); + }, 500); + + } + + alterar(){ + + } + + openModal(){ + + var modal = document.getElementById('modal2') + + modal?.setAttribute('style', 'display:block;') + + modal?.setAttribute('class', 'portfolio-modal modal fade show') + modal?.removeAttribute('aria-hidden') + + modal?.setAttribute('arial-modal', 'true') + } + closeModal(){ + var modal = document.getElementById('modal2') + + modal?.setAttribute('class', 'portfolio-modal modal fade') + setTimeout(()=>{ + modal?.setAttribute('style', 'display:none;') + },500) + + } + + openModalEdit(){ + + var modal = document.getElementById('modal3') + + modal?.setAttribute('style', 'display:block;') + + modal?.setAttribute('class', 'portfolio-modal modal fade show') + modal?.removeAttribute('aria-hidden') + + modal?.setAttribute('arial-modal', 'true') + + } + + closeModalEdit(){ + var modal = document.getElementById('modal3') + + modal?.setAttribute('class', 'portfolio-modal modal fade') + setTimeout(()=>{ + modal?.setAttribute('style', 'display:none;') + },500) + + } + + } + + + \ No newline at end of file diff --git a/frontend/main/src/app/users/users.component.html b/frontend/main/src/app/users/users.component.html index a825d34..bbdcc02 100644 --- a/frontend/main/src/app/users/users.component.html +++ b/frontend/main/src/app/users/users.component.html @@ -1,4 +1,72 @@ - +
+ + + + + + + + + + - - -

- - + + - - + + @@ -41,8 +107,76 @@ diff --git a/frontend/main/src/app/users/users.component.ts b/frontend/main/src/app/users/users.component.ts index 08f69e9..e794843 100644 --- a/frontend/main/src/app/users/users.component.ts +++ b/frontend/main/src/app/users/users.component.ts @@ -1,6 +1,7 @@ import { HttpClient } from '@angular/common/http'; import { Component, OnInit } from '@angular/core'; import { Router } from '@angular/router'; +import { catchError } from 'rxjs'; import { UsersService } from '../users.service'; @Component({ @@ -14,12 +15,18 @@ name!:string email!:string document!:string birth!:string +id!: number constructor(public usersService: UsersService, private router: Router, private http: HttpClient) { } ngOnInit(): void { this.users = new Array() - this.usersService.listUsers().pipe().subscribe((response: any) => { + this.usersService.listUsers().pipe( + catchError((error)=>{ + return error + }) + + ).subscribe((response: any) => { console.log(response); @@ -27,13 +34,14 @@ birth!:string for (let i = 0; i < count; i++) { + this.id = response[i].id; this.name = response[i].nome; this.email = response[i].email; this.document = response[i].document; this.birth = response[i].birth; - this.users.push({name:this.name, email:this.email, document:this.document, birth:this.birth}); + this.users.push({id: this.id, name:this.name, email:this.email, document:this.document, birth:this.birth}); } @@ -59,16 +67,74 @@ birth!:string this.usersService.adicionar(build) - this.users.push({name:this.name, email:this.email, document:this.document, birth:this.birth}); + setTimeout(() => { + this.ngOnInit(); + }, 500); + + // this.users.push({name:this.name, email:this.email, document:this.document, birth:this.birth}); } - deletar(){ + deletar(id:number){ + + console.log(id); + this.http.delete('http://localhost:8080/user/'+id).subscribe(); + + setTimeout(() => { + this.ngOnInit(); + }, 500); + } alterar(){ } + + openModal(){ + + var modal = document.getElementById('modal2') + + modal?.setAttribute('style', 'display:block;') + + modal?.setAttribute('class', 'portfolio-modal modal fade show') + modal?.removeAttribute('aria-hidden') + + modal?.setAttribute('arial-modal', 'true') + + } + + closeModal(){ + var modal = document.getElementById('modal2') + + modal?.setAttribute('class', 'portfolio-modal modal fade') + setTimeout(()=>{ + modal?.setAttribute('style', 'display:none;') + },500) + + } + + openModalEdit(){ + + var modal = document.getElementById('modal3') + + modal?.setAttribute('style', 'display:block;') + + modal?.setAttribute('class', 'portfolio-modal modal fade show') + modal?.removeAttribute('aria-hidden') + + modal?.setAttribute('arial-modal', 'true') + + } + + closeModalEdit(){ + var modal = document.getElementById('modal3') + + modal?.setAttribute('class', 'portfolio-modal modal fade') + setTimeout(()=>{ + modal?.setAttribute('style', 'display:none;') + },500) + + } } diff --git a/frontend/main/src/app/visits/visits.component.ts b/frontend/main/src/app/visits/visits.component.ts index 8b4267c..698e68d 100644 --- a/frontend/main/src/app/visits/visits.component.ts +++ b/frontend/main/src/app/visits/visits.component.ts @@ -1,6 +1,7 @@ import { HttpClient } from '@angular/common/http'; import { Component, OnInit } from '@angular/core'; import { Router } from '@angular/router'; +import { catchError } from 'rxjs'; import { VisitsService } from '../visits.service'; @Component({ @@ -25,7 +26,12 @@ export class VisitsComponent implements OnInit { this.visits = new Array() - this.visitsService.listVisits().pipe().subscribe((response: any) => { + this.visitsService.listVisits().pipe( + catchError((error)=>{ + return error + }) + + ).subscribe((response: any) => { console.log(response); diff --git a/webpage/index.html b/webpage/index.html index 002864c..ce291d7 100644 --- a/webpage/index.html +++ b/webpage/index.html @@ -282,9 +282,14 @@

Just people who love developing❤

Bruno Roberto

Frontend Dev.

- - - + + +
@@ -294,9 +299,14 @@

Bruno Roberto

alt="..." />

Cristian Schauffert

Web Designer

- - - + + +
@@ -306,9 +316,14 @@

Cristian Schauffert

alt="..." />

Kalil Fakhouri

Lead Developer

- - - + + +
@@ -318,9 +333,13 @@

Kalil Fakhouri

alt="..." />

Mateus Felipe

Lead Developer

- - - + + +
@@ -332,28 +351,7 @@

Mateus Felipe

-
-
-
-
- ... -
-
- ... -
-
- ... -
-
- ... -
-
-
-
+
IDNomeItemName E-mail CPFData nascimentoAçãoBirthdayAction
{{user.document}} {{user.birth}} - - + + + + + + + + + + + +