commit
f124e2b218
|
@ -178,8 +178,8 @@ public class OrderDetailController {
|
|||
trainOrderDetail.setDetailId(newOrderNo);
|
||||
trainOrderDetail.setCreateTime(command.getCreateTime());
|
||||
trainOrderDetail.setId(null);
|
||||
if(trainOrderDetail.getSupplier().equals(SUPPLIER_L_Y_EXTENSION_NAME)){
|
||||
orderExtensionCreator.of(SUPPLIER_L_Y).updateTrainOrderDetailData(trainOrderDetail,command.getOrderInfo());
|
||||
if (trainOrderDetail.getSupplier().equals(SUPPLIER_L_Y_EXTENSION_NAME)) {
|
||||
orderExtensionCreator.of(SUPPLIER_L_Y).updateTrainOrderDetailData(trainOrderDetail, command.getOrderInfo());
|
||||
}
|
||||
}
|
||||
if (productType == 1) {
|
||||
|
@ -211,7 +211,7 @@ public class OrderDetailController {
|
|||
newCustomers.add(customer);
|
||||
}
|
||||
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());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,7 +16,10 @@ public interface LocationRepository {
|
|||
|
||||
List<Location> findAll();
|
||||
|
||||
Location findByCityId(Long cityId);
|
||||
Location findByCityIdAndLevelThree(Long cityId);
|
||||
|
||||
Location findByCityIdAndLevelFour(Long cityId);
|
||||
|
||||
|
||||
List<Location> findAllLevelThreeAndFour();
|
||||
|
||||
|
|
|
@ -56,7 +56,13 @@ public class CTripOrderDataAdapter implements OrderDataAdapter {
|
|||
if (hotelOrderInfoList != null && hotelOrderInfoList.size() == 1) {
|
||||
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();
|
||||
if (currency == null) {
|
||||
|
@ -68,8 +74,8 @@ public class CTripOrderDataAdapter implements OrderDataAdapter {
|
|||
.orderTime(hotelOrderInfoEntity.getOrderDate())
|
||||
.startTime(hotelOrderInfoEntity.getStartTime())
|
||||
.endTime(hotelOrderInfoEntity.getEndTime())
|
||||
.originId(byName.getLocationId())
|
||||
.destinationId(byName.getLocationId())
|
||||
.originId(originId)
|
||||
.destinationId(originId)
|
||||
.selfOrderNo(hotelOrderInfoEntity.getJourneyNo())
|
||||
.outOrderNo(hotelOrderInfoEntity.getOrderID())
|
||||
.orderStatus(translateHotelOrderStatus(hotelOrderInfoEntity.getOrderDetailStatus()))
|
||||
|
@ -93,7 +99,6 @@ public class CTripOrderDataAdapter implements OrderDataAdapter {
|
|||
originId = listByCityName.get(0).getLocationId();
|
||||
}
|
||||
|
||||
|
||||
Long destinationId;
|
||||
List<Location> arriveLocation = locationRepository.findListByCityName(flightInfo.getACityName());
|
||||
if (arriveLocation == null || arriveLocation.isEmpty()) {
|
||||
|
@ -138,8 +143,19 @@ public class CTripOrderDataAdapter implements OrderDataAdapter {
|
|||
CarQuickOrderInfoEntity carOrderInfo = carOrderInfoList.get(0);
|
||||
OrderProduct orderProduct = carOrderInfo.getOrderProduct();
|
||||
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)
|
||||
.carOrderDetailData(carOrderInfo)
|
||||
.currencyCode(CurrencyType.RENMINBI.getCode())
|
||||
|
@ -160,6 +176,17 @@ public class CTripOrderDataAdapter implements OrderDataAdapter {
|
|||
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) {
|
||||
return switch (trainOrderStatus) {
|
||||
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.LegConstant.LEG_TYPE_AIRPLANE;
|
||||
import static com.chint.infrastructure.constant.LocationConstant.LOCATION_TYPE_CITY;
|
||||
import static com.chint.infrastructure.constant.LocationConstant.LOCATION_TYPE_COUNTY;
|
||||
|
||||
@Repository
|
||||
public class LocationRepositoryImpl implements LocationRepository {
|
||||
|
@ -65,10 +66,15 @@ public class LocationRepositoryImpl implements LocationRepository {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Location findByCityId(Long cityId) {
|
||||
public Location findByCityIdAndLevelThree(Long cityId) {
|
||||
return jdbcLocationRepository.findByCityIdAndLevel(cityId, LOCATION_TYPE_CITY);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Location findByCityIdAndLevelFour(Long cityId) {
|
||||
return jdbcLocationRepository.findByCityIdAndLevel(cityId, LOCATION_TYPE_COUNTY);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Location> findAllLevelThreeAndFour() {
|
||||
return jdbcLocationRepository.findByLevelOrLevel(3, 4);
|
||||
|
|
Loading…
Reference in New Issue