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