补充同程酒店默认状态为出票成功
This commit is contained in:
parent
68196a02a3
commit
f1e11aa043
|
@ -11,6 +11,8 @@ import java.io.Serial;
|
|||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static com.chint.infrastructure.constant.FSSCConstant.FSSC_HOTEL_STATUS_REFUND;
|
||||
import static com.chint.infrastructure.constant.FSSCConstant.FSSC_HOTEL_STATUS_SUCCESS;
|
||||
import static com.chint.infrastructure.constant.OrderConstant.*;
|
||||
|
||||
@Data
|
||||
|
@ -81,15 +83,15 @@ public class OrderEvent implements Serializable {
|
|||
|
||||
public String mapToHotelOrderDetailStatus(){
|
||||
return switch (this.eventType) {
|
||||
case ORDER_EVENT_PREPARE -> "3"; //未下单 改成3
|
||||
case ORDER_EVENT_PAYED -> "1";
|
||||
case ORDER_EVENT_CHANGE -> "1";
|
||||
case ORDER_EVENT_CANCEL -> "1"; //e额外生成的单子为3 退票虽然是3 返回为1
|
||||
case ORDER_EVENT_ORDERED -> "1";
|
||||
case ORDER_EVENT_REFUND -> "1";
|
||||
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 -> "0";
|
||||
case ORDER_EVENT_FINISH -> "1";
|
||||
case ORDER_EVENT_ETA -> "1";
|
||||
case ORDER_EVENT_FINISH -> FSSC_HOTEL_STATUS_SUCCESS;
|
||||
case ORDER_EVENT_ETA -> FSSC_HOTEL_STATUS_SUCCESS;
|
||||
default -> "未知事件";
|
||||
};
|
||||
}
|
||||
|
|
|
@ -22,6 +22,7 @@ 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_HOTEL_STATUS_SUCCESS;
|
||||
import static com.chint.infrastructure.constant.OrderConstant.ORDER_EVENT_ETA;
|
||||
|
||||
@Component
|
||||
|
@ -86,7 +87,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 +124,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 +141,17 @@ 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.mapToFlightOrderDetailStatus());
|
||||
}}
|
||||
first1.ifPresent(it -> {
|
||||
OrderEvent lastEvent = it.getLastEvent();
|
||||
if (lastEvent != null) {
|
||||
flightOrderDetail.setOrderStatus(lastEvent.mapToFlightOrderDetailStatus());
|
||||
}
|
||||
}
|
||||
);
|
||||
// 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
|
||||
|
||||
|
@ -295,7 +297,7 @@ public class LYOrderExtensionFactoryImpl implements OrderExtensionFactory {
|
|||
.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
|
||||
|
@ -305,13 +307,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());
|
||||
|
@ -325,11 +327,14 @@ 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.mapToHotelOrderDetailStatus());
|
||||
}}
|
||||
first1.ifPresent(it -> {
|
||||
OrderEvent lastEvent = it.getLastEvent();
|
||||
if (lastEvent != null) {
|
||||
hotelOrderDetail.setOrderStatus(lastEvent.mapToHotelOrderDetailStatus());
|
||||
} else {
|
||||
hotelOrderDetail.setOrderStatus(FSSC_HOTEL_STATUS_SUCCESS);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
Optional<Integer> firstOrderEvent = orderDetail.getOrderEventList()
|
||||
|
@ -388,8 +393,6 @@ public class LYOrderExtensionFactoryImpl implements OrderExtensionFactory {
|
|||
.orElseThrow(() -> new NotFoundException(NOT_FOUND));
|
||||
|
||||
|
||||
|
||||
|
||||
RouteOrder routeOrder = routeRepository.queryById(orderDetail.getRouteId());
|
||||
String sysCode = routeOrder.getApproveOrderNo().getSysCode();
|
||||
|
||||
|
@ -414,7 +417,6 @@ public class LYOrderExtensionFactoryImpl implements OrderExtensionFactory {
|
|||
}
|
||||
|
||||
|
||||
|
||||
if (trainDetailData != null) {
|
||||
trainOrderDetail.setOrderNo(trainDetailData.getOrderNo());
|
||||
trainOrderDetail.setDetailId(trainDetailData.getOrderNo());
|
||||
|
@ -427,15 +429,16 @@ 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.mapToTrainOrderDetailStatus());
|
||||
}}
|
||||
first1.ifPresent(it -> {
|
||||
OrderEvent lastEvent = it.getLastEvent();
|
||||
if (lastEvent != null) {
|
||||
trainOrderDetail.setOrderStatus(lastEvent.mapToTrainOrderDetailStatus());
|
||||
}
|
||||
}
|
||||
);
|
||||
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());
|
||||
|
@ -458,7 +461,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());
|
||||
|
@ -473,23 +476,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("一等座");
|
||||
}
|
||||
|
||||
|
@ -584,17 +586,18 @@ 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.mapToCarOrderDetailStatus());
|
||||
}}
|
||||
firstOrderDetail.ifPresent(it -> {
|
||||
OrderEvent lastEvent = it.getLastEvent();
|
||||
if (lastEvent != null) {
|
||||
carOrderDetail.setOrderStatus(lastEvent.mapToCarOrderDetailStatus());
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
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());
|
||||
|
@ -629,14 +632,14 @@ public class LYOrderExtensionFactoryImpl implements OrderExtensionFactory {
|
|||
}
|
||||
|
||||
|
||||
if (orderDriverInfo != null){
|
||||
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());
|
||||
|
|
|
@ -17,4 +17,11 @@ 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_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 XN_FSSC_REDIRECT_PATH_APPROVAL_ONE = "/XNFsscSSO?loginUser=";//申请单类型
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue