提交 4fad6a2e authored 作者: aiqingguo's avatar aiqingguo

Merge branch 'v10.7_borrowing_and_repayment_20240118' into release

# Conflicts: # performance-api/src/main/java/com/clx/performance/enums/PerformanceResultEnum.java
......@@ -113,7 +113,6 @@ public enum PerformanceResultEnum implements ResultEnum {
PASSWORD_RESET_IS_FAIL(1909, "重置密码出现异常"),
PASSWORD_CHECK_FAIL(1910, "交易密码填写错误,请重新输入"),
SLIDER_CHECK_FAIL(1911, "滑块验证错误"),
ORDER_CHILD_SYNC_ERROR(1912, "承运同步网络货运异常"),
PLATFORM_ACCOUNT_CONFIG_ONLY(1913, "当前配置已存在"),
PLATFORM_ACCOUNT_CONFIG_WITHDRAWAL_IS_NULL(1914, "提现平台账户未配置"),
......@@ -122,6 +121,7 @@ public enum PerformanceResultEnum implements ResultEnum {
PLATFORM_ACCOUNT_CONFIG_RECHARGE_MANY(1917, "充值平台账户配置不唯一"),
PLATFORM_ACCOUNT_CONFIG_IS_NULL(1918, "平台账户未配置"),
PLATFORM_ACCOUNT_CONFIG_MANY(1919, "平台账户配置不唯一"),
ORDER_CHILD_SYNC_ERROR(2001, "承运同步网络货运异常"),
BORROWER_NAME_EXIST(1701, "数据重复,请核实后重新提交"),
BORROWER_DELETE_ENABLE_ERROR(1702, "无法删除启用数据"),
BORROWER_CONFIG_BORROWER_ID_EXIST(1703, "数据重复,请核实后重新提交"),
......@@ -135,7 +135,15 @@ public enum PerformanceResultEnum implements ResultEnum {
NB_BANK_NOTIFY_ERROR(1801, "宁波银行回调失败"),
NB_BANK_PAY_TYPE_ERROR(1802, "支付方式不支持"),
NB_BANK_ORDER_PAY_ERROR(1803, "宁波银行订单支付失败"),
NB_BANK_NO_MONEY_ERROR(1804, "账户余额不足"),
PLATFORM_ACCOUNT_CONFIG_ONLY(1913, "当前配置已存在"),
PLATFORM_ACCOUNT_CONFIG_WITHDRAWAL_IS_NULL(1914, "提现平台账户未配置"),
PLATFORM_ACCOUNT_CONFIG_WITHDRAWAL_MANY(1915, "提现平台账户配置不唯一"),
PLATFORM_ACCOUNT_CONFIG_RECHARGE_IS_NULL(1916, "充值平台账户未配置"),
PLATFORM_ACCOUNT_CONFIG_RECHARGE_MANY(1917, "充值平台账户配置不唯一"),
PLATFORM_ACCOUNT_CONFIG_IS_NULL(1918, "平台账户未配置"),
PLATFORM_ACCOUNT_CONFIG_MANY(1919, "平台账户配置不唯一"),
GET_LOAN_RECORD(1901, "货主借款失败"),
OWNER_ACCOUNT_ERROR(1902, "货主货款不足"),
......@@ -146,6 +154,7 @@ public enum PerformanceResultEnum implements ResultEnum {
OWNER_LOAN_RECORD_PAY_WAIT_ERROR(1853,"当前借款单状态不是待付款"),
OWNER_LOAN_PAYMENT_STATUS_ERROR(1854, "执行借款审批失败,请稍后重试"),
OWNER_LOAN_PAY_STATUS_ERROR(1855, "付款失败"),
DATA_STATUS_ERROR(1856, "当前状态有误")
;
private final int code;
......
......@@ -15,6 +15,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
@Slf4j
......@@ -52,5 +53,12 @@ public class CarrierOwnerPaymentController {
return Result.ok();
}
@ApiOperation(value = "付款重新支付(只更改借款状态)",notes = "<br>By:胡宇帆")
@GetMapping("/ownerPaymentRetryPay")
public Result<Object> ownerPaymentRetryPay(@RequestParam(value = "id") @NotBlank Integer id) {
ownerPaymentService.ownerPaymentRetryPay(id);
return Result.ok();
}
}
......@@ -7,6 +7,7 @@ import com.clx.performance.dao.loan.OwnerLoanAccountDao;
import com.clx.performance.dao.loan.OwnerLoanRecordDao;
import com.clx.performance.dao.loan.OwnerRepaymentDao;
import com.clx.performance.enums.OwnerAccountEnum;
import com.clx.performance.enums.PerformanceResultEnum;
import com.clx.performance.enums.loan.BankTradeEnum;
import com.clx.performance.enums.loan.OwnerLoanRecordEnum;
import com.clx.performance.enums.loan.OwnerRePaymentEnum;
......@@ -27,6 +28,7 @@ import com.clx.performance.vo.pc.nbbank.NbBankOrderPayResultVO;
import com.clx.user.vo.feign.OwnerInfoFeignVO;
import com.msl.common.base.Optional;
import com.msl.common.convertor.aspect.UnitCovert;
import com.msl.common.exception.ServiceSystemException;
import com.msl.user.data.UserSessionData;
import com.msl.user.utils.TokenUtil;
import lombok.AllArgsConstructor;
......@@ -108,6 +110,9 @@ public class OwnerLoanAccountServiceImpl implements OwnerLoanAccountService {
@Override
public void ownerRepayment(OwnerRepaymentParam param) {
OwnerRepayment ownerRepayment = ownerRepaymentDao.getOneByField(OwnerRepayment::getRepaymentNo, param.getRepaymentNo()).get();
if (!ownerRepayment.getStatus().equals(OwnerRePaymentEnum.Status.PAY_WAIT.getCode())) {
throw new ServiceSystemException(PerformanceResultEnum.OWNER_LOAN_RECORD_PAY_STATUS_ERROR);
}
OwnerLoanRecord ownerLoanRecord = ownerLoanRecordDao.getOneByField(OwnerLoanRecord::getLoanNo, ownerRepayment.getLoanNo()).get();
BankTrade bankTrade = new BankTrade();
OwnerBindCardRecord ownerBindCardRecord = ownerBindCardRecordDao.getOwnerBindCardByUserNo(ownerRepayment.getOwnerUserNo());
......
......@@ -92,4 +92,13 @@ public class OwnerPaymentServiceImpl implements OwnerPaymentService {
ownerPaymentDao.updateStatusAndMerchantRunningWaterNo(ownerPayment);
}
@Override
public void ownerPaymentRetryPay(Integer id) {
OwnerPayment ownerPayment = ownerPaymentDao.getEntityByKey(id).orElseThrow(PerformanceResultEnum.DATA_NOT_FIND);
if (!OwnerPaymentEnum.Status.PAY_FAIL.getCode().equals(ownerPayment.getStatus())) {
throw new ServiceSystemException(PerformanceResultEnum.DATA_STATUS_ERROR);
}
ownerPaymentDao.updatePayStatus(id, OwnerPaymentEnum.Status.PAY_WAIT.getCode());
}
}
......@@ -457,13 +457,18 @@ public class NbBankThirdpartyServiceImpl implements NbBankThirdpartyService {
JSONObject responseJson = JSON.parseObject(JSON.toJSONString(response));
JSONObject data = responseJson.getJSONObject("data");
if (!StringUtils.equals(data.getString("errorCode"), "000000")){
if (!StringUtils.equals(data.getString("errorCode"), "PAY888")){
throw new ServiceSystemException(PerformanceResultEnum.NB_BANK_NO_MONEY_ERROR);
}
else if (!StringUtils.equals(data.getString("errorCode"), "000000")){
log.info("宁波银行, 调账接口(fundTransferOrder), code:{}, msg:{}", data.getString("errorCode"), data.getString("errorMsg"));
throw new ServiceSystemException(PerformanceResultEnum.NB_BANK_API_ERROR);
}
return data;
} catch (Exception e) {
if (e instanceof ServiceSystemException) {throw (ServiceSystemException)e;}
log.info("宁波银行接口异常:{}", ExceptionUtils.getStackTrace(e));
}
......
......@@ -16,4 +16,6 @@ public interface OwnerPaymentService {
CarrierOwnerPaymentVO getOwnerPaymentDetail(Integer id);
void pay(Integer id);
void ownerPaymentRetryPay(Integer id);
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论