Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
99de34606e
|
@ -160,6 +160,10 @@ public class OrderDetailQuery {
|
|||
Double.parseDouble(hotelOrderDetail.getOrderAmount()) == 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
HotelOrderDetailDto orderDetailDto = HotelOrderDetailDto.copyFrom(hotelOrderDetail);
|
||||
RouteOrder routeOrder = routeRepository.queryById(orderDetail.getRouteId());
|
||||
orderDetailDto.setApplicantId(routeOrder.getUserId());
|
||||
|
|
|
@ -4,6 +4,7 @@ package com.chint.domain.aggregates.order;
|
|||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.springframework.data.annotation.Id;
|
||||
import org.springframework.data.annotation.Transient;
|
||||
import org.springframework.data.relational.core.mapping.MappedCollection;
|
||||
import org.springframework.data.relational.core.mapping.Table;
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@ import org.springframework.data.relational.core.mapping.Table;
|
|||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Objects;
|
||||
|
||||
@Data
|
||||
@Table("hotel_order_detail_customer")
|
||||
|
@ -27,4 +28,17 @@ public class HotelOrderDetailCustomer implements Serializable {
|
|||
|
||||
// 入住人手机号
|
||||
private String phone;
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
HotelOrderDetailCustomer that = (HotelOrderDetailCustomer) o;
|
||||
return Objects.equals(userName, that.userName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(userName);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -221,7 +221,7 @@ public class CTripOrderExtensionFactoryImpl implements OrderExtensionFactory {
|
|||
} else {
|
||||
flightOrderDetail.setOrderStatus(FSSC_FLIGHT_STATUS_SUCCESS);
|
||||
}
|
||||
//携程创建的飞机订单只有取消和预定成功两个状态
|
||||
//携程创建的飞机订单只有
|
||||
if(!flightOrderDetail.getOrderStatus().equals(FSSC_ORDER_STATUS_CANCEL)){
|
||||
flightOrderDetail.setOrderStatus(FSSC_FLIGHT_STATUS_SUCCESS);
|
||||
}
|
||||
|
|
|
@ -19,6 +19,7 @@ import org.springframework.stereotype.Component;
|
|||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
|
@ -82,18 +83,14 @@ public class LYOrderExtensionFactoryImpl implements OrderExtensionFactory {
|
|||
FlightOrderDetail flightOrderDetail = orderDetailFactory.buildFlightWithRouteOrderAndOrderDetail(routeOrder, first);
|
||||
|
||||
//飞机票状态属性保存
|
||||
OrderEvent lastEvent = orderDetail.getLastEvent();
|
||||
if (lastEvent != null) {
|
||||
flightOrderDetail.setOrderStatus(lastEvent.mapToFlightOrderDetailStatus());
|
||||
} else {
|
||||
//如果订单事件为空,那么就需要重新根据查询到的订单信息重新进行映射
|
||||
Integer orderStatus = orderDetails.getOrderStatus();
|
||||
flightOrderDetail.setOrderStatus(
|
||||
OrderEvent.mapToFlightOrderDetailStatus(
|
||||
LYOrderUtil.mapFlightStatus(orderStatus.toString())
|
||||
)
|
||||
);
|
||||
}
|
||||
//根据查询到的订单信息重新进行映射
|
||||
Integer orderStatus = orderDetails.getOrderStatus();
|
||||
flightOrderDetail.setOrderStatus(
|
||||
OrderEvent.mapToFlightOrderDetailStatus(
|
||||
LYOrderUtil.mapFlightStatus(orderStatus.toString())
|
||||
)
|
||||
);
|
||||
|
||||
if (orderDetails.getIsChangeOrder()) {
|
||||
//如果发现同程的订单号里面还有C就能够判断出 ,它是改签订单
|
||||
flightOrderDetail.setOrderStatus(FSSC_FLIGHT_STATUS_CHANGE);
|
||||
|
@ -280,7 +277,12 @@ public class LYOrderExtensionFactoryImpl implements OrderExtensionFactory {
|
|||
List<HotelDetailResponse.Room> roomList = data.getRoomList();
|
||||
if (roomList != null && !roomList.isEmpty()) {
|
||||
HotelDetailResponse.Room room = roomList.get(0);
|
||||
hotelOrderDetail.setStandardItems(room.getDayStandardPrice());
|
||||
String dayStandardPrice = room.getDayStandardPrice();
|
||||
String[] split = dayStandardPrice.split(",");
|
||||
List<String> list = Arrays.asList(split);
|
||||
if (!list.isEmpty()) {
|
||||
hotelOrderDetail.setStandardItems(list.get(0));
|
||||
}
|
||||
}
|
||||
|
||||
return hotelOrderDetail;
|
||||
|
|
|
@ -110,17 +110,19 @@ public class OrderDetailFactoryImpl implements OrderDetailFactory {
|
|||
//如果已经存在的话 ,那么这些基础字段就不用重新构建了
|
||||
return orderDetail.getFlightOrderDetail();
|
||||
}
|
||||
//如果订单存在,直接配置该订单的超标信息和原因
|
||||
orderDetail.getOrderEventList()
|
||||
.stream()
|
||||
.filter(it -> it.getEventType().equals(ORDER_EVENT_ETA))
|
||||
.findFirst()
|
||||
.ifPresentOrElse(it -> {
|
||||
flightOrderDetail.setOverStandard("是");
|
||||
flightOrderDetail.setOverStandardReason(it.getExtension());
|
||||
}, () -> flightOrderDetail.setOverStandard("否"));
|
||||
flightOrderDetail.setOrderNo(orderDetail.getOrderNo());
|
||||
flightOrderDetail.setDetailId(orderDetail.getOrderNo());
|
||||
if(orderDetail.getOrderEventList() != null){
|
||||
//如果订单存在,直接配置该订单的超标信息和原因
|
||||
orderDetail.getOrderEventList()
|
||||
.stream()
|
||||
.filter(it -> it.getEventType().equals(ORDER_EVENT_ETA))
|
||||
.findFirst()
|
||||
.ifPresentOrElse(it -> {
|
||||
flightOrderDetail.setOverStandard("是");
|
||||
flightOrderDetail.setOverStandardReason(it.getExtension());
|
||||
}, () -> flightOrderDetail.setOverStandard("否"));
|
||||
flightOrderDetail.setOrderNo(orderDetail.getOrderNo());
|
||||
flightOrderDetail.setDetailId(orderDetail.getOrderNo());
|
||||
}
|
||||
} else {
|
||||
flightOrderDetail = BeanUtil.copyProperties(buildWithRouteOrder(routeOrder), FlightOrderDetail.class);
|
||||
}
|
||||
|
@ -139,22 +141,24 @@ public class OrderDetailFactoryImpl implements OrderDetailFactory {
|
|||
//如果已经存在的话 ,那么这些基础字段就不用重新构建了
|
||||
return order.getTrainOrderDetail();
|
||||
}
|
||||
//如果订单存在,直接配置该订单的超标信息和原因
|
||||
order.getOrderEventList()
|
||||
.stream()
|
||||
.filter(it -> it.getEventType().equals(ORDER_EVENT_ETA))
|
||||
.findFirst()
|
||||
.ifPresentOrElse(it -> {
|
||||
trainOrderDetail.setOverStandard("是");
|
||||
trainOrderDetail.setOverStandardReason(it.getExtension());
|
||||
}, () -> trainOrderDetail.setOverStandard("否"));
|
||||
trainOrderDetail.setOrderNo(order.getOrderNo());
|
||||
trainOrderDetail.setDetailId(order.getOrderNo());
|
||||
if(order.getOrderEventList() != null){
|
||||
//如果订单存在,直接配置该订单的超标信息和原因
|
||||
order.getOrderEventList()
|
||||
.stream()
|
||||
.filter(it -> it.getEventType().equals(ORDER_EVENT_ETA))
|
||||
.findFirst()
|
||||
.ifPresentOrElse(it -> {
|
||||
trainOrderDetail.setOverStandard("是");
|
||||
trainOrderDetail.setOverStandardReason(it.getExtension());
|
||||
}, () -> trainOrderDetail.setOverStandard("否"));
|
||||
trainOrderDetail.setOrderNo(order.getOrderNo());
|
||||
trainOrderDetail.setDetailId(order.getOrderNo());
|
||||
|
||||
User user = userRepository.findByUserEmployeeNo(routeOrder.getUserId());
|
||||
trainOrderDetail.setBookingUserCode(user.getEmployeeNo());
|
||||
trainOrderDetail.setBookingName(user.getName());
|
||||
trainOrderDetail.setBookingUserPhone(user.getPhoneNumber());
|
||||
User user = userRepository.findByUserEmployeeNo(routeOrder.getUserId());
|
||||
trainOrderDetail.setBookingUserCode(user.getEmployeeNo());
|
||||
trainOrderDetail.setBookingName(user.getName());
|
||||
trainOrderDetail.setBookingUserPhone(user.getPhoneNumber());
|
||||
}
|
||||
} else {
|
||||
trainOrderDetail = BeanUtil.copyProperties(buildWithRouteOrder(routeOrder), TrainOrderDetail.class);
|
||||
}
|
||||
|
@ -172,22 +176,25 @@ public class OrderDetailFactoryImpl implements OrderDetailFactory {
|
|||
//如果已经存在的话 ,那么这些基础字段就不用重新构建了
|
||||
return orderDetail.getHotelOrderDetail();
|
||||
}
|
||||
//如果订单存在,直接配置该订单的超标信息和原因
|
||||
orderDetail.getOrderEventList()
|
||||
.stream()
|
||||
.filter(it -> it.getEventType().equals(ORDER_EVENT_ETA))
|
||||
.findFirst()
|
||||
.ifPresentOrElse(it -> {
|
||||
hotelOrderDetail.setOverStandard("是");
|
||||
hotelOrderDetail.setOverStandardReason(it.getExtension());
|
||||
}, () -> hotelOrderDetail.setOverStandard("否"));
|
||||
hotelOrderDetail.setOrderNo(orderDetail.getOrderNo());
|
||||
hotelOrderDetail.setDetailId(orderDetail.getOrderNo());
|
||||
|
||||
User user = userRepository.findByUserEmployeeNo(routeOrder.getUserId());
|
||||
hotelOrderDetail.setBookingUserCode(user.getEmployeeNo());
|
||||
hotelOrderDetail.setBookingName(user.getName());
|
||||
hotelOrderDetail.setBookingUserPhone(user.getPhoneNumber());
|
||||
//如果订单存在,直接配置该订单的超标信息和原因
|
||||
if(orderDetail.getOrderEventList() != null){
|
||||
orderDetail.getOrderEventList()
|
||||
.stream()
|
||||
.filter(it -> it.getEventType().equals(ORDER_EVENT_ETA))
|
||||
.findFirst()
|
||||
.ifPresentOrElse(it -> {
|
||||
hotelOrderDetail.setOverStandard("是");
|
||||
hotelOrderDetail.setOverStandardReason(it.getExtension());
|
||||
}, () -> hotelOrderDetail.setOverStandard("否"));
|
||||
hotelOrderDetail.setOrderNo(orderDetail.getOrderNo());
|
||||
hotelOrderDetail.setDetailId(orderDetail.getOrderNo());
|
||||
|
||||
User user = userRepository.findByUserEmployeeNo(routeOrder.getUserId());
|
||||
hotelOrderDetail.setBookingUserCode(user.getEmployeeNo());
|
||||
hotelOrderDetail.setBookingName(user.getName());
|
||||
hotelOrderDetail.setBookingUserPhone(user.getPhoneNumber());
|
||||
}
|
||||
|
||||
return hotelOrderDetail;
|
||||
}
|
||||
|
|
|
@ -45,4 +45,12 @@ public class LYConstant {
|
|||
public static final int L_Y_PRODUCT_TYPE_CHAILORDER = 4; //差旅单推送
|
||||
public static final int L_Y_PRODUCT_TYPE_CAR = 6; //用车
|
||||
public static final int L_Y_PRODUCT_TYPE_HOTEL = 3; //酒店
|
||||
|
||||
//同程订单推送类型
|
||||
// public static final int L_Y_NOTIFY_COMMON = 1; //酒店
|
||||
// public static final int L_Y_PRODUCT_TYPE_HOTEL = 3; //酒店
|
||||
// public static final int L_Y_PRODUCT_TYPE_HOTEL = 3; //酒店
|
||||
// public static final int L_Y_PRODUCT_TYPE_HOTEL = 3; //酒店
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -4,10 +4,7 @@ package com.chint.interfaces.rest.bpm.dto.orderdetail;
|
|||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.chint.domain.aggregates.order.HotelOrderDetail;
|
||||
import com.chint.domain.aggregates.order.HotelOrderDetailCustomer;
|
||||
import com.chint.domain.aggregates.order.OrderDetail;
|
||||
import com.chint.domain.aggregates.order.TrainOrderDetail;
|
||||
import lombok.Data;
|
||||
import org.springframework.data.relational.core.mapping.MappedCollection;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
@ -165,6 +162,10 @@ public class HotelOrderDetailDto implements Serializable {
|
|||
return null;
|
||||
}
|
||||
HotelOrderDetailDto hotelOrderDetailDto = BeanUtil.copyProperties(hotelOrderDetail, HotelOrderDetailDto.class);
|
||||
//这里执行逻辑用于筛选重复的入住人
|
||||
hotelOrderDetailDto.setCustomers(
|
||||
hotelOrderDetail.getCustomers().stream().distinct().toList()
|
||||
);
|
||||
return hotelOrderDetailDto;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -125,11 +125,6 @@ public class CommonController {
|
|||
orderTravel.setTravelNo(travelApplyNo);
|
||||
saveOrderTravel(orderTravel);
|
||||
lyCallBackDataHandler.carCallBackData(orderSerialNo, 0);
|
||||
/*
|
||||
if (subNotifyType == 2 || subNotifyType == 3 || subNotifyType == 1){
|
||||
sendMsg(travelApplyNo);
|
||||
}*/
|
||||
|
||||
}
|
||||
return new LYNoteResponse("100", "OK");
|
||||
}
|
||||
|
@ -146,10 +141,6 @@ public class CommonController {
|
|||
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) {
|
||||
changeTrain(ruleViolate, subNotifyType, orderTrain.getOrderNo());
|
||||
|
@ -175,15 +166,7 @@ public class CommonController {
|
|||
if (Objects.nonNull(notifyData)) {
|
||||
JSONObject jsonObj = JSON.parseObject(notifyData.toString());
|
||||
ResultBackHotel resultBackHotel = jsonObj.toJavaObject(ResultBackHotel.class);
|
||||
// Gson gson = new Gson();
|
||||
// ResultBackHotel common = gson.fromJson(notifyData.toString(), ResultBackHotel.class);
|
||||
ResultBackHotel.DataObject dataObject = resultBackHotel.getData();
|
||||
|
||||
// OrderTravel orderTravel = new OrderTravel();
|
||||
// orderTravel.setOrderNo(dataObject.getOrderInfo().getOrderSerialNo());
|
||||
// orderTravel.setTravelNo(dataObject.getTravelData().getTravelApplyNo());
|
||||
// saveOrderTravel(orderTravel);
|
||||
|
||||
int ruleViolate = dataObject.getOrderInfo().getRuleViolate() ? 1 : 0;
|
||||
String orderSerialNo = dataObject.getOrderInfo().getOrderSerialNo();
|
||||
String foulReason = dataObject.getOrderInfo().getFoulReason();//超标原因
|
||||
|
@ -204,6 +187,7 @@ public class CommonController {
|
|||
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);
|
||||
|
|
Loading…
Reference in New Issue