|
@@ -1,22 +1,12 @@
|
|
|
using Fuel.Core.Transactions.Dto;
|
|
|
-using Org.BouncyCastle.Asn1.Ocsp;
|
|
|
-using System;
|
|
|
-using System.Collections.Generic;
|
|
|
-using System.Linq;
|
|
|
-using System.Text;
|
|
|
-using System.Threading.Tasks;
|
|
|
-using static FreeSql.Internal.GlobalFilter;
|
|
|
using Microsoft.AspNetCore.Http;
|
|
|
-using Microsoft.AspNetCore.Mvc;
|
|
|
using Newtonsoft.Json;
|
|
|
using FuelServer.Core.Entity;
|
|
|
-using Fuel.Core.Nozzle.Dto;
|
|
|
-using Org.BouncyCastle.Asn1.X509;
|
|
|
using System.Linq.Expressions;
|
|
|
using Fuel.Core.Models;
|
|
|
-using DFS.Core.Abstractions.View;
|
|
|
using System.Net;
|
|
|
using Fuel.Payment.Service.Pay;
|
|
|
+using DFS.Core.Abstractions.View;
|
|
|
|
|
|
|
|
|
namespace Fuel.Application.Service
|
|
@@ -109,6 +99,40 @@ namespace Fuel.Application.Service
|
|
|
return ServiceResponse.Ok(result);
|
|
|
}
|
|
|
/// <summary>
|
|
|
+ /// 小程序查询未支付订单
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ public async Task<ServiceResponse> GetMiniProgramTransactionsUnpaidAsync(TransactionsInput input)
|
|
|
+ {
|
|
|
+ string Buid = _httpContextAccessor.HttpContext.Request.Headers["Buid"].FirstOrDefault();
|
|
|
+ Guid guid = Guid.Parse(Buid);
|
|
|
+ Expression<Func<transactions, bool>> where = p => p.Buid == guid;
|
|
|
+ if (input.MiniProgramID == null)
|
|
|
+ {
|
|
|
+ return ServiceResponse.Error("用户id为空");
|
|
|
+ }
|
|
|
+ where = CombineExpressions(where, p => p.MiniProgramID == input.MiniProgramID && p.OrderStatus == transactionsORDERSTATUS.Unpaid);
|
|
|
+ var result = await _entityHelper.GetEntitiesAsync<transactions>(where);
|
|
|
+ return ServiceResponse.Ok(result);
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
+ /// 小程序查询已支付订单
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ public async Task<ServiceResponse> GetMiniProgramTransactionsPaidAsync(TransactionsInput input)
|
|
|
+ {
|
|
|
+ string Buid = _httpContextAccessor.HttpContext.Request.Headers["Buid"].FirstOrDefault();
|
|
|
+ Guid guid = Guid.Parse(Buid);
|
|
|
+ Expression<Func<transactions, bool>> where = p => p.Buid == guid;
|
|
|
+ if (input.MiniProgramID == null)
|
|
|
+ {
|
|
|
+ return ServiceResponse.Error("用户id为空");
|
|
|
+ }
|
|
|
+ where = CombineExpressions(where, p => p.MiniProgramID == input.MiniProgramID && p.OrderStatus == transactionsORDERSTATUS.Paid);
|
|
|
+ var result = await _entityHelper.GetEntitiesAsync<transactions>(where);
|
|
|
+ return ServiceResponse.Ok(result);
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
/// 提交支付
|
|
|
/// </summary>
|
|
|
/// <param name="input"></param>
|