提现手续费改为参数传入

This commit is contained in:
Guoqs
2025-02-13 11:49:52 +08:00
parent cbff91cada
commit cd3aced52f
5 changed files with 32 additions and 7 deletions

View File

@@ -189,6 +189,7 @@ public class AdapayMemberController extends BaseController {
public AjaxResult drawCash(@RequestBody WithdrawDTO dto) { public AjaxResult drawCash(@RequestBody WithdrawDTO dto) {
AjaxResult result; AjaxResult result;
try { try {
dto.setFeeAmt("5");
adapayService.drawCash(dto); adapayService.drawCash(dto);
result = AjaxResult.success(); result = AjaxResult.success();
} catch (BusinessException e) { } catch (BusinessException e) {

View File

@@ -6,7 +6,7 @@ import java.util.HashMap;
import java.util.Map; import java.util.Map;
/** /**
* 停车场公参数 * 停车场公参数
*/ */
@Data @Data
public class ParkingCommonParam { public class ParkingCommonParam {

View File

@@ -14,6 +14,9 @@ public class WithdrawDTO {
// 提现金额 // 提现金额
private String cashAmt; private String cashAmt;
// 手续费
private String feeAmt;
// 微信小程序appId // 微信小程序appId
private String wechatAppId; private String wechatAppId;
} }

View File

@@ -811,8 +811,9 @@ public class AdapayService {
throw new BusinessException(ReturnCodeEnum.CODE_ADAPAY_MEMBER_IS_NULL_ERROR); throw new BusinessException(ReturnCodeEnum.CODE_ADAPAY_MEMBER_IS_NULL_ERROR);
} }
// 提现手续费 每笔固定5元 // 提现手续费 每笔固定5元 2025年2月13日11点47分手续费改为参数传入
BigDecimal feeAmt = new BigDecimal("5"); // BigDecimal feeAmt = new BigDecimal("5");
BigDecimal feeAmt = new BigDecimal(dto.getFeeAmt());
// 实际提现到账金额 // 实际提现到账金额
BigDecimal cashAmt = adapayAccountBalanceVO.getAvlBalance().subtract(feeAmt); BigDecimal cashAmt = adapayAccountBalanceVO.getAvlBalance().subtract(feeAmt);

View File

@@ -1,6 +1,8 @@
package com.jsowell.quartz.task; package com.jsowell.quartz.task;
import com.google.common.collect.Lists; import com.huifu.adapay.core.exception.BaseAdaPayException;
import com.jsowell.adapay.dto.WithdrawDTO;
import com.jsowell.adapay.service.AdapayService;
import com.jsowell.common.constant.CacheConstants; import com.jsowell.common.constant.CacheConstants;
import com.jsowell.common.constant.Constants; import com.jsowell.common.constant.Constants;
import com.jsowell.common.core.redis.RedisCache; import com.jsowell.common.core.redis.RedisCache;
@@ -16,14 +18,11 @@ import com.jsowell.pile.service.*;
import com.jsowell.pile.vo.base.StationInfoVO; import com.jsowell.pile.vo.base.StationInfoVO;
import com.jsowell.pile.vo.web.BillingTemplateVO; import com.jsowell.pile.vo.web.BillingTemplateVO;
import com.jsowell.thirdparty.amap.service.AMapService; import com.jsowell.thirdparty.amap.service.AMapService;
import com.jsowell.thirdparty.platform.service.ThirdPartyPlatformService;
import com.jsowell.thirdparty.platform.service.impl.GuiZhouPlatformServiceImpl; import com.jsowell.thirdparty.platform.service.impl.GuiZhouPlatformServiceImpl;
import com.jsowell.thirdparty.service.ThirdpartySecretInfoService;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.math.BigDecimal; import java.math.BigDecimal;
@@ -60,6 +59,9 @@ public class JsowellTask {
@Autowired @Autowired
private AMapService aMapService; private AMapService aMapService;
@Autowired
private AdapayService adapayService;
@Autowired @Autowired
private SettleOrderReportService settleOrderReportService; private SettleOrderReportService settleOrderReportService;
@@ -220,5 +222,23 @@ public class JsowellTask {
log.error("处理订单分账异常, merchantId:{}", merchant.getId(), e); log.error("处理订单分账异常, merchantId:{}", merchant.getId(), e);
} }
}); });
// TODO 换为实时分账后, 此方法改为 自动提现并计算前一天的分账信息
}
/**
* 自动提现并计算前一天的分账信息
* automaticPayouts
*/
private void automaticPayouts(String merchantId) {
WithdrawDTO dto = new WithdrawDTO();
dto.setMerchantId(merchantId);
dto.setFeeAmt("0");
try {
adapayService.drawCash(dto);
} catch (BaseAdaPayException e) {
throw new RuntimeException(e);
}
} }
} }