From c8ea01fdd9fc8ebf5e1fcbbd56fee7071e4d5809 Mon Sep 17 00:00:00 2001 From: cloudroam <cloudroam> Date: 星期二, 10 十二月 2024 14:45:05 +0800 Subject: [PATCH] 583-订单管理-订单列表统计页面增加一个,筛选地区的下拉列表,例如昆明-呈贡区等等 --- src/main/java/com/mzl/flower/web/v2/wallet/WalletController.java | 24 ++++++++++++++++++++++-- 1 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/mzl/flower/web/v2/wallet/WalletController.java b/src/main/java/com/mzl/flower/web/v2/wallet/WalletController.java index 7f44be0..5f9406b 100644 --- a/src/main/java/com/mzl/flower/web/v2/wallet/WalletController.java +++ b/src/main/java/com/mzl/flower/web/v2/wallet/WalletController.java @@ -9,6 +9,7 @@ import com.mzl.flower.dto.request.wallet.QueryWalletDTO; import com.mzl.flower.dto.response.supplier.SupplierDTO; import com.mzl.flower.service.supplier.SupplierService; +import com.mzl.flower.service.wallet.WalletBillRecordService; import com.mzl.flower.service.wallet.WalletService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -19,6 +20,7 @@ import com.mzl.flower.entity.wallet.WalletDO; import javax.validation.constraints.Positive; +import java.math.BigDecimal; /** * @author @TaoJie @@ -35,6 +37,9 @@ @Autowired private SupplierService supplierService; + + @Autowired + private WalletBillRecordService walletBillRecordService; @PostMapping("") public ResponseEntity<ReturnDataDTO> create() { @@ -66,9 +71,24 @@ if(null==currentSupplier){ throw new ValidationException("供应商不能为空"); } + final WalletDO walletDO = walletService.getCurrentSupplier(); + if(null!=walletDO){ + // 根据当前供应商获取待结算的钱 + BigDecimal waittingSettlementAmount = walletService.getWaittingSettlementAmount(walletDO); + // 获取已经提现和已结算的钱 + BigDecimal historyAmount = walletBillRecordService.getHistoryAmount(walletDO.getId(), walletDO.getSupplierId()); + //已提现 + walletDO.setWithdrawnAmount(walletDO.getWithdrawnAmount().add(historyAmount)); + //已结算 + walletDO.setSettledAmount(walletDO.getSettledAmount().add(historyAmount)); + walletDO.setSettlingAmount(waittingSettlementAmount); + // 总交易额度 + walletDO.setTotalTransactionAmount(walletService.getSupplierTotalTransactionAmount(walletDO)); + // 总扣款数量 + walletDO.setTotalDeduction(walletService.getSupplierDeductAmount(walletDO)); + } - - return returnData(R.SUCCESS.getCode(), walletService.getCurrentSupplier()); + return returnData(R.SUCCESS.getCode(), walletDO); } @GetMapping("/page") -- Gitblit v1.9.3