mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-05-17 16:28:41 +08:00
update
This commit is contained in:
@@ -6,7 +6,7 @@ import com.jsowell.common.exception.BusinessException;
|
|||||||
import com.jsowell.common.response.RestApiResponse;
|
import com.jsowell.common.response.RestApiResponse;
|
||||||
import com.jsowell.pile.dto.MerchantOrderReportDTO;
|
import com.jsowell.pile.dto.MerchantOrderReportDTO;
|
||||||
import com.jsowell.pile.service.BusinessFinancialService;
|
import com.jsowell.pile.service.BusinessFinancialService;
|
||||||
import com.jsowell.pile.vo.uniapp.business.BusinessFinancialQueryResultVO;
|
import com.jsowell.pile.vo.web.MerchantOrderReportVO;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
@@ -32,7 +32,7 @@ public class BusinessFinancialController extends BaseController {
|
|||||||
* @param dto 查询参数
|
* @param dto 查询参数
|
||||||
* @return 钱包信息查询结果
|
* @return 钱包信息查询结果
|
||||||
*/
|
*/
|
||||||
@PostMapping("/")
|
@PostMapping("/myWallet")
|
||||||
public RestApiResponse<?> getMyWallet(@RequestBody MerchantOrderReportDTO dto) {
|
public RestApiResponse<?> getMyWallet(@RequestBody MerchantOrderReportDTO dto) {
|
||||||
logger.info("我的钱包查询 merchantId:{}", dto != null ? dto.getMerchantId() : null);
|
logger.info("我的钱包查询 merchantId:{}", dto != null ? dto.getMerchantId() : null);
|
||||||
RestApiResponse<?> response;
|
RestApiResponse<?> response;
|
||||||
@@ -42,7 +42,7 @@ public class BusinessFinancialController extends BaseController {
|
|||||||
throw new BusinessException(ReturnCodeEnum.CODE_PARAM_NOT_NULL_ERROR);
|
throw new BusinessException(ReturnCodeEnum.CODE_PARAM_NOT_NULL_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
BusinessFinancialQueryResultVO result = businessFinancialService.getMyWallet(dto);
|
MerchantOrderReportVO result = businessFinancialService.getMyWallet(dto);
|
||||||
response = new RestApiResponse<>(result);
|
response = new RestApiResponse<>(result);
|
||||||
logger.info("我的钱包查询成功 merchantId:{}", dto.getMerchantId());
|
logger.info("我的钱包查询成功 merchantId:{}", dto.getMerchantId());
|
||||||
} catch (BusinessException e) {
|
} catch (BusinessException e) {
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
package com.jsowell.pile.service;
|
package com.jsowell.pile.service;
|
||||||
|
|
||||||
import com.jsowell.pile.dto.MerchantOrderReportDTO;
|
import com.jsowell.pile.dto.MerchantOrderReportDTO;
|
||||||
import com.jsowell.pile.vo.uniapp.business.BusinessFinancialQueryResultVO;
|
import com.jsowell.pile.vo.web.MerchantOrderReportVO;
|
||||||
|
|
||||||
public interface BusinessFinancialService {
|
public interface BusinessFinancialService {
|
||||||
BusinessFinancialQueryResultVO getMyWallet(MerchantOrderReportDTO dto);
|
MerchantOrderReportVO getMyWallet(MerchantOrderReportDTO dto);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,9 +7,7 @@ import com.jsowell.pile.dto.MerchantOrderReportDTO;
|
|||||||
import com.jsowell.pile.service.BusinessFinancialService;
|
import com.jsowell.pile.service.BusinessFinancialService;
|
||||||
import com.jsowell.pile.service.ClearingWithdrawInfoService;
|
import com.jsowell.pile.service.ClearingWithdrawInfoService;
|
||||||
import com.jsowell.pile.service.SettleOrderReportService;
|
import com.jsowell.pile.service.SettleOrderReportService;
|
||||||
import com.jsowell.pile.vo.uniapp.business.BusinessFinancialQueryResultVO;
|
|
||||||
import com.jsowell.pile.vo.web.MerchantOrderReportVO;
|
import com.jsowell.pile.vo.web.MerchantOrderReportVO;
|
||||||
import com.jsowell.pile.vo.web.OrderReportDetail;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@@ -38,24 +36,9 @@ public class BusinessFinancialServiceImpl implements BusinessFinancialService {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public BusinessFinancialQueryResultVO getMyWallet(MerchantOrderReportDTO dto) {
|
public MerchantOrderReportVO getMyWallet(MerchantOrderReportDTO dto) {
|
||||||
// 查询运营商订单报表
|
// 查询运营商订单报表
|
||||||
MerchantOrderReportVO merchantOrderReportVO = settleOrderReportService.getMerchantOrderReportV2(dto);
|
MerchantOrderReportVO result = settleOrderReportService.getMerchantOrderReportV2(dto);
|
||||||
|
|
||||||
// 构建返回结果
|
|
||||||
BusinessFinancialQueryResultVO result = new BusinessFinancialQueryResultVO();
|
|
||||||
|
|
||||||
// 从订单报表中获取收入金额、交易金额、交易手续费
|
|
||||||
if (merchantOrderReportVO != null && merchantOrderReportVO.getMerchantOrderReport() != null) {
|
|
||||||
OrderReportDetail report = merchantOrderReportVO.getMerchantOrderReport();
|
|
||||||
result.setTotalAmount(report.getTotalAmount() != null ? report.getTotalAmount() : BigDecimal.ZERO);
|
|
||||||
result.setTradeAmount(report.getTradeAmount() != null ? report.getTradeAmount() : BigDecimal.ZERO);
|
|
||||||
result.setTradeFee(report.getTradeFee() != null ? report.getTradeFee() : BigDecimal.ZERO);
|
|
||||||
} else {
|
|
||||||
result.setTotalAmount(BigDecimal.ZERO);
|
|
||||||
result.setTradeAmount(BigDecimal.ZERO);
|
|
||||||
result.setTradeFee(BigDecimal.ZERO);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 查询账户余额
|
// 查询账户余额
|
||||||
BigDecimal acctBalance = BigDecimal.ZERO;
|
BigDecimal acctBalance = BigDecimal.ZERO;
|
||||||
@@ -67,7 +50,7 @@ public class BusinessFinancialServiceImpl implements BusinessFinancialService {
|
|||||||
} catch (BaseAdaPayException e) {
|
} catch (BaseAdaPayException e) {
|
||||||
log.error("查询汇付账户余额异常 merchantId:{}", dto.getMerchantId(), e);
|
log.error("查询汇付账户余额异常 merchantId:{}", dto.getMerchantId(), e);
|
||||||
}
|
}
|
||||||
result.setAcctBalance(acctBalance);
|
result.getMerchantOrderReport().setAcctBalance(acctBalance);
|
||||||
|
|
||||||
// 查询累计提现金额
|
// 查询累计提现金额
|
||||||
BigDecimal totalWithdraw = BigDecimal.ZERO;
|
BigDecimal totalWithdraw = BigDecimal.ZERO;
|
||||||
@@ -79,7 +62,7 @@ public class BusinessFinancialServiceImpl implements BusinessFinancialService {
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("查询累计提现金额异常 merchantId:{}", dto.getMerchantId(), e);
|
log.error("查询累计提现金额异常 merchantId:{}", dto.getMerchantId(), e);
|
||||||
}
|
}
|
||||||
result.setTotalWithdraw(totalWithdraw);
|
result.getMerchantOrderReport().setTotalWithdraw(totalWithdraw);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,77 +0,0 @@
|
|||||||
package com.jsowell.pile.vo.uniapp.business;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
@AllArgsConstructor
|
|
||||||
@Builder
|
|
||||||
@NoArgsConstructor
|
|
||||||
public class BusinessFinancialQueryResultVO {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 账户总余额
|
|
||||||
*/
|
|
||||||
private BigDecimal acctBalance;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 累计提现金额
|
|
||||||
*/
|
|
||||||
private BigDecimal totalWithdraw;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 收入金额
|
|
||||||
*/
|
|
||||||
private BigDecimal totalAmount;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 交易金额
|
|
||||||
*/
|
|
||||||
private BigDecimal tradeAmount;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 交易手续费
|
|
||||||
*/
|
|
||||||
private BigDecimal tradeFee;
|
|
||||||
|
|
||||||
|
|
||||||
@Data
|
|
||||||
@AllArgsConstructor
|
|
||||||
@Builder
|
|
||||||
@NoArgsConstructor
|
|
||||||
public static class BusinessFinancialQueryResultList{
|
|
||||||
/**
|
|
||||||
* 账单金额
|
|
||||||
*/
|
|
||||||
private BigDecimal billAmount;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 账单状态
|
|
||||||
* (0-未清分;1-清分在途;2-可提现;3-提现申请中;4-已提现;5等待处理;6-线下结算)
|
|
||||||
*/
|
|
||||||
private String billStatus;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 交易日期
|
|
||||||
*/
|
|
||||||
private String tradeDate;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 提现申请时间
|
|
||||||
*/
|
|
||||||
private String applicationTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 提现订单号
|
|
||||||
*/
|
|
||||||
private String withdrawCode;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -42,4 +42,14 @@ public class OrderReportDetail {
|
|||||||
// 他人分账金额
|
// 他人分账金额
|
||||||
private BigDecimal otherSplitAmount;
|
private BigDecimal otherSplitAmount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 账户总余额
|
||||||
|
*/
|
||||||
|
private BigDecimal acctBalance;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 累计提现金额
|
||||||
|
*/
|
||||||
|
private BigDecimal totalWithdraw;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user