diff --git a/CoreCms.Net.Auth/CoreCms.Net.Auth.csproj b/CoreCms.Net.Auth/CoreCms.Net.Auth.csproj index 7e565cf64c13b7fc984fecce8d4814c5f59937d2..a9a3b2e9af931770ef9a938a4982d25df75cd82a 100644 --- a/CoreCms.Net.Auth/CoreCms.Net.Auth.csproj +++ b/CoreCms.Net.Auth/CoreCms.Net.Auth.csproj @@ -5,9 +5,9 @@ - + - + diff --git a/CoreCms.Net.Caching/CoreCms.Net.Caching.csproj b/CoreCms.Net.Caching/CoreCms.Net.Caching.csproj index c4c6ce0b1c6a856e8412944de0741077ffd7add8..7bf66bc6f11a8e01f2000834cc6df4e77b484289 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 4f3e832778a1cdc9ef769104fac784f1d3383747..b25e41ab7a4fa6136eb933a39005fb4da4b1c64f 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.CodeGenerator/CrudTemplete/Controllers/Controller.tpl b/CoreCms.Net.CodeGenerator/CrudTemplete/Controllers/Controller.tpl index acc2635215ffd212a6e103156d862f7ed865df2f..36cd062956d8e60c05376cfb18a5a9506cd87d2b 100644 --- a/CoreCms.Net.CodeGenerator/CrudTemplete/Controllers/Controller.tpl +++ b/CoreCms.Net.CodeGenerator/CrudTemplete/Controllers/Controller.tpl @@ -41,7 +41,7 @@ namespace CoreCms.Net.Web.Admin.Controllers [ApiController] [RequiredErrorForAdmin] [Authorize] - public class {{ModelClassName}}Controller : Controller + public class {{ModelClassName}}Controller : ControllerBase { private readonly IWebHostEnvironment _webHostEnvironment; private readonly I{{ModelClassName}}Services _{{ModelClassName}}Services; @@ -65,7 +65,7 @@ namespace CoreCms.Net.Web.Admin.Controllers /// [HttpPost] [Description("获取列表")] - public async Task GetPageList() + public async Task GetPageList() { var jm = new AdminUiCallBack(); var pageCurrent = Request.Form["page"].FirstOrDefault().ObjectToInt(1); @@ -149,7 +149,7 @@ namespace CoreCms.Net.Web.Admin.Controllers jm.code = 0; jm.count = list.TotalCount; jm.msg = "数据调用成功!"; - return Json(jm); + return jm; } #endregion @@ -161,11 +161,11 @@ namespace CoreCms.Net.Web.Admin.Controllers /// [HttpPost] [Description("首页数据")] - public JsonResult GetIndex() + public AdminUiCallBack GetIndex() { //返回数据 var jm = new AdminUiCallBack { code = 0 }; - return Json(jm); + return jm; } #endregion @@ -177,11 +177,11 @@ namespace CoreCms.Net.Web.Admin.Controllers /// [HttpPost] [Description("创建数据")] - public JsonResult GetCreate() + public AdminUiCallBack GetCreate() { //返回数据 var jm = new AdminUiCallBack { code = 0 }; - return Json(jm); + return jm; } #endregion @@ -194,10 +194,10 @@ namespace CoreCms.Net.Web.Admin.Controllers /// [HttpPost] [Description("创建提交")] - public async Task DoCreate([FromBody]{{ModelClassName}} entity) + public async Task DoCreate([FromBody]{{ModelClassName}} entity) { var jm = await _{{ModelClassName}}Services.InsertAsync(entity); - return Json(jm); + return jm; } #endregion @@ -210,7 +210,7 @@ namespace CoreCms.Net.Web.Admin.Controllers /// [HttpPost] [Description("编辑数据")] - public async Task GetEdit([FromBody]FMIntId entity) + public async Task GetEdit([FromBody]FMIntId entity) { var jm = new AdminUiCallBack(); @@ -218,12 +218,12 @@ namespace CoreCms.Net.Web.Admin.Controllers if (model == null) { jm.msg = "不存在此信息"; - return Json(jm); + return jm; } jm.code = 0; jm.data = model; - return Json(jm); + return jm; } #endregion @@ -236,10 +236,10 @@ namespace CoreCms.Net.Web.Admin.Controllers /// [HttpPost] [Description("编辑提交")] - public async Task DoEdit([FromBody]{{ModelClassName}} entity) + public async Task DoEdit([FromBody]{{ModelClassName}} entity) { var jm = await _{{ModelClassName}}Services.UpdateAsync(entity); - return Json(jm); + return jm; } #endregion @@ -252,7 +252,7 @@ namespace CoreCms.Net.Web.Admin.Controllers /// [HttpPost] [Description("单选删除")] - public async Task DoDelete([FromBody]FMIntId entity) + public async Task DoDelete([FromBody]FMIntId entity) { var jm = new AdminUiCallBack(); @@ -260,11 +260,11 @@ namespace CoreCms.Net.Web.Admin.Controllers if (!model) { jm.msg = GlobalConstVars.DataisNo; - return Json(jm); + return jm; } jm = await _{{ModelClassName}}Services.DeleteByIdAsync(entity.id); - return Json(jm); + return jm; } #endregion @@ -277,10 +277,10 @@ namespace CoreCms.Net.Web.Admin.Controllers /// [HttpPost] [Description("批量删除")] - public async Task DoBatchDelete([FromBody]FMArrayIntIds entity) + public async Task DoBatchDelete([FromBody]FMArrayIntIds entity) { var jm = await _{{ModelClassName}}Services.DeleteByIdsAsync(entity.id); - return Json(jm); + return jm; } #endregion @@ -294,7 +294,7 @@ namespace CoreCms.Net.Web.Admin.Controllers /// [HttpPost] [Description("预览数据")] - public async Task GetDetails([FromBody]FMIntId entity) + public async Task GetDetails([FromBody]FMIntId entity) { var jm = new AdminUiCallBack(); @@ -302,12 +302,12 @@ namespace CoreCms.Net.Web.Admin.Controllers if (model == null) { jm.msg = "不存在此信息"; - return Json(jm); + return jm; } jm.code = 0; jm.data = model; - return Json(jm); + return jm; } #endregion @@ -320,7 +320,7 @@ namespace CoreCms.Net.Web.Admin.Controllers /// [HttpPost] [Description("选择导出")] - public async Task SelectExportExcel([FromBody]FMArrayIntIds entity) + public async Task SelectExportExcel([FromBody]FMArrayIntIds entity) { var jm = new AdminUiCallBack(); @@ -370,7 +370,7 @@ namespace CoreCms.Net.Web.Admin.Controllers jm.msg = GlobalConstVars.ExcelExportSuccess; jm.data = tpath + fileName; - return Json(jm); + return jm; } #endregion @@ -382,7 +382,7 @@ namespace CoreCms.Net.Web.Admin.Controllers /// [HttpPost] [Description("查询导出")] - public async Task QueryExportExcel() + public async Task QueryExportExcel() { var jm = new AdminUiCallBack(); @@ -474,7 +474,7 @@ namespace CoreCms.Net.Web.Admin.Controllers jm.msg = GlobalConstVars.ExcelExportSuccess; jm.data = tpath + fileName; - return Json(jm); + return jm; } #endregion @@ -488,7 +488,7 @@ namespace CoreCms.Net.Web.Admin.Controllers /// [HttpPost] [Description("设置{{field.ColumnDescription}}")] - public async Task DoSet{{field.DbColumnName}}([FromBody]FMUpdateBoolDataByIntId entity) + public async Task DoSet{{field.DbColumnName}}([FromBody]FMUpdateBoolDataByIntId entity) { var jm = new AdminUiCallBack(); @@ -496,7 +496,7 @@ namespace CoreCms.Net.Web.Admin.Controllers if (oldModel == null) { jm.msg = "不存在此信息"; - return Json(jm); + return jm; } oldModel.{{field.DbColumnName}} = (bool)entity.data; @@ -504,7 +504,7 @@ namespace CoreCms.Net.Web.Admin.Controllers jm.code = bl ? 0 : 1; jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure; - return Json(jm); + return jm; } #endregion {% endif %}{% endfor %} diff --git a/CoreCms.Net.Configuration/GlobalEnumVars.cs b/CoreCms.Net.Configuration/GlobalEnumVars.cs index 6e375ed68d523ca5e5fa71f7648fb6b12fec4200..05be22ef6e6e13c23f1c19af1a872f4cc5331bbe 100644 --- a/CoreCms.Net.Configuration/GlobalEnumVars.cs +++ b/CoreCms.Net.Configuration/GlobalEnumVars.cs @@ -560,22 +560,33 @@ namespace CoreCms.Net.Configuration /// 团购 /// [Description("团购")] - GROUP = 3, + Group = 3, /// /// 秒杀 /// [Description("秒杀")] - SKILL = 4, + Skill = 4, /// /// 砍价 /// [Description("砍价")] - BARGAIN = 6, + Bargain = 6, /// /// 赠品 /// [Description("赠品")] - GIVEAWAY = 7, + Giveaway = 7, + /// + /// 接龙 + /// + [Description("接龙")] + Solitaire = 8, + /// + /// 微信交易组件 + /// + [Description("微信交易组件")] + TransactionComponent = 10, + } /// /// 发货单状态 diff --git a/CoreCms.Net.Core/CoreCms.Net.Core.csproj b/CoreCms.Net.Core/CoreCms.Net.Core.csproj index 1831881e220572ce77c94d1fbd65675901579eb9..b405e9bc7be9907df23526bd6db0606f5072b544 100644 --- a/CoreCms.Net.Core/CoreCms.Net.Core.csproj +++ b/CoreCms.Net.Core/CoreCms.Net.Core.csproj @@ -25,7 +25,7 @@ - + diff --git a/CoreCms.Net.Filter/AdminsControllerPermission.cs b/CoreCms.Net.Filter/AdminsControllerPermission.cs index c22458db31d6042e35ae9719173df2f40a7f6c45..34810d85f7637ee3fcb86b430d539d6bd7303918 100644 --- a/CoreCms.Net.Filter/AdminsControllerPermission.cs +++ b/CoreCms.Net.Filter/AdminsControllerPermission.cs @@ -37,7 +37,7 @@ namespace CoreCms.Net.Filter var controllers = types.Where(p => p.Name.Contains("Controller") && !noController.Contains(p.Name)); foreach (var type in controllers) { - if (type.Name.Length > 10 && type.BaseType.Name == "Controller" && type.Name.EndsWith("Controller")) //如果是Controller + if (type.Name.Length > 10 && type.BaseType.Name == "ControllerBase" && type.Name.EndsWith("Controller")) //如果是Controller { var members = type.GetMethods(); var cp = new ControllerPermission @@ -56,12 +56,18 @@ namespace CoreCms.Net.Filter var newMembers = members.Where(p => - p.ReturnType.Name == "ActionResult" || p.ReturnType.Name == "FileResult" || - p.ReturnType.Name == "JsonResult" || (p.ReturnType.GenericTypeArguments.Length > 0 && p.ReturnType.GenericTypeArguments[0].Name == "JsonResult")).ToList(); + p.ReturnType.FullName != null && (p.ReturnType.Name == "ActionResult" || + p.ReturnType.Name == "FileResult" || + p.ReturnType.Name == "JsonResult" || + (p.ReturnType.GenericTypeArguments.Length > 0 && p.ReturnType.GenericTypeArguments[0].Name == "JsonResult") || + p.ReturnType.Name == "AdminUiCallBack" || + p.ReturnType.Name == "IActionResult" || + p.ReturnType.FullName.Contains("CoreCms.Net.Model.ViewModels.UI.AdminUiCallBack")) + ).ToList(); foreach (var member in newMembers) { - if (member.Name == "ValidationProblem" || member.Name =="Json") continue; + if (member.Name == "ValidationProblem" || member.Name == "Json") continue; //if (member.ReturnType.Name == "ActionResult" || member.ReturnType.Name == "FileResult" || member.ReturnType.Name == "JsonResult" || (member.ReturnType.GenericTypeArguments.Length > 0 && member.ReturnType.GenericTypeArguments[0].Name == "JsonResult")) //如果是Action //{ diff --git a/CoreCms.Net.IRepository/Solitaire/ICoreCmsSolitaireItemsRepository.cs b/CoreCms.Net.IRepository/Solitaire/ICoreCmsSolitaireItemsRepository.cs deleted file mode 100644 index 3932efd44523e92995b50ba6405fe51122992e97..0000000000000000000000000000000000000000 --- a/CoreCms.Net.IRepository/Solitaire/ICoreCmsSolitaireItemsRepository.cs +++ /dev/null @@ -1,102 +0,0 @@ -/*********************************************************************** - * 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 - - - /// - /// 重写根据条件查询列表数据 - /// - /// 判断集合 - /// 排序方式 - /// - /// 是否使用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 deleted file mode 100644 index d8e4c32e68e022bc281a79ce1eb63acfaa931cca..0000000000000000000000000000000000000000 --- a/CoreCms.Net.IRepository/Solitaire/ICoreCmsSolitaireRepository.cs +++ /dev/null @@ -1,87 +0,0 @@ -/*********************************************************************** - * 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.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 - - /// - /// 重写根据条件查询分页数据 - /// - /// 判断集合 - /// 排序方式 - /// 当前页面索引 - /// 分布大小 - /// - /// 是否使用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.IServices/Cart/ICoreCmsCartServices.cs b/CoreCms.Net.IServices/Cart/ICoreCmsCartServices.cs index efd8428fd56459683fe15339b88011ce23d073d4..419ba493525b187fbb2ddc0729c34531b1fe6e10 100644 --- a/CoreCms.Net.IServices/Cart/ICoreCmsCartServices.cs +++ b/CoreCms.Net.IServices/Cart/ICoreCmsCartServices.cs @@ -50,11 +50,9 @@ namespace CoreCms.Net.IServices /// 数量 /// 数量类型/1是直接增加/2是赋值 /// 1普通购物/2拼团模式/3团购模式/4秒杀模式/6砍价模式/7赠品 - /// 团队序列 - /// 团购秒杀规则序列 + /// 关联对象类型 /// - Task Add(int userId, int productId, int nums, int numType, int cartTypes = 1, int teamId = 0, - int groupId = 0); + Task Add(int userId, int productId, int nums, int numType, int cartTypes = 1, int objectId = 0); /// @@ -73,8 +71,10 @@ namespace CoreCms.Net.IServices /// 用户序号 /// 已选择货号 /// 购物车类型/同订单类型 + /// 关联非订单类型数据序列 /// - Task GetCartDtoData(int userId, int[] ids = null, int type = 1); + Task GetCartDtoData(int userId, int[] ids = null, int type = 1, int objectId = 0); + /// @@ -88,11 +88,11 @@ namespace CoreCms.Net.IServices /// 优惠券码 /// 是否免运费 /// 关联上面的是否免运费/1=快递配送(要去算运费)生成订单记录快递方式,2=同城配送/3=门店自提(不需要计算运费)生成订单记录门店自提信息 - /// 传团购或秒杀序列 + /// 关联非普通订单营销类型序列 /// Task GetCartInfos(int userId, int[] ids, int orderType, int areaId, int point, string couponCode, bool freeFreight = false, - int deliveryType = (int) GlobalEnumVars.OrderReceiptType.Logistics, int groupId = 0); + int deliveryType = (int)GlobalEnumVars.OrderReceiptType.Logistics, int objectId = 0); /// diff --git a/CoreCms.Net.IServices/Order/ICoreCmsOrderServices.cs b/CoreCms.Net.IServices/Order/ICoreCmsOrderServices.cs index 980f1a8deabd8b2cfd9a789d7bc2ccdb1868458e..756471df328f4cf0244e5ba58e9e6dca207597d6 100644 --- a/CoreCms.Net.IServices/Order/ICoreCmsOrderServices.cs +++ b/CoreCms.Net.IServices/Order/ICoreCmsOrderServices.cs @@ -60,15 +60,16 @@ namespace CoreCms.Net.IServices /// 积分 /// 优惠券码 /// 来源平台 + /// 场景值(一般小程序才有) /// 发票信息 /// 发票抬头 /// 发票税务编码 - /// 团队序列 - /// 团购秒杀序列 + /// 关联非普通订单营销功能的序列 + /// 拼团订单分组序列 /// Task ToAdd(int userId, int orderType, string cartIds, int receiptType, int ushipId, int storeId, string ladingName, string ladingMobile, string memo, int point, string couponCode, - int source, int taxType, string taxName, string taxCode, int teamId, int groupId); + int source, int scene, int taxType, string taxName, string taxCode, int objectId, int teamId); /// /// 获取订单信息 diff --git a/CoreCms.Net.IServices/Solitaire/ICoreCmsSolitaireItemsServices.cs b/CoreCms.Net.IServices/Solitaire/ICoreCmsSolitaireItemsServices.cs deleted file mode 100644 index bfb8d1d3435778717f31d4ef9fb716abf65d7db6..0000000000000000000000000000000000000000 --- a/CoreCms.Net.IServices/Solitaire/ICoreCmsSolitaireItemsServices.cs +++ /dev/null @@ -1,97 +0,0 @@ -/*********************************************************************** - * 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 - - /// - /// 重写根据条件查询列表数据 - /// - /// 判断集合 - /// 排序方式 - /// - /// 是否使用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 deleted file mode 100644 index e408ee3436d8bb01c09402c2a4a321fbe3d7c6a1..0000000000000000000000000000000000000000 --- a/CoreCms.Net.IServices/Solitaire/ICoreCmsSolitaireServices.cs +++ /dev/null @@ -1,84 +0,0 @@ -/*********************************************************************** - * 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.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 重写根据条件查询分页数据 - /// - /// 重写根据条件查询分页数据 - /// - /// 判断集合 - /// 排序方式 - /// 当前页面索引 - /// 分布大小 - /// - /// 是否使用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.Model/CoreCms.Net.Model.csproj b/CoreCms.Net.Model/CoreCms.Net.Model.csproj index 836c681bf356b86651f566ccb79b635a219cb1ad..a246a8220b8009e8d977243ef1b25f981b468477 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/Cart/CoreCmsCart.cs b/CoreCms.Net.Model/Entities/Cart/CoreCmsCart.cs index 7e609e2c342ac48df425c5f6791017a9dad0559a..5a8f5662f8ba46a65d157f5b5fbfcd1e24d81eeb 100644 --- a/CoreCms.Net.Model/Entities/Cart/CoreCmsCart.cs +++ b/CoreCms.Net.Model/Entities/Cart/CoreCmsCart.cs @@ -60,5 +60,15 @@ namespace CoreCms.Net.Model.Entities [SugarColumn(ColumnDescription = "购物车类型")] [Required(ErrorMessage = "请输入{0}")] public System.Int32 type { get; set; } + + + + /// + /// 关联对象序列 + /// + [Display(Name = "关联对象序列")] + [Required(ErrorMessage = "请输入{0}")] + public int objectId { get; set; } + } } \ No newline at end of file diff --git a/CoreCms.Net.Model/Entities/Expression/PredicateBuilder.cs b/CoreCms.Net.Model/Entities/Expression/PredicateBuilder.cs index 0af59b1ac85898d73ea1dc0b2871ae344faa6d54..7961e1acfe4c5a68b7ee715195edcefe0dc4751f 100644 --- a/CoreCms.Net.Model/Entities/Expression/PredicateBuilder.cs +++ b/CoreCms.Net.Model/Entities/Expression/PredicateBuilder.cs @@ -51,7 +51,7 @@ namespace CoreCms.Net.Model.Entities.Expression public static Expression> And(this Expression> first, Expression> second) { - return first.Compose(second, System.Linq.Expressions.Expression.And); + return first.Compose(second, System.Linq.Expressions.Expression.AndAlso); } public static Expression> Or(this Expression> first, diff --git a/CoreCms.Net.Model/Entities/Order/CoreCmsOrder.cs b/CoreCms.Net.Model/Entities/Order/CoreCmsOrder.cs index 0e598d556502a6f4825fffb5dde1f17fe4cddbb1..7f8f666927243166bf6b4d25fe8fb12ed09851f2 100644 --- a/CoreCms.Net.Model/Entities/Order/CoreCmsOrder.cs +++ b/CoreCms.Net.Model/Entities/Order/CoreCmsOrder.cs @@ -3,11 +3,13 @@ * ProjectName: 核心内容管理系统 * Web: https://www.corecms.net * Author: 大灰灰 - * Email: jianweie@163.com - * CreateTime: 2021-06-08 22:14:58 + * Email: jianweie@163.com + * CreateTime: 2021/10/18 11:51:30 * Description: 暂无 -***********************************************************************/ + ***********************************************************************/ + using SqlSugar; +using System.ComponentModel; using System.ComponentModel.DataAnnotations; namespace CoreCms.Net.Model.Entities @@ -15,306 +17,507 @@ namespace CoreCms.Net.Model.Entities /// /// 订单表 /// - [SugarTable("CoreCmsOrder",TableDescription = "订单表")] public partial class CoreCmsOrder { /// - /// 订单表 + /// 构造函数 /// public CoreCmsOrder() { } - + /// /// 订单号 /// [Display(Name = "订单号")] - [SugarColumn(ColumnDescription = "订单号", IsPrimaryKey = true)] + + [SugarColumn(IsPrimaryKey = true)] + [Required(ErrorMessage = "请输入{0}")] - [StringLength(20, ErrorMessage = "【{0}】不能超过{1}字符长度")] - public System.String orderId { get; set; } + [StringLength(maximumLength:20,ErrorMessage = "{0}不能超过{1}字")] + + + public System.String orderId { get; set; } + + /// /// 商品总价 /// [Display(Name = "商品总价")] - [SugarColumn(ColumnDescription = "商品总价")] + [Required(ErrorMessage = "请输入{0}")] - public System.Decimal goodsAmount { get; set; } + + + + public System.Decimal goodsAmount { get; set; } + + /// /// 已支付的金额 /// [Display(Name = "已支付的金额")] - [SugarColumn(ColumnDescription = "已支付的金额")] + [Required(ErrorMessage = "请输入{0}")] - public System.Decimal payedAmount { get; set; } + + + + public System.Decimal payedAmount { get; set; } + + /// /// 订单实际销售总额 /// [Display(Name = "订单实际销售总额")] - [SugarColumn(ColumnDescription = "订单实际销售总额")] + [Required(ErrorMessage = "请输入{0}")] - public System.Decimal orderAmount { get; set; } + + + + public System.Decimal orderAmount { get; set; } + + /// /// 支付状态 /// [Display(Name = "支付状态")] - [SugarColumn(ColumnDescription = "支付状态")] + [Required(ErrorMessage = "请输入{0}")] - public System.Int32 payStatus { get; set; } + + + + public System.Int32 payStatus { get; set; } + + /// /// 发货状态 /// [Display(Name = "发货状态")] - [SugarColumn(ColumnDescription = "发货状态")] + [Required(ErrorMessage = "请输入{0}")] - public System.Int32 shipStatus { get; set; } + + + + public System.Int32 shipStatus { 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.Int32 orderType { get; set; } + + + + public System.Int32 orderType { get; set; } + + /// /// 收货方式 /// [Display(Name = "收货方式")] - [SugarColumn(ColumnDescription = "收货方式")] + [Required(ErrorMessage = "请输入{0}")] - public System.Int32 receiptType { get; set; } + + + + public System.Int32 receiptType { get; set; } + + /// /// 支付方式代码 /// [Display(Name = "支付方式代码")] - [SugarColumn(ColumnDescription = "支付方式代码", IsNullable = true)] - [StringLength(20, ErrorMessage = "【{0}】不能超过{1}字符长度")] - public System.String paymentCode { get; set; } + + + [StringLength(maximumLength:20,ErrorMessage = "{0}不能超过{1}字")] + + + public System.String paymentCode { get; set; } + + /// /// 支付时间 /// [Display(Name = "支付时间")] - [SugarColumn(ColumnDescription = "支付时间", IsNullable = true)] - public System.DateTime? paymentTime { get; set; } + + + + + + public System.DateTime? paymentTime { get; set; } + + /// /// 配送方式ID 关联ship.id /// [Display(Name = "配送方式ID 关联ship.id")] - [SugarColumn(ColumnDescription = "配送方式ID 关联ship.id")] + [Required(ErrorMessage = "请输入{0}")] - public System.Int32 logisticsId { get; set; } + + + + public System.Int32 logisticsId { get; set; } + + /// /// 配送方式名称 /// [Display(Name = "配送方式名称")] - [SugarColumn(ColumnDescription = "配送方式名称", IsNullable = true)] - [StringLength(50, ErrorMessage = "【{0}】不能超过{1}字符长度")] - public System.String logisticsName { get; set; } + + + [StringLength(maximumLength:50,ErrorMessage = "{0}不能超过{1}字")] + + + public System.String logisticsName { get; set; } + + /// /// 配送费用 /// [Display(Name = "配送费用")] - [SugarColumn(ColumnDescription = "配送费用")] + [Required(ErrorMessage = "请输入{0}")] - public System.Decimal costFreight { get; set; } + + + + public System.Decimal costFreight { get; set; } + + /// /// 用户ID 关联user.id /// [Display(Name = "用户ID 关联user.id")] - [SugarColumn(ColumnDescription = "用户ID 关联user.id")] + [Required(ErrorMessage = "请输入{0}")] - public System.Int32 userId { get; set; } + + + + public System.Int32 userId { get; set; } + + /// /// 店铺ID 关联seller.id /// [Display(Name = "店铺ID 关联seller.id")] - [SugarColumn(ColumnDescription = "店铺ID 关联seller.id")] + [Required(ErrorMessage = "请输入{0}")] - public System.Int32 sellerId { get; set; } + + + + public System.Int32 sellerId { get; set; } + + /// /// 售后状态 /// [Display(Name = "售后状态")] - [SugarColumn(ColumnDescription = "售后状态")] + [Required(ErrorMessage = "请输入{0}")] - public System.Int32 confirmStatus { get; set; } + + + + public System.Int32 confirmStatus { get; set; } + + /// /// 确认收货时间 /// [Display(Name = "确认收货时间")] - [SugarColumn(ColumnDescription = "确认收货时间", IsNullable = true)] - public System.DateTime? confirmTime { get; set; } + + + + + + public System.DateTime? confirmTime { get; set; } + + /// /// 自提门店ID,0就是不门店自提 /// [Display(Name = "自提门店ID,0就是不门店自提")] - [SugarColumn(ColumnDescription = "自提门店ID,0就是不门店自提")] + [Required(ErrorMessage = "请输入{0}")] - public System.Int32 storeId { get; set; } + + + + public System.Int32 storeId { get; set; } + + /// /// 收货地区ID /// [Display(Name = "收货地区ID")] - [SugarColumn(ColumnDescription = "收货地区ID")] + [Required(ErrorMessage = "请输入{0}")] - public System.Int32 shipAreaId { get; set; } + + + + public System.Int32 shipAreaId { get; set; } + + /// /// 收货详细地址 /// [Display(Name = "收货详细地址")] - [SugarColumn(ColumnDescription = "收货详细地址", IsNullable = true)] - [StringLength(200, ErrorMessage = "【{0}】不能超过{1}字符长度")] - public System.String shipAddress { get; set; } + + + [StringLength(maximumLength:200,ErrorMessage = "{0}不能超过{1}字")] + + + public System.String shipAddress { get; set; } + + /// /// 收货人姓名 /// [Display(Name = "收货人姓名")] - [SugarColumn(ColumnDescription = "收货人姓名", IsNullable = true)] - [StringLength(50, ErrorMessage = "【{0}】不能超过{1}字符长度")] - public System.String shipName { get; set; } + + + [StringLength(maximumLength:50,ErrorMessage = "{0}不能超过{1}字")] + + + public System.String shipName { get; set; } + + /// /// 收货电话 /// [Display(Name = "收货电话")] - [SugarColumn(ColumnDescription = "收货电话", IsNullable = true)] - [StringLength(50, ErrorMessage = "【{0}】不能超过{1}字符长度")] - public System.String shipMobile { get; set; } + + + [StringLength(maximumLength:50,ErrorMessage = "{0}不能超过{1}字")] + + + public System.String shipMobile { get; set; } + + /// /// 商品总重量 /// [Display(Name = "商品总重量")] - [SugarColumn(ColumnDescription = "商品总重量")] + [Required(ErrorMessage = "请输入{0}")] - public System.Decimal weight { get; set; } + + + + public System.Decimal weight { get; set; } + + /// /// 开发票 /// [Display(Name = "开发票")] - [SugarColumn(ColumnDescription = "开发票")] + [Required(ErrorMessage = "请输入{0}")] - public System.Int32 taxType { get; set; } + + + + public System.Int32 taxType { get; set; } + + /// /// 税号 /// [Display(Name = "税号")] - [SugarColumn(ColumnDescription = "税号", IsNullable = true)] - [StringLength(50, ErrorMessage = "【{0}】不能超过{1}字符长度")] - public System.String taxCode { get; set; } + + + [StringLength(maximumLength:50,ErrorMessage = "{0}不能超过{1}字")] + + + public System.String taxCode { get; set; } + + /// /// 发票抬头 /// [Display(Name = "发票抬头")] - [SugarColumn(ColumnDescription = "发票抬头", IsNullable = true)] - [StringLength(50, ErrorMessage = "【{0}】不能超过{1}字符长度")] - public System.String taxTitle { get; set; } + + + [StringLength(maximumLength:50,ErrorMessage = "{0}不能超过{1}字")] + + + public System.String taxTitle { get; set; } + + /// /// 使用积分 /// [Display(Name = "使用积分")] - [SugarColumn(ColumnDescription = "使用积分")] + [Required(ErrorMessage = "请输入{0}")] - public System.Int32 point { get; set; } + + + + public System.Int32 point { get; set; } + + /// /// 积分抵扣金额 /// [Display(Name = "积分抵扣金额")] - [SugarColumn(ColumnDescription = "积分抵扣金额")] + [Required(ErrorMessage = "请输入{0}")] - public System.Decimal pointMoney { get; set; } + + + + public System.Decimal pointMoney { get; set; } + + /// /// 订单优惠金额 /// [Display(Name = "订单优惠金额")] - [SugarColumn(ColumnDescription = "订单优惠金额")] + [Required(ErrorMessage = "请输入{0}")] - public System.Decimal orderDiscountAmount { get; set; } + + + + public System.Decimal orderDiscountAmount { get; set; } + + /// /// 商品优惠金额 /// [Display(Name = "商品优惠金额")] - [SugarColumn(ColumnDescription = "商品优惠金额")] + [Required(ErrorMessage = "请输入{0}")] - public System.Decimal goodsDiscountAmount { get; set; } + + + + public System.Decimal goodsDiscountAmount { get; set; } + + /// /// 优惠券优惠额度 /// [Display(Name = "优惠券优惠额度")] - [SugarColumn(ColumnDescription = "优惠券优惠额度")] + [Required(ErrorMessage = "请输入{0}")] - public System.Decimal couponDiscountAmount { get; set; } + + + + public System.Decimal couponDiscountAmount { get; set; } + /// /// 优惠券信息 /// [Display(Name = "优惠券信息")] - [SugarColumn(ColumnDescription = "优惠券信息", IsNullable = true)] - public System.String coupon { get; set; } + + public System.String coupon { get; set; } + + /// /// 优惠信息 /// [Display(Name = "优惠信息")] - [SugarColumn(ColumnDescription = "优惠信息", IsNullable = true)] - [StringLength(255, ErrorMessage = "【{0}】不能超过{1}字符长度")] - public System.String promotionList { get; set; } + + + [StringLength(maximumLength:255,ErrorMessage = "{0}不能超过{1}字")] + + + public System.String promotionList { get; set; } + + /// /// 买家备注 /// [Display(Name = "买家备注")] - [SugarColumn(ColumnDescription = "买家备注", IsNullable = true)] - [StringLength(255, ErrorMessage = "【{0}】不能超过{1}字符长度")] - public System.String memo { get; set; } + + + [StringLength(maximumLength:255,ErrorMessage = "{0}不能超过{1}字")] + + + public System.String memo { get; set; } + + /// /// 下单IP /// [Display(Name = "下单IP")] - [SugarColumn(ColumnDescription = "下单IP", IsNullable = true)] - [StringLength(50, ErrorMessage = "【{0}】不能超过{1}字符长度")] - public System.String ip { get; set; } + + + [StringLength(maximumLength:50,ErrorMessage = "{0}不能超过{1}字")] + + + public System.String ip { get; set; } + + /// /// 卖家备注 /// [Display(Name = "卖家备注")] - [SugarColumn(ColumnDescription = "卖家备注", IsNullable = true)] - [StringLength(510, ErrorMessage = "【{0}】不能超过{1}字符长度")] - public System.String mark { get; set; } + + + [StringLength(maximumLength:510,ErrorMessage = "{0}不能超过{1}字")] + + + public System.String mark { get; set; } + + /// /// 订单来源 /// [Display(Name = "订单来源")] - [SugarColumn(ColumnDescription = "订单来源")] + [Required(ErrorMessage = "请输入{0}")] - public System.Int32 source { get; set; } + public System.Int32 source { get; set; } + /// /// 是否评论 /// [Display(Name = "是否评论")] - [SugarColumn(ColumnDescription = "是否评论")] + [Required(ErrorMessage = "请输入{0}")] - public System.Boolean isComment { get; set; } + + + + public System.Boolean isComment { get; set; } + + /// /// 删除标志 /// [Display(Name = "删除标志")] - [SugarColumn(ColumnDescription = "删除标志")] [Required(ErrorMessage = "请输入{0}")] - public System.Boolean isdel { get; set; } + + public System.Boolean isdel { get; set; } + + /// + /// 关联营销类型对象序列 + /// + [Display(Name = "关联营销类型对象序列")] + + [Required(ErrorMessage = "请输入{0}")] + + public System.Int32 objectId { 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? updateTime { get; set; } + public System.DateTime? updateTime { 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 deleted file mode 100644 index beda78c5b18ec4d0acf62ce8b63d99aec2137d24..0000000000000000000000000000000000000000 --- a/CoreCms.Net.Model/Entities/Solitaire/CoreCmsSolitaire.cs +++ /dev/null @@ -1,109 +0,0 @@ -/*********************************************************************** - * Project: CoreCms - * ProjectName: 核心内容管理系统 - * Web: https://www.corecms.net - * Author: 大灰灰 - * Email: jianweie@163.com - * CreateTime: 2021/6/28 22:49:48 - * Description: 暂无 - ***********************************************************************/ - -using System; -using System.ComponentModel.DataAnnotations; -using SqlSugar; - -namespace CoreCms.Net.Model.Entities -{ - /// - /// 接龙活动表 - /// - public partial class CoreCmsSolitaire - { - /// - /// 序列没 - /// - [Display(Name = "序列")] - [SugarColumn(IsPrimaryKey = true, IsIdentity = true)] - [Required(ErrorMessage = "请输入{0}")] - public int id { get; set; } - - /// - /// 活动标题 - /// - [Display(Name = "活动标题")] - [Required(ErrorMessage = "请输入{0}")] - [StringLength(250, ErrorMessage = "{0}不能超过{1}字")] - public string title { get; set; } - - /// - /// 缩略图 - /// - [Display(Name = "缩略图")] - [Required(ErrorMessage = "请输入{0}")] - [StringLength(250, ErrorMessage = "{0}不能超过{1}字")] - public string thumbnail { get; set; } - - /// - /// 活动内容 - /// - [Display(Name = "活动内容")] - [Required(ErrorMessage = "请输入{0}")] - public string contentBody { get; set; } - - /// - /// 开始时间 - /// - [Display(Name = "开始时间")] - [Required(ErrorMessage = "请输入{0}")] - public DateTime startTime { get; set; } - - /// - /// 结束时间 - /// - [Display(Name = "结束时间")] - [Required(ErrorMessage = "请输入{0}")] - public DateTime endTime { get; set; } - - /// - /// 起购价格 - /// - [Display(Name = "起购价格")] - [Required(ErrorMessage = "请输入{0}")] - public decimal startBuyPrice { get; set; } - - /// - /// 起送价格 - /// - [Display(Name = "起送价格")] - [Required(ErrorMessage = "请输入{0}")] - public decimal minDeliveryPrice { get; set; } - - /// - /// 是否显示 - /// - [Display(Name = "是否显示")] - [Required(ErrorMessage = "请输入{0}")] - public bool isShow { get; set; } - - /// - /// 活动状态 - /// - [Display(Name = "活动状态")] - [Required(ErrorMessage = "请输入{0}")] - public int status { get; set; } - - /// - /// 标注删除 - /// - [Display(Name = "标注删除")] - [Required(ErrorMessage = "请输入{0}")] - public bool isDelete { get; set; } - - /// - /// 创建时间 - /// - [Display(Name = "创建时间")] - [Required(ErrorMessage = "请输入{0}")] - public DateTime createTime { get; set; } - } -} \ No newline at end of file diff --git a/CoreCms.Net.Model/Entities/Solitaire/CoreCmsSolitaireItems.cs b/CoreCms.Net.Model/Entities/Solitaire/CoreCmsSolitaireItems.cs deleted file mode 100644 index 3d7c4dbab77e8d4b153e3d1b39be26527d4e6a25..0000000000000000000000000000000000000000 --- a/CoreCms.Net.Model/Entities/Solitaire/CoreCmsSolitaireItems.cs +++ /dev/null @@ -1,85 +0,0 @@ -/*********************************************************************** - * 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 deleted file mode 100644 index 12af81e5430b4f8e69195d7e306dacebafc8c178..0000000000000000000000000000000000000000 --- a/CoreCms.Net.Model/Entities/Solitaire/CoreCmsSolitaireItemsPartial.cs +++ /dev/null @@ -1,38 +0,0 @@ -/*********************************************************************** - * 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 deleted file mode 100644 index 66f84c028f0326bda47a8d53e0bc8210300203de..0000000000000000000000000000000000000000 --- a/CoreCms.Net.Model/Entities/Solitaire/CoreCmsSolitairePartial.cs +++ /dev/null @@ -1,30 +0,0 @@ -/*********************************************************************** - * 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.Model/FromBody/FMCart.cs b/CoreCms.Net.Model/FromBody/FMCart.cs index 290bcbad946d097cc3e64a01f66a390bcfdc577b..d5373c5570cc894854dff1810549cd339c7d1db7 100644 --- a/CoreCms.Net.Model/FromBody/FMCart.cs +++ b/CoreCms.Net.Model/FromBody/FMCart.cs @@ -40,18 +40,10 @@ namespace CoreCms.Net.Model.FromBody /// public int cartType { get; set; } = 1; - - /// - /// 如果是拼团,是否带团队id - /// - public int teamId { get; set; } = 0; - /// - /// 如果是团购秒杀,是否带团购秒杀规则id + /// 非普通货品,关联对象序列 /// - public int groupId { get; set; } = 0; - - + public int objectId { get; set; } = 0; } /// @@ -96,9 +88,9 @@ namespace CoreCms.Net.Model.FromBody /// - /// 如果是团购秒杀,是否带团购秒杀规则id + /// 关联非普通订单对象序列 /// - public int groupId { get; set; } = 0; + public int objectId { get; set; } = 0; } diff --git a/CoreCms.Net.Model/ViewModels/DTO/OrderDTO.cs b/CoreCms.Net.Model/ViewModels/DTO/OrderDTO.cs index 795dd0dce40dd0fe623bc18c471fdbb6a9538e66..7c204ce55a9111406756f7b468aaf530e2952c68 100644 --- a/CoreCms.Net.Model/ViewModels/DTO/OrderDTO.cs +++ b/CoreCms.Net.Model/ViewModels/DTO/OrderDTO.cs @@ -124,14 +124,19 @@ namespace CoreCms.Net.Model.ViewModels.DTO public string ladingMobile { get; set; } /// - /// 团队序列 + /// 非普通订单关联营销对象序列 + /// + public int objectId { get; set; } = 0; + + /// + /// 拼团订单分组序列 /// public int teamId { get; set; } = 0; /// - /// 团购秒杀规则序列 + /// 场景值 /// - public int groupId { get; set; } = 0; + public int scene { get; set; } = 0; } /// @@ -222,6 +227,11 @@ namespace CoreCms.Net.Model.ViewModels.DTO /// public int status { get; set; } = 0; + /// + /// 收货类型 + /// + public int receiptType { get; set; } = 0; + /// /// 门店序列 diff --git a/CoreCms.Net.RedisMQ/CoreCms.Net.RedisMQ.csproj b/CoreCms.Net.RedisMQ/CoreCms.Net.RedisMQ.csproj index 79a724215eb5a442d1f6f24ef6172471328eec27..cd08989daebdc4ca438ad25d3c8e632aeaa925fb 100644 --- a/CoreCms.Net.RedisMQ/CoreCms.Net.RedisMQ.csproj +++ b/CoreCms.Net.RedisMQ/CoreCms.Net.RedisMQ.csproj @@ -5,10 +5,10 @@ - + - + diff --git a/CoreCms.Net.Repository/Bill/CoreCmsBillDeliveryRepository.cs b/CoreCms.Net.Repository/Bill/CoreCmsBillDeliveryRepository.cs index eab19489344e74a78482c1fff69dd157a89561c5..21a31437f997c93963ef77ad07e49296c9883e14 100644 --- a/CoreCms.Net.Repository/Bill/CoreCmsBillDeliveryRepository.cs +++ b/CoreCms.Net.Repository/Bill/CoreCmsBillDeliveryRepository.cs @@ -41,30 +41,21 @@ namespace CoreCms.Net.Repository /// public async Task> Statistics() { - var dt = DateTime.Now.AddDays(-8).ToString("yyyy-MM-dd 00:00:00"); + var dt = DateTime.Now.AddDays(-8); - var sqlStr = string.Empty; - string dbTypeString = AppSettingsConstVars.DbDbType; - if (dbTypeString == DbType.SqlServer.ToString()) - { - sqlStr = @"SELECT count(1) AS nums,CONVERT(varchar(100),createTime, 23) AS day - FROM CoreCmsBillDelivery - WHERE createTime >= '" + dt + @"' - GROUP BY CONVERT(varchar(100),createTime, 23)"; - } - else if (dbTypeString == DbType.MySql.ToString()) - { - sqlStr = @"SELECT count(1) AS nums,date(createTime) AS day - FROM CoreCmsBillDelivery - WHERE createTime >= '" + dt + @"' - GROUP BY date(createTime)"; - } + var list = await DbClient.Queryable() + .Where(p => p.createTime >= dt) + .Select(it => new + { + it.deliveryId, + createTime = it.createTime.Date + }) + .MergeTable() + .GroupBy(it => it.createTime) + .Select(it => new StatisticsOut { day = it.createTime.ToString("yyyy-MM-dd"), nums = SqlFunc.AggregateCount(it.deliveryId) }) + .ToListAsync(); - if (string.IsNullOrEmpty(sqlStr)) - { - return null; - } - return await DbClient.SqlQueryable(sqlStr).ToListAsync(); + return list; } } diff --git a/CoreCms.Net.Repository/Bill/CoreCmsBillPaymentsRepository.cs b/CoreCms.Net.Repository/Bill/CoreCmsBillPaymentsRepository.cs index d2d20ca27e14ffcba5637f4b1910496865b5bd98..d69dc9238f91d25fdcf7416b558fe0f228590938 100644 --- a/CoreCms.Net.Repository/Bill/CoreCmsBillPaymentsRepository.cs +++ b/CoreCms.Net.Repository/Bill/CoreCmsBillPaymentsRepository.cs @@ -41,31 +41,20 @@ namespace CoreCms.Net.Repository /// public async Task> Statistics() { - var dt = DateTime.Now.AddDays(-8).ToString("yyyy-MM-dd 00:00:00"); + var dt = DateTime.Now.AddDays(-8); - var sqlStr = string.Empty; - string dbTypeString = AppSettingsConstVars.DbDbType; - if (dbTypeString == DbType.SqlServer.ToString()) - { - sqlStr = @"SELECT count(1) AS nums,CONVERT(varchar(100),createTime, 23) AS day - FROM CoreCmsBillPayments - WHERE createTime >= '" + dt + @"' AND status = " + (int)GlobalEnumVars.BillPaymentsStatus.Payed + @" AND type=" + (int)GlobalEnumVars.BillPaymentsType.Order + @" - GROUP BY CONVERT(varchar(100),createTime, 23)"; - } - else if (dbTypeString == DbType.MySql.ToString()) - { - sqlStr = @"SELECT count(1) AS nums,date(createTime) AS day - FROM CoreCmsBillPayments - WHERE createTime >= '" + dt + @"' AND status = " + (int)GlobalEnumVars.BillPaymentsStatus.Payed + @" AND type=" + (int)GlobalEnumVars.BillPaymentsType.Order + @" - GROUP BY date(createTime)"; - } + var list = await DbClient.Queryable() + .Where(p => p.createTime >= dt && p.status == (int)GlobalEnumVars.BillPaymentsStatus.Payed && p.type == (int)GlobalEnumVars.BillPaymentsType.Order) + .Select(it => new + { + it.paymentId, + createTime = it.createTime.Date + }) + .MergeTable() + .GroupBy(it => it.createTime) + .Select(it => new StatisticsOut { day = it.createTime.ToString("yyyy-MM-dd"), nums = SqlFunc.AggregateCount(it.paymentId) }) + .ToListAsync(); - if (string.IsNullOrEmpty(sqlStr)) - { - return null; - } - - var list = await DbClient.SqlQueryable(sqlStr).ToListAsync(); return list; } diff --git a/CoreCms.Net.Repository/CoreCms.Net.Repository.csproj b/CoreCms.Net.Repository/CoreCms.Net.Repository.csproj index 7236792977677ab298f2e4d8b20ecbd0350064d4..ae24f2b2a4611b5f6fc8b5e3dbb1f7fe844162e7 100644 --- a/CoreCms.Net.Repository/CoreCms.Net.Repository.csproj +++ b/CoreCms.Net.Repository/CoreCms.Net.Repository.csproj @@ -6,7 +6,7 @@ - + diff --git a/CoreCms.Net.Repository/Financial/CoreCmsReportsRepository.cs b/CoreCms.Net.Repository/Financial/CoreCmsReportsRepository.cs index 871fa3bdfd628954518499958103131fe61a1bcc..7f5f1b8e45339aa87ce29250c2696cb3cc22a148 100644 --- a/CoreCms.Net.Repository/Financial/CoreCmsReportsRepository.cs +++ b/CoreCms.Net.Repository/Financial/CoreCmsReportsRepository.cs @@ -8,6 +8,7 @@ * Description: 暂无 ***********************************************************************/ +using System; using System.Collections.Generic; using System.Threading.Tasks; using CoreCms.Net.Configuration; @@ -44,38 +45,45 @@ namespace CoreCms.Net.Repository /// public async Task> GetGoodsSalesVolumes(string start, string end, string filter, string filterSed, string thesort, int pageIndex = 1, int pageSize = 5000) { - var sqlStr = string.Empty; - string dbTypeString = AppSettingsConstVars.DbDbType; - if (dbTypeString == DbType.SqlServer.ToString()) - { - sqlStr = @"select top 1000 sum(oi.nums) as nums,sum(oi.amount) as amount,oi.sn,oi.name,oi.imageUrl,oi.addon - from CoreCmsOrderItem oi - left join CoreCmsOrder o on oi.orderId = o.orderId - where o.payStatus <> 1 - and o.paymentTime > '" + start + @"' and o.paymentTime <= '" + end + @"' - group by oi.sn,oi.name,oi.imageUrl,oi.addon - order by sum(oi." + filter + @") " + thesort + @",sum(oi." + filterSed + @") " + thesort + @""; - } - else if (dbTypeString == DbType.MySql.ToString()) - { - sqlStr = @"select sum(oi.nums) as nums,sum(oi.amount) as amount,oi.sn,oi.name,oi.imageUrl,oi.addon - from CoreCmsOrderItem oi - left join CoreCmsOrder o on oi.orderId = o.orderId - where o.payStatus <> 1 - and o.paymentTime > '" + start + @"' and o.paymentTime <= '" + end + @"' - group by oi.sn,oi.name,oi.imageUrl,oi.addon - order by sum(oi." + filter + @") " + thesort + @",sum(oi." + filterSed + @") " + thesort + @" LIMIT 1000"; - } + RefAsync totalCount = 0; - if (string.IsNullOrEmpty(sqlStr)) + var startDt = DateTime.Parse(start); + var endDt = DateTime.Parse(end); + + var orderBy = thesort switch { - return null; - } + "asc" => OrderByType.Asc, + "desc" => OrderByType.Desc, + _ => OrderByType.Desc + }; + var data = await DbClient.Queryable() + .LeftJoin((oi, o) => oi.orderId == o.orderId) + .Where((oi, o) => o.payStatus != 1 && o.paymentTime > startDt && o.paymentTime <= endDt) + .GroupBy((oi, o) => new + { + oi.sn, + oi.name, + oi.imageUrl, + oi.addon + }) + .Select((oi, o) => new GoodsSalesVolume() + { + nums = SqlFunc.AggregateSum(oi.nums), + amount = SqlFunc.AggregateSum(oi.amount), + sn = oi.sn, + name = oi.name, + imageUrl = oi.imageUrl, + addon = oi.addon + }) + .MergeTable() + .OrderByIF(filter == "nums", p => p.nums, orderBy) + .OrderByIF(filter == "amount", p => p.amount, orderBy) + .OrderByIF(filterSed == "nums", p => p.nums, orderBy) + .OrderByIF(filterSed == "amount", p => p.amount, orderBy) + .ToPageListAsync(pageIndex, pageSize, totalCount); - RefAsync totalCount = 0; - var page = await DbClient.SqlQueryable(sqlStr).ToPageListAsync(pageIndex, pageSize, totalCount); - var list = new PageList(page, pageIndex, pageSize, totalCount); + var list = new PageList(data, pageIndex, pageSize, totalCount); return list; } @@ -90,36 +98,34 @@ namespace CoreCms.Net.Repository /// public async Task> GetGoodsCollections(string start, string end, string thesort, int pageIndex = 1, int pageSize = 5000) { + RefAsync totalCount = 0; - var sqlStr = string.Empty; - string dbTypeString = AppSettingsConstVars.DbDbType; - if (dbTypeString == DbType.SqlServer.ToString()) - { - sqlStr = @"select top 1000 count(gc.goodsId) as nums,gc.goodsId,gc.goodsName,g.images - from CoreCmsGoodsCollection gc - left join CoreCmsGoods g on gc.goodsId = g.id - where gc.createTime > '" + start + @"' and gc.createTime <= '" + end + @"' - group by gc.goodsId,gc.goodsName,g.images - order by sum(gc.goodsId) " + thesort + @""; - } - else if (dbTypeString == DbType.MySql.ToString()) - { - sqlStr = @"select count(gc.goodsId) as nums,gc.goodsId,gc.goodsName,g.images - from CoreCmsGoodsCollection gc - left join CoreCmsGoods g on gc.goodsId = g.id - where gc.createTime > '" + start + @"' and gc.createTime <= '" + end + @"' - group by gc.goodsId,gc.goodsName,g.images - order by sum(gc.goodsId) " + thesort + @" LIMIT 1000"; - } + var startDt = DateTime.Parse(start); + var endDt = DateTime.Parse(end); - if (string.IsNullOrEmpty(sqlStr)) + var orderBy = thesort switch { - return null; - } + "asc" => OrderByType.Asc, + "desc" => OrderByType.Desc, + _ => OrderByType.Desc + }; - RefAsync totalCount = 0; - var page = await DbClient.SqlQueryable(sqlStr).ToPageListAsync(pageIndex, pageSize, totalCount); - var list = new PageList(page, pageIndex, pageSize, totalCount); + var data = await DbClient.Queryable() + .LeftJoin((gc, g) => gc.goodsId == g.id) + .Where((gc, g) => gc.createTime > startDt && gc.createTime <= endDt) + .GroupBy((gc, g) => new { gc.goodsId, gc.goodsName, g.images }) + .Select((gc, g) => new GoodsCollection() + { + nums = SqlFunc.AggregateCount(gc.goodsId), + goodsName = gc.goodsName, + goodId = gc.goodsId, + images = g.images + }) + .MergeTable() + .OrderBy(gc => gc.nums, orderBy) + .ToPageListAsync(pageIndex, pageSize, totalCount); + + var list = new PageList(data, pageIndex, pageSize, totalCount); return list; } diff --git a/CoreCms.Net.Repository/Shop/CoreCmsStoreRepository.cs b/CoreCms.Net.Repository/Shop/CoreCmsStoreRepository.cs index 6032a0e6bcedb130d3050eb90082a6c281d0dd37..febaa6c7de6059103203f362813332ded40c47cf 100644 --- a/CoreCms.Net.Repository/Shop/CoreCmsStoreRepository.cs +++ b/CoreCms.Net.Repository/Shop/CoreCmsStoreRepository.cs @@ -146,38 +146,57 @@ namespace CoreCms.Net.Repository RefAsync totalCount = 0; //MySql与SqlServer查询语句相同 - var sql = string.Empty; + List page; if (latitude > 0 && longitude > 0) { var sqrt = "SQRT(power(SIN((" + latitude + "*PI()/180-(CoreCmsStore.latitude)*PI()/180)/2),2)+COS(" + latitude + "*PI()/180)*COS((CoreCmsStore.latitude)*PI()/180)*power(SIN((" + longitude + "*PI()/180-(CoreCmsStore.longitude)*PI()/180)/2),2))"; - sql = "SELECT id, storeName, mobile, linkMan, logoImage, areaId, address, coordinate, latitude, longitude, isDefault, createTime, updateTime, ROUND(6378.138*2*ASIN(" + sqrt + ")*1000,2) AS distance FROM CoreCmsStore"; + var sql = "SELECT id, storeName, mobile, linkMan, logoImage, areaId, address, coordinate, latitude, longitude, isDefault, createTime, updateTime, ROUND(6378.138*2*ASIN(" + sqrt + ")*1000,2) AS distance FROM CoreCmsStore"; + + page = await DbClient.SqlQueryable(sql) + .WhereIF(predicate != null, predicate) + .OrderByIF(orderByExpression != null, orderByExpression, orderByType) + .Select(p => new CoreCmsStore + { + id = p.id, + storeName = p.storeName, + mobile = p.mobile, + linkMan = p.linkMan, + logoImage = p.logoImage, + areaId = p.areaId, + address = p.address, + coordinate = p.coordinate, + latitude = p.latitude, + longitude = p.longitude, + isDefault = p.isDefault, + createTime = p.createTime, + updateTime = p.updateTime, + distance = Convert.ToDecimal(p.distance) + }).ToPageListAsync(pageIndex, pageSize, totalCount); } else { - sql = "SELECT id, storeName, mobile, linkMan, logoImage, areaId, address, coordinate, latitude, longitude, isDefault, createTime, updateTime, distance FROM CoreCmsStore"; + page = await DbClient.Queryable() + .WhereIF(predicate != null, predicate) + .OrderByIF(orderByExpression != null, orderByExpression, orderByType) + .Select(p => new CoreCmsStore + { + id = p.id, + storeName = p.storeName, + mobile = p.mobile, + linkMan = p.linkMan, + logoImage = p.logoImage, + areaId = p.areaId, + address = p.address, + coordinate = p.coordinate, + latitude = p.latitude, + longitude = p.longitude, + isDefault = p.isDefault, + createTime = p.createTime, + updateTime = p.updateTime, + distance = Convert.ToDecimal(p.distance) + }).ToPageListAsync(pageIndex, pageSize, totalCount); } - var page = await DbClient.SqlQueryable(sql) - .WhereIF(predicate != null, predicate) - .OrderByIF(orderByExpression != null, orderByExpression, orderByType) - .Select(p => new CoreCmsStore - { - id = p.id, - storeName = p.storeName, - mobile = p.mobile, - linkMan = p.linkMan, - logoImage = p.logoImage, - areaId = p.areaId, - address = p.address, - coordinate = p.coordinate, - latitude = p.latitude, - longitude = p.longitude, - isDefault = p.isDefault, - createTime = p.createTime, - updateTime = p.updateTime, - distance = Convert.ToDecimal(p.distance) - }).ToPageListAsync(pageIndex, pageSize, totalCount); - var list = new PageList(page, pageIndex, pageSize, totalCount); return list; } diff --git a/CoreCms.Net.Repository/Solitaire/CoreCmsSolitaireItemsRepository.cs b/CoreCms.Net.Repository/Solitaire/CoreCmsSolitaireItemsRepository.cs deleted file mode 100644 index 700ee45a32e1409ab72341e5306d8d607ad0588b..0000000000000000000000000000000000000000 --- a/CoreCms.Net.Repository/Solitaire/CoreCmsSolitaireItemsRepository.cs +++ /dev/null @@ -1,262 +0,0 @@ -/*********************************************************************** - * 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; - - 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; - - 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; - - 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; - - 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; - - return jm; - } - - #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 deleted file mode 100644 index 8bade941181f5b5af5caf748addd7042a4805170..0000000000000000000000000000000000000000 --- a/CoreCms.Net.Repository/Solitaire/CoreCmsSolitaireRepository.cs +++ /dev/null @@ -1,334 +0,0 @@ -/*********************************************************************** - * 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.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; - - 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.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; - - 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; - - 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; - - 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; - - return jm; - } - - #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, - //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, - //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 - - } -} diff --git a/CoreCms.Net.Repository/System/SysMenuRepository.cs b/CoreCms.Net.Repository/System/SysMenuRepository.cs index 370dc7803add9abb3d2794bce4ea4e234dcb71a6..e4174b01aa5359d043b79bd62136a3277681ec7d 100644 --- a/CoreCms.Net.Repository/System/SysMenuRepository.cs +++ b/CoreCms.Net.Repository/System/SysMenuRepository.cs @@ -83,12 +83,12 @@ namespace CoreCms.Net.Repository oldModel.iconColor = entity.iconColor; oldModel.hide = entity.hide; //oldModel.deleted = entity.deleted; - //oldModel.createTime = entity.createTime; + //oldModel.createTime = oldModel.createTime; oldModel.updateTime = DateTime.Now; oldModel.identificationCode = entity.identificationCode; //事物处理过程结束 - var bl = await DbClient.Updateable(entity).ExecuteCommandHasChangeAsync(); + var bl = await DbClient.Updateable(oldModel).ExecuteCommandHasChangeAsync(); jm.code = bl ? 0 : 1; jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure; if (bl) diff --git a/CoreCms.Net.Repository/User/CoreCmsUserRepository.cs b/CoreCms.Net.Repository/User/CoreCmsUserRepository.cs index 295704d5a8d6ec3c8195215568f361db640d03c1..0fc8bb9f5bdb607b9c226d0ffd9790c95ea831be 100644 --- a/CoreCms.Net.Repository/User/CoreCmsUserRepository.cs +++ b/CoreCms.Net.Repository/User/CoreCmsUserRepository.cs @@ -150,30 +150,19 @@ namespace CoreCms.Net.Repository /// public async Task> Statistics(int day) { - var dt = DateTime.Now.AddDays(-day).ToString("yyyy-MM-dd"); - - var sqlStr = string.Empty; - string dbTypeString = AppSettingsConstVars.DbDbType; - if (dbTypeString == DbType.SqlServer.ToString()) - { - sqlStr = @"SELECT count(1) AS nums,CONVERT(varchar(100),createTime, 23) AS day - FROM CoreCmsUser - WHERE createTime > '" + dt + @"' - GROUP BY CONVERT(varchar(100),createTime, 23)"; - } - else if (dbTypeString == DbType.MySql.ToString()) - { - sqlStr = @"SELECT count(1) AS nums,date(createTime) AS day - FROM CoreCmsUser - WHERE createTime > '" + dt + @"' - GROUP BY date(createTime)"; - } - if (string.IsNullOrEmpty(sqlStr)) - { - return null; - } + var dt = DateTime.Now.AddDays(-day); + var list = await DbClient.Queryable() + .Where(p => p.createTime >= dt) + .Select(it => new + { + it.id, + createTime = it.createTime.Date + }) + .MergeTable() + .GroupBy(it => it.createTime) + .Select(it => new StatisticsOut { day = it.createTime.ToString("yyyy-MM-dd"), nums = SqlFunc.AggregateCount(it.id) }) + .ToListAsync(); - var list = await DbClient.SqlQueryable(sqlStr).ToListAsync(); return list; } diff --git a/CoreCms.Net.Repository/User/CoreCmsUserShipRepository.cs b/CoreCms.Net.Repository/User/CoreCmsUserShipRepository.cs index b1f49f90fa80f7c344548365d4cee50274bb05e7..02edc97503157dfd04d1a6f5c60f08ee51981b5d 100644 --- a/CoreCms.Net.Repository/User/CoreCmsUserShipRepository.cs +++ b/CoreCms.Net.Repository/User/CoreCmsUserShipRepository.cs @@ -85,7 +85,7 @@ namespace CoreCms.Net.Repository } //事物处理过程结束 - var bl = await DbClient.Updateable(entity).ExecuteCommandHasChangeAsync(); + var bl = await DbClient.Updateable(oldModel).ExecuteCommandHasChangeAsync(); jm.code = bl ? 0 : 1; jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure; diff --git a/CoreCms.Net.Services/Cart/CoreCmsCartServices.cs b/CoreCms.Net.Services/Cart/CoreCmsCartServices.cs index 2ef1cc1502fe73b0c919201501914e44e943f8a4..6fd7f6790b29b613c6c2d5389fa9918e2a59dd63 100644 --- a/CoreCms.Net.Services/Cart/CoreCmsCartServices.cs +++ b/CoreCms.Net.Services/Cart/CoreCmsCartServices.cs @@ -159,7 +159,6 @@ namespace CoreCms.Net.Services #endregion #region 添加单个货品到购物车 - /// /// 添加单个货品到购物车 /// @@ -168,10 +167,9 @@ namespace CoreCms.Net.Services /// 数量 /// 数量类型/1是直接增加/2是赋值 /// 1普通购物还是2团购秒杀3团购模式4秒杀模式6砍价模式7赠品 - /// 团队序列 - /// 团购秒杀规则序列 + /// 关联对象类型 /// - public async Task Add(int userId, int productId, int nums, int numType, int cartTypes = 1, int teamId = 0, int groupId = 0) + public async Task Add(int userId, int productId, int nums, int numType, int cartTypes = 1, int objectId = 0) { var jm = new WebApiCallBack(); @@ -181,7 +179,7 @@ namespace CoreCms.Net.Services var productsServices = container.ServiceProvider.GetService(); var goodsServices = container.ServiceProvider.GetService(); - //获取数据 + //获取数据 if (nums == 0) { jm.msg = "请选择货品数量"; @@ -209,7 +207,7 @@ namespace CoreCms.Net.Services //剩余库存可购判定 var canBuyNum = products.stock; //获取是否存在记录 - var catInfo = await _dal.QueryByClauseAsync(p => p.userId == userId && p.productId == productId); + var catInfo = await _dal.QueryByClauseAsync(p => p.userId == userId && p.productId == productId && p.objectId == objectId); //根据购物车存储类型匹配数据 switch (cartTypes) @@ -220,7 +218,7 @@ namespace CoreCms.Net.Services case (int)GlobalEnumVars.OrderType.PinTuan: numType = (int)GlobalEnumVars.OrderType.PinTuan; //拼团模式去判断是否开启拼团,是否存在 - var callBack = await AddCartHavePinTuan(products.id, userId, nums, teamId); + var callBack = await AddCartHavePinTuan(products.id, userId, nums, objectId); if (callBack.status == false) { return callBack; @@ -229,14 +227,14 @@ namespace CoreCms.Net.Services await _dal.DeleteAsync(p => p.type == (int)GlobalEnumVars.OrderType.PinTuan && p.userId == userId); catInfo = null; break; - case (int)GlobalEnumVars.OrderType.GROUP or (int)GlobalEnumVars.OrderType.SKILL: + case (int)GlobalEnumVars.OrderType.Group or (int)GlobalEnumVars.OrderType.Skill: //标准模式不需要做什么判断 //判断商品是否做团购秒杀 - if (goodsServices.IsInGroup((int)products.goodsId, out var promotionsModel, groupId) == true) + if (goodsServices.IsInGroup((int)products.goodsId, out var promotionsModel, objectId) == true) { jm.msg = "进入判断商品是否做团购秒杀"; - var typeIds = new int[] { (int)GlobalEnumVars.OrderType.GROUP, (int)GlobalEnumVars.OrderType.SKILL }; + var typeIds = new int[] { (int)GlobalEnumVars.OrderType.Group, (int)GlobalEnumVars.OrderType.Skill }; //此人的购物车中的所有购物车拼团商品都删掉,因为立即购买也是要加入购物车的,所以需要清空之前历史的加入过购物车的商品 await _dal.DeleteAsync(p => typeIds.Contains(p.type) && p.productId == products.id && p.userId == userId); catInfo = null; @@ -263,9 +261,11 @@ namespace CoreCms.Net.Services } break; - case (int)GlobalEnumVars.OrderType.BARGAIN: + case (int)GlobalEnumVars.OrderType.Bargain: + break; + case (int)GlobalEnumVars.OrderType.Solitaire: break; default: @@ -286,7 +286,8 @@ namespace CoreCms.Net.Services userId = userId, productId = productId, nums = nums, - type = cartTypes + type = cartTypes, + objectId = objectId }; var outId = await _dal.InsertAsync(catInfo); jm.status = outId > 0; @@ -407,14 +408,16 @@ namespace CoreCms.Net.Services #endregion #region 获取购物车原始列表(未核算) + /// /// 获取购物车原始列表(未核算) /// /// 用户序号 /// 已选择货号 /// 购物车类型/同订单类型 + /// 关联非订单类型数据序列 /// - public async Task GetCartDtoData(int userId, int[] ids = null, int type = 1) + public async Task GetCartDtoData(int userId, int[] ids = null, int type = 1, int objectId = 0) { var jm = new WebApiCallBack() { methodDescription = "获取购物车原始列表(未核算)" }; @@ -486,16 +489,19 @@ namespace CoreCms.Net.Services return result; } break; - case (int)GlobalEnumVars.OrderType.GROUP: + case (int)GlobalEnumVars.OrderType.Group: //团购模式不需要修改订单数据和商品数据 break; - case (int)GlobalEnumVars.OrderType.SKILL: + case (int)GlobalEnumVars.OrderType.Skill: //秒杀模式不需要修改订单数据和商品数据 break; - case (int)GlobalEnumVars.OrderType.BARGAIN: + case (int)GlobalEnumVars.OrderType.Bargain: //砍价模式 break; + case (int)GlobalEnumVars.OrderType.Solitaire: + //接龙模式,去获取接龙商品价格。 + break; default: jm.msg = GlobalErrorCodeVars.Code10000; @@ -524,13 +530,13 @@ namespace CoreCms.Net.Services /// 优惠券码 /// 是否免运费 /// 关联上面的是否免运费/1=快递配送(要去算运费)生成订单记录快递方式 2=门店自提(不需要计算运费)生成订单记录门店自提信息 - /// 传团购或秒杀序列 + /// 关联非普通订单营销类型序列 /// - public async Task GetCartInfos(int userId, int[] ids, int orderType, int areaId, int point, string couponCode, bool freeFreight = false, int deliveryType = (int)GlobalEnumVars.OrderReceiptType.Logistics, int groupId = 0) + public async Task GetCartInfos(int userId, int[] ids, int orderType, int areaId, int point, string couponCode, bool freeFreight = false, int deliveryType = (int)GlobalEnumVars.OrderReceiptType.Logistics, int objectId = 0) { var jm = new WebApiCallBack() { methodDescription = "获取处理后的购物车信息" }; var cartDto = new CartDto(); //必须初始化 - var cartDtoData = await GetCartDtoData(userId, ids, orderType); + var cartDtoData = await GetCartDtoData(userId, ids, orderType, objectId); if (!cartDtoData.status) { jm.msg = "1"; @@ -581,11 +587,11 @@ namespace CoreCms.Net.Services jm.data = await _promotionServices.ToPromotion(cartDto); jm.msg = "订单促销金额计算"; } - else if ((orderType == (int)GlobalEnumVars.OrderType.GROUP || orderType == (int)GlobalEnumVars.OrderType.SKILL) && groupId > 0) + else if ((orderType == (int)GlobalEnumVars.OrderType.Group || orderType == (int)GlobalEnumVars.OrderType.Skill) && objectId > 0) { //团购秒杀默认时间过期后,不可以下单 var dt = DateTime.Now; - var promotionInfo = await _promotionServices.QueryByClauseAsync(p => p.startTime < dt && p.endTime > dt && p.id == groupId); + var promotionInfo = await _promotionServices.QueryByClauseAsync(p => p.startTime < dt && p.endTime > dt && p.id == objectId); var checkRes = await _promotionServices.SetPromotion(promotionInfo, cartDto); if (checkRes == false) diff --git a/CoreCms.Net.Services/CoreCms.Net.Services.csproj b/CoreCms.Net.Services/CoreCms.Net.Services.csproj index e8a57be0ec7d897634ab7143c11ee32a8746ccdc..53bb1847322e8727ab692a279fe2bbd4e7bf2a3e 100644 --- a/CoreCms.Net.Services/CoreCms.Net.Services.csproj +++ b/CoreCms.Net.Services/CoreCms.Net.Services.csproj @@ -5,7 +5,7 @@ - + diff --git a/CoreCms.Net.Services/Order/CoreCmsOrderServices.cs b/CoreCms.Net.Services/Order/CoreCmsOrderServices.cs index 979dfb9a1693281dbbecd39affc496144f0bb66a..79985e174cbff4609c44e295a71e3268b407e15e 100644 --- a/CoreCms.Net.Services/Order/CoreCmsOrderServices.cs +++ b/CoreCms.Net.Services/Order/CoreCmsOrderServices.cs @@ -189,13 +189,14 @@ namespace CoreCms.Net.Services /// 积分 /// 优惠券码 /// 来源平台 + /// 场景值(一般小程序才有) /// 发票信息 /// 发票抬头 /// 发票税务编码 - /// 团队序列 - /// 团购秒杀序列 + /// 关联非普通订单营销功能的序列 + /// 拼团订单分组序列 /// - public async Task ToAdd(int userId, int orderType, string cartIds, int receiptType, int ushipId, int storeId, string ladingName, string ladingMobile, string memo, int point, string couponCode, int source, int taxType, string taxName, string taxCode, int teamId, int groupId) + public async Task ToAdd(int userId, int orderType, string cartIds, int receiptType, int ushipId, int storeId, string ladingName, string ladingMobile, string memo, int point, string couponCode, int source, int scene, int taxType, string taxName, string taxCode, int objectId, int teamId) { var jm = new WebApiCallBack() { methodDescription = "创建订单" }; @@ -206,7 +207,8 @@ namespace CoreCms.Net.Services orderType = orderType, point = point, coupon = couponCode, - receiptType = receiptType + receiptType = receiptType, + objectId = objectId }; //生成收货信息 @@ -224,7 +226,7 @@ namespace CoreCms.Net.Services //通过购物车生成订单信息和订单明细信息 List orderItems; var ids = CommonHelper.StringToIntArray(cartIds); - var orderRes = await FormatOrder(order, userId, ids, areaId, point, couponCode, false, receiptType, groupId); + var orderRes = await FormatOrder(order, userId, ids, areaId, point, couponCode, false, receiptType, objectId); if (!orderRes.status) { return orderRes; @@ -308,21 +310,21 @@ namespace CoreCms.Net.Services return pinTuanRes; } break; - case (int)GlobalEnumVars.OrderType.GROUP: - var groupRes = await _promotionRecordServices.OrderAdd(order, orderItems, groupId, orderType); + case (int)GlobalEnumVars.OrderType.Group: + var groupRes = await _promotionRecordServices.OrderAdd(order, orderItems, objectId, orderType); if (groupRes.status == false) { return groupRes; } break; - case (int)GlobalEnumVars.OrderType.SKILL: - var rskillRes = await _promotionRecordServices.OrderAdd(order, orderItems, groupId, orderType); + case (int)GlobalEnumVars.OrderType.Skill: + var rskillRes = await _promotionRecordServices.OrderAdd(order, orderItems, objectId, orderType); if (rskillRes.status == false) { return rskillRes; } break; - case (int)GlobalEnumVars.OrderType.BARGAIN: + case (int)GlobalEnumVars.OrderType.Bargain: //砍价模式 break; @@ -388,6 +390,7 @@ namespace CoreCms.Net.Services //推送消息 await _messageCenterServices.SendMessage(order.userId, GlobalEnumVars.PlatformMessageTypes.CreateOrder.ToString(), JObject.FromObject(order)); + jm.status = true; jm.data = order; @@ -751,7 +754,7 @@ namespace CoreCms.Net.Services foreach (var item in order.refundItem) { item.paymentCodeName = EnumHelper.GetEnumDescriptionByKey(item.paymentCode); - item.statusName = EnumHelper.GetEnumDescriptionByValue(item.status); + item.statusName = EnumHelper.GetEnumDescriptionByValue(item.status); } } //发货单 diff --git a/CoreCms.Net.Services/Solitaire/CoreCmsSolitaireItemsServices.cs b/CoreCms.Net.Services/Solitaire/CoreCmsSolitaireItemsServices.cs deleted file mode 100644 index ffe5e046adafe2ddc6192ce8a25d1766b4bcd710..0000000000000000000000000000000000000000 --- a/CoreCms.Net.Services/Solitaire/CoreCmsSolitaireItemsServices.cs +++ /dev/null @@ -1,134 +0,0 @@ -/*********************************************************************** - * 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 - - - /// - /// 重写根据条件查询列表数据 - /// - /// 判断集合 - /// 排序方式 - /// - /// 是否使用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 deleted file mode 100644 index 06a8b055f1948dd69372ec33349647d37fc1113a..0000000000000000000000000000000000000000 --- a/CoreCms.Net.Services/Solitaire/CoreCmsSolitaireServices.cs +++ /dev/null @@ -1,115 +0,0 @@ -/*********************************************************************** - * 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.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 重写根据条件查询分页数据 - /// - /// 重写根据条件查询分页数据 - /// - /// 判断集合 - /// 排序方式 - /// 当前页面索引 - /// 分布大小 - /// - /// 是否使用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.Swagger/CoreCms.Net.Swagger.csproj b/CoreCms.Net.Swagger/CoreCms.Net.Swagger.csproj index e980e4271ca3fe434f0fef3a67a607f50c88253e..8c4f0af51935eb40b59e80946e84c889a0926d24 100644 --- a/CoreCms.Net.Swagger/CoreCms.Net.Swagger.csproj +++ b/CoreCms.Net.Swagger/CoreCms.Net.Swagger.csproj @@ -7,7 +7,7 @@ - + diff --git a/CoreCms.Net.Uni-App/CoreShop/components/coreshop-navbar-slot/coreshop-navbar-slot.vue b/CoreCms.Net.Uni-App/CoreShop/components/coreshop-navbar-slot/coreshop-navbar-slot.vue new file mode 100644 index 0000000000000000000000000000000000000000..02ce59cda7826fa6adbacbb8b233ec62aba7ddc0 --- /dev/null +++ b/CoreCms.Net.Uni-App/CoreShop/components/coreshop-navbar-slot/coreshop-navbar-slot.vue @@ -0,0 +1,328 @@ + + + + + diff --git a/CoreCms.Net.Uni-App/CoreShop/pages/activity/groupBuying/details/details.vue b/CoreCms.Net.Uni-App/CoreShop/pages/activity/groupBuying/details/details.vue index e44d63dc98f73c7756b3cd3a424d701e76829838..cc582027ff815cc619d2e738bb06af0d6f206055 100644 --- a/CoreCms.Net.Uni-App/CoreShop/pages/activity/groupBuying/details/details.vue +++ b/CoreCms.Net.Uni-App/CoreShop/pages/activity/groupBuying/details/details.vue @@ -1,11 +1,9 @@