booking_auth_dev
wanghaomei 2 years ago
commit 5072ae1cb9

@ -159,7 +159,7 @@ namespace Myshipping.Application
.WhereIF(!string.IsNullOrWhiteSpace(input.HUMIDITY), u => u.HUMIDITY == input.HUMIDITY)
.WhereIF(!string.IsNullOrWhiteSpace(input.TEMPMIN), u => u.TEMPMIN == input.TEMPMIN)
.WhereIF(!string.IsNullOrWhiteSpace(input.TEMPMAX), u => u.TEMPMAX == input.TEMPMAX)
.WhereIF(!input.ISCONTAINERSOC, u => u.ISCONTAINERSOC == input.ISCONTAINERSOC)
.WhereIF(input.ISCONTAINERSOC!=null, u => u.ISCONTAINERSOC == input.ISCONTAINERSOC)
.WhereIF(!string.IsNullOrWhiteSpace(input.SOREMARK), u => u.SOREMARK.Contains(input.SOREMARK))
.WhereIF(!string.IsNullOrWhiteSpace(input.SIREMARK), u => u.SIREMARK.Contains(input.SIREMARK))
.WhereIF(!string.IsNullOrWhiteSpace(input.YARDREMARK), u => u.YARDREMARK.Contains(input.YARDREMARK))
@ -196,7 +196,7 @@ namespace Myshipping.Application
.WhereIF(!string.IsNullOrWhiteSpace(input.CUSTSERVICEID), u => u.CUSTSERVICEID == input.CUSTSERVICEID)
.WhereIF(!string.IsNullOrWhiteSpace(input.CUSTSERVICE), u => u.CUSTSERVICE.Contains(input.CUSTSERVICE))
.WhereIF(!string.IsNullOrWhiteSpace(input.CUSTOMERNAME), u => u.CUSTOMERNAME.Contains(input.CUSTOMERNAME))
.WhereIF(input.CUSTOMERID != 0, u => u.CUSTOMERID == input.CUSTOMERID)
.WhereIF(input.CUSTOMERID !=null, u => u.CUSTOMERID == input.CUSTOMERID)
.WhereIF(!string.IsNullOrWhiteSpace(input.FORWARDER), u => u.FORWARDER.Contains(input.FORWARDER))
.WhereIF(!string.IsNullOrWhiteSpace(input.CUSTSERVICE), u => u.CUSTSERVICE == input.CUSTSERVICE)
.WhereIF(!string.IsNullOrWhiteSpace(input.CUSTOMERNAME), u => u.CUSTOMERNAME == input.CUSTOMERNAME)

@ -368,7 +368,7 @@ namespace Myshipping.Application
/// <summary>
/// 是否SOC箱
/// </summary>
public virtual bool ISCONTAINERSOC { get; set; }
public virtual bool? ISCONTAINERSOC { get; set; }
/// <summary>
/// SO备注
@ -623,7 +623,7 @@ namespace Myshipping.Application
/// <summary>
/// 客户ID
/// </summary>
public virtual long CUSTOMERID { get; set; }
public virtual long? CUSTOMERID { get; set; }
/// <summary>
/// 订舱代理ID

@ -119,6 +119,23 @@ public class CommonConst
/// 场站映射
/// </summary>
public const string CACHE_KEY_COMMON_DB_MAPPING_YARD = "CommonDbMappingYard";
/// <summary>
/// 起始港映射
/// </summary>
public const string CACHE_KEY_COMMON_DB_MAPPING_PORTLOAD = "CommonDbMappingPortLoad";
/// <summary>
/// 目的港映射
/// </summary>
public const string CACHE_KEY_COMMON_DB_MAPPING_PORT = "CommonDbMappingPort";
/// <summary>
/// 包装映射
/// </summary>
public const string CACHE_KEY_COMMON_DB_MAPPING_PACKAGE = "CommonDbMappingPackage";
/// <summary>
/// 包装映射
/// </summary>
public const string CACHE_KEY_COMMON_DB_MAPPING_SERVICE = "CommonDbMappingService";
/// <summary>
/// 字典映射

@ -76,4 +76,10 @@ namespace Myshipping.Core.Entity
public string Remark { get; set; }
}
}

