From e4487c9f56f50a14002ac358760e4f2a01a41fa0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E5=81=9A=E7=A0=81=E5=86=9C?= <599854767@qq.com> Date: Wed, 24 Nov 2021 14:30:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BB=A3=E7=A0=81=E7=94=9F?= =?UTF-8?q?=E6=88=90=E6=B5=8B=E8=AF=95=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/business/GendemoController.cs | 20 ++- ZR.Model/Dto/GendemoDto.cs | 4 +- ZR.Model/Models/Gendemo.cs | 21 ++- .../Repositories/GendemoRepository.cs | 14 +- ZR.Service/Business/GendemoService.cs | 18 +- .../Business/IBusService/IGendemoService.cs | 3 +- ZR.Vue/src/views/business/gendemo/index.vue | 170 ++++++++++-------- 7 files changed, 132 insertions(+), 118 deletions(-) diff --git a/ZR.Admin.WebApi/Controllers/business/GendemoController.cs b/ZR.Admin.WebApi/Controllers/business/GendemoController.cs index 077ca73..0fdfee2 100644 --- a/ZR.Admin.WebApi/Controllers/business/GendemoController.cs +++ b/ZR.Admin.WebApi/Controllers/business/GendemoController.cs @@ -22,7 +22,7 @@ namespace ZR.Admin.WebApi.Controllers /// 代码生成演示Controller /// /// @author zr - /// @date 2021-10-10 + /// @date 2021-11-24 /// [Verify] [Route("business/Gendemo")] @@ -49,9 +49,9 @@ namespace ZR.Admin.WebApi.Controllers //开始拼装查询条件 var predicate = Expressionable.Create(); - //TODO 搜索条件 + //TODO 自己实现搜索条件查询语法参考Sqlsugar,默认查询所有 //predicate = predicate.And(m => m.Name.Contains(parm.Name)); - _GendemoService.Test(); + var response = _GendemoService.GetPages(predicate.ToExpression(), parm); return SUCCESS(response); @@ -77,7 +77,7 @@ namespace ZR.Admin.WebApi.Controllers /// [HttpPost] [ActionPermissionFilter(Permission = "business:gendemo:add")] - [Log(Title = "代码生成演示添加", BusinessType = BusinessType.INSERT)] + [Log(Title = "代码生成演示", BusinessType = BusinessType.INSERT)] public IActionResult AddGendemo([FromBody] GendemoDto parm) { if (parm == null) @@ -92,8 +92,12 @@ namespace ZR.Admin.WebApi.Controllers it.Name, it.Icon, it.ShowStatus, + it.AddTime, it.Sex, it.Sort, + it.BeginTime, + it.EndTime, + it.Remark, })); } @@ -103,7 +107,7 @@ namespace ZR.Admin.WebApi.Controllers /// [HttpPut] [ActionPermissionFilter(Permission = "business:gendemo:update")] - [Log(Title = "代码生成演示修改", BusinessType = BusinessType.UPDATE)] + [Log(Title = "代码生成演示", BusinessType = BusinessType.UPDATE)] public IActionResult UpdateGendemo([FromBody] GendemoDto parm) { if (parm == null) @@ -119,8 +123,12 @@ namespace ZR.Admin.WebApi.Controllers Name = model.Name, Icon = model.Icon, ShowStatus = model.ShowStatus, + AddTime = model.AddTime, Sex = model.Sex, Sort = model.Sort, + BeginTime = model.BeginTime, + EndTime = model.EndTime, + Remark = model.Remark, }); return SUCCESS(response); @@ -132,7 +140,7 @@ namespace ZR.Admin.WebApi.Controllers /// [HttpDelete("{ids}")] [ActionPermissionFilter(Permission = "business:gendemo:delete")] - [Log(Title = "代码生成演示删除", BusinessType = BusinessType.DELETE)] + [Log(Title = "代码生成演示", BusinessType = BusinessType.DELETE)] public IActionResult DeleteGendemo(string ids) { int[] idsArr = Tools.SpitIntArrary(ids); diff --git a/ZR.Model/Dto/GendemoDto.cs b/ZR.Model/Dto/GendemoDto.cs index de6932b..7f86d2a 100644 --- a/ZR.Model/Dto/GendemoDto.cs +++ b/ZR.Model/Dto/GendemoDto.cs @@ -16,6 +16,9 @@ namespace ZR.Model.Dto public int ShowStatus { get; set; } public int? Sex { get; set; } public int? Sort { get; set; } + public DateTime? BeginTime { get; set; } + public DateTime? EndTime { get; set; } + public string Remark { get; set; } } @@ -24,7 +27,6 @@ namespace ZR.Model.Dto /// public class GendemoQueryDto: PagerInfo { - public string Name { get; set; } public DateTime? BeginTime { get; set; } public DateTime? EndTime { get; set; } diff --git a/ZR.Model/Models/Gendemo.cs b/ZR.Model/Models/Gendemo.cs index e2e2556..0ba1695 100644 --- a/ZR.Model/Models/Gendemo.cs +++ b/ZR.Model/Models/Gendemo.cs @@ -7,7 +7,7 @@ namespace ZR.Model.Models /// 代码生成演示,数据实体对象 /// /// @author zr - /// @date 2021-09-27 + /// @date 2021-11-24 /// [SqlSugar.SugarTable("gen_demo")] public class Gendemo @@ -16,11 +16,11 @@ namespace ZR.Model.Models /// 描述 :自增id /// 空值 :False /// - [SqlSugar.SugarColumn(IsPrimaryKey = true, IsIdentity = true)] + [SqlSugar.SugarColumn(IsPrimaryKey = false, IsIdentity = true)] public int Id { get; set; } /// /// 描述 :名称 - /// 空值 :False + /// 空值 :True /// public string Name { get; set; } /// @@ -48,6 +48,21 @@ namespace ZR.Model.Models /// 空值 :True /// public int? Sort { get; set; } + /// + /// 描述 :开始时间 + /// 空值 :True + /// + public DateTime? BeginTime { get; set; } + /// + /// 描述 :结束时间 + /// 空值 :True + /// + public DateTime? EndTime { get; set; } + /// + /// 描述 :备注 + /// 空值 :True + /// + public string Remark { get; set; } } } diff --git a/ZR.Repository/Repositories/GendemoRepository.cs b/ZR.Repository/Repositories/GendemoRepository.cs index 061add0..e830a4c 100644 --- a/ZR.Repository/Repositories/GendemoRepository.cs +++ b/ZR.Repository/Repositories/GendemoRepository.cs @@ -2,8 +2,6 @@ using System; using Infrastructure.Attribute; using ZR.Repository.System; using ZR.Model.Models; -using SqlSugar; -using SqlSugar.IOC; namespace ZR.Repository { @@ -11,22 +9,12 @@ namespace ZR.Repository /// 代码生成演示仓储接口的实现 /// /// @author zr - /// @date 2021-09-27 + /// @date 2021-11-24 /// [AppService(ServiceLifetime = LifeTime.Transient)] public class GendemoRepository : BaseRepository { - private readonly ISqlSugarClient db; - public GendemoRepository() - { - db = DbScoped.SugarScope.GetConnection(1); - } - #region 业务逻辑代码 - public void Test() - { - var date = db.GetDate(); - } #endregion } } \ No newline at end of file diff --git a/ZR.Service/Business/GendemoService.cs b/ZR.Service/Business/GendemoService.cs index 7bd56c5..8328c68 100644 --- a/ZR.Service/Business/GendemoService.cs +++ b/ZR.Service/Business/GendemoService.cs @@ -1,12 +1,5 @@ using Infrastructure; using Infrastructure.Attribute; -using Infrastructure.Extensions; -using SqlSugar; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using ZR.Common; using ZR.Model.Models; using ZR.Repository; @@ -16,22 +9,19 @@ namespace ZR.Service.Business /// 代码生成演示Service业务层处理 /// /// @author zr - /// @date 2021-09-27 + /// @date 2021-11-24 /// [AppService(ServiceType = typeof(IGendemoService), ServiceLifetime = LifeTime.Transient)] public class GendemoService: BaseService, IGendemoService { - private readonly GendemoRepository _repository; + private readonly GendemoRepository _Gendemorepository; public GendemoService(GendemoRepository repository) { - _repository = repository; + _Gendemorepository = repository; } #region 业务逻辑代码 - public void Test() - { - _repository.Test(); - } + #endregion } } \ No newline at end of file diff --git a/ZR.Service/Business/IBusService/IGendemoService.cs b/ZR.Service/Business/IBusService/IGendemoService.cs index 969afd1..2274ec3 100644 --- a/ZR.Service/Business/IBusService/IGendemoService.cs +++ b/ZR.Service/Business/IBusService/IGendemoService.cs @@ -7,10 +7,9 @@ namespace ZR.Service.Business /// 代码生成演示service接口 /// /// @author zr - /// @date 2021-09-27 + /// @date 2021-11-24 /// public interface IGendemoService: IBaseService { - void Test(); } } diff --git a/ZR.Vue/src/views/business/gendemo/index.vue b/ZR.Vue/src/views/business/gendemo/index.vue index bac7304..a1bf969 100644 --- a/ZR.Vue/src/views/business/gendemo/index.vue +++ b/ZR.Vue/src/views/business/gendemo/index.vue @@ -2,19 +2,13 @@
- - - - - - 搜索 重置 - + @@ -30,24 +24,28 @@ - + - + - - - - + + + + + + + + @@ -55,32 +53,40 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +