提交 ebb09dfb authored 作者: 艾庆国's avatar 艾庆国

Merge branch 'refs/heads/v17.5_order_child_sync_broker_20240617' into test

Former-commit-id: 422a2b02
......@@ -3,6 +3,7 @@ package com.clx.performance.listener;
import cn.hutool.json.JSONUtil;
import com.clx.order.enums.InvoicingCompanyEnum;
import com.clx.order.enums.OrderEnum;
import com.clx.order.enums.QuotationEnum;
import com.clx.order.vo.pc.carrier.InvoicingCompanyVO;
import com.clx.performance.component.IdGenerateSnowFlake;
import com.clx.performance.config.SettlementConfig;
......@@ -162,8 +163,15 @@ public class OrderChildSyncTransportListener {
// 结算金额
settlementOwnerDetail.setSettlementFreight(settlementCommonService.settlementFreightCalc(orderChild.getSettlementWay(), settlementOwnerDetail));
// 未税 卸车减货损不用生成扣除相关流水逻辑
if (Objects.equals(invoiceType, SettlementOwnerEnum.InvoiceType.ONLINE.getCode())
&& Objects.equals(orderGoods.getPlatformFreightQuotationTaxType(),QuotationEnum.PlatformFreightQuotationTaxType.NO.getCode())
&& Objects.equals(orderGoods.getSettlementWay(), SettlementWayEnum.WayType.UNLOAD_LOSS.getCode())) {
settlementOwnerDetail.setPrepayFreight(BigDecimal.ZERO);
settlementDriverDetail.setPrepayFreightFlag(SettlementDriverEnum.PrepayFreightFlag.NO_PAY.getCode());
}
else if (Objects.equals(invoiceType, SettlementOwnerEnum.InvoiceType.ONLINE.getCode())) {
if (Objects.equals(invoiceType, SettlementOwnerEnum.InvoiceType.ONLINE.getCode())) {
//通过风控
List<OwnerRunningWaterRecord> runningWaterRecordList = ownerRunningWaterRecordDao.getOwnerRunningWaterRecord(orderChild.getOrderNo());
BigDecimal frozen = runningWaterRecordList.stream().filter(item -> {
......@@ -182,11 +190,11 @@ public class OrderChildSyncTransportListener {
BigDecimal subtract = frozen.subtract(takeOut);
log.info("冻结预付运费:{}, 扣除的流水总和:{}", frozen, takeOut);
settlementDriverDetail.setPrepayFreight(ans);
//冻结的预付运费为0 或者 此刻预付运费也可能为0,那么就不用生成扣除相关流水逻辑
if (subtract.compareTo(BigDecimal.ZERO) <= 0 || ans.compareTo(BigDecimal.ZERO) == 0) {
settlementOwnerDetail.setPrepayFreight(BigDecimal.ZERO);
settlementDriverDetail.setPrepayFreightFlag(SettlementDriverEnum.PrepayFreightFlag.NO_PAY.getCode());
} else {
if (subtract.subtract(ans).compareTo(BigDecimal.ZERO) >= 0) {
//账户扣钱并生成扣除流水
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论