From 44fcf529b141b96228a48c29e43beb6f674ef426 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A7=E7=81=B0=E7=81=B0?= Date: Sun, 16 Jan 2022 18:19:41 +0000 Subject: [PATCH] =?UTF-8?q?!188=20=E5=AE=8C=E5=96=84=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E7=AE=A1=E7=90=86=E5=8A=9F=E8=83=BD=EF=BC=8C?= =?UTF-8?q?=E5=AE=8C=E5=96=84=E5=95=86=E5=93=81=E6=9F=A5=E7=9C=8B=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E5=8A=9F=E8=83=BD=E7=AD=89=E5=85=B6=E4=BB=96=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E3=80=82=20###=201.3.0=20=E5=BC=80=E6=BA=90=E7=A4=BE?= =?UTF-8?q?=E5=8C=BA=E7=89=88=EF=BC=88=E4=BC=9A=E5=91=98=E4=B8=93=E4=B8=9A?= =?UTF-8?q?=E7=89=88=E5=90=8C=E6=AD=A5=EF=BC=89=EF=BC=9A=20=E3=80=90?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E3=80=91=E5=AE=8C=E5=96=84=E5=95=86=E5=93=81?= =?UTF-8?q?=E6=9F=A5=E7=9C=8B=E8=AF=A6=E6=83=85=E5=8A=9F=E8=83=BD=E3=80=82?= =?UTF-8?q?#I4QTLR=20=E3=80=90=E6=96=B0=E5=A2=9E=E3=80=91=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E8=AF=A6=E6=83=85=E9=A1=B5=E9=9D=A2=E9=9C=80=E8=A6=81?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=B8=8B=E5=8D=95=E5=AE=A2=E6=88=B7=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E3=80=82=20=E3=80=90=E6=96=B0=E5=A2=9E=E3=80=91?= =?UTF-8?q?=E5=AE=8C=E5=96=84=E6=9C=8D=E5=8A=A1=E8=AE=A2=E5=8D=95=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E5=8A=9F=E8=83=BD=EF=BC=8C=E5=AE=9E=E7=8E=B0=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E4=BD=9C=E5=BA=9F=E3=80=81=E5=AF=BC=E5=87=BA=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=EF=BC=9B=E6=A0=B8=E9=94=80=E7=A0=81=E5=AE=9E=E7=8E=B0?= =?UTF-8?q?=E5=88=97=E8=A1=A8=EF=BC=8C=E4=BD=9C=E5=BA=9F=EF=BC=8C=E5=AF=BC?= =?UTF-8?q?=E5=87=BA=E5=8A=9F=E8=83=BD=E3=80=82#I4OSBK=20=E3=80=90?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E3=80=91=E4=BF=AE=E5=A4=8D=E6=99=AE=E9=80=9A?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E6=9F=A5=E7=9C=8B=E8=AF=A6=E6=83=85=EF=BC=8C?= =?UTF-8?q?=E5=9B=A0=E4=BC=98=E6=83=A0=E4=BF=A1=E6=81=AF=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E7=9A=84=E5=BC=82=E5=B8=B8=E6=83=85=E5=86=B5?= =?UTF-8?q?=E3=80=82#I4QXUQ=20=E3=80=90=E4=BF=AE=E5=A4=8D=E3=80=91?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=97=A8=E5=BA=97=E5=88=97=E8=A1=A8=E4=B8=8B?= =?UTF-8?q?=E7=9A=84=E7=94=A8=E6=88=B7=E7=BC=96=E8=BE=91=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E5=90=8D=E7=A7=B0=E5=A4=A7=E5=B0=8F=E5=86=99=E9=97=AE=E9=A2=98?= =?UTF-8?q?=EF=BC=88linux=E4=B8=8B=E5=A4=A7=E5=B0=8F=E5=86=99=E6=95=8F?= =?UTF-8?q?=E6=84=9F=E9=97=AE=E9=A2=98=EF=BC=89=E3=80=82=20=E3=80=90?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E3=80=91=E4=BF=AE=E5=A4=8D=E5=BE=AE=E4=BF=A1?= =?UTF-8?q?=E6=94=AF=E4=BB=98=E6=88=90=E5=8A=9F=E7=9B=B8=E5=BA=94=E7=9A=84?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E8=AE=B0=E5=BD=95=E7=B1=BB=E5=9E=8B=E6=9C=89?= =?UTF-8?q?=E8=AF=AF=E3=80=82#I4QSNZ=20=E3=80=90=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E3=80=91=E4=BF=AE=E5=A4=8D=E5=8F=91=E8=B4=A7=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E8=AE=B0=E5=BD=95sku=E8=B4=A7=E5=8F=B7=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E3=80=82#I4PX25=20=E3=80=90=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E3=80=91=E4=BF=AE=E5=A4=8D=E5=8F=91=E8=B4=A7=E5=8D=95?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=9F=A5=E7=9C=8B=E8=AF=A6=E6=83=85=EF=BC=8C?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E6=9D=83=E9=99=90=E4=B8=8D=E8=B6=B3=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E3=80=82#I4QDQR?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ### 0.0.8 会员专业版: 【新增】新增接龙功能营销功能,实现单个活动,可以添加多个不同商品的不同sku混合选择下单。 【新增】增加接龙数据库脚本及演示文件。 【升级】升级uView组件到2.0.20版本。 【修复】修复编辑收货地址的路径中选取区域部分可以手动输入文字。 【修复】修复【微信直播带货】组件缺少获取sku分页数据的问题。#I4QKSU 【优化】调整【微信自定义交易组件】商品类目排序方式及展示内容。#I4QE0N --- CoreCms.Net.Configuration/GlobalEnumVars.cs | 18 +- .../ICoreCmsUserServicesOrderRepository.cs | 22 + .../ICoreCmsUserServicesTicketRepository.cs | 22 + .../ICoreCmsUserServicesOrderServices.cs | 22 + .../ICoreCmsUserServicesTicketServices.cs | 24 + .../Service/CoreCmsUserServicesOrder.cs | 112 +- .../CoreCmsUserServicesOrderPartial.cs | 18 + .../CoreCmsUserServicesOrderRepository.cs | 82 ++ .../CoreCmsUserServicesTicketRepository.cs | 77 ++ .../Bill/CoreCmsBillDeliveryServices.cs | 2 +- .../Order/CoreCmsOrderServices.cs | 6 +- .../CoreCmsUserServicesOrderServices.cs | 25 + .../CoreCmsUserServicesTicketServices.cs | 25 +- .../Controllers/Com/ToolsController.cs | 1 - .../Good/CoreCmsGoodsController.cs | 90 +- .../CoreCmsUserServicesOrderController.cs | 996 ++++++++++++++---- .../CoreCmsUserServicesTicketController.cs | 948 ----------------- ...ServicesTicketVerificationLogController.cs | 631 ----------- .../wwwroot/views/good/goods/details.html | 744 +++++++++++++ .../wwwroot/views/good/goods/index.html | 40 +- .../wwwroot/views/order/orders/details.html | 20 + .../views/order/servicesOrder/create.html | 133 +-- .../views/order/servicesOrder/details.html | 358 +++++-- .../views/order/servicesOrder/edit.html | 128 ++- .../views/order/servicesOrder/index.html | 256 ++--- .../serviceGoods/servicesticket/create.html | 140 --- .../serviceGoods/servicesticket/details.html | 143 --- .../serviceGoods/servicesticket/edit.html | 140 --- .../serviceGoods/servicesticket/index.html | 447 -------- .../servicesticketverificationlog/create.html | 78 -- .../details.html | 80 -- .../servicesticketverificationlog/edit.html | 78 -- .../servicesticketverificationlog/index.html | 362 ------- .../wwwroot/views/shop/store/index.html | 2 +- .../PayNotify/WeChatPayController.cs | 3 +- 35 files changed, 2562 insertions(+), 3711 deletions(-) delete mode 100644 CoreCms.Net.Web.Admin/Controllers/ServiceGoods/CoreCmsUserServicesTicketController.cs delete mode 100644 CoreCms.Net.Web.Admin/Controllers/ServiceGoods/CoreCmsUserServicesTicketVerificationLogController.cs create mode 100644 CoreCms.Net.Web.Admin/wwwroot/views/good/goods/details.html delete mode 100644 CoreCms.Net.Web.Admin/wwwroot/views/serviceGoods/servicesticket/create.html delete mode 100644 CoreCms.Net.Web.Admin/wwwroot/views/serviceGoods/servicesticket/details.html delete mode 100644 CoreCms.Net.Web.Admin/wwwroot/views/serviceGoods/servicesticket/edit.html delete mode 100644 CoreCms.Net.Web.Admin/wwwroot/views/serviceGoods/servicesticket/index.html delete mode 100644 CoreCms.Net.Web.Admin/wwwroot/views/serviceGoods/servicesticketverificationlog/create.html delete mode 100644 CoreCms.Net.Web.Admin/wwwroot/views/serviceGoods/servicesticketverificationlog/details.html delete mode 100644 CoreCms.Net.Web.Admin/wwwroot/views/serviceGoods/servicesticketverificationlog/edit.html delete mode 100644 CoreCms.Net.Web.Admin/wwwroot/views/serviceGoods/servicesticketverificationlog/index.html diff --git a/CoreCms.Net.Configuration/GlobalEnumVars.cs b/CoreCms.Net.Configuration/GlobalEnumVars.cs index 52f7fdd..4de6a65 100644 --- a/CoreCms.Net.Configuration/GlobalEnumVars.cs +++ b/CoreCms.Net.Configuration/GlobalEnumVars.cs @@ -2491,27 +2491,25 @@ namespace CoreCms.Net.Configuration /// /// 正常 /// - [Description("正常")] + [Description("")] Normal = 0, /// /// 过期 /// - [Description("过期")] + [Description("")] Overdue = 1, /// /// 作废 /// - [Description("作废")] + [Description("")] Cancellation = 2, /// /// 已核销 /// - [Description("已核销")] + [Description("")] Verification = 3 } - - /// /// 服务订单状态 /// @@ -2520,24 +2518,24 @@ namespace CoreCms.Net.Configuration /// /// 正常 /// - [Description("正常")] + [Description("")] 正常 = 1, /// /// 作废 /// - [Description("作废")] + [Description("")] 作废 = 2, /// /// 过期 /// - [Description("过期")] + [Description("")] 过期 = 3, /// /// 用罄 /// - [Description("用罄")] + [Description("")] 用罄 = 4 } diff --git a/CoreCms.Net.IRepository/Service/ICoreCmsUserServicesOrderRepository.cs b/CoreCms.Net.IRepository/Service/ICoreCmsUserServicesOrderRepository.cs index 540514d..2a42605 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 aae3456..0b62d69 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.IServices/Service/ICoreCmsUserServicesOrderServices.cs b/CoreCms.Net.IServices/Service/ICoreCmsUserServicesOrderServices.cs index bc14691..4af1d39 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 bf45469..ab91542 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.Model/Entities/Service/CoreCmsUserServicesOrder.cs b/CoreCms.Net.Model/Entities/Service/CoreCmsUserServicesOrder.cs index bf8154a..0bb6e28 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 57a418f..a744c27 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.Repository/Service/CoreCmsUserServicesOrderRepository.cs b/CoreCms.Net.Repository/Service/CoreCmsUserServicesOrderRepository.cs index 18f7ad1..464284b 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 dce63fb..46603d6 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.Services/Bill/CoreCmsBillDeliveryServices.cs b/CoreCms.Net.Services/Bill/CoreCmsBillDeliveryServices.cs index c79c120..bbd7c94 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/Order/CoreCmsOrderServices.cs b/CoreCms.Net.Services/Order/CoreCmsOrderServices.cs index a4cfad9..b41d757 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 48c34f9..9077cdf 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 26c0e8f..a0b10a9 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.Web.Admin/Controllers/Com/ToolsController.cs b/CoreCms.Net.Web.Admin/Controllers/Com/ToolsController.cs index df8cea0..cc4c2aa 100644 --- a/CoreCms.Net.Web.Admin/Controllers/Com/ToolsController.cs +++ b/CoreCms.Net.Web.Admin/Controllers/Com/ToolsController.cs @@ -1126,7 +1126,6 @@ namespace CoreCms.Net.Web.Admin.Controllers /// /// [HttpPost] - [Authorize(Permissions.Name)] public async Task LogisticsByApi([FromBody] FMApiLogisticsByApiPost entity) { var jm = new WebApiCallBack(); diff --git a/CoreCms.Net.Web.Admin/Controllers/Good/CoreCmsGoodsController.cs b/CoreCms.Net.Web.Admin/Controllers/Good/CoreCmsGoodsController.cs index 59acfbb..5295305 100644 --- a/CoreCms.Net.Web.Admin/Controllers/Good/CoreCmsGoodsController.cs +++ b/CoreCms.Net.Web.Admin/Controllers/Good/CoreCmsGoodsController.cs @@ -628,11 +628,99 @@ namespace CoreCms.Net.Web.Admin.Controllers if (model == null) { jm.msg = "不存在此信息"; + jm.data = entity.id; return jm; } jm.code = 0; - jm.data = model; + + //获取商品分类 + var categories = await _coreCmsGoodsCategoryServices.GetCaChe(); + categories = categories.Where(p => p.isShow == true).ToList(); + + //获取用户等级 + var userGrade = await _userGradeServices.QueryAsync(); + //用户价格体系 + var goodsGrades = await _goodsGradeServices.QueryListByClauseAsync(p => p.goodsId == model.id); + //货品信息 + var products = + await _productsServices.QueryListByClauseAsync(p => p.goodsId == model.id && p.isDel == false); + //扩展信息 + var categoryExtend = await _categoryExtendServices.QueryListByClauseAsync(p => p.goodsId == model.id); + //获取商品分销enum + var productsDistributionType = EnumHelper.EnumToList(); + + + //获取参数列表 + var paramsList = await _goodsParamsServices.QueryListByClauseAsync(p => p.id > 0, p => p.id, OrderByType.Desc, true); + //获取SKU列表 + var skuList = await _goodsTypeSpecServices.QueryListByClauseAsync(p => p.id > 0, p => p.id, OrderByType.Desc, true); + + //获取品牌 + var brands = await _brandServices.QueryListByClauseAsync(p => p.id > 0 && p.isShow == true, p => p.id, OrderByType.Desc, true); + + + if (products != null && products.Any()) + { + var pIds = products.Select(p => p.id).ToList(); + if (pIds.Any()) + { + // 获取商品分销明细 + var pds = await _productsDistributionServices.QueryListByClauseAsync(p => pIds.Contains(p.productsId), p => p.id, OrderByType.Asc); + products.ForEach(p => + { + foreach (var o in pds.Where(o => o.productsId == p.id)) + { + p.levelOne = o.levelOne; + p.levelTwo = o.levelTwo; + p.levelThree = o.levelThree; + } + }); + jm.otherData = pds; + } + + } + + //获取参数信息 + var goodsTypeSpec = new List(); + var goodsParams = new List(); + + //获取参数 + if (!string.IsNullOrEmpty(model.goodsParamsIds)) + { + var paramsIds = Utility.Helper.CommonHelper.StringToIntArray(model.goodsParamsIds); + goodsParams = await _goodsParamsServices.QueryListByClauseAsync(p => paramsIds.Contains(p.id)); + } + + //获取属性 + if (!string.IsNullOrEmpty(model.goodsSkuIds)) + { + var specIds = Utility.Helper.CommonHelper.StringToIntArray(model.goodsSkuIds); + var typeSpecs = await _typeSpecServices.QueryListByClauseAsync(p => specIds.Contains(p.id)); + var typeSpecValues = await _typeSpecValueServices.QueryListByClauseAsync(p => specIds.Contains(p.specId)); + typeSpecs.ForEach(p => + { + p.specValues = typeSpecValues.Where(o => o.specId == p.id).ToList(); + }); + goodsTypeSpec = typeSpecs; + } + + jm.data = new + { + model, + categories = GoodsHelper.GetTree(categories, false), + brands, + userGrade, + goodsGrades, + products, + categoryExtend, + goodsTypeSpec, + goodsParams, + productsDistributionType, + paramsList, + skuList + }; + return jm; } diff --git a/CoreCms.Net.Web.Admin/Controllers/ServiceGoods/CoreCmsUserServicesOrderController.cs b/CoreCms.Net.Web.Admin/Controllers/ServiceGoods/CoreCmsUserServicesOrderController.cs index 94a4e44..18c3922 100644 --- a/CoreCms.Net.Web.Admin/Controllers/ServiceGoods/CoreCmsUserServicesOrderController.cs +++ b/CoreCms.Net.Web.Admin/Controllers/ServiceGoods/CoreCmsUserServicesOrderController.cs @@ -4,31 +4,32 @@ * Web: https://www.corecms.net * Author: 大灰灰 * Email: jianweie@163.com - * CreateTime: 2021/1/31 21:45:10 + * CreateTime: 2022/1/15 1:30:57 * Description: 暂无 ***********************************************************************/ + +using System; +using System.ComponentModel; +using System.IO; +using System.Linq; +using System.Linq.Expressions; +using System.Threading.Tasks; using CoreCms.Net.Configuration; -using CoreCms.Net.Filter; -using CoreCms.Net.IServices; -using CoreCms.Net.Loging; using CoreCms.Net.Model.Entities; using CoreCms.Net.Model.Entities.Expression; using CoreCms.Net.Model.FromBody; using CoreCms.Net.Model.ViewModels.UI; -using CoreCms.Net.Utility.Extensions; +using CoreCms.Net.Filter; +using CoreCms.Net.Loging; +using CoreCms.Net.IServices; using CoreCms.Net.Utility.Helper; +using CoreCms.Net.Utility.Extensions; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Mvc; using NPOI.HSSF.UserModel; using SqlSugar; -using System; -using System.ComponentModel; -using System.IO; -using System.Linq; -using System.Linq.Expressions; -using System.Threading.Tasks; namespace CoreCms.Net.Web.Admin.Controllers { @@ -39,25 +40,27 @@ namespace CoreCms.Net.Web.Admin.Controllers [Route("api/[controller]/[action]")] [ApiController] [RequiredErrorForAdmin] - [Authorize(Permissions.Name)] + [Authorize] public class CoreCmsUserServicesOrderController : ControllerBase { private readonly IWebHostEnvironment _webHostEnvironment; - private readonly ICoreCmsUserServicesOrderServices _CoreCmsUserServicesOrderServices; + private readonly ICoreCmsUserServicesOrderServices _coreCmsUserServicesOrderServices; + + private readonly ICoreCmsUserServicesTicketServices _coreCmsUserServicesTicketServices; + /// /// 构造函数 /// public CoreCmsUserServicesOrderController(IWebHostEnvironment webHostEnvironment - , ICoreCmsUserServicesOrderServices CoreCmsUserServicesOrderServices - ) + , ICoreCmsUserServicesOrderServices coreCmsUserServicesOrderServices, ICoreCmsUserServicesTicketServices coreCmsUserServicesTicketServices) { _webHostEnvironment = webHostEnvironment; - _CoreCmsUserServicesOrderServices = CoreCmsUserServicesOrderServices; + _coreCmsUserServicesOrderServices = coreCmsUserServicesOrderServices; + _coreCmsUserServicesTicketServices = coreCmsUserServicesTicketServices; } #region 获取列表============================================================ - // POST: Api/CoreCmsUserServicesOrder/GetPageList /// /// 获取列表 @@ -73,53 +76,22 @@ namespace CoreCms.Net.Web.Admin.Controllers var where = PredicateBuilder.True(); //获取排序字段 var orderField = Request.Form["orderField"].FirstOrDefault(); - Expression> orderEx; - switch (orderField) - { - case "id": - orderEx = p => p.id; - break; - - case "serviceOrderId": - orderEx = p => p.serviceOrderId; - break; - - case "userId": - orderEx = p => p.userId; - break; - - case "servicesId": - orderEx = p => p.servicesId; - break; - - case "isPay": - orderEx = p => p.isPay; - break; - - case "payTime": - orderEx = p => p.payTime; - break; - - case "paymentId": - orderEx = p => p.paymentId; - break; - - case "status": - orderEx = p => p.status; - break; - case "createTime": - orderEx = p => p.createTime; - break; - - case "servicesEndTime": - orderEx = p => p.servicesEndTime; - break; + Expression> orderEx = orderField switch + { + "id" => p => p.id, + "serviceOrderId" => p => p.serviceOrderId, + "userId" => p => p.userId, + "servicesId" => p => p.servicesId, + "isPay" => p => p.isPay, + "payTime" => p => p.payTime, + "paymentId" => p => p.paymentId, + "status" => p => p.status, + "createTime" => p => p.createTime, + "servicesEndTime" => p => p.servicesEndTime, + _ => p => p.id + }; - default: - orderEx = p => p.id; - break; - } //设置排序方式 var orderDirection = Request.Form["orderDirection"].FirstOrDefault(); var orderBy = orderDirection switch @@ -231,7 +203,7 @@ namespace CoreCms.Net.Web.Admin.Controllers } } //获取数据 - var list = await _CoreCmsUserServicesOrderServices.QueryPageAsync(where, orderEx, orderBy, pageCurrent, pageSize); + var list = await _coreCmsUserServicesOrderServices.QueryPageAsync(where, orderEx, orderBy, pageCurrent, pageSize, true); //返回数据 jm.data = list; jm.code = 0; @@ -239,11 +211,9 @@ namespace CoreCms.Net.Web.Admin.Controllers jm.msg = "数据调用成功!"; return jm; } - - #endregion 获取列表============================================================ + #endregion #region 首页数据============================================================ - // POST: Api/CoreCmsUserServicesOrder/GetIndex /// /// 首页数据 @@ -255,175 +225,50 @@ namespace CoreCms.Net.Web.Admin.Controllers { //返回数据 var jm = new AdminUiCallBack { code = 0 }; - return jm; - } - - #endregion 首页数据============================================================ - - #region 创建数据============================================================ - - // POST: Api/CoreCmsUserServicesOrder/GetCreate - /// - /// 创建数据 - /// - /// - [HttpPost] - [Description("创建数据")] - public AdminUiCallBack GetCreate() - { - //返回数据 - var jm = new AdminUiCallBack { code = 0 }; - return jm; - } - - #endregion 创建数据============================================================ - - #region 创建提交============================================================ - - // POST: Api/CoreCmsUserServicesOrder/DoCreate - /// - /// 创建提交 - /// - /// - /// - [HttpPost] - [Description("创建提交")] - public async Task DoCreate([FromBody] CoreCmsUserServicesOrder entity) - { - var jm = new AdminUiCallBack(); - - var bl = await _CoreCmsUserServicesOrderServices.InsertAsync(entity) > 0; - jm.code = bl ? 0 : 1; - jm.msg = (bl ? GlobalConstVars.CreateSuccess : GlobalConstVars.CreateFailure); - return jm; - } - - #endregion 创建提交============================================================ - - #region 编辑数据============================================================ - - // POST: Api/CoreCmsUserServicesOrder/GetEdit - /// - /// 编辑数据 - /// - /// - /// - [HttpPost] - [Description("编辑数据")] - public async Task GetEdit([FromBody] FMIntId entity) - { - var jm = new AdminUiCallBack(); - - var model = await _CoreCmsUserServicesOrderServices.QueryByIdAsync(entity.id); - if (model == null) - { - jm.msg = "不存在此信息"; - return jm; - } - jm.code = 0; - jm.data = model; - - return jm; - } - - #endregion 编辑数据============================================================ - - #region 编辑提交============================================================ - - // POST: Api/CoreCmsUserServicesOrder/Edit - /// - /// 编辑提交 - /// - /// - /// - [HttpPost] - [Description("编辑提交")] - public async Task DoEdit([FromBody] CoreCmsUserServicesOrder entity) - { - var jm = new AdminUiCallBack(); + var serviceOrderStatus = EnumHelper.EnumToList(); - var oldModel = await _CoreCmsUserServicesOrderServices.QueryByIdAsync(entity.id); - if (oldModel == null) + jm.data = new { - jm.msg = "不存在此信息"; - return jm; - } - //事物处理过程开始 - oldModel.id = entity.id; - oldModel.serviceOrderId = entity.serviceOrderId; - oldModel.userId = entity.userId; - oldModel.servicesId = entity.servicesId; - oldModel.isPay = entity.isPay; - oldModel.payTime = entity.payTime; - oldModel.paymentId = entity.paymentId; - oldModel.status = entity.status; - oldModel.createTime = entity.createTime; - oldModel.servicesEndTime = entity.servicesEndTime; - - //事物处理过程结束 - var bl = await _CoreCmsUserServicesOrderServices.UpdateAsync(oldModel); - jm.code = bl ? 0 : 1; - jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure; + serviceOrderStatus + }; return jm; } + #endregion - #endregion 编辑提交============================================================ - - #region 删除数据============================================================ - - // POST: Api/CoreCmsUserServicesOrder/DoDelete/10 + #region 作废订单============================================================ + // POST: Api/CoreCmsUserServicesOrder/DoCancellation/10 /// - /// 单选删除 + /// 作废订单 /// /// /// [HttpPost] - [Description("单选删除")] - public async Task DoDelete([FromBody] FMIntId entity) + [Description("作废订单")] + public async Task DoCancellation([FromBody] FMIntId entity) { var jm = new AdminUiCallBack(); - var model = await _CoreCmsUserServicesOrderServices.QueryByIdAsync(entity.id); - if (model == null) + var model = await _coreCmsUserServicesOrderServices.ExistsAsync(p => p.id == entity.id, true); + if (!model) { jm.msg = GlobalConstVars.DataisNo; return jm; } - var bl = await _CoreCmsUserServicesOrderServices.DeleteByIdAsync(entity.id); - jm.code = bl ? 0 : 1; - jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure; - return jm; - } - - #endregion 删除数据============================================================ - #region 批量删除============================================================ - - // POST: Api/CoreCmsUserServicesOrder/DoBatchDelete/10,11,20 - /// - /// 批量删除 - /// - /// - /// - [HttpPost] - [Description("批量删除")] - public async Task DoBatchDelete([FromBody] FMArrayIntIds entity) - { - var jm = new AdminUiCallBack(); + var bl = await _coreCmsUserServicesOrderServices.UpdateAsync( + p => new CoreCmsUserServicesOrder() { status = (int)GlobalEnumVars.ServicesOrderStatus.作废 }, + p => p.id == entity.id); - var bl = await _CoreCmsUserServicesOrderServices.DeleteByIdsAsync(entity.id); jm.code = bl ? 0 : 1; - jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure; + jm.msg = bl ? "作废成功" : "作废失败"; return jm; } - - #endregion 批量删除============================================================ + #endregion #region 预览数据============================================================ - // POST: Api/CoreCmsUserServicesOrder/GetDetails/10 /// /// 预览数据 @@ -436,22 +281,29 @@ namespace CoreCms.Net.Web.Admin.Controllers { var jm = new AdminUiCallBack(); - var model = await _CoreCmsUserServicesOrderServices.QueryByIdAsync(entity.id); + var model = await _coreCmsUserServicesOrderServices.QueryByIdAsync(entity.id, false); if (model == null) { jm.msg = "不存在此信息"; return jm; } jm.code = 0; - jm.data = model; + + var servicesTicketStatus = EnumHelper.EnumToList(); + //服务核销有效期类型 + var types = EnumHelper.EnumToList(); + jm.data = new + { + model, + servicesTicketStatus, + types + }; return jm; } - - #endregion 预览数据============================================================ + #endregion #region 选择导出============================================================ - // POST: Api/CoreCmsUserServicesOrder/SelectExportExcel/10 /// /// 选择导出 @@ -469,7 +321,7 @@ namespace CoreCms.Net.Web.Admin.Controllers //添加一个sheet var mySheet = book.CreateSheet("Sheet1"); //获取list数据 - var listModel = await _CoreCmsUserServicesOrderServices.QueryListByClauseAsync(p => entity.id.Contains(p.id), p => p.id, OrderByType.Asc); + var listModel = await _coreCmsUserServicesOrderServices.QueryListByClauseAsync(p => entity.id.Contains(p.id), p => p.id, OrderByType.Asc, true); //给sheet1添加第一行的头部标题 var headerRow = mySheet.CreateRow(0); var headerStyle = ExcelHelper.GetHeaderStyle(book); @@ -571,6 +423,7 @@ namespace CoreCms.Net.Web.Admin.Controllers var rowTemp9 = rowTemp.CreateCell(9); rowTemp9.SetCellValue(listModel[i].servicesEndTime.ToString()); rowTemp9.CellStyle = commonCellStyle; + } // 导出excel string webRootPath = _webHostEnvironment.WebRootPath; @@ -592,11 +445,9 @@ namespace CoreCms.Net.Web.Admin.Controllers return jm; } - - #endregion 选择导出============================================================ + #endregion #region 查询导出============================================================ - // POST: Api/CoreCmsUserServicesOrder/QueryExportExcel/10 /// /// 查询导出 @@ -684,7 +535,7 @@ namespace CoreCms.Net.Web.Admin.Controllers //添加一个sheet var mySheet = book.CreateSheet("Sheet1"); //获取list数据 - var listModel = await _CoreCmsUserServicesOrderServices.QueryListByClauseAsync(where, p => p.id, OrderByType.Asc); + var listModel = await _coreCmsUserServicesOrderServices.QueryListByClauseAsync(where, p => p.id, OrderByType.Asc, true); //给sheet1添加第一行的头部标题 var headerRow = mySheet.CreateRow(0); var headerStyle = ExcelHelper.GetHeaderStyle(book); @@ -739,6 +590,7 @@ namespace CoreCms.Net.Web.Admin.Controllers cell9.CellStyle = headerStyle; mySheet.SetColumnWidth(9, 10 * 256); + headerRow.Height = 30 * 20; var commonCellStyle = ExcelHelper.GetCommonStyle(book); @@ -747,45 +599,66 @@ namespace CoreCms.Net.Web.Admin.Controllers { var rowTemp = mySheet.CreateRow(i + 1); + var rowTemp0 = rowTemp.CreateCell(0); rowTemp0.SetCellValue(listModel[i].id.ToString()); rowTemp0.CellStyle = commonCellStyle; + + var rowTemp1 = rowTemp.CreateCell(1); rowTemp1.SetCellValue(listModel[i].serviceOrderId.ToString()); rowTemp1.CellStyle = commonCellStyle; + + var rowTemp2 = rowTemp.CreateCell(2); rowTemp2.SetCellValue(listModel[i].userId.ToString()); rowTemp2.CellStyle = commonCellStyle; + + var rowTemp3 = rowTemp.CreateCell(3); rowTemp3.SetCellValue(listModel[i].servicesId.ToString()); rowTemp3.CellStyle = commonCellStyle; + + var rowTemp4 = rowTemp.CreateCell(4); rowTemp4.SetCellValue(listModel[i].isPay.ToString()); rowTemp4.CellStyle = commonCellStyle; + + var rowTemp5 = rowTemp.CreateCell(5); rowTemp5.SetCellValue(listModel[i].payTime.ToString()); rowTemp5.CellStyle = commonCellStyle; + + var rowTemp6 = rowTemp.CreateCell(6); rowTemp6.SetCellValue(listModel[i].paymentId.ToString()); rowTemp6.CellStyle = commonCellStyle; + + var rowTemp7 = rowTemp.CreateCell(7); rowTemp7.SetCellValue(listModel[i].status.ToString()); rowTemp7.CellStyle = commonCellStyle; + + var rowTemp8 = rowTemp.CreateCell(8); rowTemp8.SetCellValue(listModel[i].createTime.ToString()); rowTemp8.CellStyle = commonCellStyle; + + var rowTemp9 = rowTemp.CreateCell(9); rowTemp9.SetCellValue(listModel[i].servicesEndTime.ToString()); rowTemp9.CellStyle = commonCellStyle; + + } // 写入到excel string webRootPath = _webHostEnvironment.WebRootPath; @@ -807,11 +680,10 @@ namespace CoreCms.Net.Web.Admin.Controllers return jm; } + #endregion - #endregion 查询导出============================================================ #region 设置是否支付============================================================ - // POST: Api/CoreCmsUserServicesOrder/DoSetisPay/10 /// /// 设置是否支付 @@ -824,7 +696,7 @@ namespace CoreCms.Net.Web.Admin.Controllers { var jm = new AdminUiCallBack(); - var oldModel = await _CoreCmsUserServicesOrderServices.QueryByIdAsync(entity.id); + var oldModel = await _coreCmsUserServicesOrderServices.QueryByIdAsync(entity.id, false); if (oldModel == null) { jm.msg = "不存在此信息"; @@ -832,13 +704,689 @@ namespace CoreCms.Net.Web.Admin.Controllers } oldModel.isPay = (bool)entity.data; - var bl = await _CoreCmsUserServicesOrderServices.UpdateAsync(oldModel); + var bl = await _coreCmsUserServicesOrderServices.UpdateAsync(p => new CoreCmsUserServicesOrder() { isPay = oldModel.isPay }, p => p.id == oldModel.id); jm.code = bl ? 0 : 1; jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure; return jm; } + #endregion + + + #region 获取核销码列表============================================================ + // POST: Api/CoreCmsUserServicesTicket/GetPageList + /// + /// 获取核销码列表 + /// + /// + [HttpPost] + [Description("获取核销码列表")] + public async Task GetTicketPageList(string serviceOrderId) + { + var jm = new AdminUiCallBack(); + var pageCurrent = Request.Form["page"].FirstOrDefault().ObjectToInt(1); + var pageSize = Request.Form["limit"].FirstOrDefault().ObjectToInt(30); + var where = PredicateBuilder.True(); + + //关联购买订单 nvarchar + if (!string.IsNullOrEmpty(serviceOrderId)) + { + where = where.And(p => p.serviceOrderId == serviceOrderId); + } + else + { + jm.msg = "订单获取失败"; + return jm; + } + + //获取排序字段 + var orderField = Request.Form["orderField"].FirstOrDefault(); + + Expression> orderEx = orderField switch + { + "id" => p => p.id, + "serviceOrderId" => p => p.serviceOrderId, + "securityCode" => p => p.securityCode, + "redeemCode" => p => p.redeemCode, + "serviceId" => p => p.serviceId, + "userId" => p => p.userId, + "status" => p => p.status, + "validityType" => p => p.validityType, + "validityStartTime" => p => p.validityStartTime, + "validityEndTime" => p => p.validityEndTime, + "createTime" => p => p.createTime, + "isVerification" => p => p.isVerification, + "verificationTime" => p => p.verificationTime, + _ => p => p.id + }; + + //设置排序方式 + var orderDirection = Request.Form["orderDirection"].FirstOrDefault(); + var orderBy = orderDirection switch + { + "asc" => OrderByType.Asc, + "desc" => OrderByType.Desc, + _ => OrderByType.Desc + }; + //查询筛选 + + //安全码 uniqueidentifier + //var securityCode = Request.Form["securityCode"].FirstOrDefault(); + //if (!string.IsNullOrEmpty(securityCode)) + //{ + // where = where.And(p => p.securityCode.Contains(securityCode)); + //} + //兑换码 nvarchar + var redeemCode = Request.Form["redeemCode"].FirstOrDefault(); + if (!string.IsNullOrEmpty(redeemCode)) + { + where = where.And(p => p.redeemCode.Contains(redeemCode)); + } + //关联服务项目id int + var serviceId = Request.Form["serviceId"].FirstOrDefault().ObjectToInt(0); + if (serviceId > 0) + { + where = where.And(p => p.serviceId == serviceId); + } + //关联用户id int + var userId = Request.Form["userId"].FirstOrDefault().ObjectToInt(0); + if (userId > 0) + { + where = where.And(p => p.userId == userId); + } + //状态 int + var status = Request.Form["status"].FirstOrDefault().ObjectToInt(0); + if (status > 0) + { + where = where.And(p => p.status == status); + } + //核销有效期类型 int + var validityType = Request.Form["validityType"].FirstOrDefault().ObjectToInt(0); + if (validityType > 0) + { + where = where.And(p => p.validityType == validityType); + } + //核销开始时间 datetime + var validityStartTime = Request.Form["validityStartTime"].FirstOrDefault(); + if (!string.IsNullOrEmpty(validityStartTime)) + { + if (validityStartTime.Contains("到")) + { + var dts = validityStartTime.Split("到"); + var dtStart = dts[0].Trim().ObjectToDate(); + where = where.And(p => p.validityStartTime > dtStart); + var dtEnd = dts[1].Trim().ObjectToDate(); + where = where.And(p => p.validityStartTime < dtEnd); + } + else + { + var dt = validityStartTime.ObjectToDate(); + where = where.And(p => p.validityStartTime > dt); + } + } + //核销结束时间 datetime + var validityEndTime = Request.Form["validityEndTime"].FirstOrDefault(); + if (!string.IsNullOrEmpty(validityEndTime)) + { + if (validityEndTime.Contains("到")) + { + var dts = validityEndTime.Split("到"); + var dtStart = dts[0].Trim().ObjectToDate(); + where = where.And(p => p.validityEndTime > dtStart); + var dtEnd = dts[1].Trim().ObjectToDate(); + where = where.And(p => p.validityEndTime < dtEnd); + } + else + { + var dt = validityEndTime.ObjectToDate(); + where = where.And(p => p.validityEndTime > dt); + } + } + //创建时间 datetime + var createTime = Request.Form["createTime"].FirstOrDefault(); + if (!string.IsNullOrEmpty(createTime)) + { + if (createTime.Contains("到")) + { + var dts = createTime.Split("到"); + var dtStart = dts[0].Trim().ObjectToDate(); + where = where.And(p => p.createTime > dtStart); + var dtEnd = dts[1].Trim().ObjectToDate(); + where = where.And(p => p.createTime < dtEnd); + } + else + { + var dt = createTime.ObjectToDate(); + where = where.And(p => p.createTime > dt); + } + } + //是否核销 bit + var isVerification = Request.Form["isVerification"].FirstOrDefault(); + if (!string.IsNullOrEmpty(isVerification) && isVerification.ToLowerInvariant() == "true") + { + where = where.And(p => p.isVerification == true); + } + else if (!string.IsNullOrEmpty(isVerification) && isVerification.ToLowerInvariant() == "false") + { + where = where.And(p => p.isVerification == false); + } + //核销时间 datetime + var verificationTime = Request.Form["verificationTime"].FirstOrDefault(); + if (!string.IsNullOrEmpty(verificationTime)) + { + if (verificationTime.Contains("到")) + { + var dts = verificationTime.Split("到"); + var dtStart = dts[0].Trim().ObjectToDate(); + where = where.And(p => p.verificationTime > dtStart); + var dtEnd = dts[1].Trim().ObjectToDate(); + where = where.And(p => p.verificationTime < dtEnd); + } + else + { + var dt = verificationTime.ObjectToDate(); + where = where.And(p => p.verificationTime > dt); + } + } + //获取数据 + var list = await _coreCmsUserServicesTicketServices.QueryPageAsync(where, orderEx, orderBy, pageCurrent, pageSize, true); + //返回数据 + jm.data = list; + jm.code = 0; + jm.count = list.TotalCount; + jm.msg = "数据调用成功!"; + jm.otherData = serviceOrderId; + return jm; + } + #endregion + + #region 作废核销码记录============================================================ + // POST: Api/CoreCmsUserServicesTicket/DoDelete/10 + /// + /// 作废核销码记录 + /// + /// + /// + [HttpPost] + [Description("作废记录")] + public async Task DoCancellationTicket([FromBody] FMIntId entity) + { + var jm = new AdminUiCallBack(); + + var oldModel = await _coreCmsUserServicesTicketServices.QueryByIdAsync(entity.id); + if (oldModel == null) + { + jm.msg = "不存在此信息"; + return jm; + } + oldModel.status = (int)GlobalEnumVars.ServicesTicketStatus.Cancellation; + + + var bl = await _coreCmsUserServicesTicketServices.UpdateAsync(oldModel); + jm.code = bl ? 0 : 1; + jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure; + + return jm; + } + #endregion + + #region 设置核销码是否核销============================================================ + + // POST: Api/CoreCmsUserServicesOrder/DoSetisVerification/10 + /// + /// 设置核销码是否核销 + /// + /// + /// + [HttpPost] + [Description("设置核销码是否核销")] + public async Task DoSetisVerification([FromBody] FMUpdateBoolDataByIntId entity) + { + var jm = new AdminUiCallBack(); + + var oldModel = await _coreCmsUserServicesTicketServices.QueryByIdAsync(entity.id); + if (oldModel == null) + { + jm.msg = "不存在此信息"; + return jm; + } + oldModel.isVerification = (bool)entity.data; + + var bl = await _coreCmsUserServicesTicketServices.UpdateAsync(oldModel); + jm.code = bl ? 0 : 1; + jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure; + + return jm; + } + + #endregion 设置核销码是否核销============================================================ + + #region 选择核销码导出============================================================ + + // POST: Api/CoreCmsUserServicesOrder/SelectExportExcel/10 + /// + /// 选择核销码导出 + /// + /// + /// + [HttpPost] + [Description("选择核销码导出")] + public async Task SelectTicketExportExcel([FromBody] FMArrayIntIds entity) + { + var jm = new AdminUiCallBack(); + + //创建Excel文件的对象 + var book = new HSSFWorkbook(); + //添加一个sheet + var mySheet = book.CreateSheet("Sheet1"); + //获取list数据 + var listModel = await _coreCmsUserServicesTicketServices.QueryListByClauseAsync(p => entity.id.Contains(p.id), p => p.id, OrderByType.Asc); + //给sheet1添加第一行的头部标题 + var headerRow = mySheet.CreateRow(0); + var headerStyle = ExcelHelper.GetHeaderStyle(book); + + var cell0 = headerRow.CreateCell(0); + cell0.SetCellValue("序列"); + cell0.CellStyle = headerStyle; + mySheet.SetColumnWidth(0, 10 * 256); + + var cell1 = headerRow.CreateCell(1); + cell1.SetCellValue("关联购买订单"); + cell1.CellStyle = headerStyle; + mySheet.SetColumnWidth(1, 10 * 256); + + var cell2 = headerRow.CreateCell(2); + cell2.SetCellValue("安全码"); + cell2.CellStyle = headerStyle; + mySheet.SetColumnWidth(2, 10 * 256); + + var cell3 = headerRow.CreateCell(3); + cell3.SetCellValue("兑换码"); + cell3.CellStyle = headerStyle; + mySheet.SetColumnWidth(3, 10 * 256); + + var cell4 = headerRow.CreateCell(4); + cell4.SetCellValue("关联服务项目id"); + cell4.CellStyle = headerStyle; + mySheet.SetColumnWidth(4, 10 * 256); + + var cell5 = headerRow.CreateCell(5); + cell5.SetCellValue("关联用户id"); + cell5.CellStyle = headerStyle; + mySheet.SetColumnWidth(5, 10 * 256); + + var cell6 = headerRow.CreateCell(6); + cell6.SetCellValue("状态"); + cell6.CellStyle = headerStyle; + mySheet.SetColumnWidth(6, 10 * 256); + + var cell7 = headerRow.CreateCell(7); + cell7.SetCellValue("核销有效期类型"); + cell7.CellStyle = headerStyle; + mySheet.SetColumnWidth(7, 10 * 256); + + var cell8 = headerRow.CreateCell(8); + cell8.SetCellValue("核销开始时间"); + cell8.CellStyle = headerStyle; + mySheet.SetColumnWidth(8, 10 * 256); + + var cell9 = headerRow.CreateCell(9); + cell9.SetCellValue("核销结束时间"); + cell9.CellStyle = headerStyle; + mySheet.SetColumnWidth(9, 10 * 256); + + var cell10 = headerRow.CreateCell(10); + cell10.SetCellValue("创建时间"); + cell10.CellStyle = headerStyle; + mySheet.SetColumnWidth(10, 10 * 256); + + var cell11 = headerRow.CreateCell(11); + cell11.SetCellValue("是否核销"); + cell11.CellStyle = headerStyle; + mySheet.SetColumnWidth(11, 10 * 256); + + var cell12 = headerRow.CreateCell(12); + cell12.SetCellValue("核销时间"); + cell12.CellStyle = headerStyle; + mySheet.SetColumnWidth(12, 10 * 256); + + headerRow.Height = 30 * 20; + var commonCellStyle = ExcelHelper.GetCommonStyle(book); + + //将数据逐步写入sheet1各个行 + for (var i = 0; i < listModel.Count; i++) + { + var rowTemp = mySheet.CreateRow(i + 1); + + var rowTemp0 = rowTemp.CreateCell(0); + rowTemp0.SetCellValue(listModel[i].id.ToString()); + rowTemp0.CellStyle = commonCellStyle; + + var rowTemp1 = rowTemp.CreateCell(1); + rowTemp1.SetCellValue(listModel[i].serviceOrderId.ToString()); + rowTemp1.CellStyle = commonCellStyle; + + var rowTemp2 = rowTemp.CreateCell(2); + rowTemp2.SetCellValue(listModel[i].securityCode.ToString()); + rowTemp2.CellStyle = commonCellStyle; + + var rowTemp3 = rowTemp.CreateCell(3); + rowTemp3.SetCellValue(listModel[i].redeemCode.ToString()); + rowTemp3.CellStyle = commonCellStyle; + + var rowTemp4 = rowTemp.CreateCell(4); + rowTemp4.SetCellValue(listModel[i].serviceId.ToString()); + rowTemp4.CellStyle = commonCellStyle; + + var rowTemp5 = rowTemp.CreateCell(5); + rowTemp5.SetCellValue(listModel[i].userId.ToString()); + rowTemp5.CellStyle = commonCellStyle; + + var rowTemp6 = rowTemp.CreateCell(6); + rowTemp6.SetCellValue(listModel[i].status.ToString()); + rowTemp6.CellStyle = commonCellStyle; + + var rowTemp7 = rowTemp.CreateCell(7); + rowTemp7.SetCellValue(listModel[i].validityType.ToString()); + rowTemp7.CellStyle = commonCellStyle; + + var rowTemp8 = rowTemp.CreateCell(8); + rowTemp8.SetCellValue(listModel[i].validityStartTime.ToString()); + rowTemp8.CellStyle = commonCellStyle; + + var rowTemp9 = rowTemp.CreateCell(9); + rowTemp9.SetCellValue(listModel[i].validityEndTime.ToString()); + rowTemp9.CellStyle = commonCellStyle; + + var rowTemp10 = rowTemp.CreateCell(10); + rowTemp10.SetCellValue(listModel[i].createTime.ToString()); + rowTemp10.CellStyle = commonCellStyle; + + var rowTemp11 = rowTemp.CreateCell(11); + rowTemp11.SetCellValue(listModel[i].isVerification.ToString()); + rowTemp11.CellStyle = commonCellStyle; + + var rowTemp12 = rowTemp.CreateCell(12); + rowTemp12.SetCellValue(listModel[i].verificationTime.ToString()); + rowTemp12.CellStyle = commonCellStyle; + } + // 导出excel + string webRootPath = _webHostEnvironment.WebRootPath; + string tpath = "/files/" + DateTime.Now.ToString("yyyy-MM-dd") + "/"; + string fileName = DateTime.Now.ToString("yyyyMMddHHmmssfff") + "-CoreCmsUserServicesTicket导出(选择结果).xls"; + string filePath = webRootPath + tpath; + DirectoryInfo di = new DirectoryInfo(filePath); + if (!di.Exists) + { + di.Create(); + } + FileStream fileHssf = new FileStream(filePath + fileName, FileMode.Create); + book.Write(fileHssf); + fileHssf.Close(); + + jm.code = 0; + jm.msg = GlobalConstVars.ExcelExportSuccess; + jm.data = tpath + fileName; + + return jm; + } + + #endregion 选择导出============================================================ + + #region 查询核销码导出============================================================ + + // POST: Api/CoreCmsUserServicesOrder/QueryExportExcel/10 + /// + /// 查询核销码导出 + /// + /// + [HttpPost] + [Description("查询核销码导出")] + public async Task QueryTicketExportExcel() + { + var jm = new AdminUiCallBack(); + + var where = PredicateBuilder.True(); + //查询筛选 + + //序列 int + var id = Request.Form["id"].FirstOrDefault().ObjectToInt(0); + if (id > 0) + { + where = where.And(p => p.id == id); + } + //关联购买订单 nvarchar + var serviceOrderId = Request.Form["serviceOrderId"].FirstOrDefault(); + if (!string.IsNullOrEmpty(serviceOrderId)) + { + where = where.And(p => p.serviceOrderId.Contains(serviceOrderId)); + } + //兑换码 nvarchar + var redeemCode = Request.Form["redeemCode"].FirstOrDefault(); + if (!string.IsNullOrEmpty(redeemCode)) + { + where = where.And(p => p.redeemCode.Contains(redeemCode)); + } + //关联服务项目id int + var serviceId = Request.Form["serviceId"].FirstOrDefault().ObjectToInt(0); + if (serviceId > 0) + { + where = where.And(p => p.serviceId == serviceId); + } + //关联用户id int + var userId = Request.Form["userId"].FirstOrDefault().ObjectToInt(0); + if (userId > 0) + { + where = where.And(p => p.userId == userId); + } + //状态 int + var status = Request.Form["status"].FirstOrDefault().ObjectToInt(0); + if (status > 0) + { + where = where.And(p => p.status == status); + } + //核销有效期类型 int + var validityType = Request.Form["validityType"].FirstOrDefault().ObjectToInt(0); + if (validityType > 0) + { + where = where.And(p => p.validityType == validityType); + } + //核销开始时间 datetime + var validityStartTime = Request.Form["validityStartTime"].FirstOrDefault(); + if (!string.IsNullOrEmpty(validityStartTime)) + { + var dt = validityStartTime.ObjectToDate(); + where = where.And(p => p.validityStartTime > dt); + } + //核销结束时间 datetime + var validityEndTime = Request.Form["validityEndTime"].FirstOrDefault(); + if (!string.IsNullOrEmpty(validityEndTime)) + { + var dt = validityEndTime.ObjectToDate(); + where = where.And(p => p.validityEndTime > dt); + } + //创建时间 datetime + var createTime = Request.Form["createTime"].FirstOrDefault(); + if (!string.IsNullOrEmpty(createTime)) + { + var dt = createTime.ObjectToDate(); + where = where.And(p => p.createTime > dt); + } + //是否核销 bit + var isVerification = Request.Form["isVerification"].FirstOrDefault(); + if (!string.IsNullOrEmpty(isVerification) && isVerification.ToLowerInvariant() == "true") + { + where = where.And(p => p.isVerification == true); + } + else if (!string.IsNullOrEmpty(isVerification) && isVerification.ToLowerInvariant() == "false") + { + where = where.And(p => p.isVerification == false); + } + //核销时间 datetime + var verificationTime = Request.Form["verificationTime"].FirstOrDefault(); + if (!string.IsNullOrEmpty(verificationTime)) + { + var dt = verificationTime.ObjectToDate(); + where = where.And(p => p.verificationTime > dt); + } + //获取数据 + //创建Excel文件的对象 + var book = new HSSFWorkbook(); + //添加一个sheet + var mySheet = book.CreateSheet("Sheet1"); + //获取list数据 + var listModel = await _coreCmsUserServicesTicketServices.QueryListByClauseAsync(where, p => p.id, OrderByType.Asc); + //给sheet1添加第一行的头部标题 + var headerRow = mySheet.CreateRow(0); + var headerStyle = ExcelHelper.GetHeaderStyle(book); + + var cell0 = headerRow.CreateCell(0); + cell0.SetCellValue("序列"); + cell0.CellStyle = headerStyle; + mySheet.SetColumnWidth(0, 10 * 256); + + var cell1 = headerRow.CreateCell(1); + cell1.SetCellValue("关联购买订单"); + cell1.CellStyle = headerStyle; + mySheet.SetColumnWidth(1, 10 * 256); + + var cell2 = headerRow.CreateCell(2); + cell2.SetCellValue("安全码"); + cell2.CellStyle = headerStyle; + mySheet.SetColumnWidth(2, 10 * 256); + + var cell3 = headerRow.CreateCell(3); + cell3.SetCellValue("兑换码"); + cell3.CellStyle = headerStyle; + mySheet.SetColumnWidth(3, 10 * 256); + + var cell4 = headerRow.CreateCell(4); + cell4.SetCellValue("关联服务项目id"); + cell4.CellStyle = headerStyle; + mySheet.SetColumnWidth(4, 10 * 256); + + var cell5 = headerRow.CreateCell(5); + cell5.SetCellValue("关联用户id"); + cell5.CellStyle = headerStyle; + mySheet.SetColumnWidth(5, 10 * 256); + + var cell6 = headerRow.CreateCell(6); + cell6.SetCellValue("状态"); + cell6.CellStyle = headerStyle; + mySheet.SetColumnWidth(6, 10 * 256); + + var cell7 = headerRow.CreateCell(7); + cell7.SetCellValue("核销有效期类型"); + cell7.CellStyle = headerStyle; + mySheet.SetColumnWidth(7, 10 * 256); + + var cell8 = headerRow.CreateCell(8); + cell8.SetCellValue("核销开始时间"); + cell8.CellStyle = headerStyle; + mySheet.SetColumnWidth(8, 10 * 256); + + var cell9 = headerRow.CreateCell(9); + cell9.SetCellValue("核销结束时间"); + cell9.CellStyle = headerStyle; + mySheet.SetColumnWidth(9, 10 * 256); + + var cell10 = headerRow.CreateCell(10); + cell10.SetCellValue("创建时间"); + cell10.CellStyle = headerStyle; + mySheet.SetColumnWidth(10, 10 * 256); + + var cell11 = headerRow.CreateCell(11); + cell11.SetCellValue("是否核销"); + cell11.CellStyle = headerStyle; + mySheet.SetColumnWidth(11, 10 * 256); + + var cell12 = headerRow.CreateCell(12); + cell12.SetCellValue("核销时间"); + cell12.CellStyle = headerStyle; + mySheet.SetColumnWidth(12, 10 * 256); + + headerRow.Height = 30 * 20; + var commonCellStyle = ExcelHelper.GetCommonStyle(book); + + //将数据逐步写入sheet1各个行 + for (var i = 0; i < listModel.Count; i++) + { + var rowTemp = mySheet.CreateRow(i + 1); + + var rowTemp0 = rowTemp.CreateCell(0); + rowTemp0.SetCellValue(listModel[i].id.ToString()); + rowTemp0.CellStyle = commonCellStyle; + + var rowTemp1 = rowTemp.CreateCell(1); + rowTemp1.SetCellValue(listModel[i].serviceOrderId.ToString()); + rowTemp1.CellStyle = commonCellStyle; + + var rowTemp2 = rowTemp.CreateCell(2); + rowTemp2.SetCellValue(listModel[i].securityCode.ToString()); + rowTemp2.CellStyle = commonCellStyle; + + var rowTemp3 = rowTemp.CreateCell(3); + rowTemp3.SetCellValue(listModel[i].redeemCode.ToString()); + rowTemp3.CellStyle = commonCellStyle; + + var rowTemp4 = rowTemp.CreateCell(4); + rowTemp4.SetCellValue(listModel[i].serviceId.ToString()); + rowTemp4.CellStyle = commonCellStyle; + + var rowTemp5 = rowTemp.CreateCell(5); + rowTemp5.SetCellValue(listModel[i].userId.ToString()); + rowTemp5.CellStyle = commonCellStyle; + + var rowTemp6 = rowTemp.CreateCell(6); + rowTemp6.SetCellValue(listModel[i].status.ToString()); + rowTemp6.CellStyle = commonCellStyle; + + var rowTemp7 = rowTemp.CreateCell(7); + rowTemp7.SetCellValue(listModel[i].validityType.ToString()); + rowTemp7.CellStyle = commonCellStyle; + + var rowTemp8 = rowTemp.CreateCell(8); + rowTemp8.SetCellValue(listModel[i].validityStartTime.ToString()); + rowTemp8.CellStyle = commonCellStyle; + + var rowTemp9 = rowTemp.CreateCell(9); + rowTemp9.SetCellValue(listModel[i].validityEndTime.ToString()); + rowTemp9.CellStyle = commonCellStyle; + + var rowTemp10 = rowTemp.CreateCell(10); + rowTemp10.SetCellValue(listModel[i].createTime.ToString()); + rowTemp10.CellStyle = commonCellStyle; + + var rowTemp11 = rowTemp.CreateCell(11); + rowTemp11.SetCellValue(listModel[i].isVerification.ToString()); + rowTemp11.CellStyle = commonCellStyle; + + var rowTemp12 = rowTemp.CreateCell(12); + rowTemp12.SetCellValue(listModel[i].verificationTime.ToString()); + rowTemp12.CellStyle = commonCellStyle; + } + // 写入到excel + string webRootPath = _webHostEnvironment.WebRootPath; + string tpath = "/files/" + DateTime.Now.ToString("yyyy-MM-dd") + "/"; + string fileName = DateTime.Now.ToString("yyyyMMddHHmmssfff") + "-CoreCmsUserServicesTicket导出(查询结果).xls"; + string filePath = webRootPath + tpath; + DirectoryInfo di = new DirectoryInfo(filePath); + if (!di.Exists) + { + di.Create(); + } + FileStream fileHssf = new FileStream(filePath + fileName, FileMode.Create); + book.Write(fileHssf); + fileHssf.Close(); + + jm.code = 0; + jm.msg = GlobalConstVars.ExcelExportSuccess; + jm.data = tpath + fileName; + + return jm; + } + + #endregion 查询导出============================================================ - #endregion 设置是否支付============================================================ } -} \ No newline at end of file +} diff --git a/CoreCms.Net.Web.Admin/Controllers/ServiceGoods/CoreCmsUserServicesTicketController.cs b/CoreCms.Net.Web.Admin/Controllers/ServiceGoods/CoreCmsUserServicesTicketController.cs deleted file mode 100644 index c72eec5..0000000 --- a/CoreCms.Net.Web.Admin/Controllers/ServiceGoods/CoreCmsUserServicesTicketController.cs +++ /dev/null @@ -1,948 +0,0 @@ -/*********************************************************************** - * Project: CoreCms - * ProjectName: 核心内容管理系统 - * Web: https://www.corecms.net - * Author: 大灰灰 - * Email: jianweie@163.com - * CreateTime: 2021/1/31 21:45:10 - * Description: 暂无 - ***********************************************************************/ - -using CoreCms.Net.Configuration; -using CoreCms.Net.Filter; -using CoreCms.Net.IServices; -using CoreCms.Net.Model.Entities; -using CoreCms.Net.Model.Entities.Expression; -using CoreCms.Net.Model.FromBody; -using CoreCms.Net.Model.ViewModels.UI; -using CoreCms.Net.Utility.Extensions; -using CoreCms.Net.Utility.Helper; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.Mvc; -using NPOI.HSSF.UserModel; -using SqlSugar; -using System; -using System.ComponentModel; -using System.IO; -using System.Linq; -using System.Linq.Expressions; -using System.Threading.Tasks; - -namespace CoreCms.Net.Web.Admin.Controllers -{ - /// - /// 服务消费券 - /// - [Description("服务消费券")] - [Route("api/[controller]/[action]")] - [ApiController] - [RequiredErrorForAdmin] - [Authorize(Permissions.Name)] - public class CoreCmsUserServicesTicketController : ControllerBase - { - private readonly IWebHostEnvironment _webHostEnvironment; - private readonly ICoreCmsUserServicesTicketServices _CoreCmsUserServicesTicketServices; - - /// - /// 构造函数 - /// - public CoreCmsUserServicesTicketController(IWebHostEnvironment webHostEnvironment - , ICoreCmsUserServicesTicketServices CoreCmsUserServicesTicketServices - ) - { - _webHostEnvironment = webHostEnvironment; - _CoreCmsUserServicesTicketServices = CoreCmsUserServicesTicketServices; - } - - #region 获取列表============================================================ - - // POST: Api/CoreCmsUserServicesTicket/GetPageList - /// - /// 获取列表 - /// - /// - [HttpPost] - [Description("获取列表")] - public async Task GetPageList() - { - var jm = new AdminUiCallBack(); - var pageCurrent = Request.Form["page"].FirstOrDefault().ObjectToInt(1); - var pageSize = Request.Form["limit"].FirstOrDefault().ObjectToInt(30); - var where = PredicateBuilder.True(); - //获取排序字段 - var orderField = Request.Form["orderField"].FirstOrDefault(); - Expression> orderEx; - switch (orderField) - { - case "id": - orderEx = p => p.id; - break; - - case "serviceOrderId": - orderEx = p => p.serviceOrderId; - break; - - case "securityCode": - orderEx = p => p.securityCode; - break; - - case "redeemCode": - orderEx = p => p.redeemCode; - break; - - case "serviceId": - orderEx = p => p.serviceId; - break; - - case "userId": - orderEx = p => p.userId; - break; - - case "status": - orderEx = p => p.status; - break; - - case "validityType": - orderEx = p => p.validityType; - break; - - case "validityStartTime": - orderEx = p => p.validityStartTime; - break; - - case "validityEndTime": - orderEx = p => p.validityEndTime; - break; - - case "createTime": - orderEx = p => p.createTime; - break; - - case "isVerification": - orderEx = p => p.isVerification; - break; - - case "verificationTime": - orderEx = p => p.verificationTime; - break; - - default: - orderEx = p => p.id; - break; - } - //设置排序方式 - var orderDirection = Request.Form["orderDirection"].FirstOrDefault(); - var orderBy = orderDirection switch - { - "asc" => OrderByType.Asc, - "desc" => OrderByType.Desc, - _ => OrderByType.Desc - }; - //查询筛选 - - //序列 int - var id = Request.Form["id"].FirstOrDefault().ObjectToInt(0); - if (id > 0) - { - where = where.And(p => p.id == id); - } - //关联购买订单 nvarchar - var serviceOrderId = Request.Form["serviceOrderId"].FirstOrDefault(); - if (!string.IsNullOrEmpty(serviceOrderId)) - { - where = where.And(p => p.serviceOrderId.Contains(serviceOrderId)); - } - //兑换码 nvarchar - var redeemCode = Request.Form["redeemCode"].FirstOrDefault(); - if (!string.IsNullOrEmpty(redeemCode)) - { - where = where.And(p => p.redeemCode.Contains(redeemCode)); - } - //关联服务项目id int - var serviceId = Request.Form["serviceId"].FirstOrDefault().ObjectToInt(0); - if (serviceId > 0) - { - where = where.And(p => p.serviceId == serviceId); - } - //关联用户id int - var userId = Request.Form["userId"].FirstOrDefault().ObjectToInt(0); - if (userId > 0) - { - where = where.And(p => p.userId == userId); - } - //状态 int - var status = Request.Form["status"].FirstOrDefault().ObjectToInt(0); - if (status > 0) - { - where = where.And(p => p.status == status); - } - //核销有效期类型 int - var validityType = Request.Form["validityType"].FirstOrDefault().ObjectToInt(0); - if (validityType > 0) - { - where = where.And(p => p.validityType == validityType); - } - //核销开始时间 datetime - var validityStartTime = Request.Form["validityStartTime"].FirstOrDefault(); - if (!string.IsNullOrEmpty(validityStartTime)) - { - if (validityStartTime.Contains("到")) - { - var dts = validityStartTime.Split("到"); - var dtStart = dts[0].Trim().ObjectToDate(); - where = where.And(p => p.validityStartTime > dtStart); - var dtEnd = dts[1].Trim().ObjectToDate(); - where = where.And(p => p.validityStartTime < dtEnd); - } - else - { - var dt = validityStartTime.ObjectToDate(); - where = where.And(p => p.validityStartTime > dt); - } - } - //核销结束时间 datetime - var validityEndTime = Request.Form["validityEndTime"].FirstOrDefault(); - if (!string.IsNullOrEmpty(validityEndTime)) - { - if (validityEndTime.Contains("到")) - { - var dts = validityEndTime.Split("到"); - var dtStart = dts[0].Trim().ObjectToDate(); - where = where.And(p => p.validityEndTime > dtStart); - var dtEnd = dts[1].Trim().ObjectToDate(); - where = where.And(p => p.validityEndTime < dtEnd); - } - else - { - var dt = validityEndTime.ObjectToDate(); - where = where.And(p => p.validityEndTime > dt); - } - } - //创建时间 datetime - var createTime = Request.Form["createTime"].FirstOrDefault(); - if (!string.IsNullOrEmpty(createTime)) - { - if (createTime.Contains("到")) - { - var dts = createTime.Split("到"); - var dtStart = dts[0].Trim().ObjectToDate(); - where = where.And(p => p.createTime > dtStart); - var dtEnd = dts[1].Trim().ObjectToDate(); - where = where.And(p => p.createTime < dtEnd); - } - else - { - var dt = createTime.ObjectToDate(); - where = where.And(p => p.createTime > dt); - } - } - //是否核销 bit - var isVerification = Request.Form["isVerification"].FirstOrDefault(); - if (!string.IsNullOrEmpty(isVerification) && isVerification.ToLowerInvariant() == "true") - { - where = where.And(p => p.isVerification == true); - } - else if (!string.IsNullOrEmpty(isVerification) && isVerification.ToLowerInvariant() == "false") - { - where = where.And(p => p.isVerification == false); - } - //核销时间 datetime - var verificationTime = Request.Form["verificationTime"].FirstOrDefault(); - if (!string.IsNullOrEmpty(verificationTime)) - { - if (verificationTime.Contains("到")) - { - var dts = verificationTime.Split("到"); - var dtStart = dts[0].Trim().ObjectToDate(); - where = where.And(p => p.verificationTime > dtStart); - var dtEnd = dts[1].Trim().ObjectToDate(); - where = where.And(p => p.verificationTime < dtEnd); - } - else - { - var dt = verificationTime.ObjectToDate(); - where = where.And(p => p.verificationTime > dt); - } - } - //获取数据 - var list = await _CoreCmsUserServicesTicketServices.QueryPageAsync(where, orderEx, orderBy, pageCurrent, pageSize); - //返回数据 - jm.data = list; - jm.code = 0; - jm.count = list.TotalCount; - jm.msg = "数据调用成功!"; - return jm; - } - - #endregion 获取列表============================================================ - - #region 首页数据============================================================ - - // POST: Api/CoreCmsUserServicesTicket/GetIndex - /// - /// 首页数据 - /// - /// - [HttpPost] - [Description("首页数据")] - public AdminUiCallBack GetIndex() - { - //返回数据 - var jm = new AdminUiCallBack { code = 0 }; - return jm; - } - - #endregion 首页数据============================================================ - - #region 创建数据============================================================ - - // POST: Api/CoreCmsUserServicesTicket/GetCreate - /// - /// 创建数据 - /// - /// - [HttpPost] - [Description("创建数据")] - public AdminUiCallBack GetCreate() - { - //返回数据 - var jm = new AdminUiCallBack { code = 0 }; - return jm; - } - - #endregion 创建数据============================================================ - - #region 创建提交============================================================ - - // POST: Api/CoreCmsUserServicesTicket/DoCreate - /// - /// 创建提交 - /// - /// - /// - [HttpPost] - [Description("创建提交")] - public async Task DoCreate([FromBody] CoreCmsUserServicesTicket entity) - { - var jm = new AdminUiCallBack(); - - var bl = await _CoreCmsUserServicesTicketServices.InsertAsync(entity) > 0; - jm.code = bl ? 0 : 1; - jm.msg = (bl ? GlobalConstVars.CreateSuccess : GlobalConstVars.CreateFailure); - - return jm; - } - - #endregion 创建提交============================================================ - - #region 编辑数据============================================================ - - // POST: Api/CoreCmsUserServicesTicket/GetEdit - /// - /// 编辑数据 - /// - /// - /// - [HttpPost] - [Description("编辑数据")] - public async Task GetEdit([FromBody] FMIntId entity) - { - var jm = new AdminUiCallBack(); - - var model = await _CoreCmsUserServicesTicketServices.QueryByIdAsync(entity.id); - if (model == null) - { - jm.msg = "不存在此信息"; - return jm; - } - jm.code = 0; - jm.data = model; - - return jm; - } - - #endregion 编辑数据============================================================ - - #region 编辑提交============================================================ - - // POST: Api/CoreCmsUserServicesTicket/Edit - /// - /// 编辑提交 - /// - /// - /// - [HttpPost] - [Description("编辑提交")] - public async Task DoEdit([FromBody] CoreCmsUserServicesTicket entity) - { - var jm = new AdminUiCallBack(); - - var oldModel = await _CoreCmsUserServicesTicketServices.QueryByIdAsync(entity.id); - if (oldModel == null) - { - jm.msg = "不存在此信息"; - return jm; - } - //事物处理过程开始 - oldModel.serviceOrderId = entity.serviceOrderId; - oldModel.securityCode = entity.securityCode; - oldModel.redeemCode = entity.redeemCode; - oldModel.serviceId = entity.serviceId; - oldModel.userId = entity.userId; - oldModel.status = entity.status; - oldModel.validityType = entity.validityType; - oldModel.validityStartTime = entity.validityStartTime; - oldModel.validityEndTime = entity.validityEndTime; - oldModel.createTime = entity.createTime; - oldModel.isVerification = entity.isVerification; - oldModel.verificationTime = entity.verificationTime; - - //事物处理过程结束 - var bl = await _CoreCmsUserServicesTicketServices.UpdateAsync(oldModel); - jm.code = bl ? 0 : 1; - jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure; - - return jm; - } - - #endregion 编辑提交============================================================ - - #region 删除数据============================================================ - - // POST: Api/CoreCmsUserServicesTicket/DoDelete/10 - /// - /// 单选删除 - /// - /// - /// - [HttpPost] - [Description("单选删除")] - public async Task DoDelete([FromBody] FMIntId entity) - { - var jm = new AdminUiCallBack(); - - var model = await _CoreCmsUserServicesTicketServices.QueryByIdAsync(entity.id); - if (model == null) - { - jm.msg = GlobalConstVars.DataisNo; - return jm; - } - var bl = await _CoreCmsUserServicesTicketServices.DeleteByIdAsync(entity.id); - jm.code = bl ? 0 : 1; - jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure; - return jm; - } - - #endregion 删除数据============================================================ - - #region 批量删除============================================================ - - // POST: Api/CoreCmsUserServicesTicket/DoBatchDelete/10,11,20 - /// - /// 批量删除 - /// - /// - /// - [HttpPost] - [Description("批量删除")] - public async Task DoBatchDelete([FromBody] FMArrayIntIds entity) - { - var jm = new AdminUiCallBack(); - - var bl = await _CoreCmsUserServicesTicketServices.DeleteByIdsAsync(entity.id); - jm.code = bl ? 0 : 1; - jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure; - - return jm; - } - - #endregion 批量删除============================================================ - - #region 预览数据============================================================ - - // POST: Api/CoreCmsUserServicesTicket/GetDetails/10 - /// - /// 预览数据 - /// - /// - /// - [HttpPost] - [Description("预览数据")] - public async Task GetDetails([FromBody] FMIntId entity) - { - var jm = new AdminUiCallBack(); - - var model = await _CoreCmsUserServicesTicketServices.QueryByIdAsync(entity.id); - if (model == null) - { - jm.msg = "不存在此信息"; - return jm; - } - jm.code = 0; - jm.data = model; - - return jm; - } - - #endregion 预览数据============================================================ - - #region 选择导出============================================================ - - // POST: Api/CoreCmsUserServicesTicket/SelectExportExcel/10 - /// - /// 选择导出 - /// - /// - /// - [HttpPost] - [Description("选择导出")] - public async Task SelectExportExcel([FromBody] FMArrayIntIds entity) - { - var jm = new AdminUiCallBack(); - - //创建Excel文件的对象 - var book = new HSSFWorkbook(); - //添加一个sheet - var mySheet = book.CreateSheet("Sheet1"); - //获取list数据 - var listModel = await _CoreCmsUserServicesTicketServices.QueryListByClauseAsync(p => entity.id.Contains(p.id), p => p.id, OrderByType.Asc); - //给sheet1添加第一行的头部标题 - var headerRow = mySheet.CreateRow(0); - var headerStyle = ExcelHelper.GetHeaderStyle(book); - - var cell0 = headerRow.CreateCell(0); - cell0.SetCellValue("序列"); - cell0.CellStyle = headerStyle; - mySheet.SetColumnWidth(0, 10 * 256); - - var cell1 = headerRow.CreateCell(1); - cell1.SetCellValue("关联购买订单"); - cell1.CellStyle = headerStyle; - mySheet.SetColumnWidth(1, 10 * 256); - - var cell2 = headerRow.CreateCell(2); - cell2.SetCellValue("安全码"); - cell2.CellStyle = headerStyle; - mySheet.SetColumnWidth(2, 10 * 256); - - var cell3 = headerRow.CreateCell(3); - cell3.SetCellValue("兑换码"); - cell3.CellStyle = headerStyle; - mySheet.SetColumnWidth(3, 10 * 256); - - var cell4 = headerRow.CreateCell(4); - cell4.SetCellValue("关联服务项目id"); - cell4.CellStyle = headerStyle; - mySheet.SetColumnWidth(4, 10 * 256); - - var cell5 = headerRow.CreateCell(5); - cell5.SetCellValue("关联用户id"); - cell5.CellStyle = headerStyle; - mySheet.SetColumnWidth(5, 10 * 256); - - var cell6 = headerRow.CreateCell(6); - cell6.SetCellValue("状态"); - cell6.CellStyle = headerStyle; - mySheet.SetColumnWidth(6, 10 * 256); - - var cell7 = headerRow.CreateCell(7); - cell7.SetCellValue("核销有效期类型"); - cell7.CellStyle = headerStyle; - mySheet.SetColumnWidth(7, 10 * 256); - - var cell8 = headerRow.CreateCell(8); - cell8.SetCellValue("核销开始时间"); - cell8.CellStyle = headerStyle; - mySheet.SetColumnWidth(8, 10 * 256); - - var cell9 = headerRow.CreateCell(9); - cell9.SetCellValue("核销结束时间"); - cell9.CellStyle = headerStyle; - mySheet.SetColumnWidth(9, 10 * 256); - - var cell10 = headerRow.CreateCell(10); - cell10.SetCellValue("创建时间"); - cell10.CellStyle = headerStyle; - mySheet.SetColumnWidth(10, 10 * 256); - - var cell11 = headerRow.CreateCell(11); - cell11.SetCellValue("是否核销"); - cell11.CellStyle = headerStyle; - mySheet.SetColumnWidth(11, 10 * 256); - - var cell12 = headerRow.CreateCell(12); - cell12.SetCellValue("核销时间"); - cell12.CellStyle = headerStyle; - mySheet.SetColumnWidth(12, 10 * 256); - - headerRow.Height = 30 * 20; - var commonCellStyle = ExcelHelper.GetCommonStyle(book); - - //将数据逐步写入sheet1各个行 - for (var i = 0; i < listModel.Count; i++) - { - var rowTemp = mySheet.CreateRow(i + 1); - - var rowTemp0 = rowTemp.CreateCell(0); - rowTemp0.SetCellValue(listModel[i].id.ToString()); - rowTemp0.CellStyle = commonCellStyle; - - var rowTemp1 = rowTemp.CreateCell(1); - rowTemp1.SetCellValue(listModel[i].serviceOrderId.ToString()); - rowTemp1.CellStyle = commonCellStyle; - - var rowTemp2 = rowTemp.CreateCell(2); - rowTemp2.SetCellValue(listModel[i].securityCode.ToString()); - rowTemp2.CellStyle = commonCellStyle; - - var rowTemp3 = rowTemp.CreateCell(3); - rowTemp3.SetCellValue(listModel[i].redeemCode.ToString()); - rowTemp3.CellStyle = commonCellStyle; - - var rowTemp4 = rowTemp.CreateCell(4); - rowTemp4.SetCellValue(listModel[i].serviceId.ToString()); - rowTemp4.CellStyle = commonCellStyle; - - var rowTemp5 = rowTemp.CreateCell(5); - rowTemp5.SetCellValue(listModel[i].userId.ToString()); - rowTemp5.CellStyle = commonCellStyle; - - var rowTemp6 = rowTemp.CreateCell(6); - rowTemp6.SetCellValue(listModel[i].status.ToString()); - rowTemp6.CellStyle = commonCellStyle; - - var rowTemp7 = rowTemp.CreateCell(7); - rowTemp7.SetCellValue(listModel[i].validityType.ToString()); - rowTemp7.CellStyle = commonCellStyle; - - var rowTemp8 = rowTemp.CreateCell(8); - rowTemp8.SetCellValue(listModel[i].validityStartTime.ToString()); - rowTemp8.CellStyle = commonCellStyle; - - var rowTemp9 = rowTemp.CreateCell(9); - rowTemp9.SetCellValue(listModel[i].validityEndTime.ToString()); - rowTemp9.CellStyle = commonCellStyle; - - var rowTemp10 = rowTemp.CreateCell(10); - rowTemp10.SetCellValue(listModel[i].createTime.ToString()); - rowTemp10.CellStyle = commonCellStyle; - - var rowTemp11 = rowTemp.CreateCell(11); - rowTemp11.SetCellValue(listModel[i].isVerification.ToString()); - rowTemp11.CellStyle = commonCellStyle; - - var rowTemp12 = rowTemp.CreateCell(12); - rowTemp12.SetCellValue(listModel[i].verificationTime.ToString()); - rowTemp12.CellStyle = commonCellStyle; - } - // 导出excel - string webRootPath = _webHostEnvironment.WebRootPath; - string tpath = "/files/" + DateTime.Now.ToString("yyyy-MM-dd") + "/"; - string fileName = DateTime.Now.ToString("yyyyMMddHHmmssfff") + "-CoreCmsUserServicesTicket导出(选择结果).xls"; - string filePath = webRootPath + tpath; - DirectoryInfo di = new DirectoryInfo(filePath); - if (!di.Exists) - { - di.Create(); - } - FileStream fileHssf = new FileStream(filePath + fileName, FileMode.Create); - book.Write(fileHssf); - fileHssf.Close(); - - jm.code = 0; - jm.msg = GlobalConstVars.ExcelExportSuccess; - jm.data = tpath + fileName; - - return jm; - } - - #endregion 选择导出============================================================ - - #region 查询导出============================================================ - - // POST: Api/CoreCmsUserServicesTicket/QueryExportExcel/10 - /// - /// 查询导出 - /// - /// - [HttpPost] - [Description("查询导出")] - public async Task QueryExportExcel() - { - var jm = new AdminUiCallBack(); - - var where = PredicateBuilder.True(); - //查询筛选 - - //序列 int - var id = Request.Form["id"].FirstOrDefault().ObjectToInt(0); - if (id > 0) - { - where = where.And(p => p.id == id); - } - //关联购买订单 nvarchar - var serviceOrderId = Request.Form["serviceOrderId"].FirstOrDefault(); - if (!string.IsNullOrEmpty(serviceOrderId)) - { - where = where.And(p => p.serviceOrderId.Contains(serviceOrderId)); - } - //兑换码 nvarchar - var redeemCode = Request.Form["redeemCode"].FirstOrDefault(); - if (!string.IsNullOrEmpty(redeemCode)) - { - where = where.And(p => p.redeemCode.Contains(redeemCode)); - } - //关联服务项目id int - var serviceId = Request.Form["serviceId"].FirstOrDefault().ObjectToInt(0); - if (serviceId > 0) - { - where = where.And(p => p.serviceId == serviceId); - } - //关联用户id int - var userId = Request.Form["userId"].FirstOrDefault().ObjectToInt(0); - if (userId > 0) - { - where = where.And(p => p.userId == userId); - } - //状态 int - var status = Request.Form["status"].FirstOrDefault().ObjectToInt(0); - if (status > 0) - { - where = where.And(p => p.status == status); - } - //核销有效期类型 int - var validityType = Request.Form["validityType"].FirstOrDefault().ObjectToInt(0); - if (validityType > 0) - { - where = where.And(p => p.validityType == validityType); - } - //核销开始时间 datetime - var validityStartTime = Request.Form["validityStartTime"].FirstOrDefault(); - if (!string.IsNullOrEmpty(validityStartTime)) - { - var dt = validityStartTime.ObjectToDate(); - where = where.And(p => p.validityStartTime > dt); - } - //核销结束时间 datetime - var validityEndTime = Request.Form["validityEndTime"].FirstOrDefault(); - if (!string.IsNullOrEmpty(validityEndTime)) - { - var dt = validityEndTime.ObjectToDate(); - where = where.And(p => p.validityEndTime > dt); - } - //创建时间 datetime - var createTime = Request.Form["createTime"].FirstOrDefault(); - if (!string.IsNullOrEmpty(createTime)) - { - var dt = createTime.ObjectToDate(); - where = where.And(p => p.createTime > dt); - } - //是否核销 bit - var isVerification = Request.Form["isVerification"].FirstOrDefault(); - if (!string.IsNullOrEmpty(isVerification) && isVerification.ToLowerInvariant() == "true") - { - where = where.And(p => p.isVerification == true); - } - else if (!string.IsNullOrEmpty(isVerification) && isVerification.ToLowerInvariant() == "false") - { - where = where.And(p => p.isVerification == false); - } - //核销时间 datetime - var verificationTime = Request.Form["verificationTime"].FirstOrDefault(); - if (!string.IsNullOrEmpty(verificationTime)) - { - var dt = verificationTime.ObjectToDate(); - where = where.And(p => p.verificationTime > dt); - } - //获取数据 - //创建Excel文件的对象 - var book = new HSSFWorkbook(); - //添加一个sheet - var mySheet = book.CreateSheet("Sheet1"); - //获取list数据 - var listModel = await _CoreCmsUserServicesTicketServices.QueryListByClauseAsync(where, p => p.id, OrderByType.Asc); - //给sheet1添加第一行的头部标题 - var headerRow = mySheet.CreateRow(0); - var headerStyle = ExcelHelper.GetHeaderStyle(book); - - var cell0 = headerRow.CreateCell(0); - cell0.SetCellValue("序列"); - cell0.CellStyle = headerStyle; - mySheet.SetColumnWidth(0, 10 * 256); - - var cell1 = headerRow.CreateCell(1); - cell1.SetCellValue("关联购买订单"); - cell1.CellStyle = headerStyle; - mySheet.SetColumnWidth(1, 10 * 256); - - var cell2 = headerRow.CreateCell(2); - cell2.SetCellValue("安全码"); - cell2.CellStyle = headerStyle; - mySheet.SetColumnWidth(2, 10 * 256); - - var cell3 = headerRow.CreateCell(3); - cell3.SetCellValue("兑换码"); - cell3.CellStyle = headerStyle; - mySheet.SetColumnWidth(3, 10 * 256); - - var cell4 = headerRow.CreateCell(4); - cell4.SetCellValue("关联服务项目id"); - cell4.CellStyle = headerStyle; - mySheet.SetColumnWidth(4, 10 * 256); - - var cell5 = headerRow.CreateCell(5); - cell5.SetCellValue("关联用户id"); - cell5.CellStyle = headerStyle; - mySheet.SetColumnWidth(5, 10 * 256); - - var cell6 = headerRow.CreateCell(6); - cell6.SetCellValue("状态"); - cell6.CellStyle = headerStyle; - mySheet.SetColumnWidth(6, 10 * 256); - - var cell7 = headerRow.CreateCell(7); - cell7.SetCellValue("核销有效期类型"); - cell7.CellStyle = headerStyle; - mySheet.SetColumnWidth(7, 10 * 256); - - var cell8 = headerRow.CreateCell(8); - cell8.SetCellValue("核销开始时间"); - cell8.CellStyle = headerStyle; - mySheet.SetColumnWidth(8, 10 * 256); - - var cell9 = headerRow.CreateCell(9); - cell9.SetCellValue("核销结束时间"); - cell9.CellStyle = headerStyle; - mySheet.SetColumnWidth(9, 10 * 256); - - var cell10 = headerRow.CreateCell(10); - cell10.SetCellValue("创建时间"); - cell10.CellStyle = headerStyle; - mySheet.SetColumnWidth(10, 10 * 256); - - var cell11 = headerRow.CreateCell(11); - cell11.SetCellValue("是否核销"); - cell11.CellStyle = headerStyle; - mySheet.SetColumnWidth(11, 10 * 256); - - var cell12 = headerRow.CreateCell(12); - cell12.SetCellValue("核销时间"); - cell12.CellStyle = headerStyle; - mySheet.SetColumnWidth(12, 10 * 256); - - headerRow.Height = 30 * 20; - var commonCellStyle = ExcelHelper.GetCommonStyle(book); - - //将数据逐步写入sheet1各个行 - for (var i = 0; i < listModel.Count; i++) - { - var rowTemp = mySheet.CreateRow(i + 1); - - var rowTemp0 = rowTemp.CreateCell(0); - rowTemp0.SetCellValue(listModel[i].id.ToString()); - rowTemp0.CellStyle = commonCellStyle; - - var rowTemp1 = rowTemp.CreateCell(1); - rowTemp1.SetCellValue(listModel[i].serviceOrderId.ToString()); - rowTemp1.CellStyle = commonCellStyle; - - var rowTemp2 = rowTemp.CreateCell(2); - rowTemp2.SetCellValue(listModel[i].securityCode.ToString()); - rowTemp2.CellStyle = commonCellStyle; - - var rowTemp3 = rowTemp.CreateCell(3); - rowTemp3.SetCellValue(listModel[i].redeemCode.ToString()); - rowTemp3.CellStyle = commonCellStyle; - - var rowTemp4 = rowTemp.CreateCell(4); - rowTemp4.SetCellValue(listModel[i].serviceId.ToString()); - rowTemp4.CellStyle = commonCellStyle; - - var rowTemp5 = rowTemp.CreateCell(5); - rowTemp5.SetCellValue(listModel[i].userId.ToString()); - rowTemp5.CellStyle = commonCellStyle; - - var rowTemp6 = rowTemp.CreateCell(6); - rowTemp6.SetCellValue(listModel[i].status.ToString()); - rowTemp6.CellStyle = commonCellStyle; - - var rowTemp7 = rowTemp.CreateCell(7); - rowTemp7.SetCellValue(listModel[i].validityType.ToString()); - rowTemp7.CellStyle = commonCellStyle; - - var rowTemp8 = rowTemp.CreateCell(8); - rowTemp8.SetCellValue(listModel[i].validityStartTime.ToString()); - rowTemp8.CellStyle = commonCellStyle; - - var rowTemp9 = rowTemp.CreateCell(9); - rowTemp9.SetCellValue(listModel[i].validityEndTime.ToString()); - rowTemp9.CellStyle = commonCellStyle; - - var rowTemp10 = rowTemp.CreateCell(10); - rowTemp10.SetCellValue(listModel[i].createTime.ToString()); - rowTemp10.CellStyle = commonCellStyle; - - var rowTemp11 = rowTemp.CreateCell(11); - rowTemp11.SetCellValue(listModel[i].isVerification.ToString()); - rowTemp11.CellStyle = commonCellStyle; - - var rowTemp12 = rowTemp.CreateCell(12); - rowTemp12.SetCellValue(listModel[i].verificationTime.ToString()); - rowTemp12.CellStyle = commonCellStyle; - } - // 写入到excel - string webRootPath = _webHostEnvironment.WebRootPath; - string tpath = "/files/" + DateTime.Now.ToString("yyyy-MM-dd") + "/"; - string fileName = DateTime.Now.ToString("yyyyMMddHHmmssfff") + "-CoreCmsUserServicesTicket导出(查询结果).xls"; - string filePath = webRootPath + tpath; - DirectoryInfo di = new DirectoryInfo(filePath); - if (!di.Exists) - { - di.Create(); - } - FileStream fileHssf = new FileStream(filePath + fileName, FileMode.Create); - book.Write(fileHssf); - fileHssf.Close(); - - jm.code = 0; - jm.msg = GlobalConstVars.ExcelExportSuccess; - jm.data = tpath + fileName; - - return jm; - } - - #endregion 查询导出============================================================ - - #region 设置是否核销============================================================ - - // POST: Api/CoreCmsUserServicesTicket/DoSetisVerification/10 - /// - /// 设置是否核销 - /// - /// - /// - [HttpPost] - [Description("设置是否核销")] - public async Task DoSetisVerification([FromBody] FMUpdateBoolDataByIntId entity) - { - var jm = new AdminUiCallBack(); - - var oldModel = await _CoreCmsUserServicesTicketServices.QueryByIdAsync(entity.id); - if (oldModel == null) - { - jm.msg = "不存在此信息"; - return jm; - } - oldModel.isVerification = (bool)entity.data; - - var bl = await _CoreCmsUserServicesTicketServices.UpdateAsync(oldModel); - jm.code = bl ? 0 : 1; - jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure; - - return jm; - } - - #endregion 设置是否核销============================================================ - } -} \ No newline at end of file diff --git a/CoreCms.Net.Web.Admin/Controllers/ServiceGoods/CoreCmsUserServicesTicketVerificationLogController.cs b/CoreCms.Net.Web.Admin/Controllers/ServiceGoods/CoreCmsUserServicesTicketVerificationLogController.cs deleted file mode 100644 index 95b80ed..0000000 --- a/CoreCms.Net.Web.Admin/Controllers/ServiceGoods/CoreCmsUserServicesTicketVerificationLogController.cs +++ /dev/null @@ -1,631 +0,0 @@ -/*********************************************************************** - * Project: CoreCms - * ProjectName: 核心内容管理系统 - * Web: https://www.corecms.net - * Author: 大灰灰 - * Email: jianweie@163.com - * CreateTime: 2021/1/31 21:45:10 - * Description: 暂无 - ***********************************************************************/ - -using System; -using System.ComponentModel; -using System.IO; -using System.Linq; -using System.Linq.Expressions; -using System.Threading.Tasks; -using CoreCms.Net.Configuration; -using CoreCms.Net.Model.Entities; -using CoreCms.Net.Model.Entities.Expression; -using CoreCms.Net.Model.FromBody; -using CoreCms.Net.Model.ViewModels.UI; -using CoreCms.Net.Filter; -using CoreCms.Net.Loging; -using CoreCms.Net.IServices; -using CoreCms.Net.Utility.Helper; -using CoreCms.Net.Utility.Extensions; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.Mvc; -using NPOI.HSSF.UserModel; -using SqlSugar; - -namespace CoreCms.Net.Web.Admin.Controllers -{ - /// - /// 服务券核验日志 - /// - [Description("服务券核验日志")] - [Route("api/[controller]/[action]")] - [ApiController] - [RequiredErrorForAdmin] - [Authorize(Permissions.Name)] - public class CoreCmsUserServicesTicketVerificationLogController : ControllerBase - { - private readonly IWebHostEnvironment _webHostEnvironment; - private readonly ICoreCmsUserServicesTicketVerificationLogServices _CoreCmsUserServicesTicketVerificationLogServices; - - /// - /// 构造函数 - /// - public CoreCmsUserServicesTicketVerificationLogController(IWebHostEnvironment webHostEnvironment - , ICoreCmsUserServicesTicketVerificationLogServices CoreCmsUserServicesTicketVerificationLogServices - ) - { - _webHostEnvironment = webHostEnvironment; - _CoreCmsUserServicesTicketVerificationLogServices = CoreCmsUserServicesTicketVerificationLogServices; - } - - #region 获取列表============================================================ - // POST: Api/CoreCmsUserServicesTicketVerificationLog/GetPageList - /// - /// 获取列表 - /// - /// - [HttpPost] - [Description("获取列表")] - public async Task GetPageList() - { - var jm = new AdminUiCallBack(); - var pageCurrent = Request.Form["page"].FirstOrDefault().ObjectToInt(1); - var pageSize = Request.Form["limit"].FirstOrDefault().ObjectToInt(30); - var where = PredicateBuilder.True(); - //获取排序字段 - var orderField = Request.Form["orderField"].FirstOrDefault(); - Expression> orderEx; - switch (orderField) - { - case "id": - orderEx = p => p.id; - break; - case "storeId": - orderEx = p => p.storeId; - break; - case "verificationUserId": - orderEx = p => p.verificationUserId; - break; - case "ticketId": - orderEx = p => p.ticketId; - break; - case "ticketRedeemCode": - orderEx = p => p.ticketRedeemCode; - break; - case "verificationTime": - orderEx = p => p.verificationTime; - break; - default: - orderEx = p => p.id; - break; - } - //设置排序方式 - var orderDirection = Request.Form["orderDirection"].FirstOrDefault(); - var orderBy = orderDirection switch - { - "asc" => OrderByType.Asc, - "desc" => OrderByType.Desc, - _ => OrderByType.Desc - }; - //查询筛选 - - //序列 int - var id = Request.Form["id"].FirstOrDefault().ObjectToInt(0); - if (id > 0) - { - where = where.And(p => p.id == id); - } - //核销门店id int - var storeId = Request.Form["storeId"].FirstOrDefault().ObjectToInt(0); - if (storeId > 0) - { - where = where.And(p => p.storeId == storeId); - } - //核验人 int - var verificationUserId = Request.Form["verificationUserId"].FirstOrDefault().ObjectToInt(0); - if (verificationUserId > 0) - { - where = where.And(p => p.verificationUserId == verificationUserId); - } - //服务券序列 int - var ticketId = Request.Form["ticketId"].FirstOrDefault().ObjectToInt(0); - if (ticketId > 0) - { - where = where.And(p => p.ticketId == ticketId); - } - //核验码 nvarchar - var ticketRedeemCode = Request.Form["ticketRedeemCode"].FirstOrDefault(); - if (!string.IsNullOrEmpty(ticketRedeemCode)) - { - where = where.And(p => p.ticketRedeemCode.Contains(ticketRedeemCode)); - } - //核验时间 datetime - var verificationTime = Request.Form["verificationTime"].FirstOrDefault(); - if (!string.IsNullOrEmpty(verificationTime)) - { - if (verificationTime.Contains("到")) - { - var dts = verificationTime.Split("到"); - var dtStart = dts[0].Trim().ObjectToDate(); - where = where.And(p => p.verificationTime > dtStart); - var dtEnd = dts[1].Trim().ObjectToDate(); - where = where.And(p => p.verificationTime < dtEnd); - } - else - { - var dt = verificationTime.ObjectToDate(); - where = where.And(p => p.verificationTime > dt); - } - } - //获取数据 - var list = await _CoreCmsUserServicesTicketVerificationLogServices.QueryPageAsync(where, orderEx, orderBy, pageCurrent, pageSize); - //返回数据 - jm.data = list; - jm.code = 0; - jm.count = list.TotalCount; - jm.msg = "数据调用成功!"; - return jm; - } - #endregion - - #region 首页数据============================================================ - // POST: Api/CoreCmsUserServicesTicketVerificationLog/GetIndex - /// - /// 首页数据 - /// - /// - [HttpPost] - [Description("首页数据")] - public AdminUiCallBack GetIndex() - { - //返回数据 - var jm = new AdminUiCallBack { code = 0 }; - return jm; - } - #endregion - - #region 创建数据============================================================ - // POST: Api/CoreCmsUserServicesTicketVerificationLog/GetCreate - /// - /// 创建数据 - /// - /// - [HttpPost] - [Description("创建数据")] - public AdminUiCallBack GetCreate() - { - //返回数据 - var jm = new AdminUiCallBack { code = 0 }; - return jm; - } - #endregion - - #region 创建提交============================================================ - // POST: Api/CoreCmsUserServicesTicketVerificationLog/DoCreate - /// - /// 创建提交 - /// - /// - /// - [HttpPost] - [Description("创建提交")] - public async Task DoCreate([FromBody] CoreCmsUserServicesTicketVerificationLog entity) - { - var jm = new AdminUiCallBack(); - - var bl = await _CoreCmsUserServicesTicketVerificationLogServices.InsertAsync(entity) > 0; - jm.code = bl ? 0 : 1; - jm.msg = (bl ? GlobalConstVars.CreateSuccess : GlobalConstVars.CreateFailure); - - return jm; - } - #endregion - - #region 编辑数据============================================================ - // POST: Api/CoreCmsUserServicesTicketVerificationLog/GetEdit - /// - /// 编辑数据 - /// - /// - /// - [HttpPost] - [Description("编辑数据")] - public async Task GetEdit([FromBody] FMIntId entity) - { - var jm = new AdminUiCallBack(); - - var model = await _CoreCmsUserServicesTicketVerificationLogServices.QueryByIdAsync(entity.id); - if (model == null) - { - jm.msg = "不存在此信息"; - return jm; - } - jm.code = 0; - jm.data = model; - - return jm; - } - #endregion - - #region 编辑提交============================================================ - // POST: Api/CoreCmsUserServicesTicketVerificationLog/Edit - /// - /// 编辑提交 - /// - /// - /// - [HttpPost] - [Description("编辑提交")] - public async Task DoEdit([FromBody] CoreCmsUserServicesTicketVerificationLog entity) - { - var jm = new AdminUiCallBack(); - - var oldModel = await _CoreCmsUserServicesTicketVerificationLogServices.QueryByIdAsync(entity.id); - if (oldModel == null) - { - jm.msg = "不存在此信息"; - return jm; - } - //事物处理过程开始 - oldModel.id = entity.id; - oldModel.storeId = entity.storeId; - oldModel.verificationUserId = entity.verificationUserId; - oldModel.ticketId = entity.ticketId; - oldModel.ticketRedeemCode = entity.ticketRedeemCode; - oldModel.verificationTime = entity.verificationTime; - - //事物处理过程结束 - var bl = await _CoreCmsUserServicesTicketVerificationLogServices.UpdateAsync(oldModel); - jm.code = bl ? 0 : 1; - jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure; - - return jm; - } - #endregion - - #region 删除数据============================================================ - // POST: Api/CoreCmsUserServicesTicketVerificationLog/DoDelete/10 - /// - /// 单选删除 - /// - /// - /// - [HttpPost] - [Description("单选删除")] - public async Task DoDelete([FromBody] FMIntId entity) - { - var jm = new AdminUiCallBack(); - - var model = await _CoreCmsUserServicesTicketVerificationLogServices.QueryByIdAsync(entity.id); - if (model == null) - { - jm.msg = GlobalConstVars.DataisNo; - return jm; - } - var bl = await _CoreCmsUserServicesTicketVerificationLogServices.DeleteByIdAsync(entity.id); - jm.code = bl ? 0 : 1; - jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure; - return jm; - - } - #endregion - - #region 批量删除============================================================ - // POST: Api/CoreCmsUserServicesTicketVerificationLog/DoBatchDelete/10,11,20 - /// - /// 批量删除 - /// - /// - /// - [HttpPost] - [Description("批量删除")] - public async Task DoBatchDelete([FromBody] FMArrayIntIds entity) - { - var jm = new AdminUiCallBack(); - - var bl = await _CoreCmsUserServicesTicketVerificationLogServices.DeleteByIdsAsync(entity.id); - jm.code = bl ? 0 : 1; - jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure; - - return jm; - } - - #endregion - - #region 预览数据============================================================ - // POST: Api/CoreCmsUserServicesTicketVerificationLog/GetDetails/10 - /// - /// 预览数据 - /// - /// - /// - [HttpPost] - [Description("预览数据")] - public async Task GetDetails([FromBody] FMIntId entity) - { - var jm = new AdminUiCallBack(); - - var model = await _CoreCmsUserServicesTicketVerificationLogServices.QueryByIdAsync(entity.id); - if (model == null) - { - jm.msg = "不存在此信息"; - return jm; - } - jm.code = 0; - jm.data = model; - - return jm; - } - #endregion - - #region 选择导出============================================================ - // POST: Api/CoreCmsUserServicesTicketVerificationLog/SelectExportExcel/10 - /// - /// 选择导出 - /// - /// - /// - [HttpPost] - [Description("选择导出")] - public async Task SelectExportExcel([FromBody] FMArrayIntIds entity) - { - var jm = new AdminUiCallBack(); - - //创建Excel文件的对象 - var book = new HSSFWorkbook(); - //添加一个sheet - var mySheet = book.CreateSheet("Sheet1"); - //获取list数据 - var listModel = await _CoreCmsUserServicesTicketVerificationLogServices.QueryListByClauseAsync(p => entity.id.Contains(p.id), p => p.id, OrderByType.Asc); - //给sheet1添加第一行的头部标题 - var headerRow = mySheet.CreateRow(0); - var headerStyle = ExcelHelper.GetHeaderStyle(book); - - var cell0 = headerRow.CreateCell(0); - cell0.SetCellValue("序列"); - cell0.CellStyle = headerStyle; - mySheet.SetColumnWidth(0, 10 * 256); - - var cell1 = headerRow.CreateCell(1); - cell1.SetCellValue("核销门店id"); - cell1.CellStyle = headerStyle; - mySheet.SetColumnWidth(1, 10 * 256); - - var cell2 = headerRow.CreateCell(2); - cell2.SetCellValue("核验人"); - cell2.CellStyle = headerStyle; - mySheet.SetColumnWidth(2, 10 * 256); - - var cell3 = headerRow.CreateCell(3); - cell3.SetCellValue("服务券序列"); - cell3.CellStyle = headerStyle; - mySheet.SetColumnWidth(3, 10 * 256); - - var cell4 = headerRow.CreateCell(4); - cell4.SetCellValue("核验码"); - cell4.CellStyle = headerStyle; - mySheet.SetColumnWidth(4, 10 * 256); - - var cell5 = headerRow.CreateCell(5); - cell5.SetCellValue("核验时间"); - cell5.CellStyle = headerStyle; - mySheet.SetColumnWidth(5, 10 * 256); - - headerRow.Height = 30 * 20; - var commonCellStyle = ExcelHelper.GetCommonStyle(book); - - //将数据逐步写入sheet1各个行 - for (var i = 0; i < listModel.Count; i++) - { - var rowTemp = mySheet.CreateRow(i + 1); - - var rowTemp0 = rowTemp.CreateCell(0); - rowTemp0.SetCellValue(listModel[i].id.ToString()); - rowTemp0.CellStyle = commonCellStyle; - - var rowTemp1 = rowTemp.CreateCell(1); - rowTemp1.SetCellValue(listModel[i].storeId.ToString()); - rowTemp1.CellStyle = commonCellStyle; - - var rowTemp2 = rowTemp.CreateCell(2); - rowTemp2.SetCellValue(listModel[i].verificationUserId.ToString()); - rowTemp2.CellStyle = commonCellStyle; - - var rowTemp3 = rowTemp.CreateCell(3); - rowTemp3.SetCellValue(listModel[i].ticketId.ToString()); - rowTemp3.CellStyle = commonCellStyle; - - var rowTemp4 = rowTemp.CreateCell(4); - rowTemp4.SetCellValue(listModel[i].ticketRedeemCode.ToString()); - rowTemp4.CellStyle = commonCellStyle; - - var rowTemp5 = rowTemp.CreateCell(5); - rowTemp5.SetCellValue(listModel[i].verificationTime.ToString()); - rowTemp5.CellStyle = commonCellStyle; - - } - // 导出excel - string webRootPath = _webHostEnvironment.WebRootPath; - string tpath = "/files/" + DateTime.Now.ToString("yyyy-MM-dd") + "/"; - string fileName = DateTime.Now.ToString("yyyyMMddHHmmssfff") + "-CoreCmsUserServicesTicketVerificationLog导出(选择结果).xls"; - string filePath = webRootPath + tpath; - DirectoryInfo di = new DirectoryInfo(filePath); - if (!di.Exists) - { - di.Create(); - } - FileStream fileHssf = new FileStream(filePath + fileName, FileMode.Create); - book.Write(fileHssf); - fileHssf.Close(); - - jm.code = 0; - jm.msg = GlobalConstVars.ExcelExportSuccess; - jm.data = tpath + fileName; - - return jm; - } - #endregion - - #region 查询导出============================================================ - // POST: Api/CoreCmsUserServicesTicketVerificationLog/QueryExportExcel/10 - /// - /// 查询导出 - /// - /// - [HttpPost] - [Description("查询导出")] - public async Task QueryExportExcel() - { - var jm = new AdminUiCallBack(); - - var where = PredicateBuilder.True(); - //查询筛选 - - //序列 int - var id = Request.Form["id"].FirstOrDefault().ObjectToInt(0); - if (id > 0) - { - where = where.And(p => p.id == id); - } - //核销门店id int - var storeId = Request.Form["storeId"].FirstOrDefault().ObjectToInt(0); - if (storeId > 0) - { - where = where.And(p => p.storeId == storeId); - } - //核验人 int - var verificationUserId = Request.Form["verificationUserId"].FirstOrDefault().ObjectToInt(0); - if (verificationUserId > 0) - { - where = where.And(p => p.verificationUserId == verificationUserId); - } - //服务券序列 int - var ticketId = Request.Form["ticketId"].FirstOrDefault().ObjectToInt(0); - if (ticketId > 0) - { - where = where.And(p => p.ticketId == ticketId); - } - //核验码 nvarchar - var ticketRedeemCode = Request.Form["ticketRedeemCode"].FirstOrDefault(); - if (!string.IsNullOrEmpty(ticketRedeemCode)) - { - where = where.And(p => p.ticketRedeemCode.Contains(ticketRedeemCode)); - } - //核验时间 datetime - var verificationTime = Request.Form["verificationTime"].FirstOrDefault(); - if (!string.IsNullOrEmpty(verificationTime)) - { - var dt = verificationTime.ObjectToDate(); - where = where.And(p => p.verificationTime > dt); - } - //获取数据 - //创建Excel文件的对象 - var book = new HSSFWorkbook(); - //添加一个sheet - var mySheet = book.CreateSheet("Sheet1"); - //获取list数据 - var listModel = await _CoreCmsUserServicesTicketVerificationLogServices.QueryListByClauseAsync(where, p => p.id, OrderByType.Asc); - //给sheet1添加第一行的头部标题 - var headerRow = mySheet.CreateRow(0); - var headerStyle = ExcelHelper.GetHeaderStyle(book); - - var cell0 = headerRow.CreateCell(0); - cell0.SetCellValue("序列"); - cell0.CellStyle = headerStyle; - mySheet.SetColumnWidth(0, 10 * 256); - - var cell1 = headerRow.CreateCell(1); - cell1.SetCellValue("核销门店id"); - cell1.CellStyle = headerStyle; - mySheet.SetColumnWidth(1, 10 * 256); - - var cell2 = headerRow.CreateCell(2); - cell2.SetCellValue("核验人"); - cell2.CellStyle = headerStyle; - mySheet.SetColumnWidth(2, 10 * 256); - - var cell3 = headerRow.CreateCell(3); - cell3.SetCellValue("服务券序列"); - cell3.CellStyle = headerStyle; - mySheet.SetColumnWidth(3, 10 * 256); - - var cell4 = headerRow.CreateCell(4); - cell4.SetCellValue("核验码"); - cell4.CellStyle = headerStyle; - mySheet.SetColumnWidth(4, 10 * 256); - - var cell5 = headerRow.CreateCell(5); - cell5.SetCellValue("核验时间"); - cell5.CellStyle = headerStyle; - mySheet.SetColumnWidth(5, 10 * 256); - - - headerRow.Height = 30 * 20; - var commonCellStyle = ExcelHelper.GetCommonStyle(book); - - //将数据逐步写入sheet1各个行 - for (var i = 0; i < listModel.Count; i++) - { - var rowTemp = mySheet.CreateRow(i + 1); - - - var rowTemp0 = rowTemp.CreateCell(0); - rowTemp0.SetCellValue(listModel[i].id.ToString()); - rowTemp0.CellStyle = commonCellStyle; - - - - var rowTemp1 = rowTemp.CreateCell(1); - rowTemp1.SetCellValue(listModel[i].storeId.ToString()); - rowTemp1.CellStyle = commonCellStyle; - - - - var rowTemp2 = rowTemp.CreateCell(2); - rowTemp2.SetCellValue(listModel[i].verificationUserId.ToString()); - rowTemp2.CellStyle = commonCellStyle; - - - - var rowTemp3 = rowTemp.CreateCell(3); - rowTemp3.SetCellValue(listModel[i].ticketId.ToString()); - rowTemp3.CellStyle = commonCellStyle; - - - - var rowTemp4 = rowTemp.CreateCell(4); - rowTemp4.SetCellValue(listModel[i].ticketRedeemCode.ToString()); - rowTemp4.CellStyle = commonCellStyle; - - - - var rowTemp5 = rowTemp.CreateCell(5); - rowTemp5.SetCellValue(listModel[i].verificationTime.ToString()); - rowTemp5.CellStyle = commonCellStyle; - - - } - // 写入到excel - string webRootPath = _webHostEnvironment.WebRootPath; - string tpath = "/files/" + DateTime.Now.ToString("yyyy-MM-dd") + "/"; - string fileName = DateTime.Now.ToString("yyyyMMddHHmmssfff") + "-CoreCmsUserServicesTicketVerificationLog导出(查询结果).xls"; - string filePath = webRootPath + tpath; - DirectoryInfo di = new DirectoryInfo(filePath); - if (!di.Exists) - { - di.Create(); - } - FileStream fileHssf = new FileStream(filePath + fileName, FileMode.Create); - book.Write(fileHssf); - fileHssf.Close(); - - jm.code = 0; - jm.msg = GlobalConstVars.ExcelExportSuccess; - jm.data = tpath + fileName; - - return jm; - } - #endregion - - - - } -} diff --git a/CoreCms.Net.Web.Admin/wwwroot/views/good/goods/details.html b/CoreCms.Net.Web.Admin/wwwroot/views/good/goods/details.html new file mode 100644 index 0000000..78f6903 --- /dev/null +++ b/CoreCms.Net.Web.Admin/wwwroot/views/good/goods/details.html @@ -0,0 +1,744 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CoreCms.Net.Web.Admin/wwwroot/views/good/goods/index.html b/CoreCms.Net.Web.Admin/wwwroot/views/good/goods/index.html index d5df5a8..2074320 100644 --- a/CoreCms.Net.Web.Admin/wwwroot/views/good/goods/index.html +++ b/CoreCms.Net.Web.Admin/wwwroot/views/good/goods/index.html @@ -118,6 +118,11 @@ , element = layui.element , view = layui.view; + //监听行双击事件 + table.on('rowDouble(LAY-app-CoreCmsGoods-tableBox)', function (obj) { + //查看详情 + doDetails(obj); + }); //重载form @@ -255,13 +260,14 @@ } }); }); - //监听行双击事件 - //table.on('rowDouble(LAY-app-CoreCmsGoods-tableBox)', function (obj) { - //}); + + //监听工具条 table.on('tool(LAY-app-CoreCmsGoods-tableBox)', function (obj) { - if (obj.event === 'del') { + if (obj.event === 'detail') { + doDetails(obj); + } else if (obj.event === 'del') { doDelete(obj); } else if (obj.event === 'edit') { doEdit(obj) @@ -421,6 +427,32 @@ } }); } + + //执行预览操作 + function doDetails(obj) { + console.log(obj); + coreHelper.Post("Api/CoreCmsGoods/GetDetails", { id: obj.data.id }, function (e) { + if (e.code === 0) { + admin.popup({ + shadeClose: false, + title: '查看详情', + area: ['95%', '95%'], + id: 'LAY-popup-CoreCmsGoods-details', + success: function (layero, index) { + view(this.id).render('good/goods/details', { data: e.data }).done(function () { + form.render(); + }); + // 禁止弹窗出现滚动条 + //$(layero).children('.layui-layer-content').css('overflow', 'visible'); + } + }); + } else { + layer.msg(e.msg); + } + }); + } + + //删除商品 function delGoods(delidsStr) { layer.confirm('确定删除吗?删除后将无法恢复。', diff --git a/CoreCms.Net.Web.Admin/wwwroot/views/order/orders/details.html b/CoreCms.Net.Web.Admin/wwwroot/views/order/orders/details.html index 4884161..ae1135e 100644 --- a/CoreCms.Net.Web.Admin/wwwroot/views/order/orders/details.html +++ b/CoreCms.Net.Web.Admin/wwwroot/views/order/orders/details.html @@ -183,6 +183,26 @@
{{d.params.data.memo||'无'}}
+ +
+ 下单用户 +
+
+ +
+ {{d.params.data.user.id}} +
+ +
+ {{d.params.data.user.mobile}} +
+
+ {{d.params.data.user.nickName}} +
+
+ {{d.params.data.user.userWx}} +
+
diff --git a/CoreCms.Net.Web.Admin/wwwroot/views/order/servicesOrder/create.html b/CoreCms.Net.Web.Admin/wwwroot/views/order/servicesOrder/create.html index 6e232bd..6418646 100644 --- a/CoreCms.Net.Web.Admin/wwwroot/views/order/servicesOrder/create.html +++ b/CoreCms.Net.Web.Admin/wwwroot/views/order/servicesOrder/create.html @@ -1,73 +1,80 @@ \ No newline at end of file + diff --git a/CoreCms.Net.Web.Admin/wwwroot/views/order/servicesOrder/details.html b/CoreCms.Net.Web.Admin/wwwroot/views/order/servicesOrder/details.html index efa7e0e..d20b313 100644 --- a/CoreCms.Net.Web.Admin/wwwroot/views/order/servicesOrder/details.html +++ b/CoreCms.Net.Web.Admin/wwwroot/views/order/servicesOrder/details.html @@ -1,107 +1,273 @@ + + + + + + + + + \ No newline at end of file + + + + + + diff --git a/CoreCms.Net.Web.Admin/wwwroot/views/order/servicesOrder/edit.html b/CoreCms.Net.Web.Admin/wwwroot/views/order/servicesOrder/edit.html index 1b63e86..a4dcd9a 100644 --- a/CoreCms.Net.Web.Admin/wwwroot/views/order/servicesOrder/edit.html +++ b/CoreCms.Net.Web.Admin/wwwroot/views/order/servicesOrder/edit.html @@ -1,101 +1,115 @@ \ No newline at end of file + diff --git a/CoreCms.Net.Web.Admin/wwwroot/views/order/servicesOrder/index.html b/CoreCms.Net.Web.Admin/wwwroot/views/order/servicesOrder/index.html index 4c9b860..832c72f 100644 --- a/CoreCms.Net.Web.Admin/wwwroot/views/order/servicesOrder/index.html +++ b/CoreCms.Net.Web.Admin/wwwroot/views/order/servicesOrder/index.html @@ -10,65 +10,68 @@ - +
+
+
+ + -
-
-
- + @@ -128,23 +126,6 @@ , util = layui.util , view = layui.view; - laydate.render({ - elem: '#searchTime-CoreCmsUserServicesOrder-payTime', - type: 'datetime', - range: '到', - }); - laydate.render({ - elem: '#searchTime-CoreCmsUserServicesOrder-createTime', - type: 'datetime', - range: '到', - }); - laydate.render({ - elem: '#searchTime-CoreCmsUserServicesOrder-servicesEndTime', - type: 'datetime', - range: '到', - }); - //重载form - form.render(); var searchwhere; //监听搜索 form.on('submit(LAY-app-CoreCmsUserServicesOrder-search)', @@ -160,6 +141,8 @@ url: layui.setter.apiUrl + 'Api/CoreCmsUserServicesOrder/GetPageList', method: 'POST', toolbar: '#LAY-app-CoreCmsUserServicesOrder-toolbar', + pagebar: '#LAY-app-CoreCmsUserServicesOrder-pagebar', + className: 'pagebarbox', defaultToolbar: ['filter', 'print', 'exports'], height: 'full-127',//面包屑142px,搜索框4行172,3行137,2行102,1行67 page: true, @@ -169,16 +152,30 @@ cols: [ [ { type: "checkbox", fixed: "left" }, - { field: 'serviceOrderId', title: '服务订单编号', sort: false, width: 105 }, - { field: 'userId', title: '关联用户', sort: false, width: 105 }, - { field: 'servicesId', title: '关联服务', sort: false, width: 105 }, + { field: 'id', title: '序列', width: 50, sort: false }, + { field: 'serviceOrderId', title: '服务订单编号', sort: false, width: 125 }, + { + field: 'userId', title: '关联用户', sort: false, width: 155, templet: function (d) { + return d.userId + '【' + d.userName + '】'; + } + }, + { field: 'serviceTitle', title: '关联服务', sort: false }, { field: 'isPay', title: '是否支付', width: 95, templet: '#switch_isPay', sort: false, unresize: true }, { field: 'payTime', title: '支付时间', width: 130, sort: false }, - { field: 'paymentId', title: '支付单号', sort: false, width: 105 }, - { field: 'status', title: '状态', sort: false, width: 105 }, + { field: 'paymentId', title: '支付单号', sort: false, width: 125 }, + { + field: 'status', title: '状态', sort: false, width: 80, templet: function (data) { + for (var i = 0; i < d.data.serviceOrderStatus.length; i++) { + if (data.status == d.data.serviceOrderStatus[i].value) { + return d.data.serviceOrderStatus[i].description; + } + } + return ""; + } + }, { field: 'createTime', title: '订单创建时间', width: 130, sort: false }, { field: 'servicesEndTime', title: '截止服务时间', width: 130, sort: false }, - { width: 142, align: 'center', title: '操作', fixed: 'right', toolbar: '#LAY-app-CoreCmsUserServicesOrder-tableBox-bar' } + { width: 122, align: 'center', title: '操作', fixed: 'right', toolbar: '#LAY-app-CoreCmsUserServicesOrder-tableBox-bar' } ] ] }); @@ -198,15 +195,9 @@ doDetails(obj); }); //头工具栏事件 - table.on('toolbar(LAY-app-CoreCmsUserServicesOrder-tableBox)', function (obj) { + table.on('pagebar(LAY-app-CoreCmsUserServicesOrder-tableBox)', function (obj) { var checkStatus = table.checkStatus(obj.config.id); switch (obj.event) { - case 'addData': - doCreate(); - break; - case 'batchDelete': - doBatchDelete(checkStatus); - break; case 'selectExportExcel': doSelectExportExcel(checkStatus); break; @@ -220,94 +211,11 @@ function (obj) { if (obj.event === 'detail') { doDetails(obj); - } else if (obj.event === 'del') { - doDelete(obj); - } else if (obj.event === 'edit') { - doEdit(obj) - } - }); - //执行创建操作 - function doCreate() { - coreHelper.Post("Api/CoreCmsUserServicesOrder/GetCreate", null, function (e) { - if (e.code === 0) { - admin.popup({ - shadeClose: false, - title: '创建数据', - area: ['600px', '500px'], - id: 'LAY-popup-CoreCmsUserServicesOrder-create', - success: function (layero, index) { - view(this.id).render('order/servicesOrder/create', { data: e.data }).done(function () { - //监听提交 - form.on('submit(LAY-app-CoreCmsUserServicesOrder-createForm-submit)', - function (data) { - var field = data.field; //获取提交的字段 - - field.isPay = field.isPay == 'on'; - - if (debug) { console.log(field); } //开启调试返回数据 - //提交 Ajax 成功后,关闭当前弹层并重载表格 - coreHelper.Post("Api/CoreCmsUserServicesOrder/DoCreate", field, function (e) { - console.log(e) - if (e.code === 0) { - layui.table.reloadData('LAY-app-CoreCmsUserServicesOrder-tableBox'); //重载表格 - layer.close(index); //再执行关闭 - layer.msg(e.msg); - } else { - layer.msg(e.msg); - } - }); - }); - }); - // 禁止弹窗出现滚动条 - $(layero).children('.layui-layer-content').css('overflow', 'visible'); - } - }); - } else { - layer.msg(e.msg); + } else if (obj.event === 'cancellation') { + doCancellation(obj); } }); - } - //执行编辑操作 - function doEdit(obj) { - coreHelper.Post("Api/CoreCmsUserServicesOrder/GetEdit", { id: obj.data.id }, function (e) { - if (e.code === 0) { - admin.popup({ - shadeClose: false, - title: '编辑数据', - area: ['600px', '500px'], - id: 'LAY-popup-CoreCmsUserServicesOrder-edit', - success: function (layero, index) { - view(this.id).render('order/servicesOrder/edit', { data: e.data }).done(function () { - //监听提交 - form.on('submit(LAY-app-CoreCmsUserServicesOrder-editForm-submit)', - function (data) { - var field = data.field; //获取提交的字段 - - field.isPay = field.isPay == 'on'; - if (debug) { console.log(field); } //开启调试返回数据 - //提交 Ajax 成功后,关闭当前弹层并重载表格 - coreHelper.Post("Api/CoreCmsUserServicesOrder/DoEdit", field, function (e) { - console.log(e) - if (e.code === 0) { - layui.table.reloadData('LAY-app-CoreCmsUserServicesOrder-tableBox'); //重载表格 - layer.close(index); //再执行关闭 - layer.msg(e.msg); - } else { - layer.msg(e.msg); - } - }); - }); - }) - // 禁止弹窗出现滚动条 - $(layero).children('.layui-layer-content').css('overflow', 'visible'); - } - }); - } else { - layer.msg(e.msg); - } - }); - } //执行预览操作 function doDetails(obj) { coreHelper.Post("Api/CoreCmsUserServicesOrder/GetDetails", { id: obj.data.id }, function (e) { @@ -315,14 +223,14 @@ admin.popup({ shadeClose: false, title: '查看详情', - area: ['600px', '500px'], + area: ['1200px', '90%'], id: 'LAY-popup-CoreCmsUserServicesOrder-details', success: function (layero, index) { view(this.id).render('order/servicesOrder/details', { data: e.data }).done(function () { form.render(); }); // 禁止弹窗出现滚动条 - $(layero).children('.layui-layer-content').css('overflow', 'visible'); + //$(layero).children('.layui-layer-content').css('overflow', 'visible'); } }); } else { @@ -330,34 +238,14 @@ } }); } - //执行单个删除 - function doDelete(obj) { - coreHelper.Post("Api/CoreCmsUserServicesOrder/DoDelete", { id: obj.data.id }, function (e) { + //执行作废订单 + function doCancellation(obj) { + coreHelper.Post("Api/CoreCmsUserServicesOrder/DoCancellation", { id: obj.data.id }, function (e) { if (debug) { console.log(e); } //开启调试返回数据 table.reloadData('LAY-app-CoreCmsUserServicesOrder-tableBox'); layer.msg(e.msg); }); } - //执行批量删除 - function doBatchDelete(checkStatus) { - var checkData = checkStatus.data; - if (checkData.length === 0) { - return layer.msg('请选择要删除的数据'); - } - layer.confirm('确定删除吗?删除后将无法恢复。', - function (index) { - var delidsStr = []; - layui.each(checkData, - function (index, item) { - delidsStr.push(item.id); - }); - coreHelper.Post("Api/CoreCmsUserServicesOrder/DoBatchDelete", { id: delidsStr }, function (e) { - if (debug) { console.log(e); } //开启调试返回数据 - table.reloadData('LAY-app-CoreCmsUserServicesOrder-tableBox'); - layer.msg(e.msg); - }); - }); - } //执行查询条件导出excel function doQueryExportexcel() { layer.confirm('确定根据当前的查询条件导出数据吗?', @@ -397,6 +285,24 @@ }); }); } + + + laydate.render({ + elem: '#searchTime-CoreCmsUserServicesOrder-payTime', + type: 'datetime', + range: '到', + }); + laydate.render({ + elem: '#searchTime-CoreCmsUserServicesOrder-createTime', + type: 'datetime', + range: '到', + }); + laydate.render({ + elem: '#searchTime-CoreCmsUserServicesOrder-servicesEndTime', + type: 'datetime', + range: '到', + }); + //监听 表格复选框操作 layui.form.on('switch(switch_isPay)', function (obj) { @@ -407,11 +313,15 @@ }); }); + + //重载form + form.render(); }); }; \ No newline at end of file + + + diff --git a/CoreCms.Net.Web.Admin/wwwroot/views/serviceGoods/servicesticket/create.html b/CoreCms.Net.Web.Admin/wwwroot/views/serviceGoods/servicesticket/create.html deleted file mode 100644 index 116c4c5..0000000 --- a/CoreCms.Net.Web.Admin/wwwroot/views/serviceGoods/servicesticket/create.html +++ /dev/null @@ -1,140 +0,0 @@ - - \ No newline at end of file diff --git a/CoreCms.Net.Web.Admin/wwwroot/views/serviceGoods/servicesticket/details.html b/CoreCms.Net.Web.Admin/wwwroot/views/serviceGoods/servicesticket/details.html deleted file mode 100644 index d18d93c..0000000 --- a/CoreCms.Net.Web.Admin/wwwroot/views/serviceGoods/servicesticket/details.html +++ /dev/null @@ -1,143 +0,0 @@ - - \ No newline at end of file diff --git a/CoreCms.Net.Web.Admin/wwwroot/views/serviceGoods/servicesticket/edit.html b/CoreCms.Net.Web.Admin/wwwroot/views/serviceGoods/servicesticket/edit.html deleted file mode 100644 index 8c4eaaa..0000000 --- a/CoreCms.Net.Web.Admin/wwwroot/views/serviceGoods/servicesticket/edit.html +++ /dev/null @@ -1,140 +0,0 @@ - - \ No newline at end of file diff --git a/CoreCms.Net.Web.Admin/wwwroot/views/serviceGoods/servicesticket/index.html b/CoreCms.Net.Web.Admin/wwwroot/views/serviceGoods/servicesticket/index.html deleted file mode 100644 index 84cf5d3..0000000 --- a/CoreCms.Net.Web.Admin/wwwroot/views/serviceGoods/servicesticket/index.html +++ /dev/null @@ -1,447 +0,0 @@ -服务消费券 - -
-
- -
-
- - - -
-
-
- - - - - - - - \ No newline at end of file diff --git a/CoreCms.Net.Web.Admin/wwwroot/views/serviceGoods/servicesticketverificationlog/create.html b/CoreCms.Net.Web.Admin/wwwroot/views/serviceGoods/servicesticketverificationlog/create.html deleted file mode 100644 index 8578df6..0000000 --- a/CoreCms.Net.Web.Admin/wwwroot/views/serviceGoods/servicesticketverificationlog/create.html +++ /dev/null @@ -1,78 +0,0 @@ - - \ No newline at end of file diff --git a/CoreCms.Net.Web.Admin/wwwroot/views/serviceGoods/servicesticketverificationlog/details.html b/CoreCms.Net.Web.Admin/wwwroot/views/serviceGoods/servicesticketverificationlog/details.html deleted file mode 100644 index 401e156..0000000 --- a/CoreCms.Net.Web.Admin/wwwroot/views/serviceGoods/servicesticketverificationlog/details.html +++ /dev/null @@ -1,80 +0,0 @@ - - \ No newline at end of file diff --git a/CoreCms.Net.Web.Admin/wwwroot/views/serviceGoods/servicesticketverificationlog/edit.html b/CoreCms.Net.Web.Admin/wwwroot/views/serviceGoods/servicesticketverificationlog/edit.html deleted file mode 100644 index 94d05a9..0000000 --- a/CoreCms.Net.Web.Admin/wwwroot/views/serviceGoods/servicesticketverificationlog/edit.html +++ /dev/null @@ -1,78 +0,0 @@ - - \ No newline at end of file diff --git a/CoreCms.Net.Web.Admin/wwwroot/views/serviceGoods/servicesticketverificationlog/index.html b/CoreCms.Net.Web.Admin/wwwroot/views/serviceGoods/servicesticketverificationlog/index.html deleted file mode 100644 index 95c1c81..0000000 --- a/CoreCms.Net.Web.Admin/wwwroot/views/serviceGoods/servicesticketverificationlog/index.html +++ /dev/null @@ -1,362 +0,0 @@ -服务券核验日志 - -
-
- -
-
- - - -
-
-
- - - - - \ No newline at end of file diff --git a/CoreCms.Net.Web.Admin/wwwroot/views/shop/store/index.html b/CoreCms.Net.Web.Admin/wwwroot/views/shop/store/index.html index 0730fc2..38db491 100644 --- a/CoreCms.Net.Web.Admin/wwwroot/views/shop/store/index.html +++ b/CoreCms.Net.Web.Admin/wwwroot/views/shop/store/index.html @@ -389,7 +389,7 @@ area: ['380px', '200px'], id: 'LAY-popup-CoreCmsStore-clerkEdit', success: function (layero, index) { - view(this.id).render('shop/store/clerkEdit', { data: e.data }).done(function () { + view(this.id).render('shop/store/clerkedit', { data: e.data }).done(function () { //监听提交 form.on('submit(LAY-app-CoreCmsStore-clerkEdit-submit)', function (data) { diff --git a/CoreCms.Net.Web.WebApi/Controllers/PayNotify/WeChatPayController.cs b/CoreCms.Net.Web.WebApi/Controllers/PayNotify/WeChatPayController.cs index c8fd7ff..f3599d7 100644 --- a/CoreCms.Net.Web.WebApi/Controllers/PayNotify/WeChatPayController.cs +++ b/CoreCms.Net.Web.WebApi/Controllers/PayNotify/WeChatPayController.cs @@ -65,11 +65,12 @@ namespace CoreCms.Net.Web.WebApi.Controllers.PayNotify await _redisOperationRepository.ListLeftPushAsync(RedisMessageQueueKey.WeChatPayNotice, JsonConvert.SerializeObject(notify)); return WeChatPayNotifyResult.Success; } + NLogUtil.WriteAll(LogLevel.Trace, LogType.Order, "微信支付成功回调", JsonConvert.SerializeObject(notify)); return NoContent(); } catch (Exception ex) { - NLogUtil.WriteAll(LogLevel.Trace, LogType.Refund, "微信支付成功回调", "统一下单支付结果通知", ex); + NLogUtil.WriteAll(LogLevel.Trace, LogType.Order, "微信支付成功回调", "统一下单支付结果通知", ex); return NoContent(); } }