提交 0baa3186 authored 作者: liuhaiquan's avatar liuhaiquan

Merge remote-tracking branch 'origin/v10.7_borrowing_and_repayment_20240118'…

Merge remote-tracking branch 'origin/v10.7_borrowing_and_repayment_20240118' into v10.7_borrowing_and_repayment_20240118
......@@ -29,7 +29,7 @@ public class BorrowerConfigVO {
private Integer borrowerId;
@ApiModelProperty(value = "借出方", example = "")
private String borrowerName;
@ApiModelProperty(value = "类型:1资金 2虚拟货币", example = "")
@ApiModelProperty(value = "类型:1虚拟货币 2 资金", example = "")
private Integer type;
@ApiModelProperty(value = "借款天数", example = "")
private Integer day;
......
......@@ -52,7 +52,7 @@ public class OwnerLoanAccountRunningWaterRecordVO {
private BigDecimal alterationBalance;
@MoneyOutConvert
@ApiModelProperty(value = "可用余额", example = "1.23")
private BigDecimal useableBalance;
private BigDecimal useAbleBalance;
@MoneyOutConvert
@ApiModelProperty(value = "冻结余额", example = "1.23")
private BigDecimal frozenBalance;
......
......@@ -34,6 +34,4 @@ public interface OwnerRunningWaterRecordDao extends BaseDao<OwnerRunningWaterRec
List<OwnerAccountRunningWaterRecordVO> marginAccountList(PagePlatformMarginAccountParam param);
OwnerRunningWaterRecord getOneByOrderNoAndRunningWaterTypeAndAccountType(String orderNo, Integer runningWaterType, Integer accountType);
}
......@@ -66,11 +66,4 @@ public class OwnerRunningWaterRecordDaoImpl extends BaseDaoImpl<OwnerRunningWate
return baseMapper.marginAccountList(param);
}
@Override
public OwnerRunningWaterRecord getOneByOrderNoAndRunningWaterTypeAndAccountType(String orderNo, Integer runningWaterType, Integer accountType) {
return baseMapper.selectOne(lQrWrapper().eq(OwnerRunningWaterRecord::getOrderNo, orderNo)
.eq(OwnerRunningWaterRecord::getRunningWaterType, runningWaterType)
.eq(OwnerRunningWaterRecord::getAccountType, accountType)
);
}
}
......@@ -31,10 +31,22 @@ public class OwnerLoanAccountDaoImpl extends BaseDaoImpl<OwnerLoanAccountMapper,
}
}
@Override
public Integer childWriteOffOwnerLoanAccountCAS(OwnerLoanAccount account, LocalDateTime now) {
String nowStr = DateUtils.formatDateTime(now).get();
return baseMapper.childWriteOffOwnerLoanAccountCAS(account, nowStr);
}
@Override
public IPage<CarrierOwnerLoanAccountVO> pageByParam(PageOwnerLoanAccountParam param) {
Page<CarrierOwnerLoanAccountVO> page = Page.of(param.getPage(), param.getPageSize());
return baseMapper.pageByParam(page,param);
}
@Override
public Integer thawOwnerLoanAccountCAS(OwnerLoanAccount account, LocalDateTime now) {
String nowStr = DateUtils.formatDateTime(now).get();
return baseMapper.thawOwnerLoanAccountCAS(account, nowStr);
}
}
......@@ -77,4 +77,19 @@ public class OwnerLoanAccountRunningWaterRecordDaoImpl extends BaseDaoImpl<Owner
query.orderByDesc(OwnerLoanAccountRunningWaterRecord :: getModifiedTime);
return baseMapper.selectList(query);
}
@Override
public OwnerLoanAccountRunningWaterRecord getOneByChildNoAndStatus(String childNo, Integer type) {
return baseMapper.selectOne(lQrWrapper().eq(OwnerLoanAccountRunningWaterRecord::getChildNo, childNo)
.eq(OwnerLoanAccountRunningWaterRecord::getRunningWaterType, type)
);
}
@Override
public List<OwnerLoanAccountRunningWaterRecord> getListByOrderNoAndRunningWaterType(String childNo, Integer runningWaterType) {
return baseMapper.selectList(lQrWrapper().eq(OwnerLoanAccountRunningWaterRecord::getChildNo, childNo)
.eq(OwnerLoanAccountRunningWaterRecord::getRunningWaterType, runningWaterType)
.orderByAsc(OwnerLoanAccountRunningWaterRecord::getId)
);
}
}
......@@ -70,4 +70,5 @@ public class OwnerLoanRecordDaoImpl extends BaseDaoImpl<OwnerLoanRecordMapper, O
);
}
}
......@@ -18,6 +18,22 @@ public interface OwnerLoanAccountDao extends BaseDao<OwnerLoanAccountMapper, Own
Integer updateAccountCAS(OwnerLoanAccount account, LocalDateTime now, boolean flag);
/**
* 核心抵扣
* @param account
* @param now
* @return
*/
Integer childWriteOffOwnerLoanAccountCAS(OwnerLoanAccount account, LocalDateTime now);
IPage<CarrierOwnerLoanAccountVO> pageByParam(PageOwnerLoanAccountParam param);
/**
* 解冻账户金额
* @param account
* @param now
* @return
*/
Integer thawOwnerLoanAccountCAS(OwnerLoanAccount account, LocalDateTime now);
}
......@@ -22,4 +22,8 @@ public interface OwnerLoanAccountRunningWaterRecordDao extends BaseDao<OwnerLoan
IPage<OwnerLoanAccountRunningWaterRecord> pageOwnerLoanRunWaterRecord(Long userNo, PageOwnerLoanRunWaterRecordParam param);
List<OwnerLoanAccountRunningWaterRecord> listOwnerLoanRunWaterRecord(Long userNo, PageOwnerLoanRunWaterRecordParam param);
OwnerLoanAccountRunningWaterRecord getOneByChildNoAndStatus(String childNo, Integer type);
List<OwnerLoanAccountRunningWaterRecord> getListByOrderNoAndRunningWaterType(String childNo, Integer runningWaterType);
}
......@@ -22,4 +22,6 @@ public interface OwnerLoanRecordDao extends BaseDao<OwnerLoanRecordMapper, Owner
IPage<OwnerLoanRecordVO> pageByParam(PageOwnerLoanRecordOfOwner param);
List<OwnerLoanRecord> selectLoanBalance(Long userNo);
}
......@@ -2,6 +2,7 @@ package com.clx.performance.listener;
import cn.hutool.json.JSONUtil;
import com.clx.performance.component.IdGenerateSnowFlake;
import com.clx.performance.component.OrderChildLoanComponent;
import com.clx.performance.component.ThirdComponent;
import com.clx.performance.constant.RabbitKeyConstants;
import com.clx.performance.dao.OrderChildSyncTransportInvoiceRecordDao;
......@@ -29,7 +30,6 @@ import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.util.List;
......@@ -65,6 +65,8 @@ public class OrderChildSyncTransportListener {
private final SettlementMqService settlementMqService;
private final OrderChildLoanComponent orderChildLoanComponent;
@RabbitListener(queues = RabbitKeyConstants.ORDER_CHILD_SYNC_TRANSPORT_QUEUE)
public void onMessage(String message) {
OrderChild orderChild = JSONUtil.toBean(message, OrderChild.class);
......@@ -101,6 +103,9 @@ public class OrderChildSyncTransportListener {
public void extracted(OrderChild orderChild, OrderChildSyncDTO bean, String remark,
SettlementOwnerDetail settlementOwnerDetail,
Integer invoiceType, SettlementDriverDetail settlementDriverDetail) {
// 结算金额
settlementOwnerDetail.setSettlementFreight(settlementFreightCalc(orderChild.getSettlementWay(), settlementOwnerDetail));
if (null != bean && bean.getCode() == 0) {
log.info("当前OrderChildSyncTransportListener监听同步网络货运成功,运单号为{}", orderChild.getChildNo());
if (null != bean.getData() && bean.getData().getStatus() == 1) {
......@@ -127,8 +132,6 @@ public class OrderChildSyncTransportListener {
if (subtract.compareTo(BigDecimal.ZERO) <= 0 || ans.compareTo(BigDecimal.ZERO) == 0) {
settlementOwnerDetail.setPrepayFreight(BigDecimal.ZERO);
settlementDriverDetail.setPrepayFreightFlag(SettlementDriverEnum.PrepayFreightFlag.NO_PAY.getCode());
BigDecimal settlementFreight = settlementOwnerDetail.getSettlementFreight();
//生成借款标识
} else {
if (subtract.subtract(ans).compareTo(BigDecimal.ZERO) >= 0) {
......@@ -149,11 +152,8 @@ public class OrderChildSyncTransportListener {
} else {
settlementOwnerDetail.setPrepayFreight(BigDecimal.ZERO);
settlementDriverDetail.setPrepayFreightFlag(SettlementDriverEnum.PrepayFreightFlag.NO_PAY.getCode());
}
}
} else {
settlementDriverDetail.setPrepayFreightFlag(SettlementDriverEnum.PrepayFreightFlag.NO_PAY.getCode());
settlementOwnerDetail.setPrepayFreight(BigDecimal.ZERO);
......@@ -166,8 +166,6 @@ public class OrderChildSyncTransportListener {
settlementOwnerDetail.setFinalPaymentStatus(SettlementOwnerDetailEnum.FinalPaymentStatus.NO.getCode());
}
// 结算金额
settlementOwnerDetail.setSettlementFreight(settlementFreightCalc(orderChild.getSettlementWay(), settlementOwnerDetail));
if (SettlementOwnerEnum.InvoiceType.ORDINARY.getCode().equals(invoiceType)) {
if (settlementOwnerDetail.getSettlementFreight().compareTo(BigDecimal.ZERO) == 0) {
settlementOwnerDetail.setFinalPaymentStatus(SettlementOwnerDetailEnum.FinalPaymentStatus.NO_REQUIRE.getCode());
......@@ -179,6 +177,8 @@ public class OrderChildSyncTransportListener {
}
settlementOwnerDetail.setInvoiceType(invoiceType);
settlementDriverDetail.setInvoiceType(invoiceType);
//生成借款标识
orderChildLoanComponent.childLoanConfirmAfterProcess(settlementDriverDetail, settlementOwnerDetail);
log.info("当前货主结算信息{},车主结算信息:{}", JSONUtil.parse(settlementOwnerDetail), JSONUtil.parse(settlementDriverDetail));
settlementOwnerDetailDao.updateInvoiceType(settlementOwnerDetail);
......
......@@ -25,11 +25,11 @@ public interface OwnerLoanAccountMapper extends BaseMapper<OwnerLoanAccount> {
)
Integer addAccount(@Param("account") OwnerLoanAccount account, @Param("now") String nowStr);
@Update("update owner_loan_account set funding_account_balance = funding_account_balance - #{account.fundingAccountBalance}," +
",funding_usable_balance = funding_usable_balance - #{account.fundingUsableBalance},funding_frozen_balance = funding_frozen_balance - #{account.fundingFrozenBalance}," +
",virtually_account_balance = virtually_account_balance - #{account.virtuallyAccountBalance},virtually_usable_balance = virtually_usable_balance - #{account.virtuallyUsableBalance}," +
",virtually_frozen_balance = virtually_frozen_balance - #{account.virtuallyFrozenBalance}," +
"modified_time=#{now}"
@Update("update owner_loan_account set funding_account_balance = funding_account_balance - #{account.fundingAccountBalance}" +
",funding_usable_balance = funding_usable_balance - #{account.fundingUsableBalance},funding_frozen_balance = funding_frozen_balance + #{account.fundingFrozenBalance}" +
",virtually_account_balance = virtually_account_balance - #{account.virtuallyAccountBalance},virtually_usable_balance = virtually_usable_balance - #{account.virtuallyUsableBalance}" +
",virtually_frozen_balance = virtually_frozen_balance + #{account.virtuallyFrozenBalance}" +
",modified_time=#{now}"
+ "where id = #{account.id} and modified_time = #{account.modifiedTime}"
)
Integer subAccount(@Param("account") OwnerLoanAccount account, @Param("now") String now);
......@@ -40,4 +40,21 @@ public interface OwnerLoanAccountMapper extends BaseMapper<OwnerLoanAccount> {
@SelectProvider(type = OwnerLoanAccountSqlProvider.class, method = "pageByParam")
IPage<CarrierOwnerLoanAccountVO> pageByParam(@Param("page") Page<CarrierOwnerLoanAccountVO> page, @Param("param") PageOwnerLoanAccountParam param);
@Update("update owner_loan_account set funding_account_balance = funding_account_balance - #{account.fundingAccountBalance}" +
",funding_usable_balance = funding_usable_balance - #{account.fundingUsableBalance},funding_frozen_balance = funding_frozen_balance - #{account.fundingFrozenBalance}" +
",virtually_account_balance = virtually_account_balance - #{account.virtuallyAccountBalance},virtually_usable_balance = virtually_usable_balance - #{account.virtuallyUsableBalance}" +
",virtually_frozen_balance = virtually_frozen_balance - #{account.virtuallyFrozenBalance}" +
",modified_time=#{now}"
+ "where id = #{account.id} and modified_time = #{account.modifiedTime}"
)
Integer childWriteOffOwnerLoanAccountCAS(OwnerLoanAccount account, String nowStr);
@Update("update owner_loan_account set funding_account_balance = funding_account_balance + #{account.fundingAccountBalance}" +
",funding_usable_balance = funding_usable_balance + #{account.fundingUsableBalance},funding_frozen_balance = funding_frozen_balance - #{account.fundingFrozenBalance}" +
",virtually_account_balance = virtually_account_balance + #{account.virtuallyAccountBalance},virtually_usable_balance = virtually_usable_balance + #{account.virtuallyUsableBalance}" +
",virtually_frozen_balance = virtually_frozen_balance - #{account.virtuallyFrozenBalance}" +
",modified_time=#{now}"
+ "where id = #{account.id} and modified_time = #{account.modifiedTime}"
)
Integer thawOwnerLoanAccountCAS(OwnerLoanAccount account, String nowStr);
}
......@@ -53,6 +53,10 @@ public class OwnerLoanAccountRunningWaterRecord implements HasKey<Integer> {
@ApiModelProperty("借款单号")
private Long loanNo;
@TableField("loan_type")
@ApiModelProperty("借款类型 1:虚拟货币 2:资金")
private Integer loanType;
@TableField("child_no")
@ApiModelProperty("运单编号")
......@@ -68,9 +72,9 @@ public class OwnerLoanAccountRunningWaterRecord implements HasKey<Integer> {
@ApiModelProperty("金额")
private BigDecimal alterationBalance;
@TableField("useable_balance")
@TableField("use_able_balance")
@ApiModelProperty("可用余额")
private BigDecimal useableBalance;
private BigDecimal useAbleBalance;
@TableField("frozen_balance")
@ApiModelProperty("冻结余额")
......
......@@ -43,6 +43,7 @@ public class SettlementDriver implements HasKey<Integer> {
private BigDecimal lossWeight; //货损吨数
private BigDecimal lossFreight; //货损金额(分)
private BigDecimal settlementFreight; //结算金额(分)
private Integer loanFlag; //借款标示 0:未借款 1:已借款
private Integer invoiceType; //开票标识:1网运单 2普通单
private String settlementPlatform; //结算平台
private Integer prepayFreightFlag; //预付运费标示 0:未预付 1:已预付
......
......@@ -44,6 +44,7 @@ public class SettlementDriverDetail implements HasKey<Integer> {
private BigDecimal lossFreight; //货损金额(分)
private BigDecimal prepayFreight; //预付运费金额(分)
private Integer prepayFreightFlag; //预付运费标示 0:未预付 1:已预付
private Integer loanFlag; //借款标示 0:未借款 1:已借款
private BigDecimal settlementFreight; //结算金额(分)
private Integer invoiceType; //开票标识:1网运单 2普通单
private Integer status; //状态
......
......@@ -41,6 +41,7 @@ public class SettlementOwner implements HasKey<Integer> {
private BigDecimal lossFreight; //货损金额(分)
private BigDecimal prepayFreight; //预付运费金额(分)
private BigDecimal settlementFreight; //结算金额(分)
private BigDecimal loanFreight; //借款金额(分)
private Integer invoiceType; //开票标识:1网运单 2普通单
private BigDecimal invoiceFreight; //开票金额(分)
private String invoiceImg; //结算凭证
......
......@@ -49,6 +49,7 @@ public class SettlementOwnerDetail implements HasKey<Integer> {
private BigDecimal lossFreight; //货损金额(分)
private BigDecimal prepayFreight; //预付运费金额(分)
private BigDecimal settlementFreight; //结算金额(分)
private BigDecimal loanFreight; //借款抵扣金额(分)
private BigDecimal invoiceFreight; //开票金额(分)
private Integer invoiceType; //开票标识:1网运单 2普通单
private Integer finalPaymentStatus; //尾款状态 0-否,1-是,2-无需支付
......
......@@ -115,7 +115,7 @@ public class BorrowerConfigServiceImpl implements BorrowerConfigService {
UserSessionData loginUserInfo = TokenUtil.getLoginUserInfo();
BorrowerConfig borrowerConfig = borrowerConfigDao.getEntityByKey(param.getId()).orElseThrow(PerformanceResultEnum.DATA_NOT_FIND);
if (Objects.equals(borrowerConfig.getStatus(), BorrowerConfigEnum.Status.ENABLE)){
if (Objects.equals(borrowerConfig.getStatus(), BorrowerConfigEnum.Status.ENABLE.getCode())){
throw new ServiceSystemException(PerformanceResultEnum.BORROWER_CONFIG_DELETE_ENABLE_ERROR);
}
......
......@@ -107,7 +107,7 @@ public class BorrowerServiceImpl implements BorrowerService {
UserSessionData loginUserInfo = TokenUtil.getLoginUserInfo();
Borrower borrower = borrowerDao.getEntityByKey(param.getId()).orElseThrow(PerformanceResultEnum.DATA_NOT_FIND);
if (Objects.equals(borrower.getStatus(), BorrowerEnum.Status.ENABLE)){
if (Objects.equals(borrower.getStatus(), BorrowerEnum.Status.ENABLE.getCode())){
throw new ServiceSystemException(PerformanceResultEnum.BORROWER_DELETE_ENABLE_ERROR);
}
......
......@@ -16,6 +16,7 @@ import com.clx.performance.dao.loan.OwnerLoanRecordDao;
import com.clx.performance.dao.loan.OwnerRepaymentDao;
import com.clx.performance.enums.PerformanceResultEnum;
import com.clx.performance.enums.RunningWaterTypeEnum;
import com.clx.performance.enums.loan.OwnerLoanAccountRunningWaterRecordEnum;
import com.clx.performance.enums.loan.OwnerLoanRecordEnum;
import com.clx.performance.enums.loan.OwnerRePaymentEnum;
import com.clx.performance.model.OwnerBindCardRecord;
......@@ -40,6 +41,7 @@ import com.clx.user.feign.OwnerFeign;
import com.clx.user.vo.feign.OwnerInfoFeignVO;
import com.msl.common.base.Optional;
import com.msl.common.enums.ResultCodeEnum;
import com.msl.common.exception.ServiceSystemException;
import com.msl.common.result.Result;
import com.msl.common.utils.DateUtils;
import com.msl.document.api.feign.ContractEvidenceFeign;
......@@ -54,6 +56,7 @@ import org.apache.poi.ss.formula.functions.T;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.*;
import java.util.stream.Collectors;
......@@ -323,4 +326,101 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService {
Result<ContractEvidenceRecordVo> contractEvidenceDetail = contractEvidenceFeign.getContractEvidenceDetail(longResult.getData());
return contractEvidenceDetail.getData().getFileUrl();
}
@Override
@Transactional(rollbackFor = Exception.class)
public void getLoanBalance(BigDecimal orderChildPrice, Long userNo, String childNo) {
log.info("执行借款,借款金额{}, 货主编号:{}, 运单号:{}", orderChildPrice, userNo, childNo);
//TODO 需要加锁处理
List<OwnerLoanRecord> updateList = new LinkedList<>();
List<OwnerLoanRecord> ownerLoanRecords = ownerLoanRecordDao.selectLoanBalance(userNo);
BigDecimal orderChildPriceTemp = orderChildPrice;
for (OwnerLoanRecord ownerLoanRecord : ownerLoanRecords) {
BigDecimal loanResidueBalance = ownerLoanRecord.getLoanResidueBalance();
log.info("当前借款金额:{},借款单号{},借款剩余金额{}", orderChildPriceTemp, ownerLoanRecord.getLoanNo(), loanResidueBalance);
if (loanResidueBalance.compareTo(orderChildPriceTemp) >= 0) {
log.info("当前借款单的剩余金额足够借款金额");
generateFrozenOwnerLoanRunningWater(ownerLoanRecord, childNo, orderChildPrice);
updateList.add(ownerLoanRecord.setLoanResidueBalance(loanResidueBalance.subtract(orderChildPriceTemp)));
orderChildPriceTemp = BigDecimal.ZERO;
break;
} else {
log.info("当前借款单的剩余金额不够抵扣借款金额,先进行扣除当前借款所有剩余");
generateFrozenOwnerLoanRunningWater(ownerLoanRecord, childNo, orderChildPrice);
updateList.add(ownerLoanRecord.setLoanResidueBalance(BigDecimal.ZERO));
orderChildPriceTemp = orderChildPriceTemp.subtract(loanResidueBalance);
}
}
if (orderChildPriceTemp.compareTo(BigDecimal.ZERO) != 0) {
throw new ServiceSystemException(PerformanceResultEnum.ORDER_CHILD_SAVE_FAIL, "货主货款不足");
}
for (OwnerLoanRecord update : updateList) {
ownerLoanRecordDao.updateEntityByKey(update);
}
log.info("执行借款成功,借款金额{}, 货主编号:{}, 运单号:{}", orderChildPrice, userNo, childNo);
}
public void generateFrozenOwnerLoanRunningWater(OwnerLoanRecord ownerLoanRecord, String childNo, BigDecimal orderChildPrice) {
log.info("13.生成借款冻结流水");
OwnerLoanAccount update = new OwnerLoanAccount();
while (true) {
ownerLoanAccountUpdate(ownerLoanRecord, orderChildPrice, update);
Integer i = ownerLoanAccountDao.updateAccountCAS(update, LocalDateTime.now(), false);
log.info("CAS更新结果:{}", i);
if (i == 1) {
OwnerLoanAccountRunningWaterRecord waterRecord = new OwnerLoanAccountRunningWaterRecord();
waterRecord.setLoanNo(ownerLoanRecord.getLoanNo());
waterRecord.setOwnerUserName(ownerLoanRecord.getOwnerUserName());
waterRecord.setOwnerUserNo(ownerLoanRecord.getOwnerUserNo());
waterRecord.setMobile(ownerLoanRecord.getMobile());
waterRecord.setLoanType(ownerLoanRecord.getLoanType());
waterRecord.setRunningWaterNo(idGenerateSnowFlake.nextId(1L));
waterRecord.setChildNo(childNo);
waterRecord.setRunningWaterType(OwnerLoanAccountRunningWaterRecordEnum.RunWaterType.APPROVE_FROZEN.getCode());
waterRecord.setAlterationBalance(orderChildPrice);
OwnerLoanAccount account = ownerLoanAccountDao.getOneByField(OwnerLoanAccount::getOwnerUserNo,
ownerLoanRecord.getOwnerUserNo()).get();
waterRecord.setAccountBalance(account.getVirtuallyAccountBalance().add(account.getFundingAccountBalance()));
waterRecord.setUseAbleBalance(account.getVirtuallyUsableBalance().add(account.getFundingUsableBalance()));
waterRecord.setFrozenBalance(account.getVirtuallyFrozenBalance().add(account.getFundingFrozenBalance()));
waterRecord.setCreateBy("系统");
ownerLoanAccountRunningWaterRecordDao.saveEntity(waterRecord);
break;
}
}
}
public void ownerLoanAccountUpdate(OwnerLoanRecord ownerLoanRecord, BigDecimal orderChildPrice, OwnerLoanAccount update) {
log.info("执行CAS前置借款账户信息赋值");
Integer loanType = ownerLoanRecord.getLoanType();
OwnerLoanAccount account = ownerLoanAccountDao.getOneByField(OwnerLoanAccount::getOwnerUserNo,
ownerLoanRecord.getOwnerUserNo()).get();
if (OwnerLoanRecordEnum.LoanType.VIRTUAL_CURRENCY.getCode().equals(loanType)) {
log.info("进行虚拟货币信息赋值");
update.setId(account.getId());
update.setModifiedTime(account.getModifiedTime());
update.setVirtuallyFrozenBalance(orderChildPrice);
update.setVirtuallyUsableBalance(orderChildPrice);
update.setVirtuallyAccountBalance(BigDecimal.ZERO);
update.setFundingAccountBalance(BigDecimal.ZERO);
update.setFundingFrozenBalance(BigDecimal.ZERO);
update.setFundingUsableBalance(BigDecimal.ZERO);
} else {
log.info("进行资金信息赋值");
update.setId(account.getId());
update.setModifiedTime(account.getModifiedTime());
update.setFundingFrozenBalance(orderChildPrice);
update.setFundingUsableBalance(orderChildPrice);
update.setFundingAccountBalance(BigDecimal.ZERO);
update.setVirtuallyFrozenBalance(BigDecimal.ZERO);
update.setVirtuallyUsableBalance(BigDecimal.ZERO);
update.setVirtuallyAccountBalance(BigDecimal.ZERO);
}
}
}
......@@ -189,6 +189,7 @@ public class SettlementMqHandlerServiceImpl implements SettlementMqHandlerServic
settlementDriver.setFreight(detail.getFreight());
settlementDriver.setLossPrice(detail.getLossPrice());
settlementDriver.setLossWeight(detail.getLossWeight());
settlementDriver.setLoanFlag(detail.getLoanFlag());
settlementDriver.setLossFreight(detail.getLossFreight());
settlementDriver.setPrepayFreightFlag(detail.getPrepayFreightFlag());
settlementDriver.setSettlementFreight(detail.getSettlementFreight());
......@@ -312,6 +313,7 @@ public class SettlementMqHandlerServiceImpl implements SettlementMqHandlerServic
settlementOwner.setLossWeight(settlementOwnerDetail.getLossWeight());
settlementOwner.setLossFreight(settlementOwnerDetail.getLossFreight());
settlementOwner.setSettlementFreight(settlementOwnerDetail.getSettlementFreight());
settlementOwner.setLoanFreight(settlementOwnerDetail.getLoanFreight());
settlementOwner.setInvoiceType(settlementOwnerDetail.getInvoiceType());
settlementOwner.setInvoiceFreight(settlementOwnerDetail.getInvoiceFreight());
......@@ -361,6 +363,7 @@ public class SettlementMqHandlerServiceImpl implements SettlementMqHandlerServic
settlementOwner.setFreight(settlementOwner.getFreight().add(item.getFreight()));
settlementOwner.setLossWeight(settlementOwner.getLossWeight().add(item.getLossWeight()));
settlementOwner.setLossFreight(settlementOwner.getLossFreight().add(item.getLossFreight()));
settlementOwner.setLoanFreight(settlementOwner.getLoanFreight().add(item.getLoanFreight()));
settlementOwner.setPrepayFreight(settlementOwner.getPrepayFreight().add(item.getPrepayFreight()));
settlementOwner.setSettlementFreight(settlementOwner.getSettlementFreight().add(item.getSettlementFreight()));
settlementOwner.setInvoiceFreight(settlementOwner.getInvoiceFreight().add(item.getInvoiceFreight()));
......@@ -389,6 +392,7 @@ public class SettlementMqHandlerServiceImpl implements SettlementMqHandlerServic
settlementOwner.setLossWeight(settlementOwnerDetail.getLossWeight());
settlementOwner.setLossFreight(settlementOwnerDetail.getLossFreight());
settlementOwner.setSettlementFreight(settlementOwnerDetail.getSettlementFreight());
settlementOwner.setLoanFreight(settlementOwnerDetail.getLoanFreight());
settlementOwner.setInvoiceType(settlementOwnerDetail.getInvoiceType());
settlementOwner.setInvoiceFreight(settlementOwnerDetail.getInvoiceFreight());
......
......@@ -12,6 +12,8 @@ import com.clx.performance.vo.pc.loan.carrier.OwnerOrderPaymentDetailVO;
import com.clx.performance.vo.pc.loan.owner.OwnerLoanRecordDetail;
import com.clx.performance.vo.pc.loan.carrier.CarrierTransferPaymentDetailVO;
import java.math.BigDecimal;
/**
* @author kavin
* Date 2024-01-20
......@@ -35,4 +37,6 @@ public interface OwnerLoanRecordService {
CarrierTransferPaymentDetailVO getTransferPaymentDetail(Integer id);
String savePaymentApplicationForm(ExportPaymentApplicationFormParam param);
void getLoanBalance(BigDecimal orderChildPrice, Long userNo, String childNo);
}
......@@ -17,7 +17,7 @@ public class OwnerLoanAccountRunningWaterRecordSqlProvider {
SELECT(" id, owner_user_no as ownerUserNo, owner_user_name as ownerUserName, mobile, " +
" running_water_no as runningWaterNo, loan_no as loanNo, child_no as childNo, " +
" running_water_type as runningWaterType, " +
" alteration_balance as alterationBalance, useable_balance as useableBalance, frozen_balance as frozenBalance, account_balance as accountBalance, " +
" alteration_balance as alterationBalance, use_able_balance as useAbleBalance, frozen_balance as frozenBalance, account_balance as accountBalance, " +
" create_by as createBy, " +
" date_format(create_time, '%Y-%m-%d %H:%i:%s') as createTime, " +
" date_format(modified_time, '%Y-%m-%d %H:%i:%s') as modifiedTime "
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论