已合并 PR 10100: 修复携程飞机订单明细拆分逻辑

This commit is contained in:
卢麟哲 2024-03-19 18:23:44 +08:00
commit 1dec2d6502
8 changed files with 17 additions and 22 deletions

View File

@ -226,7 +226,7 @@ public class CTripOrderExtensionFactoryImpl implements OrderExtensionFactory {
flightOrderDetail.setOrderAmount(String.valueOf(flightOrderBasicInfo.getAmount()));
//只有下单成功得状态会收取服务费
if (flightOrderDetail.equals(FSSC_FLIGHT_STATUS_SUCCESS)) {
if (flightOrderDetail.getOrderStatus().equals(FSSC_FLIGHT_STATUS_SUCCESS)) {
flightOrderDetail.setPostServiceFee(String.valueOf(flightOrderBasicInfo.getPostBasicServiceFee()));
} else {
flightOrderDetail.setPostServiceFee(KEEP_TWO_DECIMAL_ZERO);
@ -308,7 +308,13 @@ public class CTripOrderExtensionFactoryImpl implements OrderExtensionFactory {
SequenceInfo sequenceInfo = sequenceInfoList.get(0);
if (sequenceInfo.getChangeInfo() != null && !sequenceInfo.getChangeInfo().isEmpty() &&
flightOrderDetail.getOrderStatus().equals(FSSC_FLIGHT_STATUS_CHANGE)) {
ChangeInfo changeInfo = sequenceInfo.getChangeInfo().get(0);
String[] split = flightOrderDetail.getDetailId().split("-");
//要找出对应退票信息
ChangeInfo changeInfo = sequenceInfo
.getChangeInfo()
.stream()
.filter(it -> it.getRebookId().equals(Integer.parseInt(split[1])))
.toList().get(0);
flightOrderDetail.setUpFee(String.valueOf(changeInfo.getPriceDifferential()));
//如果是改签的要加入改签费
flightOrderDetail.setChangeFee(String.valueOf(changeInfo.getRebookServiceFee()));

View File

@ -20,7 +20,7 @@ public class DelayDispatch {
} finally {
scheduler.shutdown(); // 确保在任务执行完毕后关闭scheduler
}
}, 30, TimeUnit.SECONDS);
}, 5, TimeUnit.SECONDS);
}
}
}

View File

@ -2,20 +2,16 @@ package com.chint.interfaces.rest.bpm;
import com.chint.domain.aggregates.order.OrderTravel;
import com.chint.domain.aggregates.standards.TravelStandards;
import com.chint.domain.value_object.TravelStandardsData;
import com.chint.infrastructure.constant.BPMConstant;
import com.chint.infrastructure.constant.CommonMessageConstant;
import com.chint.infrastructure.repository.jdbc.JdbcOrderTravelRepository;
import com.chint.infrastructure.util.PageResult;
import com.chint.infrastructure.util.Result;
import com.chint.interfaces.rest.bpm.dot.BPMBack;
import com.chint.interfaces.rest.ctrip.CTripAuditRequest;
import com.chint.interfaces.rest.ly.dto.strokepush.Param;
import com.chint.interfaces.rest.ly.dto.strokepush.StrokeController;
import com.chint.interfaces.rest.ly.in.StrokeController;
import com.chint.interfaces.rest.ly.dto.strokepush.StrokePushDTO;
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;
@ -24,7 +20,6 @@ import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import static com.chint.infrastructure.constant.BPMConstant.*;
import static com.chint.infrastructure.constant.Constant.*;
import static com.chint.infrastructure.constant.SupplierNameConstant.*;

View File

