diff --git a/CoreCms.Net.Caching/CoreCms.Net.Caching.csproj b/CoreCms.Net.Caching/CoreCms.Net.Caching.csproj index 46c0a429..c3337852 100644 --- a/CoreCms.Net.Caching/CoreCms.Net.Caching.csproj +++ b/CoreCms.Net.Caching/CoreCms.Net.Caching.csproj @@ -6,7 +6,7 @@ - + diff --git a/CoreCms.Net.CodeGenerator/CoreCms.Net.CodeGenerator.csproj b/CoreCms.Net.CodeGenerator/CoreCms.Net.CodeGenerator.csproj index a268e7a6..28979def 100644 --- a/CoreCms.Net.CodeGenerator/CoreCms.Net.CodeGenerator.csproj +++ b/CoreCms.Net.CodeGenerator/CoreCms.Net.CodeGenerator.csproj @@ -19,7 +19,7 @@ - + diff --git a/CoreCms.Net.Configuration/CoreCms.Net.Configuration.csproj b/CoreCms.Net.Configuration/CoreCms.Net.Configuration.csproj index a7f9d35f..b89bd190 100644 --- a/CoreCms.Net.Configuration/CoreCms.Net.Configuration.csproj +++ b/CoreCms.Net.Configuration/CoreCms.Net.Configuration.csproj @@ -5,7 +5,7 @@ - + diff --git a/CoreCms.Net.Configuration/GlobalConstVars.cs b/CoreCms.Net.Configuration/GlobalConstVars.cs index 420d1cb3..7b2fca3a 100644 --- a/CoreCms.Net.Configuration/GlobalConstVars.cs +++ b/CoreCms.Net.Configuration/GlobalConstVars.cs @@ -278,7 +278,8 @@ public const string CacheCoreCmsProductsDistribution = "CacheCoreCmsProductsDistribution"; //货品三级佣金表 public const string CacheCoreCmsServiceDescription = "CacheCoreCmsServiceDescription"; public const string CacheCoreCmsAgentGrade = "CacheCoreCmsAgentGrade"; - + public const string CacheCoreCmsSolitaireItems = "CacheCoreCmsSolitaireItems"; + public const string CacheCoreCmsSolitaire = "CacheCoreCmsSolitaire"; public const string CacheWeChatTCThirdCatList = "CacheWeChatTCThirdCatList"; public const string CacheWeChatTransactionComponentGood = "CacheWeChatTransactionComponentGood"; public const string CacheWeChatTransactionComponentDeliveryCompany = "CacheWeChatTransactionComponentDeliveryCompany"; diff --git a/CoreCms.Net.Configuration/GlobalEnumVars.cs b/CoreCms.Net.Configuration/GlobalEnumVars.cs index 52f7fdd8..34bd6636 100644 --- a/CoreCms.Net.Configuration/GlobalEnumVars.cs +++ b/CoreCms.Net.Configuration/GlobalEnumVars.cs @@ -1839,6 +1839,11 @@ namespace CoreCms.Net.Configuration /// [Description("11代理")] Agent = 11, + /// + /// 12接龙 + /// + [Description("12接龙")] + Solitaire = 12, } /// @@ -2491,27 +2496,25 @@ namespace CoreCms.Net.Configuration /// /// 正常 /// - [Description("正常")] + [Description("")] Normal = 0, /// /// 过期 /// - [Description("过期")] + [Description("")] Overdue = 1, /// /// 作废 /// - [Description("作废")] + [Description("")] Cancellation = 2, /// /// 已核销 /// - [Description("已核销")] + [Description("")] Verification = 3 } - - /// /// 服务订单状态 /// @@ -2520,24 +2523,24 @@ namespace CoreCms.Net.Configuration /// /// 正常 /// - [Description("正常")] + [Description("")] 正常 = 1, /// /// 作废 /// - [Description("作废")] + [Description("")] 作废 = 2, /// /// 过期 /// - [Description("过期")] + [Description("")] 过期 = 3, /// /// 用罄 /// - [Description("用罄")] + [Description("")] 用罄 = 4 } diff --git a/CoreCms.Net.Configuration/GlobalErrorCodeVars.cs b/CoreCms.Net.Configuration/GlobalErrorCodeVars.cs index 1b989364..c573e686 100644 --- a/CoreCms.Net.Configuration/GlobalErrorCodeVars.cs +++ b/CoreCms.Net.Configuration/GlobalErrorCodeVars.cs @@ -537,6 +537,15 @@ namespace CoreCms.Net.Configuration public const string Code20039 = ""; public const string Code20040 = ""; + //接龙 + public const string Code21001 = "没有找到此接龙活动"; + public const string Code21002 = "还没到时间"; + public const string Code21003 = "已经结束了"; + public const string Code21004 = "未获取到此活动下货品信息"; + public const string Code21005 = "活动下未找到此货品信息"; + public const string Code21006 = "货品折扣后价格已经小于0"; + + //会员管理 -21000 //商品管理 -22000 diff --git a/CoreCms.Net.Core/CoreCms.Net.Core.csproj b/CoreCms.Net.Core/CoreCms.Net.Core.csproj index a476580e..242ff018 100644 --- a/CoreCms.Net.Core/CoreCms.Net.Core.csproj +++ b/CoreCms.Net.Core/CoreCms.Net.Core.csproj @@ -20,13 +20,13 @@ - + - + diff --git a/CoreCms.Net.IRepository/Good/ICoreCmsGoodsRepository.cs b/CoreCms.Net.IRepository/Good/ICoreCmsGoodsRepository.cs index eab1ad6f..704e0b62 100644 --- a/CoreCms.Net.IRepository/Good/ICoreCmsGoodsRepository.cs +++ b/CoreCms.Net.IRepository/Good/ICoreCmsGoodsRepository.cs @@ -149,6 +149,23 @@ namespace CoreCms.Net.IRepository Task> QueryAgentGoodsPageAsync(Expression> predicate, string orderBy = "", int pageIndex = 1, int pageSize = 20, bool blUseNoLock = false); + + + /// + /// 根据条件查询商品及sku分页数据 + /// + /// 判断集合 + /// 排序方式 + /// 当前页面索引 + /// 分布大小 + /// + /// 是否使用WITH(NOLOCK) + /// + Task> QueryGoodAndSkuPageAsync(Expression> predicate, + Expression> orderByExpression, OrderByType orderByType, int pageIndex = 1, + int pageSize = 20, bool blUseNoLock = false); + + /// /// 获取下拉商品数据 /// diff --git a/CoreCms.Net.IRepository/Service/ICoreCmsUserServicesOrderRepository.cs b/CoreCms.Net.IRepository/Service/ICoreCmsUserServicesOrderRepository.cs index 540514d5..2a426058 100644 --- a/CoreCms.Net.IRepository/Service/ICoreCmsUserServicesOrderRepository.cs +++ b/CoreCms.Net.IRepository/Service/ICoreCmsUserServicesOrderRepository.cs @@ -8,7 +8,12 @@ * Description: 暂无 ***********************************************************************/ +using System; +using System.Linq.Expressions; +using System.Threading.Tasks; using CoreCms.Net.Model.Entities; +using CoreCms.Net.Model.ViewModels.Basics; +using SqlSugar; namespace CoreCms.Net.IRepository { @@ -59,5 +64,22 @@ namespace CoreCms.Net.IRepository //new Task DeleteByIdsAsync(int[] ids); #endregion + + + /// + /// 重写根据条件查询分页数据 + /// + /// 判断集合 + /// 排序方式 + /// 当前页面索引 + /// 分布大小 + /// + /// 是否使用WITH(NOLOCK) + /// + new Task> QueryPageAsync( + Expression> predicate, + Expression> orderByExpression, OrderByType orderByType, int pageIndex = 1, + int pageSize = 20, bool blUseNoLock = false); + } } \ No newline at end of file diff --git a/CoreCms.Net.IRepository/Service/ICoreCmsUserServicesTicketRepository.cs b/CoreCms.Net.IRepository/Service/ICoreCmsUserServicesTicketRepository.cs index aae3456c..0b62d698 100644 --- a/CoreCms.Net.IRepository/Service/ICoreCmsUserServicesTicketRepository.cs +++ b/CoreCms.Net.IRepository/Service/ICoreCmsUserServicesTicketRepository.cs @@ -8,7 +8,12 @@ * Description: 暂无 ***********************************************************************/ +using System; +using System.Linq.Expressions; +using System.Threading.Tasks; using CoreCms.Net.Model.Entities; +using CoreCms.Net.Model.ViewModels.Basics; +using SqlSugar; namespace CoreCms.Net.IRepository { @@ -59,5 +64,22 @@ namespace CoreCms.Net.IRepository //new Task DeleteByIdsAsync(int[] ids); #endregion + + + /// + /// 重写根据条件查询分页数据 + /// + /// 判断集合 + /// 排序方式 + /// 当前页面索引 + /// 分布大小 + /// + /// 是否使用WITH(NOLOCK) + /// + new Task> QueryPageAsync( + Expression> predicate, + Expression> orderByExpression, OrderByType orderByType, int pageIndex = 1, + int pageSize = 20, bool blUseNoLock = false); + } } \ No newline at end of file diff --git a/CoreCms.Net.IRepository/Solitaire/ICoreCmsSolitaireItemsRepository.cs b/CoreCms.Net.IRepository/Solitaire/ICoreCmsSolitaireItemsRepository.cs new file mode 100644 index 00000000..635d1a3c --- /dev/null +++ b/CoreCms.Net.IRepository/Solitaire/ICoreCmsSolitaireItemsRepository.cs @@ -0,0 +1,118 @@ +/*********************************************************************** + * Project: CoreCms + * ProjectName: 核心内容管理系统 + * Web: https://www.corecms.net + * Author: 大灰灰 + * Email: jianweie@163.com + * CreateTime: 2021/6/14 23:18:18 + * Description: 暂无 + ***********************************************************************/ + +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Threading.Tasks; +using CoreCms.Net.Model.Entities; +using CoreCms.Net.Model.ViewModels.Basics; +using CoreCms.Net.Model.ViewModels.UI; +using SqlSugar; + + +namespace CoreCms.Net.IRepository +{ + /// + /// 接龙活动商品表 工厂接口 + /// + public interface ICoreCmsSolitaireItemsRepository : IBaseRepository + { + #region 重写增删改查操作=========================================================== + + /// + /// 重写异步插入方法 + /// + /// + /// + new Task InsertAsync(CoreCmsSolitaireItems entity); + + + /// + /// 重写异步更新方法 + /// + /// + /// + new Task UpdateAsync(CoreCmsSolitaireItems entity); + + + /// + /// 重写异步更新方法 + /// + /// + /// + new Task UpdateAsync(List entity); + + + /// + /// 重写删除指定ID的数据 + /// + /// + /// + new Task DeleteByIdAsync(object id); + + + /// + /// 重写删除指定ID集合的数据(批量删除) + /// + /// + /// + new Task DeleteByIdsAsync(int[] ids); + + #endregion + + #region 获取缓存的所有数据========================================================== + + /// + /// 获取缓存的所有数据 + /// + /// + Task> GetCaChe(); + + /// + /// 更新cache + /// + Task> UpdateCaChe(); + + #endregion + + + + /// + /// 重写根据条件查询列表数据 + /// + /// 判断集合 + /// 排序方式 + /// + /// 是否使用WITH(NOLOCK) + /// + new Task> QueryListByClauseAsync( + Expression> predicate, + Expression> orderByExpression, OrderByType orderByType, + bool blUseNoLock = false); + + + /// + /// 重写根据条件查询分页数据 + /// + /// 判断集合 + /// 排序方式 + /// 当前页面索引 + /// 分布大小 + /// + /// 是否使用WITH(NOLOCK) + /// + new Task> QueryPageAsync( + Expression> predicate, + Expression> orderByExpression, OrderByType orderByType, int pageIndex = 1, + int pageSize = 20, bool blUseNoLock = false); + + } +} diff --git a/CoreCms.Net.IRepository/Solitaire/ICoreCmsSolitaireRepository.cs b/CoreCms.Net.IRepository/Solitaire/ICoreCmsSolitaireRepository.cs new file mode 100644 index 00000000..a547cd7c --- /dev/null +++ b/CoreCms.Net.IRepository/Solitaire/ICoreCmsSolitaireRepository.cs @@ -0,0 +1,120 @@ +/*********************************************************************** + * Project: CoreCms + * ProjectName: 核心内容管理系统 + * Web: https://www.corecms.net + * Author: 大灰灰 + * Email: jianweie@163.com + * CreateTime: 2021/6/14 23:17:57 + * Description: 暂无 + ***********************************************************************/ + +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Threading.Tasks; +using CoreCms.Net.Model.Entities; +using CoreCms.Net.Model.ViewModels.Basics; +using CoreCms.Net.Model.ViewModels.DTO; +using CoreCms.Net.Model.ViewModels.UI; +using SqlSugar; + + +namespace CoreCms.Net.IRepository +{ + /// + /// 接龙活动表 工厂接口 + /// + public interface ICoreCmsSolitaireRepository : IBaseRepository + { + #region 重写增删改查操作=========================================================== + + /// + /// 重写异步插入方法 + /// + /// + /// + new Task InsertAsync(CoreCmsSolitaire entity); + + + /// + /// 重写异步更新方法 + /// + /// + /// + new Task UpdateAsync(CoreCmsSolitaire entity); + + + /// + /// 重写异步更新方法 + /// + /// + /// + new Task UpdateAsync(List entity); + + + /// + /// 重写删除指定ID的数据 + /// + /// + /// + new Task DeleteByIdAsync(object id); + + + /// + /// 重写删除指定ID集合的数据(批量删除) + /// + /// + /// + new Task DeleteByIdsAsync(int[] ids); + + #endregion + + #region 获取缓存的所有数据========================================================== + + /// + /// 获取缓存的所有数据 + /// + /// + Task> GetCaChe(); + + /// + /// 更新cache + /// + Task> UpdateCaChe(); + + #endregion + + + /// + /// 重写根据条件查询分页数据 + /// + /// 判断集合 + /// 排序方式 + /// 当前页面索引 + /// 分布大小 + /// + /// 是否使用WITH(NOLOCK) + /// + new Task> QueryPageAsync( + Expression> predicate, + Expression> orderByExpression, OrderByType orderByType, int pageIndex = 1, + int pageSize = 20, bool blUseNoLock = false); + + /// + /// 取购物车数据的时候,更新价格 + /// + /// + /// + /// + Task SolitaireInfo(int objectId, List list); + + + /// + /// 获取接龙购买用户记录 + /// + /// + /// + Task GetBuyRecord(int id); + + } +} diff --git a/CoreCms.Net.IServices/Good/ICoreCmsGoodsServices.cs b/CoreCms.Net.IServices/Good/ICoreCmsGoodsServices.cs index 23b55d0a..4186e238 100644 --- a/CoreCms.Net.IServices/Good/ICoreCmsGoodsServices.cs +++ b/CoreCms.Net.IServices/Good/ICoreCmsGoodsServices.cs @@ -201,6 +201,21 @@ namespace CoreCms.Net.IServices Task> QueryAgentGoodsPageAsync(Expression> predicate, string orderBy = "", int pageIndex = 1, int pageSize = 20, bool blUseNoLock = false); + + /// + /// 根据条件查询商品及sku分页数据 + /// + /// 判断集合 + /// 排序方式 + /// 当前页面索引 + /// 分布大小 + /// + /// 是否使用WITH(NOLOCK) + /// + Task> QueryGoodAndSkuPageAsync(Expression> predicate, + Expression> orderByExpression, OrderByType orderByType, int pageIndex = 1, + int pageSize = 20, bool blUseNoLock = false); + /// /// 获取下拉商品数据 /// diff --git a/CoreCms.Net.IServices/Service/ICoreCmsUserServicesOrderServices.cs b/CoreCms.Net.IServices/Service/ICoreCmsUserServicesOrderServices.cs index bc146910..4af1d390 100644 --- a/CoreCms.Net.IServices/Service/ICoreCmsUserServicesOrderServices.cs +++ b/CoreCms.Net.IServices/Service/ICoreCmsUserServicesOrderServices.cs @@ -8,9 +8,13 @@ * Description: 暂无 ***********************************************************************/ +using System; +using System.Linq.Expressions; using System.Threading.Tasks; using CoreCms.Net.Model.Entities; +using CoreCms.Net.Model.ViewModels.Basics; using CoreCms.Net.Model.ViewModels.UI; +using SqlSugar; namespace CoreCms.Net.IServices { @@ -26,5 +30,23 @@ namespace CoreCms.Net.IServices /// /// Task CreateUserServicesTickets(string serviceOrderId, string paymentId); + + + + /// + /// 重写根据条件查询分页数据 + /// + /// 判断集合 + /// 排序方式 + /// 当前页面索引 + /// 分布大小 + /// + /// 是否使用WITH(NOLOCK) + /// + new Task> QueryPageAsync( + Expression> predicate, + Expression> orderByExpression, OrderByType orderByType, int pageIndex = 1, + int pageSize = 20, bool blUseNoLock = false); + } } \ No newline at end of file diff --git a/CoreCms.Net.IServices/Service/ICoreCmsUserServicesTicketServices.cs b/CoreCms.Net.IServices/Service/ICoreCmsUserServicesTicketServices.cs index bf454696..ab915427 100644 --- a/CoreCms.Net.IServices/Service/ICoreCmsUserServicesTicketServices.cs +++ b/CoreCms.Net.IServices/Service/ICoreCmsUserServicesTicketServices.cs @@ -8,7 +8,12 @@ * Description: 暂无 ***********************************************************************/ +using System; +using System.Linq.Expressions; +using System.Threading.Tasks; using CoreCms.Net.Model.Entities; +using CoreCms.Net.Model.ViewModels.Basics; +using SqlSugar; namespace CoreCms.Net.IServices { @@ -17,5 +22,24 @@ namespace CoreCms.Net.IServices /// public interface ICoreCmsUserServicesTicketServices : IBaseServices { + + /// + /// 重写根据条件查询分页数据 + /// + /// 判断集合 + /// 排序方式 + /// 当前页面索引 + /// 分布大小 + /// + /// 是否使用WITH(NOLOCK) + /// + new Task> QueryPageAsync( + Expression> predicate, + Expression> orderByExpression, OrderByType orderByType, int pageIndex = 1, + int pageSize = 20, bool blUseNoLock = false); + } + + + } \ No newline at end of file diff --git a/CoreCms.Net.IServices/Solitaire/ICoreCmsSolitaireItemsServices.cs b/CoreCms.Net.IServices/Solitaire/ICoreCmsSolitaireItemsServices.cs new file mode 100644 index 00000000..5b538433 --- /dev/null +++ b/CoreCms.Net.IServices/Solitaire/ICoreCmsSolitaireItemsServices.cs @@ -0,0 +1,113 @@ +/*********************************************************************** + * Project: CoreCms + * ProjectName: 核心内容管理系统 + * Web: https://www.corecms.net + * Author: 大灰灰 + * Email: jianweie@163.com + * CreateTime: 2021/6/14 23:18:18 + * Description: 暂无 + ***********************************************************************/ + +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Threading.Tasks; +using CoreCms.Net.Model.Entities; +using CoreCms.Net.Model.ViewModels.Basics; +using CoreCms.Net.Model.ViewModels.UI; +using SqlSugar; + +namespace CoreCms.Net.IServices +{ + /// + /// 接龙活动商品表 服务工厂接口 + /// + public interface ICoreCmsSolitaireItemsServices : IBaseServices + { + #region 重写增删改查操作=========================================================== + + /// + /// 重写异步插入方法 + /// + /// + /// + new Task InsertAsync(CoreCmsSolitaireItems entity); + + /// + /// 重写异步更新方法 + /// + /// + /// + new Task UpdateAsync(CoreCmsSolitaireItems entity); + + /// + /// 重写异步更新方法 + /// + /// + /// + new Task UpdateAsync(List entity); + + /// + /// 重写删除指定ID的数据 + /// + /// + /// + new Task DeleteByIdAsync(object id); + + /// + /// 重写删除指定ID集合的数据(批量删除) + /// + /// + /// + new Task DeleteByIdsAsync(int[] ids); + + #endregion + + + #region 获取缓存的所有数据========================================================== + + /// + /// 获取缓存的所有数据 + /// + /// + Task> GetCaChe(); + + /// + /// 更新cache + /// + Task> UpdateCaChe(); + + #endregion + + /// + /// 重写根据条件查询列表数据 + /// + /// 判断集合 + /// 排序方式 + /// + /// 是否使用WITH(NOLOCK) + /// + new Task> QueryListByClauseAsync( + Expression> predicate, + Expression> orderByExpression, OrderByType orderByType, + bool blUseNoLock = false); + + + #region 重写根据条件查询分页数据 + /// + /// 重写根据条件查询分页数据 + /// + /// 判断集合 + /// 排序方式 + /// 当前页面索引 + /// 分布大小 + /// + /// 是否使用WITH(NOLOCK) + /// + new Task> QueryPageAsync( + Expression> predicate, + Expression> orderByExpression, OrderByType orderByType, int pageIndex = 1, + int pageSize = 20, bool blUseNoLock = false); + #endregion + } +} diff --git a/CoreCms.Net.IServices/Solitaire/ICoreCmsSolitaireServices.cs b/CoreCms.Net.IServices/Solitaire/ICoreCmsSolitaireServices.cs new file mode 100644 index 00000000..96113b2f --- /dev/null +++ b/CoreCms.Net.IServices/Solitaire/ICoreCmsSolitaireServices.cs @@ -0,0 +1,117 @@ +/*********************************************************************** + * Project: CoreCms + * ProjectName: 核心内容管理系统 + * Web: https://www.corecms.net + * Author: 大灰灰 + * Email: jianweie@163.com + * CreateTime: 2021/6/14 23:17:57 + * Description: 暂无 + ***********************************************************************/ + +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Threading.Tasks; +using CoreCms.Net.Model.Entities; +using CoreCms.Net.Model.ViewModels.Basics; +using CoreCms.Net.Model.ViewModels.DTO; +using CoreCms.Net.Model.ViewModels.UI; +using SqlSugar; + +namespace CoreCms.Net.IServices +{ + /// + /// 接龙活动表 服务工厂接口 + /// + public interface ICoreCmsSolitaireServices : IBaseServices + { + #region 重写增删改查操作=========================================================== + + /// + /// 重写异步插入方法 + /// + /// + /// + new Task InsertAsync(CoreCmsSolitaire entity); + + /// + /// 重写异步更新方法 + /// + /// + /// + new Task UpdateAsync(CoreCmsSolitaire entity); + + /// + /// 重写异步更新方法 + /// + /// + /// + new Task UpdateAsync(List entity); + + /// + /// 重写删除指定ID的数据 + /// + /// + /// + new Task DeleteByIdAsync(object id); + + /// + /// 重写删除指定ID集合的数据(批量删除) + /// + /// + /// + new Task DeleteByIdsAsync(int[] ids); + + #endregion + + + #region 获取缓存的所有数据========================================================== + + /// + /// 获取缓存的所有数据 + /// + /// + Task> GetCaChe(); + + /// + /// 更新cache + /// + Task> UpdateCaChe(); + + #endregion + + #region 重写根据条件查询分页数据 + /// + /// 重写根据条件查询分页数据 + /// + /// 判断集合 + /// 排序方式 + /// 当前页面索引 + /// 分布大小 + /// + /// 是否使用WITH(NOLOCK) + /// + new Task> QueryPageAsync( + Expression> predicate, + Expression> orderByExpression, OrderByType orderByType, int pageIndex = 1, + int pageSize = 20, bool blUseNoLock = false); + #endregion + + + /// + /// 取购物车数据的时候,更新价格 + /// + /// + /// + /// + Task SolitaireInfo(int objectId, List list); + + /// + /// 获取接龙购买用户记录 + /// + /// + /// + Task GetBuyRecord(int id); + + } +} diff --git a/CoreCms.Net.Mapping/CoreCms.Net.Mapping.csproj b/CoreCms.Net.Mapping/CoreCms.Net.Mapping.csproj index be72919a..b1a695f6 100644 --- a/CoreCms.Net.Mapping/CoreCms.Net.Mapping.csproj +++ b/CoreCms.Net.Mapping/CoreCms.Net.Mapping.csproj @@ -5,7 +5,7 @@ - + diff --git a/CoreCms.Net.Model/CoreCms.Net.Model.csproj b/CoreCms.Net.Model/CoreCms.Net.Model.csproj index 98e530e9..86dce1c3 100644 --- a/CoreCms.Net.Model/CoreCms.Net.Model.csproj +++ b/CoreCms.Net.Model/CoreCms.Net.Model.csproj @@ -5,7 +5,7 @@ - + diff --git a/CoreCms.Net.Model/Entities/Good/CoreCmsGoodsPartial.cs b/CoreCms.Net.Model/Entities/Good/CoreCmsGoodsPartial.cs index b9f02a3a..95d31954 100644 --- a/CoreCms.Net.Model/Entities/Good/CoreCmsGoodsPartial.cs +++ b/CoreCms.Net.Model/Entities/Good/CoreCmsGoodsPartial.cs @@ -89,6 +89,11 @@ namespace CoreCms.Net.Model.Entities [SugarColumn(IsIgnore = true)] public CoreCmsProducts product { get; set; } = new(); + /// + /// 关联SKU + /// + [SugarColumn(IsIgnore = true)] + public List sku { get; set; } = new(); /// /// 是否收藏 diff --git a/CoreCms.Net.Model/Entities/Service/CoreCmsUserServicesOrder.cs b/CoreCms.Net.Model/Entities/Service/CoreCmsUserServicesOrder.cs index bf8154a6..0bb6e28a 100644 --- a/CoreCms.Net.Model/Entities/Service/CoreCmsUserServicesOrder.cs +++ b/CoreCms.Net.Model/Entities/Service/CoreCmsUserServicesOrder.cs @@ -3,11 +3,13 @@ * ProjectName: 核心内容管理系统 * Web: https://www.corecms.net * Author: 大灰灰 - * Email: jianweie@163.com - * CreateTime: 2021-06-08 22:14:59 + * Email: jianweie@163.com + * CreateTime: 2022/1/15 1:30:57 * Description: 暂无 -***********************************************************************/ + ***********************************************************************/ + using SqlSugar; +using System.ComponentModel; using System.ComponentModel.DataAnnotations; namespace CoreCms.Net.Model.Entities @@ -15,84 +17,136 @@ namespace CoreCms.Net.Model.Entities /// /// 服务购买表 /// - [SugarTable("CoreCmsUserServicesOrder",TableDescription = "服务购买表")] public partial class CoreCmsUserServicesOrder { /// - /// 服务购买表 + /// 构造函数 /// public CoreCmsUserServicesOrder() { } - + /// /// 序列 /// [Display(Name = "序列")] - [SugarColumn(ColumnDescription = "序列", IsPrimaryKey = true, IsIdentity = true)] + + [SugarColumn(IsPrimaryKey = true, IsIdentity = true)] + [Required(ErrorMessage = "请输入{0}")] - public System.Int32 id { get; set; } + + + + public System.Int32 id { get; set; } + + /// /// 服务订单编号 /// [Display(Name = "服务订单编号")] - [SugarColumn(ColumnDescription = "服务订单编号")] + [Required(ErrorMessage = "请输入{0}")] - [StringLength(50, ErrorMessage = "【{0}】不能超过{1}字符长度")] - public System.String serviceOrderId { get; set; } + [StringLength(maximumLength:50,ErrorMessage = "{0}不能超过{1}字")] + + + public System.String serviceOrderId { get; set; } + + /// /// 关联用户 /// [Display(Name = "关联用户")] - [SugarColumn(ColumnDescription = "关联用户")] + [Required(ErrorMessage = "请输入{0}")] - public System.Int32 userId { get; set; } + + + + public System.Int32 userId { get; set; } + + /// /// 关联服务 /// [Display(Name = "关联服务")] - [SugarColumn(ColumnDescription = "关联服务")] + [Required(ErrorMessage = "请输入{0}")] - public System.Int32 servicesId { get; set; } + + + + public System.Int32 servicesId { get; set; } + + /// /// 是否支付 /// [Display(Name = "是否支付")] - [SugarColumn(ColumnDescription = "是否支付")] + [Required(ErrorMessage = "请输入{0}")] - public System.Boolean isPay { get; set; } + + + + public System.Boolean isPay { get; set; } + + /// /// 支付时间 /// [Display(Name = "支付时间")] - [SugarColumn(ColumnDescription = "支付时间", IsNullable = true)] - public System.DateTime? payTime { get; set; } + + + + + + public System.DateTime? payTime { get; set; } + + /// /// 支付单号 /// [Display(Name = "支付单号")] - [SugarColumn(ColumnDescription = "支付单号", IsNullable = true)] - [StringLength(50, ErrorMessage = "【{0}】不能超过{1}字符长度")] - public System.String paymentId { get; set; } + + + [StringLength(maximumLength:50,ErrorMessage = "{0}不能超过{1}字")] + + + public System.String paymentId { get; set; } + + /// /// 状态 /// [Display(Name = "状态")] - [SugarColumn(ColumnDescription = "状态")] + [Required(ErrorMessage = "请输入{0}")] - public System.Int32 status { get; set; } + + + + public System.Int32 status { get; set; } + + /// /// 订单创建时间 /// [Display(Name = "订单创建时间")] - [SugarColumn(ColumnDescription = "订单创建时间")] + [Required(ErrorMessage = "请输入{0}")] - public System.DateTime createTime { get; set; } + + + + public System.DateTime createTime { get; set; } + + /// /// 截止服务时间 /// [Display(Name = "截止服务时间")] - [SugarColumn(ColumnDescription = "截止服务时间", IsNullable = true)] - public System.DateTime? servicesEndTime { get; set; } + + + + + + public System.DateTime? servicesEndTime { get; set; } + + } -} \ No newline at end of file +} diff --git a/CoreCms.Net.Model/Entities/Service/CoreCmsUserServicesOrderPartial.cs b/CoreCms.Net.Model/Entities/Service/CoreCmsUserServicesOrderPartial.cs index 57a418f3..a744c273 100644 --- a/CoreCms.Net.Model/Entities/Service/CoreCmsUserServicesOrderPartial.cs +++ b/CoreCms.Net.Model/Entities/Service/CoreCmsUserServicesOrderPartial.cs @@ -32,5 +32,23 @@ namespace CoreCms.Net.Model.Entities [Display(Name = "状态说明")] [SugarColumn(IsIgnore = true)] public string statusStr { get; set; } + + + /// + /// 服务标题 + /// + [Display(Name = "服务标题")] + [SugarColumn(IsIgnore = true)] + public string serviceTitle { get; set; } + + + /// + /// 用户昵称 + /// + [Display(Name = "用户昵称")] + [SugarColumn(IsIgnore = true)] + public string userName { get; set; } + + } } \ No newline at end of file diff --git a/CoreCms.Net.Model/Entities/Solitaire/CoreCmsSolitaire.cs b/CoreCms.Net.Model/Entities/Solitaire/CoreCmsSolitaire.cs new file mode 100644 index 00000000..b6fe8196 --- /dev/null +++ b/CoreCms.Net.Model/Entities/Solitaire/CoreCmsSolitaire.cs @@ -0,0 +1,188 @@ +/*********************************************************************** + * Project: CoreCms + * ProjectName: 核心内容管理系统 + * Web: https://www.corecms.net + * Author: 大灰灰 + * Email: jianweie@163.com + * CreateTime: 2021/10/11 22:19:44 + * Description: 暂无 + ***********************************************************************/ + +using SqlSugar; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; + +namespace CoreCms.Net.Model.Entities +{ + /// + /// 接龙活动表 + /// + public partial class CoreCmsSolitaire + { + /// + /// 构造函数 + /// + public CoreCmsSolitaire() + { + } + + /// + /// 序列 + /// + [Display(Name = "序列")] + + [SugarColumn(IsPrimaryKey = true, IsIdentity = true)] + + [Required(ErrorMessage = "请输入{0}")] + + + + public System.Int32 id { get; set; } + + + /// + /// 活动标题 + /// + [Display(Name = "活动标题")] + + [Required(ErrorMessage = "请输入{0}")] + [StringLength(maximumLength:250,ErrorMessage = "{0}不能超过{1}字")] + + + public System.String title { get; set; } + + + /// + /// 缩略图 + /// + [Display(Name = "缩略图")] + + [Required(ErrorMessage = "请输入{0}")] + [StringLength(maximumLength:250,ErrorMessage = "{0}不能超过{1}字")] + + + public System.String thumbnail { get; set; } + + + /// + /// 活动描述 + /// + [Display(Name = "活动描述")] + + + [StringLength(maximumLength:250,ErrorMessage = "{0}不能超过{1}字")] + + + public System.String description { get; set; } + + + /// + /// 活动内容 + /// + [Display(Name = "活动内容")] + + [Required(ErrorMessage = "请输入{0}")] + + + + public System.String contentBody { get; set; } + + + /// + /// 开始时间 + /// + [Display(Name = "开始时间")] + + [Required(ErrorMessage = "请输入{0}")] + + + + public System.DateTime startTime { get; set; } + + + /// + /// 结束时间 + /// + [Display(Name = "结束时间")] + + [Required(ErrorMessage = "请输入{0}")] + + + + public System.DateTime endTime { get; set; } + + + /// + /// 起购价格 + /// + [Display(Name = "起购价格")] + + [Required(ErrorMessage = "请输入{0}")] + + + + public System.Decimal startBuyPrice { get; set; } + + + /// + /// 起送价格 + /// + [Display(Name = "起送价格")] + + [Required(ErrorMessage = "请输入{0}")] + + + + public System.Decimal minDeliveryPrice { get; set; } + + + /// + /// 是否显示 + /// + [Display(Name = "是否显示")] + + [Required(ErrorMessage = "请输入{0}")] + + + + public System.Boolean isShow { get; set; } + + + /// + /// 活动状态 + /// + [Display(Name = "活动状态")] + + [Required(ErrorMessage = "请输入{0}")] + + + + public System.Int32 status { get; set; } + + + /// + /// 标注删除 + /// + [Display(Name = "标注删除")] + + [Required(ErrorMessage = "请输入{0}")] + + + + public System.Boolean isDelete { get; set; } + + + /// + /// 创建时间 + /// + [Display(Name = "创建时间")] + + [Required(ErrorMessage = "请输入{0}")] + + + + public System.DateTime createTime { get; set; } + + + } +} diff --git a/CoreCms.Net.Model/Entities/Solitaire/CoreCmsSolitaireItems.cs b/CoreCms.Net.Model/Entities/Solitaire/CoreCmsSolitaireItems.cs new file mode 100644 index 00000000..3d7c4dba --- /dev/null +++ b/CoreCms.Net.Model/Entities/Solitaire/CoreCmsSolitaireItems.cs @@ -0,0 +1,85 @@ +/*********************************************************************** + * Project: CoreCms + * ProjectName: 核心内容管理系统 + * Web: https://www.corecms.net + * Author: 大灰灰 + * Email: jianweie@163.com + * CreateTime: 2021/6/21 1:16:08 + * Description: 暂无 + ***********************************************************************/ + +using System.ComponentModel.DataAnnotations; +using SqlSugar; + +namespace CoreCms.Net.Model.Entities +{ + /// + /// 接龙活动商品表 + /// + public partial class CoreCmsSolitaireItems + { + /// + /// 序列 + /// + [Display(Name = "序列")] + [SugarColumn(IsPrimaryKey = true, IsIdentity = true)] + [Required(ErrorMessage = "请输入{0}")] + public int id { get; set; } + + /// + /// 接龙序列 + /// + [Display(Name = "接龙序列")] + [Required(ErrorMessage = "请输入{0}")] + public int solitaireId { get; set; } + + /// + /// 商品序列 + /// + [Display(Name = "商品序列")] + [Required(ErrorMessage = "请输入{0}")] + public int goodId { get; set; } + + /// + /// 货品价格 + /// + [Display(Name = "货品价格")] + [Required(ErrorMessage = "请输入{0}")] + public int productId { get; set; } + + /// + /// 接龙价 + /// + [Display(Name = "接龙价")] + [Required(ErrorMessage = "请输入{0}")] + public decimal price { get; set; } + + /// + /// 活动库存 + /// + [Display(Name = "活动库存")] + [Required(ErrorMessage = "请输入{0}")] + public int activityStock { get; set; } + + /// + /// 每人可买 + /// + [Display(Name = "每人可买")] + [Required(ErrorMessage = "请输入{0}")] + public int oneCanBuy { get; set; } + + /// + /// 排序 + /// + [Display(Name = "排序")] + [Required(ErrorMessage = "请输入{0}")] + public int sortId { get; set; } + + /// + /// 标注删除 + /// + [Display(Name = "标注删除")] + [Required(ErrorMessage = "请输入{0}")] + public bool isDelete { get; set; } + } +} \ No newline at end of file diff --git a/CoreCms.Net.Model/Entities/Solitaire/CoreCmsSolitaireItemsPartial.cs b/CoreCms.Net.Model/Entities/Solitaire/CoreCmsSolitaireItemsPartial.cs new file mode 100644 index 00000000..12af81e5 --- /dev/null +++ b/CoreCms.Net.Model/Entities/Solitaire/CoreCmsSolitaireItemsPartial.cs @@ -0,0 +1,38 @@ +/*********************************************************************** + * Project: CoreCms + * ProjectName: 核心内容管理系统 + * Web: https://www.corecms.net + * Author: 大灰灰 + * Email: jianweie@163.com + * CreateTime: 2021/6/21 1:16:08 + * Description: 暂无 + ***********************************************************************/ + +using SqlSugar; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; + +namespace CoreCms.Net.Model.Entities +{ + /// + /// 接龙活动商品表 + /// + public partial class CoreCmsSolitaireItems + { + + /// + /// 关联货品 + /// + [Display(Name = "关联货品")] + [SqlSugar.SugarColumn(IsIgnore = true)] + public CoreCmsProducts productObj { get; set; } + + /// + /// 关联商品 + /// + [Display(Name = "关联商品")] + [SqlSugar.SugarColumn(IsIgnore = true)] + public CoreCmsGoods goodObj { get; set; } + + } +} diff --git a/CoreCms.Net.Model/Entities/Solitaire/CoreCmsSolitairePartial.cs b/CoreCms.Net.Model/Entities/Solitaire/CoreCmsSolitairePartial.cs new file mode 100644 index 00000000..66f84c02 --- /dev/null +++ b/CoreCms.Net.Model/Entities/Solitaire/CoreCmsSolitairePartial.cs @@ -0,0 +1,30 @@ +/*********************************************************************** + * Project: CoreCms + * ProjectName: 核心内容管理系统 + * Web: https://www.corecms.net + * Author: 大灰灰 + * Email: jianweie@163.com + * CreateTime: 2021/6/14 23:17:57 + * Description: 暂无 + ***********************************************************************/ + +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using SqlSugar; + +namespace CoreCms.Net.Model.Entities +{ + /// + /// 接龙活动表 + /// + public partial class CoreCmsSolitaire + { + /// + /// 货品明细 + /// + [Display(Name = "货品明细")] + [SqlSugar.SugarColumn(IsIgnore = true)] + public List items { get; set; } + } +} \ No newline at end of file diff --git a/CoreCms.Net.RedisMQ/CoreCms.Net.RedisMQ.csproj b/CoreCms.Net.RedisMQ/CoreCms.Net.RedisMQ.csproj index a63742a4..9a275a4a 100644 --- a/CoreCms.Net.RedisMQ/CoreCms.Net.RedisMQ.csproj +++ b/CoreCms.Net.RedisMQ/CoreCms.Net.RedisMQ.csproj @@ -6,9 +6,9 @@ - + - + diff --git a/CoreCms.Net.Repository/Good/CoreCmsGoodsRepository.cs b/CoreCms.Net.Repository/Good/CoreCmsGoodsRepository.cs index a69c241c..d09797ec 100644 --- a/CoreCms.Net.Repository/Good/CoreCmsGoodsRepository.cs +++ b/CoreCms.Net.Repository/Good/CoreCmsGoodsRepository.cs @@ -1736,6 +1736,122 @@ namespace CoreCms.Net.Repository #endregion + #region 根据条件查询商品及sku分页数据 + /// + /// 根据条件查询商品及sku分页数据 + /// + /// 判断集合 + /// 排序方式 + /// 当前页面索引 + /// 分布大小 + /// + /// 是否使用WITH(NOLOCK) + /// + public async Task> QueryGoodAndSkuPageAsync(Expression> predicate, + Expression> orderByExpression, OrderByType orderByType, int pageIndex = 1, + int pageSize = 20, bool blUseNoLock = false) + { + RefAsync totalCount = 0; + List page; + if (blUseNoLock) + { + page = await DbClient.Queryable() + .Where(p => p.isDel == false) + .Select(good => 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, + }) + .Mapper(p => p.sku, p => p.sku.First().goodsId) + .Mapper(it => + { + it.sku = it.sku.Where(o => o.isDel == false).ToList(); + }) + .With(SqlWith.NoLock) + .OrderByIF(orderByExpression != null, orderByExpression, orderByType) + .WhereIF(predicate != null, predicate) + .ToPageListAsync(pageIndex, pageSize, totalCount); + } + else + { + page = await DbClient.Queryable() + .Where(p => p.isDel == false) + .Select(good => 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 + }) + .Mapper(p => p.sku, p => p.sku.First().goodsId) + .Mapper(it => + { + it.sku = it.sku.Where(o => o.isDel == false).ToList(); + }) + .OrderByIF(orderByExpression != null, orderByExpression, orderByType) + .WhereIF(predicate != null, predicate) + .ToPageListAsync(pageIndex, pageSize, totalCount); + } + var list = new PageList(page, pageIndex, pageSize, totalCount); + return list; + } + #endregion #region 获取下拉商品数据 /// diff --git a/CoreCms.Net.Repository/Service/CoreCmsUserServicesOrderRepository.cs b/CoreCms.Net.Repository/Service/CoreCmsUserServicesOrderRepository.cs index 18f7ad14..464284b6 100644 --- a/CoreCms.Net.Repository/Service/CoreCmsUserServicesOrderRepository.cs +++ b/CoreCms.Net.Repository/Service/CoreCmsUserServicesOrderRepository.cs @@ -8,9 +8,15 @@ * Description: 暂无 ***********************************************************************/ +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Threading.Tasks; using CoreCms.Net.IRepository; using CoreCms.Net.IRepository.UnitOfWork; using CoreCms.Net.Model.Entities; +using CoreCms.Net.Model.ViewModels.Basics; +using SqlSugar; namespace CoreCms.Net.Repository { @@ -23,5 +29,81 @@ namespace CoreCms.Net.Repository public CoreCmsUserServicesOrderRepository(IUnitOfWork unitOfWork) : base(unitOfWork) { } + + + + #region 重写根据条件查询分页数据 + /// + /// 重写根据条件查询分页数据 + /// + /// 判断集合 + /// 排序方式 + /// 当前页面索引 + /// 分布大小 + /// + /// 是否使用WITH(NOLOCK) + /// + public new async Task> QueryPageAsync(Expression> predicate, + Expression> orderByExpression, OrderByType orderByType, int pageIndex = 1, + int pageSize = 20, bool blUseNoLock = false) + { + RefAsync totalCount = 0; + List page; + if (blUseNoLock) + { + page = await DbClient.Queryable((sOrder, sUser, sService) => new JoinQueryInfos( + JoinType.Left, sOrder.userId == sUser.id, JoinType.Left, sOrder.servicesId == sService.id)) + .Select((sOrder, sUser, sService) => new CoreCmsUserServicesOrder + { + id = sOrder.id, + serviceOrderId = sOrder.serviceOrderId, + userId = sOrder.userId, + servicesId = sOrder.servicesId, + isPay = sOrder.isPay, + payTime = sOrder.payTime, + paymentId = sOrder.paymentId, + status = sOrder.status, + createTime = sOrder.createTime, + servicesEndTime = sOrder.servicesEndTime, + serviceTitle = sService.title, + userName = sUser.nickName + }) + .With(SqlWith.NoLock) + .MergeTable() + .OrderByIF(orderByExpression != null, orderByExpression, orderByType) + .WhereIF(predicate != null, predicate) + .ToPageListAsync(pageIndex, pageSize, totalCount); + } + else + { + page = await DbClient.Queryable((sOrder, sUser, sService) => new JoinQueryInfos( + JoinType.Left, sOrder.userId == sUser.id, JoinType.Left, sOrder.servicesId == sService.id)) + .Select((sOrder, sUser, sService) => new CoreCmsUserServicesOrder + { + id = sOrder.id, + serviceOrderId = sOrder.serviceOrderId, + userId = sOrder.userId, + servicesId = sOrder.servicesId, + isPay = sOrder.isPay, + payTime = sOrder.payTime, + paymentId = sOrder.paymentId, + status = sOrder.status, + createTime = sOrder.createTime, + servicesEndTime = sOrder.servicesEndTime, + serviceTitle = sService.title, + userName = sUser.nickName + }) + .MergeTable() + .OrderByIF(orderByExpression != null, orderByExpression, orderByType) + .WhereIF(predicate != null, predicate) + .ToPageListAsync(pageIndex, pageSize, totalCount); + } + var list = new PageList(page, pageIndex, pageSize, totalCount); + return list; + } + + #endregion + + } } \ No newline at end of file diff --git a/CoreCms.Net.Repository/Service/CoreCmsUserServicesTicketRepository.cs b/CoreCms.Net.Repository/Service/CoreCmsUserServicesTicketRepository.cs index dce63fb7..46603d6c 100644 --- a/CoreCms.Net.Repository/Service/CoreCmsUserServicesTicketRepository.cs +++ b/CoreCms.Net.Repository/Service/CoreCmsUserServicesTicketRepository.cs @@ -8,9 +8,15 @@ * Description: 暂无 ***********************************************************************/ +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Threading.Tasks; using CoreCms.Net.IRepository; using CoreCms.Net.IRepository.UnitOfWork; using CoreCms.Net.Model.Entities; +using CoreCms.Net.Model.ViewModels.Basics; +using SqlSugar; namespace CoreCms.Net.Repository { @@ -23,5 +29,76 @@ namespace CoreCms.Net.Repository public CoreCmsUserServicesTicketRepository(IUnitOfWork unitOfWork) : base(unitOfWork) { } + + + + #region 重写根据条件查询分页数据 + /// + /// 重写根据条件查询分页数据 + /// + /// 判断集合 + /// 排序方式 + /// 当前页面索引 + /// 分布大小 + /// + /// 是否使用WITH(NOLOCK) + /// + public new async Task> QueryPageAsync(Expression> predicate, + Expression> orderByExpression, OrderByType orderByType, int pageIndex = 1, + int pageSize = 20, bool blUseNoLock = false) + { + RefAsync totalCount = 0; + List page; + if (blUseNoLock) + { + page = await DbClient.Queryable() + .OrderByIF(orderByExpression != null, orderByExpression, orderByType) + .WhereIF(predicate != null, predicate).Select(p => new CoreCmsUserServicesTicket + { + id = p.id, + serviceOrderId = p.serviceOrderId, + securityCode = p.securityCode, + redeemCode = p.redeemCode, + serviceId = p.serviceId, + userId = p.userId, + status = p.status, + validityType = p.validityType, + validityStartTime = p.validityStartTime, + validityEndTime = p.validityEndTime, + createTime = p.createTime, + isVerification = p.isVerification, + verificationTime = p.verificationTime, + + }).With(SqlWith.NoLock).ToPageListAsync(pageIndex, pageSize, totalCount); + } + else + { + page = await DbClient.Queryable() + .OrderByIF(orderByExpression != null, orderByExpression, orderByType) + .WhereIF(predicate != null, predicate).Select(p => new CoreCmsUserServicesTicket + { + id = p.id, + serviceOrderId = p.serviceOrderId, + securityCode = p.securityCode, + redeemCode = p.redeemCode, + serviceId = p.serviceId, + userId = p.userId, + status = p.status, + validityType = p.validityType, + validityStartTime = p.validityStartTime, + validityEndTime = p.validityEndTime, + createTime = p.createTime, + isVerification = p.isVerification, + verificationTime = p.verificationTime, + + }).ToPageListAsync(pageIndex, pageSize, totalCount); + } + var list = new PageList(page, pageIndex, pageSize, totalCount); + return list; + } + + #endregion + + } } \ No newline at end of file diff --git a/CoreCms.Net.Repository/Solitaire/CoreCmsSolitaireItemsRepository.cs b/CoreCms.Net.Repository/Solitaire/CoreCmsSolitaireItemsRepository.cs new file mode 100644 index 00000000..984b93a0 --- /dev/null +++ b/CoreCms.Net.Repository/Solitaire/CoreCmsSolitaireItemsRepository.cs @@ -0,0 +1,313 @@ +/*********************************************************************** + * Project: CoreCms + * ProjectName: 核心内容管理系统 + * Web: https://www.corecms.net + * Author: 大灰灰 + * Email: jianweie@163.com + * CreateTime: 2021/6/19 23:42:28 + * Description: 暂无 + ***********************************************************************/ + +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Threading.Tasks; +using CoreCms.Net.Caching.Manual; +using CoreCms.Net.Configuration; +using CoreCms.Net.Model.Entities; +using CoreCms.Net.IRepository; +using CoreCms.Net.IRepository.UnitOfWork; +using CoreCms.Net.Model.ViewModels.Basics; +using CoreCms.Net.Model.ViewModels.UI; +using SqlSugar; + +namespace CoreCms.Net.Repository +{ + /// + /// 接龙活动商品表 接口实现 + /// + public class CoreCmsSolitaireItemsRepository : BaseRepository, ICoreCmsSolitaireItemsRepository + { + public CoreCmsSolitaireItemsRepository(IUnitOfWork unitOfWork) : base(unitOfWork) + { + } + + #region 实现重写增删改查操作========================================================== + + /// + /// 重写异步插入方法 + /// + /// 实体数据 + /// + public new async Task InsertAsync(CoreCmsSolitaireItems 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; + if (bl) + { + await UpdateCaChe(); + } + + return jm; + } + + /// + /// 重写异步更新方法 + /// + /// + /// + public new async Task UpdateAsync(CoreCmsSolitaireItems entity) + { + var jm = new AdminUiCallBack(); + + var oldModel = await DbClient.Queryable().In(entity.id).SingleAsync(); + if (oldModel == null) + { + jm.msg = "不存在此信息"; + return jm; + } + //事物处理过程开始 + oldModel.id = entity.id; + oldModel.solitaireId = entity.solitaireId; + oldModel.goodId = entity.goodId; + oldModel.productId = entity.productId; + oldModel.price = entity.price; + oldModel.activityStock = entity.activityStock; + oldModel.oneCanBuy = entity.oneCanBuy; + oldModel.isDelete = entity.isDelete; + + //事物处理过程结束 + 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; + } + + /// + /// 重写异步更新方法 + /// + /// + /// + public new async Task UpdateAsync(List 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; + } + + /// + /// 重写删除指定ID的数据 + /// + /// + /// + public new async Task DeleteByIdAsync(object id) + { + var jm = new AdminUiCallBack(); + + var bl = await DbClient.Deleteable(id).ExecuteCommandHasChangeAsync(); + jm.code = bl ? 0 : 1; + jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure; + if (bl) + { + await UpdateCaChe(); + } + + return jm; + } + + /// + /// 重写删除指定ID集合的数据(批量删除) + /// + /// + /// + public new async Task DeleteByIdsAsync(int[] ids) + { + var jm = new AdminUiCallBack(); + + var bl = await DbClient.Deleteable().In(ids).ExecuteCommandHasChangeAsync(); + jm.code = bl ? 0 : 1; + jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure; + if (bl) + { + await UpdateCaChe(); + } + + return jm; + } + + #endregion + + #region 获取缓存的所有数据========================================================== + + /// + /// 获取缓存的所有数据 + /// + /// + public async Task> GetCaChe() + { + var cache = ManualDataCache.Instance.Get>(GlobalConstVars.CacheCoreCmsSolitaireItems); + if (cache != null) + { + return cache; + } + return await UpdateCaChe(); + } + + /// + /// 更新cache + /// + public async Task> UpdateCaChe() + { + var list = await DbClient.Queryable().With(SqlWith.NoLock).ToListAsync(); + ManualDataCache.Instance.Set(GlobalConstVars.CacheCoreCmsSolitaireItems, list); + return list; + } + + #endregion + + + #region 重写根据条件查询列表数据 + /// + /// 重写根据条件查询列表数据 + /// + /// 判断集合 + /// 排序方式 + /// + /// 是否使用WITH(NOLOCK) + /// + public new async Task> QueryListByClauseAsync(Expression> predicate, + Expression> orderByExpression, OrderByType orderByType, bool blUseNoLock = false) + { + List list; + if (blUseNoLock) + { + list = await DbClient.Queryable() + .OrderByIF(orderByExpression != null, orderByExpression, orderByType) + .WhereIF(predicate != null, predicate).Select(p => new CoreCmsSolitaireItems + { + id = p.id, + solitaireId = p.solitaireId, + goodId = p.goodId, + productId = p.productId, + price = p.price, + activityStock = p.activityStock, + oneCanBuy = p.oneCanBuy, + sortId = p.sortId, + isDelete = p.isDelete, + }) + .With(SqlWith.NoLock) + .MergeTable() + .Mapper(it => it.productObj, it => it.productId) + .Mapper(it => it.goodObj, it => it.goodId) + .ToListAsync(); + } + else + { + list = await DbClient.Queryable() + .OrderByIF(orderByExpression != null, orderByExpression, orderByType) + .WhereIF(predicate != null, predicate).Select(p => new CoreCmsSolitaireItems + { + id = p.id, + solitaireId = p.solitaireId, + goodId = p.goodId, + productId = p.productId, + price = p.price, + activityStock = p.activityStock, + oneCanBuy = p.oneCanBuy, + sortId = p.sortId, + isDelete = p.isDelete, + + }) + .Mapper(it => it.productObj, it => it.productId) + .Mapper(it => it.goodObj, it => it.goodId) + .ToListAsync(); + } + return list; + } + + #endregion + + + + #region 重写根据条件查询分页数据 + /// + /// 重写根据条件查询分页数据 + /// + /// 判断集合 + /// 排序方式 + /// 当前页面索引 + /// 分布大小 + /// + /// 是否使用WITH(NOLOCK) + /// + public new async Task> QueryPageAsync(Expression> predicate, + Expression> orderByExpression, OrderByType orderByType, int pageIndex = 1, + int pageSize = 20, bool blUseNoLock = false) + { + RefAsync totalCount = 0; + List page; + if (blUseNoLock) + { + page = await DbClient.Queryable() + .OrderByIF(orderByExpression != null, orderByExpression, orderByType) + .WhereIF(predicate != null, predicate).Select(p => new CoreCmsSolitaireItems + { + id = p.id, + solitaireId = p.solitaireId, + goodId = p.goodId, + productId = p.productId, + price = p.price, + activityStock = p.activityStock, + oneCanBuy = p.oneCanBuy, + sortId = p.sortId, + isDelete = p.isDelete, + + }) + .With(SqlWith.NoLock) + .Mapper(it => it.productObj, it => it.productId) + .ToPageListAsync(pageIndex, pageSize, totalCount); + } + else + { + page = await DbClient.Queryable() + .OrderByIF(orderByExpression != null, orderByExpression, orderByType) + .WhereIF(predicate != null, predicate).Select(p => new CoreCmsSolitaireItems + { + id = p.id, + solitaireId = p.solitaireId, + goodId = p.goodId, + productId = p.productId, + price = p.price, + activityStock = p.activityStock, + oneCanBuy = p.oneCanBuy, + sortId = p.sortId, + isDelete = p.isDelete, + + }) + .Mapper(it => it.productObj, it => it.productId) + .ToPageListAsync(pageIndex, pageSize, totalCount); + } + var list = new PageList(page, pageIndex, pageSize, totalCount); + return list; + } + + #endregion + + } +} diff --git a/CoreCms.Net.Repository/Solitaire/CoreCmsSolitaireRepository.cs b/CoreCms.Net.Repository/Solitaire/CoreCmsSolitaireRepository.cs new file mode 100644 index 00000000..39b49d3e --- /dev/null +++ b/CoreCms.Net.Repository/Solitaire/CoreCmsSolitaireRepository.cs @@ -0,0 +1,488 @@ +/*********************************************************************** + * Project: CoreCms + * ProjectName: 核心内容管理系统 + * Web: https://www.corecms.net + * Author: 大灰灰 + * Email: jianweie@163.com + * CreateTime: 2021/6/14 23:17:57 + * Description: 暂无 + ***********************************************************************/ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Linq.Expressions; +using System.Threading.Tasks; +using CoreCms.Net.Caching.Manual; +using CoreCms.Net.Configuration; +using CoreCms.Net.Model.Entities; +using CoreCms.Net.IRepository; +using CoreCms.Net.IRepository.UnitOfWork; +using CoreCms.Net.Model.ViewModels.Basics; +using CoreCms.Net.Model.ViewModels.DTO; +using CoreCms.Net.Model.ViewModels.UI; +using SqlSugar; + +namespace CoreCms.Net.Repository +{ + /// + /// 接龙活动表 接口实现 + /// + public class CoreCmsSolitaireRepository : BaseRepository, ICoreCmsSolitaireRepository + { + private readonly IUnitOfWork _unitOfWork; + + public CoreCmsSolitaireRepository(IUnitOfWork unitOfWork) : base(unitOfWork) + { + _unitOfWork = unitOfWork; + } + + #region 实现重写增删改查操作========================================================== + + /// + /// 重写异步插入方法 + /// + /// 实体数据 + /// + public new async Task InsertAsync(CoreCmsSolitaire entity) + { + var jm = new AdminUiCallBack(); + + if (entity.status != (int)GlobalEnumVars.SolitaireStatus.Close && entity.status != (int)GlobalEnumVars.SolitaireStatus.Open) + { + jm.msg = "请设置活动状态"; + return jm; + } + if (entity.endTime < entity.startTime) + { + jm.msg = "活动开始时间不能大于结束时间"; + return jm; + } + if (entity.items == null || entity.items.Count <= 0) + { + jm.msg = "请设置商品sku"; + return jm; + } + var bl = false; + try + { + _unitOfWork.BeginTran(); + + entity.createTime = DateTime.Now; + + var id = await DbClient.Insertable(entity).ExecuteReturnIdentityAsync(); + if (id > 0) + { + entity.items.ForEach(p => + { + p.solitaireId = id; + }); + } + await DbClient.Insertable(entity.items).ExecuteCommandAsync(); + + _unitOfWork.CommitTran(); + bl = true; + } + catch (Exception e) + { + bl = false; + _unitOfWork.RollbackTran(); + jm.msg = GlobalConstVars.DataHandleEx; + jm.data = e; + } + + jm.code = bl ? 0 : 1; + jm.msg = bl ? GlobalConstVars.CreateSuccess : GlobalConstVars.CreateFailure; + if (bl) + { + await UpdateCaChe(); + } + return jm; + } + + /// + /// 重写异步更新方法 + /// + /// + /// + public new async Task UpdateAsync(CoreCmsSolitaire entity) + { + var jm = new AdminUiCallBack(); + + if (entity.status != (int)GlobalEnumVars.SolitaireStatus.Close && entity.status != (int)GlobalEnumVars.SolitaireStatus.Open) + { + jm.msg = "请设置活动状态"; + return jm; + } + if (entity.endTime < entity.startTime) + { + jm.msg = "活动开始时间不能大于结束时间"; + return jm; + } + if (entity.items == null || entity.items.Count <= 0) + { + jm.msg = "请设置商品sku"; + return jm; + } + + var oldModel = await DbClient.Queryable().In(entity.id).SingleAsync(); + if (oldModel == null) + { + jm.msg = "不存在此信息"; + return jm; + } + + var bl = false; + try + { + _unitOfWork.BeginTran(); + + //事物处理过程开始 + //oldModel.id = entity.id; + oldModel.title = entity.title; + oldModel.description = entity.description; + oldModel.contentBody = entity.contentBody; + oldModel.startTime = entity.startTime; + oldModel.endTime = entity.endTime; + oldModel.startBuyPrice = entity.startBuyPrice; + oldModel.minDeliveryPrice = entity.minDeliveryPrice; + oldModel.isShow = entity.isShow; + oldModel.status = entity.status; + oldModel.thumbnail = entity.thumbnail; + + //oldModel.isDelete = entity.isDelete; + //oldModel.createTime = entity.createTime; + + await DbClient.Updateable(oldModel).ExecuteCommandHasChangeAsync(); + + //获取数据库存在的数据 + var oldList = await DbClient.Queryable().Where(p => p.solitaireId == oldModel.id && p.isDelete == false).ToListAsync(); + var oldProductIds = oldList.Select(p => p.productId).ToList(); + + //获取提交的数据有货品序列 + var newProductIds = entity.items.Select(p => p.productId).ToList(); + + //标记已经不存在新数据里面的货品数据为假删除状态 + await DbClient.Updateable(p => p.isDelete == true) + .Where(p => !newProductIds.Contains(p.productId) && p.solitaireId == oldModel.id && p.isDelete == false) + .ExecuteCommandAsync(); + + //获取老数据并进行更新 + var oldItems = oldList.Where(p => newProductIds.Contains(p.productId)).ToList(); + if (oldItems.Any()) + { + oldItems.ForEach(o => + { + var newOne = entity.items.Find(p => p.productId == o.productId); + o.price = newOne.price; + o.activityStock = newOne.activityStock; + o.oneCanBuy = newOne.oneCanBuy; + o.sortId = newOne.sortId; + }); + await DbClient.Updateable(oldItems).ExecuteCommandAsync(); + } + + //获取新数据并进行增加 + var newItems = entity.items.Where(p => !oldProductIds.Contains(p.productId)).ToList(); + if (newItems.Any()) + { + var newList = new List(); + newItems.ForEach(p => + { + newList.Add(new CoreCmsSolitaireItems() + { + solitaireId = oldModel.id, + goodId = p.goodId, + productId = p.productId, + price = p.price, + activityStock = p.activityStock, + oneCanBuy = p.oneCanBuy, + sortId = p.sortId, + isDelete = false, + }); + }); + await DbClient.Insertable(newList).ExecuteCommandAsync(); + } + //事物处理过程结束 + _unitOfWork.CommitTran(); + bl = true; + + } + catch (Exception e) + { + bl = false; + _unitOfWork.RollbackTran(); + jm.msg = GlobalConstVars.DataHandleEx; + jm.data = e; + } + jm.code = bl ? 0 : 1; + jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure; + if (bl) + { + await UpdateCaChe(); + } + + return jm; + } + + /// + /// 重写异步更新方法 + /// + /// + /// + public new async Task UpdateAsync(List 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; + } + + /// + /// 重写删除指定ID的数据 + /// + /// + /// + public new async Task DeleteByIdAsync(object id) + { + var jm = new AdminUiCallBack(); + + var bl = await DbClient.Deleteable(id).ExecuteCommandHasChangeAsync(); + jm.code = bl ? 0 : 1; + jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure; + if (bl) + { + await UpdateCaChe(); + } + + return jm; + } + + /// + /// 重写删除指定ID集合的数据(批量删除) + /// + /// + /// + public new async Task DeleteByIdsAsync(int[] ids) + { + var jm = new AdminUiCallBack(); + + var bl = await DbClient.Deleteable().In(ids).ExecuteCommandHasChangeAsync(); + jm.code = bl ? 0 : 1; + jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure; + if (bl) + { + await UpdateCaChe(); + } + + return jm; + } + + #endregion + + #region 获取缓存的所有数据========================================================== + + /// + /// 获取缓存的所有数据 + /// + /// + public async Task> GetCaChe() + { + var cache = ManualDataCache.Instance.Get>(GlobalConstVars.CacheCoreCmsSolitaire); + if (cache != null) + { + return cache; + } + return await UpdateCaChe(); + } + + /// + /// 更新cache + /// + public async Task> UpdateCaChe() + { + var list = await DbClient.Queryable().With(SqlWith.NoLock).ToListAsync(); + ManualDataCache.Instance.Set(GlobalConstVars.CacheCoreCmsSolitaire, list); + return list; + } + + #endregion + + + #region 重写根据条件查询分页数据 + /// + /// 重写根据条件查询分页数据 + /// + /// 判断集合 + /// 排序方式 + /// 当前页面索引 + /// 分布大小 + /// + /// 是否使用WITH(NOLOCK) + /// + public new async Task> QueryPageAsync(Expression> predicate, + Expression> orderByExpression, OrderByType orderByType, int pageIndex = 1, + int pageSize = 20, bool blUseNoLock = false) + { + RefAsync totalCount = 0; + List page; + if (blUseNoLock) + { + page = await DbClient.Queryable() + .OrderByIF(orderByExpression != null, orderByExpression, orderByType) + .WhereIF(predicate != null, predicate).Select(p => new CoreCmsSolitaire + { + id = p.id, + title = p.title, + thumbnail = p.thumbnail, + description = p.description, + //contentBody = p.contentBody, + startTime = p.startTime, + endTime = p.endTime, + startBuyPrice = p.startBuyPrice, + minDeliveryPrice = p.minDeliveryPrice, + isShow = p.isShow, + status = p.status, + isDelete = p.isDelete, + createTime = p.createTime, + + }).With(SqlWith.NoLock).ToPageListAsync(pageIndex, pageSize, totalCount); + } + else + { + page = await DbClient.Queryable() + .OrderByIF(orderByExpression != null, orderByExpression, orderByType) + .WhereIF(predicate != null, predicate).Select(p => new CoreCmsSolitaire + { + id = p.id, + title = p.title, + thumbnail = p.thumbnail, + description = p.description, + //contentBody = p.contentBody, + startTime = p.startTime, + endTime = p.endTime, + startBuyPrice = p.startBuyPrice, + minDeliveryPrice = p.minDeliveryPrice, + isShow = p.isShow, + status = p.status, + isDelete = p.isDelete, + createTime = p.createTime, + + }).ToPageListAsync(pageIndex, pageSize, totalCount); + } + var list = new PageList(page, pageIndex, pageSize, totalCount); + return list; + } + + #endregion + + #region 取购物车数据的时候,更新价格 + + /// + /// 取购物车数据的时候,更新价格 + /// + /// + /// + /// + public async Task SolitaireInfo(int objectId, List list) + { + var res = new WebApiCallBack(); + + var solitaire = await DbClient.Queryable().FirstAsync(p => p.id == objectId); + if (solitaire == null) + { + res.data = 21001; + res.msg = GlobalErrorCodeVars.Code21001; + return res; + } + var dt = DateTime.Now; + if (solitaire.startTime > dt) + { + res.data = 21002; + res.msg = GlobalErrorCodeVars.Code21002; + return res; + } + if (solitaire.endTime < dt) + { + res.data = 21003; + res.msg = GlobalErrorCodeVars.Code21003; + return res; + } + + var items = await DbClient.Queryable().Where(p => p.solitaireId == objectId && p.isDelete == false).ToListAsync(); + if (!items.Any()) + { + res.data = 21004; + res.msg = GlobalErrorCodeVars.Code21004; + return res; + } + foreach (var item in list) + { + var sku = items.Find(p => p.productId == item.productId); + if (sku == null) + { + res.data = 21005; + res.msg = GlobalErrorCodeVars.Code21005; + return res; + } + else + { + item.products.price = sku.price; + if (item.products.price < 0) + { + res.data = 21006; + res.msg = GlobalErrorCodeVars.Code21006; + return res; + } + } + } + res.status = true; + res.data = list; + return res; + } + + #endregion + + + #region 获取接龙购买用户记录 + /// + /// 获取接龙购买用户记录 + /// + /// + /// + public async Task GetBuyRecord(int id) + { + var jm = new WebApiCallBack() { status = true }; + var orderType = (int)GlobalEnumVars.OrderType.Solitaire; + var list = await DbClient.Queryable() + .LeftJoin((sOrder, sUser) => sOrder.userId == sUser.id) + .LeftJoin((sOrder, sUser, sOrderItem) => sOrder.orderId == sOrderItem.orderId) + .Where(sOrder => sOrder.orderType == orderType && sOrder.payStatus == 2 && sOrder.objectId == id) + .OrderBy(sOrder => sOrder.createTime, OrderByType.Desc) + .Select((sOrder, sUser, sOrderItem) => new + { + sUser.avatarImage, + sUser.nickName, + create = sOrder.createTime, + productName = sOrderItem.name, + productSku = sOrderItem.addon, + sOrderItem.nums + }) + .ToListAsync(); + jm.data = list; + return jm; + } + + + + #endregion + + } +} diff --git a/CoreCms.Net.Services/Bill/CoreCmsBillDeliveryServices.cs b/CoreCms.Net.Services/Bill/CoreCmsBillDeliveryServices.cs index c79c1205..bbd7c942 100644 --- a/CoreCms.Net.Services/Bill/CoreCmsBillDeliveryServices.cs +++ b/CoreCms.Net.Services/Bill/CoreCmsBillDeliveryServices.cs @@ -405,7 +405,7 @@ namespace CoreCms.Net.Services var sLog = new CoreCmsStockLog { stockId = deliveryInfo.deliveryId, - productId = item.id, + productId = item.productId, goodsId = item.goodsId, nums = -sendNum, sn = item.sn, diff --git a/CoreCms.Net.Services/Cart/CoreCmsCartServices.cs b/CoreCms.Net.Services/Cart/CoreCmsCartServices.cs index 6fd7f679..eb96d110 100644 --- a/CoreCms.Net.Services/Cart/CoreCmsCartServices.cs +++ b/CoreCms.Net.Services/Cart/CoreCmsCartServices.cs @@ -54,6 +54,8 @@ namespace CoreCms.Net.Services private readonly ICoreCmsPinTuanRecordServices _pinTuanRecordServices; private readonly ICoreCmsGoodsServices _goodsServices; private readonly ICoreCmsGoodsCategoryServices _goodsCategoryServices; + private readonly ICoreCmsSolitaireServices _solitaireServices; + public CoreCmsCartServices( ICoreCmsCartRepository dal @@ -66,7 +68,7 @@ namespace CoreCms.Net.Services , ICoreCmsUserServices userServices , ICoreCmsSettingServices settingServices , ICoreCmsProductsServices productsServices - , ICoreCmsPinTuanGoodsServices pinTuanGoodsServices, ICoreCmsPromotionConditionServices promotionConditionServices, ICoreCmsGoodsServices goodsServices, ICoreCmsGoodsCategoryServices goodsCategoryServices, ICoreCmsPromotionResultServices promotionResultServices, ICoreCmsPinTuanRecordServices pinTuanRecordServices) + , ICoreCmsPinTuanGoodsServices pinTuanGoodsServices, ICoreCmsPromotionConditionServices promotionConditionServices, ICoreCmsGoodsServices goodsServices, ICoreCmsGoodsCategoryServices goodsCategoryServices, ICoreCmsPromotionResultServices promotionResultServices, ICoreCmsPinTuanRecordServices pinTuanRecordServices, ICoreCmsSolitaireServices solitaireServices) { this._dal = dal; base.BaseDal = dal; @@ -86,6 +88,7 @@ namespace CoreCms.Net.Services _goodsCategoryServices = goodsCategoryServices; _promotionResultServices = promotionResultServices; _pinTuanRecordServices = pinTuanRecordServices; + _solitaireServices = solitaireServices; } #region 设置购物车商品数量==================================================== @@ -501,6 +504,16 @@ namespace CoreCms.Net.Services break; case (int)GlobalEnumVars.OrderType.Solitaire: //接龙模式,去获取接龙商品价格。 + var solitaireInfo = await _solitaireServices.SolitaireInfo(objectId, cartDto.list); + if (solitaireInfo.status) + { + cartDto.list = solitaireInfo.data as List; + } + else + { + return solitaireInfo; + } + break; break; default: diff --git a/CoreCms.Net.Services/CoreCms.Net.Services.csproj b/CoreCms.Net.Services/CoreCms.Net.Services.csproj index 1689db4a..28119fcb 100644 --- a/CoreCms.Net.Services/CoreCms.Net.Services.csproj +++ b/CoreCms.Net.Services/CoreCms.Net.Services.csproj @@ -17,7 +17,7 @@ - + diff --git a/CoreCms.Net.Services/Good/CoreCmsGoodsServices.cs b/CoreCms.Net.Services/Good/CoreCmsGoodsServices.cs index 5e3dac38..c6ca0960 100644 --- a/CoreCms.Net.Services/Good/CoreCmsGoodsServices.cs +++ b/CoreCms.Net.Services/Good/CoreCmsGoodsServices.cs @@ -667,6 +667,23 @@ namespace CoreCms.Net.Services } + /// + /// 根据条件查询商品及sku分页数据 + /// + /// 判断集合 + /// 排序方式 + /// 当前页面索引 + /// 分布大小 + /// + /// 是否使用WITH(NOLOCK) + /// + public async Task> QueryGoodAndSkuPageAsync(Expression> predicate, + Expression> orderByExpression, OrderByType orderByType, int pageIndex = 1, + int pageSize = 20, bool blUseNoLock = false) + { + return await _dal.QueryGoodAndSkuPageAsync(predicate, orderByExpression, orderByType, pageIndex, pageSize, blUseNoLock); + } + #region 获取下拉商品数据 /// /// 获取下拉商品数据 diff --git a/CoreCms.Net.Services/Order/CoreCmsOrderServices.cs b/CoreCms.Net.Services/Order/CoreCmsOrderServices.cs index 3a663dc4..0c1d22d8 100644 --- a/CoreCms.Net.Services/Order/CoreCmsOrderServices.cs +++ b/CoreCms.Net.Services/Order/CoreCmsOrderServices.cs @@ -624,8 +624,10 @@ namespace CoreCms.Net.Services if (!string.IsNullOrEmpty(p.promotionList)) { var jobj = JObject.Parse(p.promotionList); - var v = jobj.Values().First(); - p.promotionObj = v; + if (jobj.Values().Any()) + { + p.promotionObj = jobj.Values().FirstOrDefault(); + } } }); } diff --git a/CoreCms.Net.Services/Service/CoreCmsUserServicesOrderServices.cs b/CoreCms.Net.Services/Service/CoreCmsUserServicesOrderServices.cs index 48c34f96..9077cdf5 100644 --- a/CoreCms.Net.Services/Service/CoreCmsUserServicesOrderServices.cs +++ b/CoreCms.Net.Services/Service/CoreCmsUserServicesOrderServices.cs @@ -10,15 +10,18 @@ using System; using System.Collections.Generic; +using System.Linq.Expressions; using System.Threading.Tasks; using CoreCms.Net.Configuration; using CoreCms.Net.IRepository; using CoreCms.Net.IRepository.UnitOfWork; using CoreCms.Net.IServices; using CoreCms.Net.Model.Entities; +using CoreCms.Net.Model.ViewModels.Basics; using CoreCms.Net.Model.ViewModels.UI; using CoreCms.Net.Utility.Helper; using Microsoft.Extensions.DependencyInjection; +using SqlSugar; namespace CoreCms.Net.Services @@ -105,5 +108,27 @@ namespace CoreCms.Net.Services return jm; } + + + + #region 重写根据条件查询分页数据 + /// + /// 重写根据条件查询分页数据 + /// + /// 判断集合 + /// 排序方式 + /// 当前页面索引 + /// 分布大小 + /// + /// 是否使用WITH(NOLOCK) + /// + public new async Task> QueryPageAsync(Expression> predicate, + Expression> orderByExpression, OrderByType orderByType, int pageIndex = 1, + int pageSize = 20, bool blUseNoLock = false) + { + return await _dal.QueryPageAsync(predicate, orderByExpression, orderByType, pageIndex, pageSize, blUseNoLock); + } + #endregion + } } diff --git a/CoreCms.Net.Services/Service/CoreCmsUserServicesTicketServices.cs b/CoreCms.Net.Services/Service/CoreCmsUserServicesTicketServices.cs index 26c0e8f1..a0b10a92 100644 --- a/CoreCms.Net.Services/Service/CoreCmsUserServicesTicketServices.cs +++ b/CoreCms.Net.Services/Service/CoreCmsUserServicesTicketServices.cs @@ -9,13 +9,15 @@ ***********************************************************************/ using System; +using System.Linq.Expressions; using System.Threading.Tasks; using CoreCms.Net.Configuration; using CoreCms.Net.IRepository; using CoreCms.Net.IRepository.UnitOfWork; using CoreCms.Net.IServices; using CoreCms.Net.Model.Entities; -using CoreCms.Net.Model.ViewModels.UI; +using CoreCms.Net.Model.ViewModels.Basics; +using SqlSugar; namespace CoreCms.Net.Services @@ -34,5 +36,26 @@ namespace CoreCms.Net.Services _unitOfWork = unitOfWork; } + + #region 重写根据条件查询分页数据 + /// + /// 重写根据条件查询分页数据 + /// + /// 判断集合 + /// 排序方式 + /// 当前页面索引 + /// 分布大小 + /// + /// 是否使用WITH(NOLOCK) + /// + public new async Task> QueryPageAsync(Expression> predicate, + Expression> orderByExpression, OrderByType orderByType, int pageIndex = 1, + int pageSize = 20, bool blUseNoLock = false) + { + return await _dal.QueryPageAsync(predicate, orderByExpression, orderByType, pageIndex, pageSize, blUseNoLock); + } + #endregion + + } } diff --git a/CoreCms.Net.Services/Share/CoreCmsShareServices.cs b/CoreCms.Net.Services/Share/CoreCmsShareServices.cs index 42ccb794..3409bd5a 100644 --- a/CoreCms.Net.Services/Share/CoreCmsShareServices.cs +++ b/CoreCms.Net.Services/Share/CoreCmsShareServices.cs @@ -38,7 +38,6 @@ using SixLabors.ImageSharp.Processing; using SKIT.FlurlHttpClient.Wechat.Api; using SKIT.FlurlHttpClient.Wechat.Api.Models; - namespace CoreCms.Net.Services { /// @@ -49,9 +48,10 @@ namespace CoreCms.Net.Services private readonly IUnitOfWork _unitOfWork; private readonly IWebHostEnvironment _webHostEnvironment; - public static readonly string AppInterFaceUrl = AppSettingsConstVars.AppConfigAppInterFaceUrl; + private readonly string _appInterFaceUrl = AppSettingsConstVars.AppConfigAppInterFaceUrl; - public readonly ICoreCmsGoodsServices GoodsServices; + private readonly ICoreCmsGoodsServices _goodsServices; + private readonly ICoreCmsSolitaireServices _solitaireServices; private readonly WeChatOptions _weChatOptions; private readonly WeChat.Service.HttpClients.IWeChatApiHttpClientFactory _weChatApiHttpClientFactory; @@ -60,13 +60,14 @@ namespace CoreCms.Net.Services public CoreCmsShareServices(IUnitOfWork unitOfWork , IWebHostEnvironment webHostEnvironment , ICoreCmsGoodsServices goodsServices - , IOptions weChatOptions, IWeChatApiHttpClientFactory weChatApiHttpClientFactory) + , IOptions weChatOptions, IWeChatApiHttpClientFactory weChatApiHttpClientFactory, ICoreCmsSolitaireServices solitaireServices) { _unitOfWork = unitOfWork; _webHostEnvironment = webHostEnvironment; - GoodsServices = goodsServices; + _goodsServices = goodsServices; _weChatApiHttpClientFactory = weChatApiHttpClientFactory; + _solitaireServices = solitaireServices; _weChatOptions = weChatOptions.Value; } @@ -123,14 +124,20 @@ namespace CoreCms.Net.Services /// public async Task PosterShare(int client, int page, int userShareCode, string url, JObject parameter) { + //获取分享代码 var res = GetCode(client, page, userShareCode, url, parameter); if (!res.status) { return res; } //如果不是商品和拼团 - if (page != (int)GlobalEnumVars.UrlSharePageType.PinTuan && page != (int)GlobalEnumVars.UrlSharePageType.Goods && page != (int)GlobalEnumVars.UrlSharePageType.Seckill && page != (int)GlobalEnumVars.UrlSharePageType.Group) + if (page != (int)GlobalEnumVars.UrlSharePageType.PinTuan && + page != (int)GlobalEnumVars.UrlSharePageType.Goods && + page != (int)GlobalEnumVars.UrlSharePageType.Seckill && + page != (int)GlobalEnumVars.UrlSharePageType.Solitaire && + page != (int)GlobalEnumVars.UrlSharePageType.Group) { + //走二维码分享 return await getQr(url, res.otherData.ToString(), client); } //生成海报图片 @@ -196,7 +203,7 @@ namespace CoreCms.Net.Services //有这个二维码了 jm.status = true; jm.msg = "二维码获取成功"; - jm.data = AppInterFaceUrl + fileName; + jm.data = _appInterFaceUrl + fileName; } else { @@ -231,50 +238,22 @@ namespace CoreCms.Net.Services //拼团 if (!string.IsNullOrEmpty(invite)) { - if (!string.IsNullOrEmpty(teamId)) - { - scene = ShareHelper.share_parameter_encode("5", invite, id, teamId); - } - else - { - scene = ShareHelper.share_parameter_encode("5", invite, id, ""); - } + scene = ShareHelper.share_parameter_encode("5", invite, id, !string.IsNullOrEmpty(teamId) ? teamId : ""); } else { - if (!string.IsNullOrEmpty(teamId)) - { - scene = ShareHelper.share_parameter_encode("5", "", id, teamId); - } - else - { - scene = ShareHelper.share_parameter_encode("5", "", id, ""); - } + scene = ShareHelper.share_parameter_encode("5", "", id, !string.IsNullOrEmpty(teamId) ? teamId : ""); } } else if (type == 4) { //店铺首页 - if (!string.IsNullOrEmpty(invite)) - { - scene = ShareHelper.share_parameter_encode("9", invite, id, ""); - } - else - { - scene = ShareHelper.share_parameter_encode("9", "", id, ""); - } + scene = ShareHelper.share_parameter_encode("9", !string.IsNullOrEmpty(invite) ? invite : "", id, ""); } else { //默认首页 - if (!string.IsNullOrEmpty(invite)) - { - scene = ShareHelper.share_parameter_encode("3", invite, "", ""); - } - else - { - scene = ShareHelper.share_parameter_encode("3", "", "", ""); - } + scene = ShareHelper.share_parameter_encode("3", !string.IsNullOrEmpty(invite) ? invite : "", "", ""); } //没有去官方请求生成 @@ -363,7 +342,7 @@ namespace CoreCms.Net.Services { jm.status = true; jm.msg = "二维码获取成功"; - jm.data = AppInterFaceUrl + fileName; + jm.data = _appInterFaceUrl + fileName; jm.otherData = fileNameMin; } else @@ -646,6 +625,17 @@ namespace CoreCms.Net.Services return jm; } break; + case (int)GlobalEnumVars.UrlSharePageType.Solitaire: + if (parameter.ContainsKey("id")) + { + str = parameter["id"]?.ToString(); + } + else + { + jm.msg = "参数必须传id"; + return jm; + } + break; default: jm.msg = GlobalErrorCodeVars.Code10000; return jm; @@ -745,7 +735,7 @@ namespace CoreCms.Net.Services case (int)GlobalEnumVars.UrlSharePageType.Form: if (arr.Length == 1) { - jm.data = new { goodsId = arr[0] }; + jm.data = new { id = arr[0] }; jm.status = true; } break; @@ -778,6 +768,13 @@ namespace CoreCms.Net.Services jm.status = true; } break; + case (int)GlobalEnumVars.UrlSharePageType.Solitaire: + if (arr.Length == 1) + { + jm.data = new { id = arr[0] }; + jm.status = true; + } + break; default: jm.msg = GlobalErrorCodeVars.Code10000; return jm; @@ -814,7 +811,7 @@ namespace CoreCms.Net.Services //有这个二维码了 jm.status = true; jm.msg = "海报获取成功"; - jm.data = AppInterFaceUrl + fileName; + jm.data = _appInterFaceUrl + fileName; } else { @@ -838,7 +835,7 @@ namespace CoreCms.Net.Services { jm.status = true; jm.msg = "海报生成成功"; - jm.data = AppInterFaceUrl + fileName; + jm.data = _appInterFaceUrl + fileName; } jm.otherData = mkResult; } @@ -856,7 +853,6 @@ namespace CoreCms.Net.Services { var fileName = fileNameStr; - //文件硬地址 var savePath = _webHostEnvironment.WebRootPath + "/static/qrCode/weChat/"; var qrCodeDir = _webHostEnvironment.WebRootPath + "/static/qrCode/weChat/" + otherData; @@ -871,7 +867,7 @@ namespace CoreCms.Net.Services } //2商品详情页,3拼团详情页 var page = dataObj["page"].ObjectToInt(0); - if (page == 2 || page == 3) + if (page == (int)GlobalEnumVars.UrlSharePageType.Goods || page == (int)GlobalEnumVars.UrlSharePageType.PinTuan) { if (dataObj.ContainsKey("params")) { @@ -881,20 +877,19 @@ namespace CoreCms.Net.Services return false; } var goodId = paramsObj["goodsId"].ObjectToInt(); - var goodModel = await GoodsServices.GetGoodsDetial(goodId); + var goodModel = await _goodsServices.GetGoodsDetial(goodId); if (goodModel != null) { var images = goodModel.images.Split(","); if (images.Any()) { - var image = images[0]; //创建一个背景宽度为400X600的底图 using var imageTemple = new SixLabors.ImageSharp.Image(400, 600); //设置底图的背景色为白色 imageTemple.Mutate(x => x.BackgroundColor(SixLabors.ImageSharp.Color.White)); //绘制商品图片(网络下载图片) HttpClient client = new HttpClient(); - HttpResponseMessage response = await client.GetAsync(image); + HttpResponseMessage response = await client.GetAsync(goodModel.image); response.EnsureSuccessStatusCode(); var stream = await response.Content.ReadAsStreamAsync(); //载入下载的图片流 @@ -956,9 +951,88 @@ namespace CoreCms.Net.Services } } } + else if (page == (int)GlobalEnumVars.UrlSharePageType.Solitaire) + { + if (dataObj.ContainsKey("params")) + { + var paramsObj = JObject.FromObject(dataObj["params"]); + if (!paramsObj.ContainsKey("id")) + { + return false; + } + var id = paramsObj["id"].ObjectToInt(); + var solitaireModel = await _solitaireServices.QueryByClauseAsync(p => p.id == id); + if (solitaireModel != null && !string.IsNullOrEmpty(solitaireModel.thumbnail)) + { + //创建一个背景宽度为400X600的底图 + using var imageTemple = new SixLabors.ImageSharp.Image(400, 600); + //设置底图的背景色为白色 + imageTemple.Mutate(x => x.BackgroundColor(SixLabors.ImageSharp.Color.White)); + //绘制商品图片(网络下载图片) + HttpClient client = new HttpClient(); + HttpResponseMessage response = await client.GetAsync(solitaireModel.thumbnail); + response.EnsureSuccessStatusCode(); + var stream = await response.Content.ReadAsStreamAsync(); + //载入下载的图片流 + var imageThumbnail = await SixLabors.ImageSharp.Image.LoadAsync(stream); + //将下载的图片压缩至400X400 + imageThumbnail.Mutate(x => + { + x.Resize(400, 400); + }); + //将商品大图合并到背景图上 + imageTemple.Mutate(x => x.DrawImage(imageThumbnail, new SixLabors.ImageSharp.Point(0, 0), 1)); + //将用户的分享二维码合并大背景图上 + var imageQrcode = await SixLabors.ImageSharp.Image.LoadAsync(qrCodeDir); + //将二维码缩略至120X120 + imageQrcode.Mutate(x => + { + x.Resize(120, 120); + }); + //将二维码图片合并到背景图上 + imageTemple.Mutate(x => x.DrawImage(imageQrcode, new SixLabors.ImageSharp.Point(275, 420), 1)); + //构建字体//装载字体(ttf)(而且字体一定要支持简体中文的) + var fonts = new FontCollection(); + SixLabors.Fonts.FontFamily fontFamily = fonts.Install(_webHostEnvironment.WebRootPath + "/fonts/SourceHanSansK-Normal.ttf"); + //绘制商品名称 + SixLabors.Fonts.Font titleFont = new SixLabors.Fonts.Font(fontFamily, 20, SixLabors.Fonts.FontStyle.Regular); + //商品名称可能较长,设置为多行文本输出 + var textOptions = new TextOptions() + { + ApplyKerning = true, + VerticalAlignment = VerticalAlignment.Top, + HorizontalAlignment = HorizontalAlignment.Left, + WrapTextWidth = 230 + }; + var graphicsOptions = new GraphicsOptions() + { + Antialias = true + }; + //沿着行尾的绕行路径绘制文本 + var options = new SixLabors.ImageSharp.Drawing.Processing.DrawingOptions + { + GraphicsOptions = graphicsOptions, + TextOptions = textOptions + }; + //开始绘制商品名称 + imageTemple.Mutate(ctx => ctx.DrawText(options, solitaireModel.title, titleFont, SixLabors.ImageSharp.Color.Red, new SixLabors.ImageSharp.PointF(10, 450))); + //绘制商品金额 + SixLabors.Fonts.Font moneyFont = new SixLabors.Fonts.Font(fontFamily, 18); + //获取该文件绘制所需的大小 + //var size = TextMeasurer.Measure(moneyText, new RendererOptions(moneyFont)); + imageTemple.Mutate(ctx => ctx.DrawText("火热接龙中", moneyFont, SixLabors.ImageSharp.Color.Crimson, new SixLabors.ImageSharp.PointF(10, 410))); + //绘制提示语 + SixLabors.Fonts.Font tipsFont = new SixLabors.Fonts.Font(fontFamily, 10); + imageTemple.Mutate(ctx => ctx.DrawText("扫描或长按识别二维码", tipsFont, SixLabors.ImageSharp.Color.Black, new SixLabors.ImageSharp.PointF(283, 555))); + + //载入流存储在到文件 + await imageTemple.SaveAsync(_webHostEnvironment.WebRootPath + fileName); + + return true; + } + } + } return false; } - - } } diff --git a/CoreCms.Net.Services/Solitaire/CoreCmsSolitaireItemsServices.cs b/CoreCms.Net.Services/Solitaire/CoreCmsSolitaireItemsServices.cs new file mode 100644 index 00000000..df667bd8 --- /dev/null +++ b/CoreCms.Net.Services/Solitaire/CoreCmsSolitaireItemsServices.cs @@ -0,0 +1,154 @@ +/*********************************************************************** + * Project: CoreCms + * ProjectName: 核心内容管理系统 + * Web: https://www.corecms.net + * Author: 大灰灰 + * Email: jianweie@163.com + * CreateTime: 2021/6/14 23:18:18 + * Description: 暂无 + ***********************************************************************/ + +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Threading.Tasks; +using CoreCms.Net.Configuration; +using CoreCms.Net.IRepository; +using CoreCms.Net.IRepository.UnitOfWork; +using CoreCms.Net.IServices; +using CoreCms.Net.Model.Entities; +using CoreCms.Net.Model.ViewModels.Basics; +using CoreCms.Net.Model.ViewModels.UI; +using SqlSugar; + + +namespace CoreCms.Net.Services +{ + /// + /// 接龙活动商品表 接口实现 + /// + public class CoreCmsSolitaireItemsServices : BaseServices, ICoreCmsSolitaireItemsServices + { + private readonly ICoreCmsSolitaireItemsRepository _dal; + private readonly IUnitOfWork _unitOfWork; + + public CoreCmsSolitaireItemsServices(IUnitOfWork unitOfWork, ICoreCmsSolitaireItemsRepository dal) + { + this._dal = dal; + base.BaseDal = dal; + _unitOfWork = unitOfWork; + } + + #region 实现重写增删改查操作========================================================== + + /// + /// 重写异步插入方法 + /// + /// 实体数据 + /// + public new async Task InsertAsync(CoreCmsSolitaireItems entity) + { + return await _dal.InsertAsync(entity); + } + + /// + /// 重写异步更新方法方法 + /// + /// + /// + public new async Task UpdateAsync(CoreCmsSolitaireItems entity) + { + return await _dal.UpdateAsync(entity); + } + + /// + /// 重写异步更新方法方法 + /// + /// + /// + public new async Task UpdateAsync(List entity) + { + return await _dal.UpdateAsync(entity); + } + + /// + /// 重写删除指定ID的数据 + /// + /// + /// + public new async Task DeleteByIdAsync(object id) + { + return await _dal.DeleteByIdAsync(id); + } + + /// + /// 重写删除指定ID集合的数据(批量删除) + /// + /// + /// + public new async Task DeleteByIdsAsync(int[] ids) + { + return await _dal.DeleteByIdsAsync(ids); + } + + #endregion + + #region 获取缓存的所有数据========================================================== + + /// + /// 获取缓存的所有数据 + /// + /// + public async Task> GetCaChe() + { + return await _dal.GetCaChe(); + } + + /// + /// 更新cache + /// + public async Task> UpdateCaChe() + { + return await _dal.UpdateCaChe(); + } + + #endregion + + /// + /// 重写根据条件查询列表数据 + /// + /// 判断集合 + /// 排序方式 + /// + /// 是否使用WITH(NOLOCK) + /// + public new Task> QueryListByClauseAsync( + Expression> predicate, + Expression> orderByExpression, OrderByType orderByType, + bool blUseNoLock = false) + { + return _dal.QueryListByClauseAsync(predicate, orderByExpression, orderByType, blUseNoLock); + } + + + #region 重写根据条件查询分页数据 + /// + /// 重写根据条件查询分页数据 + /// + /// 判断集合 + /// 排序方式 + /// 当前页面索引 + /// 分布大小 + /// + /// 是否使用WITH(NOLOCK) + /// + public new async Task> QueryPageAsync(Expression> predicate, + Expression> orderByExpression, OrderByType orderByType, int pageIndex = 1, + int pageSize = 20, bool blUseNoLock = false) + { + return await _dal.QueryPageAsync(predicate, orderByExpression, orderByType, pageIndex, pageSize, blUseNoLock); + } + #endregion + + } +} diff --git a/CoreCms.Net.Services/Solitaire/CoreCmsSolitaireServices.cs b/CoreCms.Net.Services/Solitaire/CoreCmsSolitaireServices.cs new file mode 100644 index 00000000..2db6ede4 --- /dev/null +++ b/CoreCms.Net.Services/Solitaire/CoreCmsSolitaireServices.cs @@ -0,0 +1,162 @@ +/*********************************************************************** + * Project: CoreCms + * ProjectName: 核心内容管理系统 + * Web: https://www.corecms.net + * Author: 大灰灰 + * Email: jianweie@163.com + * CreateTime: 2021/6/14 23:17:57 + * Description: 暂无 + ***********************************************************************/ + +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Threading.Tasks; +using CoreCms.Net.Configuration; +using CoreCms.Net.IRepository; +using CoreCms.Net.IRepository.UnitOfWork; +using CoreCms.Net.IServices; +using CoreCms.Net.Model.Entities; +using CoreCms.Net.Model.ViewModels.Basics; +using CoreCms.Net.Model.ViewModels.DTO; +using CoreCms.Net.Model.ViewModels.UI; +using SqlSugar; + +namespace CoreCms.Net.Services +{ + /// + /// 接龙活动表 接口实现 + /// + public class CoreCmsSolitaireServices : BaseServices, ICoreCmsSolitaireServices + { + private readonly ICoreCmsSolitaireRepository _dal; + private readonly IUnitOfWork _unitOfWork; + + public CoreCmsSolitaireServices(IUnitOfWork unitOfWork, ICoreCmsSolitaireRepository dal) + { + this._dal = dal; + base.BaseDal = dal; + _unitOfWork = unitOfWork; + } + + #region 实现重写增删改查操作========================================================== + + /// + /// 重写异步插入方法 + /// + /// 实体数据 + /// + public new async Task InsertAsync(CoreCmsSolitaire entity) + { + return await _dal.InsertAsync(entity); + } + + /// + /// 重写异步更新方法方法 + /// + /// + /// + public new async Task UpdateAsync(CoreCmsSolitaire entity) + { + return await _dal.UpdateAsync(entity); + } + + /// + /// 重写异步更新方法方法 + /// + /// + /// + public new async Task UpdateAsync(List entity) + { + return await _dal.UpdateAsync(entity); + } + + /// + /// 重写删除指定ID的数据 + /// + /// + /// + public new async Task DeleteByIdAsync(object id) + { + return await _dal.DeleteByIdAsync(id); + } + + /// + /// 重写删除指定ID集合的数据(批量删除) + /// + /// + /// + public new async Task DeleteByIdsAsync(int[] ids) + { + return await _dal.DeleteByIdsAsync(ids); + } + + #endregion + + #region 获取缓存的所有数据========================================================== + + /// + /// 获取缓存的所有数据 + /// + /// + public async Task> GetCaChe() + { + return await _dal.GetCaChe(); + } + + /// + /// 更新cache + /// + public async Task> UpdateCaChe() + { + return await _dal.UpdateCaChe(); + } + + #endregion + + #region 重写根据条件查询分页数据 + /// + /// 重写根据条件查询分页数据 + /// + /// 判断集合 + /// 排序方式 + /// 当前页面索引 + /// 分布大小 + /// + /// 是否使用WITH(NOLOCK) + /// + public new async Task> QueryPageAsync(Expression> predicate, + Expression> orderByExpression, OrderByType orderByType, int pageIndex = 1, + int pageSize = 20, bool blUseNoLock = false) + { + return await _dal.QueryPageAsync(predicate, orderByExpression, orderByType, pageIndex, pageSize, blUseNoLock); + } + #endregion + + #region 取购物车数据的时候,更新价格 + + /// + /// 取购物车数据的时候,更新价格 + /// + /// + /// + /// + public async Task SolitaireInfo(int objectId, List list) + { + return await _dal.SolitaireInfo(objectId, list); + } + + #endregion + + /// + /// 获取接龙购买用户记录 + /// + /// + /// + public async Task GetBuyRecord(int id) + { + return await _dal.GetBuyRecord(id); + } + + } +} diff --git a/CoreCms.Net.Uni-App/CoreShop/pages.json b/CoreCms.Net.Uni-App/CoreShop/pages.json index 32e03fab..8681a5df 100644 --- a/CoreCms.Net.Uni-App/CoreShop/pages.json +++ b/CoreCms.Net.Uni-App/CoreShop/pages.json @@ -258,6 +258,20 @@ } }, { + "path": "pages/activity/solitaire/list/list", + "style": { + "navigationBarTextStyle": "black", + "navigationBarTitleText": "接龙" + } + }, + { + "path": "pages/activity/solitaire/solitaireDetails/solitaireDetails", + "style": { + "navigationBarTextStyle": "black", + "navigationBarTitleText": "接龙详情" + } + }, + { "path": "pages/template", "style": { "navigationBarTextStyle": "black", diff --git a/CoreCms.Net.Uni-App/CoreShop/pages/activity/solitaire/list/list.vue b/CoreCms.Net.Uni-App/CoreShop/pages/activity/solitaire/list/list.vue new file mode 100644 index 00000000..18651efd --- /dev/null +++ b/CoreCms.Net.Uni-App/CoreShop/pages/activity/solitaire/list/list.vue @@ -0,0 +1,126 @@ + + + + + diff --git a/CoreCms.Net.Uni-App/CoreShop/pages/activity/solitaire/solitaireDetails/solitaireDetails.vue b/CoreCms.Net.Uni-App/CoreShop/pages/activity/solitaire/solitaireDetails/solitaireDetails.vue new file mode 100644 index 00000000..5367d814 --- /dev/null +++ b/CoreCms.Net.Uni-App/CoreShop/pages/activity/solitaire/solitaireDetails/solitaireDetails.vue @@ -0,0 +1,389 @@ + + + + + diff --git a/CoreCms.Net.Uni-App/CoreShop/uni_modules/uview-ui/README.md b/CoreCms.Net.Uni-App/CoreShop/uni_modules/uview-ui/README.md index c3cadd08..31bd594d 100644 --- a/CoreCms.Net.Uni-App/CoreShop/uni_modules/uview-ui/README.md +++ b/CoreCms.Net.Uni-App/CoreShop/uni_modules/uview-ui/README.md @@ -4,12 +4,6 @@

