Consumo facturacion autorizacion task

parent 4a8f88a8
......@@ -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**/
......
......@@ -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 {
......
......@@ -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 + "}";
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment