From bc11e0a9c9b0b014dd2fc44baf527988980386ff Mon Sep 17 00:00:00 2001 From: lulz1 Date: Mon, 1 Apr 2024 17:16:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=87=E4=BB=BD=E6=90=BA=E7=A8=8B=E6=8C=89?= =?UTF-8?q?=E6=9C=88=E8=8E=B7=E5=8F=96=E7=BB=93=E7=AE=97=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../application/dtos/CTripRecordMonthSaveDTO.java | 8 ++++++++ .../com/chint/application/in/AutoWorkController.java | 12 ++++++++++++ .../rest/ctrip/order/CTripOrderDetailRequest.java | 6 +++--- .../rest/ctrip/order/CTripOrderRecordAutoSave.java | 4 ++++ 4 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 src/main/java/com/chint/application/dtos/CTripRecordMonthSaveDTO.java diff --git a/src/main/java/com/chint/application/dtos/CTripRecordMonthSaveDTO.java b/src/main/java/com/chint/application/dtos/CTripRecordMonthSaveDTO.java new file mode 100644 index 00000000..562571d4 --- /dev/null +++ b/src/main/java/com/chint/application/dtos/CTripRecordMonthSaveDTO.java @@ -0,0 +1,8 @@ +package com.chint.application.dtos; + +import lombok.Data; + +@Data +public class CTripRecordMonthSaveDTO { + private String date; +} diff --git a/src/main/java/com/chint/application/in/AutoWorkController.java b/src/main/java/com/chint/application/in/AutoWorkController.java index 0e84d69e..7761a317 100644 --- a/src/main/java/com/chint/application/in/AutoWorkController.java +++ b/src/main/java/com/chint/application/in/AutoWorkController.java @@ -1,6 +1,7 @@ package com.chint.application.in; +import com.chint.application.dtos.CTripRecordMonthSaveDTO; import com.chint.domain.factoriy.order_record.LyStatementOrder; import com.chint.infrastructure.echo_framework.command.Command; import com.chint.application.commands.OrderRecordGenerateCommand; @@ -12,6 +13,7 @@ import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import com.chint.application.commands.OrderRecordGenerateCommand; @@ -45,6 +47,16 @@ public class AutoWorkController { return Result.Success(SUCCESS); } + @Transactional + @ApiOperation("拉取按月份的携程流水") + @PostMapping("/cTrip/record/save/month") + public Result autoSaveCTripRecordByMonth(@RequestBody CTripRecordMonthSaveDTO cTripRecordMonthSaveDTO) { + cTripOrderRecordAutoSave.saveAll(); + //将昨天的结算数据生成为财务共享需要的数据 + Command.of(OrderRecordGenerateCommand.class).sendToQueue(); + return Result.Success(SUCCESS); + } + @Transactional @ApiOperation("自动拉取同程上个月的流水号") @PostMapping("/ly/record/save") diff --git a/src/main/java/com/chint/interfaces/rest/ctrip/order/CTripOrderDetailRequest.java b/src/main/java/com/chint/interfaces/rest/ctrip/order/CTripOrderDetailRequest.java index 0032ea64..5e613686 100644 --- a/src/main/java/com/chint/interfaces/rest/ctrip/order/CTripOrderDetailRequest.java +++ b/src/main/java/com/chint/interfaces/rest/ctrip/order/CTripOrderDetailRequest.java @@ -65,8 +65,10 @@ public class CTripOrderDetailRequest { return getFlightOrder(formatter.format(localDateTime), formatter.format(localDateTime)); } - public OrderFlightResponse getFlightOrder(String dateFrom,String dateTo){ + + + public OrderFlightResponse getFlightOrder(String dateFrom,String dateTo){ String substring = dateFrom.substring(0, 6); String dateFromNew = substring + "01"; @@ -77,13 +79,11 @@ public class CTripOrderDetailRequest { dateTo, batchNo ); - orderFlightParam.auth(Authentification.midOf(C_TRIP_APP_KEY, ticketRequest.loadTicket())); orderFlightParam.setAppKey(C_TRIP_APP_KEY); orderFlightParam.setTicket(ticketRequest.loadTicket()); OrderFlightResponse orderFlightResponse = postRequest.post(flightOrderUrl, orderFlightParam, OrderFlightResponse.class); - return orderFlightResponse; } 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 6793cf08..cef780fd 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 @@ -32,6 +32,10 @@ public class CTripOrderRecordAutoSave { this.cTripCarRecordAutoSave(); } + public void saveByDate(){ + + } + public void cTripFlightRecordAutoSave() { OrderFlightResponse flightOrder = cTripOrderDetailRequest.getFlightOrder(); List flightOrderAccountSettlementList = flightOrder