结算明细字段映射调整
This commit is contained in:
parent
8084bda3c0
commit
08b303b9a7
|
@ -1,18 +1,32 @@
|
||||||
package com.chint.application.in;
|
package com.chint.application.in;
|
||||||
|
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.chint.application.commands.LYOrderRecordGenerateCommand;
|
import com.chint.application.commands.LYOrderRecordGenerateCommand;
|
||||||
|
import com.chint.application.dtos.AuthenticationSignDto;
|
||||||
import com.chint.application.dtos.CTripRecordMonthSaveDTO;
|
import com.chint.application.dtos.CTripRecordMonthSaveDTO;
|
||||||
|
import com.chint.domain.aggregates.order.OrderDetail;
|
||||||
|
import com.chint.domain.aggregates.order.RouteOrder;
|
||||||
import com.chint.domain.factoriy.order_record.LyStatementOrder;
|
import com.chint.domain.factoriy.order_record.LyStatementOrder;
|
||||||
|
import com.chint.infrastructure.config.LogConfig.Dto.LogPageDto;
|
||||||
|
import com.chint.infrastructure.config.LogConfig.SystemLog;
|
||||||
|
import com.chint.infrastructure.constant.CommonMessageConstant;
|
||||||
import com.chint.infrastructure.echo_framework.command.Command;
|
import com.chint.infrastructure.echo_framework.command.Command;
|
||||||
import com.chint.application.commands.OrderRecordGenerateCommand;
|
import com.chint.application.commands.OrderRecordGenerateCommand;
|
||||||
import com.chint.domain.factoriy.order_record.LyStatementOrder;
|
import com.chint.domain.factoriy.order_record.LyStatementOrder;
|
||||||
import com.chint.infrastructure.echo_framework.command.Command;
|
import com.chint.infrastructure.echo_framework.command.Command;
|
||||||
|
import com.chint.infrastructure.repository.jdbc.JdbcRouteRepository;
|
||||||
|
import com.chint.infrastructure.util.BeanCopyUtils;
|
||||||
import com.chint.infrastructure.util.DateTimeUtil;
|
import com.chint.infrastructure.util.DateTimeUtil;
|
||||||
|
import com.chint.infrastructure.util.PageResult;
|
||||||
import com.chint.infrastructure.util.Result;
|
import com.chint.infrastructure.util.Result;
|
||||||
import com.chint.interfaces.rest.ctrip.order.CTripOrderRecordAutoSave;
|
import com.chint.interfaces.rest.ctrip.order.CTripOrderRecordAutoSave;
|
||||||
|
import com.chint.interfaces.rest.ly.reconciliation.dto.PageInfo;
|
||||||
|
import com.google.gson.Gson;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.data.domain.Page;
|
||||||
|
import org.springframework.data.domain.PageRequest;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
@ -74,4 +88,21 @@ public class AutoWorkController {
|
||||||
return Result.Success(SUCCESS);
|
return Result.Success(SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private JdbcRouteRepository jdbcRouteRepository;
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
@ApiOperation("临时接口查询订单数据")
|
||||||
|
@PostMapping("/routeOrder/pageQuery")
|
||||||
|
public Result<PageResult<RouteOrder>> routeOrderPageQuery(@RequestBody PageInfo pageInfo) {
|
||||||
|
PageRequest pageResult = PageRequest.of(
|
||||||
|
pageInfo.getPageIndex() - 1,
|
||||||
|
pageInfo.getPageSize()
|
||||||
|
);
|
||||||
|
Page<RouteOrder> res = jdbcRouteRepository.findAllBy(pageResult);
|
||||||
|
PageResult<RouteOrder> routeOrderPageResult = PageResult.totalPageNum(res.getTotalElements(), res.toList());
|
||||||
|
return Result.Success(SUCCESS, routeOrderPageResult);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
package com.chint.application.in;
|
||||||
|
|
||||||
|
import com.chint.domain.aggregates.order.RouteOrder;
|
||||||
|
import com.chint.infrastructure.util.PageResult;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.apache.poi.ss.formula.functions.T;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class RouteOrderPageDto {
|
||||||
|
|
||||||
|
private String msg;
|
||||||
|
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
private PageResult<RouteOrder> data;
|
||||||
|
}
|
|
@ -103,7 +103,11 @@ public class Leg implements Serializable {
|
||||||
return this.eventList.isEmpty() ? null : this.eventList.get(this.eventList.size() - 1);
|
return this.eventList.isEmpty() ? null : this.eventList.get(this.eventList.size() - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public OrderDetail getLastOrderDetail() {
|
public OrderDetail getLastOrderDetail() {
|
||||||
|
if (this.orderDetails == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return this.orderDetails.stream()
|
return this.orderDetails.stream()
|
||||||
.max(Comparator.comparingLong(OrderDetail::getOrderId))
|
.max(Comparator.comparingLong(OrderDetail::getOrderId))
|
||||||
.orElse(null);
|
.orElse(null);
|
||||||
|
@ -209,7 +213,7 @@ public class Leg implements Serializable {
|
||||||
exists = lastLegEvent.getEventType().equals(newEventType);
|
exists = lastLegEvent.getEventType().equals(newEventType);
|
||||||
|
|
||||||
//这里如果发现最后的时间是结束时间 , 那么禁止往该行程节点添加新的事件
|
//这里如果发现最后的时间是结束时间 , 那么禁止往该行程节点添加新的事件
|
||||||
if(lastLegEvent.getEventType().equals(LEG_EVENT_FINISH)){
|
if (lastLegEvent.getEventType().equals(LEG_EVENT_FINISH)) {
|
||||||
log.info("This leg was finished.");
|
log.info("This leg was finished.");
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
@ -222,7 +226,6 @@ public class Leg implements Serializable {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 如果列表为空,且新事件不是准备事件,抛出异常
|
// 如果列表为空,且新事件不是准备事件,抛出异常
|
||||||
// if (eventList.isEmpty() && newEventType != LegConstant.LEG_EVENT_PREPARE) {
|
// if (eventList.isEmpty() && newEventType != LegConstant.LEG_EVENT_PREPARE) {
|
||||||
// throw new LegEventException("The first event must be a prepare event.");
|
// throw new LegEventException("The first event must be a prepare event.");
|
||||||
|
|
|
@ -34,7 +34,6 @@ public class LegExtensionField implements Serializable {
|
||||||
private String estimatedAmount;
|
private String estimatedAmount;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public LegExtensionField addLocationIdsAsString(List<Long> locationIds) {
|
public LegExtensionField addLocationIdsAsString(List<Long> locationIds) {
|
||||||
this.locationIds = Arrays.toString(locationIds.toArray());
|
this.locationIds = Arrays.toString(locationIds.toArray());
|
||||||
return this;
|
return this;
|
||||||
|
@ -42,6 +41,9 @@ public class LegExtensionField implements Serializable {
|
||||||
|
|
||||||
public List<Long> getLocationIdsAsLong() {
|
public List<Long> getLocationIdsAsLong() {
|
||||||
// 去除字符串开头和结尾的方括号
|
// 去除字符串开头和结尾的方括号
|
||||||
|
if (this.locationIds == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
// this.locationIds = this.locationIds.substring(1, this.locationIds.length() - 1);
|
// this.locationIds = this.locationIds.substring(1, this.locationIds.length() - 1);
|
||||||
// 根据逗号分割字符串
|
// 根据逗号分割字符串
|
||||||
String[] items = this.locationIds.split(",");
|
String[] items = this.locationIds.split(",");
|
||||||
|
@ -49,21 +51,32 @@ public class LegExtensionField implements Serializable {
|
||||||
List<Long> result = new ArrayList<>();
|
List<Long> result = new ArrayList<>();
|
||||||
// 将每个分割后的字符串转换为Long并添加到列表中
|
// 将每个分割后的字符串转换为Long并添加到列表中
|
||||||
for (String item : items) {
|
for (String item : items) {
|
||||||
result.add(Long.parseLong(item.trim()));
|
if (!item.trim().isEmpty()) {
|
||||||
|
result.add(Long.parseLong(item.trim()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Long> getLocationIdsAsLongFromArray() {
|
public List<Long> getLocationIdsAsLongFromArray() {
|
||||||
// 去除字符串开头和结尾的方括号
|
// 去除字符串开头和结尾的方括号
|
||||||
this.locationIds = this.locationIds.substring(1, this.locationIds.length() - 1);
|
if (this.locationIds == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.locationIds.length() >= 2) {
|
||||||
|
this.locationIds = this.locationIds.substring(1, this.locationIds.length() - 1);
|
||||||
|
}
|
||||||
// 根据逗号分割字符串
|
// 根据逗号分割字符串
|
||||||
String[] items = this.locationIds.split(",");
|
String[] items = this.locationIds.split(",");
|
||||||
// 创建一个Long类型的列表
|
// 创建一个Long类型的列表
|
||||||
List<Long> result = new ArrayList<>();
|
List<Long> result = new ArrayList<>();
|
||||||
// 将每个分割后的字符串转换为Long并添加到列表中
|
// 将每个分割后的字符串转换为Long并添加到列表中
|
||||||
for (String item : items) {
|
for (String item : items) {
|
||||||
result.add(Long.parseLong(item.trim()));
|
// 检查字符串是否为空或只包含空格
|
||||||
|
if (!item.trim().isEmpty()) {
|
||||||
|
result.add(Long.parseLong(item.trim()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,8 @@ public class WebConfig implements WebMvcConfigurer {
|
||||||
//调用bean
|
//调用bean
|
||||||
registry.addInterceptor(getMyRequestLoggingInterceptor())
|
registry.addInterceptor(getMyRequestLoggingInterceptor())
|
||||||
.addPathPatterns("/**")
|
.addPathPatterns("/**")
|
||||||
.excludePathPatterns("/public/log/pageQuery", "/order/pageQuery", "/OrderDetail/query/**", "/order/query/**", "/location/**");
|
.excludePathPatterns("/public/**/pageQuery", "/order/pageQuery", "/OrderDetail/query/**",
|
||||||
|
"/order/query/**", "/location/**", "/OrderDetail/record/query");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,11 +17,11 @@ public class RouteOrderCallBackImpl implements BeforeSaveCallback<RouteOrder> {
|
||||||
entity.setCreateTime(LocalDateTime.now());
|
entity.setCreateTime(LocalDateTime.now());
|
||||||
}
|
}
|
||||||
if (entity.getCreateUser() == null) {
|
if (entity.getCreateUser() == null) {
|
||||||
entity.setCreateUser(BaseContext.getCurrentUser().getUserId().toString());
|
entity.setCreateUser(BaseContext.getCurrentUser() != null ? BaseContext.getCurrentUser().getUserId().toString() : "");
|
||||||
}
|
}
|
||||||
entity.setUpdateTime(LocalDateTime.now());
|
entity.setUpdateTime(LocalDateTime.now());
|
||||||
if (BaseContext.getCurrentUser() != null) {
|
if (BaseContext.getCurrentUser() != null) {
|
||||||
entity.setUpdateUser(BaseContext.getCurrentUser().getUserId().toString());
|
entity.setUpdateUser(BaseContext.getCurrentUser() != null ? BaseContext.getCurrentUser().getUserId().toString() : "");
|
||||||
}
|
}
|
||||||
return entity;
|
return entity;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@ package com.chint.infrastructure.repository.jdbc;
|
||||||
|
|
||||||
import com.chint.domain.aggregates.order.RouteOrder;
|
import com.chint.domain.aggregates.order.RouteOrder;
|
||||||
import org.springframework.data.domain.Page;
|
import org.springframework.data.domain.Page;
|
||||||
|
import org.springframework.data.domain.PageRequest;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
import org.springframework.data.repository.CrudRepository;
|
import org.springframework.data.repository.CrudRepository;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
@ -39,4 +40,6 @@ public interface JdbcRouteRepository extends CrudRepository<RouteOrder, Long> {
|
||||||
List<RouteOrder> findByUserIdAndApproveOrderNo_ActualOrderNoNotNullOrApproveOrderNo_CreatorAndApproveOrderNo_ActualOrderNoNotNull(String userId, String approveOrderNo_creator);
|
List<RouteOrder> findByUserIdAndApproveOrderNo_ActualOrderNoNotNullOrApproveOrderNo_CreatorAndApproveOrderNo_ActualOrderNoNotNull(String userId, String approveOrderNo_creator);
|
||||||
|
|
||||||
List<RouteOrder> findByCreateTimeBetween(LocalDateTime createTime, LocalDateTime createTime2);
|
List<RouteOrder> findByCreateTimeBetween(LocalDateTime createTime, LocalDateTime createTime2);
|
||||||
|
|
||||||
|
Page<RouteOrder> findAllBy(PageRequest pageResult);
|
||||||
}
|
}
|
||||||
|
|
|
@ -122,6 +122,26 @@ public class PostRequest {
|
||||||
return gson.fromJson(responseBody, responseType);
|
return gson.fromJson(responseBody, responseType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public <T> T postJSON(String url, Object jsonRequest, Class<T> responseType) {
|
||||||
|
HttpPost post = new HttpPost(url);
|
||||||
|
String json = JSON.toJSONString(jsonRequest);
|
||||||
|
log.info(json);
|
||||||
|
post.setEntity(new StringEntity(json, ContentType.APPLICATION_JSON));
|
||||||
|
String responseBody = null;
|
||||||
|
HttpEntity responseEntity = null;
|
||||||
|
HttpResponse response = null;
|
||||||
|
try {
|
||||||
|
response = client.execute(post);
|
||||||
|
responseEntity = response.getEntity();
|
||||||
|
responseBody = EntityUtils.toString(responseEntity, "UTF-8");
|
||||||
|
log.info(responseBody);
|
||||||
|
} catch (IOException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
return JSON.parseObject(responseBody, responseType);
|
||||||
|
}
|
||||||
|
|
||||||
public Gson gson() {
|
public Gson gson() {
|
||||||
return gson;
|
return gson;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,15 +5,12 @@ import com.chint.domain.aggregates.location.basedata.DistrictPOIInfoEntity;
|
||||||
import com.chint.domain.aggregates.location.basedata.PrefectureLevelCityInfoEntity;
|
import com.chint.domain.aggregates.location.basedata.PrefectureLevelCityInfoEntity;
|
||||||
import com.chint.domain.aggregates.order.Location;
|
import com.chint.domain.aggregates.order.Location;
|
||||||
import com.chint.domain.aggregates.order.RouteOrder;
|
import com.chint.domain.aggregates.order.RouteOrder;
|
||||||
import com.chint.domain.aggregates.order.order_record.OrderFlightRecord;
|
|
||||||
import com.chint.domain.aggregates.order.order_record.ctrip_order_record.*;
|
|
||||||
import com.chint.domain.aggregates.user.User;
|
import com.chint.domain.aggregates.user.User;
|
||||||
import com.chint.domain.repository.*;
|
import com.chint.domain.repository.*;
|
||||||
import com.chint.domain.service.order_sync.CTripOrderSyncAdapter;
|
import com.chint.domain.service.order_sync.CTripOrderSyncAdapter;
|
||||||
import com.chint.domain.service.supplier.SupplierService;
|
import com.chint.domain.service.supplier.SupplierService;
|
||||||
import com.chint.domain.value_object.SupplierCallbackData;
|
import com.chint.domain.value_object.SupplierCallbackData;
|
||||||
import com.chint.infrastructure.repository.CTripOrderDetailImpl;
|
|
||||||
import com.chint.infrastructure.repository.OrderFlightRecordRepositoryImpl;
|
|
||||||
import com.chint.infrastructure.util.BaseContext;
|
import com.chint.infrastructure.util.BaseContext;
|
||||||
import com.chint.infrastructure.util.Digest;
|
import com.chint.infrastructure.util.Digest;
|
||||||
import com.chint.infrastructure.util.PinyinUtil;
|
import com.chint.infrastructure.util.PinyinUtil;
|
||||||
|
@ -40,7 +37,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.dto.search.SearchOrderResponse;
|
||||||
import com.chint.interfaces.rest.ctrip.in.CTripNoteController;
|
import com.chint.interfaces.rest.ctrip.in.CTripNoteController;
|
||||||
import com.chint.interfaces.rest.ctrip.order.CTripOrderDetailRequest;
|
import com.chint.interfaces.rest.ctrip.order.CTripOrderDetailRequest;
|
||||||
import com.chint.interfaces.rest.ctrip.order.CTripOrderRecordAutoSave;
|
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
@ -125,15 +121,6 @@ public class CTripTest {
|
||||||
@Value("${cTrip.requestSecret}")
|
@Value("${cTrip.requestSecret}")
|
||||||
private String C_TRIP_REQUEST_SECRET;
|
private String C_TRIP_REQUEST_SECRET;
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private OrderFlightRecordRepository orderFlightRecordRepository;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private CTripOrderDetailImpl cTripOrderDetail;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private CTripOrderRecordAutoSave cTripOrderRecordAutoSave;
|
|
||||||
|
|
||||||
|
|
||||||
private User user = new User(1L, "230615020", 1, "卢麟哲", "1033719135@qq.com", "15857193365", "A30000001");
|
private User user = new User(1L, "230615020", 1, "卢麟哲", "1033719135@qq.com", "15857193365", "A30000001");
|
||||||
|
|
||||||
|
@ -246,10 +233,10 @@ public class CTripTest {
|
||||||
System.out.println(gson.toJson(estimate));
|
System.out.println(gson.toJson(estimate));
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Test
|
@Test
|
||||||
void search() {
|
void search() {
|
||||||
BaseContext.setCurrentUser(user);
|
BaseContext.setCurrentUser(user);
|
||||||
SearchOrderResponse response = orderSearchRequest.searchOrderResponseByOrderId("31288249965");
|
SearchOrderResponse response = orderSearchRequest.searchOrderResponseByOrderId("31108053999");
|
||||||
System.out.println(response);
|
System.out.println(response);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -497,11 +484,11 @@ public class CTripTest {
|
||||||
OrderFlightResponse.FlightOrderSettlementInfo flightOrderSettlementInfo = orderSettlementList.get(0);
|
OrderFlightResponse.FlightOrderSettlementInfo flightOrderSettlementInfo = orderSettlementList.get(0);
|
||||||
OrderFlightResponse.FlightOrderSettlementBaseInfo orderSettlementBaseInfo =
|
OrderFlightResponse.FlightOrderSettlementBaseInfo orderSettlementBaseInfo =
|
||||||
flightOrderSettlementInfo.getOrderSettlementBaseInfo();
|
flightOrderSettlementInfo.getOrderSettlementBaseInfo();
|
||||||
if (orderSettlementBaseInfo != null) {
|
/*if (orderSettlementBaseInfo != null) {
|
||||||
CTripFlightRecordBase ctripFlightOrderDetail = new CTripFlightRecordBase();
|
CtripFlightOrderDetail ctripFlightOrderDetail = new CtripFlightOrderDetail();
|
||||||
ctripFlightOrderDetail = ctripFlightOrderDetail.changeInfo(orderSettlementBaseInfo);
|
ctripFlightOrderDetail = ctripFlightOrderDetail.changeInfo(orderSettlementBaseInfo);
|
||||||
ctripOrderDetailRepository.save(ctripFlightOrderDetail);
|
ctripOrderDetailRepository.save(ctripFlightOrderDetail);
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -519,11 +506,11 @@ public class CTripTest {
|
||||||
OrderTrainResponse.CorpTrainSettlementInfo corpTrainSettlementInfo = lstTrainSettlementDetail.get(0);
|
OrderTrainResponse.CorpTrainSettlementInfo corpTrainSettlementInfo = lstTrainSettlementDetail.get(0);
|
||||||
OrderTrainResponse.CorpTrainSettlementDetail trainSettlementDetail =
|
OrderTrainResponse.CorpTrainSettlementDetail trainSettlementDetail =
|
||||||
corpTrainSettlementInfo.getTrainSettlementDetail();
|
corpTrainSettlementInfo.getTrainSettlementDetail();
|
||||||
if (trainSettlementDetail != null) {
|
/*if (trainSettlementDetail != null) {
|
||||||
CTripTrainRecordBase ctripTrainOrderDetail = new CTripTrainRecordBase();
|
CtripTrainOrderDetail ctripTrainOrderDetail = new CtripTrainOrderDetail();
|
||||||
ctripTrainOrderDetail = ctripTrainOrderDetail.changeInfo(trainSettlementDetail);
|
ctripTrainOrderDetail = ctripTrainOrderDetail.changeInfo(trainSettlementDetail);
|
||||||
ctripOrderDetailRepository.save(ctripTrainOrderDetail);
|
ctripOrderDetailRepository.save(ctripTrainOrderDetail);
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -540,11 +527,11 @@ public class CTripTest {
|
||||||
if (!LstHotelSettlementDetail.isEmpty()) {
|
if (!LstHotelSettlementDetail.isEmpty()) {
|
||||||
OrderHotelResponse.LstHotelSettlementDetail hotelSettlementDetail = LstHotelSettlementDetail.get(0);
|
OrderHotelResponse.LstHotelSettlementDetail hotelSettlementDetail = LstHotelSettlementDetail.get(0);
|
||||||
OrderHotelResponse.SettlementDetail settlementDetail = hotelSettlementDetail.getSettlementDetail();
|
OrderHotelResponse.SettlementDetail settlementDetail = hotelSettlementDetail.getSettlementDetail();
|
||||||
if (settlementDetail != null) {
|
/*if (settlementDetail != null) {
|
||||||
CTripHotelRecordBase ctripFlightOrderDetail = new CTripHotelRecordBase();
|
CtripHotelOrderDetail ctripFlightOrderDetail = new CtripHotelOrderDetail();
|
||||||
ctripFlightOrderDetail = ctripFlightOrderDetail.changeInfo(settlementDetail);
|
ctripFlightOrderDetail = ctripFlightOrderDetail.changeInfo(settlementDetail);
|
||||||
ctripOrderDetailRepository.save(ctripFlightOrderDetail);
|
ctripOrderDetailRepository.save(ctripFlightOrderDetail);
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -562,11 +549,11 @@ public class CTripTest {
|
||||||
if (!carSettlementDetailList.isEmpty()) {
|
if (!carSettlementDetailList.isEmpty()) {
|
||||||
OrderCarResponse.CarOrderSettlementDetail carOrderSettlementDetail = carSettlementDetailList.get(0);
|
OrderCarResponse.CarOrderSettlementDetail carOrderSettlementDetail = carSettlementDetailList.get(0);
|
||||||
OrderCarResponse.CarOrderSettlementBaseInfo settlementBaseInfo = carOrderSettlementDetail.getSettlementBaseInfo();
|
OrderCarResponse.CarOrderSettlementBaseInfo settlementBaseInfo = carOrderSettlementDetail.getSettlementBaseInfo();
|
||||||
if (settlementBaseInfo != null) {
|
/*if (settlementBaseInfo != null) {
|
||||||
CTripCarRecordBase ctripCarOrderDetail = new CTripCarRecordBase();
|
CtripCarOrderDetail ctripCarOrderDetail = new CtripCarOrderDetail();
|
||||||
ctripCarOrderDetail = ctripCarOrderDetail.changeInfo(settlementBaseInfo);
|
ctripCarOrderDetail = ctripCarOrderDetail.changeInfo(settlementBaseInfo);
|
||||||
ctripOrderDetailRepository.save(ctripCarOrderDetail);
|
ctripOrderDetailRepository.save(ctripCarOrderDetail);
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -596,26 +583,4 @@ public class CTripTest {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Test
|
|
||||||
void findRecord(){
|
|
||||||
CTripFlightRecord byId = cTripOrderDetail.findFlightRecordById(14513L);
|
|
||||||
Gson gson = new Gson();
|
|
||||||
System.out.println(gson.toJson(byId));
|
|
||||||
}
|
|
||||||
|
|
||||||
// @Test
|
|
||||||
void findHotelRecord(){
|
|
||||||
CTripHotelRecord byId = cTripOrderDetail.findHotelRecordByRecordId("97211839");
|
|
||||||
Gson gson = new Gson();
|
|
||||||
System.out.println(gson.toJson(byId));
|
|
||||||
}
|
|
||||||
|
|
||||||
// @Test
|
|
||||||
void findCarRecord(){
|
|
||||||
CTripCarRecord byId = cTripOrderDetail.findCarRecordByRecordId("50597248");
|
|
||||||
Gson gson = new Gson();
|
|
||||||
System.out.println(gson.toJson(byId));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,23 +10,25 @@ import com.authine.cloudpivot.opensdk.config.CloudpivotEnvConfig;
|
||||||
import com.authine.cloudpivot.opensdk.model.request.workflow.StartWorkflowRequest;
|
import com.authine.cloudpivot.opensdk.model.request.workflow.StartWorkflowRequest;
|
||||||
import com.authine.cloudpivot.opensdk.model.response.workflow.StartWorkflowResponse;
|
import com.authine.cloudpivot.opensdk.model.response.workflow.StartWorkflowResponse;
|
||||||
import com.chint.application.commands.RefundOrderGenerateCommand;
|
import com.chint.application.commands.RefundOrderGenerateCommand;
|
||||||
|
import com.chint.application.in.AutoWorkController;
|
||||||
|
import com.chint.application.in.RouteOrderPageDto;
|
||||||
import com.chint.application.services.login.strategy.ANFeiShuLoginStrategy;
|
import com.chint.application.services.login.strategy.ANFeiShuLoginStrategy;
|
||||||
import com.chint.application.services.login.strategy.FeishuLoginStrategy;
|
import com.chint.domain.aggregates.order.*;
|
||||||
import com.chint.domain.aggregates.order.Leg;
|
import com.chint.domain.aggregates.order.order_record.OrderHotelRecord;
|
||||||
import com.chint.domain.aggregates.order.OrderDetail;
|
|
||||||
import com.chint.domain.aggregates.order.order_record.ly_order_record.LyOrderCarRecord;
|
import com.chint.domain.aggregates.order.order_record.ly_order_record.LyOrderCarRecord;
|
||||||
import com.chint.domain.aggregates.order.order_record.ly_order_record.LyOrderFlightRecord;
|
import com.chint.domain.aggregates.order.order_record.ly_order_record.LyOrderFlightRecord;
|
||||||
import com.chint.domain.aggregates.order.order_record.ly_order_record.LyOrderHotelRecord;
|
import com.chint.domain.aggregates.order.order_record.ly_order_record.LyOrderHotelRecord;
|
||||||
import com.chint.domain.aggregates.order.order_record.ly_order_record.LyOrderTrainRecord;
|
import com.chint.domain.aggregates.order.order_record.ly_order_record.LyOrderTrainRecord;
|
||||||
import com.chint.domain.aggregates.standards.StaffRank;
|
import com.chint.domain.aggregates.standards.StaffRank;
|
||||||
import com.chint.domain.aggregates.standards.XNStaffRank;
|
import com.chint.domain.aggregates.standards.XNStaffRank;
|
||||||
|
import com.chint.domain.factoriy.order_record.OrderRecordBasic;
|
||||||
import com.chint.infrastructure.config.LogConfig.LogController;
|
import com.chint.infrastructure.config.LogConfig.LogController;
|
||||||
import com.chint.infrastructure.config.LogConfig.RedisCache;
|
import com.chint.infrastructure.config.LogConfig.RedisCache;
|
||||||
import com.chint.infrastructure.config.LogConfig.SystemLog;
|
import com.chint.infrastructure.config.LogConfig.SystemLog;
|
||||||
import com.chint.infrastructure.echo_framework.command.Command;
|
import com.chint.infrastructure.echo_framework.command.Command;
|
||||||
import com.chint.infrastructure.repository.jdbc.*;
|
import com.chint.infrastructure.repository.jdbc.*;
|
||||||
import com.chint.infrastructure.util.BaseContext;
|
|
||||||
import com.chint.infrastructure.util.BeanCopyUtils;
|
import com.chint.infrastructure.util.BeanCopyUtils;
|
||||||
|
import com.chint.infrastructure.util.PageResult;
|
||||||
import com.chint.infrastructure.util.Result;
|
import com.chint.infrastructure.util.Result;
|
||||||
import com.chint.interfaces.rest.base.PostRequest;
|
import com.chint.interfaces.rest.base.PostRequest;
|
||||||
import com.chint.interfaces.rest.bpm.XNBPM.YSTokenDto;
|
import com.chint.interfaces.rest.bpm.XNBPM.YSTokenDto;
|
||||||
|
@ -41,6 +43,7 @@ import com.chint.interfaces.rest.ctrip.dto.search.car.OrderFee;
|
||||||
import com.chint.interfaces.rest.ctrip.dto.search.flight.ChangeInfo;
|
import com.chint.interfaces.rest.ctrip.dto.search.flight.ChangeInfo;
|
||||||
import com.chint.interfaces.rest.ctrip.dto.search.flight.FlightOrderInfoEntity;
|
import com.chint.interfaces.rest.ctrip.dto.search.flight.FlightOrderInfoEntity;
|
||||||
import com.chint.interfaces.rest.ly.LYSearchRequest;
|
import com.chint.interfaces.rest.ly.LYSearchRequest;
|
||||||
|
import com.chint.interfaces.rest.ly.dto.LYBaseRequest;
|
||||||
import com.chint.interfaces.rest.ly.dto.search.response.filght.FlightOrderResponse;
|
import com.chint.interfaces.rest.ly.dto.search.response.filght.FlightOrderResponse;
|
||||||
import com.chint.interfaces.rest.ly.dto.search.response.train.TrainDetailResponse;
|
import com.chint.interfaces.rest.ly.dto.search.response.train.TrainDetailResponse;
|
||||||
import com.chint.interfaces.rest.ly.reconciliation.dto.BaseDetailParam;
|
import com.chint.interfaces.rest.ly.reconciliation.dto.BaseDetailParam;
|
||||||
|
@ -48,16 +51,22 @@ import com.chint.interfaces.rest.ly.reconciliation.dto.DetailResponse.CarStateme
|
||||||
import com.chint.interfaces.rest.ly.reconciliation.dto.DetailResponse.FlightStatement;
|
import com.chint.interfaces.rest.ly.reconciliation.dto.DetailResponse.FlightStatement;
|
||||||
import com.chint.interfaces.rest.ly.reconciliation.dto.DetailResponse.HotelStatement;
|
import com.chint.interfaces.rest.ly.reconciliation.dto.DetailResponse.HotelStatement;
|
||||||
import com.chint.interfaces.rest.ly.reconciliation.dto.DetailResponse.TrainStatement;
|
import com.chint.interfaces.rest.ly.reconciliation.dto.DetailResponse.TrainStatement;
|
||||||
|
import com.chint.interfaces.rest.ly.reconciliation.dto.PageInfo;
|
||||||
import com.chint.interfaces.rest.ly.reconciliation.dto.statementList.ResStatementList;
|
import com.chint.interfaces.rest.ly.reconciliation.dto.statementList.ResStatementList;
|
||||||
import com.chint.interfaces.rest.ly.reconciliation.dto.statementList.StatementList;
|
import com.chint.interfaces.rest.ly.reconciliation.dto.statementList.StatementList;
|
||||||
import com.chint.interfaces.rest.ly.reconciliation.dto.statementList.StatementPageList;
|
import com.chint.interfaces.rest.ly.reconciliation.dto.statementList.StatementPageList;
|
||||||
import com.chint.interfaces.rest.ly.reconciliation.request.ReqStatement;
|
import com.chint.interfaces.rest.ly.reconciliation.request.ReqStatement;
|
||||||
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.reflect.TypeToken;
|
import com.google.gson.reflect.TypeToken;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.boot.test.context.SpringBootTest;
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
|
import org.springframework.context.ApplicationContext;
|
||||||
|
import org.springframework.data.domain.Page;
|
||||||
|
import org.springframework.data.domain.PageRequest;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.lang.reflect.Type;
|
import java.lang.reflect.Type;
|
||||||
|
@ -67,12 +76,11 @@ import java.time.LocalDate;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.concurrent.atomic.AtomicReference;
|
||||||
|
import java.util.function.Consumer;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
import java.util.stream.Collectors;
|
|
||||||
import java.util.stream.Stream;
|
|
||||||
|
|
||||||
import static com.chint.infrastructure.constant.BPMConstant.AN_FSSC;
|
|
||||||
import static com.chint.infrastructure.constant.BPMConstant.YSBPM_TOKEN_URL;
|
import static com.chint.infrastructure.constant.BPMConstant.YSBPM_TOKEN_URL;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
|
@ -470,7 +478,7 @@ public class ExcelTest {
|
||||||
@Autowired
|
@Autowired
|
||||||
private ANFeiShuLoginStrategy anFeiShuLoginStrategy;
|
private ANFeiShuLoginStrategy anFeiShuLoginStrategy;
|
||||||
|
|
||||||
@Test
|
// @Test
|
||||||
void ssoLogin() {
|
void ssoLogin() {
|
||||||
String login = anFeiShuLoginStrategy.login("b28o253524f34b25bd4da9ed3a224548");
|
String login = anFeiShuLoginStrategy.login("b28o253524f34b25bd4da9ed3a224548");
|
||||||
System.out.println(login);
|
System.out.println(login);
|
||||||
|
@ -503,6 +511,12 @@ public class ExcelTest {
|
||||||
ResStatementList resStatementList = reqStatement.queryStatementList(statementList);
|
ResStatementList resStatementList = reqStatement.queryStatementList(statementList);
|
||||||
log.info("resStatementList: {}", resStatementList);
|
log.info("resStatementList: {}", resStatementList);
|
||||||
ArrayList<ResStatementList.OnlineStatementList> onlineStatementList = resStatementList.getData().getOnlineStatementList();
|
ArrayList<ResStatementList.OnlineStatementList> onlineStatementList = resStatementList.getData().getOnlineStatementList();
|
||||||
|
// 获取当前时间
|
||||||
|
LocalDate now = LocalDate.now();
|
||||||
|
LocalDate startDate = now.minusMonths(2).withDayOfMonth(1);
|
||||||
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||||
|
String startTime = startDate.atStartOfDay().format(formatter);
|
||||||
|
String endTime = LocalDateTime.now().format(formatter);
|
||||||
for (ResStatementList.OnlineStatementList onlineStatement : onlineStatementList) {
|
for (ResStatementList.OnlineStatementList onlineStatement : onlineStatementList) {
|
||||||
String statementCode = onlineStatement.getStatementCode();//对账单编码
|
String statementCode = onlineStatement.getStatementCode();//对账单编码
|
||||||
|
|
||||||
|
@ -517,7 +531,7 @@ public class ExcelTest {
|
||||||
//保存数据
|
//保存数据
|
||||||
List<FlightStatement.StatementOrderList> statementOrderList = flightStatement.getData().getStatementOrderList();
|
List<FlightStatement.StatementOrderList> statementOrderList = flightStatement.getData().getStatementOrderList();
|
||||||
//查询已经保存的数据
|
//查询已经保存的数据
|
||||||
List<String> orderSerialNoList = jdbcLyOrderFlightRecord.queryBillOrderNo("2024-03-01 00:00:00", "2024-03-26 23:00:00");
|
List<String> orderSerialNoList = jdbcLyOrderFlightRecord.queryBillOrderNo(startTime, endTime);
|
||||||
//过滤出已经保存的数据
|
//过滤出已经保存的数据
|
||||||
List<FlightStatement.StatementOrderList> statementOrderListNew = statementOrderList.stream().filter(o ->
|
List<FlightStatement.StatementOrderList> statementOrderListNew = statementOrderList.stream().filter(o ->
|
||||||
!orderSerialNoList.contains(o.getBillOrderNo())
|
!orderSerialNoList.contains(o.getBillOrderNo())
|
||||||
|
@ -537,7 +551,7 @@ public class ExcelTest {
|
||||||
//保存数据
|
//保存数据
|
||||||
List<HotelStatement.StatementOrderList> statementOrderList = hotelStatement.getData().getStatementOrderList();
|
List<HotelStatement.StatementOrderList> statementOrderList = hotelStatement.getData().getStatementOrderList();
|
||||||
//查询已经保存的数据
|
//查询已经保存的数据
|
||||||
List<String> orderSerialNoList = jdbcLyOrderHotelRecord.queryBillOrderNo("2024-03-01 00:00:00", "2024-03-26 23:00:00");
|
List<String> orderSerialNoList = jdbcLyOrderHotelRecord.queryBillOrderNo(startTime, endTime);
|
||||||
//过滤出已经保存的数据
|
//过滤出已经保存的数据
|
||||||
List<HotelStatement.StatementOrderList> statementOrderListNew = statementOrderList.stream().filter(o ->
|
List<HotelStatement.StatementOrderList> statementOrderListNew = statementOrderList.stream().filter(o ->
|
||||||
!orderSerialNoList.contains(o.getBillOrderNo())
|
!orderSerialNoList.contains(o.getBillOrderNo())
|
||||||
|
@ -557,7 +571,7 @@ public class ExcelTest {
|
||||||
//保存数据
|
//保存数据
|
||||||
List<TrainStatement.StatementOrderList> statementOrderList = trainStatement.getData().getStatementOrderList();
|
List<TrainStatement.StatementOrderList> statementOrderList = trainStatement.getData().getStatementOrderList();
|
||||||
//查询已经保存的数据
|
//查询已经保存的数据
|
||||||
List<String> orderSerialNoList = jdbcLyOrderTrainRecord.queryBillOrderNo("2024-03-01 00:00:00", "2024-03-26 23:00:00");
|
List<String> orderSerialNoList = jdbcLyOrderTrainRecord.queryBillOrderNo(startTime, endTime);
|
||||||
//过滤出已经保存的数据
|
//过滤出已经保存的数据
|
||||||
List<TrainStatement.StatementOrderList> statementOrderListNew = statementOrderList.stream().filter(o ->
|
List<TrainStatement.StatementOrderList> statementOrderListNew = statementOrderList.stream().filter(o ->
|
||||||
!orderSerialNoList.contains(o.getBillOrderNo())
|
!orderSerialNoList.contains(o.getBillOrderNo())
|
||||||
|
@ -578,7 +592,7 @@ public class ExcelTest {
|
||||||
//保存数据
|
//保存数据
|
||||||
List<CarStatement.StatementOrderList> statementOrderList = carStatement.getData().getStatementOrderList();
|
List<CarStatement.StatementOrderList> statementOrderList = carStatement.getData().getStatementOrderList();
|
||||||
//查询已经保存的数据
|
//查询已经保存的数据
|
||||||
List<String> orderSerialNoList = jdbcLyOrderCarRecord.queryBillOrderNo("2024-03-01 00:00:00", "2024-03-26 23:00:00");
|
List<String> orderSerialNoList = jdbcLyOrderCarRecord.queryBillOrderNo(startTime, endTime);
|
||||||
//过滤出已经保存的数据
|
//过滤出已经保存的数据
|
||||||
List<CarStatement.StatementOrderList> statementOrderListNew = statementOrderList.stream().filter(o ->
|
List<CarStatement.StatementOrderList> statementOrderListNew = statementOrderList.stream().filter(o ->
|
||||||
!orderSerialNoList.contains(o.getBillOrderNo())
|
!orderSerialNoList.contains(o.getBillOrderNo())
|
||||||
|
@ -593,19 +607,186 @@ public class ExcelTest {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Test
|
// @Test
|
||||||
void awwe1() {
|
void awwe1() {
|
||||||
|
int count = 0;//初始化变量
|
||||||
|
int pageSize = 10; // 假设每页大小为10
|
||||||
|
int LoopNum;//需要的循环数
|
||||||
|
do {
|
||||||
|
PageRequest pageResult = PageRequest.of(count, pageSize);
|
||||||
|
Page<LyOrderFlightRecord> lyOrderFlightRecordPage = jdbcLyOrderFlightRecord.findAllByStatusIsNull(pageResult);
|
||||||
|
long totalElements = lyOrderFlightRecordPage.getTotalElements();//总数
|
||||||
|
LoopNum = (int) Math.ceil((double) totalElements / pageSize); // 计算总页数并向上取整
|
||||||
|
//数据
|
||||||
|
List<LyOrderFlightRecord> lyOrderFlightRecordPageList = lyOrderFlightRecordPage.toList();
|
||||||
|
|
||||||
|
count++;
|
||||||
|
} while (count < LoopNum);
|
||||||
|
//修改数据,将状态为null的设置为1
|
||||||
|
jdbcLyOrderFlightRecord.updateStatusByNullStatus();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ApplicationContext applicationContext;
|
||||||
|
|
||||||
|
// @Test
|
||||||
|
public void hauwsdhauh() {
|
||||||
|
String[] beanDefinitionNames = applicationContext.getBeanDefinitionNames();
|
||||||
|
String jsonString = JSON.toJSONString(beanDefinitionNames);
|
||||||
|
System.out.println("beanDefinitionNames = " + jsonString);
|
||||||
|
Object bean = applicationContext.getBean("orderDomainService");
|
||||||
|
System.out.println("bean = " + bean);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testDto() {
|
||||||
|
AtomicReference<OrderDetail> orderDetailRef = new AtomicReference<>();
|
||||||
|
OrderRecordBasic orderRecordBasic = getOrderRecordBasic("123", orderDetailRef::set);
|
||||||
|
OrderDetail orderDetail = orderDetailRef.get();
|
||||||
|
String orderNo = orderDetail.getOrderNo();
|
||||||
|
System.out.println("orderNo = " + orderNo);
|
||||||
|
System.out.println("orderNo = " + orderDetail);
|
||||||
|
|
||||||
|
OrderRecordBasic orderRecordBasic22 = getOrderRecordBasic22("123", orderDetailRef::set);
|
||||||
|
OrderDetail orderDetail22 = orderDetailRef.get();
|
||||||
|
String orderNo22 = orderDetail22.getOrderNo();
|
||||||
|
System.out.println("orderNo = " + orderNo22);
|
||||||
|
System.out.println("orderNo = " + orderDetail);
|
||||||
|
if (orderDetail22.equals(orderDetail) || orderDetail == orderDetail22) {
|
||||||
|
System.out.println("orderNo22 = " + orderNo22);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public OrderRecordBasic getOrderRecordBasic(String orderSerialNo, Consumer<OrderDetail> consumer) {
|
||||||
|
OrderDetail orderDetail = new OrderDetail();
|
||||||
|
orderDetail.setOrderNo("1234561");
|
||||||
|
consumer.accept(orderDetail);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public OrderRecordBasic getOrderRecordBasic22(String orderSerialNo, Consumer<OrderDetail> consumer) {
|
||||||
|
OrderDetail orderDetail = new OrderDetail();
|
||||||
|
orderDetail.setOrderNo("123456122");
|
||||||
|
consumer.accept(orderDetail);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testStrDto() {
|
||||||
|
String ab = "dadasd";
|
||||||
|
String[] split = ab.split("-");
|
||||||
|
System.out.println("split[0] = " + split[0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
//获取账期号
|
||||||
|
@Test
|
||||||
|
public void getAccountPeriod() {
|
||||||
|
// 获取当前时间
|
||||||
|
LocalDate now = LocalDate.now();
|
||||||
|
LocalDate startDate = now.minusMonths(2).withDayOfMonth(1);
|
||||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||||
LocalDate parse = LocalDate.parse("2024-01-04 00:00:00",formatter);
|
String startTime = startDate.atStartOfDay().format(formatter);
|
||||||
LocalDate firstDayOfLastMonth = parse.minusMonths(1).withDayOfMonth(1);
|
System.out.println("startTime = " + startTime);
|
||||||
LocalDate lastDayOfLastMonth = parse.withDayOfMonth(1).minusDays(1);
|
String endTime = LocalDateTime.now().format(formatter);
|
||||||
|
System.out.println("endTime = " + endTime);
|
||||||
String beginDate = firstDayOfLastMonth.atStartOfDay().format(formatter);
|
|
||||||
System.out.println("beginDate = " + beginDate);
|
|
||||||
String endDate = lastDayOfLastMonth.atTime(23, 59, 59).format(formatter);
|
|
||||||
System.out.println("endDate = " + endDate);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private JdbcRouteRepository repository;
|
||||||
|
|
||||||
|
// @Test
|
||||||
|
@Transactional
|
||||||
|
public void getRouteOrder() throws Exception {
|
||||||
|
int count = 0;//初始化变量
|
||||||
|
int pageSize = 100; // 假设每页大小为100
|
||||||
|
int LoopNum;//需要的循环数
|
||||||
|
PageInfo pageInfo = new PageInfo();
|
||||||
|
pageInfo.setPageSize(pageSize);
|
||||||
|
String url = "http://127.0.0.1:8081/public/routeOrder/pageQuery";
|
||||||
|
do {
|
||||||
|
pageInfo.setPageIndex(count + 1);
|
||||||
|
RouteOrderPageDto routeOrderPageDto = postRequest.postJSON(url, pageInfo, RouteOrderPageDto.class);
|
||||||
|
PageResult<RouteOrder> pageResult = routeOrderPageDto.getData();
|
||||||
|
long totalElements = pageResult.getTotal();//总数
|
||||||
|
LoopNum = (int) Math.ceil((double) totalElements / pageSize); // 计算总页数并向上取整
|
||||||
|
//保存数据
|
||||||
|
List<RouteOrder> records = pageResult.getRecords();
|
||||||
|
for (RouteOrder record : records) {
|
||||||
|
record.setRouteId(null);
|
||||||
|
List<Leg> legItems = record.getLegItems();
|
||||||
|
for (Leg legItem : legItems) {
|
||||||
|
legItem.setLegId(null);
|
||||||
|
legItem.setRouteId(null);
|
||||||
|
|
||||||
|
List<LegEvent> eventList = legItem.getEventList();
|
||||||
|
for (LegEvent legEvent : eventList) {
|
||||||
|
legEvent.setLegEventId(null);
|
||||||
|
legEvent.setLegId(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
LegExtensionField legExtensionField = legItem.getLegExtensionField();
|
||||||
|
if (legExtensionField != null) {
|
||||||
|
legExtensionField.setId(null);
|
||||||
|
legExtensionField.setLegId(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
List<OrderDetail> orderDetails = record.getOrderDetails();
|
||||||
|
for (OrderDetail orderDetail : orderDetails) {
|
||||||
|
orderDetail.setOrderId(null);
|
||||||
|
orderDetail.setRouteId(null);
|
||||||
|
orderDetail.setLegId(null);
|
||||||
|
List<OrderEvent> orderEventList = orderDetail.getOrderEventList();
|
||||||
|
for (OrderEvent orderEvent : orderEventList) {
|
||||||
|
orderEvent.setOrderEventId(null);
|
||||||
|
orderEvent.setOrderId(null);
|
||||||
|
}
|
||||||
|
CarOrderDetail carOrderDetail = orderDetail.getCarOrderDetail();
|
||||||
|
if (carOrderDetail != null) {
|
||||||
|
carOrderDetail.setId(null);
|
||||||
|
}
|
||||||
|
FlightOrderDetail flightOrderDetail = orderDetail.getFlightOrderDetail();
|
||||||
|
if (flightOrderDetail != null) {
|
||||||
|
flightOrderDetail.setId(null);
|
||||||
|
}
|
||||||
|
HotelOrderDetail hotelOrderDetail = orderDetail.getHotelOrderDetail();
|
||||||
|
if (hotelOrderDetail != null) {
|
||||||
|
hotelOrderDetail.setId(null);
|
||||||
|
List<HotelOrderDetailCustomer> customers = hotelOrderDetail.getCustomers();
|
||||||
|
for (HotelOrderDetailCustomer customer : customers) {
|
||||||
|
customer.setId(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
TrainOrderDetail trainOrderDetail = orderDetail.getTrainOrderDetail();
|
||||||
|
if (trainOrderDetail != null) {
|
||||||
|
trainOrderDetail.setId(null);
|
||||||
|
}
|
||||||
|
OtherOrderDetail otherOrderDetail = orderDetail.getOtherOrderDetail();
|
||||||
|
if (otherOrderDetail != null) {
|
||||||
|
otherOrderDetail.setId(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
List<ApprovalEvent> approveEvents = record.getApproveEvents();
|
||||||
|
for (ApprovalEvent approveEvent : approveEvents) {
|
||||||
|
approveEvent.setRouteId(null);
|
||||||
|
approveEvent.setApprovalEventId(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
log.info(JSON.toJSONString(records));
|
||||||
|
repository.saveAll(pageResult.getRecords());
|
||||||
|
|
||||||
|
|
||||||
|
count++;
|
||||||
|
} while (count < LoopNum);
|
||||||
|
log.info("成功");
|
||||||
|
if (true) {
|
||||||
|
log.info("成功");
|
||||||
|
throw new Exception();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -811,7 +811,7 @@ public class LYTest {
|
||||||
System.out.println(json);
|
System.out.println(json);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
// @Test
|
||||||
void searchTrain() {
|
void searchTrain() {
|
||||||
TrainDetailResponse trainOrderDetail = lySearchRequest.getTrainOrderDetail("DTC24032868398852849");
|
TrainDetailResponse trainOrderDetail = lySearchRequest.getTrainOrderDetail("DTC24032868398852849");
|
||||||
Gson gson = new Gson();
|
Gson gson = new Gson();
|
||||||
|
@ -921,14 +921,14 @@ public class LYTest {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
// @Test
|
||||||
void syncToSupplierOne(){
|
void syncToSupplierOne(){
|
||||||
RouteOrder routeOrder = routeRepository.queryById(665L);
|
RouteOrder routeOrder = routeRepository.queryById(665L);
|
||||||
lyOrderSyncAdapter.syncSupplierOrder(routeOrder);
|
lyOrderSyncAdapter.syncSupplierOrder(routeOrder);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Test
|
// @Test
|
||||||
void queryHotelCustom(){
|
void queryHotelCustom(){
|
||||||
OrderDetail byId = orderDetailRepository.findById(2569L);
|
OrderDetail byId = orderDetailRepository.findById(2569L);
|
||||||
HotelOrderDetailDto hotelOrderDetailDto = HotelOrderDetailDto.copyFrom(byId.getHotelOrderDetail());
|
HotelOrderDetailDto hotelOrderDetailDto = HotelOrderDetailDto.copyFrom(byId.getHotelOrderDetail());
|
||||||
|
|
Loading…
Reference in New Issue