Compare commits
No commits in common. "bc11e0a9c9b0b014dd2fc44baf527988980386ff" and "89dfea7c3e002d55bbf9ccdf595cb5e1c3514c8d" have entirely different histories.
bc11e0a9c9
...
89dfea7c3e
|
@ -11,5 +11,6 @@ public class AuthenticationSignDto extends BaseQuery {
|
|||
private String systemType;
|
||||
private String startTime;
|
||||
private String endTime;
|
||||
|
||||
private String sign;
|
||||
}
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
package com.chint.application.dtos;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class CTripRecordMonthSaveDTO {
|
||||
private String date;
|
||||
}
|
|
@ -1,7 +1,6 @@
|
|||
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;
|
||||
|
@ -13,7 +12,6 @@ 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;
|
||||
|
@ -47,16 +45,6 @@ public class AutoWorkController {
|
|||
return Result.Success(SUCCESS);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@ApiOperation("拉取按月份的携程流水")
|
||||
@PostMapping("/cTrip/record/save/month")
|
||||
public Result<String> autoSaveCTripRecordByMonth(@RequestBody CTripRecordMonthSaveDTO cTripRecordMonthSaveDTO) {
|
||||
cTripOrderRecordAutoSave.saveAll();
|
||||
//将昨天的结算数据生成为财务共享需要的数据
|
||||
Command.of(OrderRecordGenerateCommand.class).sendToQueue();
|
||||
return Result.Success(SUCCESS);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@ApiOperation("自动拉取同程上个月的流水号")
|
||||
@PostMapping("/ly/record/save")
|
||||
|
|
|
@ -25,6 +25,7 @@ import com.chint.interfaces.rest.ly.dto.search.response.filght.FlightOrderRespon
|
|||
import com.chint.interfaces.rest.ly.dto.search.response.hotel.HotelDetailResponse;
|
||||
import com.chint.interfaces.rest.ly.dto.search.response.train.TrainDetailResponse;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
@ -90,9 +91,9 @@ public class OrderDetailController {
|
|||
|
||||
@ApiOperation("订单结算查询接口")
|
||||
@PostMapping("/record/query")
|
||||
public Result<PageResult> queryRecord(@RequestBody AuthenticationSignDto authenticationDto) {
|
||||
public Result<PageResult<Object>> queryRecord(@RequestBody AuthenticationSignDto authenticationDto) {
|
||||
if (signCheck(authenticationDto)) {
|
||||
return Result.Success(SUCCESS, orderDetailPageQuery.orderRecordInfoPageQuery(authenticationDto));
|
||||
return orderDetailPageQuery.orderRecordInfoPageQuery(authenticationDto);
|
||||
} else {
|
||||
return Result.error("签名错误");
|
||||
}
|
||||
|
|
|
@ -7,8 +7,8 @@ import com.chint.application.dtos.mapper.OrderDetailMapper;
|
|||
import com.chint.application.dtos.response.OrderDetailRes;
|
||||
import com.chint.domain.aggregates.order.*;
|
||||
import com.chint.domain.aggregates.user.User;
|
||||
import com.chint.domain.exceptions.NotFoundException;
|
||||
import com.chint.domain.repository.*;
|
||||
import com.chint.domain.repository.OrderDetailRepository;
|
||||
import com.chint.domain.repository.RouteRepository;
|
||||
import com.chint.infrastructure.util.BaseContext;
|
||||
import com.chint.infrastructure.util.PageResult;
|
||||
import com.chint.infrastructure.util.Result;
|
||||
|
@ -39,37 +39,76 @@ public class OrderDetailQuery {
|
|||
@Autowired
|
||||
private RouteRepository routeRepository;
|
||||
|
||||
@Autowired
|
||||
private OrderCarRecordRepository orderCarRecordRepository;
|
||||
@Autowired
|
||||
private OrderHotelRecordRepository orderHotelRecordRepository;
|
||||
@Autowired
|
||||
private OrderFlightRecordRepository orderFlightRecordRepository;
|
||||
@Autowired
|
||||
private OrderTrainRecordRepository orderTrainRecordRepository;
|
||||
|
||||
|
||||
public PageResult<?> orderRecordInfoPageQuery(AuthenticationSignDto authenticationDto) {
|
||||
Integer productType = authenticationDto.getProductType();
|
||||
String systemType = authenticationDto.getSystemType();
|
||||
Integer pageSize = authenticationDto.getPageSize();
|
||||
Integer pageNum = authenticationDto.getPageNum();
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
LocalDateTime targetTimeBegin = LocalDateTime.parse(authenticationDto.getStartTime(), formatter);
|
||||
LocalDateTime targetTimeEnd = LocalDateTime.parse(authenticationDto.getEndTime(), formatter);
|
||||
return switch (productType) {
|
||||
case 1 -> orderFlightRecordRepository.findByUpdateDataTime(targetTimeBegin,
|
||||
targetTimeEnd, pageSize, pageNum, systemType);
|
||||
case 2 -> orderHotelRecordRepository.findByUpdateDataTime(targetTimeBegin,
|
||||
targetTimeEnd, pageSize, pageNum, systemType);
|
||||
case 3 -> orderTrainRecordRepository.findByUpdateDataTime(targetTimeBegin,
|
||||
targetTimeEnd, pageSize, pageNum, systemType);
|
||||
case 4 -> orderCarRecordRepository.findByUpdateDataTime(targetTimeBegin,
|
||||
targetTimeEnd, pageSize, pageNum, systemType);
|
||||
default -> throw new NotFoundException("错误产品类型");
|
||||
};
|
||||
}
|
||||
|
||||
// public Result<PageResult<Object>> orderDetailInfoPageQuery(AuthenticationSignDto authenticationDto) {
|
||||
// Integer productType = authenticationDto.getProductType();
|
||||
// String systemType = authenticationDto.getSystemType();
|
||||
// Integer pageSize = authenticationDto.getPageSize();
|
||||
// Integer pageNum = authenticationDto.getPageNum();
|
||||
//
|
||||
// DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
// LocalDateTime targetTimeBegin = LocalDateTime.parse(authenticationDto.getStartTime(), formatter);
|
||||
// LocalDateTime targetTimeEnd = LocalDateTime.parse(authenticationDto.getEndTime(), formatter);
|
||||
// List<OrderDetail> orderDetailList = orderDetailRepository.findByUpdateTimeBetween(targetTimeBegin, targetTimeEnd);
|
||||
// List<Object> orderDetailResList = new ArrayList<>();
|
||||
// for (OrderDetail orderDetail : orderDetailList) {
|
||||
// if (productType == 1) {
|
||||
// FlightOrderDetail flightOrderDetail = orderDetail.getFlightOrderDetail();
|
||||
//
|
||||
// if (flightOrderDetail != null) {
|
||||
// String receiptsNum = flightOrderDetail.getReceiptsNum();
|
||||
// if (receiptsNum != null) {
|
||||
// flightOrderDetail.setReceiptsNum(regetReceiptsNum(receiptsNum));
|
||||
// }
|
||||
// if (flightOrderDetail.getOrderStatus() != null && flightOrderDetail.getBelongSysType() != null && flightOrderDetail.getBelongSysType().equals(systemType)) {
|
||||
// orderDetailResList.add(flightOrderDetail);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// if (productType == 2) {
|
||||
// HotelOrderDetail hotelOrderDetail = orderDetail.getHotelOrderDetail();
|
||||
// if (hotelOrderDetail != null) {
|
||||
// String receiptsNum = hotelOrderDetail.getReceiptsNum();
|
||||
// if (receiptsNum != null) {
|
||||
// hotelOrderDetail.setReceiptsNum(regetReceiptsNum(receiptsNum));
|
||||
// }
|
||||
// if (hotelOrderDetail.getBelongSysType() != null && hotelOrderDetail.getBelongSysType().equals(systemType)) {
|
||||
// //这里添加过滤逻辑 ,如果该订单为同程酒店订单 , 并且金额为0 判断为 临时订单数据
|
||||
// if (orderDetail.getSupplierName().equals(SUPPLIER_L_Y) && Double.parseDouble(hotelOrderDetail.getOrderAmount()) == 0)
|
||||
// continue;
|
||||
// orderDetailResList.add(hotelOrderDetail);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// if (productType == 3) {
|
||||
// TrainOrderDetail trainOrderDetail = orderDetail.getTrainOrderDetail();
|
||||
// if (trainOrderDetail != null) {
|
||||
// String receiptsNum = trainOrderDetail.getReceiptsNum();
|
||||
// if (receiptsNum != null) {
|
||||
// trainOrderDetail.setReceiptsNum(regetReceiptsNum(receiptsNum));
|
||||
// }
|
||||
// if (trainOrderDetail.getOrderStatus() != null && trainOrderDetail.getBelongSysType() != null && trainOrderDetail.getBelongSysType().equals(systemType)) {
|
||||
// orderDetailResList.add(trainOrderDetail);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// if (productType == 4) {
|
||||
// CarOrderDetail carOrderDetail = orderDetail.getCarOrderDetail();
|
||||
// if (carOrderDetail != null) {
|
||||
// String receiptsNum = carOrderDetail.getReceiptsNum();
|
||||
// if (receiptsNum != null) {
|
||||
// carOrderDetail.setReceiptsNum(regetReceiptsNum(receiptsNum));
|
||||
// }
|
||||
// if (carOrderDetail.getOrderStatus() != null && carOrderDetail.getBelongSysType() != null && carOrderDetail.getBelongSysType().equals(systemType)) {
|
||||
// orderDetailResList.add(carOrderDetail);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// List<Object> newres2 = orderDetailResList.stream().skip((long) (pageNum - 1) * pageSize).limit(pageSize).toList();
|
||||
//
|
||||
// return Result.Success(SUCCESS, PageResult.totalPageNum(Long.parseLong(String.valueOf(orderDetailResList.size())), newres2));
|
||||
// }
|
||||
|
||||
public Result<PageResult<Object>> orderDetailInfoPageQuery(AuthenticationSignDto authenticationDto) {
|
||||
Integer productType = authenticationDto.getProductType();
|
||||
|
@ -79,6 +118,7 @@ public class OrderDetailQuery {
|
|||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
LocalDateTime targetTimeBegin = LocalDateTime.parse(authenticationDto.getStartTime(), formatter);
|
||||
LocalDateTime targetTimeEnd = LocalDateTime.parse(authenticationDto.getEndTime(), formatter);
|
||||
|
||||
List<OrderDetail> orderDetailList = orderDetailRepository.findByUpdateTimeBetween(targetTimeBegin, targetTimeEnd);
|
||||
|
||||
Stream<Object> orderDetailStream = orderDetailList.stream().map(orderDetail -> switch (productType) {
|
||||
|
@ -99,6 +139,10 @@ public class OrderDetailQuery {
|
|||
return Result.Success(SUCCESS, PageResult.totalPageNum(res.size(), paginatedResults));
|
||||
}
|
||||
|
||||
public Result<PageResult<Object>> orderRecordInfoPageQuery(AuthenticationSignDto authenticationDto) {
|
||||
return null;
|
||||
}
|
||||
|
||||
private Object processHotelOrderDetail(OrderDetail orderDetail, String systemType) {
|
||||
HotelOrderDetail hotelOrderDetail = orderDetail.getHotelOrderDetail();
|
||||
|
||||
|
|
|
@ -154,7 +154,7 @@ public class OrderQuery {
|
|||
|
||||
//这里按照业务要求,尝试进行自动确认结束行程
|
||||
orders.forEach(it->{
|
||||
if(it.getIfCanBeFinished().equals("1") && !it.getOrderStatus().equals(ORDER_STATUS_FINISH)){
|
||||
if(it.getIfCanBeFinished().equals("1") && !it.getOrderStatus().equals(ORDER_EVENT_FINISH)){
|
||||
orderDomainService.finishOrder(it.getRouteId());
|
||||
}
|
||||
});
|
||||
|
|
|
@ -72,7 +72,6 @@ public class OrderCarRecord extends OrderBaseRecord {
|
|||
private String payAmount;//支付总金额
|
||||
|
||||
|
||||
|
||||
//添加行程信息
|
||||
public OrderCarRecord loadTravelInfo(String startTime,
|
||||
String arriveTime,
|
||||
|
|
|
@ -72,16 +72,17 @@ public class CTripOrderRecordExtensionFactory implements OrderRecordExtensionFac
|
|||
public OrderCarRecord createCarOrderRecord(Object orderCarRecordData) {
|
||||
CTripCarRecord cTripCarRecord = (CTripCarRecord) orderCarRecordData;
|
||||
String routeOrderNo = cTripCarRecord.getRouteOrderNo();
|
||||
Optional<RouteOrder> byOrderNo = Optional.ofNullable(routeRepository.findByOrderNo(routeOrderNo));
|
||||
RouteOrder byOrderNo = routeRepository.findByOrderNo(routeOrderNo);
|
||||
OrderCarRecord orderCarRecord = buildWithRecord(cTripCarRecord)
|
||||
.carRecord();
|
||||
CTripCarRecordBase cTripCarRecordBase = cTripCarRecord.getCTripCarRecordBase();
|
||||
//携程的打车订单可以直接通过订单号获取对应的订单
|
||||
Optional<OrderDetail> orderDetail = byOrderNo.flatMap(routeOrder -> routeOrder.getOrderDetails()
|
||||
Optional<OrderDetail> orderDetail = byOrderNo
|
||||
.getOrderDetails()
|
||||
.stream()
|
||||
.filter(it -> it.getOrderNo().equals(String.valueOf(
|
||||
cTripCarRecordBase.getOrderId()
|
||||
))).findFirst());
|
||||
))).findFirst();
|
||||
|
||||
CTripCarQuickInfo cTripCarQuickInfo = cTripCarRecord.getCTripCarQuickInfo();
|
||||
|
||||
|
@ -146,7 +147,7 @@ public class CTripOrderRecordExtensionFactory implements OrderRecordExtensionFac
|
|||
}
|
||||
|
||||
// 加载超标信息, 加载订单关联信息 , 加载订单状态 ,单号,创建时间等信息
|
||||
orderDetail.ifPresentOrElse(it -> {
|
||||
orderDetail.ifPresent(it -> {
|
||||
CarOrderDetail carOrderDetail = it.getCarOrderDetail();
|
||||
orderCarRecord.loadComplianceInfo(it)
|
||||
.loadRelatedOrderInfo(it.getOrderId(),
|
||||
|
@ -157,14 +158,7 @@ public class CTripOrderRecordExtensionFactory implements OrderRecordExtensionFac
|
|||
.loadBasicOrderInfo(carOrderDetail.getOrderNo(),
|
||||
carOrderDetail.getOrderStatus(),
|
||||
carOrderDetail.getCreateTime());
|
||||
}, () -> orderCarRecord.loadRelatedOrderInfo(cTripCarRecordBase.getOrderId(),
|
||||
cTripCarRecord.getRecordId(),
|
||||
cTripCarRecord.getRouteOrderNo(),
|
||||
String.valueOf(cTripCarRecordBase.getOrderId()),
|
||||
String.valueOf(cTripCarRecordBase.getOrderId()))
|
||||
.loadBasicOrderInfo( String.valueOf(cTripCarRecordBase.getOrderId()),
|
||||
"",
|
||||
cTripCarRecordBase.getCreateTime()));
|
||||
});
|
||||
|
||||
return orderCarRecord;
|
||||
}
|
||||
|
@ -214,18 +208,18 @@ public class CTripOrderRecordExtensionFactory implements OrderRecordExtensionFac
|
|||
CTripFlightRecord cTripFlightRecord = (CTripFlightRecord) orderFlightRecordData;
|
||||
CTripFlightBaseInfo cTripFlightBaseInfo = cTripFlightRecord.getCTripFlightBaseInfo();
|
||||
String routeOrderNo = cTripFlightRecord.getRouteOrderNo();
|
||||
Optional<RouteOrder> byOrderNo = Optional.ofNullable(routeRepository.findByOrderNo(routeOrderNo));
|
||||
RouteOrder byOrderNo = routeRepository.findByOrderNo(routeOrderNo);
|
||||
OrderFlightRecord orderFlightRecord = buildWithRecord(cTripFlightRecord)
|
||||
.flightRecord();
|
||||
|
||||
CTripFlightInfo cTripFlightInfo = cTripFlightRecord.getCTripFlightInfo();
|
||||
CTripFlightRecordBase cTripFlightRecordBase = cTripFlightRecord.getCTripFlightRecordBase();
|
||||
//携程的打车订单可以直接通过订单号获取对应的订单
|
||||
Optional<OrderDetail> orderDetail = byOrderNo.flatMap(routeOrder -> routeOrder.
|
||||
Optional<OrderDetail> orderDetail = byOrderNo.
|
||||
getOrderDetails()
|
||||
.stream()
|
||||
.filter(it -> it.getOrderNo().equals(String.valueOf(cTripFlightRecordBase.getOrderId()
|
||||
))).findFirst());
|
||||
))).findFirst();
|
||||
|
||||
// 加载航班信息 , 航线
|
||||
orderFlightRecord.loadFlightInfo(cTripFlightInfo.getFlight(),
|
||||
|
@ -279,6 +273,19 @@ public class CTripOrderRecordExtensionFactory implements OrderRecordExtensionFac
|
|||
orderFlightRecord.loadSourceInfo("Y");
|
||||
}
|
||||
|
||||
// 加载关联票价原因
|
||||
orderDetail.ifPresent(it -> {
|
||||
FlightOrderDetail flightOrderDetail = it.getFlightOrderDetail();
|
||||
orderFlightRecord.loadComplianceInfo(it)
|
||||
.loadBasicOrderInfo(String.valueOf(cTripFlightRecordBase.getOrderId()),
|
||||
flightOrderDetail.getOrderStatus(),
|
||||
cTripFlightRecordBase.getCreateTime())
|
||||
.loadRelatedOrderInfo(it.getOrderId(),
|
||||
String.valueOf(cTripFlightRecordBase.getRecordId()),
|
||||
flightOrderDetail.getReceiptsNum(),
|
||||
flightOrderDetail.getParentOrderNo(),
|
||||
it.getOrderNo());
|
||||
});
|
||||
|
||||
// 加载未预订最低价原因
|
||||
orderFlightRecord.loadNotLowReason(cTripFlightInfo.getReasonDesc());
|
||||
|
@ -287,26 +294,6 @@ public class CTripOrderRecordExtensionFactory implements OrderRecordExtensionFac
|
|||
cTripFlightBaseInfo.getDept2(),
|
||||
cTripFlightBaseInfo.getDept3());
|
||||
|
||||
// 加载关联票价原因
|
||||
orderDetail.ifPresentOrElse(it -> {
|
||||
FlightOrderDetail flightOrderDetail = it.getFlightOrderDetail();
|
||||
orderFlightRecord.loadComplianceInfo(it)
|
||||
.loadBasicOrderInfo(String.valueOf(cTripFlightRecordBase.getOrderId()),
|
||||
flightOrderDetail.getOrderStatus(),
|
||||
cTripFlightRecordBase.getCreateTime())
|
||||
.loadRelatedOrderInfo(cTripFlightRecordBase.getOrderId(),
|
||||
String.valueOf(cTripFlightRecordBase.getRecordId()),
|
||||
flightOrderDetail.getReceiptsNum(),
|
||||
flightOrderDetail.getParentOrderNo(),
|
||||
it.getOrderNo());
|
||||
}, () -> orderFlightRecord.loadRelatedOrderInfo(cTripFlightRecordBase.getOrderId(), //兼容测试环境没有申请单的情况
|
||||
String.valueOf(cTripFlightRecordBase.getRecordId()),
|
||||
cTripFlightBaseInfo.getJourneyID(),
|
||||
String.valueOf(cTripFlightRecordBase.getOrderId()),
|
||||
String.valueOf(cTripFlightRecordBase.getOrderId()))
|
||||
.loadBasicOrderInfo(String.valueOf(cTripFlightRecordBase.getOrderId()),
|
||||
"",
|
||||
cTripFlightRecordBase.getCreateTime()));
|
||||
return orderFlightRecord;
|
||||
}
|
||||
|
||||
|
@ -349,18 +336,12 @@ public class CTripOrderRecordExtensionFactory implements OrderRecordExtensionFac
|
|||
CTripHotelRecord cTripHotelRecord = (CTripHotelRecord) orderHotelRecordData;
|
||||
CTripHotelOrderDetail cTripHotelOrderDetail = cTripHotelRecord.getCTripHotelOrderDetail();
|
||||
String routeOrderNo = cTripHotelRecord.getRouteOrderNo();
|
||||
Optional<RouteOrder> byOrderNo = Optional.ofNullable(routeRepository.findByOrderNo(routeOrderNo));
|
||||
RouteOrder byOrderNo = routeRepository.findByOrderNo(routeOrderNo);
|
||||
OrderHotelRecord orderHotelRecord = buildWithRecord(cTripHotelRecord)
|
||||
.hotelRecord();
|
||||
|
||||
CTripHotelInfo cTripHotelInfo = cTripHotelRecord.getCTripHotelInfo();
|
||||
CTripHotelRecordBase cTripHotelRecordBase = cTripHotelRecord.getCTripHotelRecordBase();
|
||||
|
||||
Optional<OrderDetail> orderDetailOptional = byOrderNo.flatMap(it -> it.getOrderDetails()
|
||||
.stream()
|
||||
.filter(orderDetail -> orderDetail.getOrderNo().equals(String.valueOf(cTripHotelRecordBase.getOrderId())))
|
||||
.findFirst());
|
||||
|
||||
// 加载酒店和入住信息
|
||||
orderHotelRecord.loadHotelInfo(cTripHotelInfo.getHotelName(),
|
||||
cTripHotelInfo.getHotelName(),
|
||||
|
@ -410,8 +391,12 @@ public class CTripOrderRecordExtensionFactory implements OrderRecordExtensionFac
|
|||
}
|
||||
orderHotelRecord.loadSourceInfo(sourceInfo);
|
||||
|
||||
Optional<OrderDetail> orderDetailOptional = byOrderNo.getOrderDetails()
|
||||
.stream()
|
||||
.filter(it -> it.getOrderNo().equals(String.valueOf(cTripHotelRecordBase.getOrderId())))
|
||||
.findFirst();
|
||||
|
||||
orderDetailOptional.ifPresentOrElse(it -> {
|
||||
orderDetailOptional.ifPresent(it -> {
|
||||
orderHotelRecord.loadComplianceInfo(it); // 加载违规信息
|
||||
HotelOrderDetail hotelOrderDetail = it.getHotelOrderDetail();
|
||||
orderHotelRecord.loadOrderNoInfo(it.getOrderId(), // 加载订单关联号信息
|
||||
|
@ -422,14 +407,7 @@ public class CTripOrderRecordExtensionFactory implements OrderRecordExtensionFac
|
|||
orderHotelRecord.loadBasicOrderInfo(hotelOrderDetail.getOrderNo(), // 加载基础订单信息
|
||||
hotelOrderDetail.getOrderStatus(),
|
||||
cTripHotelRecordBase.getCreateTime());
|
||||
}, () -> orderHotelRecord.loadOrderNoInfo(cTripHotelRecordBase.getOrderId(), //兼容测试环境不存在行程规划单的情况 // 加载订单关联号信息
|
||||
cTripHotelRecord.getRecordId(),
|
||||
cTripHotelRecord.getRouteOrderNo(),
|
||||
String.valueOf(cTripHotelRecordBase.getOrderId()),
|
||||
String.valueOf(cTripHotelRecordBase.getOrderId()))
|
||||
.loadBasicOrderInfo(String.valueOf(cTripHotelRecordBase.getOrderId()), // 加载基础订单信息
|
||||
"",
|
||||
cTripHotelRecordBase.getCreateTime()));
|
||||
});
|
||||
|
||||
// 加载财务信息
|
||||
orderHotelRecord.loadFinancialInfo(cTripHotelRecordBase.getSubAccCheckBatchNo(),
|
||||
|
|
|
@ -17,6 +17,12 @@ public class OrderRecordFactory {
|
|||
@Autowired
|
||||
private UserRepository userRepository;
|
||||
|
||||
@Autowired
|
||||
private CTripOrderRecordExtensionFactory cTripOrderRecordExtensionFactory;
|
||||
|
||||
@Autowired
|
||||
private LyOrderRecordExtensionFactory lyOrderRecordExtensionFactory;
|
||||
|
||||
public OrderRecordBasic buildWithRouteOrder(RouteOrder routeOrder) {
|
||||
routeOrder.reloadStatus();
|
||||
OrderRecordBasic orderRecordBasic = new OrderRecordBasic();
|
||||
|
@ -65,4 +71,11 @@ public class OrderRecordFactory {
|
|||
return orderRecordBasic;
|
||||
}
|
||||
|
||||
public OrderRecordExtensionFactory extensionFactoryOfSupplierName(String supplierName) {
|
||||
return switch (supplierName) {
|
||||
case SUPPLIER_C_TRIP -> cTripOrderRecordExtensionFactory;
|
||||
case SUPPLIER_L_Y -> lyOrderRecordExtensionFactory;
|
||||
default -> null;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,24 +0,0 @@
|
|||
package com.chint.domain.factoriy.order_record;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import static com.chint.infrastructure.constant.SupplierNameConstant.SUPPLIER_C_TRIP;
|
||||
import static com.chint.infrastructure.constant.SupplierNameConstant.SUPPLIER_L_Y;
|
||||
|
||||
@Component
|
||||
public class OrderRecordFactorySelector {
|
||||
@Autowired
|
||||
private CTripOrderRecordExtensionFactory cTripOrderRecordExtensionFactory;
|
||||
|
||||
@Autowired
|
||||
private LyOrderRecordExtensionFactory lyOrderRecordExtensionFactory;
|
||||
|
||||
public OrderRecordExtensionFactory extensionFactoryOfSupplierName(String supplierName) {
|
||||
return switch (supplierName) {
|
||||
case SUPPLIER_C_TRIP -> cTripOrderRecordExtensionFactory;
|
||||
case SUPPLIER_L_Y -> lyOrderRecordExtensionFactory;
|
||||
default -> null;
|
||||
};
|
||||
}
|
||||
}
|
|
@ -1,16 +1,12 @@
|
|||
package com.chint.domain.repository;
|
||||
|
||||
import com.chint.domain.aggregates.order.order_record.OrderCarRecord;
|
||||
import com.chint.infrastructure.util.PageResult;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
public interface OrderCarRecordRepository {
|
||||
List<OrderCarRecord> saveAll(List<OrderCarRecord> orderCarRecordList);
|
||||
|
||||
Optional<OrderCarRecord> findByDetailId(String detailId);
|
||||
|
||||
PageResult<OrderCarRecord> findByUpdateDataTime(LocalDateTime startTime, LocalDateTime endTime, Integer pageSize, Integer pageNum ,String systemType);
|
||||
Optional<OrderCarRecord> findByDetailId(String detailId);
|
||||
}
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
package com.chint.domain.repository;
|
||||
|
||||
import com.chint.domain.aggregates.order.order_record.OrderFlightRecord;
|
||||
import com.chint.infrastructure.util.PageResult;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
|
@ -11,10 +9,4 @@ public interface OrderFlightRecordRepository {
|
|||
List<OrderFlightRecord> saveAll(List<OrderFlightRecord> orderFlightRecordList);
|
||||
|
||||
Optional<OrderFlightRecord> findByDetailId(String detailId);
|
||||
|
||||
PageResult<OrderFlightRecord> findByUpdateDataTime(LocalDateTime startTime,
|
||||
LocalDateTime endTime,
|
||||
Integer pageSize,
|
||||
Integer pageNum,
|
||||
String systemType);
|
||||
}
|
||||
|
|
|
@ -1,10 +1,7 @@
|
|||
package com.chint.domain.repository;
|
||||
|
||||
import com.chint.domain.aggregates.order.order_record.OrderCarRecord;
|
||||
import com.chint.domain.aggregates.order.order_record.OrderHotelRecord;
|
||||
import com.chint.infrastructure.util.PageResult;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
|
@ -12,6 +9,4 @@ public interface OrderHotelRecordRepository {
|
|||
List<OrderHotelRecord> saveAll(List<OrderHotelRecord> orderHotelRecordList);
|
||||
|
||||
Optional<OrderHotelRecord> findByDetailId(String detailId);
|
||||
|
||||
PageResult<OrderHotelRecord> findByUpdateDataTime(LocalDateTime startTime, LocalDateTime endTime, Integer pageSize, Integer pageNum ,String systemType);
|
||||
}
|
||||
|
|
|
@ -1,11 +1,8 @@
|
|||
package com.chint.domain.repository;
|
||||
|
||||
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.infrastructure.util.PageResult;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
|
@ -13,6 +10,4 @@ public interface OrderTrainRecordRepository {
|
|||
List<OrderTrainRecord> saveAll(List<OrderTrainRecord> orderTrainRecordList);
|
||||
|
||||
Optional<OrderTrainRecord> findByDetailId(String detailId);
|
||||
|
||||
PageResult<OrderTrainRecord> findByUpdateDataTime(LocalDateTime startTime, LocalDateTime endTime, Integer pageSize, Integer pageNum ,String systemType);
|
||||
}
|
||||
|
|
|
@ -11,10 +11,8 @@ import com.chint.domain.aggregates.order.order_record.ctrip_order_record.CTripHo
|
|||
import com.chint.domain.factoriy.order_record.CTripOrderRecordExtensionFactory;
|
||||
import com.chint.domain.factoriy.order_record.OrderRecordExtensionFactory;
|
||||
import com.chint.domain.factoriy.order_record.OrderRecordFactory;
|
||||
import com.chint.domain.factoriy.order_record.OrderRecordFactorySelector;
|
||||
import com.chint.domain.repository.CTripOrderDetailRepository;
|
||||
import com.chint.domain.service.OrderDetailDomainService;
|
||||
import com.chint.infrastructure.echo_framework.annotation.ListenTo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
|
@ -33,14 +31,13 @@ public class CTripOrderRecordDomainService implements OrderRecordDomainService {
|
|||
@Autowired
|
||||
private CTripOrderDetailRepository cTripOrderDetailRepository;
|
||||
@Autowired
|
||||
private OrderRecordFactorySelector orderRecordFactorySelector;
|
||||
private OrderRecordFactory orderRecordFactory;
|
||||
|
||||
|
||||
@ListenTo(command = "OrderRecordGenerateCommand", order = 0)
|
||||
@Override
|
||||
public List<OrderHotelRecord> generateHotelRecord(OrderRecordGenerateCommand command) {
|
||||
List<CTripHotelRecord> records = cTripOrderDetailRepository.findHotelRecordByCreateTime(command.getStartTime(), command.getEndTime());
|
||||
OrderRecordExtensionFactory orderRecordExtensionFactory = orderRecordFactorySelector.extensionFactoryOfSupplierName(SUPPLIER_C_TRIP);
|
||||
OrderRecordExtensionFactory orderRecordExtensionFactory = orderRecordFactory.extensionFactoryOfSupplierName(SUPPLIER_C_TRIP);
|
||||
List<OrderHotelRecord> list = records.stream().map(orderRecordExtensionFactory::createHotelOrderRecord).toList();
|
||||
return orderDetailDomainService.saveHotelOrderRecordBatch(list);
|
||||
}
|
||||
|
@ -51,20 +48,18 @@ public class CTripOrderRecordDomainService implements OrderRecordDomainService {
|
|||
return null;
|
||||
}
|
||||
|
||||
@ListenTo(command = "OrderRecordGenerateCommand", order = 1)
|
||||
@Override
|
||||
public List<OrderFlightRecord> generateFlightRecord(OrderRecordGenerateCommand command) {
|
||||
List<CTripFlightRecord> records = cTripOrderDetailRepository.findFlightRecordByCreateTime(command.getStartTime(), command.getEndTime());
|
||||
OrderRecordExtensionFactory orderRecordExtensionFactory = orderRecordFactorySelector.extensionFactoryOfSupplierName(SUPPLIER_C_TRIP);
|
||||
OrderRecordExtensionFactory orderRecordExtensionFactory = orderRecordFactory.extensionFactoryOfSupplierName(SUPPLIER_C_TRIP);
|
||||
List<OrderFlightRecord> list = records.stream().map(orderRecordExtensionFactory::createFlightOrderRecord).toList();
|
||||
return orderDetailDomainService.saveFlightOrderRecordBatch(list);
|
||||
}
|
||||
|
||||
@ListenTo(command = "OrderRecordGenerateCommand", order = 2)
|
||||
@Override
|
||||
public List<OrderCarRecord> generateCarRecord(OrderRecordGenerateCommand command) {
|
||||
List<CTripCarRecord> records = cTripOrderDetailRepository.findCarRecordByCreateTime(command.getStartTime(), command.getEndTime());
|
||||
OrderRecordExtensionFactory orderRecordExtensionFactory = orderRecordFactorySelector.extensionFactoryOfSupplierName(SUPPLIER_C_TRIP);
|
||||
OrderRecordExtensionFactory orderRecordExtensionFactory = orderRecordFactory.extensionFactoryOfSupplierName(SUPPLIER_C_TRIP);
|
||||
List<OrderCarRecord> list = records.stream().map(orderRecordExtensionFactory::createCarOrderRecord).toList();
|
||||
return orderDetailDomainService.saveCarOrderRecordBatch(list);
|
||||
}
|
||||
|
|
|
@ -67,8 +67,8 @@ public class JwtTokenAdminInterceptor implements HandlerInterceptor {
|
|||
if (res) {
|
||||
return true;
|
||||
} else {
|
||||
throw new AuthException(JWT_INVALID);
|
||||
// return true;
|
||||
// throw new AuthException(JWT_INVALID);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -14,7 +14,6 @@ public class OrderConstant {
|
|||
public static final String ORDER_EVENT_REFUND_NAME = "退票";
|
||||
public static final int ORDER_EVENT_FINISH = 5;
|
||||
public static final String ORDER_EVENT_FINISH_NAME = "已完成";
|
||||
|
||||
public static final int ORDER_EVENT_CANCEL = -1;
|
||||
public static final String ORDER_EVENT_CANCEL_NAME = "取消";
|
||||
public static final int ORDER_EVENT_ETA = -2;
|
||||
|
|
|
@ -3,14 +3,9 @@ package com.chint.infrastructure.repository;
|
|||
import com.chint.domain.aggregates.order.order_record.OrderCarRecord;
|
||||
import com.chint.domain.repository.OrderCarRecordRepository;
|
||||
import com.chint.infrastructure.repository.jdbc.JdbcOrderCarRecordRepository;
|
||||
import com.chint.infrastructure.util.PageResult;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.data.domain.Sort;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
@ -19,7 +14,6 @@ import java.util.Optional;
|
|||
public class OrderCarRecordRepositoryImpl implements OrderCarRecordRepository {
|
||||
@Autowired
|
||||
private JdbcOrderCarRecordRepository orderCarRecordRepository;
|
||||
|
||||
@Override
|
||||
public List<OrderCarRecord> saveAll(List<OrderCarRecord> orderCarRecordList) {
|
||||
List<OrderCarRecord> res = new ArrayList<>();
|
||||
|
@ -31,16 +25,4 @@ public class OrderCarRecordRepositoryImpl implements OrderCarRecordRepository {
|
|||
public Optional<OrderCarRecord> findByDetailId(String detailId) {
|
||||
return orderCarRecordRepository.findByDetailId(detailId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<OrderCarRecord> findByUpdateDataTime(LocalDateTime startTime,
|
||||
LocalDateTime endTime,
|
||||
Integer pageSize,
|
||||
Integer pageNum,
|
||||
String systemType) {
|
||||
PageRequest pageRequest = PageRequest.of(pageNum - 1, pageSize, Sort.by("update_data_time").descending());
|
||||
Page<OrderCarRecord> byUpdateDataTimeBetween = orderCarRecordRepository
|
||||
.findByBelongSysTypeAndUpdateDataTimeBetween(systemType, startTime, endTime, pageRequest);
|
||||
return PageResult.totalPageNum(byUpdateDataTimeBetween.getTotalElements(), byUpdateDataTimeBetween.getContent());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,14 +3,9 @@ package com.chint.infrastructure.repository;
|
|||
import com.chint.domain.aggregates.order.order_record.OrderFlightRecord;
|
||||
import com.chint.domain.repository.OrderFlightRecordRepository;
|
||||
import com.chint.infrastructure.repository.jdbc.JdbcOrderFlightRecordRepository;
|
||||
import com.chint.infrastructure.util.PageResult;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.data.domain.Sort;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
@ -33,12 +28,4 @@ public class OrderFlightRecordRepositoryImpl implements OrderFlightRecordReposit
|
|||
return jdbcOrderFlightRecordRepository.findByDetailId(detailId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<OrderFlightRecord> findByUpdateDataTime(LocalDateTime startTime, LocalDateTime endTime, Integer pageSize, Integer pageNum, String systemType) {
|
||||
PageRequest pageRequest = PageRequest.of(pageNum - 1, pageSize, Sort.by("update_data_time").descending());
|
||||
Page<OrderFlightRecord> byUpdateDataTimeBetween = jdbcOrderFlightRecordRepository
|
||||
.findByBelongSysTypeAndUpdateDataTimeBetween(systemType, startTime, endTime, pageRequest);
|
||||
return PageResult.totalPageNum(byUpdateDataTimeBetween.getTotalElements(), byUpdateDataTimeBetween.getContent());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,19 +1,13 @@
|
|||
package com.chint.infrastructure.repository;
|
||||
|
||||
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.repository.OrderHotelRecordRepository;
|
||||
import com.chint.infrastructure.repository.jdbc.JdbcOrderFlightRecordRepository;
|
||||
import com.chint.infrastructure.repository.jdbc.JdbcOrderHotelRecordRepository;
|
||||
import com.chint.infrastructure.util.PageResult;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.data.domain.Sort;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
@ -34,12 +28,4 @@ public class OrderHotelRecordRepositoryImpl implements OrderHotelRecordRepositor
|
|||
public Optional<OrderHotelRecord> findByDetailId(String detailId) {
|
||||
return jdbcOrderHotelRecordRepository.findByDetailId(detailId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<OrderHotelRecord> findByUpdateDataTime(LocalDateTime startTime, LocalDateTime endTime, Integer pageSize, Integer pageNum ,String systemType) {
|
||||
PageRequest pageRequest = PageRequest.of(pageNum - 1, pageSize, Sort.by("update_data_time").descending());
|
||||
Page<OrderHotelRecord> byUpdateDataTimeBetween = jdbcOrderHotelRecordRepository
|
||||
.findByBelongSysTypeAndUpdateDataTimeBetween(systemType, startTime, endTime, pageRequest);
|
||||
return PageResult.totalPageNum(byUpdateDataTimeBetween.getTotalElements(), byUpdateDataTimeBetween.getContent());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,14 +5,9 @@ import com.chint.domain.aggregates.order.order_record.OrderTrainRecord;
|
|||
import com.chint.domain.repository.OrderTrainRecordRepository;
|
||||
import com.chint.infrastructure.repository.jdbc.JdbcOrderHotelRecordRepository;
|
||||
import com.chint.infrastructure.repository.jdbc.JdbcOrderTrainRecordRepository;
|
||||
import com.chint.infrastructure.util.PageResult;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.data.domain.Sort;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
@ -32,12 +27,4 @@ public class OrderTrainRecordRepositoryImpl implements OrderTrainRecordRepositor
|
|||
public Optional<OrderTrainRecord> findByDetailId(String detailId) {
|
||||
return jdbcOrderTrainRecordRepository.findByDetailId(detailId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<OrderTrainRecord> findByUpdateDataTime(LocalDateTime startTime, LocalDateTime endTime, Integer pageSize, Integer pageNum ,String systemType) {
|
||||
PageRequest pageRequest = PageRequest.of(pageNum - 1, pageSize, Sort.by("update_data_time").descending());
|
||||
Page<OrderTrainRecord> byUpdateDataTimeBetween = jdbcOrderTrainRecordRepository
|
||||
.findByBelongSysTypeAndUpdateDataTimeBetween(systemType, startTime, endTime, pageRequest);
|
||||
return PageResult.totalPageNum(byUpdateDataTimeBetween.getTotalElements(), byUpdateDataTimeBetween.getContent());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,22 +0,0 @@
|
|||
package com.chint.infrastructure.repository.config;
|
||||
|
||||
import com.chint.domain.aggregates.base.BaseEntity;
|
||||
import com.chint.domain.aggregates.order.order_record.OrderBaseRecord;
|
||||
import com.chint.infrastructure.util.BaseContext;
|
||||
import org.springframework.data.relational.core.conversion.MutableAggregateChange;
|
||||
import org.springframework.data.relational.core.mapping.event.BeforeSaveCallback;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Component
|
||||
public class OrderRecordCallbackImpl implements BeforeSaveCallback<OrderBaseRecord> {
|
||||
@Override
|
||||
public OrderBaseRecord onBeforeSave(OrderBaseRecord entity, MutableAggregateChange<OrderBaseRecord> aggregateChange) {
|
||||
if (entity.getCreateDataTime() == null) {
|
||||
entity.setCreateDataTime(LocalDateTime.now());
|
||||
}
|
||||
entity.setUpdateDataTime(LocalDateTime.now());
|
||||
return entity;
|
||||
}
|
||||
}
|
|
@ -1,18 +1,13 @@
|
|||
package com.chint.infrastructure.repository.jdbc;
|
||||
|
||||
import com.chint.domain.aggregates.order.order_record.OrderCarRecord;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.repository.CrudRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Optional;
|
||||
|
||||
@Repository
|
||||
public interface JdbcOrderCarRecordRepository extends CrudRepository<OrderCarRecord, Long> {
|
||||
public interface JdbcOrderCarRecordRepository extends CrudRepository<OrderCarRecord,Long> {
|
||||
|
||||
Optional<OrderCarRecord> findByDetailId(String detailId);
|
||||
|
||||
Page<OrderCarRecord> findByBelongSysTypeAndUpdateDataTimeBetween(String belongSysType, LocalDateTime updateDataTime, LocalDateTime updateDataTime2, Pageable pageable);
|
||||
}
|
||||
|
|
|
@ -1,17 +1,12 @@
|
|||
package com.chint.infrastructure.repository.jdbc;
|
||||
|
||||
import com.chint.domain.aggregates.order.order_record.OrderFlightRecord;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.repository.CrudRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Optional;
|
||||
|
||||
@Repository
|
||||
public interface JdbcOrderFlightRecordRepository extends CrudRepository<OrderFlightRecord, Long> {
|
||||
public interface JdbcOrderFlightRecordRepository extends CrudRepository<OrderFlightRecord,Long> {
|
||||
Optional<OrderFlightRecord> findByDetailId(String detailId);
|
||||
|
||||
Page<OrderFlightRecord> findByBelongSysTypeAndUpdateDataTimeBetween(String belongSysType, LocalDateTime updateDataTime, LocalDateTime updateDataTime2, Pageable pageable);
|
||||
}
|
||||
|
|
|
@ -1,18 +1,13 @@
|
|||
package com.chint.infrastructure.repository.jdbc;
|
||||
|
||||
import com.chint.domain.aggregates.order.order_record.OrderHotelRecord;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.repository.CrudRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Optional;
|
||||
|
||||
@Repository
|
||||
public interface JdbcOrderHotelRecordRepository extends CrudRepository<OrderHotelRecord, Long> {
|
||||
public interface JdbcOrderHotelRecordRepository extends CrudRepository<OrderHotelRecord,Long> {
|
||||
|
||||
Optional<OrderHotelRecord> findByDetailId(String detailId);
|
||||
|
||||
Page<OrderHotelRecord> findByBelongSysTypeAndUpdateDataTimeBetween(String belongSysType, LocalDateTime updateDataTime, LocalDateTime updateDataTime2, Pageable pageable);
|
||||
}
|
||||
|
|
|
@ -1,17 +1,12 @@
|
|||
package com.chint.infrastructure.repository.jdbc;
|
||||
|
||||
import com.chint.domain.aggregates.order.order_record.OrderTrainRecord;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.repository.CrudRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Optional;
|
||||
|
||||
@Repository
|
||||
public interface JdbcOrderTrainRecordRepository extends CrudRepository<OrderTrainRecord, Long> {
|
||||
public interface JdbcOrderTrainRecordRepository extends CrudRepository<OrderTrainRecord,Long> {
|
||||
Optional<OrderTrainRecord> findByDetailId(String detailId);
|
||||
|
||||
Page<OrderTrainRecord> findByBelongSysTypeAndUpdateDataTimeBetween(String belongSysType, LocalDateTime updateDataTime, LocalDateTime updateDataTime2, Pageable pageable);
|
||||
}
|
||||
|
|
|
@ -65,10 +65,8 @@ public class CTripOrderDetailRequest {
|
|||
return getFlightOrder(formatter.format(localDateTime), formatter.format(localDateTime));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public OrderFlightResponse getFlightOrder(String dateFrom,String dateTo){
|
||||
|
||||
String substring = dateFrom.substring(0, 6);
|
||||
String dateFromNew = substring + "01";
|
||||
|
||||
|
@ -79,11 +77,13 @@ 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;
|
||||
}
|
||||
|
||||
|
|
|
@ -11,8 +11,6 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Component
|
||||
@Slf4j
|
||||
|
@ -32,10 +30,6 @@ public class CTripOrderRecordAutoSave {
|
|||
this.cTripCarRecordAutoSave();
|
||||
}
|
||||
|
||||
public void saveByDate(){
|
||||
|
||||
}
|
||||
|
||||
public void cTripFlightRecordAutoSave() {
|
||||
OrderFlightResponse flightOrder = cTripOrderDetailRequest.getFlightOrder();
|
||||
List<OrderFlightResponse.FlightOrderAccountSettlementInfo> flightOrderAccountSettlementList = flightOrder
|
||||
|
@ -55,13 +49,6 @@ public class CTripOrderRecordAutoSave {
|
|||
CTripFlightInfo.of(it.getOrderFlightInfo()),
|
||||
CTripFlightBaseInfo.of(it.getOrderBaseInfo())
|
||||
);
|
||||
} else {
|
||||
Long originId = record.getId();
|
||||
record = CTripFlightRecord.of(
|
||||
CTripFlightRecordBase.changeInfo(orderSettlementBaseInfo),
|
||||
CTripFlightInfo.of(it.getOrderFlightInfo()),
|
||||
CTripFlightBaseInfo.of(it.getOrderBaseInfo()));
|
||||
record.setId(originId);
|
||||
}
|
||||
//补充额外的字段
|
||||
OrderFlightResponse.FlightOrderBaseInfo orderBaseInfo = it.getOrderBaseInfo();
|
||||
|
@ -87,21 +74,13 @@ public class CTripOrderRecordAutoSave {
|
|||
record = CTripHotelRecord.of(CTripHotelRecordBase.changeInfo(settlementDetail),
|
||||
CTripHotelInfo.of(it.getHotelDetail()),
|
||||
CTripHotelOrderDetail.of(it.getOrderDetail()));
|
||||
} else {
|
||||
Long originId = record.getId();
|
||||
record = CTripHotelRecord.of(CTripHotelRecordBase.changeInfo(settlementDetail),
|
||||
CTripHotelInfo.of(it.getHotelDetail()),
|
||||
CTripHotelOrderDetail.of(it.getOrderDetail()));
|
||||
record.setId(originId);
|
||||
}
|
||||
//补充额外的字段
|
||||
OrderHotelResponse.SettlementOrderDetail orderDetail = it.getOrderDetail();
|
||||
record.setRouteOrderNo(orderDetail.getHotelRelatedJourneyNo());
|
||||
record.setRecordId(orderDetail.getHotelRelatedJourneyNo());
|
||||
return record;
|
||||
}).toList();
|
||||
Map<Boolean, List<CTripHotelRecord>> collect = list.stream()
|
||||
.collect(Collectors.groupingBy(record -> record.getId() != null));
|
||||
collect.values().forEach(it -> cTripOrderDetailRepository.saveAllCTripHotelRecord(it));
|
||||
cTripOrderDetailRepository.saveAllCTripHotelRecord(list);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -119,11 +98,6 @@ public class CTripOrderRecordAutoSave {
|
|||
if (record == null) {
|
||||
record = CTripTrainRecord.of(CTripTrainRecordBase.changeInfo(trainSettlementDetail),
|
||||
CTripTrainInfo.of(it.getTrainSettlementTicket()));
|
||||
} else {
|
||||
Long originId = record.getId();
|
||||
record = CTripTrainRecord.of(CTripTrainRecordBase.changeInfo(trainSettlementDetail),
|
||||
CTripTrainInfo.of(it.getTrainSettlementTicket()));
|
||||
record.setId(originId);
|
||||
}
|
||||
//补充额外的字段
|
||||
record.setRouteOrderNo(it.getTrainSettlementOrder().getJouneryID());
|
||||
|
@ -149,14 +123,6 @@ public class CTripOrderRecordAutoSave {
|
|||
CTripCarQuickInfo.of(it.getOrderDetail().getQuickProductInfo()),
|
||||
CTripCarPassengerInfo.of(it.getOrderDetail().getPassengerInfoList().get(0))
|
||||
);
|
||||
} else {
|
||||
Long originId = record.getId();
|
||||
record = CTripCarRecord.of(
|
||||
CTripCarRecordBase.changeInfo(settlementBaseInfo),
|
||||
CTripCarQuickInfo.of(it.getOrderDetail().getQuickProductInfo()),
|
||||
CTripCarPassengerInfo.of(it.getOrderDetail().getPassengerInfoList().get(0))
|
||||
);
|
||||
record.setId(originId);
|
||||
}
|
||||
//补充额外的字段
|
||||
OrderCarResponse.CarOrderCorpInfo corpInfo = it.getOrderDetail().getCorpInfo();
|
||||
|
|
|
@ -14,8 +14,8 @@ chint:
|
|||
# host: gf-jump.chint.com
|
||||
# port: 30108
|
||||
# database: itinerary_booking
|
||||
# username: fe1ff9fb-6d54-46ab-84ae-e76f00d2d473
|
||||
# password: EpqDr9g6xc3CrQlg
|
||||
# username: 42b24d69-49d0-4085-b8a8-a281d0b66bb2
|
||||
# password: bHFb2HZtUHKIoZ2O
|
||||
|
||||
url: https://trip.chint.com/
|
||||
redis:
|
||||
|
@ -27,8 +27,8 @@ chint:
|
|||
|
||||
logging:
|
||||
level:
|
||||
org.springframework.jdbc.core.JdbcTemplate: debug
|
||||
org.springframework.jdbc.core.StatementCreatorUtils: debug
|
||||
org.springframework.jdbc.core.JdbcTemplate: info
|
||||
org.springframework.jdbc.core.StatementCreatorUtils: info
|
||||
root: info
|
||||
org.springframework.cache: info
|
||||
|
||||
|
|
|
@ -40,7 +40,6 @@ import com.chint.interfaces.rest.ctrip.dto.put.CTripStatusNotification;
|
|||
import com.chint.interfaces.rest.ctrip.dto.search.SearchOrderResponse;
|
||||
import com.chint.interfaces.rest.ctrip.in.CTripNoteController;
|
||||
import com.chint.interfaces.rest.ctrip.order.CTripOrderDetailRequest;
|
||||
import com.chint.interfaces.rest.ctrip.order.CTripOrderRecordAutoSave;
|
||||
import com.google.gson.Gson;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -131,9 +130,6 @@ public class CTripTest {
|
|||
@Autowired
|
||||
private CTripOrderDetailImpl cTripOrderDetail;
|
||||
|
||||
@Autowired
|
||||
private CTripOrderRecordAutoSave cTripOrderRecordAutoSave;
|
||||
|
||||
|
||||
private User user = new User(1L, "230615020", 1, "卢麟哲", "1033719135@qq.com", "15857193365", "A30000001");
|
||||
|
||||
|
@ -617,9 +613,4 @@ public class CTripTest {
|
|||
System.out.println(gson.toJson(byId));
|
||||
}
|
||||
|
||||
|
||||
// @Test
|
||||
void saveFlightRecord(){
|
||||
cTripOrderRecordAutoSave.cTripFlightRecordAutoSave();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -279,7 +279,7 @@ class RouteApplicationTests {
|
|||
|
||||
// @Test
|
||||
void loginSignProd() {
|
||||
String sfno = "190801115";
|
||||
String sfno = "231201060";
|
||||
String syscode = "FSSC";
|
||||
String billcode = "CLSQ240225000099";
|
||||
String companycode = "正泰集团股份有限公司";
|
||||
|
|
Loading…
Reference in New Issue