This commit is contained in:
77
2024-03-31 23:38:36 +08:00
parent 5615e84361
commit 5b0207d9d4

View File

@@ -51,13 +51,15 @@ public class AppBorrowController {
@ApiOperation(value = "提现") @ApiOperation(value = "提现")
public AjaxResult<Void> withdraw(@ApiParam("提现金额") Double withdrawAmount,String withdrawCode){ public AjaxResult<Void> withdraw(@ApiParam("提现金额") Double withdrawAmount,String withdrawCode){
Long customerId = SecurityUtils.getLoginUser().getCustomer().getId(); Long customerId = SecurityUtils.getLoginUser().getCustomer().getId();
HomeSetting homeSetting = homeSettingService.getHomeSetting();
if(homeSetting.getOpenWithdrawCode()){
if(StringUtils.isBlank(withdrawCode)){ if(StringUtils.isBlank(withdrawCode)){
return AjaxResult.error(MessageUtils.message("dk.withdraw.code.null")); return AjaxResult.error(MessageUtils.message("dk.withdraw.code.null"));
} }
HomeSetting homeSetting = homeSettingService.getHomeSetting(); if(!homeSetting.getWithdrawCode().equals(withdrawCode)){
if(homeSetting.getOpenWithdrawCode() && !homeSetting.getWithdrawCode().equals(withdrawCode)){
return AjaxResult.error(MessageUtils.message("dk.withdraw.code.error")); return AjaxResult.error(MessageUtils.message("dk.withdraw.code.error"));
} }
}
borrowService.withdraw(withdrawAmount,customerId); borrowService.withdraw(withdrawAmount,customerId);
return AjaxResult.success(); return AjaxResult.success();
} }