提交 c84f277f authored 作者: huyufan's avatar huyufan

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
package com.clx.performance.enums.nbbank;
import lombok.AllArgsConstructor;
import lombok.Getter;
import java.util.Arrays;
import java.util.Optional;
public enum NbBankStatusEnum {
;
@Getter
@AllArgsConstructor
public enum Status {
TEMP(0, "中间态"),
SUCCESS(1, "交易成功"),
FAIL(2, "交易失败"),
ACCEPT(3, "交易已受理"),
INIT(4, "订单初始状态"),
NOT_FOUND(5, "交易不存在"),
TIMEOUT(6, "交易超时,须发起交易结果查询"),
;
private final Integer code;
private final String msg;
public static Optional<Status> getByCode(int code) {
return Arrays.stream(values()).filter(e -> e.code == code).findFirst();
}
public static String getMsgByCode(int code) {
return getByCode(code).map(Status::getMsg).orElse(null);
}
}
}
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;
}
......@@ -34,7 +34,6 @@ public class OwnerLoanAccountVO {
@ApiModelProperty(value = "默认 3:借款账户", example = "3")
private Integer accountType;
@ApiModelProperty(value = "账户余额 (元) ", example = "1.23")
private BigDecimal amount;
public BigDecimal getAmount() {
......
......@@ -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;
......@@ -73,7 +70,11 @@ public class OwnerRepaymentVO {
@ApiModelProperty("收款账户")
private String payeeAccount;
@ApiModelProperty("货物名称")
private String goodsName;
@ApiModelProperty("借款单号")
private Long loanNo;
......@@ -128,7 +129,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;
}
......@@ -18,14 +18,17 @@ import java.util.List;
@Setter
public class OwnerLoanRecordDetail {
@ApiModelProperty("借款方下拉选")
@ApiModelProperty("公司名称(借款方)")
private String companyName;
@ApiModelProperty("借出方下拉选")
private List<BorrowerSelectVO> borrowerList;
@ApiModelProperty("借款方下拉选")
@ApiModelProperty("收款方")
private List<PayeeVO> payeeList;
@ApiModelProperty("公司名称")
private String companyName;
......
......@@ -31,7 +31,7 @@ public class NbBankOrderPayResultVO {
private String transSeqNo;
@ApiModelProperty(value = "转账编号 (转账专用)", example = "123456")
private String signNo;
@ApiModelProperty(value = "关单时间 (转账专用)", example = "")
@ApiModelProperty(value = "关单时间", example = "")
private String closeDtTm;
}
\ No newline at end of file
......@@ -34,6 +34,6 @@ public class NbBankOrderResultVO {
private String signNo;
@ApiModelProperty(value = "交易状态:1交易成功 2交易失败 3交易已受理 4订单初始状态 5交易不存在 6交易超时", example = "1")
private Integer transStatus;
private Integer status;
}
\ No newline at end of file
......@@ -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;
}
......@@ -5,6 +5,7 @@ import com.clx.performance.param.pc.loan.carrier.PageOwnerLoanAccountParam;
import com.clx.performance.service.loan.OwnerLoanAccountService;
import com.clx.performance.vo.pc.loan.carrier.OwnerLoanAccountVO;
import com.msl.common.base.PageData;
import com.msl.common.convertor.aspect.UnitCovert;
import com.msl.common.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......@@ -29,6 +30,7 @@ public class CarrierOwnerLoanAccountController {
@ApiOperation(value = "分页搜索货主借款账户列表",notes = "<br>By:艾庆国")
@PostMapping("/pageOwnerLoanAccount")
@UnitCovert(param = false)
public Result<PageData<OwnerLoanAccountVO>> pageOwnerLoanAccount(@RequestBody @Validated PageOwnerLoanAccountParam param) {
IPage<OwnerLoanAccountVO> page = ownerLoanAccountService.pageOwnerLoanAccount(param);
return Result.page(page.getRecords(), page.getTotal(), page.getPages());
......
......@@ -5,6 +5,7 @@ import com.clx.performance.param.pc.loan.carrier.PageOwnerLoanAccountWaterRecord
import com.clx.performance.service.loan.OwnerLoanAccountRunningWaterRecordService;
import com.clx.performance.vo.pc.loan.carrier.OwnerLoanAccountRunningWaterRecordVO;
import com.msl.common.base.PageData;
import com.msl.common.convertor.aspect.UnitCovert;
import com.msl.common.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......@@ -20,13 +21,14 @@ import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping(value="/pc/carrier/ownerLoanAccountWaterRecord")
@Validated
@Api(tags = "承运端-借款账户")
@Api(tags = "承运端-借款账户流水")
public class CarrierOwnerLoanAccountWaterRecordController {
@Autowired
private OwnerLoanAccountRunningWaterRecordService ownerLoanAccountRunningWaterRecordService;
@ApiOperation(value = "分页搜索货主借款账户流水列表",notes = "<br>By:艾庆国")
@PostMapping("/pageOwnerLoanAccountWaterOfOwner")
@UnitCovert(param = false)
public Result<PageData<OwnerLoanAccountRunningWaterRecordVO>> pageOwnerLoanAccountWaterOfOwner(@RequestBody @Validated PageOwnerLoanAccountWaterRecordOfOwnerParam param) {
IPage<OwnerLoanAccountRunningWaterRecordVO> page = ownerLoanAccountRunningWaterRecordService.pageOwnerLoanAccountWaterOfOwner(param);
return Result.page(page.getRecords(), page.getTotal(), page.getPages());
......
......@@ -4,8 +4,12 @@ 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.service.loan.OwnerLoanRecordService;
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.clx.performance.vo.pc.loan.carrier.TransferPaymentDetailVO;
import com.msl.common.base.PageData;
import com.msl.common.convertor.aspect.UnitCovert;
import com.msl.common.result.Result;
......@@ -13,11 +17,11 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Param;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.validation.constraints.NotNull;
@Slf4j
@RestController
......@@ -47,9 +51,43 @@ public class CarrierOwnerLoanRecordController {
@ApiOperation(value = "分页搜索货主借款列表",notes = "<br>By:艾庆国")
@PostMapping("/pageOwnerLoanRecordOfOwner")
@UnitCovert(param = false)
public Result<PageData<OwnerLoanRecordVO>> pageOwnerLoanRecordOfOwner(@RequestBody @Validated PageOwnerLoanRecordOfOwner param) {
IPage<OwnerLoanRecordVO> page = ownerLoanRecordService.pageOwnerLoanRecordOfOwner(param);
return Result.page(page.getRecords(), page.getTotal(), page.getPages());
}
@ApiOperation(value = "收银台信息",notes = "<br>By:刘海泉")
@GetMapping("/getCashierInfo")
@UnitCovert(param = false)
public Result<CashierInfoVO> getCashierInfo(@Param("id") @NotNull(message = "id不能为空") Integer id) {
CashierInfoVO vo = ownerLoanRecordService.getCashierInfo(id);
return Result.ok(vo);
}
@ApiOperation(value = "订单支付详情",notes = "<br>By:刘海泉")
@GetMapping("/getOrderPaymentDetail")
@UnitCovert(param = false)
public Result<OrderPaymentDetailVO> getOrderPaymentDetail(@Param("id") @NotNull(message = "id不能为空") Integer id) {
OrderPaymentDetailVO vo = ownerLoanRecordService.getOrderPaymentDetail(id);
return Result.ok(vo);
}
@ApiOperation(value = "转账支付详情",notes = "<br>By:刘海泉")
@GetMapping("/getTransferPaymentDetail")
@UnitCovert(param = false)
public Result<TransferPaymentDetailVO> getTransferPaymentDetail(@Param("id") @NotNull(message = "id不能为空") Integer id) {
TransferPaymentDetailVO vo = ownerLoanRecordService.getTransferPaymentDetail(id);
return Result.ok(vo);
}
@ApiOperation(value = "生成付款申请单",notes = "<br>By:刘海泉")
@GetMapping("/savePaymentApplicationForm")
public Result<String> savePaymentApplicationForm(@RequestBody @Validated ExportPaymentApplicationFormParam param) {
String url = ownerLoanRecordService.savePaymentApplicationForm(param);
return Result.ok(url);
}
}
......@@ -40,6 +40,7 @@ public class CarrierOwnerRepaymentController {
@ApiOperation(value = "分页搜索货主还款列表",notes = "<br>By:艾庆国")
@PostMapping("/pageOwnerRepaymentOfOwner")
@UnitCovert(param = false)
public Result<PageData<OwnerRepaymentVO>> pageOwnerRepaymentOfOwner(@RequestBody @Validated PageOwnerRepaymentOfOwner param) {
IPage<OwnerRepaymentVO> page = ownerRepaymentService.pageOwnerRepaymentOfOwner(param);
return Result.page(page.getRecords(), page.getTotal(), page.getPages());
......
......@@ -2,9 +2,13 @@ package com.clx.performance.controller.pc.loan.owner;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.clx.performance.param.pc.loan.carrier.PageOwnerLoanRecordOfOwner;
import com.clx.performance.param.pc.loan.owner.ExportPaymentApplicationFormParam;
import com.clx.performance.service.loan.OwnerLoanRecordService;
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;
import com.msl.common.base.PageData;
import com.msl.common.convertor.aspect.UnitCovert;
import com.msl.common.result.Result;
......@@ -14,11 +18,11 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Param;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.validation.constraints.NotNull;
@Slf4j
@RestController
......@@ -44,10 +48,13 @@ public class OwnerLoanRecordController {
@ApiOperation(value = "借款详情",notes = "<br>By:刘海泉")
@PostMapping("/getOwnerLoanRecordDetail")
@GetMapping("/getOwnerLoanRecordDetail")
public Result<OwnerLoanRecordDetail> getOwnerLoanRecordDetail() {
OwnerLoanRecordDetail detail = ownerLoanRecordService.getOwnerLoanRecordDetail();
return Result.ok(detail);
}
}
......@@ -76,7 +76,7 @@ public class TempBankController {
@RequestMapping(value = "/notify", method = RequestMethod.POST)
public Result notify(NbBankOrderResultVO param) {
bankService.orderPayCallback(param.getMerSeqNo(), param.getTransSeqNo(),
param.getAmount(), param.getAmount(), param.getTransStatus(), param.getSignNo());
param.getAmount(), param.getAmount(), param.getStatus(), param.getSignNo());
return Result.ok();
}
......
......@@ -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;
......
......@@ -8,6 +8,7 @@ import com.clx.performance.param.pc.loan.carrier.PageOwnerLoanAccountParam;
import com.clx.performance.service.loan.OwnerLoanAccountService;
import com.clx.performance.struct.loan.OwnerLoanAccountStruct;
import com.clx.performance.vo.pc.loan.carrier.OwnerLoanAccountVO;
import com.msl.common.convertor.aspect.UnitCovert;
import com.msl.user.data.UserSessionData;
import com.msl.user.utils.TokenUtil;
import lombok.AllArgsConstructor;
......@@ -51,6 +52,7 @@ public class OwnerLoanAccountServiceImpl implements OwnerLoanAccountService {
}
@Override
@UnitCovert(param = false)
public IPage<OwnerLoanAccountVO> pageOwnerLoanAccount(PageOwnerLoanAccountParam param) {
return ownerLoanAccountDao.pageByParam(param);
}
......
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);
......@@ -242,7 +256,7 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService {
Result::succeed).map(Result::getData).orElseThrow(ResultCodeEnum.FAIL);
detail.setCompanyName(ownerInfoFeignVO.getCompanyName());
//款方
//款方
List<PayeeVO> payeeList =ClxPayeeConfig.payeeList.stream().map(
item-> PayeeVO.builder().name(item.getName()).account(item.getAccount()).id(item.getId()).build()
).collect(Collectors.toList());
......@@ -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);
......
......@@ -3,6 +3,7 @@ package com.clx.performance.service.impl.thirdparty.nbbank;
import com.alibaba.fastjson.JSONObject;
import com.clx.performance.component.IdGenerateSnowFlake;
import com.clx.performance.enums.PerformanceResultEnum;
import com.clx.performance.enums.nbbank.NbBankStatusEnum;
import com.clx.performance.service.thirdparty.nbbank.NbBankService;
import com.clx.performance.service.thirdparty.nbbank.NbBankThirdpartyService;
import com.clx.performance.utils.LocalDateTimeUtils;
......@@ -15,8 +16,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
/**
* 易付通
......@@ -73,6 +72,7 @@ public class NbBankServiceImpl implements NbBankService {
String merSeqNo = idGenerateSnowFlake.nextIdToString(3L);
String merDtTm = LocalDateTimeUtils.formatTime();
String closeDtTm = LocalDateTimeUtils.formatTime(LocalDateTimeUtils.parseTime(merDtTm).plusDays(30));
JSONObject data = bankThirdpartyService.unionPayDirectOrder(merSeqNo, merDtTm, amount,
payAcctOpenBankId,payAcctNo, payAcctNm);
......@@ -86,6 +86,7 @@ public class NbBankServiceImpl implements NbBankService {
result.setMerDtTm(merDtTm);
result.setMerSeqNo(merSeqNo);
result.setTransSeqNo(transSeqNo);
result.setCloseDtTm(closeDtTm);
return result;
}
......@@ -101,20 +102,14 @@ public class NbBankServiceImpl implements NbBankService {
NbBankOrderResultVO result = new NbBankOrderResultVO();
String transStatus = data.getString("transStatus");
if (StringUtils.equals(transStatus, "00")){result.setTransStatus(1);} //交易成功
else if (StringUtils.equals(transStatus, "01")){result.setTransStatus(2);} //交易失败
else if (StringUtils.equals(transStatus, "02")){result.setTransStatus(3);} //交易已受理
else if (StringUtils.equals(transStatus, "80")){result.setTransStatus(4);} //订单初始状态
else if (StringUtils.equals(transStatus, "90")){result.setTransStatus(5);} //交易不存在
else if (StringUtils.equals(transStatus, "99")){result.setTransStatus(6);} //交易超时,须发起交易结果查询
BigDecimal trxAmt = data.getBigDecimal("trxAmt");
BigDecimal realTrxAmt = data.getBigDecimal("realTrxAmt");
String transSeqNo = data.getString("transSeqNo");
String signNo = data.getString("signNo");
result.setStatus(getStatus(transStatus));
result.setAmount(trxAmt==null? null : trxAmt.movePointLeft(2).intValue());
result.setRealAmount(trxAmt==null? null : realTrxAmt.movePointLeft(2).intValue());
result.setRealAmount(realTrxAmt==null? null : realTrxAmt.movePointLeft(2).intValue());
result.setMerSeqNo(orgMerSeqNo);
result.setTransSeqNo(transSeqNo);
result.setSignNo(signNo);
......@@ -137,15 +132,9 @@ public class NbBankServiceImpl implements NbBankService {
NbBankOrderResultVO result = new NbBankOrderResultVO();
String transStatus = data.getString("transStatus");
if (StringUtils.equals(transStatus, "00")){result.setTransStatus(1);} //交易成功
else if (StringUtils.equals(transStatus, "01")){result.setTransStatus(2);} //交易失败
else if (StringUtils.equals(transStatus, "02")){result.setTransStatus(3);} //交易已受理
else if (StringUtils.equals(transStatus, "80")){result.setTransStatus(4);} //订单初始状态
else if (StringUtils.equals(transStatus, "90")){result.setTransStatus(5);} //交易不存在
else if (StringUtils.equals(transStatus, "99")){result.setTransStatus(6);} //交易超时,须发起交易结果查询
String transSeqNo = data.getString("transSeqNo");
result.setStatus(getStatus(transStatus));
result.setAmount(amount);
result.setRealAmount(amount);
result.setMerDtTm(merDtTm);
......@@ -157,7 +146,7 @@ public class NbBankServiceImpl implements NbBankService {
/**
* 退款
* @Param type: 1普通退款 2银行转账退款 3银联订单支付撤单
* @Param type: 1普通退款(忽略) 2银行转账退款(支付成功) 3银联订单支付撤单(未支付)
* @param orgMerSeqNo 商户流水号(原)
* @param amount 金额分
* @param orgTransSeqNo 第三方流水号 (原)
......@@ -173,15 +162,9 @@ public class NbBankServiceImpl implements NbBankService {
NbBankOrderResultVO result = new NbBankOrderResultVO();
String transStatus = data.getString("transStatus");
if (StringUtils.equals(transStatus, "00")){result.setTransStatus(1);} //交易成功
else if (StringUtils.equals(transStatus, "01")){result.setTransStatus(2);} //交易失败
else if (StringUtils.equals(transStatus, "02")){result.setTransStatus(3);} //交易已受理
else if (StringUtils.equals(transStatus, "80")){result.setTransStatus(4);} //订单初始状态
else if (StringUtils.equals(transStatus, "90")){result.setTransStatus(5);} //交易不存在
else if (StringUtils.equals(transStatus, "99")){result.setTransStatus(6);} //交易超时,须发起交易结果查询
String transSeqNo = data.getString("transSeqNo");
result.setStatus(getStatus(transStatus));
result.setAmount(amount);
result.setRealAmount(amount);
result.setMerDtTm(merDtTm);
......@@ -209,29 +192,11 @@ public class NbBankServiceImpl implements NbBankService {
merSeqNo, transSeqNo, trxAmt, realTrxAmt, transStatus, signNo);
NbBankOrderResultVO result = new NbBankOrderResultVO();
if (StringUtils.equals(transStatus, "00")){ //交易成功
result.setTransStatus(1);
}
if (StringUtils.equals(transStatus, "01")){ //交易失败
result.setTransStatus(2);
}
if (StringUtils.equals(transStatus, "02")){ //交易已受理
result.setTransStatus(3);
}
if (StringUtils.equals(transStatus, "80")){ //订单初始状态
result.setTransStatus(4);
}
if (StringUtils.equals(transStatus, "90")){ //交易不存在
result.setTransStatus(5);
}
if (StringUtils.equals(transStatus, "99")){ //交易超时,须发起交易结果查询
result.setTransStatus(6);
}
result.setStatus(getStatus(transStatus));
orderPayCallback(merSeqNo, transSeqNo, trxAmt, realTrxAmt, result.getTransStatus(), signNo);
orderPayCallback(merSeqNo, transSeqNo, trxAmt, realTrxAmt, result.getStatus(), signNo);
}
/**
* 银行回调
* @param merSeqNo 商户流水号
......@@ -258,4 +223,19 @@ public class NbBankServiceImpl implements NbBankService {
return StringUtils.isBlank(signNo)? StringUtils.right(cardNo,7) : signNo;
}
/**
* 获取订单状态
*/
private Integer getStatus(String transStatus){
if (StringUtils.equals(transStatus, "00")){return NbBankStatusEnum.Status.SUCCESS.getCode();} //交易成功
else if (StringUtils.equals(transStatus, "01")){return NbBankStatusEnum.Status.FAIL.getCode();} //交易失败
else if (StringUtils.equals(transStatus, "02")){return NbBankStatusEnum.Status.ACCEPT.getCode();} //交易已受理
else if (StringUtils.equals(transStatus, "80")){return NbBankStatusEnum.Status.INIT.getCode();} //订单初始状态
else if (StringUtils.equals(transStatus, "90")){return NbBankStatusEnum.Status.NOT_FOUND.getCode();} //交易不存在
else if (StringUtils.equals(transStatus, "99")){return NbBankStatusEnum.Status.TIMEOUT.getCode();} //交易超时,须发起交易结果查询
return NbBankStatusEnum.Status.TEMP.getCode();
}
}
......@@ -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);
}
......@@ -25,7 +25,7 @@ public class BorrowerConfigSqlProvider {
FROM("borrower_config");
WHERE("delete_status = 0");
if (StringUtils.isNotBlank(param.getBorrowerName())) {WHERE("borrower_name = like CONCAT(#{param.borrowerName},'%')");}
if (StringUtils.isNotBlank(param.getBorrowerName())) {WHERE("borrower_name like CONCAT(#{param.borrowerName},'%')");}
if (Objects.nonNull(param.getStatus())) {WHERE("status = #{param.status}");}
ORDER_BY("create_time desc");
......
......@@ -24,7 +24,7 @@ public class BorrowerSqlProvider {
FROM("borrower");
WHERE("delete_status = 0");
if (StringUtils.isNotBlank(param.getName())) {WHERE("name = like CONCAT(#{param.name},'%')");}
if (StringUtils.isNotBlank(param.getName())) {WHERE("name like CONCAT(#{param.name},'%')");}
ORDER_BY("create_time desc");
}}.toString();
......
......@@ -16,7 +16,8 @@ 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, account_balance as accountBalance, " +
" running_water_type as runningWaterType, " +
" alteration_balance as alterationBalance, useable_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 "
......
......@@ -25,7 +25,7 @@ public class OwnerLoanAccountSqlProvider {
FROM("owner_loan_account");
if (Objects.nonNull(param.getOwnerUserNo())) {WHERE("owner_user_no = #{param.ownerUserNo}");}
if (StringUtils.isNotBlank(param.getOwnerUserName())) {WHERE("owner_user_name = like CONCAT(#{param.ownerUserName},'%')");}
if (StringUtils.isNotBlank(param.getOwnerUserName())) {WHERE("owner_user_name like CONCAT(#{param.ownerUserName},'%')");}
if (StringUtils.isNotBlank(param.getMobile())) {WHERE("mobile = #{param.mobile}");}
ORDER_BY("create_time desc");
......
......@@ -15,14 +15,19 @@ public class OwnerLoanRecordSqlProvider {
return new SQL(){{
SELECT(" id, owner_user_no as ownerUserNo, owner_user_name as ownerUserName, mobile, " +
" running_water_open_no as runningWaterOpenNo, " +
" loan_no as loanNo, loan_type as loanType, loan_balance as loanBalance, borrower, borrower_account as borrowerAccount, " +
" lending_party as lendingParty, lending_party_account as lendingPartyAccount, payee, payee_account as payeeAccount, " +
" status, date_format(approve_time, '%Y-%m-%d %H:%i:%s') as approveTime, approve_by as approveBy, " +
" goods_name as goodsName, " +
" running_water_open_no as runningWaterOpenNo, merchant_running_water_no as merchantRunningWaterNo, " +
" loan_no as loanNo, loan_type as loanType, loan_balance as loanBalance, " +
" borrower, borrower_account as borrowerAccount, remittance_identification_code as remittanceIdentificationCode, " +
" lending_party as lendingParty, lending_party_account as lendingPartyAccount, " +
" payee, payee_account as payeeAccount, " +
" status, " +
" date_format(approve_time, '%Y-%m-%d %H:%i:%s') as approveTime, approve_by as approveBy, " +
" reject_reason as rejectReason, date_format(loan_repayment_time, '%Y-%m-%d %H:%i:%s') as loanRepaymentTime, " +
" pay_channel as payChannel, close_order_time as closeOrderTime, " +
" 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 "
" date_format(create_time, '%Y-%m-%d %H:%i:%s') as createTime, " +
" date_format(modified_time, '%Y-%m-%d %H:%i:%s') as modifiedTime "
);
FROM("owner_loan_record");
......
......@@ -15,11 +15,15 @@ public class OwnerRepaymentSqlProvider {
return new SQL(){{
SELECT(" id, owner_user_no as ownerUserNo, owner_user_name as ownerUserName, mobile, " +
" running_water_open_no as runningWaterOpenNo, repayment_no as repaymentNo, " +
" repayment_balance as repaymentBalance, payment, payment_account as paymentAccount, " +
" payee, payee_account as payeeAccount, loan_no as loanNo, status, pay_channel as payChannel, " +
" be_overdue as beOverdue, date_format(loan_repayment_time, '%Y-%m-%d %H:%i:%s') as loanRepaymentTime, " +
" date_format(operate_time, '%Y-%m-%d %H:%i:%s') as operateTime, operate_by as operateBy, create_by as createBy, " +
" running_water_open_no as runningWaterOpenNo, merchant_running_water_no as merchantRunningWaterNo, " +
" repayment_no as repaymentNo, repayment_balance as repaymentBalance, " +
" payment, payment_account as paymentAccount, remittance_identification_code as remittanceIdentificationCode, " +
" goods_name as goodsName, " +
" payee, payee_account as payeeAccount, " +
" loan_no as loanNo, status, " +
" pay_channel as payChannel, be_overdue as beOverdue, date_format(loan_repayment_time, '%Y-%m-%d %H:%i:%s') as loanRepaymentTime, " +
" close_order_time as closeOrderTime, date_format(operate_time, '%Y-%m-%d %H:%i:%s') as operateTime, " +
" operate_by as operateBy, 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 "
);
......
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);
}
{
"api": [
{
"appKey": "77667c76_3503_4c04_95f7_fc10938c7942",
"publicUrl": "https://open-test.nbcb.com.cn/sit/nbcb/api",
"platfromPublicKeyPath": "/app/nbbank/bankPubKey.cer",
"merchantPrivateKeyPath":"/app/nbbank/bankPrivateKey.sm2",
"merchantPrivateKeyPwd":"cfca",
"connectTimeout": 10000,
"readTimeout": 30000,
"merchantName":"",
"subMerchantName":"",
"subMerchantId":"",
"isProxy":false,
"proxyIp":"",
"proxyPort":80
}
],
"file": [
{
"uid":"TEST",
"publicFileUrl":"https://file-test.nbcb.com.cn/sit",
"clientIp":"127.0.0.1",
"passwd":"nbcb123456",
"apiVersion":"201809101526",
"isProxy":false,
"proxyIp":"",
"proxyPort":80
}
]
}
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论