From 28aa7bdac546a6b1ad974652cd9aa08532de618b Mon Sep 17 00:00:00 2001 From: lulz1 Date: Wed, 27 Mar 2024 21:30:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E7=BB=93=E7=AE=97=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 | 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 = "正泰集团股份有限公司";