添加部分结算代码
This commit is contained in:
parent
3db25286ba
commit
c8d88f707c
|
@ -53,6 +53,7 @@ public class OrderCarRecord extends OrderBaseRecord {
|
||||||
private String cancelCost; // 取消费
|
private String cancelCost; // 取消费
|
||||||
private String userName; // 用车人姓名
|
private String userName; // 用车人姓名
|
||||||
private String userCode; // 用车人code
|
private String userCode; // 用车人code
|
||||||
|
private String ownPayAmt; // 个人统付金额
|
||||||
private String comyPayAmt; // 公司统付金额
|
private String comyPayAmt; // 公司统付金额
|
||||||
private String bookOrgCode1; // 用车人组织架构信息1
|
private String bookOrgCode1; // 用车人组织架构信息1
|
||||||
private String bookOrgCode2; // 用车人组织架构信息2
|
private String bookOrgCode2; // 用车人组织架构信息2
|
||||||
|
@ -98,20 +99,16 @@ public class OrderCarRecord extends OrderBaseRecord {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 加载财务信息
|
// 加载财务信息
|
||||||
public OrderCarRecord loadFinancialInfo(String accountCompanyId,
|
public OrderCarRecord loadFinancialInfo(String accountPeriod,
|
||||||
String accountCompanyName,
|
|
||||||
String accountPeriod,
|
|
||||||
String billNo,
|
String billNo,
|
||||||
String orderAmount) {
|
String orderAmount) {
|
||||||
this.setAccountCompanyId(accountCompanyId);
|
|
||||||
this.setAccountCompanyName(accountCompanyName);
|
|
||||||
this.setAccountPeriod(accountPeriod);
|
this.setAccountPeriod(accountPeriod);
|
||||||
this.setBillNo(billNo);
|
this.setBillNo(billNo);
|
||||||
this.setOrderAmount(orderAmount);
|
this.setOrderAmount(orderAmount);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 加载费用细节
|
// 加载费用细节, 未税金额,税费,服务费,取消费,额外费用,额外费用名称
|
||||||
public OrderCarRecord loadFeeDetails(String noTaxAmt,
|
public OrderCarRecord loadFeeDetails(String noTaxAmt,
|
||||||
String taxAmt,
|
String taxAmt,
|
||||||
String serviceCost,
|
String serviceCost,
|
||||||
|
@ -128,10 +125,12 @@ public class OrderCarRecord extends OrderBaseRecord {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 加载付款和项目信息
|
// 加载付款和项目信息
|
||||||
public OrderCarRecord loadPaymentAndProjectInfo(String paymentType,
|
public OrderCarRecord loadPayment(String paymentType,
|
||||||
String comyPayAmt) {
|
String comyPayAmt,
|
||||||
|
String ownPayAmt) {
|
||||||
this.setPaymentType(paymentType);
|
this.setPaymentType(paymentType);
|
||||||
this.setComyPayAmt(comyPayAmt);
|
this.setComyPayAmt(comyPayAmt);
|
||||||
|
this.setOwnPayAmt(ownPayAmt);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -146,7 +145,7 @@ public class OrderCarRecord extends OrderBaseRecord {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 加载来源和系统归属信息, 线上线下
|
// 加载来源和系统归属信息, 线上线下
|
||||||
public OrderCarRecord loadSourceAndSystemInfo(String orderSource) {
|
public OrderCarRecord loadSource(String orderSource) {
|
||||||
this.setOrderSource(orderSource);
|
this.setOrderSource(orderSource);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,12 +1,13 @@
|
||||||
package com.chint.domain.factoriy.order_record;
|
package com.chint.domain.factoriy.order_record;
|
||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import com.chint.domain.aggregates.order.RouteOrder;
|
||||||
import com.chint.domain.aggregates.order.*;
|
|
||||||
import com.chint.domain.aggregates.order.order_record.OrderCarRecord;
|
import com.chint.domain.aggregates.order.order_record.OrderCarRecord;
|
||||||
import com.chint.domain.aggregates.order.order_record.OrderFlightRecord;
|
import com.chint.domain.aggregates.order.order_record.OrderFlightRecord;
|
||||||
import com.chint.domain.aggregates.order.order_record.OrderHotelRecord;
|
import com.chint.domain.aggregates.order.order_record.OrderHotelRecord;
|
||||||
import com.chint.domain.aggregates.order.order_record.OrderTrainRecord;
|
import com.chint.domain.aggregates.order.order_record.OrderTrainRecord;
|
||||||
|
import com.chint.domain.aggregates.order.order_record.ctrip_order_record.CTripCarQuickInfo;
|
||||||
import com.chint.domain.aggregates.order.order_record.ctrip_order_record.CTripCarRecord;
|
import com.chint.domain.aggregates.order.order_record.ctrip_order_record.CTripCarRecord;
|
||||||
|
import com.chint.domain.aggregates.order.order_record.ctrip_order_record.CTripCarRecordBase;
|
||||||
import com.chint.domain.repository.RouteRepository;
|
import com.chint.domain.repository.RouteRepository;
|
||||||
import com.chint.domain.service.OrderDetailDomainService;
|
import com.chint.domain.service.OrderDetailDomainService;
|
||||||
import com.chint.infrastructure.repository.jdbc.JdbcCtripHotelOrderDetailRepository;
|
import com.chint.infrastructure.repository.jdbc.JdbcCtripHotelOrderDetailRepository;
|
||||||
|
@ -14,7 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
public class CTripOrderRecordExtensionFactory implements OrderRecordExtensionFactory{
|
public class CTripOrderRecordExtensionFactory implements OrderRecordExtensionFactory {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private OrderDetailDomainService orderDetailDomainService;
|
private OrderDetailDomainService orderDetailDomainService;
|
||||||
|
@ -36,6 +37,69 @@ public class CTripOrderRecordExtensionFactory implements OrderRecordExtensionFa
|
||||||
.buildWithRouteOrder(byOrderNo)
|
.buildWithRouteOrder(byOrderNo)
|
||||||
.carRecord();
|
.carRecord();
|
||||||
|
|
||||||
|
CTripCarRecordBase cTripCarRecordBase = cTripCarRecord.getCTripCarRecordBase();
|
||||||
|
CTripCarQuickInfo cTripCarQuickInfo = cTripCarRecord.getCTripCarQuickInfo();
|
||||||
|
|
||||||
|
//添加行程信息
|
||||||
|
String startTime = cTripCarQuickInfo.getServiceBeginTime();
|
||||||
|
String endTime = cTripCarQuickInfo.getServiceEndTime();
|
||||||
|
if (startTime.isBlank() || startTime.isEmpty()) {
|
||||||
|
startTime = cTripCarRecordBase.getCreateTime();
|
||||||
|
}
|
||||||
|
if (endTime.isBlank() || endTime.isEmpty()) {
|
||||||
|
endTime = cTripCarRecordBase.getCreateTime();
|
||||||
|
}
|
||||||
|
orderCarRecord.loadTravelInfo(startTime, endTime,
|
||||||
|
cTripCarQuickInfo.getDepartureCityName(),
|
||||||
|
cTripCarQuickInfo.getArrivalCityName());
|
||||||
|
|
||||||
|
// 加载车型和运行信息,车类型,时间,里程
|
||||||
|
orderCarRecord.loadVehicleAndTravelInfo(cTripCarQuickInfo.getVehicleName(),
|
||||||
|
cTripCarQuickInfo.getNormalTime(),
|
||||||
|
cTripCarQuickInfo.getNormalDistance());
|
||||||
|
|
||||||
|
// 加载财务信息,账期号,账单号,总金额
|
||||||
|
String batchNo = cTripCarRecordBase.getBatchNoStartDate().substring(0, 6);
|
||||||
|
orderCarRecord.loadFinancialInfo(batchNo,
|
||||||
|
cTripCarRecordBase.getSubAccCheckBatchNo(),
|
||||||
|
String.valueOf(cTripCarRecordBase.getAmount()));
|
||||||
|
|
||||||
|
// 加载费用细节, 未税金额,税费,服务费,取消费,额外费用,额外费用名称 , 携程马上用车产品没有税费和额外费用字段
|
||||||
|
orderCarRecord.loadFeeDetails(String.valueOf(cTripCarRecordBase.getAmount()),
|
||||||
|
"",
|
||||||
|
String.valueOf(cTripCarRecordBase.getServerFee()),
|
||||||
|
String.valueOf(cTripCarRecordBase.getPenaltyFee()),
|
||||||
|
"",
|
||||||
|
"");
|
||||||
|
|
||||||
|
// 加载组织架构信息
|
||||||
|
orderCarRecord.loadOrganizationalInfo(cTripCarRecordBase.getDept1(),
|
||||||
|
cTripCarRecordBase.getDept2(),
|
||||||
|
cTripCarRecordBase.getDept3());
|
||||||
|
|
||||||
|
// 加载付款 付款方式,公司付款金额, 个人付款金额
|
||||||
|
String paymentType;
|
||||||
|
Double personAmount = cTripCarRecordBase.getPersonAmount();
|
||||||
|
Double realAmountHasPost = cTripCarRecordBase.getRealAmountHasPost();
|
||||||
|
if (personAmount > 0 && personAmount < realAmountHasPost) {
|
||||||
|
paymentType = "2";
|
||||||
|
} else if (personAmount.equals(realAmountHasPost)) {
|
||||||
|
paymentType = "1";
|
||||||
|
} else {
|
||||||
|
paymentType = "0";
|
||||||
|
}
|
||||||
|
orderCarRecord.loadPayment(paymentType,
|
||||||
|
String.valueOf(realAmountHasPost - personAmount),
|
||||||
|
String.valueOf(personAmount));
|
||||||
|
|
||||||
|
if(cTripCarRecord.getRouteOrderNo() == null ||
|
||||||
|
cTripCarRecord.getRouteOrderNo().isEmpty() ||
|
||||||
|
cTripCarRecord.getRouteOrderNo().isBlank()){
|
||||||
|
orderCarRecord.loadSource("N");
|
||||||
|
} else {
|
||||||
|
orderCarRecord.loadSource("Y");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return orderCarRecord;
|
return orderCarRecord;
|
||||||
|
|
|
@ -33,6 +33,8 @@ public class OrderRecordBasic {
|
||||||
private String bookingUserPhone;
|
private String bookingUserPhone;
|
||||||
// 资源供应商
|
// 资源供应商
|
||||||
private String supplier;
|
private String supplier;
|
||||||
|
// 是否超标
|
||||||
|
private String overStandard;
|
||||||
// 超标原因
|
// 超标原因
|
||||||
private String overStandardReason;
|
private String overStandardReason;
|
||||||
// 项目订单号
|
// 项目订单号
|
||||||
|
@ -46,10 +48,10 @@ public class OrderRecordBasic {
|
||||||
|
|
||||||
// 加载用户和预订信息
|
// 加载用户和预订信息
|
||||||
public OrderRecordBasic loadBookingInfo(String bookingUserCode,
|
public OrderRecordBasic loadBookingInfo(String bookingUserCode,
|
||||||
String bookingName,
|
String bookingName,
|
||||||
String bookingUserPhone,
|
String bookingUserPhone,
|
||||||
String userName,
|
String userName,
|
||||||
String userCode) {
|
String userCode) {
|
||||||
this.setBookingUserPhone(bookingUserPhone);
|
this.setBookingUserPhone(bookingUserPhone);
|
||||||
this.setBookingUserCode(bookingUserCode);
|
this.setBookingUserCode(bookingUserCode);
|
||||||
this.setBookingName(bookingName);
|
this.setBookingName(bookingName);
|
||||||
|
|
Loading…
Reference in New Issue