Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bspastoriza19-esi-solutions
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Breixo Senra Pastoriza
bspastoriza19-esi-solutions
Commits
c8ba5a32
Commit
c8ba5a32
authored
Oct 25, 2025
by
Breixo Senra
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Envío de email a owner de mascota vacunada
parent
d596a8e3
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
1 deletion
+23
-1
Pet.java
.../src/main/java/es/uvigo/esei/xcs/domain/entities/Pet.java
+4
-0
PetDetailsManagedBean.java
...ain/java/es/uvigo/esei/xcs/jsf/PetDetailsManagedBean.java
+4
-0
petDetails.xhtml
jsf/src/main/webapp/vet/petDetails.xhtml
+3
-0
PetService.java
...e/src/main/java/es/uvigo/esei/xcs/service/PetService.java
+4
-1
VaccinationService.java
...in/java/es/uvigo/esei/xcs/service/VaccinationService.java
+8
-0
No files found.
domain/src/main/java/es/uvigo/esei/xcs/domain/entities/Pet.java
View file @
c8ba5a32
...
@@ -221,6 +221,10 @@ public class Pet implements Serializable {
...
@@ -221,6 +221,10 @@ public class Pet implements Serializable {
this
.
vaccinations
.
remove
(
vaccination
);
this
.
vaccinations
.
remove
(
vaccination
);
}
}
public
Collection
<
Identifier
>
getIdentifiers
()
{
return
this
.
identifiers
;
}
public
void
addIdentifier
(
Identifier
identifier
)
{
public
void
addIdentifier
(
Identifier
identifier
)
{
requireNonNull
(
identifier
,
"Identifier can't be null"
);
requireNonNull
(
identifier
,
"Identifier can't be null"
);
identifier
.
setPet
(
this
);
identifier
.
setPet
(
this
);
...
...
jsf/src/main/java/es/uvigo/esei/xcs/jsf/PetDetailsManagedBean.java
View file @
c8ba5a32
...
@@ -18,6 +18,7 @@ import java.util.Map;
...
@@ -18,6 +18,7 @@ import java.util.Map;
import
es.uvigo.esei.xcs.domain.entities.Pet
;
import
es.uvigo.esei.xcs.domain.entities.Pet
;
import
es.uvigo.esei.xcs.domain.entities.Vaccine
;
import
es.uvigo.esei.xcs.domain.entities.Vaccine
;
import
es.uvigo.esei.xcs.domain.entities.Vaccination
;
import
es.uvigo.esei.xcs.domain.entities.Vaccination
;
import
es.uvigo.esei.xcs.service.EmailService
;
import
es.uvigo.esei.xcs.service.PetService
;
import
es.uvigo.esei.xcs.service.PetService
;
import
es.uvigo.esei.xcs.service.VaccinationService
;
import
es.uvigo.esei.xcs.service.VaccinationService
;
import
es.uvigo.esei.xcs.service.VaccineService
;
import
es.uvigo.esei.xcs.service.VaccineService
;
...
@@ -37,6 +38,9 @@ public class PetDetailsManagedBean implements Serializable{
...
@@ -37,6 +38,9 @@ public class PetDetailsManagedBean implements Serializable{
@Inject
@Inject
private
VaccinationService
vaccinationService
;
private
VaccinationService
vaccinationService
;
@Inject
private
EmailService
emailService
;
private
Pet
pet
;
private
Pet
pet
;
private
Long
selectedVaccineId
;
private
Long
selectedVaccineId
;
...
...
jsf/src/main/webapp/vet/petDetails.xhtml
View file @
c8ba5a32
...
@@ -25,6 +25,9 @@
...
@@ -25,6 +25,9 @@
<h:outputText
value=
"Fecha de Nacimiento:"
/>
<h:outputText
value=
"Fecha de Nacimiento:"
/>
<h:outputText
value=
"#{petDetails.pet.birth}"
/>
<h:outputText
value=
"#{petDetails.pet.birth}"
/>
<h:outputText
value=
"Propietario:"
/>
<h:outputText
value=
"#{petDetails.pet.owner.login}"
/>
</h:panelGrid>
</h:panelGrid>
<h3>
Vacunas
</h3>
<h3>
Vacunas
</h3>
...
...
service/src/main/java/es/uvigo/esei/xcs/service/PetService.java
View file @
c8ba5a32
...
@@ -8,6 +8,7 @@ import java.util.List;
...
@@ -8,6 +8,7 @@ import java.util.List;
import
javax.annotation.security.PermitAll
;
import
javax.annotation.security.PermitAll
;
import
javax.annotation.security.RolesAllowed
;
import
javax.annotation.security.RolesAllowed
;
import
javax.ejb.EJB
;
import
javax.ejb.EJBAccessException
;
import
javax.ejb.EJBAccessException
;
import
javax.ejb.Stateless
;
import
javax.ejb.Stateless
;
import
javax.inject.Inject
;
import
javax.inject.Inject
;
...
@@ -32,6 +33,9 @@ public class PetService {
...
@@ -32,6 +33,9 @@ public class PetService {
@Inject
@Inject
private
Principal
currentUser
;
private
Principal
currentUser
;
@EJB
private
EmailService
emailService
;
@PersistenceContext
@PersistenceContext
private
EntityManager
em
;
private
EntityManager
em
;
...
@@ -243,5 +247,4 @@ public class PetService {
...
@@ -243,5 +247,4 @@ public class PetService {
return
count
>
0
;
return
count
>
0
;
}
}
}
}
service/src/main/java/es/uvigo/esei/xcs/service/VaccinationService.java
View file @
c8ba5a32
...
@@ -8,6 +8,7 @@ import java.text.SimpleDateFormat;
...
@@ -8,6 +8,7 @@ import java.text.SimpleDateFormat;
import
java.util.List
;
import
java.util.List
;
import
javax.annotation.security.PermitAll
;
import
javax.annotation.security.PermitAll
;
import
javax.ejb.EJB
;
import
javax.ejb.Stateless
;
import
javax.ejb.Stateless
;
import
javax.persistence.EntityManager
;
import
javax.persistence.EntityManager
;
import
javax.persistence.PersistenceContext
;
import
javax.persistence.PersistenceContext
;
...
@@ -24,6 +25,8 @@ public class VaccinationService {
...
@@ -24,6 +25,8 @@ public class VaccinationService {
@PersistenceContext
@PersistenceContext
EntityManager
em
;
EntityManager
em
;
@EJB
private
EmailService
emailService
;
public
Vaccination
get
(
int
vaccinationId
)
{
public
Vaccination
get
(
int
vaccinationId
)
{
return
em
.
find
(
Vaccination
.
class
,
vaccinationId
);
return
em
.
find
(
Vaccination
.
class
,
vaccinationId
);
...
@@ -72,6 +75,11 @@ public class VaccinationService {
...
@@ -72,6 +75,11 @@ public class VaccinationService {
Vaccination
vaccination
=
new
Vaccination
(
pet
,
vaccine
,
date
);
Vaccination
vaccination
=
new
Vaccination
(
pet
,
vaccine
,
date
);
em
.
persist
(
vaccination
);
em
.
persist
(
vaccination
);
emailService
.
send
(
pet
.
getOwner
().
getLogin
(),
pet
.
getName
()
+
" ha sido vacunado con "
+
vaccine
.
getName
(),
pet
.
getName
()
+
" ha sido vacunado con "
+
vaccine
.
getName
()
);
return
vaccination
;
return
vaccination
;
}
}
...
...
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