其他类型的城市查询过滤机场数据
This commit is contained in:
parent
5101ea9e16
commit
60614f7208
|
@ -21,6 +21,8 @@ import org.springframework.web.bind.annotation.RestController;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import static com.chint.infrastructure.constant.CommonMessageConstant.SUCCESS;
|
import static com.chint.infrastructure.constant.CommonMessageConstant.SUCCESS;
|
||||||
|
import static com.chint.infrastructure.constant.LegConstant.LEG_TYPE_AIRPLANE;
|
||||||
|
import static com.chint.infrastructure.constant.LocationConstant.LOCATION_TYPE_AIRPORT;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/location")
|
@RequestMapping("/location")
|
||||||
|
@ -51,6 +53,14 @@ public class LocationController {
|
||||||
locations = locationDomainService.queryByFirstLetter(locationParam);
|
locations = locationDomainService.queryByFirstLetter(locationParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (locationParam.getProductType() != LEG_TYPE_AIRPLANE) {
|
||||||
|
//过滤机场数据
|
||||||
|
locations = locations
|
||||||
|
.stream()
|
||||||
|
.filter(it -> it.getLocationType().equals(LOCATION_TYPE_AIRPORT))
|
||||||
|
.toList();
|
||||||
|
}
|
||||||
|
|
||||||
if (locations != null && !locations.isEmpty()) {
|
if (locations != null && !locations.isEmpty()) {
|
||||||
locationRes = locations
|
locationRes = locations
|
||||||
.stream()
|
.stream()
|
||||||
|
|
|
@ -421,10 +421,11 @@ public class RouteOrder implements Serializable {
|
||||||
Location destinationLocation = leg.getDestinationLocation();
|
Location destinationLocation = leg.getDestinationLocation();
|
||||||
Long orderDetailOriginId = orderDetail.getOriginId();
|
Long orderDetailOriginId = orderDetail.getOriginId();
|
||||||
Long orderDetailDestinationId = orderDetail.getDestinationId();
|
Long orderDetailDestinationId = orderDetail.getDestinationId();
|
||||||
return leg.getLegType().equals(orderDetail.getProductType())
|
return leg.getLegType().equals(orderDetail.getProductType()) &&
|
||||||
&& (originLocation.getLocationId().equals(orderDetailOriginId) ||
|
(originLocation.getLocationId().equals(orderDetailOriginId) ||
|
||||||
originLocation.getParentLocationId().equals(orderDetailOriginId))
|
originLocation.getParentLocationId().equals(orderDetailOriginId))
|
||||||
&& (destinationLocation.getLocationId().equals(orderDetailDestinationId) ||
|
&&
|
||||||
|
(destinationLocation.getLocationId().equals(orderDetailDestinationId) ||
|
||||||
destinationLocation.getParentLocationId().equals(orderDetailDestinationId));
|
destinationLocation.getParentLocationId().equals(orderDetailDestinationId));
|
||||||
})
|
})
|
||||||
.toList();
|
.toList();
|
||||||
|
|
|
@ -76,8 +76,8 @@ public class LocationRepositoryImpl implements LocationRepository {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Location> findByCityIdAndLocationType(Long cityId , Integer LocationType) {
|
public List<Location> findByCityIdAndLocationType(Long cityId, Integer LocationType) {
|
||||||
return jdbcLocationRepository.findByCityIdAndLocationType(cityId,LocationType);
|
return jdbcLocationRepository.findByCityIdAndLocationType(cityId, LocationType);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -113,8 +113,8 @@ public class LocationRepositoryImpl implements LocationRepository {
|
||||||
Integer cityType = locationParam.getCityType();
|
Integer cityType = locationParam.getCityType();
|
||||||
String queryWord = locationParam.getQueryWord();
|
String queryWord = locationParam.getQueryWord();
|
||||||
if (productType.equals(LEG_TYPE_AIRPLANE)) {
|
if (productType.equals(LEG_TYPE_AIRPLANE)) {
|
||||||
return jdbcLocationRepository.findByFirstPinYinAndIsInternalAndIsHaveAirportAndLevelOrFirstPinYinAndIsInternalAndIsHaveAirportAndLevel(
|
return jdbcLocationRepository.findByFirstPinYinAndIsInternalAndIsHaveAirportAndLevelOrFirstPinYinAndIsInternalAndIsHaveAirportAndLevelOrFirstPinYinAndIsInternalAndIsHaveAirportAndLevel(
|
||||||
queryWord, cityType, 1, 3, queryWord, cityType, 1, 4);
|
queryWord, cityType, 1, 3, queryWord, cityType, 1, 4, queryWord, cityType, 1, 5);
|
||||||
} else {
|
} else {
|
||||||
return jdbcLocationRepository.findByFirstPinYinAndIsInternalAndLevelOrFirstPinYinAndIsInternalAndLevel(
|
return jdbcLocationRepository.findByFirstPinYinAndIsInternalAndLevelOrFirstPinYinAndIsInternalAndLevel(
|
||||||
queryWord, cityType, 3, queryWord, cityType, 4);
|
queryWord, cityType, 3, queryWord, cityType, 4);
|
||||||
|
@ -128,8 +128,8 @@ public class LocationRepositoryImpl implements LocationRepository {
|
||||||
Integer cityType = locationParam.getCityType();
|
Integer cityType = locationParam.getCityType();
|
||||||
String queryWord = locationParam.getQueryWord();
|
String queryWord = locationParam.getQueryWord();
|
||||||
if (productType.equals(LEG_TYPE_AIRPLANE)) {
|
if (productType.equals(LEG_TYPE_AIRPLANE)) {
|
||||||
return jdbcLocationRepository.findByLocationPathNameContainingAndIsInternalAndIsHaveAirportAndLevelOrLocationPathNameContainingAndIsInternalAndIsHaveAirportAndLevel(
|
return jdbcLocationRepository.findByLocationPathNameContainingAndIsInternalAndIsHaveAirportAndLevelOrLocationPathNameContainingAndIsInternalAndIsHaveAirportAndLevelOrLocationPathNameContainingAndIsInternalAndIsHaveAirportAndLevel(
|
||||||
queryWord, cityType, 1, 3, queryWord, cityType, 1, 4);
|
queryWord, cityType, 1, 3, queryWord, cityType, 1, 4, queryWord, cityType, 1, 5);
|
||||||
} else {
|
} else {
|
||||||
return jdbcLocationRepository.findByLocationPathNameContainingAndIsInternalAndLevelOrLocationPathNameContainingAndIsInternalAndLevel(
|
return jdbcLocationRepository.findByLocationPathNameContainingAndIsInternalAndLevelOrLocationPathNameContainingAndIsInternalAndLevel(
|
||||||
queryWord, cityType, 3, queryWord, cityType, 4);
|
queryWord, cityType, 3, queryWord, cityType, 4);
|
||||||
|
|
|
@ -33,14 +33,12 @@ public interface JdbcLocationRepository extends CrudRepository<Location, Long> {
|
||||||
|
|
||||||
List<Location> findByLocationPathNameContaining(String localName);
|
List<Location> findByLocationPathNameContaining(String localName);
|
||||||
|
|
||||||
List<Location> findByFirstPinYinAndIsInternalAndIsHaveAirportAndLevelOrFirstPinYinAndIsInternalAndIsHaveAirportAndLevel(String firstPinYin, Integer isInternal, Integer isHaveAirport, Integer level,
|
List<Location> findByFirstPinYinAndIsInternalAndIsHaveAirportAndLevelOrFirstPinYinAndIsInternalAndIsHaveAirportAndLevelOrFirstPinYinAndIsInternalAndIsHaveAirportAndLevel(String firstPinYin, Integer isInternal, Integer isHaveAirport, Integer level, String firstPinYin2, Integer isInternal2, Integer isHaveAirport2, Integer level2, String firstPinYin3, Integer isInternal3, Integer isHaveAirport3, Integer level3);
|
||||||
String firstPinYin2, Integer isInternal2, Integer isHaveAirport2, Integer level2);
|
|
||||||
|
|
||||||
List<Location> findByFirstPinYinAndIsInternalAndLevelOrFirstPinYinAndIsInternalAndLevel(String firstPinYin, Integer isInternal, Integer level,
|
List<Location> findByFirstPinYinAndIsInternalAndLevelOrFirstPinYinAndIsInternalAndLevel(String firstPinYin, Integer isInternal, Integer level,
|
||||||
String firstPinYin2, Integer isInternal2, Integer level2);
|
String firstPinYin2, Integer isInternal2, Integer level2);
|
||||||
|
|
||||||
List<Location> findByLocationPathNameContainingAndIsInternalAndIsHaveAirportAndLevelOrLocationPathNameContainingAndIsInternalAndIsHaveAirportAndLevel(String locationPathName, Integer isInternal, Integer isHaveAirport, Integer level,
|
List<Location> findByLocationPathNameContainingAndIsInternalAndIsHaveAirportAndLevelOrLocationPathNameContainingAndIsInternalAndIsHaveAirportAndLevelOrLocationPathNameContainingAndIsInternalAndIsHaveAirportAndLevel(String locationPathName, Integer isInternal, Integer isHaveAirport, Integer level, String locationPathName2, Integer isInternal2, Integer isHaveAirport2, Integer level2, String locationPathName3, Integer isInternal3, Integer isHaveAirport3, Integer level3);
|
||||||
String locationPathName2, Integer isInternal2, Integer isHaveAirport2, Integer level2);
|
|
||||||
|
|
||||||
List<Location> findByLocationPathNameContainingAndIsInternalAndLevelOrLocationPathNameContainingAndIsInternalAndLevel(String locationPathName, Integer isInternal, Integer level,
|
List<Location> findByLocationPathNameContainingAndIsInternalAndLevelOrLocationPathNameContainingAndIsInternalAndLevel(String locationPathName, Integer isInternal, Integer level,
|
||||||
String locationPathName2, Integer isInternal2, Integer level2);
|
String locationPathName2, Integer isInternal2, Integer level2);
|
||||||
|
|
Loading…
Reference in New Issue