提交 b688f20c authored 作者: liuhaiquan's avatar liuhaiquan

增加借款列表相关接口

上级 5ef33676
package com.clx.performance.vo.pc.loan.carrier;
import com.msl.common.convertor.type.MoneyOutConvert;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import java.math.BigDecimal;
import java.util.List;
/**
* @ClassName CashierInfoVO
* @Description
* @Author kavin
* @Date 2024/1/24 16:24
* @Version 1.0
*/
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class CashierInfoVO {
@ApiModelProperty("借款单号")
private Long loanNo;
@ApiModelProperty("货物名称")
private String goodsName;
@ApiModelProperty("交易流水号(第三方)")
private String runningWaterOpenNo;
@MoneyOutConvert
@ApiModelProperty("订单金额")
private BigDecimal loanBalance;
@ApiModelProperty("支付方式")
private List<Integer> payWay;
@ApiModelProperty("付款账户")
private String payAccount;
}
package com.clx.performance.vo.pc.loan.carrier;
import com.clx.performance.enums.loan.OwnerLoanRecordEnum;
import com.clx.performance.enums.loan.OwnerRePaymentEnum;
import com.msl.common.convertor.type.MoneyOutConvert;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import java.math.BigDecimal;
/**
* @ClassName OrderPaymentDetailVO
* @Description
* @Author kavin
* @Date 2024/1/24 16:45
* @Version 1.0
*/
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class OrderPaymentDetailVO {
@ApiModelProperty("借款单号")
private Long loanNo;
@ApiModelProperty("付款方")
private String lendingParty;
@ApiModelProperty("付款账户")
private String lendingPartyAccount;
@ApiModelProperty("收款方")
private String borrower;
@ApiModelProperty("收款账户")
private String borrowerAccount;
@MoneyOutConvert
@ApiModelProperty("订单金额")
private BigDecimal loanBalance;
@ApiModelProperty("10 待审批 20 审批通过 30 审批拒绝 40 付款中 50 付款成功 60 付款失败 ")
private Integer status;
@ApiModelProperty("订单支付状态 10 待付款 40 付款中 50 付款成功 60 付款失败")
private String statusMsg;
public String getStatusMsg(){
return OwnerLoanRecordEnum.Status.getMsgByCode(status);
}
@ApiModelProperty("付款最终时间")
public String finalPaymentTime;
@ApiModelProperty("订单创建时间")
public String createTime;
}
......@@ -37,6 +37,12 @@ public class OwnerLoanRecordVO {
@ApiModelProperty("交易流水号(第三方)")
private Long runningWaterOpenNo;
@ApiModelProperty("商户流水号")
private String merchantRunningWaterNo;
@ApiModelProperty("汇款识别码")
private String remittanceIdentificationCode;
@ApiModelProperty("借款单号")
private Long loanNo;
......
......@@ -57,9 +57,6 @@ public class OwnerRepaymentVO {
@ApiModelProperty("付款账户")
private String paymentAccount;
@ApiModelProperty("生成付款申请单时间")
private String paymentApplicationFormTime;
@ApiModelProperty("汇款识别码")
private String remittanceIdentificationCode;
......@@ -128,7 +125,7 @@ public class OwnerRepaymentVO {
private String createBy;
@ApiModelProperty("创建时间")
@ApiModelProperty("生成付款申请单时间")
private String createTime;
......
package com.clx.performance.vo.pc.loan.carrier;
import com.clx.performance.enums.loan.OwnerLoanRecordEnum;
import com.clx.performance.enums.loan.OwnerRePaymentEnum;
import com.msl.common.convertor.type.MoneyOutConvert;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import java.math.BigDecimal;
/**
* @ClassName TransferPaymentDetailVO
* @Description
* @Author kavin
* @Date 2024/1/24 16:57
* @Version 1.0
*/
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class TransferPaymentDetailVO {
@ApiModelProperty("收款户名")
private String payee;
@ApiModelProperty("收款账号")
private String payeeAccount;
@ApiModelProperty("汇款识别码")
private String remittanceIdentificationCode;
@ApiModelProperty("收款银行")
private String payeeBank;
@ApiModelProperty("收款行号")
private String payeeBankNo;
@MoneyOutConvert
@ApiModelProperty("订单金额")
private BigDecimal loanBalance;
@ApiModelProperty("订单支付状态 10 待付款 40 付款中 50 付款成功 60 付款失败")
private Integer status;
@ApiModelProperty("订单支付状态 10 待付款 40 付款中 50 付款成功 60 付款失败")
private String statusMsg;
public String getStatusMsg(){
return OwnerLoanRecordEnum.Status.getMsgByCode(status);
}
@ApiModelProperty("付款最后时间")
public String finalPaymentTime;
}
......@@ -23,12 +23,10 @@ import java.time.LocalDateTime;
@Builder
public class OrderPaymentDetailVO {
@ApiModelProperty("还款单号")
private Long repaymentNo;
@ApiModelProperty("订单创建时间")
private LocalDateTime paymentApplicationFormTime;
@ApiModelProperty("付款方")
private String payment;
......@@ -60,4 +58,8 @@ public class OrderPaymentDetailVO {
@ApiModelProperty("付款最终时间")
public String finalPaymentTime;
@ApiModelProperty("订单创建时间")
public String createTime;
}
......@@ -11,8 +11,9 @@ import org.springframework.context.annotation.Configuration;
@ConfigurationProperties(prefix = "payment.form")
public class PaymentFromConfig {
//模版编号
private Long templateNo;
//借款模版编号
private Long loanTemplateNo;
//还款模版编号
private Long repaymentTemplateNo;
}
......@@ -40,6 +40,10 @@ public class OwnerLoanRecord implements HasKey<Integer> {
@ApiModelProperty("联系电话")
private String mobile;
@TableField("goods_name")
@ApiModelProperty("货物名称")
private String goodsName;
@TableField("running_water_open_no")
@ApiModelProperty("交易流水号(第三方)")
private String runningWaterOpenNo;
......@@ -68,6 +72,10 @@ public class OwnerLoanRecord implements HasKey<Integer> {
@TableField("borrower_account")
private String borrowerAccount;
@TableField("remittance_identification_code")
@ApiModelProperty("汇款识别码")
private String remittanceIdentificationCode;
@TableField("lending_party")
@ApiModelProperty("借出方")
private String lendingParty;
......@@ -109,6 +117,12 @@ public class OwnerLoanRecord implements HasKey<Integer> {
@ApiModelProperty("支付渠道 10 订单支付 20 转账支付")
private Integer payChannel;
@TableField("close_order_time")
@ApiModelProperty("[转账支付]时有关单时间字段 yyyy-MM-dd HH:mm:ss")
private String closeOrderTime;
@TableField("create_by")
@ApiModelProperty("创建人")
private String createBy;
......
......@@ -65,11 +65,6 @@ public class OwnerRepayment implements HasKey<Integer> {
private String paymentAccount;
@TableField("payment_application_form_time")
@ApiModelProperty("生成付款申请单时间")
private LocalDateTime paymentApplicationFormTime;
@TableField("remittance_identification_code")
@ApiModelProperty("汇款识别码")
private String remittanceIdentificationCode;
......@@ -107,6 +102,10 @@ public class OwnerRepayment implements HasKey<Integer> {
@ApiModelProperty("借款归还时间")
private LocalDateTime loanRepaymentTime;
@TableField("close_order_time")
@ApiModelProperty("[转账支付]时有关单时间字段 yyyy-MM-dd HH:mm:ss")
private String closeOrderTime;
@TableField("operate_time")
@ApiModelProperty("操作时间")
private LocalDateTime operateTime;
......
package com.clx.performance.service.impl.loan;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.clx.performance.component.IdGenerateSnowFlake;
import com.clx.performance.config.loan.ClxPayeeConfig;
import com.clx.performance.config.loan.PaymentFromConfig;
import com.clx.performance.dao.OwnerBindCardRecordDao;
import com.clx.performance.dao.loan.BorrowerDao;
import com.clx.performance.dao.loan.OwnerLoanAccountDao;
import com.clx.performance.dao.loan.OwnerLoanAccountRunningWaterRecordDao;
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.OwnerLoanRecordEnum;
import com.clx.performance.enums.loan.OwnerRePaymentEnum;
......@@ -21,20 +25,26 @@ import com.clx.performance.model.loan.OwnerRepayment;
import com.clx.performance.param.pc.loan.carrier.CarrierOwnerLoanRecordApproveParam;
import com.clx.performance.param.pc.loan.carrier.PageCarrierOwnerLoanRecordParam;
import com.clx.performance.param.pc.loan.carrier.PageOwnerLoanRecordOfOwner;
import com.clx.performance.param.pc.loan.owner.ExportPaymentApplicationFormParam;
import com.clx.performance.param.pc.loan.owner.OwnerLoanRecordParam;
import com.clx.performance.service.loan.OwnerLoanRecordService;
import com.clx.performance.service.thirdparty.nbbank.NbBankService;
import com.clx.performance.struct.loan.OwnerLoanRecordStruct;
import com.clx.performance.vo.pc.loan.carrier.OwnerLoanRecordVO;
import com.clx.performance.vo.pc.loan.carrier.PayeeVO;
import com.clx.performance.vo.pc.loan.carrier.*;
import com.clx.performance.vo.pc.loan.owner.BorrowerSelectVO;
import com.clx.performance.vo.pc.loan.owner.OwnerLoanRecordDetail;
import com.clx.performance.vo.pc.loan.carrier.TransferPaymentDetailVO;
import com.clx.performance.vo.pc.nbbank.NbBankOrderPayResultVO;
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.result.Result;
import com.msl.common.utils.DateUtils;
import com.msl.document.api.feign.ContractEvidenceFeign;
import com.msl.document.api.feign.ContractTemplateFeign;
import com.msl.document.api.param.GenerateContractParam;
import com.msl.document.api.vo.ContractEvidenceRecordVo;
import com.msl.user.data.UserSessionData;
import com.msl.user.utils.TokenUtil;
import lombok.AllArgsConstructor;
......@@ -77,6 +87,10 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService {
private final OwnerFeign ownerFeign;
private final ContractEvidenceFeign contractEvidenceFeign;
private final ContractTemplateFeign contractTemplateFeign;
private final PaymentFromConfig paymentFromConfig;
@Override
public IPage<OwnerLoanRecordVO> pageOwnerLoanRecord(PageCarrierOwnerLoanRecordParam param) {
IPage<OwnerLoanRecord> page = ownerLoanRecordDao.pageOwnerLoanRecord(param);
......@@ -250,4 +264,61 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService {
return detail;
}
@Override
public CashierInfoVO getCashierInfo(Integer id) {
OwnerLoanRecord ownerLoanRecord = ownerLoanRecordDao.getEntityByKey(id).orElseThrow(
PerformanceResultEnum.DATA_NOT_FIND);
CashierInfoVO vo = ownerLoanRecordStruct.convertCashierInfo(ownerLoanRecord);
//TODO 设置支付方式和付款账户 ,宇帆提供
return vo;
}
@Override
public OrderPaymentDetailVO getOrderPaymentDetail(Integer id) {
OwnerLoanRecord ownerLoanRecord = ownerLoanRecordDao.getEntityByKey(id).orElseThrow(
PerformanceResultEnum.DATA_NOT_FIND);
OrderPaymentDetailVO vo = ownerLoanRecordStruct.convertOrderPaymentDetail(ownerLoanRecord);
//计算倒计时时间,下单时间 + 30天 为截止时间
LocalDateTime endTime = ownerLoanRecord.getCreateTime().plusDays(30);
vo.setFinalPaymentTime(DateUtils.formatDateTime(endTime).get());
return vo;
}
@Override
public TransferPaymentDetailVO getTransferPaymentDetail(Integer id) {
OwnerLoanRecord ownerLoanRecord = ownerLoanRecordDao.getEntityByKey(id).orElseThrow(
PerformanceResultEnum.DATA_NOT_FIND);
ClxPayeeConfig.PayeeConfig payeeMap = ClxPayeeConfig.getPayeeMap(ClxPayeeConfig.XXH_ID);
return TransferPaymentDetailVO.builder().payee(payeeMap.getName())
.payeeAccount(payeeMap.getAccount()).payeeBank(payeeMap.getBank()).payeeBankNo(payeeMap.getBankNo())
.loanBalance(ownerLoanRecord.getLoanBalance())
.remittanceIdentificationCode(ownerLoanRecord.getRemittanceIdentificationCode())
.status(ownerLoanRecord.getStatus()).finalPaymentTime(ownerLoanRecord.getCloseOrderTime()).build();
}
@Override
public String savePaymentApplicationForm(ExportPaymentApplicationFormParam param) {
OwnerLoanRecord ownerLoanRecord = ownerLoanRecordDao.getEntityByKey(param.getId()).orElseThrow(
PerformanceResultEnum.DATA_NOT_FIND);
OwnerLoanRecordVO ownerLoanRecordVO = ownerLoanRecordStruct.convert(ownerLoanRecord);
//货主借款: 收款方鑫祥和 付款方为诚联信 借款方为货主
Map<String,String> map = JSON.parseObject(JSONUtil.parse(ownerLoanRecordVO).toString(), Map.class);
// 创建合同
GenerateContractParam feignParam = new GenerateContractParam();
if(Objects.equals(OwnerRePaymentEnum.Channel.ORDER.getCode(),param.getPayWay())){
feignParam.setTemplateNo(paymentFromConfig.getLoanTemplateNo());
}else{
feignParam.setTemplateNo(paymentFromConfig.getLoanTemplateNo());
}
feignParam.setParametersValueMap(map);
Result<Long> longResult = contractTemplateFeign.generateContract(feignParam);
Result<ContractEvidenceRecordVo> contractEvidenceDetail = contractEvidenceFeign.getContractEvidenceDetail(longResult.getData());
return contractEvidenceDetail.getData().getFileUrl();
}
}
......@@ -79,8 +79,9 @@ public class OwnerRepaymentServiceImpl implements OwnerRepaymentService {
OwnerRepayment ownerRepayment = ownerRepaymentDao.getEntityByKey(id).orElseThrow(
PerformanceResultEnum.DATA_NOT_FIND);
OrderPaymentDetailVO vo = ownerRepaymentStruct.convertOrderPaymentDetail(ownerRepayment);
//TODO 设置付款倒计时
vo.setFinalPaymentTime(null);
//计算倒计时时间,下单时间 + 30天 为截止时间
LocalDateTime endTime = ownerRepayment.getCreateTime().plusDays(30);
vo.setFinalPaymentTime(DateUtils.formatDateTime(endTime).get());
return vo;
}
......@@ -89,14 +90,11 @@ public class OwnerRepaymentServiceImpl implements OwnerRepaymentService {
OwnerRepayment ownerRepayment = ownerRepaymentDao.getEntityByKey(id).orElseThrow(
PerformanceResultEnum.DATA_NOT_FIND);
ClxPayeeConfig.PayeeConfig payeeMap = ClxPayeeConfig.getPayeeMap(ClxPayeeConfig.XXH_ID);
//计算倒计时时间,下单时间 + 30天 为截止时间
LocalDateTime endTime = ownerRepayment.getPaymentApplicationFormTime().plusDays(30);
return TransferPaymentDetailVO.builder().payee(payeeMap.getName())
.payeeAccount(payeeMap.getAccount()).payeeBank(payeeMap.getBank()).payeeBankNo(payeeMap.getBankNo())
.repaymentBalance(ownerRepayment.getRepaymentBalance())
.remittanceIdentificationCode(ownerRepayment.getRemittanceIdentificationCode())
.status(ownerRepayment.getStatus()).finalPaymentTime(DateUtils.formatDateTime(endTime).get()).build();
.status(ownerRepayment.getStatus()).finalPaymentTime(ownerRepayment.getCloseOrderTime()).build();
}
@Override
......@@ -108,9 +106,9 @@ public class OwnerRepaymentServiceImpl implements OwnerRepaymentService {
// 创建合同
GenerateContractParam feignParam = new GenerateContractParam();
if(Objects.equals(OwnerRePaymentEnum.Channel.ORDER.getCode(),param.getPayWay())){
feignParam.setTemplateNo(paymentFromConfig.getTemplateNo());
feignParam.setTemplateNo(paymentFromConfig.getRepaymentTemplateNo());
}else{
feignParam.setTemplateNo(paymentFromConfig.getTemplateNo());
feignParam.setTemplateNo(paymentFromConfig.getRepaymentTemplateNo());
}
feignParam.setParametersValueMap(map);
......
......@@ -4,9 +4,13 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.clx.performance.param.pc.loan.carrier.CarrierOwnerLoanRecordApproveParam;
import com.clx.performance.param.pc.loan.carrier.PageCarrierOwnerLoanRecordParam;
import com.clx.performance.param.pc.loan.carrier.PageOwnerLoanRecordOfOwner;
import com.clx.performance.param.pc.loan.owner.ExportPaymentApplicationFormParam;
import com.clx.performance.param.pc.loan.owner.OwnerLoanRecordParam;
import com.clx.performance.vo.pc.loan.carrier.OwnerLoanRecordVO;
import com.clx.performance.vo.pc.loan.carrier.CashierInfoVO;
import com.clx.performance.vo.pc.loan.carrier.OrderPaymentDetailVO;
import com.clx.performance.vo.pc.loan.owner.OwnerLoanRecordDetail;
import com.clx.performance.vo.pc.loan.carrier.TransferPaymentDetailVO;
/**
* @author kavin
......@@ -23,4 +27,12 @@ public interface OwnerLoanRecordService {
IPage<OwnerLoanRecordVO> pageOwnerLoanRecordOfOwner(PageOwnerLoanRecordOfOwner param);
OwnerLoanRecordDetail getOwnerLoanRecordDetail();
CashierInfoVO getCashierInfo(Integer id);
OrderPaymentDetailVO getOrderPaymentDetail(Integer id);
TransferPaymentDetailVO getTransferPaymentDetail(Integer id);
String savePaymentApplicationForm(ExportPaymentApplicationFormParam param);
}
package com.clx.performance.struct.loan;
import com.clx.performance.model.loan.OwnerLoanRecord;
import com.clx.performance.vo.pc.loan.carrier.CashierInfoVO;
import com.clx.performance.vo.pc.loan.carrier.OrderPaymentDetailVO;
import com.clx.performance.vo.pc.loan.carrier.OwnerLoanRecordVO;
import com.msl.common.utils.DateStructUtil;
import org.mapstruct.Mapper;
......@@ -14,4 +16,9 @@ public interface OwnerLoanRecordStruct {
List<OwnerLoanRecordVO> convertList(List<OwnerLoanRecord> list);
CashierInfoVO convertCashierInfo(OwnerLoanRecord ownerLoanRecord);
OrderPaymentDetailVO convertOrderPaymentDetail(OwnerLoanRecord ownerLoanRecord);
OwnerLoanRecordVO convert(OwnerLoanRecord ownerLoanRecord);
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论