uView

多平台快速开发的UI框架

-## 一起推动uView发展 - -uView正在参与开源中国的“年度最佳项目”评选,目前投票进入了最后一个阶段(之前投过票的现在也可以投票), -我们不分昼夜的努力,恳请同学们能为我们投一票,uView来源于社区,也希望社区能一起推动它的发展,[点此帮助uView](https://www.oschina.net/project/top_cn_2021/?id=583) - - ## 说明 uView UI,是[uni-app](https://uniapp.dcloud.io/)生态优秀的UI框架,全面的组件和便捷的工具会让您信手拈来,如鱼得水 @@ -27,7 +21,7 @@ uView UI,是[uni-app](https://uniapp.dcloud.io/)生态优秀的UI框架,全 ## 安装 ```bash -# npm方式安装 +# npm方式安装,插件市场导入无需执行此命令 npm i uview-ui ``` diff --git a/CoreCms.Net.Uni-App/CoreShop/uni_modules/uview-ui/changelog.md b/CoreCms.Net.Uni-App/CoreShop/uni_modules/uview-ui/changelog.md index 6dd72f64..f79c00ef 100644 --- a/CoreCms.Net.Uni-App/CoreShop/uni_modules/uview-ui/changelog.md +++ b/CoreCms.Net.Uni-App/CoreShop/uni_modules/uview-ui/changelog.md @@ -1,3 +1,21 @@ +## 2.0.20(2022-01-14) +# uView2.0重磅发布,利剑出鞘,一统江湖 + +1. 修复calendar默认会选择一个日期,如果直接点确定的话,无法取到值的问题 +2. 修复Slider缺少disabled props 还有注释 +3. 修复u-notice-bar点击事件无法拿到index索引值的问题 +4. 修复u-collapse-item在vue文件下,app端自定义插槽不生效的问题 +5. 优化头像为空时显示默认头像 +6. 修复图片地址赋值后判断加载状态为完成问题 +7. 修复日历滚动到默认日期月份区域 +8. search组件暴露点击左边icon事件 +9. 修复u-form clearValidate方法不生效 +10. upload h5端增加返回文件参数(文件的name参数) +11. 处理upload选择文件后url为blob类型无法预览的问题 +12. u-code-input 修复输入框没有往左移出一半屏幕 +13. 修复Upload上传 disabled为true时,控制台报hoverClass类型错误 +14. 临时处理ios app下grid点击坍塌问题 +15. 其他修复 ## 2.0.19(2021-12-29) # uView2.0重磅发布,利剑出鞘,一统江湖 diff --git a/CoreCms.Net.Uni-App/CoreShop/uni_modules/uview-ui/components/u-avatar/u-avatar.vue b/CoreCms.Net.Uni-App/CoreShop/uni_modules/uview-ui/components/u-avatar/u-avatar.vue index cd4ea0ff..de4b17ab 100644 --- a/CoreCms.Net.Uni-App/CoreShop/uni_modules/uview-ui/components/u-avatar/u-avatar.vue +++ b/CoreCms.Net.Uni-App/CoreShop/uni_modules/uview-ui/components/u-avatar/u-avatar.vue @@ -7,7 +7,7 @@ width: $u.addUnit(size), height: $u.addUnit(size), }, $u.addStyle(customStyle)]" - @tap.stop="clickHandler" + @tap="clickHandler" > @@ -41,7 +41,7 @@ class="u-avatar__image" v-else :class="[`u-avatar__image--${shape}`]" - :src="avatarUrl" + :src="avatarUrl || defaultUrl" :mode="mode" @error="errorHandler" :style="[{ diff --git a/CoreCms.Net.Uni-App/CoreShop/uni_modules/uview-ui/components/u-calendar/month.vue b/CoreCms.Net.Uni-App/CoreShop/uni_modules/uview-ui/components/u-calendar/month.vue index 05928bcb..c20937fe 100644 --- a/CoreCms.Net.Uni-App/CoreShop/uni_modules/uview-ui/components/u-calendar/month.vue +++ b/CoreCms.Net.Uni-App/CoreShop/uni_modules/uview-ui/components/u-calendar/month.vue @@ -1,7 +1,7 @@