booking_auth_dev
jianghaiqing 2 years ago
commit 2d17d6289a

@ -0,0 +1,120 @@
using Furion.FriendlyException;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Application.Enum
{
[ErrorCodeType]
public enum BookingErrorCode
{
#region 订舱
/// <summary>
/// 订舱数据不存在
/// </summary>
[ErrorCodeItemMetadata("订舱数据不存在")]
BOOK001,
/// <summary>
/// 已存在同类型且名称相同的收发通模板
/// </summary>
[ErrorCodeItemMetadata("已存在同类型且名称相同的收发通模板")]
BOOK101,
/// <summary>
/// 收发通模板不存在
/// </summary>
[ErrorCodeItemMetadata("收发通模板不存在")]
BOOK111,
/// <summary>
/// 打印模板不存在
/// </summary>
[ErrorCodeItemMetadata("打印模板不存在")]
BOOK112,
/// <summary>
/// 未上传模板文件
/// </summary>
[ErrorCodeItemMetadata("未上传模板文件")]
BOOK113,
/// <summary>
/// 不允许的文件类型
/// </summary>
[ErrorCodeItemMetadata("不允许的文件类型")]
BOOK114,
/// <summary>
/// 模板文件不存在
/// </summary>
[ErrorCodeItemMetadata("模板文件不存在")]
BOOK115,
/// <summary>
/// 放舱信息不存在
/// </summary>
[ErrorCodeItemMetadata("放舱信息不存在")]
BOOK116,
/// <summary>
/// 不支持的船公司
/// </summary>
[ErrorCodeItemMetadata("不支持的船公司")]
BOOK117,
/// <summary>
/// 船公司未正确填写
/// </summary>
[ErrorCodeItemMetadata("船公司未正确填写")]
BOOK118,
/// <summary>
/// 亿通账号未正确配置
/// </summary>
[ErrorCodeItemMetadata("亿通账号未正确配置")]
BOOK119,
/// <summary>
/// 场站EDI配置未找到
/// </summary>
[ErrorCodeItemMetadata("场站EDI配置未找到{0}")]
BOOK120,
/// <summary>
/// 所有箱型箱量必须录入完整
/// </summary>
[ErrorCodeItemMetadata("所有箱型箱量必须录入完整")]
BOOK121,
/// <summary>
/// 箱型EDI配置未找到
/// </summary>
[ErrorCodeItemMetadata("箱型EDI配置未找到")]
BOOK122,
/// <summary>
/// 箱型EDI配置未找到
/// </summary>
[ErrorCodeItemMetadata("箱型EDI配置未找到{0}")]
BOOK123,
/// <summary>
/// 提箱小票链接生成失败
/// </summary>
[ErrorCodeItemMetadata("提箱小票链接生成失败:{0}")]
BOOK124,
/// <summary>
/// 附件不存在
/// </summary>
[ErrorCodeItemMetadata("附件不存在")]
BOOK200,
#endregion
}
}

@ -2511,6 +2511,91 @@
运踪id
</summary>
</member>
<member name="F:Myshipping.Application.Enum.BookingErrorCode.BOOK001">
<summary>
订舱数据不存在
</summary>
</member>
<member name="F:Myshipping.Application.Enum.BookingErrorCode.BOOK101">
<summary>
已存在同类型且名称相同的收发通模板
</summary>
</member>
<member name="F:Myshipping.Application.Enum.BookingErrorCode.BOOK111">
<summary>
收发通模板不存在
</summary>
</member>
<member name="F:Myshipping.Application.Enum.BookingErrorCode.BOOK112">
<summary>
打印模板不存在
</summary>
</member>
<member name="F:Myshipping.Application.Enum.BookingErrorCode.BOOK113">
<summary>
未上传模板文件
</summary>
</member>
<member name="F:Myshipping.Application.Enum.BookingErrorCode.BOOK114">
<summary>
不允许的文件类型
</summary>
</member>
<member name="F:Myshipping.Application.Enum.BookingErrorCode.BOOK115">
<summary>
模板文件不存在
</summary>
</member>
<member name="F:Myshipping.Application.Enum.BookingErrorCode.BOOK116">
<summary>
放舱信息不存在
</summary>
</member>
<member name="F:Myshipping.Application.Enum.BookingErrorCode.BOOK117">
<summary>
不支持的船公司
</summary>
</member>
<member name="F:Myshipping.Application.Enum.BookingErrorCode.BOOK118">
<summary>
船公司未正确填写
</summary>
</member>
<member name="F:Myshipping.Application.Enum.BookingErrorCode.BOOK119">
<summary>
亿通账号未正确配置
</summary>
</member>
<member name="F:Myshipping.Application.Enum.BookingErrorCode.BOOK120">
<summary>
场站EDI配置未找到
</summary>
</member>
<member name="F:Myshipping.Application.Enum.BookingErrorCode.BOOK121">
<summary>
所有箱型箱量必须录入完整
</summary>
</member>
<member name="F:Myshipping.Application.Enum.BookingErrorCode.BOOK122">
<summary>
箱型EDI配置未找到
</summary>
</member>
<member name="F:Myshipping.Application.Enum.BookingErrorCode.BOOK123">
<summary>
箱型EDI配置未找到
</summary>
</member>
<member name="F:Myshipping.Application.Enum.BookingErrorCode.BOOK124">
<summary>
提箱小票链接生成失败
</summary>
</member>
<member name="F:Myshipping.Application.Enum.BookingErrorCode.BOOK200">
<summary>
附件不存在
</summary>
</member>
<member name="T:Myshipping.Application.BookingCtnDetailDto">
<summary>
多品名输出参数
@ -3363,6 +3448,13 @@
<param name="type">类型1pdf、2xlsx</param>
<returns></returns>
</member>
<member name="M:Myshipping.Application.BookingOrderService.TxxpLink(System.Int64)">
<summary>
获取提箱小票链接
</summary>
<param name="bookingId"></param>
<returns></returns>
</member>
<member name="M:Myshipping.Application.BookingOrderService.GenReportJson(System.Int64)">
<summary>
获取用户报表的json

@ -35,6 +35,7 @@ using System.Text;
using System.Web;
using Newtonsoft.Json.Linq;
using Myshipping.Core.Helper;
using Myshipping.Application.Enum;
namespace Myshipping.Application
{
@ -61,13 +62,15 @@ namespace Myshipping.Application
private readonly SqlSugarRepository<BookingPrintTemplate> _repPrintTemplate;
private readonly SqlSugarRepository<BookingLetteryard> _repLetterYard;
private readonly SqlSugarRepository<SysUser> _repUser;
private readonly SqlSugarRepository<BookingOrderUrl> _repOrderUrl;
public BookingOrderService(SqlSugarRepository<BookingOrder> rep, SqlSugarRepository<BookingCtn> repCtn, SqlSugarRepository<BookingCtnDetail> ctndetailrep,
SqlSugarRepository<BookingLog> bookinglog, SqlSugarRepository<BookingLogDetail> bookinglogdetail, SqlSugarRepository<BookingRemark> bookingremark,
SqlSugarRepository<BookingFile> bookingfile, SqlSugarRepository<DjyWebsiteAccountConfig> webconfig, SqlSugarRepository<BookingPrintTemplate> repPrint,
SqlSugarRepository<SysDictData> dicdata, SqlSugarRepository<BookingStatusLog> statuslog, SqlSugarRepository<BookingStatusLogDetail> statuslogdetail,
ILogger<BookingOrderService> logger, ISysCacheService cache,
SqlSugarRepository<BookingPrintTemplate> repPrintTemplate, SqlSugarRepository<BookingLetteryard> repLetterYard, SqlSugarRepository<SysUser> repUser)
SqlSugarRepository<BookingPrintTemplate> repPrintTemplate, SqlSugarRepository<BookingLetteryard> repLetterYard, SqlSugarRepository<SysUser> repUser,
SqlSugarRepository<BookingOrderUrl> repOrderUrl)
{
this._logger = logger;
this._rep = rep;
@ -86,6 +89,7 @@ namespace Myshipping.Application
this._repPrintTemplate = repPrintTemplate;
this._repLetterYard = repLetterYard;
this._repUser = repUser;
this._repOrderUrl = repOrderUrl;
}
#region 主表和箱信息
@ -471,7 +475,7 @@ namespace Myshipping.Application
//未上传打印模板文件
if (file == null || file.Length == 0)
{
throw Oops.Oh(ErrorCode.BOOK113);
throw Oops.Oh(BookingErrorCode.BOOK200);
}
var opt = App.GetOptions<BookingAttachOptions>();
@ -479,7 +483,7 @@ namespace Myshipping.Application
var fileSuffix = Path.GetExtension(file.FileName).ToLower(); // 文件后缀
if (!opt.fileType.Contains(fileSuffix))
{
throw Oops.Oh(ErrorCode.BOOK114);
throw Oops.Oh(BookingErrorCode.BOOK114);
}
var dirAbs = string.Empty;
@ -509,7 +513,7 @@ namespace Myshipping.Application
TypeCode = dto.TypeCode,
TypeName = dto.TypeName,
TenantId = Convert.ToInt16(UserManager.TENANT_ID),
TenantName = UserManager.CLAINM_TENANT_NAME,
TenantName = UserManager.TENANT_NAME,
};
await _bookingfile.InsertAsync(newFile);
using (var stream = File.Create(fileAbsPath))
@ -722,19 +726,19 @@ namespace Myshipping.Application
var order = _rep.FirstOrDefault(x => x.Id == bookingId);
if (order == null)
{
throw Oops.Oh(ErrorCode.BOOK001);
throw Oops.Oh(BookingErrorCode.BOOK001);
}
var letterYard = await _repLetterYard.FirstOrDefaultAsync(x => x.BookingId == bookingId);
if (letterYard == null)
{
throw Oops.Oh(ErrorCode.BOOK116);
throw Oops.Oh(BookingErrorCode.BOOK116);
}
var printTemplate = _repPrintTemplate.FirstOrDefault(x => x.TenantId == letterYard.TenantId && x.TypeCode == "fangcang");
if (printTemplate == null)
{
throw Oops.Oh(ErrorCode.BOOK115);
throw Oops.Oh(BookingErrorCode.BOOK115);
}
var opt = App.GetOptions<PrintTemplateOptions>();
@ -747,7 +751,7 @@ namespace Myshipping.Application
var fileAbsPath = Path.Combine(dirAbs, printTemplate.FilePath);
if (!File.Exists(fileAbsPath))
{
throw Oops.Oh(ErrorCode.BOOK115);
throw Oops.Oh(BookingErrorCode.BOOK115);
}
_logger.LogInformation($"准备调用报表生成放舱id{bookingId},文件:{printTemplate.FileName}");
@ -784,6 +788,146 @@ namespace Myshipping.Application
#endregion
#region 小票链接
/// <summary>
/// 获取提箱小票链接
/// </summary>
/// <param name="bookingId"></param>
/// <returns></returns>
[HttpGet("/BookingOrder/txxplink")]
public async Task<string> TxxpLink(long bookingId)
{
var order = _rep.FirstOrDefault(x => x.Id == bookingId);
if (order == null)
{
throw Oops.Oh(BookingErrorCode.BOOK001);
}
var ordUrl = _repOrderUrl.FirstOrDefault(x => x.BookingId == bookingId);
if (ordUrl == null)
{
ordUrl = new BookingOrderUrl();
ordUrl.BookingId = bookingId;
await _repOrderUrl.InsertAsync(ordUrl);
}
if (!string.IsNullOrEmpty(ordUrl.UrlTxxp))
{
return ordUrl.UrlTxxp;
}
//校验船公司
if (string.IsNullOrEmpty(order.CARRIERID))
{
throw Oops.Oh(BookingErrorCode.BOOK118);
}
//判断船公司是否支持
var allowCarrier = _cache.GetAllDictData().Result.Where(x => x.TypeCode == "txxp_carrier_list").Select(x => x.Code).ToList();
if (!allowCarrier.Contains(order.CARRIERID))
{
throw Oops.Oh(BookingErrorCode.BOOK117);
}
//亿通账号
var ytAcc = _webconfig.FirstOrDefault(x => x.CreatedUserId == UserManager.UserId && x.TypeCode == "YitongWeb");
if (ytAcc == null)
{
throw Oops.Oh(BookingErrorCode.BOOK119);
}
//场站转换
var yardset = _cache.GetAllMappingYard().Result.FirstOrDefault(y => y.Code == order.YARDID && y.Module == "BookingTxxp");
if (yardset == null)
{
throw Oops.Oh(BookingErrorCode.BOOK120, order.YARDID);
}
var ctns = await _repCtn.Where(x => x.BILLID == bookingId).ToListAsync();
//校验箱子数据录入
if (ctns.Where(c => string.IsNullOrEmpty(c.CTNALL) || !c.CTNNUM.HasValue).Count() > 0)
{
throw Oops.Oh(BookingErrorCode.BOOK121);
}
//箱型映射
var ctnMapping = await _cache.GetAllMappingCtn();
ctnMapping = ctnMapping.Where(x => x.Module == "BookingTxxp").ToList();
if (ctnMapping.Count == 0)
{
throw Oops.Oh(BookingErrorCode.BOOK122);
}
var expCode = ctns.Select(x => x.CTNCODE).Distinct().Except(ctnMapping.Select(y => y.Code)).ToList();
if (expCode.Count > 0)
{
throw Oops.Oh(BookingErrorCode.BOOK123, string.Join(',', expCode));
}
var user = await _repUser.FirstOrDefaultAsync(x => x.Id == UserManager.UserId);
//调用小票服务
var dicUrlTxxp = _cache.GetAllDictData().Result.First(x => x.TypeCode == "url_set" && x.Code == "txxp_service");
var postObj = new
{
SystemCode = "djy_hechuan",
CarrierCode = order.CARRIERID,
billOrderId = order.Id.ToString(),
sendOrderCode = order.MBLNO,
userId = UserManager.DjyUserId,
customerId = order.CUSTOMERID.ToString(),
// userName = currUser.CODENAME,
//userPassword = currUser.PASSWORD,
operatorName = UserManager.Name,
depotCode = yardset.MapCode,
depotName = yardset.MapName,
AgentName = UserManager.TENANT_NAME,
linkName = UserManager.Name,
linkMobile = user.Tel,
CustomerName = $"{UserManager.TENANT_NAME}+{UserManager.Name}", //公司名称+用户姓名
memo = string.Empty,
boxInfo = ctns.Select(c =>
{
return new
{
boxType = ctnMapping.First(x => x.Code == c.CTNCODE).MapCode,
boxCount = c.CTNNUM.Value
};
}),
sysLoginName = ytAcc.Account,
sysPsssword = ytAcc.Password
};
string strPostObj = postObj.ToJsonString();
_logger.LogInformation($"调用提箱小票接口传递数据:{strPostObj}");
var strResp = await dicUrlTxxp.Value.SetBody(postObj).PostAsStringAsync();
_logger.LogInformation($"调用提箱小票接口返回:{strResp}");
var jobjResp = JObject.Parse(strResp);
int respCode = jobjResp.GetIntValue("code");
if (respCode != 200)
{
throw Oops.Oh(BookingErrorCode.BOOK124, jobjResp.GetStringValue("message"));
}
//保存url
var txxpUrl = jobjResp.GetStringValue("data");
ordUrl.UrlTxxp = txxpUrl;
await _repOrderUrl.UpdateAsync(ordUrl);
return txxpUrl;
}
#endregion
#region VGM及VMG链接
#endregion
#region 订舱、截单EDI
#endregion
#region 其他
/// <summary>
/// 获取用户报表的json
@ -826,14 +970,14 @@ namespace Myshipping.Application
var order = _rep.FirstOrDefault(x => x.Id == id);
if (order == null)
{
throw Oops.Oh(ErrorCode.BOOK001);
throw Oops.Oh(BookingErrorCode.BOOK001);
}
//打印模板
var printTemplate = _repPrint.FirstOrDefault(x => x.TenantId == order.TenantId && x.TypeCode == type);
if (printTemplate == null)
{
throw Oops.Oh(ErrorCode.BOOK112);
throw Oops.Oh(BookingErrorCode.BOOK112);
}
//读取配置路劲
@ -848,7 +992,7 @@ namespace Myshipping.Application
var fileAbsPath = Path.Combine(dirAbs, printTemplate.FilePath).ToLower();
if (!File.Exists(fileAbsPath))
{
throw Oops.Oh(ErrorCode.BOOK112);
throw Oops.Oh(BookingErrorCode.BOOK112);
}
_logger.LogInformation($"准备调用报表生成id{id},文件:{printTemplate.FileName}");

@ -17,6 +17,7 @@ using Furion.FriendlyException;
using Furion.RemoteRequest.Extensions;
using System.Text;
using System.Web;
using Myshipping.Application.Enum;
namespace Myshipping.Application
{
@ -63,7 +64,7 @@ namespace Myshipping.Application
//未上传打印模板文件
if (file == null || file.Length == 0)
{
throw Oops.Oh(ErrorCode.BOOK113);
throw Oops.Oh(BookingErrorCode.BOOK113);
}
var opt = App.GetOptions<PrintTemplateOptions>();
@ -71,7 +72,7 @@ namespace Myshipping.Application
var fileSuffix = Path.GetExtension(file.FileName).ToLower(); // 文件后缀
if (!opt.fileType.Contains(fileSuffix))
{
throw Oops.Oh(ErrorCode.BOOK114);
throw Oops.Oh(BookingErrorCode.BOOK114);
}
var dirAbs = string.Empty;
@ -123,7 +124,7 @@ namespace Myshipping.Application
//未上传打印模板文件
if (file == null || file.Length == 0)
{
throw Oops.Oh(ErrorCode.BOOK113);
throw Oops.Oh(BookingErrorCode.BOOK113);
}
var opt = App.GetOptions<PrintTemplateOptions>();
@ -131,14 +132,14 @@ namespace Myshipping.Application
var fileSuffix = Path.GetExtension(file.FileName).ToLower(); // 文件后缀
if (!opt.fileType.Contains(fileSuffix))
{
throw Oops.Oh(ErrorCode.BOOK114);
throw Oops.Oh(BookingErrorCode.BOOK114);
}
_rep.Context.QueryFilter.Clear();
var entity = _rep.FirstOrDefault(x => x.Id == input.Id);
if (entity == null)
{
throw Oops.Oh(ErrorCode.BOOK112);
throw Oops.Oh(BookingErrorCode.BOOK112);
}
entity = input.Adapt(entity);
@ -218,7 +219,7 @@ namespace Myshipping.Application
var printFile = await _rep.FirstOrDefaultAsync(u => u.Id == id);
if (printFile == null)
{
throw Oops.Oh(ErrorCode.BOOK115);
throw Oops.Oh(BookingErrorCode.BOOK115);
}
@ -232,7 +233,7 @@ namespace Myshipping.Application
var fileFullPath = Path.Combine(dirAbs, printFile.FilePath);
if (!File.Exists(fileFullPath))
{
throw Oops.Oh(ErrorCode.BOOK115);
throw Oops.Oh(BookingErrorCode.BOOK115);
}
var fileName = HttpUtility.UrlEncode(printFile.FileName, Encoding.GetEncoding("UTF-8"));

@ -9,6 +9,7 @@ using System.Threading.Tasks;
using Myshipping.Application.Entity;
using Microsoft.Extensions.Logging;
using Furion.FriendlyException;
using Myshipping.Application.Enum;
namespace Myshipping.Application
{
@ -53,7 +54,7 @@ namespace Myshipping.Application
var c = _rep.Count(x => x.Type == input.Type && x.Title == input.Title);
if (c > 0)
{
throw Oops.Oh(ErrorCode.BOOK101);
throw Oops.Oh(BookingErrorCode.BOOK101);
}
var entity = input.Adapt<BookingTemplate>();
@ -71,7 +72,7 @@ namespace Myshipping.Application
var bt = _rep.FirstOrDefault(x => x.Id == input.Id);
if (bt == null)
{
throw Oops.Oh(ErrorCode.BOOK111);
throw Oops.Oh(BookingErrorCode.BOOK111);
}
bt.Content = input.Content;

@ -115,13 +115,18 @@ public class CommonConst
/// </summary>
public const string CACHE_KEY_COMMON_DB_MAPPING_VESSEL = "CommonDbMappingVessel";
/// <summary>
/// 场站映射
/// </summary>
public const string CACHE_KEY_COMMON_DB_MAPPING_YARD = "CommonDbMappingYard";
/// <summary>
/// 字典映射
/// </summary>
public const string CACHE_KEY_COMMON_DB_DICT_DATA = "DictDataList";
/// <summary>
/// 船名映射
/// EDI映射
/// </summary>
public const string CACHE_KEY_DJY_EDI_SETTING = "DjyEdiSetting";

@ -32,26 +32,39 @@ namespace Myshipping.Core.Entity
/// </summary>
public string Remark { get; set; }
}
[SugarTable("MappingYard")]
[Description("场站映射")]
public class MappingYard : CommonDbEntity
{
/// <summary>
/// 创建时间
/// 代码
/// </summary>
public DateTime CreateTime { get; set; }
public string Code { get; set; }
/// <summary>
/// 修改时间
/// 模块
/// </summary>
public DateTime? ModifyTime { get; set; }
public string Module { get; set; }
/// <summary>
/// 创建人
/// 映射代码
/// </summary>
public string CreateUser { get; set; }
public string MapCode { get; set; }
/// <summary>
/// 修改人
/// 映射名称
/// </summary>
public string ModifyUser { get; set; }
public string MapName { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
}
}

@ -405,56 +405,6 @@ public enum ErrorCode
F1000,
#region 订舱
/// <summary>
/// 订舱数据不存在
/// </summary>
[ErrorCodeItemMetadata("订舱数据不存在")]
BOOK001,
/// <summary>
/// 已存在同类型且名称相同的收发通模板
/// </summary>
[ErrorCodeItemMetadata("已存在同类型且名称相同的收发通模板")]
BOOK101,
/// <summary>
/// 收发通模板不存在
/// </summary>
[ErrorCodeItemMetadata("收发通模板不存在")]
BOOK111,
/// <summary>
/// 打印模板不存在
/// </summary>
[ErrorCodeItemMetadata("打印模板不存在")]
BOOK112,
/// <summary>
/// 未上传模板文件
/// </summary>
[ErrorCodeItemMetadata("未上传模板文件")]
BOOK113,
/// <summary>
/// 不允许的文件类型
/// </summary>
[ErrorCodeItemMetadata("不允许的文件类型")]
BOOK114,
/// <summary>
/// 模板文件不存在
/// </summary>
[ErrorCodeItemMetadata("模板文件不存在")]
BOOK115,
/// <summary>
/// 放舱信息不存在
/// </summary>
[ErrorCodeItemMetadata("放舱信息不存在")]
BOOK116,
#endregion
#region 邮箱账号

@ -40,7 +40,7 @@ public static class UserManager
/// <summary>
/// 租户名称
/// </summary>
public static string CLAINM_TENANT_NAME => App.User.FindFirst(ClaimConst.CLAINM_TENANT_NAME)?.Value;
public static string TENANT_NAME => App.User.FindFirst(ClaimConst.CLAINM_TENANT_NAME)?.Value;
/// <summary>
/// 大简云userid

@ -652,6 +652,11 @@
船名映射
</summary>
</member>
<member name="F:Myshipping.Core.CommonConst.CACHE_KEY_COMMON_DB_MAPPING_YARD">
<summary>
场站映射
</summary>
</member>
<member name="F:Myshipping.Core.CommonConst.CACHE_KEY_COMMON_DB_DICT_DATA">
<summary>
字典映射
@ -659,7 +664,7 @@
</member>
<member name="F:Myshipping.Core.CommonConst.CACHE_KEY_DJY_EDI_SETTING">
<summary>
船名映射
EDI映射
</summary>
</member>
<member name="F:Myshipping.Core.CommonConst.ENTITY_ASSEMBLY_NAME">
@ -1237,24 +1242,29 @@
备注
</summary>
</member>
<member name="P:Myshipping.Core.Entity.CodeYard.CreateTime">
<member name="P:Myshipping.Core.Entity.MappingYard.Code">
<summary>
创建时间
代码
</summary>
</member>
<member name="P:Myshipping.Core.Entity.CodeYard.ModifyTime">
<member name="P:Myshipping.Core.Entity.MappingYard.Module">
<summary>
修改时间
模块
</summary>
</member>
<member name="P:Myshipping.Core.Entity.CodeYard.CreateUser">
<member name="P:Myshipping.Core.Entity.MappingYard.MapCode">
<summary>
创建人
映射代码
</summary>
</member>
<member name="P:Myshipping.Core.Entity.CodeYard.ModifyUser">
<member name="P:Myshipping.Core.Entity.MappingYard.MapName">
<summary>
修改人
映射名称
</summary>
</member>
<member name="P:Myshipping.Core.Entity.MappingYard.Remark">
<summary>
备注
</summary>
</member>
<member name="P:Myshipping.Core.Entity.CommonDbEntity.GID">
@ -3880,46 +3890,6 @@
表单不存在
</summary>
</member>
<member name="F:Myshipping.Core.ErrorCode.BOOK001">
<summary>
订舱数据不存在
</summary>
</member>
<member name="F:Myshipping.Core.ErrorCode.BOOK101">
<summary>
已存在同类型且名称相同的收发通模板
</summary>
</member>
<member name="F:Myshipping.Core.ErrorCode.BOOK111">
<summary>
收发通模板不存在
</summary>
</member>
<member name="F:Myshipping.Core.ErrorCode.BOOK112">
<summary>
打印模板不存在
</summary>
</member>
<member name="F:Myshipping.Core.ErrorCode.BOOK113">
<summary>
未上传模板文件
</summary>
</member>
<member name="F:Myshipping.Core.ErrorCode.BOOK114">
<summary>
不允许的文件类型
</summary>
</member>
<member name="F:Myshipping.Core.ErrorCode.BOOK115">
<summary>
模板文件不存在
</summary>
</member>
<member name="F:Myshipping.Core.ErrorCode.BOOK116">
<summary>
放舱信息不存在
</summary>
</member>
<member name="F:Myshipping.Core.ErrorCode.EMAIL001">
<summary>
邮箱账号已存在
@ -4968,7 +4938,7 @@
租户ID
</summary>
</member>
<member name="P:Myshipping.Core.UserManager.CLAINM_TENANT_NAME">
<member name="P:Myshipping.Core.UserManager.TENANT_NAME">
<summary>
租户名称
</summary>
@ -5518,6 +5488,12 @@
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.ISysCacheService.GetAllMappingYard">
<summary>
获取公共库 场站映射
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.ISysCacheService.SetAllCodeCarrier(System.Collections.Generic.List{Myshipping.Core.Entity.CodeCarrier})">
<summary>
设置公共库 船公司
@ -5602,6 +5578,12 @@
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.ISysCacheService.SetAllMappingYard(System.Collections.Generic.List{Myshipping.Core.Entity.MappingYard})">
<summary>
设置公共库 场站映射
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.ISysCacheService.GetAllTenantParam">
<summary>
获取租户参数
@ -5899,6 +5881,12 @@
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.SysCacheService.GetAllMappingYard">
<summary>
获取公共库 船名映射
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.SysCacheService.SetAllCodeCarrier(System.Collections.Generic.List{Myshipping.Core.Entity.CodeCarrier})">
<summary>
设置公共库 船公司
@ -5983,6 +5971,12 @@
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.SysCacheService.SetAllMappingYard(System.Collections.Generic.List{Myshipping.Core.Entity.MappingYard})">
<summary>
设置公共库 场站映射
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.SysCacheService.GetAllTenantParam">
<summary>
获取租户参数
@ -6588,6 +6582,16 @@
新增场站信息
</summary>
</member>
<member name="M:Myshipping.Core.Service.CommonDBService.MappingYardList(Myshipping.Core.Service.MappingQueryDto)">
<summary>
获取场站映射
</summary>
</member>
<member name="M:Myshipping.Core.Service.CommonDBService.AddOrUpdateMappingYard(Myshipping.Core.Entity.MappingYard)">
<summary>
新增编辑场站映射信息
</summary>
</member>
<member name="M:Myshipping.Core.Service.CommonDBService.PortloadList(Myshipping.Core.Service.NameQueryDto)">
<summary>
获取起始港信息
@ -6719,6 +6723,12 @@
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.ICommonDBService.GetAllMappingYard">
<summary>
获取场站映射
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.ICommonDBService.GetAllPortload">
<summary>
获取起始港

@ -94,6 +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 },
});
// 设置Swagger自动登录
@ -148,6 +149,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 },
});
// 设置Swagger自动登录

@ -121,7 +121,11 @@ public interface ISysCacheService
Task<List<MappingVessel>> GetAllMappingVessel();
/// <summary>
/// 获取公共库 场站映射
/// </summary>
/// <returns></returns>
Task<List<MappingYard>> GetAllMappingYard();
/// <summary>
/// 设置公共库 船公司
/// </summary>
@ -204,6 +208,12 @@ public interface ISysCacheService
/// </summary>
/// <returns></returns>
Task SetAllMappingVessel(List<MappingVessel> list);
/// <summary>
/// 设置公共库 场站映射
/// </summary>
/// <returns></returns>
Task SetAllMappingYard(List<MappingYard> list);
#endregion
#region DJY

@ -418,7 +418,14 @@ public class SysCacheService : ISysCacheService, IDynamicApiController, ISinglet
return _cache.GetAsync<List<MappingVessel>>(CommonConst.CACHE_KEY_COMMON_DB_MAPPING_VESSEL);
}
/// <summary>
/// 获取公共库 船名映射
/// </summary>
/// <returns></returns>
public Task<List<MappingYard>> GetAllMappingYard()
{
return _cache.GetAsync<List<MappingYard>>(CommonConst.CACHE_KEY_COMMON_DB_MAPPING_YARD);
}
/// <summary>
@ -427,7 +434,7 @@ public class SysCacheService : ISysCacheService, IDynamicApiController, ISinglet
/// <returns></returns>
public Task SetAllCodeCarrier(List<CodeCarrier> list)
{
return _cache.SetAsync(CommonConst.CACHE_KEY_COMMON_DB_CARRIER, list, TimeSpan.FromMinutes(5));
return _cache.SetAsync(CommonConst.CACHE_KEY_COMMON_DB_CARRIER, list);
}
/// <summary>
@ -436,7 +443,7 @@ public class SysCacheService : ISysCacheService, IDynamicApiController, ISinglet
/// <returns></returns>
public Task SetAllCodeVessel(List<CodeVessel> list)
{
return _cache.SetAsync(CommonConst.CACHE_KEY_COMMON_DB_VESSEL, list, TimeSpan.FromMinutes(5));
return _cache.SetAsync(CommonConst.CACHE_KEY_COMMON_DB_VESSEL, list);
}
/// <summary>
@ -445,7 +452,7 @@ public class SysCacheService : ISysCacheService, IDynamicApiController, ISinglet
/// <returns></returns>
public Task SetAllCodeForwarder(List<CodeForwarder> list)
{
return _cache.SetAsync(CommonConst.CACHE_KEY_COMMON_DB_FORWARDER, list, TimeSpan.FromMinutes(5));
return _cache.SetAsync(CommonConst.CACHE_KEY_COMMON_DB_FORWARDER, list);
}
/// <summary>
@ -454,7 +461,7 @@ public class SysCacheService : ISysCacheService, IDynamicApiController, ISinglet
/// <returns></returns>
public Task SetAllCodeYard(List<CodeYard> list)
{
return _cache.SetAsync(CommonConst.CACHE_KEY_COMMON_DB_YARD, list, TimeSpan.FromMinutes(5));
return _cache.SetAsync(CommonConst.CACHE_KEY_COMMON_DB_YARD, list);
}
/// <summary>
@ -463,7 +470,7 @@ public class SysCacheService : ISysCacheService, IDynamicApiController, ISinglet
/// <returns></returns>
public Task SetAllCodePortLoad(List<CodePortLoad> list)
{
return _cache.SetAsync(CommonConst.CACHE_KEY_COMMON_DB_PORTLOAD, list, TimeSpan.FromMinutes(5));
return _cache.SetAsync(CommonConst.CACHE_KEY_COMMON_DB_PORTLOAD, list);
}
/// <summary>
@ -472,7 +479,7 @@ public class SysCacheService : ISysCacheService, IDynamicApiController, ISinglet
/// <returns></returns>
public Task SetAllCodePort(List<CodePort> list)
{
return _cache.SetAsync(CommonConst.CACHE_KEY_COMMON_DB_PORT, list, TimeSpan.FromMinutes(5));
return _cache.SetAsync(CommonConst.CACHE_KEY_COMMON_DB_PORT, list);
}
/// <summary>
@ -481,7 +488,7 @@ public class SysCacheService : ISysCacheService, IDynamicApiController, ISinglet
/// <returns></returns>
public Task SetAllCodePackage(List<CodePackage> list)
{
return _cache.SetAsync(CommonConst.CACHE_KEY_COMMON_DB_PACKAGE, list, TimeSpan.FromMinutes(5));
return _cache.SetAsync(CommonConst.CACHE_KEY_COMMON_DB_PACKAGE, list);
}
/// <summary>
@ -490,7 +497,7 @@ public class SysCacheService : ISysCacheService, IDynamicApiController, ISinglet
/// <returns></returns>
public Task SetAllCodeService(List<CodeService> list)
{
return _cache.SetAsync(CommonConst.CACHE_KEY_COMMON_DB_SERVICE, list, TimeSpan.FromMinutes(5));
return _cache.SetAsync(CommonConst.CACHE_KEY_COMMON_DB_SERVICE, list);
}
/// <summary>
@ -499,7 +506,7 @@ public class SysCacheService : ISysCacheService, IDynamicApiController, ISinglet
/// <returns></returns>
public Task SetAllCodeCtn(List<CodeCtn> list)
{
return _cache.SetAsync(CommonConst.CACHE_KEY_COMMON_DB_CTN, list, TimeSpan.FromMinutes(5));
return _cache.SetAsync(CommonConst.CACHE_KEY_COMMON_DB_CTN, list);
}
/// <summary>
@ -508,7 +515,7 @@ public class SysCacheService : ISysCacheService, IDynamicApiController, ISinglet
/// <returns></returns>
public Task SetAllCodeFrt(List<CodeFrt> list)
{
return _cache.SetAsync(CommonConst.CACHE_KEY_COMMON_DB_FRT, list, TimeSpan.FromMinutes(5));
return _cache.SetAsync(CommonConst.CACHE_KEY_COMMON_DB_FRT, list);
}
/// <summary>
@ -517,7 +524,7 @@ public class SysCacheService : ISysCacheService, IDynamicApiController, ISinglet
/// <returns></returns>
public Task SetAllMappingCtn(List<MappingCtn> list)
{
return _cache.SetAsync(CommonConst.CACHE_KEY_COMMON_DB_MAPPING_CTN, list, TimeSpan.FromMinutes(5));
return _cache.SetAsync(CommonConst.CACHE_KEY_COMMON_DB_MAPPING_CTN, list);
}
/// <summary>
@ -526,7 +533,7 @@ public class SysCacheService : ISysCacheService, IDynamicApiController, ISinglet
/// <returns></returns>
public Task SetAllMappingCarrier(List<MappingCarrier> list)
{
return _cache.SetAsync(CommonConst.CACHE_KEY_COMMON_DB_MAPPING_CARRIER, list, TimeSpan.FromMinutes(5));
return _cache.SetAsync(CommonConst.CACHE_KEY_COMMON_DB_MAPPING_CARRIER, list);
}
/// <summary>
@ -535,7 +542,7 @@ public class SysCacheService : ISysCacheService, IDynamicApiController, ISinglet
/// <returns></returns>
public Task SetAllMappingFrt(List<MappingFrt> list)
{
return _cache.SetAsync(CommonConst.CACHE_KEY_COMMON_DB_MAPPING_FRT, list, TimeSpan.FromMinutes(5));
return _cache.SetAsync(CommonConst.CACHE_KEY_COMMON_DB_MAPPING_FRT, list);
}
/// <summary>
@ -544,9 +551,17 @@ public class SysCacheService : ISysCacheService, IDynamicApiController, ISinglet
/// <returns></returns>
public Task SetAllMappingVessel(List<MappingVessel> list)
{
return _cache.SetAsync(CommonConst.CACHE_KEY_COMMON_DB_MAPPING_VESSEL, list, TimeSpan.FromMinutes(5));
return _cache.SetAsync(CommonConst.CACHE_KEY_COMMON_DB_MAPPING_VESSEL, list);
}
/// <summary>
/// 设置公共库 场站映射
/// </summary>
/// <returns></returns>
public Task SetAllMappingYard(List<MappingYard> list)
{
return _cache.SetAsync(CommonConst.CACHE_KEY_COMMON_DB_MAPPING_YARD, list);
}
#endregion

@ -20,23 +20,19 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
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 ISysCacheService _sysCacheService;
public CommonDBService(SqlSugarRepository<CodeCarrier> codeCarrierRep,
@ -53,6 +49,7 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
SqlSugarRepository<MappingVessel> mappingVesselRep,
SqlSugarRepository<MappingCtn> mappingCtnRep,
SqlSugarRepository<MappingFrt> mappingFrtRep,
SqlSugarRepository<MappingYard> mappingYardRep,
ISysCacheService sysCacheService)
{
_codeCarrierRep = codeCarrierRep;
@ -69,6 +66,7 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
_mappingVesselRep = mappingVesselRep;
_mappingCtnRep = mappingCtnRep;
_mappingFrtRep = mappingFrtRep;
_mappingYardRep = mappingYardRep;
_sysCacheService = sysCacheService;
@ -96,6 +94,7 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
public async Task AddCarrier([FromBody] CodeCarrier dto)
{
var entity = dto.Adapt<CodeCarrier>();
entity.GID = Guid.NewGuid().ToString();
await _codeCarrierRep.InsertAsync(entity);
await GetAllCarrier();
}
@ -112,7 +111,7 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
.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.Code.Contains(input.MapName, System.StringComparison.CurrentCultureIgnoreCase));
.WhereIF(!string.IsNullOrEmpty(input.MapName), x => x.MapName.Contains(input.MapName, System.StringComparison.CurrentCultureIgnoreCase));
return queryList.ToList();
}
@ -125,6 +124,7 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
var entity = dto.Adapt<MappingCarrier>();
if (string.IsNullOrWhiteSpace(dto.GID))
{
entity.GID = Guid.NewGuid().ToString();
await _mappingCarrierRep.InsertAsync(entity);
}
else
@ -159,7 +159,6 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
return queryList.ToList();
}
/// <summary>
/// 新增船名信息
/// </summary>
@ -167,6 +166,7 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
public async Task AddVessel([FromBody] CodeVessel dto)
{
var entity = dto.Adapt<CodeVessel>();
entity.GID = Guid.NewGuid().ToString();
await _codeVesselRep.InsertAsync(entity);
await GetAllVessel();
}
@ -186,7 +186,7 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
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.Name.Contains(input.MapName, System.StringComparison.CurrentCultureIgnoreCase));
.WhereIF(!string.IsNullOrEmpty(input.MapName), x => x.MapName.Contains(input.MapName, System.StringComparison.CurrentCultureIgnoreCase));
return queryList.ToList();
}
@ -200,6 +200,7 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
var entity = dto.Adapt<MappingVessel>();
if (string.IsNullOrWhiteSpace(dto.GID))
{
entity.GID = Guid.NewGuid().ToString();
await _mappingVesselRep.InsertAsync(entity);
}
else
@ -213,7 +214,6 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
#endregion
#region 船代
/// <summary>
/// 获取船代列表信息
@ -235,12 +235,12 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
public async Task AddForwarder([FromBody] CodeForwarder dto)
{
var entity = dto.Adapt<CodeForwarder>();
entity.GID = Guid.NewGuid().ToString();
await _codeForwarderRep.InsertAsync(entity);
await GetAllForwarder();
}
#endregion
#region 场站
/// <summary>
@ -262,11 +262,54 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
public async Task AddYard([FromBody] CodeYard dto)
{
var entity = dto.Adapt<CodeYard>();
entity.GID = Guid.NewGuid().ToString();
await _codeYardRep.InsertAsync(entity);
await GetAllYard();
}
#endregion
/// <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] MappingYard dto)
{
var entity = dto.Adapt<MappingYard>();
if (string.IsNullOrWhiteSpace(dto.GID))
{
entity.GID = Guid.NewGuid().ToString();
await _mappingYardRep.InsertAsync(entity);
}
else
{
await _mappingYardRep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
}
await GetAllMappingYard();
}
#endregion
#region 起始港
/// <summary>
@ -288,6 +331,7 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
public async Task AddPortload([FromBody] CodePortLoad dto)
{
var entity = dto.Adapt<CodePortLoad>();
entity.GID = Guid.NewGuid().ToString();
await _codePortLoadrRep.InsertAsync(entity);
await GetAllPortload();
}
@ -321,6 +365,7 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
public async Task AddPort([FromBody] CodePort dto)
{
var entity = dto.Adapt<CodePort>();
entity.GID = Guid.NewGuid().ToString();
await _codePortRep.InsertAsync(entity);
await GetAllPort();
}
@ -348,6 +393,7 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
public async Task AddPackage([FromBody] CodePackage dto)
{
var entity = dto.Adapt<CodePackage>();
entity.GID = Guid.NewGuid().ToString();
await _codePackageRep.InsertAsync(entity);
await GetAllPackage();
}
@ -375,6 +421,7 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
public async Task AddService([FromBody] CodeService dto)
{
var entity = dto.Adapt<CodeService>();
entity.GID = Guid.NewGuid().ToString();
await _codeServiceRep.InsertAsync(entity);
await GetAllService();
}
@ -404,6 +451,7 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
public async Task AddCtn([FromBody] CodeCtn dto)
{
var entity = dto.Adapt<CodeCtn>();
entity.GID = Guid.NewGuid().ToString();
await _codeCtnRep.InsertAsync(entity);
await GetAllCtn();
}
@ -421,7 +469,7 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
.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.Code.Contains(input.MapName, System.StringComparison.CurrentCultureIgnoreCase));
.WhereIF(!string.IsNullOrEmpty(input.MapName), x => x.MapName.Contains(input.MapName, System.StringComparison.CurrentCultureIgnoreCase));
return queryList.ToList();
}
@ -435,6 +483,7 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
var entity = dto.Adapt<MappingCtn>();
if (string.IsNullOrWhiteSpace(dto.GID))
{
entity.GID = Guid.NewGuid().ToString();
await _mappingCtnRep.InsertAsync(entity);
}
else
@ -470,6 +519,7 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
public async Task AddFrt([FromBody] CodeFrt dto)
{
var entity = dto.Adapt<CodeFrt>();
entity.GID = Guid.NewGuid().ToString();
await _codeFrtRep.InsertAsync(entity);
await GetAllFrt();
}
@ -487,7 +537,7 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
.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.Code.Contains(input.MapName, System.StringComparison.CurrentCultureIgnoreCase));
.WhereIF(!string.IsNullOrEmpty(input.MapName), x => x.MapName.Contains(input.MapName, System.StringComparison.CurrentCultureIgnoreCase));
return queryList.ToList();
}
@ -500,6 +550,7 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
var entity = dto.Adapt<MappingFrt>();
if (string.IsNullOrWhiteSpace(dto.GID))
{
entity.GID = Guid.NewGuid().ToString();
await _mappingFrtRep.InsertAsync(entity);
}
else
@ -510,9 +561,6 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
}
#endregion
#region 实现接口,获取公共数据并缓存
[NonAction]
public async Task<List<CodeCarrier>> GetAllCarrier()
@ -550,7 +598,15 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
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()
{
@ -647,7 +703,4 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
}
#endregion
}

@ -42,6 +42,12 @@ public interface ICommonDBService
/// <returns></returns>
Task<List<CodeYard>> GetAllYard();
/// <summary>
/// 获取场站映射
/// </summary>
/// <returns></returns>
Task<List<MappingYard>> GetAllMappingYard();
/// <summary>
/// 获取起始港
/// </summary>

@ -135,6 +135,9 @@ public class Startup : AppStartup
//船名映射
App.GetService<ICommonDBService>().GetAllMappingVessel();
//场站映射
App.GetService<ICommonDBService>().GetAllMappingYard();
//船代
App.GetService<ICommonDBService>().GetAllForwarder();

Loading…
Cancel
Save