mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2025-12-06 17:43:26 +08:00
【新增】新增微信扫码支付功能,对接PC端。
【新增】增加DTO类库,将逐步完善dto层。 【修复】修复【分类】切换后,切换回来未清零原始数据,导致更新数据重复的问题。 【调整】移除模板库功能,防止出现审核因为模板库页面存在而导致的审核失败。暂将模板库的代码存放到会员QQ群内,方便下载使用。 【调整】代码生成器【Repository.tpl】移除Cache手动增删改,【SqlSugarSetup】增加sqlsugar自动检测增删改后清理二级缓存。 【调整】后端新增秒杀独立组件,用于区分团购及秒杀的差异,首页新增秒杀组件。 【优化】重写首页所有组件样式及接口数据获取效率。 【优化】优化拼团,秒杀,团购,接龙数据获取逻辑,提升列表及详情页面数据获取效率。 【优化】调整拼团,秒杀,团购,服务商品推广海报为新式海报效果。增加服务商品推广海报。 【优化】清理h5相关代码判断,移除h5支付组件,提高响应速度。 【优化】移除小程序前端冗余代码。加快代码执行效率。
This commit is contained in:
@@ -39,7 +39,7 @@ namespace CoreCms.Net.Repository
|
||||
public async Task<AdminUiCallBack> InsertAsync(CoreCmsGoodsCategory entity)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
var bl = await DbClient.Insertable(entity).RemoveDataCache().ExecuteReturnIdentityAsync() > 0;
|
||||
var bl = await DbClient.Insertable(entity).ExecuteReturnIdentityAsync() > 0;
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.CreateSuccess : GlobalConstVars.CreateFailure;
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace CoreCms.Net.Repository
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
//事物处理过程结束
|
||||
var bl = await DbClient.Updateable(entity).RemoveDataCache().ExecuteCommandHasChangeAsync();
|
||||
var bl = await DbClient.Updateable(entity).ExecuteCommandHasChangeAsync();
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure;
|
||||
|
||||
@@ -72,7 +72,7 @@ namespace CoreCms.Net.Repository
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var bl = await DbClient.Deleteable<CoreCmsGoodsCategory>(id).RemoveDataCache().ExecuteCommandHasChangeAsync();
|
||||
var bl = await DbClient.Deleteable<CoreCmsGoodsCategory>(id).ExecuteCommandHasChangeAsync();
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure;
|
||||
|
||||
|
||||
@@ -36,6 +36,7 @@ namespace CoreCms.Net.Repository
|
||||
}
|
||||
|
||||
|
||||
#region 重写异步插入方法
|
||||
/// <summary>
|
||||
/// 重写异步插入方法
|
||||
/// </summary>
|
||||
@@ -285,6 +286,9 @@ namespace CoreCms.Net.Repository
|
||||
return jm;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 重写异步更新方法方法
|
||||
/// <summary>
|
||||
/// 重写异步更新方法方法
|
||||
/// </summary>
|
||||
@@ -734,7 +738,7 @@ namespace CoreCms.Net.Repository
|
||||
return jm;
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region 重写删除指定ID集合的数据(批量删除)
|
||||
/// <summary>
|
||||
@@ -1923,5 +1927,132 @@ namespace CoreCms.Net.Repository
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 获取商品及默认货品信息
|
||||
|
||||
/// <summary>
|
||||
/// 获取商品及默认货品信息
|
||||
/// </summary>
|
||||
/// <param name="predicate"></param>
|
||||
/// <param name="orderByPredicate"></param>
|
||||
/// <param name="orderByType"></param>
|
||||
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||
/// <returns></returns>
|
||||
public async Task<List<CoreCmsGoods>> QueryGoodWithDefaultProductAsync(Expression<Func<CoreCmsGoods, bool>> predicate, Expression<Func<CoreCmsGoods, object>> orderByPredicate, OrderByType orderByType, bool blUseNoLock = false)
|
||||
{
|
||||
List<CoreCmsGoods> listData;
|
||||
if (blUseNoLock)
|
||||
{
|
||||
listData = await DbClient.Queryable<CoreCmsGoods, CoreCmsProducts>((good, pd) => new JoinQueryInfos(JoinType.Left, good.id == pd.goodsId))
|
||||
.Where((good, pd) => pd.isDefalut == true && pd.isDel == false)
|
||||
.Select((good, pd) => new CoreCmsGoods
|
||||
{
|
||||
id = good.id,
|
||||
bn = good.bn,
|
||||
name = good.name,
|
||||
brief = good.brief,
|
||||
image = good.image,
|
||||
images = good.images,
|
||||
video = good.video,
|
||||
productsDistributionType = good.productsDistributionType,
|
||||
goodsCategoryId = good.goodsCategoryId,
|
||||
goodsTypeId = good.goodsTypeId,
|
||||
brandId = good.brandId,
|
||||
isNomalVirtual = good.isNomalVirtual,
|
||||
isMarketable = good.isMarketable,
|
||||
unit = good.unit,
|
||||
//intro = good.intro,
|
||||
spesDesc = good.spesDesc,
|
||||
parameters = good.parameters,
|
||||
commentsCount = good.commentsCount,
|
||||
viewCount = good.viewCount,
|
||||
buyCount = good.buyCount,
|
||||
uptime = good.uptime,
|
||||
downtime = good.downtime,
|
||||
sort = good.sort,
|
||||
labelIds = good.labelIds,
|
||||
newSpec = good.newSpec,
|
||||
openSpec = good.openSpec,
|
||||
createTime = good.createTime,
|
||||
updateTime = good.updateTime,
|
||||
isRecommend = good.isRecommend,
|
||||
isHot = good.isHot,
|
||||
isDel = good.isDel,
|
||||
sn = pd.sn,
|
||||
price = pd.price,
|
||||
costprice = pd.costprice,
|
||||
mktprice = pd.mktprice,
|
||||
stock = pd.stock,
|
||||
freezeStock = pd.freezeStock,
|
||||
pointsDeduction = pd.pointsDeduction,
|
||||
points = pd.points,
|
||||
weight = pd.weight,
|
||||
initialSales = good.initialSales,
|
||||
})
|
||||
.With(SqlWith.NoLock)
|
||||
.MergeTable()
|
||||
.WhereIF(predicate != null, predicate)
|
||||
.OrderByIF(orderByPredicate != null, orderByPredicate, orderByType)
|
||||
.ToListAsync();
|
||||
}
|
||||
else
|
||||
{
|
||||
listData = await DbClient.Queryable<CoreCmsGoods, CoreCmsProducts>((good, pd) => new JoinQueryInfos(
|
||||
JoinType.Left, good.id == pd.goodsId))
|
||||
.Where((good, pd) => pd.isDefalut == true && pd.isDel == false)
|
||||
.Select((good, pd) => new CoreCmsGoods
|
||||
{
|
||||
id = good.id,
|
||||
bn = good.bn,
|
||||
name = good.name,
|
||||
brief = good.brief,
|
||||
image = good.image,
|
||||
images = good.images,
|
||||
video = good.video,
|
||||
productsDistributionType = good.productsDistributionType,
|
||||
goodsCategoryId = good.goodsCategoryId,
|
||||
goodsTypeId = good.goodsTypeId,
|
||||
brandId = good.brandId,
|
||||
isNomalVirtual = good.isNomalVirtual,
|
||||
isMarketable = good.isMarketable,
|
||||
unit = good.unit,
|
||||
//intro = good.intro,
|
||||
spesDesc = good.spesDesc,
|
||||
parameters = good.parameters,
|
||||
commentsCount = good.commentsCount,
|
||||
viewCount = good.viewCount,
|
||||
buyCount = good.buyCount,
|
||||
uptime = good.uptime,
|
||||
downtime = good.downtime,
|
||||
sort = good.sort,
|
||||
labelIds = good.labelIds,
|
||||
newSpec = good.newSpec,
|
||||
openSpec = good.openSpec,
|
||||
createTime = good.createTime,
|
||||
updateTime = good.updateTime,
|
||||
isRecommend = good.isRecommend,
|
||||
isHot = good.isHot,
|
||||
isDel = good.isDel,
|
||||
sn = pd.sn,
|
||||
price = pd.price,
|
||||
costprice = pd.costprice,
|
||||
mktprice = pd.mktprice,
|
||||
stock = pd.stock,
|
||||
freezeStock = pd.freezeStock,
|
||||
pointsDeduction = pd.pointsDeduction,
|
||||
points = pd.points,
|
||||
weight = pd.weight,
|
||||
initialSales = good.initialSales,
|
||||
})
|
||||
.MergeTable()
|
||||
.WhereIF(predicate != null, predicate)
|
||||
.OrderByIF(orderByPredicate != null, orderByPredicate, orderByType)
|
||||
.ToListAsync();
|
||||
}
|
||||
return listData;
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,10 +64,10 @@ namespace CoreCms.Net.Repository
|
||||
var goodsTypeSpec = new CoreCmsGoodsTypeSpec();
|
||||
goodsTypeSpec.name = entity.name;
|
||||
goodsTypeSpec.sort = entity.sort;
|
||||
var specId = await DbClient.Insertable(goodsTypeSpec).RemoveDataCache().ExecuteReturnIdentityAsync();
|
||||
var specId = await DbClient.Insertable(goodsTypeSpec).ExecuteReturnIdentityAsync();
|
||||
if (specId <= 0 || entity.value is not { Count: > 0 }) return jm;
|
||||
var list = entity.value.Select((item, index) => new CoreCmsGoodsTypeSpecValue() { specId = specId, value = item, sort = index + 1 }).ToList();
|
||||
var bl = await DbClient.Insertable(list).RemoveDataCache().ExecuteCommandAsync() > 0;
|
||||
var bl = await DbClient.Insertable(list).ExecuteCommandAsync() > 0;
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.CreateSuccess : GlobalConstVars.CreateFailure;
|
||||
|
||||
@@ -107,7 +107,7 @@ namespace CoreCms.Net.Repository
|
||||
}
|
||||
oldModel.name = entity.name;
|
||||
oldModel.sort = entity.sort;
|
||||
var bl = await DbClient.Updateable(oldModel).RemoveDataCache().ExecuteCommandHasChangeAsync();
|
||||
var bl = await DbClient.Updateable(oldModel).ExecuteCommandHasChangeAsync();
|
||||
if (bl)
|
||||
{
|
||||
var oldValues = await DbClient.Queryable<CoreCmsGoodsTypeSpecValue>().OrderBy(p => p.sort).Where(p => p.specId == oldModel.id).ToListAsync();
|
||||
@@ -115,7 +115,7 @@ namespace CoreCms.Net.Repository
|
||||
//获取需要删除的数据库数据
|
||||
var deleteValues = oldValues.Where(p => !entity.value.Contains(p.value)).ToList();
|
||||
//删除旧数据
|
||||
if (deleteValues.Any()) bl = await DbClient.Deleteable<CoreCmsGoodsTypeSpecValue>(deleteValues).RemoveDataCache().ExecuteCommandHasChangeAsync();
|
||||
if (deleteValues.Any()) bl = await DbClient.Deleteable<CoreCmsGoodsTypeSpecValue>(deleteValues).ExecuteCommandHasChangeAsync();
|
||||
|
||||
//新数据
|
||||
var values = oldValues.Select(p => p.value).ToList();
|
||||
@@ -125,7 +125,7 @@ namespace CoreCms.Net.Repository
|
||||
if (newValues.Any())
|
||||
{
|
||||
var newList = newValues.Select((t, index) => new CoreCmsGoodsTypeSpecValue() { specId = oldModel.id, value = t, sort = oldValues.Count + index }).ToList();
|
||||
bl = await DbClient.Insertable<CoreCmsGoodsTypeSpecValue>(newList).RemoveDataCache().ExecuteCommandAsync() > 0;
|
||||
bl = await DbClient.Insertable<CoreCmsGoodsTypeSpecValue>(newList).ExecuteCommandAsync() > 0;
|
||||
}
|
||||
}
|
||||
jm.code = bl ? 0 : 1;
|
||||
@@ -144,12 +144,12 @@ namespace CoreCms.Net.Repository
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var bl = await DbClient.Deleteable<CoreCmsGoodsTypeSpec>(id).RemoveDataCache().ExecuteCommandHasChangeAsync();
|
||||
var bl = await DbClient.Deleteable<CoreCmsGoodsTypeSpec>(id).ExecuteCommandHasChangeAsync();
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure;
|
||||
if (bl)
|
||||
{
|
||||
await DbClient.Deleteable<CoreCmsGoodsTypeSpecValue>(p => p.specId == (int)id).RemoveDataCache().ExecuteCommandHasChangeAsync();
|
||||
await DbClient.Deleteable<CoreCmsGoodsTypeSpecValue>(p => p.specId == (int)id).ExecuteCommandHasChangeAsync();
|
||||
}
|
||||
|
||||
return jm;
|
||||
|
||||
Reference in New Issue
Block a user