Skip to content

Commit

Permalink
clean old peruste update system
Browse files Browse the repository at this point in the history
  • Loading branch information
oplekal committed Dec 3, 2024
1 parent 613c51c commit fa24eaf
Show file tree
Hide file tree
Showing 38 changed files with 51 additions and 451 deletions.
10 changes: 7 additions & 3 deletions eperusteet/eperusteet-service/pom.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<version>2.0.0</version>
<version>3.0.0</version>

<parent>
<groupId>org.springframework.boot</groupId>
Expand Down Expand Up @@ -36,7 +36,7 @@
<maven-compiler-plugin.version>3.10.1</maven-compiler-plugin.version>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<org.apache.tomcat.version>9.0.90</org.apache.tomcat.version>
<org.apache.tomcat.version>10.1.33</org.apache.tomcat.version>
<pdfbox.version>2.0.29</pdfbox.version>
<postgresql.version>42.5.5</postgresql.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down Expand Up @@ -113,7 +113,11 @@
<artifactId>spring-plugin-metadata</artifactId>
<version>3.0.0</version>
</dependency>

<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-catalina</artifactId>
<version>${org.apache.tomcat.version}</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.apache.tomcat.embed</groupId>-->
<!-- <artifactId>tomcat-embed-core</artifactId>-->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Excepti
.requestMatchers("/buildversion.txt").permitAll()
.requestMatchers(HttpMethod.GET, "/api/**").permitAll()
.requestMatchers(HttpMethod.GET, "/").permitAll()
.requestMatchers(HttpMethod.POST, "/api/dokumentit/pdf/**").permitAll()
.anyRequest().authenticated())
.httpBasic(Customizer.withDefaults())
.logout(logout -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public class PerusteenOsaViite implements
@OneToOne(fetch = FetchType.LAZY, mappedBy = "sisalto")
private DigitaalisenOsaamisenPerusteenSisalto digitaalinenOsaaminenSisalto;

@ManyToOne(cascade = {CascadeType.MERGE, CascadeType.PERSIST}, fetch = FetchType.LAZY)
@ManyToOne(cascade = {CascadeType.MERGE, CascadeType.PERSIST})
@Getter
@Setter
private PerusteenOsa perusteenOsa;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import fi.vm.sade.eperusteet.service.dokumentti.DokumenttiStateService;
import fi.vm.sade.eperusteet.service.dokumentti.ExternalPdfService;
import fi.vm.sade.eperusteet.service.dokumentti.impl.util.DokumenttiUtils;
import fi.vm.sade.eperusteet.service.event.aop.IgnorePerusteUpdateCheck;

import fi.vm.sade.eperusteet.service.exception.DokumenttiException;
import fi.vm.sade.eperusteet.service.mapping.Dto;
import fi.vm.sade.eperusteet.service.mapping.DtoMapper;
Expand Down Expand Up @@ -64,7 +64,6 @@ public class DokumenttiServiceImpl implements DokumenttiService {

@Override
@Transactional(propagation = Propagation.REQUIRES_NEW)
@IgnorePerusteUpdateCheck
public DokumenttiDto createDtoFor(
long id,
Kieli kieli,
Expand Down Expand Up @@ -94,14 +93,12 @@ public DokumenttiDto createDtoFor(

@Override
@Transactional(readOnly = true)
@IgnorePerusteUpdateCheck
public DokumenttiDto findLatest(Long id, Kieli kieli, Suoritustapakoodi suoritustapakoodi) {
return findLatest(id, kieli, suoritustapakoodi, null);
}

@Override
@Transactional(readOnly = true)
@IgnorePerusteUpdateCheck
public DokumenttiDto findLatest(Long id, Kieli kieli, Suoritustapakoodi suoritustapakoodi, GeneratorVersion version) {
Dokumentti dokumentti;

Expand Down Expand Up @@ -133,7 +130,6 @@ public DokumenttiDto findLatest(Long id, Kieli kieli, Suoritustapakoodi suoritus

@Override
@Transactional(readOnly = true)
@IgnorePerusteUpdateCheck
public DokumenttiDto getJulkaistuDokumentti(Long perusteId, Kieli kieli, Integer revision) {
Peruste peruste = perusteRepository.findOne(perusteId);

Expand Down Expand Up @@ -161,14 +157,12 @@ public DokumenttiDto getJulkaistuDokumentti(Long perusteId, Kieli kieli, Integer

@Override
@Transactional(noRollbackFor = DokumenttiException.class, propagation = Propagation.REQUIRES_NEW)
@IgnorePerusteUpdateCheck
public void generateWithDto(DokumenttiDto dto) throws DokumenttiException {
generateWithDto(dto, null);
}

@Override
@Transactional(noRollbackFor = DokumenttiException.class, propagation = Propagation.REQUIRES_NEW)
@IgnorePerusteUpdateCheck
public void generateWithDto(DokumenttiDto dto, PerusteKaikkiDto perusteDto) throws DokumenttiException {
dto.setTila(DokumenttiTila.LUODAAN);
dokumenttiStateService.save(dto);
Expand All @@ -186,7 +180,6 @@ public void generateWithDto(DokumenttiDto dto, PerusteKaikkiDto perusteDto) thro

@Override
@Transactional(readOnly = true)
@IgnorePerusteUpdateCheck
public byte[] get(Long id) {
Dokumentti dokumentti = dokumenttiRepository.findById(id).orElse(null);

Expand All @@ -209,7 +202,6 @@ public byte[] get(Long id) {

@Override
@Transactional
@IgnorePerusteUpdateCheck
public Long getDokumenttiId(Long perusteId, Kieli kieli, Suoritustapakoodi suoritustapakoodi, GeneratorVersion generatorVersion) {
Sort sort = Sort.by(Sort.Direction.DESC, "valmistumisaika");

Expand Down Expand Up @@ -239,7 +231,6 @@ public Long getDokumenttiId(Long perusteId, Kieli kieli, Suoritustapakoodi suori

@Override
@Transactional(propagation = Propagation.REQUIRES_NEW)
@IgnorePerusteUpdateCheck
public void setStarted(DokumenttiDto dto) {
dto.setAloitusaika(new Date());
dto.setLuoja(SecurityUtil.getAuthenticatedPrincipal().getName());
Expand All @@ -249,7 +240,6 @@ public void setStarted(DokumenttiDto dto) {

@Override
@Transactional(readOnly = true)
@IgnorePerusteUpdateCheck
public DokumenttiDto query(Long id) {
Dokumentti dokumentti = dokumenttiRepository.findById(id).orElse(null);
DokumenttiDto dto = mapper.map(dokumentti, DokumenttiDto.class);
Expand All @@ -274,7 +264,6 @@ public DokumenttiDto query(Long id) {

@Override
@Transactional
@IgnorePerusteUpdateCheck
public void updateDokumenttiPdfData(byte[] data, Long dokumenttiId) {
Optional<Dokumentti> optionalDokumentti = dokumenttiRepository.findById(dokumenttiId);
if (optionalDokumentti.isPresent()) {
Expand All @@ -288,7 +277,6 @@ public void updateDokumenttiPdfData(byte[] data, Long dokumenttiId) {

@Override
@Transactional
@IgnorePerusteUpdateCheck
public void updateDokumenttiTila(DokumenttiTila tila, Long dokumenttiId) {
Optional<Dokumentti> optionalDokumentti = dokumenttiRepository.findById(dokumenttiId);
if (optionalDokumentti.isPresent()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import fi.vm.sade.eperusteet.dto.DokumenttiDto;
import fi.vm.sade.eperusteet.repository.DokumenttiRepository;
import fi.vm.sade.eperusteet.service.dokumentti.DokumenttiStateService;
import fi.vm.sade.eperusteet.service.event.aop.IgnorePerusteUpdateCheck;

import fi.vm.sade.eperusteet.service.mapping.Dto;
import fi.vm.sade.eperusteet.service.mapping.DtoMapper;
import org.springframework.beans.factory.annotation.Autowired;
Expand All @@ -21,7 +21,7 @@ public class DokumenttiStateServiceImpl implements DokumenttiStateService {
@Autowired
private DtoMapper mapper;

@IgnorePerusteUpdateCheck

@Transactional
public DokumenttiDto save(DokumenttiDto dto) {
Dokumentti dokumentti = mapper.map(dto, Dokumentti.class);
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit fa24eaf

Please sign in to comment.