提交 571de275 authored 作者: huyufan's avatar huyufan

修改逻辑

上级 671de885
...@@ -75,31 +75,9 @@ public class SettlementServiceImpl implements SettlementService { ...@@ -75,31 +75,9 @@ public class SettlementServiceImpl implements SettlementService {
OrderChild orderChild = orderChildDao.getByChildNo(childNo).orElseThrow(PerformanceResultEnum.ORDER_CHILD_NO_FOUND); OrderChild orderChild = orderChildDao.getByChildNo(childNo).orElseThrow(PerformanceResultEnum.ORDER_CHILD_NO_FOUND);
SettlementOwnerDetail settlementOwnerDetail = settlementOwnerDetailDao.getByChildNo(childNo).orElseThrow(PerformanceResultEnum.DATA_NOT_FIND); SettlementOwnerDetail settlementOwnerDetail = settlementOwnerDetailDao.getByChildNo(childNo).orElseThrow(PerformanceResultEnum.DATA_NOT_FIND);
SettlementDriverDetail settlementDriverDetail = settlementDriverDetailDao.getByChildNo(childNo).orElseThrow(PerformanceResultEnum.DATA_NOT_FIND); SettlementDriverDetail settlementDriverDetail = settlementDriverDetailDao.getByChildNo(childNo).orElseThrow(PerformanceResultEnum.DATA_NOT_FIND);
// 开票金额
settlementOwnerDetail.setInvoiceFreight(invoiceFreightCalc(orderChild.getSettlementWay(),settlementOwnerDetail));
// 结算金额
settlementOwnerDetail.setSettlementFreight(settlementFreightCalc(orderChild.getSettlementWay(),settlementOwnerDetail));
settlementOwnerDetail.setFinalPaymentStatus(SettlementOwnerDetailEnum.FinalPaymentStatus.NO.getCode());
if (settlementOwnerDetail.getInvoiceType() != null) {return;} if (settlementOwnerDetail.getInvoiceType() != null) {return;}
//设置司机预付运费标示
if (settlementOwnerDetail.getPrepayFreight().compareTo(BigDecimal.ZERO) > 0) {
settlementDriverDetail.setPrepayFreightFlag(1);
} else {
settlementDriverDetail.setPrepayFreightFlag(0);
}
// 货主结算金额<0走普通单
if (settlementOwnerDetail.getSettlementFreight().compareTo(BigDecimal.ZERO) < 0){
invoiceType = SettlementOwnerEnum.InvoiceType.ORDINARY.getCode();
settlementDriverDetail.setPrepayFreightFlag(0);
} else {
OrderGoods orderGoods = orderGoodsDao.getByOrderGoodsNo(orderChild.getOrderGoodsNo()).get(); OrderGoods orderGoods = orderGoodsDao.getByOrderGoodsNo(orderChild.getOrderGoodsNo()).get();
//是否通过风控,调用网络货运 //是否通过风控,调用网络货运
ThirdOrderChildBrokerParam param = transportSyncService.generateOrderChildSync(orderChild, orderGoods, settlementOwnerDetail, settlementDriverDetail); ThirdOrderChildBrokerParam param = transportSyncService.generateOrderChildSync(orderChild, orderGoods, settlementOwnerDetail, settlementDriverDetail);
...@@ -154,7 +132,10 @@ public class SettlementServiceImpl implements SettlementService { ...@@ -154,7 +132,10 @@ public class SettlementServiceImpl implements SettlementService {
settlementOwnerDetail.setPrepayFreight(BigDecimal.ZERO); settlementOwnerDetail.setPrepayFreight(BigDecimal.ZERO);
} }
} else { } else {
settlementDriverDetail.setPrepayFreightFlag(0);
invoiceType = SettlementOwnerEnum.InvoiceType.ORDINARY.getCode(); invoiceType = SettlementOwnerEnum.InvoiceType.ORDINARY.getCode();
settlementOwnerDetail.setPrepayFreight(BigDecimal.ZERO);
settlementOwnerDetail.setFinalPaymentStatus(SettlementOwnerDetailEnum.FinalPaymentStatus.NO.getCode());
} }
} else { } else {
throw new ServiceSystemException(PerformanceResultEnum.ORDER_CHILD_SYNC_ERROR); throw new ServiceSystemException(PerformanceResultEnum.ORDER_CHILD_SYNC_ERROR);
...@@ -164,10 +145,20 @@ public class SettlementServiceImpl implements SettlementService { ...@@ -164,10 +145,20 @@ public class SettlementServiceImpl implements SettlementService {
if (SettlementOwnerEnum.InvoiceType.ONLINE.getCode().equals(invoiceType) && settlementOwnerDetail.getPrepayFreight().compareTo(BigDecimal.ZERO) > 0) { if (SettlementOwnerEnum.InvoiceType.ONLINE.getCode().equals(invoiceType) && settlementOwnerDetail.getPrepayFreight().compareTo(BigDecimal.ZERO) > 0) {
settlementDriverDetail.setPrepayFreightFlag(1); settlementDriverDetail.setPrepayFreightFlag(1);
} }
}
settlementOwnerDetail.setInvoiceType(invoiceType); settlementOwnerDetail.setInvoiceType(invoiceType);
settlementDriverDetail.setInvoiceType(invoiceType); settlementDriverDetail.setInvoiceType(invoiceType);
// 开票金额
settlementOwnerDetail.setInvoiceFreight(invoiceFreightCalc(orderChild.getSettlementWay(),settlementOwnerDetail));
// 结算金额
settlementOwnerDetail.setSettlementFreight(settlementFreightCalc(orderChild.getSettlementWay(),settlementOwnerDetail));
//设置司机预付运费标示
if (settlementOwnerDetail.getPrepayFreight().compareTo(BigDecimal.ZERO) > 0) {
settlementDriverDetail.setPrepayFreightFlag(1);
} else {
settlementDriverDetail.setPrepayFreightFlag(0);
}
// // 网运单更新预付运费 // // 网运单更新预付运费
// if (Objects.equals(settlementOwnerDetail.getInvoiceType(), SettlementOwnerEnum.InvoiceType.ONLINE.getCode())) { // if (Objects.equals(settlementOwnerDetail.getInvoiceType(), SettlementOwnerEnum.InvoiceType.ONLINE.getCode())) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论