From 55b28bd99c02e15f2424783201846804212e3df3 Mon Sep 17 00:00:00 2001 From: "747575620@qq.com" <747575620@qq.com> Date: Mon, 7 Aug 2023 10:17:14 +0800 Subject: [PATCH] =?UTF-8?q?AGV=E7=82=B9=E4=BD=8D=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BPA.MES.Base.Application.xml | 381 ++++++++++++++++++ .../Services/AGVService/Dtos/AgvLineDto.cs | 95 +++++ .../Services/AGVService/Dtos/AgvPointDto.cs | 83 ++++ .../AGVService/Services/AgvLineService.cs | 115 ++++++ .../AGVService/Services/AgvPointService.cs | 115 ++++++ .../AGVService/Services/IAgvLineService.cs | 43 ++ .../AGVService/Services/IAgvPointService.cs | 43 ++ 7 files changed, 875 insertions(+) create mode 100644 backend/BPA.MES.Base.Application/Services/AGVService/Dtos/AgvLineDto.cs create mode 100644 backend/BPA.MES.Base.Application/Services/AGVService/Dtos/AgvPointDto.cs create mode 100644 backend/BPA.MES.Base.Application/Services/AGVService/Services/AgvLineService.cs create mode 100644 backend/BPA.MES.Base.Application/Services/AGVService/Services/AgvPointService.cs create mode 100644 backend/BPA.MES.Base.Application/Services/AGVService/Services/IAgvLineService.cs create mode 100644 backend/BPA.MES.Base.Application/Services/AGVService/Services/IAgvPointService.cs diff --git a/backend/BPA.MES.Base.Application/BPA.MES.Base.Application.xml b/backend/BPA.MES.Base.Application/BPA.MES.Base.Application.xml index 85f9321..ca433b8 100644 --- a/backend/BPA.MES.Base.Application/BPA.MES.Base.Application.xml +++ b/backend/BPA.MES.Base.Application/BPA.MES.Base.Application.xml @@ -1209,6 +1209,387 @@ 工单状态(信息系统 --> 中控系统) + + + 名 称 : + 创 建 人 :yangxiao + 创建时间 : 2023/8/7 9:59:47 + 描 述 : + + + + + 自定义编码 + + + + + 线路名称 + + + + + 开始点位 + + + + + 结束点位 + + + + + 描述 + + + + + 增加 + + + + + 修改 + + + + + 主键 + + + + + 刪除 + + + + + 主键 + + + + + 普通查询条件 + + + + + 主键 + + + + + 分页查询条件 + + + + + 名称 + + + + + 编码 + + + + + 输出 + + + + + 主键 + + + + + 名 称 : + 创 建 人 :yangxiao + 创建时间 : 2023/8/7 10:00:01 + 描 述 : + + + + + 点位名称 + + + + + 点位编码 + + + + + 增加 + + + + + 修改 + + + + + 主键 + + + + + 刪除 + + + + + 主键 + + + + + 普通查询条件 + + + + + 主键 + + + + + 分页查询条件 + + + + + 名称 + + + + + 编码 + + + + + 输出 + + + + + 主键 + + + + + 名 称 :AGV线路管理 + 创 建 人 :yangxiao + 创建时间 : 2023/8/7 10:03:21 + 描 述 : + + + + + 增加 + + + + + + + 删除 + + + + + + + + 详情 + + + + + + + + 列表 + + + + + + + 分页 + + + + + + + 下拉 + + + + + + + 更新 + + + + + + + + 名 称 :AGV点位管理 + 创 建 人 :yangxiao + 创建时间 : 2023/8/7 10:03:37 + 描 述 : + + + + + 增加 + + + + + + + 删除 + + + + + + + + 详情 + + + + + + + + 列表 + + + + + + + 分页 + + + + + + + 下拉 + + + + + + + 更新 + + + + + + + + 名 称 : + 创 建 人 :yangxiao + 创建时间 : 2023/8/7 10:02:54 + 描 述 : + + + + + 增加 + + + + + + 移除 + + + + + + 更新 + + + + + + 不分页列表 + + + + + + 分页列表 + + + + + + 查询单条 + + + + + + + 名 称 :AVG点位 + 创 建 人 :yangxiao + 创建时间 : 2023/8/7 10:03:06 + 描 述 : + + + + + 增加 + + + + + + 移除 + + + + + + 更新 + + + + + + 不分页列表 + + + + + + 分页列表 + + + + + + 查询单条 + + + + 名 称 : diff --git a/backend/BPA.MES.Base.Application/Services/AGVService/Dtos/AgvLineDto.cs b/backend/BPA.MES.Base.Application/Services/AGVService/Dtos/AgvLineDto.cs new file mode 100644 index 0000000..2539232 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/AGVService/Dtos/AgvLineDto.cs @@ -0,0 +1,95 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 : + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/8/7 9:59:47 + /// 描 述 : + /// + public class AgvLineDto + { + /// + /// 自定义编码 + /// + public string Code { get; set; } + /// + /// 线路名称 + /// + public string Name { get; set; } + /// + /// 开始点位 + /// + public string StartPointId { get; set; } + /// + /// 结束点位 + /// + public string EndPointId { get; set; } + /// + /// 描述 + /// + public string Description { get; set; } + } + /// + /// 增加 + /// + public class AgvLineAddInput : AgvLineDto + { + + } + /// + /// 修改 + /// + public class AgvLineUpdateInput : AgvLineDto + { + /// + /// 主键 + /// + public string Id { get; set; } + } + /// + /// 刪除 + /// + public class AgvLineDelInput + { + /// + /// 主键 + /// + public string Id { get; set; } + } + /// + /// 普通查询条件 + /// + public class AgvLineQueryInput + { + /// + /// 主键 + /// + public string Id { get; set; } + } + /// + /// 分页查询条件 + /// + public class AgvLineQueryPageInput : RequestPage + { + + /// + /// 名称 + /// + public string Name { get; set; } + /// + /// 编码 + /// + public string Code { get; set; } + } + /// + /// 输出 + /// + public class AgvLineOutput : AgvLineDto + { + /// + /// 主键 + /// + public string Id { get; set; } + //下面增加多的数据 + } +} \ No newline at end of file diff --git a/backend/BPA.MES.Base.Application/Services/AGVService/Dtos/AgvPointDto.cs b/backend/BPA.MES.Base.Application/Services/AGVService/Dtos/AgvPointDto.cs new file mode 100644 index 0000000..1d3299d --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/AGVService/Dtos/AgvPointDto.cs @@ -0,0 +1,83 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 : + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/8/7 10:00:01 + /// 描 述 : + /// + public class AgvPointDto + { + /// + /// 点位名称 + /// + public string Name { get; set; } + /// + /// 点位编码 + /// + public string Code { get; set; } + } + /// + /// 增加 + /// + public class AgvPointAddInput : AgvPointDto + { + + } + /// + /// 修改 + /// + public class AgvPointUpdateInput : AgvPointDto + { + /// + /// 主键 + /// + public string Id { get; set; } + } + /// + /// 刪除 + /// + public class AgvPointDelInput + { + /// + /// 主键 + /// + public string Id { get; set; } + } + /// + /// 普通查询条件 + /// + public class AgvPointQueryInput + { + /// + /// 主键 + /// + public string Id { get; set; } + } + /// + /// 分页查询条件 + /// + public class AgvPointQueryPageInput : RequestPage + { + + /// + /// 名称 + /// + public string Name { get; set; } + /// + /// 编码 + /// + public string Code { get; set; } + } + /// + /// 输出 + /// + public class AgvPointOutput : AgvPointDto + { + /// + /// 主键 + /// + public string Id { get; set; } + //下面增加多的数据 + } +} \ No newline at end of file diff --git a/backend/BPA.MES.Base.Application/Services/AGVService/Services/AgvLineService.cs b/backend/BPA.MES.Base.Application/Services/AGVService/Services/AgvLineService.cs new file mode 100644 index 0000000..7a53431 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/AGVService/Services/AgvLineService.cs @@ -0,0 +1,115 @@ +namespace BPA.MES.Base.Application.Services.AGVService.Services +{ + /// + /// 名 称 :AGV线路管理 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/8/7 10:03:21 + /// 描 述 : + /// + [ApiDescriptionSettings("AGV管理", Name = "AgvLine", Tag = "AGV线路", KeepName = true, SplitCamelCase = true, KeepVerb = true)] + public class AgvLineService : IAgvLineService, ITransient, IDynamicApiController + { + private readonly ISqlSugarClient _dbContext; + public AgvLineService(ISqlSugarClient db) + { + _dbContext = db; + } + /// + /// 增加 + /// + /// + /// + [HttpPost] + public async Task Add(AgvLineAddInput input) + { + var r_entity = await _dbContext.Queryable().FirstAsync(x => x.Name == input.Name); + if (r_entity != null) + { + throw Oops.Bah("名称已存在!"); + } + AgvLineEntity entity = input.Adapt(); + return await _dbContext.Insertable(entity).IgnoreColumns(ignoreNullColumn: true).ExecuteCommandIdentityIntoEntityAsync(); + } + /// + /// 删除 + /// + /// + /// + /// + [HttpPost] + public async Task Del(AgvLineDelInput input) + { + var res = await _dbContext.Deleteable().Where(x => x.Id == input.Id).ExecuteCommandHasChangeAsync(); + return res; + } + /// + /// 详情 + /// + /// + /// + /// + [HttpGet] + public async Task Detail(string Id) + { + var entity = await _dbContext.Queryable().FirstAsync(x => x.Id == Id); + AgvLineOutput output = entity.Adapt(); + return output; + } + /// + /// 列表 + /// + /// + /// + [HttpPost] + public async Task> List(AgvLineQueryInput input) + { + var entity = await _dbContext.Queryable().ToListAsync(); + List output = entity.Adapt>(); + return output; + } + /// + /// 分页 + /// + /// + /// + [HttpPost] + public async Task> PagedList(AgvLineQueryPageInput input) + { + var entity = await _dbContext.Queryable() + .WhereIF(!string.IsNullOrEmpty(input.Name), x => x.Name.Contains(input.Name)) + .WhereIF(!string.IsNullOrEmpty(input.Code), x => x.Code.Contains(input.Code)) + .ToPagedListAsync(input.PageIndex, input.PageSize); + SqlSugarPagedList output = entity.Adapt>(); + return output; + } + /// + /// 下拉 + /// + /// + /// + [HttpGet] + public async Task SelectList() + { + var entity = await _dbContext.Queryable().Select(x => new + { + key = x.Id, + value = x.Name + }).ToListAsync(); + return entity; + } + /// + /// 更新 + /// + /// + /// + /// + [HttpPost] + public async Task Update(AgvLineUpdateInput input) + { + var entity = await _dbContext.Queryable().Where(x => x.Id == input.Id).FirstAsync(); + entity = input.Adapt(); + var res = await _dbContext.Updateable(entity).IgnoreColumns(true).ExecuteCommandHasChangeAsync(); + return res; + } + } +} \ No newline at end of file diff --git a/backend/BPA.MES.Base.Application/Services/AGVService/Services/AgvPointService.cs b/backend/BPA.MES.Base.Application/Services/AGVService/Services/AgvPointService.cs new file mode 100644 index 0000000..5975935 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/AGVService/Services/AgvPointService.cs @@ -0,0 +1,115 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 :AGV点位管理 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/8/7 10:03:37 + /// 描 述 : + /// + [ApiDescriptionSettings("AGV管理", Name = "AgvPoint", Tag = "AGV点位", KeepName = true, SplitCamelCase = true, KeepVerb = true)] + public class AgvPointService : IAgvPointService, ITransient, IDynamicApiController + { + private readonly ISqlSugarClient _dbContext; + public AgvPointService(ISqlSugarClient db) + { + _dbContext = db; + } + /// + /// 增加 + /// + /// + /// + [HttpPost] + public async Task Add(AgvPointAddInput input) + { + var r_entity = await _dbContext.Queryable().FirstAsync(x => x.Name == input.Name); + if (r_entity != null) + { + throw Oops.Bah("名称已存在!"); + } + AgvPointEntity entity = input.Adapt(); + return await _dbContext.Insertable(entity).IgnoreColumns(ignoreNullColumn: true).ExecuteCommandIdentityIntoEntityAsync(); + } + /// + /// 删除 + /// + /// + /// + /// + [HttpPost] + public async Task Del(AgvPointDelInput input) + { + var res = await _dbContext.Deleteable().Where(x => x.Id == input.Id).ExecuteCommandHasChangeAsync(); + return res; + } + /// + /// 详情 + /// + /// + /// + /// + [HttpGet] + public async Task Detail(string Id) + { + var entity = await _dbContext.Queryable().FirstAsync(x => x.Id == Id); + AgvPointOutput output = entity.Adapt(); + return output; + } + /// + /// 列表 + /// + /// + /// + [HttpPost] + public async Task> List(AgvPointQueryInput input) + { + var entity = await _dbContext.Queryable().ToListAsync(); + List output = entity.Adapt>(); + return output; + } + /// + /// 分页 + /// + /// + /// + [HttpPost] + public async Task> PagedList(AgvPointQueryPageInput input) + { + var entity = await _dbContext.Queryable() + .WhereIF(!string.IsNullOrEmpty(input.Name), x => x.Name.Contains(input.Name)) + .WhereIF(!string.IsNullOrEmpty(input.Code), x => x.Code.Contains(input.Code)) + .ToPagedListAsync(input.PageIndex, input.PageSize); + SqlSugarPagedList output = entity.Adapt>(); + return output; + } + /// + /// 下拉 + /// + /// + /// + [HttpGet] + public async Task SelectList() + { + var entity = await _dbContext.Queryable().Select(x => new + { + key = x.Id, + value = x.Name + }).ToListAsync(); + return entity; + } + /// + /// 更新 + /// + /// + /// + /// + [HttpPost] + public async Task Update(AgvPointUpdateInput input) + { + var entity = await _dbContext.Queryable().Where(x => x.Id == input.Id).FirstAsync(); + entity = input.Adapt(); + var res = await _dbContext.Updateable(entity).IgnoreColumns(true).ExecuteCommandHasChangeAsync(); + return res; + } + } +} \ No newline at end of file diff --git a/backend/BPA.MES.Base.Application/Services/AGVService/Services/IAgvLineService.cs b/backend/BPA.MES.Base.Application/Services/AGVService/Services/IAgvLineService.cs new file mode 100644 index 0000000..1065d50 --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/AGVService/Services/IAgvLineService.cs @@ -0,0 +1,43 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 : + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/8/7 10:02:54 + /// 描 述 : + /// + public interface IAgvLineService + { + /// + /// 增加 + /// + /// + Task Add(AgvLineAddInput input); + /// + /// 移除 + /// + /// + Task Del(AgvLineDelInput input); + /// + /// 更新 + /// + /// + Task Update(AgvLineUpdateInput input); + /// + /// 不分页列表 + /// + /// + Task> List(AgvLineQueryInput input); + /// + /// 分页列表 + /// + /// + Task> PagedList(AgvLineQueryPageInput input); + /// + /// 查询单条 + /// + /// + /// + Task Detail(string Id); + } +} diff --git a/backend/BPA.MES.Base.Application/Services/AGVService/Services/IAgvPointService.cs b/backend/BPA.MES.Base.Application/Services/AGVService/Services/IAgvPointService.cs new file mode 100644 index 0000000..353cbeb --- /dev/null +++ b/backend/BPA.MES.Base.Application/Services/AGVService/Services/IAgvPointService.cs @@ -0,0 +1,43 @@ +namespace BPA.MES.Base.Application.Services +{ + /// + /// 名 称 :AVG点位 + /// 创 建 人 :yangxiao + /// 创建时间 : 2023/8/7 10:03:06 + /// 描 述 : + /// + public interface IAgvPointService + { + /// + /// 增加 + /// + /// + Task Add(AgvPointAddInput input); + /// + /// 移除 + /// + /// + Task Del(AgvPointDelInput input); + /// + /// 更新 + /// + /// + Task Update(AgvPointUpdateInput input); + /// + /// 不分页列表 + /// + /// + Task> List(AgvPointQueryInput input); + /// + /// 分页列表 + /// + /// + Task> PagedList(AgvPointQueryPageInput input); + /// + /// 查询单条 + /// + /// + /// + Task Detail(string Id); + } +}