同步代码
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,22 +232,28 @@ 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)) {
|
||||||
originCity = cityEntities.stream().filter(cityEntity -> cityEntity
|
|
||||||
.getCityName()
|
|
||||||
.equals(leg.getOriginLocation().getLocationName()))
|
|
||||||
.findFirst().get();
|
|
||||||
destinationCity = cityEntities.stream().filter(cityEntity -> cityEntity
|
|
||||||
.getCityName()
|
|
||||||
.equals(leg.getDestinationLocation().getLocationName()))
|
|
||||||
.findFirst().get();
|
|
||||||
|
|
||||||
scheduleDetailBuilder
|
if (leg.getOriginLocation() != null) {
|
||||||
.startCity(originCity.getCityName())
|
originCity = cityEntities.stream().filter(cityEntity -> cityEntity
|
||||||
.startCityName(originCity.getCityName())
|
.getCityName()
|
||||||
.startCityEnName(originCity.getCityename())
|
.equals(leg.getOriginLocation().getLocationName()))
|
||||||
.endCityName(destinationCity.getCityName())
|
.findFirst().get();
|
||||||
.endCity(destinationCity.getCityName())
|
scheduleDetailBuilder
|
||||||
.endCityEnName(destinationCity.getCityename());
|
.startCity(originCity.getCityName())
|
||||||
|
.startCityName(originCity.getCityName())
|
||||||
|
.startCityEnName(originCity.getCityename());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (leg.getDestinationLocation() != null) {
|
||||||
|
destinationCity = cityEntities.stream().filter(cityEntity -> cityEntity
|
||||||
|
.getCityName()
|
||||||
|
.equals(leg.getDestinationLocation().getLocationName()))
|
||||||
|
.findFirst().get();
|
||||||
|
scheduleDetailBuilder
|
||||||
|
.endCityName(destinationCity.getCityName())
|
||||||
|
.endCity(destinationCity.getCityName())
|
||||||
|
.endCityEnName(destinationCity.getCityename());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (leg.getCurrencyType() != null) {
|
if (leg.getCurrencyType() != null) {
|
||||||
|
|
|
@ -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