|
|
|
@ -42,6 +42,7 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
|
|
|
|
|
private readonly SqlSugarRepository<MappingService> _mappingServiceRep;
|
|
|
|
|
private readonly ISysCacheService _sysCacheService;
|
|
|
|
|
private readonly SqlSugarRepository<CodeIssueType> _codeIssueTypeRep;
|
|
|
|
|
private readonly SqlSugarRepository<MappingIssueType> _mappingIssueTypeRep;
|
|
|
|
|
private readonly SqlSugarRepository<CommonModule> _commonModuleRep;
|
|
|
|
|
private readonly ILogger<CommonDBService> _logger;
|
|
|
|
|
private readonly SqlSugarRepository<CodeLane> _codeLaneRep;
|
|
|
|
@ -72,6 +73,7 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
|
|
|
|
|
ISysCacheService sysCacheService,
|
|
|
|
|
SqlSugarRepository<CodeLane> codeLaneRep,
|
|
|
|
|
SqlSugarRepository<RelaPortCarrierLane> relaPortCarrierLaneRep,
|
|
|
|
|
SqlSugarRepository<MappingIssueType> mappingIssueTypeRep
|
|
|
|
|
SqlSugarRepository<CodeCountry> codeCountryRep)
|
|
|
|
|
{
|
|
|
|
|
_codeCarrierRep = codeCarrierRep;
|
|
|
|
@ -100,6 +102,7 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
|
|
|
|
|
_codeLaneRep = codeLaneRep;
|
|
|
|
|
_relaPortCarrierLaneRep = relaPortCarrierLaneRep;
|
|
|
|
|
_codeCountryRep = codeCountryRep;
|
|
|
|
|
_mappingIssueTypeRep= mappingIssueTypeRep;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
@ -295,7 +298,7 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
|
|
|
|
|
public async Task AddOrUpdateMappingVessel([FromBody] MappingVesselDto dto)
|
|
|
|
|
{
|
|
|
|
|
var list = await _sysCacheService.GetAllMappingVessel();
|
|
|
|
|
var count = list.Where(x => x.Name == dto.Name.Trim()
|
|
|
|
|
var count = list.Where(x => x.Name == dto.Name.Trim()
|
|
|
|
|
&& x.Module == dto.Module
|
|
|
|
|
&& x.YardCode == dto.YardCode
|
|
|
|
|
&& x.GID != dto.GID).Count();
|
|
|
|
@ -1230,6 +1233,65 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
|
|
|
|
|
|
|
|
|
|
await GetAllCodeIssueType();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取签单方式映射列表信息
|
|
|
|
|
/// </summary>
|
|
|
|
|
[HttpGet("/commondb/mappingIssueTypelist")]
|
|
|
|
|
public async Task<dynamic> MappingIssueTypeList([FromQuery] MappingQueryDto input)
|
|
|
|
|
{ //数量太多,不允许查询全部
|
|
|
|
|
if (string.IsNullOrEmpty(input.Module) || input.Module.Length < 1)
|
|
|
|
|
{
|
|
|
|
|
throw Oops.Bah("参数过多,请传入模块查询");
|
|
|
|
|
}
|
|
|
|
|
var list = await _sysCacheService.GetAllMappingIssueType();
|
|
|
|
|
|
|
|
|
|
var queryList = list.Where(x => x.Module == input.Module)
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(input.KeyWord), x => x.Code.Contains(input.KeyWord, System.StringComparison.CurrentCultureIgnoreCase)
|
|
|
|
|
|| x.MapName.Contains(input.KeyWord, System.StringComparison.CurrentCultureIgnoreCase));
|
|
|
|
|
if (queryList.Count() > 20)
|
|
|
|
|
{
|
|
|
|
|
return queryList.Take(input.Limit).OrderBy(x => x.Sort).ToList();
|
|
|
|
|
}
|
|
|
|
|
return queryList.OrderBy(x => x.Sort).ToList();
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 新增编辑签单方式映射信息
|
|
|
|
|
/// </summary>
|
|
|
|
|
[HttpPost("/commondb/addmappingIssueType")]
|
|
|
|
|
public async Task AddOrUpdateMappingIssueType([FromBody] MappingIssueTypeDto dto)
|
|
|
|
|
{
|
|
|
|
|
var list = await _sysCacheService.GetAllMappingIssueType();
|
|
|
|
|
var count = list.Where(x => x.Code == dto.Code && x.Module == dto.Module && x.GID != dto.GID).Count();
|
|
|
|
|
if (count > 0)
|
|
|
|
|
{
|
|
|
|
|
throw Oops.Bah(ErrorCode.D1006);
|
|
|
|
|
}
|
|
|
|
|
var entity = dto.Adapt<MappingIssueType>();
|
|
|
|
|
if (string.IsNullOrWhiteSpace(dto.GID))
|
|
|
|
|
{
|
|
|
|
|
entity.GID = Guid.NewGuid().ToString();
|
|
|
|
|
entity.CreateTime = DateTime.Now;
|
|
|
|
|
entity.CreateUser = UserManager.DjyUserId;
|
|
|
|
|
await _mappingIssueTypeRep.InsertAsync(entity);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
entity.CreateTime = list.Where(x => x.GID == dto.GID).Select(x => x.CreateTime).FirstOrDefault();
|
|
|
|
|
entity.CreateUser = list.Where(x => x.GID == dto.GID).Select(x => x.CreateUser).FirstOrDefault();
|
|
|
|
|
entity.ModifyTime = DateTime.Now;
|
|
|
|
|
entity.ModifyUser = UserManager.DjyUserId;
|
|
|
|
|
await _mappingIssueTypeRep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
|
|
|
|
|
}
|
|
|
|
|
await GetAllMappingFrt();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|