From 28aa7bdac546a6b1ad974652cd9aa08532de618b Mon Sep 17 00:00:00 2001 From: lulz1 Date: Wed, 27 Mar 2024 21:30:18 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E7=BB=93=E7=AE=97?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../application/in/AutoWorkController.java | 4 +++- .../ctrip_order_record}/CTripCarRecord.java | 3 +-- .../ctrip_order_record}/CTripCarRecordBase.java | 2 +- .../ctrip_order_record}/CTripFlightInfo.java | 2 +- .../ctrip_order_record}/CTripFlightRecord.java | 3 ++- .../CTripFlightRecordBase.java | 2 +- .../ctrip_order_record/CTripHotelRecord.java | 17 +++++++++++++++++ .../CTripHotelRecordBase.java | 2 +- .../CTripTrainRecordBase.java | 2 +- .../CTripOrderRecordExtensionFactory.java | 1 - .../repository/CTripOrderDetailRepository.java | 2 +- .../chint/domain/service/LegDomainService.java | 6 ++++-- .../repository/CTripOrderDetailImpl.java | 2 +- .../jdbc/JdbcCTripFlightRecordRepository.java | 3 +-- .../jdbc/JdbcCtripCarOrderDetailRepository.java | 2 +- .../JdbcCtripFlightOrderDetailRepository.java | 2 +- .../JdbcCtripHotelOrderDetailRepository.java | 2 +- .../JdbcCtripTrainOrderDetailRepository.java | 2 +- .../ctrip/order/CTripOrderRecordAutoSave.java | 2 +- .../java/com/chint/RouteApplicationTests.java | 2 +- 20 files changed, 41 insertions(+), 22 deletions(-) rename src/main/java/com/chint/domain/aggregates/order/{ctrip => order_record/ctrip_order_record}/CTripCarRecord.java (76%) rename src/main/java/com/chint/domain/aggregates/order/{ctrip => order_record/ctrip_order_record}/CTripCarRecordBase.java (98%) rename src/main/java/com/chint/domain/aggregates/order/{ctrip => order_record/ctrip_order_record}/CTripFlightInfo.java (96%) rename src/main/java/com/chint/domain/aggregates/order/{ctrip => order_record/ctrip_order_record}/CTripFlightRecord.java (89%) rename src/main/java/com/chint/domain/aggregates/order/{ctrip => order_record/ctrip_order_record}/CTripFlightRecordBase.java (99%) create mode 100644 src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripHotelRecord.java rename src/main/java/com/chint/domain/aggregates/order/{ctrip => order_record/ctrip_order_record}/CTripHotelRecordBase.java (98%) rename src/main/java/com/chint/domain/aggregates/order/{ctrip => order_record/ctrip_order_record}/CTripTrainRecordBase.java (99%) diff --git a/src/main/java/com/chint/application/in/AutoWorkController.java b/src/main/java/com/chint/application/in/AutoWorkController.java index 6c18df82..93b33c74 100644 --- a/src/main/java/com/chint/application/in/AutoWorkController.java +++ b/src/main/java/com/chint/application/in/AutoWorkController.java @@ -1,6 +1,8 @@ package com.chint.application.in; +import com.chint.domain.factoriy.order_record.LyStatementOrder; +import com.chint.infrastructure.echo_framework.command.Command; import com.chint.infrastructure.util.Result; import com.chint.interfaces.rest.ctrip.order.CTripOrderRecordAutoSave; import io.swagger.annotations.ApiOperation; @@ -9,7 +11,7 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; - +import com.chint.application.commands.OrderRecordGenerateCommand; import static com.chint.infrastructure.constant.CommonMessageConstant.SUCCESS; @RestController diff --git a/src/main/java/com/chint/domain/aggregates/order/ctrip/CTripCarRecord.java b/src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripCarRecord.java similarity index 76% rename from src/main/java/com/chint/domain/aggregates/order/ctrip/CTripCarRecord.java rename to src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripCarRecord.java index 44c9cc6b..e807650e 100644 --- a/src/main/java/com/chint/domain/aggregates/order/ctrip/CTripCarRecord.java +++ b/src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripCarRecord.java @@ -1,6 +1,5 @@ -package com.chint.domain.aggregates.order.ctrip; +package com.chint.domain.aggregates.order.order_record.ctrip_order_record; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.annotation.Id; import org.springframework.data.relational.core.mapping.MappedCollection; import org.springframework.data.relational.core.mapping.Table; diff --git a/src/main/java/com/chint/domain/aggregates/order/ctrip/CTripCarRecordBase.java b/src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripCarRecordBase.java similarity index 98% rename from src/main/java/com/chint/domain/aggregates/order/ctrip/CTripCarRecordBase.java rename to src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripCarRecordBase.java index ed4ac023..5272f5c6 100644 --- a/src/main/java/com/chint/domain/aggregates/order/ctrip/CTripCarRecordBase.java +++ b/src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripCarRecordBase.java @@ -1,4 +1,4 @@ -package com.chint.domain.aggregates.order.ctrip; +package com.chint.domain.aggregates.order.order_record.ctrip_order_record; import com.chint.interfaces.rest.ctrip.dto.order.OrderCarResponse; import lombok.Data; diff --git a/src/main/java/com/chint/domain/aggregates/order/ctrip/CTripFlightInfo.java b/src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripFlightInfo.java similarity index 96% rename from src/main/java/com/chint/domain/aggregates/order/ctrip/CTripFlightInfo.java rename to src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripFlightInfo.java index 26d55fe0..955e2486 100644 --- a/src/main/java/com/chint/domain/aggregates/order/ctrip/CTripFlightInfo.java +++ b/src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripFlightInfo.java @@ -1,4 +1,4 @@ -package com.chint.domain.aggregates.order.ctrip; +package com.chint.domain.aggregates.order.order_record.ctrip_order_record; import cn.hutool.core.bean.BeanUtil; import com.chint.interfaces.rest.ctrip.dto.order.OrderFlightResponse; diff --git a/src/main/java/com/chint/domain/aggregates/order/ctrip/CTripFlightRecord.java b/src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripFlightRecord.java similarity index 89% rename from src/main/java/com/chint/domain/aggregates/order/ctrip/CTripFlightRecord.java rename to src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripFlightRecord.java index 99aa0238..e2f08b71 100644 --- a/src/main/java/com/chint/domain/aggregates/order/ctrip/CTripFlightRecord.java +++ b/src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripFlightRecord.java @@ -1,4 +1,4 @@ -package com.chint.domain.aggregates.order.ctrip; +package com.chint.domain.aggregates.order.order_record.ctrip_order_record; import lombok.Data; import org.springframework.data.annotation.Id; @@ -10,6 +10,7 @@ import org.springframework.data.relational.core.mapping.Table; public class CTripFlightRecord { @Id private Long id; + private String recordId; @MappedCollection(idColumn = "c_trip_flight_record_id") private CTripFlightRecordBase cTripFlightRecordBase; @MappedCollection(idColumn = "c_trip_flight_record_id") diff --git a/src/main/java/com/chint/domain/aggregates/order/ctrip/CTripFlightRecordBase.java b/src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripFlightRecordBase.java similarity index 99% rename from src/main/java/com/chint/domain/aggregates/order/ctrip/CTripFlightRecordBase.java rename to src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripFlightRecordBase.java index ab80dba8..05cd093f 100644 --- a/src/main/java/com/chint/domain/aggregates/order/ctrip/CTripFlightRecordBase.java +++ b/src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripFlightRecordBase.java @@ -1,4 +1,4 @@ -package com.chint.domain.aggregates.order.ctrip; +package com.chint.domain.aggregates.order.order_record.ctrip_order_record; import com.chint.interfaces.rest.ctrip.dto.order.OrderFlightResponse; import lombok.Data; 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 new file mode 100644 index 00000000..c1a1206b --- /dev/null +++ b/src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripHotelRecord.java @@ -0,0 +1,17 @@ +package com.chint.domain.aggregates.order.order_record.ctrip_order_record; + +import lombok.Data; +import org.springframework.data.annotation.Id; +import org.springframework.data.relational.core.mapping.MappedCollection; +import org.springframework.data.relational.core.mapping.Table; + +@Data +@Table("c_trip_flight_record") +public class CTripHotelRecord { + @Id + private Long id; + private String recordId; + @MappedCollection(idColumn = "c_trip_hotel_record_id") + private CTripHotelRecordBase cTripHotelRecordBase; + +} diff --git a/src/main/java/com/chint/domain/aggregates/order/ctrip/CTripHotelRecordBase.java b/src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripHotelRecordBase.java similarity index 98% rename from src/main/java/com/chint/domain/aggregates/order/ctrip/CTripHotelRecordBase.java rename to src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripHotelRecordBase.java index 5e61c9b9..819b3a66 100644 --- a/src/main/java/com/chint/domain/aggregates/order/ctrip/CTripHotelRecordBase.java +++ b/src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripHotelRecordBase.java @@ -1,4 +1,4 @@ -package com.chint.domain.aggregates.order.ctrip; +package com.chint.domain.aggregates.order.order_record.ctrip_order_record; import com.chint.interfaces.rest.ctrip.dto.order.OrderHotelResponse; import lombok.Data; diff --git a/src/main/java/com/chint/domain/aggregates/order/ctrip/CTripTrainRecordBase.java b/src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripTrainRecordBase.java similarity index 99% rename from src/main/java/com/chint/domain/aggregates/order/ctrip/CTripTrainRecordBase.java rename to src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripTrainRecordBase.java index 2db48874..706f6e2f 100644 --- a/src/main/java/com/chint/domain/aggregates/order/ctrip/CTripTrainRecordBase.java +++ b/src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripTrainRecordBase.java @@ -1,4 +1,4 @@ -package com.chint.domain.aggregates.order.ctrip; +package com.chint.domain.aggregates.order.order_record.ctrip_order_record; import com.chint.interfaces.rest.ctrip.dto.order.OrderTrainResponse; import lombok.Data; diff --git a/src/main/java/com/chint/domain/factoriy/order_record/CTripOrderRecordExtensionFactory.java b/src/main/java/com/chint/domain/factoriy/order_record/CTripOrderRecordExtensionFactory.java index 17b88d17..f5127470 100644 --- a/src/main/java/com/chint/domain/factoriy/order_record/CTripOrderRecordExtensionFactory.java +++ b/src/main/java/com/chint/domain/factoriy/order_record/CTripOrderRecordExtensionFactory.java @@ -24,7 +24,6 @@ public class CTripOrderRecordExtensionFactory implements OrderRecordExtensionFa @Override public OrderCarRecord createCarOrderRecord(Object orderCarRecordData) { - return null; } diff --git a/src/main/java/com/chint/domain/repository/CTripOrderDetailRepository.java b/src/main/java/com/chint/domain/repository/CTripOrderDetailRepository.java index c91d8d60..6b968033 100644 --- a/src/main/java/com/chint/domain/repository/CTripOrderDetailRepository.java +++ b/src/main/java/com/chint/domain/repository/CTripOrderDetailRepository.java @@ -1,6 +1,6 @@ package com.chint.domain.repository; -import com.chint.domain.aggregates.order.ctrip.*; +import com.chint.domain.aggregates.order.order_record.ctrip_order_record.*; import java.util.List; diff --git a/src/main/java/com/chint/domain/service/LegDomainService.java b/src/main/java/com/chint/domain/service/LegDomainService.java index 3dae4d6e..ca45fc3c 100644 --- a/src/main/java/com/chint/domain/service/LegDomainService.java +++ b/src/main/java/com/chint/domain/service/LegDomainService.java @@ -62,12 +62,14 @@ public class LegDomainService { List details = orderDetailList.stream().filter(orderDetail -> orderDetail.getOrderStatus().equals(ORDER_EVENT_ORDERED_NAME) || orderDetail.getOrderStatus().equals(ORDER_EVENT_PAYED_NAME)).toList(); - if (!details.isEmpty() && leg.getLegStatus() < LegConstant.LEG_EVENT_ORDERED) { - LegEvent legEvent = legEventFactory.creatLegEvent(LegConstant.LEG_EVENT_ORDERED); + if (!details.isEmpty() && leg.getLegStatus() < LEG_EVENT_ORDERED) { + LegEvent legEvent = legEventFactory.creatLegEvent(LEG_EVENT_ORDERED); leg.addEvent(legEvent); return legRepository.save(leg); } + + if(leg.getLegStatus().equals(LEG_STATUS_CHANGE)){ //如果发现该订单 LegEvent legEvent = legEventFactory.creatLegEvent(LEG_EVENT_APPROVAL); diff --git a/src/main/java/com/chint/infrastructure/repository/CTripOrderDetailImpl.java b/src/main/java/com/chint/infrastructure/repository/CTripOrderDetailImpl.java index ad5cf044..114e88dd 100644 --- a/src/main/java/com/chint/infrastructure/repository/CTripOrderDetailImpl.java +++ b/src/main/java/com/chint/infrastructure/repository/CTripOrderDetailImpl.java @@ -1,6 +1,6 @@ package com.chint.infrastructure.repository; -import com.chint.domain.aggregates.order.ctrip.*; +import com.chint.domain.aggregates.order.order_record.ctrip_order_record.*; import com.chint.domain.repository.CTripOrderDetailRepository; import com.chint.infrastructure.repository.jdbc.*; import org.springframework.beans.factory.annotation.Autowired; diff --git a/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcCTripFlightRecordRepository.java b/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcCTripFlightRecordRepository.java index c75b7a7f..242a5121 100644 --- a/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcCTripFlightRecordRepository.java +++ b/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcCTripFlightRecordRepository.java @@ -1,7 +1,6 @@ package com.chint.infrastructure.repository.jdbc; -import com.chint.domain.aggregates.order.ctrip.CTripFlightRecord; -import org.springframework.beans.factory.annotation.Autowired; +import com.chint.domain.aggregates.order.order_record.ctrip_order_record.CTripFlightRecord; import org.springframework.data.repository.CrudRepository; import org.springframework.stereotype.Repository; diff --git a/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcCtripCarOrderDetailRepository.java b/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcCtripCarOrderDetailRepository.java index 55741b4e..2638e426 100644 --- a/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcCtripCarOrderDetailRepository.java +++ b/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcCtripCarOrderDetailRepository.java @@ -1,6 +1,6 @@ package com.chint.infrastructure.repository.jdbc; -import com.chint.domain.aggregates.order.ctrip.CTripCarRecordBase; +import com.chint.domain.aggregates.order.order_record.ctrip_order_record.CTripCarRecordBase; import org.springframework.data.repository.CrudRepository; import org.springframework.stereotype.Repository; diff --git a/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcCtripFlightOrderDetailRepository.java b/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcCtripFlightOrderDetailRepository.java index e1535530..ec15a622 100644 --- a/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcCtripFlightOrderDetailRepository.java +++ b/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcCtripFlightOrderDetailRepository.java @@ -1,6 +1,6 @@ package com.chint.infrastructure.repository.jdbc; -import com.chint.domain.aggregates.order.ctrip.CTripFlightRecordBase; +import com.chint.domain.aggregates.order.order_record.ctrip_order_record.CTripFlightRecordBase; import org.springframework.data.repository.CrudRepository; import org.springframework.stereotype.Repository; diff --git a/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcCtripHotelOrderDetailRepository.java b/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcCtripHotelOrderDetailRepository.java index 860eb50d..d5f5c13d 100644 --- a/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcCtripHotelOrderDetailRepository.java +++ b/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcCtripHotelOrderDetailRepository.java @@ -1,6 +1,6 @@ package com.chint.infrastructure.repository.jdbc; -import com.chint.domain.aggregates.order.ctrip.CTripHotelRecordBase; +import com.chint.domain.aggregates.order.order_record.ctrip_order_record.CTripHotelRecordBase; import org.springframework.data.repository.CrudRepository; import org.springframework.stereotype.Repository; diff --git a/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcCtripTrainOrderDetailRepository.java b/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcCtripTrainOrderDetailRepository.java index 28c4c74a..6886de80 100644 --- a/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcCtripTrainOrderDetailRepository.java +++ b/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcCtripTrainOrderDetailRepository.java @@ -1,6 +1,6 @@ package com.chint.infrastructure.repository.jdbc; -import com.chint.domain.aggregates.order.ctrip.CTripTrainRecordBase; +import com.chint.domain.aggregates.order.order_record.ctrip_order_record.CTripTrainRecordBase; import org.springframework.data.repository.CrudRepository; import org.springframework.stereotype.Repository; diff --git a/src/main/java/com/chint/interfaces/rest/ctrip/order/CTripOrderRecordAutoSave.java b/src/main/java/com/chint/interfaces/rest/ctrip/order/CTripOrderRecordAutoSave.java index c4fe2568..1ddfc0ff 100644 --- a/src/main/java/com/chint/interfaces/rest/ctrip/order/CTripOrderRecordAutoSave.java +++ b/src/main/java/com/chint/interfaces/rest/ctrip/order/CTripOrderRecordAutoSave.java @@ -1,6 +1,6 @@ package com.chint.interfaces.rest.ctrip.order; -import com.chint.domain.aggregates.order.ctrip.*; +import com.chint.domain.aggregates.order.order_record.ctrip_order_record.*; import com.chint.domain.repository.CTripOrderDetailRepository; import com.chint.interfaces.rest.ctrip.dto.order.OrderCarResponse; import com.chint.interfaces.rest.ctrip.dto.order.OrderFlightResponse; diff --git a/src/test/java/com/chint/RouteApplicationTests.java b/src/test/java/com/chint/RouteApplicationTests.java index e001a55d..38f572a2 100644 --- a/src/test/java/com/chint/RouteApplicationTests.java +++ b/src/test/java/com/chint/RouteApplicationTests.java @@ -269,7 +269,7 @@ class RouteApplicationTests { @Test void loginSignProd() { - String sfno = "181203012"; + String sfno = "231201060"; String syscode = "FSSC"; String billcode = "CLSQ240225000099"; String companycode = "正泰集团股份有限公司"; From 90a1b6994e73c3e32331cc7a9a6704dff68a545c Mon Sep 17 00:00:00 2001 From: Superdandan <1033719135@qq.com> Date: Wed, 27 Mar 2024 22:39:43 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E6=90=BA=E7=A8=8B?= =?UTF-8?q?=E7=BB=93=E7=AE=97=E6=98=8E=E7=BB=86=E4=BF=9D=E5=AD=98=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ctrip_order_record/CTripCarQuickInfo.java | 48 ++++++++ .../ctrip_order_record/CTripCarRecord.java | 23 +++- .../CTripCarRecordBase.java | 2 +- .../ctrip_order_record/CTripFlightRecord.java | 1 + .../ctrip_order_record/CTripHotelInfo.java | 42 +++++++ .../ctrip_order_record/CTripHotelRecord.java | 9 ++ .../CTripHotelRecordBase.java | 100 ++++++++------- .../ctrip_order_record/CTripTrainInfo.java | 74 ++++++++++++ .../ctrip_order_record/CTripTrainRecord.java | 31 +++++ .../CTripTrainRecordBase.java | 114 +++++++++--------- .../CTripOrderDetailRepository.java | 5 +- .../repository/CTripOrderDetailImpl.java | 34 +++++- .../jdbc/JdbcCTripCarRecordRepository.java | 11 ++ .../jdbc/JdbcCTripHotelRecordRepository.java | 10 ++ .../jdbc/JdbcCTripTrainRecordRepository.java | 10 ++ .../ctrip/order/CTripOrderRecordAutoSave.java | 33 ++--- 16 files changed, 413 insertions(+), 134 deletions(-) create mode 100644 src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripCarQuickInfo.java create mode 100644 src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripHotelInfo.java create mode 100644 src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripTrainInfo.java create mode 100644 src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripTrainRecord.java create mode 100644 src/main/java/com/chint/infrastructure/repository/jdbc/JdbcCTripCarRecordRepository.java create mode 100644 src/main/java/com/chint/infrastructure/repository/jdbc/JdbcCTripHotelRecordRepository.java create mode 100644 src/main/java/com/chint/infrastructure/repository/jdbc/JdbcCTripTrainRecordRepository.java diff --git a/src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripCarQuickInfo.java b/src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripCarQuickInfo.java new file mode 100644 index 00000000..c7a40b6a --- /dev/null +++ b/src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripCarQuickInfo.java @@ -0,0 +1,48 @@ +package com.chint.domain.aggregates.order.order_record.ctrip_order_record; + + +import cn.hutool.core.bean.BeanUtil; +import com.chint.interfaces.rest.ctrip.dto.order.OrderCarResponse; +import lombok.Data; +import org.springframework.data.annotation.Id; +import org.springframework.data.relational.core.mapping.Table; + +import java.io.Serial; +import java.io.Serializable; + +@Data +@Table("c_trip_car_quick_info") +public class CTripCarQuickInfo implements Serializable { + @Serial + private static final long serialVersionUID = 2343214623512376645L; + @Id + private Long id; + private Long cTripCarRecordId; + private int BookingType; + private String UseTime; + private String DepartureCityId; + private String DepartureDistrictCode; + private String DepartureCityName; + private String DepartureAddressDetail; + private String ArrivalCityId; + private String ArrivalDistrictCode; + private String ArrivalCityName; + private String ArrivalAddressDetail; + private int VehicleId; + private String VehicleName; + private String NormalDistance; + private String NormalTime; + private String ServiceBeginTime; + private String ServiceEndTime; + private String SceneName; + private String StandardName; + // private List DestinationChangeList; + private String VendorName; + // 如果StandardGeoInfo是标准地理信息类 +// private OrderCarResponse.StandardGeoInfo StandardGeoInfo; + private String CancelTime; + + public static CTripCarQuickInfo of(OrderCarResponse.CarOrderQuickProductInfo data) { + return BeanUtil.copyProperties(data, CTripCarQuickInfo.class); + } +} 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 e807650e..27f60b4f 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 @@ -1,16 +1,31 @@ package com.chint.domain.aggregates.order.order_record.ctrip_order_record; +import lombok.Data; import org.springframework.data.annotation.Id; import org.springframework.data.relational.core.mapping.MappedCollection; import org.springframework.data.relational.core.mapping.Table; -@Table("c_trip_car_record") -public class CTripCarRecord { +import java.io.Serial; +import java.io.Serializable; +@Data +@Table("c_trip_car_record") +public class CTripCarRecord implements Serializable { + @Serial + private static final long serialVersionUID = 5553214622358970145L; @Id private Long id; - @MappedCollection(idColumn = "id") + private String recordId; + @MappedCollection(idColumn = "c_trip_car_record_id") private CTripCarRecordBase cTripCarRecordBase; + @MappedCollection(idColumn = "c_trip_car_record_id") + private CTripCarQuickInfo cTripCarQuickInfo; - + public static CTripCarRecord of(CTripCarRecordBase cTripCarRecordBase, CTripCarQuickInfo cTripCarQuickInfo) { + CTripCarRecord cTripCarRecord = new CTripCarRecord(); + cTripCarRecord.setCTripCarQuickInfo(cTripCarQuickInfo); + cTripCarRecord.setCTripCarRecordBase(cTripCarRecordBase); + cTripCarRecord.setRecordId(String.valueOf(cTripCarRecordBase.getRecordId())); + return cTripCarRecord; + } } diff --git a/src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripCarRecordBase.java b/src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripCarRecordBase.java index 5272f5c6..112885a6 100644 --- a/src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripCarRecordBase.java +++ b/src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripCarRecordBase.java @@ -17,11 +17,11 @@ import java.io.Serializable; @Data @Table("c_trip_order_car_settlement_base_info") public class CTripCarRecordBase implements Serializable { - @Serial private static final long serialVersionUID = 4583214623558870145L; @Id private Long id; + private Long cTripCarRecordId; private Long recordId; private String batchNo; private String createTime; 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 e2f08b71..5597e65d 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 @@ -20,6 +20,7 @@ public class CTripFlightRecord { CTripFlightRecord cTripFlightRecord = new CTripFlightRecord(); cTripFlightRecord.setCTripFlightRecordBase(cTripFlightRecordBase); cTripFlightRecord.setCTripFlightInfo(cTripFlightInfo); + cTripFlightRecord.setRecordId(String.valueOf(cTripFlightRecordBase.getRecordId())); return cTripFlightRecord; } } diff --git a/src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripHotelInfo.java b/src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripHotelInfo.java new file mode 100644 index 00000000..32822a7f --- /dev/null +++ b/src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripHotelInfo.java @@ -0,0 +1,42 @@ +package com.chint.domain.aggregates.order.order_record.ctrip_order_record; + +import cn.hutool.core.bean.BeanUtil; +import com.chint.interfaces.rest.ctrip.dto.order.OrderCarResponse; +import com.chint.interfaces.rest.ctrip.dto.order.OrderHotelResponse; +import lombok.Data; +import org.springframework.data.annotation.Id; +import org.springframework.data.relational.core.mapping.Table; + +import java.io.Serial; +import java.io.Serializable; + +@Data +@Table("c_trip_hotel_info") +public class CTripHotelInfo implements Serializable { + @Serial + private static final long serialVersionUID = 4027343172340686513L; + @Id + private Long id; + private Long cTripHotelRecordId; + private String HotelName; + private String HotelNameEN; + private String CityName; + private String CityNameEN; + private Integer Star; + private boolean IsDomestic; + private String ISCU; + private Integer CityID; + private String DistrictCode; + private Integer DistrictID; + private String DistrictName; + private String BrandName; + private Integer ParentCityID; + private String ParentCityName; + private String ParentCityEnName; + private Integer HotelGroupId; + private String HotelGroupName; + + public static CTripHotelInfo of(OrderHotelResponse.SettlementHotelDetail data) { + return BeanUtil.copyProperties(data, CTripHotelInfo.class); + } +} 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 c1a1206b..25e081d4 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 @@ -13,5 +13,14 @@ public class CTripHotelRecord { private String recordId; @MappedCollection(idColumn = "c_trip_hotel_record_id") private CTripHotelRecordBase cTripHotelRecordBase; + @MappedCollection(idColumn = "c_trip_hotel_record_id") + private CTripHotelInfo cTripHotelInfo; + public static CTripHotelRecord of(CTripHotelRecordBase cTripHotelRecordBase, CTripHotelInfo cTripHotelInfo) { + CTripHotelRecord cTripHotelRecord = new CTripHotelRecord(); + cTripHotelRecord.setRecordId(String.valueOf(cTripHotelRecordBase.getRecordId())); + cTripHotelRecord.setCTripHotelRecordBase(cTripHotelRecordBase); + cTripHotelRecord.setCTripHotelInfo(cTripHotelInfo); + return cTripHotelRecord; + } } diff --git a/src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripHotelRecordBase.java b/src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripHotelRecordBase.java index 819b3a66..18040ffc 100644 --- a/src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripHotelRecordBase.java +++ b/src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripHotelRecordBase.java @@ -21,6 +21,7 @@ public class CTripHotelRecordBase implements Serializable { private static final long serialVersionUID = 3087333171110684513L; @Id private Long id; + private Long cTripHotelRecordId; private Long recordId; private Long orderId; private Integer accountId; @@ -34,8 +35,8 @@ public class CTripHotelRecordBase implements Serializable { private Double serviceFee; private Double extraCharge; private String accCheckBatchNo; - private String createTime; - private String datachangeLasttime; + private String createTime; + private String datachangeLasttime; private Integer orderType; private String subAccCheckBatchNo; private Long tripId; @@ -69,59 +70,54 @@ public class CTripHotelRecordBase implements Serializable { private BigDecimal averageRoomPrice; - public static CTripHotelRecordBase changeInfo(OrderHotelResponse.SettlementDetail SettlementDetail) { CTripHotelRecordBase ctripHotelOrderDetail = new CTripHotelRecordBase(); - if (SettlementDetail != null){ - ctripHotelOrderDetail.setRecordId(SettlementDetail.getRecordId()); - ctripHotelOrderDetail.setOrderId(SettlementDetail.getOrderID()); - ctripHotelOrderDetail.setAccountId(SettlementDetail.getAccountId()); - ctripHotelOrderDetail.setUid(SettlementDetail.getUid()); - ctripHotelOrderDetail.setDetailType(SettlementDetail.getDetailType()); - ctripHotelOrderDetail.setPayType(SettlementDetail.getPayType()); - ctripHotelOrderDetail.setHotelType(SettlementDetail.getHotelType()); - ctripHotelOrderDetail.setPrice(SettlementDetail.getPrice()); - ctripHotelOrderDetail.setQuantity(SettlementDetail.getQuantity()); - ctripHotelOrderDetail.setAmount(SettlementDetail.getAmount()); - ctripHotelOrderDetail.setServiceFee(SettlementDetail.getServicefee()); - ctripHotelOrderDetail.setExtraCharge(SettlementDetail.getExtraCharge()); - ctripHotelOrderDetail.setAccCheckBatchNo(SettlementDetail.getAccCheckBatchNo()); - ctripHotelOrderDetail.setCreateTime(SettlementDetail.getCreatetime()); - ctripHotelOrderDetail.setDatachangeLasttime(SettlementDetail.getDatachange_Lasttime()); - ctripHotelOrderDetail.setOrderType(SettlementDetail.getOrderType()); - ctripHotelOrderDetail.setSubAccCheckBatchNo(SettlementDetail.getSubAccCheckBatchNo()); - ctripHotelOrderDetail.setTripId(SettlementDetail.getTripID()); - ctripHotelOrderDetail.setSettlementCurrency(SettlementDetail.getSettlementCurrency()); - ctripHotelOrderDetail.setIsChecked(SettlementDetail.isIsChecked()); + ctripHotelOrderDetail.setRecordId(SettlementDetail.getRecordId()); + ctripHotelOrderDetail.setOrderId(SettlementDetail.getOrderID()); + ctripHotelOrderDetail.setAccountId(SettlementDetail.getAccountId()); + ctripHotelOrderDetail.setUid(SettlementDetail.getUid()); + ctripHotelOrderDetail.setDetailType(SettlementDetail.getDetailType()); + ctripHotelOrderDetail.setPayType(SettlementDetail.getPayType()); + ctripHotelOrderDetail.setHotelType(SettlementDetail.getHotelType()); + ctripHotelOrderDetail.setPrice(SettlementDetail.getPrice()); + ctripHotelOrderDetail.setQuantity(SettlementDetail.getQuantity()); + ctripHotelOrderDetail.setAmount(SettlementDetail.getAmount()); + ctripHotelOrderDetail.setServiceFee(SettlementDetail.getServicefee()); + ctripHotelOrderDetail.setExtraCharge(SettlementDetail.getExtraCharge()); + ctripHotelOrderDetail.setAccCheckBatchNo(SettlementDetail.getAccCheckBatchNo()); + ctripHotelOrderDetail.setCreateTime(SettlementDetail.getCreatetime()); + ctripHotelOrderDetail.setDatachangeLasttime(SettlementDetail.getDatachange_Lasttime()); + ctripHotelOrderDetail.setOrderType(SettlementDetail.getOrderType()); + ctripHotelOrderDetail.setSubAccCheckBatchNo(SettlementDetail.getSubAccCheckBatchNo()); + ctripHotelOrderDetail.setTripId(SettlementDetail.getTripID()); + ctripHotelOrderDetail.setSettlementCurrency(SettlementDetail.getSettlementCurrency()); + ctripHotelOrderDetail.setIsChecked(SettlementDetail.isIsChecked()); // ctripHotelOrderDetailis.setDailyAvgPriceInfo(SettlementDetail.getDailyAvgPriceInfo()); // ctripHotelOrderDetailis.setInvoiceIds(SettlementDetail.getInvoiceIds()); - ctripHotelOrderDetail.setBatchStartDate(SettlementDetail.getBatchStartDate()); - ctripHotelOrderDetail.setBatchEndDate(SettlementDetail.getBatchEndDate()); - ctripHotelOrderDetail.setFrontendServiceFee(SettlementDetail.getFrontendServiceFee()); - ctripHotelOrderDetail.setCoupon(SettlementDetail.getCoupon()); - ctripHotelOrderDetail.setRelatedCostsId(SettlementDetail.getRelatedCostsID()); - ctripHotelOrderDetail.setApportionMode(SettlementDetail.getApportionMode()); - ctripHotelOrderDetail.setOrderRoomMode(SettlementDetail.getOrderRoomMode()); - ctripHotelOrderDetail.setClientApprovalNo(SettlementDetail.getClientApprovalNo()); - ctripHotelOrderDetail.setFellowApprovalNo(SettlementDetail.getFellowApprovalNo()); - ctripHotelOrderDetail.setLoanServiceFee(SettlementDetail.getLoanServiceFee()); - ctripHotelOrderDetail.setClientName(SettlementDetail.getClientName()); - ctripHotelOrderDetail.setEmployeeId(SettlementDetail.getEmployeeID()); - ctripHotelOrderDetail.setInsuranceAmount(SettlementDetail.getInsuranceAmount()); - ctripHotelOrderDetail.setPersonAmount(SettlementDetail.getPersonAmount()); - ctripHotelOrderDetail.setChannelFee(SettlementDetail.getChannelFee()); - ctripHotelOrderDetail.setPersonalChannelFee(SettlementDetail.getPersonalChannelFee()); - ctripHotelOrderDetail.setPaidAmount(SettlementDetail.getPaidAmount()); - ctripHotelOrderDetail.setPersonalTotalAmount(SettlementDetail.getPersonalTotalAmount()); - ctripHotelOrderDetail.setPersonalRemittedTax(SettlementDetail.getPersonalRemittedTax()); - ctripHotelOrderDetail.setBookServiceFee(SettlementDetail.getBookServiceFee()); - ctripHotelOrderDetail.setModifyServiceFee(SettlementDetail.getModifyServiceFee()); - ctripHotelOrderDetail.setCancelServiceFee(SettlementDetail.getCancelServiceFee()); - ctripHotelOrderDetail.setPayDiscountAmount(SettlementDetail.getPayDiscountAmount()); - ctripHotelOrderDetail.setAverageRoomPrice(SettlementDetail.getAverageRoomPrice()); - return ctripHotelOrderDetail; - } - return null; - + ctripHotelOrderDetail.setBatchStartDate(SettlementDetail.getBatchStartDate()); + ctripHotelOrderDetail.setBatchEndDate(SettlementDetail.getBatchEndDate()); + ctripHotelOrderDetail.setFrontendServiceFee(SettlementDetail.getFrontendServiceFee()); + ctripHotelOrderDetail.setCoupon(SettlementDetail.getCoupon()); + ctripHotelOrderDetail.setRelatedCostsId(SettlementDetail.getRelatedCostsID()); + ctripHotelOrderDetail.setApportionMode(SettlementDetail.getApportionMode()); + ctripHotelOrderDetail.setOrderRoomMode(SettlementDetail.getOrderRoomMode()); + ctripHotelOrderDetail.setClientApprovalNo(SettlementDetail.getClientApprovalNo()); + ctripHotelOrderDetail.setFellowApprovalNo(SettlementDetail.getFellowApprovalNo()); + ctripHotelOrderDetail.setLoanServiceFee(SettlementDetail.getLoanServiceFee()); + ctripHotelOrderDetail.setClientName(SettlementDetail.getClientName()); + ctripHotelOrderDetail.setEmployeeId(SettlementDetail.getEmployeeID()); + ctripHotelOrderDetail.setInsuranceAmount(SettlementDetail.getInsuranceAmount()); + ctripHotelOrderDetail.setPersonAmount(SettlementDetail.getPersonAmount()); + ctripHotelOrderDetail.setChannelFee(SettlementDetail.getChannelFee()); + ctripHotelOrderDetail.setPersonalChannelFee(SettlementDetail.getPersonalChannelFee()); + ctripHotelOrderDetail.setPaidAmount(SettlementDetail.getPaidAmount()); + ctripHotelOrderDetail.setPersonalTotalAmount(SettlementDetail.getPersonalTotalAmount()); + ctripHotelOrderDetail.setPersonalRemittedTax(SettlementDetail.getPersonalRemittedTax()); + ctripHotelOrderDetail.setBookServiceFee(SettlementDetail.getBookServiceFee()); + ctripHotelOrderDetail.setModifyServiceFee(SettlementDetail.getModifyServiceFee()); + ctripHotelOrderDetail.setCancelServiceFee(SettlementDetail.getCancelServiceFee()); + ctripHotelOrderDetail.setPayDiscountAmount(SettlementDetail.getPayDiscountAmount()); + ctripHotelOrderDetail.setAverageRoomPrice(SettlementDetail.getAverageRoomPrice()); + return ctripHotelOrderDetail; } } diff --git a/src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripTrainInfo.java b/src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripTrainInfo.java new file mode 100644 index 00000000..987ba51f --- /dev/null +++ b/src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripTrainInfo.java @@ -0,0 +1,74 @@ +package com.chint.domain.aggregates.order.order_record.ctrip_order_record; + +import cn.hutool.core.bean.BeanUtil; +import com.chint.interfaces.rest.ctrip.dto.order.OrderHotelResponse; +import com.chint.interfaces.rest.ctrip.dto.order.OrderTrainResponse; +import lombok.Data; +import org.springframework.data.annotation.Id; +import org.springframework.data.relational.core.mapping.Table; + +import java.io.Serial; +import java.io.Serializable; +import java.util.List; + +@Data +@Table("c_trip_train_info") +public class CTripTrainInfo implements Serializable { + @Serial + private static final long serialVersionUID = 3282323171110442253L; + @Id + private Long id; + private Long cTripTrainRecordId; + private long TicketInfoID; + private String TrainName; + private String FirstSeatTypeName; + private String TrainType; + private String DepartureCityName; + private String DepartureDate; + private String DepartureStationName; + private String DepartureStationEn; + private String ArrivalCityName; + private String ArrivalDate; + private String ArrivalStationName; + private String ArrivalStationEn; + private String ElectronicOrderNo; + private int CustomType; + private String CustomDetail; + private String TrainTicketType; +// private List TrainSeatPriceData; + private String ChangeStatus; + private double DealTicketPrice; + private double RebRefEstimateAmount; + private int DepartureCityID; + private String DepartureDistrictCode; + private int ArrivalCityID; + private String ArrivalDistrictCode; + private String ChangeCode; + private String DealSeatNo; + private String DealSeatName; + private long DepartureProvinceId; + private String DepartureProvinceName; + private long DepartureLocationId; + private String DepartureLocationName; + private int DepartureLocationCategoryId; + private long ArrivalProvinceId; + private String ArrivalProvinceName; + private long ArrivalLocationId; + private String ArrivalLocationName; + private int ArrivalLocationCategoryId; + private int Sequence; + private String RefundreasonCode; + private String RefundreasonCodeDesc; + private String IssueTicketTime; + private String RebookTicketSuccessTime; + private String RefundTicketSuccessTime; + private String ChangePreApprovalId; + private String RefundApprovalId; +// private OrderTrainResponse.StandardGeoInfo StandardGeoInfo; + private String ChangeDescription; + + + public static CTripTrainInfo of(OrderTrainResponse.CorpTrainSettlementTicketDetail data) { + return BeanUtil.copyProperties(data, CTripTrainInfo.class); + } +} diff --git a/src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripTrainRecord.java b/src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripTrainRecord.java new file mode 100644 index 00000000..51394228 --- /dev/null +++ b/src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripTrainRecord.java @@ -0,0 +1,31 @@ +package com.chint.domain.aggregates.order.order_record.ctrip_order_record; + +import lombok.Data; +import org.springframework.data.annotation.Id; +import org.springframework.data.relational.core.mapping.MappedCollection; +import org.springframework.data.relational.core.mapping.Table; + +import java.io.Serial; +import java.io.Serializable; + +@Data +@Table("c_trip_train_record") +public class CTripTrainRecord implements Serializable { + @Serial + private static final long serialVersionUID = 4087333423450684513L; + @Id + private Long id; + private String recordId; + @MappedCollection(idColumn = "c_trip_train_record_id") + private CTripTrainRecordBase cTripTrainRecordBase; + @MappedCollection(idColumn = "c_trip_train_record_id") + private CTripTrainInfo cTripTrainInfo; + + public static CTripTrainRecord of(CTripTrainRecordBase cTripTrainRecordBase, CTripTrainInfo cTripTrainInfo) { + CTripTrainRecord cTripTrainRecord = new CTripTrainRecord(); + cTripTrainRecord.setRecordId(String.valueOf(cTripTrainRecordBase.getRecordId())); + cTripTrainRecord.setCTripTrainRecordBase(cTripTrainRecordBase); + cTripTrainRecord.setCTripTrainInfo(cTripTrainInfo); + return cTripTrainRecord; + } +} diff --git a/src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripTrainRecordBase.java b/src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripTrainRecordBase.java index 706f6e2f..ceb04934 100644 --- a/src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripTrainRecordBase.java +++ b/src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripTrainRecordBase.java @@ -21,6 +21,7 @@ public class CTripTrainRecordBase implements Serializable { private static final long serialVersionUID = 1642492804808714974L; @Id private Long id; + private Long cTripTrainRecordId; private Long recordId; private Long orderId; private String corpId; @@ -78,65 +79,64 @@ public class CTripTrainRecordBase implements Serializable { public static CTripTrainRecordBase changeInfo(OrderTrainResponse.CorpTrainSettlementDetail trainSettlementDetail) { CTripTrainRecordBase ctripTrainOrderDetail = new CTripTrainRecordBase(); - if (trainSettlementDetail != null){ - ctripTrainOrderDetail.setRecordId(trainSettlementDetail.getRecordID()); - ctripTrainOrderDetail.setOrderId(trainSettlementDetail.getOrderID()); - ctripTrainOrderDetail.setCorpId(trainSettlementDetail.getCorpId()); - ctripTrainOrderDetail.setAccountId(trainSettlementDetail.getAccountID()); - ctripTrainOrderDetail.setUid(trainSettlementDetail.getUID()); - ctripTrainOrderDetail.setDetailType(trainSettlementDetail.getDetailType()); - ctripTrainOrderDetail.setPassengerName(trainSettlementDetail.getPassengerName()); - ctripTrainOrderDetail.setPrice(trainSettlementDetail.getPrice()); - ctripTrainOrderDetail.setServerFee(trainSettlementDetail.getServerFee()); - ctripTrainOrderDetail.setCancelFee(trainSettlementDetail.getCancelFee()); - ctripTrainOrderDetail.setInsureFee(trainSettlementDetail.getInsureFee()); - ctripTrainOrderDetail.setPaperTicketFee(trainSettlementDetail.getPaperTicketFee()); - ctripTrainOrderDetail.setDeliverFee(trainSettlementDetail.getDeliverFee()); - ctripTrainOrderDetail.setReBookingServiceFee(trainSettlementDetail.getReBookingServiceFee()); - ctripTrainOrderDetail.setRealAmount(trainSettlementDetail.getRealAmount()); - ctripTrainOrderDetail.setBatchNo(trainSettlementDetail.getBatchNo()); - ctripTrainOrderDetail.setSettlementType(trainSettlementDetail.getSettlementType()); - ctripTrainOrderDetail.setCreateTime(trainSettlementDetail.getCreatetime()); - ctripTrainOrderDetail.setChangeLastTime(trainSettlementDetail.getChangeLasttime()); - ctripTrainOrderDetail.setOrderType(trainSettlementDetail.getOrderType()); - ctripTrainOrderDetail.setSubAccCheckBatchNo(trainSettlementDetail.getSubAccCheckBatchNo()); - ctripTrainOrderDetail.setTripId(trainSettlementDetail.getTripID()); - ctripTrainOrderDetail.setSettlementCurrency(trainSettlementDetail.getSettlementCurrency()); - ctripTrainOrderDetail.setGrabServiceFee(trainSettlementDetail.getGrabServiceFee()); - ctripTrainOrderDetail.setPostServiceFee(trainSettlementDetail.getPostServiceFee()); - ctripTrainOrderDetail.setRealAmountHasPost(trainSettlementDetail.getRealAmountHasPost()); - ctripTrainOrderDetail.setIsChecked(trainSettlementDetail.isIsChecked()); - ctripTrainOrderDetail.setSubDetailType(trainSettlementDetail.getSubDetailType()); -// ctripTrainOrderDetailis.setInvoiceIds(trainSettlementDetail.getInvoiceIds()); - ctripTrainOrderDetail.setBatchStartDate(trainSettlementDetail.getBatchStartDate()); - ctripTrainOrderDetail.setBatchEndDate(trainSettlementDetail.getBatchEndDate()); - ctripTrainOrderDetail.setAfterTakeTicketFee(trainSettlementDetail.getAfterTakeTicketFee()); - ctripTrainOrderDetail.setEstimatePrice(trainSettlementDetail.getEstimatePrice()); - ctripTrainOrderDetail.setEstimaAmount(trainSettlementDetail.getEstimaAmount()); - ctripTrainOrderDetail.setPurchaseFee(trainSettlementDetail.getPurchaseFee()); - ctripTrainOrderDetail.setPayMixFlag(trainSettlementDetail.isPayMixFlag()); - ctripTrainOrderDetail.setPersonalPayTicketFee(trainSettlementDetail.getPersonalPayTicketFee()); - ctripTrainOrderDetail.setPersonalPayServiceFee(trainSettlementDetail.getPersonalPayServiceFee()); - ctripTrainOrderDetail.setPersonalPayOtherFee(trainSettlementDetail.getPersonalPayOtherFee()); - ctripTrainOrderDetail.setTrainChangePrice(trainSettlementDetail.getTrainChangePrice()); - ctripTrainOrderDetail.setTrainOtherFee(trainSettlementDetail.getTrainOtherFee()); - ctripTrainOrderDetail.setDealTime(trainSettlementDetail.getDealTime()); - ctripTrainOrderDetail.setProductType(trainSettlementDetail.getProductType()); - ctripTrainOrderDetail.setDepartureCountry(trainSettlementDetail.getDepartureCountry()); - ctripTrainOrderDetail.setArrivalCountry(trainSettlementDetail.getArrivalCountry()); - ctripTrainOrderDetail.setSequence(trainSettlementDetail.getSequence()); - ctripTrainOrderDetail.setLoanServiceFee(trainSettlementDetail.getLoanServiceFee()); - ctripTrainOrderDetail.setIntlIssueTicketFee(trainSettlementDetail.getIntlIssueTicketFee()); - ctripTrainOrderDetail.setDeductibleTax(trainSettlementDetail.getDeductibleTax()); - ctripTrainOrderDetail.setNotIncludeTaxPrice(trainSettlementDetail.getNotIncludeTaxPrice()); - ctripTrainOrderDetail.setOnsiteRefundFlag(trainSettlementDetail.isOnsiteRefundFlag()); - ctripTrainOrderDetail.setTicketPrice(trainSettlementDetail.getTicketPrice()); - ctripTrainOrderDetail.setRefundTicketServiceFee(trainSettlementDetail.getRefundTicketServiceFee()); - return ctripTrainOrderDetail; + ctripTrainOrderDetail.setRecordId(trainSettlementDetail.getRecordID()); + ctripTrainOrderDetail.setOrderId(trainSettlementDetail.getOrderID()); + ctripTrainOrderDetail.setCorpId(trainSettlementDetail.getCorpId()); + ctripTrainOrderDetail.setAccountId(trainSettlementDetail.getAccountID()); + ctripTrainOrderDetail.setUid(trainSettlementDetail.getUID()); + ctripTrainOrderDetail.setDetailType(trainSettlementDetail.getDetailType()); + ctripTrainOrderDetail.setPassengerName(trainSettlementDetail.getPassengerName()); + ctripTrainOrderDetail.setPrice(trainSettlementDetail.getPrice()); + ctripTrainOrderDetail.setServerFee(trainSettlementDetail.getServerFee()); + ctripTrainOrderDetail.setCancelFee(trainSettlementDetail.getCancelFee()); + ctripTrainOrderDetail.setInsureFee(trainSettlementDetail.getInsureFee()); + ctripTrainOrderDetail.setPaperTicketFee(trainSettlementDetail.getPaperTicketFee()); + ctripTrainOrderDetail.setDeliverFee(trainSettlementDetail.getDeliverFee()); + ctripTrainOrderDetail.setReBookingServiceFee(trainSettlementDetail.getReBookingServiceFee()); + ctripTrainOrderDetail.setRealAmount(trainSettlementDetail.getRealAmount()); + ctripTrainOrderDetail.setBatchNo(trainSettlementDetail.getBatchNo()); + ctripTrainOrderDetail.setSettlementType(trainSettlementDetail.getSettlementType()); + ctripTrainOrderDetail.setCreateTime(trainSettlementDetail.getCreatetime()); + ctripTrainOrderDetail.setChangeLastTime(trainSettlementDetail.getChangeLasttime()); + ctripTrainOrderDetail.setOrderType(trainSettlementDetail.getOrderType()); + ctripTrainOrderDetail.setSubAccCheckBatchNo(trainSettlementDetail.getSubAccCheckBatchNo()); + ctripTrainOrderDetail.setTripId(trainSettlementDetail.getTripID()); + ctripTrainOrderDetail.setSettlementCurrency(trainSettlementDetail.getSettlementCurrency()); + ctripTrainOrderDetail.setGrabServiceFee(trainSettlementDetail.getGrabServiceFee()); + ctripTrainOrderDetail.setPostServiceFee(trainSettlementDetail.getPostServiceFee()); + ctripTrainOrderDetail.setRealAmountHasPost(trainSettlementDetail.getRealAmountHasPost()); + ctripTrainOrderDetail.setIsChecked(trainSettlementDetail.isIsChecked()); + ctripTrainOrderDetail.setSubDetailType(trainSettlementDetail.getSubDetailType()); +// ctripTrainOrderDetailis.setInvoiceIds(trainSettlementDetail.getInvoiceIds()); + ctripTrainOrderDetail.setBatchStartDate(trainSettlementDetail.getBatchStartDate()); + ctripTrainOrderDetail.setBatchEndDate(trainSettlementDetail.getBatchEndDate()); + ctripTrainOrderDetail.setAfterTakeTicketFee(trainSettlementDetail.getAfterTakeTicketFee()); + ctripTrainOrderDetail.setEstimatePrice(trainSettlementDetail.getEstimatePrice()); + ctripTrainOrderDetail.setEstimaAmount(trainSettlementDetail.getEstimaAmount()); + ctripTrainOrderDetail.setPurchaseFee(trainSettlementDetail.getPurchaseFee()); + ctripTrainOrderDetail.setPayMixFlag(trainSettlementDetail.isPayMixFlag()); + ctripTrainOrderDetail.setPersonalPayTicketFee(trainSettlementDetail.getPersonalPayTicketFee()); + ctripTrainOrderDetail.setPersonalPayServiceFee(trainSettlementDetail.getPersonalPayServiceFee()); + ctripTrainOrderDetail.setPersonalPayOtherFee(trainSettlementDetail.getPersonalPayOtherFee()); + ctripTrainOrderDetail.setTrainChangePrice(trainSettlementDetail.getTrainChangePrice()); + ctripTrainOrderDetail.setTrainOtherFee(trainSettlementDetail.getTrainOtherFee()); + ctripTrainOrderDetail.setDealTime(trainSettlementDetail.getDealTime()); + ctripTrainOrderDetail.setProductType(trainSettlementDetail.getProductType()); + ctripTrainOrderDetail.setDepartureCountry(trainSettlementDetail.getDepartureCountry()); + ctripTrainOrderDetail.setArrivalCountry(trainSettlementDetail.getArrivalCountry()); + ctripTrainOrderDetail.setSequence(trainSettlementDetail.getSequence()); + ctripTrainOrderDetail.setLoanServiceFee(trainSettlementDetail.getLoanServiceFee()); + ctripTrainOrderDetail.setIntlIssueTicketFee(trainSettlementDetail.getIntlIssueTicketFee()); + ctripTrainOrderDetail.setDeductibleTax(trainSettlementDetail.getDeductibleTax()); + ctripTrainOrderDetail.setNotIncludeTaxPrice(trainSettlementDetail.getNotIncludeTaxPrice()); + ctripTrainOrderDetail.setOnsiteRefundFlag(trainSettlementDetail.isOnsiteRefundFlag()); + ctripTrainOrderDetail.setTicketPrice(trainSettlementDetail.getTicketPrice()); + ctripTrainOrderDetail.setRefundTicketServiceFee(trainSettlementDetail.getRefundTicketServiceFee()); + + return ctripTrainOrderDetail; // return BeanUtil.copyProperties(flightOrderSettlementBaseInfo,CtripFlightOrderDetail.class); - } - return null; + } } diff --git a/src/main/java/com/chint/domain/repository/CTripOrderDetailRepository.java b/src/main/java/com/chint/domain/repository/CTripOrderDetailRepository.java index 6b968033..69c40f5d 100644 --- a/src/main/java/com/chint/domain/repository/CTripOrderDetailRepository.java +++ b/src/main/java/com/chint/domain/repository/CTripOrderDetailRepository.java @@ -17,7 +17,6 @@ public interface CTripOrderDetailRepository { CTripFlightRecord save(CTripFlightRecord cTripFlightRecord); - void saveAll(List cTripFlightRecordList); CTripFlightRecordBase findFlightByRecordId(Long id); @@ -38,4 +37,8 @@ public interface CTripOrderDetailRepository { void saveAllCarRecord(List ctripCarOrderDetailList); CTripCarRecordBase findCarByRecordId(Long id); + void saveAllCTripFlightRecord(List cTripFlightRecordList); + void saveAllCTripHotelRecord(List cTripHotelRecordList); + void saveAllCTripTrainRecord(List cTripTrainRecordList); + void saveAllCTripCarRecord(List cTripCarRecordList); } diff --git a/src/main/java/com/chint/infrastructure/repository/CTripOrderDetailImpl.java b/src/main/java/com/chint/infrastructure/repository/CTripOrderDetailImpl.java index 114e88dd..a9aa924f 100644 --- a/src/main/java/com/chint/infrastructure/repository/CTripOrderDetailImpl.java +++ b/src/main/java/com/chint/infrastructure/repository/CTripOrderDetailImpl.java @@ -35,6 +35,16 @@ public class CTripOrderDetailImpl implements CTripOrderDetailRepository { @Autowired private JdbcCTripFlightRecordRepository jdbcCTripFlightRecordRepository; + @Autowired + private JdbcCTripCarRecordRepository jdbcCTripCarRecordRepository; + + @Autowired + private JdbcCTripHotelRecordRepository jdbcCTripHotelRecordRepository; + + @Autowired + private JdbcCTripTrainRecordRepository jdbcCTripTrainRecordRepository; + + @Override public CTripFlightRecordBase save(CTripFlightRecordBase ctripFlightOrderDetail) { return jdbcCtripFlightOrderDetailRepository.save(ctripFlightOrderDetail); @@ -50,10 +60,6 @@ public class CTripOrderDetailImpl implements CTripOrderDetailRepository { return jdbcCTripFlightRecordRepository.save(cTripFlightRecord); } - @Override - public void saveAll(List cTripFlightRecordList) { - jdbcCTripFlightRecordRepository.saveAll(cTripFlightRecordList); - } @Override public CTripFlightRecordBase findFlightByRecordId(Long recordId) { @@ -107,6 +113,26 @@ public class CTripOrderDetailImpl implements CTripOrderDetailRepository { public CTripCarRecordBase findCarByRecordId(Long recordId) { return jdbcCtripCarOrderDetailRepository.findByRecordId(recordId); } + + @Override + public void saveAllCTripFlightRecord(List cTripFlightRecordList) { + jdbcCTripFlightRecordRepository.saveAll(cTripFlightRecordList); + } + + @Override + public void saveAllCTripHotelRecord(List cTripHotelRecordList) { + jdbcCTripHotelRecordRepository.saveAll(cTripHotelRecordList); + } + + @Override + public void saveAllCTripTrainRecord(List cTripTrainRecordList) { + jdbcCTripTrainRecordRepository.saveAll(cTripTrainRecordList); + } + + @Override + public void saveAllCTripCarRecord(List cTripCarRecordList) { + jdbcCTripCarRecordRepository.saveAll(cTripCarRecordList); + } // // @Override // public Client findByClientId(String clientId){ diff --git a/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcCTripCarRecordRepository.java b/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcCTripCarRecordRepository.java new file mode 100644 index 00000000..abd3cb0d --- /dev/null +++ b/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcCTripCarRecordRepository.java @@ -0,0 +1,11 @@ +package com.chint.infrastructure.repository.jdbc; + +import com.chint.domain.aggregates.order.order_record.ctrip_order_record.CTripCarRecord; +import com.chint.domain.aggregates.order.order_record.ctrip_order_record.CTripCarRecordBase; +import com.chint.domain.aggregates.order.order_record.ctrip_order_record.CTripFlightRecordBase; +import org.springframework.data.repository.CrudRepository; +import org.springframework.stereotype.Repository; + +@Repository +public interface JdbcCTripCarRecordRepository extends CrudRepository { +} diff --git a/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcCTripHotelRecordRepository.java b/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcCTripHotelRecordRepository.java new file mode 100644 index 00000000..58a4c3ef --- /dev/null +++ b/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcCTripHotelRecordRepository.java @@ -0,0 +1,10 @@ +package com.chint.infrastructure.repository.jdbc; + +import com.chint.domain.aggregates.order.order_record.ctrip_order_record.CTripHotelRecord; +import com.chint.domain.aggregates.order.order_record.ctrip_order_record.CTripHotelRecordBase; +import org.springframework.data.repository.CrudRepository; +import org.springframework.stereotype.Repository; + +@Repository +public interface JdbcCTripHotelRecordRepository extends CrudRepository { +} diff --git a/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcCTripTrainRecordRepository.java b/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcCTripTrainRecordRepository.java new file mode 100644 index 00000000..5f64ecd0 --- /dev/null +++ b/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcCTripTrainRecordRepository.java @@ -0,0 +1,10 @@ +package com.chint.infrastructure.repository.jdbc; + +import com.chint.domain.aggregates.order.order_record.ctrip_order_record.CTripHotelRecord; +import com.chint.domain.aggregates.order.order_record.ctrip_order_record.CTripTrainRecord; +import org.springframework.data.repository.CrudRepository; +import org.springframework.stereotype.Repository; + +@Repository +public interface JdbcCTripTrainRecordRepository extends CrudRepository { +} diff --git a/src/main/java/com/chint/interfaces/rest/ctrip/order/CTripOrderRecordAutoSave.java b/src/main/java/com/chint/interfaces/rest/ctrip/order/CTripOrderRecordAutoSave.java index 1ddfc0ff..486e495f 100644 --- a/src/main/java/com/chint/interfaces/rest/ctrip/order/CTripOrderRecordAutoSave.java +++ b/src/main/java/com/chint/interfaces/rest/ctrip/order/CTripOrderRecordAutoSave.java @@ -44,7 +44,7 @@ public class CTripOrderRecordAutoSave { ), CTripFlightInfo.of(it.getOrderFlightInfo()) )) .toList(); - cTripOrderDetailRepository.saveAll(cTripFlightRecords); + cTripOrderDetailRepository.saveAllCTripFlightRecord(cTripFlightRecords); } } @@ -53,12 +53,14 @@ public class CTripOrderRecordAutoSave { OrderHotelResponse hotelOrder = cTripOrderDetailRequest.getHotelOrder(); List lstHtlSettlement = hotelOrder.getLstHtlSettlement(); if (lstHtlSettlement != null && !lstHtlSettlement.isEmpty()) { - List list = lstHtlSettlement.stream() + List list = lstHtlSettlement.stream() .flatMap(it -> it.getLstHotelSettlementDetail().stream()) - .map(OrderHotelResponse.LstHotelSettlementDetail::getSettlementDetail) - .map(CTripHotelRecordBase::changeInfo) + .map(it -> + CTripHotelRecord.of(CTripHotelRecordBase.changeInfo(it.getSettlementDetail()), + CTripHotelInfo.of(it.getHotelDetail())) + ) .toList(); - cTripOrderDetailRepository.saveAllHotelRecord(list); + cTripOrderDetailRepository.saveAllCTripHotelRecord(list); } } @@ -67,27 +69,28 @@ public class CTripOrderRecordAutoSave { OrderTrainResponse trainOrder = cTripOrderDetailRequest.getTrainOrder(); List lstTrainSettlement = trainOrder.getLstTrainSettlement(); if (lstTrainSettlement != null && !lstTrainSettlement.isEmpty()) { - List list = lstTrainSettlement.stream() + List list = lstTrainSettlement.stream() .flatMap(it -> it.getLstTrainSettlementDetail().stream()) - .map(OrderTrainResponse.CorpTrainSettlementInfo::getTrainSettlementDetail) - .map(CTripTrainRecordBase::changeInfo) + .map(it -> + CTripTrainRecord.of(CTripTrainRecordBase.changeInfo(it.getTrainSettlementDetail()), + CTripTrainInfo.of(it.getTrainSettlementTicket())) + ) .toList(); - cTripOrderDetailRepository.saveAllTrainRecord(list); + cTripOrderDetailRepository.saveAllCTripTrainRecord(list); } } - public void cTripCarRecordAutoSave() { OrderCarResponse carOrder = cTripOrderDetailRequest.getCarOrder(); List settlementList = carOrder.getCarOrderAccountSettlementList(); if (settlementList != null && !settlementList.isEmpty()) { - List list = settlementList.stream() + List list = settlementList.stream() .flatMap(it -> it.getCarSettlementDetailList().stream()) - .map(OrderCarResponse.CarOrderSettlementDetail::getSettlementBaseInfo) - .map(CTripCarRecordBase::changeInfo) + .map(it -> CTripCarRecord.of( + CTripCarRecordBase.changeInfo(it.getSettlementBaseInfo()), + CTripCarQuickInfo.of(it.getOrderDetail().getQuickProductInfo()))) .toList(); - cTripOrderDetailRepository.saveAllCarRecord(list); + cTripOrderDetailRepository.saveAllCTripCarRecord(list); } } - } From 8eb0c2dfc27c0bb568cc4126231f098a2a906e55 Mon Sep 17 00:00:00 2001 From: lulz1 Date: Thu, 28 Mar 2024 17:02:37 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E6=90=BA=E7=A8=8B?= =?UTF-8?q?=E7=BB=93=E7=AE=97=E6=95=B0=E6=8D=AE=E4=BF=9D=E5=AD=98=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../application/in/AutoWorkController.java | 2 +- .../ctrip_order_record/CTripCarRecord.java | 5 ++ .../CTripCarRecordBase.java | 4 +- .../ctrip_order_record/CTripFlightRecord.java | 6 ++ .../ctrip_order_record/CTripHotelInfo.java | 7 +- .../ctrip_order_record/CTripHotelRecord.java | 8 +- .../CTripHotelRecordBase.java | 45 ++++++----- .../ctrip_order_record/CTripTrainRecord.java | 5 ++ .../CTripOrderRecordExtensionFactory.java | 3 +- .../factoriy/ranks/RanksFactoryImpl.java | 8 +- .../CTripOrderDetailRepository.java | 6 ++ .../CompanyBlackListRepository.java | 2 + .../OrderFlightRecordRepository.java | 2 + .../domain/service/OrderDomainService.java | 13 +++- .../service/leg_event/LegEventHandler.java | 1 + .../order_sync/CTripOrderSyncAdapter.java | 9 ++- .../infrastructure/constant/RankConstant.java | 6 ++ .../repository/CTripOrderDetailImpl.java | 30 ++++++++ .../CompanyBlackListRepositoryImpl.java | 9 +++ .../OrderFlightRecordRepositoryImpl.java | 2 + .../jdbc/JdbcCTripCarRecordRepository.java | 1 + .../jdbc/JdbcCTripFlightRecordRepository.java | 2 + .../jdbc/JdbcCTripHotelRecordRepository.java | 1 + .../jdbc/JdbcCTripTrainRecordRepository.java | 1 + .../infrastructure/util/DateTimeUtil.java | 17 ++++- .../ctrip/dto/order/OrderCarResponse.java | 7 +- .../ctrip/order/CTripOrderRecordAutoSave.java | 76 ++++++++++++++----- 27 files changed, 215 insertions(+), 63 deletions(-) diff --git a/src/main/java/com/chint/application/in/AutoWorkController.java b/src/main/java/com/chint/application/in/AutoWorkController.java index 0e84d69e..7b4fb30f 100644 --- a/src/main/java/com/chint/application/in/AutoWorkController.java +++ b/src/main/java/com/chint/application/in/AutoWorkController.java @@ -41,7 +41,7 @@ public class AutoWorkController { public Result autoSaveCTripRecord() { cTripOrderRecordAutoSave.saveAll(); //将昨天的结算数据生成为财务共享需要的数据 - Command.of(OrderRecordGenerateCommand.class).sendToQueue(); +// Command.of(OrderRecordGenerateCommand.class).sendToQueue(); return Result.Success(SUCCESS); } 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 27f60b4f..e252843a 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 @@ -1,5 +1,6 @@ package com.chint.domain.aggregates.order.order_record.ctrip_order_record; +import com.chint.infrastructure.util.DateTimeUtil; import lombok.Data; import org.springframework.data.annotation.Id; import org.springframework.data.relational.core.mapping.MappedCollection; @@ -7,6 +8,7 @@ import org.springframework.data.relational.core.mapping.Table; import java.io.Serial; import java.io.Serializable; +import java.time.LocalDateTime; @Data @Table("c_trip_car_record") @@ -16,6 +18,8 @@ public class CTripCarRecord implements Serializable { @Id private Long id; private String recordId; + private LocalDateTime createTime; + private String routeOrderNo; @MappedCollection(idColumn = "c_trip_car_record_id") private CTripCarRecordBase cTripCarRecordBase; @MappedCollection(idColumn = "c_trip_car_record_id") @@ -26,6 +30,7 @@ public class CTripCarRecord implements Serializable { cTripCarRecord.setCTripCarQuickInfo(cTripCarQuickInfo); cTripCarRecord.setCTripCarRecordBase(cTripCarRecordBase); cTripCarRecord.setRecordId(String.valueOf(cTripCarRecordBase.getRecordId())); + cTripCarRecord.setCreateTime(DateTimeUtil.strToTime(cTripCarRecordBase.getCreateTime())); return cTripCarRecord; } } diff --git a/src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripCarRecordBase.java b/src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripCarRecordBase.java index 112885a6..6d458785 100644 --- a/src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripCarRecordBase.java +++ b/src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripCarRecordBase.java @@ -43,7 +43,7 @@ public class CTripCarRecordBase implements Serializable { private Double expressFee; private Integer orderType; private String subAccCheckBatchNo; - private Long tripId; + private String tripId; private String settlementCurrency; private Double postServiceFee; private Double realAmountHasPost; @@ -94,7 +94,7 @@ public class CTripCarRecordBase implements Serializable { ctripCarOrderDetail.setExpressFee(carOrderSettlementBaseInfo.getExpressFee()); ctripCarOrderDetail.setOrderType(carOrderSettlementBaseInfo.getOrderType()); ctripCarOrderDetail.setSubAccCheckBatchNo(carOrderSettlementBaseInfo.getSubAccCheckBatchNo()); - ctripCarOrderDetail.setTripId(carOrderSettlementBaseInfo.getTripID()); + ctripCarOrderDetail.setTripId( carOrderSettlementBaseInfo.getTripID()); ctripCarOrderDetail.setSettlementCurrency(carOrderSettlementBaseInfo.getSettlementCurrency()); ctripCarOrderDetail.setPostServiceFee(carOrderSettlementBaseInfo.getPostServiceFee()); ctripCarOrderDetail.setRealAmountHasPost(carOrderSettlementBaseInfo.getRealAmountHasPost()); 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 5597e65d..b52fbef5 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 @@ -1,16 +1,21 @@ package com.chint.domain.aggregates.order.order_record.ctrip_order_record; +import com.chint.infrastructure.util.DateTimeUtil; import lombok.Data; import org.springframework.data.annotation.Id; import org.springframework.data.relational.core.mapping.MappedCollection; import org.springframework.data.relational.core.mapping.Table; +import java.time.LocalDateTime; + @Data @Table("c_trip_flight_record") public class CTripFlightRecord { @Id private Long id; private String recordId; + public LocalDateTime createTime; + private String routeOrderNo; @MappedCollection(idColumn = "c_trip_flight_record_id") private CTripFlightRecordBase cTripFlightRecordBase; @MappedCollection(idColumn = "c_trip_flight_record_id") @@ -21,6 +26,7 @@ public class CTripFlightRecord { cTripFlightRecord.setCTripFlightRecordBase(cTripFlightRecordBase); cTripFlightRecord.setCTripFlightInfo(cTripFlightInfo); cTripFlightRecord.setRecordId(String.valueOf(cTripFlightRecordBase.getRecordId())); + cTripFlightRecord.setCreateTime(DateTimeUtil.strToTimeMM(cTripFlightRecordBase.getCreateTime())); return cTripFlightRecord; } } diff --git a/src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripHotelInfo.java b/src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripHotelInfo.java index 32822a7f..8944747b 100644 --- a/src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripHotelInfo.java +++ b/src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripHotelInfo.java @@ -1,7 +1,6 @@ package com.chint.domain.aggregates.order.order_record.ctrip_order_record; import cn.hutool.core.bean.BeanUtil; -import com.chint.interfaces.rest.ctrip.dto.order.OrderCarResponse; import com.chint.interfaces.rest.ctrip.dto.order.OrderHotelResponse; import lombok.Data; import org.springframework.data.annotation.Id; @@ -23,7 +22,7 @@ public class CTripHotelInfo implements Serializable { private String CityName; private String CityNameEN; private Integer Star; - private boolean IsDomestic; + private Integer IsDomestic; private String ISCU; private Integer CityID; private String DistrictCode; @@ -37,6 +36,8 @@ public class CTripHotelInfo implements Serializable { private String HotelGroupName; public static CTripHotelInfo of(OrderHotelResponse.SettlementHotelDetail data) { - return BeanUtil.copyProperties(data, CTripHotelInfo.class); + CTripHotelInfo cTripHotelInfo = BeanUtil.copyProperties(data, CTripHotelInfo.class); + cTripHotelInfo.setIsDomestic(data.isIsDomestic() ? 1 : 0); + return cTripHotelInfo; } } 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 25e081d4..3a668234 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 @@ -1,16 +1,21 @@ package com.chint.domain.aggregates.order.order_record.ctrip_order_record; +import com.chint.infrastructure.util.DateTimeUtil; import lombok.Data; import org.springframework.data.annotation.Id; import org.springframework.data.relational.core.mapping.MappedCollection; import org.springframework.data.relational.core.mapping.Table; +import java.time.LocalDateTime; + @Data -@Table("c_trip_flight_record") +@Table("c_trip_hotel_record") public class CTripHotelRecord { @Id private Long id; private String recordId; + private LocalDateTime createTime; + private String routeOrderNo; @MappedCollection(idColumn = "c_trip_hotel_record_id") private CTripHotelRecordBase cTripHotelRecordBase; @MappedCollection(idColumn = "c_trip_hotel_record_id") @@ -21,6 +26,7 @@ public class CTripHotelRecord { cTripHotelRecord.setRecordId(String.valueOf(cTripHotelRecordBase.getRecordId())); cTripHotelRecord.setCTripHotelRecordBase(cTripHotelRecordBase); cTripHotelRecord.setCTripHotelInfo(cTripHotelInfo); + cTripHotelRecord.setCreateTime(DateTimeUtil.strToTimeMM(cTripHotelRecordBase.getCreateTime())); return cTripHotelRecord; } } diff --git a/src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripHotelRecordBase.java b/src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripHotelRecordBase.java index 18040ffc..e9e1052b 100644 --- a/src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripHotelRecordBase.java +++ b/src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripHotelRecordBase.java @@ -7,7 +7,6 @@ import org.springframework.data.relational.core.mapping.Table; import java.io.Serial; import java.io.Serializable; -import java.math.BigDecimal; /** * @author wanglf3 @@ -41,7 +40,7 @@ public class CTripHotelRecordBase implements Serializable { private String subAccCheckBatchNo; private Long tripId; private String settlementCurrency; - private Boolean isChecked; + private Integer isChecked; private String dailyAvgPriceInfo; private String invoiceIds; private String batchStartDate; @@ -58,16 +57,16 @@ public class CTripHotelRecordBase implements Serializable { private String employeeId; private Double insuranceAmount; private Double personAmount; - private BigDecimal channelFee; - private BigDecimal personalChannelFee; - private BigDecimal paidAmount; - private BigDecimal personalTotalAmount; - private BigDecimal personalRemittedTax; - private BigDecimal bookServiceFee; - private BigDecimal modifyServiceFee; - private BigDecimal cancelServiceFee; - private BigDecimal payDiscountAmount; - private BigDecimal averageRoomPrice; + private String channelFee; + private String personalChannelFee; + private String paidAmount; + private String personalTotalAmount; + private String personalRemittedTax; + private String bookServiceFee; + private String modifyServiceFee; + private String cancelServiceFee; + private String payDiscountAmount; + private String averageRoomPrice; public static CTripHotelRecordBase changeInfo(OrderHotelResponse.SettlementDetail SettlementDetail) { @@ -91,7 +90,7 @@ public class CTripHotelRecordBase implements Serializable { ctripHotelOrderDetail.setSubAccCheckBatchNo(SettlementDetail.getSubAccCheckBatchNo()); ctripHotelOrderDetail.setTripId(SettlementDetail.getTripID()); ctripHotelOrderDetail.setSettlementCurrency(SettlementDetail.getSettlementCurrency()); - ctripHotelOrderDetail.setIsChecked(SettlementDetail.isIsChecked()); + ctripHotelOrderDetail.setIsChecked(SettlementDetail.isIsChecked() ? 1 : 0); // ctripHotelOrderDetailis.setDailyAvgPriceInfo(SettlementDetail.getDailyAvgPriceInfo()); // ctripHotelOrderDetailis.setInvoiceIds(SettlementDetail.getInvoiceIds()); ctripHotelOrderDetail.setBatchStartDate(SettlementDetail.getBatchStartDate()); @@ -108,16 +107,16 @@ public class CTripHotelRecordBase implements Serializable { ctripHotelOrderDetail.setEmployeeId(SettlementDetail.getEmployeeID()); ctripHotelOrderDetail.setInsuranceAmount(SettlementDetail.getInsuranceAmount()); ctripHotelOrderDetail.setPersonAmount(SettlementDetail.getPersonAmount()); - ctripHotelOrderDetail.setChannelFee(SettlementDetail.getChannelFee()); - ctripHotelOrderDetail.setPersonalChannelFee(SettlementDetail.getPersonalChannelFee()); - ctripHotelOrderDetail.setPaidAmount(SettlementDetail.getPaidAmount()); - ctripHotelOrderDetail.setPersonalTotalAmount(SettlementDetail.getPersonalTotalAmount()); - ctripHotelOrderDetail.setPersonalRemittedTax(SettlementDetail.getPersonalRemittedTax()); - ctripHotelOrderDetail.setBookServiceFee(SettlementDetail.getBookServiceFee()); - ctripHotelOrderDetail.setModifyServiceFee(SettlementDetail.getModifyServiceFee()); - ctripHotelOrderDetail.setCancelServiceFee(SettlementDetail.getCancelServiceFee()); - ctripHotelOrderDetail.setPayDiscountAmount(SettlementDetail.getPayDiscountAmount()); - ctripHotelOrderDetail.setAverageRoomPrice(SettlementDetail.getAverageRoomPrice()); + ctripHotelOrderDetail.setChannelFee(String.valueOf(SettlementDetail.getChannelFee())); + ctripHotelOrderDetail.setPersonalChannelFee(String.valueOf(SettlementDetail.getPersonalChannelFee())); + ctripHotelOrderDetail.setPaidAmount(String.valueOf(SettlementDetail.getPaidAmount())); + ctripHotelOrderDetail.setPersonalTotalAmount(String.valueOf(SettlementDetail.getPersonalTotalAmount())); + ctripHotelOrderDetail.setPersonalRemittedTax(String.valueOf(SettlementDetail.getPersonalRemittedTax())); + ctripHotelOrderDetail.setBookServiceFee(String.valueOf(SettlementDetail.getBookServiceFee())); + ctripHotelOrderDetail.setModifyServiceFee(String.valueOf(SettlementDetail.getModifyServiceFee())); + ctripHotelOrderDetail.setCancelServiceFee(String.valueOf(SettlementDetail.getCancelServiceFee())); + ctripHotelOrderDetail.setPayDiscountAmount(String.valueOf(SettlementDetail.getPayDiscountAmount())); + ctripHotelOrderDetail.setAverageRoomPrice(String.valueOf(SettlementDetail.getAverageRoomPrice())); return ctripHotelOrderDetail; } } diff --git a/src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripTrainRecord.java b/src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripTrainRecord.java index 51394228..2db57c72 100644 --- a/src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripTrainRecord.java +++ b/src/main/java/com/chint/domain/aggregates/order/order_record/ctrip_order_record/CTripTrainRecord.java @@ -1,5 +1,6 @@ package com.chint.domain.aggregates.order.order_record.ctrip_order_record; +import com.chint.infrastructure.util.DateTimeUtil; import lombok.Data; import org.springframework.data.annotation.Id; import org.springframework.data.relational.core.mapping.MappedCollection; @@ -7,6 +8,7 @@ import org.springframework.data.relational.core.mapping.Table; import java.io.Serial; import java.io.Serializable; +import java.time.LocalDateTime; @Data @Table("c_trip_train_record") @@ -16,6 +18,8 @@ public class CTripTrainRecord implements Serializable { @Id private Long id; private String recordId; + private LocalDateTime createTime; + private String routeOrderNo; @MappedCollection(idColumn = "c_trip_train_record_id") private CTripTrainRecordBase cTripTrainRecordBase; @MappedCollection(idColumn = "c_trip_train_record_id") @@ -26,6 +30,7 @@ public class CTripTrainRecord implements Serializable { cTripTrainRecord.setRecordId(String.valueOf(cTripTrainRecordBase.getRecordId())); cTripTrainRecord.setCTripTrainRecordBase(cTripTrainRecordBase); cTripTrainRecord.setCTripTrainInfo(cTripTrainInfo); + cTripTrainRecord.setCreateTime(DateTimeUtil.strToTimeMM(cTripTrainRecordBase.getCreateTime())); return cTripTrainRecord; } } diff --git a/src/main/java/com/chint/domain/factoriy/order_record/CTripOrderRecordExtensionFactory.java b/src/main/java/com/chint/domain/factoriy/order_record/CTripOrderRecordExtensionFactory.java index f5127470..a11d292f 100644 --- a/src/main/java/com/chint/domain/factoriy/order_record/CTripOrderRecordExtensionFactory.java +++ b/src/main/java/com/chint/domain/factoriy/order_record/CTripOrderRecordExtensionFactory.java @@ -8,6 +8,7 @@ import com.chint.domain.aggregates.order.order_record.OrderCarRecord; import com.chint.domain.aggregates.order.order_record.OrderFlightRecord; import com.chint.domain.aggregates.order.order_record.OrderHotelRecord; import com.chint.domain.aggregates.order.order_record.OrderTrainRecord; +import com.chint.domain.aggregates.order.order_record.ctrip_order_record.CTripCarRecord; import com.chint.domain.service.OrderDetailDomainService; import com.chint.infrastructure.repository.jdbc.JdbcCtripHotelOrderDetailRepository; import org.springframework.beans.factory.annotation.Autowired; @@ -23,7 +24,7 @@ public class CTripOrderRecordExtensionFactory implements OrderRecordExtensionFa @Override public OrderCarRecord createCarOrderRecord(Object orderCarRecordData) { - + CTripCarRecord orderCarRecord = (CTripCarRecord) orderCarRecordData; return null; } diff --git a/src/main/java/com/chint/domain/factoriy/ranks/RanksFactoryImpl.java b/src/main/java/com/chint/domain/factoriy/ranks/RanksFactoryImpl.java index 489133ba..d558edcc 100644 --- a/src/main/java/com/chint/domain/factoriy/ranks/RanksFactoryImpl.java +++ b/src/main/java/com/chint/domain/factoriy/ranks/RanksFactoryImpl.java @@ -35,10 +35,10 @@ public class RanksFactoryImpl implements RanksFactory { Integer level = ranksData.getLevel(); ranks.setStandardLevel( switch (level) { - case 1 -> prefix + RankConstant.STANDARD_LEVEL_ONE; - case 2 -> prefix + RankConstant.STANDARD_LEVEL_TWO; - case 3 -> prefix + RankConstant.STANDARD_LEVEL_THREE; - case 4 -> prefix + RankConstant.STANDARD_LEVEL_FOUR; + case 1 -> prefix + STANDARD_LEVEL_ONE_COMMON; + case 2 -> prefix + STANDARD_LEVEL_TWO_COMMON; + case 3 -> prefix + STANDARD_LEVEL_THREE_COMMON; + case 4 -> prefix + STANDARD_LEVEL_FOUR_COMMON; default -> throw new NotFoundException(CommonMessageConstant.NOT_FOUND); } ); diff --git a/src/main/java/com/chint/domain/repository/CTripOrderDetailRepository.java b/src/main/java/com/chint/domain/repository/CTripOrderDetailRepository.java index 69c40f5d..b43d66f5 100644 --- a/src/main/java/com/chint/domain/repository/CTripOrderDetailRepository.java +++ b/src/main/java/com/chint/domain/repository/CTripOrderDetailRepository.java @@ -38,7 +38,13 @@ public interface CTripOrderDetailRepository { CTripCarRecordBase findCarByRecordId(Long id); void saveAllCTripFlightRecord(List cTripFlightRecordList); + CTripFlightRecord findFlightRecordById(Long id); + CTripFlightRecord findFlightRecordByRecordId(String recordId); void saveAllCTripHotelRecord(List cTripHotelRecordList); + CTripHotelRecord findHotelRecordById(Long id); + CTripHotelRecord findHotelRecordByRecordId(String recordId); void saveAllCTripTrainRecord(List cTripTrainRecordList); + CTripTrainRecord findTrainRecordByRecordId(String recordId); void saveAllCTripCarRecord(List cTripCarRecordList); + CTripCarRecord findCarRecordByRecordId(String recordId); } diff --git a/src/main/java/com/chint/domain/repository/CompanyBlackListRepository.java b/src/main/java/com/chint/domain/repository/CompanyBlackListRepository.java index 92004f61..09e11be5 100644 --- a/src/main/java/com/chint/domain/repository/CompanyBlackListRepository.java +++ b/src/main/java/com/chint/domain/repository/CompanyBlackListRepository.java @@ -9,4 +9,6 @@ public interface CompanyBlackListRepository { CompanyBlackList findByCompanyName(String companyName); List findAll(); + + Boolean ifInCompanyList(String companyName); } diff --git a/src/main/java/com/chint/domain/repository/OrderFlightRecordRepository.java b/src/main/java/com/chint/domain/repository/OrderFlightRecordRepository.java index f73dd606..c7d47ebd 100644 --- a/src/main/java/com/chint/domain/repository/OrderFlightRecordRepository.java +++ b/src/main/java/com/chint/domain/repository/OrderFlightRecordRepository.java @@ -6,4 +6,6 @@ import java.util.List; public interface OrderFlightRecordRepository { List saveAll(List orderFlightRecordList); + + } diff --git a/src/main/java/com/chint/domain/service/OrderDomainService.java b/src/main/java/com/chint/domain/service/OrderDomainService.java index 07fe8b27..6836149d 100644 --- a/src/main/java/com/chint/domain/service/OrderDomainService.java +++ b/src/main/java/com/chint/domain/service/OrderDomainService.java @@ -113,7 +113,6 @@ public class OrderDomainService { @Autowired private JdbcLegRepository jdbcLegRepository; - private Set companyBlackList = new HashSet<>(); public RouteOrder saveOrder(RouteOrder routeOrder) { @@ -130,7 +129,7 @@ public class OrderDomainService { } public boolean checkCompanyNameIfBlack(String companyName) { - if (companyBlackList.contains(companyName)) { + if (companyBlackListRepository.ifInCompanyList(companyName)) { throw new OrderException(COMPANY_NAME_IN_BLACK_LIST); } else { return true; @@ -197,6 +196,16 @@ public class OrderDomainService { ApprovalSimpleData data = command.getData(); Optional.ofNullable(routeRepository.findByActualOrderNoAndSysCode(data.getActualOrderNo(), data.getSysCode())) .ifPresentOrElse(route -> { + //保存提交审批所提供的资料 + ApproveOrderNo approveOrderNo = route.getApproveOrderNo(); + approveOrderNo.setActualOrderNo(data.getActualOrderNo()); + approveOrderNo.setInstructions(data.getInstructions()); + approveOrderNo.setCreator(data.getCreator()); + approveOrderNo.setAccountCompanyName(data.getAccountCompany()); + approveOrderNo.setAccountCompanyCode(data.getAccountCompanyCode()); + approveOrderNo.setProjectName(data.getProjectName()); + approveOrderNo.setCostCenter(data.getCostCenter()); + LegEvent legEvent = legEventFactory.creatLegEvent(command.getLegEventType()); route.getLegItems().forEach(leg -> leg.addEvent(legEvent)); ApprovalEvent approvalEvent = routeOrderFactory.createApprovalEvent(APPROVAL_EVENT_ING); diff --git a/src/main/java/com/chint/domain/service/leg_event/LegEventHandler.java b/src/main/java/com/chint/domain/service/leg_event/LegEventHandler.java index 1a5b145c..87148a89 100644 --- a/src/main/java/com/chint/domain/service/leg_event/LegEventHandler.java +++ b/src/main/java/com/chint/domain/service/leg_event/LegEventHandler.java @@ -114,6 +114,7 @@ public class LegEventHandler implements LegEventService { approveOrderNo.setActualOrderNo(data.getActualOrderNo()); approveOrderNo.setInstructions(data.getInstructions()); approveOrderNo.setCreator(data.getCreator()); + approveOrderNo.setAccountCompanyName(data.getAccountCompany()); approveOrderNo.setAccountCompanyCode(data.getAccountCompanyCode()); approveOrderNo.setProjectName(data.getProjectName()); approveOrderNo.setCostCenter(data.getCostCenter()); diff --git a/src/main/java/com/chint/domain/service/order_sync/CTripOrderSyncAdapter.java b/src/main/java/com/chint/domain/service/order_sync/CTripOrderSyncAdapter.java index 6279ed80..5eb285f2 100644 --- a/src/main/java/com/chint/domain/service/order_sync/CTripOrderSyncAdapter.java +++ b/src/main/java/com/chint/domain/service/order_sync/CTripOrderSyncAdapter.java @@ -28,6 +28,7 @@ import java.util.stream.Collectors; import static com.chint.infrastructure.constant.LegConstant.*; import static com.chint.infrastructure.constant.LocationConstant.LOCATION_LEVEL_COUNTY; +import static com.chint.infrastructure.constant.LocationConstant.LOCATION_TYPE_DISTRICT; @Slf4j @Component @@ -198,7 +199,13 @@ public class CTripOrderSyncAdapter implements SupplierOrderSync { } locationRepository.saveAll(List.of(location)); } + //这里的逻辑需要修改 , + // 如果是县级市的话 ,取CItyId , + // 如果是区的话 ,要查找地级市, 取地级市的Id , + // 如果是地级市的话 ,直接取地级市的ID + if (location.getLocationType().equals(LOCATION_TYPE_DISTRICT)) { + return locationRepository.findById(location.getParentLocationId()); + } return location; } - } diff --git a/src/main/java/com/chint/infrastructure/constant/RankConstant.java b/src/main/java/com/chint/infrastructure/constant/RankConstant.java index a44aa63d..fd073534 100644 --- a/src/main/java/com/chint/infrastructure/constant/RankConstant.java +++ b/src/main/java/com/chint/infrastructure/constant/RankConstant.java @@ -29,6 +29,12 @@ public class RankConstant { public static final String ALTER_APPLY = "3";//变更 + //集团差标等级 + public static final String STANDARD_LEVEL_ONE_COMMON = "STANDARD_LEVEL_ONE";//差标1 + public static final String STANDARD_LEVEL_TWO_COMMON = "STANDARD_LEVEL_TWO";//差标2 + public static final String STANDARD_LEVEL_THREE_COMMON = "STANDARD_LEVEL_THREE";//差标3 + public static final String STANDARD_LEVEL_FOUR_COMMON = "STANDARD_LEVEL_FOUR";//差标4 + //集团差标等级 public static final String STANDARD_LEVEL_ONE = "JT_STANDARD_LEVEL_ONE";//差标1 public static final String STANDARD_LEVEL_TWO = "JT_STANDARD_LEVEL_TWO";//差标2 diff --git a/src/main/java/com/chint/infrastructure/repository/CTripOrderDetailImpl.java b/src/main/java/com/chint/infrastructure/repository/CTripOrderDetailImpl.java index a9aa924f..ab6568e1 100644 --- a/src/main/java/com/chint/infrastructure/repository/CTripOrderDetailImpl.java +++ b/src/main/java/com/chint/infrastructure/repository/CTripOrderDetailImpl.java @@ -119,20 +119,50 @@ public class CTripOrderDetailImpl implements CTripOrderDetailRepository { jdbcCTripFlightRecordRepository.saveAll(cTripFlightRecordList); } + @Override + public CTripFlightRecord findFlightRecordById(Long id) { + return jdbcCTripFlightRecordRepository.findById(id).get(); + } + + @Override + public CTripFlightRecord findFlightRecordByRecordId(String recordId) { + return jdbcCTripFlightRecordRepository.findByRecordId(recordId); + } + @Override public void saveAllCTripHotelRecord(List cTripHotelRecordList) { jdbcCTripHotelRecordRepository.saveAll(cTripHotelRecordList); } + @Override + public CTripHotelRecord findHotelRecordById(Long id) { + return jdbcCTripHotelRecordRepository.findById(id).get(); + } + + @Override + public CTripHotelRecord findHotelRecordByRecordId(String recordId) { + return jdbcCTripHotelRecordRepository.findByRecordId(recordId); + } + @Override public void saveAllCTripTrainRecord(List cTripTrainRecordList) { jdbcCTripTrainRecordRepository.saveAll(cTripTrainRecordList); } + @Override + public CTripTrainRecord findTrainRecordByRecordId(String recordId) { + return jdbcCTripTrainRecordRepository.findByRecordId(recordId); + } + @Override public void saveAllCTripCarRecord(List cTripCarRecordList) { jdbcCTripCarRecordRepository.saveAll(cTripCarRecordList); } + + @Override + public CTripCarRecord findCarRecordByRecordId(String recordId) { + return jdbcCTripCarRecordRepository.findByRecordId(recordId); + } // // @Override // public Client findByClientId(String clientId){ diff --git a/src/main/java/com/chint/infrastructure/repository/CompanyBlackListRepositoryImpl.java b/src/main/java/com/chint/infrastructure/repository/CompanyBlackListRepositoryImpl.java index 21e5209f..2d618803 100644 --- a/src/main/java/com/chint/infrastructure/repository/CompanyBlackListRepositoryImpl.java +++ b/src/main/java/com/chint/infrastructure/repository/CompanyBlackListRepositoryImpl.java @@ -4,6 +4,7 @@ import com.chint.domain.aggregates.system.CompanyBlackList; import com.chint.domain.repository.CompanyBlackListRepository; import com.chint.infrastructure.repository.jdbc.JdbcCompanyBlackListRepository; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.cache.annotation.Cacheable; import org.springframework.stereotype.Repository; import java.util.ArrayList; @@ -20,6 +21,7 @@ public class CompanyBlackListRepositoryImpl implements CompanyBlackListRepositor return jdbcCompanyBlackListRepository.findByCompanyName(companyName); } + @Cacheable(value = "CompanyBlack") @Override public List findAll() { List all = new ArrayList<>(); @@ -28,4 +30,11 @@ public class CompanyBlackListRepositoryImpl implements CompanyBlackListRepositor ); return all; } + + @Cacheable(value = "CompanyBlack", key = "#companyName") + @Override + public Boolean ifInCompanyList(String companyName) { + CompanyBlackList byCompanyName = jdbcCompanyBlackListRepository.findByCompanyName(companyName); + return byCompanyName != null; + } } diff --git a/src/main/java/com/chint/infrastructure/repository/OrderFlightRecordRepositoryImpl.java b/src/main/java/com/chint/infrastructure/repository/OrderFlightRecordRepositoryImpl.java index a1afff6e..92e4b59b 100644 --- a/src/main/java/com/chint/infrastructure/repository/OrderFlightRecordRepositoryImpl.java +++ b/src/main/java/com/chint/infrastructure/repository/OrderFlightRecordRepositoryImpl.java @@ -21,4 +21,6 @@ public class OrderFlightRecordRepositoryImpl implements OrderFlightRecordReposit jdbcOrderFlightRecordRepository.saveAll(orderFlightRecordList).forEach(res::add); return res; } + + } diff --git a/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcCTripCarRecordRepository.java b/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcCTripCarRecordRepository.java index abd3cb0d..6f2da842 100644 --- a/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcCTripCarRecordRepository.java +++ b/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcCTripCarRecordRepository.java @@ -8,4 +8,5 @@ import org.springframework.stereotype.Repository; @Repository public interface JdbcCTripCarRecordRepository extends CrudRepository { + CTripCarRecord findByRecordId(String recordId); } diff --git a/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcCTripFlightRecordRepository.java b/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcCTripFlightRecordRepository.java index 242a5121..8669cf7e 100644 --- a/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcCTripFlightRecordRepository.java +++ b/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcCTripFlightRecordRepository.java @@ -6,4 +6,6 @@ import org.springframework.stereotype.Repository; @Repository public interface JdbcCTripFlightRecordRepository extends CrudRepository { + + CTripFlightRecord findByRecordId(String recordId); } diff --git a/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcCTripHotelRecordRepository.java b/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcCTripHotelRecordRepository.java index 58a4c3ef..c844e383 100644 --- a/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcCTripHotelRecordRepository.java +++ b/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcCTripHotelRecordRepository.java @@ -7,4 +7,5 @@ import org.springframework.stereotype.Repository; @Repository public interface JdbcCTripHotelRecordRepository extends CrudRepository { + CTripHotelRecord findByRecordId(String recordId); } diff --git a/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcCTripTrainRecordRepository.java b/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcCTripTrainRecordRepository.java index 5f64ecd0..2dabe052 100644 --- a/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcCTripTrainRecordRepository.java +++ b/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcCTripTrainRecordRepository.java @@ -7,4 +7,5 @@ import org.springframework.stereotype.Repository; @Repository public interface JdbcCTripTrainRecordRepository extends CrudRepository { + CTripTrainRecord findByRecordId(String recordId); } diff --git a/src/main/java/com/chint/infrastructure/util/DateTimeUtil.java b/src/main/java/com/chint/infrastructure/util/DateTimeUtil.java index 8c984e4a..ab1037a8 100644 --- a/src/main/java/com/chint/infrastructure/util/DateTimeUtil.java +++ b/src/main/java/com/chint/infrastructure/util/DateTimeUtil.java @@ -5,8 +5,21 @@ import java.time.format.DateTimeFormatter; public class DateTimeUtil { + + + private final static DateTimeFormatter formatterMM = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSS"); + private final static DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); + private final static DateTimeFormatter formatterDate = DateTimeFormatter.ofPattern("yyyy-MM-dd"); + public static String timeToStr(LocalDateTime input) { - DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); - return input.format(formatter); + return input.format(formatterDate); + } + + public static LocalDateTime strToTime(String input) { + return LocalDateTime.parse(input.substring(0, 19), formatter); + } + + public static LocalDateTime strToTimeMM(String input) { + return LocalDateTime.parse(input.substring(0, 23), formatterMM); } } diff --git a/src/main/java/com/chint/interfaces/rest/ctrip/dto/order/OrderCarResponse.java b/src/main/java/com/chint/interfaces/rest/ctrip/dto/order/OrderCarResponse.java index 3c6b450b..f4c979e6 100644 --- a/src/main/java/com/chint/interfaces/rest/ctrip/dto/order/OrderCarResponse.java +++ b/src/main/java/com/chint/interfaces/rest/ctrip/dto/order/OrderCarResponse.java @@ -30,6 +30,7 @@ public class OrderCarResponse { public static class ResponseStatus { private String Message; private Boolean Success; + private Integer ErrorCode; } @@ -57,7 +58,7 @@ public class OrderCarResponse { private double ExpressFee; private int OrderType; private String SubAccCheckBatchNo; - private long TripID; + private String TripID; private String SettlementCurrency; private double PostServiceFee; private double RealAmountHasPost; @@ -122,7 +123,7 @@ public class OrderCarResponse { private String ReachTravel; private String ServerFrom; private double ServiceFee; - private long TripID; + private String TripID; private String Uid; private String UserName; private String PreEmployeeID; @@ -142,7 +143,7 @@ public class OrderCarResponse { } @Data public static class CarOrderCorpInfo { - private long CorpId; + private String CorpId; private String CorpName; private int AccountId; private int SubAccountId; diff --git a/src/main/java/com/chint/interfaces/rest/ctrip/order/CTripOrderRecordAutoSave.java b/src/main/java/com/chint/interfaces/rest/ctrip/order/CTripOrderRecordAutoSave.java index 486e495f..1151d4cf 100644 --- a/src/main/java/com/chint/interfaces/rest/ctrip/order/CTripOrderRecordAutoSave.java +++ b/src/main/java/com/chint/interfaces/rest/ctrip/order/CTripOrderRecordAutoSave.java @@ -38,12 +38,23 @@ public class CTripOrderRecordAutoSave { List cTripFlightRecords = flightOrderAccountSettlementList .stream() .flatMap(it -> it.getOrderSettlementList().stream()) - .map(it -> CTripFlightRecord.of( - CTripFlightRecordBase.changeInfo( - it.getOrderSettlementBaseInfo() - ), CTripFlightInfo.of(it.getOrderFlightInfo()) - )) - .toList(); + .map(it -> { + //对数据库进行查找 ,如果发现已经存在 , 就使用查找出来的 + OrderFlightResponse.FlightOrderSettlementBaseInfo orderSettlementBaseInfo = it.getOrderSettlementBaseInfo(); + CTripFlightRecord record = cTripOrderDetailRepository.findFlightRecordByRecordId( + String.valueOf(orderSettlementBaseInfo.getRecordID())); + if (record == null) { + record = CTripFlightRecord.of( + CTripFlightRecordBase.changeInfo( + orderSettlementBaseInfo + ), CTripFlightInfo.of(it.getOrderFlightInfo()) + ); + } + //补充额外的字段 + OrderFlightResponse.FlightOrderBaseInfo orderBaseInfo = it.getOrderBaseInfo(); + record.setRouteOrderNo(orderBaseInfo.getJourneyID()); + return record; + }).toList(); cTripOrderDetailRepository.saveAllCTripFlightRecord(cTripFlightRecords); } } @@ -55,11 +66,19 @@ public class CTripOrderRecordAutoSave { if (lstHtlSettlement != null && !lstHtlSettlement.isEmpty()) { List list = lstHtlSettlement.stream() .flatMap(it -> it.getLstHotelSettlementDetail().stream()) - .map(it -> - CTripHotelRecord.of(CTripHotelRecordBase.changeInfo(it.getSettlementDetail()), - CTripHotelInfo.of(it.getHotelDetail())) - ) - .toList(); + .map(it -> { + OrderHotelResponse.SettlementDetail settlementDetail = it.getSettlementDetail(); + CTripHotelRecord record = cTripOrderDetailRepository.findHotelRecordByRecordId( + String.valueOf(settlementDetail.getRecordId())); + if (record == null) { + record = CTripHotelRecord.of(CTripHotelRecordBase.changeInfo(settlementDetail), + CTripHotelInfo.of(it.getHotelDetail())); + } + //补充额外的字段 + OrderHotelResponse.SettlementOrderDetail orderDetail = it.getOrderDetail(); + record.setRecordId(orderDetail.getHotelRelatedJourneyNo()); + return record; + }).toList(); cTripOrderDetailRepository.saveAllCTripHotelRecord(list); } } @@ -71,11 +90,18 @@ public class CTripOrderRecordAutoSave { if (lstTrainSettlement != null && !lstTrainSettlement.isEmpty()) { List list = lstTrainSettlement.stream() .flatMap(it -> it.getLstTrainSettlementDetail().stream()) - .map(it -> - CTripTrainRecord.of(CTripTrainRecordBase.changeInfo(it.getTrainSettlementDetail()), - CTripTrainInfo.of(it.getTrainSettlementTicket())) - ) - .toList(); + .map(it -> { + OrderTrainResponse.CorpTrainSettlementDetail trainSettlementDetail = it.getTrainSettlementDetail(); + CTripTrainRecord record = cTripOrderDetailRepository.findTrainRecordByRecordId( + String.valueOf(trainSettlementDetail.getRecordID())); + if (record == null) { + record = CTripTrainRecord.of(CTripTrainRecordBase.changeInfo(trainSettlementDetail), + CTripTrainInfo.of(it.getTrainSettlementTicket())); + } + //补充额外的字段 + record.setRouteOrderNo(it.getTrainSettlementOrder().getJouneryID()); + return record; + }).toList(); cTripOrderDetailRepository.saveAllCTripTrainRecord(list); } } @@ -86,10 +112,20 @@ public class CTripOrderRecordAutoSave { if (settlementList != null && !settlementList.isEmpty()) { List list = settlementList.stream() .flatMap(it -> it.getCarSettlementDetailList().stream()) - .map(it -> CTripCarRecord.of( - CTripCarRecordBase.changeInfo(it.getSettlementBaseInfo()), - CTripCarQuickInfo.of(it.getOrderDetail().getQuickProductInfo()))) - .toList(); + .map(it -> { + OrderCarResponse.CarOrderSettlementBaseInfo settlementBaseInfo = it.getSettlementBaseInfo(); + CTripCarRecord record = cTripOrderDetailRepository.findCarRecordByRecordId( + String.valueOf(settlementBaseInfo.getRecordId())); + if (record == null) { + record = CTripCarRecord.of( + CTripCarRecordBase.changeInfo(settlementBaseInfo), + CTripCarQuickInfo.of(it.getOrderDetail().getQuickProductInfo())); + } + //补充额外的字段 + OrderCarResponse.CarOrderCorpInfo corpInfo = it.getOrderDetail().getCorpInfo(); + record.setRouteOrderNo(corpInfo.getJouneryId()); + return record; + }).toList(); cTripOrderDetailRepository.saveAllCTripCarRecord(list); } }