查询运营商提现记录

This commit is contained in:
2023-09-19 17:05:16 +08:00
parent 42ad306647
commit 09e83e8b24
4 changed files with 81 additions and 0 deletions

View File

@@ -68,4 +68,6 @@ public interface ClearingWithdrawInfoMapper {
ClearingBillVO selectWithdrawInfoByOrderCode(@Param("orderCode") String orderCode);
List<ClearingBillVO> selectWithdrawInfoByOrderCodeList(@Param("orderCodeList") List<String> orderCodeList);
List<ClearingWithdrawInfo> selectByMerchantId(@Param("merchantId") String merchantId);
}

View File

@@ -1,9 +1,19 @@
package com.jsowell.pile.service.impl;
import com.google.common.collect.Lists;
import com.huifu.adapay.core.exception.BaseAdaPayException;
import com.jsowell.adapay.service.AdapayService;
import com.jsowell.adapay.vo.DrawCashDetailVO;
import com.jsowell.common.util.DateUtils;
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.IPileMerchantInfoService;
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;
@@ -11,6 +21,12 @@ import java.util.List;
@Service
public class ClearingWithdrawInfoServiceImpl implements ClearingWithdrawInfoService{
@Autowired
private AdapayService adapayService;
@Autowired
private IPileMerchantInfoService pileMerchantInfoService;
@Resource
private ClearingWithdrawInfoMapper clearingWithdrawInfoMapper;
@@ -82,4 +98,33 @@ public class ClearingWithdrawInfoServiceImpl implements ClearingWithdrawInfoServ
return clearingWithdrawInfoMapper.selectWithdrawInfoByOrderCodeList(orderCodeList);
}
/**
* 查询运营商提现记录
*/
public List<WithdrawInfoVO> selectByMerchantId(String merchantId) throws BaseAdaPayException {
List<WithdrawInfoVO> resultList = Lists.newArrayList();
List<ClearingWithdrawInfo> infoList = clearingWithdrawInfoMapper.selectByMerchantId(merchantId);
if (CollectionUtils.isEmpty(infoList)) {
return resultList;
}
String wechatAppId = pileMerchantInfoService.queryAppIdByMerchantId(merchantId);
if (StringUtils.isBlank(wechatAppId)) {
return resultList;
}
for (ClearingWithdrawInfo clearingWithdrawInfo : infoList) {
String withdrawCode = clearingWithdrawInfo.getWithdrawCode();
DrawCashDetailVO drawCashDetailVO = adapayService.queryDrawCashDetail(withdrawCode, wechatAppId);
WithdrawInfoVO vo = new WithdrawInfoVO();
vo.setMerchantId(merchantId);
vo.setWithdrawCode(withdrawCode);
vo.setApplicationTime(DateUtils.formatDateTime(clearingWithdrawInfo.getApplicationTime()));
if (drawCashDetailVO != null) {
vo.setStatusDesc(drawCashDetailVO.getStatusDesc());
vo.setCashAmt(drawCashDetailVO.getCashAmt());
}
resultList.add(vo);
}
return resultList;
}
}

View File

@@ -0,0 +1,26 @@
package com.jsowell.pile.vo.web;
import lombok.Getter;
import lombok.Setter;
/**
* 提现记录VO
*/
@Getter
@Setter
public class WithdrawInfoVO {
// 运营商id
private String merchantId;
// 提现编号
private String withdrawCode;
// 提现状态描述
private String statusDesc;
// 申请时间
private String applicationTime;
// 提现金额
private String cashAmt;
}