修复酒店数据回推无法成功的问题
This commit is contained in:
parent
38c62a9eea
commit
613272bd92
|
@ -178,8 +178,8 @@ public class OrderDetailController {
|
||||||
trainOrderDetail.setDetailId(newOrderNo);
|
trainOrderDetail.setDetailId(newOrderNo);
|
||||||
trainOrderDetail.setCreateTime(command.getCreateTime());
|
trainOrderDetail.setCreateTime(command.getCreateTime());
|
||||||
trainOrderDetail.setId(null);
|
trainOrderDetail.setId(null);
|
||||||
if(trainOrderDetail.getSupplier().equals(SUPPLIER_L_Y_EXTENSION_NAME)){
|
if (trainOrderDetail.getSupplier().equals(SUPPLIER_L_Y_EXTENSION_NAME)) {
|
||||||
orderExtensionCreator.of(SUPPLIER_L_Y).updateTrainOrderDetailData(trainOrderDetail,command.getOrderInfo());
|
orderExtensionCreator.of(SUPPLIER_L_Y).updateTrainOrderDetailData(trainOrderDetail, command.getOrderInfo());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (productType == 1) {
|
if (productType == 1) {
|
||||||
|
@ -211,7 +211,7 @@ public class OrderDetailController {
|
||||||
newCustomers.add(customer);
|
newCustomers.add(customer);
|
||||||
}
|
}
|
||||||
hotelOrderDetail.setCustomers(newCustomers);
|
hotelOrderDetail.setCustomers(newCustomers);
|
||||||
if(hotelOrderDetail.getSupplier().equals(SUPPLIER_L_Y_EXTENSION_NAME)){
|
if (orderDetail.getSupplierName().equals(SUPPLIER_L_Y_CN_NAME) && hotelOrderDetail.getSupplier().equals(SUPPLIER_L_Y_EXTENSION_NAME)) {
|
||||||
orderExtensionCreator.of(SUPPLIER_L_Y).updateHotelOrderDetailData(hotelOrderDetail, command.getOrderInfo());
|
orderExtensionCreator.of(SUPPLIER_L_Y).updateHotelOrderDetailData(hotelOrderDetail, command.getOrderInfo());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,10 @@ public interface LocationRepository {
|
||||||
|
|
||||||
List<Location> findAll();
|
List<Location> findAll();
|
||||||
|
|
||||||
Location findByCityId(Long cityId);
|
Location findByCityIdAndLevelThree(Long cityId);
|
||||||
|
|
||||||
|
Location findByCityIdAndLevelFour(Long cityId);
|
||||||
|
|
||||||
|
|
||||||
List<Location> findAllLevelThreeAndFour();
|
List<Location> findAllLevelThreeAndFour();
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,13 @@ public class CTripOrderDataAdapter implements OrderDataAdapter {
|
||||||
if (hotelOrderInfoList != null && hotelOrderInfoList.size() == 1) {
|
if (hotelOrderInfoList != null && hotelOrderInfoList.size() == 1) {
|
||||||
HotelOrderInfoEntity hotelOrderInfoEntity = hotelOrderInfoList.get(0);
|
HotelOrderInfoEntity hotelOrderInfoEntity = hotelOrderInfoList.get(0);
|
||||||
|
|
||||||
Location byName = locationRepository.findByCityId(Long.valueOf(hotelOrderInfoEntity.getCityID()));
|
|
||||||
|
Location location = getLocationId(hotelOrderInfoEntity.getCityName(),
|
||||||
|
Long.valueOf(hotelOrderInfoEntity.getCityID()));
|
||||||
|
Long originId = null;
|
||||||
|
if (location != null) {
|
||||||
|
originId = location.getLocationId();
|
||||||
|
}
|
||||||
|
|
||||||
String currency = hotelOrderInfoEntity.getCurrency();
|
String currency = hotelOrderInfoEntity.getCurrency();
|
||||||
if (currency == null) {
|
if (currency == null) {
|
||||||
|
@ -68,8 +74,8 @@ public class CTripOrderDataAdapter implements OrderDataAdapter {
|
||||||
.orderTime(hotelOrderInfoEntity.getOrderDate())
|
.orderTime(hotelOrderInfoEntity.getOrderDate())
|
||||||
.startTime(hotelOrderInfoEntity.getStartTime())
|
.startTime(hotelOrderInfoEntity.getStartTime())
|
||||||
.endTime(hotelOrderInfoEntity.getEndTime())
|
.endTime(hotelOrderInfoEntity.getEndTime())
|
||||||
.originId(byName.getLocationId())
|
.originId(originId)
|
||||||
.destinationId(byName.getLocationId())
|
.destinationId(originId)
|
||||||
.selfOrderNo(hotelOrderInfoEntity.getJourneyNo())
|
.selfOrderNo(hotelOrderInfoEntity.getJourneyNo())
|
||||||
.outOrderNo(hotelOrderInfoEntity.getOrderID())
|
.outOrderNo(hotelOrderInfoEntity.getOrderID())
|
||||||
.orderStatus(translateHotelOrderStatus(hotelOrderInfoEntity.getOrderDetailStatus()))
|
.orderStatus(translateHotelOrderStatus(hotelOrderInfoEntity.getOrderDetailStatus()))
|
||||||
|
@ -93,7 +99,6 @@ public class CTripOrderDataAdapter implements OrderDataAdapter {
|
||||||
originId = listByCityName.get(0).getLocationId();
|
originId = listByCityName.get(0).getLocationId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Long destinationId;
|
Long destinationId;
|
||||||
List<Location> arriveLocation = locationRepository.findListByCityName(flightInfo.getACityName());
|
List<Location> arriveLocation = locationRepository.findListByCityName(flightInfo.getACityName());
|
||||||
if (arriveLocation == null || arriveLocation.isEmpty()) {
|
if (arriveLocation == null || arriveLocation.isEmpty()) {
|
||||||
|
@ -138,8 +143,19 @@ public class CTripOrderDataAdapter implements OrderDataAdapter {
|
||||||
CarQuickOrderInfoEntity carOrderInfo = carOrderInfoList.get(0);
|
CarQuickOrderInfoEntity carOrderInfo = carOrderInfoList.get(0);
|
||||||
OrderProduct orderProduct = carOrderInfo.getOrderProduct();
|
OrderProduct orderProduct = carOrderInfo.getOrderProduct();
|
||||||
CarBasicInfo carBasicInfo = carOrderInfo.getBasicInfo();
|
CarBasicInfo carBasicInfo = carOrderInfo.getBasicInfo();
|
||||||
Location departCityName = locationRepository.findByCityId(Long.valueOf(orderProduct.getDepartAddress().getCityId()));
|
|
||||||
Location arriveCityName = locationRepository.findByCityId(Long.valueOf(orderProduct.getArriveAddress().getCityId()));
|
|
||||||
|
Long departCityId = Long.valueOf(orderProduct.getDepartAddress().getCityId());
|
||||||
|
Location departCityName = locationRepository.findByCityIdAndLevelThree(departCityId);
|
||||||
|
if(departCityName == null){
|
||||||
|
departCityName = locationRepository.findByCityIdAndLevelFour(departCityId);
|
||||||
|
}
|
||||||
|
|
||||||
|
Long arriveCityId = Long.valueOf(orderProduct.getArriveAddress().getCityId());
|
||||||
|
Location arriveCityName = locationRepository.findByCityIdAndLevelThree(arriveCityId);
|
||||||
|
if(arriveCityName == null){
|
||||||
|
arriveCityName = locationRepository.findByCityIdAndLevelFour(arriveCityId);
|
||||||
|
}
|
||||||
return builder.productType(LegConstant.LEG_TYPE_TAXI)
|
return builder.productType(LegConstant.LEG_TYPE_TAXI)
|
||||||
.carOrderDetailData(carOrderInfo)
|
.carOrderDetailData(carOrderInfo)
|
||||||
.currencyCode(CurrencyType.RENMINBI.getCode())
|
.currencyCode(CurrencyType.RENMINBI.getCode())
|
||||||
|
@ -160,6 +176,17 @@ public class CTripOrderDataAdapter implements OrderDataAdapter {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Location getLocationId(String cityName, Long cityId) {
|
||||||
|
Location byName = locationRepository.findByCityIdAndLevelThree(cityId);
|
||||||
|
if (byName == null) {
|
||||||
|
List<Location> listByCityName = locationRepository.findListByCityName(cityName);
|
||||||
|
if (listByCityName != null && !listByCityName.isEmpty()) {
|
||||||
|
byName = listByCityName.get(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return byName;
|
||||||
|
}
|
||||||
|
|
||||||
private Integer translateTrainOrderStatus(String trainOrderStatus) {
|
private Integer translateTrainOrderStatus(String trainOrderStatus) {
|
||||||
return switch (trainOrderStatus) {
|
return switch (trainOrderStatus) {
|
||||||
case "N" -> OrderConstant.ORDER_EVENT_PREPARE; //未提交
|
case "N" -> OrderConstant.ORDER_EVENT_PREPARE; //未提交
|
||||||
|
|
|
@ -18,6 +18,7 @@ import java.util.List;
|
||||||
import static com.chint.infrastructure.constant.CommonMessageConstant.NOT_FOUND;
|
import static com.chint.infrastructure.constant.CommonMessageConstant.NOT_FOUND;
|
||||||
import static com.chint.infrastructure.constant.LegConstant.LEG_TYPE_AIRPLANE;
|
import static com.chint.infrastructure.constant.LegConstant.LEG_TYPE_AIRPLANE;
|
||||||
import static com.chint.infrastructure.constant.LocationConstant.LOCATION_TYPE_CITY;
|
import static com.chint.infrastructure.constant.LocationConstant.LOCATION_TYPE_CITY;
|
||||||
|
import static com.chint.infrastructure.constant.LocationConstant.LOCATION_TYPE_COUNTY;
|
||||||
|
|
||||||
@Repository
|
@Repository
|
||||||
public class LocationRepositoryImpl implements LocationRepository {
|
public class LocationRepositoryImpl implements LocationRepository {
|
||||||
|
@ -65,10 +66,15 @@ public class LocationRepositoryImpl implements LocationRepository {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Location findByCityId(Long cityId) {
|
public Location findByCityIdAndLevelThree(Long cityId) {
|
||||||
return jdbcLocationRepository.findByCityIdAndLevel(cityId, LOCATION_TYPE_CITY);
|
return jdbcLocationRepository.findByCityIdAndLevel(cityId, LOCATION_TYPE_CITY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Location findByCityIdAndLevelFour(Long cityId) {
|
||||||
|
return jdbcLocationRepository.findByCityIdAndLevel(cityId, LOCATION_TYPE_COUNTY);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Location> findAllLevelThreeAndFour() {
|
public List<Location> findAllLevelThreeAndFour() {
|
||||||
return jdbcLocationRepository.findByLevelOrLevel(3, 4);
|
return jdbcLocationRepository.findByLevelOrLevel(3, 4);
|
||||||
|
|
Loading…
Reference in New Issue