Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
BackEnd-V2
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Joel Andres Molina Velez
BackEnd-V2
Commits
6ac45cee
Commit
6ac45cee
authored
Jun 29, 2023
by
Joel Andres Molina Velez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Se corrigen los servicios de ModelUzyTavDetComca
parent
d04ed314
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
14 additions
and
12 deletions
+14
-12
UzyTUsuarioController.java
...vilidad/MovilidadWS/Controller/UzyTUsuarioController.java
+1
-1
UzyTavDetComcaController.java
...idad/MovilidadWS/Controller/UzyTavDetComcaController.java
+2
-3
DaoUzyTavDetComca.java
...edu/espe/movilidad/MovilidadWS/Dao/DaoUzyTavDetComca.java
+1
-1
UzyTavDetComcaMapper.java
...lidadWS/Mapper/Components_Class/UzyTavDetComcaMapper.java
+5
-1
ModelUzyTavDetComca.java
...espe/movilidad/MovilidadWS/Model/ModelUzyTavDetComca.java
+1
-2
IServiceUzyTavDetComca.java
...idadWS/Service/UzyTavDetComca/IServiceUzyTavDetComca.java
+1
-1
ServiceUzyTavDetComca.java
...lidadWS/Service/UzyTavDetComca/ServiceUzyTavDetComca.java
+3
-3
No files found.
src/main/java/ec/edu/espe/movilidad/MovilidadWS/Controller/UzyTUsuarioController.java
View file @
6ac45cee
...
...
@@ -33,7 +33,7 @@ public class UzyTUsuarioController {
return
new
ResponseEntity
<>(
serviceUzyTUsuario
.
ListarRegistros
(),
HttpStatus
.
OK
);
}
@GetMapping
(
"/buscar
u
saurio"
)
@GetMapping
(
"/buscar
U
saurio"
)
public
ResponseEntity
<
List
<
DtoUzyTUsuario
>>
buscarUsuarios
(
@RequestParam
(
required
=
false
)
String
usuario
)
{
List
<
DtoUzyTUsuario
>
usuarios
=
serviceUzyTUsuario
.
findByUsuario
(
usuario
);
return
ResponseEntity
.
ok
(
usuarios
);
...
...
src/main/java/ec/edu/espe/movilidad/MovilidadWS/Controller/UzyTavDetComcaController.java
View file @
6ac45cee
...
...
@@ -33,9 +33,8 @@ public class UzyTavDetComcaController {
}
@GetMapping
(
"/datosRealacionadosconCabComca/{id}"
)
public
ResponseEntity
<
List
<
Object
[]>>
findByIdconDatosCabComca
(
@PathVariable
(
"id"
)
Long
id
)
{
List
<
Object
[]>
result
=
serviceUzyTavDetComca
.
findByIdconDatosCabComca
(
id
);
return
ResponseEntity
.
ok
(
result
);
public
ResponseEntity
<
List
<
DtoUzyTavDetComca
>>
findByIdconDatosCabComca
(
@PathVariable
(
"id"
)
Long
id
)
{
return
new
ResponseEntity
<>(
serviceUzyTavDetComca
.
findByIdconDatosCabComca
(
id
),
HttpStatus
.
OK
);
}
...
...
src/main/java/ec/edu/espe/movilidad/MovilidadWS/Dao/DaoUzyTavDetComca.java
View file @
6ac45cee
...
...
@@ -14,7 +14,7 @@ public interface DaoUzyTavDetComca extends JpaRepository<ModelUzyTavDetComca, L
//Obtener los datos relacionados con la tabla CabComca mediante un ID
@Query
(
"SELECT p FROM ModelUzyTavDetComca p INNER JOIN p.uzytavcabcomca c WHERE c.uzytavcabcomca_id = :id"
)
List
<
Object
[]
>
findByIdconDatosCabComca
(
@Param
(
"id"
)
Long
id
);
List
<
ModelUzyTavDetComca
>
findByIdconDatosCabComca
(
@Param
(
"id"
)
Long
id
);
}
src/main/java/ec/edu/espe/movilidad/MovilidadWS/Mapper/Components_Class/UzyTavDetComcaMapper.java
View file @
6ac45cee
...
...
@@ -28,11 +28,15 @@ public class UzyTavDetComcaMapper {
}
public
ModelUzyTavDetComca
dtoToEntity
(
DtoUzyTavDetComca
dto
)
{
if
(
dto
.
getUzytusuario_id_asignado
()
==
null
)
{
throw
new
IllegalArgumentException
(
"El campo usuarioIdAsignado es requerido"
);
}
ModelUzyTavDetComca
entity
=
modelMapper
.
map
(
dto
,
ModelUzyTavDetComca
.
class
);
Long
cabcomcaID
=
dto
.
getUzytavcabcomca_id
();
ModelUzyTavCabComca
cabComca
=
entityManager
.
find
(
ModelUzyTavCabComca
.
class
,
cabcomcaID
);
Long
usuarioIdAsignado
=
dto
.
getUzytusuario_id_asignado
();
entity
.
setUzytavcabcomca
(
cabComca
);
entity
.
setUzytusuario_id_asignado
(
usuarioIdAsignado
);
return
entity
;
}
...
...
src/main/java/ec/edu/espe/movilidad/MovilidadWS/Model/ModelUzyTavDetComca.java
View file @
6ac45cee
...
...
@@ -33,14 +33,13 @@ public class ModelUzyTavDetComca {
private
String
uzytavdetcomca_estado
;
//Relacion con la tabla CabComca-Tabla padre
@JsonIgnore
@ManyToOne
@JoinColumn
(
name
=
"uzytavcabcomca_id"
)
private
ModelUzyTavCabComca
uzytavcabcomca
;
//RELACIÓN CON LA TABLA uzytavcabevalp- TABLA HIJA
@JsonIgnore
@OneToMany
(
mappedBy
=
"uzytavdetcomca"
,
cascade
=
CascadeType
.
ALL
)
@OneToMany
(
mappedBy
=
"uzytavdetcomca"
)
private
Set
<
ModelUzyTavCabeValp
>
modelUzyTavCabeValpSet
;
}
src/main/java/ec/edu/espe/movilidad/MovilidadWS/Service/UzyTavDetComca/IServiceUzyTavDetComca.java
View file @
6ac45cee
...
...
@@ -13,7 +13,7 @@ public interface IServiceUzyTavDetComca {
DtoUzyTavDetComca
guardar
(
DtoUzyTavDetComca
dtoUzyTavDetComca
);
List
<
Object
[]
>
findByIdconDatosCabComca
(
@Param
(
"id"
)
Long
id
);
List
<
DtoUzyTavDetComca
>
findByIdconDatosCabComca
(
@Param
(
"id"
)
Long
id
);
DtoUzyTavDetComca
editar
(
Long
id
,
DtoUzyTavDetComca
dtoUzyTavDetComca
);
...
...
src/main/java/ec/edu/espe/movilidad/MovilidadWS/Service/UzyTavDetComca/ServiceUzyTavDetComca.java
View file @
6ac45cee
...
...
@@ -43,8 +43,9 @@ public class ServiceUzyTavDetComca implements IServiceUzyTavDetComca{
}
@Override
public
List
<
Object
[]>
findByIdconDatosCabComca
(
Long
id
)
{
return
daoUzyTavDetComca
.
findByIdconDatosCabComca
(
id
);
public
List
<
DtoUzyTavDetComca
>
findByIdconDatosCabComca
(
Long
id
)
{
List
<
ModelUzyTavDetComca
>
entities
=
daoUzyTavDetComca
.
findByIdconDatosCabComca
(
id
);
return
mapper
.
entitiesToDtos
(
entities
);
}
@Override
...
...
@@ -53,7 +54,6 @@ public class ServiceUzyTavDetComca implements IServiceUzyTavDetComca{
ModelUzyTavDetComca
entity
=
daoUzyTavDetComca
.
findById
(
id
).
get
();
if
(
entity
!=
null
)
{
entity
.
setUzytusuario_id_crea
(
dtoUzyTavDetComca
.
getUzytusuario_id_crea
());
entity
.
setUzytusuario_id_asignado
(
dtoUzyTavDetComca
.
getUzytusuario_id_asignado
());
entity
.
setUzytavdetcomca_fech_crea
(
dtoUzyTavDetComca
.
getUzytavdetcomca_fech_crea
());
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment