diff --git a/GDZZ.Application/Enum/ConsumeEnum.cs b/GDZZ.Application/Enum/ConsumeEnum.cs new file mode 100644 index 0000000..d00e428 --- /dev/null +++ b/GDZZ.Application/Enum/ConsumeEnum.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace GDZZ.Application.Enum +{ + public enum ConsumeEnum + { + /// + /// 联系费用 + /// + [Description("联系费用")] Contact = 0, + } +} diff --git a/GDZZ.Application/GDZZ.Application.xml b/GDZZ.Application/GDZZ.Application.xml index a689de1..530a62f 100644 --- a/GDZZ.Application/GDZZ.Application.xml +++ b/GDZZ.Application/GDZZ.Application.xml @@ -409,6 +409,11 @@ 地区级别 1-省、自治区、直辖市 2-地级市、地区、自治州、盟 3-市辖区、县级市、县 + + + 联系费用 + + 已取消 @@ -590,6 +595,36 @@ 余额 + + + + + + + + 消费类型 + + + + + 沟通ID + + + + + 消费金额 + + + + + 余额 + + + + + 用户ID + + 总价格 diff --git a/GDZZ.Application/Service/Auth/AuthService.cs b/GDZZ.Application/Service/Auth/AuthService.cs index 4bcc52e..32c3e5a 100644 --- a/GDZZ.Application/Service/Auth/AuthService.cs +++ b/GDZZ.Application/Service/Auth/AuthService.cs @@ -30,7 +30,6 @@ namespace GDZZ.Application.Service.Auth private readonly SqlSugarRepository _sysTenantRep; //租户仓储 private readonly SqlSugarRepository Self; //职业仓储 private readonly SqlSugarRepository CompanyRep; - private readonly SqlSugarRepository rechargeRep; //充值仓储 private readonly SqlSugarRepository payTakeRep; //支付仓储 #endregion diff --git a/GDZZ.Application/Service/WXPay/Dto/BalanceOut.cs b/GDZZ.Application/Service/WXPay/Dto/BalanceOut.cs index bf828e6..7dd13bd 100644 --- a/GDZZ.Application/Service/WXPay/Dto/BalanceOut.cs +++ b/GDZZ.Application/Service/WXPay/Dto/BalanceOut.cs @@ -21,5 +21,8 @@ namespace GDZZ.Application.Service.WXPay.Dto /// 余额 /// public decimal Amount { get; set; } + + + } } diff --git a/GDZZ.Application/Service/WXPay/Dto/ConsumeOut.cs b/GDZZ.Application/Service/WXPay/Dto/ConsumeOut.cs new file mode 100644 index 0000000..5438f1f --- /dev/null +++ b/GDZZ.Application/Service/WXPay/Dto/ConsumeOut.cs @@ -0,0 +1,37 @@ +using GDZZ.Application.Enum; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace GDZZ.Application.Service.WXPay.Dto +{ + /// + /// + /// + public class ConsumeOut + { + /// + /// 消费类型 + /// + public ConsumeEnum Sort { get; set; } + /// + /// 沟通ID + /// + public long? ResumeID { get; set; } + + /// + /// 消费金额 + /// + public decimal CAmount { get; set; } + /// + /// 余额 + /// + public decimal Surplus { get; set; } + /// + /// 用户ID + /// + public long UserID { get; set; } + } +} diff --git a/GDZZ.Application/Service/WXPay/WXPayService.cs b/GDZZ.Application/Service/WXPay/WXPayService.cs index d836a4d..6d511ed 100644 --- a/GDZZ.Application/Service/WXPay/WXPayService.cs +++ b/GDZZ.Application/Service/WXPay/WXPayService.cs @@ -23,6 +23,7 @@ using Microsoft.AspNetCore.Authorization; using System.Collections.Generic; using Mapster; using Furion.FriendlyException; +using GDZZ.Application.Enum; namespace GDZZ.Application.Service.WXPay { @@ -44,7 +45,6 @@ namespace GDZZ.Application.Service.WXPay private readonly WechatOAuth _wechatOAuth; //微信权限服务 - private readonly IEventPublisher _eventPublisher; //事件写入服务 private readonly IHttpContextAccessor _httpContextAccessor; //http服务 @@ -139,6 +139,7 @@ namespace GDZZ.Application.Service.WXPay { CAmount= Consume, Surplus = ban.Amount, + Sort =(int)ConsumeEnum.Contact, ResumeID = ResumeID }); @@ -152,9 +153,10 @@ namespace GDZZ.Application.Service.WXPay /// [HttpGet] [Route("Mini/v1/GetBalance")] - public async Task GetBalance() + public async Task> GetBalance() { - return await this.ComsumeRep.Where(x=>x.UserID == UserManager.UserId).ToListAsync(); + var comsume = await this.ComsumeRep.Where(x => x.CreatedUserId == UserManager.UserId).OrderByDescending(x=>x.CreatedTime).ToListAsync(); + return comsume.Adapt>(); } @@ -237,12 +239,12 @@ namespace GDZZ.Application.Service.WXPay string return_code = resHandler.GetParameter("return_code"); string return_msg = resHandler.GetParameter("return_msg"); - var res = ""; + //var res = ""; resHandler.SetKey(Config.SenparcWeixinSetting.TenPayV3_Key); //验证请求是否从微信发过来(安全) if (resHandler.IsTenpaySign() && return_code.ToUpper() == "SUCCESS") { - res = "success";//正确的订单处理 + //res = "success";//正确的订单处理 //直到这里,才能认为交易真正成功了,可以进行数据库操作,但是别忘了返回规定格式的消息! Console.WriteLine("回调成功"); //attach @@ -278,7 +280,7 @@ namespace GDZZ.Application.Service.WXPay else { Console.WriteLine("回调失败"); - res = "wrong";//错误的订单处理 + //res = "wrong";//错误的订单处理 } /* 这里可以进行订单处理的逻辑 */