@ -13,7 +13,6 @@ import com.chint.interfaces.rest.ly.dto.*;
import com.chint.interfaces.rest.ly.dto.flydatapushback.FlyOkDTO;
import com.chint.interfaces.rest.ly.dto.flydatapushback.ParamFly;
import com.chint.interfaces.rest.ly.dto.strokepush.Param;
import com.chint.interfaces.rest.ly.dto.strokepush.StrokeController;
import com.chint.interfaces.rest.ly.dto.strokepush.StrokePushDTO;
import com.chint.interfaces.rest.ly.dto.strokepush.StrokePushResult;
import com.chint.interfaces.rest.ly.dto.strokepush.TrainChange.TrainChangeParam;
@ -21,7 +20,6 @@ import com.chint.interfaces.rest.ly.dto.strokepush.TrainChange.TrainChangeReques
import com.chint.interfaces.rest.ly.tools.GetObjectNature;
import com.google.gson.Gson;
import lombok.extern.slf4j.Slf4j;
import org.apache.http.impl.client.HttpClients;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.PostMapping;

View File

@ -15,7 +15,6 @@ import com.chint.interfaces.rest.ly.dto.ResultBackFly;
import com.chint.interfaces.rest.ly.dto.flydatapushback.FlyDetailResult;
import com.chint.interfaces.rest.ly.dto.search.response.filght.FlightOrderResponse;
import com.chint.interfaces.rest.ly.dto.strokepush.Param;
import com.chint.interfaces.rest.ly.dto.strokepush.StrokeController;
import com.chint.interfaces.rest.ly.dto.strokepush.StrokePushDTO;
import com.google.gson.Gson;
import org.springframework.beans.factory.annotation.Autowired;

View File

@ -15,14 +15,12 @@ import com.chint.interfaces.rest.ly.dto.ResultBackHotel;
import com.chint.interfaces.rest.ly.dto.hotelorderdatapushbach.HotelDetailResult;
import com.chint.interfaces.rest.ly.dto.search.response.hotel.HotelDetailResponse;
import com.chint.interfaces.rest.ly.dto.strokepush.Param;
import com.chint.interfaces.rest.ly.dto.strokepush.StrokeController;
import com.chint.interfaces.rest.ly.dto.strokepush.StrokePushDTO;
import com.google.gson.Gson;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import static com.chint.infrastructure.constant.Constant.*;
import static com.chint.infrastructure.constant.LYConstant.L_Y_PRODUCT_TYPE_HOTEL;
import static com.chint.infrastructure.constant.OrderConstant.ORDER_EVENT_ETA;

View File

@ -18,7 +18,6 @@ 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 com.chint.interfaces.rest.ly.dto.strokepush.Param;
import com.chint.interfaces.rest.ly.dto.strokepush.StrokeController;
import com.chint.interfaces.rest.ly.dto.strokepush.StrokePushDTO;
import com.chint.interfaces.rest.ly.tools.LYOrderUtil;
import org.springframework.beans.factory.annotation.Autowired;

View File

@ -1,6 +1,9 @@
package com.chint.interfaces.rest.ly.dto.strokepush;
package com.chint.interfaces.rest.ly.in;
import com.chint.infrastructure.util.DelayDispatch;
import com.chint.interfaces.rest.ly.LYPostRequest;
import com.chint.interfaces.rest.ly.dto.strokepush.StrokePushDTO;
import com.chint.interfaces.rest.ly.dto.strokepush.StrokePushResult;
import jakarta.annotation.PostConstruct;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
@ -30,11 +33,8 @@ public class StrokeController {
}
@PostMapping("/push")
public Integer strokePush(@RequestBody StrokePushDTO strokePushDTO) {
Integer status = strokePushDTO.getParam().getApprovalStatus();
if (status == 1 || status == 2) {
StrokePushResult postData = postRequest.post(strokeUrl, strokePushDTO, StrokePushResult.class);
}
return status;
public void strokePush(@RequestBody StrokePushDTO strokePushDTO) {
DelayDispatch.attemptToSend(() ->postRequest.post(strokeUrl, strokePushDTO, StrokePushResult.class).getSuccess(),
0);
}
}