Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
ejercicio2-framework-back
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
Josue
ejercicio2-framework-back
Commits
6e1e5140
Commit
6e1e5140
authored
Jan 14, 2022
by
Roberto Loayza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update SchedulerService, CountryRepository
parent
31fd50ae
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
4 deletions
+12
-4
JobCompletionListener.java
...esw/bytebot/etl/batch/listener/JobCompletionListener.java
+3
-1
ScheduleService.java
...com/bytesw/bytebot/etl/batch/service/ScheduleService.java
+2
-2
CountryRepository.java
...java/com/bytesw/bytebot/repository/CountryRepository.java
+6
-0
AgentService.java
src/main/java/com/bytesw/bytebot/service/AgentService.java
+1
-1
No files found.
src/main/java/com/bytesw/bytebot/etl/batch/listener/JobCompletionListener.java
View file @
6e1e5140
package
com
.
bytesw
.
bytebot
.
etl
.
batch
.
listener
;
import
lombok.extern.log4j.Log4j2
;
import
org.springframework.batch.core.BatchStatus
;
import
org.springframework.batch.core.JobExecution
;
import
org.springframework.batch.core.listener.JobExecutionListenerSupport
;
@Log4j2
public
class
JobCompletionListener
extends
JobExecutionListenerSupport
{
@Override
public
void
afterJob
(
JobExecution
jobExecution
)
{
if
(
jobExecution
.
getStatus
()
==
BatchStatus
.
COMPLETED
)
{
System
.
out
.
println
(
"BATCH JOB COMPLETED SUCCESSFULLY"
);
log
.
debug
(
"BATCH JOB COMPLETED SUCCESSFULLY"
);
}
}
...
...
src/main/java/com/bytesw/bytebot/etl/batch/service/ScheduleService.java
View file @
6e1e5140
...
...
@@ -321,7 +321,7 @@ public class ScheduleService implements SchedulingConfigurer {
result
=
false
;
}
}
else
if
(
exception
.
getFrequencyType
().
equals
(
FrequencyType
.
UNIQUE
.
getName
()))
{
if
(
now
.
toLocalDate
()
==
exception
.
getDate
(
))
{
if
(
now
.
toLocalDate
()
.
equals
(
exception
.
getDate
()
))
{
result
=
false
;
}
}
else
if
(
exception
.
getFrequencyType
().
equals
(
FrequencyType
.
UniqueWeekly
.
getName
()))
{
...
...
@@ -389,7 +389,7 @@ public class ScheduleService implements SchedulingConfigurer {
/* Métodos ETL de data sensible */
private
Job
createJobDataSens
(
DeleteDataSensBean
data
)
{
System
.
out
.
println
(
"ETL de eliminacion"
);
log
.
info
(
"ETL de eliminacion"
);
ThreadLocalStorage
.
setTenantName
(
tenant
);
return
jobBuilderFactory
.
get
(
String
.
format
(
"processDataSensible-%d"
,
data
.
getAgenId
()))
.
incrementer
(
new
RunIdIncrementer
()).
listener
(
listener
)
...
...
src/main/java/com/bytesw/bytebot/repository/CountryRepository.java
View file @
6e1e5140
package
com
.
bytesw
.
bytebot
.
repository
;
import
com.bytesw.bytebot.model.Country
;
import
org.springframework.data.jpa.repository.Query
;
import
org.springframework.data.repository.CrudRepository
;
import
java.util.List
;
/**
* @author Sebastián Chicoma Sandmann.
* @version 9-sep-2020
...
...
@@ -15,4 +18,7 @@ import org.springframework.data.repository.CrudRepository;
* licencia de uso que firmó con Byte.
*/
public
interface
CountryRepository
extends
CrudRepository
<
Country
,
Long
>
{
@Query
(
"select c from Country c order by c.name"
)
List
<
Country
>
findAllOrder
();
}
src/main/java/com/bytesw/bytebot/service/AgentService.java
View file @
6e1e5140
...
...
@@ -451,7 +451,7 @@ public class AgentService extends CustomPaginationService<Agent> {
public
List
<
CountryBean
>
getCountries
()
{
List
<
CountryBean
>
countriesBean
=
new
ArrayList
<>();
List
<
Country
>
countries
=
(
List
<
Country
>)
countryRepository
.
findAll
();
List
<
Country
>
countries
=
countryRepository
.
findAllOrder
();
for
(
Country
country
:
countries
)
{
countriesBean
.
add
(
CountryBean
.
clone
(
country
));
...
...
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