From 41d0ca2d1bea56adb58ef8c35e3539491b6c7387 Mon Sep 17 00:00:00 2001 From: wtp <1813748440@qq.com> Date: Fri, 24 Mar 2023 15:21:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=85=85=E5=80=BC=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E6=9F=A5=E8=AF=A2=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/WXPay/Dto/RechargeOut.cs | 28 +++++++++++++++++++ .../Service/WXPay/WXPayService.cs | 18 ++++++++++-- 2 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 GDZZ.Application/Service/WXPay/Dto/RechargeOut.cs diff --git a/GDZZ.Application/Service/WXPay/Dto/RechargeOut.cs b/GDZZ.Application/Service/WXPay/Dto/RechargeOut.cs new file mode 100644 index 0000000..2405a57 --- /dev/null +++ b/GDZZ.Application/Service/WXPay/Dto/RechargeOut.cs @@ -0,0 +1,28 @@ +using GDZZ.Core.Entity; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace GDZZ.Application.Service.WXPay.Dto +{ + public class RechargeOut: DEntityBase + { + /// + /// 总价格 + /// + public decimal TotalPrice { get; set; } + /// + /// 支付金额 + /// + public decimal PaymentMoney { get; set; } + /// + /// 充值状态 + /// + public int Status { get; set; } + + + + } +} diff --git a/GDZZ.Application/Service/WXPay/WXPayService.cs b/GDZZ.Application/Service/WXPay/WXPayService.cs index 14d7aa7..ffc9102 100644 --- a/GDZZ.Application/Service/WXPay/WXPayService.cs +++ b/GDZZ.Application/Service/WXPay/WXPayService.cs @@ -20,6 +20,8 @@ using System.IO; using System.Text; using Senparc.Weixin.Exceptions; using Microsoft.AspNetCore.Authorization; +using System.Collections.Generic; +using Mapster; namespace GDZZ.Application.Service.WXPay { @@ -33,7 +35,7 @@ namespace GDZZ.Application.Service.WXPay private readonly SqlSugarRepository _sysUserRep; // 用户表仓储 private readonly SqlSugarRepository _sysTenantRep; //租户仓储 private readonly SqlSugarRepository self; //职业仓储 - private readonly SqlSugarRepository balance; //职业仓储 + private readonly SqlSugarRepository balance; //余额仓储 private readonly SqlSugarRepository rechargeRep; //充值仓储 private readonly SqlSugarRepository payTakeRep; //支付仓储 @@ -85,7 +87,7 @@ namespace GDZZ.Application.Service.WXPay [Route("Mini/v1/GetUserBalance")] public async Task GetUserBalance() { - var balan = await this.balance.SingleAsync(x => x.UserID == UserManager.UserId); + var balan = await this.balance.AsQueryable().Filter("TenantId", true).SingleAsync(x => x.UserID == UserManager.UserId); if (balan == null) return null; @@ -96,6 +98,18 @@ namespace GDZZ.Application.Service.WXPay }; } + /// + /// 充值记录查询 + /// + /// + [HttpGet] + [Route("Mini/v1/GetRechargeList")] + public async Task> GetRechargeList() + { + var rechargeLiist = this.rechargeRep.Where(x => x.CreatedUserId == UserManager.UserId).ToListAsync(); + return rechargeLiist.Adapt>(); + + }