mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2025-12-06 22:43:25 +08:00
【新增】新增微信扫码支付功能,对接PC端。
【新增】增加DTO类库,将逐步完善dto层。 【修复】修复【分类】切换后,切换回来未清零原始数据,导致更新数据重复的问题。 【调整】移除模板库功能,防止出现审核因为模板库页面存在而导致的审核失败。暂将模板库的代码存放到会员QQ群内,方便下载使用。 【调整】代码生成器【Repository.tpl】移除Cache手动增删改,【SqlSugarSetup】增加sqlsugar自动检测增删改后清理二级缓存。 【调整】后端新增秒杀独立组件,用于区分团购及秒杀的差异,首页新增秒杀组件。 【优化】重写首页所有组件样式及接口数据获取效率。 【优化】优化拼团,秒杀,团购,接龙数据获取逻辑,提升列表及详情页面数据获取效率。 【优化】调整拼团,秒杀,团购,服务商品推广海报为新式海报效果。增加服务商品推广海报。 【优化】清理h5相关代码判断,移除h5支付组件,提高响应速度。 【优化】移除小程序前端冗余代码。加快代码执行效率。
This commit is contained in:
@@ -16,6 +16,7 @@ using CoreCms.Net.Auth.HttpContextUser;
|
||||
using CoreCms.Net.Caching.AutoMate.RedisCache;
|
||||
using CoreCms.Net.Configuration;
|
||||
using CoreCms.Net.IServices;
|
||||
using CoreCms.Net.Loging;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.Entities.Expression;
|
||||
using CoreCms.Net.Model.FromBody;
|
||||
@@ -25,6 +26,7 @@ using CoreCms.Net.Utility.Extensions;
|
||||
using CoreCms.Net.Utility.Helper;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Newtonsoft.Json;
|
||||
using SqlSugar;
|
||||
|
||||
namespace CoreCms.Net.Web.WebApi.Controllers
|
||||
@@ -48,6 +50,7 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
||||
private readonly ICoreCmsGoodsServices _goodsServices;
|
||||
private readonly ICoreCmsStoreServices _storeServices;
|
||||
private readonly ICoreCmsOrderDistributionModelServices _orderDistributionModelServices;
|
||||
private readonly ICoreCmsBillPaymentsServices _billPaymentsServices;
|
||||
private readonly IRedisOperationRepository _redisOperationRepository;
|
||||
|
||||
|
||||
@@ -61,7 +64,7 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
||||
, ICoreCmsSettingServices settingServices
|
||||
, ICoreCmsAreaServices areaServices
|
||||
, ICoreCmsBillReshipServices reshipServices, ICoreCmsShipServices shipServices
|
||||
, ICoreCmsBillDeliveryServices billDeliveryServices, ICoreCmsLogisticsServices logisticsServices, ICoreCmsGoodsServices goodsServices, ICoreCmsStoreServices storeServices, ICoreCmsOrderDistributionModelServices orderDistributionModelServices, IRedisOperationRepository redisOperationRepository)
|
||||
, ICoreCmsBillDeliveryServices billDeliveryServices, ICoreCmsLogisticsServices logisticsServices, ICoreCmsGoodsServices goodsServices, ICoreCmsStoreServices storeServices, ICoreCmsOrderDistributionModelServices orderDistributionModelServices, IRedisOperationRepository redisOperationRepository, ICoreCmsBillPaymentsServices billPaymentsServices)
|
||||
{
|
||||
_user = user;
|
||||
_orderServices = orderServices;
|
||||
@@ -76,6 +79,7 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
||||
_storeServices = storeServices;
|
||||
_orderDistributionModelServices = orderDistributionModelServices;
|
||||
_redisOperationRepository = redisOperationRepository;
|
||||
_billPaymentsServices = billPaymentsServices;
|
||||
}
|
||||
|
||||
|
||||
@@ -269,6 +273,52 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 订单是否支付状态查询==================================================
|
||||
/// <summary>
|
||||
/// 订单预览
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Authorize]
|
||||
public async Task<WebApiCallBack> CheckOrderIsPaid([FromBody] FMStringId entity)
|
||||
{
|
||||
var jm = new WebApiCallBack();
|
||||
|
||||
var lockKey = "LOCK_CheckOrderIsPaid:user_" + _user.ID;
|
||||
var lockHolder = Guid.NewGuid().ToString("N"); //锁持有者
|
||||
var redisUserLock = await _redisOperationRepository.LockTakeAsync(lockKey, lockHolder, TimeSpan.FromSeconds(5));
|
||||
if (redisUserLock)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (string.IsNullOrEmpty(entity.id))
|
||||
{
|
||||
jm.msg = "支付单编号不能为空";
|
||||
return jm;
|
||||
}
|
||||
var bl = await _orderServices.ExistsAsync(p => p.orderId == entity.id && (p.payStatus == (int)GlobalEnumVars.OrderPayStatus.Yes || p.payStatus == (int)GlobalEnumVars.OrderPayStatus.PartialYes), true);
|
||||
jm.status = true;
|
||||
jm.data = bl;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
jm.msg = "数据处理异常";
|
||||
jm.otherData = e;
|
||||
NLogUtil.WriteFileLog(NLog.LogLevel.Error, LogType.ApiRequest, "用户支付支付", JsonConvert.SerializeObject(jm));
|
||||
}
|
||||
finally
|
||||
{
|
||||
await _redisOperationRepository.LockReleaseAsync(lockKey, lockHolder);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
jm.msg = "当前请求太频繁_请稍后再试";
|
||||
}
|
||||
return jm;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 获取订单不同状态的数量==================================================
|
||||
/// <summary>
|
||||
/// 获取订单不同状态的数量
|
||||
@@ -610,5 +660,7 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user