fix:修复消费明细和行程节点状态缺少映射的问题

This commit is contained in:
lulz1 2024-05-24 16:46:30 +08:00
parent 5f282e7d25
commit 2986559831
5 changed files with 36 additions and 31 deletions

View File

@ -244,4 +244,6 @@ public class OrderDetailController {
return Result.Success(SUCCESS, flightOrderDetail);
}
}

View File

@ -210,16 +210,18 @@ public class SupplierServiceImpl implements SupplierService {
//为行程添加下单事件
public OrderDetail orderLeg(Leg leg, OrderDetail orderDetail) {
String orderStatus = orderDetail.getOrderStatus();
String orderStatus = orderDetail.reloadStatus().getOrderStatus();
LegEvent legEvent;
switch (orderStatus) {
case ORDER_EVENT_ORDERED_NAME:
case ORDER_EVENT_PAYED_NAME:
case ORDER_EVENT_CHANGE_NAME:
case ORDER_EVENT_ETA_NAME:
case ORDER_EVENT_FINISH_NAME:
legEvent = legEventFactory.creatLegEvent(LEG_EVENT_ORDERED);
break;
case ORDER_EVENT_REFUND_NAME:
case ORDER_EVENT_PREPARE_NAME:
case ORDER_EVENT_CANCEL_NAME:
legEvent = legEventFactory.creatLegEvent(LEG_EVENT_NOT_ORDERED);
break;
@ -526,6 +528,7 @@ public class SupplierServiceImpl implements SupplierService {
}
}
}
return commands;
}

View File

@ -87,33 +87,33 @@ public class CommonController {
@PostMapping("/back")
public LYNoteResponse Back(@RequestBody Notification notification) {
// int notifyType = notification.getNotifyType();
// switch (notifyType) {
// //进行订单数据回推
// case 1 -> getOrderFlight(notification);
// case 3 -> getOrderHotel(notification);
// case 5 -> getOrderTrain(notification);
// case 6 -> getOrderCar(notification);
// default -> LYNoteResponse.success();
// }
if (ifForwardRequest) {
CompletableFuture.runAsync(() -> {
log.info("转发同程订单状态推送");
LYNoteResponse response = basePostRequest
.post(forwardRequestBaseUrl + forwardRequestPath, notification, LYNoteResponse.class);
if (response.getResCode().equals("100")) {
log.info("转发同程订单状态推送成功");
} else {
log.info("转发同程订单状态推送失败");
}
});
int notifyType = notification.getNotifyType();
switch (notifyType) {
//进行订单数据回推
case 1 -> getOrderFlight(notification);
case 3 -> getOrderHotel(notification);
case 5 -> getOrderTrain(notification);
case 6 -> getOrderCar(notification);
default -> LYNoteResponse.success();
}
String json = gson.toJson(notification);
log.info("存入Redis{}", json);
redisTemplate.opsForList().leftPush(CommonMessageConstant.COMMON_BACK, json);
// if (ifForwardRequest) {
// CompletableFuture.runAsync(() -> {
// log.info("转发同程订单状态推送");
// LYNoteResponse response = basePostRequest
// .post(forwardRequestBaseUrl + forwardRequestPath, notification, LYNoteResponse.class);
// if (response.getResCode().equals("100")) {
// log.info("转发同程订单状态推送成功");
// } else {
// log.info("转发同程订单状态推送失败");
// }
// });
// }
//
// String json = gson.toJson(notification);
// log.info("存入Redis{}", json);
// redisTemplate.opsForList().leftPush(CommonMessageConstant.COMMON_BACK, json);
return new LYNoteResponse("100", "OK");
}

View File

@ -46,10 +46,10 @@ logging:
#正式
ly:
appId: zhengtai
account: ab9fe0c19dd64a99b936fded72c3bb94
password: glHRJJ9JMUwNfQ8OwAQi
secret: MnghmYJpM1U2RaLx
baseUrl: https://api.dttrip.cn/openapi
account: 4f9cb1080b564dd0a94aa95f7a19c8b5
password: 1fD3SutgzfS48qznYQiq
secret: WOHzCMvHd823iHgH
baseUrl: https://api.qa.dttrip.cn/openapi
ifForwardRequest: false
forwardRequestBaseUrl: https://secureqrdev-t.chint.com/llz

View File

@ -812,7 +812,7 @@ public class LYTest {
@Test
void searchFlight() {
FlightOrderResponse flightOrderDetail = lySearchRequest.getFlightOrderDetail("DF24040869327887639");
FlightOrderResponse flightOrderDetail = lySearchRequest.getFlightOrderDetail("DF24032968512339782");
Gson gson = new Gson();
String json = gson.toJson(flightOrderDetail);
System.out.println(json);