From 3a41badcda59a27c064502ad5ae6337fa5a58b58 Mon Sep 17 00:00:00 2001 From: lulz1 Date: Fri, 14 Jun 2024 17:07:02 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=8B=89=E5=8F=96?= =?UTF-8?q?=E7=BB=93=E7=AE=97=E6=95=B0=E6=8D=AE=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ctrip_order_record/CTripCarRecord.java | 16 +++++++++++++++- .../ctrip_order_record/CTripFlightRecord.java | 14 ++++++++++++++ .../ctrip_order_record/CTripHotelRecord.java | 14 ++++++++++++++ 3 files changed, 43 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripCarRecord.java b/src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripCarRecord.java index 590ba38b..7b655710 100644 --- a/src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripCarRecord.java +++ b/src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripCarRecord.java @@ -9,6 +9,7 @@ import org.springframework.data.relational.core.mapping.Table; import java.io.Serial; import java.io.Serializable; import java.time.LocalDateTime; +import java.util.Objects; @Data @Table("c_trip_car_record") @@ -33,7 +34,7 @@ public class CTripCarRecord implements Serializable { @MappedCollection(idColumn = "c_trip_car_record_id") private CTripCarPassengerInfo cTripCarPassengerInfo; - public static CTripCarRecord of(CTripCarRecordBase cTripCarRecordBase, CTripCarQuickInfo cTripCarQuickInfo , CTripCarPassengerInfo cTripCarPassengerInfo) { + public static CTripCarRecord of(CTripCarRecordBase cTripCarRecordBase, CTripCarQuickInfo cTripCarQuickInfo, CTripCarPassengerInfo cTripCarPassengerInfo) { CTripCarRecord cTripCarRecord = new CTripCarRecord(); cTripCarRecord.setCTripCarQuickInfo(cTripCarQuickInfo); cTripCarRecord.setCTripCarRecordBase(cTripCarRecordBase); @@ -42,4 +43,17 @@ public class CTripCarRecord implements Serializable { cTripCarRecord.setCTripCarPassengerInfo(cTripCarPassengerInfo); return cTripCarRecord; } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + CTripCarRecord that = (CTripCarRecord) o; + return Objects.equals(recordId, that.recordId) && Objects.equals(createTime, that.createTime) && Objects.equals(routeOrderNo, that.routeOrderNo) && Objects.equals(orderDate, that.orderDate) && Objects.equals(bookingUserName, that.bookingUserName) && Objects.equals(bookingUserCode, that.bookingUserCode) && Objects.equals(bookingUserPhone, that.bookingUserPhone) && Objects.equals(userName, that.userName) && Objects.equals(userCode, that.userCode) && Objects.equals(cTripCarRecordBase, that.cTripCarRecordBase) && Objects.equals(cTripCarQuickInfo, that.cTripCarQuickInfo) && Objects.equals(cTripCarPassengerInfo, that.cTripCarPassengerInfo); + } + + @Override + public int hashCode() { + return Objects.hash(recordId, createTime, routeOrderNo, orderDate, bookingUserName, bookingUserCode, bookingUserPhone, userName, userCode, cTripCarRecordBase, cTripCarQuickInfo, cTripCarPassengerInfo); + } } diff --git a/src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripFlightRecord.java b/src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripFlightRecord.java index 9256c182..35f9ba24 100644 --- a/src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripFlightRecord.java +++ b/src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripFlightRecord.java @@ -9,6 +9,7 @@ import org.springframework.data.relational.core.mapping.Table; import java.io.Serial; import java.io.Serializable; import java.time.LocalDateTime; +import java.util.Objects; @Data @Table("c_trip_flight_record") @@ -55,4 +56,17 @@ public class CTripFlightRecord implements Serializable { this.setCTripFlightPrintInfo(cTripFlightPrintInfo); return this; } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + CTripFlightRecord that = (CTripFlightRecord) o; + return Objects.equals(recordId, that.recordId) && Objects.equals(createTime, that.createTime) && Objects.equals(routeOrderNo, that.routeOrderNo) && Objects.equals(ticketNo, that.ticketNo) && Objects.equals(bookingUserName, that.bookingUserName) && Objects.equals(bookingUserCode, that.bookingUserCode) && Objects.equals(bookingUserPhone, that.bookingUserPhone) && Objects.equals(userName, that.userName) && Objects.equals(userCode, that.userCode) && Objects.equals(cTripFlightRecordBase, that.cTripFlightRecordBase) && Objects.equals(cTripFlightInfo, that.cTripFlightInfo) && Objects.equals(cTripFlightBaseInfo, that.cTripFlightBaseInfo) && Objects.equals(cTripFlightTripInfo, that.cTripFlightTripInfo) && Objects.equals(cTripFlightPrintInfo, that.cTripFlightPrintInfo); + } + + @Override + public int hashCode() { + return Objects.hash(recordId, createTime, routeOrderNo, ticketNo, bookingUserName, bookingUserCode, bookingUserPhone, userName, userCode, cTripFlightRecordBase, cTripFlightInfo, cTripFlightBaseInfo, cTripFlightTripInfo, cTripFlightPrintInfo); + } } diff --git a/src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripHotelRecord.java b/src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripHotelRecord.java index 1c9fd0df..ffb5080d 100644 --- a/src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripHotelRecord.java +++ b/src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripHotelRecord.java @@ -9,6 +9,7 @@ import org.springframework.data.relational.core.mapping.Table; import java.io.Serial; import java.io.Serializable; import java.time.LocalDateTime; +import java.util.Objects; @Data @Table("c_trip_hotel_record") @@ -41,4 +42,17 @@ public class CTripHotelRecord implements Serializable { cTripHotelRecord.setCreateTime(DateTimeUtil.strToTimeMM(cTripHotelRecordBase.getCreateTime())); return cTripHotelRecord; } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + CTripHotelRecord that = (CTripHotelRecord) o; + return Objects.equals(recordId, that.recordId) && Objects.equals(createTime, that.createTime) && Objects.equals(routeOrderNo, that.routeOrderNo) && Objects.equals(bookingUserName, that.bookingUserName) && Objects.equals(bookingUserCode, that.bookingUserCode) && Objects.equals(bookingUserPhone, that.bookingUserPhone) && Objects.equals(userName, that.userName) && Objects.equals(userCode, that.userCode) && Objects.equals(cTripHotelRecordBase, that.cTripHotelRecordBase) && Objects.equals(cTripHotelInfo, that.cTripHotelInfo) && Objects.equals(cTripHotelOrderDetail, that.cTripHotelOrderDetail); + } + + @Override + public int hashCode() { + return Objects.hash(recordId, createTime, routeOrderNo, bookingUserName, bookingUserCode, bookingUserPhone, userName, userCode, cTripHotelRecordBase, cTripHotelInfo, cTripHotelOrderDetail); + } }