Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
ConsumoSriAutorizacion
Overview
Overview
Details
Activity
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
GERMAN PATRICIO ROMERO QUISHPE
ConsumoSriAutorizacion
Commits
ab1d80dc
Commit
ab1d80dc
authored
May 11, 2023
by
GERMAN PATRICIO ROMERO QUISHPE
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Consumo facturacion autorizacion task
parent
4a8f88a8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
9 deletions
+16
-9
src/main/java/ec/edu/epn/consumosriautorizacion/Tasks/Task_autorizacion.java
+4
-2
src/main/java/ec/edu/epn/consumosriautorizacion/Tasks/Task_cargaDocumentacion.java
+9
-2
src/main/java/ec/edu/epn/consumosriautorizacion/service/TaskSchedulingService.java
+3
-5
No files found.
src/main/java/ec/edu/epn/consumosriautorizacion/Tasks/Task_autorizacion.java
View file @
ab1d80dc
...
...
@@ -38,13 +38,15 @@ public class Task_autorizacion implements Tasklet {
private
static
String
ambiente
=
"PRODUCCION"
;
@Autowired
ConsultasFacturacionController
consultas
;
/*
@Autowired
ConsultasFacturacionController consultas;
*/
@Override
public
RepeatStatus
execute
(
StepContribution
contribution
,
ChunkContext
chunkContext
)
throws
Exception
{
ConsultasFacturacionController
consultas
=
new
ConsultasFacturacionController
();
List
<
FacturaDTO
>
listFactContingencia
=
new
ArrayList
<
FacturaDTO
>();
/**OBTENER LA FECHA ACTUAL**/
...
...
src/main/java/ec/edu/epn/consumosriautorizacion/Tasks/Task_cargaDocumentacion.java
View file @
ab1d80dc
...
...
@@ -9,6 +9,7 @@ import ec.edu.epn.consumosriautorizacion.dto.PagosDTO;
import
ec.edu.epn.consumosriautorizacion.dto.UserFactDTO
;
import
ec.edu.epn.consumosriautorizacion.service.EmailService
;
import
ec.edu.epn.consumosriautorizacion.service.FTPService
;
import
ec.edu.epn.consumosriautorizacion.service.FileServiceImp
;
import
org.apache.commons.net.util.Base64
;
import
org.springframework.batch.core.StepContribution
;
import
org.springframework.batch.core.scope.context.ChunkContext
;
...
...
@@ -33,12 +34,12 @@ import static java.nio.charset.StandardCharsets.UTF_8;
@Component
public
class
Task_cargaDocumentacion
implements
Tasklet
{
@Autowired
/*
@Autowired
ConsultasFacturacionController consultas;
@Autowired
FTPService
ftpService
;
FTPService ftpService;
*/
...
...
@@ -53,6 +54,10 @@ public class Task_cargaDocumentacion implements Tasklet {
@Override
public
RepeatStatus
execute
(
StepContribution
contribution
,
ChunkContext
chunkContext
)
throws
Exception
{
ConsultasFacturacionController
consultas
=
new
ConsultasFacturacionController
();
FTPService
ftpService
=
new
FileServiceImp
();
List
<
FacturaDTO
>
listFact
=
new
ArrayList
<
FacturaDTO
>();
/**OBTENER LA FECHA ACTUAL**/
Date
date
=
new
Date
();
...
...
@@ -198,6 +203,8 @@ public class Task_cargaDocumentacion implements Tasklet {
public
UserFactDTO
usuarioFact
(
String
ciRucCli
)
{
ConsultasFacturacionController
consultas
=
new
ConsultasFacturacionController
();
UserFactDTO
usuario
=
new
UserFactDTO
();
usuario
=
consultas
.
consumoUserFact
(
ciRucCli
.
trim
());
try
{
...
...
src/main/java/ec/edu/epn/consumosriautorizacion/service/TaskSchedulingService.java
View file @
ab1d80dc
...
...
@@ -7,10 +7,7 @@ import org.springframework.scheduling.TaskScheduler;
import
org.springframework.scheduling.support.CronTrigger
;
import
org.springframework.stereotype.Service
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.TimeZone
;
import
java.util.UUID
;
import
java.util.*
;
import
java.util.concurrent.ScheduledFuture
;
@Service
...
...
@@ -25,7 +22,8 @@ public class TaskSchedulingService {
UUID
uuid
=
UUID
.
randomUUID
();
String
jobId
=
uuid
.
toString
();
System
.
out
.
println
(
"Cron con job id: "
+
jobId
+
" y cron : "
+
cronExpression
);
ScheduledFuture
<?>
scheduledTask
=
taskScheduler
.
schedule
(
tasklet
,
new
CronTrigger
(
cronExpression
,
TimeZone
.
getTimeZone
(
TimeZone
.
getDefault
().
getID
())));
//ScheduledFuture<?> scheduledTask = taskScheduler.schedule(tasklet, new CronTrigger(cronExpression, TimeZone.getTimeZone(TimeZone.getDefault().getID())));
ScheduledFuture
<?>
scheduledTask
=
taskScheduler
.
schedule
(
tasklet
,
new
CronTrigger
(
"0 0/5 8,9,10,11,12,13,14,15,16,17,18 * * ?"
));
jobsMap
.
put
(
jobId
,
scheduledTask
);
return
"CRON-JOB:{id: "
+
jobId
+
", cron : "
+
cronExpression
+
"}"
;
}
...
...
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