From 2cc36f4e0ffe00bf98bd3d0907355fe1a270bd20 Mon Sep 17 00:00:00 2001 From: wanghaomei Date: Thu, 10 Nov 2022 09:55:38 +0800 Subject: [PATCH] =?UTF-8?q?=E9=92=89=E9=92=89=E7=BE=A4=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Entity/DJY/DjyDingtalkGroupConfig.cs | 31 ++++ Myshipping.Core/Myshipping.Core.xml | 175 ++++++++++++++++++ .../DjyDingtalkGroupConfigService.cs | 116 ++++++++++++ .../Dto/DjyDingtalkGroupConfigInput.cs | 98 ++++++++++ .../Dto/DjyDingtalkGroupConfigOutput.cs | 36 ++++ .../IDjyDingtalkGroupConfigService.cs | 16 ++ 6 files changed, 472 insertions(+) create mode 100644 Myshipping.Core/Entity/DJY/DjyDingtalkGroupConfig.cs create mode 100644 Myshipping.Core/Service/DjyDingtalkGroupConfig/DjyDingtalkGroupConfigService.cs create mode 100644 Myshipping.Core/Service/DjyDingtalkGroupConfig/Dto/DjyDingtalkGroupConfigInput.cs create mode 100644 Myshipping.Core/Service/DjyDingtalkGroupConfig/Dto/DjyDingtalkGroupConfigOutput.cs create mode 100644 Myshipping.Core/Service/DjyDingtalkGroupConfig/IDjyDingtalkGroupConfigService.cs diff --git a/Myshipping.Core/Entity/DJY/DjyDingtalkGroupConfig.cs b/Myshipping.Core/Entity/DJY/DjyDingtalkGroupConfig.cs new file mode 100644 index 00000000..6fa5b866 --- /dev/null +++ b/Myshipping.Core/Entity/DJY/DjyDingtalkGroupConfig.cs @@ -0,0 +1,31 @@ +using System; +using SqlSugar; +using System.ComponentModel; +using Myshipping.Core.Entity; +namespace Myshipping.Application.Entity +{ + /// + /// 钉钉客服通知群配置 + /// + [SugarTable("djy_dingtalk_group_config")] + [Description("钉钉客服通知群配置")] + public class DjyDingtalkGroupConfig : DEntityBase + { + /// + /// 代码 + /// + public string Code { get; set; } + /// + /// 说明 + /// + public string Desp { get; set; } + /// + /// Url + /// + public string Url { get; set; } + /// + /// 关键 + /// + public string Keyword { get; set; } + } +} \ No newline at end of file diff --git a/Myshipping.Core/Myshipping.Core.xml b/Myshipping.Core/Myshipping.Core.xml index aae2ef1a..dc86f87b 100644 --- a/Myshipping.Core/Myshipping.Core.xml +++ b/Myshipping.Core/Myshipping.Core.xml @@ -7867,6 +7867,156 @@ 备注 + + + 钉钉客服通知群配置服务 + + + + + 分页查询钉钉客服通知群配置 + + + + + + + 增加钉钉客服通知群配置 + + + + + + + 更新钉钉客服通知群配置 + + + + + + + 删除钉钉客服通知群配置 + + + + + + + 获取钉钉客服通知群配置 + + + + + + + 钉钉客服通知群配置输入参数 + + + + + 代码 + + + + + 说明 + + + + + Url + + + + + 关键 + + + + + 钉钉客服通知群配置新增输入参数 + + + + + 钉钉客服通知群配置修改输入参数 + + + + + 主键Id + + + + + 钉钉客服通知群配置获取(删除)输入参数 + + + + + 主键Id + + + + + 钉钉客服通知群配置查询输入参数 + + + + + 主键Id + + + + + 代码 + + + + + 说明 + + + + + Url + + + + + 关键 + + + + + 钉钉客服通知群配置输出参数 + + + + + 主键Id + + + + + 代码 + + + + + 说明 + + + + + Url + + + + + 关键 + + EDI参数设置服务 @@ -14462,6 +14612,31 @@ + + + 钉钉客服通知群配置 + + + + + 代码 + + + + + 说明 + + + + + Url + + + + + 关键 + + 用户邮箱账号 diff --git a/Myshipping.Core/Service/DjyDingtalkGroupConfig/DjyDingtalkGroupConfigService.cs b/Myshipping.Core/Service/DjyDingtalkGroupConfig/DjyDingtalkGroupConfigService.cs new file mode 100644 index 00000000..cb965bee --- /dev/null +++ b/Myshipping.Core/Service/DjyDingtalkGroupConfig/DjyDingtalkGroupConfigService.cs @@ -0,0 +1,116 @@ +using Myshipping.Core; +using Furion.DependencyInjection; +using Furion.DynamicApiController; +using Mapster; +using Microsoft.AspNetCore.Mvc; +using SqlSugar; +using System.Linq; +using System.Threading.Tasks; +using Myshipping.Application.Entity; +using Microsoft.Extensions.Logging; +using Furion.FriendlyException; + +namespace Myshipping.Core.Service +{ + /// + /// 钉钉客服通知群配置服务 + /// + [ApiDescriptionSettings(Name = "DjyDingtalkGroupConfig", Order = 1)] + public class DjyDingtalkGroupConfigService : IDjyDingtalkGroupConfigService, IDynamicApiController, ITransient + { + private readonly SqlSugarRepository _rep; + private readonly ILogger _logger; + + public DjyDingtalkGroupConfigService(SqlSugarRepository rep, ILogger logger) + { + _rep = rep; + _logger = logger; + } + + /// + /// 分页查询钉钉客服通知群配置 + /// + /// + /// + [HttpGet("/DjyDingtalkGroupConfig/page")] + public async Task Page([FromQuery] QueryDjyDingtalkGroupConfigInput input) + { + var entities = await _rep.AsQueryable() + .WhereIF(!string.IsNullOrWhiteSpace(input.Code), u => u.Code == input.Code) + .WhereIF(!string.IsNullOrWhiteSpace(input.Desp), u => u.Desp.Contains(input.Desp.Trim())) + .WhereIF(!string.IsNullOrWhiteSpace(input.Keyword), u => u.Keyword.Contains(input.Keyword.Trim())) + .ToPagedListAsync(input.PageNo, input.PageSize); + return entities.XnPagedResult(); + } + + /// + /// 增加钉钉客服通知群配置 + /// + /// + /// + [HttpPost("/DjyDingtalkGroupConfig/add")] + public async Task Add(AddDjyDingtalkGroupConfigInput input) + { + var cc = _rep.Count(x => x.Code == input.Code); + if (cc > 0) + { + throw Oops.Bah("代码重复"); + } + + var entity = input.Adapt(); + await _rep.InsertAsync(entity); + } + + /// + /// 更新钉钉客服通知群配置 + /// + /// + /// + [HttpPost("/DjyDingtalkGroupConfig/edit")] + public async Task Update(UpdateDjyDingtalkGroupConfigInput input) + { + var cc = _rep.Count(x => x.Code == input.Code && x.Id != input.Id); + if (cc > 0) + { + throw Oops.Bah("代码重复"); + } + + var entity = input.Adapt(); + await _rep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync(); + } + + /// + /// 删除钉钉客服通知群配置 + /// + /// + /// + [HttpPost("/DjyDingtalkGroupConfig/delete")] + public async Task Delete(GetDjyDingtalkGroupConfigInput input) + { + var entity = await _rep.FirstOrDefaultAsync(u => u.Id == input.Id); + await _rep.DeleteAsync(entity); + } + + /// + /// 获取钉钉客服通知群配置 + /// + /// + /// + [HttpGet("/DjyDingtalkGroupConfig/detail")] + public async Task Get([FromQuery] GetDjyDingtalkGroupConfigInput input) + { + return await _rep.FirstOrDefaultAsync(u => u.Id == input.Id); + } + + ///// + ///// 获取钉钉客服通知群配置列表 + ///// + ///// + ///// + //[HttpGet("/DjyDingtalkGroupConfig/list")] + //public async Task List([FromQuery] QueryDjyDingtalkGroupConfigInput input) + //{ + // return await _rep.ToListAsync(); + //} + } +} diff --git a/Myshipping.Core/Service/DjyDingtalkGroupConfig/Dto/DjyDingtalkGroupConfigInput.cs b/Myshipping.Core/Service/DjyDingtalkGroupConfig/Dto/DjyDingtalkGroupConfigInput.cs new file mode 100644 index 00000000..ca6fda3d --- /dev/null +++ b/Myshipping.Core/Service/DjyDingtalkGroupConfig/Dto/DjyDingtalkGroupConfigInput.cs @@ -0,0 +1,98 @@ +using Myshipping.Core; +using System; +using System.ComponentModel.DataAnnotations; + +namespace Myshipping.Core.Service +{ + /// + /// 钉钉客服通知群配置输入参数 + /// + public class DjyDingtalkGroupConfigInput + { + /// + /// 代码 + /// + public virtual string Code { get; set; } + + /// + /// 说明 + /// + public virtual string Desp { get; set; } + + /// + /// Url + /// + public virtual string Url { get; set; } + + /// + /// 关键 + /// + public virtual string Keyword { get; set; } + + } + + /// + /// 钉钉客服通知群配置新增输入参数 + /// + public class AddDjyDingtalkGroupConfigInput : DjyDingtalkGroupConfigInput + { + } + + /// + /// 钉钉客服通知群配置修改输入参数 + /// + public class UpdateDjyDingtalkGroupConfigInput : DjyDingtalkGroupConfigInput + { + /// + /// 主键Id + /// + [Required(ErrorMessage = "主键Id不能为空")] + public long Id { get; set; } + + } + + /// + /// 钉钉客服通知群配置获取(删除)输入参数 + /// + public class GetDjyDingtalkGroupConfigInput + { + /// + /// 主键Id + /// + [Required(ErrorMessage = "主键Id不能为空")] + public long Id { get; set; } + + } + + /// + /// 钉钉客服通知群配置查询输入参数 + /// + public class QueryDjyDingtalkGroupConfigInput : PageInputBase + { + /// + /// 主键Id + /// + public virtual long Id { get; set; } + + /// + /// 代码 + /// + public virtual string Code { get; set; } + + /// + /// 说明 + /// + public virtual string Desp { get; set; } + + /// + /// Url + /// + public virtual string Url { get; set; } + + /// + /// 关键 + /// + public virtual string Keyword { get; set; } + + } +} diff --git a/Myshipping.Core/Service/DjyDingtalkGroupConfig/Dto/DjyDingtalkGroupConfigOutput.cs b/Myshipping.Core/Service/DjyDingtalkGroupConfig/Dto/DjyDingtalkGroupConfigOutput.cs new file mode 100644 index 00000000..c93b510c --- /dev/null +++ b/Myshipping.Core/Service/DjyDingtalkGroupConfig/Dto/DjyDingtalkGroupConfigOutput.cs @@ -0,0 +1,36 @@ +using System; + +namespace Myshipping.Core.Service +{ + /// + /// 钉钉客服通知群配置输出参数 + /// + public class DjyDingtalkGroupConfigOutput + { + /// + /// 主键Id + /// + public long Id { get; set; } + + /// + /// 代码 + /// + public string Code { get; set; } + + /// + /// 说明 + /// + public string Desp { get; set; } + + /// + /// Url + /// + public string Url { get; set; } + + /// + /// 关键 + /// + public string Keyword { get; set; } + + } +} diff --git a/Myshipping.Core/Service/DjyDingtalkGroupConfig/IDjyDingtalkGroupConfigService.cs b/Myshipping.Core/Service/DjyDingtalkGroupConfig/IDjyDingtalkGroupConfigService.cs new file mode 100644 index 00000000..cccb2998 --- /dev/null +++ b/Myshipping.Core/Service/DjyDingtalkGroupConfig/IDjyDingtalkGroupConfigService.cs @@ -0,0 +1,16 @@ +using Myshipping.Core; +using Microsoft.AspNetCore.Mvc; +using System.Threading.Tasks; +using Myshipping.Application.Entity; +namespace Myshipping.Core.Service +{ + public interface IDjyDingtalkGroupConfigService + { + Task Page([FromQuery] QueryDjyDingtalkGroupConfigInput input); + Task Add(AddDjyDingtalkGroupConfigInput input); + Task Update(UpdateDjyDingtalkGroupConfigInput input); + Task Delete(GetDjyDingtalkGroupConfigInput input); + Task Get([FromQuery] GetDjyDingtalkGroupConfigInput input); + //Task List([FromQuery] QueryDjyDingtalkGroupConfigInput input); + } +} \ No newline at end of file