提交 99bafec2 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
...@@ -70,7 +70,7 @@ public enum OwnerLoanRecordEnum { ...@@ -70,7 +70,7 @@ public enum OwnerLoanRecordEnum {
} }
public static String getMsgByCode(Integer code) { public static String getMsgByCode(Integer code) {
return getByCode(code).map(LoanFlag::getMsg).orElse(null); return getByCode(code).map(LoanFlag::getMsg).orElse("无需借款");
} }
} }
......
...@@ -65,7 +65,7 @@ public class CarrierPageSettlementDriverDetailVO { ...@@ -65,7 +65,7 @@ public class CarrierPageSettlementDriverDetailVO {
private Integer loanFlag; private Integer loanFlag;
@ApiModelProperty(value = "借款标示 0:未借款 1:已借款 2:已还款") @ApiModelProperty(value = "借款标示 0:未借款 1:已借款 2:已还款")
private Integer loanFlagMsg; private String loanFlagMsg;
@MoneyOutConvert @MoneyOutConvert
@ApiModelProperty(value = "结算金额") @ApiModelProperty(value = "结算金额")
......
...@@ -64,7 +64,7 @@ public class CarrierPageSettlementDriverVO { ...@@ -64,7 +64,7 @@ public class CarrierPageSettlementDriverVO {
private Integer loanFlag; private Integer loanFlag;
@ApiModelProperty(value = "借款标示 0:未借款 1:已借款 2:已还款") @ApiModelProperty(value = "借款标示 0:未借款 1:已借款 2:已还款")
private Integer loanFlagMsg; private String loanFlagMsg;
@MoneyOutConvert @MoneyOutConvert
@ApiModelProperty(value = "结算金额") @ApiModelProperty(value = "结算金额")
......
...@@ -45,6 +45,7 @@ public class CarrierPageSettlementOwnerVO { ...@@ -45,6 +45,7 @@ public class CarrierPageSettlementOwnerVO {
@MoneyOutConvert @MoneyOutConvert
@ApiModelProperty(value = "结算金额") @ApiModelProperty(value = "结算金额")
private BigDecimal settlementFreight; private BigDecimal settlementFreight;
@MoneyOutConvert
@ApiModelProperty(value = "借款金额") @ApiModelProperty(value = "借款金额")
private BigDecimal loanFreight; private BigDecimal loanFreight;
@MoneyOutConvert @MoneyOutConvert
......
...@@ -192,7 +192,7 @@ public class OrderChildLoanComponent { ...@@ -192,7 +192,7 @@ public class OrderChildLoanComponent {
OwnerQuotationDetailVO quotationDetailVO = orderFeign.getQuotationByOrderNo(settlementDriverDetail.getOrderNo()).getData(); OwnerQuotationDetailVO quotationDetailVO = orderFeign.getQuotationByOrderNo(settlementDriverDetail.getOrderNo()).getData();
BigDecimal freightFreezeRate = quotationDetailVO.getFreightFreezeRate(); BigDecimal freightFreezeRate = quotationDetailVO.getFreightFreezeRate();
if (freightFreezeRate.compareTo(BigDecimal.ONE) == 0) { if (freightFreezeRate.compareTo(new BigDecimal(100)) == 0) {
//百分百预付不需要考虑借款账户 //百分百预付不需要考虑借款账户
log.info("1.1百分百预付不需要考虑借款账户"); log.info("1.1百分百预付不需要考虑借款账户");
return; return;
......
...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; ...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.clx.performance.dao.loan.OwnerLoanAccountRunningWaterRecordDao; import com.clx.performance.dao.loan.OwnerLoanAccountRunningWaterRecordDao;
import com.clx.performance.enums.loan.OwnerLoanAccountRunningWaterRecordEnum;
import com.clx.performance.mapper.loan.OwnerLoanAccountRunningWaterRecordMapper; import com.clx.performance.mapper.loan.OwnerLoanAccountRunningWaterRecordMapper;
import com.clx.performance.model.loan.OwnerLoanAccountRunningWaterRecord; import com.clx.performance.model.loan.OwnerLoanAccountRunningWaterRecord;
import com.clx.performance.param.pc.loan.carrier.PageOwnerLoanAccountWaterRecordOfOwnerParam; import com.clx.performance.param.pc.loan.carrier.PageOwnerLoanAccountWaterRecordOfOwnerParam;
...@@ -92,4 +93,11 @@ public class OwnerLoanAccountRunningWaterRecordDaoImpl extends BaseDaoImpl<Owner ...@@ -92,4 +93,11 @@ public class OwnerLoanAccountRunningWaterRecordDaoImpl extends BaseDaoImpl<Owner
.orderByAsc(OwnerLoanAccountRunningWaterRecord::getId) .orderByAsc(OwnerLoanAccountRunningWaterRecord::getId)
); );
} }
@Override
public List<OwnerLoanAccountRunningWaterRecord> selectLoanRunningWatterRecord(Long loanNo) {
return baseMapper.selectList(lQrWrapper().eq(OwnerLoanAccountRunningWaterRecord::getLoanNo, loanNo)
.eq(OwnerLoanAccountRunningWaterRecord::getRunningWaterType,
OwnerLoanAccountRunningWaterRecordEnum.RunWaterType.APPROVE_FROZEN.getCode())
); }
} }
...@@ -57,14 +57,14 @@ public class OwnerLoanRecordDaoImpl extends BaseDaoImpl<OwnerLoanRecordMapper, O ...@@ -57,14 +57,14 @@ public class OwnerLoanRecordDaoImpl extends BaseDaoImpl<OwnerLoanRecordMapper, O
} }
/** /**
* 查询审批通过并且未用完的借款 * 查询审批通过和付款成功并且未用完的借款(资金+虚拟货币)
* @param userNo * @param userNo
* @return * @return
*/ */
@Override @Override
public List<OwnerLoanRecord> selectLoanBalance(Long userNo) { public List<OwnerLoanRecord> selectLoanBalance(Long userNo) {
return baseMapper.selectList( return baseMapper.selectList(
lQrWrapper().eq(OwnerLoanRecord::getStatus, OwnerLoanRecordEnum.Status.APPROVE_PASS.getCode()) lQrWrapper().in(OwnerLoanRecord::getStatus, OwnerLoanRecordEnum.Status.APPROVE_PASS.getCode(), OwnerLoanRecordEnum.Status.PAY_SUCCESS.getCode())
.eq(OwnerLoanRecord::getOwnerUserNo , userNo) .eq(OwnerLoanRecord::getOwnerUserNo , userNo)
.gt(OwnerLoanRecord::getLoanResidueBalance, 0) .gt(OwnerLoanRecord::getLoanResidueBalance, 0)
.orderByAsc(OwnerLoanRecord::getId) .orderByAsc(OwnerLoanRecord::getId)
......
...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; ...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.clx.performance.dao.settle.SettlementDriverDao; import com.clx.performance.dao.settle.SettlementDriverDao;
import com.clx.performance.enums.loan.OwnerLoanRecordEnum;
import com.clx.performance.mapper.settle.SettlementDriverMapper; import com.clx.performance.mapper.settle.SettlementDriverMapper;
import com.clx.performance.model.settle.SettlementDriver; import com.clx.performance.model.settle.SettlementDriver;
import com.clx.performance.param.pc.driver.PageCarrierSettlementDriverParam; import com.clx.performance.param.pc.driver.PageCarrierSettlementDriverParam;
...@@ -13,6 +14,7 @@ import org.apache.commons.lang3.StringUtils; ...@@ -13,6 +14,7 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import java.util.Objects; import java.util.Objects;
import java.util.Set;
/** /**
* @Author: aiqinguo * @Author: aiqinguo
...@@ -57,4 +59,11 @@ public class SettlementDriverDaoImpl extends BaseDaoImpl<SettlementDriverMapper, ...@@ -57,4 +59,11 @@ public class SettlementDriverDaoImpl extends BaseDaoImpl<SettlementDriverMapper,
) )
.map(super::getOne); .map(super::getOne);
} }
@Override
public void updateLoanFlagByChildNoList(Set<String> childNoList) {
update(lUdWrapper().in(SettlementDriver::getChildNo, childNoList)
.set(SettlementDriver::getLoanFlag, OwnerLoanRecordEnum.LoanFlag.RE_PAY.getCode())
);
}
} }
...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; ...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.clx.performance.dao.settle.SettlementDriverDetailDao; import com.clx.performance.dao.settle.SettlementDriverDetailDao;
import com.clx.performance.enums.loan.OwnerLoanRecordEnum;
import com.clx.performance.mapper.settle.SettlementDriverDetailMapper; import com.clx.performance.mapper.settle.SettlementDriverDetailMapper;
import com.clx.performance.model.settle.SettlementDriverDetail; import com.clx.performance.model.settle.SettlementDriverDetail;
import com.clx.performance.param.pc.driver.PageCarrierSettlementDriverDetailParam; import com.clx.performance.param.pc.driver.PageCarrierSettlementDriverDetailParam;
...@@ -15,6 +16,7 @@ import org.springframework.stereotype.Repository; ...@@ -15,6 +16,7 @@ import org.springframework.stereotype.Repository;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.Objects;
import java.util.Set;
/** /**
* @Author: aiqinguo * @Author: aiqinguo
...@@ -81,4 +83,12 @@ public class SettlementDriverDetailDaoImpl extends BaseDaoImpl<SettlementDriverD ...@@ -81,4 +83,12 @@ public class SettlementDriverDetailDaoImpl extends BaseDaoImpl<SettlementDriverD
return baseMapper.findByDriverSettlementIds(ids); return baseMapper.findByDriverSettlementIds(ids);
} }
@Override
public void updateLoanFlagByChildNoList(Set<String> childNoList) {
update(lUdWrapper()
.in(SettlementDriverDetail::getChildNo, childNoList)
.set(SettlementDriverDetail::getLoanFlag, OwnerLoanRecordEnum.LoanFlag.RE_PAY.getCode())
);
}
} }
...@@ -26,4 +26,6 @@ public interface OwnerLoanAccountRunningWaterRecordDao extends BaseDao<OwnerLoan ...@@ -26,4 +26,6 @@ public interface OwnerLoanAccountRunningWaterRecordDao extends BaseDao<OwnerLoan
OwnerLoanAccountRunningWaterRecord getOneByChildNoAndStatus(String childNo, Integer type); OwnerLoanAccountRunningWaterRecord getOneByChildNoAndStatus(String childNo, Integer type);
List<OwnerLoanAccountRunningWaterRecord> getListByOrderNoAndRunningWaterType(String childNo, Integer runningWaterType); List<OwnerLoanAccountRunningWaterRecord> getListByOrderNoAndRunningWaterType(String childNo, Integer runningWaterType);
List<OwnerLoanAccountRunningWaterRecord> selectLoanRunningWatterRecord(Long loanNo);
} }
...@@ -7,6 +7,8 @@ import com.clx.performance.param.pc.driver.PageCarrierSettlementDriverParam; ...@@ -7,6 +7,8 @@ import com.clx.performance.param.pc.driver.PageCarrierSettlementDriverParam;
import com.msl.common.base.Optional; import com.msl.common.base.Optional;
import com.msl.common.dao.BaseDao; import com.msl.common.dao.BaseDao;
import java.util.Set;
/** /**
* @Author: aiqinguo * @Author: aiqinguo
* @Description: 车主结算单 * @Description: 车主结算单
...@@ -18,4 +20,6 @@ public interface SettlementDriverDao extends BaseDao<SettlementDriverMapper, Set ...@@ -18,4 +20,6 @@ public interface SettlementDriverDao extends BaseDao<SettlementDriverMapper, Set
Optional<SettlementDriver> getByChildNo(String childNo); Optional<SettlementDriver> getByChildNo(String childNo);
void updateLoanFlagByChildNoList(Set<String> childNoList);
} }
...@@ -9,6 +9,7 @@ import com.msl.common.dao.BaseDao; ...@@ -9,6 +9,7 @@ import com.msl.common.dao.BaseDao;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.List; import java.util.List;
import java.util.Set;
/** /**
* @Author: aiqinguo * @Author: aiqinguo
...@@ -31,4 +32,5 @@ public interface SettlementDriverDetailDao extends BaseDao<SettlementDriverDetai ...@@ -31,4 +32,5 @@ public interface SettlementDriverDetailDao extends BaseDao<SettlementDriverDetai
List<SettlementDriverDetail> findByDriverSettlementIds(List<Integer> ids); List<SettlementDriverDetail> findByDriverSettlementIds(List<Integer> ids);
void updateLoanFlagByChildNoList(Set<String> childNoList);
} }
...@@ -10,6 +10,7 @@ import com.msl.common.dao.BaseDao; ...@@ -10,6 +10,7 @@ import com.msl.common.dao.BaseDao;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
import java.util.Set;
/** /**
......
package com.clx.performance.event; package com.clx.performance.event;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.exceptions.ExceptionUtil; import cn.hutool.core.exceptions.ExceptionUtil;
import cn.hutool.json.JSONUtil; import cn.hutool.json.JSONUtil;
import com.clx.performance.component.OrderChildLoanComponent; import com.clx.performance.component.OrderChildLoanComponent;
import com.clx.performance.dao.loan.OrderChildLoanRetryRecordDao; import com.clx.performance.dao.loan.OrderChildLoanRetryRecordDao;
import com.clx.performance.dao.loan.OwnerLoanAccountRunningWaterRecordDao;
import com.clx.performance.dao.loan.OwnerRepaymentDao; import com.clx.performance.dao.loan.OwnerRepaymentDao;
import com.clx.performance.dao.settle.SettlementDriverDao;
import com.clx.performance.dao.settle.SettlementDriverDetailDao; import com.clx.performance.dao.settle.SettlementDriverDetailDao;
import com.clx.performance.dao.settle.SettlementOwnerDetailDao; import com.clx.performance.dao.settle.SettlementOwnerDetailDao;
import com.clx.performance.dto.OwnerLoanMqDTO; import com.clx.performance.dto.OwnerLoanMqDTO;
...@@ -12,6 +15,7 @@ import com.clx.performance.enums.loan.OwnerLoanRecordEnum; ...@@ -12,6 +15,7 @@ import com.clx.performance.enums.loan.OwnerLoanRecordEnum;
import com.clx.performance.enums.loan.OwnerRePaymentEnum; import com.clx.performance.enums.loan.OwnerRePaymentEnum;
import com.clx.performance.model.OrderChild; import com.clx.performance.model.OrderChild;
import com.clx.performance.model.loan.OrderChildLoanRetryRecord; import com.clx.performance.model.loan.OrderChildLoanRetryRecord;
import com.clx.performance.model.loan.OwnerLoanAccountRunningWaterRecord;
import com.clx.performance.model.loan.OwnerRepayment; import com.clx.performance.model.loan.OwnerRepayment;
import com.clx.performance.model.settle.SettlementDriverDetail; import com.clx.performance.model.settle.SettlementDriverDetail;
import com.clx.performance.model.settle.SettlementOwnerDetail; import com.clx.performance.model.settle.SettlementOwnerDetail;
...@@ -23,6 +27,11 @@ import org.springframework.context.event.EventListener; ...@@ -23,6 +27,11 @@ import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.transaction.PlatformTransactionManager; import org.springframework.transaction.PlatformTransactionManager;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
@Component @Component
@Slf4j @Slf4j
@AllArgsConstructor @AllArgsConstructor
...@@ -42,6 +51,10 @@ public class EventListenerComponent { ...@@ -42,6 +51,10 @@ public class EventListenerComponent {
private final ApplicationEventPublisher applicationEventPublisher; private final ApplicationEventPublisher applicationEventPublisher;
private final SettlementDriverDao settlementDriverDao;
private final OwnerLoanAccountRunningWaterRecordDao ownerLoanAccountRunningWaterRecordDao;
@EventListener(classes = {SettlementUpdateEvent.class}) @EventListener(classes = {SettlementUpdateEvent.class})
public void listen(SettlementUpdateEvent event) { public void listen(SettlementUpdateEvent event) {
...@@ -94,4 +107,28 @@ public class EventListenerComponent { ...@@ -94,4 +107,28 @@ public class EventListenerComponent {
// 发送mq 通过开票标识 // 发送mq 通过开票标识
settlementMqService.invoiceTypeSync(settlementDriverDetail.getChildNo(), settlementDriverDetail.getInvoiceType()); settlementMqService.invoiceTypeSync(settlementDriverDetail.getChildNo(), settlementDriverDetail.getInvoiceType());
} }
@EventListener(classes = {OwnerLoanFlagEvent.class})
public void listen(OwnerLoanFlagEvent event) {
log.info("OwnerLoanFlagEvent事件执行");
Long loanNo = event.getLoanNo();
List<OwnerLoanAccountRunningWaterRecord> records = ownerLoanAccountRunningWaterRecordDao.selectLoanRunningWatterRecord(loanNo);
if (CollectionUtil.isEmpty(records)) {
return;
}
Map<String, List<OwnerLoanAccountRunningWaterRecord>> listMap = records.stream().collect(Collectors.groupingBy(OwnerLoanAccountRunningWaterRecord::getChildNo));
for (Map.Entry<String, List<OwnerLoanAccountRunningWaterRecord>> entry : listMap.entrySet()) {
if (entry.getValue().size() > 1) {
log.info("当前运单{}存在多条流水,不更新还款标志", entry.getKey());
listMap.remove(entry.getKey());
}
}
log.info("当前需要更新的运单数量:{}", listMap.size());
settlementDriverDetailDao.updateLoanFlagByChildNoList(listMap.keySet());
settlementDriverDao.updateLoanFlagByChildNoList(listMap.keySet());
}
} }
package com.clx.performance.event;
import lombok.Getter;
import lombok.Setter;
import org.springframework.context.ApplicationEvent;
@Getter
@Setter
public class OwnerLoanFlagEvent extends ApplicationEvent {
private Long loanNo;
/**
* Create a new {@code ApplicationEvent}.
*
* @param source the object on which the event initially occurred or with
* which the event is associated (never {@code null})
*/
public OwnerLoanFlagEvent(Object source) {
super(source);
}
public OwnerLoanFlagEvent(Object source, Long loanNo) {
super(source);
this.loanNo = loanNo;
}
}
...@@ -21,7 +21,7 @@ public interface OwnerLoanAccountMapper extends BaseMapper<OwnerLoanAccount> { ...@@ -21,7 +21,7 @@ public interface OwnerLoanAccountMapper extends BaseMapper<OwnerLoanAccount> {
@Update("update owner_loan_account set funding_account_balance = funding_account_balance + #{account.fundingAccountBalance}" + @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}" + ",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_account_balance = virtually_account_balance + #{account.virtuallyAccountBalance},virtually_usable_balance = virtually_usable_balance + #{account.virtuallyUsableBalance}" +
",virtually_frozen_balance = virtually_frozen_balance + #{account.virtuallyFrozenBalance}" + ",virtually_frozen_balance = virtually_frozen_balance + #{account.virtuallyFrozenBalance},funding_arrears = funding_arrears + #{account.fundingArrears},virtually_arrears = virtually_arrears + #{account.virtuallyArrears}" +
",modified_time=#{now}" ",modified_time=#{now}"
+ "where id = #{account.id} and modified_time = #{account.modifiedTime}" + "where id = #{account.id} and modified_time = #{account.modifiedTime}"
) )
...@@ -30,7 +30,7 @@ public interface OwnerLoanAccountMapper extends BaseMapper<OwnerLoanAccount> { ...@@ -30,7 +30,7 @@ public interface OwnerLoanAccountMapper extends BaseMapper<OwnerLoanAccount> {
@Update("update owner_loan_account set funding_account_balance = funding_account_balance - #{account.fundingAccountBalance}" + @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}" + ",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_account_balance = virtually_account_balance - #{account.virtuallyAccountBalance},virtually_usable_balance = virtually_usable_balance - #{account.virtuallyUsableBalance}" +
",virtually_frozen_balance = virtually_frozen_balance + #{account.virtuallyFrozenBalance}" + ",virtually_frozen_balance = virtually_frozen_balance + #{account.virtuallyFrozenBalance},funding_arrears = funding_arrears - #{account.fundingArrears},virtually_arrears = virtually_arrears - #{account.virtuallyArrears}" +
",modified_time=#{now}" ",modified_time=#{now}"
+ "where id = #{account.id} and modified_time = #{account.modifiedTime}" + "where id = #{account.id} and modified_time = #{account.modifiedTime}"
) )
......
package com.clx.performance.service.impl.loan; package com.clx.performance.service.impl.loan;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.json.JSONObject; import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil; import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
...@@ -184,7 +185,6 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService { ...@@ -184,7 +185,6 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService {
.orElseThrow(PerformanceResultEnum.DATA_NOT_FIND); .orElseThrow(PerformanceResultEnum.DATA_NOT_FIND);
//同意 //同意
ownerLoanRecord.setPayChannel(param.getPayChannel());
ownerLoanRecord.setLoanType(param.getLoanType()); ownerLoanRecord.setLoanType(param.getLoanType());
//设置借款记录中借款方和借出方的银行账户信息 //设置借款记录中借款方和借出方的银行账户信息
...@@ -223,6 +223,9 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService { ...@@ -223,6 +223,9 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService {
entity.setVirtuallyFrozenBalance(BigDecimal.ZERO); entity.setVirtuallyFrozenBalance(BigDecimal.ZERO);
entity.setVirtuallyUsableBalance(ownerLoanRecord.getLoanBalance()); entity.setVirtuallyUsableBalance(ownerLoanRecord.getLoanBalance());
entity.setModifiedTime(ownerLoanAccount.getModifiedTime()); entity.setModifiedTime(ownerLoanAccount.getModifiedTime());
entity.setFundingArrears(BigDecimal.ZERO);
entity.setVirtuallyArrears(ownerLoanRecord.getLoanBalance());
Integer flag = ownerLoanAccountDao.updateAccountCAS(entity, LocalDateTime.now(), true); Integer flag = ownerLoanAccountDao.updateAccountCAS(entity, LocalDateTime.now(), true);
if (flag == 1) { if (flag == 1) {
//生成借款流水 //生成借款流水
...@@ -303,7 +306,7 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService { ...@@ -303,7 +306,7 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService {
* @param ownerLoanRecord * @param ownerLoanRecord
*/ */
private void initOwnerLoanRunningWaterRecord(OwnerLoanRecord ownerLoanRecord) { private void initOwnerLoanRunningWaterRecord(OwnerLoanRecord ownerLoanRecord) {
OwnerLoanAccount ownerLoanAccount= ownerLoanAccountDao.getOneByField(OwnerLoanAccount::getOwnerUserNo, ownerLoanRecord.getOwnerUserNo()).get(); OwnerLoanAccount ownerLoanAccount = ownerLoanAccountDao.getOneByField(OwnerLoanAccount::getOwnerUserNo, ownerLoanRecord.getOwnerUserNo()).get();
ownerLoanRecordDao.updateEntityByKey(ownerLoanRecord); ownerLoanRecordDao.updateEntityByKey(ownerLoanRecord);
OwnerLoanAccountRunningWaterRecord record = new OwnerLoanAccountRunningWaterRecord() OwnerLoanAccountRunningWaterRecord record = new OwnerLoanAccountRunningWaterRecord()
.setOwnerUserNo(ownerLoanRecord.getOwnerUserNo()) .setOwnerUserNo(ownerLoanRecord.getOwnerUserNo())
...@@ -466,24 +469,52 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService { ...@@ -466,24 +469,52 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService {
List<OwnerLoanRecord> ownerLoanRecords = ownerLoanRecordDao.selectLoanBalance(userNo); List<OwnerLoanRecord> ownerLoanRecords = ownerLoanRecordDao.selectLoanBalance(userNo);
BigDecimal orderChildPriceTemp = orderChildPrice; BigDecimal orderChildPriceTemp = orderChildPrice;
log.info("查询ownerLoanRecords:{}", JSONUtil.parse(ownerLoanRecords)); log.info("查询ownerLoanRecords:{}", JSONUtil.parse(ownerLoanRecords));
for (OwnerLoanRecord ownerLoanRecord : ownerLoanRecords) { Map<Integer, List<OwnerLoanRecord>> listMap = ownerLoanRecords.stream().collect(Collectors.groupingBy(OwnerLoanRecord::getLoanType));
BigDecimal loanResidueBalance = ownerLoanRecord.getLoanResidueBalance();
log.info("当前借款金额:{},借款单号{},借款剩余金额{}", orderChildPriceTemp, ownerLoanRecord.getLoanNo(), loanResidueBalance); List<OwnerLoanRecord> verList = listMap.get(OwnerLoanRecordEnum.LoanType.VIRTUAL_CURRENCY.getCode());
if (loanResidueBalance.compareTo(orderChildPriceTemp) >= 0) { if (CollectionUtil.isNotEmpty(verList)) {
log.info("当前借款单的剩余金额足够借款金额"); for (OwnerLoanRecord ownerLoanRecord : verList) {
generateFrozenOwnerLoanRunningWater(ownerLoanRecord, childNo, orderChildPriceTemp); BigDecimal loanResidueBalance = ownerLoanRecord.getLoanResidueBalance();
updateList.add(ownerLoanRecord.setLoanResidueBalance(loanResidueBalance.subtract(orderChildPriceTemp))); log.info("当前借款金额:{},虚拟币借款单号{},借款剩余金额{}", orderChildPriceTemp, ownerLoanRecord.getLoanNo(), loanResidueBalance);
orderChildPriceTemp = BigDecimal.ZERO; if (loanResidueBalance.compareTo(orderChildPriceTemp) >= 0) {
break; log.info("当前借款单的剩余金额足够借款金额");
} else { generateFrozenOwnerLoanRunningWater(ownerLoanRecord, childNo, orderChildPriceTemp);
log.info("当前借款单的剩余金额不够抵扣借款金额,先进行扣除当前借款所有剩余"); updateList.add(ownerLoanRecord.setLoanResidueBalance(loanResidueBalance.subtract(orderChildPriceTemp)));
generateFrozenOwnerLoanRunningWater(ownerLoanRecord, childNo, loanResidueBalance); orderChildPriceTemp = BigDecimal.ZERO;
updateList.add(ownerLoanRecord.setLoanResidueBalance(BigDecimal.ZERO)); break;
orderChildPriceTemp = orderChildPriceTemp.subtract(loanResidueBalance); } else {
log.info("当前借款单的剩余金额不够抵扣借款金额,先进行扣除当前借款所有剩余");
generateFrozenOwnerLoanRunningWater(ownerLoanRecord, childNo, loanResidueBalance);
updateList.add(ownerLoanRecord.setLoanResidueBalance(BigDecimal.ZERO));
orderChildPriceTemp = orderChildPriceTemp.subtract(loanResidueBalance);
}
log.info("当前虚拟币orderChildPriceTemp:{}", orderChildPriceTemp);
}
}
List<OwnerLoanRecord> fundList = listMap.get(OwnerLoanRecordEnum.LoanType.FUND.getCode());
if (orderChildPriceTemp.compareTo(BigDecimal.ZERO) !=0 && CollectionUtil.isNotEmpty(fundList)) {
for (OwnerLoanRecord ownerLoanRecord : fundList) {
BigDecimal loanResidueBalance = ownerLoanRecord.getLoanResidueBalance();
log.info("当前借款金额:{},资金借款单号{},借款剩余金额{}", orderChildPriceTemp, ownerLoanRecord.getLoanNo(), loanResidueBalance);
if (loanResidueBalance.compareTo(orderChildPriceTemp) >= 0) {
log.info("当前借款单的剩余金额足够借款金额");
generateFrozenOwnerLoanRunningWater(ownerLoanRecord, childNo, orderChildPriceTemp);
updateList.add(ownerLoanRecord.setLoanResidueBalance(loanResidueBalance.subtract(orderChildPriceTemp)));
orderChildPriceTemp = BigDecimal.ZERO;
break;
} else {
log.info("当前借款单的剩余金额不够抵扣借款金额,先进行扣除当前借款所有剩余");
generateFrozenOwnerLoanRunningWater(ownerLoanRecord, childNo, loanResidueBalance);
updateList.add(ownerLoanRecord.setLoanResidueBalance(BigDecimal.ZERO));
orderChildPriceTemp = orderChildPriceTemp.subtract(loanResidueBalance);
}
log.info("当前资金orderChildPriceTemp:{}", orderChildPriceTemp);
} }
log.info("当前orderChildPriceTemp:{}", orderChildPriceTemp);
} }
if (orderChildPriceTemp.compareTo(BigDecimal.ZERO) != 0) { if (orderChildPriceTemp.compareTo(BigDecimal.ZERO) != 0) {
//当前钱不够,需要记录,流程卡死,不往下走 //当前钱不够,需要记录,流程卡死,不往下走
...@@ -575,7 +606,7 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService { ...@@ -575,7 +606,7 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService {
BankTrade bankTrade = bankTradeDao.selectByMerchantRunningWaterNo(merSeqNo).get(); BankTrade bankTrade = bankTradeDao.selectByMerchantRunningWaterNo(merSeqNo).get();
OwnerLoanRecord ownerLoanRecord = ownerLoanRecordDao.getOneByField(OwnerLoanRecord::getLoanNo, bankTrade.getRelationNo()) OwnerLoanRecord ownerLoanRecord = ownerLoanRecordDao.getOneByField(OwnerLoanRecord::getLoanNo, bankTrade.getRelationNo())
.orElseThrow(PerformanceResultEnum.DATA_NOT_FIND); .orElseThrow(PerformanceResultEnum.DATA_NOT_FIND);
if (Objects.equals(ownerLoanRecord.getStatus(), OwnerLoanRecordEnum.Status.PAYING.getCode())) { if (!Objects.equals(ownerLoanRecord.getStatus(), OwnerLoanRecordEnum.Status.PAYING.getCode())) {
log.info("借款单非支付中状态, loanNo:{}", bankTrade.getRelationNo()); log.info("借款单非支付中状态, loanNo:{}", bankTrade.getRelationNo());
return; return;
} }
...@@ -594,7 +625,7 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService { ...@@ -594,7 +625,7 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService {
OwnerLoanRecord ownerLoanRecord = ownerLoanRecordDao.getOneByField(OwnerLoanRecord::getLoanNo, bankTrade.getRelationNo()) OwnerLoanRecord ownerLoanRecord = ownerLoanRecordDao.getOneByField(OwnerLoanRecord::getLoanNo, bankTrade.getRelationNo())
.orElseThrow(PerformanceResultEnum.DATA_NOT_FIND); .orElseThrow(PerformanceResultEnum.DATA_NOT_FIND);
if (Objects.equals(ownerLoanRecord.getStatus(), OwnerLoanRecordEnum.Status.PAYING.getCode())) { if (!Objects.equals(ownerLoanRecord.getStatus(), OwnerLoanRecordEnum.Status.PAYING.getCode())) {
log.info("借款单非支付中状态, loanNo:{}", ownerLoanRecord.getLoanNo()); log.info("借款单非支付中状态, loanNo:{}", ownerLoanRecord.getLoanNo());
return; return;
} }
...@@ -605,13 +636,17 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService { ...@@ -605,13 +636,17 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService {
ownerLoanRecord.getOwnerUserNo()).get(); ownerLoanRecord.getOwnerUserNo()).get();
OwnerLoanAccount entity = new OwnerLoanAccount(); OwnerLoanAccount entity = new OwnerLoanAccount();
entity.setId(ownerLoanAccount.getId()); entity.setId(ownerLoanAccount.getId());
entity.setFundingAccountBalance(BigDecimal.ZERO); entity.setVirtuallyAccountBalance(BigDecimal.ZERO);
entity.setFundingFrozenBalance(BigDecimal.ZERO);
entity.setFundingUsableBalance(BigDecimal.ZERO);
entity.setVirtuallyAccountBalance(ownerLoanRecord.getLoanBalance());
entity.setVirtuallyFrozenBalance(BigDecimal.ZERO); entity.setVirtuallyFrozenBalance(BigDecimal.ZERO);
entity.setVirtuallyUsableBalance(ownerLoanRecord.getLoanBalance()); entity.setVirtuallyUsableBalance(BigDecimal.ZERO);
entity.setFundingAccountBalance(ownerLoanRecord.getLoanBalance());
entity.setFundingFrozenBalance(BigDecimal.ZERO);
entity.setFundingUsableBalance(ownerLoanRecord.getLoanBalance());
entity.setFundingArrears(ownerLoanRecord.getLoanBalance());
entity.setVirtuallyArrears(BigDecimal.ZERO);
entity.setModifiedTime(ownerLoanAccount.getModifiedTime()); entity.setModifiedTime(ownerLoanAccount.getModifiedTime());
Integer flag = ownerLoanAccountDao.updateAccountCAS(entity, LocalDateTime.now(), true); Integer flag = ownerLoanAccountDao.updateAccountCAS(entity, LocalDateTime.now(), true);
if (flag == 1) { if (flag == 1) {
//生成借款流水 //生成借款流水
...@@ -702,7 +737,9 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService { ...@@ -702,7 +737,9 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService {
log.info("13.生成借款冻结流水"); log.info("13.生成借款冻结流水");
OwnerLoanAccount update = new OwnerLoanAccount(); OwnerLoanAccount update = new OwnerLoanAccount();
while (true) { while (true) {
//赋值
ownerLoanAccountUpdate(ownerLoanRecord, orderChildPrice, update); ownerLoanAccountUpdate(ownerLoanRecord, orderChildPrice, update);
log.info("13.1 当前cas更新对象信息:{}", JSONUtil.parse(update));
Integer i = ownerLoanAccountDao.updateAccountCAS(update, LocalDateTime.now(), false); Integer i = ownerLoanAccountDao.updateAccountCAS(update, LocalDateTime.now(), false);
log.info("CAS更新结果:{}", i); log.info("CAS更新结果:{}", i);
if (i == 1) { if (i == 1) {
...@@ -747,6 +784,8 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService { ...@@ -747,6 +784,8 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService {
update.setFundingAccountBalance(BigDecimal.ZERO); update.setFundingAccountBalance(BigDecimal.ZERO);
update.setFundingFrozenBalance(BigDecimal.ZERO); update.setFundingFrozenBalance(BigDecimal.ZERO);
update.setFundingUsableBalance(BigDecimal.ZERO); update.setFundingUsableBalance(BigDecimal.ZERO);
update.setFundingArrears(BigDecimal.ZERO);
update.setVirtuallyArrears(BigDecimal.ZERO);
} else { } else {
log.info("进行资金信息赋值"); log.info("进行资金信息赋值");
update.setId(account.getId()); update.setId(account.getId());
...@@ -758,6 +797,8 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService { ...@@ -758,6 +797,8 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService {
update.setVirtuallyFrozenBalance(BigDecimal.ZERO); update.setVirtuallyFrozenBalance(BigDecimal.ZERO);
update.setVirtuallyUsableBalance(BigDecimal.ZERO); update.setVirtuallyUsableBalance(BigDecimal.ZERO);
update.setVirtuallyAccountBalance(BigDecimal.ZERO); update.setVirtuallyAccountBalance(BigDecimal.ZERO);
update.setFundingArrears(BigDecimal.ZERO);
update.setVirtuallyArrears(BigDecimal.ZERO);
} }
} }
......
...@@ -15,20 +15,16 @@ import com.clx.performance.config.ClxMessageConfig; ...@@ -15,20 +15,16 @@ import com.clx.performance.config.ClxMessageConfig;
import com.clx.performance.config.loan.ClxPayeeConfig; import com.clx.performance.config.loan.ClxPayeeConfig;
import com.clx.performance.config.loan.PaymentFromConfig; import com.clx.performance.config.loan.PaymentFromConfig;
import com.clx.performance.config.nbbank.NbBankConfig; import com.clx.performance.config.nbbank.NbBankConfig;
import com.clx.performance.dao.loan.BankTradeDao; import com.clx.performance.dao.loan.*;
import com.clx.performance.dao.loan.OwnerLoanRecordDao;
import com.clx.performance.dao.loan.OwnerPaymentDao;
import com.clx.performance.dao.loan.OwnerRepaymentDao;
import com.clx.performance.enums.PerformanceResultEnum; import com.clx.performance.enums.PerformanceResultEnum;
import com.clx.performance.enums.loan.OwnerLoanRecordEnum; import com.clx.performance.enums.loan.OwnerLoanRecordEnum;
import com.clx.performance.enums.loan.OwnerPaymentEnum; import com.clx.performance.enums.loan.OwnerPaymentEnum;
import com.clx.performance.enums.loan.OwnerRePaymentEnum; import com.clx.performance.enums.loan.OwnerRePaymentEnum;
import com.clx.performance.enums.nbbank.NbBankStatusEnum; import com.clx.performance.enums.nbbank.NbBankStatusEnum;
import com.clx.performance.event.OwnerLoanFlagEvent;
import com.clx.performance.event.OwnerRepaymentUpdateEvent;
import com.clx.performance.extranal.user.impl.OwnerInfoServiceImpl; import com.clx.performance.extranal.user.impl.OwnerInfoServiceImpl;
import com.clx.performance.model.loan.BankTrade; import com.clx.performance.model.loan.*;
import com.clx.performance.model.loan.OwnerLoanRecord;
import com.clx.performance.model.loan.OwnerPayment;
import com.clx.performance.model.loan.OwnerRepayment;
import com.clx.performance.param.pc.loan.carrier.PageCarrierOwnerRepaymentParam; import com.clx.performance.param.pc.loan.carrier.PageCarrierOwnerRepaymentParam;
import com.clx.performance.param.pc.loan.carrier.PageOwnerRepaymentOfOwner; import com.clx.performance.param.pc.loan.carrier.PageOwnerRepaymentOfOwner;
import com.clx.performance.param.pc.loan.owner.ExportPaymentApplicationFormParam; import com.clx.performance.param.pc.loan.owner.ExportPaymentApplicationFormParam;
...@@ -54,9 +50,11 @@ import com.msl.user.data.UserSessionData; ...@@ -54,9 +50,11 @@ import com.msl.user.data.UserSessionData;
import com.msl.user.utils.TokenUtil; import com.msl.user.utils.TokenUtil;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.*; import java.util.*;
...@@ -84,6 +82,8 @@ public class OwnerRepaymentServiceImpl implements OwnerRepaymentService { ...@@ -84,6 +82,8 @@ public class OwnerRepaymentServiceImpl implements OwnerRepaymentService {
private final IdGenerateSnowFlake idGenerateSnowFlake; private final IdGenerateSnowFlake idGenerateSnowFlake;
private final OwnerPaymentDao ownerPaymentDao; private final OwnerPaymentDao ownerPaymentDao;
private final OwnerLoanRecordDao ownerLoanRecordDao; private final OwnerLoanRecordDao ownerLoanRecordDao;
private final ApplicationEventPublisher applicationEventPublisher;
private final OwnerLoanAccountDao ownerLoanAccountDao;
@Override @Override
public IPage<OwnerRepaymentVO> pageOwnerRepayment(PageCarrierOwnerRepaymentParam param) { public IPage<OwnerRepaymentVO> pageOwnerRepayment(PageCarrierOwnerRepaymentParam param) {
...@@ -271,12 +271,40 @@ public class OwnerRepaymentServiceImpl implements OwnerRepaymentService { ...@@ -271,12 +271,40 @@ public class OwnerRepaymentServiceImpl implements OwnerRepaymentService {
// 查询还款信息 // 查询还款信息
OwnerRepayment ownerRepayment = ownerRepaymentDao.getOneByField(OwnerRepayment::getRepaymentNo, bankTrade.getRelationNo()).get(); OwnerRepayment ownerRepayment = ownerRepaymentDao.getOneByField(OwnerRepayment::getRepaymentNo, bankTrade.getRelationNo()).get();
ownerRepayment.setStatus(OwnerRePaymentEnum.Status.PAY_SUCCESS.getCode()); ownerRepayment.setStatus(OwnerRePaymentEnum.Status.PAY_SUCCESS.getCode());
// 更新款信息 // 更新款信息
ownerRepaymentDao.updateStatusById(ownerRepayment); ownerRepaymentDao.updateStatusById(ownerRepayment);
OwnerLoanRecord ownerLoanRecord = ownerLoanRecordDao.getOneByField(OwnerLoanRecord::getLoanNo, OwnerLoanRecord ownerLoanRecord = ownerLoanRecordDao.getOneByField(OwnerLoanRecord::getLoanNo,
ownerRepayment.getLoanNo()).orElseThrow(PerformanceResultEnum.DATA_NOT_FIND); ownerRepayment.getLoanNo()).orElseThrow(PerformanceResultEnum.DATA_NOT_FIND);
while (true) {
OwnerLoanAccount ownerLoanAccount = ownerLoanAccountDao.getOneByField(OwnerLoanAccount::getOwnerUserNo,
ownerLoanRecord.getOwnerUserNo()).get();
OwnerLoanAccount entity = new OwnerLoanAccount();
if (OwnerLoanRecordEnum.LoanType.FUND.getCode().equals(ownerLoanRecord.getLoanType())) {
entity.setFundingArrears(ownerLoanRecord.getLoanBalance());
entity.setVirtuallyArrears(BigDecimal.ZERO);
} else {
entity.setFundingArrears(BigDecimal.ZERO);
entity.setVirtuallyArrears(ownerLoanRecord.getLoanBalance());
}
entity.setFundingFrozenBalance(BigDecimal.ZERO);
entity.setFundingUsableBalance(BigDecimal.ZERO);
entity.setFundingAccountBalance(BigDecimal.ZERO);
entity.setVirtuallyFrozenBalance(BigDecimal.ZERO);
entity.setVirtuallyUsableBalance(BigDecimal.ZERO);
entity.setVirtuallyAccountBalance(BigDecimal.ZERO);
entity.setId(ownerLoanAccount.getId());
entity.setModifiedTime(ownerLoanAccount.getModifiedTime());
Integer flag = ownerLoanAccountDao.updateAccountCAS(entity, LocalDateTime.now(), false);
if (flag > 0) {
break;
}
}
//生成付款记录 //生成付款记录
OwnerPayment ownerPayment = new OwnerPayment(); OwnerPayment ownerPayment = new OwnerPayment();
ownerPayment.setOwnerUserNo(ownerRepayment.getOwnerUserNo()); ownerPayment.setOwnerUserNo(ownerRepayment.getOwnerUserNo());
...@@ -297,6 +325,9 @@ public class OwnerRepaymentServiceImpl implements OwnerRepaymentService { ...@@ -297,6 +325,9 @@ public class OwnerRepaymentServiceImpl implements OwnerRepaymentService {
ownerPayment.setPayChannel(OwnerLoanRecordEnum.PayChannel.ASSET.getCode()); ownerPayment.setPayChannel(OwnerLoanRecordEnum.PayChannel.ASSET.getCode());
ownerPayment.setCreateBy("系统"); ownerPayment.setCreateBy("系统");
ownerPaymentDao.saveEntity(ownerPayment); ownerPaymentDao.saveEntity(ownerPayment);
applicationEventPublisher.publishEvent(new OwnerLoanFlagEvent(this, ownerRepayment.getLoanNo()));
} }
@Override @Override
......
...@@ -13,8 +13,10 @@ import java.util.List; ...@@ -13,8 +13,10 @@ import java.util.List;
@Mapper(componentModel = "spring", uses = DateStructUtil.class, imports = {DateUtils.class}) @Mapper(componentModel = "spring", uses = DateStructUtil.class, imports = {DateUtils.class})
public interface SettlementDriverDetailStruct { public interface SettlementDriverDetailStruct {
@Mapping(target = "loanFlagMsg", expression = "java(com.clx.performance.service.impl.settle.SettlementDriverDetailServiceImpl.formatLoanMsg(detail.getLoanFlag()))")
List<CarrierPageSettlementDriverDetailVO> covertList(List<SettlementDriverDetail> records); List<CarrierPageSettlementDriverDetailVO> covertList(List<SettlementDriverDetail> records);
@Mapping(target = "loanFlagMsg", expression = "java(com.clx.performance.enums.loan.OwnerLoanRecordEnum.LoanFlag.getMsgByCode(detail.getLoanFlag()))")
CarrierPageSettlementDriverDetailVO convert(SettlementDriverDetail detail);
OrderChildSyncTransportRecord convertRecord(SettlementDriverDetail detail); OrderChildSyncTransportRecord convertRecord(SettlementDriverDetail detail);
} }
...@@ -8,7 +8,6 @@ import org.mapstruct.IterableMapping; ...@@ -8,7 +8,6 @@ import org.mapstruct.IterableMapping;
import org.mapstruct.Mapper; import org.mapstruct.Mapper;
import org.mapstruct.Mapping; import org.mapstruct.Mapping;
import org.mapstruct.Named; import org.mapstruct.Named;
import java.util.List; import java.util.List;
@Mapper(componentModel = "spring", uses = DateStructUtil.class, imports = {DateUtils.class}) @Mapper(componentModel = "spring", uses = DateStructUtil.class, imports = {DateUtils.class})
...@@ -17,9 +16,9 @@ public interface SettlementDriverStruct { ...@@ -17,9 +16,9 @@ public interface SettlementDriverStruct {
@Named("toBaseVo") @Named("toBaseVo")
@Mapping(target = "payErrorMsg", expression = "java(com.clx.performance.service.impl.settle.SettlementDriverServiceImpl.formatPayMsg(detail.getStatus(),detail.getPayErrorMsg()))") @Mapping(target = "payErrorMsg", expression = "java(com.clx.performance.service.impl.settle.SettlementDriverServiceImpl.formatPayMsg(detail.getStatus(),detail.getPayErrorMsg()))")
@Mapping(target = "loanFlagMsg", expression = "java(com.clx.performance.enums.loan.OwnerLoanRecordEnum.LoanFlag.getMsgByCode(detail.getLoanFlag()))")
CarrierPageSettlementDriverVO convert(SettlementDriver detail); CarrierPageSettlementDriverVO convert(SettlementDriver detail);
@Mapping(target = "loanFlagMsg", expression = "java(com.clx.performance.service.impl.settle.SettlementDriverServiceImpl.formatLoanMsg(detail.getLoanFlag()))")
@IterableMapping(qualifiedByName = "toBaseVo") @IterableMapping(qualifiedByName = "toBaseVo")
List<CarrierPageSettlementDriverVO> covertList(List<SettlementDriver> records); List<CarrierPageSettlementDriverVO> covertList(List<SettlementDriver> records);
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论