已合并 PR 10065: 修复部分用车数据无法回推问题
This commit is contained in:
commit
7d980a7c60
|
@ -7,7 +7,6 @@ import lombok.Data;
|
|||
@Data
|
||||
public class AuthenticationSignDto extends BaseQuery {
|
||||
// private String orderNo; //订单号
|
||||
|
||||
private Integer productType; //机票1 、酒店2、火车3、打车4
|
||||
private String systemType;
|
||||
private String startTime;
|
||||
|
|
|
@ -12,6 +12,10 @@ import com.chint.domain.repository.RouteRepository;
|
|||
import com.chint.infrastructure.util.BaseContext;
|
||||
import com.chint.infrastructure.util.PageResult;
|
||||
import com.chint.infrastructure.util.Result;
|
||||
import com.chint.interfaces.rest.bpm.dto.orderdetail.CarOrderDetailDto;
|
||||
import com.chint.interfaces.rest.bpm.dto.orderdetail.FlightOrderDetailDto;
|
||||
import com.chint.interfaces.rest.bpm.dto.orderdetail.HotelOrderDetailDto;
|
||||
import com.chint.interfaces.rest.bpm.dto.orderdetail.TrainOrderDetailDto;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
|
@ -36,6 +40,9 @@ public class OrderDetailQuery {
|
|||
private RouteRepository routeRepository;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// public Result<PageResult<Object>> orderDetailInfoPageQuery(AuthenticationSignDto authenticationDto) {
|
||||
// Integer productType = authenticationDto.getProductType();
|
||||
// String systemType = authenticationDto.getSystemType();
|
||||
|
@ -156,7 +163,11 @@ public class OrderDetailQuery {
|
|||
Double.parseDouble(hotelOrderDetail.getOrderAmount()) == 0) {
|
||||
return null;
|
||||
}
|
||||
return hotelOrderDetail;
|
||||
HotelOrderDetailDto orderDetailDto = HotelOrderDetailDto.copyFrom(hotelOrderDetail);
|
||||
RouteOrder routeOrder = routeRepository.queryById(orderDetail.getRouteId());
|
||||
ApproveOrderNo approveOrderNo = routeOrder.getApproveOrderNo();
|
||||
orderDetailDto.setApplicantId(approveOrderNo.getCreator());
|
||||
return orderDetailDto;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
@ -170,7 +181,11 @@ public class OrderDetailQuery {
|
|||
if (receiptsNum != null) {
|
||||
trainOrderDetail.setReceiptsNum(regetReceiptsNum(receiptsNum));
|
||||
}
|
||||
return trainOrderDetail;
|
||||
TrainOrderDetailDto orderDetailDto = TrainOrderDetailDto.copyFrom(trainOrderDetail);
|
||||
RouteOrder routeOrder = routeRepository.queryById(orderDetail.getRouteId());
|
||||
ApproveOrderNo approveOrderNo = routeOrder.getApproveOrderNo();
|
||||
orderDetailDto.setApplicantId(approveOrderNo.getCreator());
|
||||
return orderDetailDto;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
@ -184,13 +199,18 @@ public class OrderDetailQuery {
|
|||
if (receiptsNum != null) {
|
||||
carOrderDetail.setReceiptsNum(regetReceiptsNum(receiptsNum));
|
||||
}
|
||||
return carOrderDetail;
|
||||
CarOrderDetailDto orderDetailDto = CarOrderDetailDto.copyFrom(carOrderDetail);
|
||||
RouteOrder routeOrder = routeRepository.queryById(orderDetail.getRouteId());
|
||||
ApproveOrderNo approveOrderNo = routeOrder.getApproveOrderNo();
|
||||
orderDetailDto.setApplicantId(approveOrderNo.getCreator());
|
||||
return orderDetailDto;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private Object processFlightOrderDetail(OrderDetail orderDetail, String systemType) {
|
||||
FlightOrderDetail flightOrderDetail = orderDetail.getFlightOrderDetail();
|
||||
|
||||
if (flightOrderDetail != null &&
|
||||
!flightOrderDetail.getOrderStatus().equals(FSSC_ORDER_STATUS_CANCEL) &&
|
||||
systemType.equals(flightOrderDetail.getBelongSysType())) {
|
||||
|
@ -198,7 +218,22 @@ public class OrderDetailQuery {
|
|||
if (receiptsNum != null) {
|
||||
flightOrderDetail.setReceiptsNum(regetReceiptsNum(receiptsNum));
|
||||
}
|
||||
return flightOrderDetail;
|
||||
FlightOrderDetailDto orderDetailDto = FlightOrderDetailDto.copyFrom(flightOrderDetail);
|
||||
|
||||
String ticketNo = orderDetailDto.getTicketNo();
|
||||
if (ticketNo.contains("-") && ticketNo != null) {
|
||||
ticketNo = ticketNo.replace("-", "");
|
||||
orderDetailDto.setTicketNo(ticketNo);
|
||||
}
|
||||
String changedTicketNo = orderDetailDto.getChangedTicketNo();
|
||||
if (changedTicketNo.contains("-") && changedTicketNo != null) {
|
||||
changedTicketNo = changedTicketNo.replace("-", "");
|
||||
orderDetailDto.setChangedTicketNo(changedTicketNo);
|
||||
}
|
||||
RouteOrder routeOrder = routeRepository.queryById(orderDetail.getRouteId());
|
||||
ApproveOrderNo approveOrderNo = routeOrder.getApproveOrderNo();
|
||||
orderDetailDto.setApplicantId(approveOrderNo.getCreator());
|
||||
return orderDetailDto;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -412,6 +412,11 @@ public class RouteOrder implements Serializable {
|
|||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if(leg.getLegType().equals(LEG_TYPE_TAXI)){
|
||||
return false;
|
||||
}
|
||||
|
||||
Location originLocation = leg.getOriginLocation();
|
||||
Location destinationLocation = leg.getDestinationLocation();
|
||||
Long orderDetailOriginId = orderDetail.getOriginId();
|
||||
|
|
|
@ -117,53 +117,37 @@ public class CTripOrderExtensionFactoryImpl implements OrderExtensionFactory {
|
|||
carOrderDetail.setReceiptsNum(routeOrder.getRouteOrderNo());
|
||||
carOrderDetail.setCreateTime(carBasicInfo.getCreateTime());
|
||||
carOrderDetail.setOrderAmount(String.valueOf(carBasicInfo.getOrderAmount()));
|
||||
|
||||
|
||||
carOrderDetail.setCompanyPaymentAmount(String.valueOf(carBasicInfo.getAccntAmount()));
|
||||
carOrderDetail.setPersonalPaymentAmount(String.valueOf(carBasicInfo.getPersonAmount()));
|
||||
if (carBasicInfo.getPaymentType().equals("ACCNT")) {
|
||||
carOrderDetail.setPaymentType("0");
|
||||
} else {
|
||||
carOrderDetail.setPaymentType("1");
|
||||
|
||||
}
|
||||
carOrderDetail.setCompanyPaymentAmount(String.valueOf(carBasicInfo.getPersonAmount()));
|
||||
|
||||
carOrderDetail.setPersonalPaymentAmount(String.valueOf(carBasicInfo.getAccntAmount()));
|
||||
if (!carQuickOrderInfoEntity.getOrderFeeList().isEmpty()) {
|
||||
OrderFee orderFee = carQuickOrderInfoEntity.getOrderFeeList().get(0);
|
||||
|
||||
if (orderFee.getFeeName().equals("取消费")) {
|
||||
carOrderDetail.setCancellationFee(orderFee.getAmount().toString());
|
||||
} else {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
OrderProduct orderProduct = carQuickOrderInfoEntity.getOrderProduct();
|
||||
if (orderProduct != null) {
|
||||
carOrderDetail.setStartTime(orderProduct.getServiceBeginTime());
|
||||
carOrderDetail.setArriveTime(orderProduct.getServiceEndTime());
|
||||
carOrderDetail.setMileage(orderProduct.getNormalDistance());
|
||||
carOrderDetail.setRunTime(orderProduct.getNormalTime());
|
||||
|
||||
Address depAddress = orderProduct.getDepartAddress();
|
||||
Address arrAddress = orderProduct.getArriveAddress();
|
||||
|
||||
carOrderDetail.setFromStationName(depAddress.getAddressDetail());
|
||||
carOrderDetail.setToStationName(arrAddress.getAddressDetail());
|
||||
|
||||
carOrderDetail.setFromCity(depAddress.getCityName());
|
||||
carOrderDetail.setToCity(arrAddress.getCityName());
|
||||
|
||||
Driver driver = orderProduct.getDriver();
|
||||
|
||||
|
||||
carOrderDetail.setCarModel(driver.getDriverVehicleName());
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
ApproveOrderNo approveOrderNo = routeOrder.getApproveOrderNo();
|
||||
if (approveOrderNo != null) {
|
||||
carOrderDetail.setAccountCompanyId(approveOrderNo.getAccountCompanyCode());
|
||||
|
@ -172,7 +156,6 @@ public class CTripOrderExtensionFactoryImpl implements OrderExtensionFactory {
|
|||
carOrderDetail.setCostCenter(approveOrderNo.getCostCenter());
|
||||
carOrderDetail.setProjectOrderNo(approveOrderNo.getProjectName());
|
||||
}
|
||||
|
||||
OrderDetail orderDetail = orderDetailRepository.findByOrderNo(carBasicInfo.getOrderId())
|
||||
.orElseThrow(() -> new NotFoundException(NOT_FOUND));
|
||||
Optional<Integer> firstOrderEvent = orderDetail.getOrderEventList()
|
||||
|
@ -186,7 +169,6 @@ public class CTripOrderExtensionFactoryImpl implements OrderExtensionFactory {
|
|||
} else {
|
||||
carOrderDetail.setOverStandard("是"); //无
|
||||
}
|
||||
|
||||
Optional<OrderEvent> first1 = orderDetail.getOrderEventList()
|
||||
.stream()
|
||||
.findFirst();
|
||||
|
|
|
@ -654,9 +654,15 @@ public class LYOrderExtensionFactoryImpl implements OrderExtensionFactory {
|
|||
carOrderDetail.setUserName(carOrderDetailInfo.getContactName());
|
||||
carOrderDetail.setUserCode(carOrderDetailInfo.getOutEmployeeId());
|
||||
carOrderDetail.setPhone(carOrderDetailInfo.getContactPhone());
|
||||
|
||||
carOrderDetail.setPersonalPaymentAmount(String.valueOf(carOrderDetailInfo.getPersonalPrice()));
|
||||
carOrderDetail.setCompanyPaymentAmount(String.valueOf(carOrderDetailInfo.getCompanyPrice()));
|
||||
carOrderDetail.setPaymentType(String.valueOf(carOrderDetailInfo.getPayType())); //无
|
||||
|
||||
if (Double.valueOf(carOrderDetail.getCompanyPaymentAmount()) > 0){
|
||||
carOrderDetail.setPaymentType("0"); //无
|
||||
}else {
|
||||
carOrderDetail.setPaymentType("1"); //无
|
||||
}
|
||||
}
|
||||
|
||||
carOrderDetail.setReceiptsNum(routeOrder.getRouteOrderNo());
|
||||
|
|
|
@ -32,7 +32,7 @@ public class SupplierResponseInterceptor implements HandlerInterceptor {
|
|||
CTripNoteResponse error = CTripNoteResponse.error(result.getMsg());
|
||||
cTripResContent = gson.toJson(error);
|
||||
} else if(result.getCode().equals(RESULT_SUCCESS_CODE)){
|
||||
CTripNoteResponse success = CTripNoteResponse.success(result.getMsg());
|
||||
CTripNoteResponse success = CTripNoteResponse.success(null);
|
||||
cTripResContent = gson.toJson(success);
|
||||
} else {
|
||||
CTripNoteResponse error = CTripNoteResponse.error("未知消息");
|
||||
|
|
|
@ -72,7 +72,7 @@ public class BPMRequest {
|
|||
return switch (sysCode) {
|
||||
case "FSSC", "H3BPM" -> submitWorkflow(rescheduleDto, employeeNo, accountCompany, CANCEL_AND_CHANGE);
|
||||
case "XNFSSC" -> BPMSubmitWorkflow("JG_AS_CLGQSQ", rescheduleDto, XNBPMUrl, sysCode, employeeNo);
|
||||
case "ANFSSC" -> null;
|
||||
case "ANFSSC" -> new BPMResponse(true);
|
||||
default -> {
|
||||
BPMResponse bpmResponse = new BPMResponse();
|
||||
bpmResponse.setSuccess(false);
|
||||
|
@ -87,7 +87,7 @@ public class BPMRequest {
|
|||
return switch (sysCode) {
|
||||
case "FSSC", "H3BPM" -> submitWorkflow(changeDto, employeeNo, accountCompany, ALTER_APPLY);
|
||||
case "XNFSSC" -> BPMSubmitWorkflow("XN_AS_CLBGSQ", changeDto, XNBPMUrl, sysCode, employeeNo);
|
||||
case "ANFSSC" -> null;
|
||||
case "ANFSSC" -> new BPMResponse(true);
|
||||
default -> {
|
||||
BPMResponse bpmResponse = new BPMResponse();
|
||||
bpmResponse.setSuccess(false);
|
||||
|
|
|
@ -1,10 +1,18 @@
|
|||
package com.chint.interfaces.rest.bpm.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class BPMResponse {
|
||||
private Boolean Success;//创建成功标志
|
||||
private String InstanceID;//实例id
|
||||
private String Message;//返回消息
|
||||
|
||||
public BPMResponse(Boolean success) {
|
||||
this.Success = success;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,153 @@
|
|||
package com.chint.interfaces.rest.bpm.dto.orderdetail;
|
||||
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.chint.domain.aggregates.order.CarOrderDetail;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class CarOrderDetailDto implements Serializable {
|
||||
|
||||
private Long id;
|
||||
|
||||
// 数据来源商旅平台
|
||||
private String trvaleSysType;
|
||||
|
||||
// 对应所属系统
|
||||
private String belongSysType;
|
||||
|
||||
// 订单号
|
||||
private String orderNo;
|
||||
|
||||
// 消费明细唯一标识
|
||||
private String detailId;
|
||||
|
||||
// 是否超标
|
||||
private String overStandard;
|
||||
|
||||
// 父级订单号
|
||||
private String parentOrderNo;
|
||||
|
||||
// 原始订单号
|
||||
private String originalOrderNo;
|
||||
|
||||
// 订单状态
|
||||
private String orderStatus;
|
||||
|
||||
// 核算企业id
|
||||
private String accountCompanyId;
|
||||
|
||||
// 核算企业名称
|
||||
private String accountCompanyName;
|
||||
|
||||
// 申请单号
|
||||
private String receiptsNum;
|
||||
|
||||
// 行程编号
|
||||
private String scheduleNum;
|
||||
|
||||
// 预订人Code
|
||||
private String bookingUserCode;
|
||||
|
||||
// 预订人姓名
|
||||
private String bookingName;
|
||||
|
||||
// 预订人电话
|
||||
private String bookingUserPhone;
|
||||
|
||||
// 订单创建时间 格式:2023-04-26 13:15:17
|
||||
private String createTime;
|
||||
|
||||
// 出发时间 格式:2023-04-26 13:15:17
|
||||
private String startTime;
|
||||
|
||||
// 到达时间 格式:2023-04-26 13:15:17
|
||||
private String arriveTime;
|
||||
|
||||
// 出发地
|
||||
private String fromStationName;
|
||||
|
||||
// 到达地
|
||||
private String toStationName;
|
||||
|
||||
// 车型
|
||||
private String carModel;
|
||||
|
||||
// 出发城市
|
||||
private String fromCity;
|
||||
|
||||
// 到达城市
|
||||
private String toCity;
|
||||
|
||||
// 运行时长 01:08 表示 1小时8分钟
|
||||
private String runTime;
|
||||
|
||||
// 里程数
|
||||
private String mileage;
|
||||
|
||||
// 订单总额(含前收服务费)
|
||||
private String orderAmount;
|
||||
|
||||
// 取消费
|
||||
private String cancellationFee;
|
||||
|
||||
// 差标
|
||||
private String standardItems;
|
||||
|
||||
// 用车人姓名
|
||||
private String userName;
|
||||
|
||||
// 用车人code
|
||||
private String userCode;
|
||||
|
||||
// 用车人手机号
|
||||
private String phone;
|
||||
|
||||
// 资源供应商
|
||||
private String supplier;
|
||||
|
||||
// 个人支付金额
|
||||
private String personalPaymentAmount;
|
||||
|
||||
// 公司统付金额
|
||||
private String companyPaymentAmount;
|
||||
|
||||
// 超标原因
|
||||
private String overStandardReason;
|
||||
|
||||
// 用车人组织架构信息1
|
||||
private String BOOK_ORG_STRUCT_1;
|
||||
|
||||
// 用车人组织架构信息2
|
||||
private String BOOK_ORG_STRUCT_2;
|
||||
|
||||
// 用车人组织架构信息3
|
||||
private String BOOK_ORG_STRUCT_3;
|
||||
|
||||
// 付款方式 0:公司统付 1:个人付 2:混付
|
||||
private String paymentType;
|
||||
|
||||
// 项目订单号
|
||||
private String projectOrderNo;
|
||||
|
||||
// 成本中心
|
||||
private String costCenter;
|
||||
|
||||
// 高速费
|
||||
private String tollFee;
|
||||
|
||||
|
||||
private String applicantId;
|
||||
|
||||
public static CarOrderDetailDto copyFrom(CarOrderDetail carOrderDetail) {
|
||||
if (carOrderDetail == null) {
|
||||
return null;
|
||||
}
|
||||
CarOrderDetailDto carOrderDetailDto = BeanUtil.copyProperties(carOrderDetail, CarOrderDetailDto.class);
|
||||
|
||||
return carOrderDetailDto;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,219 @@
|
|||
package com.chint.interfaces.rest.bpm.dto.orderdetail;
|
||||
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.chint.domain.aggregates.order.FlightOrderDetail;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class FlightOrderDetailDto implements Serializable {
|
||||
|
||||
private Long id;
|
||||
// 数据来源商旅平台
|
||||
private String trvaleSysType;
|
||||
|
||||
// 对应所属系统
|
||||
private String belongSysType;
|
||||
|
||||
// 飞机型号
|
||||
private String flightModel;
|
||||
|
||||
// 订单号
|
||||
private String orderNo;
|
||||
|
||||
// 消费明细唯一标识
|
||||
private String detailId;
|
||||
|
||||
// 是否超标
|
||||
private String overStandard;
|
||||
|
||||
// 父级订单号
|
||||
private String parentOrderNo;
|
||||
|
||||
// 原始订单号
|
||||
private String originalOrderNo;
|
||||
|
||||
// 订单状态:1-出票成功,2-改签成功,3-退票成功
|
||||
private String orderStatus;
|
||||
|
||||
// 核算企业id
|
||||
private String accountCompanyId;
|
||||
|
||||
// 核算企业名称
|
||||
private String accountCompanyName;
|
||||
|
||||
// 差旅申请单
|
||||
private String receiptsNum;
|
||||
|
||||
// 行程编号
|
||||
private String scheduleNum;
|
||||
|
||||
// 改签后行程编号
|
||||
private String changedScheduleNum;
|
||||
|
||||
// 预订人code
|
||||
private String bookingUserCode;
|
||||
|
||||
// 预订人姓名
|
||||
private String bookingName;
|
||||
|
||||
// 预订人电话
|
||||
private String bookingUserPhone;
|
||||
|
||||
// 订单创建时间 格式:2023-04-26 13:15:17
|
||||
private String createTime;
|
||||
|
||||
// 起飞时间 格式:2023-04-26 13:15:17
|
||||
private String startTime;
|
||||
|
||||
// 到达时间 格式:2023-04-26 13:15:17
|
||||
private String arriveTime;
|
||||
|
||||
// 起飞城市名称
|
||||
private String startCityName;
|
||||
|
||||
// 起飞城市编码
|
||||
private String startCityCode;
|
||||
|
||||
// 起飞机场名称
|
||||
private String startAirportName;
|
||||
|
||||
// 起飞机场三字码
|
||||
private String startAirportCode;
|
||||
|
||||
// 起飞航站楼
|
||||
private String startTerminal;
|
||||
|
||||
// 到达城市名称
|
||||
private String endCityName;
|
||||
|
||||
// 到达城市编码
|
||||
private String endCityCode;
|
||||
|
||||
// 到达机场名称
|
||||
private String endAirportName;
|
||||
|
||||
// 到达机场三字码
|
||||
private String endAirportCode;
|
||||
|
||||
// 到达航站楼
|
||||
private String endTerminal;
|
||||
|
||||
// 航程公里数
|
||||
private String distance;
|
||||
|
||||
// 航空公司名称
|
||||
private String flightCompName;
|
||||
|
||||
// 航班号
|
||||
private String flightNum;
|
||||
|
||||
// 舱位
|
||||
private String seatPoint;
|
||||
|
||||
// 舱位名称
|
||||
private String seatPointName;
|
||||
|
||||
// 订单总额
|
||||
private String orderAmount;
|
||||
|
||||
// 前收服务费
|
||||
private String preServiceFee;
|
||||
|
||||
// 后收服务费
|
||||
private String postServiceFee;
|
||||
|
||||
// 退款总额
|
||||
private String refundAmount;
|
||||
|
||||
// 机票信息
|
||||
private String tickets;
|
||||
|
||||
// 燃油费
|
||||
private String fuelTax;
|
||||
|
||||
// 机建费
|
||||
private String airportTax;
|
||||
|
||||
// 票面价
|
||||
private String facePrice;
|
||||
|
||||
// 改签费
|
||||
private String changeFee;
|
||||
|
||||
// 退票手续费
|
||||
private String refundFee;
|
||||
|
||||
// 升舱费
|
||||
private String upFee;
|
||||
|
||||
// 舱位及折扣
|
||||
private String standard;
|
||||
|
||||
// 票号
|
||||
private String ticketNo;
|
||||
|
||||
// 改签后票号
|
||||
private String changedTicketNo;
|
||||
|
||||
// 出行人姓名
|
||||
private String userName;
|
||||
|
||||
// 出行人code
|
||||
private String userCode;
|
||||
|
||||
// 是否超标
|
||||
private String isOverStandard;
|
||||
|
||||
// 出行人手机号
|
||||
private String phone;
|
||||
|
||||
// 付款方式 0:公司统付 1:个人付 2:混付
|
||||
private String paymentType;
|
||||
|
||||
// 未预订最低价原因
|
||||
private String notBookedLowestPriceReason;
|
||||
|
||||
// 资源供应商
|
||||
private String supplier;
|
||||
|
||||
// 个人支付金额
|
||||
private String personalPaymentAmount;
|
||||
|
||||
// 公司统付金额
|
||||
private String companyPaymentAmount;
|
||||
|
||||
// 超标原因
|
||||
private String overStandardReason;
|
||||
|
||||
// 出行人组织架构信息1
|
||||
private String BOOK_ORG_STRUCT_1;
|
||||
|
||||
// 出行人组织架构信息2
|
||||
private String BOOK_ORG_STRUCT_2;
|
||||
|
||||
// 出行人组织架构信息3
|
||||
private String BOOK_ORG_STRUCT_3;
|
||||
|
||||
// 保险费
|
||||
private String insuranceFee;
|
||||
|
||||
// 项目订单号
|
||||
private String projectOrderNo;
|
||||
// 成本中心
|
||||
private String costCenter;
|
||||
|
||||
|
||||
private String applicantId;
|
||||
|
||||
public static FlightOrderDetailDto copyFrom(FlightOrderDetail flightOrderDetail) {
|
||||
if (flightOrderDetail == null) {
|
||||
return null;
|
||||
}
|
||||
FlightOrderDetailDto flightOrderDetailDto = BeanUtil.copyProperties(flightOrderDetail, FlightOrderDetailDto.class);
|
||||
|
||||
return flightOrderDetailDto;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,171 @@
|
|||
package com.chint.interfaces.rest.bpm.dto.orderdetail;
|
||||
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.chint.domain.aggregates.order.HotelOrderDetail;
|
||||
import com.chint.domain.aggregates.order.HotelOrderDetailCustomer;
|
||||
import com.chint.domain.aggregates.order.OrderDetail;
|
||||
import com.chint.domain.aggregates.order.TrainOrderDetail;
|
||||
import lombok.Data;
|
||||
import org.springframework.data.relational.core.mapping.MappedCollection;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class HotelOrderDetailDto implements Serializable {
|
||||
|
||||
|
||||
private Long id;
|
||||
|
||||
// 数据来源商旅平台
|
||||
private String trvaleSysType;
|
||||
|
||||
// 对应所属系统
|
||||
private String belongSysType;
|
||||
|
||||
// 订单号
|
||||
private String orderNo;
|
||||
|
||||
// 消费明细唯一标识
|
||||
private String detailId;
|
||||
|
||||
// 是否超标
|
||||
private String overStandard;
|
||||
|
||||
// 订单状态:1-预订成功,3-全部退订成功,4-部分退订成功
|
||||
private String orderStatus;
|
||||
|
||||
// 核算企业id
|
||||
private String accountCompanyId;
|
||||
|
||||
// 核算企业名称
|
||||
private String accountCompanyName;
|
||||
|
||||
// 申请单号
|
||||
private String receiptsNum;
|
||||
|
||||
// 行程编号
|
||||
private String scheduleNum;
|
||||
|
||||
// 预订人Code
|
||||
private String bookingUserCode;
|
||||
|
||||
// 预订人姓名
|
||||
private String bookingName;
|
||||
|
||||
// 预订人电话
|
||||
private String bookingUserPhone;
|
||||
|
||||
// 订单创建时间 格式:2023-04-26 13:15:17
|
||||
private String createTime;
|
||||
|
||||
// 入住城市
|
||||
private String checkInCity;
|
||||
|
||||
// 酒店名称
|
||||
private String hotelName;
|
||||
|
||||
// 酒店电话
|
||||
private String contactPhone;
|
||||
|
||||
// 酒店地址
|
||||
private String hotelAddress;
|
||||
|
||||
// 星级
|
||||
private String starRate;
|
||||
|
||||
// 入住日期 格式:2022-09-10
|
||||
private String checkInDate;
|
||||
|
||||
// 离店日期 格式:2022-09-10
|
||||
private String departureDate;
|
||||
|
||||
// 夜晚数
|
||||
private String nightCount;
|
||||
|
||||
// 房间数
|
||||
private String roomCount;
|
||||
|
||||
// 退订夜间数
|
||||
private String refundRoomNightCount;
|
||||
|
||||
// 房型
|
||||
private String roomTypeName;
|
||||
|
||||
// 付款方式 0:公司统付 1:个人付 2:混付
|
||||
private String paymentType;
|
||||
|
||||
// 企业统付总额
|
||||
private String companyAmount;
|
||||
|
||||
// 个人支付总额
|
||||
private String personalAmount;
|
||||
|
||||
// 企业退款金额
|
||||
private String companyRefundAmount;
|
||||
|
||||
// 个人退款金额
|
||||
private String personalRefundAmount;
|
||||
|
||||
// 订单总额
|
||||
private String orderAmount;
|
||||
|
||||
// 前收服务费
|
||||
private String preServiceFee;
|
||||
|
||||
// 后收服务费
|
||||
private String postServiceFee;
|
||||
|
||||
// 退款总额
|
||||
private String refundAmount;
|
||||
|
||||
// 入住人信息
|
||||
// @MappedCollection(idColumn = "hotel_order_detail_id", keyColumn = "hotel_order_detail_key")
|
||||
private List<HotelOrderDetailCustomer> customers;
|
||||
|
||||
// 入离日期内差标
|
||||
private String standardItems;
|
||||
|
||||
// 间夜信息
|
||||
private String nightRates;
|
||||
|
||||
// 资源供应商
|
||||
private String supplier;
|
||||
|
||||
// 涉及金额字段都要取回
|
||||
private String amountFields;
|
||||
|
||||
// 超标原因
|
||||
private String overStandardReason;
|
||||
|
||||
// 是否协议酒店
|
||||
private String agreementHotel;
|
||||
|
||||
// 入住人组织架构信息1
|
||||
private String BOOK_ORG_STRUCT_1;
|
||||
|
||||
// 入住人组织架构信息2
|
||||
private String BOOK_ORG_STRUCT_2;
|
||||
|
||||
// 入住人组织架构信息3
|
||||
private String BOOK_ORG_STRUCT_3;
|
||||
|
||||
// 项目订单号
|
||||
private String projectOrderNo;
|
||||
|
||||
// 成本中心
|
||||
private String costCenter;
|
||||
|
||||
|
||||
private String applicantId;
|
||||
|
||||
public static HotelOrderDetailDto copyFrom(HotelOrderDetail hotelOrderDetail) {
|
||||
if (hotelOrderDetail == null) {
|
||||
return null;
|
||||
}
|
||||
HotelOrderDetailDto hotelOrderDetailDto = BeanUtil.copyProperties(hotelOrderDetail, HotelOrderDetailDto.class);
|
||||
|
||||
return hotelOrderDetailDto;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,182 @@
|
|||
package com.chint.interfaces.rest.bpm.dto.orderdetail;
|
||||
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.chint.domain.aggregates.order.FlightOrderDetail;
|
||||
import com.chint.domain.aggregates.order.OrderDetail;
|
||||
import com.chint.domain.aggregates.order.TrainOrderDetail;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class TrainOrderDetailDto implements Serializable {
|
||||
|
||||
|
||||
private Long id;
|
||||
|
||||
// 数据来源商旅平台
|
||||
private String trvaleSysType;
|
||||
|
||||
// 对应所属系统
|
||||
private String belongSysType;
|
||||
|
||||
// 订单号
|
||||
private String orderNo;
|
||||
|
||||
// 消费明细唯一标识
|
||||
private String detailId;
|
||||
|
||||
// 是否超标
|
||||
private String overStandard;
|
||||
|
||||
// 父级订单号
|
||||
private String parentOrderNo;
|
||||
|
||||
// 原始订单号
|
||||
private String originalOrderNo;
|
||||
|
||||
// 订单状态:1-出票成功,2-改签成功,3-退票成功
|
||||
private String orderStatus;
|
||||
|
||||
// 核算企业id
|
||||
private String accountCompanyId;
|
||||
|
||||
// 核算企业名称
|
||||
private String accountCompanyName;
|
||||
|
||||
// 申请单号
|
||||
private String receiptsNum;
|
||||
|
||||
// 行程编号
|
||||
private String scheduleNum;
|
||||
|
||||
// 预订人Code
|
||||
private String bookingUserCode;
|
||||
|
||||
// 预订人姓名
|
||||
private String bookingName;
|
||||
|
||||
// 预订人电话
|
||||
private String bookingUserPhone;
|
||||
|
||||
// 订单创建时间 格式:2023-04-26 13:15:17
|
||||
private String createTime;
|
||||
|
||||
// 出发时间 格式:2023-04-26 13:15:17
|
||||
private String startTime;
|
||||
|
||||
// 到达时间 格式:2023-04-26 13:15:17
|
||||
private String arriveTime;
|
||||
|
||||
// 出发站
|
||||
private String fromStationName;
|
||||
|
||||
// 到达站
|
||||
private String toStationName;
|
||||
|
||||
// 车次
|
||||
private String trainNo;
|
||||
|
||||
// 出发城市
|
||||
private String fromCity;
|
||||
|
||||
// 到达城市
|
||||
private String toCity;
|
||||
|
||||
// 运行时长 01:08 表示 1小时8分钟
|
||||
private String runTime;
|
||||
|
||||
// 订单总额(含前收服务费)
|
||||
private String orderAmount;
|
||||
|
||||
// 前收服务费
|
||||
private String preServiceFee;
|
||||
|
||||
// 后收服务费
|
||||
private String postServiceFee;
|
||||
|
||||
// 退款总额
|
||||
private String refundAmount;
|
||||
|
||||
// 改签差额 高改低时为负数,平改时为0,低改高为正数
|
||||
private String changeDifference;
|
||||
|
||||
// 改签手续费
|
||||
private String changeCost;
|
||||
|
||||
// 火车票信息
|
||||
private String tickets;
|
||||
|
||||
// 座位等级
|
||||
private String seatType;
|
||||
|
||||
// 座位
|
||||
private String seatName;
|
||||
|
||||
// 票价
|
||||
private String ticketPrice;
|
||||
|
||||
// 退款手续费
|
||||
private String refundCost;
|
||||
|
||||
// 退款金额
|
||||
private String refundPrice;
|
||||
|
||||
// 差标
|
||||
private String standardItems;
|
||||
|
||||
// 出行人姓名
|
||||
private String userName;
|
||||
|
||||
// 出行人code
|
||||
private String userCode;
|
||||
|
||||
// 出行人手机号
|
||||
private String phone;
|
||||
|
||||
// 资源供应商
|
||||
private String supplier;
|
||||
|
||||
// 个人支付金额
|
||||
private String personalAmount;
|
||||
|
||||
// 公司统付金额
|
||||
private String companyAmount;
|
||||
|
||||
// 超标原因
|
||||
private String overStandardReason;
|
||||
|
||||
// 出行人组织架构信息1
|
||||
private String BOOK_ORG_STRUCT_1;
|
||||
|
||||
// 出行人组织架构信息2
|
||||
private String BOOK_ORG_STRUCT_2;
|
||||
|
||||
// 出行人组织架构信息3
|
||||
private String BOOK_ORG_STRUCT_3;
|
||||
|
||||
// 付款方式 0:公司统付 1:个人付 2:混付
|
||||
private String paymentType;
|
||||
|
||||
// 保险费
|
||||
private String insuranceFee;
|
||||
|
||||
// 项目订单号
|
||||
private String projectOrderNo;
|
||||
|
||||
// 成本中心
|
||||
private String costCenter;
|
||||
|
||||
|
||||
private String applicantId;
|
||||
|
||||
public static TrainOrderDetailDto copyFrom(TrainOrderDetail trainOrderDetail) {
|
||||
if (trainOrderDetail == null) {
|
||||
return null;
|
||||
}
|
||||
TrainOrderDetailDto trainOrderDetailDto = BeanUtil.copyProperties(trainOrderDetail, TrainOrderDetailDto.class);
|
||||
|
||||
return trainOrderDetailDto;
|
||||
}
|
||||
}
|
|
@ -12,7 +12,7 @@ public class CarQuickOrderInfoEntity {
|
|||
private OrderInsurance OrderInsurance; // 订单保险信息
|
||||
private OrderInvoice OrderInvoice; // 订单发票信息
|
||||
private CarPassengerInfo PassengerInfo; // 乘客信息
|
||||
// private List<PaymentInfo> PaymentInfoList; // 支付信息列表
|
||||
private List<PaymentInfo> PaymentInfoList; // 支付信息列表
|
||||
// private List<PaymentSettlement> PaymentSettlementList; // 支付结算列表
|
||||
private List<ChoosedVehicle> ChoosedVehicleList; // 选择的车辆列表
|
||||
// private OrderConfigInfo OrderConfigInfo; // 订单配置信息
|
||||
|
|
|
@ -5,9 +5,12 @@ import lombok.Data;
|
|||
// 支付信息类
|
||||
@Data
|
||||
public class PaymentInfo {
|
||||
private String amount; // 金额
|
||||
private String billNo; // 账单号
|
||||
private String paidTime; // 支付时间
|
||||
private String paymentCategory; // 支付类别
|
||||
private Double Amount; // 金额
|
||||
private String BillNo; // 账单号
|
||||
private String PaidTime; // 支付时间
|
||||
private String PaymentCategory; // 支付类别
|
||||
private String PaymentId; // 账单号
|
||||
private String PaymentRemark; // 支付时间
|
||||
private String PaymentType; // 支付类别
|
||||
// Other fields and getters/setters
|
||||
}
|
|
@ -24,6 +24,7 @@ import com.chint.interfaces.rest.ly.tools.LYOrderUtil;
|
|||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static com.chint.infrastructure.constant.LYConstant.*;
|
||||
|
@ -107,6 +108,10 @@ public class LYCallBackDataHandler {
|
|||
.data(data)
|
||||
.productType(productType);
|
||||
OrderDetail orderDetail = supplierService.handleSupplierCallback(supplierCallbackData);
|
||||
|
||||
if (orderDetail.getOrderEventList() == null) {
|
||||
orderDetail.setOrderEventList(new ArrayList<>());
|
||||
}
|
||||
List<Integer> list = orderDetail
|
||||
.getOrderEventList()
|
||||
.stream()
|
||||
|
@ -119,6 +124,9 @@ public class LYCallBackDataHandler {
|
|||
.outStatus(outStatus)
|
||||
.eventType(ORDER_EVENT_ETA)
|
||||
.sendToQueue();
|
||||
} else if (isRuleViolate.equals(L_Y_IS_RULE_VIOLATE)) {
|
||||
//已经推送过的超标
|
||||
return new LYNoteResponse("100", "OK");
|
||||
} else {
|
||||
Command.of(OrderStatusChangeCommand.class)
|
||||
.orderDetail(orderDetail)
|
||||
|
|
|
@ -2,36 +2,61 @@ package com.chint;
|
|||
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.alibaba.excel.read.listener.PageReadListener;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.authine.cloudpivot.opensdk.ApiException;
|
||||
import com.authine.cloudpivot.opensdk.CloudpivotOpenClient;
|
||||
import com.authine.cloudpivot.opensdk.client.impl.JdkHttpClient;
|
||||
import com.authine.cloudpivot.opensdk.config.CloudpivotEnvConfig;
|
||||
import com.authine.cloudpivot.opensdk.model.request.workflow.StartWorkflowRequest;
|
||||
import com.authine.cloudpivot.opensdk.model.response.workflow.StartWorkflowResponse;
|
||||
import com.chint.application.commands.RefundOrderGenerateCommand;
|
||||
import com.chint.domain.aggregates.order.Leg;
|
||||
import com.chint.domain.aggregates.order.OrderDetail;
|
||||
import com.chint.domain.aggregates.standards.StaffRank;
|
||||
import com.chint.domain.aggregates.standards.XNStaffRank;
|
||||
import com.chint.domain.service.order_sync.LYOrderSyncAdapter;
|
||||
import com.chint.infrastructure.config.LogConfig.LogController;
|
||||
import com.chint.infrastructure.config.LogConfig.RedisCache;
|
||||
import com.chint.infrastructure.config.LogConfig.SystemLog;
|
||||
import com.chint.infrastructure.echo_framework.command.Command;
|
||||
import com.chint.infrastructure.repository.jdbc.JdbcLegRepository;
|
||||
import com.chint.infrastructure.repository.jdbc.JdbcOrderDetailRepository;
|
||||
import com.chint.infrastructure.repository.jdbc.JdbcStaffRankRepository;
|
||||
import com.chint.infrastructure.repository.jdbc.JdbcSystemLogRepository;
|
||||
import com.chint.infrastructure.util.BaseContext;
|
||||
import com.chint.infrastructure.util.Result;
|
||||
import com.chint.interfaces.rest.base.PostRequest;
|
||||
import com.chint.interfaces.rest.bpm.XNBPM.YSTokenDto;
|
||||
import com.chint.interfaces.rest.bpm.dot.ANBPMBack;
|
||||
import com.chint.interfaces.rest.bpm.dto.*;
|
||||
import com.chint.interfaces.rest.ctrip.CTripOrderSearchRequest;
|
||||
import com.chint.interfaces.rest.ctrip.dto.search.ItineraryEntity;
|
||||
import com.chint.interfaces.rest.ctrip.dto.search.SearchOrderResponse;
|
||||
import com.chint.interfaces.rest.ctrip.dto.search.car.CarBasicInfo;
|
||||
import com.chint.interfaces.rest.ctrip.dto.search.car.CarQuickOrderInfoEntity;
|
||||
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.FlightOrderInfoEntity;
|
||||
import com.chint.interfaces.rest.ly.LYSearchRequest;
|
||||
import com.chint.interfaces.rest.ly.dto.search.response.filght.FlightOrderResponse;
|
||||
import com.chint.interfaces.rest.ly.dto.search.response.train.TrainDetailResponse;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.data.redis.core.HashOperations;
|
||||
import org.springframework.data.redis.core.ScanOptions;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
|
||||
import java.io.File;
|
||||
import java.lang.reflect.Type;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.Duration;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.chint.infrastructure.constant.LegConstant.*;
|
||||
import static com.chint.infrastructure.constant.LegConstant.LEG_TYPE_TAXI;
|
||||
import static com.chint.infrastructure.constant.BPMConstant.YSBPM_TOKEN_URL;
|
||||
|
||||
@Slf4j
|
||||
@SpringBootTest
|
||||
|
@ -150,17 +175,44 @@ public class ExcelTest {
|
|||
processedLogCount = 0;
|
||||
}
|
||||
|
||||
// @Test
|
||||
//@Test
|
||||
public void saveLog() {
|
||||
int count = 0; // 初始化计数器
|
||||
while (count <= 10000) { //当计数器小于10000时执行循环
|
||||
long logNums = redisCache.getHashSize("SystemLog");
|
||||
if (logNums <= 0L) {
|
||||
break;//没有数据结束循环
|
||||
}
|
||||
//获取日志信息
|
||||
Map<String, Object> systemLogMap = redisCache.getCacheHashValues("SystemLog", 100);
|
||||
if (systemLogMap.isEmpty()) {
|
||||
break; // 如果没有数据可取,跳出循环
|
||||
}
|
||||
List<Object> logData = new ArrayList<>(systemLogMap.values());
|
||||
Gson gson = new Gson();
|
||||
List<SystemLog> systemLogs = logData.stream().map(log ->
|
||||
gson.fromJson((String) log, SystemLog.class)
|
||||
).toList();
|
||||
jdbcSystemLogRepository.saveAll(systemLogs);
|
||||
// 删除已处理的日志数据
|
||||
redisCache.delCacheMapValue("SystemLog", systemLogMap.keySet());
|
||||
count++;
|
||||
}
|
||||
log.info("日志保存成功");
|
||||
}
|
||||
|
||||
|
||||
// @Test
|
||||
public void aa111() {
|
||||
LocalDateTime time1 = LocalDateTime.of(2024, 3, 22, 0, 0, 0);
|
||||
LocalDateTime time2 = LocalDateTime.of(2024, 3, 22, 0, 0, 0);
|
||||
Duration duration = Duration.between(time2,time1);
|
||||
Duration duration = Duration.between(time2, time1);
|
||||
long days = duration.toDays(); // 获取天数差异
|
||||
//预估入住天数
|
||||
int roundedDays = (int) Math.ceil(days); // 向上取整,例如大于一天小于二天取1天
|
||||
}
|
||||
|
||||
// @Test
|
||||
// @Test
|
||||
public void deleteLog() throws InterruptedException {
|
||||
/*Integer count = jdbcSystemLogRepository.deleteLogsOlderThanOneMonth();
|
||||
log.info("日志删除成功:{}条", count);
|
||||
|
@ -189,11 +241,214 @@ public class ExcelTest {
|
|||
|
||||
@Autowired
|
||||
LogController logController;
|
||||
// @Test
|
||||
|
||||
// @Test
|
||||
public void logTableSizeInMB() throws InterruptedException {
|
||||
Result<Integer> integerResult = logController.deleteLogDays(1);
|
||||
System.out.println("logMessageDtoResult = " + integerResult);
|
||||
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private LYSearchRequest lySearchRequest;
|
||||
|
||||
// @Test
|
||||
public void aaaaa() {
|
||||
TrainDetailResponse trainOrderDetail = lySearchRequest.getTrainOrderDetail("DTC24031366584001415");
|
||||
System.out.println("trainOrderDetail = " + trainOrderDetail);
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private CTripOrderSearchRequest cTripOrderSearchRequest;
|
||||
|
||||
// @Test
|
||||
public void cTrip() {
|
||||
SearchOrderResponse searchOrderResponse = cTripOrderSearchRequest.searchOrderResponseByOrderId("31025198037");
|
||||
List<ItineraryEntity> itineraryList = searchOrderResponse.getItineraryList();
|
||||
ItineraryEntity itineraryEntity = itineraryList.get(0);
|
||||
FlightOrderInfoEntity flightOrderInfoList = itineraryEntity.getFlightOrderInfoList().get(0);
|
||||
//改签前时间
|
||||
String createTime = flightOrderInfoList.getFlightInfo().get(0).getTakeoffTime();
|
||||
ChangeInfo changeInfo = flightOrderInfoList.getPassengerInfo().get(0).getSequenceInfo().get(0).getChangeInfo().get(0);
|
||||
//改签后时间
|
||||
String cTakeOffTime = changeInfo.getCTakeOffTime();
|
||||
//改签原因
|
||||
String RebookReasonDesc = changeInfo.getRebookReasonDesc();
|
||||
|
||||
FlightOrderInfoEntity flightOrderInfoLists = searchOrderResponse.getItineraryList().get(0).getFlightOrderInfoList().get(0);
|
||||
String refundResonDesc = flightOrderInfoLists.getRefundInfo().get(0).getRefundResonDesc();
|
||||
|
||||
|
||||
}
|
||||
|
||||
// @Test
|
||||
public void Ly() {
|
||||
TrainDetailResponse trainDetailResponse = lySearchRequest.getTrainOrderDetail("DTC24031466742283976");
|
||||
TrainDetailResponse.TrainDetailData data = trainDetailResponse.getData();
|
||||
String trainNo = data.getTrainNo();//原车次
|
||||
String planBeginDateOld = data.getPlanBeginDate();//原时间
|
||||
//原席别
|
||||
TrainDetailResponse.Item item = data.getItems().get(0);
|
||||
String seatClassOld = item.getSeatClass();
|
||||
|
||||
TrainDetailResponse.ChangeInfo changeInfo = item.getChangeInfo();
|
||||
String planBeginDate = changeInfo.getPlanBeginDate();//改签后时间
|
||||
String ticketNo = changeInfo.getTrainNo();//改签后车次
|
||||
String seatClass = changeInfo.getChangeItem().getSeatClass();//改签后席别
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private JdbcOrderDetailRepository jdbcOrderDetailRepository;
|
||||
|
||||
// @Test
|
||||
public void LyFlight() {
|
||||
FlightOrderResponse flightOrderResponse = lySearchRequest.getFlightOrderDetail("DFC24031466775503254");
|
||||
FlightOrderResponse.FlightSegment flightSegment = flightOrderResponse.getData().getFlightSegmentList().get(0);
|
||||
String departTimeFull = flightSegment.getDepartTimeFull();//改签后时间
|
||||
//原订单
|
||||
FlightOrderResponse.Data data = flightOrderResponse.getData();
|
||||
String originalOrderNo = data.getOrderDetails().getOriginalOrderNo();
|
||||
|
||||
OrderDetail byOrderNo = jdbcOrderDetailRepository.findFirstByOrderNo("DFC24031466775503254");
|
||||
}
|
||||
|
||||
// @Test
|
||||
public void CarTest() {
|
||||
SearchOrderResponse searchOrderResponse = cTripOrderSearchRequest.searchOrderResponseByOrderId("30352884087");
|
||||
List<ItineraryEntity> itineraryList = searchOrderResponse.getItineraryList();
|
||||
List<CarQuickOrderInfoEntity> carQuickOrderInfoList = itineraryList.get(0).getCarQuickOrderInfoList();
|
||||
CarBasicInfo basicInfo = carQuickOrderInfoList.get(0).getBasicInfo();
|
||||
List<OrderFee> orderFeeList = carQuickOrderInfoList.get(0).getOrderFeeList();
|
||||
for (OrderFee orderFee : orderFeeList) {
|
||||
//退款
|
||||
if ("REFUND".equals(orderFee.getCostScene()) || "AFTER_REFUND".equals(orderFee.getCostScene())) {
|
||||
LocalDateTime localDateTime = LocalDateTime.now();
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
Command.of(RefundOrderGenerateCommand.class).Info(
|
||||
String.valueOf(orderFee.getOrderFeeId()),
|
||||
basicInfo.getOrderId(),
|
||||
"-" + orderFee.getAmount(),
|
||||
"4",
|
||||
localDateTime.format(formatter)
|
||||
).sendToQueue();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private PostRequest postRequest;
|
||||
|
||||
// @Test
|
||||
public void outOfStandard() {
|
||||
String ANBPMUrl = "https://fssc.chintanneng.com/fssc";
|
||||
String AN_Exceed_Standard = "/extapi/businessTravel/exceeding";
|
||||
String url = ANBPMUrl + AN_Exceed_Standard;
|
||||
// 定义日期时间格式
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSS");
|
||||
String startTime = "2024-03-12T16:31:34.619";
|
||||
String endTime = "2024-03-12T16:31:34.619";
|
||||
ANExceedStandardDto anExceedStandardDto = new ANExceedStandardDto();
|
||||
anExceedStandardDto.setSourceSystemNum("123456")//来源系统ID
|
||||
.setSourceSystem("chint-trip")//系统标识
|
||||
.setApplicant("220329071")//申请人
|
||||
.setApplyNo("CLSQ24031200003")//差旅申请单号
|
||||
.setOrderNo("order123")//商旅订单号
|
||||
.setOrderType("火车票超标")//超标原因
|
||||
.setOrderSource("携程商旅")//订单来源
|
||||
.setLegNo("L2403121044077470")//行程ID
|
||||
.setStartPlace("北京")//出发地
|
||||
.setEndPlace("上海")//目的地
|
||||
.setStartTime(LocalDateTime.parse(startTime, formatter))//开始日期
|
||||
.setEndTime(LocalDateTime.parse(endTime, formatter))//结束日期
|
||||
.setOrderMoney(new BigDecimal("358.16"));//金额
|
||||
ANBPMBack anbpmBack = postRequest.postANBPM(url, anExceedStandardDto, ANBPMBack.class);
|
||||
System.out.println("anbpmBack = " + anbpmBack);
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private PostRequest httpPostRequest;
|
||||
|
||||
// @Test
|
||||
public void aabbcc() {
|
||||
|
||||
|
||||
YSTokenDto tokenDto = httpPostRequest.get("https://bpm.astronergy.com.cn" + YSBPM_TOKEN_URL + "?code=" + "191107079", YSTokenDto.class);
|
||||
if (!"0".equals(tokenDto.getErrcode())) {
|
||||
throw new RuntimeException("用户不存在!");
|
||||
}
|
||||
|
||||
String userId = tokenDto.getUser_id();
|
||||
CloudpivotOpenClient client = getXNInstance();
|
||||
System.out.println("xnInstance = " + client);
|
||||
|
||||
StartWorkflowRequest request = new StartWorkflowRequest();
|
||||
Gson gson = new Gson();
|
||||
XNChangeDto changeDto = new XNChangeDto();
|
||||
//新增行程
|
||||
ArrayList<LegNewTrip> newTrips = new ArrayList<>();
|
||||
LegNewTrip newTrip = new LegNewTrip();
|
||||
newTrip.setAllowProductTypes("飞机")
|
||||
.setDepartCitiesName("温州")
|
||||
.setArriveCitiesName("北京")
|
||||
.setBsDate("2024-03-01")
|
||||
.setEdDate("2024-03-01")
|
||||
.setReason("出差帮扶");
|
||||
newTrips.add(newTrip);
|
||||
//原行程
|
||||
ArrayList<LegOldTrip> oldTrips = new ArrayList<>();
|
||||
LegOldTrip oldTrip = new LegOldTrip();
|
||||
oldTrip.setAllowProductTypes("火车")
|
||||
.setDepartCitiesName("温州")
|
||||
.setArriveCitiesName("杭州")
|
||||
.setBsDate("2024-03-01")
|
||||
.setEdDate("2024-03-01");
|
||||
oldTrips.add(oldTrip);
|
||||
//变更行程
|
||||
ArrayList<LegChangeTrip> changeTrips = new ArrayList<>();
|
||||
LegChangeTrip changeTrip = new LegChangeTrip();
|
||||
changeTrip.setAllowProductTypes("火车")
|
||||
.setDepartCitiesName("乐清")
|
||||
.setArriveCitiesName("杭州")
|
||||
.setBsDate("2024-03-01")
|
||||
.setEdDate("2024-03-01")
|
||||
.setReason("出发地变更");
|
||||
changeTrips.add(changeTrip);
|
||||
//设置值
|
||||
changeDto.setStartTime("2024-03-01")//出差开始时间
|
||||
.setEndTime("2024-03-01")//出差结束时间
|
||||
.setReason("出差帮扶")//出差说明
|
||||
.setXN_AS_CLBGSQ_ITEM_NewTrip(newTrips)//新增行程信息
|
||||
.setXN_AS_CLBGSQ_ITEM_OldTrip(oldTrips)//原行程信息
|
||||
.setXN_AS_CLBGSQ_ITEM_ChangeTrip(changeTrips);//变更行程信息
|
||||
|
||||
String entityParamValues = gson.toJson(changeDto);
|
||||
Type type = new TypeToken<HashMap<String, Object>>() {
|
||||
}.getType();
|
||||
HashMap<String, Object> map = gson.fromJson(entityParamValues, type);
|
||||
request.setData(map);//数据
|
||||
request.setDepartmentId("");//部门id,默认主部门
|
||||
request.setFinishStart(true);//发起流程
|
||||
request.setUserId(userId);//员工号
|
||||
request.setWorkflowCode("XN_AS_CLBGSQ");//差旅变更流程
|
||||
try {
|
||||
StartWorkflowResponse response = client.startWorkflow(request);
|
||||
System.out.println("response = " + JSON.toJSONString(response));
|
||||
} catch (ApiException e) {
|
||||
throw new RuntimeException(e.getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static CloudpivotOpenClient XNClient;
|
||||
|
||||
public synchronized static CloudpivotOpenClient getXNInstance() {
|
||||
if (XNClient == null) {
|
||||
CloudpivotEnvConfig config = new CloudpivotEnvConfig("https://bpm.astronergy.com.cn" + "/api", "xclient", "0a417ecce58c31b32364ce19ca8fcd15");
|
||||
XNClient = new CloudpivotOpenClient(config, new JdkHttpClient());
|
||||
|
||||
}
|
||||
return XNClient;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -6,12 +6,14 @@ import com.authine.cloudpivot.opensdk.CloudpivotOpenClient;
|
|||
import com.authine.cloudpivot.opensdk.model.request.workflow.StartWorkflowRequest;
|
||||
import com.authine.cloudpivot.opensdk.model.response.workflow.StartWorkflowResponse;
|
||||
import com.chint.application.commands.RefundOrderGenerateCommand;
|
||||
import com.chint.domain.aggregates.order.OrderDetail;
|
||||
import com.chint.domain.aggregates.order.OrderTravel;
|
||||
import com.chint.domain.aggregates.user.User;
|
||||
import com.chint.domain.repository.OrderDetailRepository;
|
||||
import com.chint.domain.repository.RouteRepository;
|
||||
import com.chint.infrastructure.constant.LYConstant;
|
||||
import com.chint.infrastructure.echo_framework.command.Command;
|
||||
import com.chint.infrastructure.repository.jdbc.JdbcOrderDetailRepository;
|
||||
import com.chint.infrastructure.repository.jdbc.JdbcOrderTravelRepository;
|
||||
import com.chint.infrastructure.util.BaseContext;
|
||||
import com.chint.interfaces.rest.base.PostRequest;
|
||||
|
@ -793,7 +795,7 @@ public class LYTest {
|
|||
}
|
||||
|
||||
|
||||
@Test
|
||||
// @Test
|
||||
void search() {
|
||||
// FlightOrderResponse t1 = lySearchRequest
|
||||
// .getFlightOrderDetail("DF24031466751565416");
|
||||
|
@ -820,12 +822,12 @@ public class LYTest {
|
|||
// System.out.println(json);
|
||||
}
|
||||
|
||||
@Test
|
||||
// @Test
|
||||
void conform() {
|
||||
commonController.changeFlight(0, 9, "T24031566810476306");
|
||||
}
|
||||
|
||||
@Test
|
||||
// @Test
|
||||
void sendMsg() {
|
||||
commonController.sendMsg("T24031566811702174");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue