1.修改同程飞机 修改订单状态设置

This commit is contained in:
wanglf3 2024-03-16 18:09:04 +08:00
parent 93fd53b8a6
commit fd9c571c8c
8 changed files with 129 additions and 26 deletions

View File

@ -140,7 +140,9 @@ public class OrderDetailController {
if (productType == 2) {
HotelOrderDetail hotelOrderDetail = orderDetail.getHotelOrderDetail();
hotelOrderDetail.setOrderAmount(command.getAmount());
hotelOrderDetail.setOrderStatus(type);
hotelOrderDetail.setOrderStatus("3");
hotelOrderDetail.setOrderNo(newOrderNo);
hotelOrderDetail.setDetailId(newOrderNo);
hotelOrderDetail.setCreateTime(command.getCreateTime());
@ -156,7 +158,8 @@ public class OrderDetailController {
if (productType == 3) {
CarOrderDetail carOrderDetail = orderDetail.getCarOrderDetail();
carOrderDetail.setOrderAmount(command.getAmount());
carOrderDetail.setOrderStatus(type);
carOrderDetail.setOrderStatus("3");
carOrderDetail.setOrderNo(newOrderNo);
carOrderDetail.setDetailId(newOrderNo);
carOrderDetail.setCreateTime(command.getCreateTime());

View File

@ -70,6 +70,8 @@ public class OrderDetailQuery {
if (hotelOrderDetail.getBelongSysType() != null && hotelOrderDetail.getBelongSysType().equals(systemType)) {
orderDetailResList.add(hotelOrderDetail);
}
}
}
if (productType == 3) {

View File

@ -64,6 +64,68 @@ public class OrderEvent implements Serializable {
};
}
public String mapToFlightOrderDetailStatus(){
return switch (this.eventType) {
case ORDER_EVENT_PREPARE -> "1";
case ORDER_EVENT_PAYED -> "1";
case ORDER_EVENT_CHANGE -> "2";
case ORDER_EVENT_CANCEL -> "3";
case ORDER_EVENT_ORDERED -> "1";
case ORDER_EVENT_REFUND -> "3";
case ORDER_EVENT_UNKNOWN -> "1";
case ORDER_EVENT_FINISH -> "1";
case ORDER_EVENT_ETA -> "1";
default -> "未知事件";
};
}
public String mapToHotelOrderDetailStatus(){
return switch (this.eventType) {
case ORDER_EVENT_PREPARE -> "3"; //未下单 改成3
case ORDER_EVENT_PAYED -> "1";
case ORDER_EVENT_CHANGE -> "1";
case ORDER_EVENT_CANCEL -> "1"; //e额外生成的单子为3 退票虽然是3 返回为1
case ORDER_EVENT_ORDERED -> "1";
case ORDER_EVENT_REFUND -> "1";
case ORDER_EVENT_UNKNOWN -> "0";
case ORDER_EVENT_FINISH -> "1";
case ORDER_EVENT_ETA -> "1";
default -> "未知事件";
};
}
public String mapToTrainOrderDetailStatus(){
return switch (this.eventType) {
case ORDER_EVENT_PREPARE -> "1";
case ORDER_EVENT_PAYED -> "1";
case ORDER_EVENT_CHANGE -> "2";
case ORDER_EVENT_CANCEL -> "3";
case ORDER_EVENT_ORDERED -> "1";
case ORDER_EVENT_REFUND -> "3";
case ORDER_EVENT_UNKNOWN -> "0";
case ORDER_EVENT_FINISH -> "1";
case ORDER_EVENT_ETA -> "1";
default -> "未知事件";
};
}
public String mapToCarOrderDetailStatus(){
return switch (this.eventType) {
case ORDER_EVENT_PREPARE -> "1";
case ORDER_EVENT_PAYED -> "1";
case ORDER_EVENT_CHANGE -> "1";
case ORDER_EVENT_CANCEL -> "1";
case ORDER_EVENT_ORDERED -> "1";
case ORDER_EVENT_REFUND -> "1";
case ORDER_EVENT_UNKNOWN -> "0";
case ORDER_EVENT_FINISH -> "1";
case ORDER_EVENT_ETA -> "1";
default -> "未知事件";
};
}
public OrderEvent reloadStatus() {
this.setEventName(translateOrderEvent(this.eventType));
return this;

View File

@ -284,11 +284,10 @@ public class CTripOrderExtensionFactoryImpl implements OrderExtensionFactory {
}
//付款方式 ACCNT公司统付 其他类型个人支付
if (flightOrderBasicInfo.getPrepayType().equals("ACCNT")) {
flightOrderDetail.setPersonalPaymentAmount(String.valueOf(flightOrderBasicInfo.getAmount()));
flightOrderDetail.setCompanyPaymentAmount(String.valueOf(flightOrderBasicInfo.getAmount()));
} else {
flightOrderDetail.setPersonalPaymentAmount(String.valueOf(flightOrderBasicInfo.getAmount()));
}
}
if (flightInfo != null) {

View File

@ -143,7 +143,7 @@ public class LYOrderExtensionFactoryImpl implements OrderExtensionFactory {
first1.ifPresent(it ->{
OrderEvent lastEvent = it.getLastEvent();
if(lastEvent != null){
flightOrderDetail.setOrderStatus(lastEvent.mapToOrderDetailStatus());
flightOrderDetail.setOrderStatus(lastEvent.mapToFlightOrderDetailStatus());
}}
);
// flightOrderDetail.setScheduleNum(orderDetails.getTravelOrderNo());
@ -328,7 +328,7 @@ public class LYOrderExtensionFactoryImpl implements OrderExtensionFactory {
first1.ifPresent(it ->{
OrderEvent lastEvent = it.getLastEvent();
if(lastEvent != null){
hotelOrderDetail.setOrderStatus(lastEvent.mapToOrderDetailStatus());
hotelOrderDetail.setOrderStatus(lastEvent.mapToHotelOrderDetailStatus());
}}
);
@ -430,7 +430,7 @@ public class LYOrderExtensionFactoryImpl implements OrderExtensionFactory {
first1.ifPresent(it ->{
OrderEvent lastEvent = it.getLastEvent();
if(lastEvent != null){
trainOrderDetail.setOrderStatus(lastEvent.mapToOrderDetailStatus());
trainOrderDetail.setOrderStatus(lastEvent.mapToTrainOrderDetailStatus());
}}
);
String EmployeeNo = routeOrder.getUserId();
@ -585,7 +585,7 @@ public class LYOrderExtensionFactoryImpl implements OrderExtensionFactory {
firstOrderDetail.ifPresent(it ->{
OrderEvent lastEvent = it.getLastEvent();
if(lastEvent != null){
carOrderDetail.setOrderStatus(lastEvent.mapToOrderDetailStatus());
carOrderDetail.setOrderStatus(lastEvent.mapToCarOrderDetailStatus());
}}
);

View File

@ -37,9 +37,7 @@ import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.*;
import java.util.stream.Collectors;
import static com.chint.infrastructure.constant.SupplierNameConstant.SUPPLIER_C_TRIP;
@ -201,13 +199,7 @@ public class CTripTest {
System.out.println(gson.toJson(estimate));
}
// @Test
void search() {
BaseContext.setCurrentUser(user);
SearchOrderResponse response = orderSearchRequest.searchOrderResponseByOrderId("31024617012");
System.out.println(response);
}
// @Test
void searchAndHandlerData() {
@ -433,5 +425,48 @@ public class CTripTest {
}
}
}
@Test
void queryDistrictByCountryId() {
CountryInfoEntity countryInfoEntity = countryInfoEntityRepository.findById(336L);
QueryAllPOIInfoResponseType allPOIInfoQuery = cTripAllPOIInfoRequest.getAllPOIInfoQuery(1L);
Map<Long, POIData> poiDataByProvinceId = new HashMap<>();
for (POIData poiData : allPOIInfoQuery.getDataList()) {
poiDataByProvinceId.put(poiData.getProvinceId(), poiData);
}
for (POIDataInfoEntity poiDataInfoEntity : countryInfoEntity.getPoiDataInfoEntities()) {
POIData poiData = poiDataByProvinceId.get(poiDataInfoEntity.getProvinceId());
if (poiData != null) {
Map<Long, PrefectureLevelCityInfo> cityInfoByCityId = new HashMap<>();
for (PrefectureLevelCityInfo cityInfo : poiData.getPrefectureLevelCityInfoList()) {
cityInfoByCityId.put(cityInfo.getCityId(), cityInfo);
}
for (PrefectureLevelCityInfoEntity cityInfoEntity : poiDataInfoEntity.getPrefectureLevelCityInfoEntities()) {
PrefectureLevelCityInfo cityInfo = cityInfoByCityId.get(cityInfoEntity.getCityId());
if (cityInfo != null) {
if(cityInfo.getDistrictList() == null) continue;
for (DistrictPOIInfo districtPOIInfo : cityInfo.getDistrictList()) {
DistrictPOIInfoEntity districtPOIInfoEntity = new DistrictPOIInfoEntity();
districtPOIInfoEntity.setDistrictId(districtPOIInfo.getDistrictId());
districtPOIInfoEntity.setDistrictName(districtPOIInfo.getDistrictName());
districtPOIInfoEntity.setDistrictEnName(districtPOIInfo.getDistrictEnName());
cityInfoEntity.addDistrict(districtPOIInfoEntity);
}
}
}
}
}
countryInfoEntityRepository.save(countryInfoEntity);
System.out.println(allPOIInfoQuery);
}
// @Test
void search() {
BaseContext.setCurrentUser(user);
SearchOrderResponse response = orderSearchRequest.searchOrderResponseByOrderId("31100788726");
System.out.println(response);
}
}

View File

@ -789,11 +789,11 @@ public class LYTest {
@Test
void search(){
FlightOrderResponse t1 = lySearchRequest
.getFlightOrderDetail("DF24031466751565416");
Gson gson = new Gson();
String json = gson.toJson(t1);
System.out.println(json);
// FlightOrderResponse t1 = lySearchRequest
// .getFlightOrderDetail("DF24031466751565416");
// Gson gson = new Gson();
// String json = gson.toJson(t1);
// System.out.println(json);
// TrainDetailResponse trainDetailResponse = lySearchRequest.getTrainOrderDetail("DT24031466762140980");
@ -801,9 +801,9 @@ public class LYTest {
// String json = gson.toJson(trainDetailResponse);
// System.out.println(json);
// HotelDetailResponse trainDetailResponse = lySearchRequest.getHotelOrderDetail("HO20240302193400479205");
// Gson gson = new Gson();
// String json = gson.toJson(trainDetailResponse);
// System.out.println(json);
HotelDetailResponse trainDetailResponse = lySearchRequest.getHotelOrderDetail("HO20240314170700934118");
Gson gson = new Gson();
String json = gson.toJson(trainDetailResponse);
System.out.println(json);
}
}

View File

@ -921,4 +921,6 @@ class RouteApplicationTests {
System.out.println(locationList);
System.out.println(saveLocations);
}
}