@ -40,4 +40,40 @@ namespace Myshipping.Core.Entity
}
[SugarTable("MappingPackage")]
[Description("包装映射")]
public class MappingPackage : CommonDbEntity
{
/// <summary>
/// 代码
/// </summary>
public string Code { get; set; }
/// <summary>
/// 船司代码
/// </summary>
public string CarrierCode { get; set; }
/// <summary>
/// 模块
/// </summary>
public string Module { get; set; }
/// <summary>
/// 映射代码
/// </summary>
public string MapCode { get; set; }
/// <summary>
/// 映射名称
/// </summary>
public string MapName { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
}
}

@ -66,4 +66,40 @@ namespace Myshipping.Core.Entity
}
[SugarTable("MappingPort")]
[Description("起运港映射")]
public class MappingPort : CommonDbEntity
{
/// <summary>
/// 代码
/// </summary>
public string Code { get; set; }
/// <summary>
/// 船司代码
/// </summary>
public string CarrierCode { get; set; }
/// <summary>
/// 模块
/// </summary>
public string Module { get; set; }
/// <summary>
/// 映射代码
/// </summary>
public string MapCode { get; set; }
/// <summary>
/// 映射名称
/// </summary>
public string MapName { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
}
}

@ -41,8 +41,42 @@ namespace Myshipping.Core.Entity
/// 备注
/// </summary>
public string Remark { get; set; }
}
[SugarTable("MappingPortLoad")]
[Description("起运港映射")]
public class MappingPortLoad : CommonDbEntity
{
/// <summary>
/// 代码
/// </summary>
public string Code { get; set; }
/// <summary>
/// 船司代码
/// </summary>
public string CarrierCode { get; set; }
/// <summary>
/// 模块
/// </summary>
public string Module { get; set; }
/// <summary>
/// 映射代码
/// </summary>
public string MapCode { get; set; }
/// <summary>
/// 映射名称
/// </summary>
public string MapName { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
}
}

@ -39,5 +39,44 @@ namespace Myshipping.Core.Entity
}
[SugarTable("MappingService")]
[Description("运输方式")]
public class MappingService : CommonDbEntity
{
/// <summary>
/// 代码
/// </summary>
public string Code { get; set; }
/// <summary>
/// 船司代码
/// </summary>
public string CarrierCode { get; set; }
/// <summary>
/// 模块
/// </summary>
public string Module { get; set; }
/// <summary>
/// 映射代码
/// </summary>
public string MapCode { get; set; }
/// <summary>
/// 映射名称
/// </summary>
public string MapName { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
}
}

File diff suppressed because it is too large Load Diff

@ -94,7 +94,7 @@ public class AuthService : IAuthService, IDynamicApiController, ITransient
{ClaimConst.CLAINM_SUPERADMIN, user.AdminType},
{ ClaimConst.CLAINM_TENANT_TYPE, tenant.TenantType },
{ ClaimConst.CLAINM_TENANT_NAME, tenant.Name },
{ ClaimConst.DjyUserId, user.DjyUserId },
{ ClaimConst.DjyUserId, user.DjyUserId },
});
// 设置Swagger自动登录

@ -214,6 +214,50 @@ public interface ISysCacheService
/// </summary>
/// <returns></returns>
Task SetAllMappingYard(List<MappingYard> list);
/// <summary>
/// 设置公共库 起始港映射
/// </summary>
/// <returns></returns>
Task SetAllMappingPortLoad(List<MappingPortLoad> list);
/// <summary>
/// 获取公共库 起始港映射
/// </summary>
/// <returns></returns>
Task<List<MappingPortLoad>> GetAllMappingPortLoad();
/// <summary>
/// 获取公共库 目的港映射
/// </summary>
/// <returns></returns>
Task<List<MappingPort>> GetAllMappingPort();
/// <summary>
/// 设置公共库 目的港映射
/// </summary>
/// <returns></returns>
Task SetAllMappingPort(List<MappingPort> list);
/// <summary>
/// 设置公共库 包装映射
/// </summary>
/// <returns></returns>
Task SetAllMappingPackage(List<MappingPackage> list);
/// <summary>
/// 获取公共库 包装映射
/// </summary>
/// <returns></returns>
Task<List<MappingPackage>> GetAllMappingPackage();
/// <summary>
/// 获取公共库 运输条款映射
/// </summary>
/// <returns></returns>
Task<List<MappingService>> GetAllMappingService();
/// <summary>
/// 设置公共库 运输条款映射
/// </summary>
/// <returns></returns>
Task SetAllMappingService(List<MappingService> list);
#endregion
#region DJY

