Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Eclipse Projects
Eclipse openK User Modules
org.eclipse.openk-usermodules.gridFailureInformation.backend
Commits
c2cf1a20
Commit
c2cf1a20
authored
Apr 07, 2020
by
Ina Curdt
Browse files
SI-557, 558 Adress-Services
parent
6e8f9037
Changes
3
Hide whitespace changes
Inline
Side-by-side
gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/controller/AddressController.java
View file @
c2cf1a20
...
...
@@ -65,7 +65,7 @@ public class AddressController {
}
//@Secured({"ROLE_GRID-FAILURE-ADMIN", "ROLE_GRID-FAILURE-CREATOR", "ROLE_GRID-FAILURE-QUALIFIER", "ROLE_GRID-FAILURE-PUBLISHER"})
@ApiOperation
(
value
=
"Anzeige Strassen nach Postleitzahl und Ort"
)
@ApiOperation
(
value
=
"Anzeige Strassen nach Postleitzahl und Ort
und Ortsteil (optional)
"
)
@ApiResponses
(
value
=
{
@ApiResponse
(
code
=
200
,
message
=
"Erfolgreich durchgeführt"
)})
@GetMapping
(
"/streets"
)
public
List
<
String
>
findStreets
(
...
...
@@ -77,6 +77,19 @@ public class AddressController {
}
//@Secured({"ROLE_GRID-FAILURE-ADMIN", "ROLE_GRID-FAILURE-CREATOR", "ROLE_GRID-FAILURE-QUALIFIER", "ROLE_GRID-FAILURE-PUBLISHER"})
@ApiOperation
(
value
=
"Anzeige Strassen nach Postleitzahl und Ort und Strasse"
)
@ApiResponses
(
value
=
{
@ApiResponse
(
code
=
200
,
message
=
"Erfolgreich durchgeführt"
)})
@GetMapping
(
"/housenumbers"
)
public
List
<
String
>
findHousenumbers
(
@RequestParam
(
"postcode"
)
String
postcode
,
@RequestParam
(
"community"
)
String
community
,
@RequestParam
(
"street"
)
String
street
)
{
return
addressService
.
getHousenumbers
(
postcode
,
community
,
street
);
}
...
...
gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/repository/AddressRepository.java
View file @
c2cf1a20
...
...
@@ -41,15 +41,13 @@ public interface AddressRepository extends JpaRepository<TblAddress, Long > {
@Query
(
"select distinct a.district from TblAddress a where postcode = :postcode and community = :community"
)
List
<
String
>
findDistrictsByPostcodeAndCommunity
(
@Param
(
"postcode"
)
String
postcode
,
@Param
(
"community"
)
String
community
);
@Query
(
"select distinct a.district from TblAddress a where postcode = :postcode"
)
List
<
String
>
findDistrictsByPostcode
(
@Param
(
"postcode"
)
String
postcode
);
@Query
(
"select distinct a.district from TblAddress a where community = :community"
)
List
<
String
>
findDistrictsByCommunity
(
@Param
(
"community"
)
String
community
);
@Query
(
"select distinct a.district from TblAddress a"
)
List
<
String
>
findAllDistricts
();
@Query
(
"select distinct a.street from TblAddress a where postcode = :postcode and community = :community"
)
List
<
String
>
findStreetsByPostcodeAndCommunity
(
@Param
(
"postcode"
)
String
postcode
,
@Param
(
"community"
)
String
community
);
@Query
(
"select distinct a.street from TblAddress a where postcode = :postcode and community = :community and district = :district"
)
List
<
String
>
findStreetsByPostcodeAndCommunityAndDistrict
(
@Param
(
"postcode"
)
String
postcode
,
@Param
(
"community"
)
String
community
,
@Param
(
"district"
)
String
district
);
@Query
(
"select distinct a.housenumber from TblAddress a where postcode = :postcode and community = :community and street = :street"
)
List
<
String
>
findHousenumbersByPostcodeAndCommunityAndStreet
(
@Param
(
"postcode"
)
String
postcode
,
@Param
(
"community"
)
String
community
,
@Param
(
"street"
)
String
street
);
}
gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/service/AddressService.java
View file @
c2cf1a20
...
...
@@ -53,7 +53,18 @@ public class AddressService {
}
public
List
<
String
>
getStreets
(
String
postcode
,
String
community
,
Optional
<
String
>
district
)
{
return
addressRepository
.
findDistrictsByPostcodeAndCommunity
(
postcode
,
community
);
if
(
district
.
equals
(
Optional
.
empty
())){
return
addressRepository
.
findStreetsByPostcodeAndCommunity
(
postcode
,
community
);
}
else
{
return
addressRepository
.
findStreetsByPostcodeAndCommunityAndDistrict
(
postcode
,
community
,
district
.
get
());
}
}
public
List
<
String
>
getHousenumbers
(
String
postcode
,
String
community
,
String
street
)
{
return
addressRepository
.
findHousenumbersByPostcodeAndCommunityAndStreet
(
postcode
,
community
,
street
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment