添加部分结算代码

This commit is contained in:
lulz1 2024-03-29 10:51:22 +08:00
parent 3db25286ba
commit c8d88f707c
3 changed files with 81 additions and 16 deletions

View File

@ -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;
} }

View File

@ -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;
@ -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;

View File

@ -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;
// 项目订单号 // 项目订单号