Updated Stampings support
This commit is contained in:
parent
362c542dcb
commit
e91d8a3a77
|
@ -33,4 +33,13 @@ public class EpasRestTemplateConfig {
|
||||||
applicationProperties.getDatasourceEpasRest().getRestPassword2())
|
applicationProperties.getDatasourceEpasRest().getRestPassword2())
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Bean(name = "RestTemplateForThirdUser")
|
||||||
|
public RestTemplate restTemplateThird(RestTemplateBuilder builder) {
|
||||||
|
return builder.defaultHeader("Accept", MediaType.APPLICATION_JSON.toString())
|
||||||
|
.basicAuthentication(applicationProperties.getDatasourceEpasRest().getRestUsername3(),
|
||||||
|
applicationProperties.getDatasourceEpasRest().getRestPassword3())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,6 @@ import org.springframework.data.jdbc.repository.config.EnableJdbcRepositories;
|
||||||
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcOperations;
|
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcOperations;
|
||||||
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
|
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
|
||||||
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
|
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
|
||||||
import org.springframework.jdbc.datasource.DriverManagerDataSource;
|
|
||||||
import org.springframework.transaction.TransactionManager;
|
import org.springframework.transaction.TransactionManager;
|
||||||
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
package it.cnr.isti.epasmed.config;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||||
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
@EnableScheduling
|
||||||
|
public class SyncConfiguration {
|
||||||
|
|
||||||
|
private final Logger logger = LoggerFactory.getLogger(SyncConfiguration.class);
|
||||||
|
|
||||||
|
@Scheduled(cron = "0 0 7 * * ?")
|
||||||
|
public void cronJobSch() {
|
||||||
|
|
||||||
|
LocalDateTime start = LocalDateTime.now();
|
||||||
|
logger.info("Scheduled Sync Start : {}", start);
|
||||||
|
|
||||||
|
LocalDateTime end = LocalDateTime.now();
|
||||||
|
logger.info("Scheduled Sync End : {}", end);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -30,13 +30,13 @@ public class TabsSI implements Serializable {
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Column(unique = true, nullable = false)
|
@Column(unique = true, nullable = false)
|
||||||
public String nome;
|
private String nome;
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
public String operazioni;
|
private String operazioni;
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
public Long idFlusso;
|
private Long idFlusso;
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Column(columnDefinition = "TIMESTAMP" )
|
@Column(columnDefinition = "TIMESTAMP" )
|
||||||
|
|
|
@ -28,13 +28,13 @@ public class TimeCardsReporting implements Serializable {
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Column(nullable = false)
|
@Column(nullable = false)
|
||||||
public Integer year;
|
private Integer year;
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
public Integer month;
|
private Integer month;
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
public Long idFlusso;
|
private Long idFlusso;
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Column(columnDefinition = "TIMESTAMP")
|
@Column(columnDefinition = "TIMESTAMP")
|
||||||
|
|
|
@ -0,0 +1,44 @@
|
||||||
|
package it.cnr.isti.epasmed.epas.client;
|
||||||
|
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.web.client.RestTemplate;
|
||||||
|
|
||||||
|
import it.cnr.isti.epasmed.config.ApplicationProperties;
|
||||||
|
import it.cnr.isti.epasmed.epas.dto.EPASStampingsDTO;
|
||||||
|
import it.cnr.isti.epasmed.epas.model.EPASStampings;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
public class EPASStampingsClient {
|
||||||
|
|
||||||
|
private static final Logger logger = LoggerFactory.getLogger(EPASStampingsClient.class);
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
@Qualifier("RestTemplateForThirdUser")
|
||||||
|
RestTemplate rt;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
ApplicationProperties appProps;
|
||||||
|
|
||||||
|
public EPASStampings getById(String id) {
|
||||||
|
EPASStampings epasPersons = rt.getForObject(
|
||||||
|
appProps.getDatasourceEpasRest().getRestUrl() + "/v3/stampings/show/{id}", EPASStampings.class, id);
|
||||||
|
logger.info("Retrieved EPASStamping: {}", epasPersons);
|
||||||
|
return epasPersons;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EPASStampings create(EPASStampingsDTO epasStampingsDTO) {
|
||||||
|
ResponseEntity<EPASStampings> response = rt.postForEntity(
|
||||||
|
appProps.getDatasourceEpasRest().getRestUrl() + "/v3/stampings/create", epasStampingsDTO, EPASStampings.class);
|
||||||
|
EPASStampings createdEPASPersons = response.getBody();
|
||||||
|
|
||||||
|
logger.info("Created EPASStamping: {}", createdEPASPersons);
|
||||||
|
return createdEPASPersons;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,24 @@
|
||||||
|
package it.cnr.isti.epasmed.epas.dto;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class EPASStampingsDTO implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
private String wayType;
|
||||||
|
private String reasonType;
|
||||||
|
private String dateTime;
|
||||||
|
private String badgeNumber;
|
||||||
|
private String zone;
|
||||||
|
private String note;
|
||||||
|
private String place;
|
||||||
|
private String reason;
|
||||||
|
}
|
|
@ -0,0 +1,24 @@
|
||||||
|
package it.cnr.isti.epasmed.epas.service;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import it.cnr.isti.epasmed.epas.client.EPASStampingsClient;
|
||||||
|
import it.cnr.isti.epasmed.epas.dto.EPASStampingsDTO;
|
||||||
|
import it.cnr.isti.epasmed.epas.model.EPASStampings;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class EPASStampingsService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
EPASStampingsClient epasStampingsClient;
|
||||||
|
|
||||||
|
public EPASStampings getById(String id) {
|
||||||
|
return epasStampingsClient.getById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
public EPASStampings create(EPASStampingsDTO epasStampingsDTO) {
|
||||||
|
return epasStampingsClient.create(epasStampingsDTO);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,28 @@
|
||||||
|
package it.cnr.isti.epasmed.sistemainformativo.model;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.sql.Timestamp;
|
||||||
|
import java.sql.Date;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class SICartellini implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
private Long id;
|
||||||
|
private Integer idpersona;
|
||||||
|
private String cf;
|
||||||
|
private Date data;
|
||||||
|
private String motivo;
|
||||||
|
private Integer ore_lavorate;
|
||||||
|
private Integer differenza;
|
||||||
|
private Timestamp data_mod;
|
||||||
|
private String flag_del;
|
||||||
|
private Long id_flusso;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,23 @@
|
||||||
|
package it.cnr.isti.epasmed.sistemainformativo.model;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.sql.Timestamp;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class SICartelliniRendicontazioni implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
private Long id;
|
||||||
|
private Integer anno;
|
||||||
|
private Integer mese;
|
||||||
|
private Timestamp data_mod;
|
||||||
|
private String flag_del;
|
||||||
|
private Long id_flusso;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,23 @@
|
||||||
|
package it.cnr.isti.epasmed.sistemainformativo.model;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.sql.Timestamp;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class SIOrario implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
private Long id;
|
||||||
|
private String descrizione;
|
||||||
|
private String flag;
|
||||||
|
private Timestamp data_mod;
|
||||||
|
private String flag_del;
|
||||||
|
private Long id_flusso;
|
||||||
|
|
||||||
|
}
|
|
@ -18,7 +18,7 @@ import it.cnr.isti.epasmed.sistemainformativo.model.SIAnagrafico;
|
||||||
@Repository
|
@Repository
|
||||||
public class SIAnagraficoRepository {
|
public class SIAnagraficoRepository {
|
||||||
|
|
||||||
private final Logger logger = LoggerFactory.getLogger(SIAnagraficoRepository.class);
|
private static final Logger logger = LoggerFactory.getLogger(SIAnagraficoRepository.class);
|
||||||
|
|
||||||
private JdbcTemplate jdbcTemplate;
|
private JdbcTemplate jdbcTemplate;
|
||||||
|
|
||||||
|
@ -29,7 +29,6 @@ public class SIAnagraficoRepository {
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<SIAnagrafico> readNewFlux(Long flusso) {
|
public List<SIAnagrafico> readNewFlux(Long flusso) {
|
||||||
logger.info("Read Flux > {}",flusso);
|
|
||||||
String query="select codicefiscale, cognome, nome, datanascita,"
|
String query="select codicefiscale, cognome, nome, datanascita,"
|
||||||
+ " numbadge, data_mod, flag_del, id_flusso, id "
|
+ " numbadge, data_mod, flag_del, id_flusso, id "
|
||||||
+ " from anagrafico "
|
+ " from anagrafico "
|
||||||
|
@ -62,6 +61,7 @@ public class SIAnagraficoRepository {
|
||||||
a.setId(rs.getInt(9));
|
a.setId(rs.getInt(9));
|
||||||
return a;
|
return a;
|
||||||
}});
|
}});
|
||||||
|
logger.debug("Anagrafica: {}", anagrafica);
|
||||||
return anagrafica;
|
return anagrafica;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,37 @@
|
||||||
|
package it.cnr.isti.epasmed.sistemainformativo.repository;
|
||||||
|
|
||||||
|
import javax.sql.DataSource;
|
||||||
|
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
|
import org.springframework.jdbc.core.JdbcTemplate;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import it.cnr.isti.epasmed.sistemainformativo.model.SICartelliniRendicontazioni;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public class SICartelliniRendicontazioniRepository {
|
||||||
|
|
||||||
|
private static final Logger logger = LoggerFactory.getLogger(SICartelliniRendicontazioniRepository.class);
|
||||||
|
|
||||||
|
private JdbcTemplate jdbcTemplate;
|
||||||
|
|
||||||
|
//
|
||||||
|
public SICartelliniRendicontazioniRepository(
|
||||||
|
final @Qualifier("sistemaInformativoDataSource") DataSource dataSource) {
|
||||||
|
super();
|
||||||
|
this.jdbcTemplate = new JdbcTemplate(dataSource);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void writeNewFlux(Long fluxId, SICartelliniRendicontazioni siCartelliniRendicontazioni) {
|
||||||
|
jdbcTemplate.update(
|
||||||
|
"INSERT INTO epas_cartellini_rendicontazioni (id,anno,mese,data_mod,flag_del,id_flusso) "
|
||||||
|
+ "VALUES (?,?,?,?,?,?)",
|
||||||
|
siCartelliniRendicontazioni.getId(), siCartelliniRendicontazioni.getAnno(),
|
||||||
|
siCartelliniRendicontazioni.getMese(), siCartelliniRendicontazioni.getData_mod(),
|
||||||
|
siCartelliniRendicontazioni.getFlag_del(), fluxId);
|
||||||
|
logger.debug("Writed SICartellinoRendicontazioni: {}", siCartelliniRendicontazioni);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,38 @@
|
||||||
|
package it.cnr.isti.epasmed.sistemainformativo.repository;
|
||||||
|
|
||||||
|
import javax.sql.DataSource;
|
||||||
|
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
|
import org.springframework.jdbc.core.JdbcTemplate;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import it.cnr.isti.epasmed.sistemainformativo.model.SICartellini;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public class SICartelliniRepository {
|
||||||
|
|
||||||
|
private static final Logger logger = LoggerFactory.getLogger(SICartelliniRepository.class);
|
||||||
|
|
||||||
|
private JdbcTemplate jdbcTemplate;
|
||||||
|
|
||||||
|
//
|
||||||
|
public SICartelliniRepository(final @Qualifier("sistemaInformativoDataSource") DataSource dataSource) {
|
||||||
|
super();
|
||||||
|
this.jdbcTemplate = new JdbcTemplate(dataSource);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void writeNewFlux(Long fluxId, SICartellini siCartellini) {
|
||||||
|
jdbcTemplate.update("INSERT INTO epas_cartellini (id,idpersona,cf,data,"
|
||||||
|
+ " motivo,ore_lavorate,differenza,data_mod,flag_del,id_flusso) "
|
||||||
|
+ "VALUES (?,?,?,?,?,?,?,?,?,?)",
|
||||||
|
siCartellini.getId(),siCartellini.getIdpersona(),siCartellini.getCf(),siCartellini.getData(),
|
||||||
|
siCartellini.getMotivo(),siCartellini.getOre_lavorate(),siCartellini.getDifferenza(),
|
||||||
|
siCartellini.getData_mod(),siCartellini.getFlag_del(),fluxId);
|
||||||
|
logger.debug("Writed SICartellino: {}",siCartellini);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -18,7 +18,7 @@ import it.cnr.isti.epasmed.sistemainformativo.model.SIEmail;
|
||||||
@Repository
|
@Repository
|
||||||
public class SIEmailRepository {
|
public class SIEmailRepository {
|
||||||
|
|
||||||
private final Logger logger = LoggerFactory.getLogger(SIEmailRepository.class);
|
private static final Logger logger = LoggerFactory.getLogger(SIEmailRepository.class);
|
||||||
|
|
||||||
private JdbcTemplate jdbcTemplate;
|
private JdbcTemplate jdbcTemplate;
|
||||||
|
|
||||||
|
@ -29,7 +29,6 @@ public class SIEmailRepository {
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<SIEmail> readNewFlux(Long flusso) {
|
public List<SIEmail> readNewFlux(Long flusso) {
|
||||||
logger.info("Read Flux > {}",flusso);
|
|
||||||
String query="select cf, email, tipoemail, data_mod, flag_del, id_flusso, id, idpersona "
|
String query="select cf, email, tipoemail, data_mod, flag_del, id_flusso, id, idpersona "
|
||||||
+ " from mail "
|
+ " from mail "
|
||||||
+ " WHERE id_flusso > "
|
+ " WHERE id_flusso > "
|
||||||
|
@ -50,6 +49,7 @@ public class SIEmailRepository {
|
||||||
|
|
||||||
return m;
|
return m;
|
||||||
}});
|
}});
|
||||||
|
logger.debug("Emaills: {}",emails);
|
||||||
return emails;
|
return emails;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,7 @@ import it.cnr.isti.epasmed.sistemainformativo.model.SIGruppiPers;
|
||||||
@Repository
|
@Repository
|
||||||
public class SIGruppiPersRepository {
|
public class SIGruppiPersRepository {
|
||||||
|
|
||||||
private final Logger logger = LoggerFactory.getLogger(SIGruppiPersRepository.class);
|
private static final Logger logger = LoggerFactory.getLogger(SIGruppiPersRepository.class);
|
||||||
|
|
||||||
private JdbcTemplate jdbcTemplate;
|
private JdbcTemplate jdbcTemplate;
|
||||||
|
|
||||||
|
@ -29,7 +29,6 @@ public class SIGruppiPersRepository {
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<SIGruppiPers> readNewFlux(Long flusso) {
|
public List<SIGruppiPers> readNewFlux(Long flusso) {
|
||||||
logger.info("Read Flux > {}",flusso);
|
|
||||||
String query="select cf, gruppo, dal, al, percentuale, data_mod, flag_del, id_flusso, id, idpersona, idgruppo "
|
String query="select cf, gruppo, dal, al, percentuale, data_mod, flag_del, id_flusso, id, idpersona, idgruppo "
|
||||||
+ " from gruppo_pers "
|
+ " from gruppo_pers "
|
||||||
+ " WHERE id_flusso > "
|
+ " WHERE id_flusso > "
|
||||||
|
@ -54,6 +53,7 @@ public class SIGruppiPersRepository {
|
||||||
|
|
||||||
return gp;
|
return gp;
|
||||||
}});
|
}});
|
||||||
|
logger.debug("Gruppi: {}",gruppi);
|
||||||
return gruppi;
|
return gruppi;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,7 @@ import it.cnr.isti.epasmed.sistemainformativo.model.SIGruppi;
|
||||||
@Repository
|
@Repository
|
||||||
public class SIGruppiRepository {
|
public class SIGruppiRepository {
|
||||||
|
|
||||||
private final Logger logger = LoggerFactory.getLogger(SIGruppiRepository.class);
|
private static final Logger logger = LoggerFactory.getLogger(SIGruppiPersRepository.class);
|
||||||
|
|
||||||
private JdbcTemplate jdbcTemplate;
|
private JdbcTemplate jdbcTemplate;
|
||||||
|
|
||||||
|
@ -29,7 +29,6 @@ public class SIGruppiRepository {
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<SIGruppi> readNewFlux(Long flusso) {
|
public List<SIGruppi> readNewFlux(Long flusso) {
|
||||||
logger.info("Read Flux > {}",flusso);
|
|
||||||
String query="select sigla, descrizione, data_mod, flag_del, id_flusso, id "
|
String query="select sigla, descrizione, data_mod, flag_del, id_flusso, id "
|
||||||
+ " from gruppi "
|
+ " from gruppi "
|
||||||
+ " WHERE id_flusso > "
|
+ " WHERE id_flusso > "
|
||||||
|
@ -48,6 +47,7 @@ public class SIGruppiRepository {
|
||||||
g.setId(rs.getInt(6));
|
g.setId(rs.getInt(6));
|
||||||
return g;
|
return g;
|
||||||
}});
|
}});
|
||||||
|
logger.debug("Gruppi: {}",gruppi);
|
||||||
return gruppi;
|
return gruppi;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,7 @@ import org.springframework.stereotype.Repository;
|
||||||
@Repository
|
@Repository
|
||||||
public class SIMasterLogRepository {
|
public class SIMasterLogRepository {
|
||||||
|
|
||||||
private final Logger log = LoggerFactory.getLogger(SIMasterLogRepository.class);
|
private static final Logger logger = LoggerFactory.getLogger(SIMasterLogRepository.class);
|
||||||
|
|
||||||
private JdbcTemplate jdbcTemplate;
|
private JdbcTemplate jdbcTemplate;
|
||||||
|
|
||||||
|
@ -27,21 +27,21 @@ public class SIMasterLogRepository {
|
||||||
}
|
}
|
||||||
|
|
||||||
public Long count() {
|
public Long count() {
|
||||||
log.debug("Call MasterLogRepository Count()");
|
logger.debug("Call MasterLogRepository Count()");
|
||||||
return jdbcTemplate.queryForObject("select count(*) from master_log", Long.class);
|
return jdbcTemplate.queryForObject("select count(*) from master_log", Long.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void startFluxReads() {
|
public void startFluxReads() {
|
||||||
log.info("Iniziato Flusso in lettura");
|
logger.info("Iniziato Flusso in lettura");
|
||||||
jdbcTemplate.update("INSERT INTO master_log (codice_flusso, tabelle, operazione, data_inizio_oper) "
|
jdbcTemplate.update("INSERT INTO master_log (codice_flusso, tabelle, operazione, data_inizio_oper) "
|
||||||
+ "VALUES ('epas','anagrafico,mail,telefoni,gruppi','L',current_timestamp)");
|
+ "VALUES ('epas','anagrafico,mail,telefoni,gruppi','L',current_timestamp)");
|
||||||
log.info("Flusso in lettura aperto");
|
logger.info("Flusso in lettura aperto");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void closeFluxReads(String tabelleLette) throws Exception {
|
public void closeFluxReads(String tabelleLette) throws Exception {
|
||||||
log.info("Chiusura Flusso in lettura");
|
logger.info("Chiusura Flusso in lettura");
|
||||||
log.info("Tabelle Lette: {}", tabelleLette);
|
logger.info("Tabelle Lette: {}", tabelleLette);
|
||||||
if (tabelleLette.isEmpty()) {
|
if (tabelleLette.isEmpty()) {
|
||||||
tabelleLette = " ";
|
tabelleLette = " ";
|
||||||
}
|
}
|
||||||
|
@ -57,64 +57,64 @@ public class SIMasterLogRepository {
|
||||||
return idFlusso;
|
return idFlusso;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
log.info("Flusso da chiudere: {}", idsFlux);
|
logger.info("Flusso da chiudere: {}", idsFlux);
|
||||||
|
|
||||||
if (idsFlux != null && !idsFlux.isEmpty()) {
|
if (idsFlux != null && !idsFlux.isEmpty()) {
|
||||||
|
|
||||||
jdbcTemplate.update("UPDATE master_log SET data_fine_oper=current_timestamp, tabelle='" + tabelleLette
|
jdbcTemplate.update("UPDATE master_log SET data_fine_oper=current_timestamp, tabelle='" + tabelleLette
|
||||||
+ "', esito_oper='OK' WHERE codice_flusso='epas' AND id_flusso=" + idsFlux.get(0) + " ");
|
+ "', esito_oper='OK' WHERE codice_flusso='epas' AND id_flusso=" + idsFlux.get(0) + " ");
|
||||||
|
|
||||||
log.info("Flusso in lettura chiuso");
|
logger.info("Flusso in lettura chiuso");
|
||||||
} else {
|
} else {
|
||||||
log.error("Flusso da chiudere non trovato: {}", idsFlux);
|
logger.error("Flusso da chiudere non trovato: {}", idsFlux);
|
||||||
throw new Exception("Errore chiudendo il flusso di lettura, id: "+idsFlux);
|
throw new Exception("Errore chiudendo il flusso di lettura, id: "+idsFlux);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Long startFluxWrites() throws Exception {
|
public Long startFluxWrites() throws Exception {
|
||||||
log.info("Iniziato Flusso in scrittura");
|
logger.info("Iniziato Flusso in scrittura");
|
||||||
jdbcTemplate.update("INSERT INTO master_log (codice_flusso, tabelle, operazione, data_inizio_oper) \"\n"
|
jdbcTemplate.update("INSERT INTO master_log (codice_flusso, tabelle, operazione, data_inizio_oper) \"\n"
|
||||||
+ " + \"VALUES ('epas','cartellini, cartellini_rendicontazioni, festivita, pers_orario, lavoro_fuori_sede','S',current_timestamp)");
|
+ " + \"VALUES ('epas','cartellini, cartellini_rendicontazioni, festivita, pers_orario, lavoro_fuori_sede','S',current_timestamp)");
|
||||||
log.info("Flusso in scrittura aperto");
|
logger.info("Flusso in scrittura aperto");
|
||||||
|
|
||||||
String query = "SELECT id_flusso FROM master_log" + " WHERE codice_flusso='epas' AND operazione='S'"
|
String query = "SELECT id_flusso FROM master_log" + " WHERE codice_flusso='epas' AND operazione='S'"
|
||||||
+ " AND data_fine_oper IS NULL" + " ORDER BY id_flusso DESC";
|
+ " AND data_fine_oper IS NULL" + " ORDER BY id_flusso DESC";
|
||||||
|
|
||||||
List<Long> idsFlux = jdbcTemplate.query(query, new RowMapper<Long>() {
|
List<Long> fluxIds = jdbcTemplate.query(query, new RowMapper<Long>() {
|
||||||
@Override
|
@Override
|
||||||
public Long mapRow(ResultSet rs, int rowNum) throws SQLException {
|
public Long mapRow(ResultSet rs, int rowNum) throws SQLException {
|
||||||
Long idFlusso = rs.getLong("id_flusso");
|
Long idFlusso = rs.getLong("id_flusso");
|
||||||
return idFlusso;
|
return idFlusso;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
Long idFlux = 0l;
|
Long fluxId = 0l;
|
||||||
if (idsFlux != null && !idsFlux.isEmpty()) {
|
if (fluxIds != null && !fluxIds.isEmpty()) {
|
||||||
idFlux = idsFlux.get(0);
|
fluxId = fluxIds.get(0);
|
||||||
log.info("Flusso in scrittura id: {}", idFlux);
|
logger.info("Flusso in scrittura id: {}", fluxId);
|
||||||
} else {
|
} else {
|
||||||
log.error("Errore inizializando il flusso di scrittura, id: {}",idsFlux);
|
logger.error("Errore inizializando il flusso di scrittura, id: {}",fluxIds);
|
||||||
throw new Exception("Errore inizializando il flusso di scrittura, id: "+idsFlux);
|
throw new Exception("Errore inizializando il flusso di scrittura, id: "+fluxIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
return idFlux;
|
return fluxId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void closeFluxWrites(Long idFlux, String tabelleScritte) {
|
public void closeFluxWrites(Long fluxId, String tabelleScritte) {
|
||||||
log.info("Chiusura Flusso in scrittura");
|
logger.info("Chiusura Flusso in scrittura");
|
||||||
log.info("Tabelle Scritte: {}", tabelleScritte);
|
logger.info("Tabelle Scritte: {}", tabelleScritte);
|
||||||
if (tabelleScritte.isEmpty()) {
|
if (tabelleScritte.isEmpty()) {
|
||||||
tabelleScritte = " ";
|
tabelleScritte = " ";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (idFlux != null && idFlux.longValue() != 0) {
|
if (fluxId != null && fluxId.longValue() != 0) {
|
||||||
|
|
||||||
jdbcTemplate.update("UPDATE master_log SET data_fine_oper=current_timestamp, tabelle='" + tabelleScritte
|
jdbcTemplate.update("UPDATE master_log SET data_fine_oper=current_timestamp, tabelle='" + tabelleScritte
|
||||||
+ "', esito_oper='OK' WHERE codice_flusso='epas' AND id_flusso=" + idFlux + " ");
|
+ "', esito_oper='OK' WHERE codice_flusso='epas' AND id_flusso=" + fluxId + " ");
|
||||||
|
|
||||||
log.info("Flusso in scrittura chiuso");
|
logger.info("Flusso in scrittura chiuso");
|
||||||
} else {
|
} else {
|
||||||
log.info("Flusso in scrittura da chiudere non trovato: {}", idFlux);
|
logger.info("Flusso in scrittura da chiudere non trovato: {}", fluxId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,37 @@
|
||||||
|
package it.cnr.isti.epasmed.sistemainformativo.repository;
|
||||||
|
|
||||||
|
import javax.sql.DataSource;
|
||||||
|
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
|
import org.springframework.jdbc.core.JdbcTemplate;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import it.cnr.isti.epasmed.sistemainformativo.model.SIOrario;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public class SIOrarioRepository {
|
||||||
|
|
||||||
|
private static final Logger logger = LoggerFactory.getLogger(SIOrarioRepository.class);
|
||||||
|
|
||||||
|
private JdbcTemplate jdbcTemplate;
|
||||||
|
|
||||||
|
//
|
||||||
|
public SIOrarioRepository(
|
||||||
|
final @Qualifier("sistemaInformativoDataSource") DataSource dataSource) {
|
||||||
|
super();
|
||||||
|
this.jdbcTemplate = new JdbcTemplate(dataSource);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void writeNewFlux(Long fluxId, SIOrario siOrario) {
|
||||||
|
jdbcTemplate.update(
|
||||||
|
"INSERT INTO epas_orario (id,descrizione,flag,data_mod,flag_del,id_flusso)"
|
||||||
|
+ " VALUES (?,?,?,?,?,?)",
|
||||||
|
siOrario.getId(), siOrario.getDescrizione(),
|
||||||
|
siOrario.getFlag(), siOrario.getData_mod(),
|
||||||
|
siOrario.getFlag_del(), fluxId);
|
||||||
|
logger.debug("Writed SIOrario: {}", siOrario);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -18,7 +18,7 @@ import it.cnr.isti.epasmed.sistemainformativo.model.SIPosizioni;
|
||||||
@Repository
|
@Repository
|
||||||
public class SIPosizioniRepository {
|
public class SIPosizioniRepository {
|
||||||
|
|
||||||
private final Logger logger = LoggerFactory.getLogger(SIPosizioniRepository.class);
|
private static final Logger logger = LoggerFactory.getLogger(SIPosizioniRepository.class);
|
||||||
|
|
||||||
private JdbcTemplate jdbcTemplate;
|
private JdbcTemplate jdbcTemplate;
|
||||||
|
|
||||||
|
@ -29,7 +29,6 @@ public class SIPosizioniRepository {
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<SIPosizioni> readNewFlux(Long flusso) {
|
public List<SIPosizioni> readNewFlux(Long flusso) {
|
||||||
logger.info("Read Flux > {}",flusso);
|
|
||||||
String query="select cf, dal, al, matricola, profilo, subprofilo, livello, tipocontratto, "
|
String query="select cf, dal, al, matricola, profilo, subprofilo, livello, tipocontratto, "
|
||||||
+ " motivofinerapportoti, fasciaimportoassegno, data_mod, flag_del,id_flusso, finerapportoti, idpersona, id "
|
+ " motivofinerapportoti, fasciaimportoassegno, data_mod, flag_del,id_flusso, finerapportoti, idpersona, id "
|
||||||
+ " from posizioni "
|
+ " from posizioni "
|
||||||
|
@ -60,6 +59,7 @@ public class SIPosizioniRepository {
|
||||||
|
|
||||||
return pos;
|
return pos;
|
||||||
}});
|
}});
|
||||||
|
logger.debug("Posizioni: {}",posizioni);
|
||||||
return posizioni;
|
return posizioni;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,7 @@ import it.cnr.isti.epasmed.sistemainformativo.model.SIProroghe;
|
||||||
@Repository
|
@Repository
|
||||||
public class SIProrogheRepository {
|
public class SIProrogheRepository {
|
||||||
|
|
||||||
private final Logger logger = LoggerFactory.getLogger(SIProrogheRepository.class);
|
private static final Logger logger = LoggerFactory.getLogger(SIProrogheRepository.class);
|
||||||
|
|
||||||
private JdbcTemplate jdbcTemplate;
|
private JdbcTemplate jdbcTemplate;
|
||||||
|
|
||||||
|
@ -29,7 +29,6 @@ public class SIProrogheRepository {
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<SIProroghe> readNewFlux(Long flusso) {
|
public List<SIProroghe> readNewFlux(Long flusso) {
|
||||||
logger.info("Read Flux > {}",flusso);
|
|
||||||
String query="select cf,posizione_dal, proroga_al, data_mod,flag_del,id_flusso, "
|
String query="select cf,posizione_dal, proroga_al, data_mod,flag_del,id_flusso, "
|
||||||
+ " posizione_al, proroga_dal, id, idposizione"
|
+ " posizione_al, proroga_dal, id, idposizione"
|
||||||
+ " from proroghe "
|
+ " from proroghe "
|
||||||
|
@ -54,6 +53,7 @@ public class SIProrogheRepository {
|
||||||
|
|
||||||
return pro;
|
return pro;
|
||||||
}});
|
}});
|
||||||
|
logger.debug("Proroghe: {}",proroghe);
|
||||||
return proroghe;
|
return proroghe;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,7 @@ import it.cnr.isti.epasmed.sistemainformativo.model.SITelefoni;
|
||||||
@Repository
|
@Repository
|
||||||
public class SITelefoniRepository {
|
public class SITelefoniRepository {
|
||||||
|
|
||||||
private final Logger logger = LoggerFactory.getLogger(SITelefoniRepository.class);
|
private static final Logger logger = LoggerFactory.getLogger(SITelefoniRepository.class);
|
||||||
|
|
||||||
private JdbcTemplate jdbcTemplate;
|
private JdbcTemplate jdbcTemplate;
|
||||||
|
|
||||||
|
@ -29,7 +29,6 @@ public class SITelefoniRepository {
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<SITelefoni> readNewFlux(Long flusso) {
|
public List<SITelefoni> readNewFlux(Long flusso) {
|
||||||
logger.info("Read Flux > {}",flusso);
|
|
||||||
String query="select cf, tiporecapitotelefonico, recapitotelefonico, data_mod, flag_del, id_flusso, id, idpersona "
|
String query="select cf, tiporecapitotelefonico, recapitotelefonico, data_mod, flag_del, id_flusso, id, idpersona "
|
||||||
+ " from telefoni "
|
+ " from telefoni "
|
||||||
+ " WHERE id_flusso > "
|
+ " WHERE id_flusso > "
|
||||||
|
@ -50,6 +49,7 @@ public class SITelefoniRepository {
|
||||||
|
|
||||||
return t;
|
return t;
|
||||||
}});
|
}});
|
||||||
|
logger.debug("Telefoni: {}",telefoni);
|
||||||
return telefoni;
|
return telefoni;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@ import it.cnr.isti.epasmed.sistemainformativo.repository.SIAnagraficoRepository;
|
||||||
@Transactional("sistemaInformativoTransactionManager")
|
@Transactional("sistemaInformativoTransactionManager")
|
||||||
public class SIAnagraficoService {
|
public class SIAnagraficoService {
|
||||||
|
|
||||||
private final Logger log = LoggerFactory.getLogger(SIAnagraficoService.class);
|
private static final Logger logger = LoggerFactory.getLogger(SIAnagraficoService.class);
|
||||||
|
|
||||||
private final SIAnagraficoRepository anagraficoRepository;
|
private final SIAnagraficoRepository anagraficoRepository;
|
||||||
|
|
||||||
|
@ -28,9 +28,9 @@ public class SIAnagraficoService {
|
||||||
this.anagraficoRepository = anagraficoRepository;
|
this.anagraficoRepository = anagraficoRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<SIAnagrafico> readNewFlux(Long flusso) {
|
public List<SIAnagrafico> readNewFlux(Long fluxId) {
|
||||||
log.debug("Request Anagrafico Flux > {}",flusso);
|
logger.debug("Request SIAnagrafico Flux > {}",fluxId);
|
||||||
return anagraficoRepository.readNewFlux(flusso);
|
return anagraficoRepository.readNewFlux(fluxId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,33 @@
|
||||||
|
package it.cnr.isti.epasmed.sistemainformativo.service;
|
||||||
|
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import it.cnr.isti.epasmed.sistemainformativo.model.SICartelliniRendicontazioni;
|
||||||
|
import it.cnr.isti.epasmed.sistemainformativo.repository.SICartelliniRendicontazioniRepository;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Service class for managing CartelliniRendicontazioni.
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Transactional("sistemaInformativoTransactionManager")
|
||||||
|
public class SICartelliniRendicontazioniService {
|
||||||
|
|
||||||
|
private static final Logger logger = LoggerFactory.getLogger(SICartelliniRendicontazioniService.class);
|
||||||
|
|
||||||
|
private final SICartelliniRendicontazioniRepository siCartelliniRendicontazioniRepository;
|
||||||
|
|
||||||
|
public SICartelliniRendicontazioniService(
|
||||||
|
SICartelliniRendicontazioniRepository siCartelliniRendicontazioniRepository) {
|
||||||
|
super();
|
||||||
|
this.siCartelliniRendicontazioniRepository = siCartelliniRendicontazioniRepository;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void writeNewFlux(Long fluxId, SICartelliniRendicontazioni siCartelliniRendicontazioni) {
|
||||||
|
logger.debug("Write SICartelliniRendicontazioni Flux = {}", fluxId);
|
||||||
|
siCartelliniRendicontazioniRepository.writeNewFlux(fluxId, siCartelliniRendicontazioni);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,35 @@
|
||||||
|
package it.cnr.isti.epasmed.sistemainformativo.service;
|
||||||
|
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import it.cnr.isti.epasmed.sistemainformativo.model.SICartellini;
|
||||||
|
import it.cnr.isti.epasmed.sistemainformativo.repository.SICartelliniRepository;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Service class for managing Cartellini.
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Transactional("sistemaInformativoTransactionManager")
|
||||||
|
public class SICartelliniService {
|
||||||
|
|
||||||
|
private final Logger log = LoggerFactory.getLogger(getClass());
|
||||||
|
|
||||||
|
private final SICartelliniRepository siCartelliniRepository;
|
||||||
|
|
||||||
|
public SICartelliniService(SICartelliniRepository siCartelliniRepository) {
|
||||||
|
super();
|
||||||
|
this.siCartelliniRepository = siCartelliniRepository;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void writeNewFlux(Long fluxId, SICartellini siCartellini) {
|
||||||
|
log.debug("Write SICartellini Flux = {}",fluxId);
|
||||||
|
siCartelliniRepository.writeNewFlux(fluxId,siCartellini);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -19,7 +19,7 @@ import it.cnr.isti.epasmed.sistemainformativo.repository.SIEmailRepository;
|
||||||
@Transactional("sistemaInformativoTransactionManager")
|
@Transactional("sistemaInformativoTransactionManager")
|
||||||
public class SIEmailService {
|
public class SIEmailService {
|
||||||
|
|
||||||
private final Logger log = LoggerFactory.getLogger(SIEmailService.class);
|
private final Logger log = LoggerFactory.getLogger(getClass());
|
||||||
|
|
||||||
private final SIEmailRepository emailRepository;
|
private final SIEmailRepository emailRepository;
|
||||||
|
|
||||||
|
@ -28,9 +28,9 @@ public class SIEmailService {
|
||||||
this.emailRepository = emailRepository;
|
this.emailRepository = emailRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<SIEmail> readNewFlux(Long flusso) {
|
public List<SIEmail> readNewFlux(Long fluxId) {
|
||||||
log.debug("Request SIEmail Flux > {}",flusso);
|
log.debug("Request SIEmail Flux > {}",fluxId);
|
||||||
return emailRepository.readNewFlux(flusso);
|
return emailRepository.readNewFlux(fluxId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ import it.cnr.isti.epasmed.sistemainformativo.repository.SIGruppiPersRepository;
|
||||||
@Transactional("sistemaInformativoTransactionManager")
|
@Transactional("sistemaInformativoTransactionManager")
|
||||||
public class SIGruppiPersService {
|
public class SIGruppiPersService {
|
||||||
|
|
||||||
private final Logger log = LoggerFactory.getLogger(SIGruppiPersService.class);
|
private final Logger log = LoggerFactory.getLogger(getClass());
|
||||||
|
|
||||||
private final SIGruppiPersRepository gruppiPersRepository;
|
private final SIGruppiPersRepository gruppiPersRepository;
|
||||||
|
|
||||||
|
@ -28,9 +28,9 @@ public class SIGruppiPersService {
|
||||||
this.gruppiPersRepository = gruppiPersRepository;
|
this.gruppiPersRepository = gruppiPersRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<SIGruppiPers> readNewFlux(Long flusso) {
|
public List<SIGruppiPers> readNewFlux(Long fluxId) {
|
||||||
log.debug("Request GruppiPers Flux > {}",flusso);
|
log.debug("Request SIGruppiPers Flux > {}",fluxId);
|
||||||
return gruppiPersRepository.readNewFlux(flusso);
|
return gruppiPersRepository.readNewFlux(fluxId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ import it.cnr.isti.epasmed.sistemainformativo.repository.SIGruppiRepository;
|
||||||
@Transactional("sistemaInformativoTransactionManager")
|
@Transactional("sistemaInformativoTransactionManager")
|
||||||
public class SIGruppiService {
|
public class SIGruppiService {
|
||||||
|
|
||||||
private final Logger log = LoggerFactory.getLogger(SIGruppiService.class);
|
private final Logger log = LoggerFactory.getLogger(getClass());
|
||||||
|
|
||||||
private final SIGruppiRepository gruppiRepository;
|
private final SIGruppiRepository gruppiRepository;
|
||||||
|
|
||||||
|
@ -28,9 +28,9 @@ public class SIGruppiService {
|
||||||
this.gruppiRepository = gruppiRepository;
|
this.gruppiRepository = gruppiRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<SIGruppi> readNewFlux(Long flusso) {
|
public List<SIGruppi> readNewFlux(Long fluxId) {
|
||||||
log.debug("Request Gruppi Flux > {}",flusso);
|
log.debug("Request SIGruppi Flux > {}",fluxId);
|
||||||
return gruppiRepository.readNewFlux(flusso);
|
return gruppiRepository.readNewFlux(fluxId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -45,8 +45,8 @@ public class SIMasterLogService {
|
||||||
return masterLogRepository.startFluxWrites();
|
return masterLogRepository.startFluxWrites();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void closeFluxWrites(Long idFlusso,String tabelleScritte) {
|
public void closeFluxWrites(Long fluxId,String tabelleScritte) {
|
||||||
log.debug("Request Close Flux Writes");
|
log.debug("Request Close Flux Writes");
|
||||||
masterLogRepository.closeFluxWrites(idFlusso,tabelleScritte);
|
masterLogRepository.closeFluxWrites(fluxId,tabelleScritte);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -0,0 +1,35 @@
|
||||||
|
package it.cnr.isti.epasmed.sistemainformativo.service;
|
||||||
|
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import it.cnr.isti.epasmed.sistemainformativo.model.SIOrario;
|
||||||
|
import it.cnr.isti.epasmed.sistemainformativo.repository.SIOrarioRepository;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Service class for managing Orario.
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Transactional("sistemaInformativoTransactionManager")
|
||||||
|
public class SIOrarioService {
|
||||||
|
|
||||||
|
private static final Logger log = LoggerFactory.getLogger(SIOrarioService.class);
|
||||||
|
|
||||||
|
private final SIOrarioRepository siOrarioRepository;
|
||||||
|
|
||||||
|
public SIOrarioService(SIOrarioRepository siOrarioRepository) {
|
||||||
|
super();
|
||||||
|
this.siOrarioRepository = siOrarioRepository;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void writeNewFlux(Long fluxId, SIOrario siOrario) {
|
||||||
|
log.debug("Write SIOrario Flux = {}",fluxId);
|
||||||
|
siOrarioRepository.writeNewFlux(fluxId,siOrario);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -28,9 +28,9 @@ public class SIPosizioniService {
|
||||||
this.posizioniRepository = posizioniRepository;
|
this.posizioniRepository = posizioniRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<SIPosizioni> readNewFlux(Long flusso) {
|
public List<SIPosizioni> readNewFlux(Long fluxId) {
|
||||||
log.debug("Request Posizioni Flux > {}",flusso);
|
log.debug("Request SIPosizioni Flux > {}",fluxId);
|
||||||
return posizioniRepository.readNewFlux(flusso);
|
return posizioniRepository.readNewFlux(fluxId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -28,9 +28,9 @@ public class SIProrogheService {
|
||||||
this.prorogheRepository = prorogheRepository;
|
this.prorogheRepository = prorogheRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<SIProroghe> readNewFlux(Long flusso) {
|
public List<SIProroghe> readNewFlux(Long fluxId) {
|
||||||
log.debug("Request Proroghe Flux > {}",flusso);
|
log.debug("Request SIProroghe Flux > {}",fluxId);
|
||||||
return prorogheRepository.readNewFlux(flusso);
|
return prorogheRepository.readNewFlux(fluxId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -28,9 +28,9 @@ public class SITelefoniService {
|
||||||
this.telefoniRepository = telefoniRepository;
|
this.telefoniRepository = telefoniRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<SITelefoni> readNewFlux(Long flusso) {
|
public List<SITelefoni> readNewFlux(Long fluxId) {
|
||||||
log.debug("Request Telefoni Flux > {}",flusso);
|
log.debug("Request SITelefoni Flux > {}",fluxId);
|
||||||
return telefoniRepository.readNewFlux(flusso);
|
return telefoniRepository.readNewFlux(fluxId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
package it.cnr.isti.epasmed.sync;
|
package it.cnr.isti.epasmed.sync;
|
||||||
|
|
||||||
|
import java.sql.Timestamp;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.YearMonth;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.GregorianCalendar;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
|
@ -20,8 +21,10 @@ import it.cnr.isti.epasmed.epas.dto.EPASPersonsDTO;
|
||||||
import it.cnr.isti.epasmed.epas.mapper.EPASAffiliationsMapper;
|
import it.cnr.isti.epasmed.epas.mapper.EPASAffiliationsMapper;
|
||||||
import it.cnr.isti.epasmed.epas.mapper.EPASGroupsMapper;
|
import it.cnr.isti.epasmed.epas.mapper.EPASGroupsMapper;
|
||||||
import it.cnr.isti.epasmed.epas.mapper.EPASPersonsMapper;
|
import it.cnr.isti.epasmed.epas.mapper.EPASPersonsMapper;
|
||||||
|
import it.cnr.isti.epasmed.epas.model.EPASAbsences;
|
||||||
import it.cnr.isti.epasmed.epas.model.EPASAffiliations;
|
import it.cnr.isti.epasmed.epas.model.EPASAffiliations;
|
||||||
import it.cnr.isti.epasmed.epas.model.EPASGroups;
|
import it.cnr.isti.epasmed.epas.model.EPASGroups;
|
||||||
|
import it.cnr.isti.epasmed.epas.model.EPASPersonDays;
|
||||||
import it.cnr.isti.epasmed.epas.model.EPASPersons;
|
import it.cnr.isti.epasmed.epas.model.EPASPersons;
|
||||||
import it.cnr.isti.epasmed.epas.model.EPASTimeCards;
|
import it.cnr.isti.epasmed.epas.model.EPASTimeCards;
|
||||||
import it.cnr.isti.epasmed.epas.model.EPASValidates;
|
import it.cnr.isti.epasmed.epas.model.EPASValidates;
|
||||||
|
@ -33,11 +36,15 @@ import it.cnr.isti.epasmed.epas.service.EPASValidatesService;
|
||||||
import it.cnr.isti.epasmed.service.TabsSIService;
|
import it.cnr.isti.epasmed.service.TabsSIService;
|
||||||
import it.cnr.isti.epasmed.service.TimeCardsReportingService;
|
import it.cnr.isti.epasmed.service.TimeCardsReportingService;
|
||||||
import it.cnr.isti.epasmed.sistemainformativo.model.SIAnagrafico;
|
import it.cnr.isti.epasmed.sistemainformativo.model.SIAnagrafico;
|
||||||
|
import it.cnr.isti.epasmed.sistemainformativo.model.SICartellini;
|
||||||
|
import it.cnr.isti.epasmed.sistemainformativo.model.SICartelliniRendicontazioni;
|
||||||
import it.cnr.isti.epasmed.sistemainformativo.model.SIEmail;
|
import it.cnr.isti.epasmed.sistemainformativo.model.SIEmail;
|
||||||
import it.cnr.isti.epasmed.sistemainformativo.model.SIGruppi;
|
import it.cnr.isti.epasmed.sistemainformativo.model.SIGruppi;
|
||||||
import it.cnr.isti.epasmed.sistemainformativo.model.SIGruppiPers;
|
import it.cnr.isti.epasmed.sistemainformativo.model.SIGruppiPers;
|
||||||
import it.cnr.isti.epasmed.sistemainformativo.model.SITelefoni;
|
import it.cnr.isti.epasmed.sistemainformativo.model.SITelefoni;
|
||||||
import it.cnr.isti.epasmed.sistemainformativo.service.SIAnagraficoService;
|
import it.cnr.isti.epasmed.sistemainformativo.service.SIAnagraficoService;
|
||||||
|
import it.cnr.isti.epasmed.sistemainformativo.service.SICartelliniRendicontazioniService;
|
||||||
|
import it.cnr.isti.epasmed.sistemainformativo.service.SICartelliniService;
|
||||||
import it.cnr.isti.epasmed.sistemainformativo.service.SIEmailService;
|
import it.cnr.isti.epasmed.sistemainformativo.service.SIEmailService;
|
||||||
import it.cnr.isti.epasmed.sistemainformativo.service.SIGruppiPersService;
|
import it.cnr.isti.epasmed.sistemainformativo.service.SIGruppiPersService;
|
||||||
import it.cnr.isti.epasmed.sistemainformativo.service.SIGruppiService;
|
import it.cnr.isti.epasmed.sistemainformativo.service.SIGruppiService;
|
||||||
|
@ -55,7 +62,7 @@ public class SyncService {
|
||||||
private static final String SI_TIPO_EMAIL_ISTITUZIONALE = "Istituzionale";
|
private static final String SI_TIPO_EMAIL_ISTITUZIONALE = "Istituzionale";
|
||||||
private static final String SI_TIPO_EMAIL_CNR = "C.N.R.";
|
private static final String SI_TIPO_EMAIL_CNR = "C.N.R.";
|
||||||
|
|
||||||
private final Logger log = LoggerFactory.getLogger(SyncService.class);
|
private static final Logger logger = LoggerFactory.getLogger(SyncService.class);
|
||||||
private final SimpleDateFormat sdfDate = new SimpleDateFormat("yyyy-MM-dd");
|
private final SimpleDateFormat sdfDate = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
@Autowired
|
@Autowired
|
||||||
TabsSIService tabsSIService;
|
TabsSIService tabsSIService;
|
||||||
|
@ -74,6 +81,10 @@ public class SyncService {
|
||||||
SIGruppiService siGruppiService;
|
SIGruppiService siGruppiService;
|
||||||
@Autowired
|
@Autowired
|
||||||
SIGruppiPersService siGruppiPersService;
|
SIGruppiPersService siGruppiPersService;
|
||||||
|
@Autowired
|
||||||
|
SICartelliniService siCartelliniService;
|
||||||
|
@Autowired
|
||||||
|
SICartelliniRendicontazioniService siCartelliniRendicontazioniService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
EPASPersonsService epasPersonsService;
|
EPASPersonsService epasPersonsService;
|
||||||
|
@ -127,9 +138,9 @@ public class SyncService {
|
||||||
baspettative = false;
|
baspettative = false;
|
||||||
|
|
||||||
List<TabsSI> tabsSI = tabsSIService.getAllTabsSI();
|
List<TabsSI> tabsSI = tabsSIService.getAllTabsSI();
|
||||||
Long idFlux = siMasterLogService.startFluxWrites();
|
Long fluxId = siMasterLogService.startFluxWrites();
|
||||||
writeData(idFlux, tabsSI);
|
writeData(fluxId, tabsSI);
|
||||||
siMasterLogService.closeFluxWrites(idFlux, writeTabs());
|
siMasterLogService.closeFluxWrites(fluxId, writeTabs());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -137,7 +148,7 @@ public class SyncService {
|
||||||
// TabsSI posizioniTab = null;
|
// TabsSI posizioniTab = null;
|
||||||
// TabsSI prorogheTab = null;
|
// TabsSI prorogheTab = null;
|
||||||
for (TabsSI tab : tabsSI) {
|
for (TabsSI tab : tabsSI) {
|
||||||
log.info("TabSI: {}", tab);
|
logger.info("TabSI: {}", tab);
|
||||||
if (tab.getOperazioni() != null && !tab.getOperazioni().isEmpty()
|
if (tab.getOperazioni() != null && !tab.getOperazioni().isEmpty()
|
||||||
&& tab.getOperazioni().compareTo("R") == 0) {
|
&& tab.getOperazioni().compareTo("R") == 0) {
|
||||||
if (tab.getNome() == null || tab.getNome().isEmpty()) {
|
if (tab.getNome() == null || tab.getNome().isEmpty()) {
|
||||||
|
@ -178,7 +189,7 @@ public class SyncService {
|
||||||
|
|
||||||
private void syncAnagrafico(TabsSI tab) {
|
private void syncAnagrafico(TabsSI tab) {
|
||||||
if (tab.getIdFlusso() == null || tab.getIdFlusso().longValue() == 0) {
|
if (tab.getIdFlusso() == null || tab.getIdFlusso().longValue() == 0) {
|
||||||
log.error("Invalid Id Flusso for tab: {}", tab);
|
logger.error("Invalid Id Flusso for tab: {}", tab);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
long maxIdFlusso = 0;
|
long maxIdFlusso = 0;
|
||||||
|
@ -199,13 +210,13 @@ public class SyncService {
|
||||||
epasPersonsDTO.setSurname(sia.getCognome());
|
epasPersonsDTO.setSurname(sia.getCognome());
|
||||||
epasPersonsDTO.setOfficeId(ISTI_OFFICE_ID);
|
epasPersonsDTO.setOfficeId(ISTI_OFFICE_ID);
|
||||||
epasPerson = epasPersonsService.create(epasPersonsDTO);
|
epasPerson = epasPersonsService.create(epasPersonsDTO);
|
||||||
log.info("EPAS Created Person: {}", epasPerson);
|
logger.info("EPAS Created Person: {}", epasPerson);
|
||||||
} else {
|
} else {
|
||||||
EPASPersonsDTO epasPersonsDTO = epasPersonsMapper.epasPersonsToEPASPersonsDTO(epasPerson);
|
EPASPersonsDTO epasPersonsDTO = epasPersonsMapper.epasPersonsToEPASPersonsDTO(epasPerson);
|
||||||
epasPersonsDTO.setName(sia.getNome());
|
epasPersonsDTO.setName(sia.getNome());
|
||||||
epasPersonsDTO.setSurname(sia.getCognome());
|
epasPersonsDTO.setSurname(sia.getCognome());
|
||||||
epasPersonsService.updateByFiscalCode(epasPersonsDTO.getFiscalCode(), epasPersonsDTO);
|
epasPersonsService.updateByFiscalCode(epasPersonsDTO.getFiscalCode(), epasPersonsDTO);
|
||||||
log.info("EPAS Updated Person: {}", epasPersonsDTO);
|
logger.info("EPAS Updated Person: {}", epasPersonsDTO);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -224,7 +235,7 @@ public class SyncService {
|
||||||
|
|
||||||
private void syncMail(TabsSI tab) {
|
private void syncMail(TabsSI tab) {
|
||||||
if (tab.getIdFlusso() == null || tab.getIdFlusso().longValue() == 0) {
|
if (tab.getIdFlusso() == null || tab.getIdFlusso().longValue() == 0) {
|
||||||
log.error("Invalid Id Flusso for tab: {}", tab);
|
logger.error("Invalid Id Flusso for tab: {}", tab);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
long maxIdFlusso = 0;
|
long maxIdFlusso = 0;
|
||||||
|
@ -257,7 +268,7 @@ public class SyncService {
|
||||||
epasPersonsDTO.setEppn(se.getEmail());
|
epasPersonsDTO.setEppn(se.getEmail());
|
||||||
epasPersonsService.updateByFiscalCode(epasPersonsDTO.getFiscalCode(),
|
epasPersonsService.updateByFiscalCode(epasPersonsDTO.getFiscalCode(),
|
||||||
epasPersonsDTO);
|
epasPersonsDTO);
|
||||||
log.info("EPAS Updated Person: {}", epasPersonsDTO);
|
logger.info("EPAS Updated Person: {}", epasPersonsDTO);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -282,7 +293,7 @@ public class SyncService {
|
||||||
|
|
||||||
private void syncTelefoni(TabsSI tab) {
|
private void syncTelefoni(TabsSI tab) {
|
||||||
if (tab.getIdFlusso() == null || tab.getIdFlusso().longValue() == 0) {
|
if (tab.getIdFlusso() == null || tab.getIdFlusso().longValue() == 0) {
|
||||||
log.info("Invalid Id Flusso for tab: {}", tab);
|
logger.info("Invalid Id Flusso for tab: {}", tab);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
long maxIdFlusso = 0;
|
long maxIdFlusso = 0;
|
||||||
|
@ -306,7 +317,7 @@ public class SyncService {
|
||||||
epasPersonsDTO.setTelephone(sit.getRecapitotelefonico());
|
epasPersonsDTO.setTelephone(sit.getRecapitotelefonico());
|
||||||
epasPersonsService.updateByFiscalCode(epasPersonsDTO.getFiscalCode(),
|
epasPersonsService.updateByFiscalCode(epasPersonsDTO.getFiscalCode(),
|
||||||
epasPersonsDTO);
|
epasPersonsDTO);
|
||||||
log.info("EPAS Updated Person: {}", epasPersonsDTO);
|
logger.info("EPAS Updated Person: {}", epasPersonsDTO);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -328,7 +339,7 @@ public class SyncService {
|
||||||
|
|
||||||
private void syncGruppi(TabsSI tab) {
|
private void syncGruppi(TabsSI tab) {
|
||||||
if (tab.getIdFlusso() == null || tab.getIdFlusso().longValue() == 0) {
|
if (tab.getIdFlusso() == null || tab.getIdFlusso().longValue() == 0) {
|
||||||
log.info("Invalid Id Flusso for tab: {}", tab);
|
logger.info("Invalid Id Flusso for tab: {}", tab);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
long maxIdFlusso = 0;
|
long maxIdFlusso = 0;
|
||||||
|
@ -355,20 +366,20 @@ public class SyncService {
|
||||||
EPASGroupsDTO epasGroupsDTO = new EPASGroupsDTO(sig.getDescrizione(), null,
|
EPASGroupsDTO epasGroupsDTO = new EPASGroupsDTO(sig.getDescrizione(), null,
|
||||||
String.valueOf(sig.getId()), null, null, sig.getSigla(), ISTI_OFFICE_ID);
|
String.valueOf(sig.getId()), null, null, sig.getSigla(), ISTI_OFFICE_ID);
|
||||||
EPASGroups epasGroup = epasGroupsService.create(epasGroupsDTO);
|
EPASGroups epasGroup = epasGroupsService.create(epasGroupsDTO);
|
||||||
log.info("EPAS Created Group: {}", epasGroup);
|
logger.info("EPAS Created Group: {}", epasGroup);
|
||||||
} else {
|
} else {
|
||||||
EPASGroupsMapper epasGroupsMapper = new EPASGroupsMapper();
|
EPASGroupsMapper epasGroupsMapper = new EPASGroupsMapper();
|
||||||
EPASGroupsDTO epasGroupsDTO = epasGroupsMapper.epasGroupsToEPASGroupsDTO(groupPresent);
|
EPASGroupsDTO epasGroupsDTO = epasGroupsMapper.epasGroupsToEPASGroupsDTO(groupPresent);
|
||||||
epasGroupsDTO.setDescription(sig.getDescrizione());
|
epasGroupsDTO.setDescription(sig.getDescrizione());
|
||||||
epasGroupsDTO.setName(sig.getSigla());
|
epasGroupsDTO.setName(sig.getSigla());
|
||||||
epasGroupsService.updateById(groupPresent.getId(), epasGroupsDTO);
|
epasGroupsService.updateById(groupPresent.getId(), epasGroupsDTO);
|
||||||
log.info("EPAS Updated Group: {}", epasGroupsDTO);
|
logger.info("EPAS Updated Group: {}", epasGroupsDTO);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
EPASGroupsDTO epasGroupsDTO = new EPASGroupsDTO(sig.getDescrizione(), null,
|
EPASGroupsDTO epasGroupsDTO = new EPASGroupsDTO(sig.getDescrizione(), null,
|
||||||
String.valueOf(sig.getId()), null, null, sig.getSigla(), ISTI_OFFICE_ID);
|
String.valueOf(sig.getId()), null, null, sig.getSigla(), ISTI_OFFICE_ID);
|
||||||
EPASGroups epasGroup = epasGroupsService.create(epasGroupsDTO);
|
EPASGroups epasGroup = epasGroupsService.create(epasGroupsDTO);
|
||||||
log.info("EPAS Created Group: {}", epasGroup);
|
logger.info("EPAS Created Group: {}", epasGroup);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
List<EPASGroups> epasGroups = epasGroupsService.getList(ISTI_OFFICE_ID);
|
List<EPASGroups> epasGroups = epasGroupsService.getList(ISTI_OFFICE_ID);
|
||||||
|
@ -390,7 +401,7 @@ public class SyncService {
|
||||||
EPASGroupsDTO epasGroupsDTO = epasGroupsMapper
|
EPASGroupsDTO epasGroupsDTO = epasGroupsMapper
|
||||||
.epasGroupsToEPASGroupsDTO(groupPresent);
|
.epasGroupsToEPASGroupsDTO(groupPresent);
|
||||||
epasGroupsService.updateById(groupPresent.getId(), epasGroupsDTO);
|
epasGroupsService.updateById(groupPresent.getId(), epasGroupsDTO);
|
||||||
log.info("EPAS Delete Group: {}", epasGroupsDTO);
|
logger.info("EPAS Delete Group: {}", epasGroupsDTO);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -411,7 +422,7 @@ public class SyncService {
|
||||||
|
|
||||||
private void syncGruppoPers(TabsSI tab) {
|
private void syncGruppoPers(TabsSI tab) {
|
||||||
if (tab.getIdFlusso() == null || tab.getIdFlusso().longValue() == 0) {
|
if (tab.getIdFlusso() == null || tab.getIdFlusso().longValue() == 0) {
|
||||||
log.info("Invalid Id Flusso for tab: {}", tab);
|
logger.info("Invalid Id Flusso for tab: {}", tab);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
long maxIdFlusso = 0;
|
long maxIdFlusso = 0;
|
||||||
|
@ -452,7 +463,7 @@ public class SyncService {
|
||||||
groupPresent.getId(), null, String.valueOf(sigp.getPercentuale()),
|
groupPresent.getId(), null, String.valueOf(sigp.getPercentuale()),
|
||||||
epasPerson.getId(), String.valueOf(sigp.getId()));
|
epasPerson.getId(), String.valueOf(sigp.getId()));
|
||||||
epasAffiliationsService.updateById(affPresent.getId(), epasAffiliationsDTO);
|
epasAffiliationsService.updateById(affPresent.getId(), epasAffiliationsDTO);
|
||||||
log.info("EPAS Updated Affilation: {}", epasAffiliationsDTO);
|
logger.info("EPAS Updated Affilation: {}", epasAffiliationsDTO);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -477,7 +488,7 @@ public class SyncService {
|
||||||
epasPerson.getId(), String.valueOf(sigp.getId()));
|
epasPerson.getId(), String.valueOf(sigp.getId()));
|
||||||
EPASAffiliations epasAffiliationNew = epasAffiliationsService
|
EPASAffiliations epasAffiliationNew = epasAffiliationsService
|
||||||
.create(epasAffiliationsDTO);
|
.create(epasAffiliationsDTO);
|
||||||
log.info("EPAS Created Affilation: {}", epasAffiliationNew);
|
logger.info("EPAS Created Affilation: {}", epasAffiliationNew);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -503,7 +514,7 @@ public class SyncService {
|
||||||
epasPerson.getId(), String.valueOf(sigp.getId()));
|
epasPerson.getId(), String.valueOf(sigp.getId()));
|
||||||
EPASAffiliations epasAffiliationNew = epasAffiliationsService
|
EPASAffiliations epasAffiliationNew = epasAffiliationsService
|
||||||
.create(epasAffiliationsDTO);
|
.create(epasAffiliationsDTO);
|
||||||
log.info("EPAS Created Affilation: {}", epasAffiliationNew);
|
logger.info("EPAS Created Affilation: {}", epasAffiliationNew);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -523,10 +534,11 @@ public class SyncService {
|
||||||
}
|
}
|
||||||
if (affPresent != null) {
|
if (affPresent != null) {
|
||||||
EPASAffiliationsMapper epasAffiliationsMapper = new EPASAffiliationsMapper();
|
EPASAffiliationsMapper epasAffiliationsMapper = new EPASAffiliationsMapper();
|
||||||
EPASAffiliationsDTO epasAffiliationsDTO=epasAffiliationsMapper.epasAffiliationsToEPASAffiliationsDTO(affPresent);
|
EPASAffiliationsDTO epasAffiliationsDTO = epasAffiliationsMapper
|
||||||
|
.epasAffiliationsToEPASAffiliationsDTO(affPresent);
|
||||||
epasAffiliationsDTO.setEndDate(sdfDate.format(sigp.getAl()));
|
epasAffiliationsDTO.setEndDate(sdfDate.format(sigp.getAl()));
|
||||||
epasAffiliationsService.updateById(affPresent.getId(), epasAffiliationsDTO);
|
epasAffiliationsService.updateById(affPresent.getId(), epasAffiliationsDTO);
|
||||||
log.info("EPAS Delete Affilation: {}", epasAffiliationsDTO);
|
logger.info("EPAS Delete Affilation: {}", epasAffiliationsDTO);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -643,12 +655,12 @@ public class SyncService {
|
||||||
return writeTabs;
|
return writeTabs;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void writeData(Long idFlux, List<TabsSI> tabsSI) {
|
private void writeData(Long fluxId, List<TabsSI> tabsSI) {
|
||||||
// TabsSI caretelliniRendicontazioniTab = null;
|
// TabsSI caretelliniRendicontazioniTab = null;
|
||||||
// TabsSI cartelliniTab = null;
|
// TabsSI cartelliniTab = null;
|
||||||
|
|
||||||
for (TabsSI tab : tabsSI) {
|
for (TabsSI tab : tabsSI) {
|
||||||
log.info("TabSI: {}", tab);
|
logger.info("TabSI: {}", tab);
|
||||||
if (tab.getOperazioni() != null && !tab.getOperazioni().isEmpty()
|
if (tab.getOperazioni() != null && !tab.getOperazioni().isEmpty()
|
||||||
&& tab.getOperazioni().compareTo("W") == 0) {
|
&& tab.getOperazioni().compareTo("W") == 0) {
|
||||||
if (tab.getNome() == null || tab.getNome().isEmpty()) {
|
if (tab.getNome() == null || tab.getNome().isEmpty()) {
|
||||||
|
@ -656,16 +668,16 @@ public class SyncService {
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (tab.getNome()) {
|
switch (tab.getNome()) {
|
||||||
// case "orario":
|
case "orario":
|
||||||
// syncOrario(idFlux,tab);
|
syncOrario(fluxId,tab);
|
||||||
// break;
|
break;
|
||||||
// case "pers_orario":
|
// case "pers_orario":
|
||||||
// syncPersOrario(idFlux,tab);
|
// syncPersOrario(idFlux,tab);
|
||||||
// break;
|
// break;
|
||||||
case "cartellini":
|
case "cartellini":
|
||||||
break;
|
break;
|
||||||
case "cartellini_rendicontazioni":
|
case "cartellini_rendicontazioni":
|
||||||
syncCartelliniRendicontazioni(idFlux, tab);
|
syncCartelliniRendicontazioni(fluxId, tab);
|
||||||
break;
|
break;
|
||||||
// case "lavoro_fuori_sede":
|
// case "lavoro_fuori_sede":
|
||||||
// syncLavoroFuoriSede(idFlux,tab);
|
// syncLavoroFuoriSede(idFlux,tab);
|
||||||
|
@ -681,36 +693,110 @@ public class SyncService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void syncCartelliniRendicontazioni(Long idFlux, TabsSI tab) {
|
private void syncOrario(Long fluxId, TabsSI tab) {
|
||||||
if (tab.getIdFlusso() == null || tab.getIdFlusso().longValue() == 0) {
|
if (tab.getIdFlusso() == null || tab.getIdFlusso().longValue() == 0) {
|
||||||
log.error("Invalid Id Flusso for tab: {}", tab);
|
logger.error("Invalid Id Flusso for tab: {}", tab);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void syncCartelliniRendicontazioni(Long fluxId, TabsSI tab) {
|
||||||
|
if (tab.getIdFlusso() == null || tab.getIdFlusso().longValue() == 0) {
|
||||||
|
logger.error("Invalid Id Flusso for tab: {}", tab);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
long maxIdFlusso = 0;
|
|
||||||
|
|
||||||
GregorianCalendar lastMonthSent = new GregorianCalendar(2021, 11, 1);
|
|
||||||
Optional<TimeCardsReporting> lastTcR = timeCardsReportingService.getLastTimeCardsReporting();
|
Optional<TimeCardsReporting> lastTcR = timeCardsReportingService.getLastTimeCardsReporting();
|
||||||
if (!lastTcR.isPresent()) {
|
if (!lastTcR.isPresent()) {
|
||||||
log.error("Invalid TimeCardsReporting start point: {}", tab);
|
logger.error("Invalid TimeCardsReporting start point: {}", tab);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
GregorianCalendar nextMonthToSent = new GregorianCalendar();
|
Integer year = lastTcR.get().getYear();
|
||||||
nextMonthToSent.setTime(lastMonthSent.getTime());
|
Integer month = lastTcR.get().getMonth();
|
||||||
nextMonthToSent.add(GregorianCalendar.MONTH, 1);
|
|
||||||
String y = String.valueOf(nextMonthToSent.get(GregorianCalendar.YEAR));
|
YearMonth nextMonthToSent = YearMonth.of(year, month);
|
||||||
String m = String.valueOf(nextMonthToSent.get(GregorianCalendar.YEAR));
|
nextMonthToSent = nextMonthToSent.plusMonths(1);
|
||||||
EPASValidates epasValidates = epasValidatesService.getValidatesByOfficeCodeId(ISTI_OFFICE_CODEID, y, m);
|
|
||||||
|
EPASValidates epasValidates = epasValidatesService.getValidatesByOfficeCodeId(ISTI_OFFICE_CODEID,
|
||||||
|
String.valueOf(nextMonthToSent.getYear()), String.valueOf(nextMonthToSent.getMonthValue()));
|
||||||
|
|
||||||
if (!epasValidates.getAllCertificationsValidated()) {
|
if (!epasValidates.getAllCertificationsValidated()) {
|
||||||
log.info("No new month closed on EPAS: [year={}, month={}]", y, m);
|
logger.info("No new month closed on EPAS: {}", nextMonthToSent);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
log.info("Certifications Validated: [year={}, month={}]", y, m);
|
logger.info("Certifications Validated: {}", nextMonthToSent);
|
||||||
|
// Set Update DateTime
|
||||||
|
LocalDateTime now = LocalDateTime.now();
|
||||||
|
Timestamp dataMod = Timestamp.valueOf(now);
|
||||||
|
|
||||||
|
// EPASMed
|
||||||
|
TimeCardsReporting timeCardsReporting = new TimeCardsReporting();
|
||||||
|
timeCardsReporting.setYear(nextMonthToSent.getYear());
|
||||||
|
timeCardsReporting.setMonth(nextMonthToSent.getMonthValue());
|
||||||
|
timeCardsReporting.setIdFlusso(fluxId);
|
||||||
|
timeCardsReporting.setLastUpdate(now);
|
||||||
|
|
||||||
|
timeCardsReporting = timeCardsReportingService.createTimeCardsReporting(timeCardsReporting);
|
||||||
|
|
||||||
|
// SI
|
||||||
for (EPASPersons person : epasValidates.getValidatedPersons()) {
|
for (EPASPersons person : epasValidates.getValidatedPersons()) {
|
||||||
log.info("Writing TimeCard for Person: {}", person);
|
logger.info("Writing TimeCard for Person: {}", person);
|
||||||
EPASTimeCards epasTimeCards = epasTimeCardsService.getTimeCardByPersonEmail(person.getEmail(), y, m);
|
EPASTimeCards epasTimeCards = epasTimeCardsService.getTimeCardByPersonFiscalCode(person.getFiscalCode(),
|
||||||
|
String.valueOf(nextMonthToSent.getYear()), String.valueOf(nextMonthToSent.getMonthValue()));
|
||||||
|
|
||||||
|
EPASPersons epasPerson = epasTimeCards.getPerson();
|
||||||
|
Integer personId = Integer.valueOf(epasPerson.getId());
|
||||||
|
|
||||||
|
for (EPASPersonDays epasPersonDay : epasTimeCards.getPersonDays()) {
|
||||||
|
Long id = Long.valueOf(epasPersonDay.getId());
|
||||||
|
|
||||||
|
StringBuilder motivo = new StringBuilder();
|
||||||
|
if (epasPersonDay.getIsHoliday()) {
|
||||||
|
motivo.append("[Festivo]");
|
||||||
}
|
}
|
||||||
|
if (epasPersonDay.getAbsences() != null && epasPersonDay.getAbsences().length > 0) {
|
||||||
|
for (EPASAbsences epasAbsences : epasPersonDay.getAbsences()) {
|
||||||
|
motivo.append("[");
|
||||||
|
motivo.append(epasAbsences.getJustifiedType());
|
||||||
|
motivo.append("-");
|
||||||
|
motivo.append(epasAbsences.getJustifiedTime());
|
||||||
|
motivo.append("-");
|
||||||
|
motivo.append(epasAbsences.getNote());
|
||||||
|
motivo.append("]");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
java.sql.Date date = null;
|
||||||
|
try {
|
||||||
|
date = java.sql.Date.valueOf(epasPersonDay.getDate());
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("Invalid date format: {}", epasPersonDay.getDate());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
SICartellini siCartellini = new SICartellini(id, personId, epasPerson.getFiscalCode(), date,
|
||||||
|
motivo.toString(), epasPersonDay.getTimeAtWork(), epasPersonDay.getDifference(), dataMod, "0",
|
||||||
|
fluxId);
|
||||||
|
siCartelliniService.writeNewFlux(fluxId, siCartellini);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
logger.info("SICartellini Updated");
|
||||||
|
|
||||||
|
SICartelliniRendicontazioni siCartelliniRendicontazioni = new SICartelliniRendicontazioni(
|
||||||
|
timeCardsReporting.getId(), timeCardsReporting.getYear(), timeCardsReporting.getMonth(),
|
||||||
|
Timestamp.valueOf(timeCardsReporting.getLastUpdate()), "0", fluxId);
|
||||||
|
siCartelliniRendicontazioniService.writeNewFlux(fluxId, siCartelliniRendicontazioni);
|
||||||
|
logger.info("SICartelliniRendicontazioni Updated");
|
||||||
|
|
||||||
|
bcartellini_rendicontazioni = true;
|
||||||
|
bcartellini=true;
|
||||||
|
tab.setIdFlusso(fluxId);
|
||||||
|
tab.setLastUpdate(LocalDateTime.now());
|
||||||
|
tabsSIService.updateTabsSI(tab);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@ -27,19 +27,19 @@ import it.cnr.isti.epasmed.sync.SyncService;
|
||||||
@RequestMapping("/api")
|
@RequestMapping("/api")
|
||||||
public class SyncResource {
|
public class SyncResource {
|
||||||
|
|
||||||
private final Logger log = LoggerFactory.getLogger(SyncResource.class);
|
private static final Logger logger = LoggerFactory.getLogger(SyncResource.class);
|
||||||
|
|
||||||
@Value("${jhipster.clientApp.name}")
|
@Value("${jhipster.clientApp.name}")
|
||||||
private String applicationName;
|
private String applicationName;
|
||||||
|
|
||||||
private final SyncService syncReads;
|
private final SyncService syncService;
|
||||||
|
|
||||||
public SyncResource(SyncService syncReads) {
|
public SyncResource(SyncService syncService) {
|
||||||
this.syncReads = syncReads;
|
this.syncService = syncService;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@code POST /sync/reads} : Retrieve new flux from Sistema Informativo and
|
* {@code GET /sync/reads} : Retrieve new flux from Sistema Informativo and
|
||||||
* update ePAS.
|
* update ePAS.
|
||||||
*
|
*
|
||||||
* @return the {@link ResponseEntity} with status {@code 201 (Executed)}
|
* @return the {@link ResponseEntity} with status {@code 201 (Executed)}
|
||||||
|
@ -47,24 +47,52 @@ public class SyncResource {
|
||||||
*
|
*
|
||||||
|
|
||||||
*/
|
*/
|
||||||
@PostMapping("/sync/reads")
|
@GetMapping("/sync/reads")
|
||||||
@PreAuthorize("hasAuthority(\"" + AuthoritiesConstants.ADMIN + "\")")
|
@PreAuthorize("hasAuthority(\"" + AuthoritiesConstants.ADMIN + "\")")
|
||||||
public ResponseEntity<Void> syncReads() throws URISyntaxException {
|
public ResponseEntity<Void> syncReads() throws URISyntaxException {
|
||||||
log.info("REST request syncReads()");
|
logger.info("REST request syncReads()");
|
||||||
ResponseEntity<Void> res;
|
ResponseEntity<Void> res;
|
||||||
try {
|
try {
|
||||||
syncReads.executeReads();
|
syncService.executeReads();
|
||||||
log.info("Sincronizzazione delle Letture eseguita correttamente.");
|
logger.info("Sincronizzazione delle Letture eseguita correttamente.");
|
||||||
res=ResponseEntity.noContent().headers(HeaderUtil.createAlert(applicationName,
|
res=ResponseEntity.noContent().headers(HeaderUtil.createAlert(applicationName,
|
||||||
"Sincronizzazione delle letture eseguita corretamente.","")).build();
|
"Sincronizzazione delle letture eseguita corretamente.","")).build();
|
||||||
|
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
log.error("Errore nella sincronizzazione delle letture: {}", e.getLocalizedMessage(), e);
|
logger.error("Errore nella sincronizzazione delle letture: {}", e.getLocalizedMessage(), e);
|
||||||
res=ResponseEntity.noContent().headers(HeaderUtil.createAlert(applicationName,
|
res=ResponseEntity.noContent().headers(HeaderUtil.createAlert(applicationName,
|
||||||
"Errore nella sincronizzazione delle letture: {}", e.getLocalizedMessage())).build();
|
"Errore nella sincronizzazione delle letture: {}", e.getLocalizedMessage())).build();
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@code GET /sync/writes} : Retrieve new flux from ePAS and
|
||||||
|
* update SistemaInformativo.
|
||||||
|
*
|
||||||
|
* @return the {@link ResponseEntity} with status {@code 201 (Executed)}
|
||||||
|
* or with status {@code 400 (Bad Request)} if there is a error.
|
||||||
|
*
|
||||||
|
|
||||||
|
*/
|
||||||
|
@GetMapping("/sync/writes")
|
||||||
|
@PreAuthorize("hasAuthority(\"" + AuthoritiesConstants.ADMIN + "\")")
|
||||||
|
public ResponseEntity<Void> syncWrites() throws URISyntaxException {
|
||||||
|
logger.info("REST request syncWrites)");
|
||||||
|
ResponseEntity<Void> res;
|
||||||
|
try {
|
||||||
|
syncService.executeWrites();
|
||||||
|
String msg="Sincronizzazione delle scritture eseguita correttamente.";
|
||||||
|
logger.info(msg);
|
||||||
|
res=ResponseEntity.noContent().headers(HeaderUtil.createAlert(applicationName,
|
||||||
|
msg,"")).build();
|
||||||
|
|
||||||
|
} catch (Throwable e) {
|
||||||
|
logger.error("Errore nella sincronizzazione delle scritture: {}", e.getLocalizedMessage(), e);
|
||||||
|
res=ResponseEntity.noContent().headers(HeaderUtil.createAlert(applicationName,
|
||||||
|
"Errore nella sincronizzazione delle scritture: {}", e.getLocalizedMessage())).build();
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -41,8 +41,8 @@ public class EPASPersonsResource {
|
||||||
|
|
||||||
private final EPASPersonsService epasPersonsService;
|
private final EPASPersonsService epasPersonsService;
|
||||||
|
|
||||||
public EPASPersonsResource(EPASPersonsService epasPersonsServiceService) {
|
public EPASPersonsResource(EPASPersonsService epasPersonsService) {
|
||||||
this.epasPersonsService = epasPersonsServiceService;
|
this.epasPersonsService = epasPersonsService;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -98,7 +98,7 @@ public class EPASPersonsResource {
|
||||||
* <p>
|
* <p>
|
||||||
* Creates a new persons if the id is not already used.
|
* Creates a new persons if the id is not already used.
|
||||||
*
|
*
|
||||||
* @param epasPersonsDTO the user to create.
|
* @param epasPersonsDTO the person to create.
|
||||||
* @return the {@link ResponseEntity} with status {@code 201 (Created)} and with
|
* @return the {@link ResponseEntity} with status {@code 201 (Created)} and with
|
||||||
* body the new ePAS Person, or with status {@code 400 (Bad Request)} if
|
* body the new ePAS Person, or with status {@code 400 (Bad Request)} if
|
||||||
* the id is already in use.
|
* the id is already in use.
|
||||||
|
|
|
@ -0,0 +1,89 @@
|
||||||
|
package it.cnr.isti.epasmed.web.rest.epas;
|
||||||
|
|
||||||
|
import java.net.URI;
|
||||||
|
import java.net.URISyntaxException;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import io.github.jhipster.web.util.HeaderUtil;
|
||||||
|
import io.github.jhipster.web.util.ResponseUtil;
|
||||||
|
import it.cnr.isti.epasmed.epas.dto.EPASStampingsDTO;
|
||||||
|
import it.cnr.isti.epasmed.epas.model.EPASStampings;
|
||||||
|
import it.cnr.isti.epasmed.epas.service.EPASStampingsService;
|
||||||
|
import it.cnr.isti.epasmed.security.AuthoritiesConstants;
|
||||||
|
import it.cnr.isti.epasmed.web.rest.errors.BadRequestAlertException;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/epas")
|
||||||
|
public class EPASStampingsResource {
|
||||||
|
|
||||||
|
private final Logger log = LoggerFactory.getLogger(getClass());
|
||||||
|
|
||||||
|
@Value("${jhipster.clientApp.name}")
|
||||||
|
private String applicationName;
|
||||||
|
|
||||||
|
private final EPASStampingsService epasStampingsService;
|
||||||
|
|
||||||
|
public EPASStampingsResource(EPASStampingsService epasStampingsService) {
|
||||||
|
this.epasStampingsService = epasStampingsService;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@code GET /stampings/:id} : get stampings by id.
|
||||||
|
*
|
||||||
|
* @param id the id of the stampings to find.
|
||||||
|
* @return the {@link ResponseEntity} with status {@code 200 (OK)} and with body
|
||||||
|
* the EPAS Stampings, or with status {@code 404 (Not Found)}.
|
||||||
|
*/
|
||||||
|
@GetMapping("/stampings/{id}")
|
||||||
|
public ResponseEntity<EPASStampings> getEPASStampingsById(@PathVariable String id) {
|
||||||
|
log.info("REST request to get ePAS Stampings by Id: {}", id);
|
||||||
|
EPASStampings epasStampings = epasStampingsService.getById(id);
|
||||||
|
log.info("Retrieved Stampings: {}", epasStampings);
|
||||||
|
return ResponseUtil.wrapOrNotFound(Optional.of(epasStampings));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@code POST /stampings} : Creates a new stampings.
|
||||||
|
* <p>
|
||||||
|
* Creates a new stampings.
|
||||||
|
*
|
||||||
|
* @param epasStampingsDTO the stamping to create.
|
||||||
|
* @return the {@link ResponseEntity} with status {@code 201 (Created)} and with
|
||||||
|
* body the new ePAS Stamping, or with status {@code 400 (Bad Request)} if
|
||||||
|
* the id is already in use.
|
||||||
|
* @throws URISyntaxException if the Location URI syntax is incorrect.
|
||||||
|
* @throws BadRequestAlertException {@code 400 (Bad Request)} if the id is
|
||||||
|
* already in use.
|
||||||
|
*/
|
||||||
|
@PostMapping("/stampings")
|
||||||
|
@PreAuthorize("hasAuthority(\"" + AuthoritiesConstants.ADMIN + "\")")
|
||||||
|
public ResponseEntity<EPASStampings> createEPASStampings(@Valid @RequestBody EPASStampingsDTO epasStampingsDTO)
|
||||||
|
throws URISyntaxException {
|
||||||
|
log.debug("REST request to create EPAS Stamping: {}", epasStampingsDTO);
|
||||||
|
|
||||||
|
EPASStampings createdEPASStampings = epasStampingsService.create(epasStampingsDTO);
|
||||||
|
return ResponseEntity.created(new URI("/api/epas/stampings/" + createdEPASStampings.getId()))
|
||||||
|
.headers(HeaderUtil.createAlert(applicationName,
|
||||||
|
"A ePAS Stampings is created with identifier " + createdEPASStampings.getId(),
|
||||||
|
createdEPASStampings.getId()))
|
||||||
|
.body(createdEPASStampings);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -29,6 +29,10 @@ const LAYOUT_ROUTES = [navbarRoute, ...errorRoute];
|
||||||
path: 'entities',
|
path: 'entities',
|
||||||
loadChildren: () => import('./entities/entity.module').then(m => m.EpasmedEntityModule),
|
loadChildren: () => import('./entities/entity.module').then(m => m.EpasmedEntityModule),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: 'operations',
|
||||||
|
loadChildren: () => import('./operations/operations.module').then(m => m.EpasmedOperationsModule),
|
||||||
|
},
|
||||||
|
|
||||||
...LAYOUT_ROUTES,
|
...LAYOUT_ROUTES,
|
||||||
],
|
],
|
||||||
|
|
|
@ -7,6 +7,7 @@ import { EpasmedCoreModule } from 'app/core/core.module';
|
||||||
import { EpasmedAppRoutingModule } from './app-routing.module';
|
import { EpasmedAppRoutingModule } from './app-routing.module';
|
||||||
import { EpasmedHomeModule } from './home/home.module';
|
import { EpasmedHomeModule } from './home/home.module';
|
||||||
import { EpasmedEntityModule } from './entities/entity.module';
|
import { EpasmedEntityModule } from './entities/entity.module';
|
||||||
|
import { EpasmedOperationsModule } from './operations/operations.module';
|
||||||
// jhipster-needle-angular-add-module-import JHipster will add new module here
|
// jhipster-needle-angular-add-module-import JHipster will add new module here
|
||||||
import { MainComponent } from './layouts/main/main.component';
|
import { MainComponent } from './layouts/main/main.component';
|
||||||
import { NavbarComponent } from './layouts/navbar/navbar.component';
|
import { NavbarComponent } from './layouts/navbar/navbar.component';
|
||||||
|
@ -22,6 +23,7 @@ import { ErrorComponent } from './layouts/error/error.component';
|
||||||
EpasmedHomeModule,
|
EpasmedHomeModule,
|
||||||
// jhipster-needle-angular-add-module JHipster will add new module here
|
// jhipster-needle-angular-add-module JHipster will add new module here
|
||||||
EpasmedEntityModule,
|
EpasmedEntityModule,
|
||||||
|
EpasmedOperationsModule,
|
||||||
EpasmedAppRoutingModule,
|
EpasmedAppRoutingModule,
|
||||||
],
|
],
|
||||||
declarations: [MainComponent, NavbarComponent, ErrorComponent, PageRibbonComponent, FooterComponent],
|
declarations: [MainComponent, NavbarComponent, ErrorComponent, PageRibbonComponent, FooterComponent],
|
||||||
|
|
|
@ -41,6 +41,22 @@
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
<li *jhiHasAnyAuthority="'ROLE_ADMIN'" ngbDropdown class="nav-item dropdown pointer" display="dynamic" routerLinkActive="active" [routerLinkActiveOptions]="{ exact: true }">
|
||||||
|
<a class="nav-link dropdown-toggle" ngbDropdownToggle href="javascript:void(0);" id="admin-menu">
|
||||||
|
<span>
|
||||||
|
<fa-icon icon="road"></fa-icon>
|
||||||
|
<span>Operations</span>
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
<ul class="dropdown-menu" ngbDropdownMenu aria-labelledby="admin-menu">
|
||||||
|
<li>
|
||||||
|
<a class="dropdown-item" routerLink="operations/sync" routerLinkActive="active" (click)="collapseNavbar()">
|
||||||
|
<fa-icon icon="cloud" [fixedWidth]="true"></fa-icon>
|
||||||
|
<span>Sync</span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
<li *jhiHasAnyAuthority="'ROLE_ADMIN'" ngbDropdown class="nav-item dropdown pointer" display="dynamic" routerLinkActive="active" [routerLinkActiveOptions]="{ exact: true }">
|
<li *jhiHasAnyAuthority="'ROLE_ADMIN'" ngbDropdown class="nav-item dropdown pointer" display="dynamic" routerLinkActive="active" [routerLinkActiveOptions]="{ exact: true }">
|
||||||
<a class="nav-link dropdown-toggle" ngbDropdownToggle href="javascript:void(0);" id="admin-menu">
|
<a class="nav-link dropdown-toggle" ngbDropdownToggle href="javascript:void(0);" id="admin-menu">
|
||||||
<span>
|
<span>
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { RouterModule } from '@angular/router';
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [
|
||||||
|
RouterModule.forChild([
|
||||||
|
/* jhipster-needle-add-entity-route - JHipster will add entity modules routes here */
|
||||||
|
{
|
||||||
|
path: 'sync',
|
||||||
|
loadChildren: () => import('./sync/sync.module').then(m => m.SyncModule),
|
||||||
|
data: {
|
||||||
|
pageTitle: 'Sync',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
]),
|
||||||
|
],
|
||||||
|
})
|
||||||
|
export class EpasmedOperationsModule {}
|
|
@ -0,0 +1,11 @@
|
||||||
|
<div class="table-responsive">
|
||||||
|
<h2 id="logs-page-heading">Sync</h2>
|
||||||
|
|
||||||
|
<p>Sync Sistema Informativo ed ePAS.</p>
|
||||||
|
|
||||||
|
<div class="d-grid gap-2 d-md-block">
|
||||||
|
<button class="btn btn-primary" type="button" (click)="sync('reads')">Reads</button>
|
||||||
|
<button class="btn btn-primary" type="button" (click)="sync('writes')">Writes</button>
|
||||||
|
</div>
|
||||||
|
{{syncT}}
|
||||||
|
</div>
|
|
@ -0,0 +1,22 @@
|
||||||
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
|
||||||
|
import { SyncType } from './sync.model';
|
||||||
|
import { SyncService } from './sync.service';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'jhi-sync',
|
||||||
|
templateUrl: './sync.component.html',
|
||||||
|
})
|
||||||
|
export class SyncComponent implements OnInit {
|
||||||
|
syncT: SyncType | null = null;
|
||||||
|
|
||||||
|
constructor(private syncService: SyncService) {}
|
||||||
|
|
||||||
|
ngOnInit(): void {}
|
||||||
|
|
||||||
|
sync(syncType: SyncType): void {
|
||||||
|
this.syncT = syncType;
|
||||||
|
}
|
||||||
|
|
||||||
|
// this.syncService.sync(syncType);
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
export type SyncType = 'reads' | 'writes';
|
|
@ -0,0 +1,13 @@
|
||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { RouterModule } from '@angular/router';
|
||||||
|
|
||||||
|
import { EpasmedSharedModule } from 'app/shared/shared.module';
|
||||||
|
import { SyncComponent } from './sync.component';
|
||||||
|
import { syncRoute } from './sync.route';
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [EpasmedSharedModule, RouterModule.forChild(syncRoute)],
|
||||||
|
declarations: [SyncComponent],
|
||||||
|
entryComponents: [SyncComponent],
|
||||||
|
})
|
||||||
|
export class SyncModule {}
|
|
@ -0,0 +1,13 @@
|
||||||
|
import { Routes } from '@angular/router';
|
||||||
|
|
||||||
|
import { SyncComponent } from './sync.component';
|
||||||
|
|
||||||
|
export const syncRoute: Routes = [
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
component: SyncComponent,
|
||||||
|
data: {
|
||||||
|
pageTitle: 'Sync',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
];
|
|
@ -0,0 +1,15 @@
|
||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { Observable } from 'rxjs';
|
||||||
|
import { HttpClient } from '@angular/common/http';
|
||||||
|
|
||||||
|
import { SERVER_API_URL } from 'app/app.constants';
|
||||||
|
import { SyncType } from './sync.model';
|
||||||
|
|
||||||
|
@Injectable({ providedIn: 'root' })
|
||||||
|
export class SyncService {
|
||||||
|
constructor(private http: HttpClient) {}
|
||||||
|
|
||||||
|
sync(syncType: SyncType): Observable<{}> {
|
||||||
|
return this.http.get(SERVER_API_URL + 'api/sync/' + syncType);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,18 @@
|
||||||
|
package it.cnr.isti.epasmed;
|
||||||
|
|
||||||
|
import java.time.YearMonth;
|
||||||
|
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
class SimpleTest {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void dateOperation() {
|
||||||
|
Integer year = 2021;
|
||||||
|
Integer month = 12;
|
||||||
|
|
||||||
|
YearMonth nextMonthToSent = YearMonth.of(year, month);
|
||||||
|
nextMonthToSent=nextMonthToSent.plusMonths(1);
|
||||||
|
System.out.print("Result Date: "+nextMonthToSent);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,238 @@
|
||||||
|
package it.cnr.isti.epasmed.web.rest.epas;
|
||||||
|
|
||||||
|
import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.csrf;
|
||||||
|
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
|
||||||
|
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
|
||||||
|
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.put;
|
||||||
|
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
|
||||||
|
|
||||||
|
import java.io.FileWriter;
|
||||||
|
import java.nio.file.Files;
|
||||||
|
import java.nio.file.Paths;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.function.Function;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
|
||||||
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
|
import org.springframework.core.env.Environment;
|
||||||
|
import org.springframework.http.MediaType;
|
||||||
|
import org.springframework.security.test.context.support.WithMockUser;
|
||||||
|
import org.springframework.test.context.junit.jupiter.EnabledIf;
|
||||||
|
import org.springframework.test.web.servlet.MockMvc;
|
||||||
|
|
||||||
|
import it.cnr.isti.epasmed.EpasmedApp;
|
||||||
|
import it.cnr.isti.epasmed.epas.dto.EPASStampingsDTO;
|
||||||
|
import it.cnr.isti.epasmed.security.AuthoritiesConstants;
|
||||||
|
import it.cnr.isti.epasmed.web.rest.TestUtil;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Integration tests for the {@link EPASStampingsResource} REST controller.
|
||||||
|
*/
|
||||||
|
@AutoConfigureMockMvc
|
||||||
|
@WithMockUser(authorities = AuthoritiesConstants.ADMIN)
|
||||||
|
@SpringBootTest(classes = EpasmedApp.class)
|
||||||
|
@EnabledIf("false")
|
||||||
|
public class EPASStampingsResourceIT {
|
||||||
|
|
||||||
|
private static final Logger logger = LoggerFactory.getLogger(EPASStampingsResourceIT.class);
|
||||||
|
|
||||||
|
// private static final String OFFICE_DEFAULT_ID = "1";
|
||||||
|
// private static final String OFFICE_DEFAULT_NAME = "ISTI - Pisa";
|
||||||
|
// private static final String OFFICE_DEFAULT_CODE = "074000";
|
||||||
|
// private static final String OFFICE_DEFAULT_CODEID = "225200";
|
||||||
|
|
||||||
|
private static final String STAMPING_DEFAULT_WAYTYPE = "in";
|
||||||
|
private static final String STAMPING_DEFAULT_REASONTYPE = null;
|
||||||
|
private static final String STAMPING_DEFAULT_DATETIME = "2021-02-12T08:20";
|
||||||
|
private static final String STAMPING_DEFAULT_BADGENUMBER = "9802";
|
||||||
|
private static final String STAMPING_DEFAULT_ZONE = null;
|
||||||
|
private static final String STAMPING_DEFAULT_NOTE = "Timbratura test";
|
||||||
|
private static final String STAMPING_DEFAULT_PLACE = null;
|
||||||
|
private static final String STAMPING_DEFAULT_REASON = null;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private MockMvc restEPASStampingsMockMvc;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private Environment environment;
|
||||||
|
|
||||||
|
private EPASStampingsDTO epasStampingsDTO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a EPASStampingsDTO.
|
||||||
|
*
|
||||||
|
* This is a static method
|
||||||
|
*/
|
||||||
|
public static EPASStampingsDTO createEPASStampingsDTO() {
|
||||||
|
EPASStampingsDTO epasStampingsDTO = new EPASStampingsDTO();
|
||||||
|
epasStampingsDTO.setWayType(STAMPING_DEFAULT_WAYTYPE);
|
||||||
|
epasStampingsDTO.setReasonType(STAMPING_DEFAULT_REASONTYPE);
|
||||||
|
epasStampingsDTO.setDateTime(STAMPING_DEFAULT_DATETIME);
|
||||||
|
epasStampingsDTO.setBadgeNumber(STAMPING_DEFAULT_BADGENUMBER);
|
||||||
|
epasStampingsDTO.setZone(STAMPING_DEFAULT_ZONE);
|
||||||
|
epasStampingsDTO.setNote(STAMPING_DEFAULT_NOTE);
|
||||||
|
epasStampingsDTO.setPlace(STAMPING_DEFAULT_PLACE);
|
||||||
|
epasStampingsDTO.setReason(STAMPING_DEFAULT_REASON);
|
||||||
|
return epasStampingsDTO;
|
||||||
|
}
|
||||||
|
|
||||||
|
@BeforeEach
|
||||||
|
public void initTest() {
|
||||||
|
for (String profileName : environment.getActiveProfiles()) {
|
||||||
|
logger.info("Currently active profile - " + profileName);
|
||||||
|
}
|
||||||
|
logger.info("System env - " + System.getenv("spring.profiles.active"));
|
||||||
|
epasStampingsDTO = createEPASStampingsDTO();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void getStampingById() throws Exception {
|
||||||
|
restEPASStampingsMockMvc.perform(get("/api/epas/stampings/14")).andExpect(status().isOk());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void createStamping() throws Exception {
|
||||||
|
|
||||||
|
restEPASStampingsMockMvc
|
||||||
|
.perform(post("/api/epas/stampings").contentType(MediaType.APPLICATION_JSON)
|
||||||
|
.content(TestUtil.convertObjectToJsonBytes(epasStampingsDTO)).with(csrf()))
|
||||||
|
.andExpect(status().isCreated());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void istiUpdatedStampings() {
|
||||||
|
String userDirectory = System.getProperty("user.dir");
|
||||||
|
logger.info(userDirectory);
|
||||||
|
List<EPASStampingsDTO> istiStampings = null;
|
||||||
|
try (Stream<String> stream = Files
|
||||||
|
.lines(Paths.get("src/test/resources/it/cnr/isti/epasmed/web/rest/epas/timbratureISTI.csv"))) {
|
||||||
|
istiStampings = stream.skip(1).map(istiMapToStampingsDTO).collect(Collectors.toList());
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error(e.getLocalizedMessage(), e);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
logger.info("ISTI StampingsDTO loaded");
|
||||||
|
|
||||||
|
for (EPASStampingsDTO esDTO : istiStampings) {
|
||||||
|
if (esDTO.getBadgeNumber() != null && !esDTO.getBadgeNumber().isEmpty()) {
|
||||||
|
try {
|
||||||
|
restEPASStampingsMockMvc
|
||||||
|
.perform(post("/api/epas/stampings").contentType(MediaType.APPLICATION_JSON)
|
||||||
|
.content(TestUtil.convertObjectToJsonBytes(esDTO)).with(csrf()))
|
||||||
|
.andExpect(status().is2xxSuccessful());
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error(e.getLocalizedMessage(), e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
logger.info("Stampings created");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private Function<String, EPASStampingsDTO> istiMapToStampingsDTO = (line) -> {
|
||||||
|
|
||||||
|
String[] s = line.split(",");// a CSV has comma separated lines
|
||||||
|
|
||||||
|
EPASStampingsDTO stamping = new EPASStampingsDTO();
|
||||||
|
|
||||||
|
// Badge = Matricola
|
||||||
|
if (s[2] != null && s[2].length() > 0) {
|
||||||
|
String badge = s[2].substring(1, s[2].length() - 1);
|
||||||
|
if (badge != null && !badge.isEmpty()) {
|
||||||
|
stamping.setBadgeNumber(badge);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Operazione
|
||||||
|
if (s[3] != null && s[3].length() > 0) {
|
||||||
|
String operazione = s[3].substring(1, s[3].length() - 1);
|
||||||
|
if (operazione != null && !operazione.isEmpty()) {
|
||||||
|
switch (operazione) {
|
||||||
|
case "Entrata":
|
||||||
|
stamping.setWayType("in");
|
||||||
|
break;
|
||||||
|
case "Uscita":
|
||||||
|
stamping.setWayType("out");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Data
|
||||||
|
if (s[4] != null && s[4].length() > 0) {
|
||||||
|
String d = s[4].substring(1, s[4].length() - 1);
|
||||||
|
if (d != null && !d.isEmpty()) {
|
||||||
|
stamping.setDateTime(d);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Causale Codice
|
||||||
|
if (s[5] != null && s[5].length() > 0) {
|
||||||
|
String causale = s[5].substring(1, s[5].length() - 1);
|
||||||
|
if (causale != null && !causale.isEmpty()) {
|
||||||
|
switch (causale) {
|
||||||
|
case "1":
|
||||||
|
stamping.setReasonType("motiviDiServizio");
|
||||||
|
break;
|
||||||
|
case "5":
|
||||||
|
stamping.setReasonType("lavoroFuoriSede");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Timbratura Altro Motivo
|
||||||
|
if (s[9] != null && s[9].length() > 0) {
|
||||||
|
String note = s[9].substring(1, s[9].length() - 1);
|
||||||
|
if (note != null && !note.isEmpty()) {
|
||||||
|
stamping.setNote(note);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return stamping;
|
||||||
|
};
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void addVirgolette() {
|
||||||
|
String userDirectory = System.getProperty("user.dir");
|
||||||
|
logger.info(userDirectory);
|
||||||
|
List<String> list = new ArrayList<>();
|
||||||
|
try (Stream<String> stream = Files
|
||||||
|
.lines(Paths.get("src/test/resources/it/cnr/isti/epasmed/web/rest/epas/timbratureISTI.csv"))) {
|
||||||
|
list = stream.collect(Collectors.toList());
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error(e.getLocalizedMessage(), e);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
FileWriter writer = new FileWriter(
|
||||||
|
"src/test/resources/it/cnr/isti/epasmed/web/rest/epas/timbratureISTI2.csv");
|
||||||
|
for (String str : list) {
|
||||||
|
writer.write("\""+str+"\"" + System.lineSeparator());
|
||||||
|
}
|
||||||
|
writer.close();
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error(e.getLocalizedMessage(), e);
|
||||||
|
}
|
||||||
|
logger.info("ISTI StampingsDTO updated");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -33,7 +33,7 @@ import it.cnr.isti.epasmed.security.AuthoritiesConstants;
|
||||||
@AutoConfigureMockMvc
|
@AutoConfigureMockMvc
|
||||||
@WithMockUser(authorities = AuthoritiesConstants.ADMIN)
|
@WithMockUser(authorities = AuthoritiesConstants.ADMIN)
|
||||||
@SpringBootTest(classes = EpasmedApp.class)
|
@SpringBootTest(classes = EpasmedApp.class)
|
||||||
@EnabledIf("false")
|
@EnabledIf("true")
|
||||||
public class EPASWorkingTimeTypesResourceIT {
|
public class EPASWorkingTimeTypesResourceIT {
|
||||||
|
|
||||||
private final Logger log = LoggerFactory.getLogger(getClass());
|
private final Logger log = LoggerFactory.getLogger(getClass());
|
||||||
|
|
Loading…
Reference in New Issue