|
|
@ -276,7 +276,11 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
|
|
|
|
var queryList = list.Where(x => x.Module == input.Module)
|
|
|
|
var queryList = list.Where(x => x.Module == input.Module)
|
|
|
|
|
|
|
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(input.KeyWord), x => x.MapName.Contains(input.KeyWord, System.StringComparison.CurrentCultureIgnoreCase)
|
|
|
|
.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)
|
|
|
|
if (queryList.Count() > 20)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return queryList.Take(input.Limit).OrderBy(x => x.Sort).ToList();
|
|
|
|
return queryList.Take(input.Limit).OrderBy(x => x.Sort).ToList();
|
|
|
@ -290,10 +294,12 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
|
|
|
|
[HttpPost("/commondb/addorupdatevessel")]
|
|
|
|
[HttpPost("/commondb/addorupdatevessel")]
|
|
|
|
public async Task AddOrUpdateMappingVessel([FromBody] MappingVesselDto dto)
|
|
|
|
public async Task AddOrUpdateMappingVessel([FromBody] MappingVesselDto dto)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var list = await _sysCacheService.GetAllMappingVessel();
|
|
|
|
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)
|
|
|
|
if (count > 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
throw Oops.Bah(ErrorCode.D1006);
|
|
|
|
throw Oops.Bah(ErrorCode.D1006);
|
|
|
|