diff --git a/ARW.Model/Dto/Api/GoodsManager/Goodss/GoodsApiDto.cs b/ARW.Model/Dto/Api/GoodsManager/Goodss/GoodsApiDto.cs
index 27e236a..6c79bda 100644
--- a/ARW.Model/Dto/Api/GoodsManager/Goodss/GoodsApiDto.cs
+++ b/ARW.Model/Dto/Api/GoodsManager/Goodss/GoodsApiDto.cs
@@ -19,7 +19,7 @@ namespace ARW.Model.Dto.Api.GoodsManager.Goodss
///
/// 店铺经营类目
///
- public long? GoodsCategoryGuid { get; set; }
+ public long GoodsCategoryGuid { get; set; }
///
/// 店铺商品类目
diff --git a/ARW.Model/Models/Business/OrderManage/Orders/Order.cs b/ARW.Model/Models/Business/OrderManage/Orders/Order.cs
index c47e0e4..509260c 100644
--- a/ARW.Model/Models/Business/OrderManage/Orders/Order.cs
+++ b/ARW.Model/Models/Business/OrderManage/Orders/Order.cs
@@ -55,6 +55,16 @@ namespace ARW.Model.Models.Business.OrderManage.Orders
public long CustomerGuid { get; set; }
+ ///
+ /// 描述 :购物车Id
+ /// 空值 : false
+ ///
+ [EpplusTableColumn(Header = "购物车Id")]
+ [JsonConverter(typeof(ValueToStringConverter))]
+ [SugarColumn(ColumnName = "cart_ids")]
+ public string CartIds { get; set; }
+
+
///
/// 描述 :订单号
/// 空值 : false
diff --git a/ARW.Model/Vo/Api/Home/HomeCategoryApiVo.cs b/ARW.Model/Vo/Api/Home/HomeCategoryApiVo.cs
new file mode 100644
index 0000000..cf6c3ce
--- /dev/null
+++ b/ARW.Model/Vo/Api/Home/HomeCategoryApiVo.cs
@@ -0,0 +1,31 @@
+using Newtonsoft.Json;
+using OfficeOpenXml.Attributes;
+using SqlSugar;
+using System;
+using ARW.Model.Models.Business.GoodsManager.GoodsCategorys;
+using System.Collections.Generic;
+
+namespace ARW.Model.Vo.Api.Home
+{
+ ///
+ /// 首页推荐类目展示对象Api
+ ///
+ /// @author lwh
+ /// @date 2023-07-08
+ ///
+ public class HomeCategoryApiVo
+ {
+
+ ///
+ /// 描述 : 名称
+ ///
+ public string Text { get; set; }
+
+
+
+ [JsonConverter(typeof(ValueToStringConverter))]
+ public long Key { get; set; }
+
+ }
+
+}
diff --git a/ARW.Service/Api/BusinessService/GoodsManager/GoodsCategorys/GoodsCategoryServiceApi.cs b/ARW.Service/Api/BusinessService/GoodsManager/GoodsCategorys/GoodsCategoryServiceApi.cs
index 9416f5f..028ea38 100644
--- a/ARW.Service/Api/BusinessService/GoodsManager/GoodsCategorys/GoodsCategoryServiceApi.cs
+++ b/ARW.Service/Api/BusinessService/GoodsManager/GoodsCategorys/GoodsCategoryServiceApi.cs
@@ -13,6 +13,7 @@ using ARW.Service.Api.IBusinessService.GoodsManager.GoodsCategorys;
using ARW.Model.Dto.Api.GoodsManager.GoodsCategorys;
using ARW.Model.Models.Business.GoodsManager.GoodsCategorys;
using ARW.Model.Vo.Api.GoodsManager.GoodsCategorys;
+using ARW.Model.Vo.Api.Home;
namespace ARW.Service.Api.BusinessService.GoodsManager.GoodsCategorys
{
@@ -63,6 +64,33 @@ namespace ARW.Service.Api.BusinessService.GoodsManager.GoodsCategorys
return await query.ToTreeAsync(it => it.Children, it => it.ParentGuid, 0);
}
+
+ ///
+ /// 获取首页推荐类目列表(Api)
+ ///
+ ///
+ public async Task> GetHomeCategoryListApi()
+ {
+ var query = _GoodsCategoryRepository
+ .Queryable()
+ .Where(s => s.GoodsCategoryIsPopular == 1)
+ .OrderBy(s => s.ProductCategorySort, OrderByType.Asc)
+ .Select((s) => new HomeCategoryApiVo
+ {
+ Key = s.GoodsCategoryGuid,
+ Text = s.GoodsCategoryName,
+ });
+
+ var list = await query.ToListAsync();
+
+ //for (int i = 0; i < list.Count; i++)
+ //{
+ // list[i].Key = i + 1;
+ //}
+
+ return list;
+ }
+
#endregion
}
diff --git a/ARW.Service/Api/BusinessService/GoodsManager/Goodss/GoodsServiceApi.cs b/ARW.Service/Api/BusinessService/GoodsManager/Goodss/GoodsServiceApi.cs
index 476ada8..986d566 100644
--- a/ARW.Service/Api/BusinessService/GoodsManager/Goodss/GoodsServiceApi.cs
+++ b/ARW.Service/Api/BusinessService/GoodsManager/Goodss/GoodsServiceApi.cs
@@ -77,7 +77,7 @@ namespace ARW.Service.Api.BusinessService.GoodsManager.Goodss
{
//开始拼装查询条件
var predicate = Expressionable.Create();
- //string[] goodsCategoryArr = null;
+ string[] goodsCategoryArr = null;
// 检索经营类目
//if (parm.GoodsCategoryGuid != null)
@@ -106,7 +106,7 @@ namespace ARW.Service.Api.BusinessService.GoodsManager.Goodss
.Queryable()
.LeftJoin((s, c) => s.ShopGuid == c.ShopGuid)
.Where(predicate.ToExpression())
- .WhereIF(parm.GoodsCategoryGuid != null, (s, c) => c.ShopBusinessCategoryGuid == parm.GoodsCategoryGuid)
+ .WhereIF(parm.GoodsCategoryGuid != 0, (s, c) => c.ShopBusinessCategoryGuid == parm.GoodsCategoryGuid)
//.WhereIF(parm.GoodsCategoryGuid != null, (s, c) => c.ShopBusinessCategoryGuid == parm.GoodsCategoryGuid || goodsCategoryArr.Contains(c.ShopBusinessCategoryGuid.ToString()))
.Where(s => s.GoodsShelfStatus == 1)
.OrderByIF(parm.GoodsSort == 0, s => s.GoodsSort, OrderByType.Asc)
diff --git a/ARW.Service/Api/BusinessService/PayManage/PayServiceApi.cs b/ARW.Service/Api/BusinessService/PayManage/PayServiceApi.cs
index a0e4cd6..fd5334d 100644
--- a/ARW.Service/Api/BusinessService/PayManage/PayServiceApi.cs
+++ b/ARW.Service/Api/BusinessService/PayManage/PayServiceApi.cs
@@ -23,7 +23,14 @@ using ARW.Repository.Business.OrderManage.OrderGoodss;
using ARW.Repository.Business.OrderManage.OrderCustomerAddreses;
using ARW.Repository.Business.Custom.CustomerAddresses;
using ARW.Model.Models.Business.OrderManage.OrderCustomerAddreses;
-using ARW.Model.Models.Business.GoodsManager.Goodss;
+using Senparc.Weixin.TenPayV3.Apis.BasePay;
+using System;
+using System.Collections.Generic;
+using ARW.Common;
+using ARW.Model.Models.Business.Carts;
+using ARW.Repository.Business.Marketing.CouponManage.CustomerCoupons;
+using ARW.Model.Models.Business.Marketing.CouponManage.CustomerCoupons;
+using ARW.Model.Vo.Business.Marketing.CouponManage.CustomerCoupons;
namespace ARW.Service.Api.BusinessService.PaymentManage
{
@@ -53,10 +60,11 @@ namespace ARW.Service.Api.BusinessService.PaymentManage
private readonly OrderGoodsRepository _OrderGoodsRepository;
private readonly OrderCustomerAddressRepository _OrderCustomerAddressRepository;
private readonly CustomerAddressRepository _CustomerAddressRepository;
+ private readonly CustomerCouponRepository _CustomerCouponRepository;
- public PayServiceApi(ShopRepository ShopRepository, GoodsCategoryRepository goodsCategoryRepository, CustomerRepository customerRepository, OrderRepository orderRepository, PaymentRepository paymentRepository, CouponRepository couponRepository, SenparcHttpClient httpClient, GoodsRepository goodsRepository, GoodsSkuRepository goodsSkuRepository, IGoodsServiceApi goodsServiceApi, CartRepository cartRepository, OrderGoodsRepository orderGoodsRepository, OrderCustomerAddressRepository orderCustomerAddressRepository, CustomerAddressRepository customerAddressRepository)
+ public PayServiceApi(ShopRepository ShopRepository, GoodsCategoryRepository goodsCategoryRepository, CustomerRepository customerRepository, OrderRepository orderRepository, PaymentRepository paymentRepository, CouponRepository couponRepository, SenparcHttpClient httpClient, GoodsRepository goodsRepository, GoodsSkuRepository goodsSkuRepository, IGoodsServiceApi goodsServiceApi, CartRepository cartRepository, OrderGoodsRepository orderGoodsRepository, OrderCustomerAddressRepository orderCustomerAddressRepository, CustomerAddressRepository customerAddressRepository, CustomerCouponRepository customerCouponRepository)
{
this._ShopRepository = ShopRepository;
_GoodsCategoryRepository = goodsCategoryRepository;
@@ -72,15 +80,43 @@ namespace ARW.Service.Api.BusinessService.PaymentManage
_OrderGoodsRepository = orderGoodsRepository;
_OrderCustomerAddressRepository = orderCustomerAddressRepository;
_CustomerAddressRepository = customerAddressRepository;
+ _CustomerCouponRepository = customerCouponRepository;
}
#region Api接口代码
+ ///
+ /// 统一下单的业务处理
+ ///
+ ///
+ ///
+ ///
public async Task HandelPrePay(CommitPayDtoApi parm)
{
+ /* 计算核销前价格(商品总额) */
+ var goodsPrice = await CalculateBeforePrice(parm);
+
+ /* 计算运费 */
+ GoodsFreightDto goodsFreightDto = new()
+ {
+ GoodsRequestList = parm.GoodsRequestList,
+ CustomerAddressGuid = parm.CustomerAddressGuid,
+ };
+ var freight = await _GoodsServiceApi.GetGoodsFreight(goodsFreightDto);
+ var totalPrice = goodsPrice + freight;
+
+ /* 计算核销前后价格(优惠后价格) */
+ var afterPriceRes = await CalculateAfterPrice(parm);
+ if (parm.TotalAmount != afterPriceRes.DiscountPrice) throw new CustomException("前端传递金额不合法!下单失败!");
+ parm.TotalAmount = afterPriceRes.DiscountPrice;
+
+
// 获取金额
var price = 1;//单位:分
+ //int price = (int)(afterPriceRes.DiscountPrice * 100);//单位:分
+
+
// 生成订单号
var orderNo = Common.Common.CreateNoQuery();
// 调用统一下单(接口)
@@ -96,23 +132,6 @@ namespace ARW.Service.Api.BusinessService.PaymentManage
{
#region 业务处理
- /* 计算核销前价格(商品总额) */
- var goodsPrice = await CalculateBeforePrice(parm);
-
- /* 计算运费 */
- GoodsFreightDto goodsFreightDto = new()
- {
- GoodsRequestList = parm.GoodsRequestList,
- CustomerAddressGuid = parm.CustomerAddressGuid,
- };
- var freight = await _GoodsServiceApi.GetGoodsFreight(goodsFreightDto);
-
- var totalPrice = goodsPrice + freight;
- if (parm.TotalAmount != totalPrice) throw new CustomException("前端传递金额不合法!下单失败!");
- parm.TotalAmount = totalPrice;
-
- /* 计算核销前后价格(优惠后价格) */
- var afterPriceRes = await CalculateAfterPrice(parm);
/* 添加订单流水 */
@@ -142,9 +161,26 @@ namespace ARW.Service.Api.BusinessService.PaymentManage
}
+
+ ///
+ /// 支付回调的业务处理
+ ///
+ ///
+ public async Task HandleNotify(OrderReturnJson res)
+ {
+ /* 修改订单流水 */
+ await UpdatePayment(res);
+
+ /* 修改业务订单 */
+ await UpdateOrder(res);
+ }
+
+
#region 业务方法调用
+ #region 添加订单
+
///
/// 计算核销前的价格
///
@@ -169,11 +205,27 @@ namespace ARW.Service.Api.BusinessService.PaymentManage
{
price += sku.GoodsSkuPrice * quantity;
}
+ // 下单立减库存
+ if (goods.GoodsDeductStockType == 1)
+ {
+ sku.GoodsSkuStockNum -= quantity;
+ await _GoodsSkuRepository.UpdateAsync(sku);
+ goods.GoodsTotalInventory -= quantity;
+ await _GoodsRepository.UpdateAsync(goods);
+ }
}
else
{
price += goods.GoodsPriceHighest * quantity;
+ // 下单立减库存
+ if (goods.GoodsDeductStockType == 1)
+ {
+ goods.GoodsTotalInventory -= quantity;
+ await _GoodsRepository.UpdateAsync(goods);
+ }
}
+
+
}
return price;
@@ -230,8 +282,8 @@ namespace ARW.Service.Api.BusinessService.PaymentManage
CustomerGuid = parm.UserId,
PaymentNumber = orderNo,
PaymentBuytype = parm.PayType,
- PaymentBeforeMoney = beforeMoney,
- PaymentMoney = afterMoney,
+ PaymentBeforeMoney = afterMoney,
+ //PaymentMoney = afterMoney,
PaymentStatus = 1
};
var response = await _PaymentRepository.InsertReturnSnowflakeIdAsync(payment);
@@ -264,7 +316,7 @@ namespace ARW.Service.Api.BusinessService.PaymentManage
CouponMoney = discountRes.CouponMoney,
GoodsTotalAmoun = beforeMoney,
OrderAmount = discountRes.DiscountPrice,
- PayPrice = discountRes.DiscountPrice,
+ //PayPrice = discountRes.DiscountPrice,
OrderRemark = parm?.Remark,
PayType = parm.PayType,
PayStatus = 1,
@@ -278,12 +330,21 @@ namespace ARW.Service.Api.BusinessService.PaymentManage
ExpressPrice = freight,
};
- // TODO:余额支付
+ // 关联购物车ids
+ var idsList = new List();
+ foreach (var item in parm.GoodsRequestList)
+ {
+ idsList.Add(item.CartId);
+ }
+ var idsArrar = idsList.ToArray();
+ order.CartIds = string.Join(",", idsList);
var response = await _OrderRepository.InsertReturnSnowflakeIdAsync(order);
if (response == 0)
throw new CustomException("业务订单数据加入失败");
+
+
return response;
}
@@ -367,6 +428,115 @@ namespace ARW.Service.Api.BusinessService.PaymentManage
}
+ #endregion
+
+
+
+ #region 支付完成后的业务调用方法
+
+
+ ///
+ /// 修改订单流水
+ ///
+ ///
+ ///
+ public async Task UpdatePayment(OrderReturnJson res)
+ {
+ await _PaymentRepository.UpdateAsync(f => new Payment
+ {
+ PaymentWeixinNumber = res.transaction_id,
+ PaymentMoney = res.amount.payer_total / 100,
+ PaymentStatus = 2,
+ Update_time = DateTime.Now,
+ }, f => f.PaymentNumber == res.out_trade_no);
+ }
+
+
+ ///
+ /// 修改业务订单
+ ///
+ ///
+ ///
+ public async Task UpdateOrder(OrderReturnJson res)
+ {
+
+ await _OrderRepository.UpdateAsync(f => new Model.Models.Business.OrderManage.Orders.Order
+ {
+ TransactionId = res.transaction_id,
+ PayPrice = res.amount.payer_total / 100,
+ PayStatus = 2,
+ PayTime = DateTime.Now,
+ Update_time = DateTime.Now,
+ }, f => f.OrderNumber == res.out_trade_no);
+
+ var order = await _OrderRepository.GetFirstAsync(s => s.OrderNumber == res.out_trade_no);
+
+
+ /* 删除购物车中对应的商品 */
+ var cartIds = Tools.SpitIntArrary(order.CartIds);
+ foreach (var cartId in cartIds)
+ {
+ await _CartRepository.UpdateAsync(s => new Cart
+ {
+ IsDelete = true,
+ }, s => s.CartId == cartId);
+ }
+
+ /* 对应优惠券修改为已使用 */
+ if (order.CouponGuid != 0)
+ {
+ var customer = await _CustomerRepository.GetFirstAsync(s => s.CustomerXcxOpenid == res.payer.openid);
+ var customerCoupon = await _CustomerCouponRepository.GetFirstAsync(s => s.CouponGuid == order.CouponGuid && s.CustomerGuid == customer.CustomerGuid);
+ await _CustomerCouponRepository.UpdateAsync(s => new CustomerCoupon
+ {
+ CustomerCouponIsUsed = 2,
+ }, s => s.CustomerCouponId == customerCoupon.CustomerCouponId);
+ }
+
+
+ /* 店铺和商品的销售数量增加 对应库存减少*/
+ var orderGoodsList = await _OrderGoodsRepository.GetListAsync(s => s.OrderGuid == order.OrderGuid);
+ foreach (var orderGood in orderGoodsList)
+ {
+ var goods = await _GoodsRepository.GetFirstAsync(s => s.GoodsGuid == orderGood.GoodsGuid);
+ var shop = await _ShopRepository.GetFirstAsync(s => s.ShopGuid == goods.ShopGuid);
+
+ goods.GoodsSalesActual += orderGood.GoodsTotalNum;
+ await _GoodsRepository.UpdateAsync(goods);
+ shop.ShopSalesOrderCount += orderGood.GoodsTotalNum;
+ await _ShopRepository.UpdateAsync(shop);
+
+ if (goods.GoodsDeductStockType == 2)
+ {
+ if (orderGood.GoodsSkuId != 0)
+ {
+ var sku = await _GoodsSkuRepository.GetFirstAsync(s => s.GoodsSkuId == orderGood.GoodsSkuId);
+ sku.GoodsSkuStockNum -= orderGood.GoodsTotalNum;
+ goods.GoodsTotalInventory -= orderGood.GoodsTotalNum;
+ await _GoodsSkuRepository.UpdateAsync(sku);
+ await _GoodsRepository.UpdateAsync(goods);
+ }
+ else
+ {
+ goods.GoodsTotalInventory -= orderGood.GoodsTotalNum;
+ await _GoodsRepository.UpdateAsync(goods);
+ }
+ }
+ }
+
+
+ /* 积分操作*/
+
+
+
+
+ }
+
+
+ #endregion
+
+
+
#endregion
diff --git a/ARW.Service/Api/IBusinessService/GoodsManager/GoodsCategorys/IGoodsCategoryServiceApi.cs b/ARW.Service/Api/IBusinessService/GoodsManager/GoodsCategorys/IGoodsCategoryServiceApi.cs
index fcc209a..e13821f 100644
--- a/ARW.Service/Api/IBusinessService/GoodsManager/GoodsCategorys/IGoodsCategoryServiceApi.cs
+++ b/ARW.Service/Api/IBusinessService/GoodsManager/GoodsCategorys/IGoodsCategoryServiceApi.cs
@@ -7,6 +7,7 @@ using ARW.Model;
using ARW.Model.Dto.Api.GoodsManager.GoodsCategorys;
using ARW.Model.Models.Business.GoodsManager.GoodsCategorys;
using ARW.Model.Vo.Api.GoodsManager.GoodsCategorys;
+using ARW.Model.Vo.Api.Home;
namespace ARW.Service.Api.IBusinessService.GoodsManager.GoodsCategorys
{
@@ -26,5 +27,11 @@ namespace ARW.Service.Api.IBusinessService.GoodsManager.GoodsCategorys
Task> GetGoodsCategoryTreeListApi(GoodsCategoryQueryDtoApi parm);
+ ///
+ /// 获取首页推荐类目列表(Api)
+ ///
+ ///
+ Task> GetHomeCategoryListApi();
+
}
}
diff --git a/ARW.Service/Api/IBusinessService/PayManage/IPayServiceApi.cs b/ARW.Service/Api/IBusinessService/PayManage/IPayServiceApi.cs
index 98cc3ca..f97572c 100644
--- a/ARW.Service/Api/IBusinessService/PayManage/IPayServiceApi.cs
+++ b/ARW.Service/Api/IBusinessService/PayManage/IPayServiceApi.cs
@@ -2,6 +2,7 @@ using System.Threading.Tasks;
using ARW.Model.Dto.Api.Carts;
using ARW.Model.Dto.Api.Pay;
using ARW.Model.Models.Business.Payments;
+using Senparc.Weixin.TenPayV3.Apis.BasePay;
using static Infrastructure.WeChat.TenPay.Pay;
namespace ARW.Service.Api.IBusinessService.PayManage
@@ -22,5 +23,12 @@ namespace ARW.Service.Api.IBusinessService.PayManage
Task HandelPrePay(CommitPayDtoApi parm);
+ ///
+ /// 支付回调的业务处理
+ ///
+ ///
+ ///
+ Task HandleNotify(OrderReturnJson res);
+
}
}
diff --git a/ARW.WebApi/Controllers/Api/GoodsManager/Goodss/GoodsApiController.cs b/ARW.WebApi/Controllers/Api/GoodsManager/Goodss/GoodsApiController.cs
index 4613522..a69d42a 100644
--- a/ARW.WebApi/Controllers/Api/GoodsManager/Goodss/GoodsApiController.cs
+++ b/ARW.WebApi/Controllers/Api/GoodsManager/Goodss/GoodsApiController.cs
@@ -15,6 +15,7 @@ using ARW.Model.Models.Business.GoodsManager.Goodss;
using ARW.Model.Vo.Api.GoodsManager.Goodss;
using Microsoft.AspNetCore.Authorization;
using Geocoding;
+using ARW.Service.Api.IBusinessService.GoodsManager.GoodsCategorys;
namespace ARW.WebApi.Controllers.Api.GoodsManager.Goodss
{
@@ -30,6 +31,7 @@ namespace ARW.WebApi.Controllers.Api.GoodsManager.Goodss
{
private readonly IGoodsServiceApi _GoodsServiceApi;
+
///
/// 依赖注入
///
diff --git a/ARW.WebApi/Controllers/Api/Home/HomeApiController.cs b/ARW.WebApi/Controllers/Api/Home/HomeApiController.cs
new file mode 100644
index 0000000..1db61ff
--- /dev/null
+++ b/ARW.WebApi/Controllers/Api/Home/HomeApiController.cs
@@ -0,0 +1,60 @@
+using Infrastructure;
+using Infrastructure.Attribute;
+using Infrastructure.Enums;
+using Infrastructure.Model;
+using Mapster;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using ARW.Admin.WebApi.Extensions;
+using ARW.Admin.WebApi.Filters;
+using ARW.Common;
+using ARW.Admin.WebApi.Controllers;
+using ARW.Model.Dto.Api.GoodsManager.Goodss;
+using ARW.Service.Api.IBusinessService.GoodsManager.Goodss;
+using ARW.Model.Models.Business.GoodsManager.Goodss;
+using ARW.Model.Vo.Api.GoodsManager.Goodss;
+using Microsoft.AspNetCore.Authorization;
+using Geocoding;
+using ARW.Service.Api.IBusinessService.GoodsManager.GoodsCategorys;
+using ARW.Model.Dto.Api.GoodsManager.GoodsCategorys;
+using ARW.Model.Vo.Api.GoodsManager.GoodsCategorys;
+
+namespace ARW.WebApi.Controllers.Api.GoodsManager.Home
+{
+ ///
+ /// 首页控制器Api
+ ///
+ /// @author lwh
+ /// @date 2023-07-09
+ ///
+ //[Verify]
+ [Route("api/[controller]")]
+ public class HomeApiController : BaseController
+ {
+ private readonly IGoodsServiceApi _GoodsServiceApi;
+ private readonly IGoodsCategoryServiceApi _GoodsCategoryServiceApi;
+
+ ///
+ /// 依赖注入
+ ///
+ /// 商品商品Api服务
+ public HomeApiController(IGoodsServiceApi GoodsServiceApi, IGoodsCategoryServiceApi goodsCategoryServiceApi)
+ {
+ _GoodsServiceApi = GoodsServiceApi;
+ _GoodsCategoryServiceApi = goodsCategoryServiceApi;
+ }
+
+
+ ///
+ /// 获取首页推荐类目列表(Api)
+ ///
+ ///
+ [HttpGet("getHomeCategoryListApi")]
+ public async Task GetHomeCategoryListApi()
+ {
+ var res = await _GoodsCategoryServiceApi.GetHomeCategoryListApi();
+ return SUCCESS(res);
+ }
+
+ }
+}
diff --git a/ARW.WebApi/Controllers/Api/Wechat/WxPay/WxPayController.cs b/ARW.WebApi/Controllers/Api/Wechat/WxPay/WxPayController.cs
index c58e7d5..d801007 100644
--- a/ARW.WebApi/Controllers/Api/Wechat/WxPay/WxPayController.cs
+++ b/ARW.WebApi/Controllers/Api/Wechat/WxPay/WxPayController.cs
@@ -75,16 +75,8 @@ namespace ARW.WebApi.Controllers.Api.Wechat.WxPay
if (res.trade_state == "SUCCESS")
{
- // 业务
- var respones = _PayServiceApi.UpdateAsync(f => new Payment
- {
- PaymentWeixinNumber = res.transaction_id,
- PaymentBeforeMoney = res.amount.total,
- PaymentMoney = res.amount.payer_total,
- PaymentStatus = 2,
- Update_time = DateTime.Now,
- }, f => f.PaymentNumber == res.out_trade_no);
-
+ /* 支付回调的业务处理 */
+ await _PayServiceApi.HandleNotify(res);
}
return SUCCESS("");