Merge remote-tracking branch 'origin/dev' into dev
# Conflicts: # src/main/java/com/chint/domain/service/OrderDomainService.java
This commit is contained in:
commit
290f906d41
|
@ -24,6 +24,9 @@ import com.chint.interfaces.rest.bpm.dto.RescheduleDto;
|
|||
import com.chint.interfaces.rest.ctrip.CTripOrderSearchRequest;
|
||||
import com.chint.interfaces.rest.ctrip.dto.search.ItineraryEntity;
|
||||
import com.chint.interfaces.rest.ctrip.dto.search.SearchOrderResponse;
|
||||
import com.chint.interfaces.rest.ctrip.dto.search.car.CarBasicInfo;
|
||||
import com.chint.interfaces.rest.ctrip.dto.search.car.CarQuickOrderInfoEntity;
|
||||
import com.chint.interfaces.rest.ctrip.dto.search.car.OrderFee;
|
||||
import com.chint.interfaces.rest.ctrip.dto.search.flight.ChangeInfo;
|
||||
import com.chint.interfaces.rest.ctrip.dto.search.flight.FlightOrderInfoEntity;
|
||||
import com.chint.interfaces.rest.ctrip.dto.search.flight.FlightRefundInfo;
|
||||
|
@ -219,6 +222,9 @@ public class OrderDomainService {
|
|||
if (!orderEventType.equals(ORDER_EVENT_ETA) && orderDetail.getProductType().equals(LEG_TYPE_HOTEL)) {
|
||||
generateHotelRefundAndChangeOrder(orderDetail.getOrderNo());
|
||||
}
|
||||
if (!orderEventType.equals(ORDER_EVENT_ETA) && orderDetail.getProductType().equals(LEG_TYPE_TAXI)) {
|
||||
carRefundChangeOrder(orderDetail.getOrderNo());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -454,4 +460,27 @@ public class OrderDomainService {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void carRefundChangeOrder(String orderNo) {
|
||||
SearchOrderResponse searchOrderResponse = cTripOrderSearchRequest.searchOrderResponseByOrderId(orderNo);
|
||||
List<ItineraryEntity> itineraryList = searchOrderResponse.getItineraryList();
|
||||
List<CarQuickOrderInfoEntity> carQuickOrderInfoList = itineraryList.get(0).getCarQuickOrderInfoList();
|
||||
CarBasicInfo basicInfo = carQuickOrderInfoList.get(0).getBasicInfo();
|
||||
List<OrderFee> orderFeeList = carQuickOrderInfoList.get(0).getOrderFeeList();
|
||||
for (OrderFee orderFee : orderFeeList) {
|
||||
//退款
|
||||
if ("REFUND".equals(orderFee.getCostScene()) || "AFTER_REFUND".equals(orderFee.getCostScene())) {
|
||||
LocalDateTime localDateTime = LocalDateTime.now();
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
Command.of(CTripOrderRefundCommand.class).Info(
|
||||
String.valueOf(orderFee.getOrderFeeId()),
|
||||
basicInfo.getOrderId(),
|
||||
"-" + orderFee.getAmount(),
|
||||
"4",
|
||||
localDateTime.format(formatter)
|
||||
).sendToQueue();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue