diff --git a/Myshipping.Application/Entity/TaskManagePlat/TaskAPIInfo.cs b/Myshipping.Application/Entity/TaskManagePlat/TaskAPIInfo.cs new file mode 100644 index 00000000..3e49298b --- /dev/null +++ b/Myshipping.Application/Entity/TaskManagePlat/TaskAPIInfo.cs @@ -0,0 +1,47 @@ +using System; +using SqlSugar; +using System.ComponentModel; +using Myshipping.Core.Entity; +using NPOI.SS.UserModel; + +namespace Myshipping.Application.Entity +{ + /// + /// 任务API配置 + /// + [SugarTable("task_api_info")] + [Description("任务主表")] + public class TaskAPIInfo : TaskManageDbEntity + { + /// + /// API名称 + /// + public string APIName { get; set; } + /// + /// 请求地址 + /// + public string URL { get; set; } + /// + /// 请求方式 + /// + public string RequestMethod { get; set; } + /// + /// 请求key + /// + public string Key { get; set; } + /// + /// 请求密钥 + /// + public string SecretKey { get; set; } + + /// + /// 平台代码 + /// + public string SYSTEM_CODE { get; set; } + + /// + /// 平台名称 + /// + public string SYSTEM_NAME { get; set; } +} +} diff --git a/Myshipping.Application/Entity/TaskManagePlat/TaskFlowTenant.cs b/Myshipping.Application/Entity/TaskManagePlat/TaskFlowTenant.cs new file mode 100644 index 00000000..4f56220e --- /dev/null +++ b/Myshipping.Application/Entity/TaskManagePlat/TaskFlowTenant.cs @@ -0,0 +1,31 @@ +using System; +using SqlSugar; +using System.ComponentModel; +using Myshipping.Core.Entity; +using NPOI.SS.UserModel; + +namespace Myshipping.Application.Entity +{ + /// + /// 任务租户流程配置 + /// + [SugarTable("task_flow_tenant")] + [Description("租户任务流程配置 ")] + public class TaskFlowTenant : TaskManageDbEntity + { + /// + /// 任务APIID + /// + public string TaskApiId { get; set; } + + /// + /// 平台代码 + /// + public string SYSTEM_CODE { get; set; } + + /// + /// 平台名称 + /// + public string SYSTEM_NAME { get; set; } +} +} diff --git a/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskAPIDto.cs b/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskAPIDto.cs new file mode 100644 index 00000000..97c67192 --- /dev/null +++ b/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskAPIDto.cs @@ -0,0 +1,80 @@ +using Myshipping.Core; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Myshipping.Application +{ + + public class TaskAPIBase + { + /// + /// API名称 + /// + public string APIName { get; set; } + /// + /// 请求地址 + /// + public string URL { get; set; } + /// + /// 请求方式 + /// + public string RequestMethod { get; set; } + /// + /// 请求key + /// + public string Key { get; set; } + /// + /// 请求密钥 + /// + public string SecretKey { get; set; } + + /// + /// 平台代码 + /// + public string SYSTEM_CODE { get; set; } + + /// + /// 平台名称 + /// + public string SYSTEM_NAME { get; set; } + } + + public class TaskAPIInput:PageInputBase + { + + } + + + public class AddTaskAPIInput : TaskAPIBase + { + + } + + public class DeleteTaskAPIInput + { + /// + /// 主键 + /// + public string PK_ID { get; set; } + } + + public class UpdateTaskAPIInput: TaskAPIBase + { + /// + /// 主键 + /// + public string PK_ID { get; set; } + } + + public class GetTaskApiInfoInput + { + /// + /// 主键 + /// + public string PK_ID { get; set; } + } + +} diff --git a/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskFlowTenantDto.cs b/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskFlowTenantDto.cs new file mode 100644 index 00000000..db3f47a2 --- /dev/null +++ b/Myshipping.Application/Service/TaskManagePlat/Dtos/TaskFlowTenantDto.cs @@ -0,0 +1,72 @@ +using Myshipping.Core; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Myshipping.Application +{ + + + + public class TaskFlowTenantBase + { + + /// + /// 任务APIId + /// + public string TaskApiId { get; set; } + + + /// + /// 平台代码 + /// + public string SYSTEM_CODE { get; set; } + + /// + /// 平台名称 + /// + public string SYSTEM_NAME { get; set; } + } + + public class TaskFlowTenantInput : PageInputBase + { + /// + /// 任务APIId + /// + public string TaskApiId { get; set; } + + + } + + + public class AddTaskFlowTenantInput : TaskFlowTenantBase + { + + } + + public class DeleteTaskFlowTenantInput + { + /// + /// 主键 + /// + public string PK_ID { get; set; } + } + + public class UpdateTaskFlowTenantInput : TaskFlowTenantBase + { + /// + /// 主键 + /// + public string PK_ID { get; set; } + } + + public class GetTaskFlowTenantInfoInput + { + /// + /// 主键 + /// + public string PK_ID { get; set; } + } +} diff --git a/Myshipping.Application/Service/TaskManagePlat/TaskAPIService.cs b/Myshipping.Application/Service/TaskManagePlat/TaskAPIService.cs new file mode 100644 index 00000000..cd0bb3f2 --- /dev/null +++ b/Myshipping.Application/Service/TaskManagePlat/TaskAPIService.cs @@ -0,0 +1,128 @@ +using Furion; +using Furion.DependencyInjection; +using Furion.DynamicApiController; +using Furion.FriendlyException; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Myshipping.Core.Service; +using Myshipping.Core; +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Myshipping.Application.Entity; +using Myshipping.Application.Service.Fee.Dto; +using Mapster; +using Furion.DistributedIDGenerator; + +namespace Myshipping.Application.Service.TaskManagePlat +{ + + /// + /// 任务API配置 + /// + [ApiDescriptionSettings("Application", Name = "TaskAPI", Order = 10)] + public class TaskAPIService : IDynamicApiController, ITransient + { + + private readonly SqlSugarRepository _rep; + public TaskAPIService(SqlSugarRepository rep) + { + _rep = rep; + } + + /// + /// 分页查询任务API配置 + /// + /// + /// + [HttpPost] + [ApiDescriptionSettings(Name = "Page")] + public async Task> Page(TaskAPIInput input) + { + var query = _rep.AsQueryable() + .Select(u => new TaskAPIInfo + { + PK_ID = u.PK_ID, + APIName = u.APIName, + URL = u.URL, + RequestMethod = u.RequestMethod, + Key = u.Key, + SecretKey = u.SecretKey, + SYSTEM_CODE = u.SYSTEM_CODE, + SYSTEM_NAME = u.SYSTEM_NAME + }); + + return await query.ToPagedListAsync(input.PageNo, input.PageSize); + } + + /// + /// 增加任务API配置 + /// + /// + /// + [HttpPost] + [ApiDescriptionSettings(Name = "Add")] + public async Task Add(AddTaskAPIInput input) + { + var entity = input.Adapt(); + entity.PK_ID = IDGen.NextID().ToString(); + await _rep.InsertAsync(entity); + } + + /// + /// 删除任务API配置 + /// + /// + /// + [HttpPost] + [ApiDescriptionSettings(Name = "Delete")] + public async Task Delete(DeleteTaskAPIInput input) + { + var entity = await _rep.FirstOrDefaultAsync(u => u.PK_ID == input.PK_ID) ?? throw Oops.Oh("数据不存在"); + entity.IsDeleted = true; + await _rep.UpdateAsync(entity); + } + + /// + /// 更新任务API配置 + /// + /// + /// + [HttpPost] + [ApiDescriptionSettings(Name = "Update")] + public async Task Update(UpdateTaskAPIInput input) + { + var entity = input.Adapt(); + await _rep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync(); + } + + /// + /// 获取任务API配置详情 + /// + /// + /// + [HttpPost] + [ApiDescriptionSettings(Name = "Detail")] + public async Task Get(GetTaskApiInfoInput input) + { + return await _rep.FirstOrDefaultAsync(u => u.PK_ID == input.PK_ID); + } + + /// + /// 获取任务API配置列表 + /// + /// + /// + [HttpGet] + [ApiDescriptionSettings(Name = "List")] + public async Task> List([FromQuery] TaskAPIInput input) + { + return await _rep.AsQueryable().Select().ToListAsync(); + } + + } +} diff --git a/Myshipping.Application/Service/TaskManagePlat/TaskFlowTenant.cs b/Myshipping.Application/Service/TaskManagePlat/TaskFlowTenant.cs new file mode 100644 index 00000000..b646c20a --- /dev/null +++ b/Myshipping.Application/Service/TaskManagePlat/TaskFlowTenant.cs @@ -0,0 +1,118 @@ +using Furion.DependencyInjection; +using Furion.DistributedIDGenerator; +using Furion.DynamicApiController; +using Furion.FriendlyException; +using Mapster; +using Microsoft.AspNetCore.Mvc; +using Myshipping.Application.Entity; +using Myshipping.Core; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Myshipping.Application.Service.TaskManagePlat +{ + + /// + /// 租户任务流程配置 + /// + [ApiDescriptionSettings("Application", Name = "TaskFlowTenant", Order = 10)] + public class TaskFlowTenantService : IDynamicApiController, ITransient + { + + private readonly SqlSugarRepository _rep; + public TaskFlowTenantService(SqlSugarRepository rep) + { + _rep = rep; + } + + /// + /// 分页查询租户任务流程配置 + /// + /// + /// + [HttpPost] + [ApiDescriptionSettings(Name = "Page")] + public async Task> Page(TaskFlowTenantInput input) + { + var query = _rep.AsQueryable() + .Select(u => new TaskFlowTenant + { + PK_ID = u.PK_ID, + TaskApiId = u.TaskApiId, + SYSTEM_CODE = u.SYSTEM_CODE, + SYSTEM_NAME = u.SYSTEM_NAME + }); + + return await query.ToPagedListAsync(input.PageNo, input.PageSize); + } + + /// + /// 增加租户任务流程配置 + /// + /// + /// + [HttpPost] + [ApiDescriptionSettings(Name = "Add")] + public async Task Add(AddTaskFlowTenantInput input) + { + var entity = input.Adapt(); + entity.PK_ID = IDGen.NextID().ToString(); + await _rep.InsertAsync(entity); + } + + /// + /// 删除租户任务流程配置 + /// + /// + /// + [HttpPost] + [ApiDescriptionSettings(Name = "Delete")] + public async Task Delete(DeleteTaskFlowTenantInput input) + { + var entity = await _rep.FirstOrDefaultAsync(u => u.PK_ID == input.PK_ID) ?? throw Oops.Oh("数据不存在"); + entity.IsDeleted = true; + await _rep.UpdateAsync(entity); + } + + /// + /// 更新租户任务流程配置 + /// + /// + /// + [HttpPost] + [ApiDescriptionSettings(Name = "Update")] + public async Task Update(UpdateTaskFlowTenantInput input) + { + var entity = input.Adapt(); + await _rep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync(); + } + + /// + /// 获取租户任务流程配置 + /// + /// + /// + [HttpPost] + [ApiDescriptionSettings(Name = "Detail")] + public async Task Get(GetTaskFlowTenantInfoInput input) + { + return await _rep.FirstOrDefaultAsync(u => u.PK_ID == input.PK_ID); + } + + /// + /// 获取租户任务流程配置 + /// + /// + /// + [HttpGet] + [ApiDescriptionSettings(Name = "List")] + public async Task> List([FromQuery] TaskFlowTenantInput input) + { + return await _rep.AsQueryable().Select().ToListAsync(); + } + + } +} diff --git a/Myshipping.Core/Myshipping.Core.xml b/Myshipping.Core/Myshipping.Core.xml index 1b4c18b8..262cc054 100644 --- a/Myshipping.Core/Myshipping.Core.xml +++ b/Myshipping.Core/Myshipping.Core.xml @@ -2230,6 +2230,11 @@ 排序 + + + 是否多选 + + 客户参数定义 @@ -11656,6 +11661,11 @@ 排序 + + + 是否多选 + + 列表输出