From 6a1f6e62fb159dfa90c2cdc7de774dea4ebe7080 Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Wed, 29 Mar 2023 15:20:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=88=B9=E5=90=8D=E6=98=A0?= =?UTF-8?q?=E5=B0=84=E5=9F=BA=E7=A1=80=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Myshipping.Core/Entity/CommonDB/CodeVessel.cs | 15 +++++++ Myshipping.Core/Myshipping.Core.xml | 41 +++++++++++++++++++ .../Service/CommonDB/CommonDBService.cs | 14 +++++-- .../Service/CommonDB/Dto/MappingVesselDto.cs | 16 ++++++++ 4 files changed, 82 insertions(+), 4 deletions(-) diff --git a/Myshipping.Core/Entity/CommonDB/CodeVessel.cs b/Myshipping.Core/Entity/CommonDB/CodeVessel.cs index ac0baa27..6dd781a1 100644 --- a/Myshipping.Core/Entity/CommonDB/CodeVessel.cs +++ b/Myshipping.Core/Entity/CommonDB/CodeVessel.cs @@ -42,16 +42,30 @@ namespace Myshipping.Core.Entity [Description("船名映射")] public class MappingVessel : CommonDbEntity { + /// + /// 代码 + /// + public string Code { get; set; } /// /// 名称 /// public string Name { get; set; } + /// + /// 场站代码 + /// + public string YardCode { get; set; } + /// /// 模块 /// public string Module { get; set; } + /// + /// 映射代码 + /// + public string MapCode { get; set; } + /// /// 映射名称 /// @@ -62,5 +76,6 @@ namespace Myshipping.Core.Entity /// public string Remark { get; set; } + } } diff --git a/Myshipping.Core/Myshipping.Core.xml b/Myshipping.Core/Myshipping.Core.xml index 786176b9..2d5949e9 100644 --- a/Myshipping.Core/Myshipping.Core.xml +++ b/Myshipping.Core/Myshipping.Core.xml @@ -1392,16 +1392,31 @@ 备注 + + + 代码 + + 名称 + + + 场站代码 + + 模块 + + + 映射代码 + + 映射名称 @@ -8619,6 +8634,11 @@ 排序 + + + 代码 + + 名称 @@ -8629,6 +8649,7 @@ 模块 + 映射名称 @@ -8644,6 +8665,11 @@ 排序 + + + 场站代码 + + 业务id @@ -17720,6 +17746,16 @@ 东胜id + + + 创建人名称 + + + + + 创建者Id + + 东胜id @@ -17810,5 +17846,10 @@ 内部航次 + + + 创建人名称 + + diff --git a/Myshipping.Core/Service/CommonDB/CommonDBService.cs b/Myshipping.Core/Service/CommonDB/CommonDBService.cs index 5263c4e1..7e1a0afa 100644 --- a/Myshipping.Core/Service/CommonDB/CommonDBService.cs +++ b/Myshipping.Core/Service/CommonDB/CommonDBService.cs @@ -276,7 +276,11 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie var queryList = list.Where(x => x.Module == input.Module) .WhereIF(!string.IsNullOrEmpty(input.KeyWord), x => x.MapName.Contains(input.KeyWord, System.StringComparison.CurrentCultureIgnoreCase) - || x.Name.Contains(input.KeyWord, System.StringComparison.CurrentCultureIgnoreCase)); + || x.Name.Contains(input.KeyWord, System.StringComparison.CurrentCultureIgnoreCase) + || x.Code.Contains(input.KeyWord, System.StringComparison.CurrentCultureIgnoreCase) + || x.MapCode.Contains(input.KeyWord, System.StringComparison.CurrentCultureIgnoreCase) + || x.YardCode.Contains(input.KeyWord, System.StringComparison.CurrentCultureIgnoreCase)); + if (queryList.Count() > 20) { return queryList.Take(input.Limit).OrderBy(x => x.Sort).ToList(); @@ -290,10 +294,12 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie [HttpPost("/commondb/addorupdatevessel")] public async Task AddOrUpdateMappingVessel([FromBody] MappingVesselDto dto) { - - var list = await _sysCacheService.GetAllMappingVessel(); - var count = list.Where(x => x.Name == dto.Name.Trim() && x.Module == dto.Module && x.GID != dto.GID).Count(); + var count = list.Where(x => x.Code == dto.Code.Trim() + && x.Module == dto.Module + && x.YardCode == dto.YardCode + && x.GID != dto.GID).Count(); + if (count > 0) { throw Oops.Bah(ErrorCode.D1006); diff --git a/Myshipping.Core/Service/CommonDB/Dto/MappingVesselDto.cs b/Myshipping.Core/Service/CommonDB/Dto/MappingVesselDto.cs index dd6e45cf..f337c925 100644 --- a/Myshipping.Core/Service/CommonDB/Dto/MappingVesselDto.cs +++ b/Myshipping.Core/Service/CommonDB/Dto/MappingVesselDto.cs @@ -9,6 +9,12 @@ namespace Myshipping.Core.Service.CommonDB.Dto public class MappingVesselDto { public string GID { get; set; } + + /// + /// 代码 + /// + public string Code { get; set; } + /// /// 名称 /// @@ -19,6 +25,11 @@ namespace Myshipping.Core.Service.CommonDB.Dto /// public string Module { get; set; } + // + /// 映射代码 + /// + public string MapCode { get; set; } + /// /// 映射名称 /// @@ -33,5 +44,10 @@ namespace Myshipping.Core.Service.CommonDB.Dto /// public int Sort { get; set; } + /// + /// 场站代码 + /// + public string YardCode { get; set; } + } }