update 可提现金额,减去当天申请金额

This commit is contained in:
Guoqs
2025-11-18 13:33:26 +08:00
parent 277fad8918
commit e778d34941
13 changed files with 2077 additions and 36 deletions

View File

@@ -1,6 +1,8 @@
package com.jsowell.pile.service;
import com.jsowell.pile.domain.AdapayUnsplitRecord;
import com.jsowell.pile.vo.AdapayUnsplitRecordVO;
import java.util.List;
public interface AdapayUnsplitRecordService{
@@ -27,4 +29,6 @@ public interface AdapayUnsplitRecordService{
int batchInsert(List<AdapayUnsplitRecord> list);
List<AdapayUnsplitRecord> queryUnsplitOrders(String startTime, String endTime);
List<AdapayUnsplitRecordVO> queryList();
}

View File

@@ -43,4 +43,7 @@ public interface ClearingWithdrawInfoService{
PageResponse queryWithdrawList(QueryWithdrawListDTO dto) throws BaseAdaPayException;
BigDecimal queryTotalWithdraw(String merchantId);
// 获取今日提现总额
BigDecimal queryTodayWithdrawalAmount(String merchantId);
}

View File

@@ -5,7 +5,6 @@ import com.github.pagehelper.PageInfo;
import com.google.common.collect.Lists;
import com.huifu.adapay.core.exception.BaseAdaPayException;
import com.jsowell.adapay.dto.QueryWithdrawListDTO;
import com.jsowell.adapay.service.AdapayService;
import com.jsowell.common.constant.Constants;
import com.jsowell.common.core.page.PageResponse;
import com.jsowell.common.util.DateUtils;
@@ -13,11 +12,9 @@ import com.jsowell.common.util.StringUtils;
import com.jsowell.pile.domain.ClearingWithdrawInfo;
import com.jsowell.pile.mapper.ClearingWithdrawInfoMapper;
import com.jsowell.pile.service.ClearingWithdrawInfoService;
import com.jsowell.pile.service.PileMerchantInfoService;
import com.jsowell.pile.vo.web.ClearingBillVO;
import com.jsowell.pile.vo.web.WithdrawInfoVO;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@@ -164,4 +161,36 @@ public class ClearingWithdrawInfoServiceImpl implements ClearingWithdrawInfoServ
return clearingWithdrawInfoMapper.queryTotalWithdraw(merchantId);
}
/**
* 查询今日提现总额
* @param merchantId
* @return
*/
@Override
public BigDecimal queryTodayWithdrawalAmount(String merchantId) {
BigDecimal todayWithdrawalAmount = BigDecimal.ZERO;
QueryWithdrawListDTO dto = QueryWithdrawListDTO.builder()
.merchantId(merchantId)
.pageNum(1)
.pageSize(10)
.build();
PageResponse pageResponse = null;
try {
pageResponse = queryWithdrawList(dto);
} catch (BaseAdaPayException e) {
throw new RuntimeException(e);
}
if (pageResponse != null && pageResponse.getList() != null && !pageResponse.getList().isEmpty()) {
List<WithdrawInfoVO> list = (List<WithdrawInfoVO>) pageResponse.getList();
for (WithdrawInfoVO vo : list) {
// 如果applicationTime在当天则加到todayWithdrawalAmount中
if (DateUtils.isToday(vo.getApplicationTime())) {
todayWithdrawalAmount = todayWithdrawalAmount.add(vo.getCashAmt());
}
}
}
return todayWithdrawalAmount;
}
}