|
|
|
|
using Furion.DependencyInjection;
|
|
|
|
|
using Furion.DynamicApiController;
|
|
|
|
|
using Furion.FriendlyException;
|
|
|
|
|
using Myshipping.Core.Entity;
|
|
|
|
|
using Mapster;
|
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
using SqlSugar;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System;
|
|
|
|
|
using Myshipping.Core.Service.CommonDB.Dto;
|
|
|
|
|
|
|
|
|
|
namespace Myshipping.Core.Service;
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 公共库
|
|
|
|
|
/// </summary>
|
|
|
|
|
[ApiDescriptionSettings(Name = "CommonDB", Order = 1000)]
|
|
|
|
|
public class CommonDBService : ICommonDBService, IDynamicApiController, ITransient
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
private readonly SqlSugarRepository<CodeCarrier> _codeCarrierRep;
|
|
|
|
|
private readonly SqlSugarRepository<MappingCarrier> _mappingCarrierRep;
|
|
|
|
|
private readonly SqlSugarRepository<CodeVessel> _codeVesselRep;
|
|
|
|
|
private readonly SqlSugarRepository<MappingVessel> _mappingVesselRep;
|
|
|
|
|
private readonly SqlSugarRepository<CodeForwarder> _codeForwarderRep;
|
|
|
|
|
private readonly SqlSugarRepository<CodeYard> _codeYardRep;
|
|
|
|
|
private readonly SqlSugarRepository<MappingYard> _mappingYardRep;
|
|
|
|
|
private readonly SqlSugarRepository<CodePortLoad> _codePortLoadrRep;
|
|
|
|
|
private readonly SqlSugarRepository<CodePort> _codePortRep;
|
|
|
|
|
private readonly SqlSugarRepository<CodePackage> _codePackageRep;
|
|
|
|
|
private readonly SqlSugarRepository<CodeService> _codeServiceRep;
|
|
|
|
|
private readonly SqlSugarRepository<CodeCtn> _codeCtnRep;
|
|
|
|
|
private readonly SqlSugarRepository<MappingCtn> _mappingCtnRep;
|
|
|
|
|
private readonly SqlSugarRepository<CodeFrt> _codeFrtRep;
|
|
|
|
|
private readonly SqlSugarRepository<MappingFrt> _mappingFrtRep;
|
|
|
|
|
private readonly SqlSugarRepository<MappingPortLoad> _mappingPortLoadRep;
|
|
|
|
|
private readonly SqlSugarRepository<MappingPort> _mappingPortRep;
|
|
|
|
|
private readonly SqlSugarRepository<MappingPackage> _mappingPackageRep;
|
|
|
|
|
private readonly SqlSugarRepository<MappingService> _mappingServiceRep;
|
|
|
|
|
private readonly ISysCacheService _sysCacheService;
|
|
|
|
|
|
|
|
|
|
public CommonDBService(SqlSugarRepository<CodeCarrier> codeCarrierRep,
|
|
|
|
|
SqlSugarRepository<CodeVessel> codeVesselRep,
|
|
|
|
|
SqlSugarRepository<CodeForwarder> codeForwarderRep,
|
|
|
|
|
SqlSugarRepository<CodeYard> codeYardRep,
|
|
|
|
|
SqlSugarRepository<CodePortLoad> codePortLoadrRep,
|
|
|
|
|
SqlSugarRepository<CodePort> codePortRep,
|
|
|
|
|
SqlSugarRepository<CodePackage> codePackageRep,
|
|
|
|
|
SqlSugarRepository<CodeService> codeServiceRep,
|
|
|
|
|
SqlSugarRepository<CodeCtn> codeCtnRep,
|
|
|
|
|
SqlSugarRepository<CodeFrt> codeFrtRep,
|
|
|
|
|
SqlSugarRepository<MappingCarrier> mappingCarrierRep,
|
|
|
|
|
SqlSugarRepository<MappingVessel> mappingVesselRep,
|
|
|
|
|
SqlSugarRepository<MappingCtn> mappingCtnRep,
|
|
|
|
|
SqlSugarRepository<MappingFrt> mappingFrtRep,
|
|
|
|
|
SqlSugarRepository<MappingYard> mappingYardRep,
|
|
|
|
|
SqlSugarRepository<MappingPortLoad> mappingPortLoadRep,
|
|
|
|
|
SqlSugarRepository<MappingPort> mappingPortRep,
|
|
|
|
|
SqlSugarRepository<MappingPackage> mappingPackageRep,
|
|
|
|
|
SqlSugarRepository<MappingService> mappingServiceRep,
|
|
|
|
|
ISysCacheService sysCacheService)
|
|
|
|
|
{
|
|
|
|
|
_codeCarrierRep = codeCarrierRep;
|
|
|
|
|
_codeVesselRep = codeVesselRep;
|
|
|
|
|
_codeForwarderRep = codeForwarderRep;
|
|
|
|
|
_codeYardRep = codeYardRep;
|
|
|
|
|
_codePortLoadrRep = codePortLoadrRep;
|
|
|
|
|
_codePortRep = codePortRep;
|
|
|
|
|
_codePackageRep = codePackageRep;
|
|
|
|
|
_codeServiceRep = codeServiceRep;
|
|
|
|
|
_codeCtnRep = codeCtnRep;
|
|
|
|
|
_codeFrtRep = codeFrtRep;
|
|
|
|
|
_mappingCarrierRep = mappingCarrierRep;
|
|
|
|
|
_mappingVesselRep = mappingVesselRep;
|
|
|
|
|
_mappingCtnRep = mappingCtnRep;
|
|
|
|
|
_mappingFrtRep = mappingFrtRep;
|
|
|
|
|
_mappingYardRep = mappingYardRep;
|
|
|
|
|
_sysCacheService = sysCacheService;
|
|
|
|
|
_mappingPortLoadRep = mappingPortLoadRep;
|
|
|
|
|
_mappingPortRep = mappingPortRep;
|
|
|
|
|
_mappingPackageRep = mappingPackageRep;
|
|
|
|
|
_mappingServiceRep = mappingServiceRep;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region 船公司
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取船公司列表信息
|
|
|
|
|
/// </summary>
|
|
|
|
|
[HttpGet("/commondb/carrierlist")]
|
|
|
|
|
public async Task<dynamic> CarrierList([FromQuery] CodeCnEnQueryDto input)
|
|
|
|
|
{
|
|
|
|
|
var list = await _sysCacheService.GetAllCodeCarrier();
|
|
|
|
|
var queryList = list.WhereIF(!string.IsNullOrEmpty(input.Code), x => x.Code.Contains(input.Code, System.StringComparison.CurrentCultureIgnoreCase))
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(input.CnName), x => x.Code.Contains(input.CnName))
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(input.EnName), x => x.Code.Contains(input.EnName, System.StringComparison.CurrentCultureIgnoreCase));
|
|
|
|
|
return queryList.ToList();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 新增船公司信息
|
|
|
|
|
/// </summary>
|
|
|
|
|
[HttpPost("/commondb/addcarrier")]
|
|
|
|
|
public async Task AddCarrier([FromBody] CodeCarrierDto dto)
|
|
|
|
|
{
|
|
|
|
|
var entity = dto.Adapt<CodeCarrier>();
|
|
|
|
|
entity.GID = Guid.NewGuid().ToString();
|
|
|
|
|
entity.CreateTime = DateTime.Now;
|
|
|
|
|
entity.CreateUser = UserManager.DjyUserId;
|
|
|
|
|
await _codeCarrierRep.InsertAsync(entity);
|
|
|
|
|
await GetAllCarrier();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取船公司映射列表信息
|
|
|
|
|
/// </summary>
|
|
|
|
|
[HttpGet("/commondb/mappingcarrierlist")]
|
|
|
|
|
public async Task<dynamic> MappingCarrierList([FromQuery] MappingQueryDto input)
|
|
|
|
|
{
|
|
|
|
|
var list = await _sysCacheService.GetAllMappingCarrier();
|
|
|
|
|
|
|
|
|
|
var queryList = list
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(input.Code), x => x.Code.Contains(input.Code, System.StringComparison.CurrentCultureIgnoreCase))
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(input.MapCode), x => x.MapCode.Contains(input.MapCode, System.StringComparison.CurrentCultureIgnoreCase))
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(input.Module), x => x.Module == input.Module)
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(input.MapName), x => x.MapName.Contains(input.MapName, System.StringComparison.CurrentCultureIgnoreCase));
|
|
|
|
|
return queryList.ToList();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 新增编辑船公司映射信息
|
|
|
|
|
/// </summary>
|
|
|
|
|
[HttpPost("/commondb/addorupdatemappingcarrier")]
|
|
|
|
|
public async Task AddOrUpdateMappingCarrier([FromBody] MappingCarrierDto dto)
|
|
|
|
|
{
|
|
|
|
|
var entity = dto.Adapt<MappingCarrier>();
|
|
|
|
|
if (string.IsNullOrWhiteSpace(dto.GID))
|
|
|
|
|
{
|
|
|
|
|
entity.GID = Guid.NewGuid().ToString();
|
|
|
|
|
entity.CreateTime = DateTime.Now;
|
|
|
|
|
entity.CreateUser =UserManager.DjyUserId;
|
|
|
|
|
await _mappingCarrierRep.InsertAsync(entity);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
entity.ModifyTime = DateTime.Now;
|
|
|
|
|
entity.ModifyUser = UserManager.DjyUserId;
|
|
|
|
|
await _mappingCarrierRep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
await GetAllMappingCarrier();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 船名
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取船名列表信息
|
|
|
|
|
/// </summary>
|
|
|
|
|
[HttpGet("/commondb/vessellist")]
|
|
|
|
|
public async Task<dynamic> VesselList([FromQuery] NameQueryDto input)
|
|
|
|
|
{
|
|
|
|
|
//数量太多,不允许查询全部
|
|
|
|
|
if (string.IsNullOrEmpty(input.Name) || input.Name.Length < 2)
|
|
|
|
|
{
|
|
|
|
|
return new List<CodeVessel>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<CodeVessel> list = await _sysCacheService.GetAllCodeVessel();
|
|
|
|
|
|
|
|
|
|
var queryList = list.WhereIF(!string.IsNullOrEmpty(input.Name), x => x.Name.Contains(input.Name, System.StringComparison.CurrentCultureIgnoreCase));
|
|
|
|
|
|
|
|
|
|
return queryList.ToList();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 新增船名信息
|
|
|
|
|
/// </summary>
|
|
|
|
|
[HttpPost("/commondb/addvessel")]
|
|
|
|
|
public async Task AddVessel([FromBody] CodeVesselDto dto)
|
|
|
|
|
{
|
|
|
|
|
var entity = dto.Adapt<CodeVessel>();
|
|
|
|
|
entity.GID = Guid.NewGuid().ToString();
|
|
|
|
|
entity.CreateTime = DateTime.Now;
|
|
|
|
|
entity.CreateUser = UserManager.DjyUserId;
|
|
|
|
|
await _codeVesselRep.InsertAsync(entity);
|
|
|
|
|
await GetAllVessel();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取船名映射
|
|
|
|
|
/// </summary>
|
|
|
|
|
[HttpGet("/commondb/mappingvessellist")]
|
|
|
|
|
public async Task<dynamic> MappingVesselList([FromQuery] MappingQueryDto input)
|
|
|
|
|
{
|
|
|
|
|
//数量太多,不允许查询全部
|
|
|
|
|
if (string.IsNullOrEmpty(input.Module) || input.Module.Length < 1)
|
|
|
|
|
{
|
|
|
|
|
return new List<MappingVessel>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<MappingVessel> list = await _sysCacheService.GetAllMappingVessel();
|
|
|
|
|
|
|
|
|
|
var queryList = list.WhereIF(!string.IsNullOrEmpty(input.Module), x => x.Module == input.Module)
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(input.MapName), x => x.MapName.Contains(input.MapName, System.StringComparison.CurrentCultureIgnoreCase));
|
|
|
|
|
|
|
|
|
|
return queryList.ToList();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 新增编辑船名映射信息
|
|
|
|
|
/// </summary>
|
|
|
|
|
[HttpPost("/commondb/addorupdatevessel")]
|
|
|
|
|
public async Task AddOrUpdateMappingVessel([FromBody] MappingVesselDto dto)
|
|
|
|
|
{
|
|
|
|
|
var entity = dto.Adapt<MappingVessel>();
|
|
|
|
|
if (string.IsNullOrWhiteSpace(dto.GID))
|
|
|
|
|
{
|
|
|
|
|
entity.GID = Guid.NewGuid().ToString();
|
|
|
|
|
entity.CreateTime = DateTime.Now;
|
|
|
|
|
entity.CreateUser = UserManager.DjyUserId;
|
|
|
|
|
await _mappingVesselRep.InsertAsync(entity);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
entity.ModifyTime = DateTime.Now;
|
|
|
|
|
entity.ModifyUser = UserManager.DjyUserId;
|
|
|
|
|
await _mappingVesselRep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
await GetAllMappingVessel();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 船代
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取船代列表信息
|
|
|
|
|
/// </summary>
|
|
|
|
|
[HttpGet("/commondb/forwarderlist")]
|
|
|
|
|
public async Task<dynamic> ForwarderList([FromQuery] NameQueryDto input)
|
|
|
|
|
{
|
|
|
|
|
List<CodeForwarder> list = await _sysCacheService.GetAllCodeForwarder();
|
|
|
|
|
|
|
|
|
|
var queryList = list.WhereIF(!string.IsNullOrEmpty(input.Name), x => x.Name.Contains(input.Name, System.StringComparison.CurrentCultureIgnoreCase));
|
|
|
|
|
|
|
|
|
|
return queryList.ToList();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 新增船代信息
|
|
|
|
|
/// </summary>
|
|
|
|
|
[HttpPost("/commondb/addforwarder")]
|
|
|
|
|
public async Task AddForwarder([FromBody] CodeForwarderDto dto)
|
|
|
|
|
{
|
|
|
|
|
var entity = dto.Adapt<CodeForwarder>();
|
|
|
|
|
entity.GID = Guid.NewGuid().ToString();
|
|
|
|
|
entity.CreateTime = DateTime.Now;
|
|
|
|
|
entity.CreateUser = UserManager.DjyUserId;
|
|
|
|
|
await _codeForwarderRep.InsertAsync(entity);
|
|
|
|
|
await GetAllForwarder();
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 场站
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取场站列表信息
|
|
|
|
|
/// </summary>
|
|
|
|
|
[HttpGet("/commondb/yardlist")]
|
|
|
|
|
public async Task<dynamic> YardList([FromQuery] NameQueryDto input)
|
|
|
|
|
{
|
|
|
|
|
List<CodeYard> list = await _sysCacheService.GetAllCodeYard();
|
|
|
|
|
|
|
|
|
|
var queryList = list.WhereIF(!string.IsNullOrEmpty(input.Name), x => x.Name.Contains(input.Name, System.StringComparison.CurrentCultureIgnoreCase));
|
|
|
|
|
|
|
|
|
|
return queryList.ToList();
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 新增场站信息
|
|
|
|
|
/// </summary>
|
|
|
|
|
[HttpPost("/commondb/addyard")]
|
|
|
|
|
public async Task AddYard([FromBody] CodeYardDto dto)
|
|
|
|
|
{
|
|
|
|
|
var entity = dto.Adapt<CodeYard>();
|
|
|
|
|
entity.GID = Guid.NewGuid().ToString();
|
|
|
|
|
entity.CreateTime = DateTime.Now;
|
|
|
|
|
entity.CreateUser = UserManager.DjyUserId;
|
|
|
|
|
await _codeYardRep.InsertAsync(entity);
|
|
|
|
|
await GetAllYard();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取场站映射
|
|
|
|
|
/// </summary>
|
|
|
|
|
[HttpGet("/commondb/mappingyardlist")]
|
|
|
|
|
public async Task<dynamic> MappingYardList([FromQuery] MappingQueryDto input)
|
|
|
|
|
{
|
|
|
|
|
//数量太多,不允许查询全部
|
|
|
|
|
if (string.IsNullOrEmpty(input.Module) || input.Module.Length < 1)
|
|
|
|
|
{
|
|
|
|
|
return new List<MappingYard>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<MappingYard> list = await _sysCacheService.GetAllMappingYard();
|
|
|
|
|
|
|
|
|
|
var queryList = list.WhereIF(!string.IsNullOrEmpty(input.Module), x => x.Module == input.Module)
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(input.MapName), x => x.MapName.Contains(input.MapName, System.StringComparison.CurrentCultureIgnoreCase));
|
|
|
|
|
|
|
|
|
|
return queryList.ToList();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 新增编辑场站映射信息
|
|
|
|
|
/// </summary>
|
|
|
|
|
[HttpPost("/commondb/addorupdatemappingyard")]
|
|
|
|
|
public async Task AddOrUpdateMappingYard([FromBody] MappingYardDto dto)
|
|
|
|
|
{
|
|
|
|
|
var entity = dto.Adapt<MappingYard>();
|
|
|
|
|
if (string.IsNullOrWhiteSpace(dto.GID))
|
|
|
|
|
{
|
|
|
|
|
entity.GID = Guid.NewGuid().ToString();
|
|
|
|
|
entity.CreateTime = DateTime.Now;
|
|
|
|
|
entity.CreateUser = UserManager.DjyUserId;
|
|
|
|
|
await _mappingYardRep.InsertAsync(entity);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
entity.ModifyTime = DateTime.Now;
|
|
|
|
|
entity.ModifyUser = UserManager.DjyUserId;
|
|
|
|
|
await _mappingYardRep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
|
|
|
|
|
}
|
|
|
|
|
await GetAllMappingYard();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 起始港
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取起始港信息
|
|
|
|
|
/// </summary>
|
|
|
|
|
[HttpGet("/commondb/portloadlist")]
|
|
|
|
|
public async Task<dynamic> PortloadList([FromQuery] NameQueryDto input)
|
|
|
|
|
{
|
|
|
|
|
List<CodePortLoad> list = await _sysCacheService.GetAllCodePortLoad();
|
|
|
|
|
|
|
|
|
|
var queryList = list.WhereIF(!string.IsNullOrEmpty(input.Name), x => x.CnName.Contains(input.Name) || x.EnName.Contains(input.Name, System.StringComparison.CurrentCultureIgnoreCase));
|
|
|
|
|
|
|
|
|
|
return queryList.ToList();
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 新增起始港信息
|
|
|
|
|
/// </summary>
|
|
|
|
|
[HttpPost("/commondb/addportload")]
|
|
|
|
|
public async Task AddPortload([FromBody] CodePortLoadDto dto)
|
|
|
|
|
{
|
|
|
|
|
var entity = dto.Adapt<CodePortLoad>();
|
|
|
|
|
entity.GID = Guid.NewGuid().ToString();
|
|
|
|
|
entity.CreateTime = DateTime.Now;
|
|
|
|
|
entity.CreateUser = UserManager.DjyUserId;
|
|
|
|
|
await _codePortLoadrRep.InsertAsync(entity);
|
|
|
|
|
await GetAllPortload();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取起始港映射
|
|
|
|
|
/// </summary>
|
|
|
|
|
[HttpGet("/commondb/mappingportloadlist")]
|
|
|
|
|
public async Task<dynamic> PortloadList([FromQuery] MappingQueryDto input)
|
|
|
|
|
{
|
|
|
|
|
//数量太多,不允许查询全部
|
|
|
|
|
if (string.IsNullOrEmpty(input.Module) || input.Module.Length < 1)
|
|
|
|
|
{
|
|
|
|
|
return new List<MappingPortLoad>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<MappingPortLoad> list = await _sysCacheService.GetAllMappingPortLoad();
|
|
|
|
|
|
|
|
|
|
var queryList = list.WhereIF(!string.IsNullOrEmpty(input.Module), x => x.Module == input.Module)
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(input.MapName), x => x.MapName.Contains(input.MapName, System.StringComparison.CurrentCultureIgnoreCase));
|
|
|
|
|
|
|
|
|
|
return queryList.ToList();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 新增编辑起始港映射信息
|
|
|
|
|
/// </summary>
|
|
|
|
|
[HttpPost("/commondb/addorupdatemappingportload")]
|
|
|
|
|
public async Task AddOrUpdatePortload([FromBody] MappingPortLoadDto dto)
|
|
|
|
|
{
|
|
|
|
|
var entity = dto.Adapt<MappingPortLoad>();
|
|
|
|
|
if (string.IsNullOrWhiteSpace(dto.GID))
|
|
|
|
|
{
|
|
|
|
|
entity.GID = Guid.NewGuid().ToString();
|
|
|
|
|
entity.CreateTime = DateTime.Now;
|
|
|
|
|
entity.CreateUser = UserManager.DjyUserId;
|
|
|
|
|
await _mappingPortLoadRep.InsertAsync(entity);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
entity.ModifyTime = DateTime.Now;
|
|
|
|
|
entity.ModifyUser = UserManager.DjyUserId;
|
|
|
|
|
await _mappingPortLoadRep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
|
|
|
|
|
}
|
|
|
|
|
await GetAllMappingPortLoad();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 目的港
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取目的港信息
|
|
|
|
|
/// </summary>
|
|
|
|
|
[HttpGet("/commondb/portlist")]
|
|
|
|
|
public async Task<dynamic> PortList([FromQuery] NameQueryDto input)
|
|
|
|
|
{
|
|
|
|
|
//数量太多,不允许查询全部
|
|
|
|
|
if (string.IsNullOrEmpty(input.Name) || input.Name.Length < 2)
|
|
|
|
|
{
|
|
|
|
|
return new List<CodePortLoad>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<CodePort> list = await _sysCacheService.GetAllCodePort();
|
|
|
|
|
|
|
|
|
|
var queryList = list.WhereIF(!string.IsNullOrEmpty(input.Name), x => x.CnName.Contains(input.Name) || x.EnName.Contains(input.Name, System.StringComparison.CurrentCultureIgnoreCase));
|
|
|
|
|
|
|
|
|
|
return queryList.ToList();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 新增目的港信息
|
|
|
|
|
/// </summary>
|
|
|
|
|
[HttpPost("/commondb/addport")]
|
|
|
|
|
public async Task AddPort([FromBody] CodePortDto dto)
|
|
|
|
|
{
|
|
|
|
|
var entity = dto.Adapt<CodePort>();
|
|
|
|
|
entity.GID = Guid.NewGuid().ToString();
|
|
|
|
|
entity.CreateTime = DateTime.Now;
|
|
|
|
|
entity.CreateUser = UserManager.DjyUserId;
|
|
|
|
|
await _codePortRep.InsertAsync(entity);
|
|
|
|
|
await GetAllPort();
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取目的港映射
|
|
|
|
|
/// </summary>
|
|
|
|
|
[HttpGet("/commondb/mappingportlist")]
|
|
|
|
|
public async Task<dynamic> PortList([FromQuery] MappingQueryDto input)
|
|
|
|
|
{
|
|
|
|
|
//数量太多,不允许查询全部
|
|
|
|
|
if (string.IsNullOrEmpty(input.Module) || input.Module.Length < 1)
|
|
|
|
|
{
|
|
|
|
|
return new List<MappingPort>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<MappingPort> list = await _sysCacheService.GetAllMappingPort();
|
|
|
|
|
|
|
|
|
|
var queryList = list.WhereIF(!string.IsNullOrEmpty(input.Module), x => x.Module == input.Module)
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(input.MapName), x => x.MapName.Contains(input.MapName, System.StringComparison.CurrentCultureIgnoreCase));
|
|
|
|
|
|
|
|
|
|
return queryList.ToList();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 新增编辑目的港映射信息
|
|
|
|
|
/// </summary>
|
|
|
|
|
[HttpPost("/commondb/addorupdatemappingport")]
|
|
|
|
|
public async Task AddOrUpdatePort([FromBody] MappingPortDto dto)
|
|
|
|
|
{
|
|
|
|
|
var entity = dto.Adapt<MappingPort>();
|
|
|
|
|
if (string.IsNullOrWhiteSpace(dto.GID))
|
|
|
|
|
{
|
|
|
|
|
entity.GID = Guid.NewGuid().ToString();
|
|
|
|
|
entity.CreateTime = DateTime.Now;
|
|
|
|
|
entity.CreateUser = UserManager.DjyUserId;
|
|
|
|
|
await _mappingPortRep.InsertAsync(entity);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
entity.ModifyTime = DateTime.Now;
|
|
|
|
|
entity.ModifyUser = UserManager.DjyUserId;
|
|
|
|
|
await _mappingPortRep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
|
|
|
|
|
}
|
|
|
|
|
await GetAllMappingPort();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 包装
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取包装信息
|
|
|
|
|
/// </summary>
|
|
|
|
|
[HttpGet("/commondb/package")]
|
|
|
|
|
public async Task<dynamic> PackageList([FromQuery] NameQueryDto input)
|
|
|
|
|
{
|
|
|
|
|
List<CodePackage> list = await _sysCacheService.GetAllCodePackage();
|
|
|
|
|
|
|
|
|
|
var queryList = list.WhereIF(!string.IsNullOrEmpty(input.Name), x => x.Name.Contains(input.Name, System.StringComparison.CurrentCultureIgnoreCase));
|
|
|
|
|
|
|
|
|
|
return queryList.ToList();
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 新增包装信息
|
|
|
|
|
/// </summary>
|
|
|
|
|
[HttpPost("/commondb/addpackage")]
|
|
|
|
|
public async Task AddPackage([FromBody] CodePackageDto dto)
|
|
|
|
|
{
|
|
|
|
|
var entity = dto.Adapt<CodePackage>();
|
|
|
|
|
entity.GID = Guid.NewGuid().ToString();
|
|
|
|
|
await _codePackageRep.InsertAsync(entity);
|
|
|
|
|
await GetAllPackage();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取包装映射
|
|
|
|
|
/// </summary>
|
|
|
|
|
[HttpGet("/commondb/mappingpackage")]
|
|
|
|
|
public async Task<dynamic> MappingPackageList([FromQuery] MappingQueryDto input)
|
|
|
|
|
{
|
|
|
|
|
//数量太多,不允许查询全部
|
|
|
|
|
if (string.IsNullOrEmpty(input.Module) || input.Module.Length < 1)
|
|
|
|
|
{
|
|
|
|
|
return new List<MappingPackage>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<MappingPackage> list = await _sysCacheService.GetAllMappingPackage();
|
|
|
|
|
|
|
|
|
|
var queryList = list.WhereIF(!string.IsNullOrEmpty(input.Module), x => x.Module == input.Module)
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(input.MapName), x => x.MapName.Contains(input.MapName, System.StringComparison.CurrentCultureIgnoreCase));
|
|
|
|
|
|
|
|
|
|
return queryList.ToList();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 新增编辑包装映射信息
|
|
|
|
|
/// </summary>
|
|
|
|
|
[HttpPost("/commondb/addorupdatemappingpackage")]
|
|
|
|
|
public async Task AddOrUpdateMappingPackage([FromBody] MappingPackageDto dto)
|
|
|
|
|
{
|
|
|
|
|
var entity = dto.Adapt<MappingPackage>();
|
|
|
|
|
if (string.IsNullOrWhiteSpace(dto.GID))
|
|
|
|
|
{
|
|
|
|
|
entity.GID = Guid.NewGuid().ToString();
|
|
|
|
|
entity.CreateTime = DateTime.Now;
|
|
|
|
|
entity.CreateUser = UserManager.DjyUserId;
|
|
|
|
|
await _mappingPackageRep.InsertAsync(entity);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
entity.ModifyTime = DateTime.Now;
|
|
|
|
|
entity.ModifyUser = UserManager.DjyUserId;
|
|
|
|
|
await _mappingPackageRep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
|
|
|
|
|
}
|
|
|
|
|
await GetAllMappingPackage();
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 运输条款
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取运输条款信息
|
|
|
|
|
/// </summary>
|
|
|
|
|
[HttpGet("/commondb/service")]
|
|
|
|
|
public async Task<dynamic> ServiceList([FromQuery] NameQueryDto input)
|
|
|
|
|
{
|
|
|
|
|
List<CodeService> list = await _sysCacheService.GetAllCodeService();
|
|
|
|
|
|
|
|
|
|
var queryList = list.WhereIF(!string.IsNullOrEmpty(input.Name), x => x.Name.Contains(input.Name, System.StringComparison.CurrentCultureIgnoreCase));
|
|
|
|
|
|
|
|
|
|
return queryList.ToList();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 新增运输条款
|
|
|
|
|
/// </summary>
|
|
|
|
|
[HttpPost("/commondb/addservice")]
|
|
|
|
|
public async Task AddService([FromBody] CodeServiceDto dto)
|
|
|
|
|
{
|
|
|
|
|
var entity = dto.Adapt<CodeService>();
|
|
|
|
|
entity.GID = Guid.NewGuid().ToString();
|
|
|
|
|
entity.CreateTime = DateTime.Now;
|
|
|
|
|
entity.CreateUser = UserManager.DjyUserId;
|
|
|
|
|
await _codeServiceRep.InsertAsync(entity);
|
|
|
|
|
await GetAllService();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取运输条款映射
|
|
|
|
|
/// </summary>
|
|
|
|
|
[HttpGet("/commondb/mappingservice")]
|
|
|
|
|
public async Task<dynamic> MappingServiceList([FromQuery] MappingQueryDto input)
|
|
|
|
|
{
|
|
|
|
|
//数量太多,不允许查询全部
|
|
|
|
|
if (string.IsNullOrEmpty(input.Module) || input.Module.Length < 1)
|
|
|
|
|
{
|
|
|
|
|
return new List<MappingService>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<MappingService> list = await _sysCacheService.GetAllMappingService();
|
|
|
|
|
|
|
|
|
|
var queryList = list.WhereIF(!string.IsNullOrEmpty(input.Module), x => x.Module == input.Module)
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(input.MapName), x => x.MapName.Contains(input.MapName, System.StringComparison.CurrentCultureIgnoreCase));
|
|
|
|
|
|
|
|
|
|
return queryList.ToList();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 新增编辑运输条款映射信息
|
|
|
|
|
/// </summary>
|
|
|
|
|
[HttpPost("/commondb/addorupdatemappingservice")]
|
|
|
|
|
public async Task AddOrUpdateMappingService([FromBody] MappingServiceDto dto)
|
|
|
|
|
{
|
|
|
|
|
var entity = dto.Adapt<MappingService>();
|
|
|
|
|
if (string.IsNullOrWhiteSpace(dto.GID))
|
|
|
|
|
{
|
|
|
|
|
entity.GID = Guid.NewGuid().ToString();
|
|
|
|
|
entity.CreateTime = DateTime.Now;
|
|
|
|
|
entity.CreateUser = UserManager.DjyUserId;
|
|
|
|
|
await _mappingServiceRep.InsertAsync(entity);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
entity.ModifyTime = DateTime.Now;
|
|
|
|
|
entity.ModifyUser = UserManager.DjyUserId;
|
|
|
|
|
await _mappingServiceRep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
|
|
|
|
|
}
|
|
|
|
|
await GetAllMappingService();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 箱型
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取箱型信息
|
|
|
|
|
/// </summary>
|
|
|
|
|
[HttpGet("/commondb/ctn")]
|
|
|
|
|
public async Task<dynamic> CtnList([FromQuery] NameQueryDto input)
|
|
|
|
|
{
|
|
|
|
|
List<CodeCtn> list = await _sysCacheService.GetAllCodeCtn();
|
|
|
|
|
|
|
|
|
|
var queryList = list.WhereIF(!string.IsNullOrEmpty(input.Name), x => x.Name.Contains(input.Name, System.StringComparison.CurrentCultureIgnoreCase));
|
|
|
|
|
|
|
|
|
|
return queryList.ToList();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 新增箱型
|
|
|
|
|
/// </summary>
|
|
|
|
|
[HttpPost("/commondb/addctn")]
|
|
|
|
|
public async Task AddCtn([FromBody] CodeCtnDto dto)
|
|
|
|
|
{
|
|
|
|
|
var entity = dto.Adapt<CodeCtn>();
|
|
|
|
|
entity.CreateTime = DateTime.Now;
|
|
|
|
|
entity.CreateUser = UserManager.DjyUserId;
|
|
|
|
|
entity.GID = Guid.NewGuid().ToString();
|
|
|
|
|
await _codeCtnRep.InsertAsync(entity);
|
|
|
|
|
await GetAllCtn();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取箱型映射列表信息
|
|
|
|
|
/// </summary>
|
|
|
|
|
[HttpGet("/commondb/mappingctnlist")]
|
|
|
|
|
public async Task<dynamic> MappingCtnList([FromQuery] MappingQueryDto input)
|
|
|
|
|
{
|
|
|
|
|
var list = await _sysCacheService.GetAllMappingCtn();
|
|
|
|
|
|
|
|
|
|
var queryList = list
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(input.Code), x => x.Code.Contains(input.Code, System.StringComparison.CurrentCultureIgnoreCase))
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(input.MapCode), x => x.MapCode.Contains(input.MapCode, System.StringComparison.CurrentCultureIgnoreCase))
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(input.Module), x => x.Module == input.Module)
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(input.MapName), x => x.MapName.Contains(input.MapName, System.StringComparison.CurrentCultureIgnoreCase));
|
|
|
|
|
|
|
|
|
|
return queryList.ToList();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 新增编辑箱型映射信息
|
|
|
|
|
/// </summary>
|
|
|
|
|
[HttpPost("/commondb/addmappingctn")]
|
|
|
|
|
public async Task AddOrUpdateMappingCtn([FromBody] MappingCtnDto dto)
|
|
|
|
|
{
|
|
|
|
|
var entity = dto.Adapt<MappingCtn>();
|
|
|
|
|
if (string.IsNullOrWhiteSpace(dto.GID))
|
|
|
|
|
{
|
|
|
|
|
entity.GID = Guid.NewGuid().ToString();
|
|
|
|
|
entity.CreateTime = DateTime.Now;
|
|
|
|
|
entity.CreateUser = UserManager.DjyUserId;
|
|
|
|
|
await _mappingCtnRep.InsertAsync(entity);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
entity.ModifyTime = DateTime.Now;
|
|
|
|
|
entity.ModifyUser = UserManager.DjyUserId;
|
|
|
|
|
await _mappingCtnRep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
await GetAllMappingCtn();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 付费方式
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 付费方式
|
|
|
|
|
/// </summary>
|
|
|
|
|
[HttpGet("/commondb/frt")]
|
|
|
|
|
public async Task<dynamic> FrtList([FromQuery] NameQueryDto input)
|
|
|
|
|
{
|
|
|
|
|
List<CodeFrt> list = await _sysCacheService.GetAllCodeFrt();
|
|
|
|
|
|
|
|
|
|
var queryList = list.WhereIF(!string.IsNullOrEmpty(input.Name), x => x.CnName.Contains(input.Name) || x.EnName.Contains(input.Name, System.StringComparison.CurrentCultureIgnoreCase));
|
|
|
|
|
|
|
|
|
|
return queryList.ToList();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 新增付费方式
|
|
|
|
|
/// </summary>
|
|
|
|
|
[HttpPost("/commondb/addfrt")]
|
|
|
|
|
public async Task AddFrt([FromBody] CodeFrtDto dto)
|
|
|
|
|
{
|
|
|
|
|
var entity = dto.Adapt<CodeFrt>();
|
|
|
|
|
entity.GID = Guid.NewGuid().ToString();
|
|
|
|
|
entity.CreateTime = DateTime.Now;
|
|
|
|
|
entity.CreateUser = UserManager.DjyUserId;
|
|
|
|
|
await _codeFrtRep.InsertAsync(entity);
|
|
|
|
|
await GetAllFrt();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取付费映射列表信息
|
|
|
|
|
/// </summary>
|
|
|
|
|
[HttpGet("/commondb/mappingfrtlist")]
|
|
|
|
|
public async Task<dynamic> MappingFrtList([FromQuery] MappingQueryDto input)
|
|
|
|
|
{
|
|
|
|
|
var list = await _sysCacheService.GetAllMappingFrt();
|
|
|
|
|
|
|
|
|
|
var queryList = list
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(input.Code), x => x.Code.Contains(input.Code, System.StringComparison.CurrentCultureIgnoreCase))
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(input.MapCode), x => x.MapCode.Contains(input.MapCode, System.StringComparison.CurrentCultureIgnoreCase))
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(input.Module), x => x.Module == input.Module)
|
|
|
|
|
.WhereIF(!string.IsNullOrEmpty(input.MapName), x => x.MapName.Contains(input.MapName, System.StringComparison.CurrentCultureIgnoreCase));
|
|
|
|
|
|
|
|
|
|
return queryList.ToList();
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 新增编辑付费映射信息
|
|
|
|
|
/// </summary>
|
|
|
|
|
[HttpPost("/commondb/addmappingfrt")]
|
|
|
|
|
public async Task AddOrUpdateMappingFrt([FromBody] MappingFrtDto dto)
|
|
|
|
|
{
|
|
|
|
|
var entity = dto.Adapt<MappingFrt>();
|
|
|
|
|
if (string.IsNullOrWhiteSpace(dto.GID))
|
|
|
|
|
{
|
|
|
|
|
entity.GID = Guid.NewGuid().ToString();
|
|
|
|
|
entity.CreateTime = DateTime.Now;
|
|
|
|
|
entity.CreateUser = UserManager.DjyUserId;
|
|
|
|
|
await _mappingFrtRep.InsertAsync(entity);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
entity.ModifyTime = DateTime.Now;
|
|
|
|
|
entity.ModifyUser = UserManager.DjyUserId;
|
|
|
|
|
await _mappingFrtRep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
|
|
|
|
|
}
|
|
|
|
|
await GetAllMappingFrt();
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 实现接口,获取公共数据并缓存
|
|
|
|
|
[NonAction]
|
|
|
|
|
public async Task<List<CodeCarrier>> GetAllCarrier()
|
|
|
|
|
{
|
|
|
|
|
var list = await _codeCarrierRep.ToListAsync();
|
|
|
|
|
await _sysCacheService.SetAllCodeCarrier(list);
|
|
|
|
|
return list;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[NonAction]
|
|
|
|
|
public async Task<List<MappingCarrier>> GetAllMappingCarrier()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
var list = await _mappingCarrierRep.ToListAsync();
|
|
|
|
|
await _sysCacheService.SetAllMappingCarrier(list);
|
|
|
|
|
return list;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[NonAction]
|
|
|
|
|
public async Task<List<CodeVessel>> GetAllVessel()
|
|
|
|
|
{
|
|
|
|
|
var list = await _codeVesselRep.ToListAsync();
|
|
|
|
|
await _sysCacheService.SetAllCodeVessel(list);
|
|
|
|
|
return list;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[NonAction]
|
|
|
|
|
public async Task<List<MappingVessel>> GetAllMappingVessel()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
var list = await _mappingVesselRep.ToListAsync();
|
|
|
|
|
await _sysCacheService.SetAllMappingVessel(list);
|
|
|
|
|
return list;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
[NonAction]
|
|
|
|
|
public async Task<List<MappingYard>> GetAllMappingYard()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
var list = await _mappingYardRep.ToListAsync();
|
|
|
|
|
await _sysCacheService.SetAllMappingYard(list);
|
|
|
|
|
return list;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
[NonAction]
|
|
|
|
|
public async Task<List<CodeForwarder>> GetAllForwarder()
|
|
|
|
|
{
|
|
|
|
|
var list = await _codeForwarderRep.ToListAsync();
|
|
|
|
|
await _sysCacheService.SetAllCodeForwarder(list);
|
|
|
|
|
return list;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[NonAction]
|
|
|
|
|
public async Task<List<CodeYard>> GetAllYard()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
var list = await _codeYardRep.ToListAsync();
|
|
|
|
|
await _sysCacheService.SetAllCodeYard(list);
|
|
|
|
|
return list;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[NonAction]
|
|
|
|
|
public async Task<List<CodePortLoad>> GetAllPortload()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
var list = await _codePortLoadrRep.ToListAsync();
|
|
|
|
|
await _sysCacheService.SetAllCodePortLoad(list);
|
|
|
|
|
return list;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[NonAction]
|
|
|
|
|
public async Task<List<CodePort>> GetAllPort()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
var list = await _codePortRep.ToListAsync();
|
|
|
|
|
await _sysCacheService.SetAllCodePort(list);
|
|
|
|
|
return list;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[NonAction]
|
|
|
|
|
public async Task<List<CodePackage>> GetAllPackage()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
var list = await _codePackageRep.ToListAsync();
|
|
|
|
|
await _sysCacheService.SetAllCodePackage(list);
|
|
|
|
|
return list;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[NonAction]
|
|
|
|
|
public async Task<List<CodeService>> GetAllService()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
var list = await _codeServiceRep.ToListAsync();
|
|
|
|
|
await _sysCacheService.SetAllCodeService(list);
|
|
|
|
|
return list;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[NonAction]
|
|
|
|
|
public async Task<List<CodeCtn>> GetAllCtn()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
var list = await _codeCtnRep.ToListAsync();
|
|
|
|
|
await _sysCacheService.SetAllCodeCtn(list);
|
|
|
|
|
return list;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
[NonAction]
|
|
|
|
|
public async Task<List<MappingCtn>> GetAllMappingCtn()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
var list = await _mappingCtnRep.ToListAsync();
|
|
|
|
|
await _sysCacheService.SetAllMappingCtn(list);
|
|
|
|
|
return list;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
[NonAction]
|
|
|
|
|
public async Task<List<CodeFrt>> GetAllFrt()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
var list = await _codeFrtRep.ToListAsync();
|
|
|
|
|
await _sysCacheService.SetAllCodeFrt(list);
|
|
|
|
|
return list;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
[NonAction]
|
|
|
|
|
public async Task<List<MappingFrt>> GetAllMappingFrt()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
var list = await _mappingFrtRep.ToListAsync();
|
|
|
|
|
await _sysCacheService.SetAllMappingFrt(list);
|
|
|
|
|
return list;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[NonAction]
|
|
|
|
|
public async Task<List<MappingPortLoad>> GetAllMappingPortLoad()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
var list = await _mappingPortLoadRep.ToListAsync();
|
|
|
|
|
await _sysCacheService.SetAllMappingPortLoad(list);
|
|
|
|
|
return list;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[NonAction]
|
|
|
|
|
public async Task<List<MappingPort>> GetAllMappingPort()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
var list = await _mappingPortRep.ToListAsync();
|
|
|
|
|
await _sysCacheService.SetAllMappingPort(list);
|
|
|
|
|
return list;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
[NonAction]
|
|
|
|
|
public async Task<List<MappingPackage>> GetAllMappingPackage()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
var list = await _mappingPackageRep.ToListAsync();
|
|
|
|
|
await _sysCacheService.SetAllMappingPackage(list);
|
|
|
|
|
return list;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
[NonAction]
|
|
|
|
|
public async Task<List<MappingService>> GetAllMappingService()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
var list = await _mappingServiceRep.ToListAsync();
|
|
|
|
|
await _sysCacheService.SetAllMappingService(list);
|
|
|
|
|
return list;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
}
|