已合并 PR 10036: 同程转发配置,订单明细金额问题修复等
This commit is contained in:
commit
c3ba40e925
|
@ -30,6 +30,7 @@ import java.util.List;
|
|||
import java.util.Optional;
|
||||
|
||||
import static com.chint.infrastructure.constant.CommonMessageConstant.SUCCESS;
|
||||
import static com.chint.infrastructure.constant.OrderConstant.ORDER_EVENT_CHANGE;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/OrderDetail")
|
||||
|
@ -140,7 +141,7 @@ public class OrderDetailController {
|
|||
if (productType == 2) {
|
||||
HotelOrderDetail hotelOrderDetail = orderDetail.getHotelOrderDetail();
|
||||
hotelOrderDetail.setOrderAmount(command.getAmount());
|
||||
hotelOrderDetail.setOrderStatus(type);
|
||||
hotelOrderDetail.setOrderStatus("3");
|
||||
hotelOrderDetail.setOrderNo(newOrderNo);
|
||||
hotelOrderDetail.setDetailId(newOrderNo);
|
||||
hotelOrderDetail.setCreateTime(command.getCreateTime());
|
||||
|
@ -156,7 +157,7 @@ public class OrderDetailController {
|
|||
if (productType == 3) {
|
||||
CarOrderDetail carOrderDetail = orderDetail.getCarOrderDetail();
|
||||
carOrderDetail.setOrderAmount(command.getAmount());
|
||||
carOrderDetail.setOrderStatus(type);
|
||||
carOrderDetail.setOrderStatus("3");
|
||||
carOrderDetail.setOrderNo(newOrderNo);
|
||||
carOrderDetail.setDetailId(newOrderNo);
|
||||
carOrderDetail.setCreateTime(command.getCreateTime());
|
||||
|
|
|
@ -17,12 +17,14 @@ import org.springframework.stereotype.Component;
|
|||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static com.chint.infrastructure.constant.CommonMessageConstant.SUCCESS;
|
||||
import static com.chint.infrastructure.constant.FSSCConstant.FSSC_ORDER_STATUS_CANCEL;
|
||||
import static com.chint.infrastructure.constant.SupplierNameConstant.SUPPLIER_L_Y;
|
||||
|
||||
@Component
|
||||
public class OrderDetailQuery {
|
||||
|
@ -34,75 +36,171 @@ public class OrderDetailQuery {
|
|||
private RouteRepository routeRepository;
|
||||
|
||||
|
||||
// public Result<PageResult<Object>> orderDetailInfoPageQuery(AuthenticationSignDto authenticationDto) {
|
||||
// Integer productType = authenticationDto.getProductType();
|
||||
// String systemType = authenticationDto.getSystemType();
|
||||
// Integer pageSize = authenticationDto.getPageSize();
|
||||
// Integer pageNum = authenticationDto.getPageNum();
|
||||
//
|
||||
// DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
// LocalDateTime targetTimeBegin = LocalDateTime.parse(authenticationDto.getStartTime(), formatter);
|
||||
// LocalDateTime targetTimeEnd = LocalDateTime.parse(authenticationDto.getEndTime(), formatter);
|
||||
// List<OrderDetail> orderDetailList = orderDetailRepository.findByUpdateTimeBetween(targetTimeBegin, targetTimeEnd);
|
||||
// List<Object> orderDetailResList = new ArrayList<>();
|
||||
// for (OrderDetail orderDetail : orderDetailList) {
|
||||
// if (productType == 1) {
|
||||
// FlightOrderDetail flightOrderDetail = orderDetail.getFlightOrderDetail();
|
||||
//
|
||||
// if (flightOrderDetail != null) {
|
||||
// String receiptsNum = flightOrderDetail.getReceiptsNum();
|
||||
// if (receiptsNum != null) {
|
||||
// flightOrderDetail.setReceiptsNum(regetReceiptsNum(receiptsNum));
|
||||
// }
|
||||
// if (flightOrderDetail.getOrderStatus() != null && flightOrderDetail.getBelongSysType() != null && flightOrderDetail.getBelongSysType().equals(systemType)) {
|
||||
// orderDetailResList.add(flightOrderDetail);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// if (productType == 2) {
|
||||
// HotelOrderDetail hotelOrderDetail = orderDetail.getHotelOrderDetail();
|
||||
// if (hotelOrderDetail != null) {
|
||||
// String receiptsNum = hotelOrderDetail.getReceiptsNum();
|
||||
// if (receiptsNum != null) {
|
||||
// hotelOrderDetail.setReceiptsNum(regetReceiptsNum(receiptsNum));
|
||||
// }
|
||||
// if (hotelOrderDetail.getBelongSysType() != null && hotelOrderDetail.getBelongSysType().equals(systemType)) {
|
||||
// //这里添加过滤逻辑 ,如果该订单为同程酒店订单 , 并且金额为0 判断为 临时订单数据
|
||||
// if (orderDetail.getSupplierName().equals(SUPPLIER_L_Y) && Double.parseDouble(hotelOrderDetail.getOrderAmount()) == 0)
|
||||
// continue;
|
||||
// orderDetailResList.add(hotelOrderDetail);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// if (productType == 3) {
|
||||
// TrainOrderDetail trainOrderDetail = orderDetail.getTrainOrderDetail();
|
||||
// if (trainOrderDetail != null) {
|
||||
// String receiptsNum = trainOrderDetail.getReceiptsNum();
|
||||
// if (receiptsNum != null) {
|
||||
// trainOrderDetail.setReceiptsNum(regetReceiptsNum(receiptsNum));
|
||||
// }
|
||||
// if (trainOrderDetail.getOrderStatus() != null && trainOrderDetail.getBelongSysType() != null && trainOrderDetail.getBelongSysType().equals(systemType)) {
|
||||
// orderDetailResList.add(trainOrderDetail);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// if (productType == 4) {
|
||||
// CarOrderDetail carOrderDetail = orderDetail.getCarOrderDetail();
|
||||
// if (carOrderDetail != null) {
|
||||
// String receiptsNum = carOrderDetail.getReceiptsNum();
|
||||
// if (receiptsNum != null) {
|
||||
// carOrderDetail.setReceiptsNum(regetReceiptsNum(receiptsNum));
|
||||
// }
|
||||
// if (carOrderDetail.getOrderStatus() != null && carOrderDetail.getBelongSysType() != null && carOrderDetail.getBelongSysType().equals(systemType)) {
|
||||
// orderDetailResList.add(carOrderDetail);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// List<Object> newres2 = orderDetailResList.stream().skip((long) (pageNum - 1) * pageSize).limit(pageSize).toList();
|
||||
//
|
||||
// return Result.Success(SUCCESS, PageResult.totalPageNum(Long.parseLong(String.valueOf(orderDetailResList.size())), newres2));
|
||||
// }
|
||||
|
||||
public Result<PageResult<Object>> orderDetailInfoPageQuery(AuthenticationSignDto authenticationDto) {
|
||||
Integer productType = authenticationDto.getProductType();
|
||||
String systemType = authenticationDto.getSystemType();
|
||||
Integer pageSize = authenticationDto.getPageSize();
|
||||
Integer pageNum = authenticationDto.getPageNum();
|
||||
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
LocalDateTime targetTimeBegin = LocalDateTime.parse(authenticationDto.getStartTime(), formatter);
|
||||
LocalDateTime targetTimeEnd = LocalDateTime.parse(authenticationDto.getEndTime(), formatter);
|
||||
List<OrderDetail> orderDetailList = orderDetailRepository.findByUpdateTimeBetween(targetTimeBegin,
|
||||
targetTimeEnd);
|
||||
List<Object> orderDetailResList = new ArrayList<>();
|
||||
for (OrderDetail orderDetail : orderDetailList) {
|
||||
if (productType == 1) {
|
||||
FlightOrderDetail flightOrderDetail = orderDetail.getFlightOrderDetail();
|
||||
|
||||
if (flightOrderDetail != null) {
|
||||
String receiptsNum = flightOrderDetail.getReceiptsNum();
|
||||
if (receiptsNum != null){
|
||||
flightOrderDetail.setReceiptsNum(regetReceiptsNum(receiptsNum));
|
||||
}
|
||||
if (flightOrderDetail.getBelongSysType() != null && flightOrderDetail.getBelongSysType().equals(systemType)) {
|
||||
orderDetailResList.add(flightOrderDetail);
|
||||
}
|
||||
}
|
||||
List<OrderDetail> orderDetailList = orderDetailRepository.findByUpdateTimeBetween(targetTimeBegin, targetTimeEnd);
|
||||
|
||||
Stream<Object> orderDetailStream = orderDetailList.stream().map(orderDetail -> {
|
||||
switch (productType) {
|
||||
case 1:
|
||||
return processFlightOrderDetail(orderDetail, systemType);
|
||||
case 2:
|
||||
return processHotelOrderDetail(orderDetail, systemType);
|
||||
case 3:
|
||||
return processTrainOrderDetail(orderDetail, systemType);
|
||||
case 4:
|
||||
return processCarOrderDetail(orderDetail, systemType);
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
if (productType == 2) {
|
||||
HotelOrderDetail hotelOrderDetail = orderDetail.getHotelOrderDetail();
|
||||
if (hotelOrderDetail != null) {
|
||||
String receiptsNum = hotelOrderDetail.getReceiptsNum();
|
||||
if (receiptsNum != null){
|
||||
hotelOrderDetail.setReceiptsNum(regetReceiptsNum(receiptsNum));
|
||||
}
|
||||
if (hotelOrderDetail.getBelongSysType() != null && hotelOrderDetail.getBelongSysType().equals(systemType)) {
|
||||
orderDetailResList.add(hotelOrderDetail);
|
||||
}
|
||||
}
|
||||
}).filter(Objects::nonNull);
|
||||
|
||||
List<Object> res = orderDetailStream.toList();
|
||||
|
||||
List<Object> paginatedResults = res.stream()
|
||||
.skip((long) (pageNum - 1) * pageSize)
|
||||
.limit(pageSize)
|
||||
.toList();
|
||||
|
||||
return Result.Success(SUCCESS, PageResult.totalPageNum((long) res.size(), paginatedResults));
|
||||
}
|
||||
|
||||
private Object processHotelOrderDetail(OrderDetail orderDetail, String systemType) {
|
||||
HotelOrderDetail hotelOrderDetail = orderDetail.getHotelOrderDetail();
|
||||
if (hotelOrderDetail != null &&
|
||||
!hotelOrderDetail.getOrderStatus().equals(FSSC_ORDER_STATUS_CANCEL) &&
|
||||
systemType.equals(hotelOrderDetail.getBelongSysType())) {
|
||||
String receiptsNum = hotelOrderDetail.getReceiptsNum();
|
||||
if (receiptsNum != null) {
|
||||
hotelOrderDetail.setReceiptsNum(regetReceiptsNum(receiptsNum));
|
||||
}
|
||||
if (productType == 3) {
|
||||
TrainOrderDetail trainOrderDetail = orderDetail.getTrainOrderDetail();
|
||||
if (trainOrderDetail != null) {
|
||||
String receiptsNum = trainOrderDetail.getReceiptsNum();
|
||||
if (receiptsNum != null){
|
||||
trainOrderDetail.setReceiptsNum(regetReceiptsNum(receiptsNum));
|
||||
}
|
||||
if (trainOrderDetail.getBelongSysType() != null && trainOrderDetail.getBelongSysType().equals(systemType)) {
|
||||
orderDetailResList.add(trainOrderDetail);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (productType == 4) {
|
||||
CarOrderDetail carOrderDetail = orderDetail.getCarOrderDetail();
|
||||
if (carOrderDetail != null) {
|
||||
String receiptsNum = carOrderDetail.getReceiptsNum();
|
||||
if (receiptsNum != null){
|
||||
carOrderDetail.setReceiptsNum(regetReceiptsNum(receiptsNum));
|
||||
}
|
||||
if (carOrderDetail.getBelongSysType() != null && carOrderDetail.getBelongSysType().equals(systemType)) {
|
||||
orderDetailResList.add(carOrderDetail);
|
||||
}
|
||||
}
|
||||
// 仅当订单是“临时订单数据”时,不加入结果列表
|
||||
if (orderDetail.getSupplierName().equals(SUPPLIER_L_Y) &&
|
||||
Double.parseDouble(hotelOrderDetail.getOrderAmount()) == 0) {
|
||||
return null;
|
||||
}
|
||||
return hotelOrderDetail;
|
||||
}
|
||||
List<Object> newres2 = orderDetailResList.stream().skip((long) (pageNum - 1) * pageSize)
|
||||
.limit(pageSize).toList();
|
||||
return null;
|
||||
}
|
||||
|
||||
return Result.Success(SUCCESS, PageResult.totalPageNum(Long.parseLong(
|
||||
String.valueOf(orderDetailResList.size())
|
||||
), newres2));
|
||||
private Object processTrainOrderDetail(OrderDetail orderDetail, String systemType) {
|
||||
TrainOrderDetail trainOrderDetail = orderDetail.getTrainOrderDetail();
|
||||
if (trainOrderDetail != null &&
|
||||
!trainOrderDetail.getOrderStatus().equals(FSSC_ORDER_STATUS_CANCEL) &&
|
||||
systemType.equals(trainOrderDetail.getBelongSysType())) {
|
||||
String receiptsNum = trainOrderDetail.getReceiptsNum();
|
||||
if (receiptsNum != null) {
|
||||
trainOrderDetail.setReceiptsNum(regetReceiptsNum(receiptsNum));
|
||||
}
|
||||
return trainOrderDetail;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private Object processCarOrderDetail(OrderDetail orderDetail, String systemType) {
|
||||
CarOrderDetail carOrderDetail = orderDetail.getCarOrderDetail();
|
||||
if (carOrderDetail != null &&
|
||||
!carOrderDetail.getOrderStatus().equals(FSSC_ORDER_STATUS_CANCEL) &&
|
||||
systemType.equals(carOrderDetail.getBelongSysType())) {
|
||||
String receiptsNum = carOrderDetail.getReceiptsNum();
|
||||
if (receiptsNum != null) {
|
||||
carOrderDetail.setReceiptsNum(regetReceiptsNum(receiptsNum));
|
||||
}
|
||||
return carOrderDetail;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private Object processFlightOrderDetail(OrderDetail orderDetail, String systemType) {
|
||||
FlightOrderDetail flightOrderDetail = orderDetail.getFlightOrderDetail();
|
||||
if (flightOrderDetail != null &&
|
||||
!flightOrderDetail.getOrderStatus().equals(FSSC_ORDER_STATUS_CANCEL) &&
|
||||
systemType.equals(flightOrderDetail.getBelongSysType())) {
|
||||
String receiptsNum = flightOrderDetail.getReceiptsNum();
|
||||
if (receiptsNum != null) {
|
||||
flightOrderDetail.setReceiptsNum(regetReceiptsNum(receiptsNum));
|
||||
}
|
||||
return flightOrderDetail;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
@ -112,19 +210,15 @@ public class OrderDetailQuery {
|
|||
Integer ifNotStart = orderDetailQueryParam.getIfNotStart();
|
||||
User currentUser = BaseContext.getCurrentUser();
|
||||
List<RouteOrder> byEmployeeNo = routeRepository.findByEmployeeNo(currentUser.getEmployeeNo());
|
||||
Stream<OrderDetail> details = byEmployeeNo
|
||||
.stream()
|
||||
.filter(it->it.getApproveOrderNo() != null && it.getApproveOrderNo().getActualOrderNo() != null)
|
||||
.filter(it->it.getOrderDetails() != null)
|
||||
.flatMap(it -> it.getOrderDetails().stream());
|
||||
Stream<OrderDetail> details = byEmployeeNo.stream().filter(it -> it.getApproveOrderNo() != null && it.getApproveOrderNo().getActualOrderNo() != null).filter(it -> it.getOrderDetails() != null).flatMap(it -> it.getOrderDetails().stream());
|
||||
|
||||
List<Integer> productTypes = orderDetailQueryParam.getProductTypes();
|
||||
if (productTypes != null && !productTypes.isEmpty()) {
|
||||
details = details.filter(it -> productTypes.contains(it.getProductType()));
|
||||
}
|
||||
|
||||
if(ifNotStart != null && ifNotStart.equals(1)){
|
||||
details = details.filter(it->it.getStartTime() != null).filter(it->it.getStartTime().isAfter(LocalDateTime.now()));
|
||||
if (ifNotStart != null && ifNotStart.equals(1)) {
|
||||
details = details.filter(it -> it.getStartTime() != null).filter(it -> it.getStartTime().isAfter(LocalDateTime.now()));
|
||||
}
|
||||
|
||||
// if(ifStart != null && ifStart.equals(1)){
|
||||
|
@ -133,21 +227,16 @@ public class OrderDetailQuery {
|
|||
|
||||
List<OrderDetail> res = details.toList();
|
||||
Integer total = res.size();
|
||||
List<OrderDetailRes> OrderDetailResList = res.stream()
|
||||
.sorted(Comparator.comparing(OrderDetail::getUpdateTime).reversed())
|
||||
.skip((long) (pageNum - 1) * pageSize)
|
||||
.limit(pageSize)
|
||||
.map(OrderDetailMapper::copyFromExtension)
|
||||
.toList();
|
||||
List<OrderDetailRes> OrderDetailResList = res.stream().sorted(Comparator.comparing(OrderDetail::getUpdateTime).reversed()).skip((long) (pageNum - 1) * pageSize).limit(pageSize).map(OrderDetailMapper::copyFromExtension).toList();
|
||||
return new PageResult<>(total, OrderDetailResList);
|
||||
}
|
||||
|
||||
private String regetReceiptsNum(String receiptsNum){
|
||||
if (receiptsNum.contains("-")){
|
||||
private String regetReceiptsNum(String receiptsNum) {
|
||||
if (receiptsNum.contains("-")) {
|
||||
String[] parts = receiptsNum.split("-");
|
||||
String result = parts[1];
|
||||
return result;
|
||||
}else {
|
||||
} else {
|
||||
return receiptsNum;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@ import com.chint.application.queryies.estimate.EstimatePrice;
|
|||
import com.chint.domain.aggregates.location.CityEntity;
|
||||
import com.chint.domain.aggregates.order.*;
|
||||
import com.chint.domain.aggregates.user.User;
|
||||
import com.chint.domain.exceptions.NotFoundException;
|
||||
import com.chint.domain.repository.CityRepository;
|
||||
import com.chint.domain.repository.RouteRepository;
|
||||
import com.chint.domain.repository.UserRepository;
|
||||
|
@ -34,6 +35,7 @@ import java.util.Objects;
|
|||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static com.chint.infrastructure.constant.CommonMessageConstant.NOT_FOUND;
|
||||
import static com.chint.infrastructure.constant.FSSCConstant.*;
|
||||
import static com.chint.infrastructure.constant.LegConstant.LEG_TYPE_HOTEL;
|
||||
import static com.chint.infrastructure.constant.LegConstant.LEG_TYPE_OTHER;
|
||||
|
@ -381,7 +383,7 @@ public class OrderQuery {
|
|||
originCity = cityEntities.stream().filter(cityEntity -> cityEntity
|
||||
.getCityName()
|
||||
.equals(leg.getOriginLocation().getLocationName()))
|
||||
.findFirst().get();
|
||||
.findFirst().orElseThrow(() -> new NotFoundException(NOT_FOUND));
|
||||
scheduleDetailBuilder
|
||||
.startCity(originCity.getCityName())
|
||||
.startCityName(originCity.getCityName())
|
||||
|
@ -392,7 +394,7 @@ public class OrderQuery {
|
|||
destinationCity = cityEntities.stream().filter(cityEntity -> cityEntity
|
||||
.getCityName()
|
||||
.equals(leg.getDestinationLocation().getLocationName()))
|
||||
.findFirst().get();
|
||||
.findFirst().orElseThrow(() -> new NotFoundException(NOT_FOUND));
|
||||
scheduleDetailBuilder
|
||||
.endCityName(destinationCity.getCityName())
|
||||
.endCity(destinationCity.getCityName())
|
||||
|
@ -506,7 +508,9 @@ public class OrderQuery {
|
|||
}
|
||||
|
||||
public List<RouteOrderPageRes> queryNotSubmit(OrderQueryData queryData) {
|
||||
User currentUser = BaseContext.getCurrentUser();
|
||||
List<RouteOrder> routeOrders = routeRepository.findByActualOrderNoNotNull(queryData);
|
||||
routeOrders = routeOrders.stream().filter(it -> it.getUserId().equals(currentUser.getEmployeeNo())).toList();
|
||||
routeOrders.forEach(route -> orderDomainService.queryLocation(route.getLegItems()));
|
||||
Stream<RouteOrder> stream = routeOrders.stream();
|
||||
if (queryData.getSupplierName() != null) {
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
package com.chint.domain.aggregates.location.basedata;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.data.annotation.Id;
|
||||
import org.springframework.data.relational.core.mapping.Table;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
@Table("c_trip_district_info")
|
||||
public class DistrictPOIInfoEntity implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = -3622189228854599876L;
|
||||
@Id
|
||||
private Long id;
|
||||
private Long districtId;
|
||||
private String districtName;
|
||||
private String districtEnName;
|
||||
}
|
|
@ -44,12 +44,25 @@ public class PrefectureLevelCityInfoEntity implements Serializable {
|
|||
@MappedCollection(idColumn = "pre_level_city_id", keyColumn = "pre_level_city_key")
|
||||
private List<CountryLevelInfoEntity> countryLevelInfoEntities;
|
||||
|
||||
@MappedCollection(idColumn = "pre_level_city_id", keyColumn = "pre_level_city_key")
|
||||
private List<DistrictPOIInfoEntity> districtPOIInfoEntities;
|
||||
|
||||
public static PrefectureLevelCityInfoEntity of(PrefectureLevelCityInfo prefectureLevelCityInfo) {
|
||||
PrefectureLevelCityInfoEntity poiDataInfoEntity = BeanUtil
|
||||
.copyProperties(prefectureLevelCityInfo, PrefectureLevelCityInfoEntity.class);
|
||||
return poiDataInfoEntity;
|
||||
}
|
||||
|
||||
public PrefectureLevelCityInfoEntity addDistrict(DistrictPOIInfoEntity districtPOIInfoEntity) {
|
||||
if (this.districtPOIInfoEntities == null) {
|
||||
this.districtPOIInfoEntities = new ArrayList<>();
|
||||
}
|
||||
this.districtPOIInfoEntities.add(districtPOIInfoEntity);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public PrefectureLevelCityInfoEntity addAirportPOIInfoEntity(AirportPOIInfoEntity airportPOIInfoEntity) {
|
||||
if (this.airportPOIInfoEntities == null) {
|
||||
this.airportPOIInfoEntities = new ArrayList<>();
|
||||
|
|
|
@ -117,6 +117,9 @@ public class OrderDetail implements Serializable {
|
|||
}
|
||||
|
||||
public OrderEvent getLastEvent() {
|
||||
if(this.orderEventList == null){
|
||||
return null;
|
||||
}
|
||||
return this.orderEventList.isEmpty() ? null : this.orderEventList.get(this.orderEventList.size() - 1);
|
||||
// .stream()
|
||||
// .max(Comparator.comparingLong(OrderEvent::getOrderEventId))
|
||||
|
|
|
@ -11,6 +11,7 @@ import java.io.Serial;
|
|||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static com.chint.infrastructure.constant.FSSCConstant.*;
|
||||
import static com.chint.infrastructure.constant.OrderConstant.*;
|
||||
|
||||
@Data
|
||||
|
@ -39,12 +40,12 @@ public class OrderEvent implements Serializable {
|
|||
case ORDER_EVENT_PREPARE -> OrderConstant.ORDER_EVENT_PREPARE_NAME;
|
||||
case ORDER_EVENT_PAYED -> OrderConstant.ORDER_EVENT_PAYED_NAME;
|
||||
case ORDER_EVENT_CHANGE -> OrderConstant.ORDER_EVENT_CHANGE_NAME;
|
||||
case OrderConstant.ORDER_EVENT_CANCEL -> OrderConstant.ORDER_EVENT_CANCEL_NAME;
|
||||
case OrderConstant.ORDER_EVENT_ORDERED -> OrderConstant.ORDER_EVENT_ORDERED_NAME;
|
||||
case OrderConstant.ORDER_EVENT_REFUND -> OrderConstant.ORDER_EVENT_REFUND_NAME;
|
||||
case OrderConstant.ORDER_EVENT_UNKNOWN -> OrderConstant.ORDER_EVENT_UNKNOWN_NAME;
|
||||
case OrderConstant.ORDER_EVENT_FINISH -> OrderConstant.ORDER_EVENT_FINISH_NAME;
|
||||
case OrderConstant.ORDER_EVENT_ETA -> OrderConstant.ORDER_EVENT_ETA_NAME;
|
||||
case ORDER_EVENT_CANCEL -> OrderConstant.ORDER_EVENT_CANCEL_NAME;
|
||||
case ORDER_EVENT_ORDERED -> OrderConstant.ORDER_EVENT_ORDERED_NAME;
|
||||
case ORDER_EVENT_REFUND -> OrderConstant.ORDER_EVENT_REFUND_NAME;
|
||||
case ORDER_EVENT_UNKNOWN -> OrderConstant.ORDER_EVENT_UNKNOWN_NAME;
|
||||
case ORDER_EVENT_FINISH -> OrderConstant.ORDER_EVENT_FINISH_NAME;
|
||||
case ORDER_EVENT_ETA -> OrderConstant.ORDER_EVENT_ETA_NAME;
|
||||
default -> "未知事件";
|
||||
};
|
||||
}
|
||||
|
@ -64,6 +65,130 @@ public class OrderEvent implements Serializable {
|
|||
};
|
||||
}
|
||||
|
||||
public String mapToFlightOrderDetailStatus(){
|
||||
return switch (this.eventType) {
|
||||
case ORDER_EVENT_PREPARE -> FSSC_FLIGHT_STATUS_SUCCESS;
|
||||
case ORDER_EVENT_PAYED -> FSSC_FLIGHT_STATUS_SUCCESS;
|
||||
case ORDER_EVENT_CHANGE -> FSSC_FLIGHT_STATUS_CHANGE;
|
||||
case ORDER_EVENT_CANCEL -> FSSC_ORDER_STATUS_CANCEL;
|
||||
case ORDER_EVENT_ORDERED -> FSSC_FLIGHT_STATUS_SUCCESS;
|
||||
case ORDER_EVENT_REFUND -> FSSC_FLIGHT_STATUS_REFUND;
|
||||
case ORDER_EVENT_UNKNOWN -> FSSC_FLIGHT_STATUS_SUCCESS;
|
||||
case ORDER_EVENT_FINISH -> FSSC_FLIGHT_STATUS_SUCCESS;
|
||||
case ORDER_EVENT_ETA -> FSSC_FLIGHT_STATUS_SUCCESS;
|
||||
default -> "未知事件";
|
||||
};
|
||||
}
|
||||
|
||||
public static String mapToFlightOrderDetailStatus(Integer eventType){
|
||||
return switch (eventType) {
|
||||
case ORDER_EVENT_PREPARE -> FSSC_FLIGHT_STATUS_SUCCESS;
|
||||
case ORDER_EVENT_PAYED -> FSSC_FLIGHT_STATUS_SUCCESS;
|
||||
case ORDER_EVENT_CHANGE -> FSSC_FLIGHT_STATUS_CHANGE;
|
||||
case ORDER_EVENT_CANCEL -> FSSC_ORDER_STATUS_CANCEL;
|
||||
case ORDER_EVENT_ORDERED -> FSSC_FLIGHT_STATUS_SUCCESS;
|
||||
case ORDER_EVENT_REFUND -> FSSC_FLIGHT_STATUS_REFUND;
|
||||
case ORDER_EVENT_UNKNOWN -> FSSC_FLIGHT_STATUS_SUCCESS;
|
||||
case ORDER_EVENT_FINISH -> FSSC_FLIGHT_STATUS_SUCCESS;
|
||||
case ORDER_EVENT_ETA -> FSSC_FLIGHT_STATUS_SUCCESS;
|
||||
default -> "未知事件";
|
||||
};
|
||||
}
|
||||
|
||||
public String mapToHotelOrderDetailStatus(){
|
||||
return switch (this.eventType) {
|
||||
case ORDER_EVENT_PREPARE -> FSSC_HOTEL_STATUS_SUCCESS; //未下单 改成3
|
||||
case ORDER_EVENT_PAYED -> FSSC_HOTEL_STATUS_SUCCESS;
|
||||
case ORDER_EVENT_CHANGE -> FSSC_HOTEL_STATUS_SUCCESS;
|
||||
case ORDER_EVENT_CANCEL -> FSSC_HOTEL_STATUS_SUCCESS; //e额外生成的单子为3 退票虽然是3 返回为1
|
||||
case ORDER_EVENT_ORDERED -> FSSC_HOTEL_STATUS_SUCCESS;
|
||||
case ORDER_EVENT_REFUND -> FSSC_HOTEL_STATUS_SUCCESS;
|
||||
case ORDER_EVENT_UNKNOWN -> FSSC_ORDER_STATUS_CANCEL;
|
||||
case ORDER_EVENT_FINISH -> FSSC_HOTEL_STATUS_SUCCESS;
|
||||
case ORDER_EVENT_ETA -> FSSC_HOTEL_STATUS_SUCCESS;
|
||||
default -> "未知事件";
|
||||
};
|
||||
}
|
||||
|
||||
public static String mapToHotelOrderDetailStatus(Integer eventType){
|
||||
return switch (eventType) {
|
||||
case ORDER_EVENT_PREPARE -> FSSC_HOTEL_STATUS_REFUND; //未下单 改成3
|
||||
case ORDER_EVENT_PAYED -> FSSC_HOTEL_STATUS_SUCCESS;
|
||||
case ORDER_EVENT_CHANGE -> FSSC_HOTEL_STATUS_SUCCESS;
|
||||
case ORDER_EVENT_CANCEL -> FSSC_HOTEL_STATUS_SUCCESS; //e额外生成的单子为3 退票虽然是3 返回为1
|
||||
case ORDER_EVENT_ORDERED -> FSSC_HOTEL_STATUS_SUCCESS;
|
||||
case ORDER_EVENT_REFUND -> FSSC_HOTEL_STATUS_SUCCESS;
|
||||
case ORDER_EVENT_UNKNOWN -> FSSC_ORDER_STATUS_CANCEL;
|
||||
case ORDER_EVENT_FINISH -> FSSC_HOTEL_STATUS_SUCCESS;
|
||||
case ORDER_EVENT_ETA -> FSSC_HOTEL_STATUS_SUCCESS;
|
||||
default -> "未知事件";
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
public String mapToTrainOrderDetailStatus(){
|
||||
return switch (this.eventType) {
|
||||
case ORDER_EVENT_PREPARE -> FSSC_TRAIN_STATUS_SUCCESS;
|
||||
case ORDER_EVENT_PAYED -> FSSC_TRAIN_STATUS_SUCCESS;
|
||||
case ORDER_EVENT_CHANGE -> FSSC_TRAIN_STATUS_CHANGE;
|
||||
case ORDER_EVENT_CANCEL -> FSSC_ORDER_STATUS_CANCEL;
|
||||
case ORDER_EVENT_ORDERED -> FSSC_TRAIN_STATUS_SUCCESS;
|
||||
case ORDER_EVENT_REFUND -> FSSC_TRAIN_STATUS_REFUND;
|
||||
case ORDER_EVENT_UNKNOWN -> FSSC_ORDER_STATUS_CANCEL;
|
||||
case ORDER_EVENT_FINISH -> FSSC_TRAIN_STATUS_SUCCESS;
|
||||
case ORDER_EVENT_ETA -> FSSC_TRAIN_STATUS_SUCCESS;
|
||||
default -> "未知事件";
|
||||
};
|
||||
}
|
||||
|
||||
public static String mapToTrainOrderDetailStatus(Integer eventType){
|
||||
return switch (eventType) {
|
||||
case ORDER_EVENT_PREPARE -> FSSC_TRAIN_STATUS_SUCCESS;
|
||||
case ORDER_EVENT_PAYED -> FSSC_TRAIN_STATUS_SUCCESS;
|
||||
case ORDER_EVENT_CHANGE -> FSSC_TRAIN_STATUS_CHANGE;
|
||||
case ORDER_EVENT_CANCEL -> FSSC_ORDER_STATUS_CANCEL;
|
||||
case ORDER_EVENT_ORDERED -> FSSC_TRAIN_STATUS_SUCCESS;
|
||||
case ORDER_EVENT_REFUND -> FSSC_TRAIN_STATUS_REFUND;
|
||||
case ORDER_EVENT_UNKNOWN -> FSSC_ORDER_STATUS_CANCEL;
|
||||
case ORDER_EVENT_FINISH -> FSSC_TRAIN_STATUS_SUCCESS;
|
||||
case ORDER_EVENT_ETA -> FSSC_TRAIN_STATUS_SUCCESS;
|
||||
default -> "未知事件";
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
public String mapToCarOrderDetailStatus(){
|
||||
return switch (this.eventType) {
|
||||
case ORDER_EVENT_PREPARE -> FSSC_CAR_STATUS_SUCCESS;
|
||||
case ORDER_EVENT_PAYED -> FSSC_CAR_STATUS_SUCCESS;
|
||||
case ORDER_EVENT_CHANGE -> FSSC_CAR_STATUS_SUCCESS;
|
||||
case ORDER_EVENT_CANCEL -> FSSC_CAR_STATUS_SUCCESS;
|
||||
case ORDER_EVENT_ORDERED -> FSSC_CAR_STATUS_SUCCESS;
|
||||
case ORDER_EVENT_REFUND -> FSSC_CAR_STATUS_SUCCESS;
|
||||
case ORDER_EVENT_UNKNOWN -> FSSC_ORDER_STATUS_CANCEL;
|
||||
case ORDER_EVENT_FINISH -> FSSC_CAR_STATUS_SUCCESS;
|
||||
case ORDER_EVENT_ETA -> FSSC_CAR_STATUS_SUCCESS;
|
||||
default -> "未知事件";
|
||||
};
|
||||
}
|
||||
|
||||
public static String mapToCarOrderDetailStatus(Integer eventType){
|
||||
return switch (eventType) {
|
||||
case ORDER_EVENT_PREPARE -> FSSC_CAR_STATUS_SUCCESS;
|
||||
case ORDER_EVENT_PAYED -> FSSC_CAR_STATUS_SUCCESS;
|
||||
case ORDER_EVENT_CHANGE -> FSSC_CAR_STATUS_SUCCESS;
|
||||
case ORDER_EVENT_CANCEL -> FSSC_CAR_STATUS_SUCCESS;
|
||||
case ORDER_EVENT_ORDERED -> FSSC_CAR_STATUS_SUCCESS;
|
||||
case ORDER_EVENT_REFUND -> FSSC_CAR_STATUS_SUCCESS;
|
||||
case ORDER_EVENT_UNKNOWN -> FSSC_ORDER_STATUS_CANCEL;
|
||||
case ORDER_EVENT_FINISH -> FSSC_CAR_STATUS_SUCCESS;
|
||||
case ORDER_EVENT_ETA -> FSSC_CAR_STATUS_SUCCESS;
|
||||
default -> "未知事件";
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
||||
public OrderEvent reloadStatus() {
|
||||
this.setEventName(translateOrderEvent(this.eventType));
|
||||
return this;
|
||||
|
|
|
@ -11,6 +11,7 @@ import com.chint.interfaces.rest.ctrip.dto.search.car.*;
|
|||
import com.chint.interfaces.rest.ctrip.dto.search.flight.*;
|
||||
import com.chint.interfaces.rest.ctrip.dto.search.hotel.ClientInfo;
|
||||
import com.chint.interfaces.rest.ctrip.dto.search.hotel.HotelOrderInfoEntity;
|
||||
import com.chint.interfaces.rest.ctrip.dto.search.hotel.PaymentReceived;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
|
@ -20,6 +21,7 @@ import java.util.Optional;
|
|||
|
||||
import static com.chint.infrastructure.constant.BelongSystemConstant.*;
|
||||
import static com.chint.infrastructure.constant.CommonMessageConstant.NOT_FOUND;
|
||||
import static com.chint.infrastructure.constant.FSSCConstant.*;
|
||||
import static com.chint.infrastructure.constant.OrderConstant.ORDER_EVENT_ETA;
|
||||
import static com.chint.infrastructure.constant.UtilConstant.KEEP_TWO_DECIMAL_ZERO;
|
||||
|
||||
|
@ -43,7 +45,7 @@ public class CTripOrderExtensionFactoryImpl implements OrderExtensionFactory {
|
|||
public CarOrderDetail createCarOrderDetail(Object carOrderDetailData) {
|
||||
|
||||
CarQuickOrderInfoEntity carQuickOrderInfoEntity = (CarQuickOrderInfoEntity) carOrderDetailData;
|
||||
CarOrderDetail carOrderDetail = new CarOrderDetail();
|
||||
|
||||
|
||||
CarBasicInfo carBasicInfo = carQuickOrderInfoEntity.getBasicInfo();
|
||||
String orderNo = carBasicInfo.getOrderId();
|
||||
|
@ -55,6 +57,17 @@ public class CTripOrderExtensionFactoryImpl implements OrderExtensionFactory {
|
|||
.filter(orderDetail -> orderDetail.getOrderNo().equals(orderNo))
|
||||
.findFirst();
|
||||
|
||||
CarOrderDetail carOrderDetail;
|
||||
if (first.isPresent()) {
|
||||
if (first.get().getCarOrderDetail() == null) {
|
||||
carOrderDetail = new CarOrderDetail();
|
||||
} else {
|
||||
return first.get().getCarOrderDetail();
|
||||
}
|
||||
} else {
|
||||
carOrderDetail = new CarOrderDetail();
|
||||
}
|
||||
|
||||
carOrderDetail.setTrvaleSysType(TRAVAL_SYS_TYPE_CTRIP);
|
||||
if (sysCode != null) {
|
||||
if (sysCode.equals(BELONG_SYS_CODE_FSSC)) {
|
||||
|
@ -77,7 +90,9 @@ public class CTripOrderExtensionFactoryImpl implements OrderExtensionFactory {
|
|||
first.ifPresent(orderDetail -> {
|
||||
OrderEvent lastEvent = orderDetail.getLastEvent();
|
||||
if (lastEvent != null) {
|
||||
carOrderDetail.setOrderStatus(lastEvent.mapToOrderDetailStatus());
|
||||
carOrderDetail.setOrderStatus(lastEvent.mapToCarOrderDetailStatus());
|
||||
} else {
|
||||
carOrderDetail.setOrderStatus(FSSC_CAR_STATUS_SUCCESS);
|
||||
}
|
||||
});
|
||||
String employeeNo = routeOrder.getUserId();
|
||||
|
@ -104,18 +119,18 @@ public class CTripOrderExtensionFactoryImpl implements OrderExtensionFactory {
|
|||
carOrderDetail.setOrderAmount(String.valueOf(carBasicInfo.getOrderAmount()));
|
||||
|
||||
|
||||
if (carBasicInfo.getPaymentType().equals("ACCNT")) {
|
||||
carOrderDetail.setPaymentType("0");
|
||||
} else {
|
||||
carOrderDetail.setPaymentType("1");
|
||||
|
||||
}
|
||||
carOrderDetail.setCompanyPaymentAmount(String.valueOf(carBasicInfo.getPersonAmount()));
|
||||
|
||||
carOrderDetail.setPersonalPaymentAmount(String.valueOf(carBasicInfo.getAccntAmount()));
|
||||
if (!carQuickOrderInfoEntity.getOrderFeeList().isEmpty()) {
|
||||
OrderFee orderFee = carQuickOrderInfoEntity.getOrderFeeList().get(0);
|
||||
|
||||
String paymentType = carOrderDetail.getPaymentType();
|
||||
if (paymentType != null && paymentType.equals("ACCNT")) {
|
||||
carOrderDetail.setPaymentType("0");
|
||||
} else {
|
||||
carOrderDetail.setPaymentType("1");
|
||||
}
|
||||
carOrderDetail.setPersonalPaymentAmount(String.valueOf(orderFee.getAccntAmount()));
|
||||
carOrderDetail.setCompanyPaymentAmount(String.valueOf(orderFee.getPersonAmount()));
|
||||
|
||||
if (orderFee.getFeeName().equals("取消费")) {
|
||||
carOrderDetail.setCancellationFee(orderFee.getAmount().toString());
|
||||
} else {
|
||||
|
@ -139,13 +154,15 @@ public class CTripOrderExtensionFactoryImpl implements OrderExtensionFactory {
|
|||
|
||||
carOrderDetail.setFromCity(depAddress.getCityName());
|
||||
carOrderDetail.setToCity(arrAddress.getCityName());
|
||||
|
||||
Driver driver = orderProduct.getDriver();
|
||||
|
||||
|
||||
carOrderDetail.setCarModel(driver.getDriverVehicleName());
|
||||
|
||||
|
||||
}
|
||||
|
||||
List<ChoosedVehicle> choosedVehicleList = carQuickOrderInfoEntity.getChoosedVehicleList();
|
||||
if (!choosedVehicleList.isEmpty()) {
|
||||
ChoosedVehicle choosedVehicle = choosedVehicleList.get(0);
|
||||
carOrderDetail.setCarModel(choosedVehicle.getVehicleName());
|
||||
}
|
||||
|
||||
ApproveOrderNo approveOrderNo = routeOrder.getApproveOrderNo();
|
||||
if (approveOrderNo != null) {
|
||||
|
@ -188,7 +205,6 @@ public class CTripOrderExtensionFactoryImpl implements OrderExtensionFactory {
|
|||
|
||||
@Override
|
||||
public FlightOrderDetail createFlightOrderDetail(Object flightOrderDetailData) {
|
||||
|
||||
FlightOrderInfoEntity flightOrderInfoEntity = (FlightOrderInfoEntity) flightOrderDetailData;
|
||||
|
||||
BasicInfo flightOrderBasicInfo = flightOrderInfoEntity.getBasicInfo();
|
||||
|
@ -237,7 +253,18 @@ public class CTripOrderExtensionFactoryImpl implements OrderExtensionFactory {
|
|||
String sysCode = routeOrder.getApproveOrderNo().getSysCode();
|
||||
Optional<OrderDetail> first = routeOrder.getOrderDetails().stream().filter(orderDetail -> orderDetail.getOrderNo().equals(orderNo)).findFirst();
|
||||
|
||||
FlightOrderDetail flightOrderDetail = new FlightOrderDetail();
|
||||
FlightOrderDetail flightOrderDetail;
|
||||
if (first.isPresent()) {
|
||||
if (first.get().getFlightOrderDetail() == null) {
|
||||
flightOrderDetail = new FlightOrderDetail();
|
||||
} else {
|
||||
return first.get().getFlightOrderDetail();
|
||||
}
|
||||
} else {
|
||||
flightOrderDetail = new FlightOrderDetail();
|
||||
}
|
||||
|
||||
|
||||
|
||||
// flightOrderDetail.setSupplier(SUPPLIER_C_TRIP_EXTENSION_NAME);
|
||||
|
||||
|
@ -262,7 +289,9 @@ public class CTripOrderExtensionFactoryImpl implements OrderExtensionFactory {
|
|||
first.ifPresent(orderDetail -> {
|
||||
OrderEvent lastEvent = orderDetail.getLastEvent();
|
||||
if (lastEvent != null) {
|
||||
flightOrderDetail.setOrderStatus(lastEvent.mapToOrderDetailStatus());
|
||||
flightOrderDetail.setOrderStatus(lastEvent.mapToFlightOrderDetailStatus());
|
||||
} else {
|
||||
flightOrderDetail.setOrderStatus(FSSC_FLIGHT_STATUS_SUCCESS);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -283,12 +312,11 @@ public class CTripOrderExtensionFactoryImpl implements OrderExtensionFactory {
|
|||
flightOrderDetail.setPaymentType("1");
|
||||
}
|
||||
//付款方式 ACCNT:公司统付 其他类型:个人支付
|
||||
if (flightOrderBasicInfo.getPrepayType().equals("ACCNT")) {
|
||||
flightOrderDetail.setPersonalPaymentAmount(String.valueOf(flightOrderBasicInfo.getAmount()));
|
||||
if (flightOrderDetail.getPaymentType().equals("0")) {
|
||||
flightOrderDetail.setCompanyPaymentAmount(String.valueOf(flightOrderBasicInfo.getAmount()));
|
||||
} else {
|
||||
flightOrderDetail.setPersonalPaymentAmount(String.valueOf(flightOrderBasicInfo.getAmount()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (flightInfo != null) {
|
||||
|
@ -412,7 +440,7 @@ public class CTripOrderExtensionFactoryImpl implements OrderExtensionFactory {
|
|||
if (byOrderNo.get().getHotelOrderDetail() == null) {
|
||||
hotelOrderDetail = new HotelOrderDetail();
|
||||
} else {
|
||||
hotelOrderDetail = byOrderNo.get().getHotelOrderDetail();
|
||||
return byOrderNo.get().getHotelOrderDetail();
|
||||
}
|
||||
} else {
|
||||
hotelOrderDetail = new HotelOrderDetail();
|
||||
|
@ -451,7 +479,9 @@ public class CTripOrderExtensionFactoryImpl implements OrderExtensionFactory {
|
|||
first.ifPresent(orderDetail -> {
|
||||
OrderEvent lastEvent = orderDetail.getLastEvent();
|
||||
if (lastEvent != null) {
|
||||
hotelOrderDetail.setOrderStatus(lastEvent.mapToOrderDetailStatus());
|
||||
hotelOrderDetail.setOrderStatus(lastEvent.mapToHotelOrderDetailStatus());
|
||||
} else {
|
||||
hotelOrderDetail.setOrderStatus(FSSC_HOTEL_STATUS_SUCCESS);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -474,6 +504,26 @@ public class CTripOrderExtensionFactoryImpl implements OrderExtensionFactory {
|
|||
hotelOrderDetail.setCostCenter(approveOrderNo.getCostCenter());
|
||||
hotelOrderDetail.setProjectOrderNo(approveOrderNo.getProjectName());
|
||||
}
|
||||
|
||||
List<PaymentReceived> paymentReceivedList = hotelOrderInfoEntity.getPaymentReceivedList();
|
||||
if (paymentReceivedList != null && !paymentReceivedList.isEmpty()) {
|
||||
PaymentReceived paymentReceived = paymentReceivedList.get(0);
|
||||
String paymentType = paymentReceived.getPaymentType();
|
||||
if (paymentType.equals("ACCNT")) {
|
||||
hotelOrderDetail.setPaymentType("0");
|
||||
hotelOrderDetail.setCompanyAmount(paymentReceived.getAmount());
|
||||
hotelOrderDetail.setPersonalAmount(KEEP_TWO_DECIMAL_ZERO);
|
||||
|
||||
} else {
|
||||
hotelOrderDetail.setPaymentType("1");
|
||||
hotelOrderDetail.setPersonalAmount(paymentReceived.getAmount());
|
||||
hotelOrderDetail.setCompanyAmount(KEEP_TWO_DECIMAL_ZERO);
|
||||
|
||||
}
|
||||
hotelOrderDetail.setPersonalRefundAmount(KEEP_TWO_DECIMAL_ZERO);
|
||||
hotelOrderDetail.setCompanyRefundAmount(KEEP_TWO_DECIMAL_ZERO);
|
||||
}
|
||||
|
||||
if (hotelOrderInfoEntity != null) {
|
||||
hotelOrderDetail.setOrderNo(hotelOrderInfoEntity.getOrderID()); //订单号
|
||||
hotelOrderDetail.setDetailId(hotelOrderInfoEntity.getOrderID());
|
||||
|
@ -489,28 +539,6 @@ public class CTripOrderExtensionFactoryImpl implements OrderExtensionFactory {
|
|||
hotelOrderDetail.setNightCount(hotelOrderInfoEntity.getRoomDays()); //退订夜间数
|
||||
hotelOrderDetail.setRoomCount(hotelOrderInfoEntity.getRoomQuantity()); //退订夜间数
|
||||
hotelOrderDetail.setRoomTypeName(hotelOrderInfoEntity.getRoomName()); //房型
|
||||
if (Double.parseDouble(hotelOrderInfoEntity.getSettlementACCNTAmt()) > 0) {
|
||||
hotelOrderDetail.setCompanyAmount(hotelOrderInfoEntity.getSettlementACCNTAmt());
|
||||
hotelOrderDetail.setCompanyRefundAmount(KEEP_TWO_DECIMAL_ZERO);
|
||||
hotelOrderDetail.setPaymentType("0");
|
||||
} else {
|
||||
//如果公司统付为负数, 那么表示退款
|
||||
hotelOrderDetail.setCompanyAmount(KEEP_TWO_DECIMAL_ZERO);
|
||||
hotelOrderDetail.setCompanyRefundAmount(hotelOrderInfoEntity.getSettlementACCNTAmt());
|
||||
hotelOrderDetail.setPaymentType("0");
|
||||
|
||||
}
|
||||
if (Double.parseDouble(hotelOrderInfoEntity.getSettlementPersonAmt()) > 0) {
|
||||
hotelOrderDetail.setPersonalAmount(hotelOrderInfoEntity.getSettlementPersonAmt());
|
||||
hotelOrderDetail.setPersonalRefundAmount(KEEP_TWO_DECIMAL_ZERO);
|
||||
hotelOrderDetail.setPaymentType("1");
|
||||
|
||||
} else {
|
||||
hotelOrderDetail.setPersonalAmount(KEEP_TWO_DECIMAL_ZERO);
|
||||
hotelOrderDetail.setPersonalRefundAmount(hotelOrderInfoEntity.getSettlementPersonAmt());
|
||||
hotelOrderDetail.setPaymentType("1");
|
||||
|
||||
}
|
||||
|
||||
if (Double.parseDouble(hotelOrderInfoEntity.getAmount()) > 0) {
|
||||
hotelOrderDetail.setOrderAmount(hotelOrderInfoEntity.getAmount());
|
||||
|
@ -519,8 +547,10 @@ public class CTripOrderExtensionFactoryImpl implements OrderExtensionFactory {
|
|||
hotelOrderDetail.setOrderAmount(KEEP_TWO_DECIMAL_ZERO);
|
||||
// hotelOrderDetail.setRefundAmount(hotelOrderInfoEntity.getAmount());
|
||||
}
|
||||
|
||||
|
||||
hotelOrderDetail.setPreServiceFee(hotelOrderInfoEntity.getFrontendServiceFee());
|
||||
hotelOrderDetail.setPostServiceFee(hotelOrderInfoEntity.getServicefee());
|
||||
hotelOrderDetail.setPostServiceFee(hotelOrderInfoEntity.getAfterServiceFee());
|
||||
hotelOrderDetail.setStandardItems(hotelOrderInfoEntity.getTPMaxPrice());
|
||||
|
||||
if (hotelOrderInfoEntity.getHotelType().equals("协议酒店")) {
|
||||
|
|
|
@ -12,6 +12,7 @@ import com.chint.interfaces.rest.ly.dto.search.response.car.CarDetailResponse;
|
|||
import com.chint.interfaces.rest.ly.dto.search.response.filght.FlightOrderResponse;
|
||||
import com.chint.interfaces.rest.ly.dto.search.response.hotel.HotelDetailResponse;
|
||||
import com.chint.interfaces.rest.ly.dto.search.response.train.TrainDetailResponse;
|
||||
import com.chint.interfaces.rest.ly.tools.LYOrderUtil;
|
||||
import com.chint.interfaces.rest.user.UserHttpRequest;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
@ -22,6 +23,8 @@ import java.util.stream.Collectors;
|
|||
|
||||
import static com.chint.infrastructure.constant.BelongSystemConstant.*;
|
||||
import static com.chint.infrastructure.constant.CommonMessageConstant.NOT_FOUND;
|
||||
import static com.chint.infrastructure.constant.FSSCConstant.FSSC_FLIGHT_STATUS_CHANGE;
|
||||
import static com.chint.infrastructure.constant.FSSCConstant.FSSC_TRAIN_STATUS_CHANGE;
|
||||
import static com.chint.infrastructure.constant.OrderConstant.ORDER_EVENT_ETA;
|
||||
|
||||
@Component
|
||||
|
@ -86,7 +89,7 @@ public class LYOrderExtensionFactoryImpl implements OrderExtensionFactory {
|
|||
RouteOrder routeOrder = routeRepository.queryById(orderDetail.getRouteId());
|
||||
ApproveOrderNo approveOrderNo = routeOrder.getApproveOrderNo();
|
||||
FlightOrderDetail flightOrderDetail = new FlightOrderDetail();
|
||||
if (approveOrderNo != null){
|
||||
if (approveOrderNo != null) {
|
||||
flightOrderDetail.setAccountCompanyId(approveOrderNo.getAccountCompanyCode());
|
||||
flightOrderDetail.setAccountCompanyName(approveOrderNo.getAccountCompanyName());
|
||||
flightOrderDetail.setCostCenter(approveOrderNo.getCostCenter());
|
||||
|
@ -123,7 +126,7 @@ public class LYOrderExtensionFactoryImpl implements OrderExtensionFactory {
|
|||
|
||||
String EmployeeNo = routeOrder.getUserId();
|
||||
User user = userRepository.findByUserEmployeeNo(EmployeeNo);
|
||||
if (user != null){
|
||||
if (user != null) {
|
||||
flightOrderDetail.setBookingUserCode(user.getEmployeeNo());
|
||||
flightOrderDetail.setBookingName(user.getName());
|
||||
flightOrderDetail.setBookingUserPhone(user.getPhoneNumber());
|
||||
|
@ -140,16 +143,28 @@ public class LYOrderExtensionFactoryImpl implements OrderExtensionFactory {
|
|||
.filter(it -> it.getOrderNo().equals(flightOrderDetail.getOrderNo()))
|
||||
.findFirst();
|
||||
|
||||
first1.ifPresent(it ->{
|
||||
OrderEvent lastEvent = it.getLastEvent();
|
||||
if(lastEvent != null){
|
||||
flightOrderDetail.setOrderStatus(lastEvent.mapToOrderDetailStatus());
|
||||
}}
|
||||
first1.ifPresent(it -> {
|
||||
OrderEvent lastEvent = it.getLastEvent();
|
||||
if (orderDetail.getOrderNo().contains("C") && orderDetails.getIsChangeOrder()) {
|
||||
//如果发现同程的订单号里面还有C就能够判断出 ,它是改签订单
|
||||
flightOrderDetail.setOrderStatus(FSSC_FLIGHT_STATUS_CHANGE);
|
||||
} else if (lastEvent != null) {
|
||||
flightOrderDetail.setOrderStatus(lastEvent.mapToFlightOrderDetailStatus());
|
||||
} else {
|
||||
//如果订单事件为空,那么就需要重新根据查询到的订单信息重新进行映射
|
||||
Integer orderStatus = orderDetails.getOrderStatus();
|
||||
flightOrderDetail.setOrderStatus(
|
||||
OrderEvent.mapToFlightOrderDetailStatus(
|
||||
LYOrderUtil.mapFlightStatus(orderStatus.toString())
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
);
|
||||
// flightOrderDetail.setScheduleNum(orderDetails.getTravelOrderNo());
|
||||
flightOrderDetail.setChangedScheduleNum(orderDetails.getOriginalOrderNo());
|
||||
FlightOrderResponse.FlightOrderRefundInfo flightOrderRefundInfo = orderDetails.getFlightOrderRefundInfo();
|
||||
if (flightOrderRefundInfo!=null){
|
||||
if (flightOrderRefundInfo != null) {
|
||||
flightOrderDetail.setRefundFee(String.valueOf(flightOrderRefundInfo.getRefundFee()));
|
||||
flightOrderDetail.setRefundAmount(String.valueOf(flightOrderRefundInfo.getRefundPrice())); //无refundPrice
|
||||
|
||||
|
@ -160,7 +175,9 @@ public class LYOrderExtensionFactoryImpl implements OrderExtensionFactory {
|
|||
flightOrderDetail.setPostServiceFee(orderDetails.getAfterSettlementServicePrice().toString());
|
||||
flightOrderDetail.setCompanyPaymentAmount(orderDetails.getTotalPrice().toString());
|
||||
flightOrderDetail.setNotBookedLowestPriceReason(orderDetails.getFoulReason());
|
||||
flightOrderDetail.setPaymentType(orderDetails.getPayType().toString()); //贵司都是公司支付所以为0
|
||||
// flightOrderDetail.setPaymentType(orderDetails.getPayType().toString()); //贵司都是公司支付所以为0
|
||||
|
||||
flightOrderDetail.setPaymentType("0");
|
||||
}
|
||||
if (flightSegment != null) {
|
||||
flightOrderDetail.setEndAirportName(flightSegment.getArriveAirport());
|
||||
|
@ -289,11 +306,11 @@ public class LYOrderExtensionFactoryImpl implements OrderExtensionFactory {
|
|||
.setPersonalAmount(String.valueOf(orderInfo.getPersonalPrice()))
|
||||
.setCompanyRefundAmount(String.valueOf(orderInfo.getCompanyRefundPrice()))
|
||||
.setPersonalRefundAmount(String.valueOf(orderInfo.getPersonalRefundPrice()))
|
||||
.setOrderAmount(String.valueOf(orderInfo.getBusinessAmount()))
|
||||
.setOrderAmount(String.valueOf(orderInfo.getTotalPrice()))
|
||||
.setPreServiceFee(String.valueOf(orderInfo.getServicePrice()))
|
||||
.setPostServiceFee(String.valueOf(orderInfo.getAfterSettlementServicePrice()))
|
||||
.setRefundAmount(String.valueOf(orderInfo.getRefundPrice()))
|
||||
.setAgreementHotel(orderInfo.getProtocolType()==0?"否":"是");
|
||||
.setAgreementHotel(orderInfo.getProtocolType() == 0 ? "否" : "是");
|
||||
// .setBookingName(orderInfo.getContactName()) //预订人名字和电话使用contact是否正确
|
||||
// .setBookingUserPhone(orderInfo.getContactPhone())
|
||||
// .setNightRates() //nightrates 是hotelInfo
|
||||
|
@ -303,13 +320,13 @@ public class LYOrderExtensionFactoryImpl implements OrderExtensionFactory {
|
|||
// .setBOOK_ORG_STRUCT_3("Org C")
|
||||
}
|
||||
|
||||
if (user != null){
|
||||
if (user != null) {
|
||||
hotelOrderDetail.setBookingUserCode(user.getEmployeeNo());
|
||||
hotelOrderDetail.setBookingName(user.getName());
|
||||
hotelOrderDetail.setBookingUserPhone(user.getPhoneNumber());
|
||||
}
|
||||
ApproveOrderNo approveOrderNo = routeOrder.getApproveOrderNo();
|
||||
if (approveOrderNo != null){
|
||||
if (approveOrderNo != null) {
|
||||
// hotelOrderDetail.setAccountCompanyId(approveOrderNo.getAccountCompany());
|
||||
hotelOrderDetail.setAccountCompanyId(approveOrderNo.getAccountCompanyCode());
|
||||
hotelOrderDetail.setAccountCompanyName(approveOrderNo.getAccountCompanyName());
|
||||
|
@ -323,11 +340,20 @@ public class LYOrderExtensionFactoryImpl implements OrderExtensionFactory {
|
|||
.filter(it -> it.getOrderNo().equals(hotelOrderDetail.getOrderNo()))
|
||||
.findFirst();
|
||||
|
||||
first1.ifPresent(it ->{
|
||||
OrderEvent lastEvent = it.getLastEvent();
|
||||
if(lastEvent != null){
|
||||
hotelOrderDetail.setOrderStatus(lastEvent.mapToOrderDetailStatus());
|
||||
}}
|
||||
first1.ifPresent(it -> {
|
||||
OrderEvent lastEvent = it.getLastEvent();
|
||||
if (lastEvent != null) {
|
||||
hotelOrderDetail.setOrderStatus(lastEvent.mapToHotelOrderDetailStatus());
|
||||
} else {
|
||||
//如果订单事件为空,那么就需要重新根据查询到的订单信息重新进行映射
|
||||
Integer orderStatus = orderInfo.getOrderStatus();
|
||||
hotelOrderDetail.setOrderStatus(
|
||||
OrderEvent.mapToHotelOrderDetailStatus(
|
||||
LYOrderUtil.mapHotelStatus(orderStatus.toString())
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
Optional<Integer> firstOrderEvent = orderDetail.getOrderEventList()
|
||||
|
@ -386,8 +412,6 @@ public class LYOrderExtensionFactoryImpl implements OrderExtensionFactory {
|
|||
.orElseThrow(() -> new NotFoundException(NOT_FOUND));
|
||||
|
||||
|
||||
|
||||
|
||||
RouteOrder routeOrder = routeRepository.queryById(orderDetail.getRouteId());
|
||||
String sysCode = routeOrder.getApproveOrderNo().getSysCode();
|
||||
|
||||
|
@ -412,7 +436,6 @@ public class LYOrderExtensionFactoryImpl implements OrderExtensionFactory {
|
|||
}
|
||||
|
||||
|
||||
|
||||
if (trainDetailData != null) {
|
||||
trainOrderDetail.setOrderNo(trainDetailData.getOrderNo());
|
||||
trainOrderDetail.setDetailId(trainDetailData.getOrderNo());
|
||||
|
@ -425,15 +448,26 @@ public class LYOrderExtensionFactoryImpl implements OrderExtensionFactory {
|
|||
.filter(it -> it.getOrderNo().equals(trainDetailData.getOrderNo()))
|
||||
.findFirst();
|
||||
|
||||
first1.ifPresent(it ->{
|
||||
OrderEvent lastEvent = it.getLastEvent();
|
||||
if(lastEvent != null){
|
||||
trainOrderDetail.setOrderStatus(lastEvent.mapToOrderDetailStatus());
|
||||
}}
|
||||
first1.ifPresent(it -> {
|
||||
OrderEvent lastEvent = it.getLastEvent();
|
||||
if (trainDetailData.getIsChangedOrder().equals(1)) {
|
||||
trainOrderDetail.setOrderStatus(FSSC_TRAIN_STATUS_CHANGE);
|
||||
} else if (lastEvent != null) {
|
||||
trainOrderDetail.setOrderStatus(lastEvent.mapToTrainOrderDetailStatus());
|
||||
} else {
|
||||
//如果订单事件为空,那么就需要重新根据查询到的订单信息重新进行映射
|
||||
String orderStatus = trainDetailData.getOrderStatus();
|
||||
trainOrderDetail.setOrderStatus(
|
||||
OrderEvent.mapToTrainOrderDetailStatus(
|
||||
LYOrderUtil.mapTrainStatus(orderStatus)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
);
|
||||
String EmployeeNo = routeOrder.getUserId();
|
||||
User user = userRepository.findByUserEmployeeNo(EmployeeNo);
|
||||
if (user != null){
|
||||
if (user != null) {
|
||||
trainOrderDetail.setBookingUserCode(user.getEmployeeNo());
|
||||
trainOrderDetail.setBookingName(user.getName());
|
||||
trainOrderDetail.setBookingUserPhone(user.getPhoneNumber());
|
||||
|
@ -456,7 +490,7 @@ public class LYOrderExtensionFactoryImpl implements OrderExtensionFactory {
|
|||
trainDetailData.getTravelData().getSubmitItemList();
|
||||
|
||||
ApproveOrderNo approveOrderNo = routeOrder.getApproveOrderNo();
|
||||
if (approveOrderNo != null){
|
||||
if (approveOrderNo != null) {
|
||||
trainOrderDetail.setAccountCompanyId(approveOrderNo.getAccountCompanyCode());
|
||||
trainOrderDetail.setAccountCompanyName(approveOrderNo.getAccountCompanyName());
|
||||
trainOrderDetail.setCostCenter(approveOrderNo.getCostCenter());
|
||||
|
@ -471,23 +505,22 @@ public class LYOrderExtensionFactoryImpl implements OrderExtensionFactory {
|
|||
trainOrderDetail.setRefundAmount(String.valueOf(item.getRefundAmountCor()));
|
||||
|
||||
|
||||
|
||||
if (item.getSeatClass().equals("secondseat")){
|
||||
if (item.getSeatClass().equals("secondseat")) {
|
||||
trainOrderDetail.setSeatType("二等座");
|
||||
}
|
||||
if (item.getSeatClass().equals("businessseat")){
|
||||
if (item.getSeatClass().equals("businessseat")) {
|
||||
trainOrderDetail.setSeatType("商务座");
|
||||
}
|
||||
if (item.getSeatClass().equals("hardseat")){
|
||||
if (item.getSeatClass().equals("hardseat")) {
|
||||
trainOrderDetail.setSeatType("硬座");
|
||||
}
|
||||
if (item.getSeatClass().equals("softsleeperup")){
|
||||
if (item.getSeatClass().equals("softsleeperup")) {
|
||||
trainOrderDetail.setSeatType("软卧");
|
||||
}
|
||||
if (item.getSeatClass().equals("hardsleeperup")){
|
||||
if (item.getSeatClass().equals("hardsleeperup")) {
|
||||
trainOrderDetail.setSeatType("硬卧");
|
||||
}
|
||||
if (item.getSeatClass().equals("firstseat")){
|
||||
if (item.getSeatClass().equals("firstseat")) {
|
||||
trainOrderDetail.setSeatType("一等座");
|
||||
}
|
||||
|
||||
|
@ -547,6 +580,8 @@ public class LYOrderExtensionFactoryImpl implements OrderExtensionFactory {
|
|||
CarDetailResponse.CarOrderDetailInfo carOrderDetailInfo = data.getCarOrderDetailInfo();
|
||||
CarDetailResponse.OrderExtendInfo orderExtendInfo = data.getOrderExtendInfo();
|
||||
|
||||
CarDetailResponse.OrderDriverInfo orderDriverInfo = data.getOrderDriverInfo();
|
||||
|
||||
CarOrderDetail carOrderDetail = new CarOrderDetail();
|
||||
RouteOrder routeOrder = null;
|
||||
if (carOrderDetailInfo != null) {
|
||||
|
@ -580,17 +615,26 @@ public class LYOrderExtensionFactoryImpl implements OrderExtensionFactory {
|
|||
.filter(it -> it.getOrderNo().equals(carOrderDetail.getOrderNo()))
|
||||
.findFirst();
|
||||
|
||||
firstOrderDetail.ifPresent(it ->{
|
||||
OrderEvent lastEvent = it.getLastEvent();
|
||||
if(lastEvent != null){
|
||||
carOrderDetail.setOrderStatus(lastEvent.mapToOrderDetailStatus());
|
||||
}}
|
||||
firstOrderDetail.ifPresent(it -> {
|
||||
OrderEvent lastEvent = it.getLastEvent();
|
||||
if (lastEvent != null) {
|
||||
carOrderDetail.setOrderStatus(lastEvent.mapToCarOrderDetailStatus());
|
||||
} else {
|
||||
//如果订单事件为空,那么就需要重新根据查询到的订单信息重新进行映射
|
||||
Integer orderStatus = carOrderDetailInfo.getOrderStatus();
|
||||
carOrderDetail.setOrderStatus(
|
||||
OrderEvent.mapToCarOrderDetailStatus(
|
||||
LYOrderUtil.mapCarStatus(orderStatus)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
String EmployeeNo = routeOrder.getUserId();
|
||||
User user = userRepository.findByUserEmployeeNo(EmployeeNo);
|
||||
|
||||
if (user!=null){
|
||||
if (user != null) {
|
||||
carOrderDetail.setBookingUserCode(user.getEmployeeNo());
|
||||
carOrderDetail.setBookingName(user.getName());
|
||||
carOrderDetail.setBookingUserPhone(user.getPhoneNumber());
|
||||
|
@ -612,17 +656,27 @@ public class LYOrderExtensionFactoryImpl implements OrderExtensionFactory {
|
|||
carOrderDetail.setArriveTime(orderExtendInfo.getFinishTime());
|
||||
carOrderDetail.setFromStationName(orderExtendInfo.getStartAddress());
|
||||
carOrderDetail.setToStationName(orderExtendInfo.getEndAddress());
|
||||
carOrderDetail.setCarModel(String.valueOf(orderExtendInfo.getCarType()));
|
||||
carOrderDetail.setFromCity(orderExtendInfo.getStartCityName());
|
||||
carOrderDetail.setToCity(orderExtendInfo.getEndCityName());
|
||||
carOrderDetail.setRunTime(orderExtendInfo.getDuration());
|
||||
carOrderDetail.setMileage(orderExtendInfo.getMileage());
|
||||
|
||||
String duration = orderExtendInfo.getDuration();
|
||||
String durationNumbers = duration.replaceAll("\\D+", "");
|
||||
carOrderDetail.setRunTime(durationNumbers);
|
||||
|
||||
String mileage = orderExtendInfo.getMileage();
|
||||
String mileageNumbers = mileage.replaceAll("\\D+", "");
|
||||
carOrderDetail.setMileage(mileageNumbers);
|
||||
}
|
||||
|
||||
|
||||
if (orderDriverInfo != null) {
|
||||
carOrderDetail.setCarModel(String.valueOf(orderDriverInfo.getCarType()));
|
||||
}
|
||||
List<CarDetailResponse.SubmitItem> submitItemList =
|
||||
data.getTravelDataInfo().getSubmitItemList();
|
||||
|
||||
ApproveOrderNo approveOrderNo = routeOrder.getApproveOrderNo();
|
||||
if (approveOrderNo != null){
|
||||
if (approveOrderNo != null) {
|
||||
carOrderDetail.setAccountCompanyId(approveOrderNo.getAccountCompanyCode());
|
||||
carOrderDetail.setAccountCompanyName(approveOrderNo.getAccountCompanyName());
|
||||
carOrderDetail.setCostCenter(approveOrderNo.getCostCenter());
|
||||
|
|
|
@ -11,7 +11,7 @@ public interface OrderExtensionFactory {
|
|||
|
||||
FlightOrderDetail createFlightOrderDetail(Object flightOrderDetailData);
|
||||
|
||||
HotelOrderDetail createHotelOrderDetail(Object hotelOrderDetailData) throws NoSuchFieldException, IllegalAccessException;
|
||||
HotelOrderDetail createHotelOrderDetail(Object hotelOrderDetailData);
|
||||
|
||||
OtherOrderDetail createOtherOrderDetail(Object otherOrderDetailData);
|
||||
|
||||
|
|
|
@ -25,4 +25,6 @@ public interface CountryInfoEntityRepository {
|
|||
List<CountryInfoEntity> findByCountryId(Long id);
|
||||
|
||||
CountryInfoEntity findById(Long id);
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
package com.chint.domain.repository;
|
||||
|
||||
import com.chint.domain.aggregates.location.basedata.DistrictPOIInfoEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface DistrictInfoRepository {
|
||||
|
||||
List<DistrictPOIInfoEntity> findAll();
|
||||
|
||||
DistrictPOIInfoEntity save(DistrictPOIInfoEntity districtPOIInfoEntity);
|
||||
}
|
|
@ -15,6 +15,9 @@ public interface LocationRepository {
|
|||
|
||||
List<Location> findAll();
|
||||
|
||||
Location findByCityId(Long cityId,String shortName);
|
||||
List<Location> findAllLeverThreeAndIsInternal();
|
||||
|
||||
Location findById(Long id);
|
||||
|
||||
void saveAll(List<Location> locations);
|
||||
|
@ -38,7 +41,7 @@ public interface LocationRepository {
|
|||
List<Location> findByCityNameAndLevelThree(String localName);
|
||||
Location findByCityName(String localName);
|
||||
|
||||
|
||||
Location findByDistrictShotName(String name);
|
||||
|
||||
List<Location> findChinaCityByLevel(String locationNames,Integer level);
|
||||
|
||||
|
|
|
@ -14,4 +14,9 @@ public interface PrefectureLevelRepository {
|
|||
List<PrefectureLevelCityInfoEntity> findByCityName(String cityName);
|
||||
|
||||
|
||||
PrefectureLevelCityInfoEntity findByCityId(Long cityId);
|
||||
|
||||
PrefectureLevelCityInfoEntity save(PrefectureLevelCityInfoEntity cityInfoEntity);
|
||||
|
||||
|
||||
}
|
|
@ -32,7 +32,9 @@ import com.chint.interfaces.rest.ctrip.dto.search.flight.*;
|
|||
import com.chint.interfaces.rest.ctrip.dto.search.hotel.HotelOrderInfoEntity;
|
||||
import com.chint.interfaces.rest.ctrip.dto.search.hotel.RefundInfo;
|
||||
import com.chint.interfaces.rest.ly.LYSearchRequest;
|
||||
import com.chint.interfaces.rest.ly.dto.search.response.car.CarDetailResponse;
|
||||
import com.chint.interfaces.rest.ly.dto.search.response.filght.FlightOrderResponse;
|
||||
import com.chint.interfaces.rest.ly.dto.search.response.hotel.HotelDetailResponse;
|
||||
import com.chint.interfaces.rest.ly.dto.search.response.train.TrainDetailResponse;
|
||||
import com.chint.interfaces.rest.user.UserHttpRequest;
|
||||
import jakarta.annotation.PostConstruct;
|
||||
|
@ -216,14 +218,13 @@ public class OrderDomainService {
|
|||
|
||||
if (orderDetail.getSupplierName().equals(SUPPLIER_C_TRIP)) {
|
||||
if (!orderEventType.equals(ORDER_EVENT_ETA) && orderDetail.getProductType().equals(LEG_TYPE_AIRPLANE)) {
|
||||
generateRefundAndChangeOrder(orderDetail.getOrderNo());
|
||||
cTripFlightRefundAndChangeOrder(orderDetail.getOrderNo());
|
||||
}
|
||||
|
||||
if (!orderEventType.equals(ORDER_EVENT_ETA) && orderDetail.getProductType().equals(LEG_TYPE_HOTEL)) {
|
||||
generateHotelRefundAndChangeOrder(orderDetail.getOrderNo());
|
||||
cTripHotelRefundAndChangeOrder(orderDetail.getOrderNo());
|
||||
}
|
||||
if (!orderEventType.equals(ORDER_EVENT_ETA) && orderDetail.getProductType().equals(LEG_TYPE_TAXI)) {
|
||||
carRefundChangeOrder(orderDetail.getOrderNo());
|
||||
cTripCarRefundChangeOrder(orderDetail.getOrderNo());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -231,6 +232,12 @@ public class OrderDomainService {
|
|||
if (!orderEventType.equals(ORDER_EVENT_ETA) && orderDetail.getProductType().equals(LEG_TYPE_TRAIN)){
|
||||
lyTrainRefundGenerate(orderDetail.getOrderNo());
|
||||
}
|
||||
if(!orderEventType.equals(ORDER_EVENT_ETA) && orderDetail.getProductType().equals(LEG_TYPE_HOTEL)){
|
||||
lyHotelRefundGenerate(orderDetail.getOrderNo());
|
||||
}
|
||||
if(!orderEventType.equals(ORDER_EVENT_ETA) && orderDetail.getProductType().equals(LEG_TYPE_TAXI)){
|
||||
lyCarRefundGenerate(orderDetail.getOrderNo());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -438,7 +445,7 @@ public class OrderDomainService {
|
|||
return false;
|
||||
}
|
||||
|
||||
private void generateRefundAndChangeOrder(String orderNo) {
|
||||
private void cTripFlightRefundAndChangeOrder(String orderNo) {
|
||||
SearchOrderResponse response = cTripOrderSearchRequest.searchOrderResponseByOrderId(orderNo);
|
||||
FlightOrderInfoEntity flightOrderInfoEntity = response.getItineraryList().get(0).getFlightOrderInfoList().get(0);
|
||||
|
||||
|
@ -451,7 +458,7 @@ public class OrderDomainService {
|
|||
String.valueOf(flightRefundInfo.getRefundOrderID()),
|
||||
flightOrderInfoEntity.getBasicInfo().getOrderID(),
|
||||
"-" + flightRefundInfo.getPayCustomerAmount(),
|
||||
"4",
|
||||
"3",
|
||||
flightRefundInfo.getRefundAplyTime()
|
||||
).sendToQueue();
|
||||
}
|
||||
|
@ -478,7 +485,7 @@ public class OrderDomainService {
|
|||
String.valueOf(info.getRebookId()),
|
||||
flightOrderInfoEntity.getBasicInfo().getOrderID(),
|
||||
String.valueOf(info.getCFee()),
|
||||
"3",
|
||||
"2",
|
||||
info.getRebookedTime()
|
||||
).sendToQueue();
|
||||
}
|
||||
|
@ -486,7 +493,7 @@ public class OrderDomainService {
|
|||
}
|
||||
}
|
||||
|
||||
private void generateHotelRefundAndChangeOrder(String orderNo) {
|
||||
private void cTripHotelRefundAndChangeOrder(String orderNo) {
|
||||
SearchOrderResponse response = cTripOrderSearchRequest.searchOrderResponseByOrderId(orderNo);
|
||||
HotelOrderInfoEntity flightOrderInfoEntity = response.getItineraryList().get(0).getHotelOrderInfoList().get(0);
|
||||
List<RefundInfo> refundInfo = flightOrderInfoEntity.getRefundInfo();
|
||||
|
@ -504,7 +511,7 @@ public class OrderDomainService {
|
|||
}
|
||||
|
||||
|
||||
public void carRefundChangeOrder(String orderNo) {
|
||||
public void cTripCarRefundChangeOrder(String orderNo) {
|
||||
SearchOrderResponse searchOrderResponse = cTripOrderSearchRequest.searchOrderResponseByOrderId(orderNo);
|
||||
List<ItineraryEntity> itineraryList = searchOrderResponse.getItineraryList();
|
||||
List<CarQuickOrderInfoEntity> carQuickOrderInfoList = itineraryList.get(0).getCarQuickOrderInfoList();
|
||||
|
@ -536,9 +543,58 @@ public class OrderDomainService {
|
|||
String.valueOf(item.getItemId()),
|
||||
data.getOrderNo(),
|
||||
"-" + item.getRefundAmount(),
|
||||
"4",
|
||||
"3",
|
||||
data.getRefundTime()
|
||||
).sendToQueue();
|
||||
}
|
||||
}
|
||||
|
||||
private void lyFlightRefundGenerate(String orderNo){
|
||||
FlightOrderResponse flightOrderDetail = lySearchRequest.getFlightOrderDetail(orderNo);
|
||||
|
||||
}
|
||||
|
||||
private void lyHotelRefundGenerate(String orderNo){
|
||||
HotelDetailResponse hotelOrderDetail = lySearchRequest.getHotelOrderDetail(orderNo);
|
||||
if(hotelOrderDetail == null){
|
||||
return;
|
||||
}
|
||||
HotelDetailResponse.Data data = hotelOrderDetail.getData();
|
||||
if(data != null && data.getRefundInfoList() != null && !data.getRefundInfoList().isEmpty()){
|
||||
List<com.chint.interfaces.rest.ly.dto.hotelorderdatapushbach.RefundInfo> refundInfoList = data.getRefundInfoList();
|
||||
for (com.chint.interfaces.rest.ly.dto.hotelorderdatapushbach.RefundInfo refundInfo : refundInfoList) {
|
||||
Command.of(RefundOrderGenerateCommand.class).Info(
|
||||
refundInfo.getRefundTime().replace(" ", "")
|
||||
.replace("-", "")
|
||||
.replace(":", ""),
|
||||
data.getOrderInfo().getOrderSerialNo(),
|
||||
"-" + refundInfo.getRefundPrice(),
|
||||
"3",
|
||||
refundInfo.getRefundTime()
|
||||
).sendToQueue();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void lyCarRefundGenerate(String orderNo){
|
||||
CarDetailResponse carDetailResponse = lySearchRequest.getCarDetailResponse(orderNo);
|
||||
if(carDetailResponse == null){
|
||||
return;
|
||||
}
|
||||
CarDetailResponse.DataWrapper data = carDetailResponse.getData();
|
||||
if (data!= null) {
|
||||
if(data.getPriceVarList() != null && !data.getPriceVarList().isEmpty()){
|
||||
for (CarDetailResponse.CarPriceVar carPriceVar : data.getPriceVarList()) {
|
||||
Command.of(RefundOrderGenerateCommand.class).Info(
|
||||
carPriceVar.getPriceVarNo(),
|
||||
data.getCarOrderDetailInfo().getOrderSerialNo(),
|
||||
carPriceVar.getTotalPriceVar(),
|
||||
"3",
|
||||
carPriceVar.getPriceVarTime()
|
||||
).sendToQueue();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -65,21 +65,19 @@ public class SupplierServiceImpl implements SupplierService {
|
|||
}
|
||||
}
|
||||
case LegConstant.LEG_TYPE_HOTEL -> {
|
||||
try {
|
||||
if (orderLegData.getHotelOrderDetailData() != null) {
|
||||
orderDetail.addHotelOrderData(
|
||||
orderExtensionFactory.createHotelOrderDetail(orderLegData.getHotelOrderDetailData())
|
||||
);
|
||||
}
|
||||
} catch (NoSuchFieldException e) {
|
||||
throw new RuntimeException(e);
|
||||
} catch (IllegalAccessException e) {
|
||||
throw new RuntimeException(e);
|
||||
if (orderLegData.getHotelOrderDetailData() != null) {
|
||||
orderDetail.addHotelOrderData(
|
||||
orderExtensionFactory.createHotelOrderDetail(orderLegData.getHotelOrderDetailData())
|
||||
);
|
||||
}
|
||||
}
|
||||
case LegConstant.LEG_TYPE_TAXI -> {
|
||||
if (orderLegData.getCarOrderDetailData() != null) {
|
||||
orderDetail.addCarOrderData(
|
||||
orderExtensionFactory.createCarOrderDetail(orderLegData.getCarOrderDetailData())
|
||||
);
|
||||
}
|
||||
}
|
||||
case LegConstant.LEG_TYPE_TAXI -> orderDetail.addCarOrderData(
|
||||
orderExtensionFactory.createCarOrderDetail(orderLegData.getCarOrderDetailData())
|
||||
);
|
||||
case LegConstant.LEG_TYPE_OTHER -> orderDetail.addOtherOrderData(
|
||||
orderExtensionFactory.createOtherOrderDetail(orderLegData.getOtherOrderDetailData())
|
||||
);
|
||||
|
|
|
@ -0,0 +1,52 @@
|
|||
package com.chint.infrastructure.config.webconfig;
|
||||
|
||||
import com.chint.infrastructure.util.Result;
|
||||
import com.chint.interfaces.rest.ctrip.dto.put.CTripNoteResponse;
|
||||
import com.google.gson.Gson;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.springframework.web.servlet.HandlerInterceptor;
|
||||
import org.springframework.web.util.ContentCachingResponseWrapper;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
import static com.chint.infrastructure.constant.CommonMessageConstant.RESULT_ERROR_CODE;
|
||||
import static com.chint.infrastructure.constant.CommonMessageConstant.RESULT_SUCCESS_CODE;
|
||||
|
||||
public class SupplierResponseInterceptor implements HandlerInterceptor {
|
||||
|
||||
private Gson gson = new Gson();
|
||||
|
||||
@Override
|
||||
public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws IOException {
|
||||
|
||||
if(request.getRequestURI().contains("/public/CTrip/status")){
|
||||
ContentCachingResponseWrapper responseWrapper = (ContentCachingResponseWrapper) response;
|
||||
byte[] contentAsByteArray = ((ContentCachingResponseWrapper) response).getContentAsByteArray();
|
||||
String responseJson = new String(contentAsByteArray, StandardCharsets.UTF_8);
|
||||
|
||||
Result result = gson.fromJson(responseJson, Result.class);
|
||||
String cTripResContent;
|
||||
if(result.getCode().equals(RESULT_ERROR_CODE)){
|
||||
CTripNoteResponse error = CTripNoteResponse.error(result.getMsg());
|
||||
cTripResContent = gson.toJson(error);
|
||||
} else if(result.getCode().equals(RESULT_SUCCESS_CODE)){
|
||||
CTripNoteResponse success = CTripNoteResponse.success(result.getMsg());
|
||||
cTripResContent = gson.toJson(success);
|
||||
} else {
|
||||
CTripNoteResponse error = CTripNoteResponse.error("未知消息");
|
||||
cTripResContent = gson.toJson(error);
|
||||
}
|
||||
|
||||
// 清除原始响应体并写入修改后的内容
|
||||
responseWrapper.resetBuffer();
|
||||
responseWrapper.getOutputStream().write(cTripResContent.getBytes());
|
||||
responseWrapper.setContentLength(cTripResContent.getBytes().length);
|
||||
|
||||
// 必须调用此方法以确保响应被正确处理
|
||||
responseWrapper.copyBodyToResponse();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -29,10 +29,14 @@ public class WebConfig implements WebMvcConfigurer {
|
|||
registry.addInterceptor(new JwtTokenAdminInterceptor())
|
||||
.addPathPatterns("/**")
|
||||
.excludePathPatterns("/public/**", "/login");
|
||||
registry.addInterceptor(new SupplierResponseInterceptor())
|
||||
.addPathPatterns("/public/CTrip/status");
|
||||
//调用bean
|
||||
registry.addInterceptor(getMyRequestLoggingInterceptor())
|
||||
.addPathPatterns("/**")
|
||||
.excludePathPatterns("/public/log/pageQuery", "/order/pageQuery", "/OrderDetail/query/page", "/order/query/**", "/location/**");
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -37,13 +37,10 @@ public class CTripConstant {
|
|||
public static final String C_TRIP_AUDIT_ACTION_SUCCESS = "T";
|
||||
public static final String C_TRIP_AUDIT_ACTION_FAIL = "F";
|
||||
|
||||
|
||||
public static final String C_TRIP_ORDER_FLIGHT_PATH = "/switchapi/FlightOrderSettlement/GetCorpAccountFlightOrderSettlements?type=json";
|
||||
|
||||
public static final String C_TRIP_ORDER_HOTEL_PATH = "/switchapi/SettlementHltOrder/SearchSettlementHltOrderDetail";
|
||||
|
||||
public static final String C_TRIP_ORDER_TRAIN_PATH = "/switchapi/SettlementTrainOrder/SearchSettlementTrainOrderDetail";
|
||||
|
||||
|
||||
public static final String C_TRIP_ORDER_CAR_PATH = "/switchapi/CarOrderSettlement/SearchSettlementCarOrderDetail";
|
||||
}
|
||||
|
|
|
@ -19,5 +19,10 @@ public class CommonMessageConstant {
|
|||
public static final String LEG_CHANGE_MAX_ERROR = "最多支持变更两次";
|
||||
public static final String NO_PRICE_ERROR = "无估算价格";
|
||||
|
||||
public static final String RESULT_SUCCESS_CODE = "1";
|
||||
public static final String RESULT_ERROR_CODE = "0";
|
||||
public static final String RESULT_SSO_LOGIN_ERROR_CODE = "-2";
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -6,4 +6,5 @@ public class Constant {
|
|||
public static final int STATUS_DISABLED = 0;
|
||||
//system
|
||||
public static final String AES_SECRET = "chint";//国内
|
||||
|
||||
}
|
||||
|
|
|
@ -17,4 +17,19 @@ public class FSSCConstant {
|
|||
public static final String FSSC_REDIRECT_PATH_APPROVAL_TWO = "&data=%2F%23%2Fexpenseclaim%3FbillDefineId%3Dfcc76666fb1211e98e2019f4db5548fd%26scene%3DWRITE%26isNew%3Dtrue%26goback%3Dfalse";//申请单类型
|
||||
public static final String JT_FSSC_REDIRECT_PATH_APPROVAL_ONE = "/FsscSSO?loginUser=";//申请单类型
|
||||
public static final String XN_FSSC_REDIRECT_PATH_APPROVAL_ONE = "/XNFsscSSO?loginUser=";//申请单类型
|
||||
public static final String FSSC_ORDER_STATUS_CANCEL = "0";//
|
||||
public static final String FSSC_HOTEL_STATUS_SUCCESS = "1";//申请单类型
|
||||
public static final String FSSC_HOTEL_STATUS_REFUND = "3";//申请单类型
|
||||
public static final String FSSC_HOTEL_STATUS_PART_REFUND = "4";//申请单类型
|
||||
public static final String FSSC_FLIGHT_STATUS_SUCCESS = "1";//申请单类型
|
||||
public static final String FSSC_FLIGHT_STATUS_CHANGE = "2";//申请单类型
|
||||
public static final String FSSC_FLIGHT_STATUS_REFUND = "3";//申请单类型
|
||||
public static final String FSSC_TRAIN_STATUS_SUCCESS = "1";//申请单类型
|
||||
public static final String FSSC_TRAIN_STATUS_CHANGE = "2";//申请单类型
|
||||
public static final String FSSC_TRAIN_STATUS_REFUND = "3";//申请单类型
|
||||
|
||||
public static final String FSSC_CAR_STATUS_SUCCESS = "1";//申请单类型
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
package com.chint.infrastructure.repository;
|
||||
|
||||
|
||||
import com.chint.domain.aggregates.location.basedata.DistrictPOIInfoEntity;
|
||||
import com.chint.domain.repository.DistrictInfoRepository;
|
||||
import com.chint.infrastructure.repository.jdbc.JdbcDistrictInfoRepository;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Repository
|
||||
public class DistrictInfoRepositoryImpl implements DistrictInfoRepository {
|
||||
@Autowired
|
||||
private JdbcDistrictInfoRepository jdbcDistrictInfoRepository;
|
||||
|
||||
|
||||
@Override
|
||||
public List<DistrictPOIInfoEntity> findAll() {
|
||||
List<DistrictPOIInfoEntity> res = new ArrayList<>();
|
||||
jdbcDistrictInfoRepository.findAll().forEach(res::add);
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DistrictPOIInfoEntity save(DistrictPOIInfoEntity districtPOIInfoEntity) {
|
||||
return jdbcDistrictInfoRepository.save(districtPOIInfoEntity);
|
||||
}
|
||||
}
|
|
@ -59,6 +59,16 @@ public class LocationRepositoryImpl implements LocationRepository {
|
|||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Location findByCityId(Long cityId,String shortName) {
|
||||
return jdbcLocationRepository.findByCityIdAndLocationShortName(cityId,shortName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Location> findAllLeverThreeAndIsInternal() {
|
||||
return jdbcLocationRepository.findByLevelAndIsInternal(3,1);
|
||||
}
|
||||
|
||||
@Cacheable(value = "Location-findById", key = "#id")
|
||||
@Override
|
||||
public Location findById(Long id) {
|
||||
|
@ -132,6 +142,11 @@ public class LocationRepositoryImpl implements LocationRepository {
|
|||
return jdbcLocationRepository.findByLocationNameAndLevelOrLocationNameAndLevel(localName, 3, localName, 4);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Location findByDistrictShotName(String name) {
|
||||
return jdbcLocationRepository.findByLocationShortName(name);
|
||||
}
|
||||
|
||||
|
||||
@Cacheable(value = "Location-findHotCitiesByCityName-localName", key = "#locationNames")
|
||||
@Override
|
||||
|
|
|
@ -26,9 +26,16 @@ public class PrefectureLevelRepositoryImpl implements PrefectureLevelRepository
|
|||
}
|
||||
return prefectureLevelCityInfoEntities;
|
||||
}
|
||||
// public Location findByLocationId(Long locationId) {
|
||||
// return jdbcLocationRepository.findByLocationId(locationId);
|
||||
// }
|
||||
|
||||
@Override
|
||||
public PrefectureLevelCityInfoEntity findByCityId(Long cityId) {
|
||||
return jdbcPrefectureLevelRepository.findByCityId(cityId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PrefectureLevelCityInfoEntity save(PrefectureLevelCityInfoEntity cityInfoEntity) {
|
||||
return jdbcPrefectureLevelRepository.save(cityInfoEntity);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
package com.chint.infrastructure.repository.jdbc;
|
||||
|
||||
import com.chint.domain.aggregates.location.basedata.DistrictPOIInfoEntity;
|
||||
import org.springframework.data.repository.CrudRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
public interface JdbcDistrictInfoRepository extends CrudRepository<DistrictPOIInfoEntity,Long> {
|
||||
|
||||
|
||||
}
|
|
@ -11,8 +11,12 @@ import java.util.List;
|
|||
|
||||
@Repository
|
||||
public interface JdbcLocationRepository extends CrudRepository<Location, Long> {
|
||||
|
||||
Location findByCityIdAndLocationShortName(Long cityId, String locationShortName);
|
||||
Location findByLocationId(Long locationId);
|
||||
|
||||
Location findByLocationShortName(String locationShortName);
|
||||
|
||||
Page<Location> findAllByLocationPathContaining(String locationPath, Pageable pageable);
|
||||
|
||||
Page<Location> findAllByParentLocationId(Long parentLocationId, Pageable pageable);
|
||||
|
@ -55,4 +59,6 @@ public interface JdbcLocationRepository extends CrudRepository<Location, Long> {
|
|||
|
||||
List<Location> findAllByLocationPathNotContainingAndLevel(String locationPath, Integer level);
|
||||
|
||||
List<Location> findByLevelAndIsInternal(Integer level, Integer isInternal);
|
||||
|
||||
}
|
||||
|
|
|
@ -19,5 +19,5 @@ public interface JdbcPrefectureLevelRepository extends CrudRepository<Prefecture
|
|||
List<PrefectureLevelCityInfoEntity> findByCityName(String cityName);
|
||||
List<PrefectureLevelCityInfoEntity> findByCityNameContaining(String cityName);
|
||||
|
||||
|
||||
PrefectureLevelCityInfoEntity findByCityId(Long cityId);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
package com.chint.infrastructure.util;
|
||||
|
||||
import net.sourceforge.pinyin4j.PinyinHelper;
|
||||
|
||||
public class PinyinUtil {
|
||||
|
||||
public static String getFirstLetter(String chineseStr) {
|
||||
if (chineseStr == null || chineseStr.isEmpty()) {
|
||||
return "";
|
||||
}
|
||||
|
||||
// 提取字符串的第一个字符
|
||||
char firstChar = chineseStr.charAt(0);
|
||||
|
||||
// 使用pinyin4j库将字符转换为拼音数组
|
||||
String[] pinyinArray = PinyinHelper.toHanyuPinyinStringArray(firstChar);
|
||||
|
||||
// 如果字符是中文,则返回其拼音首字母,否则直接返回该字符
|
||||
if (pinyinArray != null) {
|
||||
return String.valueOf(pinyinArray[0].charAt(0)).toUpperCase();
|
||||
} else {
|
||||
return String.valueOf(firstChar).toUpperCase();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -3,6 +3,8 @@ package com.chint.infrastructure.util;
|
|||
import java.io.Serializable;
|
||||
import java.util.Objects;
|
||||
|
||||
import static com.chint.infrastructure.constant.CommonMessageConstant.*;
|
||||
|
||||
public class Result<T> implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@ -39,21 +41,21 @@ public class Result<T> implements Serializable {
|
|||
}
|
||||
|
||||
public static <T> Result<T> Success(String msg, T data) {
|
||||
return new Result<T>(msg, "1", data);
|
||||
return new Result<T>(msg, RESULT_SUCCESS_CODE, data);
|
||||
}
|
||||
|
||||
public static <T> Result<T> Success(String msg) {
|
||||
return new Result<T>(msg, "1");
|
||||
return new Result<T>(msg, RESULT_SUCCESS_CODE);
|
||||
}
|
||||
|
||||
public static <T> Result<T> error(String msg) {
|
||||
return new Result<T>(msg, "0");
|
||||
return new Result<T>(msg, RESULT_ERROR_CODE);
|
||||
}
|
||||
public static <T> Result<T> tokenExpired(String msg) {
|
||||
return new Result<T>(msg, "-1");
|
||||
}
|
||||
public static <T> Result<T> ssoLoginFail(String msg) {
|
||||
return new Result<T>(msg, "-2");
|
||||
return new Result<T>(msg, RESULT_SSO_LOGIN_ERROR_CODE);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -5,7 +5,7 @@ import com.authine.cloudpivot.opensdk.ApiException;
|
|||
import com.authine.cloudpivot.opensdk.CloudpivotOpenClient;
|
||||
import com.authine.cloudpivot.opensdk.model.request.workflow.StartWorkflowRequest;
|
||||
import com.authine.cloudpivot.opensdk.model.response.workflow.StartWorkflowResponse;
|
||||
import com.chint.dama.dc.basic.Result;
|
||||
//import com.chint.dama.dc.basic.Result;
|
||||
import com.chint.domain.aggregates.user.User;
|
||||
import com.chint.infrastructure.util.BaseContext;
|
||||
import com.chint.interfaces.rest.base.PostRequest;
|
||||
|
|
|
@ -11,4 +11,18 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||
public class CTripNoteResponse {
|
||||
private String errorCode;
|
||||
private String errorMessage;
|
||||
|
||||
public static CTripNoteResponse error(String message){
|
||||
CTripNoteResponse cTripNoteResponse = new CTripNoteResponse();
|
||||
cTripNoteResponse.setErrorCode("1");
|
||||
cTripNoteResponse.setErrorMessage(message);
|
||||
return cTripNoteResponse;
|
||||
}
|
||||
|
||||
public static CTripNoteResponse success(String message){
|
||||
CTripNoteResponse cTripNoteResponse = new CTripNoteResponse();
|
||||
cTripNoteResponse.setErrorCode("0");
|
||||
cTripNoteResponse.setErrorMessage(message);
|
||||
return cTripNoteResponse;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,8 +14,8 @@ public class BasicInfo {
|
|||
private String UID;
|
||||
private String PreEmployName;
|
||||
private String EmployeeID;
|
||||
private int AccountID;
|
||||
private int SubAccountID;
|
||||
private Integer AccountID;
|
||||
private Integer SubAccountID;
|
||||
private String CorpPayType;
|
||||
private String CreateTime;
|
||||
private String FinishDate;
|
||||
|
@ -23,7 +23,7 @@ public class BasicInfo {
|
|||
private String FlightClass;
|
||||
private String FlightWay;
|
||||
private String Remarks;
|
||||
private int PreBookDays;
|
||||
private Integer PreBookDays;
|
||||
private ServiceDetailInfo ServiceDetailInfo;
|
||||
private String NBillingType;
|
||||
private String TicketStatus;
|
||||
|
@ -32,21 +32,21 @@ public class BasicInfo {
|
|||
private String IsOfficialCard;
|
||||
private String BookingChannel;
|
||||
private String PlatformOrderID;
|
||||
private double PayExchangeRate;
|
||||
private Double PayExchangeRate;
|
||||
private int OperationCode;
|
||||
private double Amount;
|
||||
private double TravelMoney;
|
||||
private double ChangeAmount;
|
||||
private double RefundAmount;
|
||||
private double CCardPayFee;
|
||||
private double SendTicketFee;
|
||||
private double InsuranceFee;
|
||||
private Double Amount;
|
||||
private Double TravelMoney;
|
||||
private Double ChangeAmount;
|
||||
private Double RefundAmount;
|
||||
private Double CCardPayFee;
|
||||
private Double SendTicketFee;
|
||||
private Double InsuranceFee;
|
||||
private String PrepayType;
|
||||
private double TotalServiceFee;
|
||||
private Double TotalServiceFee;
|
||||
private String Currency;
|
||||
private double ForeignAmount;
|
||||
private boolean Refundable;
|
||||
private boolean Rebookable;
|
||||
private Double ForeignAmount;
|
||||
private Boolean Refundable;
|
||||
private Boolean Rebookable;
|
||||
private String JourneyID;
|
||||
private String CostCenter;
|
||||
private String CostCenter2;
|
||||
|
@ -65,18 +65,18 @@ public class BasicInfo {
|
|||
private Object ConfirmPersonCC2;
|
||||
private String ConfirmType;
|
||||
private String ConfirmType2;
|
||||
private boolean PayMixed;
|
||||
private Boolean PayMixed;
|
||||
private List<PaymentItem> PaymentItemList;
|
||||
private String IsOnline;
|
||||
private String CorporationId;
|
||||
private int DockingVendorPlatform;
|
||||
private Integer DockingVendorPlatform;
|
||||
private Object DockingVendorPlatformAccount;
|
||||
private Object CorpDockingInfoList;
|
||||
private Object AirlineCountryIdEqualAccount;
|
||||
private String PreEmployNamePinYin;
|
||||
private boolean CancelAble;
|
||||
private double NewTotalServiceFee;
|
||||
private double PostBasicServiceFee;
|
||||
private double PostItineraryFee;
|
||||
private Boolean CancelAble;
|
||||
private Double NewTotalServiceFee;
|
||||
private Double PostBasicServiceFee;
|
||||
private Double PostItineraryFee;
|
||||
private Object NewOrderIdList;
|
||||
}
|
|
@ -2,16 +2,19 @@ package com.chint.interfaces.rest.ctrip.dto.search.flight;
|
|||
|
||||
|
||||
import lombok.Data;
|
||||
import org.apache.commons.math3.util.IntegerSequence;
|
||||
|
||||
import javax.sound.midi.Sequence;
|
||||
|
||||
@Data
|
||||
public class ChangeInfo {
|
||||
private int Sequence;
|
||||
private int RebookId;
|
||||
private Integer Sequence;
|
||||
private Integer RebookId;
|
||||
private String CPrepayType;
|
||||
private String PassengerName;
|
||||
private String CStatus;
|
||||
private double CFee;
|
||||
private double RebookServiceFee;
|
||||
private Double CFee;
|
||||
private Double RebookServiceFee;
|
||||
private String RebookingTime;
|
||||
private String RebookedTime;
|
||||
private String OriTicketNo;
|
||||
|
@ -60,13 +63,13 @@ public class ChangeInfo {
|
|||
private int TaxDifferential;
|
||||
private String TakeOffTimeUTC;
|
||||
private String ArrivalTimeUTC;
|
||||
private double PriceRate;
|
||||
private Double PriceRate;
|
||||
private String DepartureCountryCode;
|
||||
private String ArrivalCountryCode;
|
||||
private String FlightWay;
|
||||
private String DepartureDistrictCode;
|
||||
private String ArrivalDistrictCode;
|
||||
private double CheckTicketPrice;
|
||||
private Double CheckTicketPrice;
|
||||
private String ShareFlightNo;
|
||||
private String OriginalTicketNoSignCode;
|
||||
private String PreTicketNoSignCode;
|
||||
|
|
|
@ -18,18 +18,18 @@ public class FlightInfo {
|
|||
private String DPortName;
|
||||
private String DPortCode;
|
||||
private String Agreement;
|
||||
private double Amount;
|
||||
private double Price;
|
||||
private double PrintPrice;
|
||||
private double PriceRate;
|
||||
private double StandardPrice;
|
||||
private Double Amount;
|
||||
private Double Price;
|
||||
private Double PrintPrice;
|
||||
private Double PriceRate;
|
||||
private Double StandardPrice;
|
||||
private boolean HasMeal;
|
||||
private double OilFee;
|
||||
private double Tax;
|
||||
private Double OilFee;
|
||||
private Double Tax;
|
||||
private String Bindtype;
|
||||
private int BindNum;
|
||||
private double BindAmount;
|
||||
private double ServerFee;
|
||||
private Double BindAmount;
|
||||
private Double ServerFee;
|
||||
private int Subsidy;
|
||||
private String AgeType;
|
||||
|
||||
|
@ -46,7 +46,7 @@ public class FlightInfo {
|
|||
private String EndNotes;
|
||||
private String Adtk;
|
||||
private int FuelMileage;
|
||||
private double EClassStandardPrice;
|
||||
private Double EClassStandardPrice;
|
||||
private String SpeicalClassTypeName;
|
||||
private String SpeicalClassTypeDescription;
|
||||
private String CraftType;
|
||||
|
@ -65,8 +65,8 @@ public class FlightInfo {
|
|||
private String PreBookReasonDesc;
|
||||
private String LowFlight;
|
||||
private String LowClass;
|
||||
private double LowestPrice;
|
||||
private double LowRate;
|
||||
private Double LowestPrice;
|
||||
private Double LowRate;
|
||||
private String LowDTime;
|
||||
private int Tpm;
|
||||
private String ClassReason;
|
||||
|
@ -81,7 +81,7 @@ public class FlightInfo {
|
|||
private String SaleType;
|
||||
private String PNR;
|
||||
private int SegmentNo;
|
||||
private double ItineraryFee;
|
||||
private Double ItineraryFee;
|
||||
// private List<ItineraryPassenger> ItineraryPassengers; // Assuming ItineraryPassenger is another class that you will define
|
||||
// ... other fields
|
||||
|
||||
|
|
|
@ -16,20 +16,20 @@ public class FlightRefundDetail {
|
|||
private String TicketNoSignCode;
|
||||
private String Flight;
|
||||
private String PassengerName;
|
||||
private double RefundFee;
|
||||
private double RefundRate;
|
||||
private Double RefundFee;
|
||||
private Double RefundRate;
|
||||
private int RefundServiceFee;
|
||||
private int Subsidy;
|
||||
private long RebookingListID;
|
||||
private long RebookingID;
|
||||
private double UsedAmount;
|
||||
private double UsedTax;
|
||||
private Double UsedAmount;
|
||||
private Double UsedTax;
|
||||
private int UnusedRefundServiceFeeType;
|
||||
private int UnusedRefundServiceFee;
|
||||
private double RefundItineraryFee;
|
||||
private Double RefundItineraryFee;
|
||||
private String RefundInsuranceDetail;
|
||||
private double TotalEmdAmount;
|
||||
private Double TotalEmdAmount;
|
||||
private String ShareFlightNo;
|
||||
private double SupplierServiceFee;
|
||||
private Double SupplierServiceFee;
|
||||
private RefundFeeForCustomerInfo RefundFeeForCustomerInfo;
|
||||
}
|
||||
|
|
|
@ -15,8 +15,8 @@ import java.util.List;
|
|||
public class FlightRefundInfo {
|
||||
private String TokenNO;
|
||||
private String Audited;
|
||||
private double PayCustomerAmount;
|
||||
private double PayCustomerTravelMoney;
|
||||
private Double PayCustomerAmount;
|
||||
private Double PayCustomerTravelMoney;
|
||||
private String RefundAplyTime;
|
||||
private String RefundAuditedTime;
|
||||
private String RefundTime;
|
||||
|
@ -47,20 +47,20 @@ class RefundFeeForCustomerInfo {
|
|||
}
|
||||
@Data
|
||||
class UsedFeeInfo {
|
||||
private double UsedPrintPrice;
|
||||
private double UsedCost;
|
||||
private double UsedTax;
|
||||
private double UsedOilFee;
|
||||
private double UsedDistributionPrice;
|
||||
private double UsedAmount;
|
||||
private Double UsedPrintPrice;
|
||||
private Double UsedCost;
|
||||
private Double UsedTax;
|
||||
private Double UsedOilFee;
|
||||
private Double UsedDistributionPrice;
|
||||
private Double UsedAmount;
|
||||
|
||||
// Getters and Setters
|
||||
}
|
||||
@Data
|
||||
class ServiceFeeInfo {
|
||||
private double CtripServiceFee;
|
||||
private double SupplierServiceFee;
|
||||
private double CarrierServiceFee;
|
||||
private Double CtripServiceFee;
|
||||
private Double SupplierServiceFee;
|
||||
private Double CarrierServiceFee;
|
||||
|
||||
// Getters and Setters
|
||||
}
|
||||
|
|
|
@ -5,5 +5,5 @@ class ItemDetail {
|
|||
private long PassengerId;
|
||||
private String PassengerName;
|
||||
private String FeeCode;
|
||||
private double FeeAmount;
|
||||
private Double FeeAmount;
|
||||
}
|
|
@ -7,6 +7,6 @@ import java.util.List;
|
|||
@Data
|
||||
public class PaymentItem {
|
||||
private String PayType;
|
||||
private double PayAmount;
|
||||
private Double PayAmount;
|
||||
private List<ItemDetail> ItemDetailList;
|
||||
}
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
package com.chint.interfaces.rest.ctrip.dto.search.flight;
|
||||
|
||||
class ServiceDetailInfo {
|
||||
private double BaseServiceFee;
|
||||
private double BindServiceFee;
|
||||
private double SpecialServiceFee;
|
||||
private double UnWorkTimeServiceFee;
|
||||
private double VIPServiceFee;
|
||||
private double ItineraryFeeForRMB;
|
||||
private double ItineraryFeeForForeign;
|
||||
private double TechnicalServiceFee;
|
||||
private double PresentInsuranceServiceFee;
|
||||
private Double BaseServiceFee;
|
||||
private Double BindServiceFee;
|
||||
private Double SpecialServiceFee;
|
||||
private Double UnWorkTimeServiceFee;
|
||||
private Double VIPServiceFee;
|
||||
private Double ItineraryFeeForRMB;
|
||||
private Double ItineraryFeeForForeign;
|
||||
private Double TechnicalServiceFee;
|
||||
private Double PresentInsuranceServiceFee;
|
||||
}
|
|
@ -26,9 +26,9 @@ public class TripRecordInfo {
|
|||
private String APortBuilding;
|
||||
private int APortBuildingId;
|
||||
private boolean OpenTranFlag;
|
||||
private double PrintPrice;
|
||||
private double Oil;
|
||||
private double Tax;
|
||||
private Double PrintPrice;
|
||||
private Double Oil;
|
||||
private Double Tax;
|
||||
private String RecordNo;
|
||||
private String AirlineRecordNo;
|
||||
private boolean SharedFlag;
|
||||
|
|
|
@ -27,6 +27,9 @@ public class HotelOrderInfoEntity {
|
|||
private String SettlementPersonAmt; // 结算个人金额
|
||||
private String AddedFees; // 额外费用
|
||||
private String FrontendServiceFee; // 前端服务费
|
||||
private String AfterServiceFee; // 前端服务费
|
||||
|
||||
|
||||
private String HotelType; // 酒店类型
|
||||
private String HotelName; // 酒店名称
|
||||
private String HotelEnName; // 酒店英文名称
|
||||
|
@ -79,4 +82,10 @@ public class HotelOrderInfoEntity {
|
|||
private List<ClientInfo> ClientInfo; // 客户信息列表
|
||||
|
||||
private List<RefundInfo> RefundInfo; // 客户信息列表
|
||||
|
||||
|
||||
private List<PaymentReceived> PaymentReceivedList;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
package com.chint.interfaces.rest.ctrip.dto.search.hotel;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author wanglf3
|
||||
* @date 2024-03-17
|
||||
* @vsrsion 1.0
|
||||
**/
|
||||
|
||||
@Data
|
||||
public class PaymentReceived {
|
||||
private String BillNo; // 客户名
|
||||
private String RelatedBillNo; // 员工ID
|
||||
private String Amount; // 成本中心1
|
||||
private String Currency; // 成本中心2
|
||||
private String ExchangeRate; // 成本中心3
|
||||
private String TransactionType; // 成本中心4
|
||||
private String PaymentStatus; // 成本中心5
|
||||
private String PaymentTime; // 成本中心6
|
||||
private String PaymentType; // 成本中心6
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -5,9 +5,9 @@ import lombok.Data;
|
|||
@Data
|
||||
public class RefundInfo {
|
||||
private long RefundInfoID;
|
||||
private int RefundCustomerAmount;
|
||||
private Double RefundCustomerAmount;
|
||||
private String Currency;
|
||||
private int ExchangeRate;
|
||||
private Double ExchangeRate;
|
||||
// private List<RefundPayment> RefundPaymentList;
|
||||
// private List<RefundDetail> RefundDetailList;
|
||||
private Long ModifyFormId;
|
||||
|
|
|
@ -9,7 +9,7 @@ public class AccountPaymentInfo {
|
|||
private int AccountID;
|
||||
private int SubAccountID;
|
||||
private String OrderID;
|
||||
private double Amount;
|
||||
private Double Amount;
|
||||
private String Category;
|
||||
private String DataChange_CreateTime;
|
||||
private String TrainRelatedNo;
|
||||
|
|
|
@ -5,7 +5,7 @@ import lombok.Data;
|
|||
|
||||
@Data
|
||||
public class FundAccountDealInfo {
|
||||
private double Amount;
|
||||
private Double Amount;
|
||||
private String Category;
|
||||
private long DealID;
|
||||
// 可以根据需要继续添加更多的字段
|
||||
|
|
|
@ -7,6 +7,6 @@ import lombok.Data;
|
|||
public class OrderPayment {
|
||||
private String PaymentType;
|
||||
private String FeeCode;
|
||||
private double FeeAmount;
|
||||
private Double FeeAmount;
|
||||
// 可以根据需要继续添加更多的字段
|
||||
}
|
|
@ -11,9 +11,9 @@ public class PassengerInfo {
|
|||
private String IdentityNo;
|
||||
private String Birthday;
|
||||
private String TicketTypeName;
|
||||
private int InsuranceProductID;
|
||||
private int PurchaseNumber;
|
||||
private int TicketPresentNum;
|
||||
private Integer InsuranceProductID;
|
||||
private Integer PurchaseNumber;
|
||||
private Integer TicketPresentNum;
|
||||
private String CostCenter1;
|
||||
private String CostCenter2;
|
||||
private String CostCenter3;
|
||||
|
|
|
@ -5,8 +5,8 @@ import lombok.Data;
|
|||
// PaymentInfo内部类定义
|
||||
@Data
|
||||
public class PaymentInfo {
|
||||
private double Amount;
|
||||
private double ExchangeRate;
|
||||
private Double Amount;
|
||||
private Double ExchangeRate;
|
||||
private String Currency;
|
||||
private String DealType;
|
||||
private String PayWayID;
|
||||
|
|
|
@ -7,17 +7,17 @@ public class SettlementInfoDetail {
|
|||
private long OrderTicketID;
|
||||
private long PassengerID;
|
||||
private String PassengerName;
|
||||
private double TicketPrice;
|
||||
private double InsuranceFee;
|
||||
private double ServiceFee;
|
||||
private double RefundTicketFee;
|
||||
private double DeliverFee;
|
||||
private double PaperTicketFee;
|
||||
private double ChangeServiceFee;
|
||||
private double GrabServiceFee;
|
||||
private long DealID;
|
||||
private Double TicketPrice;
|
||||
private Double InsuranceFee;
|
||||
private Double ServiceFee;
|
||||
private Double RefundTicketFee;
|
||||
private Double DeliverFee;
|
||||
private Double PaperTicketFee;
|
||||
private Double ChangeServiceFee;
|
||||
private Double GrabServiceFee;
|
||||
private Long DealID;
|
||||
private String TicketInfoID;
|
||||
private double AfterTakeTicketFee;
|
||||
private double PurchaseFee;
|
||||
private Double AfterTakeTicketFee;
|
||||
private Double PurchaseFee;
|
||||
// 可以根据需要继续添加更多的字段
|
||||
}
|
|
@ -12,9 +12,9 @@ public class TicketInfo {
|
|||
private String ArrivalCityName;
|
||||
private String ArrivalDateTime;
|
||||
private String FirstSeatTypeName;
|
||||
private double TicketPrice;
|
||||
private Double TicketPrice;
|
||||
private String ElectronicOrderNo;
|
||||
private double ServiceFee;
|
||||
private Double ServiceFee;
|
||||
private String TicketEntrance;
|
||||
private String DealID;
|
||||
// 可以根据需要继续添加更多的字段
|
||||
|
|
|
@ -8,18 +8,18 @@ public class TrainBasicInfo {
|
|||
private String OrderID;
|
||||
private String TripID;
|
||||
private String EmployeeID;
|
||||
private double OrderAmount;
|
||||
private double DealAmount;
|
||||
private int TotalQuantity;
|
||||
private Double OrderAmount;
|
||||
private Double DealAmount;
|
||||
private Integer TotalQuantity;
|
||||
private String Remark;
|
||||
private boolean NeedInvoice;
|
||||
private boolean IsIncludeInsuranceInvoice;
|
||||
private int OrderTicketType;
|
||||
private Boolean NeedInvoice;
|
||||
private Boolean IsIncludeInsuranceInvoice;
|
||||
private Integer OrderTicketType;
|
||||
private String OrderTicketTypeDesc;
|
||||
private String OrderStatus;
|
||||
private String OrderType;
|
||||
private String OrderTypeDesc;
|
||||
private double ServiceFee;
|
||||
private Double ServiceFee;
|
||||
private String ContactName;
|
||||
private String ContactMobile;
|
||||
private String ContactEmail;
|
||||
|
@ -28,17 +28,17 @@ public class TrainBasicInfo {
|
|||
private String RefundTicketStatus;
|
||||
private String PaymentType;
|
||||
private String DataChange_CreateTime;
|
||||
private double DeliverFee;
|
||||
private double PaperTicketFee;
|
||||
private Double DeliverFee;
|
||||
private Double PaperTicketFee;
|
||||
private String AccountName;
|
||||
private String ConfirmPerson;
|
||||
private String AuditResult;
|
||||
private String AuditResultDesc;
|
||||
private String OrderStatusName;
|
||||
private double ChangeServiceFee;
|
||||
private Double ChangeServiceFee;
|
||||
private String ServerFrom;
|
||||
private String CorporationId;
|
||||
private boolean NeedBigInvoice;
|
||||
private Boolean NeedBigInvoice;
|
||||
private String CountryCode;
|
||||
// 可以根据需要继续添加更多的字段
|
||||
}
|
|
@ -6,8 +6,8 @@ import lombok.Data;
|
|||
@Data
|
||||
public class TrainCorpOrderInfo {
|
||||
private String CorporationID;
|
||||
private int AccountID;
|
||||
private int SubAccountID;
|
||||
private Integer AccountID;
|
||||
private Integer SubAccountID;
|
||||
private String CorpPayType;
|
||||
private String CostCenter1;
|
||||
private String CostCenter2;
|
||||
|
|
|
@ -5,7 +5,7 @@ import lombok.Data;
|
|||
@Data
|
||||
public class TrainTicketDeliveryInfo {
|
||||
private String OrderID;
|
||||
private int AreaID;
|
||||
private Integer AreaID;
|
||||
private String Province;
|
||||
private String City;
|
||||
private String Area;
|
||||
|
|
|
@ -2,17 +2,16 @@ package com.chint.interfaces.rest.ctrip.in;
|
|||
|
||||
import com.chint.application.commands.OrderStatusChangeCommand;
|
||||
import com.chint.domain.aggregates.order.OrderDetail;
|
||||
import com.chint.domain.aggregates.system.SupplierCallBackLog;
|
||||
import com.chint.domain.repository.SupplierCallBackLogRepository;
|
||||
import com.chint.domain.service.supplier.SupplierService;
|
||||
import com.chint.domain.value_object.SupplierCallbackData;
|
||||
import com.chint.infrastructure.constant.OrderConstant;
|
||||
import com.chint.infrastructure.echo_framework.command.Command;
|
||||
import com.chint.infrastructure.util.Digest;
|
||||
import com.chint.infrastructure.util.Result;
|
||||
import com.chint.interfaces.rest.ctrip.CTripOrderSearchRequest;
|
||||
import com.chint.interfaces.rest.ctrip.dto.put.CTripStatusNotification;
|
||||
import com.chint.interfaces.rest.ctrip.dto.put.CTripStatusResponse;
|
||||
import com.chint.interfaces.rest.ctrip.dto.search.SearchOrderResponse;
|
||||
import com.chint.interfaces.rest.ctrip.tools.CTripUtils;
|
||||
import com.google.gson.Gson;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -67,7 +66,7 @@ public class CTripNoteController {
|
|||
|
||||
@Transactional
|
||||
@PostMapping("/status")
|
||||
public CTripStatusResponse statusEvent(@RequestBody CTripStatusNotification cTripStatusNotification) {
|
||||
public Result<String> statusEvent(@RequestBody CTripStatusNotification cTripStatusNotification) {
|
||||
String json = gson.toJson(cTripStatusNotification);
|
||||
log.info(json);
|
||||
|
||||
|
@ -84,16 +83,16 @@ public class CTripNoteController {
|
|||
String orderId = cTripStatusNotification.getOrderId();
|
||||
String putCTripSign = Digest.getPutCTripStatusSign(cTripStatusNotification.getCorpId(), productType, orderStatus, orderId, C_TRIP_REQUEST_SECRET);
|
||||
if (!putCTripSign.equals(cTripStatusNotification.getSign())) {
|
||||
return new CTripStatusResponse("1", "sign错误");
|
||||
return Result.error("sign错误");
|
||||
}
|
||||
if (orderStatus != null && orderId != null) {
|
||||
return handlerData(orderId, orderStatus, productType);
|
||||
}
|
||||
return new CTripStatusResponse("1", "未收到消息");
|
||||
return Result.error("未收到消息");
|
||||
}
|
||||
|
||||
|
||||
public CTripStatusResponse handlerData(String orderId, String orderStatus, String productType) {
|
||||
public Result<String> handlerData(String orderId, String orderStatus, String productType) {
|
||||
SupplierCallbackData supplierCallbackData =
|
||||
SupplierCallbackData.of(SUPPLIER_C_TRIP);
|
||||
SearchOrderResponse response = cTripOrderSearchRequest
|
||||
|
@ -108,15 +107,15 @@ public class CTripNoteController {
|
|||
switch (productType) {
|
||||
case "FlightInternational":
|
||||
case "FlightDomestic":
|
||||
command.eventType(mapFlightStatus(orderStatus));
|
||||
command.eventType(CTripUtils.mapFlightStatus(orderStatus));
|
||||
break;
|
||||
case "HotelMember":
|
||||
case "HotelContract":
|
||||
command.eventType(mapHotelStatus(orderStatus));
|
||||
command.eventType(CTripUtils.mapHotelStatus(orderStatus));
|
||||
break;
|
||||
case "Train":
|
||||
case "OverseaTrain":
|
||||
command.eventType(mapTrainStatus(orderStatus));
|
||||
command.eventType(CTripUtils.mapTrainStatus(orderStatus));
|
||||
break;
|
||||
case "CarPickUpInternational":
|
||||
case "CarRentalDomestic":
|
||||
|
@ -124,169 +123,10 @@ public class CTripNoteController {
|
|||
case "CarPickUpDomesticNew":
|
||||
case "CarCharterDomestic":
|
||||
case "BusTicket":
|
||||
command.eventType(mapCarStatus(orderStatus));
|
||||
command.eventType(CTripUtils.mapCarStatus(orderStatus));
|
||||
break;
|
||||
}
|
||||
command.sendToQueue();
|
||||
return new CTripStatusResponse("0", "成功收到消息");
|
||||
}
|
||||
|
||||
|
||||
public Integer mapFlightStatus(String status) {
|
||||
return switch (status) {
|
||||
case "Submitted" -> OrderConstant.ORDER_EVENT_PREPARE; // "已提交"映射到准备下单
|
||||
case "Confirmed" -> OrderConstant.ORDER_EVENT_ORDERED; // "已客户确认"映射到已下单
|
||||
case "Ticketed" -> OrderConstant.ORDER_EVENT_PAYED; // "已出票"可能意味着已经支付完成
|
||||
case "Cancelled" -> OrderConstant.ORDER_EVENT_CANCEL; // "已取消"映射到取消
|
||||
case "Refunded" -> OrderConstant.ORDER_EVENT_REFUND; // "已经退票"映射到退票
|
||||
case "RefundSuccess" -> OrderConstant.ORDER_EVENT_REFUND; // "已经退票"映射到退票
|
||||
case "RefundCancelled" ->
|
||||
// 可能需要新的状态常量,因为它没有直接映射
|
||||
OrderConstant.ORDER_EVENT_PAYED;
|
||||
case "Dealt" ->
|
||||
// "已经成交"可能意味着订单已完成,但没有直接映射,可能需要新的状态常量
|
||||
OrderConstant.ORDER_EVENT_PAYED;
|
||||
case "Rebooked" -> OrderConstant.ORDER_EVENT_PAYED;
|
||||
case "rebookSuccess" -> OrderConstant.ORDER_EVENT_CHANGE; // "改签成功"映射到改签
|
||||
case "RebookedFailed" ->
|
||||
// "改签失败"可能需要新的状态常量,因为它没有直接映射
|
||||
OrderConstant.ORDER_EVENT_PAYED;
|
||||
case "RebookSubmitted" ->
|
||||
// "改签提交"可能意味着改签过程开始,但没有直接映射
|
||||
OrderConstant.ORDER_EVENT_PAYED;
|
||||
case "RebookConfirmed" ->
|
||||
// "改签确认"可能需要新的状态常量,因为它没有直接映射
|
||||
OrderConstant.ORDER_EVENT_PAYED;
|
||||
case "RebookToBePaid" ->
|
||||
// "改签待支付"可能意味着改签了但未支付,但没有直接映射
|
||||
OrderConstant.ORDER_EVENT_PAYED;
|
||||
case "RebookCancelled" ->
|
||||
// "改签取消"可能需要新的状态常量,因为它没有直接映射
|
||||
OrderConstant.ORDER_EVENT_PAYED;
|
||||
case "Paid" -> OrderConstant.ORDER_EVENT_PAYED; // "已支付"映射到已预定
|
||||
case "Approve_G" -> OrderConstant.ORDER_EVENT_UNKNOWN; // 未知状态
|
||||
case "Approving" -> OrderConstant.ORDER_EVENT_UNKNOWN; // 未知状态
|
||||
case "Approving2" -> OrderConstant.ORDER_EVENT_ETA; // 未知状态
|
||||
case "Approve_T" -> OrderConstant.ORDER_EVENT_UNKNOWN; // 未知状态
|
||||
case "Approve_F" -> OrderConstant.ORDER_EVENT_UNKNOWN; // 未知状态
|
||||
case "Approve_A" -> OrderConstant.ORDER_EVENT_UNKNOWN; // 未知状态
|
||||
case "Approve_C" -> OrderConstant.ORDER_EVENT_UNKNOWN; // 未知状态
|
||||
default ->
|
||||
// 处理未知或未映射的状态
|
||||
-99;
|
||||
};
|
||||
}
|
||||
|
||||
public Integer mapHotelStatus(String status) {
|
||||
return switch (status) {
|
||||
case "Submitted" -> OrderConstant.ORDER_EVENT_PREPARE; // "已提交"映射到准备状态
|
||||
case "Confirmed" -> OrderConstant.ORDER_EVENT_ORDERED; // "已客户确认"映射到已下单
|
||||
case "Cancelled" -> OrderConstant.ORDER_EVENT_REFUND; // "已取消"映射到取消
|
||||
case "Refunded" -> OrderConstant.ORDER_EVENT_REFUND; // "已取消"映射到取消
|
||||
case "Wait" ->
|
||||
// "确认中"可能表示订单正在处理中,但没有直接映射,可能需要新的状态常量
|
||||
OrderConstant.ORDER_EVENT_ORDERED;
|
||||
case "Paid" -> OrderConstant.ORDER_EVENT_PAYED; // "已支付"映射到已预定
|
||||
case "Dealt" ->
|
||||
// "已经成交"可能表示订单已完成,但没有直接映射,可能需要新的状态常量
|
||||
OrderConstant.ORDER_EVENT_PAYED;
|
||||
case "CheckIn" ->
|
||||
// "入店打卡"可能需要新的状态常量,因为它没有直接映射
|
||||
OrderConstant.ORDER_EVENT_PAYED;
|
||||
case "CheckOut" ->
|
||||
// "离店打卡"可能需要新的状态常量,因为它没有直接映射
|
||||
OrderConstant.ORDER_EVENT_PAYED;
|
||||
case "CancellationFailed" ->
|
||||
// "取消失败"可能需要新的状态常量,因为它没有直接映射
|
||||
OrderConstant.ORDER_EVENT_PAYED;
|
||||
case "submitFailed" ->
|
||||
// "提交失败"可能需要新的状态常量,因为它没有直接映射
|
||||
OrderConstant.ORDER_EVENT_PREPARE;
|
||||
case "Approve_G" -> OrderConstant.ORDER_EVENT_UNKNOWN; // 未知状态
|
||||
case "Approving" -> OrderConstant.ORDER_EVENT_UNKNOWN; // 未知状态
|
||||
case "Approving2" -> OrderConstant.ORDER_EVENT_ETA; // 未知状态
|
||||
case "Approve_T" -> OrderConstant.ORDER_EVENT_UNKNOWN; // 未知状态
|
||||
case "Approve_F" -> OrderConstant.ORDER_EVENT_UNKNOWN; // 未知状态
|
||||
case "Approve_A" -> OrderConstant.ORDER_EVENT_UNKNOWN; // 未知状态
|
||||
case "Approve_C" -> OrderConstant.ORDER_EVENT_UNKNOWN; // 未知状态
|
||||
default ->
|
||||
// 处理未知或未映射的状态
|
||||
-99;
|
||||
};
|
||||
}
|
||||
|
||||
public Integer mapTrainStatus(String status) {
|
||||
return switch (status) {
|
||||
case "Submitted" -> OrderConstant.ORDER_EVENT_PREPARE; // "已提交"映射到准备状态
|
||||
case "Ticketed" ->
|
||||
// "已出票"可能表示订单已完成出票,但没有直接的映射,可能需要新的状态常量或使用现有的常量
|
||||
OrderConstant.ORDER_EVENT_PAYED;
|
||||
case "Cancelled" -> OrderConstant.ORDER_EVENT_CANCEL; // "已取消"映射到取消状态
|
||||
case "Refunded" -> OrderConstant.ORDER_EVENT_REFUND; // "已经退票"映射到退票状态
|
||||
case "Rebooked" -> OrderConstant.ORDER_EVENT_CHANGE; // "已经改签"映射到改签状态
|
||||
case "IssueTicketFailed" ->
|
||||
// "出票失败"可能需要新的状态常量,因为它没有直接映射
|
||||
OrderConstant.ORDER_EVENT_ORDERED;
|
||||
case "RebookedFailed" ->
|
||||
// "改签失败"也可能需要新的状态常量,因为它没有直接映射
|
||||
OrderConstant.ORDER_EVENT_PAYED;
|
||||
case "SubmitRefund" ->
|
||||
// "退票成功"可能最接近"已经退票",但具体映射取决于业务逻辑
|
||||
OrderConstant.ORDER_EVENT_REFUND; // 使用退票状态作为近似映射
|
||||
case "Paid" -> OrderConstant.ORDER_EVENT_PAYED; // "已支付"映射到已预定状态
|
||||
case "Approve_G" -> OrderConstant.ORDER_EVENT_UNKNOWN; // 未知状态
|
||||
case "Approving" -> OrderConstant.ORDER_EVENT_UNKNOWN; // 未知状态
|
||||
case "Approving2" -> OrderConstant.ORDER_EVENT_UNKNOWN; // 未知状态
|
||||
case "Approve_T" -> OrderConstant.ORDER_EVENT_UNKNOWN; // 未知状态
|
||||
case "Approve_F" -> OrderConstant.ORDER_EVENT_UNKNOWN; // 未知状态
|
||||
case "Approve_A" -> OrderConstant.ORDER_EVENT_UNKNOWN; // 未知状态
|
||||
case "Approve_C" -> OrderConstant.ORDER_EVENT_UNKNOWN; // 未知状态
|
||||
default ->
|
||||
// 处理未知或未映射的状态
|
||||
-99;
|
||||
};
|
||||
}
|
||||
|
||||
public Integer mapCarStatus(String status) {
|
||||
return switch (status) {
|
||||
case "Cancelled" -> OrderConstant.ORDER_EVENT_CANCEL; // "已取消"映射到取消状态
|
||||
case "Dealt" ->
|
||||
// "已经成交"可能意味着订单已经确认或完成,但没有直接映射,可能需要新的状态常量
|
||||
OrderConstant.ORDER_EVENT_PAYED;
|
||||
case "WaitReply" ->
|
||||
// "等待应答"可能表示订单正在等待确认,但没有直接映射,可能需要新的状态常量
|
||||
OrderConstant.ORDER_EVENT_ORDERED;
|
||||
case "WaitService" ->
|
||||
// "等待接驾"可能表示服务即将开始,但没有直接映射,可能需要新的状态常量
|
||||
OrderConstant.ORDER_EVENT_ORDERED;
|
||||
case "Successful" ->
|
||||
// 成功
|
||||
OrderConstant.ORDER_EVENT_ORDERED;
|
||||
case "Redispatched" ->
|
||||
// "改派中"可能需要新的状态常量,因为它没有直接映射
|
||||
OrderConstant.ORDER_EVENT_PAYED;
|
||||
case "DriverArrived" ->
|
||||
// "司机已到达"可能需要新的状态常量,因为它没有直接映射
|
||||
OrderConstant.ORDER_EVENT_PAYED;
|
||||
case "InService" ->
|
||||
// "正在服务"表示服务正在进行中,但没有直接映射,可能需要新的状态常量
|
||||
OrderConstant.ORDER_EVENT_PAYED;
|
||||
case "EndService" ->
|
||||
// "行程结束"可能意味着服务已完成,但没有直接映射,可能需要新的状态常量
|
||||
OrderConstant.ORDER_EVENT_PAYED;
|
||||
case "Canceling" ->
|
||||
// "取消中"可能表示订单正在取消过程中,但没有直接映射,可能需要新的状态常量
|
||||
OrderConstant.ORDER_EVENT_REFUND;
|
||||
case "Approve_G" -> OrderConstant.ORDER_EVENT_UNKNOWN; // 未知状态
|
||||
case "Approving" -> OrderConstant.ORDER_EVENT_UNKNOWN; // 未知状态
|
||||
case "Approving2" -> OrderConstant.ORDER_EVENT_UNKNOWN; // 未知状态
|
||||
case "Approve_T" -> OrderConstant.ORDER_EVENT_UNKNOWN; // 未知状态
|
||||
case "Approve_F" -> OrderConstant.ORDER_EVENT_UNKNOWN; // 未知状态
|
||||
case "Approve_A" -> OrderConstant.ORDER_EVENT_UNKNOWN; // 未知状态
|
||||
case "Approve_C" -> OrderConstant.ORDER_EVENT_UNKNOWN; // 未知状态
|
||||
default ->
|
||||
// 处理未知或未映射的状态
|
||||
-99;
|
||||
};
|
||||
return Result.Success("成功收到消息");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,163 @@
|
|||
package com.chint.interfaces.rest.ctrip.tools;
|
||||
|
||||
import com.chint.infrastructure.constant.OrderConstant;
|
||||
|
||||
public class CTripUtils {
|
||||
public static Integer mapFlightStatus(String status) {
|
||||
return switch (status) {
|
||||
case "Submitted" -> OrderConstant.ORDER_EVENT_PREPARE; // "已提交"映射到准备下单
|
||||
case "Confirmed" -> OrderConstant.ORDER_EVENT_ORDERED; // "已客户确认"映射到已下单
|
||||
case "Ticketed" -> OrderConstant.ORDER_EVENT_PAYED; // "已出票"可能意味着已经支付完成
|
||||
case "Cancelled" -> OrderConstant.ORDER_EVENT_CANCEL; // "已取消"映射到取消
|
||||
case "Refunded" -> OrderConstant.ORDER_EVENT_REFUND; // "已经退票"映射到退票
|
||||
case "RefundSuccess" -> OrderConstant.ORDER_EVENT_REFUND; // "已经退票"映射到退票
|
||||
case "RefundCancelled" ->
|
||||
// 可能需要新的状态常量,因为它没有直接映射
|
||||
OrderConstant.ORDER_EVENT_PAYED;
|
||||
case "Dealt" ->
|
||||
// "已经成交"可能意味着订单已完成,但没有直接映射,可能需要新的状态常量
|
||||
OrderConstant.ORDER_EVENT_PAYED;
|
||||
case "Rebooked" -> OrderConstant.ORDER_EVENT_PAYED;
|
||||
case "rebookSuccess" -> OrderConstant.ORDER_EVENT_CHANGE; // "改签成功"映射到改签
|
||||
case "RebookedFailed" ->
|
||||
// "改签失败"可能需要新的状态常量,因为它没有直接映射
|
||||
OrderConstant.ORDER_EVENT_PAYED;
|
||||
case "RebookSubmitted" ->
|
||||
// "改签提交"可能意味着改签过程开始,但没有直接映射
|
||||
OrderConstant.ORDER_EVENT_PAYED;
|
||||
case "RebookConfirmed" ->
|
||||
// "改签确认"可能需要新的状态常量,因为它没有直接映射
|
||||
OrderConstant.ORDER_EVENT_PAYED;
|
||||
case "RebookToBePaid" ->
|
||||
// "改签待支付"可能意味着改签了但未支付,但没有直接映射
|
||||
OrderConstant.ORDER_EVENT_PAYED;
|
||||
case "RebookCancelled" ->
|
||||
// "改签取消"可能需要新的状态常量,因为它没有直接映射
|
||||
OrderConstant.ORDER_EVENT_PAYED;
|
||||
case "Paid" -> OrderConstant.ORDER_EVENT_PAYED; // "已支付"映射到已预定
|
||||
case "Approve_G" -> OrderConstant.ORDER_EVENT_UNKNOWN; // 未知状态
|
||||
case "Approving" -> OrderConstant.ORDER_EVENT_UNKNOWN; // 未知状态
|
||||
case "Approving2" -> OrderConstant.ORDER_EVENT_ETA; // 未知状态
|
||||
case "Approve_T" -> OrderConstant.ORDER_EVENT_UNKNOWN; // 未知状态
|
||||
case "Approve_F" -> OrderConstant.ORDER_EVENT_UNKNOWN; // 未知状态
|
||||
case "Approve_A" -> OrderConstant.ORDER_EVENT_UNKNOWN; // 未知状态
|
||||
case "Approve_C" -> OrderConstant.ORDER_EVENT_UNKNOWN; // 未知状态
|
||||
default ->
|
||||
// 处理未知或未映射的状态
|
||||
-99;
|
||||
};
|
||||
}
|
||||
|
||||
public static Integer mapHotelStatus(String status) {
|
||||
return switch (status) {
|
||||
case "Submitted" -> OrderConstant.ORDER_EVENT_PREPARE; // "已提交"映射到准备状态
|
||||
case "Confirmed" -> OrderConstant.ORDER_EVENT_ORDERED; // "已客户确认"映射到已下单
|
||||
case "Cancelled" -> OrderConstant.ORDER_EVENT_REFUND; // "已取消"映射到取消
|
||||
case "Refunded" -> OrderConstant.ORDER_EVENT_REFUND; // "已取消"映射到取消
|
||||
case "Wait" ->
|
||||
// "确认中"可能表示订单正在处理中,但没有直接映射,可能需要新的状态常量
|
||||
OrderConstant.ORDER_EVENT_ORDERED;
|
||||
case "Paid" -> OrderConstant.ORDER_EVENT_PAYED; // "已支付"映射到已预定
|
||||
case "Dealt" ->
|
||||
// "已经成交"可能表示订单已完成,但没有直接映射,可能需要新的状态常量
|
||||
OrderConstant.ORDER_EVENT_PAYED;
|
||||
case "CheckIn" ->
|
||||
// "入店打卡"可能需要新的状态常量,因为它没有直接映射
|
||||
OrderConstant.ORDER_EVENT_PAYED;
|
||||
case "CheckOut" ->
|
||||
// "离店打卡"可能需要新的状态常量,因为它没有直接映射
|
||||
OrderConstant.ORDER_EVENT_PAYED;
|
||||
case "CancellationFailed" ->
|
||||
// "取消失败"可能需要新的状态常量,因为它没有直接映射
|
||||
OrderConstant.ORDER_EVENT_PAYED;
|
||||
case "submitFailed" ->
|
||||
// "提交失败"可能需要新的状态常量,因为它没有直接映射
|
||||
OrderConstant.ORDER_EVENT_PREPARE;
|
||||
case "Approve_G" -> OrderConstant.ORDER_EVENT_UNKNOWN; // 未知状态
|
||||
case "Approving" -> OrderConstant.ORDER_EVENT_UNKNOWN; // 未知状态
|
||||
case "Approving2" -> OrderConstant.ORDER_EVENT_ETA; // 未知状态
|
||||
case "Approve_T" -> OrderConstant.ORDER_EVENT_UNKNOWN; // 未知状态
|
||||
case "Approve_F" -> OrderConstant.ORDER_EVENT_UNKNOWN; // 未知状态
|
||||
case "Approve_A" -> OrderConstant.ORDER_EVENT_UNKNOWN; // 未知状态
|
||||
case "Approve_C" -> OrderConstant.ORDER_EVENT_UNKNOWN; // 未知状态
|
||||
default ->
|
||||
// 处理未知或未映射的状态
|
||||
-99;
|
||||
};
|
||||
}
|
||||
|
||||
public static Integer mapTrainStatus(String status) {
|
||||
return switch (status) {
|
||||
case "Submitted" -> OrderConstant.ORDER_EVENT_PREPARE; // "已提交"映射到准备状态
|
||||
case "Ticketed" ->
|
||||
// "已出票"可能表示订单已完成出票,但没有直接的映射,可能需要新的状态常量或使用现有的常量
|
||||
OrderConstant.ORDER_EVENT_PAYED;
|
||||
case "Cancelled" -> OrderConstant.ORDER_EVENT_CANCEL; // "已取消"映射到取消状态
|
||||
case "Refunded" -> OrderConstant.ORDER_EVENT_REFUND; // "已经退票"映射到退票状态
|
||||
case "Rebooked" -> OrderConstant.ORDER_EVENT_CHANGE; // "已经改签"映射到改签状态
|
||||
case "IssueTicketFailed" ->
|
||||
// "出票失败"可能需要新的状态常量,因为它没有直接映射
|
||||
OrderConstant.ORDER_EVENT_ORDERED;
|
||||
case "RebookedFailed" ->
|
||||
// "改签失败"也可能需要新的状态常量,因为它没有直接映射
|
||||
OrderConstant.ORDER_EVENT_PAYED;
|
||||
case "SubmitRefund" ->
|
||||
// "退票成功"可能最接近"已经退票",但具体映射取决于业务逻辑
|
||||
OrderConstant.ORDER_EVENT_REFUND; // 使用退票状态作为近似映射
|
||||
case "Paid" -> OrderConstant.ORDER_EVENT_PAYED; // "已支付"映射到已预定状态
|
||||
case "Approve_G" -> OrderConstant.ORDER_EVENT_UNKNOWN; // 未知状态
|
||||
case "Approving" -> OrderConstant.ORDER_EVENT_UNKNOWN; // 未知状态
|
||||
case "Approving2" -> OrderConstant.ORDER_EVENT_UNKNOWN; // 未知状态
|
||||
case "Approve_T" -> OrderConstant.ORDER_EVENT_UNKNOWN; // 未知状态
|
||||
case "Approve_F" -> OrderConstant.ORDER_EVENT_UNKNOWN; // 未知状态
|
||||
case "Approve_A" -> OrderConstant.ORDER_EVENT_UNKNOWN; // 未知状态
|
||||
case "Approve_C" -> OrderConstant.ORDER_EVENT_UNKNOWN; // 未知状态
|
||||
default ->
|
||||
// 处理未知或未映射的状态
|
||||
-99;
|
||||
};
|
||||
}
|
||||
|
||||
public static Integer mapCarStatus(String status) {
|
||||
return switch (status) {
|
||||
case "Cancelled" -> OrderConstant.ORDER_EVENT_CANCEL; // "已取消"映射到取消状态
|
||||
case "Dealt" ->
|
||||
// "已经成交"可能意味着订单已经确认或完成,但没有直接映射,可能需要新的状态常量
|
||||
OrderConstant.ORDER_EVENT_PAYED;
|
||||
case "WaitReply" ->
|
||||
// "等待应答"可能表示订单正在等待确认,但没有直接映射,可能需要新的状态常量
|
||||
OrderConstant.ORDER_EVENT_ORDERED;
|
||||
case "WaitService" ->
|
||||
// "等待接驾"可能表示服务即将开始,但没有直接映射,可能需要新的状态常量
|
||||
OrderConstant.ORDER_EVENT_ORDERED;
|
||||
case "Successful" ->
|
||||
// 成功
|
||||
OrderConstant.ORDER_EVENT_ORDERED;
|
||||
case "Redispatched" ->
|
||||
// "改派中"可能需要新的状态常量,因为它没有直接映射
|
||||
OrderConstant.ORDER_EVENT_PAYED;
|
||||
case "DriverArrived" ->
|
||||
// "司机已到达"可能需要新的状态常量,因为它没有直接映射
|
||||
OrderConstant.ORDER_EVENT_PAYED;
|
||||
case "InService" ->
|
||||
// "正在服务"表示服务正在进行中,但没有直接映射,可能需要新的状态常量
|
||||
OrderConstant.ORDER_EVENT_PAYED;
|
||||
case "EndService" ->
|
||||
// "行程结束"可能意味着服务已完成,但没有直接映射,可能需要新的状态常量
|
||||
OrderConstant.ORDER_EVENT_PAYED;
|
||||
case "Canceling" ->
|
||||
// "取消中"可能表示订单正在取消过程中,但没有直接映射,可能需要新的状态常量
|
||||
OrderConstant.ORDER_EVENT_REFUND;
|
||||
case "Approve_G" -> OrderConstant.ORDER_EVENT_UNKNOWN; // 未知状态
|
||||
case "Approving" -> OrderConstant.ORDER_EVENT_UNKNOWN; // 未知状态
|
||||
case "Approving2" -> OrderConstant.ORDER_EVENT_UNKNOWN; // 未知状态
|
||||
case "Approve_T" -> OrderConstant.ORDER_EVENT_UNKNOWN; // 未知状态
|
||||
case "Approve_F" -> OrderConstant.ORDER_EVENT_UNKNOWN; // 未知状态
|
||||
case "Approve_A" -> OrderConstant.ORDER_EVENT_UNKNOWN; // 未知状态
|
||||
case "Approve_C" -> OrderConstant.ORDER_EVENT_UNKNOWN; // 未知状态
|
||||
default ->
|
||||
// 处理未知或未映射的状态
|
||||
-99;
|
||||
};
|
||||
}
|
||||
}
|
|
@ -1,10 +1,8 @@
|
|||
package com.chint.interfaces.rest.ly.dto.search.response.car;
|
||||
|
||||
import com.chint.interfaces.rest.ly.dto.LYBaseResponse;
|
||||
import com.chint.interfaces.rest.ly.dto.carorderdatapushback.PriceDetail;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
|
@ -19,10 +17,11 @@ public class CarDetailResponse extends LYBaseResponse {
|
|||
private OrderExtendInfo orderExtendInfo;
|
||||
private OrderDriverInfo orderDriverInfo;
|
||||
private TravelDataInfo travelDataInfo;
|
||||
private List<Object> priceVarList;
|
||||
private List<CarPriceVar> priceVarList;
|
||||
|
||||
// Getter and Setter methods
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class CarOrderDetailInfo {
|
||||
private String orderSerialNo;
|
||||
|
@ -50,6 +49,7 @@ public class CarDetailResponse extends LYBaseResponse {
|
|||
|
||||
// Getter and Setter methods
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class OrderExtendInfo {
|
||||
private int serviceType;
|
||||
|
@ -86,6 +86,7 @@ public class CarDetailResponse extends LYBaseResponse {
|
|||
|
||||
// Getter and Setter methods
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class OrderDriverInfo {
|
||||
private String driverAvatar;
|
||||
|
@ -101,6 +102,7 @@ public class CarDetailResponse extends LYBaseResponse {
|
|||
|
||||
// Getter and Setter methods
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class TravelDataInfo {
|
||||
private String oaNo;
|
||||
|
@ -110,6 +112,7 @@ public class CarDetailResponse extends LYBaseResponse {
|
|||
|
||||
// Getter and Setter methods
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class SubmitItem {
|
||||
private String itemCode;
|
||||
|
@ -120,4 +123,17 @@ public class CarDetailResponse extends LYBaseResponse {
|
|||
// Getter and Setter methods
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class CarPriceVar {
|
||||
private String priceVarNo;
|
||||
private String totalPriceVar;
|
||||
private String payType;
|
||||
private String priceVarType;
|
||||
private String diffReson;
|
||||
private String priceVarTime;
|
||||
private String servicePriceVar;
|
||||
private String companyPriceVar;
|
||||
private String personalPriceVar;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -4,9 +4,9 @@ package com.chint.interfaces.rest.ly.in;
|
|||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.chint.domain.aggregates.order.OrderTravel;
|
||||
import com.chint.domain.aggregates.system.SupplierCallBackLog;
|
||||
import com.chint.domain.repository.SupplierCallBackLogRepository;
|
||||
import com.chint.infrastructure.repository.jdbc.JdbcOrderTravelRepository;
|
||||
import com.chint.interfaces.rest.base.PostRequest;
|
||||
import com.chint.interfaces.rest.ly.LYNoteResponse;
|
||||
import com.chint.interfaces.rest.ly.LYPostRequest;
|
||||
import com.chint.interfaces.rest.ly.dto.*;
|
||||
|
@ -16,12 +16,12 @@ import com.chint.interfaces.rest.ly.dto.strokepush.Param;
|
|||
import com.chint.interfaces.rest.ly.dto.strokepush.StrokeController;
|
||||
import com.chint.interfaces.rest.ly.dto.strokepush.StrokePushDTO;
|
||||
import com.chint.interfaces.rest.ly.dto.strokepush.StrokePushResult;
|
||||
import com.chint.interfaces.rest.ly.dto.strokepush.TrainChange.TrainChangeDto;
|
||||
import com.chint.interfaces.rest.ly.dto.strokepush.TrainChange.TrainChangeParam;
|
||||
import com.chint.interfaces.rest.ly.dto.strokepush.TrainChange.TrainChangeRequest;
|
||||
import com.chint.interfaces.rest.ly.tools.GetObjectNature;
|
||||
import com.google.gson.Gson;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.http.impl.client.HttpClients;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
|
@ -31,8 +31,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import static com.chint.infrastructure.constant.SupplierNameConstant.SUPPLIER_C_TRIP;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
|
@ -54,6 +53,9 @@ public class CommonController {
|
|||
@Autowired
|
||||
private LYPostRequest postRequest;
|
||||
|
||||
@Autowired
|
||||
private PostRequest basePostRequest;
|
||||
|
||||
@Value("${ly.baseUrl}")
|
||||
private String lyBaseUrl;
|
||||
|
||||
|
@ -62,33 +64,45 @@ public class CommonController {
|
|||
@Autowired
|
||||
private SupplierCallBackLogRepository supplierCallBackLogRepository;
|
||||
|
||||
@Value("${ly.ifForwardRequest}")
|
||||
private boolean ifForwardRequest;
|
||||
|
||||
@Value("${ly.forwardRequestBaseUrl}")
|
||||
private String forwardRequestBaseUrl;
|
||||
|
||||
private String forwardRequestPath = "/public/common/back";
|
||||
|
||||
private String lyConfirmPath = "/api/DomesticFlight/ConfirmFlightOrderChange";
|
||||
|
||||
@PostMapping("/back")
|
||||
public LYNoteResponse Back(@RequestBody Notification notification) {
|
||||
|
||||
if(ifForwardRequest){
|
||||
CompletableFuture.runAsync(()->{
|
||||
log.info("转发同程订单状态推送");
|
||||
LYNoteResponse response = basePostRequest
|
||||
.post(forwardRequestBaseUrl + forwardRequestPath, notification, LYNoteResponse.class);
|
||||
if(response.getResCode().equals("100")){
|
||||
log.info("转发同程订单状态推送成功");
|
||||
} else {
|
||||
log.info("转发同程订单状态推送失败");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
String json = gson.toJson(notification);
|
||||
log.info(json);
|
||||
|
||||
//创建回推日志
|
||||
// SupplierCallBackLog supplierCallBackLog = SupplierCallBackLog
|
||||
// .start()
|
||||
// .supplier(SUPPLIER_C_TRIP)
|
||||
// .callBackJson(json);
|
||||
// supplierCallBackLogRepository.save(supplierCallBackLog);
|
||||
|
||||
|
||||
int notifyType = notification.getNotifyType();
|
||||
return switch (notifyType) {
|
||||
|
||||
case 1 -> getOrderTicket(notification);
|
||||
//进行订单数据回推
|
||||
case 1 -> getOrderFlight(notification);
|
||||
case 3 -> getOrderHotel(notification);
|
||||
case 5 -> getOrderTrain(notification);
|
||||
case 6 -> getOrderCar(notification);
|
||||
//50进行行程数据回推
|
||||
case 50 -> getOrderType(notification);
|
||||
default -> new LYNoteResponse("100", "OK");
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -103,16 +117,15 @@ public class CommonController {
|
|||
int subNotifyType = notification.getSubNotifyType();
|
||||
if (Objects.nonNull(notifyData)) {
|
||||
JSONObject jsonObj = JSON.parseObject(notifyData.toString());
|
||||
ResultBackCar orderCar = jsonObj.toJavaObject(ResultBackCar.class);
|
||||
String orderSerialNo = orderCar.getData().getOrder().getOrderSerialNo();
|
||||
String travelApplyNo = orderCar.getData().getTravelData().getTravelApplyNo();
|
||||
|
||||
ResultBackCar.DataObject orderCar = jsonObj.toJavaObject(ResultBackCar.DataObject.class);
|
||||
String orderSerialNo = orderCar.getOrder().getOrderSerialNo();
|
||||
String travelApplyNo = orderCar.getTravelData().getTravelApplyNo();
|
||||
OrderTravel orderTravel = new OrderTravel();
|
||||
orderTravel.setOrderNo(orderSerialNo);
|
||||
orderTravel.setTravelNo(travelApplyNo);
|
||||
saveOrderTravel(orderTravel);
|
||||
|
||||
lyCallBackDataHandler.trainCallBackData(orderSerialNo, 0);/*
|
||||
lyCallBackDataHandler.carCallBackData(orderSerialNo, 0);
|
||||
/*
|
||||
if (subNotifyType == 2 || subNotifyType == 3 || subNotifyType == 1){
|
||||
sendMsg(travelApplyNo);
|
||||
}*/
|
||||
|
@ -131,22 +144,16 @@ public class CommonController {
|
|||
Object notifyData = notification.notifyData;
|
||||
int subNotifyType = notification.getSubNotifyType();
|
||||
if (Objects.nonNull(notifyData)) {
|
||||
|
||||
|
||||
JSONObject jsonObj = JSON.parseObject(notifyData.toString());
|
||||
ResultBackTrain orderTrain = jsonObj.toJavaObject(ResultBackTrain.class);
|
||||
|
||||
// OrderTravel orderTravel = new OrderTravel();
|
||||
// orderTravel.setOrderNo(orderTrain.getOrderNo());
|
||||
// orderTravel.setTravelNo( orderTrain.getTravelData().getTravelApplyNo());
|
||||
// saveOrderTravel(orderTravel);
|
||||
|
||||
int ruleViolate = orderTrain.getRuleViolate() ? 1 : 0;
|
||||
|
||||
if (subNotifyType == 16) {
|
||||
isOkTrain(ruleViolate, subNotifyType, orderTrain.getOrderNo());
|
||||
changeTrain(ruleViolate, subNotifyType, orderTrain.getOrderNo());
|
||||
}
|
||||
|
||||
lyCallBackDataHandler.trainCallBackData(orderTrain.getOrderNo(), Integer.valueOf(ruleViolate));
|
||||
if (subNotifyType == 2 || subNotifyType == 3 || subNotifyType == 1) {
|
||||
sendMsg(orderTrain.getTravelData().getTravelApplyNo());
|
||||
|
@ -192,14 +199,13 @@ public class CommonController {
|
|||
* @param notification
|
||||
* @return
|
||||
*/
|
||||
public LYNoteResponse getOrderTicket(Notification notification) {
|
||||
public LYNoteResponse getOrderFlight(Notification notification) {
|
||||
Object notifyData = notification.notifyData;
|
||||
int subNotifyType = notification.getSubNotifyType();
|
||||
if (Objects.nonNull(notifyData)) {
|
||||
JSONObject jsonObj = JSON.parseObject(notifyData.toString());
|
||||
ResultBackFly resultBackFly = jsonObj.toJavaObject(ResultBackFly.class);
|
||||
ResultBackFly.DataObject dataObject = resultBackFly.getData();
|
||||
|
||||
OrderTravel orderTravel = new OrderTravel();
|
||||
orderTravel.setOrderNo(dataObject.getOrderDetails().getOrderSerialNo());
|
||||
orderTravel.setTravelNo(dataObject.getOrderDetails().getTravelOrderNo());
|
||||
|
@ -210,7 +216,7 @@ public class CommonController {
|
|||
|
||||
//改签
|
||||
if (subNotifyType == 9) {
|
||||
isOk(ruleViolate, subNotifyType, orderSerialNo);
|
||||
changeFlight(ruleViolate, subNotifyType, orderSerialNo);
|
||||
}
|
||||
|
||||
//正常流程
|
||||
|
@ -238,18 +244,13 @@ public class CommonController {
|
|||
boolean emptyFly = Objects.nonNull(common.getTravelBizOrderList().getFlightOrderList());
|
||||
boolean emptyCar = Objects.nonNull(common.getTravelBizOrderList().getCarOrderList());
|
||||
boolean emptyTrain = Objects.nonNull(common.getTravelBizOrderList().getTrainOrderList());
|
||||
|
||||
if (emptyHotel) {//酒店
|
||||
NotifyData.HotelOrder hotelOrder = common.getTravelBizOrderList().getHotelOrderList().get(0);
|
||||
|
||||
OrderTravel orderTravel = new OrderTravel();
|
||||
orderTravel.setOrderNo(hotelOrder.getOrderInfo().getOrderSerialNo());
|
||||
orderTravel.setTravelNo(common.getTravelBizOrder().getTravelOrderNo());
|
||||
saveOrderTravel(orderTravel);
|
||||
|
||||
return lyCallBackDataHandler.hotelCallBackData(hotelOrder.getOrderInfo().getOrderSerialNo(), hotelOrder.getOrderInfo().getRuleViolate() ? 1 : 0);
|
||||
|
||||
|
||||
} else if (emptyFly) {//机票originalOrderNo
|
||||
NotifyData.OrderDetails flyOrder = common.getTravelBizOrderList().getFlightOrderList().get(0).getOrderDetails();
|
||||
OrderTravel orderTravel = new OrderTravel();
|
||||
|
@ -260,16 +261,13 @@ public class CommonController {
|
|||
|
||||
} else if (emptyTrain) {//火车票
|
||||
NotifyData.TrainOrderList.OrderTrain orderTrain = common.getTravelBizOrderList().getTrainOrderList().get(0);
|
||||
|
||||
OrderTravel orderTravel = new OrderTravel();
|
||||
orderTravel.setOrderNo(orderTrain.getOrderNo());
|
||||
orderTravel.setTravelNo(common.getTravelBizOrder().getTravelOrderNo());
|
||||
saveOrderTravel(orderTravel);
|
||||
return lyCallBackDataHandler.trainCallBackData(orderTrain.getOrderNo(), orderTrain.getRuleViolate() ? 1 : 0);
|
||||
|
||||
} else if (emptyCar) {
|
||||
NotifyData.CarOrderList.Order orderCar = common.getTravelBizOrderList().getCarOrderList().get(0).getOrder();
|
||||
|
||||
OrderTravel orderTravel = new OrderTravel();
|
||||
orderTravel.setOrderNo(orderCar.getOrderSerialNo());
|
||||
orderTravel.setTravelNo(common.getTravelBizOrder().getTravelOrderNo());
|
||||
|
@ -300,27 +298,20 @@ public class CommonController {
|
|||
/**
|
||||
* 机票确认改签接口
|
||||
*/
|
||||
public void strokePush(FlyOkDTO flyOkDTO) {
|
||||
StrokePushResult postData = postRequest.post(lyBaseUrl + lyConfirmPath, flyOkDTO, StrokePushResult.class);
|
||||
public void changeFlightPush(FlyOkDTO flyOkDTO) {
|
||||
postRequest.post(lyBaseUrl + lyConfirmPath, flyOkDTO, StrokePushResult.class);
|
||||
log.info("调用了机票改签确认接口");
|
||||
}
|
||||
|
||||
public LYNoteResponse isOk(Integer ruleViolate, Integer subNotifyType, String orderSerialNo) {
|
||||
if (ruleViolate == 0 && subNotifyType == 9) {
|
||||
FlyOkDTO freightDTO = new FlyOkDTO();
|
||||
ParamFly param = new ParamFly();
|
||||
param.setOrderSerialNo(orderSerialNo);
|
||||
freightDTO.setParam(param);
|
||||
strokePush(freightDTO);
|
||||
return new LYNoteResponse("100", "OK");
|
||||
} else if (ruleViolate == 1 && subNotifyType == 9) {
|
||||
FlyOkDTO freightDTO = new FlyOkDTO();
|
||||
ParamFly param = new ParamFly();
|
||||
param.setOrderSerialNo(orderSerialNo);
|
||||
strokePush(freightDTO);
|
||||
freightDTO.setParam(param);
|
||||
public LYNoteResponse changeFlight(Integer ruleViolate, Integer subNotifyType, String orderSerialNo) {
|
||||
FlyOkDTO freightDTO = new FlyOkDTO();
|
||||
ParamFly param = new ParamFly();
|
||||
param.setOrderSerialNo(orderSerialNo);
|
||||
changeFlightPush(freightDTO);
|
||||
freightDTO.setParam(param);
|
||||
//ruleViolate
|
||||
if (ruleViolate == 1 && subNotifyType == 9) {
|
||||
sendMsg(orderSerialNo);
|
||||
return new LYNoteResponse("100", "OK");
|
||||
}
|
||||
return new LYNoteResponse("100", "OK");
|
||||
}
|
||||
|
@ -328,24 +319,18 @@ public class CommonController {
|
|||
/**
|
||||
* 火车确认改签接口
|
||||
*/
|
||||
public void getTrainOk(TrainChangeParam trainChangeParam) {
|
||||
TrainChangeDto trainChangeDto = trainChangeRequest.trainChangeRequest(trainChangeParam);
|
||||
public void changeTrainPush(TrainChangeParam trainChangeParam) {
|
||||
trainChangeRequest.trainChangeRequest(trainChangeParam);
|
||||
}
|
||||
|
||||
public LYNoteResponse isOkTrain(Integer ruleViolate, Integer subNotifyType, String orderSerialNo) {
|
||||
public LYNoteResponse changeTrain(Integer ruleViolate, Integer subNotifyType, String orderSerialNo) {
|
||||
TrainChangeParam trainChangeParam = new TrainChangeParam();
|
||||
trainChangeParam.setOrderNo(orderSerialNo);
|
||||
trainChangeParam.setApprovalStatus(1);
|
||||
if (ruleViolate == 0 && subNotifyType == 16) {
|
||||
getTrainOk(trainChangeParam);
|
||||
return new LYNoteResponse("100", "OK");
|
||||
} else if (ruleViolate == 1 && subNotifyType == 16) {
|
||||
getTrainOk(trainChangeParam);
|
||||
changeTrainPush(trainChangeParam);
|
||||
if (ruleViolate == 1 && subNotifyType == 16) {
|
||||
sendMsg(orderSerialNo);
|
||||
return new LYNoteResponse("100", "OK");
|
||||
}
|
||||
return new LYNoteResponse("100", "OK");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ public class LYOrderUtil {
|
|||
case "0" -> ORDER_EVENT_ORDERED; //待审批
|
||||
case "3" -> ORDER_EVENT_ORDERED; //待提交
|
||||
case "4" -> ORDER_EVENT_ORDERED; //占座中
|
||||
case "22" -> ORDER_EVENT_PREPARE; //出票失败
|
||||
case "22" -> ORDER_EVENT_CANCEL; //出票失败
|
||||
case "40" -> ORDER_EVENT_PREPARE; //退票待审批
|
||||
case "41" -> ORDER_EVENT_PREPARE; //退票待确认
|
||||
case "42" -> ORDER_EVENT_ORDERED; //退票中
|
||||
|
@ -43,14 +43,14 @@ public class LYOrderUtil {
|
|||
case "60" -> ORDER_EVENT_CHANGE; //改签待审批
|
||||
case "63" -> ORDER_EVENT_CHANGE; //改签成功
|
||||
case "64" -> ORDER_EVENT_CHANGE; //部分改签
|
||||
case "66" -> ORDER_EVENT_ORDERED; //取消改签
|
||||
case "67" -> ORDER_EVENT_ORDERED; //改签失败
|
||||
case "66" -> ORDER_EVENT_CANCEL; //取消改签
|
||||
case "67" -> ORDER_EVENT_CANCEL; //改签失败
|
||||
case "68" -> ORDER_EVENT_ORDERED; //改签审批不通过
|
||||
case "92" -> ORDER_EVENT_ORDERED; //待确认
|
||||
case "93" -> ORDER_EVENT_CHANGE; //改签中
|
||||
case "94" -> ORDER_EVENT_REFUND; //部分退票
|
||||
case "95" -> ORDER_EVENT_REFUND; //退票成功
|
||||
case "96" -> ORDER_EVENT_REFUND; //已取消
|
||||
case "96" -> ORDER_EVENT_CANCEL; //已取消
|
||||
case "97" -> ORDER_EVENT_ORDERED; //已出票
|
||||
case "98" -> ORDER_EVENT_ORDERED; //出票中
|
||||
case "99" -> ORDER_EVENT_ORDERED; //待付款
|
||||
|
@ -65,14 +65,14 @@ public class LYOrderUtil {
|
|||
case "1" -> ORDER_EVENT_ORDERED; //待支付
|
||||
case "3" -> ORDER_EVENT_ORDERED; //待提交
|
||||
case "4" -> ORDER_EVENT_ORDERED; //待审批
|
||||
case "10" -> ORDER_EVENT_PREPARE; //超时未支付
|
||||
case "10" -> ORDER_EVENT_CANCEL; //超时未支付
|
||||
case "11" -> ORDER_EVENT_CANCEL; //客户申请取消
|
||||
case "12" -> ORDER_EVENT_PREPARE; //确认无房
|
||||
case "13" -> ORDER_EVENT_ORDERED; //审核不通过取消
|
||||
case "14" -> ORDER_EVENT_ORDERED; //超时未审批
|
||||
case "13" -> ORDER_EVENT_CANCEL; //审核不通过取消
|
||||
case "14" -> ORDER_EVENT_CANCEL; //超时未审批
|
||||
case "15" -> ORDER_EVENT_CANCEL; //客服取消
|
||||
case "16" -> ORDER_EVENT_ORDERED; //确认后用户申请取消
|
||||
case "17" -> ORDER_EVENT_ORDERED; //确认后客服取消
|
||||
case "16" -> ORDER_EVENT_CANCEL; //确认后用户申请取消
|
||||
case "17" -> ORDER_EVENT_CANCEL; //确认后客服取消
|
||||
case "18" -> ORDER_EVENT_CANCEL; //下单失败取消
|
||||
case "22" -> ORDER_EVENT_ORDERED; //已付款,确认中
|
||||
case "23" -> ORDER_EVENT_ORDERED; //已确认
|
||||
|
|
|
@ -105,9 +105,15 @@ public class PushUser {
|
|||
|
||||
Type type = new TypeToken<List<UserDataDTO>>() {
|
||||
}.getType();
|
||||
|
||||
if (result.getData() == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
List<UserDataDTO> userDataDTOs = gson.fromJson(result.getData().toString(), type);
|
||||
|
||||
List<User> users = userDataDTOs.stream()
|
||||
.filter(it-> !it.getStatus().equals("A"))
|
||||
.filter(it -> it.getLoginUsername() != null)
|
||||
.filter(it -> it.getCompany() != null)
|
||||
.filter(it -> jtCompanyDomainService.ifCompanyInJT(null, it.getCompany())
|
||||
|
@ -123,6 +129,7 @@ public class PushUser {
|
|||
user.setManaLevel(userData.getCust_manaLevel());
|
||||
user.setProfLevel(userData.getCust_profLevel());
|
||||
user.setQualityLevel(userData.getCust_qualityLevel());
|
||||
user.setEmployeeNo(userData.getLoginUsername());
|
||||
return user;
|
||||
})
|
||||
.toList();
|
||||
|
@ -138,6 +145,10 @@ public class PushUser {
|
|||
}
|
||||
}
|
||||
|
||||
// if(page == 4){
|
||||
// break;
|
||||
// }
|
||||
|
||||
users.forEach(user -> userHttpRequest.loadRankCode(user));
|
||||
page++;
|
||||
|
||||
|
@ -147,8 +158,11 @@ public class PushUser {
|
|||
list = list.stream().filter(user -> user.getEmployeeNo() != null).toList();
|
||||
|
||||
for (User user : list) {
|
||||
Optional.ofNullable(userRepository.findByUserEmployeeNo(user.getEmployeeNo())).ifPresent(
|
||||
this::asyncUser
|
||||
Optional.ofNullable(userRepository.findByUserEmployeeNo(user.getEmployeeNo())).ifPresentOrElse(
|
||||
this::asyncUser,()->{
|
||||
userRepository.save(user);
|
||||
asyncUser(user);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -18,6 +18,8 @@ chint:
|
|||
password: Worktask@Redis2023
|
||||
database: 5
|
||||
|
||||
|
||||
|
||||
logging:
|
||||
level:
|
||||
org.springframework.jdbc.core.JdbcTemplate: trace
|
||||
|
@ -40,6 +42,8 @@ ly:
|
|||
password: glHRJJ9JMUwNfQ8OwAQi
|
||||
secret: MnghmYJpM1U2RaLx
|
||||
baseUrl: https://api.dttrip.cn/openapi
|
||||
ifForwardRequest: false
|
||||
forwardRequestBaseUrl: https://secureqrdev-t.chint.com/llz
|
||||
|
||||
sf:
|
||||
openApiBaseUrl: https://openapi.chintcloud.net
|
||||
|
|
|
@ -38,6 +38,8 @@ ly:
|
|||
password: glHRJJ9JMUwNfQ8OwAQi
|
||||
secret: MnghmYJpM1U2RaLx
|
||||
baseUrl: https://api.dttrip.cn/openapi
|
||||
ifForwardRequest: true
|
||||
forwardRequestBaseUrl: https://gxdev03.chint.com/routeapi
|
||||
|
||||
sf:
|
||||
openApiBaseUrl: https://openapi.chint.com
|
||||
|
|
|
@ -52,7 +52,8 @@ ly:
|
|||
password: glHRJJ9JMUwNfQ8OwAQi
|
||||
secret: MnghmYJpM1U2RaLx
|
||||
baseUrl: https://api.dttrip.cn/openapi
|
||||
|
||||
ifForwardRequest: false
|
||||
forwardRequestBaseUrl: https://secureqrdev-t.chint.com/llz
|
||||
|
||||
sf:
|
||||
openApiBaseUrl: https://openapi.chintcloud.net
|
||||
|
|
|
@ -1,18 +1,19 @@
|
|||
package com.chint;
|
||||
|
||||
import com.chint.domain.aggregates.location.basedata.*;
|
||||
import com.chint.domain.aggregates.location.basedata.CountryInfoEntity;
|
||||
import com.chint.domain.aggregates.location.basedata.DistrictPOIInfoEntity;
|
||||
import com.chint.domain.aggregates.location.basedata.PrefectureLevelCityInfoEntity;
|
||||
import com.chint.domain.aggregates.order.Location;
|
||||
import com.chint.domain.aggregates.order.ctrip.CtripCarOrderDetail;
|
||||
import com.chint.domain.aggregates.order.ctrip.CtripFlightOrderDetail;
|
||||
import com.chint.domain.aggregates.order.ctrip.CtripHotelOrderDetail;
|
||||
import com.chint.domain.aggregates.order.ctrip.CtripTrainOrderDetail;
|
||||
import com.chint.domain.aggregates.user.User;
|
||||
import com.chint.domain.repository.CityRepository;
|
||||
import com.chint.domain.repository.CountryInfoEntityRepository;
|
||||
import com.chint.domain.repository.CTripOrderDetailRepository;
|
||||
import com.chint.domain.repository.POIDataInfoEntityRepository;
|
||||
import com.chint.domain.repository.*;
|
||||
import com.chint.domain.service.supplier.SupplierService;
|
||||
import com.chint.domain.value_object.SupplierCallbackData;
|
||||
import com.chint.infrastructure.util.BaseContext;
|
||||
import com.chint.infrastructure.util.PinyinUtil;
|
||||
import com.chint.interfaces.rest.ctrip.*;
|
||||
import com.chint.interfaces.rest.ctrip.dto.city.FlightCitySearchResponse;
|
||||
import com.chint.interfaces.rest.ctrip.dto.country.CountryResponse;
|
||||
|
@ -20,7 +21,10 @@ import com.chint.interfaces.rest.ctrip.dto.estimate.request.*;
|
|||
import com.chint.interfaces.rest.ctrip.dto.estimate.response.BookingRelatedApiResponse;
|
||||
import com.chint.interfaces.rest.ctrip.dto.location.CTripCity;
|
||||
import com.chint.interfaces.rest.ctrip.dto.location.CTripCountry;
|
||||
import com.chint.interfaces.rest.ctrip.dto.location.full.response.*;
|
||||
import com.chint.interfaces.rest.ctrip.dto.location.full.response.DistrictPOIInfo;
|
||||
import com.chint.interfaces.rest.ctrip.dto.location.full.response.POIData;
|
||||
import com.chint.interfaces.rest.ctrip.dto.location.full.response.PrefectureLevelCityInfo;
|
||||
import com.chint.interfaces.rest.ctrip.dto.location.full.response.QueryAllPOIInfoResponseType;
|
||||
import com.chint.interfaces.rest.ctrip.dto.login.CTripLoginParam;
|
||||
import com.chint.interfaces.rest.ctrip.dto.login.PCResponse;
|
||||
import com.chint.interfaces.rest.ctrip.dto.order.OrderCarResponse;
|
||||
|
@ -30,16 +34,12 @@ import com.chint.interfaces.rest.ctrip.dto.order.OrderTrainResponse;
|
|||
import com.chint.interfaces.rest.ctrip.dto.search.SearchOrderResponse;
|
||||
import com.chint.interfaces.rest.ctrip.in.CTripNoteController;
|
||||
import com.chint.interfaces.rest.ctrip.order.CTripOrderDetailRequest;
|
||||
import com.chint.interfaces.rest.ly.LYSearchRequest;
|
||||
import com.chint.interfaces.rest.ly.dto.search.response.train.TrainDetailResponse;
|
||||
import com.google.gson.Gson;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.chint.infrastructure.constant.SupplierNameConstant.SUPPLIER_C_TRIP;
|
||||
|
@ -83,6 +83,8 @@ public class CTripTest {
|
|||
@Autowired
|
||||
private CountryInfoEntityRepository countryInfoEntityRepository;
|
||||
|
||||
@Autowired
|
||||
private PrefectureLevelRepository prefectureLevelRepository;
|
||||
|
||||
@Autowired
|
||||
private POIDataInfoEntityRepository poiDataInfoEntityRepository;
|
||||
|
@ -94,10 +96,17 @@ public class CTripTest {
|
|||
private CTripOrderDetailRepository ctripOrderDetailRepository;
|
||||
|
||||
@Autowired
|
||||
private LYSearchRequest lySearchRequest;
|
||||
private OrderDetailRepository orderDetailRepository;
|
||||
|
||||
@Autowired
|
||||
private LocationRepository locationRepository;
|
||||
|
||||
@Autowired
|
||||
private DistrictInfoRepository districtInfoRepository;
|
||||
|
||||
private User user = new User(1L, "230615020", 1, "卢麟哲", "1033719135@qq.com", "15857193365", "A30000001");
|
||||
|
||||
|
||||
//@Test
|
||||
void locationCountry() {
|
||||
System.out.println(cTripLocationHttpRequest.syncCountry());
|
||||
|
@ -174,7 +183,7 @@ public class CTripTest {
|
|||
System.out.println(gson.toJson(estimate));
|
||||
}
|
||||
|
||||
// @Test
|
||||
// @Test
|
||||
void estimateTrain() {
|
||||
BaseContext.setCurrentUser(user);
|
||||
TrainProductInfo trainProductInfo = new TrainProductInfo();
|
||||
|
@ -189,7 +198,7 @@ public class CTripTest {
|
|||
System.out.println(gson.toJson(estimate));
|
||||
}
|
||||
|
||||
// @Test
|
||||
// @Test
|
||||
void estimateHotel() {
|
||||
BaseContext.setCurrentUser(user);
|
||||
HotelProductInfo hotelProductInfo = new HotelProductInfo();
|
||||
|
@ -201,13 +210,11 @@ public class CTripTest {
|
|||
System.out.println(gson.toJson(estimate));
|
||||
}
|
||||
|
||||
// @Test
|
||||
@Test
|
||||
void search() {
|
||||
BaseContext.setCurrentUser(user);
|
||||
SearchOrderResponse response = orderSearchRequest.searchOrderResponseByOrderId("29882203254");
|
||||
SearchOrderResponse response = orderSearchRequest.searchOrderResponseByOrderId("31105372581");
|
||||
System.out.println(response);
|
||||
|
||||
|
||||
}
|
||||
|
||||
// @Test
|
||||
|
@ -236,7 +243,7 @@ public class CTripTest {
|
|||
|
||||
}
|
||||
|
||||
// @Test
|
||||
// @Test
|
||||
void queryAllCountry() {
|
||||
CountryResponse countryResponse = cTripCountryRequest.getCountry();
|
||||
//获取国家信息
|
||||
|
@ -321,14 +328,106 @@ public class CTripTest {
|
|||
}
|
||||
|
||||
|
||||
// @Test
|
||||
void queryAllPOIInfo(){
|
||||
// @Test
|
||||
void queryAllPOIInfo() {
|
||||
// QueryAllPOIInfoResponseType allPOIInfoQuery = cTripAllPOIInfoRequest.getAllPOIInfoQuery(1L);
|
||||
|
||||
QueryAllPOIInfoResponseType allPOIInfoQuery = cTripAllPOIInfoRequest.getAllPOIInfoQuery(536511L);
|
||||
System.out.println(allPOIInfoQuery);
|
||||
}
|
||||
|
||||
@Test
|
||||
void queryDistrictByCountryId() {
|
||||
// CountryInfoEntity countryInfoEntity = countryInfoEntityRepository.findById(336L);
|
||||
QueryAllPOIInfoResponseType allPOIInfoQuery = cTripAllPOIInfoRequest.getAllPOIInfoQuery(1L);
|
||||
|
||||
Map<Long, POIData> poiDataByProvinceId = new HashMap<>();
|
||||
for (POIData poiData : allPOIInfoQuery.getDataList()) {
|
||||
poiDataByProvinceId.put(poiData.getProvinceId(), poiData);
|
||||
}
|
||||
|
||||
List<PrefectureLevelCityInfo> list = allPOIInfoQuery.getDataList()
|
||||
.stream()
|
||||
.flatMap(it -> it.getPrefectureLevelCityInfoList().stream())
|
||||
.toList();
|
||||
|
||||
for (PrefectureLevelCityInfo cityInfo : list) {
|
||||
PrefectureLevelCityInfoEntity byCityId = prefectureLevelRepository
|
||||
.findByCityId(cityInfo.getCityId());
|
||||
if (cityInfo.getDistrictList() == null) continue;
|
||||
List<DistrictPOIInfoEntity> districtPOIInfoEntities = getDistrictPOIInfoEntities(cityInfo);
|
||||
byCityId.setDistrictPOIInfoEntities(districtPOIInfoEntities);
|
||||
prefectureLevelRepository.save(byCityId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
void generateDistrictInLocation() {
|
||||
|
||||
List<Location> allLeverThree = locationRepository.findAllLeverThreeAndIsInternal();
|
||||
List<Location> districtCities = new ArrayList<>();
|
||||
for (Location location : allLeverThree) {
|
||||
PrefectureLevelCityInfoEntity byCityId = prefectureLevelRepository.findByCityId(location.getCityId());
|
||||
List<DistrictPOIInfoEntity> districtPOIInfoEntities = byCityId.getDistrictPOIInfoEntities();
|
||||
for (DistrictPOIInfoEntity districtPOIInfoEntity : districtPOIInfoEntities) {
|
||||
Location districtLocation = new Location();
|
||||
districtLocation.setCityId(districtPOIInfoEntity.getDistrictId());
|
||||
districtLocation.setLocationName(districtPOIInfoEntity.getDistrictName());
|
||||
districtLocation.setLocationShortName(districtPOIInfoEntity.getDistrictName() + "D");
|
||||
districtLocation.setFirstPinYin(PinyinUtil.getFirstLetter(districtPOIInfoEntity.getDistrictName()));
|
||||
districtLocation.setParentLocationId(location.getLocationId());
|
||||
districtLocation.setLocationPathName(location.getLocationPathName() + districtPOIInfoEntity.getDistrictName() + '_' );
|
||||
districtLocation.setIsInternal(location.getIsInternal());
|
||||
districtLocation.setIsHaveAirport(0);
|
||||
districtLocation.setLocationPath(location.getLocationPath());
|
||||
districtLocation.setLevel(location.getLevel() + 1);
|
||||
districtCities.add(districtLocation);
|
||||
}
|
||||
}
|
||||
locationRepository.saveAll(districtCities);
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
void updateDistrictInLocation() {
|
||||
List<DistrictPOIInfoEntity> all = districtInfoRepository.findAll();
|
||||
List<Location> districtCities = new ArrayList<>();
|
||||
for (DistrictPOIInfoEntity districtPOIInfoEntity : all) {
|
||||
Location byDistrictShotName = locationRepository
|
||||
.findByCityId(districtPOIInfoEntity.getDistrictId(),districtPOIInfoEntity.getDistrictName()+"D");
|
||||
if(byDistrictShotName == null) {
|
||||
System.out.println(districtPOIInfoEntity.getDistrictId()+ districtPOIInfoEntity.getDistrictName()+"D");
|
||||
continue;
|
||||
}
|
||||
Location location = locationRepository.findById(byDistrictShotName.getParentLocationId());
|
||||
byDistrictShotName.setLocationPathName(location.getLocationPathName() + districtPOIInfoEntity.getDistrictName() + '_' );
|
||||
byDistrictShotName.setLocationPath(location.getLocationPath() + byDistrictShotName.getLocationId() + '_');
|
||||
districtCities.add(byDistrictShotName);
|
||||
}
|
||||
locationRepository.saveAll(districtCities);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private static List<DistrictPOIInfoEntity> getDistrictPOIInfoEntities(PrefectureLevelCityInfo cityInfo) {
|
||||
List<DistrictPOIInfoEntity> districtPOIInfoEntities = new ArrayList<>();
|
||||
for (DistrictPOIInfo districtPOIInfo : cityInfo.getDistrictList()) {
|
||||
DistrictPOIInfoEntity districtPOIInfoEntity = new DistrictPOIInfoEntity();
|
||||
districtPOIInfoEntity.setDistrictId(districtPOIInfo.getDistrictId());
|
||||
districtPOIInfoEntity.setDistrictName(districtPOIInfo.getDistrictName());
|
||||
districtPOIInfoEntity.setDistrictEnName(districtPOIInfo.getDistrictEnName());
|
||||
districtPOIInfoEntities.add(districtPOIInfoEntity);
|
||||
}
|
||||
return districtPOIInfoEntities;
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
void deleteByCountryId() {
|
||||
}
|
||||
|
||||
// @Test
|
||||
void dist() {
|
||||
CountryInfoEntity byId = countryInfoEntityRepository.findById(425L);
|
||||
|
@ -347,22 +446,22 @@ public class CTripTest {
|
|||
}
|
||||
}
|
||||
|
||||
// @Test
|
||||
void getFlightOrder(){
|
||||
OrderFlightResponse orderFlightResponse = cTripOrderDetailRequest.getFlightOrder("2024-03-06","2024-03-07");
|
||||
// @Test
|
||||
void getFlightOrder() {
|
||||
OrderFlightResponse orderFlightResponse = cTripOrderDetailRequest.getFlightOrder("2024-03-06", "2024-03-07");
|
||||
List<OrderFlightResponse.FlightOrderAccountSettlementInfo> flightOrderAccountSettlementList =
|
||||
orderFlightResponse.getFlightOrderAccountSettlementList();
|
||||
if (!flightOrderAccountSettlementList.isEmpty()){
|
||||
if (!flightOrderAccountSettlementList.isEmpty()) {
|
||||
OrderFlightResponse.FlightOrderAccountSettlementInfo flightOrderAccountSettlementInfo =
|
||||
flightOrderAccountSettlementList.get(0);
|
||||
//这个数据会有很多
|
||||
List<OrderFlightResponse.FlightOrderSettlementInfo> orderSettlementList =
|
||||
flightOrderAccountSettlementInfo.getOrderSettlementList();
|
||||
if (!orderSettlementList.isEmpty()){
|
||||
if (!orderSettlementList.isEmpty()) {
|
||||
OrderFlightResponse.FlightOrderSettlementInfo flightOrderSettlementInfo = orderSettlementList.get(0);
|
||||
OrderFlightResponse.FlightOrderSettlementBaseInfo orderSettlementBaseInfo =
|
||||
flightOrderSettlementInfo.getOrderSettlementBaseInfo();
|
||||
if (orderSettlementBaseInfo != null){
|
||||
if (orderSettlementBaseInfo != null) {
|
||||
CtripFlightOrderDetail ctripFlightOrderDetail = new CtripFlightOrderDetail();
|
||||
ctripFlightOrderDetail = ctripFlightOrderDetail.changeInfo(orderSettlementBaseInfo);
|
||||
ctripOrderDetailRepository.save(ctripFlightOrderDetail);
|
||||
|
@ -371,20 +470,20 @@ public class CTripTest {
|
|||
}
|
||||
}
|
||||
|
||||
// @Test
|
||||
void getTRainOrder(){
|
||||
OrderTrainResponse orderFlightResponse = cTripOrderDetailRequest.getTrainOrder("2024-03-06","2024-03-07");
|
||||
// @Test
|
||||
void getTRainOrder() {
|
||||
OrderTrainResponse orderFlightResponse = cTripOrderDetailRequest.getTrainOrder("2024-03-06", "2024-03-07");
|
||||
List<OrderTrainResponse.CorpTrainAccountSettlement> lstTrainSettlement =
|
||||
orderFlightResponse.getLstTrainSettlement();
|
||||
if (!lstTrainSettlement.isEmpty()){
|
||||
if (!lstTrainSettlement.isEmpty()) {
|
||||
OrderTrainResponse.CorpTrainAccountSettlement corpTrainAccountSettlement = lstTrainSettlement.get(0);
|
||||
List<OrderTrainResponse.CorpTrainSettlementInfo> lstTrainSettlementDetail =
|
||||
corpTrainAccountSettlement.getLstTrainSettlementDetail();
|
||||
if (!lstTrainSettlementDetail.isEmpty()){
|
||||
if (!lstTrainSettlementDetail.isEmpty()) {
|
||||
OrderTrainResponse.CorpTrainSettlementInfo corpTrainSettlementInfo = lstTrainSettlementDetail.get(0);
|
||||
OrderTrainResponse.CorpTrainSettlementDetail trainSettlementDetail =
|
||||
corpTrainSettlementInfo.getTrainSettlementDetail();
|
||||
if (trainSettlementDetail != null){
|
||||
if (trainSettlementDetail != null) {
|
||||
CtripTrainOrderDetail ctripTrainOrderDetail = new CtripTrainOrderDetail();
|
||||
ctripTrainOrderDetail = ctripTrainOrderDetail.changeInfo(trainSettlementDetail);
|
||||
ctripOrderDetailRepository.save(ctripTrainOrderDetail);
|
||||
|
@ -392,19 +491,20 @@ public class CTripTest {
|
|||
}
|
||||
}
|
||||
}
|
||||
// @Test
|
||||
void getHotelOrder(){
|
||||
OrderHotelResponse orderFlightResponse = cTripOrderDetailRequest.getHotelOrder("2024-03-06","2024-03-07");
|
||||
|
||||
// @Test
|
||||
void getHotelOrder() {
|
||||
OrderHotelResponse orderFlightResponse = cTripOrderDetailRequest.getHotelOrder("2024-03-06", "2024-03-07");
|
||||
List<OrderHotelResponse.HotelAccountSettlementInfo> lstHtlSettlement =
|
||||
orderFlightResponse.getLstHtlSettlement();
|
||||
if (!lstHtlSettlement.isEmpty()){
|
||||
if (!lstHtlSettlement.isEmpty()) {
|
||||
OrderHotelResponse.HotelAccountSettlementInfo hotelAccountSettlementInfo = lstHtlSettlement.get(0);
|
||||
List<OrderHotelResponse.LstHotelSettlementDetail> LstHotelSettlementDetail =
|
||||
hotelAccountSettlementInfo.getLstHotelSettlementDetail();
|
||||
if(!LstHotelSettlementDetail.isEmpty()){
|
||||
if (!LstHotelSettlementDetail.isEmpty()) {
|
||||
OrderHotelResponse.LstHotelSettlementDetail hotelSettlementDetail = LstHotelSettlementDetail.get(0);
|
||||
OrderHotelResponse.SettlementDetail settlementDetail = hotelSettlementDetail.getSettlementDetail();
|
||||
if(settlementDetail != null){
|
||||
if (settlementDetail != null) {
|
||||
CtripHotelOrderDetail ctripFlightOrderDetail = new CtripHotelOrderDetail();
|
||||
ctripFlightOrderDetail = ctripFlightOrderDetail.changeInfo(settlementDetail);
|
||||
ctripOrderDetailRepository.save(ctripFlightOrderDetail);
|
||||
|
@ -414,19 +514,19 @@ public class CTripTest {
|
|||
}
|
||||
|
||||
|
||||
// @Test
|
||||
void getCarOrder(){
|
||||
OrderCarResponse orderCarResponse = cTripOrderDetailRequest.getCarOrder("2024-03-01","2024-03-07");
|
||||
// @Test
|
||||
void getCarOrder() {
|
||||
OrderCarResponse orderCarResponse = cTripOrderDetailRequest.getCarOrder("2024-03-01", "2024-03-07");
|
||||
List<OrderCarResponse.CarOrderAccountSettlementDetail> carOrderAccountSettlementList =
|
||||
orderCarResponse.getCarOrderAccountSettlementList();
|
||||
if (!carOrderAccountSettlementList.isEmpty()){
|
||||
if (!carOrderAccountSettlementList.isEmpty()) {
|
||||
OrderCarResponse.CarOrderAccountSettlementDetail carOrderAccountSettlementDetail = carOrderAccountSettlementList.get(0);
|
||||
List<OrderCarResponse.CarOrderSettlementDetail> carSettlementDetailList =
|
||||
carOrderAccountSettlementDetail.getCarSettlementDetailList();
|
||||
if (!carSettlementDetailList.isEmpty()){
|
||||
if (!carSettlementDetailList.isEmpty()) {
|
||||
OrderCarResponse.CarOrderSettlementDetail carOrderSettlementDetail = carSettlementDetailList.get(0);
|
||||
OrderCarResponse.CarOrderSettlementBaseInfo settlementBaseInfo = carOrderSettlementDetail.getSettlementBaseInfo();
|
||||
if (settlementBaseInfo != null){
|
||||
if (settlementBaseInfo != null) {
|
||||
CtripCarOrderDetail ctripCarOrderDetail = new CtripCarOrderDetail();
|
||||
ctripCarOrderDetail = ctripCarOrderDetail.changeInfo(settlementBaseInfo);
|
||||
ctripOrderDetailRepository.save(ctripCarOrderDetail);
|
||||
|
|
|
@ -46,4 +46,9 @@ public class CacheTest {
|
|||
public void getRouteIdFromCache(){
|
||||
RouteOrder routeById = routeCacheManage.getRouteById(1046L);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void cancelCache(){
|
||||
routeCacheService.invalidateRouteCache(null);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,30 +1,32 @@
|
|||
package com.chint;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
|
||||
import com.authine.cloudpivot.opensdk.ApiException;
|
||||
import com.authine.cloudpivot.opensdk.CloudpivotOpenClient;
|
||||
import com.authine.cloudpivot.opensdk.model.request.workflow.StartWorkflowRequest;
|
||||
import com.authine.cloudpivot.opensdk.model.response.workflow.StartWorkflowResponse;
|
||||
import com.chint.application.commands.RefundOrderGenerateCommand;
|
||||
import com.chint.domain.aggregates.order.OrderTravel;
|
||||
import com.chint.domain.aggregates.user.User;
|
||||
import com.chint.domain.repository.OrderDetailRepository;
|
||||
import com.chint.domain.repository.RouteRepository;
|
||||
import com.chint.infrastructure.constant.LYConstant;
|
||||
import com.chint.infrastructure.echo_framework.command.Command;
|
||||
import com.chint.infrastructure.repository.jdbc.JdbcOrderTravelRepository;
|
||||
import com.chint.infrastructure.util.BaseContext;
|
||||
import com.chint.interfaces.rest.base.PostRequest;
|
||||
import com.chint.interfaces.rest.bpm.BPMRequest;
|
||||
import com.chint.interfaces.rest.bpm.XNBPM.ClientFactory;
|
||||
import com.chint.interfaces.rest.bpm.XNBPM.YSTokenDto;
|
||||
import com.chint.interfaces.rest.bpm.dot.*;
|
||||
import com.chint.interfaces.rest.bpm.dot.BPMBaseResponse;
|
||||
import com.chint.interfaces.rest.bpm.dto.*;
|
||||
import com.chint.interfaces.rest.ly.*;
|
||||
import com.chint.interfaces.rest.ly.dto.applyordersync.*;
|
||||
import com.chint.interfaces.rest.ly.dto.commonresult.Result;
|
||||
import com.chint.interfaces.rest.ly.dto.estimateprice.*;
|
||||
import com.chint.interfaces.rest.ly.dto.search.response.filght.FlightOrderResponse;
|
||||
import com.chint.interfaces.rest.ly.dto.search.response.car.CarDetailResponse;
|
||||
import com.chint.interfaces.rest.ly.dto.search.response.train.TrainDetailResponse;
|
||||
import com.chint.interfaces.rest.ly.in.CommonController;
|
||||
import com.chint.interfaces.rest.ly.vo.estimateprice.TrainPriceVo;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
|
@ -39,7 +41,8 @@ import java.time.LocalDateTime;
|
|||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
|
||||
import static com.chint.infrastructure.constant.BPMConstant.*;
|
||||
import static com.chint.infrastructure.constant.BPMConstant.H3BPM_EXCEED_STANDARD_URL;
|
||||
import static com.chint.infrastructure.constant.BPMConstant.YSBPM_TOKEN_URL;
|
||||
|
||||
@SpringBootTest
|
||||
public class LYTest {
|
||||
|
@ -91,6 +94,9 @@ public class LYTest {
|
|||
@Autowired
|
||||
private JdbcOrderTravelRepository orderTravelRepository;
|
||||
|
||||
@Autowired
|
||||
private CommonController commonController;
|
||||
|
||||
public static final String L_Y_BASE_URL = "https://api.qa.dttrip.cn/openapi";
|
||||
|
||||
public static final String L_Y_ORDER_PATH = "/openapi/api/TravelApplyOrder/ApplyOrderSync";
|
||||
|
@ -758,7 +764,7 @@ public class LYTest {
|
|||
}
|
||||
|
||||
|
||||
// @Test
|
||||
// @Test
|
||||
void test11() {
|
||||
List<OrderTravel> byOrderNo = orderTravelRepository.findByOrderNo(null);
|
||||
System.out.println("byOrderNo = " + byOrderNo);
|
||||
|
@ -768,7 +774,7 @@ public class LYTest {
|
|||
}
|
||||
|
||||
|
||||
// @Test
|
||||
// @Test
|
||||
void testClient() {
|
||||
CloudpivotOpenClient xnInstance = ClientFactory.getXNInstance();
|
||||
CloudpivotOpenClient zwInstance = ClientFactory.getZWInstance();
|
||||
|
@ -776,7 +782,7 @@ public class LYTest {
|
|||
System.out.println("zwInstance = " + zwInstance);
|
||||
}
|
||||
|
||||
// @Test
|
||||
// @Test
|
||||
void removeDuplicates() {
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
String cityStr = stringBuilder.toString();
|
||||
|
@ -786,18 +792,61 @@ public class LYTest {
|
|||
System.out.println("join = " + join);
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
void search(){
|
||||
FlightOrderResponse t1 = lySearchRequest
|
||||
.getFlightOrderDetail("DFR24031466691835702");
|
||||
void search() {
|
||||
// FlightOrderResponse t1 = lySearchRequest
|
||||
// .getFlightOrderDetail("DF24031466751565416");
|
||||
// Gson gson = new Gson();
|
||||
// String json = gson.toJson(t1);
|
||||
// System.out.println(json);
|
||||
|
||||
|
||||
TrainDetailResponse trainDetailResponse = lySearchRequest.getTrainOrderDetail(" DTC24031767013846252");
|
||||
Gson gson = new Gson();
|
||||
String json = gson.toJson(t1);
|
||||
String json = gson.toJson(trainDetailResponse);
|
||||
System.out.println(json);
|
||||
|
||||
|
||||
// TrainDetailResponse trainDetailResponse = lySearchRequest.getTrainOrderDetail("DFR24031466691835702");
|
||||
// HotelDetailResponse trainDetailResponse = lySearchRequest.getHotelOrderDetail("HO20240314114500180104");
|
||||
// Gson gson = new Gson();
|
||||
// String json = gson.toJson(trainDetailResponse);
|
||||
// System.out.println(json);
|
||||
|
||||
|
||||
|
||||
// CarDetailResponse carDetailResponse = lySearchRequest.getCarDetailResponse("30352884087");
|
||||
// Gson gson = new Gson();
|
||||
// String json = gson.toJson(carDetailResponse);
|
||||
// System.out.println(json);
|
||||
}
|
||||
|
||||
@Test
|
||||
void conform() {
|
||||
commonController.changeFlight(0, 9, "T24031566810476306");
|
||||
}
|
||||
|
||||
@Test
|
||||
void sendMsg() {
|
||||
commonController.sendMsg("T24031566811702174");
|
||||
}
|
||||
|
||||
// DTC24031466757493927
|
||||
// DTC24031466757493927
|
||||
// @Test
|
||||
void generateLyTrain() {
|
||||
TrainDetailResponse trainOrderDetail = lySearchRequest.getTrainOrderDetail("DTC24031466757493927");
|
||||
TrainDetailResponse.TrainDetailData data = trainOrderDetail.getData();
|
||||
if (data != null && data.getOrderStatus().equals("T") && data.getItems() != null && !data.getItems().isEmpty()) {
|
||||
TrainDetailResponse.Item item = data.getItems().get(0);
|
||||
//状态为T说明该订单为退款订单, 需要生成退款订单
|
||||
Command.of(RefundOrderGenerateCommand.class).Info(
|
||||
String.valueOf(item.getItemId()),
|
||||
data.getOrderNo(),
|
||||
"-" + item.getRefundAmount(),
|
||||
"4",
|
||||
data.getRefundTime()
|
||||
).sendToQueue();
|
||||
}
|
||||
System.out.println(trainOrderDetail);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.chint;
|
|||
import cn.hutool.extra.pinyin.PinyinUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.chint.application.out.LoginController;
|
||||
import com.chint.application.services.login.strategy.PailaLoginStrategy;
|
||||
import com.chint.domain.aggregates.location.basedata.CountryLevelInfoEntity;
|
||||
import com.chint.domain.aggregates.location.basedata.PrefectureLevelCityInfoEntity;
|
||||
|
@ -11,28 +12,30 @@ import com.chint.domain.aggregates.order.Location;
|
|||
import com.chint.domain.aggregates.order.RouteOrder;
|
||||
import com.chint.domain.aggregates.user.User;
|
||||
import com.chint.domain.repository.*;
|
||||
import com.chint.domain.service.JTCompanyDomainService;
|
||||
import com.chint.infrastructure.util.Digest;
|
||||
import com.chint.interfaces.rest.base.PostRequest;
|
||||
import com.chint.interfaces.rest.ctrip.CTripUserSaveRequest;
|
||||
import com.chint.interfaces.rest.ly.LYPostRequest;
|
||||
import com.chint.interfaces.rest.ly.LYSearchRequest;
|
||||
import com.chint.interfaces.rest.ly.LYUserRequest;
|
||||
import com.chint.interfaces.rest.ly.dto.flydatapushback.FlyOkDTO;
|
||||
import com.chint.interfaces.rest.ly.dto.flydatapushback.ParamFly;
|
||||
import com.chint.interfaces.rest.ly.dto.hotelorderdatapushbach.OrderInfo;
|
||||
import com.chint.interfaces.rest.ly.dto.search.response.hotel.HotelDetailResponse;
|
||||
import com.chint.interfaces.rest.ly.dto.strokepush.StrokePushResult;
|
||||
import com.chint.interfaces.rest.ly.dto.strokepush.TrainChange.TrainChangeRequest;
|
||||
import com.chint.interfaces.rest.user.PushUser;
|
||||
import com.chint.interfaces.rest.user.UserHttpRequest;
|
||||
import com.chint.interfaces.rest.user.UserHttpRequestImpl;
|
||||
import com.chint.interfaces.rest.user.UserSFRequest;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.http.HttpResponse;
|
||||
import org.apache.http.client.HttpClient;
|
||||
import org.apache.http.client.methods.HttpGet;
|
||||
import org.apache.http.impl.client.HttpClients;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
|
@ -41,8 +44,6 @@ import java.util.Comparator;
|
|||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.chint.infrastructure.constant.FSSCConstant.FSSC_LOGIN_PATH_APPROVAL;
|
||||
|
||||
@Slf4j
|
||||
@SpringBootTest
|
||||
class RouteApplicationTests {
|
||||
|
@ -68,13 +69,17 @@ class RouteApplicationTests {
|
|||
@Autowired
|
||||
private LegRepository legRepository;
|
||||
|
||||
|
||||
@Autowired
|
||||
private PrefectureLevelRepository prefectureLevelRepository;
|
||||
|
||||
@Autowired
|
||||
private CountryLevelInfoRepository countryLevelInfoRepository;
|
||||
|
||||
@Autowired
|
||||
private JTCompanyRepository jtCompanyRepository;
|
||||
@Autowired
|
||||
private JTCompanyDomainService jtCompanyDomainService;
|
||||
|
||||
@Value("${FSSC.jt-baseUrl}")
|
||||
private String jtFSSCUrl;
|
||||
|
||||
|
@ -91,9 +96,28 @@ class RouteApplicationTests {
|
|||
@Autowired
|
||||
private PostRequest postRequest;
|
||||
|
||||
@Autowired
|
||||
private LoginController loginController;
|
||||
|
||||
@Value("${chint.loginSecretKey}")
|
||||
private String LOGIN_SECRET_KEY;
|
||||
|
||||
@Autowired
|
||||
private UserHttpRequestImpl userHttpRequestImpl;
|
||||
|
||||
|
||||
@Autowired
|
||||
private UserSFRequest userSFRequest;
|
||||
|
||||
@Autowired
|
||||
private PushUser pushUser;
|
||||
|
||||
|
||||
@Autowired
|
||||
private LYUserRequest lyUserRequest;
|
||||
@Autowired
|
||||
private CTripUserSaveRequest cTripUserSaveRequest;
|
||||
|
||||
void test3() {
|
||||
FlyOkDTO freightDTO = new FlyOkDTO();
|
||||
ParamFly param = new ParamFly();
|
||||
|
@ -104,12 +128,26 @@ class RouteApplicationTests {
|
|||
|
||||
private User user = new User(1L, "230615020", 1, "卢麟哲", "1033719135@qq.com", "15857193365");
|
||||
|
||||
// @Test
|
||||
// @Test
|
||||
void fsscLogin() {
|
||||
System.out.println(postRequest.getReDirectUrl("http://10.10.100.129:8089" + "/MobileOA/api/FsscSSO?loginUser=230615020&data=%2F%23%2Fexpenseclaim%3FbillDefineId%3Dfcc76666fb1211e98e2019f4db5548fd%26scene%3DWRITE%26isNew%3Dtrue%26goback%3Dfalse"));
|
||||
System.out.println(postRequest.getReDirectUrl("http://10.10.100.129:8089" + "/MobileOA/api/FsscSSO?loginUser=230615020&data=%2F%23%2Fexpenseclaim%3FbillDefineId%3Dfcc76666fb1211e98e2019f4db5548fd%26scene%3DWRITE%26isNew%3Dtrue%26goback%3Dfalse"));
|
||||
System.out.println(postRequest.getReDirectUrl("http://10.10.100.129:8089" + "/MobileOA/api/FsscSSO?loginUser=230615020&data=%2F%23%2Fexpenseclaim%3FbillDefineId%3Dfcc76666fb1211e98e2019f4db5548fd%26scene%3DWRITE%26isNew%3Dtrue%26goback%3Dfalse"));
|
||||
System.out.println(postRequest.getReDirectUrl("http://10.10.100.129:8089" + "/MobileOA/api/FsscSSO?loginUser=230615020&data=%2F%23%2Fexpenseclaim%3FbillDefineId%3Dfcc76666fb1211e98e2019f4db5548fd%26scene%3DWRITE%26isNew%3Dtrue%26goback%3Dfalse"));
|
||||
System.out.println(postRequest.getReDirectUrl("http://10.10.100.129:8089" + "/MobileOA/api/FsscSSO?loginUser=230615020&data=%2F%23%2Fexpenseclaim%3FbillDefineId%3Dfcc76666fb1211e98e2019f4db5548fd%26scene%3DWRITE%26isNew%3Dtrue%26goback%3Dfalse"));
|
||||
System.out.println(postRequest.getReDirectUrl("http://10.10.100.129:8089" + "/MobileOA/api/FsscSSO?loginUser=230615020&data=%2F%23%2Fexpenseclaim%3FbillDefineId%3Dfcc76666fb1211e98e2019f4db5548fd%26scene%3DWRITE%26isNew%3Dtrue%26goback%3Dfalse"));
|
||||
System.out.println(postRequest.getReDirectUrl("http://10.10.100.129:8089" + "/MobileOA/api/FsscSSO?loginUser=230615020&data=%2F%23%2Fexpenseclaim%3FbillDefineId%3Dfcc76666fb1211e98e2019f4db5548fd%26scene%3DWRITE%26isNew%3Dtrue%26goback%3Dfalse"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void syncUserTo(){
|
||||
User user = new User();
|
||||
user.setCompanyCode("A10000001");
|
||||
user.setWorkStatus("A");
|
||||
user.setGender("M");
|
||||
user.setName("陈光金");
|
||||
user.setCompanyName("正泰集团股份有限公司");
|
||||
user.setEmployeeNo("605403");
|
||||
|
||||
lyUserRequest.saveCurrentUser(user);
|
||||
cTripUserSaveRequest.saveUserToCTrip(user);
|
||||
}
|
||||
|
||||
// @Test
|
||||
|
@ -195,12 +233,12 @@ class RouteApplicationTests {
|
|||
System.out.println(orderInfo.getOrderSerialNo());
|
||||
}
|
||||
|
||||
// @Test
|
||||
@Test
|
||||
void loginSign() {
|
||||
String sfno = "220324098";
|
||||
String syscode = "XNFSSC";
|
||||
String billcode = "CLSQ240311000011";
|
||||
String companycode = "A70000056";
|
||||
String sfno = "160601023";
|
||||
String syscode = "FSSC";
|
||||
String billcode = "CLSQ240225000099";
|
||||
String companycode = "正泰集团股份有限公司";
|
||||
String timespan = "1708908662738";
|
||||
String s = Digest.md5(sfno + syscode + billcode + companycode + LOGIN_SECRET_KEY + timespan);
|
||||
System.out.println(s);
|
||||
|
@ -210,6 +248,22 @@ class RouteApplicationTests {
|
|||
// log.trace("trace");
|
||||
}
|
||||
|
||||
@Test
|
||||
void loginSignProd() {
|
||||
String sfno = "81001001";
|
||||
String syscode = "FSSC";
|
||||
String billcode = "CLSQ240225000099";
|
||||
String companycode = "正泰集团股份有限公司";
|
||||
String timespan = "1708908662738";
|
||||
String key = "ZhengTaiRoute";
|
||||
String s = Digest.md5(sfno + syscode + billcode + companycode + key + timespan);
|
||||
System.out.println(s);
|
||||
// log.info("info");
|
||||
// log.trace("trace");
|
||||
// log.trace("trace");
|
||||
// log.trace("trace");
|
||||
}
|
||||
|
||||
// @Test
|
||||
void queryUserInfo() {
|
||||
User user2 = User.withEmployeeNo("180101001");
|
||||
|
@ -234,22 +288,14 @@ class RouteApplicationTests {
|
|||
locationRepository.saveAll(all);
|
||||
}
|
||||
|
||||
// @Test
|
||||
// @Test
|
||||
void deleteRouteOrder() {
|
||||
routeRepository.deleteById(875L);
|
||||
}
|
||||
|
||||
// @Test
|
||||
@Test
|
||||
void deleteOrderDetail() {
|
||||
orderDetailRepository.deleteById(15L);
|
||||
orderDetailRepository.deleteById(18L);
|
||||
orderDetailRepository.deleteById(19L);
|
||||
orderDetailRepository.deleteById(20L);
|
||||
orderDetailRepository.deleteById(23L);
|
||||
orderDetailRepository.deleteById(26L);
|
||||
orderDetailRepository.deleteById(28L);
|
||||
orderDetailRepository.deleteById(31L);
|
||||
orderDetailRepository.deleteById(33L);
|
||||
orderDetailRepository.deleteById(1457L);
|
||||
}
|
||||
|
||||
// @Test
|
||||
|
@ -271,7 +317,7 @@ class RouteApplicationTests {
|
|||
System.out.println(Arrays.toString(ids.toArray()));
|
||||
}
|
||||
|
||||
// @Test
|
||||
// @Test
|
||||
void deleteRouteByEmployeeNo() {
|
||||
List<RouteOrder> byEmployeeNo = routeRepository.findByEmployeeNo("230615020");
|
||||
for (RouteOrder routeOrder : byEmployeeNo) {
|
||||
|
@ -916,9 +962,22 @@ class RouteApplicationTests {
|
|||
}
|
||||
|
||||
System.out.println(noCountryCity);
|
||||
// System.out.println(newNoCountryCity);
|
||||
|
||||
System.out.println(locationList);
|
||||
System.out.println(saveLocations);
|
||||
}
|
||||
|
||||
@Test
|
||||
void timeTest() {
|
||||
DateTimeFormatter formatterWithT = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||
//根据项目需求,当传入的时间 , 使用该时间保存到订单当中
|
||||
String startTime = "2024-05-31T00:00";
|
||||
String substring = startTime.substring(0, 10);
|
||||
System.out.println(LocalDate.parse(substring, formatterWithT));
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
void pushUserInfo() {
|
||||
pushUser.getUserSFDataFromOpenApiBatch();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue