|
|
@ -9,6 +9,7 @@ using System.Linq;
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System;
|
|
|
|
using System;
|
|
|
|
|
|
|
|
using Myshipping.Core.Service.CommonDB.Dto;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Myshipping.Core.Service;
|
|
|
|
namespace Myshipping.Core.Service;
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
@ -33,6 +34,10 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
|
|
|
|
private readonly SqlSugarRepository<MappingCtn> _mappingCtnRep;
|
|
|
|
private readonly SqlSugarRepository<MappingCtn> _mappingCtnRep;
|
|
|
|
private readonly SqlSugarRepository<CodeFrt> _codeFrtRep;
|
|
|
|
private readonly SqlSugarRepository<CodeFrt> _codeFrtRep;
|
|
|
|
private readonly SqlSugarRepository<MappingFrt> _mappingFrtRep;
|
|
|
|
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;
|
|
|
|
private readonly ISysCacheService _sysCacheService;
|
|
|
|
|
|
|
|
|
|
|
|
public CommonDBService(SqlSugarRepository<CodeCarrier> codeCarrierRep,
|
|
|
|
public CommonDBService(SqlSugarRepository<CodeCarrier> codeCarrierRep,
|
|
|
@ -50,6 +55,10 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
|
|
|
|
SqlSugarRepository<MappingCtn> mappingCtnRep,
|
|
|
|
SqlSugarRepository<MappingCtn> mappingCtnRep,
|
|
|
|
SqlSugarRepository<MappingFrt> mappingFrtRep,
|
|
|
|
SqlSugarRepository<MappingFrt> mappingFrtRep,
|
|
|
|
SqlSugarRepository<MappingYard> mappingYardRep,
|
|
|
|
SqlSugarRepository<MappingYard> mappingYardRep,
|
|
|
|
|
|
|
|
SqlSugarRepository<MappingPortLoad> mappingPortLoadRep,
|
|
|
|
|
|
|
|
SqlSugarRepository<MappingPort> mappingPortRep,
|
|
|
|
|
|
|
|
SqlSugarRepository<MappingPackage> mappingPackageRep,
|
|
|
|
|
|
|
|
SqlSugarRepository<MappingService> mappingServiceRep,
|
|
|
|
ISysCacheService sysCacheService)
|
|
|
|
ISysCacheService sysCacheService)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_codeCarrierRep = codeCarrierRep;
|
|
|
|
_codeCarrierRep = codeCarrierRep;
|
|
|
@ -68,8 +77,10 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
|
|
|
|
_mappingFrtRep = mappingFrtRep;
|
|
|
|
_mappingFrtRep = mappingFrtRep;
|
|
|
|
_mappingYardRep = mappingYardRep;
|
|
|
|
_mappingYardRep = mappingYardRep;
|
|
|
|
_sysCacheService = sysCacheService;
|
|
|
|
_sysCacheService = sysCacheService;
|
|
|
|
|
|
|
|
_mappingPortLoadRep = mappingPortLoadRep;
|
|
|
|
|
|
|
|
_mappingPortRep = mappingPortRep;
|
|
|
|
|
|
|
|
_mappingPackageRep = mappingPackageRep;
|
|
|
|
|
|
|
|
_mappingServiceRep = mappingServiceRep;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -91,10 +102,12 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
|
|
|
|
/// 新增船公司信息
|
|
|
|
/// 新增船公司信息
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
[HttpPost("/commondb/addcarrier")]
|
|
|
|
[HttpPost("/commondb/addcarrier")]
|
|
|
|
public async Task AddCarrier([FromBody] CodeCarrier dto)
|
|
|
|
public async Task AddCarrier([FromBody] CodeCarrierDto dto)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var entity = dto.Adapt<CodeCarrier>();
|
|
|
|
var entity = dto.Adapt<CodeCarrier>();
|
|
|
|
entity.GID = Guid.NewGuid().ToString();
|
|
|
|
entity.GID = Guid.NewGuid().ToString();
|
|
|
|
|
|
|
|
entity.CreateTime = DateTime.Now;
|
|
|
|
|
|
|
|
entity.CreateUser = UserManager.DjyUserId;
|
|
|
|
await _codeCarrierRep.InsertAsync(entity);
|
|
|
|
await _codeCarrierRep.InsertAsync(entity);
|
|
|
|
await GetAllCarrier();
|
|
|
|
await GetAllCarrier();
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -119,17 +132,20 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
|
|
|
|
/// 新增编辑船公司映射信息
|
|
|
|
/// 新增编辑船公司映射信息
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
[HttpPost("/commondb/addorupdatemappingcarrier")]
|
|
|
|
[HttpPost("/commondb/addorupdatemappingcarrier")]
|
|
|
|
public async Task AddOrUpdateMappingCarrier([FromBody] MappingCarrier dto)
|
|
|
|
public async Task AddOrUpdateMappingCarrier([FromBody] MappingCarrierDto dto)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var entity = dto.Adapt<MappingCarrier>();
|
|
|
|
var entity = dto.Adapt<MappingCarrier>();
|
|
|
|
if (string.IsNullOrWhiteSpace(dto.GID))
|
|
|
|
if (string.IsNullOrWhiteSpace(dto.GID))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
entity.GID = Guid.NewGuid().ToString();
|
|
|
|
entity.GID = Guid.NewGuid().ToString();
|
|
|
|
|
|
|
|
entity.CreateTime = DateTime.Now;
|
|
|
|
|
|
|
|
entity.CreateUser =UserManager.DjyUserId;
|
|
|
|
await _mappingCarrierRep.InsertAsync(entity);
|
|
|
|
await _mappingCarrierRep.InsertAsync(entity);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
entity.ModifyTime = DateTime.Now;
|
|
|
|
|
|
|
|
entity.ModifyUser = UserManager.DjyUserId;
|
|
|
|
await _mappingCarrierRep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
|
|
|
|
await _mappingCarrierRep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -163,10 +179,12 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
|
|
|
|
/// 新增船名信息
|
|
|
|
/// 新增船名信息
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
[HttpPost("/commondb/addvessel")]
|
|
|
|
[HttpPost("/commondb/addvessel")]
|
|
|
|
public async Task AddVessel([FromBody] CodeVessel dto)
|
|
|
|
public async Task AddVessel([FromBody] CodeVesselDto dto)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var entity = dto.Adapt<CodeVessel>();
|
|
|
|
var entity = dto.Adapt<CodeVessel>();
|
|
|
|
entity.GID = Guid.NewGuid().ToString();
|
|
|
|
entity.GID = Guid.NewGuid().ToString();
|
|
|
|
|
|
|
|
entity.CreateTime = DateTime.Now;
|
|
|
|
|
|
|
|
entity.CreateUser = UserManager.DjyUserId;
|
|
|
|
await _codeVesselRep.InsertAsync(entity);
|
|
|
|
await _codeVesselRep.InsertAsync(entity);
|
|
|
|
await GetAllVessel();
|
|
|
|
await GetAllVessel();
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -195,17 +213,20 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
|
|
|
|
/// 新增编辑船名映射信息
|
|
|
|
/// 新增编辑船名映射信息
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
[HttpPost("/commondb/addorupdatevessel")]
|
|
|
|
[HttpPost("/commondb/addorupdatevessel")]
|
|
|
|
public async Task AddOrUpdateMappingVessel([FromBody] MappingVessel dto)
|
|
|
|
public async Task AddOrUpdateMappingVessel([FromBody] MappingVesselDto dto)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var entity = dto.Adapt<MappingVessel>();
|
|
|
|
var entity = dto.Adapt<MappingVessel>();
|
|
|
|
if (string.IsNullOrWhiteSpace(dto.GID))
|
|
|
|
if (string.IsNullOrWhiteSpace(dto.GID))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
entity.GID = Guid.NewGuid().ToString();
|
|
|
|
entity.GID = Guid.NewGuid().ToString();
|
|
|
|
|
|
|
|
entity.CreateTime = DateTime.Now;
|
|
|
|
|
|
|
|
entity.CreateUser = UserManager.DjyUserId;
|
|
|
|
await _mappingVesselRep.InsertAsync(entity);
|
|
|
|
await _mappingVesselRep.InsertAsync(entity);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
entity.ModifyTime = DateTime.Now;
|
|
|
|
|
|
|
|
entity.ModifyUser = UserManager.DjyUserId;
|
|
|
|
await _mappingVesselRep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
|
|
|
|
await _mappingVesselRep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -232,10 +253,12 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
|
|
|
|
/// 新增船代信息
|
|
|
|
/// 新增船代信息
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
[HttpPost("/commondb/addforwarder")]
|
|
|
|
[HttpPost("/commondb/addforwarder")]
|
|
|
|
public async Task AddForwarder([FromBody] CodeForwarder dto)
|
|
|
|
public async Task AddForwarder([FromBody] CodeForwarderDto dto)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var entity = dto.Adapt<CodeForwarder>();
|
|
|
|
var entity = dto.Adapt<CodeForwarder>();
|
|
|
|
entity.GID = Guid.NewGuid().ToString();
|
|
|
|
entity.GID = Guid.NewGuid().ToString();
|
|
|
|
|
|
|
|
entity.CreateTime = DateTime.Now;
|
|
|
|
|
|
|
|
entity.CreateUser = UserManager.DjyUserId;
|
|
|
|
await _codeForwarderRep.InsertAsync(entity);
|
|
|
|
await _codeForwarderRep.InsertAsync(entity);
|
|
|
|
await GetAllForwarder();
|
|
|
|
await GetAllForwarder();
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -259,10 +282,12 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
|
|
|
|
/// 新增场站信息
|
|
|
|
/// 新增场站信息
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
[HttpPost("/commondb/addyard")]
|
|
|
|
[HttpPost("/commondb/addyard")]
|
|
|
|
public async Task AddYard([FromBody] CodeYard dto)
|
|
|
|
public async Task AddYard([FromBody] CodeYardDto dto)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var entity = dto.Adapt<CodeYard>();
|
|
|
|
var entity = dto.Adapt<CodeYard>();
|
|
|
|
entity.GID = Guid.NewGuid().ToString();
|
|
|
|
entity.GID = Guid.NewGuid().ToString();
|
|
|
|
|
|
|
|
entity.CreateTime = DateTime.Now;
|
|
|
|
|
|
|
|
entity.CreateUser = UserManager.DjyUserId;
|
|
|
|
await _codeYardRep.InsertAsync(entity);
|
|
|
|
await _codeYardRep.InsertAsync(entity);
|
|
|
|
await GetAllYard();
|
|
|
|
await GetAllYard();
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -291,16 +316,20 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
|
|
|
|
/// 新增编辑场站映射信息
|
|
|
|
/// 新增编辑场站映射信息
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
[HttpPost("/commondb/addorupdatemappingyard")]
|
|
|
|
[HttpPost("/commondb/addorupdatemappingyard")]
|
|
|
|
public async Task AddOrUpdateMappingYard([FromBody] MappingYard dto)
|
|
|
|
public async Task AddOrUpdateMappingYard([FromBody] MappingYardDto dto)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var entity = dto.Adapt<MappingYard>();
|
|
|
|
var entity = dto.Adapt<MappingYard>();
|
|
|
|
if (string.IsNullOrWhiteSpace(dto.GID))
|
|
|
|
if (string.IsNullOrWhiteSpace(dto.GID))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
entity.GID = Guid.NewGuid().ToString();
|
|
|
|
entity.GID = Guid.NewGuid().ToString();
|
|
|
|
|
|
|
|
entity.CreateTime = DateTime.Now;
|
|
|
|
|
|
|
|
entity.CreateUser = UserManager.DjyUserId;
|
|
|
|
await _mappingYardRep.InsertAsync(entity);
|
|
|
|
await _mappingYardRep.InsertAsync(entity);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
entity.ModifyTime = DateTime.Now;
|
|
|
|
|
|
|
|
entity.ModifyUser = UserManager.DjyUserId;
|
|
|
|
await _mappingYardRep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
|
|
|
|
await _mappingYardRep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
await GetAllMappingYard();
|
|
|
|
await GetAllMappingYard();
|
|
|
@ -328,13 +357,62 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
|
|
|
|
/// 新增起始港信息
|
|
|
|
/// 新增起始港信息
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
[HttpPost("/commondb/addportload")]
|
|
|
|
[HttpPost("/commondb/addportload")]
|
|
|
|
public async Task AddPortload([FromBody] CodePortLoad dto)
|
|
|
|
public async Task AddPortload([FromBody] CodePortLoadDto dto)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var entity = dto.Adapt<CodePortLoad>();
|
|
|
|
var entity = dto.Adapt<CodePortLoad>();
|
|
|
|
entity.GID = Guid.NewGuid().ToString();
|
|
|
|
entity.GID = Guid.NewGuid().ToString();
|
|
|
|
|
|
|
|
entity.CreateTime = DateTime.Now;
|
|
|
|
|
|
|
|
entity.CreateUser = UserManager.DjyUserId;
|
|
|
|
await _codePortLoadrRep.InsertAsync(entity);
|
|
|
|
await _codePortLoadrRep.InsertAsync(entity);
|
|
|
|
await GetAllPortload();
|
|
|
|
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
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 目的港
|
|
|
|
#region 目的港
|
|
|
@ -362,14 +440,57 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
|
|
|
|
/// 新增目的港信息
|
|
|
|
/// 新增目的港信息
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
[HttpPost("/commondb/addport")]
|
|
|
|
[HttpPost("/commondb/addport")]
|
|
|
|
public async Task AddPort([FromBody] CodePort dto)
|
|
|
|
public async Task AddPort([FromBody] CodePortDto dto)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var entity = dto.Adapt<CodePort>();
|
|
|
|
var entity = dto.Adapt<CodePort>();
|
|
|
|
entity.GID = Guid.NewGuid().ToString();
|
|
|
|
entity.GID = Guid.NewGuid().ToString();
|
|
|
|
|
|
|
|
entity.CreateTime = DateTime.Now;
|
|
|
|
|
|
|
|
entity.CreateUser = UserManager.DjyUserId;
|
|
|
|
await _codePortRep.InsertAsync(entity);
|
|
|
|
await _codePortRep.InsertAsync(entity);
|
|
|
|
await GetAllPort();
|
|
|
|
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
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
@ -390,7 +511,7 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
|
|
|
|
/// 新增包装信息
|
|
|
|
/// 新增包装信息
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
[HttpPost("/commondb/addpackage")]
|
|
|
|
[HttpPost("/commondb/addpackage")]
|
|
|
|
public async Task AddPackage([FromBody] CodePackage dto)
|
|
|
|
public async Task AddPackage([FromBody] CodePackageDto dto)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var entity = dto.Adapt<CodePackage>();
|
|
|
|
var entity = dto.Adapt<CodePackage>();
|
|
|
|
entity.GID = Guid.NewGuid().ToString();
|
|
|
|
entity.GID = Guid.NewGuid().ToString();
|
|
|
@ -398,6 +519,49 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
|
|
|
|
await GetAllPackage();
|
|
|
|
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
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 运输条款
|
|
|
|
#region 运输条款
|
|
|
@ -418,14 +582,58 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
|
|
|
|
/// 新增运输条款
|
|
|
|
/// 新增运输条款
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
[HttpPost("/commondb/addservice")]
|
|
|
|
[HttpPost("/commondb/addservice")]
|
|
|
|
public async Task AddService([FromBody] CodeService dto)
|
|
|
|
public async Task AddService([FromBody] CodeServiceDto dto)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var entity = dto.Adapt<CodeService>();
|
|
|
|
var entity = dto.Adapt<CodeService>();
|
|
|
|
entity.GID = Guid.NewGuid().ToString();
|
|
|
|
entity.GID = Guid.NewGuid().ToString();
|
|
|
|
|
|
|
|
entity.CreateTime = DateTime.Now;
|
|
|
|
|
|
|
|
entity.CreateUser = UserManager.DjyUserId;
|
|
|
|
await _codeServiceRep.InsertAsync(entity);
|
|
|
|
await _codeServiceRep.InsertAsync(entity);
|
|
|
|
await GetAllService();
|
|
|
|
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
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
@ -448,9 +656,11 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
|
|
|
|
/// 新增箱型
|
|
|
|
/// 新增箱型
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
[HttpPost("/commondb/addctn")]
|
|
|
|
[HttpPost("/commondb/addctn")]
|
|
|
|
public async Task AddCtn([FromBody] CodeCtn dto)
|
|
|
|
public async Task AddCtn([FromBody] CodeCtnDto dto)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var entity = dto.Adapt<CodeCtn>();
|
|
|
|
var entity = dto.Adapt<CodeCtn>();
|
|
|
|
|
|
|
|
entity.CreateTime = DateTime.Now;
|
|
|
|
|
|
|
|
entity.CreateUser = UserManager.DjyUserId;
|
|
|
|
entity.GID = Guid.NewGuid().ToString();
|
|
|
|
entity.GID = Guid.NewGuid().ToString();
|
|
|
|
await _codeCtnRep.InsertAsync(entity);
|
|
|
|
await _codeCtnRep.InsertAsync(entity);
|
|
|
|
await GetAllCtn();
|
|
|
|
await GetAllCtn();
|
|
|
@ -478,17 +688,20 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
|
|
|
|
/// 新增编辑箱型映射信息
|
|
|
|
/// 新增编辑箱型映射信息
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
[HttpPost("/commondb/addmappingctn")]
|
|
|
|
[HttpPost("/commondb/addmappingctn")]
|
|
|
|
public async Task AddOrUpdateMappingCtn([FromBody] MappingCtn dto)
|
|
|
|
public async Task AddOrUpdateMappingCtn([FromBody] MappingCtnDto dto)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var entity = dto.Adapt<MappingCtn>();
|
|
|
|
var entity = dto.Adapt<MappingCtn>();
|
|
|
|
if (string.IsNullOrWhiteSpace(dto.GID))
|
|
|
|
if (string.IsNullOrWhiteSpace(dto.GID))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
entity.GID = Guid.NewGuid().ToString();
|
|
|
|
entity.GID = Guid.NewGuid().ToString();
|
|
|
|
|
|
|
|
entity.CreateTime = DateTime.Now;
|
|
|
|
|
|
|
|
entity.CreateUser = UserManager.DjyUserId;
|
|
|
|
await _mappingCtnRep.InsertAsync(entity);
|
|
|
|
await _mappingCtnRep.InsertAsync(entity);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
entity.ModifyTime = DateTime.Now;
|
|
|
|
|
|
|
|
entity.ModifyUser = UserManager.DjyUserId;
|
|
|
|
await _mappingCtnRep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
|
|
|
|
await _mappingCtnRep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -516,10 +729,12 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
|
|
|
|
/// 新增付费方式
|
|
|
|
/// 新增付费方式
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
[HttpPost("/commondb/addfrt")]
|
|
|
|
[HttpPost("/commondb/addfrt")]
|
|
|
|
public async Task AddFrt([FromBody] CodeFrt dto)
|
|
|
|
public async Task AddFrt([FromBody] CodeFrtDto dto)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var entity = dto.Adapt<CodeFrt>();
|
|
|
|
var entity = dto.Adapt<CodeFrt>();
|
|
|
|
entity.GID = Guid.NewGuid().ToString();
|
|
|
|
entity.GID = Guid.NewGuid().ToString();
|
|
|
|
|
|
|
|
entity.CreateTime = DateTime.Now;
|
|
|
|
|
|
|
|
entity.CreateUser = UserManager.DjyUserId;
|
|
|
|
await _codeFrtRep.InsertAsync(entity);
|
|
|
|
await _codeFrtRep.InsertAsync(entity);
|
|
|
|
await GetAllFrt();
|
|
|
|
await GetAllFrt();
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -545,16 +760,20 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
|
|
|
|
/// 新增编辑付费映射信息
|
|
|
|
/// 新增编辑付费映射信息
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
[HttpPost("/commondb/addmappingfrt")]
|
|
|
|
[HttpPost("/commondb/addmappingfrt")]
|
|
|
|
public async Task AddOrUpdateMappingFrt([FromBody] MappingFrt dto)
|
|
|
|
public async Task AddOrUpdateMappingFrt([FromBody] MappingFrtDto dto)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var entity = dto.Adapt<MappingFrt>();
|
|
|
|
var entity = dto.Adapt<MappingFrt>();
|
|
|
|
if (string.IsNullOrWhiteSpace(dto.GID))
|
|
|
|
if (string.IsNullOrWhiteSpace(dto.GID))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
entity.GID = Guid.NewGuid().ToString();
|
|
|
|
entity.GID = Guid.NewGuid().ToString();
|
|
|
|
|
|
|
|
entity.CreateTime = DateTime.Now;
|
|
|
|
|
|
|
|
entity.CreateUser = UserManager.DjyUserId;
|
|
|
|
await _mappingFrtRep.InsertAsync(entity);
|
|
|
|
await _mappingFrtRep.InsertAsync(entity);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
entity.ModifyTime = DateTime.Now;
|
|
|
|
|
|
|
|
entity.ModifyUser = UserManager.DjyUserId;
|
|
|
|
await _mappingFrtRep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
|
|
|
|
await _mappingFrtRep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
await GetAllMappingFrt();
|
|
|
|
await GetAllMappingFrt();
|
|
|
@ -701,6 +920,45 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
|
|
|
|
return 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
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|