@ -419,7 +419,7 @@ public class SysCacheService : ISysCacheService, IDynamicApiController, ISinglet
}
/// <summary>
/// 获取公共库 船名映射
/// 获取公共库 场站映射
/// </summary>
/// <returns></returns>
public Task<List<MappingYard>> GetAllMappingYard()
@ -562,8 +562,71 @@ public class SysCacheService : ISysCacheService, IDynamicApiController, ISinglet
{
return _cache.SetAsync(CommonConst.CACHE_KEY_COMMON_DB_MAPPING_YARD, list);
}
/// <summary>
/// 设置公共库 起始港映射
/// </summary>
/// <returns></returns>
public Task SetAllMappingPortLoad(List<MappingPortLoad> list)
{
return _cache.SetAsync(CommonConst.CACHE_KEY_COMMON_DB_MAPPING_PORTLOAD, list);
}
/// <summary>
/// 获取公共库 起始港映射
/// </summary>
/// <returns></returns>
public Task<List<MappingPortLoad>> GetAllMappingPortLoad()
{
return _cache.GetAsync<List<MappingPortLoad>>(CommonConst.CACHE_KEY_COMMON_DB_MAPPING_PORTLOAD);
}
/// <summary>
/// 获取公共库 目的港映射
/// </summary>
/// <returns></returns>
public Task<List<MappingPort>> GetAllMappingPort()
{
return _cache.GetAsync<List<MappingPort>>(CommonConst.CACHE_KEY_COMMON_DB_MAPPING_PORT);
}
/// <summary>
/// 设置公共库 目的港映射
/// </summary>
/// <returns></returns>
public Task SetAllMappingPort(List<MappingPort> list)
{
return _cache.SetAsync(CommonConst.CACHE_KEY_COMMON_DB_MAPPING_PORT, list);
}
/// <summary>
/// 设置公共库 包装映射
/// </summary>
/// <returns></returns>
public Task SetAllMappingPackage(List<MappingPackage> list)
{
return _cache.SetAsync(CommonConst.CACHE_KEY_COMMON_DB_MAPPING_PACKAGE, list);
}
/// <summary>
/// 获取公共库 包装映射
/// </summary>
/// <returns></returns>
public Task<List<MappingPackage>> GetAllMappingPackage()
{
return _cache.GetAsync<List<MappingPackage>>(CommonConst.CACHE_KEY_COMMON_DB_MAPPING_PACKAGE);
}
/// <summary>
/// 获取公共库 运输条款映射
/// </summary>
/// <returns></returns>
public Task<List<MappingService>> GetAllMappingService()
{
return _cache.GetAsync<List<MappingService>>(CommonConst.CACHE_KEY_COMMON_DB_MAPPING_SERVICE);
} /// <summary>
/// 设置公共库 运输条款映射
/// </summary>
/// <returns></returns>
public Task SetAllMappingService(List<MappingService> list)
{
return _cache.SetAsync(CommonConst.CACHE_KEY_COMMON_DB_MAPPING_SERVICE, list);
}
#endregion
#region DJY

@ -9,6 +9,7 @@ using System.Linq;
using System.Threading.Tasks;
using System.Collections.Generic;
using System;
using Myshipping.Core.Service.CommonDB.Dto;
namespace Myshipping.Core.Service;
/// <summary>
@ -33,6 +34,10 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
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,
@ -50,6 +55,10 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
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;
@ -68,8 +77,10 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
_mappingFrtRep = mappingFrtRep;
_mappingYardRep = mappingYardRep;
_sysCacheService = sysCacheService;
_mappingPortLoadRep = mappingPortLoadRep;
_mappingPortRep = mappingPortRep;
_mappingPackageRep = mappingPackageRep;
_mappingServiceRep = mappingServiceRep;
}
@ -91,12 +102,15 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
/// 新增船公司信息
/// </summary>
[HttpPost("/commondb/addcarrier")]
public async Task AddCarrier([FromBody] CodeCarrier dto)
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>
@ -119,17 +133,20 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
/// 新增编辑船公司映射信息
/// </summary>
[HttpPost("/commondb/addorupdatemappingcarrier")]
public async Task AddOrUpdateMappingCarrier([FromBody] MappingCarrier dto)
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();
}
@ -163,10 +180,12 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
/// 新增船名信息
/// </summary>
[HttpPost("/commondb/addvessel")]
public async Task AddVessel([FromBody] CodeVessel dto)
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();
}
@ -195,17 +214,20 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
/// 新增编辑船名映射信息
/// </summary>
[HttpPost("/commondb/addorupdatevessel")]
public async Task AddOrUpdateMappingVessel([FromBody] MappingVessel dto)
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();
}
@ -232,10 +254,12 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
/// 新增船代信息
/// </summary>
[HttpPost("/commondb/addforwarder")]
public async Task AddForwarder([FromBody] CodeForwarder dto)
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();
}
@ -259,10 +283,12 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
/// 新增场站信息
/// </summary>
[HttpPost("/commondb/addyard")]
public async Task AddYard([FromBody] CodeYard dto)
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();
}
@ -291,16 +317,20 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
/// 新增编辑场站映射信息
/// </summary>
[HttpPost("/commondb/addorupdatemappingyard")]
public async Task AddOrUpdateMappingYard([FromBody] MappingYard dto)
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();
@ -328,13 +358,62 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
/// 新增起始港信息
/// </summary>
[HttpPost("/commondb/addportload")]
public async Task AddPortload([FromBody] CodePortLoad dto)
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 目的港
@ -362,14 +441,57 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
/// 新增目的港信息
/// </summary>
[HttpPost("/commondb/addport")]
public async Task AddPort([FromBody] CodePort dto)
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
@ -390,7 +512,7 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
/// 新增包装信息
/// </summary>
[HttpPost("/commondb/addpackage")]
public async Task AddPackage([FromBody] CodePackage dto)
public async Task AddPackage([FromBody] CodePackageDto dto)
{
var entity = dto.Adapt<CodePackage>();
entity.GID = Guid.NewGuid().ToString();
@ -398,6 +520,49 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
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 运输条款
@ -418,14 +583,58 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
/// 新增运输条款
/// </summary>
[HttpPost("/commondb/addservice")]
public async Task AddService([FromBody] CodeService dto)
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
@ -448,9 +657,11 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
/// 新增箱型
/// </summary>
[HttpPost("/commondb/addctn")]
public async Task AddCtn([FromBody] CodeCtn dto)
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();
@ -478,17 +689,20 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
/// 新增编辑箱型映射信息
/// </summary>
[HttpPost("/commondb/addmappingctn")]
public async Task AddOrUpdateMappingCtn([FromBody] MappingCtn dto)
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();
}
@ -516,10 +730,12 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
/// 新增付费方式
/// </summary>
[HttpPost("/commondb/addfrt")]
public async Task AddFrt([FromBody] CodeFrt dto)
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();
}
@ -545,16 +761,20 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
/// 新增编辑付费映射信息
/// </summary>
[HttpPost("/commondb/addmappingfrt")]
public async Task AddOrUpdateMappingFrt([FromBody] MappingFrt dto)
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();
@ -701,6 +921,45 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
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
}

@ -0,0 +1,46 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Core.Service.CommonDB.Dto
{
public class CodeCarrierDto
{
/// <summary>
/// 代码
/// </summary>
public string Code { get; set; }
/// <summary>
/// 英文名称
/// </summary>
public string EnName { get; set; }
/// <summary>
/// 中文名称
/// </summary>
public string CnName { get; set; }
/// <summary>
/// EDI代码
/// </summary>
public string EdiCode { get; set; }
/// <summary>
/// 描述
/// </summary>
public string Description { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
}
}

@ -0,0 +1,45 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Core.Service.CommonDB.Dto
{
public class CodeCtnDto
{
/// <summary>
/// 代码
/// </summary>
public string Code { get; set; }
/// <summary>
/// 尺寸
/// </summary>
public int? Size { get; set; }
/// <summary>
/// 名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// EDI代码
/// </summary>
public string EdiCode { get; set; }
/// <summary>
/// 描述
/// </summary>
public string Description { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
}
}

@ -0,0 +1,34 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Core.Service.CommonDB.Dto
{
public class CodeForwarderDto
{
/// <summary>
/// 代码
/// </summary>
public string Code { get; set; }
/// <summary>
/// 名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 描述
/// </summary>
public string Description { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
}
}

@ -0,0 +1,39 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Core.Service.CommonDB.Dto
{
public class CodeFrtDto
{
/// <summary>
/// 代码
/// </summary>
public string Code { get; set; }
/// <summary>
/// 英文名称
/// </summary>
public string EnName { get; set; }
/// <summary>
/// 中文名称
/// </summary>
public string CnName { get; set; }
/// <summary>
/// 描述
/// </summary>
public string Description { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
}
}

@ -0,0 +1,39 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Core.Service.CommonDB.Dto
{
public class CodePackageDto
{
/// <summary>
/// 代码
/// </summary>
public string Code { get; set; }
/// <summary>
/// 名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// EDI代码
/// </summary>
public string EdiCode { get; set; }
/// <summary>
/// 描述
/// </summary>
public string Description { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
}
}

@ -0,0 +1,65 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Core.Service.CommonDB.Dto
{
public class CodePortDto
{
/// <summary>
/// 代码
/// </summary>
public string Code { get; set; }
/// <summary>
/// 英文名称
/// </summary>
public string EnName { get; set; }
/// <summary>
/// 中文名称
/// </summary>
public string CnName { get; set; }
/// <summary>
/// 航线
/// </summary>
public string ShippingRoute { get; set; }
/// <summary>
/// 国家
/// </summary>
public string Country { get; set; }
/// <summary>
/// 国家代码
/// </summary>
public string CountryCode { get; set; }
/// <summary>
/// 全名
/// </summary>
public string FullName { get; set; }
/// <summary>
/// 描述
/// </summary>
public string Description { get; set; }
/// <summary>
/// EDI代码
/// </summary>
public string EdiCode { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
}
}

@ -0,0 +1,41 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Core.Service.CommonDB.Dto
{
public class CodePortLoadDto
{
/// <summary>
/// 代码
/// </summary>
public string Code { get; set; }
/// <summary>
/// 英文名称
/// </summary>
public string EnName { get; set; }
/// <summary>
/// 中文名称
/// </summary>
public string CnName { get; set; }
/// <summary>
/// 描述
/// </summary>
public string Description { get; set; }
/// <summary>
/// EDI代码
/// </summary>
public string EdiCode { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
}
}

@ -0,0 +1,36 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Core.Service.CommonDB.Dto
{
public class CodeServiceDto
{ /// <summary>
/// 代码
/// </summary>
public string Code { get; set; }
/// <summary>
/// 名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// EDI代码
/// </summary>
public string EdiCode { get; set; }
/// <summary>
/// 描述
/// </summary>
public string Description { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
}
}

@ -0,0 +1,53 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Core.Service.CommonDB.Dto
{
public class CodeVesselDto
{
/// <summary>
/// 名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// EDI代码
/// </summary>
public string EdiCode { get; set; }
/// <summary>
/// 描述
/// </summary>
public string Description { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime CreateTime { get; set; }
/// <summary>
/// 修改时间
/// </summary>
public DateTime? ModifyTime { get; set; }
/// <summary>
/// 创建人
/// </summary>
public string CreateUser { get; set; }
/// <summary>
/// 修改人
/// </summary>
public string ModifyUser { get; set; }
}
}

@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Core.Service.CommonDB.Dto
{
public class CodeYardDto
{
/// <summary>
/// 代码
/// </summary>
public string Code { get; set; }
/// <summary>
/// 名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 描述
/// </summary>
public string Description { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
}
}

@ -0,0 +1,42 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Core.Service.CommonDB.Dto
{
public class MappingCarrierDto
{
/// <summary>
/// 业务id
/// </summary>
public string GID { get; set; }
/// <summary>
/// 代码
/// </summary>
public string Code { get; set; }
/// <summary>
/// 模块
/// </summary>
public string Module { get; set; }
/// <summary>
/// 映射代码
/// </summary>
public string MapCode { get; set; }
/// <summary>
/// 映射名称
/// </summary>
public string MapName { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
}
}

@ -0,0 +1,46 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Core.Service.CommonDB.Dto
{
public class MappingCtnDto
{
/// <summary>
/// 业务id
/// </summary>
public string GID { get; set; }
/// <summary>
/// 代码
/// </summary>
public string Code { get; set; }
/// <summary>
/// 船司代码
/// </summary>
public string CarrierCode { get; set; }
/// <summary>
/// 模块
/// </summary>
public string Module { get; set; }
/// <summary>
/// 映射代码
/// </summary>
public string MapCode { get; set; }
/// <summary>
/// 映射名称
/// </summary>
public string MapName { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
}
}

@ -0,0 +1,45 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Core.Service.CommonDB.Dto
{
public class MappingFrtDto
{
/// <summary>
/// 业务id
/// </summary>
public string GID { get; set; }
/// <summary>
/// 代码
/// </summary>
public string Code { get; set; }
/// <summary>
/// 船司代码
/// </summary>
public string CarrierCode { get; set; }
/// <summary>
/// 模块
/// </summary>
public string Module { get; set; }
/// <summary>
/// 映射代码
/// </summary>
public string MapCode { get; set; }
/// <summary>
/// 映射名称
/// </summary>
public string MapName { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
}
}

@ -0,0 +1,45 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Core.Service.CommonDB.Dto
{
public class MappingServiceDto
{
/// <summary>
/// 业务id
/// </summary>
public string GID { get; set; }
/// <summary>
/// 代码
/// </summary>
public string Code { get; set; }
/// <summary>
/// 船司代码
/// </summary>
public string CarrierCode { get; set; }
/// <summary>
/// 模块
/// </summary>
public string Module { get; set; }
/// <summary>
/// 映射代码
/// </summary>
public string MapCode { get; set; }
/// <summary>
/// 映射名称
/// </summary>
public string MapName { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
}
}

@ -0,0 +1,45 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Core.Service.CommonDB.Dto
{
public class MappingPortDto
{
/// <summary>
///业务id
/// </summary>
public string GID { get; set; }
/// <summary>
/// 代码
/// </summary>
public string Code { get; set; }
/// <summary>
/// 船司代码
/// </summary>
public string CarrierCode { get; set; }
/// <summary>
/// 模块
/// </summary>
public string Module { get; set; }
/// <summary>
/// 映射代码
/// </summary>
public string MapCode { get; set; }
/// <summary>
/// 映射名称
/// </summary>
public string MapName { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
}
}

@ -0,0 +1,46 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Core.Service.CommonDB.Dto
{
public class MappingPortLoadDto
{
/// <summary>
/// 业务id
/// </summary>
public string GID { get; set; }
/// <summary>
/// 代码
/// </summary>
public string Code { get; set; }
/// <summary>
/// 船司代码
/// </summary>
public string CarrierCode { get; set; }
/// <summary>
/// 模块
/// </summary>
public string Module { get; set; }
/// <summary>
/// 映射代码
/// </summary>
public string MapCode { get; set; }
/// <summary>
/// 映射名称
/// </summary>
public string MapName { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
}
}

@ -0,0 +1,45 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Core.Service.CommonDB.Dto
{
public class MappingPackageDto
{
/// <summary>
/// 业务id
/// </summary>
public string GID { get; set; }
/// <summary>
/// 代码
/// </summary>
public string Code { get; set; }
/// <summary>
/// 船司代码
/// </summary>
public string CarrierCode { get; set; }
/// <summary>
/// 模块
/// </summary>
public string Module { get; set; }
/// <summary>
/// 映射代码
/// </summary>
public string MapCode { get; set; }
/// <summary>
/// 映射名称
/// </summary>
public string MapName { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
}
}

@ -0,0 +1,33 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Core.Service.CommonDB.Dto
{
public class MappingVesselDto
{
public string GID { get; set; }
/// <summary>
/// 名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 模块
/// </summary>
public string Module { get; set; }
/// <summary>
/// 映射名称
/// </summary>
public string MapName { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
}
}

@ -0,0 +1,41 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Core.Service.CommonDB.Dto
{
public class MappingYardDto
{
/// <summary>
/// 业务id
/// </summary>
public string GID { get; set; }
/// <summary>
/// 代码
/// </summary>
public string Code { get; set; }
/// <summary>
/// 模块
/// </summary>
public string Module { get; set; }
/// <summary>
/// 映射代码
/// </summary>
public string MapCode { get; set; }
/// <summary>
/// 映射名称
/// </summary>
public string MapName { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
}
}

@ -95,4 +95,23 @@ public interface ICommonDBService
/// 付费方式映射
/// </summary>
Task<List<MappingFrt>> GetAllMappingFrt();
/// <summary>
/// 起始港映射
/// </summary>
Task<List<MappingPortLoad>> GetAllMappingPortLoad();
/// <summary>
/// 目的港映射
/// </summary>
Task<List<MappingPort>> GetAllMappingPort();
/// <summary>
/// 包装映射
/// </summary>
Task<List<MappingPackage>> GetAllMappingPackage();
/// <summary>
/// 运输服务映射
/// </summary>
Task<List<MappingService>> GetAllMappingService();
}

@ -168,6 +168,15 @@ public class Startup : AppStartup
//付费方式映射
App.GetService<ICommonDBService>().GetAllMappingFrt();
//起始港映射
App.GetService<ICommonDBService>().GetAllMappingPortLoad();
//目的港映射
App.GetService<ICommonDBService>().GetAllMappingPort();
//包装映射
App.GetService<ICommonDBService>().GetAllMappingPackage();
//运输服务映射
App.GetService<ICommonDBService>().GetAllMappingService();
#endregion
}

Loading…
Cancel
Save