已合并 PR 10103: 修复用户名缓存问题,修复机票明细问题
This commit is contained in:
commit
aa97c211ad
|
@ -193,6 +193,7 @@ public class OrderDetailQuery {
|
|||
CarOrderDetailDto orderDetailDto = CarOrderDetailDto.copyFrom(carOrderDetail);
|
||||
RouteOrder routeOrder = routeRepository.queryById(orderDetail.getRouteId());
|
||||
orderDetailDto.setApplicantId(routeOrder.getUserId());
|
||||
orderDetailDto.setMiles(carOrderDetail.getMileage());//打车里程数映射
|
||||
return orderDetailDto;
|
||||
}
|
||||
return null;
|
||||
|
|
|
@ -72,7 +72,7 @@ public class OrderEvent implements Serializable {
|
|||
case ORDER_EVENT_CHANGE -> FSSC_FLIGHT_STATUS_CHANGE;
|
||||
case ORDER_EVENT_CANCEL -> FSSC_ORDER_STATUS_CANCEL;
|
||||
case ORDER_EVENT_ORDERED -> FSSC_FLIGHT_STATUS_SUCCESS;
|
||||
case ORDER_EVENT_REFUND -> FSSC_FLIGHT_STATUS_REFUND;
|
||||
case ORDER_EVENT_REFUND -> FSSC_FLIGHT_STATUS_CHANGE;
|
||||
case ORDER_EVENT_UNKNOWN -> FSSC_FLIGHT_STATUS_SUCCESS;
|
||||
case ORDER_EVENT_FINISH -> FSSC_FLIGHT_STATUS_SUCCESS;
|
||||
case ORDER_EVENT_ETA -> FSSC_FLIGHT_STATUS_SUCCESS;
|
||||
|
|
|
@ -7,6 +7,7 @@ import com.chint.domain.repository.LocationRepository;
|
|||
import com.chint.domain.repository.OrderDetailRepository;
|
||||
import com.chint.domain.repository.RouteRepository;
|
||||
import com.chint.domain.repository.UserRepository;
|
||||
import com.chint.infrastructure.util.BigDecimalCalculator;
|
||||
import com.chint.interfaces.rest.ctrip.dto.search.car.*;
|
||||
import com.chint.interfaces.rest.ctrip.dto.search.flight.*;
|
||||
import com.chint.interfaces.rest.ctrip.dto.search.hotel.ClientInfo;
|
||||
|
@ -22,6 +23,7 @@ import java.util.Optional;
|
|||
import static com.chint.infrastructure.constant.BelongSystemConstant.*;
|
||||
import static com.chint.infrastructure.constant.CommonMessageConstant.NOT_FOUND;
|
||||
import static com.chint.infrastructure.constant.FSSCConstant.*;
|
||||
import static com.chint.infrastructure.constant.OrderConstant.ORDER_EVENT_CANCEL;
|
||||
import static com.chint.infrastructure.constant.OrderConstant.ORDER_EVENT_ETA;
|
||||
import static com.chint.infrastructure.constant.UtilConstant.KEEP_TWO_DECIMAL_ZERO;
|
||||
|
||||
|
@ -206,10 +208,9 @@ public class CTripOrderExtensionFactoryImpl implements OrderExtensionFactory {
|
|||
//处理订单的状态信息
|
||||
first.ifPresent(orderDetail -> {
|
||||
OrderEvent lastEvent = orderDetail.getLastEvent();
|
||||
if (lastEvent != null) {
|
||||
flightOrderDetail.setOrderStatus(lastEvent.mapToFlightOrderDetailStatus());
|
||||
} else {
|
||||
flightOrderDetail.setOrderStatus(FSSC_FLIGHT_STATUS_SUCCESS);
|
||||
flightOrderDetail.setOrderStatus(FSSC_FLIGHT_STATUS_SUCCESS);
|
||||
if (lastEvent != null && lastEvent.getEventType().equals(ORDER_EVENT_CANCEL)) {
|
||||
flightOrderDetail.setOrderStatus(FSSC_ORDER_STATUS_CANCEL);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -272,23 +273,15 @@ public class CTripOrderExtensionFactoryImpl implements OrderExtensionFactory {
|
|||
flightOrderDetail.setSeatPoint(flightInfo.getFlightClass());
|
||||
flightOrderDetail.setSeatPointName(flightInfo.getClassName());
|
||||
flightOrderDetail.setFlightModel(flightInfo.getFlight());
|
||||
//前后收服务费
|
||||
//前后收服务费,燃油费,机建费
|
||||
flightOrderDetail.setPreServiceFee(String.valueOf(flightInfo.getItineraryFee()));
|
||||
if (flightOrderDetail.getOrderStatus().equals(FSSC_FLIGHT_STATUS_SUCCESS)) {
|
||||
flightOrderDetail.setFuelTax(String.valueOf(flightInfo.getOilFee()));
|
||||
flightOrderDetail.setAirportTax(String.valueOf(flightInfo.getTax()));
|
||||
flightOrderDetail.setFacePrice(String.valueOf(flightInfo.getPrice()));
|
||||
flightOrderDetail.setStandard(flightInfo.getClassName() + flightInfo.getPriceRate());
|
||||
flightOrderDetail.setNotBookedLowestPriceReason(flightInfo.getReasonDesc());
|
||||
} else {
|
||||
flightOrderDetail.setFuelTax(KEEP_TWO_DECIMAL_ZERO);
|
||||
flightOrderDetail.setAirportTax(KEEP_TWO_DECIMAL_ZERO);
|
||||
flightOrderDetail.setFacePrice(KEEP_TWO_DECIMAL_ZERO);
|
||||
flightOrderDetail.setStandard(flightInfo.getClassName() + flightInfo.getPriceRate());
|
||||
}
|
||||
flightOrderDetail.setFuelTax(String.valueOf(flightInfo.getOilFee()));
|
||||
flightOrderDetail.setAirportTax(String.valueOf(flightInfo.getTax()));
|
||||
flightOrderDetail.setFacePrice(String.valueOf(flightInfo.getPrice()));
|
||||
flightOrderDetail.setStandard(flightInfo.getClassName() + flightInfo.getPriceRate());
|
||||
flightOrderDetail.setNotBookedLowestPriceReason(flightInfo.getReasonDesc());
|
||||
}
|
||||
|
||||
|
||||
List<TripRecordInfo> tripRecordInfoList = flightOrderInfoEntity.getTripRecordInfoList();
|
||||
if (tripRecordInfoList != null && !tripRecordInfoList.isEmpty()) {
|
||||
TripRecordInfo tripRecordInfo = tripRecordInfoList.get(0);
|
||||
|
@ -310,7 +303,7 @@ public class CTripOrderExtensionFactoryImpl implements OrderExtensionFactory {
|
|||
flightOrderDetail.getOrderStatus().equals(FSSC_FLIGHT_STATUS_CHANGE)) {
|
||||
String[] split = flightOrderDetail.getDetailId().split("-");
|
||||
//要找出对应退票信息
|
||||
if(split.length > 1){
|
||||
if (split.length > 1) {
|
||||
ChangeInfo changeInfo = sequenceInfo
|
||||
.getChangeInfo()
|
||||
.stream()
|
||||
|
@ -321,6 +314,9 @@ public class CTripOrderExtensionFactoryImpl implements OrderExtensionFactory {
|
|||
flightOrderDetail.setChangeFee(String.valueOf(changeInfo.getRebookServiceFee()));
|
||||
flightOrderDetail.setOrderAmount(String.valueOf(changeInfo.getCFee()));
|
||||
flightOrderDetail.setCompanyPaymentAmount(String.valueOf(changeInfo.getCFee()));
|
||||
flightOrderDetail.setFuelTax(String.valueOf(changeInfo.getOilFee()));
|
||||
flightOrderDetail.setAirportTax(String.valueOf(changeInfo.getTax()));
|
||||
flightOrderDetail.setFacePrice(String.valueOf(changeInfo.getCPrintPrice()));
|
||||
} else {
|
||||
flightOrderDetail.setOrderStatus(FSSC_FLIGHT_STATUS_SUCCESS);
|
||||
}
|
||||
|
@ -345,9 +341,10 @@ public class CTripOrderExtensionFactoryImpl implements OrderExtensionFactory {
|
|||
flightOrderDetail.getOrderStatus().equals(FSSC_FLIGHT_STATUS_REFUND)) {
|
||||
FlightRefundDetail refundDetail = refundDetailList.get(0);
|
||||
//这里加一个判断, 只有退票状态的机票加入 退票手续费
|
||||
flightOrderDetail.setRefundFee(String.valueOf(refundDetail.getRefundFee()));
|
||||
flightOrderDetail.setChangeFee(String.valueOf(refundDetail.getRefundFee()));
|
||||
flightOrderDetail.setRefundAmount(String.valueOf(flightRefundInfo.getPayCustomerAmount()));
|
||||
flightOrderDetail.setRefundAmount(BigDecimalCalculator.add(
|
||||
String.valueOf(flightOrderBasicInfo.getAmount()), String.valueOf(flightOrderBasicInfo.getChangeAmount())
|
||||
));
|
||||
flightOrderDetail.setOrderAmount("-" + flightRefundInfo.getPayCustomerAmount());
|
||||
flightOrderDetail.setCompanyPaymentAmount("-" + flightRefundInfo.getPayCustomerAmount());
|
||||
} else {
|
||||
|
|
|
@ -4,6 +4,7 @@ import com.chint.domain.aggregates.user.User;
|
|||
import com.chint.domain.repository.UserRepository;
|
||||
import com.chint.infrastructure.repository.jdbc.JdbcUserRepository;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.cache.annotation.CacheEvict;
|
||||
import org.springframework.cache.annotation.Cacheable;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
|
@ -19,12 +20,14 @@ public class UserRepositoryImpl implements UserRepository {
|
|||
}
|
||||
|
||||
|
||||
@Cacheable(value = "RindByUserEmployeeNo",key = "#employeeNo")
|
||||
@Cacheable(value = "UserEmployeeNoCache", key = "#employeeNo")
|
||||
@Override
|
||||
public User findByUserEmployeeNo(String employeeNo) {
|
||||
return jdbcUserRepository.findByEmployeeNo(employeeNo);
|
||||
}
|
||||
|
||||
|
||||
@CacheEvict(value = "UserEmployeeNoCache", key = "#user.employeeNo")
|
||||
@Override
|
||||
public User save(User user) {
|
||||
return jdbcUserRepository.save(user);
|
||||
|
|
|
@ -144,8 +144,6 @@ public class PostRequest {
|
|||
return cachedUrl.getUrl();
|
||||
}
|
||||
}
|
||||
int i = Runtime.getRuntime().availableProcessors();
|
||||
log.info("执行get前,当前线程数为" + i);
|
||||
HttpGet request = new HttpGet(url); // 替换为你的URL
|
||||
request.setHeader("User-Agent", androidUserAgent);
|
||||
|
||||
|
@ -158,8 +156,6 @@ public class PostRequest {
|
|||
HttpResponse response = null;
|
||||
try {
|
||||
response = client.execute(request);
|
||||
int i2 = Runtime.getRuntime().availableProcessors();
|
||||
log.info("执行execute后,当前线程数为" + i2);
|
||||
} catch (IOException e) {
|
||||
return REDIRECT_NOT_EXIST;
|
||||
}
|
||||
|
@ -169,8 +165,6 @@ public class PostRequest {
|
|||
} else if (location != null) {
|
||||
String reDirectUrl = location.getValue();
|
||||
reDirectUrlCache.put(url, CachedUrl.of(reDirectUrl));
|
||||
int i3 = Runtime.getRuntime().availableProcessors();
|
||||
log.info("获取location后,当前线程数为" + i3);
|
||||
return reDirectUrl;
|
||||
} else {
|
||||
reDirectUrlCache.put(url, CachedUrl.ofError(REDIRECT_NOT_EXIST));
|
||||
|
|
|
@ -2,16 +2,20 @@ 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.in.StrokeController;
|
||||
import com.chint.interfaces.rest.ly.dto.strokepush.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;
|
||||
|
@ -20,6 +24,7 @@ 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.*;
|
||||
|
||||
|
||||
|
@ -65,7 +70,7 @@ public class BPMController {
|
|||
.setApprovalStatus(2);//1驳回 2通过
|
||||
} else {
|
||||
param.setTravelBizOrderNo(travelNo)//同程行程单号
|
||||
.setApprovalStatus(1);//1驳回 2通过
|
||||
.setApprovalStatus(2);//1驳回 2通过
|
||||
}
|
||||
strokePushDTO.setParam(param);
|
||||
strokeController.strokePush(strokePushDTO);
|
||||
|
|
|
@ -88,6 +88,9 @@ public class CarOrderDetailDto implements Serializable {
|
|||
// 里程数
|
||||
private String mileage;
|
||||
|
||||
// 打车的里程数
|
||||
private String miles;
|
||||
|
||||
// 订单总额(含前收服务费)
|
||||
private String orderAmount;
|
||||
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
package com.chint.interfaces.rest.ly.in;
|
||||
package com.chint.interfaces.rest.ly.dto.strokepush;
|
||||
|
||||
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;
|
|
@ -13,6 +13,7 @@ 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;
|
||||
|
@ -20,6 +21,7 @@ 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;
|
||||
|
@ -75,12 +77,12 @@ public class CommonController {
|
|||
@PostMapping("/back")
|
||||
public LYNoteResponse Back(@RequestBody Notification notification) {
|
||||
|
||||
if(ifForwardRequest){
|
||||
CompletableFuture.runAsync(()->{
|
||||
if (ifForwardRequest) {
|
||||
CompletableFuture.runAsync(() -> {
|
||||
log.info("转发同程订单状态推送");
|
||||
LYNoteResponse response = basePostRequest
|
||||
.post(forwardRequestBaseUrl + forwardRequestPath, notification, LYNoteResponse.class);
|
||||
if(response.getResCode().equals("100")){
|
||||
if (response.getResCode().equals("100")) {
|
||||
log.info("转发同程订单状态推送成功");
|
||||
} else {
|
||||
log.info("转发同程订单状态推送失败");
|
||||
|
@ -152,7 +154,8 @@ public class CommonController {
|
|||
if (subNotifyType == 16) {
|
||||
changeTrain(ruleViolate, subNotifyType, orderTrain.getOrderNo());
|
||||
}
|
||||
lyCallBackDataHandler.trainCallBackData(orderTrain.getOrderNo(), Integer.valueOf(ruleViolate));
|
||||
String foulReason = orderTrain.getFoulReason();//超标原因
|
||||
lyCallBackDataHandler.trainCallBackData(orderTrain.getOrderNo(), Integer.valueOf(ruleViolate), foulReason,subNotifyType);
|
||||
if (subNotifyType == 2 || subNotifyType == 3 || subNotifyType == 1) {
|
||||
sendMsg(orderTrain.getTravelData().getTravelApplyNo());
|
||||
}
|
||||
|
@ -183,7 +186,8 @@ public class CommonController {
|
|||
|
||||
int ruleViolate = dataObject.getOrderInfo().getRuleViolate() ? 1 : 0;
|
||||
String orderSerialNo = dataObject.getOrderInfo().getOrderSerialNo();
|
||||
lyCallBackDataHandler.hotelCallBackData(orderSerialNo, ruleViolate);
|
||||
String foulReason = dataObject.getOrderInfo().getFoulReason();//超标原因
|
||||
lyCallBackDataHandler.hotelCallBackData(orderSerialNo, ruleViolate, foulReason);
|
||||
if (ruleViolate == 0) {
|
||||
sendMsg(dataObject.getTravelData().getTravelApplyNo());
|
||||
}
|
||||
|
@ -216,9 +220,9 @@ public class CommonController {
|
|||
if (subNotifyType == 9) {
|
||||
changeFlight(ruleViolate, subNotifyType, orderSerialNo);
|
||||
}
|
||||
|
||||
String foulReason = dataObject.getOrderDetails().getFoulReason();//超标原因
|
||||
//正常流程
|
||||
lyCallBackDataHandler.flightCallBackData(orderSerialNo, ruleViolate);
|
||||
lyCallBackDataHandler.flightCallBackData(orderSerialNo, ruleViolate, foulReason,subNotifyType);
|
||||
if (subNotifyType == 2 || subNotifyType == 3 || subNotifyType == 1) {
|
||||
sendMsg(dataObject.getOrderDetails().getTravelOrderNo());
|
||||
}
|
||||
|
@ -234,6 +238,7 @@ public class CommonController {
|
|||
* @return
|
||||
*/
|
||||
public LYNoteResponse getOrderType(Notification notification) {
|
||||
int subNotifyType = notification.getSubNotifyType();
|
||||
Class<?> objClass = notification.getClass();
|
||||
Object object = GetObjectNature.getObject(objClass, "notifyData", notification);
|
||||
Gson gson = new Gson();
|
||||
|
@ -248,14 +253,21 @@ public class CommonController {
|
|||
orderTravel.setOrderNo(hotelOrder.getOrderInfo().getOrderSerialNo());
|
||||
orderTravel.setTravelNo(common.getTravelBizOrder().getTravelOrderNo());
|
||||
saveOrderTravel(orderTravel);
|
||||
return lyCallBackDataHandler.hotelCallBackData(hotelOrder.getOrderInfo().getOrderSerialNo(), hotelOrder.getOrderInfo().getRuleViolate() ? 1 : 0);
|
||||
String foulReason = hotelOrder.getOrderInfo().getFoulReason();//超标原因
|
||||
return lyCallBackDataHandler.hotelCallBackData(hotelOrder.getOrderInfo().getOrderSerialNo(), hotelOrder.getOrderInfo().getRuleViolate() ? 1 : 0, foulReason);
|
||||
} else if (emptyFly) {//机票originalOrderNo
|
||||
NotifyData.OrderDetails flyOrder = common.getTravelBizOrderList().getFlightOrderList().get(0).getOrderDetails();
|
||||
OrderTravel orderTravel = new OrderTravel();
|
||||
orderTravel.setOrderNo(flyOrder.getOrderSerialNo());
|
||||
orderTravel.setTravelNo(flyOrder.getTravelOrderNo());
|
||||
saveOrderTravel(orderTravel);
|
||||
return lyCallBackDataHandler.flightCallBackData(flyOrder.getOrderSerialNo(), flyOrder.getRuleViolate() ? 1 : 0);
|
||||
int ruleViolate = flyOrder.getRuleViolate() ? 1 : 0;
|
||||
//改签
|
||||
if (subNotifyType == 9) {
|
||||
changeFlight(ruleViolate, subNotifyType, flyOrder.getOrderSerialNo());
|
||||
}
|
||||
String foulReason = flyOrder.getFoulReason();//超标原因
|
||||
return lyCallBackDataHandler.flightCallBackData(flyOrder.getOrderSerialNo(), flyOrder.getRuleViolate() ? 1 : 0, foulReason,subNotifyType);
|
||||
|
||||
} else if (emptyTrain) {//火车票
|
||||
NotifyData.TrainOrderList.OrderTrain orderTrain = common.getTravelBizOrderList().getTrainOrderList().get(0);
|
||||
|
@ -263,14 +275,19 @@ public class CommonController {
|
|||
orderTravel.setOrderNo(orderTrain.getOrderNo());
|
||||
orderTravel.setTravelNo(common.getTravelBizOrder().getTravelOrderNo());
|
||||
saveOrderTravel(orderTravel);
|
||||
return lyCallBackDataHandler.trainCallBackData(orderTrain.getOrderNo(), orderTrain.getRuleViolate() ? 1 : 0);
|
||||
int ruleViolate = orderTrain.getRuleViolate() ? 1 : 0;
|
||||
if (subNotifyType == 16) {
|
||||
changeTrain(ruleViolate, subNotifyType, orderTrain.getOrderNo());
|
||||
}
|
||||
String foulReason = orderTrain.getFoulReason();//超标原因
|
||||
return lyCallBackDataHandler.trainCallBackData(orderTrain.getOrderNo(), orderTrain.getRuleViolate() ? 1 : 0, foulReason,subNotifyType);
|
||||
} else if (emptyCar) {
|
||||
NotifyData.CarOrderList.Order orderCar = common.getTravelBizOrderList().getCarOrderList().get(0).getOrder();
|
||||
OrderTravel orderTravel = new OrderTravel();
|
||||
orderTravel.setOrderNo(orderCar.getOrderSerialNo());
|
||||
orderTravel.setTravelNo(common.getTravelBizOrder().getTravelOrderNo());
|
||||
saveOrderTravel(orderTravel);
|
||||
return lyCallBackDataHandler.trainCallBackData(orderCar.getOrderSerialNo(), 0);
|
||||
return lyCallBackDataHandler.carCallBackData(orderCar.getOrderSerialNo(), 0);
|
||||
} else {
|
||||
return new LYNoteResponse("100", "OK");
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@ 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;
|
||||
|
|
|
@ -15,12 +15,14 @@ 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;
|
||||
|
||||
|
|
|
@ -18,6 +18,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 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;
|
||||
|
@ -27,7 +28,7 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
import static com.chint.infrastructure.constant.LYConstant.*;
|
||||
import static com.chint.infrastructure.constant.OrderConstant.ORDER_EVENT_ETA;
|
||||
import static com.chint.infrastructure.constant.OrderConstant.*;
|
||||
|
||||
@Component
|
||||
public class LYCallBackDataHandler {
|
||||
|
@ -49,7 +50,7 @@ public class LYCallBackDataHandler {
|
|||
private JdbcOrderTravelRepository travelRepository;
|
||||
|
||||
|
||||
public LYNoteResponse trainCallBackData(String orderNo, Integer isRuleViolate) {
|
||||
public LYNoteResponse trainCallBackData(String orderNo, Integer isRuleViolate, String foulReason, int subNotifyType) {
|
||||
TrainDetailResponse trainOrderDetail = lySearchRequest.getTrainOrderDetail(orderNo);
|
||||
TrainDetailResponse.TrainDetailData data = trainOrderDetail.getData();
|
||||
TrainDetailResponse.TravelData travelData = data.getTravelData();
|
||||
|
@ -57,11 +58,11 @@ public class LYCallBackDataHandler {
|
|||
Integer productType = L_Y_PRODUCT_TYPE_TRAIN;
|
||||
String travelNo = travelData.getTravelApplyNo();
|
||||
Integer evenType = LYOrderUtil.mapTrainStatus(data.getOrderStatus());
|
||||
return dataHandler(orderNo, isRuleViolate, travelNo, data, productType, outStatus, evenType);
|
||||
return dataHandler(orderNo, isRuleViolate, travelNo, data, productType, outStatus, evenType, foulReason, subNotifyType);
|
||||
}
|
||||
|
||||
|
||||
public LYNoteResponse flightCallBackData(String orderNo, Integer isRuleViolate) {
|
||||
public LYNoteResponse flightCallBackData(String orderNo, Integer isRuleViolate, String foulReason, int subNotifyType) {
|
||||
FlightOrderResponse flightOrderDetail = lySearchRequest.getFlightOrderDetail(orderNo);
|
||||
FlightOrderResponse.Data data = flightOrderDetail.getData();
|
||||
FlightOrderResponse.OrderDetails orderDetails = data.getOrderDetails();
|
||||
|
@ -69,10 +70,10 @@ public class LYCallBackDataHandler {
|
|||
String outStatus = orderDetails.getOrderStatusText();
|
||||
Integer evenType = LYOrderUtil.mapFlightStatus(orderDetails.getOrderStatus().toString());
|
||||
Integer productType = L_Y_PRODUCT_TYPE_FLY;
|
||||
return dataHandler(orderNo, isRuleViolate, travelNo, data, productType, outStatus, evenType);
|
||||
return dataHandler(orderNo, isRuleViolate, travelNo, data, productType, outStatus, evenType, foulReason, subNotifyType);
|
||||
}
|
||||
|
||||
public LYNoteResponse hotelCallBackData(String orderNo, Integer isRuleViolate) {
|
||||
public LYNoteResponse hotelCallBackData(String orderNo, Integer isRuleViolate, String foulReason) {
|
||||
HotelDetailResponse hotelOrderDetail = lySearchRequest.getHotelOrderDetail(orderNo);
|
||||
HotelDetailResponse.Data data = hotelOrderDetail.getData();
|
||||
HotelDetailResponse.OrderInfo orderInfo = data.getOrderInfo();
|
||||
|
@ -82,7 +83,7 @@ public class LYCallBackDataHandler {
|
|||
orderInfo.getOrderStatus()
|
||||
));
|
||||
Integer productType = L_Y_PRODUCT_TYPE_HOTEL;
|
||||
return dataHandler(orderNo, isRuleViolate, travelNo, data, productType, outStatus, evenType);
|
||||
return dataHandler(orderNo, isRuleViolate, travelNo, data, productType, outStatus, evenType, foulReason, 0);
|
||||
}
|
||||
|
||||
public LYNoteResponse carCallBackData(String orderNo, Integer isRuleViolate) {
|
||||
|
@ -95,12 +96,12 @@ public class LYCallBackDataHandler {
|
|||
Integer evenType = LYOrderUtil.mapCarStatus(orderDetailInfo.getOrderStatus()
|
||||
);
|
||||
Integer productType = L_Y_PRODUCT_TYPE_CAR;
|
||||
return dataHandler(orderNo, isRuleViolate, travelNo, data, productType, outStatus, evenType);
|
||||
return dataHandler(orderNo, isRuleViolate, travelNo, data, productType, outStatus, evenType, "其它", 0);
|
||||
}
|
||||
|
||||
private LYNoteResponse dataHandler(String orderNo, Integer isRuleViolate, String travelNo,
|
||||
Object data, Integer productType,
|
||||
String outStatus, Integer evenType) {
|
||||
String outStatus, Integer evenType, String foulReason, int subNotifyType) {
|
||||
RouteOrder byOrderNo = routeRepository.findByOrderNo(travelNo);
|
||||
SupplierCallbackData supplierCallbackData =
|
||||
SupplierCallbackData.of(SupplierNameConstant.SUPPLIER_L_Y, byOrderNo.getUserId())
|
||||
|
@ -122,8 +123,11 @@ public class LYCallBackDataHandler {
|
|||
.orderNo(orderNo)
|
||||
.outStatus(outStatus)
|
||||
.eventType(ORDER_EVENT_ETA)
|
||||
.extension(foulReason)//超标原因
|
||||
.sendToQueue();
|
||||
} else if (isRuleViolate.equals(L_Y_IS_RULE_VIOLATE)) {
|
||||
} else if (isRuleViolate.equals(L_Y_IS_RULE_VIOLATE) &&
|
||||
!(subNotifyType == 16 || subNotifyType == 9 || ORDER_EVENT_CHANGE == evenType || ORDER_EVENT_REFUND == evenType)
|
||||
) {
|
||||
//已经推送过的超标
|
||||
return new LYNoteResponse("100", "OK");
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue