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

This commit is contained in:
lulz1 2024-02-27 18:01:15 +08:00
commit 2fefbbeab8
5 changed files with 58 additions and 51 deletions

View File

@ -2,11 +2,13 @@ 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.Table;
@Data
@Table("train_order_detail")
@Accessors(chain = true)
public class TrainOrderDetail {
@Id
private Long id;

View File

@ -6,6 +6,7 @@ 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 com.chint.interfaces.rest.ly.dto.search.response.train.TrainDetailResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@ -17,9 +18,9 @@ import java.util.stream.Collectors;
public class LYOrderExtensionFactoryImpl implements OrderExtensionFactory {
@Autowired
private UserRepository userRepository;
@Override
public CarOrderDetail createCarOrderDetail(Object carOrderDetailData) {
return null;
@ -27,9 +28,15 @@ public class LYOrderExtensionFactoryImpl implements OrderExtensionFactory {
@Override
public TrainOrderDetail createTrainOrderDetail(Object trainOrderDetailData) {
TrainDetailResponse trainDetailResponse = (TrainDetailResponse) trainOrderDetailData;
TrainDetailResponse.TrainDetailData data = trainDetailResponse.getData();
TrainOrderDetail trainOrderDetail = new TrainOrderDetail();
//映射值
trainOrderDetail.setOrderNo(data.getOrderNo())
.setOverStandard(String.valueOf(data.getRuleViolate()))
;
return null;
return trainOrderDetail;
}
@Override
@ -56,11 +63,9 @@ public class LYOrderExtensionFactoryImpl implements OrderExtensionFactory {
private FlightOrderDetail convertFlight(HotelDetailResponse hotelDetailResponse) {
return null;
}
private HotelOrderDetail convertHotel(HotelDetailResponse hotelDetailResponse) {
HotelOrderDetail hotelOrderDetail = new HotelOrderDetail();
HotelDetailResponse.Data data = hotelDetailResponse.getData();
@ -68,50 +73,50 @@ public class LYOrderExtensionFactoryImpl implements OrderExtensionFactory {
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())
.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")
.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;
return hotelOrderDetail;
}
private List<HotelOrderDetailCustomer> getCustomers(List<Resident> residentList) {
private List<HotelOrderDetailCustomer> getCustomers(List<Resident> residentList) {
List<HotelOrderDetailCustomer> list = residentList.stream()
.map(resident -> {

View File

@ -10,7 +10,7 @@ import org.springframework.stereotype.Component;
import java.util.Optional;
import static com.chint.infrastructure.constant.LegConstant.LEG_TYPE_TRAIN;
import static com.chint.infrastructure.constant.LegConstant.*;
import static com.chint.infrastructure.constant.SupplierNameConstant.SUPPLIER_L_Y;
@Component
@ -49,7 +49,7 @@ public class LYOrderDataAdapter implements OrderDataAdapter {
HotelDetailResponse.Data data = hotelDetailResponse.getData();
return Optional.of(
OrderLegData.builder()
.productType(LEG_TYPE_TRAIN)
.productType(LEG_TYPE_HOTEL)
.outOrderNo(data.getOrderInfo().getOrderSerialNo())
.price(String.valueOf(data.getOrderInfo().getTotalPrice()))
.actualOrderNo(data.getOrderInfo().getOrderSerialNo())
@ -63,7 +63,7 @@ public class LYOrderDataAdapter implements OrderDataAdapter {
CarDetailResponse.Data data = carDetailResponse.getData();
return Optional.of(
OrderLegData.builder()
.productType(LEG_TYPE_TRAIN)
.productType(LEG_TYPE_TAXI)
.outOrderNo(data.getOrderNo())
.price(String.valueOf(data.getTotalAmount()))
.actualOrderNo(data.getOutOrderNo())
@ -78,7 +78,7 @@ public class LYOrderDataAdapter implements OrderDataAdapter {
FlightOrderDetail.Data data = flightOrderDetail.getData();
return Optional.of(
OrderLegData.builder()
.productType(LEG_TYPE_TRAIN)
.productType(LEG_TYPE_AIRPLANE)
// .orderNo(data.get())
// .price(String.valueOf( data.getTotalAmount()))
// .actualOrderNo(data.getOutOrderNo())

View File

@ -38,7 +38,7 @@ public class BPMController {
@PostMapping("/reschedule/back")
public Result<TravelStandards> rescheduleBack(@RequestBody BPMBack bpmBack) {
//获取订单号和审批结果
System.out.println("bpmBack = " + bpmBack);
return Result.Success(CommonMessageConstant.SUCCESS);
}
}

View File

@ -53,7 +53,7 @@ public class TrainDetailResponse {
private int bookType;
private int trainIndex;
private String relationOrderNo;
private Boolean ruleViolate;
// Constructors, Getters, and Setters
}
@Data