mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2025-12-06 19:03:27 +08:00
### 0.6.0 专业版(大版本升级,破坏性升级,请酌情处理):
【新增】弃用现在sku前端,启用全新sku组件,更加灵活,体验更好。 【新增】新增通过商品序列获取sku全新列表功能。 【新增】仓储层底层增加二级缓存功能,后面将逐步完善底层缓存中心模块。 【新增】0元购,积分兑换模式下,也去计算用户是否科技升级。 【新增】数据及业务仓储增加二级缓存功能。curd可自主控制是否缓存和清除。 【新增】订单导出excel数据增加商品名称+货品sku组合展示的方式。 【新增】自定义交易组件增加【获取商家信息】【更新商家信息】两个接口处理。 【新增】增加公告列表及公告详情页面,首页组件公告点击跳转列表展示。 【新增】个人中心增加【公告中心】入口。 【新增】后台余额变动增加说明录入。 【调整】将前端能进行分包的文件夹都进行分包,减少主包占用,方便进行二开。 【调整】因ckeditor5存在图片不可设置宽度,上传不支持mp4,排版不畅等情况,降级使用ckeditor4版本。 【修复】修复0.5.5版本售后积分返还机制积分模式判断异常的问题。 【修复】修复使用积分全额抵扣,或其他优惠政策导致的0元购,未进行短信提醒及小票打印机未打印的问题。 【修复】修复更换ckeditor4编辑器后接龙添加编辑调用失败的问题。 【修复】修复积分全额抵扣,金额0元购的情况下,进行售后执行完毕,订单未完结的情况。 【优化】去除分销申请面板按钮无用并失效报错的customStyle属性。 【优化】优化部分方法中使用手写字符串的遗留问题,统一采用enum方式。 【优化】优化前端及接口部分命名错误的问题。错将skill误写成seckill。 【优化】去除uniapp端多个客服代码。 【优化】商品详情底部完善购物车数量显示的问题。 【优化】优化团购列表,拼团列表,秒杀页面页面样式布局差异问题。 【优化】调整支付结果界面样式效果,仿微信支付结果界面。更加清晰明朗。 【优化】优化售后提交页面json计算,开放当用户下单后但未发货情况下,可以申请直接售后的操作需求。 【优化】后台商家手机号码支持设置多个,使用小写逗号分隔,方便多个商家管理员接收下单提醒。 【优化】后台售后单审核,调整售后商品为必选项。
This commit is contained in:
@@ -15,9 +15,9 @@ using System.Threading.Tasks;
|
||||
using CoreCms.Net.Caching.Manual;
|
||||
using CoreCms.Net.Configuration;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.Basics;
|
||||
using CoreCms.Net.IRepository;
|
||||
using CoreCms.Net.IRepository.UnitOfWork;
|
||||
using CoreCms.Net.Model.ViewModels.Basics;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using SqlSugar;
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace CoreCms.Net.Repository
|
||||
/// </summary>
|
||||
/// <param name="entity">实体数据</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> InsertAsync(CoreCmsDistributionCondition entity)
|
||||
public async Task<AdminUiCallBack> InsertAsync(CoreCmsDistributionCondition entity)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
@@ -52,10 +52,6 @@ namespace CoreCms.Net.Repository
|
||||
var bl = await DbClient.Insertable(entity).ExecuteReturnIdentityAsync() > 0;
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.CreateSuccess : GlobalConstVars.CreateFailure;
|
||||
if (bl)
|
||||
{
|
||||
await UpdateCaChe();
|
||||
}
|
||||
|
||||
return jm;
|
||||
}
|
||||
@@ -65,7 +61,7 @@ namespace CoreCms.Net.Repository
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(CoreCmsDistributionCondition entity)
|
||||
public async Task<AdminUiCallBack> UpdateAsync(CoreCmsDistributionCondition entity)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
@@ -91,30 +87,6 @@ namespace CoreCms.Net.Repository
|
||||
var bl = await DbClient.Updateable(oldModel).ExecuteCommandHasChangeAsync();
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure;
|
||||
if (bl)
|
||||
{
|
||||
await UpdateCaChe();
|
||||
}
|
||||
|
||||
return jm;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(List<CoreCmsDistributionCondition> entity)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var bl = await DbClient.Updateable(entity).ExecuteCommandHasChangeAsync();
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure;
|
||||
if (bl)
|
||||
{
|
||||
await UpdateCaChe();
|
||||
}
|
||||
|
||||
return jm;
|
||||
}
|
||||
@@ -124,69 +96,17 @@ namespace CoreCms.Net.Repository
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> DeleteByIdAsync(object id)
|
||||
public async Task<AdminUiCallBack> DeleteByIdAsync(object id)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var bl = await DbClient.Deleteable<CoreCmsDistributionCondition>(id).ExecuteCommandHasChangeAsync();
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure;
|
||||
if (bl)
|
||||
{
|
||||
await UpdateCaChe();
|
||||
}
|
||||
|
||||
return jm;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写删除指定ID集合的数据(批量删除)
|
||||
/// </summary>
|
||||
/// <param name="ids"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> DeleteByIdsAsync(int[] ids)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var bl = await DbClient.Deleteable<CoreCmsDistributionCondition>().In(ids).ExecuteCommandHasChangeAsync();
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure;
|
||||
if (bl)
|
||||
{
|
||||
await UpdateCaChe();
|
||||
}
|
||||
|
||||
return jm;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 获取缓存的所有数据==========================================================
|
||||
|
||||
/// <summary>
|
||||
/// 获取缓存的所有数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<List<CoreCmsDistributionCondition>> GetCaChe()
|
||||
{
|
||||
var cache = ManualDataCache.Instance.Get<List<CoreCmsDistributionCondition>>(GlobalConstVars.CacheCoreCmsDistributionCondition);
|
||||
if (cache != null)
|
||||
{
|
||||
return cache;
|
||||
}
|
||||
return await UpdateCaChe();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新cache
|
||||
/// </summary>
|
||||
public async Task<List<CoreCmsDistributionCondition>> UpdateCaChe()
|
||||
{
|
||||
var list = await DbClient.Queryable<CoreCmsDistributionCondition>().With(SqlWith.NoLock).ToListAsync();
|
||||
ManualDataCache.Instance.Set(GlobalConstVars.CacheCoreCmsDistributionCondition, list);
|
||||
return list;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 重写根据条件查询分页数据
|
||||
@@ -200,7 +120,7 @@ namespace CoreCms.Net.Repository
|
||||
/// <param name="orderByExpression"></param>
|
||||
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<IPageList<CoreCmsDistributionCondition>> QueryPageAsync(Expression<Func<CoreCmsDistributionCondition, bool>> predicate,
|
||||
public async Task<IPageList<CoreCmsDistributionCondition>> QueryPageAsync(Expression<Func<CoreCmsDistributionCondition, bool>> predicate,
|
||||
Expression<Func<CoreCmsDistributionCondition, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||
int pageSize = 20, bool blUseNoLock = false)
|
||||
{
|
||||
|
||||
@@ -15,9 +15,9 @@ using System.Threading.Tasks;
|
||||
using CoreCms.Net.Caching.Manual;
|
||||
using CoreCms.Net.Configuration;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.Basics;
|
||||
using CoreCms.Net.IRepository;
|
||||
using CoreCms.Net.IRepository.UnitOfWork;
|
||||
using CoreCms.Net.Model.ViewModels.Basics;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using SqlSugar;
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace CoreCms.Net.Repository
|
||||
/// </summary>
|
||||
/// <param name="entity">实体数据</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> InsertAsync(CoreCmsDistributionGrade entity)
|
||||
public async Task<AdminUiCallBack> InsertAsync(CoreCmsDistributionGrade entity)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace CoreCms.Net.Repository
|
||||
return jm;
|
||||
}
|
||||
|
||||
var id = await DbClient.Insertable(entity).ExecuteReturnIdentityAsync();
|
||||
var id = await DbClient.Insertable(entity).RemoveDataCache().ExecuteReturnIdentityAsync();
|
||||
var bl = id > 0;
|
||||
|
||||
jm.code = bl ? 0 : 1;
|
||||
@@ -58,9 +58,8 @@ namespace CoreCms.Net.Repository
|
||||
{
|
||||
if (entity.isDefault == true)
|
||||
{
|
||||
await DbClient.Updateable<CoreCmsDistributionGrade>().SetColumns(p => p.isDefault == false).Where(p => p.isDefault == true && p.id != id).ExecuteCommandAsync();
|
||||
await DbClient.Updateable<CoreCmsDistributionGrade>().SetColumns(p => p.isDefault == false).Where(p => p.isDefault == true && p.id != id).RemoveDataCache().ExecuteCommandAsync();
|
||||
}
|
||||
await UpdateCaChe();
|
||||
}
|
||||
return jm;
|
||||
}
|
||||
@@ -70,7 +69,7 @@ namespace CoreCms.Net.Repository
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(CoreCmsDistributionGrade entity)
|
||||
public async Task<AdminUiCallBack> UpdateAsync(CoreCmsDistributionGrade entity)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
@@ -97,7 +96,6 @@ namespace CoreCms.Net.Repository
|
||||
return jm;
|
||||
}
|
||||
//事物处理过程开始
|
||||
//oldModel.id = entity.id;
|
||||
oldModel.name = entity.name;
|
||||
oldModel.isDefault = entity.isDefault;
|
||||
oldModel.isAutoUpGrade = entity.isAutoUpGrade;
|
||||
@@ -105,7 +103,7 @@ namespace CoreCms.Net.Repository
|
||||
oldModel.description = entity.description;
|
||||
|
||||
//事物处理过程结束
|
||||
var bl = await DbClient.Updateable(oldModel).ExecuteCommandHasChangeAsync();
|
||||
var bl = await DbClient.Updateable(oldModel).RemoveDataCache().ExecuteCommandHasChangeAsync();
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure;
|
||||
if (bl)
|
||||
@@ -113,9 +111,8 @@ namespace CoreCms.Net.Repository
|
||||
//其他处理
|
||||
if (entity.isDefault)
|
||||
{
|
||||
await DbClient.Updateable<CoreCmsDistributionGrade>().SetColumns(it => it.isDefault == false).Where(p => p.isDefault == true && p.id != entity.id).ExecuteCommandAsync();
|
||||
await DbClient.Updateable<CoreCmsDistributionGrade>().SetColumns(it => it.isDefault == false).Where(p => p.isDefault == true && p.id != entity.id).RemoveDataCache().ExecuteCommandAsync();
|
||||
}
|
||||
await UpdateCaChe();
|
||||
}
|
||||
|
||||
return jm;
|
||||
@@ -136,14 +133,13 @@ namespace CoreCms.Net.Repository
|
||||
jm.msg = "存在关联的分销用户数据,禁止删除";
|
||||
return jm;
|
||||
}
|
||||
var bl = await DbClient.Deleteable<CoreCmsDistributionGrade>(id).ExecuteCommandHasChangeAsync();
|
||||
var bl = await DbClient.Deleteable<CoreCmsDistributionGrade>(id).RemoveDataCache().ExecuteCommandHasChangeAsync();
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure;
|
||||
if (bl)
|
||||
{
|
||||
await DbClient.Deleteable<CoreCmsDistributionCondition>().Where(p => p.gradeId == id).ExecuteCommandAsync();
|
||||
await DbClient.Deleteable<CoreCmsDistributionResult>().Where(p => p.gradeId == id).ExecuteCommandAsync();
|
||||
await UpdateCaChe();
|
||||
await DbClient.Deleteable<CoreCmsDistributionCondition>().Where(p => p.gradeId == id).RemoveDataCache().ExecuteCommandAsync();
|
||||
await DbClient.Deleteable<CoreCmsDistributionResult>().Where(p => p.gradeId == id).RemoveDataCache().ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
return jm;
|
||||
@@ -160,24 +156,11 @@ namespace CoreCms.Net.Repository
|
||||
/// <returns></returns>
|
||||
public async Task<List<CoreCmsDistributionGrade>> GetCaChe()
|
||||
{
|
||||
var cache = ManualDataCache.Instance.Get<List<CoreCmsDistributionGrade>>(GlobalConstVars.CacheCoreCmsDistributionGrade);
|
||||
if (cache != null)
|
||||
{
|
||||
return cache;
|
||||
}
|
||||
return await UpdateCaChe();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新cache
|
||||
/// </summary>
|
||||
public async Task<List<CoreCmsDistributionGrade>> UpdateCaChe()
|
||||
{
|
||||
var list = await DbClient.Queryable<CoreCmsDistributionGrade>().With(SqlWith.NoLock).ToListAsync();
|
||||
ManualDataCache.Instance.Set(GlobalConstVars.CacheCoreCmsDistributionGrade, list);
|
||||
var list = await DbClient.Queryable<CoreCmsDistributionGrade>().With(SqlWith.NoLock).WithCache().ToListAsync();
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -192,7 +175,7 @@ namespace CoreCms.Net.Repository
|
||||
/// <param name="orderByExpression"></param>
|
||||
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<IPageList<CoreCmsDistributionGrade>> QueryPageAsync(Expression<Func<CoreCmsDistributionGrade, bool>> predicate,
|
||||
public async Task<IPageList<CoreCmsDistributionGrade>> QueryPageAsync(Expression<Func<CoreCmsDistributionGrade, bool>> predicate,
|
||||
Expression<Func<CoreCmsDistributionGrade, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||
int pageSize = 20, bool blUseNoLock = false)
|
||||
{
|
||||
|
||||
@@ -34,182 +34,5 @@ namespace CoreCms.Net.Repository
|
||||
_unitOfWork = unitOfWork;
|
||||
}
|
||||
|
||||
#region 实现重写增删改查操作==========================================================
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步插入方法
|
||||
/// </summary>
|
||||
/// <param name="entity">实体数据</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> InsertAsync(CoreCmsDistributionOrderDetails entity)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var bl = await DbClient.Insertable(entity).ExecuteReturnIdentityAsync() > 0;
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.CreateSuccess : GlobalConstVars.CreateFailure;
|
||||
|
||||
return jm;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(CoreCmsDistributionOrderDetails entity)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var oldModel = await DbClient.Queryable<CoreCmsDistributionOrderDetails>().In(entity.id).SingleAsync();
|
||||
if (oldModel == null)
|
||||
{
|
||||
jm.msg = "不存在此信息";
|
||||
return jm;
|
||||
}
|
||||
//事物处理过程开始
|
||||
oldModel.id = entity.id;
|
||||
oldModel.distributionOrderId = entity.distributionOrderId;
|
||||
oldModel.orderId = entity.orderId;
|
||||
oldModel.productPrice = entity.productPrice;
|
||||
oldModel.amount = entity.amount;
|
||||
oldModel.goodId = entity.goodId;
|
||||
oldModel.name = entity.name;
|
||||
oldModel.addon = entity.addon;
|
||||
oldModel.productId = entity.productId;
|
||||
oldModel.productNums = entity.productNums;
|
||||
oldModel.promotionAmount = entity.promotionAmount;
|
||||
oldModel.imageUrl = entity.imageUrl;
|
||||
oldModel.remark = entity.remark;
|
||||
oldModel.createTime = entity.createTime;
|
||||
|
||||
//事物处理过程结束
|
||||
var bl = await DbClient.Updateable(oldModel).ExecuteCommandHasChangeAsync();
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure;
|
||||
|
||||
return jm;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(List<CoreCmsDistributionOrderDetails> entity)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var bl = await DbClient.Updateable(entity).ExecuteCommandHasChangeAsync();
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure;
|
||||
|
||||
return jm;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写删除指定ID的数据
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> DeleteByIdAsync(object id)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var bl = await DbClient.Deleteable<CoreCmsDistributionOrderDetails>(id).ExecuteCommandHasChangeAsync();
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure;
|
||||
|
||||
return jm;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写删除指定ID集合的数据(批量删除)
|
||||
/// </summary>
|
||||
/// <param name="ids"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> DeleteByIdsAsync(int[] ids)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var bl = await DbClient.Deleteable<CoreCmsDistributionOrderDetails>().In(ids).ExecuteCommandHasChangeAsync();
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure;
|
||||
|
||||
return jm;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region 重写根据条件查询分页数据
|
||||
/// <summary>
|
||||
/// 重写根据条件查询分页数据
|
||||
/// </summary>
|
||||
/// <param name="predicate">判断集合</param>
|
||||
/// <param name="orderByType">排序方式</param>
|
||||
/// <param name="pageIndex">当前页面索引</param>
|
||||
/// <param name="pageSize">分布大小</param>
|
||||
/// <param name="orderByExpression"></param>
|
||||
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<IPageList<CoreCmsDistributionOrderDetails>> QueryPageAsync(Expression<Func<CoreCmsDistributionOrderDetails, bool>> predicate,
|
||||
Expression<Func<CoreCmsDistributionOrderDetails, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||
int pageSize = 20, bool blUseNoLock = false)
|
||||
{
|
||||
RefAsync<int> totalCount = 0;
|
||||
List<CoreCmsDistributionOrderDetails> page;
|
||||
if (blUseNoLock)
|
||||
{
|
||||
page = await DbClient.Queryable<CoreCmsDistributionOrderDetails>()
|
||||
.OrderByIF(orderByExpression != null, orderByExpression, orderByType)
|
||||
.WhereIF(predicate != null, predicate).Select(p => new CoreCmsDistributionOrderDetails
|
||||
{
|
||||
id = p.id,
|
||||
distributionOrderId = p.distributionOrderId,
|
||||
orderId = p.orderId,
|
||||
amount = p.amount,
|
||||
productPrice = p.productPrice,
|
||||
goodId = p.goodId,
|
||||
name = p.name,
|
||||
addon = p.addon,
|
||||
productId = p.productId,
|
||||
productNums = p.productNums,
|
||||
promotionAmount = p.promotionAmount,
|
||||
imageUrl = p.imageUrl,
|
||||
remark = p.remark,
|
||||
createTime = p.createTime,
|
||||
|
||||
}).With(SqlWith.NoLock).ToPageListAsync(pageIndex, pageSize, totalCount);
|
||||
}
|
||||
else
|
||||
{
|
||||
page = await DbClient.Queryable<CoreCmsDistributionOrderDetails>()
|
||||
.OrderByIF(orderByExpression != null, orderByExpression, orderByType)
|
||||
.WhereIF(predicate != null, predicate).Select(p => new CoreCmsDistributionOrderDetails
|
||||
{
|
||||
id = p.id,
|
||||
distributionOrderId = p.distributionOrderId,
|
||||
orderId = p.orderId,
|
||||
amount = p.amount,
|
||||
productPrice = p.productPrice,
|
||||
goodId = p.goodId,
|
||||
name = p.name,
|
||||
addon = p.addon,
|
||||
productId = p.productId,
|
||||
productNums = p.productNums,
|
||||
promotionAmount = p.promotionAmount,
|
||||
imageUrl = p.imageUrl,
|
||||
remark = p.remark,
|
||||
createTime = p.createTime,
|
||||
|
||||
}).ToPageListAsync(pageIndex, pageSize, totalCount);
|
||||
}
|
||||
var list = new PageList<CoreCmsDistributionOrderDetails>(page, pageIndex, pageSize, totalCount);
|
||||
return list;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace CoreCms.Net.Repository
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#region 重写根据条件查询分页数据
|
||||
/// <summary>
|
||||
@@ -46,7 +46,7 @@ namespace CoreCms.Net.Repository
|
||||
/// <param name="orderByExpression"></param>
|
||||
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<IPageList<CoreCmsDistributionOrder>> QueryPageAsync(Expression<Func<CoreCmsDistributionOrder, bool>> predicate,
|
||||
public async Task<IPageList<CoreCmsDistributionOrder>> QueryPageAsync(Expression<Func<CoreCmsDistributionOrder, bool>> predicate,
|
||||
Expression<Func<CoreCmsDistributionOrder, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||
int pageSize = 20, bool blUseNoLock = false)
|
||||
{
|
||||
|
||||
@@ -128,7 +128,7 @@ namespace CoreCms.Net.Repository
|
||||
/// <param name="orderByExpression"></param>
|
||||
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<IPageList<CoreCmsDistribution>> QueryPageAsync(Expression<Func<CoreCmsDistribution, bool>> predicate,
|
||||
public async Task<IPageList<CoreCmsDistribution>> QueryPageAsync(Expression<Func<CoreCmsDistribution, bool>> predicate,
|
||||
Expression<Func<CoreCmsDistribution, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||
int pageSize = 20, bool blUseNoLock = false)
|
||||
{
|
||||
|
||||
@@ -15,9 +15,9 @@ using System.Threading.Tasks;
|
||||
using CoreCms.Net.Caching.Manual;
|
||||
using CoreCms.Net.Configuration;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.Basics;
|
||||
using CoreCms.Net.IRepository;
|
||||
using CoreCms.Net.IRepository.UnitOfWork;
|
||||
using CoreCms.Net.Model.ViewModels.Basics;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using SqlSugar;
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace CoreCms.Net.Repository
|
||||
/// </summary>
|
||||
/// <param name="entity">实体数据</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> InsertAsync(CoreCmsDistributionResult entity)
|
||||
public async Task<AdminUiCallBack> InsertAsync(CoreCmsDistributionResult entity)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
@@ -49,13 +49,9 @@ namespace CoreCms.Net.Repository
|
||||
return jm;
|
||||
}
|
||||
|
||||
var bl = await DbClient.Insertable(entity).ExecuteReturnIdentityAsync() > 0;
|
||||
var bl = await DbClient.Insertable(entity).RemoveDataCache().ExecuteReturnIdentityAsync() > 0;
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.CreateSuccess : GlobalConstVars.CreateFailure;
|
||||
if (bl)
|
||||
{
|
||||
await UpdateCaChe();
|
||||
}
|
||||
|
||||
return jm;
|
||||
}
|
||||
@@ -65,7 +61,7 @@ namespace CoreCms.Net.Repository
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(CoreCmsDistributionResult entity)
|
||||
public async Task<AdminUiCallBack> UpdateAsync(CoreCmsDistributionResult entity)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
@@ -88,13 +84,9 @@ namespace CoreCms.Net.Repository
|
||||
oldModel.parameters = entity.parameters;
|
||||
|
||||
//事物处理过程结束
|
||||
var bl = await DbClient.Updateable(oldModel).ExecuteCommandHasChangeAsync();
|
||||
var bl = await DbClient.Updateable(oldModel).RemoveDataCache().ExecuteCommandHasChangeAsync();
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure;
|
||||
if (bl)
|
||||
{
|
||||
await UpdateCaChe();
|
||||
}
|
||||
return jm;
|
||||
}
|
||||
|
||||
@@ -103,17 +95,13 @@ namespace CoreCms.Net.Repository
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(List<CoreCmsDistributionResult> entity)
|
||||
public async Task<AdminUiCallBack> UpdateAsync(List<CoreCmsDistributionResult> entity)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var bl = await DbClient.Updateable(entity).ExecuteCommandHasChangeAsync();
|
||||
var bl = await DbClient.Updateable(entity).RemoveDataCache().ExecuteCommandHasChangeAsync();
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure;
|
||||
if (bl)
|
||||
{
|
||||
await UpdateCaChe();
|
||||
}
|
||||
|
||||
return jm;
|
||||
}
|
||||
@@ -123,17 +111,13 @@ namespace CoreCms.Net.Repository
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> DeleteByIdAsync(object id)
|
||||
public async Task<AdminUiCallBack> DeleteByIdAsync(object id)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var bl = await DbClient.Deleteable<CoreCmsDistributionResult>(id).ExecuteCommandHasChangeAsync();
|
||||
var bl = await DbClient.Deleteable<CoreCmsDistributionResult>(id).RemoveDataCache().ExecuteCommandHasChangeAsync();
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure;
|
||||
if (bl)
|
||||
{
|
||||
await UpdateCaChe();
|
||||
}
|
||||
|
||||
return jm;
|
||||
}
|
||||
@@ -143,51 +127,19 @@ namespace CoreCms.Net.Repository
|
||||
/// </summary>
|
||||
/// <param name="ids"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> DeleteByIdsAsync(int[] ids)
|
||||
public async Task<AdminUiCallBack> DeleteByIdsAsync(int[] ids)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var bl = await DbClient.Deleteable<CoreCmsDistributionResult>().In(ids).ExecuteCommandHasChangeAsync();
|
||||
var bl = await DbClient.Deleteable<CoreCmsDistributionResult>().In(ids).RemoveDataCache().ExecuteCommandHasChangeAsync();
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure;
|
||||
if (bl)
|
||||
{
|
||||
await UpdateCaChe();
|
||||
}
|
||||
|
||||
return jm;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 获取缓存的所有数据==========================================================
|
||||
|
||||
/// <summary>
|
||||
/// 获取缓存的所有数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<List<CoreCmsDistributionResult>> GetCaChe()
|
||||
{
|
||||
var cache = ManualDataCache.Instance.Get<List<CoreCmsDistributionResult>>(GlobalConstVars.CacheCoreCmsDistributionResult);
|
||||
if (cache != null)
|
||||
{
|
||||
return cache;
|
||||
}
|
||||
return await UpdateCaChe();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新cache
|
||||
/// </summary>
|
||||
public async Task<List<CoreCmsDistributionResult>> UpdateCaChe()
|
||||
{
|
||||
var list = await DbClient.Queryable<CoreCmsDistributionResult>().With(SqlWith.NoLock).ToListAsync();
|
||||
ManualDataCache.Instance.Set(GlobalConstVars.CacheCoreCmsDistributionResult, list);
|
||||
return list;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 重写根据条件查询分页数据
|
||||
/// <summary>
|
||||
/// 重写根据条件查询分页数据
|
||||
@@ -199,7 +151,7 @@ namespace CoreCms.Net.Repository
|
||||
/// <param name="orderByExpression"></param>
|
||||
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<IPageList<CoreCmsDistributionResult>> QueryPageAsync(Expression<Func<CoreCmsDistributionResult, bool>> predicate,
|
||||
public async Task<IPageList<CoreCmsDistributionResult>> QueryPageAsync(Expression<Func<CoreCmsDistributionResult, bool>> predicate,
|
||||
Expression<Func<CoreCmsDistributionResult, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||
int pageSize = 20, bool blUseNoLock = false)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user