diff --git a/README.md b/README.md
index df9f062..819fb29 100644
--- a/README.md
+++ b/README.md
@@ -175,7 +175,7 @@
3.1 - GOOGLE CLOUD
-Clique aqui para aprender a configurar o Google Cloud
+Clique aqui para aprender a configurar o Google Cloud
>## 3.1.1 - Google API
>>### 3.1.1.1 - Directions API
diff --git a/assets/README.md b/assets/README.md
new file mode 100644
index 0000000..4a60eb5
--- /dev/null
+++ b/assets/README.md
@@ -0,0 +1,2 @@
+# CONFIGURANDO GOOGLE CLOUD PARA DEPLOY E SERVICES
+
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 823064c..814b6c5 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
@@ -65,8 +65,8 @@ public long numberClients() {
}
@GetMapping("/countVisitors")
- public long numberVisitors() {
- return countVisitorsRepository.count();
+ public List numberVisitors() {
+ return countVisitorsRepository.findAll();
}
@GetMapping("/birthnow")
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 08d3e31..f857e39 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
@@ -6,6 +6,7 @@
import org.springframework.beans.factory.annotation.Autowired;
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;
@@ -45,6 +46,11 @@ public List recentQuote(@PathVariable("id") int id){
return recentQuoteRepository.findOwnQuote(id);
}
+ @DeleteMapping("/recent/{id}")
+ public void deleteQuote(@PathVariable("id") int id){
+ recentQuoteRepository.deleteById(id);
+ }
+
@GetMapping("/go")
public int goingPackages() {
diff --git a/backend/TMSProject/src/main/java/br/com/entra21/teamroxo/TMSProject/interfaces/CarriersRepository.java b/backend/TMSProject/src/main/java/br/com/entra21/teamroxo/TMSProject/interfaces/CarriersRepository.java
index 9ac52de..c79c263 100644
--- a/backend/TMSProject/src/main/java/br/com/entra21/teamroxo/TMSProject/interfaces/CarriersRepository.java
+++ b/backend/TMSProject/src/main/java/br/com/entra21/teamroxo/TMSProject/interfaces/CarriersRepository.java
@@ -1,7 +1,5 @@
package br.com.entra21.teamroxo.TMSProject.interfaces;
-import java.util.List;
-
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
diff --git a/frontend/main/src/app/app-routing.module.ts b/frontend/main/src/app/app-routing.module.ts
index 5c32c78..32954c6 100644
--- a/frontend/main/src/app/app-routing.module.ts
+++ b/frontend/main/src/app/app-routing.module.ts
@@ -18,6 +18,7 @@ import { ReceiptComponent } from './receipt/receipt.component';
import { ShipQtComponent } from './ship-qt/ship-qt.component';
import { UserClientComponent } from './user-client/user-client.component';
import { UsersComponent } from './users/users.component';
+import { VisitsComponent } from './visits/visits.component';
const routes: Routes = [
{ path: 'home', component:HomeComponent, canActivate:[LoginserviceService]},
@@ -36,7 +37,8 @@ const routes: Routes = [
{ path: 'edit', component:EditComponent, canActivate:[LoginserviceService]},
{ path: 'about', component:AboutComponent, canActivate:[LoginserviceService]},
{ path: 'forgetPassword', component:ForgetPasswordComponent},
- { path: "user-client", component:UserClientComponent, canActivate:[LoginserviceService]}
+ { path: "user-client", component:UserClientComponent, canActivate:[LoginserviceService]},
+ { path: "visits", component:VisitsComponent, canActivate:[LoginserviceService]}
];
@NgModule({
diff --git a/frontend/main/src/app/app.module.ts b/frontend/main/src/app/app.module.ts
index 86dd107..f8a5112 100644
--- a/frontend/main/src/app/app.module.ts
+++ b/frontend/main/src/app/app.module.ts
@@ -24,6 +24,7 @@ import { AboutComponent } from './about/about.component';
import { HttpClientModule } from "@angular/common/http";
import { ForgetPasswordComponent } from './forget-password/forget-password.component';
import { UserClientComponent } from './user-client/user-client.component';
+import { VisitsComponent } from './visits/visits.component';
@NgModule({
declarations: [
@@ -46,7 +47,8 @@ import { UserClientComponent } from './user-client/user-client.component';
EditComponent,
AboutComponent,
ForgetPasswordComponent,
- UserClientComponent
+ UserClientComponent,
+ VisitsComponent
],
imports: [
BrowserModule,
diff --git a/frontend/main/src/app/body/body.component.html b/frontend/main/src/app/body/body.component.html
index 442143e..f010d99 100644
--- a/frontend/main/src/app/body/body.component.html
+++ b/frontend/main/src/app/body/body.component.html
@@ -19,12 +19,12 @@
@@ -34,12 +34,12 @@
@@ -64,32 +64,7 @@
-
-
-
- 3
-
-
-
+
@@ -196,6 +171,14 @@
+
+
+
+
+ Visits
+
+
+
diff --git a/frontend/main/src/app/body/body.component.ts b/frontend/main/src/app/body/body.component.ts
index 01e2906..628c4b0 100644
--- a/frontend/main/src/app/body/body.component.ts
+++ b/frontend/main/src/app/body/body.component.ts
@@ -1,6 +1,9 @@
import { Component, OnInit } from '@angular/core';
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';
@Component({
selector: 'app-body',
@@ -9,18 +12,55 @@ import { LoginserviceService } from '../loginservice.service';
})
export class BodyComponent implements OnInit {
- constructor(public loginService:LoginserviceService) { }
+ readonly APIBirthNow: string = "http://localhost:8080/user/birthnow"
+
+ readonly APIBirthMonth: string = "http://localhost:8080/user/birthmonth"
+
+ birthnow! : string
+ birthmonth! : string
+ aniversariantes!: Array
+ aniversariantesMes!: Array
+ id!: number
+ nome!: string
+ email!: string
+ birth!: Date
+ document!: string
+
+ constructor(public loginService:LoginserviceService, private router:Router, private http:HttpClient) { }
ngOnInit(): void {
-
+ this.aniversariantes = new Array()
+ this.aniversariantesMes = new Array()
- }
+ this.http.get(this.APIBirthNow)
+ .subscribe((resultado:any) => {
- sair(){
+ var count = Object.keys(resultado).length
+
+ for(let i=0;i {
+
+ var count = Object.keys(resultado).length
+
+ for(let i=0;i{
- return response
- })
+ return this.http.get(this.apiURL+'/'+id)
+
+
+
}
diff --git a/frontend/main/src/app/finance/finance.component.css b/frontend/main/src/app/finance/finance.component.css
index e69de29..80a0783 100644
--- a/frontend/main/src/app/finance/finance.component.css
+++ b/frontend/main/src/app/finance/finance.component.css
@@ -0,0 +1,46 @@
+#graph{
+ padding-bottom: 40px;
+ width: 600px;
+ height: 400px;
+}
+
+h2{
+ padding-top: 20px;
+}
+
+body {
+ font-family: 'open sans', sans-serif;
+ font-size: 3rem;
+ background-size: cover;
+ height: 100%;
+}
+
+svg {
+ margin: 0 auto;
+ text-align: center;
+ width: 100%;
+ padding-top: 30px;
+}
+
+polyline {
+ stroke-dasharray: 1000;
+ stroke-dashoffset: 1000;
+ animation: dash 5s ease-in forwards;
+}
+
+@keyframes dash{
+ to {
+ stroke-dashoffset: 0;
+ }
+}
+
+
+p {
+ font-size: 2rem;
+ text-align:center;
+ color: #efefef;
+}
+.name {
+ font-size: .8rem;
+ font-weight: light;
+}
diff --git a/frontend/main/src/app/finance/finance.component.html b/frontend/main/src/app/finance/finance.component.html
index 872c101..224c836 100644
--- a/frontend/main/src/app/finance/finance.component.html
+++ b/frontend/main/src/app/finance/finance.component.html
@@ -1 +1,81 @@
-finance works!
+
+
LUCRO
+
+
diff --git a/frontend/main/src/app/insight/insight.component.html b/frontend/main/src/app/insight/insight.component.html
index 6bf3143..4741b70 100644
--- a/frontend/main/src/app/insight/insight.component.html
+++ b/frontend/main/src/app/insight/insight.component.html
@@ -19,7 +19,7 @@ {{countPackages}}
-
12%
+
{{countBounce}}%
Bounce Rate
@@ -51,12 +51,12 @@
{{countClient}}
{{countVisitors}}
-
Visitors
+
Visits
-
+
@@ -288,3 +288,4 @@
+
diff --git a/frontend/main/src/app/insight/insight.component.ts b/frontend/main/src/app/insight/insight.component.ts
index 9fddf9c..f94e47c 100644
--- a/frontend/main/src/app/insight/insight.component.ts
+++ b/frontend/main/src/app/insight/insight.component.ts
@@ -16,10 +16,13 @@ export class InsightComponent implements OnInit {
readonly APICountVisits:string = "http://localhost:8080/user/countVisitors"
readonly APICountPackages:string = "http://localhost:8080/quote/go"
+
+ readonly APICountBounce:string = "http://localhost:8080/user/bounce"
countClient!: number
countVisitors!: number
countPackages!:number
+ countBounce!:number
constructor(private router:Router, private http:HttpClient) {
@@ -34,7 +37,8 @@ export class InsightComponent implements OnInit {
this.http.get(this.APICountVisits)
.subscribe((resultado:any) => {
- this.countVisitors=resultado
+ var count = Object.keys(resultado).length
+ this.countVisitors = count
});
this.http.get(this.APICountPackages)
@@ -42,6 +46,12 @@ export class InsightComponent implements OnInit {
this.countPackages=response
})
+ this.http.get(this.APICountBounce)
+ .subscribe((response:any)=>{
+ this.countBounce=response
+ })
+
+
}
register(){
@@ -52,13 +62,9 @@ export class InsightComponent implements OnInit {
this.router.navigateByUrl('users')
}
- // countClients() {
- // this.http.get(`${this.TMSLoginAPI}/countClients`).subscribe(resultado => console.log(resultado));
- // return ;
+ visits(){
+ this.router.navigateByUrl('visits')
+ }
- // }
- // countVisitors(){
- // this.http.get(`${this.apiURL}/countVisitors`).subscribe(resultado => console.log(resultado));
- // }
}
diff --git a/frontend/main/src/app/quote.service.ts b/frontend/main/src/app/quote.service.ts
index a0505ff..60805db 100644
--- a/frontend/main/src/app/quote.service.ts
+++ b/frontend/main/src/app/quote.service.ts
@@ -4,6 +4,7 @@ import { Router } from '@angular/router';
import { type } from 'os';
import { catchError } from 'rxjs';
import { LoginserviceService } from './loginservice.service';
+import { RctQtComponent } from './rct-qt/rct-qt.component';
import { ShipQtComponent } from './ship-qt/ship-qt.component';
@Injectable({
@@ -82,27 +83,20 @@ export class QuoteService {
this.http.post(this.APIBouncePut+this.login.idBounce, this.newBounce)
//FIM DO BOUNCE
-
this.http.post(this.apiURL2+'/recent',object)
.subscribe((response)=>{
-
console.log(response);
})
-
}
regPackage(object:any){
this.http.post(this.apiURL2+'/register',object)
.subscribe((response)=>{
-
-
console.log(response);
-
-
})
}
}
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 9ee9d9d..c64ada3 100644
--- a/frontend/main/src/app/rct-qt/rct-qt.component.html
+++ b/frontend/main/src/app/rct-qt/rct-qt.component.html
@@ -1,7 +1,6 @@
| Ação |
-
Preço do frete |
Prazo |
Transportadora |
@@ -9,22 +8,19 @@
Destino |
Peso cubado |
Usuário |
-
-
- |
-
+
+ |
+
R${{recQuote.price}} |
{{recQuote.await}} dias úteis |
{{recQuote.razaoTransportadora}} |
{{recQuote.origin}} |
{{recQuote.destiny}} |
- {{recQuote.cub_height}} kg |
- {{recQuote.nomePessoa}} |
-
-
+ {{recQuote.cub_height}} kg |
+ {{recQuote.nomePessoa}} |
-
\ No newline at end of file
+
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 1cbccbc..717b519 100644
--- a/frontend/main/src/app/rct-qt/rct-qt.component.ts
+++ b/frontend/main/src/app/rct-qt/rct-qt.component.ts
@@ -12,7 +12,8 @@ import { QuoteService } from '../quote.service';
})
export class RctQtComponent implements OnInit {
-
+ progress!:boolean
+ succeed:boolean = false
recQuotes!: Array
id!: number
price!: number
@@ -24,8 +25,7 @@ export class RctQtComponent implements OnInit {
pessoa_id!: number
nomePessoa!: string
razaoTransportadora!: string
-
-
+ carrier!: any
constructor(private carrierService: CarrierService, private loginService: LoginserviceService, public quoteService: QuoteService, private router: Router, private http: HttpClient) { }
@@ -35,37 +35,34 @@ export class RctQtComponent implements OnInit {
this.quoteService.recQuote().pipe().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.price = response[i].price
- this.await = response[i].await
- this.origin = response[i].origin
- this.destiny = response[i].destiny
- this.cub_height = response[i].cub_height
-
-
- this.razaoTransportadora = this.carrierService.findName(response.carrier_id);
+ // this.id = response[i].id
+ // this.price = response[i].price
+ // this.await = response[i].await
+ // this.origin = response[i].origin
+ // this.destiny = response[i].destiny
+ // this.cub_height = response[i].cub_height
+
+ this.carrierService.findName(response[i].carrier_id).subscribe((resp:any) => {
- this.recQuotes.push({id: this.id, price: this.price, await: this.await, origin: this.origin, destiny: this.destiny, cub_height: this.cub_height, razaoTransportadora: this.razaoTransportadora, carrier_id: response.carrier_id, nomePessoa: this.loginService.nome})
-
+ this.recQuotes.push({id: response[i].id, price: response[i].price, await: response[i].await, origin: response[i].origin, destiny: response[i].destiny, cub_height: response[i].cub_height, razaoTransportadora: resp.razao, carrier_id: resp.id, nomePessoa: this.loginService.nome})
+ })
}
console.log();
-
- })
+ })
}
-
regPackage(price: number, time: number, origin: string, destiny: string, carrier_id: string, cub_height: number) {
-
+ this.progress = true
let build = {
"price": price,
@@ -78,11 +75,12 @@ export class RctQtComponent implements OnInit {
}
console.log(build);
-
- this.quoteService.regPackage(build)
-
+ this.quoteService.regPackage(build)
+ setTimeout(()=>{
+ this.succeed = true
+ }, 1500)
}
diff --git a/frontend/main/src/app/visits/visits.component.css b/frontend/main/src/app/visits/visits.component.css
new file mode 100644
index 0000000..e69de29
diff --git a/frontend/main/src/app/visits/visits.component.html b/frontend/main/src/app/visits/visits.component.html
new file mode 100644
index 0000000..c542c19
--- /dev/null
+++ b/frontend/main/src/app/visits/visits.component.html
@@ -0,0 +1,18 @@
+
+
+ | ID |
+ Data |
+ Time |
+ User |
+ Bounce Rate |
+
+
+
+ | {{visit.id}} |
+ {{visit.date}} |
+ {{visit.time}} |
+ {{visit.user}} |
+ {{visit.bounceRate}} |
+
+
+
diff --git a/frontend/main/src/app/visits/visits.component.spec.ts b/frontend/main/src/app/visits/visits.component.spec.ts
new file mode 100644
index 0000000..377f3f3
--- /dev/null
+++ b/frontend/main/src/app/visits/visits.component.spec.ts
@@ -0,0 +1,23 @@
+import { ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { VisitsComponent } from './visits.component';
+
+describe('VisitsComponent', () => {
+ let component: VisitsComponent;
+ let fixture: ComponentFixture;
+
+ beforeEach(async () => {
+ await TestBed.configureTestingModule({
+ declarations: [ VisitsComponent ]
+ })
+ .compileComponents();
+
+ fixture = TestBed.createComponent(VisitsComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/frontend/main/src/app/visits/visits.component.ts b/frontend/main/src/app/visits/visits.component.ts
new file mode 100644
index 0000000..2937a48
--- /dev/null
+++ b/frontend/main/src/app/visits/visits.component.ts
@@ -0,0 +1,33 @@
+import { HttpClient } from '@angular/common/http';
+import { Component, OnInit } from '@angular/core';
+import { Router } from '@angular/router';
+
+@Component({
+ selector: 'app-visits',
+ templateUrl: './visits.component.html',
+ styleUrls: ['./visits.component.css']
+})
+export class VisitsComponent implements OnInit {
+
+ readonly APICountVisits:string = "http://localhost:8080/user/countVisitors"
+
+ visits! : Array
+
+ constructor(private router:Router, private http:HttpClient) { }
+
+ ngOnInit(): void {
+ this.visits = new Array()
+ this.http.get(this.APICountVisits)
+ .subscribe((resultado:any)=>{
+ var count = Object.keys(resultado).length
+ for(let i = 0; i