Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
lulz1 2024-02-27 15:23:13 +08:00
commit 099238dc8b
8 changed files with 143 additions and 5 deletions

View File

@ -2,6 +2,7 @@ package com.chint.domain.aggregates.order;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.data.annotation.Id;
import org.springframework.data.relational.core.mapping.MappedCollection;
import org.springframework.data.relational.core.mapping.Table;
@ -10,6 +11,7 @@ import java.util.List;
@Data
@Table("hotel_order_detail")
@Accessors(chain = true)
public class HotelOrderDetail {
@Id
private Long id;

View File

@ -1,11 +1,25 @@
package com.chint.domain.factoriy.order_detail;
import com.chint.domain.aggregates.order.*;
import com.chint.domain.aggregates.user.User;
import com.chint.domain.repository.UserRepository;
import com.chint.domain.value_object.*;
import com.chint.interfaces.rest.ly.dto.hotelorderdatapushbach.Resident;
import com.chint.interfaces.rest.ly.dto.search.response.hotel.HotelDetailResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
@Component
public class LYOrderExtensionFactoryImpl implements OrderExtensionFactory {
@Autowired
private UserRepository userRepository;
@Override
public CarOrderDetail createCarOrderDetail(Object carOrderDetailData) {
return null;
@ -25,14 +39,93 @@ public class LYOrderExtensionFactoryImpl implements OrderExtensionFactory{
@Override
public HotelOrderDetail createHotelOrderDetail(Object hotelOrderDetailData) {
HotelOrderDetail hotelOrderDetail = new HotelOrderDetail();
HotelDetailResponse hotelDetailResponse = (HotelDetailResponse) hotelOrderDetailData;
HotelOrderDetail convertHotel = convertHotel(hotelDetailResponse);
return null;
return convertHotel;
}
@Override
public OtherOrderDetail createOtherOrderDetail(Object otherOrderDetailData) {
return null;
}
private FlightOrderDetail convertFlight(HotelDetailResponse hotelDetailResponse) {
return null;
}
private HotelOrderDetail convertHotel(HotelDetailResponse hotelDetailResponse) {
HotelOrderDetail hotelOrderDetail = new HotelOrderDetail();
HotelDetailResponse.Data data = hotelDetailResponse.getData();
HotelDetailResponse.OrderInfo orderInfo = data.getOrderInfo();
HotelDetailResponse.HotelInfo hotelInfo = data.getHotelInfo();
List<HotelDetailResponse.Room> roomList = data.getRoomList();
hotelOrderDetail.setOrderNo(orderInfo.getOrderSerialNo())
.setOverStandard(String.valueOf(orderInfo.getRuleViolate()))
.setOrderStatus(String.valueOf(orderInfo.getOrderStatus()))
.setReceiptsNum(orderInfo.getTravelApplyNo())
.setBookingUserCode(orderInfo.getOutEmployeeId())
// .setBookingName(orderInfo.getEmployeeName())
.setCreateTime("2023-04-26 13:15:17")
.setCheckInCity(orderInfo.getCreateTime())
.setHotelName(hotelInfo.getHotelName())
.setContactPhone(hotelInfo.getHotelTel())
.setHotelAddress(hotelInfo.getHotelAddress())
.setStarRate("4")
.setCheckInDate(hotelInfo.getCheckInDate())
.setDepartureDate(hotelInfo.getCheckOutDate())
.setNightCount(String.valueOf(hotelInfo.getNightNum()))
.setRoomCount(String.valueOf(hotelInfo.getRoomNum()))
//.setRefundRoomNightCount("0")
.setRoomTypeName(hotelInfo.getRoomName())
.setPaymentType(String.valueOf(orderInfo.getPaymentType()))
.setCompanyAmount(String.valueOf(orderInfo.getCompanyPrice()))
.setPersonalAmount(String.valueOf(orderInfo.getPersonalPrice()))
.setCompanyRefundAmount(String.valueOf(orderInfo.getCompanyRefundPrice()))
.setPersonalRefundAmount(String.valueOf(orderInfo.getPersonalRefundPrice()))
.setOrderAmount(String.valueOf(orderInfo.getBusinessAmount()))
.setPreServiceFee(String.valueOf(orderInfo.getServicePrice()))
.setPostServiceFee(String.valueOf(orderInfo.getAfterSettlementServicePrice()))
.setRefundAmount(String.valueOf(orderInfo.getRefundPrice()))
.setCustomers(getCustomers(data.getResidentList()))
.setStandardItems(data.getItems().getPolicyName())
// .setNightRates()
.setSupplier("Supplier XYZ")
.setAmountFields("Amount A, Amount B")
.setOverStandardReason(orderInfo.getFoulReason())
.setAgreementHotel(String.valueOf(orderInfo.getProtocolType()));
// .setBOOK_ORG_STRUCT_1("Org A")
// .setBOOK_ORG_STRUCT_2("Org B")
// .setBOOK_ORG_STRUCT_3("Org C")
// .setProjectOrderNo("PROJ789")
// .setCostCenter("COST123")
return hotelOrderDetail;
}
private List<HotelOrderDetailCustomer> getCustomers(List<Resident> residentList) {
List<HotelOrderDetailCustomer> list = residentList.stream()
.map(resident -> {
HotelOrderDetailCustomer customer = new HotelOrderDetailCustomer();
customer.setId(Long.valueOf(resident.getEmployeeId()));
customer.setUserName(resident.getName());
User user = userRepository.findById(Long.valueOf(resident.getEmployeeId()));
customer.setGender(user.getGender());
customer.setUserCode(resident.getEmployeeCode());
customer.setPhone(resident.getContactPhone());
return customer;
})
.collect(Collectors.toList());
return list;
}
}

View File

@ -39,6 +39,7 @@ public class LYOrderDataAdapter implements OrderDataAdapter {
.outOrderNo(data.getOrderNo())
.price(String.valueOf(data.getTotalAmount()))
.actualOrderNo(data.getOutOrderNo())
.trainOrderDetailData(data)
.supplierName(SUPPLIER_L_Y)
.build()
);
@ -52,6 +53,7 @@ public class LYOrderDataAdapter implements OrderDataAdapter {
.outOrderNo(data.getOrderInfo().getOrderSerialNo())
.price(String.valueOf(data.getOrderInfo().getTotalPrice()))
.actualOrderNo(data.getOrderInfo().getOrderSerialNo())
.hotelOrderDetailData(data)
.supplierName(SUPPLIER_L_Y)
.build()
);
@ -65,6 +67,7 @@ public class LYOrderDataAdapter implements OrderDataAdapter {
.outOrderNo(data.getOrderNo())
.price(String.valueOf(data.getTotalAmount()))
.actualOrderNo(data.getOutOrderNo())
.carOrderDetailData(data)
.supplierName(SUPPLIER_L_Y)
.build()
);
@ -79,6 +82,7 @@ public class LYOrderDataAdapter implements OrderDataAdapter {
// .orderNo(data.get())
// .price(String.valueOf( data.getTotalAmount()))
// .actualOrderNo(data.getOutOrderNo())
.flightOrderDetailData(data)
.supplierName(SUPPLIER_L_Y)
.build()
);

View File

@ -13,5 +13,6 @@ public class Resident {
private String employeeId;
private String name;
private String contactPhone;
private String employeeCode;
private String contactEmail;
}

View File

@ -18,6 +18,7 @@ public class HotelDetailResponse {
public static class Data {
private OrderInfo orderInfo;
private HotelInfo hotelInfo;
private Items items;
private List<DayPrice> dayPrices;
private List<ContactPerson> contactPersons;
private List<Resident> residentList;
@ -31,9 +32,18 @@ public class HotelDetailResponse {
// Getters and Setters
}
@lombok.Data
public static class Items {
private String ruleTag;//违规标签
private String message;//违规提示消息
private boolean allowable;//违规是否允许预订
private String policyName;//差旅政策名称
}
@lombok.Data
public static class OrderInfo {
private String orderSerialNo;
private String travelOrderNo;
private Boolean ruleViolate;
private String foulReason;
private String businessTravelOrderNo;
private int protocolType;
private double totalStandardPrice;
@ -59,6 +69,9 @@ public class HotelDetailResponse {
private double payPrice;
private double personalPrice;
private double companyPrice;
private double companyRefundPrice;
private double personalRefundPrice;
private double refundPrice;
private String supplierOrderCreateTime;
private String employeeName;
private String enterpriseName;

View File

@ -32,7 +32,7 @@ public class FlyBackController {
private SupplierService supplierService;
//机票订单数据回推
//机票订单数据回推d
@PostMapping("/back")
public LYNoteResponse ticketBack(@RequestBody NotificationFly notificationFly) {
String orderSerialNo = notificationFly.getOrderDetails().getOrderSerialNo();

View File

@ -15,6 +15,31 @@ logging:
level:
org.springframework.jdbc.core.JdbcTemplate: DEBUG
org.springframework.jdbc.core.StatementCreatorUtils: TRACE
lYBase:
ly_app_id: "zhengtai"
ly_account: 4f9cb1080b564dd0a94aa95f7a19c8b5 # 测试appkey
ly_password: 1fD3SutgzfS48qznYQiq # 测试app秘钥
ly_secret: WOHzCMvHd823iHgH # 测试app秘钥
ly_base_url: https://api.qa.dttrip.cn/openapi
ly_strokepush: /api/TravelBizOrder/ExternalApproval
ly_token_path: /api/OAuth/v2/GetAccessToken
ly_order_path: /api/TravelApplyOrder/ApplyOrderSync
ly_user_path: /api/Employee/SyncEmployeeInfo
ly_login_path: /api/Employee/SSO
ly_flight_list_path: /api/DomesticFlight/GetFlightOrderList
ly_flight_detail_path: /api/DomesticFlight/GetFlightOrderDetail
ly_train_list_path: /api/Train/GetTrainOrderList
ly_train_detail_path: /api/Train/GetTrainOrderDetail
ly_hotel_list_path: /api/Hotel/GetHotelOrderList
ly_hotel_detail_path: /api/Hotel/GetHotelOrderDetail
ly_car_detail_path: /api/Car/QueryCarOrderDetailDistribution
ly_train_max_price: /api/Train/TrainHighPirceSearchByCityName
ly_fly_price: /api/DomesticFlight/CheckFlightOrderBookableStatus
ly_hotel_list: /api/Hotel/GetHotelCityList
ly_hotel_min_price: /api/Hotel/GetHotelMinPrice
cTrip:
baseUrl: https://ct.ctrip.com