merge develop to SI-685
diff --git a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/config/FESettings.java b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/config/FESettings.java
index bb1aa63..b9e03b3 100644
--- a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/config/FESettings.java
+++ b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/config/FESettings.java
@@ -2,13 +2,10 @@
import lombok.Getter;
import lombok.Setter;
-import lombok.extern.log4j.Log4j2;
import org.eclipse.openk.gridfailureinformation.config.rabbitMq.RabbitMqChannel;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.PropertySource;
-import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.List;
diff --git a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/config/rabbitMq/RabbitMqConfig.java b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/config/rabbitMq/RabbitMqConfig.java
index 8939a31..53922ae 100644
--- a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/config/rabbitMq/RabbitMqConfig.java
+++ b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/config/rabbitMq/RabbitMqConfig.java
@@ -2,14 +2,16 @@
import lombok.Data;
import lombok.extern.log4j.Log4j2;
-import org.eclipse.openk.gridfailureinformation.config.rabbitMq.RabbitMqChannel;
-import org.eclipse.openk.gridfailureinformation.config.rabbitMq.RabbitMqProperties;
-import org.springframework.amqp.core.*;
+import org.springframework.amqp.core.BindingBuilder;
+import org.springframework.amqp.core.DirectExchange;
+import org.springframework.amqp.core.Queue;
import org.springframework.amqp.rabbit.annotation.EnableRabbit;
import org.springframework.amqp.rabbit.core.RabbitAdmin;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.*;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Profile;
+
import javax.annotation.PostConstruct;
@Profile("!test")
diff --git a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/config/rabbitMq/RabbitMqProperties.java b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/config/rabbitMq/RabbitMqProperties.java
index 8c60131..a255897 100644
--- a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/config/rabbitMq/RabbitMqProperties.java
+++ b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/config/rabbitMq/RabbitMqProperties.java
@@ -2,9 +2,9 @@
import lombok.Getter;
import lombok.Setter;
-import org.eclipse.openk.gridfailureinformation.config.rabbitMq.RabbitMqChannel;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
+
import java.util.ArrayList;
import java.util.List;
diff --git a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/controller/FailureTypeController.java b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/controller/FailureTypeController.java
deleted file mode 100644
index cf34d73..0000000
--- a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/controller/FailureTypeController.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- *******************************************************************************
- * Copyright (c) 2019 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v. 2.0 which is available at
- * http://www.eclipse.org/legal/epl-2.0.
- *
- * SPDX-License-Identifier: EPL-2.0
- *******************************************************************************
- */
-package org.eclipse.openk.gridfailureinformation.controller;
-
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiResponse;
-import io.swagger.annotations.ApiResponses;
-import lombok.extern.log4j.Log4j2;
-import org.eclipse.openk.gridfailureinformation.service.FailureTypeService;
-import org.eclipse.openk.gridfailureinformation.viewmodel.FailureTypeDto;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.annotation.Secured;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import java.util.List;
-
-@Log4j2
-@RestController
-@RequestMapping("/failure-types")
-public class FailureTypeController {
-
- @Autowired
- private FailureTypeService failureTypeService;
-
- @Secured({"ROLE_GRID-FAILURE-ADMIN", "ROLE_GRID-FAILURE-READER", "ROLE_GRID-FAILURE-CREATOR", "ROLE_GRID-FAILURE-QUALIFIER", "ROLE_GRID-FAILURE-PUBLISHER"})
- @ApiOperation(value = "Anzeigen aller Störungsmeldungstypen")
- @ApiResponses(value = {@ApiResponse(code = 200, message = "Erfolgreich durchgeführt")})
- @GetMapping
- public List<FailureTypeDto> findBranches() {
- return failureTypeService.getFailureTypes();
- }
-}
diff --git a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/mapper/FailureInformationMapper.java b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/mapper/FailureInformationMapper.java
index be1ad8f..e3a8d09 100644
--- a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/mapper/FailureInformationMapper.java
+++ b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/mapper/FailureInformationMapper.java
@@ -32,8 +32,6 @@
@Mappings({
@Mapping(source = "refFailureClassification.uuid", target = "failureClassificationId"),
@Mapping(source = "refFailureClassification.classification", target = "failureClassification"),
- @Mapping(source = "refFailureType.uuid", target = "failureTypeId"),
- @Mapping(source = "refFailureType.type", target = "failureType"),
@Mapping(source = "refStatusIntern.uuid", target = "statusInternId"),
@Mapping(source = "refStatusIntern.status", target = "statusIntern"),
@Mapping(source = "refStatusExtern.uuid", target = "statusExternId"),
@@ -53,8 +51,6 @@
@Mappings({
@Mapping(target = "refFailureClassification.uuid", source = "failureClassificationId"),
@Mapping(target = "refFailureClassification.classification", source = "failureClassification"),
- @Mapping(target = "refFailureType.uuid", source = "failureTypeId"),
- @Mapping(target = "refFailureType.type", source = "failureType"),
@Mapping(target = "refStatusIntern.uuid", source = "statusInternId"),
@Mapping(target = "refStatusIntern.status", source = "statusIntern"),
@Mapping(target = "refStatusExtern.uuid", source = "statusExternId"),
diff --git a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/mapper/FailureTypeMapper.java b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/mapper/FailureTypeMapper.java
deleted file mode 100644
index fc8b412..0000000
--- a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/mapper/FailureTypeMapper.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- *******************************************************************************
- * Copyright (c) 2019 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v. 2.0 which is available at
- * http://www.eclipse.org/legal/epl-2.0.
- *
- * SPDX-License-Identifier: EPL-2.0
- *******************************************************************************
- */
-package org.eclipse.openk.gridfailureinformation.mapper;
-
-import org.eclipse.openk.gridfailureinformation.model.RefFailureType;
-import org.eclipse.openk.gridfailureinformation.viewmodel.FailureTypeDto;
-import org.mapstruct.Mapper;
-import org.mapstruct.ReportingPolicy;
-
-@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE)
-public interface FailureTypeMapper {
-
- FailureTypeDto toFailureTypeDto(RefFailureType refFailureType);
-
- RefFailureType toRefFailureType(FailureTypeDto failureTypeDto);
-}
diff --git a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/mapper/HistFailureInformationMapper.java b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/mapper/HistFailureInformationMapper.java
index 68c8351..7f34cf4 100644
--- a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/mapper/HistFailureInformationMapper.java
+++ b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/mapper/HistFailureInformationMapper.java
@@ -26,8 +26,6 @@
@Mappings({
@Mapping(source = "refFailureClassification.uuid", target = "failureClassificationId"),
@Mapping(source = "refFailureClassification.classification", target = "failureClassification"),
- @Mapping(source = "refFailureType.uuid", target = "failureTypeId"),
- @Mapping(source = "refFailureType.type", target = "failureType"),
@Mapping(source = "refStatusIntern.uuid", target = "statusInternId"),
@Mapping(source = "refStatusIntern.status", target = "statusIntern"),
@Mapping(source = "refStatusExtern.uuid", target = "statusExternId"),
@@ -45,8 +43,6 @@
@Mappings({
@Mapping(target = "refFailureClassification.uuid", source = "failureClassificationId"),
@Mapping(target = "refFailureClassification.classification", source = "failureClassification"),
- @Mapping(target = "refFailureType.uuid", source = "failureTypeId"),
- @Mapping(target = "refFailureType.type", source = "failureType"),
@Mapping(target = "refStatusIntern.uuid", source = "statusInternId"),
@Mapping(target = "refStatusIntern.status", source = "statusIntern"),
@Mapping(target = "refStatusExtern.uuid", source = "statusExternId"),
diff --git a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/model/HtblFailureInformation.java b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/model/HtblFailureInformation.java
index 7e6a7a7..29cd414 100644
--- a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/model/HtblFailureInformation.java
+++ b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/model/HtblFailureInformation.java
@@ -50,7 +50,6 @@
private Date failureBegin;
private Date failureEndPlanned;
private Date failureEndResupplied;
- private String internalRemark;
private String postcode;
private String city;
private String district;
@@ -87,10 +86,6 @@
private RefFailureClassification refFailureClassification;
@ManyToOne
- @JoinColumn( name = "fk_ref_failure_type")
- private RefFailureType refFailureType;
-
- @ManyToOne
@JoinColumn( name = "fk_ref_status_intern")
private RefStatus refStatusIntern;
diff --git a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/model/RefFailureType.java b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/model/RefFailureType.java
deleted file mode 100644
index c5afecd..0000000
--- a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/model/RefFailureType.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- *******************************************************************************
- * Copyright (c) 2019 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v. 2.0 which is available at
- * http://www.eclipse.org/legal/epl-2.0.
- *
- * SPDX-License-Identifier: EPL-2.0
- *******************************************************************************
-*/
-package org.eclipse.openk.gridfailureinformation.model;
-
-import lombok.Data;
-
-import javax.persistence.*;
-import java.util.UUID;
-
-@Data
-@Entity
-public class RefFailureType {
- @Id
- @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "ref_failure_type_id_seq")
- @SequenceGenerator(name = "ref_failure_type_id_seq", sequenceName = "ref_failure_type_id_seq", allocationSize = 1)
- @Column(name = "id", updatable = false)
- private Long id;
- private UUID uuid;
- private String type;
- private String description;
-}
diff --git a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/model/TblFailureInformation.java b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/model/TblFailureInformation.java
index 3ae1c6b..9c40084 100644
--- a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/model/TblFailureInformation.java
+++ b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/model/TblFailureInformation.java
@@ -47,7 +47,6 @@
private Date failureBegin;
private Date failureEndPlanned;
private Date failureEndResupplied;
- private String internalRemark;
private String postcode;
private String city;
private String district;
@@ -85,10 +84,6 @@
private RefFailureClassification refFailureClassification;
@ManyToOne
- @JoinColumn( name = "fk_ref_failure_type")
- private RefFailureType refFailureType;
-
- @ManyToOne
@JoinColumn( name = "fk_ref_status_intern")
private RefStatus refStatusIntern;
diff --git a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/model/TblFailureInformationPublicationChannel.java b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/model/TblFailureInformationPublicationChannel.java
index d4a634f..3be8bc6 100644
--- a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/model/TblFailureInformationPublicationChannel.java
+++ b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/model/TblFailureInformationPublicationChannel.java
@@ -15,8 +15,8 @@
package org.eclipse.openk.gridfailureinformation.model;
import lombok.Data;
+
import javax.persistence.*;
-import javax.validation.constraints.NotNull;
@Data
@Entity
diff --git a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/repository/FailureInformationPublicationChannelRepository.java b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/repository/FailureInformationPublicationChannelRepository.java
index 6ec9a47..481e0bd 100644
--- a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/repository/FailureInformationPublicationChannelRepository.java
+++ b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/repository/FailureInformationPublicationChannelRepository.java
@@ -18,8 +18,8 @@
import org.eclipse.openk.gridfailureinformation.model.TblFailureInformation;
import org.eclipse.openk.gridfailureinformation.model.TblFailureInformationPublicationChannel;
import org.springframework.data.jpa.repository.JpaRepository;
-import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Repository;
+
import java.util.List;
@Repository
diff --git a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/repository/FailureTypeRepository.java b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/repository/FailureTypeRepository.java
deleted file mode 100644
index 61cc31e..0000000
--- a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/repository/FailureTypeRepository.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- *******************************************************************************
- * Copyright (c) 2019 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v. 2.0 which is available at
- * http://www.eclipse.org/legal/epl-2.0.
- *
- * SPDX-License-Identifier: EPL-2.0
- *******************************************************************************
- */
-
-package org.eclipse.openk.gridfailureinformation.repository;
-
-import org.eclipse.openk.gridfailureinformation.model.RefFailureType;
-import org.springframework.data.jpa.repository.JpaRepository;
-import org.springframework.stereotype.Repository;
-
-import java.util.List;
-import java.util.Optional;
-import java.util.UUID;
-
-@Repository
-public interface FailureTypeRepository extends JpaRepository<RefFailureType, Long > {
-
- List<RefFailureType> findAll();
-
- Optional<RefFailureType> findByUuid(UUID uuid);
-}
diff --git a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/service/ExportService.java b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/service/ExportService.java
index 301c6f7..bceae11 100644
--- a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/service/ExportService.java
+++ b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/service/ExportService.java
@@ -238,7 +238,7 @@
return body;
}
- protected void createContentReplaceHashMap(TblFailureInformation tblFailureInfo){
+ protected void createContentReplaceHashMap(TblFailureInformation tblFailureInfo){ // NOSONAR
DistributionTextPlaceholderDto placeholderDto = resourceConfig.placeholderLoader();
@@ -249,11 +249,6 @@
contentReplaceMap.put(placeholderDto.getFailureClassification(), failureClassification.getClassification());
}
- RefFailureType failureType = tblFailureInfo.getRefFailureType();
- if (failureType != null) {
- contentReplaceMap.put(placeholderDto.getFailureType(), failureType.getType());
- }
-
String responsibility = tblFailureInfo.getResponsibility();
if (responsibility != null) {
contentReplaceMap.put(placeholderDto.getResponsibility(), responsibility);
@@ -320,11 +315,6 @@
contentReplaceMap.put(placeholderDto.getExpectedReason(), expectedReason.getText());
}
- String internalRemark = tblFailureInfo.getInternalRemark();
- if (internalRemark != null) {
- contentReplaceMap.put(placeholderDto.getInternalRemark(), internalRemark);
- }
-
String postcode = tblFailureInfo.getPostcode();
if (postcode != null) {
contentReplaceMap.put(placeholderDto.getPostcode(), postcode);
diff --git a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/service/FailureInformationService.java b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/service/FailureInformationService.java
index c279114..6e536ab 100644
--- a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/service/FailureInformationService.java
+++ b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/service/FailureInformationService.java
@@ -64,9 +64,6 @@
private FailureClassificationRepository failureClassificationRepository;
@Autowired
- private FailureTypeRepository failureTypeRepository;
-
- @Autowired
private RadiusRepository radiusRepository;
@Autowired
@@ -223,7 +220,6 @@
resolveBranch(destTblFailureInformation, sourceDto);
resolveFailureClassification(destTblFailureInformation, sourceDto);
- resolveFailureType(destTblFailureInformation, sourceDto);
resolveStatii(destTblFailureInformation, sourceDto);
resolveRadius(destTblFailureInformation, sourceDto);
resolveExpectedReason(destTblFailureInformation, sourceDto);
@@ -254,7 +250,7 @@
stationList.add(stationRepository.findByUuid(stationUuid).orElseThrow(() -> new NotFoundException("station.uuid.not.existing")));
}
- destTblFailureInformation.setStations(stationList);
+ destTblFailureInformation.setStations(stationList.stream().collect(Collectors.toSet()));
}
}
@@ -264,17 +260,6 @@
for (UUID distributionGroupUuid : sourceDto.getDistributionGroupUuids()) {
distributionGroupList.add(distributionGroupRepository.findByUuid(distributionGroupUuid).orElseThrow(() -> new NotFoundException("distribution.group.uuid.not.existing")));
}
-
- destTblFailureInformation.setDistributionGroups(distributionGroupList);
- }
-
-
- private void resolveFailureType(TblFailureInformation destTblFailureInformation, FailureInformationDto sourceDto) {
- destTblFailureInformation.setRefFailureType(
- sourceDto.getFailureTypeId() != null ?
- failureTypeRepository.findByUuid(sourceDto.getFailureTypeId())
- .orElseThrow(() -> new NotFoundException("failure.type.uuid.not.existing"))
- : null );
}
private void resolveCondensed(TblFailureInformation destTblFailureInformation, FailureInformationDto sourceDto) {
@@ -354,8 +339,6 @@
protected void updatePublicationChannels(FailureInformationDto sourceDto, TblFailureInformation destTblFailureInformation ){
- if( sourceDto.getStationIds() != null ) {
- Set<TblStation> stationList = new HashSet<>();
// Löschen zugeordneter Kanäle mit published = false
TblFailureInformation existingTblFailureInformation = failureInformationRepository.findByUuid(sourceDto.getUuid())
.orElseThrow(() -> new NotFoundException(Constants.FAILURE_INFO_UUID_NOT_EXISTING));
diff --git a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/service/FailureTypeService.java b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/service/FailureTypeService.java
deleted file mode 100644
index 6c0c4bf..0000000
--- a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/service/FailureTypeService.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- *******************************************************************************
- * Copyright (c) 2019 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v. 2.0 which is available at
- * http://www.eclipse.org/legal/epl-2.0.
- *
- * SPDX-License-Identifier: EPL-2.0
- *******************************************************************************
-*/
-package org.eclipse.openk.gridfailureinformation.service;
-
-
-import org.eclipse.openk.gridfailureinformation.mapper.FailureTypeMapper;
-import org.eclipse.openk.gridfailureinformation.repository.FailureTypeRepository;
-import org.eclipse.openk.gridfailureinformation.viewmodel.FailureTypeDto;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import java.util.List;
-import java.util.stream.Collectors;
-
-
-@Service
-public class FailureTypeService {
-
- @Autowired
- private FailureTypeRepository failureTypeRepository;
-
- @Autowired
- private FailureTypeMapper failureTypeMapper;
-
-
- public List<FailureTypeDto> getFailureTypes() {
-
- return failureTypeRepository.findAll().stream()
- .map( failureTypeMapper::toFailureTypeDto )
- .collect(Collectors.toList());
- }
-
-}
diff --git a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/service/HistFailureInformationService.java b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/service/HistFailureInformationService.java
index 783dc9f..7dc6307 100644
--- a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/service/HistFailureInformationService.java
+++ b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/service/HistFailureInformationService.java
@@ -18,7 +18,10 @@
import org.eclipse.openk.gridfailureinformation.exceptions.NotFoundException;
import org.eclipse.openk.gridfailureinformation.mapper.HistFailureInformationMapper;
import org.eclipse.openk.gridfailureinformation.model.HtblFailureInformation;
-import org.eclipse.openk.gridfailureinformation.repository.*;
+import org.eclipse.openk.gridfailureinformation.repository.BranchRepository;
+import org.eclipse.openk.gridfailureinformation.repository.FailureClassificationRepository;
+import org.eclipse.openk.gridfailureinformation.repository.HistFailureInformationRepository;
+import org.eclipse.openk.gridfailureinformation.repository.StatusRepository;
import org.eclipse.openk.gridfailureinformation.viewmodel.FailureInformationDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -44,9 +47,6 @@
private FailureClassificationRepository failureClassificationRepository;
@Autowired
- private FailureTypeRepository failureTypeRepository;
-
- @Autowired
private StatusRepository statusRepository;
public List<FailureInformationDto> getFailureInformationVersionsByUuid(UUID uuid ) {
diff --git a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/service/SettingsService.java b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/service/SettingsService.java
index 06d8cef..b69eb45 100644
--- a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/service/SettingsService.java
+++ b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/service/SettingsService.java
@@ -23,7 +23,6 @@
import java.util.LinkedList;
import java.util.List;
-import java.util.stream.Collectors;
@Service
@Log4j2
diff --git a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/viewmodel/FESettingsDto.java b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/viewmodel/FESettingsDto.java
index cafc716..e02af47 100644
--- a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/viewmodel/FESettingsDto.java
+++ b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/viewmodel/FESettingsDto.java
@@ -15,7 +15,6 @@
package org.eclipse.openk.gridfailureinformation.viewmodel;
import lombok.Data;
-import org.eclipse.openk.gridfailureinformation.config.rabbitMq.RabbitMqChannel;
import java.io.Serializable;
import java.util.List;
diff --git a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/viewmodel/FailureTypeDto.java b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/viewmodel/FailureTypeDto.java
deleted file mode 100644
index 691a84d..0000000
--- a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/viewmodel/FailureTypeDto.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- *******************************************************************************
- * Copyright (c) 2019 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v. 2.0 which is available at
- * http://www.eclipse.org/legal/epl-2.0.
- *
- * SPDX-License-Identifier: EPL-2.0
- *******************************************************************************
- */
-package org.eclipse.openk.gridfailureinformation.viewmodel;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-import lombok.Data;
-
-import java.io.Serializable;
-import java.util.UUID;
-
-@Data
-public class FailureTypeDto implements Serializable {
- @JsonProperty("id")
- private UUID uuid;
- private String type;
- private String description;
-}
diff --git a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/viewmodel/RabbitMqMessageDto.java b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/viewmodel/RabbitMqMessageDto.java
index 86aff3d..1b44912 100644
--- a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/viewmodel/RabbitMqMessageDto.java
+++ b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/viewmodel/RabbitMqMessageDto.java
@@ -16,10 +16,7 @@
import lombok.Data;
-import javax.validation.Valid;
import javax.validation.constraints.NotNull;
-import javax.validation.constraints.Pattern;
-import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.List;
diff --git a/gfsBackendService/src/main/resources/DistributionTextPlaceholder.json b/gfsBackendService/src/main/resources/DistributionTextPlaceholder.json
index 6fc01f6..f609981 100644
--- a/gfsBackendService/src/main/resources/DistributionTextPlaceholder.json
+++ b/gfsBackendService/src/main/resources/DistributionTextPlaceholder.json
@@ -1,6 +1,5 @@
{
"failureClassification": "$Klassifikation$",
- "failureType": "$Typ$",
"responsibility": "$Zuständigkeit$",
"internExtern": "$Meldung_intern$",
"statusIntern": "$Status_intern$",
diff --git a/gfsBackendService/src/main/resources/db/migration/V0_35__CREATE_GFI_DB.sql b/gfsBackendService/src/main/resources/db/migration/V0_35__CREATE_GFI_DB.sql
new file mode 100644
index 0000000..c0add31
--- /dev/null
+++ b/gfsBackendService/src/main/resources/db/migration/V0_35__CREATE_GFI_DB.sql
@@ -0,0 +1,801 @@
+-----------------------------------------------------------------------------------
+-- *******************************************************************************
+-- * Copyright (c) 2019 Contributors to the Eclipse Foundation
+-- *
+-- * See the NOTICE file(s) distributed with this work for additional
+-- * information regarding copyright ownership.
+-- *
+-- * This program and the accompanying materials are made available under the
+-- * terms of the Eclipse Public License v. 2.0 which is available at
+-- * http://www.eclipse.org/legal/epl-2.0.
+-- *
+-- * SPDX-License-Identifier: EPL-2.0
+-- *******************************************************************************
+-----------------------------------------------------------------------------------
+-- CREATE ROLE GFI_SERVICE LOGIN
+-- NOSUPERUSER INHERIT NOCREATEDB NOCREATEROLE NOREPLICATION;
+-- ALTER ROLE GFI_SERVICE with password 'gfi_service';
+
+DROP TABLE IF EXISTS public.VERSION CASCADE;
+DROP TABLE IF EXISTS public.TBL_FAILURE_INFORMATION CASCADE;
+DROP SEQUENCE IF EXISTS public.TBL_FAILURE_INFORMATION_ID_SEQ;
+
+DROP TABLE IF EXISTS public.REF_STATUS CASCADE;
+DROP SEQUENCE IF EXISTS public.REF_STATUS_ID_SEQ;
+
+DROP TABLE IF EXISTS public.REF_BRANCH CASCADE;
+DROP SEQUENCE IF EXISTS public.REF_BRANCH_ID_SEQ;
+
+DROP TABLE IF EXISTS public.REF_FAILURE_CLASSIFICATION CASCADE;
+DROP SEQUENCE IF EXISTS public.REF_FAILURE_CLASSIFICATION_ID_SEQ;
+
+DROP TABLE IF EXISTS public.REF_FAILURE_TYPE CASCADE;
+DROP SEQUENCE IF EXISTS public.REF_FAILURE_TYPE_ID_SEQ;
+
+DROP TABLE IF EXISTS public.REF_RADIUS CASCADE;
+DROP SEQUENCE IF EXISTS public.REF_RADIUS_ID_SEQ;
+
+DROP TABLE IF EXISTS public.REF_EXPECTED_REASON CASCADE;
+DROP SEQUENCE IF EXISTS public.REF_EXPECTED_REASON_ID_SEQ;
+
+DROP TABLE IF EXISTS public.TBL_IMPORT_DATA CASCADE;
+DROP SEQUENCE IF EXISTS public.TBL_IMPORT_DATA_ID_SEQ;
+
+DROP TABLE IF EXISTS public.TBL_DISTRIBUTION_GROUP_MEMBER CASCADE;
+DROP SEQUENCE IF EXISTS public.TBL_DISTRIBUTION_GROUP_MEMBER_ID_SEQ;
+
+DROP TABLE IF EXISTS public.TBL_DISTRIBUTION_GROUP CASCADE;
+DROP SEQUENCE IF EXISTS public.TBL_DISTRIBUTION_GROUP_ID_SEQ;
+
+DROP TABLE IF EXISTS public.TBL_FAILURE_INFORMATION_DISTRIBUTION_GROUP CASCADE;
+DROP SEQUENCE IF EXISTS public.TBL_FAILURE_INFORMATION_DISTRIBUTION_GROUP_ID_SEQ;
+
+DROP TABLE IF EXISTS public.TBL_FAILURE_INFORMATION_PUBLICATION_CHANNEL;
+DROP SEQUENCE IF EXISTS public.TBL_FAILURE_INFORMATION_PUBLICATION_CHANNEL_SEQ
+
+-- ---------------------------------------------
+-- TABLE VERSION
+-- ---------------------------------------------
+CREATE TABLE public.VERSION
+(
+ ID integer NOT NULL,
+ VERSION character varying(50) NOT NULL,
+ CONSTRAINT REF_VERSION_PKEY PRIMARY KEY (id)
+);
+
+ALTER TABLE public.VERSION
+ OWNER TO GFI_SERVICE;
+GRANT ALL ON TABLE public.VERSION TO GFI_SERVICE;
+
+INSERT INTO public.VERSION (ID, VERSION) VALUES ( 1, '00-DEV' );
+
+-- ---------------------------------------------
+-- TABLE REF_STATUS
+-- ---------------------------------------------
+CREATE SEQUENCE public.ref_status_id_seq
+ INCREMENT 1
+ MINVALUE 1
+ MAXVALUE 9223372036854775807
+ START 1
+ CACHE 1;
+ALTER TABLE public.ref_status_id_seq
+ OWNER TO GFI_SERVICE;
+
+CREATE TABLE public.REF_STATUS
+(
+ ID integer NOT NULL DEFAULT nextval('REF_STATUS_ID_SEQ'::regclass),
+ UUID uuid NOT NULL,
+ STATUS character varying(50) NOT NULL,
+ IS_INTERNAL boolean NOT NULL,
+ IS_EXTERNAL boolean NOT NULL,
+ CONSTRAINT REF_STATUS_PKEY PRIMARY KEY (id)
+);
+
+ALTER TABLE public.REF_STATUS
+ OWNER TO GFI_SERVICE;
+GRANT ALL ON TABLE public.REF_STATUS TO GFI_SERVICE;
+
+INSERT INTO public.REF_STATUS (ID, UUID, STATUS, IS_INTERNAL, IS_EXTERNAL) VALUES (1, 'acabc8f6-2cf3-485a-a4f8-68d178c7df45', 'neu', TRUE, FALSE );
+INSERT INTO public.REF_STATUS (ID, UUID, STATUS, IS_INTERNAL, IS_EXTERNAL) VALUES (2, 'f2e44dc5-d30c-4128-86bb-d3d5fc766b61', 'geplant', TRUE, TRUE );
+INSERT INTO public.REF_STATUS (ID, UUID, STATUS, IS_INTERNAL, IS_EXTERNAL) VALUES (3, '23fc0254-cc3d-4371-97ad-54ef733008ae', 'angelegt', TRUE, FALSE );
+INSERT INTO public.REF_STATUS (ID, UUID, STATUS, IS_INTERNAL, IS_EXTERNAL) VALUES (4, '74a4ca78-7268-11ea-bc55-0242ac130003', 'storniert', TRUE, FALSE );
+INSERT INTO public.REF_STATUS (ID, UUID, STATUS, IS_INTERNAL, IS_EXTERNAL) VALUES (5, '7264e572-eae9-4cca-be05-af6b0d081247', 'qualifiziert', TRUE, FALSE );
+INSERT INTO public.REF_STATUS (ID, UUID, STATUS, IS_INTERNAL, IS_EXTERNAL) VALUES (6, '9374219a-7419-4b72-899d-cd0576d85cdb', 'aktualisiert', TRUE, TRUE );
+INSERT INTO public.REF_STATUS (ID, UUID, STATUS, IS_INTERNAL, IS_EXTERNAL) VALUES (7, '8c333345-5c3c-41ed-9de4-323045f64259', 'abgeschlossen', TRUE, TRUE );
+
+
+-- ---------------------------------------------
+-- TABLE REF_FAILURE_CLASSIFICATION
+-- ---------------------------------------------
+CREATE SEQUENCE public.ref_failure_classification_id_seq
+ INCREMENT 1
+ MINVALUE 1
+ MAXVALUE 9223372036854775807
+ START 1
+ CACHE 1;
+ALTER TABLE public.ref_failure_classification_id_seq
+ OWNER TO GFI_SERVICE;
+
+CREATE TABLE public.REF_FAILURE_CLASSIFICATION
+(
+ ID integer NOT NULL DEFAULT nextval('REF_FAILURE_CLASSIFICATION_ID_SEQ'::regclass),
+ UUID uuid NOT NULL,
+ CLASSIFICATION character varying(50) NOT NULL,
+ DESCRIPTION character varying(255) NULL,
+ CONSTRAINT REF_FAILURE_CLASSIFICATION_PKEY PRIMARY KEY (id)
+);
+
+ALTER TABLE public.REF_FAILURE_CLASSIFICATION
+ OWNER TO GFI_SERVICE;
+GRANT ALL ON TABLE public.REF_FAILURE_CLASSIFICATION TO GFI_SERVICE;
+
+INSERT INTO public.REF_FAILURE_CLASSIFICATION (UUID, CLASSIFICATION, DESCRIPTION) VALUES ( '9255fb79-c57a-4448-a69c-5d57994f0c91', 'Störung', NULL );
+INSERT INTO public.REF_FAILURE_CLASSIFICATION (UUID, CLASSIFICATION, DESCRIPTION) VALUES ( '8ec1e144-5230-4d43-a3df-f62dd64bb855', 'geplante Maßnahme', NULL );
+
+-- ---------------------------------------------
+-- TABLE REF_BRANCH
+-- ---------------------------------------------
+CREATE SEQUENCE public.ref_branch_id_seq
+ INCREMENT 1
+ MINVALUE 1
+ MAXVALUE 9223372036854775807
+ START 1
+ CACHE 1;
+ALTER TABLE public.ref_branch_id_seq
+ OWNER TO GFI_SERVICE;
+
+CREATE TABLE public.REF_BRANCH
+(
+ ID integer NOT NULL DEFAULT nextval('REF_BRANCH_ID_SEQ'::regclass),
+ UUID uuid NOT NULL,
+ NAME character varying(50) NOT NULL,
+ DESCRIPTION character varying(255),
+ COLOR_CODE character varying(20),
+ CONSTRAINT REF_BRANCH_PKEY PRIMARY KEY (id)
+);
+
+ALTER TABLE public.REF_BRANCH
+ OWNER TO GFI_SERVICE;
+GRANT ALL ON TABLE public.REF_BRANCH TO GFI_SERVICE;
+
+INSERT INTO public.ref_branch(uuid, name, description, color_code) VALUES ('535b4beb-9b17-4247-bb8b-26bd01b48f9a', 'S', 'Strom', '#fc6042');
+INSERT INTO public.ref_branch(uuid, name, description, color_code) VALUES ('d41f54e5-c4df-440e-b334-40e8f3a6854a', 'G', 'Gas', '#fdea64');
+INSERT INTO public.ref_branch(uuid, name, description, color_code) VALUES ('62c6d361-96a0-41cc-bda1-4e58ad16f21a', 'F', 'Fernwärme', '#2cc990');
+INSERT INTO public.ref_branch(uuid, name, description, color_code) VALUES ('d8d93e0e-5c8c-4ab8-9625-f820de55ee7c', 'W', 'Wasser', '#2c82c9');
+INSERT INTO public.ref_branch(uuid, name, description, color_code) VALUES ('7d4907fb-cb3f-4a4f-93e9-839052e76894', 'TK', 'Telekommunikation', '#ff33cc');
+INSERT INTO public.ref_branch(uuid, name, description, color_code) VALUES ('014c4a2a-3cf1-4d28-af70-4573722bceb0', 'ST', 'Sekundärtechnik', '#9933ff');
+INSERT INTO public.ref_branch(uuid, name, description, color_code) VALUES ('8fb3c764-8fb5-11ea-bc55-0242ac130003', 'OS', 'ohne Sparte', '#ffffff');
+
+
+-- ---------------------------------------------
+-- TABLE REF_EXPECTED_REASON
+-- ---------------------------------------------
+CREATE SEQUENCE public.ref_expected_reason_id_seq
+ INCREMENT 1
+ MINVALUE 1
+ MAXVALUE 9223372036854775807
+ START 1
+ CACHE 1;
+ALTER TABLE public.ref_expected_reason_id_seq
+ OWNER TO GFI_SERVICE;
+
+CREATE TABLE public.REF_EXPECTED_REASON
+(
+ ID integer NOT NULL DEFAULT nextval('REF_EXPECTED_REASON_ID_SEQ'::regclass),
+ UUID uuid NOT NULL,
+ TEXT character varying(100) NOT NULL,
+ DESCRIPTION character varying(255) NULL,
+ BRANCHES character varying(100) NOT NULL,
+ CONSTRAINT REF_EXPECTED_REASON_PKEY PRIMARY KEY (id)
+);
+
+ALTER TABLE public.REF_EXPECTED_REASON
+ OWNER TO GFI_SERVICE;
+GRANT ALL ON TABLE public.REF_EXPECTED_REASON TO GFI_SERVICE;
+
+INSERT INTO public.ref_expected_reason(uuid, text, description, branches) VALUES ('27a07918-6aa0-11ea-bc55-0242ac130003', 'Defekt technische Anlage', 'Dies ist die Beschreibung für: Defekt technische Anlage', 'S,G,W,F,OS');
+INSERT INTO public.ref_expected_reason(uuid, text, description, branches) VALUES ('27a07c42-6aa0-11ea-bc55-0242ac130003', 'Kabelfehler Mittelspannung', 'Dies ist die Beschreibung für: Kabelfehler Mittelspannung', 'S');
+INSERT INTO public.ref_expected_reason(uuid, text, description, branches) VALUES ('27a07d50-6aa0-11ea-bc55-0242ac130003', 'Kabelfehler Niederspannung', 'Dies ist die Beschreibung für: Kabelfehler Niederspannung', 'S');
+INSERT INTO public.ref_expected_reason(uuid, text, description, branches) VALUES ('27a07e22-6aa0-11ea-bc55-0242ac130003', 'Leitung beschädigt', 'Dies ist die Beschreibung für: Leitung beschädigt', 'S,G,W,F');
+INSERT INTO public.ref_expected_reason(uuid, text, description, branches) VALUES ('27a07eea-6aa0-11ea-bc55-0242ac130003', 'noch nicht bekannt', 'Dies ist die Beschreibung für: noch nicht bekannt', 'G,W,TK,ST,F,OS');
+INSERT INTO public.ref_expected_reason(uuid, text, description, branches) VALUES ('27a07fbc-6aa0-11ea-bc55-0242ac130003', 'Wasserrohrbruch', 'Dies ist die Beschreibung für: Wasserrohrbruch', 'W');
+INSERT INTO public.ref_expected_reason(uuid, text, description, branches) VALUES ('27a08160-6aa0-11ea-bc55-0242ac130003', 'Überregionale Störung', 'Dies ist die Beschreibung für: Überregionale Störung', 'S,G,W,TK,ST');
+
+-- ---------------------------------------------
+-- TABLE REF_RADIUS
+-- ---------------------------------------------
+CREATE SEQUENCE public.ref_radius_id_seq
+ INCREMENT 1
+ MINVALUE 1
+ MAXVALUE 9223372036854775807
+ START 1
+ CACHE 1;
+ALTER TABLE public.ref_radius_id_seq
+ OWNER TO GFI_SERVICE;
+
+CREATE TABLE public.REF_RADIUS
+(
+ ID integer NOT NULL DEFAULT nextval('REF_RADIUS_ID_SEQ'::regclass),
+ UUID uuid NOT NULL,
+ RADIUS integer NOT NULL,
+ CONSTRAINT REF_RADIUS_PKEY PRIMARY KEY (id)
+);
+
+ALTER TABLE public.REF_RADIUS
+ OWNER TO GFI_SERVICE;
+GRANT ALL ON TABLE public.REF_RADIUS TO GFI_SERVICE;
+
+INSERT INTO public.REF_RADIUS(uuid, radius) VALUES ('e6439b49-ce5a-486e-a437-b362ec73dc44', 0);
+INSERT INTO public.REF_RADIUS(uuid, radius) VALUES ('36671000-6aa6-11ea-bc55-0242ac130003', 50);
+INSERT INTO public.REF_RADIUS(uuid, radius) VALUES ('366712a8-6aa6-11ea-bc55-0242ac130003', 100);
+INSERT INTO public.REF_RADIUS(uuid, radius) VALUES ('366713c0-6aa6-11ea-bc55-0242ac130003', 250);
+INSERT INTO public.REF_RADIUS(uuid, radius) VALUES ('3667150a-6aa6-11ea-bc55-0242ac130003', 500);
+INSERT INTO public.REF_RADIUS(uuid, radius) VALUES ('36671780-6aa6-11ea-bc55-0242ac130003', 1000);
+INSERT INTO public.REF_RADIUS(uuid, radius) VALUES ('3667187a-6aa6-11ea-bc55-0242ac130003', 1500);
+INSERT INTO public.REF_RADIUS(uuid, radius) VALUES ('36671ad2-6aa6-11ea-bc55-0242ac130003', 2000);
+
+-- ---------------------------------------------
+-- TABLE TBL_FAILURE_INFORMATION
+-- ---------------------------------------------
+CREATE SEQUENCE public.tbl_failure_information_id_seq
+ INCREMENT 1
+ MINVALUE 1
+ MAXVALUE 9223372036854775807
+ START 1
+ CACHE 1;
+ALTER TABLE public.tbl_failure_information_id_seq
+ OWNER TO GFI_SERVICE;
+
+CREATE TABLE public.TBL_FAILURE_INFORMATION
+(
+ ID integer NOT NULL DEFAULT nextval('TBL_FAILURE_INFORMATION_ID_SEQ'::regclass),
+ UUID uuid NOT NULL,
+ VERSION_NUMBER integer NOT NULL,
+ FK_REF_FAILURE_CLASSIFICATION integer,
+ TITLE character varying(255) NULL,
+ DESCRIPTION character varying(255) NULL,
+ RESPONSIBILITY character varying(255),
+ INTERN_EXTERN character varying(1),
+ FK_REF_STATUS_INTERN integer NOT NULL,
+ FK_REF_STATUS_EXTERN integer NOT NULL,
+ FK_REF_BRANCH integer NOT NULL,
+ VOLTAGE_LEVEL character varying(2),
+ PRESSURE_LEVEL character varying(2),
+ FAILURE_BEGIN timestamp NOT NULL,
+ FAILURE_END_PLANNED timestamp,
+ FAILURE_END_RESUPPLIED timestamp,
+ POSTCODE character varying(30),
+ CITY character varying(255),
+ DISTRICT character varying(255),
+ STREET character varying(255),
+ HOUSENUMBER character varying(30),
+ STATION_ID character varying (30),
+ STATION_DESCRIPTION character varying (255),
+ STATION_COORDS character varying (255),
+ FK_REF_RADIUS integer,
+ LONGITUDE numeric(9,6),
+ LATITUDE numeric(9,6),
+ FK_TBL_FAILURE_INFORMATION_CONDENSED integer,
+ CONDENSED boolean,
+ CONDENSED_COUNT integer,
+ OBJECT_REFERENCE_EXTERNAL_SYSTEM character varying (255),
+ PUBLICATION_STATUS character varying (40),
+ PUBLICATION_FREETEXT character varying (1024),
+ FK_REF_EXPECTED_REASON integer,
+ CREATE_DATE timestamp without time zone NOT NULL,
+ CREATE_USER character varying(100) NOT NULL,
+ MOD_DATE timestamp without time zone NOT NULL,
+ MOD_USER character varying(100),
+ CONSTRAINT TBL_FAILURE_INFORMATION_PKEY PRIMARY KEY (id),
+ CONSTRAINT TBL_FAIL_INF__FCLASS_FKEY FOREIGN KEY (FK_REF_FAILURE_CLASSIFICATION)
+ REFERENCES public.REF_FAILURE_CLASSIFICATION (ID) MATCH SIMPLE
+ ON UPDATE NO ACTION ON DELETE NO ACTION,
+ CONSTRAINT TBL_FAIL_INF_STATUSINT_FKEY FOREIGN KEY (FK_REF_STATUS_INTERN)
+ REFERENCES public.REF_STATUS (ID) MATCH SIMPLE
+ ON UPDATE NO ACTION ON DELETE NO ACTION,
+ CONSTRAINT TBL_FAIL_INF__STATUSEXT_FKEY FOREIGN KEY (FK_REF_STATUS_EXTERN)
+ REFERENCES public.REF_STATUS (ID) MATCH SIMPLE
+ ON UPDATE NO ACTION ON DELETE NO ACTION,
+ CONSTRAINT TBL_FAIL_INF__BRANCH_ID_FKEY FOREIGN KEY (FK_REF_BRANCH)
+ REFERENCES public.REF_BRANCH (ID) MATCH SIMPLE
+ ON UPDATE NO ACTION ON DELETE NO ACTION,
+ CONSTRAINT TBL_FAIL_INF__EXPREASON_FKEY FOREIGN KEY (FK_REF_EXPECTED_REASON)
+ REFERENCES public.REF_EXPECTED_REASON (ID) MATCH SIMPLE
+ ON UPDATE NO ACTION ON DELETE NO ACTION
+);
+
+ALTER TABLE public.TBL_FAILURE_INFORMATION
+ OWNER TO GFI_SERVICE;
+GRANT ALL ON TABLE public.TBL_FAILURE_INFORMATION TO GFI_SERVICE;
+
+INSERT INTO public.tbl_failure_information(UUID, VERSION_NUMBER, FK_REF_FAILURE_CLASSIFICATION, TITLE, DESCRIPTION, RESPONSIBILITY, INTERN_EXTERN, FK_REF_STATUS_INTERN, FK_REF_STATUS_EXTERN, FK_REF_BRANCH, VOLTAGE_LEVEL, PRESSURE_LEVEL, FAILURE_BEGIN, FAILURE_END_PLANNED, FAILURE_END_RESUPPLIED, POSTCODE, CITY, DISTRICT, STREET, HOUSENUMBER, STATION_ID, STATION_DESCRIPTION, STATION_COORDS, FK_REF_RADIUS, LONGITUDE, LATITUDE, OBJECT_REFERENCE_EXTERNAL_SYSTEM, PUBLICATION_STATUS, PUBLICATION_FREETEXT, FK_REF_EXPECTED_REASON, CONDENSED, CONDENSED_COUNT, FK_TBL_FAILURE_INFORMATION_CONDENSED, CREATE_DATE, CREATE_USER, MOD_DATE, MOD_USER)
+VALUES ('6432a9c9-0384-44af-9bb8-34f2878d7b49',3, 1, 'Stromausfall Murr', 'Es gibt einen Stromausfall im Bereich Murr/Westbezirk', 'Rolf Rudis', 'I', 1, 1, 1,'NS', null, '2021-01-19 00:00:00', '2021-01-22 00:00:00', '2021-01-22 12:00:00', '71711', 'Murr', 'Westbezirk', 'Ferdinand-Porsche-Straße', '2', '52863a', 'Trafo 1', '124,2323', 2, 9.247952, 48.955700, 'Link - extenes System', 'veröffentlicht', 'Freitext für die Veröffentlichung: Defekt an Trafostation', 1, false, 0, null, '2020-01-22 15:32:15', 'SCRIPT', '2020-01-24 08:02:44', 'SCRIPT');
+
+INSERT INTO public.tbl_failure_information(UUID, VERSION_NUMBER, FK_REF_FAILURE_CLASSIFICATION, TITLE, DESCRIPTION, RESPONSIBILITY, INTERN_EXTERN, FK_REF_STATUS_INTERN, FK_REF_STATUS_EXTERN, FK_REF_BRANCH, VOLTAGE_LEVEL, PRESSURE_LEVEL, FAILURE_BEGIN, FAILURE_END_PLANNED, FAILURE_END_RESUPPLIED, POSTCODE, CITY, DISTRICT, STREET, HOUSENUMBER, STATION_ID, STATION_DESCRIPTION, STATION_COORDS, FK_REF_RADIUS, LONGITUDE, LATITUDE, OBJECT_REFERENCE_EXTERNAL_SYSTEM, PUBLICATION_STATUS, PUBLICATION_FREETEXT, FK_REF_EXPECTED_REASON, CONDENSED, CONDENSED_COUNT, FK_TBL_FAILURE_INFORMATION_CONDENSED, CREATE_DATE, CREATE_USER, MOD_DATE, MOD_USER)
+VALUES ('37aef635-d0d4-4c47-ac25-c0d16c29e35c', 1, 2, 'Gasleck Oldenburg', 'Es gibt ein Gasleck in Oldenburg', 'Bernd Britzel', 'E', 2, 2, 3, 'NS', 'HD', '2021-05-19 00:00:00', '2021-05-22 00:00:00', '2021-05-22 12:00:00', '26133', 'Oldenburg', null, 'Cloppenburger Str.', '302', '1234863-b234', 'ertf', '124,2323', 4, 8.210150, 53.111820, 'Link - extenes System', 'nicht veröffentlicht', 'Freitext: Eine Gasleitung wurde beschädigt', 4, false, 0, null, '2020-02-03 15:15:15', 'SCRIPT', '2020-02-24 20:08:41', 'SCRIPT');
+
+
+-- ---------------------------------------------
+-- TABLE TBL_DISTRIBUTION_GROUP
+-- ---------------------------------------------
+CREATE SEQUENCE public.TBL_DISTRIBUTION_GROUP_ID_SEQ
+ INCREMENT 1
+ MINVALUE 1
+ MAXVALUE 9223372036854775807
+ START 1
+ CACHE 1;
+ALTER TABLE public.TBL_DISTRIBUTION_GROUP_ID_SEQ
+ OWNER TO GFI_SERVICE;
+
+
+CREATE TABLE public.TBL_DISTRIBUTION_GROUP
+(
+ ID integer NOT NULL DEFAULT nextval('TBL_DISTRIBUTION_GROUP_ID_SEQ'::regclass),
+ UUID uuid NOT NULL,
+ NAME character varying(255),
+ DISTRIBUTION_TEXT character varying(2048),
+ CONSTRAINT TBL_DISTRIBUTION_GROUP_PKEY PRIMARY KEY (id)
+);
+
+ALTER TABLE public.TBL_DISTRIBUTION_GROUP
+ OWNER TO GFI_SERVICE;
+GRANT ALL ON TABLE public.TBL_DISTRIBUTION_GROUP TO GFI_SERVICE;
+
+INSERT INTO public.tbl_distribution_group(UUID, NAME, DISTRIBUTION_TEXT)
+VALUES('5f5017fe-887a-11ea-bc55-0242ac130003', 'Verteiler technisch - intern', 'Subject: Die Störung (Sparte: $Sparte$) mit Beginn: $Störungsbeginn_gemeldet$ wurde in den Status veröffentlicht geändert.
+
+Body:
+Verteiler fachlich TEST
+
+Sehr geehrte Damen und Herren,
+
+die im Betreff genannte Meldung ist über folgenden Link erreichbar:
+
+$directFailureLink$
+
+Mit freundlichen Grüßen
+Ihre Admin-Meister-Team der PTA GmbH');
+
+INSERT INTO public.tbl_distribution_group(UUID, NAME, DISTRIBUTION_TEXT)
+VALUES('5f502046-887a-11ea-bc55-0242ac130003', 'Verteiler fachlich - intern', 'Subject: Die Störung (Sparte: $Sparte$) mit Beginn: $Störungsbeginn_gemeldet$ wurde in den Status veröffentlicht geändert.
+
+Body:
+Verteiler fachlich TEST
+
+Sehr geehrte Damen und Herren,
+
+die im Betreff genannte Meldung ist über folgenden Link erreichbar:
+
+$directFailureLink$
+
+Mit freundlichen Grüßen
+Ihre Admin-Meister-Team der PTA GmbH');
+
+-- ---------------------------------------------
+-- TABLE TBL_DISTRIBUTION_GROUP_MEMBER
+-- ---------------------------------------------
+CREATE SEQUENCE public.TBL_DISTRIBUTION_GROUP_MEMBER_ID_SEQ
+ INCREMENT 1
+ MINVALUE 1
+ MAXVALUE 9223372036854775807
+ START 1
+ CACHE 1;
+ALTER TABLE public.TBL_DISTRIBUTION_GROUP_MEMBER_ID_SEQ
+ OWNER TO GFI_SERVICE;
+
+CREATE TABLE public.TBL_DISTRIBUTION_GROUP_MEMBER
+(
+ ID integer NOT NULL DEFAULT nextval('TBL_DISTRIBUTION_GROUP_MEMBER_ID_SEQ'::regclass),
+ UUID uuid NOT NULL,
+ FK_TBL_DISTRIBUTION_GROUP integer NOT NULL,
+ CONTACT_ID uuid NOT NULL,
+ CONSTRAINT TBL_DISTRIBUTION_GROUP_MEMBER_PKEY PRIMARY KEY (id),
+ CONSTRAINT TBL_DIS_GRP_MEM__DIS_GRP_FKEY FOREIGN KEY (FK_TBL_DISTRIBUTION_GROUP)
+ REFERENCES public.TBL_DISTRIBUTION_GROUP (ID) MATCH SIMPLE
+ ON UPDATE NO ACTION ON DELETE NO ACTION
+ );
+
+ALTER TABLE public.TBL_DISTRIBUTION_GROUP_MEMBER
+ OWNER TO GFI_SERVICE;
+GRANT ALL ON TABLE public.TBL_DISTRIBUTION_GROUP_MEMBER TO GFI_SERVICE;
+
+
+INSERT INTO public.tbl_distribution_group_member(UUID, FK_TBL_DISTRIBUTION_GROUP, CONTACT_ID)
+VALUES('5f5021a4-887a-11ea-bc55-0242ac130003', 1, 'ae3f2ec1-ccc5-4269-a48f-dd40e37fa14e' );
+
+INSERT INTO public.tbl_distribution_group_member(UUID, FK_TBL_DISTRIBUTION_GROUP, CONTACT_ID)
+VALUES('5f50228a-887a-11ea-bc55-0242ac130003', 1, '7782179b-fb79-4370-8f71-f4c71470d006' );
+
+INSERT INTO public.tbl_distribution_group_member(UUID, FK_TBL_DISTRIBUTION_GROUP, CONTACT_ID)
+VALUES('14dcac8c-887f-11ea-bc55-0242ac130003', 1, 'fa3d981b-a7d6-4965-a623-cdbc69404153' );
+
+INSERT INTO public.tbl_distribution_group_member(UUID, FK_TBL_DISTRIBUTION_GROUP, CONTACT_ID)
+VALUES('14dcaef8-887f-11ea-bc55-0242ac130003', 2, 'c862d604-5766-43d6-a7e8-a4bac2bd01e1');
+
+INSERT INTO public.tbl_distribution_group_member(UUID, FK_TBL_DISTRIBUTION_GROUP, CONTACT_ID)
+VALUES('14dcaffc-887f-11ea-bc55-0242ac130003', 2, '8fe41b90-d10c-4a70-8fde-0990286ad3c6');
+
+
+-- ---------------------------------------------
+-- TABLE TBL_FAILURE_INFORMATION_DISTRIBUTION_GROUP
+-- ---------------------------------------------
+CREATE SEQUENCE public.tbl_failure_information_distribution_group_id_seq
+ INCREMENT 1
+ MINVALUE 1
+ MAXVALUE 9223372036854775807
+ START 1
+ CACHE 1;
+ALTER TABLE public.tbl_failure_information_distribution_group_id_seq
+ OWNER TO gfi_service;
+
+CREATE TABLE public.tbl_failure_information_distribution_group
+(
+ id integer NOT NULL DEFAULT nextval('tbl_failure_information_distribution_group_id_seq'::regclass),
+ fk_tbl_failure_information integer NOT NULL,
+ fk_tbl_distribution_group integer NOT NULL,
+ CONSTRAINT tbl_failure_information_distribution_group_pkey PRIMARY KEY (id),
+ CONSTRAINT tbl_fail_inf_dist_grp__failure_information_id_fkey FOREIGN KEY (fk_tbl_failure_information)
+ REFERENCES public.tbl_failure_information (id) MATCH SIMPLE
+ ON UPDATE NO ACTION ON DELETE NO ACTION,
+ CONSTRAINT tbl_fail_inf_dist_grp__distribution_group_fkey FOREIGN KEY (fk_tbl_distribution_group)
+ REFERENCES public.tbl_distribution_group (id) MATCH SIMPLE
+ ON UPDATE NO ACTION ON DELETE NO ACTION
+)
+WITH (
+ OIDS=FALSE
+);
+ALTER TABLE public.tbl_failure_information_distribution_group
+ OWNER TO gfi_service;
+GRANT ALL ON TABLE public.tbl_failure_information_distribution_group TO gfi_service;
+
+INSERT INTO public.tbl_failure_information_distribution_group(FK_TBL_FAILURE_INFORMATION, FK_TBL_DISTRIBUTION_GROUP)
+VALUES(1, 1);
+INSERT INTO public.tbl_failure_information_distribution_group(FK_TBL_FAILURE_INFORMATION, FK_TBL_DISTRIBUTION_GROUP)
+VALUES(1, 2);
+INSERT INTO public.tbl_failure_information_distribution_group(FK_TBL_FAILURE_INFORMATION, FK_TBL_DISTRIBUTION_GROUP)
+VALUES(2, 1);
+INSERT INTO public.tbl_failure_information_distribution_group(FK_TBL_FAILURE_INFORMATION, FK_TBL_DISTRIBUTION_GROUP)
+VALUES(2, 2);
+
+
+-- ---------------------------------------------
+-- TABLE TBL_FAILURE_INFORMATION_PUBLICATION_CHANNEL
+-- ---------------------------------------------
+
+CREATE SEQUENCE public.tbl_failure_information_publication_channel_seq
+ INCREMENT 1
+ MINVALUE 1
+ MAXVALUE 9223372036854775807
+ START 1
+ CACHE 1;
+ALTER TABLE public.tbl_failure_information_publication_channel_seq
+ OWNER TO gfi_service;
+
+
+CREATE TABLE public.tbl_failure_information_publication_channel
+(
+ id integer NOT NULL DEFAULT nextval('tbl_failure_information_publication_channel_seq'::regclass),
+ fk_tbl_failure_information integer NOT NULL,
+ publication_channel character varying(50) NOT NULL,
+ published boolean NOT NULL,
+ CONSTRAINT tbl_failure_information_publication_channel_pkey PRIMARY KEY (id),
+ CONSTRAINT tbl_failure_information_id_fkey FOREIGN KEY (fk_tbl_failure_information)
+ REFERENCES public.tbl_failure_information (id) MATCH SIMPLE
+ ON UPDATE NO ACTION ON DELETE NO ACTION
+);
+
+ALTER TABLE public.tbl_failure_information_publication_channel
+ OWNER TO postgres;
+GRANT ALL ON TABLE public.tbl_failure_information_publication_channel TO gfi_service;
+
+INSERT INTO public.tbl_failure_information_publication_channel(FK_TBL_FAILURE_INFORMATION, PUBLICATION_CHANNEL, PUBLISHED)
+VALUES(1, 'MAIL', false);
+
+
+
+
+-- ----------------------------------------------------------------------------
+-- ----------------------------------------------------------------------------
+-- HISTORY-TABLES
+-- ----------------------------------------------------------------------------
+-- ----------------------------------------------------------------------------
+
+
+-- PUBLIC.HTBL_FAILURE_INFORMATION Automatic generanted History Table DDL --
+-- <GENERATED CODE!>
+
+DROP TABLE IF EXISTS PUBLIC.HTBL_FAILURE_INFORMATION;
+DROP SEQUENCE IF EXISTS PUBLIC.HTBL_FAILURE_INFORMATION_ID_SEQ;
+
+CREATE SEQUENCE PUBLIC.HTBL_FAILURE_INFORMATION_ID_SEQ
+ INCREMENT 1
+ MINVALUE 1
+ MAXVALUE 9223372036854775807
+ START 1
+ CACHE 1;
+
+ALTER TABLE PUBLIC.HTBL_FAILURE_INFORMATION_ID_SEQ
+ OWNER TO gfi_service;
+
+CREATE TABLE PUBLIC.HTBL_FAILURE_INFORMATION
+(
+ HID integer NOT NULL DEFAULT nextval('HTBL_FAILURE_INFORMATION_ID_SEQ'::regclass),
+ HACTION integer NOT NULL,
+ HDATE timestamp without time zone NOT NULL,
+ HUSER character varying(100),
+
+ ID integer,
+ UUID uuid,
+ VERSION_NUMBER integer,
+ FK_REF_FAILURE_CLASSIFICATION integer,
+ TITLE character varying(255) NULL,
+ DESCRIPTION character varying(255) NULL,
+ RESPONSIBILITY character varying (255),
+ INTERN_EXTERN character varying (1),
+ FK_REF_STATUS_INTERN integer,
+ FK_REF_STATUS_EXTERN integer,
+ FK_REF_BRANCH integer,
+ VOLTAGE_LEVEL character varying (2),
+ PRESSURE_LEVEL character varying (2),
+ FAILURE_BEGIN timestamp without time zone,
+ FAILURE_END_PLANNED timestamp without time zone,
+ FAILURE_END_RESUPPLIED timestamp without time zone,
+ POSTCODE character varying (30),
+ CITY character varying (255),
+ DISTRICT character varying (255),
+ STREET character varying (255),
+ HOUSENUMBER character varying (30),
+ STATION_ID character varying (30),
+ STATION_DESCRIPTION character varying (255),
+ STATION_COORDS character varying (255),
+ FK_REF_RADIUS integer,
+ LONGITUDE numeric(9,6),
+ LATITUDE numeric(9,6),
+ FK_TBL_FAILURE_INFORMATION_CONDENSED integer,
+ CONDENSED boolean,
+ CONDENSED_COUNT integer,
+ OBJECT_REFERENCE_EXTERNAL_SYSTEM character varying (255),
+ PUBLICATION_STATUS character varying (40),
+ PUBLICATION_FREETEXT character varying (1024),
+ FK_REF_EXPECTED_REASON integer,
+ CREATE_USER character varying(100),
+ CREATE_DATE timestamp without time zone,
+ MOD_USER character varying(100),
+ MOD_DATE timestamp without time zone,
+ CONSTRAINT HTBL_FAILURE_INFORMATION_PKEY PRIMARY KEY (HID)
+)
+WITH (
+ OIDS=FALSE
+);
+
+ALTER TABLE PUBLIC.HTBL_FAILURE_INFORMATION
+ OWNER TO gfi_service;
+GRANT ALL ON TABLE PUBLIC.HTBL_FAILURE_INFORMATION TO gfi_service;
+
+INSERT INTO public.htbl_failure_information(HACTION, HDATE, HUSER, ID, UUID, VERSION_NUMBER, FK_REF_FAILURE_CLASSIFICATION, TITLE, DESCRIPTION, RESPONSIBILITY, INTERN_EXTERN, FK_REF_STATUS_INTERN, FK_REF_STATUS_EXTERN, FK_REF_BRANCH, VOLTAGE_LEVEL, PRESSURE_LEVEL, FAILURE_BEGIN, FAILURE_END_PLANNED, FAILURE_END_RESUPPLIED, POSTCODE, CITY, DISTRICT, STREET, HOUSENUMBER, STATION_ID, STATION_DESCRIPTION, STATION_COORDS, FK_REF_RADIUS, LONGITUDE, LATITUDE, OBJECT_REFERENCE_EXTERNAL_SYSTEM, PUBLICATION_STATUS, PUBLICATION_FREETEXT, FK_REF_EXPECTED_REASON, FK_TBL_FAILURE_INFORMATION_CONDENSED, CONDENSED, CONDENSED_COUNT, CREATE_DATE, CREATE_USER, MOD_DATE, MOD_USER)
+VALUES (1, '2020-03-13 00:00:00', 'SCRIPT', 1, '6432a9c9-0384-44af-9bb8-34f2878d7b49', 1, 1, 'Stromausfall Murr', 'Es gibt einen Stromausfall im Bereich Murr/Westbezirk', 'Rolf Rudis', 'I', 1, 1, 1, 'NS', null, '2021-01-19 00:00:00', '2021-01-22 00:00:00', '2021-01-22 12:00:00', '71711', 'Murr', 'Westbezirk', 'Ferdinand-Porsche-Straße', '2', '52863a', 'Trafo 1', '124,2323', 2, 9.247952, 48.955700, 'Link - extenes System', 'veröffentlicht', 'Freitext für die Veröffentlichung: Defekt an Trafostation', 1, null, false, 0, '2020-01-22 15:32:15', 'SCRIPT', '2020-01-24 08:02:44', 'SCRIPT');
+
+INSERT INTO public.htbl_failure_information(HACTION, HDATE, HUSER, ID, UUID, VERSION_NUMBER, FK_REF_FAILURE_CLASSIFICATION, TITLE, DESCRIPTION, RESPONSIBILITY, INTERN_EXTERN, FK_REF_STATUS_INTERN, FK_REF_STATUS_EXTERN, FK_REF_BRANCH, VOLTAGE_LEVEL, PRESSURE_LEVEL, FAILURE_BEGIN, FAILURE_END_PLANNED, FAILURE_END_RESUPPLIED, POSTCODE, CITY, DISTRICT, STREET, HOUSENUMBER, STATION_ID, STATION_DESCRIPTION, STATION_COORDS, FK_REF_RADIUS, LONGITUDE, LATITUDE, OBJECT_REFERENCE_EXTERNAL_SYSTEM, PUBLICATION_STATUS, PUBLICATION_FREETEXT, FK_REF_EXPECTED_REASON, FK_TBL_FAILURE_INFORMATION_CONDENSED, CONDENSED, CONDENSED_COUNT, CREATE_DATE, CREATE_USER, MOD_DATE, MOD_USER)
+VALUES (2, '2020-03-13 00:00:00', 'SCRIPT', 2, '37aef635-d0d4-4c47-ac25-c0d16c29e35c', 1, 2, 'Gasleck Oldenburg', 'Es gibt ein Gasleck in Oldenburg', 'Bernd Britzel', 'E', 2, 2, 3, 'NS', 'HD', '2021-05-19 00:00:00', '2021-05-22 00:00:00', '2021-05-22 12:00:00', '26133', 'Oldenburg', null, 'Cloppenburger Str.', '302', '1234863-b234', 'ertf', '124,2323', 4, 8.210150, 53.111820, 'Link - extenes System', 'nicht veröffentlicht', 'Freitext: Eine Gasleitung wurde beschädigt', 4, null, false, 0, '2020-02-03 15:15:15', 'SCRIPT', '2020-02-24 20:08:41', 'SCRIPT');
+
+
+-- ----------------------------------------------------------------------------
+-- ----------------------------------------------------------------------------
+-- Tables ADDRESSIMPORT
+-- ----------------------------------------------------------------------------
+-- ----------------------------------------------------------------------------
+
+/*DROP TABLE IF EXISTS public.TBL_ADDRESS CASCADE;
+DROP SEQUENCE IF EXISTS public.TBL_ADDRESS_ID_SEQ;*/
+
+-- ---------------------------------------------
+-- TABLE TBL_ADDRESS
+-- ---------------------------------------------
+/*CREATE SEQUENCE public.TBL_ADDRESS_ID_SEQ
+ INCREMENT 1
+ MINVALUE 1
+ MAXVALUE 9223372036854775807
+ START 1
+ CACHE 1;
+ALTER TABLE public.TBL_ADDRESS_ID_SEQ
+ OWNER TO GFI_SERVICE;
+
+CREATE TABLE public.TBL_ADDRESS
+(
+ ID integer NOT NULL DEFAULT nextval('TBL_ADDRESS_ID_SEQ'::regclass),
+ UUID uuid NOT NULL,
+ SDOX1 numeric(9,2) NOT NULL,
+ SDOY1 numeric(10,2) NOT NULL,
+ G3EFID numeric,
+ POSTCODE character varying(30),
+ COMMUNITY character varying(255),
+ DISTRICT character varying(255),
+ STREET character varying(255),
+ HOUSENUMBER character varying(30),
+ WATER_CONNECTION boolean,
+ WATER_GROUP character varying(255),
+ GAS_CONNECTION boolean,
+ GAS_GROUP character varying(255),
+ POWER_CONNECTION boolean,
+ STATION_ID character varying(30),
+ LONGITUDE numeric(9,6),
+ LATITUDE numeric(9,6),
+ CONSTRAINT TBL_ADDRESS_PKEY PRIMARY KEY (id)
+);
+
+ALTER TABLE public.TBL_ADDRESS
+ OWNER TO GFI_SERVICE;
+GRANT ALL ON TABLE public.TBL_ADDRESS TO GFI_SERVICE;
+
+CREATE INDEX idx_tbl_address_g3efid ON public.TBL_ADDRESS ( G3EFID );
+CREATE INDEX idx_tbl_address_postcode ON public.TBL_ADDRESS ( POSTCODE );
+CREATE INDEX idx_tbl_address_community ON public.TBL_ADDRESS ( COMMUNITY );
+CREATE INDEX idx_tbl_address_district ON public.TBL_ADDRESS ( DISTRICT );
+CREATE INDEX idx_tbl_address_street ON public.TBL_ADDRESS ( STREET );
+CREATE INDEX idx_tbl_address_station_id ON public.TBL_ADDRESS ( STATION_ID );*/
+
+
+-- ---------------------------------------------
+-- TABLE TBL_STATION
+-- ---------------------------------------------
+
+/*DROP TABLE IF EXISTS public.TBL_STATION CASCADE;
+DROP SEQUENCE IF EXISTS public.TBL_STATION_ID_SEQ;
+
+CREATE SEQUENCE public.TBL_STATION_ID_SEQ
+ INCREMENT 1
+ MINVALUE 1
+ MAXVALUE 9223372036854775807
+ START 1
+ CACHE 1;
+ALTER TABLE public.TBL_STATION_ID_SEQ
+ OWNER TO GFI_SERVICE;
+
+CREATE TABLE public.TBL_STATION
+(
+ ID integer NOT NULL DEFAULT nextval('TBL_STATION_ID_SEQ'::regclass),
+ UUID uuid NOT NULL,
+ SDOX1 numeric(9,2) NOT NULL,
+ SDOY1 numeric(10,2) NOT NULL,
+ G3EFID numeric,
+ STATION_ID character varying(30),
+ STATION_NAME character varying(255),
+ LONGITUDE numeric(9,6),
+ LATITUDE numeric(9,6),
+ CONSTRAINT TBL_STATION_PKEY PRIMARY KEY (id)
+);
+
+ALTER TABLE public.TBL_STATION
+ OWNER TO GFI_SERVICE;
+GRANT ALL ON TABLE public.TBL_STATION TO GFI_SERVICE;
+
+CREATE INDEX idx_tbl_station_g3efid ON public.TBL_STATION ( G3EFID );
+CREATE INDEX idx_tbl_station_station_id ON public.TBL_STATION ( STATION_ID );
+*/
+
+-- ----------------------------------------------------------------------------
+-- ----------------------------------------------------------------------------
+-- TRIGGER
+-- ----------------------------------------------------------------------------
+-- ----------------------------------------------------------------------------
+
+
+-- PUBLIC.TBL_FAILURE_INFORMATION INSERT TRIGGER --
+-- <GENERATED CODE!>
+CREATE OR REPLACE FUNCTION PUBLIC.TBL_FAILURE_INFORMATION_INSERT_TRG()
+ RETURNS trigger AS
+$BODY$
+ BEGIN
+ INSERT INTO HTBL_FAILURE_INFORMATION (
+ ID,UUID,VERSION_NUMBER,FK_REF_FAILURE_CLASSIFICATION,TITLE,DESCRIPTION,RESPONSIBILITY,INTERN_EXTERN,FK_REF_STATUS_INTERN,FK_REF_STATUS_EXTERN,FK_REF_BRANCH,VOLTAGE_LEVEL,PRESSURE_LEVEL,FAILURE_BEGIN,FAILURE_END_PLANNED,FAILURE_END_RESUPPLIED,POSTCODE,CITY,DISTRICT,STREET,HOUSENUMBER,STATION_ID,STATION_DESCRIPTION,STATION_COORDS,FK_REF_RADIUS,LONGITUDE,LATITUDE,FK_TBL_FAILURE_INFORMATION_CONDENSED,CONDENSED,CONDENSED_COUNT,OBJECT_REFERENCE_EXTERNAL_SYSTEM,PUBLICATION_STATUS,PUBLICATION_FREETEXT,FK_REF_EXPECTED_REASON,CREATE_DATE,CREATE_USER,MOD_DATE,MOD_USER,
+
+ HACTION,
+ HDATE,
+ HUSER
+ )
+ VALUES (
+
+ NEW.ID,NEW.UUID,NEW.VERSION_NUMBER,NEW.FK_REF_FAILURE_CLASSIFICATION,NEW.TITLE,NEW.DESCRIPTION,NEW.RESPONSIBILITY,NEW.INTERN_EXTERN,NEW.FK_REF_STATUS_INTERN,NEW.FK_REF_STATUS_EXTERN,NEW.FK_REF_BRANCH,NEW.VOLTAGE_LEVEL,NEW.PRESSURE_LEVEL,NEW.FAILURE_BEGIN,NEW.FAILURE_END_PLANNED,NEW.FAILURE_END_RESUPPLIED,NEW.POSTCODE,NEW.CITY,NEW.DISTRICT,NEW.STREET,NEW.HOUSENUMBER,NEW.STATION_ID,NEW.STATION_DESCRIPTION,NEW.STATION_COORDS,NEW.FK_REF_RADIUS,NEW.LONGITUDE,NEW.LATITUDE,NEW.FK_TBL_FAILURE_INFORMATION_CONDENSED,NEW.CONDENSED,NEW.CONDENSED_COUNT,NEW.OBJECT_REFERENCE_EXTERNAL_SYSTEM,NEW.PUBLICATION_STATUS,NEW.PUBLICATION_FREETEXT,NEW.FK_REF_EXPECTED_REASON,NEW.CREATE_DATE,NEW.CREATE_USER,NEW.MOD_DATE,NEW.MOD_USER,
+
+ 1,
+ current_timestamp,
+ NEW.CREATE_USER );
+
+ RETURN NEW;
+ END;
+$BODY$
+ LANGUAGE plpgsql VOLATILE
+ COST 100;
+ALTER FUNCTION PUBLIC.TBL_FAILURE_INFORMATION_INSERT_TRG()
+ OWNER TO gfi_service;
+
+
+DROP TRIGGER IF EXISTS TBL_FAILURE_INFORMATION_INSERT_TRG ON PUBLIC.TBL_FAILURE_INFORMATION;
+
+CREATE TRIGGER TBL_FAILURE_INFORMATION_INSERT_TRG
+ BEFORE INSERT
+ ON PUBLIC.TBL_FAILURE_INFORMATION
+ FOR EACH ROW
+ EXECUTE PROCEDURE PUBLIC.TBL_FAILURE_INFORMATION_INSERT_TRG();
+
+
+
+-- PUBLIC.TBL_FAILURE_INFORMATION UPDATE TRIGGER --
+-- <GENERATED CODE!>
+
+CREATE OR REPLACE FUNCTION PUBLIC.TBL_FAILURE_INFORMATION_UPDATE_TRG()
+ RETURNS trigger AS
+$BODY$
+ BEGIN
+ INSERT INTO HTBL_FAILURE_INFORMATION (
+ ID,UUID,VERSION_NUMBER,FK_REF_FAILURE_CLASSIFICATION,TITLE,DESCRIPTION,RESPONSIBILITY,INTERN_EXTERN,FK_REF_STATUS_INTERN,FK_REF_STATUS_EXTERN,FK_REF_BRANCH,VOLTAGE_LEVEL,PRESSURE_LEVEL,FAILURE_BEGIN,FAILURE_END_PLANNED,FAILURE_END_RESUPPLIED,POSTCODE,CITY,DISTRICT,STREET,HOUSENUMBER,STATION_ID,STATION_DESCRIPTION,STATION_COORDS,FK_REF_RADIUS,LONGITUDE,LATITUDE,FK_TBL_FAILURE_INFORMATION_CONDENSED,CONDENSED,CONDENSED_COUNT,OBJECT_REFERENCE_EXTERNAL_SYSTEM,PUBLICATION_STATUS,PUBLICATION_FREETEXT,FK_REF_EXPECTED_REASON,CREATE_DATE,CREATE_USER,MOD_DATE,MOD_USER,
+
+ HACTION,
+ HDATE,
+ HUSER
+ )
+ VALUES (
+ NEW.ID,NEW.UUID,NEW.VERSION_NUMBER,NEW.FK_REF_FAILURE_CLASSIFICATION,NEW.TITLE,NEW.DESCRIPTION,NEW.RESPONSIBILITY,NEW.INTERN_EXTERN,NEW.FK_REF_STATUS_INTERN,NEW.FK_REF_STATUS_EXTERN,NEW.FK_REF_BRANCH,NEW.VOLTAGE_LEVEL,NEW.PRESSURE_LEVEL,NEW.FAILURE_BEGIN,NEW.FAILURE_END_PLANNED,NEW.FAILURE_END_RESUPPLIED,NEW.POSTCODE,NEW.CITY,NEW.DISTRICT,NEW.STREET,NEW.HOUSENUMBER,NEW.STATION_ID,NEW.STATION_DESCRIPTION,NEW.STATION_COORDS,NEW.FK_REF_RADIUS,NEW.LONGITUDE,NEW.LATITUDE,NEW.FK_TBL_FAILURE_INFORMATION_CONDENSED,NEW.CONDENSED,NEW.CONDENSED_COUNT,NEW.OBJECT_REFERENCE_EXTERNAL_SYSTEM,NEW.PUBLICATION_STATUS,NEW.PUBLICATION_FREETEXT,NEW.FK_REF_EXPECTED_REASON,NEW.CREATE_DATE,NEW.CREATE_USER,NEW.MOD_DATE,NEW.MOD_USER,
+ 2,
+ current_timestamp,
+ NEW.MOD_USER
+ );
+
+ RETURN NEW;
+ END;
+$BODY$
+ LANGUAGE plpgsql VOLATILE
+ COST 100;
+ALTER FUNCTION PUBLIC.TBL_FAILURE_INFORMATION_UPDATE_TRG()
+ OWNER TO gfi_service;
+
+DROP TRIGGER IF EXISTS TBL_FAILURE_INFORMATION_UPDATE_TRG ON PUBLIC.TBL_FAILURE_INFORMATION;
+
+CREATE TRIGGER TBL_FAILURE_INFORMATION_UPDATE_TRG
+ BEFORE UPDATE
+ ON PUBLIC.TBL_FAILURE_INFORMATION
+ FOR EACH ROW
+ EXECUTE PROCEDURE PUBLIC.TBL_FAILURE_INFORMATION_UPDATE_TRG();
+
+
+
+-- PUBLIC.TBL_FAILURE_INFORMATION DELETE TRIGGER --
+-- <GENERATED CODE!>
+
+CREATE OR REPLACE FUNCTION PUBLIC.TBL_FAILURE_INFORMATION_DELETE_TRG()
+ RETURNS trigger AS
+$BODY$
+ BEGIN
+ IF TG_OP = 'DELETE' THEN
+ INSERT INTO HTBL_FAILURE_INFORMATION (
+
+ ID,UUID,VERSION_NUMBER,FK_REF_FAILURE_CLASSIFICATION,TITLE,DESCRIPTION,RESPONSIBILITY,INTERN_EXTERN,FK_REF_STATUS_INTERN,FK_REF_STATUS_EXTERN,FK_REF_BRANCH,VOLTAGE_LEVEL,PRESSURE_LEVEL,FAILURE_BEGIN,FAILURE_END_PLANNED,FAILURE_END_RESUPPLIED,POSTCODE,CITY,DISTRICT,STREET,HOUSENUMBER,STATION_ID,STATION_DESCRIPTION,STATION_COORDS,FK_REF_RADIUS,LONGITUDE,LATITUDE,FK_TBL_FAILURE_INFORMATION_CONDENSED,CONDENSED,CONDENSED_COUNT,OBJECT_REFERENCE_EXTERNAL_SYSTEM,PUBLICATION_STATUS,PUBLICATION_FREETEXT,FK_REF_EXPECTED_REASON,CREATE_DATE,CREATE_USER,MOD_DATE,MOD_USER,
+
+ HACTION,
+ HDATE,
+ HUSER
+ )
+ VALUES (
+ OLD.ID,OLD.UUID,OLD.VERSION_NUMBER,OLD.FK_REF_FAILURE_CLASSIFICATION,OLD.TITLE,OLD.DESCRIPTION,OLD.RESPONSIBILITY,OLD.INTERN_EXTERN,OLD.FK_REF_STATUS_INTERN,OLD.FK_REF_STATUS_EXTERN,OLD.FK_REF_BRANCH,OLD.VOLTAGE_LEVEL,OLD.PRESSURE_LEVEL,OLD.FAILURE_BEGIN,OLD.FAILURE_END_PLANNED,OLD.FAILURE_END_RESUPPLIED,OLD.POSTCODE,OLD.CITY,OLD.DISTRICT,OLD.STREET,OLD.HOUSENUMBER,OLD.STATION_ID,OLD.STATION_DESCRIPTION,OLD.STATION_COORDS,OLD.FK_REF_RADIUS,OLD.LONGITUDE,OLD.LATITUDE,OLD.FK_TBL_FAILURE_INFORMATION_CONDENSED,OLD.CONDENSED,OLD.CONDENSED_COUNT,OLD.OBJECT_REFERENCE_EXTERNAL_SYSTEM,OLD.PUBLICATION_STATUS,OLD.PUBLICATION_FREETEXT,OLD.FK_REF_EXPECTED_REASON,OLD.CREATE_DATE,OLD.CREATE_USER,OLD.MOD_DATE,OLD.MOD_USER,
+
+ 3,
+ current_timestamp,
+ OLD.MOD_USER );
+ END IF;
+
+ RETURN OLD;
+ END;
+$BODY$
+ LANGUAGE plpgsql VOLATILE
+ COST 100;
+ALTER FUNCTION PUBLIC.TBL_FAILURE_INFORMATION_DELETE_TRG()
+ OWNER TO gfi_service;
+
+DROP TRIGGER IF EXISTS TBL_FAILURE_INFORMATION_DELETE_TRG ON PUBLIC.TBL_FAILURE_INFORMATION;
+
+CREATE TRIGGER TBL_FAILURE_INFORMATION_DELETE_TRG
+ BEFORE DELETE
+ ON PUBLIC.TBL_FAILURE_INFORMATION
+ FOR EACH ROW
+ EXECUTE PROCEDURE PUBLIC.TBL_FAILURE_INFORMATION_DELETE_TRG();
+
diff --git a/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/config/TestConfiguration.java b/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/config/TestConfiguration.java
index 3d62cac..c184ce9 100644
--- a/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/config/TestConfiguration.java
+++ b/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/config/TestConfiguration.java
@@ -117,11 +117,6 @@
}
@Bean
- FailureTypeMapper failureTypeMapper() {
- return new FailureTypeMapperImpl();
- }
-
- @Bean
StatusMapper statusMapper() {
return new StatusMapperImpl();
}
@@ -209,11 +204,6 @@
}
@Bean
- public FailureTypeService myFailureTypeService() {
- return new FailureTypeService();
- }
-
- @Bean
public StatusService myStatusService() {
return new StatusService();
}
diff --git a/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/controller/FailureTypeControllerTest.java b/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/controller/FailureTypeControllerTest.java
deleted file mode 100644
index 78ff37d..0000000
--- a/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/controller/FailureTypeControllerTest.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- *******************************************************************************
- * Copyright (c) 2019 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v. 2.0 which is available at
- * http://www.eclipse.org/legal/epl-2.0.
- *
- * SPDX-License-Identifier: EPL-2.0
- *******************************************************************************
- */
-package org.eclipse.openk.gridfailureinformation.controller;
-
-import org.eclipse.openk.gridfailureinformation.GridFailureInformationApplication;
-import org.eclipse.openk.gridfailureinformation.service.FailureTypeService;
-import org.eclipse.openk.gridfailureinformation.support.MockDataHelper;
-import org.eclipse.openk.gridfailureinformation.viewmodel.FailureTypeDto;
-import org.junit.jupiter.api.Test;
-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.boot.test.mock.mockito.MockBean;
-import org.springframework.http.MediaType;
-import org.springframework.test.context.ActiveProfiles;
-import org.springframework.test.web.servlet.MockMvc;
-
-import java.util.List;
-
-import static org.mockito.Mockito.when;
-import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
-import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
-import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
-
-@SpringBootTest(classes = GridFailureInformationApplication.class)
-@AutoConfigureMockMvc
-@ActiveProfiles("test")
-public class FailureTypeControllerTest {
-
- @MockBean
- private FailureTypeService failureTypeService;
-
- @Autowired
- private MockMvc mockMvc;
-
- @Test
- public void shouldReturnFailureTypes() throws Exception {
- List<FailureTypeDto> failureTypeDtoList = MockDataHelper.mockFailureTypeDtoList();
- when(failureTypeService.getFailureTypes()).thenReturn(failureTypeDtoList);
-
- mockMvc.perform(get("/failure-types"))
- .andExpect(status().is2xxSuccessful())
- .andExpect(content().contentType(MediaType.APPLICATION_JSON));
- }
-
-}
\ No newline at end of file
diff --git a/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/service/DistributionTextPlacehoderServiceTest.java b/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/service/DistributionTextPlacehoderServiceTest.java
index de80009..ad83170 100644
--- a/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/service/DistributionTextPlacehoderServiceTest.java
+++ b/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/service/DistributionTextPlacehoderServiceTest.java
@@ -38,7 +38,6 @@
DistributionTextPlaceholderDto placeholderDto = placeholderService.getPlaceholder();
assertEquals("$Klassifikation$", placeholderDto.getFailureClassification());
- assertEquals("$Typ$", placeholderDto.getFailureType());
assertEquals("$Zuständigkeit$", placeholderDto.getResponsibility());
assertEquals("$Spannungsebene$", placeholderDto.getVoltageLevel());
assertEquals("$Störungsbeginn_gemeldet$", placeholderDto.getFailureBegin());
diff --git a/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/service/ExportServiceTest.java b/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/service/ExportServiceTest.java
index c28cfa6..a35175c 100644
--- a/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/service/ExportServiceTest.java
+++ b/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/service/ExportServiceTest.java
@@ -14,39 +14,27 @@
*/
package org.eclipse.openk.gridfailureinformation.service;
-import org.eclipse.openk.gridfailureinformation.bpmn.impl.GfiProcessState;
import org.eclipse.openk.gridfailureinformation.config.TestConfiguration;
-import org.eclipse.openk.gridfailureinformation.config.rabbitMq.RabbitMqChannel;
-import org.eclipse.openk.gridfailureinformation.exceptions.InternalServerErrorException;
import org.eclipse.openk.gridfailureinformation.mapper.FailureInformationMapper;
import org.eclipse.openk.gridfailureinformation.model.TblDistributionGroup;
-import org.eclipse.openk.gridfailureinformation.model.TblDistributionGroupMember;
import org.eclipse.openk.gridfailureinformation.model.TblFailureInformation;
import org.eclipse.openk.gridfailureinformation.repository.DistributionGroupMemberRepository;
import org.eclipse.openk.gridfailureinformation.repository.FailureInformationRepository;
import org.eclipse.openk.gridfailureinformation.support.MockDataHelper;
-import org.eclipse.openk.gridfailureinformation.util.ImportDataValidator;
-import org.eclipse.openk.gridfailureinformation.viewmodel.*;
+import org.eclipse.openk.gridfailureinformation.viewmodel.DistributionGroupMemberDto;
import org.junit.jupiter.api.Test;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.Spy;
-import org.mockito.stubbing.Answer;
-import org.powermock.reflect.Whitebox;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.messaging.Message;
import org.springframework.messaging.MessageChannel;
-import org.springframework.messaging.support.MessageBuilder;
import org.springframework.test.context.ContextConfiguration;
-import java.math.BigDecimal;
-import java.util.*;
+import java.util.List;
+import java.util.Optional;
+import java.util.UUID;
-import static org.junit.jupiter.api.Assertions.*;
+import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.mockito.Mockito.*;
@DataJpaTest
diff --git a/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/service/FailureInformationServiceTest.java b/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/service/FailureInformationServiceTest.java
index 2f1335f..983212a 100644
--- a/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/service/FailureInformationServiceTest.java
+++ b/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/service/FailureInformationServiceTest.java
@@ -16,7 +16,6 @@
import org.eclipse.openk.gridfailureinformation.bpmn.impl.GfiProcessState;
import org.eclipse.openk.gridfailureinformation.config.TestConfiguration;
-import org.eclipse.openk.gridfailureinformation.config.rabbitMq.RabbitMqChannel;
import org.eclipse.openk.gridfailureinformation.exceptions.BadRequestException;
import org.eclipse.openk.gridfailureinformation.exceptions.NotFoundException;
import org.eclipse.openk.gridfailureinformation.exceptions.OperationDeniedException;
@@ -56,8 +55,6 @@
@MockBean
private FailureClassificationRepository failureClassificationRepository;
@MockBean
- private FailureTypeRepository failureTypeRepository;
- @MockBean
private StatusRepository statusRepository;
@MockBean
private HistFailureInformationRepository histFailureInformationRepository;
@@ -116,7 +113,6 @@
FailureInformationDto fiDto = MockDataHelper.mockFailureInformationDto();
TblFailureInformation fiTbl = MockDataHelper.mockTblFailureInformation();
RefFailureClassification refFailureClassification = MockDataHelper.mockRefFailureClassification();
- RefFailureType refFailureType = MockDataHelper.mockRefFailureType();
RefStatus refStatus = MockDataHelper.mockRefStatus();
RefBranch refBranch = MockDataHelper.mockRefBranch();
RefRadius refRadius = MockDataHelper.mockRefRadius();
@@ -128,7 +124,6 @@
when(failureInformationRepository.findByUuid(any(UUID.class))).thenReturn(Optional.of(fiTbl));
when(branchRepository.findByUuid(any(UUID.class))).thenReturn(Optional.of(refBranch));
when(failureClassificationRepository.findByUuid(any(UUID.class))).thenReturn(Optional.of(refFailureClassification));
- when(failureTypeRepository.findByUuid(any(UUID.class))).thenReturn(Optional.of(refFailureType));
when(statusRepository.findByUuid(any(UUID.class))).thenReturn(Optional.of(refStatus));
when(radiusRepository.findByUuid(any(UUID.class))).thenReturn(Optional.of(refRadius));
when(expectedReasonRepository.findByUuid(any(UUID.class))).thenReturn(Optional.of(refExpectedReason));
@@ -152,7 +147,6 @@
assertEquals(fiTbl.getFailureBegin(), savedDto.getFailureBegin());
assertEquals(fiTbl.getFailureEndPlanned(), savedDto.getFailureEndPlanned());
assertEquals(fiTbl.getFailureEndResupplied(), savedDto.getFailureEndResupplied());
- assertEquals(fiTbl.getInternalRemark(), savedDto.getInternalRemark());
assertEquals(fiTbl.getPostcode(), savedDto.getPostcode());
assertEquals(fiTbl.getCity(), savedDto.getCity());
assertEquals(fiTbl.getDistrict(), savedDto.getDistrict());
@@ -165,8 +159,6 @@
assertEquals(fiTbl.getLatitude(), savedDto.getLatitude());
assertEquals(fiTbl.getRefFailureClassification().getUuid(), savedDto.getFailureClassificationId());
assertEquals(fiTbl.getRefFailureClassification().getClassification(), savedDto.getFailureClassification());
- assertEquals(fiTbl.getRefFailureType().getUuid(), savedDto.getFailureTypeId());
- assertEquals(fiTbl.getRefFailureType().getType(), savedDto.getFailureType());
assertEquals(fiTbl.getRefStatusIntern().getUuid(), savedDto.getStatusInternId());
assertEquals(fiTbl.getRefStatusIntern().getStatus(), savedDto.getStatusIntern());
assertEquals(fiTbl.getRefStatusExtern().getUuid(), savedDto.getStatusExternId());
@@ -203,13 +195,11 @@
fiTbl.setId(777L);
fiTbl.setRefBranch(null);
fiTbl.setRefFailureClassification(null);
- fiTbl.setRefFailureType(null);
fiTbl.setRefRadius(null);
fiTbl.setRefExpectedReason(null);
when(statusRepository.findByUuid(any( UUID.class ))).thenReturn(Optional.of(refStatus));
when(failureInformationRepository.findByUuid(any(UUID.class))).thenReturn(Optional.of(fiTbl));
- // when(failureInformationRepository.save(any(TblFailureInformation.class))).thenReturn(fiTbl);
when(stationRepository.findByStationId(anyString())).thenReturn(Optional.of(tblStation));
when(stationRepository.findByUuid(any(UUID.class))).thenReturn(Optional.of(tblStation));
when(addressRepository.findByStationId(anyString())).thenReturn(addressList);
@@ -233,7 +223,6 @@
assertEquals(fiTbl.getFailureBegin(), savedDto.getFailureBegin());
assertEquals(fiTbl.getFailureEndPlanned(), savedDto.getFailureEndPlanned());
assertEquals(fiTbl.getFailureEndResupplied(), savedDto.getFailureEndResupplied());
- assertEquals(fiTbl.getInternalRemark(), savedDto.getInternalRemark());
assertEquals(fiTbl.getPostcode(), savedDto.getPostcode());
assertEquals(fiTbl.getCity(), savedDto.getCity());
assertEquals(fiTbl.getDistrict(), savedDto.getDistrict());
@@ -306,7 +295,6 @@
public void shouldNotStoreFailureInformation_Exception_FailureInformationNotFound() {
FailureInformationDto fiDto = MockDataHelper.mockFailureInformationDto();
RefFailureClassification refFailureClassification = MockDataHelper.mockRefFailureClassification();
- RefFailureType refFailureType = MockDataHelper.mockRefFailureType();
RefStatus refStatus = MockDataHelper.mockRefStatus();
RefBranch refBranch = MockDataHelper.mockRefBranch();
@@ -315,7 +303,6 @@
when(branchRepository.findByUuid(any(UUID.class))).thenReturn(Optional.of(refBranch));
when(failureClassificationRepository.findByUuid(any(UUID.class))).thenReturn(Optional.of(refFailureClassification));
- when(failureTypeRepository.findByUuid(any(UUID.class))).thenReturn(Optional.of(refFailureType));
when(statusRepository.findByUuid(any(UUID.class))).thenReturn(Optional.of(refStatus));
when(failureInformationRepository.save(any(TblFailureInformation.class)))
@@ -333,7 +320,6 @@
FailureInformationDto fiDto = MockDataHelper.mockFailureInformationDto();
TblFailureInformation fiTbl = MockDataHelper.mockTblFailureInformation();
RefFailureClassification refFailureClassification = MockDataHelper.mockRefFailureClassification();
- RefFailureType refFailureType = MockDataHelper.mockRefFailureType();
RefStatus refStatus = MockDataHelper.mockRefStatus();
RefBranch refBranch = MockDataHelper.mockRefBranch();
@@ -342,7 +328,6 @@
//branch cannot be found
when(branchRepository.findByUuid(any(UUID.class))).thenReturn(Optional.empty());
when(failureClassificationRepository.findByUuid(any(UUID.class))).thenReturn(Optional.of(refFailureClassification));
- when(failureTypeRepository.findByUuid(any(UUID.class))).thenReturn(Optional.of(refFailureType));
when(statusRepository.findByUuid(any(UUID.class))).thenReturn(Optional.of(refStatus));
when(failureInformationRepository.save(any(TblFailureInformation.class)))
@@ -360,7 +345,6 @@
FailureInformationDto fiDto = MockDataHelper.mockFailureInformationDto();
TblFailureInformation fiTbl = MockDataHelper.mockTblFailureInformation();
RefFailureClassification refFailureClassification = MockDataHelper.mockRefFailureClassification();
- RefFailureType refFailureType = MockDataHelper.mockRefFailureType();
RefStatus refStatus = MockDataHelper.mockRefStatus();
RefBranch refBranch = MockDataHelper.mockRefBranch();
@@ -369,7 +353,6 @@
when(branchRepository.findByUuid(any(UUID.class))).thenReturn(Optional.of(refBranch));
//failureClassification cannot be found
when(failureClassificationRepository.findByUuid(any(UUID.class))).thenReturn(Optional.empty());
- when(failureTypeRepository.findByUuid(any(UUID.class))).thenReturn(Optional.of(refFailureType));
when(statusRepository.findByUuid(any(UUID.class))).thenReturn(Optional.of(refStatus));
when(failureInformationRepository.save(any(TblFailureInformation.class)))
@@ -387,7 +370,6 @@
FailureInformationDto fiDto = MockDataHelper.mockFailureInformationDto();
TblFailureInformation fiTbl = MockDataHelper.mockTblFailureInformation();
RefFailureClassification refFailureClassification = MockDataHelper.mockRefFailureClassification();
- RefFailureType refFailureType = MockDataHelper.mockRefFailureType();
RefStatus refStatus = MockDataHelper.mockRefStatus();
RefBranch refBranch = MockDataHelper.mockRefBranch();
@@ -395,7 +377,6 @@
when(branchRepository.findByUuid(any(UUID.class))).thenReturn(Optional.of(refBranch));
when(failureClassificationRepository.findByUuid(any(UUID.class))).thenReturn(Optional.of(refFailureClassification));
//failureType cannot be found
- when(failureTypeRepository.findByUuid(any(UUID.class))).thenReturn(Optional.empty());
when(statusRepository.findByUuid(any(UUID.class))).thenReturn(Optional.of(refStatus));
when(failureInformationRepository.save(any(TblFailureInformation.class)))
@@ -413,14 +394,12 @@
FailureInformationDto fiDto = MockDataHelper.mockFailureInformationDto();
TblFailureInformation fiTbl = MockDataHelper.mockTblFailureInformation();
RefFailureClassification refFailureClassification = MockDataHelper.mockRefFailureClassification();
- RefFailureType refFailureType = MockDataHelper.mockRefFailureType();
RefStatus refStatus = MockDataHelper.mockRefStatus();
RefBranch refBranch = MockDataHelper.mockRefBranch();
when(failureInformationRepository.findByUuid(any(UUID.class))).thenReturn(Optional.of(fiTbl));
when(branchRepository.findByUuid(any(UUID.class))).thenReturn(Optional.of(refBranch));
when(failureClassificationRepository.findByUuid(any(UUID.class))).thenReturn(Optional.of(refFailureClassification));
- when(failureTypeRepository.findByUuid(any(UUID.class))).thenReturn(Optional.of(refFailureType));
//status cannot be found
when(statusRepository.findByUuid(any(UUID.class))).thenReturn(Optional.empty());
@@ -442,14 +421,12 @@
RefRadius refRadius = MockDataHelper.mockRefRadius();
RefStatus refStatus = MockDataHelper.mockRefStatus();
RefBranch refBranch = MockDataHelper.mockRefBranch();
- RefFailureType refFailureType = MockDataHelper.mockRefFailureType();
RefExpectedReason refExpectedReason = MockDataHelper.mockRefExpectedReason();
when(failureInformationRepository.findByUuid(any(UUID.class))).thenReturn(Optional.of(fiTbl));
when(branchRepository.findByUuid(any(UUID.class))).thenReturn(Optional.of(refBranch));
when(failureClassificationRepository.findByUuid(any(UUID.class))).thenReturn(Optional.of(refFailureClassification));
when(failureClassificationRepository.findById(any(Long.class))).thenReturn(Optional.of(refFailureClassification));
- when(failureTypeRepository.findByUuid(any(UUID.class))).thenReturn(Optional.of(refFailureType));
when(statusRepository.findByUuid(any(UUID.class))).thenReturn(Optional.of(refStatus));
when(statusRepository.findById(any(Long.class))).thenReturn(Optional.of(refStatus));
//Radius cannot be found
@@ -473,16 +450,13 @@
RefRadius refRadius = MockDataHelper.mockRefRadius();
RefStatus refStatus = MockDataHelper.mockRefStatus();
RefBranch refBranch = MockDataHelper.mockRefBranch();
- //RefExpectedReason refExpectedReason = MockDataHelper.mockRefExpectedReason();
TblStation tblStation = MockDataHelper.mockTblStation();
- RefFailureType refFailureType = MockDataHelper.mockRefFailureType();
List<TblAddress> addressList = MockDataHelper.mockTblAddressList();
when(failureInformationRepository.findByUuid(any(UUID.class))).thenReturn(Optional.of(fiTbl));
when(branchRepository.findByUuid(any(UUID.class))).thenReturn(Optional.of(refBranch));
when(failureClassificationRepository.findByUuid(any(UUID.class))).thenReturn(Optional.of(refFailureClassification));
when(failureClassificationRepository.findById(any(Long.class))).thenReturn(Optional.of(refFailureClassification));
- when(failureTypeRepository.findByUuid(any(UUID.class))).thenReturn(Optional.of(refFailureType));
when(statusRepository.findByUuid(any(UUID.class))).thenReturn(Optional.of(refStatus));
when(statusRepository.findById(any(Long.class))).thenReturn(Optional.of(refStatus));
when(radiusRepository.findByUuid(any(UUID.class))).thenReturn(Optional.of(refRadius));
@@ -491,7 +465,6 @@
when(addressRepository.findByStationId(anyString())).thenReturn(addressList);
//ExpectedReason cannot be found
-
when(failureInformationRepository.save(any(TblFailureInformation.class)))
.then((Answer<TblFailureInformation>) invocation -> {
Object[] args = invocation.getArguments();
@@ -507,7 +480,6 @@
FailureInformationDto fiDto = MockDataHelper.mockFailureInformationDto();
TblFailureInformation fiTbl = MockDataHelper.mockTblFailureInformation();
RefFailureClassification refFailureClassification = MockDataHelper.mockRefFailureClassification();
- RefFailureType refFailureType = MockDataHelper.mockRefFailureType();
RefStatus refStatus = MockDataHelper.mockRefStatus();
RefBranch refBranch = MockDataHelper.mockRefBranch();
RefRadius refRadius = MockDataHelper.mockRefRadius();
@@ -519,7 +491,6 @@
when(failureInformationRepository.findByUuid(any(UUID.class))).thenReturn(Optional.of(fiTbl), Optional.of(fiTbl));
when(branchRepository.findByUuid(any(UUID.class))).thenReturn(Optional.of(refBranch));
when(failureClassificationRepository.findByUuid(any(UUID.class))).thenReturn(Optional.of(refFailureClassification));
- when(failureTypeRepository.findByUuid(any(UUID.class))).thenReturn(Optional.of(refFailureType));
when(statusRepository.findByUuid(any(UUID.class))).thenReturn(Optional.of(refStatus));
when(radiusRepository.findByUuid(any(UUID.class))).thenReturn(Optional.of(refRadius));
when(expectedReasonRepository.findByUuid(any(UUID.class))).thenReturn(Optional.of(refExpectedReason));
@@ -557,11 +528,7 @@
assertEquals(fiTbl.getLatitude(), savedDto.getLatitude());
assertEquals(refFailureClassification.getUuid(), savedDto.getFailureClassificationId());
assertEquals(refFailureClassification.getClassification(), savedDto.getFailureClassification());
- assertEquals(refFailureType.getUuid(), savedDto.getFailureTypeId());
- assertEquals(refFailureType.getType(), savedDto.getFailureType());
- //assertEquals(refStatus.getStatus(), savedDto.getStatusInternId());
assertEquals(refStatus.getStatus(), savedDto.getStatusIntern());
- //assertEquals(refStatus.getStatusExternId(), savedDto.getStatusExternId());
assertEquals(refStatus.getStatus(), savedDto.getStatusExtern());
assertEquals(refBranch.getUuid(), savedDto.getBranchId());
assertEquals(refBranch.getName(), savedDto.getBranch());
diff --git a/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/service/FailureTypeServiceTest.java b/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/service/FailureTypeServiceTest.java
deleted file mode 100644
index 5c15462..0000000
--- a/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/service/FailureTypeServiceTest.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- *******************************************************************************
- * Copyright (c) 2019 Contributors to the Eclipse Foundation
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v. 2.0 which is available at
- * http://www.eclipse.org/legal/epl-2.0.
- *
- * SPDX-License-Identifier: EPL-2.0
- *******************************************************************************
- */
-package org.eclipse.openk.gridfailureinformation.service;
-
-import org.eclipse.openk.gridfailureinformation.config.TestConfiguration;
-import org.eclipse.openk.gridfailureinformation.model.RefFailureType;
-import org.eclipse.openk.gridfailureinformation.repository.FailureTypeRepository;
-import org.eclipse.openk.gridfailureinformation.support.MockDataHelper;
-import org.eclipse.openk.gridfailureinformation.viewmodel.FailureTypeDto;
-import org.junit.jupiter.api.Test;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
-import org.springframework.boot.test.mock.mockito.MockBean;
-import org.springframework.test.context.ContextConfiguration;
-
-import java.util.List;
-
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.mockito.Mockito.when;
-
-//@RunWith(SpringRunner.class)
-@DataJpaTest
-@ContextConfiguration(classes = {TestConfiguration.class})
-
-public class FailureTypeServiceTest {
- @Qualifier("myFailureTypeService")
- @Autowired
- private FailureTypeService failureTypeService;
-
- @MockBean
- private FailureTypeRepository failureTypeRepository;
-
- @Test
- public void shouldGetFailureTypesProperly() {
- List<RefFailureType> mockRefFailureTypeList = MockDataHelper.mockRefFailureTypeList();
- when(failureTypeRepository.findAll()).thenReturn(mockRefFailureTypeList);
- List<FailureTypeDto> listRefFailureType = failureTypeService.getFailureTypes();
-
- assertEquals(listRefFailureType.size(), mockRefFailureTypeList.size());
- assertEquals(listRefFailureType.size(), 2);
- assertEquals(listRefFailureType.get(1).getUuid(), mockRefFailureTypeList.get(1).getUuid());
- }
-}
-
diff --git a/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/support/MockDataHelper.java b/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/support/MockDataHelper.java
index a207f20..dad19bd 100644
--- a/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/support/MockDataHelper.java
+++ b/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/support/MockDataHelper.java
@@ -146,7 +146,6 @@
obj.setRefStatusIntern(mockRefStatus());
obj.setRefStatusExtern(mockRefStatus());
- obj.setRefFailureType(mockRefFailureType());
obj.setRefFailureClassification(mockRefFailureClassification());
obj.setRefBranch(mockRefBranch());
@@ -195,7 +194,6 @@
obj.setRefStatusIntern(mockRefStatus2());
obj.setRefStatusExtern(mockRefStatus2());
- obj.setRefFailureType(mockRefFailureType());
obj.setRefFailureClassification(mockRefFailureClassification());
obj.setRefBranch(mockRefBranch());
@@ -284,68 +282,6 @@
return refBranchList;
}
- public static FailureTypeDto mockFailureTypeDto() {
- FailureTypeDto failureTypeDto1 = new FailureTypeDto();
-
- failureTypeDto1.setUuid(UUID.fromString("44a2aaed-8910-4116-b0c4-0855f8d3c28d"));
- failureTypeDto1.setType("Information");
- failureTypeDto1.setDescription(null);
-
- return failureTypeDto1;
- }
- public static FailureTypeDto mockFailureTypeDto2() {
- FailureTypeDto failureTypeDto2 = new FailureTypeDto();
-
- failureTypeDto2.setUuid(UUID.fromString("94e880c4-3127-47d5-aaee-5f778462ab0c"));
- failureTypeDto2.setType("unterlagerte Störung");
- failureTypeDto2.setDescription("Nicht zu veröffentlichen");
-
- return failureTypeDto2;
- }
-
- public static List<FailureTypeDto> mockFailureTypeDtoList() {
- FailureTypeDto failureTypeDto1 = mockFailureTypeDto();
- FailureTypeDto failureTypeDto2 = mockFailureTypeDto2();
-
- List<FailureTypeDto> failureTypeDtoList = new ArrayList<>();
- failureTypeDtoList.add(failureTypeDto1);
- failureTypeDtoList.add(failureTypeDto2);
-
- return failureTypeDtoList;
- }
-
- public static RefFailureType mockRefFailureType() {
- RefFailureType refFailureType1 = new RefFailureType();
-
- refFailureType1.setUuid(UUID.fromString("44a2aaed-8910-4116-b0c4-0855f8d3c28d"));
- refFailureType1.setType("Andere Information");
- refFailureType1.setDescription(null);
-
- return refFailureType1;
- }
-
- public static RefFailureType mockRefFailureType2() {
- RefFailureType refFailureType2 = new RefFailureType();
-
- refFailureType2.setUuid(UUID.fromString("94e880c4-3127-47d5-aaee-5f778462ab0c"));
- refFailureType2.setType("unterlagerte Störung");
- refFailureType2.setDescription("Nicht zu veröffentlichen");
-
- return refFailureType2;
- }
-
- public static List<RefFailureType> mockRefFailureTypeList() {
- RefFailureType refFailureType1 = mockRefFailureType();
- RefFailureType refFailureType2 = mockRefFailureType2();
-
- List<RefFailureType> refFailureTypeList = new ArrayList<>();
- refFailureTypeList.add(refFailureType1);
- refFailureTypeList.add(refFailureType2);
-
- return refFailureTypeList;
- }
-
-
public static FailureClassificationDto mockFailureClassificationDto() {
FailureClassificationDto failureClassificationDto1 = new FailureClassificationDto();
@@ -497,7 +433,6 @@
obj.setRefStatusIntern(mockRefStatus());
obj.setRefStatusExtern(mockRefStatus());
- obj.setRefFailureType(mockRefFailureType());
obj.setRefFailureClassification(mockRefFailureClassification());
obj.setRefBranch(mockRefBranch());
@@ -534,7 +469,6 @@
obj.setRefStatusIntern(mockRefStatus());
obj.setRefStatusExtern(mockRefStatus());
- obj.setRefFailureType(mockRefFailureType());
obj.setRefFailureClassification(mockRefFailureClassification());
obj.setRefBranch(mockRefBranch());
diff --git a/testImportGridFailures/src/main/resources/application_localdev.yml b/testImportGridFailures/src/main/resources/application_localdev.yml
index c366b8e..48bebce 100644
--- a/testImportGridFailures/src/main/resources/application_localdev.yml
+++ b/testImportGridFailures/src/main/resources/application_localdev.yml
@@ -22,9 +22,9 @@
port: 5672
username: ${GFI_RABBITMQ_USERNAME}
password: ${GFI_RABBITMQ_PASSWORD}
- import_exchange: importExchangeLocalDev
- failure_import_queue: failureImportQueueLocalDev
- failure_import_routingkey: importExchangeLocalDev.failureImportKeyLocalDev
+ import_exchange: importExchangeLocalDev_fd
+ failure_import_queue: failureImportQueueLocalDev_fd
+ failure_import_routingkey: importExchangeLocalDev.failureImportKeyLocalDev_fd
eureka:
client: