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.Data;
import lombok.experimental.Accessors;
import org.springframework.data.annotation.Id; import org.springframework.data.annotation.Id;
import org.springframework.data.relational.core.mapping.Table; import org.springframework.data.relational.core.mapping.Table;
@Data @Data
@Table("train_order_detail") @Table("train_order_detail")
@Accessors(chain = true)
public class TrainOrderDetail { public class TrainOrderDetail {
@Id @Id
private Long 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.domain.value_object.*;
import com.chint.interfaces.rest.ly.dto.hotelorderdatapushbach.Resident; 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.hotel.HotelDetailResponse;
import com.chint.interfaces.rest.ly.dto.search.response.train.TrainDetailResponse;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
@ -17,9 +18,9 @@ import java.util.stream.Collectors;
public class LYOrderExtensionFactoryImpl implements OrderExtensionFactory { public class LYOrderExtensionFactoryImpl implements OrderExtensionFactory {
@Autowired @Autowired
private UserRepository userRepository; private UserRepository userRepository;
@Override @Override
public CarOrderDetail createCarOrderDetail(Object carOrderDetailData) { public CarOrderDetail createCarOrderDetail(Object carOrderDetailData) {
return null; return null;
@ -27,9 +28,15 @@ public class LYOrderExtensionFactoryImpl implements OrderExtensionFactory {
@Override @Override
public TrainOrderDetail createTrainOrderDetail(Object trainOrderDetailData) { 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 trainOrderDetail;
return null;
} }
@Override @Override
@ -56,11 +63,9 @@ public class LYOrderExtensionFactoryImpl implements OrderExtensionFactory {
private FlightOrderDetail convertFlight(HotelDetailResponse hotelDetailResponse) { private FlightOrderDetail convertFlight(HotelDetailResponse hotelDetailResponse) {
return null; return null;
} }
private HotelOrderDetail convertHotel(HotelDetailResponse hotelDetailResponse) { private HotelOrderDetail convertHotel(HotelDetailResponse hotelDetailResponse) {
HotelOrderDetail hotelOrderDetail = new HotelOrderDetail(); HotelOrderDetail hotelOrderDetail = new HotelOrderDetail();
HotelDetailResponse.Data data = hotelDetailResponse.getData(); HotelDetailResponse.Data data = hotelDetailResponse.getData();
@ -68,50 +73,50 @@ public class LYOrderExtensionFactoryImpl implements OrderExtensionFactory {
HotelDetailResponse.HotelInfo hotelInfo = data.getHotelInfo(); HotelDetailResponse.HotelInfo hotelInfo = data.getHotelInfo();
List<HotelDetailResponse.Room> roomList = data.getRoomList(); List<HotelDetailResponse.Room> roomList = data.getRoomList();
hotelOrderDetail.setOrderNo(orderInfo.getOrderSerialNo()) hotelOrderDetail.setOrderNo(orderInfo.getOrderSerialNo())
.setOverStandard(String.valueOf(orderInfo.getRuleViolate())) .setOverStandard(String.valueOf(orderInfo.getRuleViolate()))
.setOrderStatus(String.valueOf(orderInfo.getOrderStatus())) .setOrderStatus(String.valueOf(orderInfo.getOrderStatus()))
.setReceiptsNum(orderInfo.getTravelApplyNo()) .setReceiptsNum(orderInfo.getTravelApplyNo())
.setBookingUserCode(orderInfo.getOutEmployeeId()) .setBookingUserCode(orderInfo.getOutEmployeeId())
// .setBookingName(orderInfo.getEmployeeName()) // .setBookingName(orderInfo.getEmployeeName())
.setCreateTime("2023-04-26 13:15:17") .setCreateTime("2023-04-26 13:15:17")
.setCheckInCity(orderInfo.getCreateTime()) .setCheckInCity(orderInfo.getCreateTime())
.setHotelName(hotelInfo.getHotelName()) .setHotelName(hotelInfo.getHotelName())
.setContactPhone(hotelInfo.getHotelTel()) .setContactPhone(hotelInfo.getHotelTel())
.setHotelAddress(hotelInfo.getHotelAddress()) .setHotelAddress(hotelInfo.getHotelAddress())
.setStarRate("4") .setStarRate("4")
.setCheckInDate(hotelInfo.getCheckInDate()) .setCheckInDate(hotelInfo.getCheckInDate())
.setDepartureDate(hotelInfo.getCheckOutDate()) .setDepartureDate(hotelInfo.getCheckOutDate())
.setNightCount(String.valueOf(hotelInfo.getNightNum())) .setNightCount(String.valueOf(hotelInfo.getNightNum()))
.setRoomCount(String.valueOf(hotelInfo.getRoomNum())) .setRoomCount(String.valueOf(hotelInfo.getRoomNum()))
//.setRefundRoomNightCount("0") //.setRefundRoomNightCount("0")
.setRoomTypeName(hotelInfo.getRoomName()) .setRoomTypeName(hotelInfo.getRoomName())
.setPaymentType(String.valueOf(orderInfo.getPaymentType())) .setPaymentType(String.valueOf(orderInfo.getPaymentType()))
.setCompanyAmount(String.valueOf(orderInfo.getCompanyPrice())) .setCompanyAmount(String.valueOf(orderInfo.getCompanyPrice()))
.setPersonalAmount(String.valueOf(orderInfo.getPersonalPrice())) .setPersonalAmount(String.valueOf(orderInfo.getPersonalPrice()))
.setCompanyRefundAmount(String.valueOf(orderInfo.getCompanyRefundPrice())) .setCompanyRefundAmount(String.valueOf(orderInfo.getCompanyRefundPrice()))
.setPersonalRefundAmount(String.valueOf(orderInfo.getPersonalRefundPrice())) .setPersonalRefundAmount(String.valueOf(orderInfo.getPersonalRefundPrice()))
.setOrderAmount(String.valueOf(orderInfo.getBusinessAmount())) .setOrderAmount(String.valueOf(orderInfo.getBusinessAmount()))
.setPreServiceFee(String.valueOf(orderInfo.getServicePrice())) .setPreServiceFee(String.valueOf(orderInfo.getServicePrice()))
.setPostServiceFee(String.valueOf(orderInfo.getAfterSettlementServicePrice())) .setPostServiceFee(String.valueOf(orderInfo.getAfterSettlementServicePrice()))
.setRefundAmount(String.valueOf(orderInfo.getRefundPrice())) .setRefundAmount(String.valueOf(orderInfo.getRefundPrice()))
.setCustomers(getCustomers(data.getResidentList())) .setCustomers(getCustomers(data.getResidentList()))
.setStandardItems(data.getItems().getPolicyName()) .setStandardItems(data.getItems().getPolicyName())
// .setNightRates() // .setNightRates()
.setSupplier("Supplier XYZ") .setSupplier("Supplier XYZ")
.setAmountFields("Amount A, Amount B") .setAmountFields("Amount A, Amount B")
.setOverStandardReason(orderInfo.getFoulReason()) .setOverStandardReason(orderInfo.getFoulReason())
.setAgreementHotel(String.valueOf(orderInfo.getProtocolType())); .setAgreementHotel(String.valueOf(orderInfo.getProtocolType()));
// .setBOOK_ORG_STRUCT_1("Org A") // .setBOOK_ORG_STRUCT_1("Org A")
// .setBOOK_ORG_STRUCT_2("Org B") // .setBOOK_ORG_STRUCT_2("Org B")
// .setBOOK_ORG_STRUCT_3("Org C") // .setBOOK_ORG_STRUCT_3("Org C")
// .setProjectOrderNo("PROJ789") // .setProjectOrderNo("PROJ789")
// .setCostCenter("COST123") // .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() List<HotelOrderDetailCustomer> list = residentList.stream()
.map(resident -> { .map(resident -> {

View File

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

View File

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

View File

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