同步代码
This commit is contained in:
parent
8aeb194824
commit
99bd01fe7b
|
@ -15,6 +15,9 @@ public class LocationRes {
|
||||||
private String province;
|
private String province;
|
||||||
|
|
||||||
public static LocationRes copyFrom(Location location) {
|
public static LocationRes copyFrom(Location location) {
|
||||||
|
if (location == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
LocationRes locationRes = BeanUtil.copyProperties(location, LocationRes.class);
|
LocationRes locationRes = BeanUtil.copyProperties(location, LocationRes.class);
|
||||||
String[] parts = location.getLocationPathName().split("_");
|
String[] parts = location.getLocationPathName().split("_");
|
||||||
if (parts.length != 4) {
|
if (parts.length != 4) {
|
||||||
|
|
|
@ -232,23 +232,29 @@ public class OrderQuery {
|
||||||
CityEntity destinationCity;
|
CityEntity destinationCity;
|
||||||
ScheduleDetail.ScheduleDetailBuilder scheduleDetailBuilder = ScheduleDetail.builder();
|
ScheduleDetail.ScheduleDetailBuilder scheduleDetailBuilder = ScheduleDetail.builder();
|
||||||
if (!leg.getLegType().equals(LegConstant.LEG_TYPE_OTHER)) {
|
if (!leg.getLegType().equals(LegConstant.LEG_TYPE_OTHER)) {
|
||||||
|
|
||||||
|
if (leg.getOriginLocation() != null) {
|
||||||
originCity = cityEntities.stream().filter(cityEntity -> cityEntity
|
originCity = cityEntities.stream().filter(cityEntity -> cityEntity
|
||||||
.getCityName()
|
.getCityName()
|
||||||
.equals(leg.getOriginLocation().getLocationName()))
|
.equals(leg.getOriginLocation().getLocationName()))
|
||||||
.findFirst().get();
|
.findFirst().get();
|
||||||
|
scheduleDetailBuilder
|
||||||
|
.startCity(originCity.getCityName())
|
||||||
|
.startCityName(originCity.getCityName())
|
||||||
|
.startCityEnName(originCity.getCityename());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (leg.getDestinationLocation() != null) {
|
||||||
destinationCity = cityEntities.stream().filter(cityEntity -> cityEntity
|
destinationCity = cityEntities.stream().filter(cityEntity -> cityEntity
|
||||||
.getCityName()
|
.getCityName()
|
||||||
.equals(leg.getDestinationLocation().getLocationName()))
|
.equals(leg.getDestinationLocation().getLocationName()))
|
||||||
.findFirst().get();
|
.findFirst().get();
|
||||||
|
|
||||||
scheduleDetailBuilder
|
scheduleDetailBuilder
|
||||||
.startCity(originCity.getCityName())
|
|
||||||
.startCityName(originCity.getCityName())
|
|
||||||
.startCityEnName(originCity.getCityename())
|
|
||||||
.endCityName(destinationCity.getCityName())
|
.endCityName(destinationCity.getCityName())
|
||||||
.endCity(destinationCity.getCityName())
|
.endCity(destinationCity.getCityName())
|
||||||
.endCityEnName(destinationCity.getCityename());
|
.endCityEnName(destinationCity.getCityename());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (leg.getCurrencyType() != null) {
|
if (leg.getCurrencyType() != null) {
|
||||||
scheduleDetailBuilder
|
scheduleDetailBuilder
|
||||||
|
|
|
@ -85,9 +85,7 @@ public class Leg {
|
||||||
}
|
}
|
||||||
|
|
||||||
public Leg queryEstimateAmount(EstimateAdapter estimateAdapter, String supplierName) {
|
public Leg queryEstimateAmount(EstimateAdapter estimateAdapter, String supplierName) {
|
||||||
if (this.getLegType().equals(LEG_TYPE_OTHER) || this.getLegType().equals(LEG_TYPE_TAXI)) {
|
if (!this.getLegType().equals(LEG_TYPE_OTHER) && !this.getLegType().equals(LEG_TYPE_TAXI)) {
|
||||||
|
|
||||||
} else {
|
|
||||||
this.estimateAmount = estimateAdapter.of(supplierName).amountEstimate(this);
|
this.estimateAmount = estimateAdapter.of(supplierName).amountEstimate(this);
|
||||||
}
|
}
|
||||||
return this;
|
return this;
|
||||||
|
|
Loading…
Reference in New Issue