From 0a4ada05084c5d1e3bedde51a69851f1b2db6aa6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?ZR20090193-=E9=99=88=E6=95=AC=E5=8B=87?= Date: Wed, 8 May 2024 14:03:09 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=BA=E7=AB=99=E7=AE=B1=E5=9E=8B=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=98=A0=E5=B0=84;=E5=88=B7=E6=96=B0Token=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8DorgId=E9=97=AE=E9=A2=98;=E8=BF=90=E8=B8=AA=E9=83=A8?= =?UTF-8?q?=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Constants/MultiLanguageConst.cs | 13 ++ .../DS.Module.Core/Extensions/Extensions.cs | 37 ++++++ .../CrawlerDataService.cs | 110 +++++++++++++++-- .../CrawlerModuleInstall.cs | 27 ++++ .../DS.Module.CrawlerData.csproj | 4 - .../ICrawlerDataService.cs | 10 +- .../DS.Module.CrawlerData/YardDataReq.cs | 43 +++++++ .../Code/Method/CodeThirdPartyService.cs | 16 ++- .../DS.WMS.Core/Fee/Dtos/FeeTemplateReq.cs | 2 +- .../DS.WMS.Core/Fee/Dtos/FeeTemplateRes.cs | 2 +- .../DS.WMS.Core/Fee/Entity/FeeTemplate.cs | 4 +- .../DS.WMS.Core/Map/Dtos/MappingCtnReq.cs | 76 ++++++++++++ .../DS.WMS.Core/Map/Dtos/MappingCtnRes.cs | 61 +++++++++ .../DS.WMS.Core/Map/Dtos/MappingYardReq.cs | 77 ++++++++++++ .../DS.WMS.Core/Map/Dtos/MappingYardRes.cs | 61 +++++++++ .../DS.WMS.Core/Map/Entity/MappingCtn.cs | 46 +++++++ .../DS.WMS.Core/Map/Entity/MappingYard.cs | 47 +++++++ .../Map/Interface/IMappingCtnService.cs | 49 ++++++++ .../Map/Interface/IMappingYardService.cs | 49 ++++++++ .../Map/Method/MappingCtnService.cs | 116 ++++++++++++++++++ .../Map/Method/MappingYardService.cs | 116 ++++++++++++++++++ .../DS.WMS.Core/Op/Dtos/SeaExportReq.cs | 8 ++ .../DS.WMS.Core/Op/Dtos/SeaExportRes.cs | 13 +- .../DS.WMS.Core/Op/Entity/SeaExport.cs | 10 ++ .../System/Method/CommonService.cs | 11 +- .../Controllers/MappingCtnController.cs | 92 ++++++++++++++ .../Controllers/MappingYardController.cs | 92 ++++++++++++++ ds-wms-service/DS.WMS.Test/SaasTest.cs | 3 +- 28 files changed, 1158 insertions(+), 37 deletions(-) create mode 100644 ds-wms-service/DS.Module.CrawlerData/CrawlerModuleInstall.cs create mode 100644 ds-wms-service/DS.Module.CrawlerData/YardDataReq.cs create mode 100644 ds-wms-service/DS.WMS.Core/Map/Dtos/MappingCtnReq.cs create mode 100644 ds-wms-service/DS.WMS.Core/Map/Dtos/MappingCtnRes.cs create mode 100644 ds-wms-service/DS.WMS.Core/Map/Dtos/MappingYardReq.cs create mode 100644 ds-wms-service/DS.WMS.Core/Map/Dtos/MappingYardRes.cs create mode 100644 ds-wms-service/DS.WMS.Core/Map/Entity/MappingCtn.cs create mode 100644 ds-wms-service/DS.WMS.Core/Map/Entity/MappingYard.cs create mode 100644 ds-wms-service/DS.WMS.Core/Map/Interface/IMappingCtnService.cs create mode 100644 ds-wms-service/DS.WMS.Core/Map/Interface/IMappingYardService.cs create mode 100644 ds-wms-service/DS.WMS.Core/Map/Method/MappingCtnService.cs create mode 100644 ds-wms-service/DS.WMS.Core/Map/Method/MappingYardService.cs create mode 100644 ds-wms-service/DS.WMS.MainApi/Controllers/MappingCtnController.cs create mode 100644 ds-wms-service/DS.WMS.MainApi/Controllers/MappingYardController.cs diff --git a/ds-wms-service/DS.Module.Core/Constants/MultiLanguageConst.cs b/ds-wms-service/DS.Module.Core/Constants/MultiLanguageConst.cs index f9b55af0..3f5b9236 100644 --- a/ds-wms-service/DS.Module.Core/Constants/MultiLanguageConst.cs +++ b/ds-wms-service/DS.Module.Core/Constants/MultiLanguageConst.cs @@ -52,6 +52,19 @@ public static class MultiLanguageConst [Description("程序异常")] public const string ProgramException = "Program_Exception"; + #region 数据映射 + [Description("场站映射信息已存在")] + public const string MappingYardExist = "MappingYard_Exist"; + + [Description("场站映射信息不存在")] + public const string MappingYardNotExist = "MappingYard_Not_Exist"; + [Description("箱型映射信息已存在")] + public const string MappingCtnExist = "MappingCtn_Exist"; + + [Description("箱型映射信息不存在")] + public const string MappingCtnNotExist = "MappingCtn_Not_Exist"; + + #endregion #region 用户管理 [Description("用户授权数量限制")] diff --git a/ds-wms-service/DS.Module.Core/Extensions/Extensions.cs b/ds-wms-service/DS.Module.Core/Extensions/Extensions.cs index aad82593..98148f03 100644 --- a/ds-wms-service/DS.Module.Core/Extensions/Extensions.cs +++ b/ds-wms-service/DS.Module.Core/Extensions/Extensions.cs @@ -500,4 +500,41 @@ public static partial class Extensions { return obj == null ? string.Empty : JsonConvert.SerializeObject(obj); } + + /// + /// 获取字符串值 + /// + /// + /// + /// + public static string GetStringValue(this JObject jobj, string prop) + { + var jt = jobj[prop]; + if (jt == null) + { + return string.Empty; + } + + return jt.ToString(); + } + + /// + /// 获取int值 + /// + /// + /// + /// + public static int GetIntValue(this JObject jobj, string prop) + { + var jt = jobj[prop]; + if (jt == null) + { + return 0; + } + + var strVal = jt.ToString(); + int rtnVal = 0; + int.TryParse(strVal, out rtnVal); + return rtnVal; + } } \ No newline at end of file diff --git a/ds-wms-service/DS.Module.CrawlerData/CrawlerDataService.cs b/ds-wms-service/DS.Module.CrawlerData/CrawlerDataService.cs index 30ff4689..212af37d 100644 --- a/ds-wms-service/DS.Module.CrawlerData/CrawlerDataService.cs +++ b/ds-wms-service/DS.Module.CrawlerData/CrawlerDataService.cs @@ -1,19 +1,21 @@ -using DS.Module.UserModule; +using DS.Module.Core; +using DS.Module.Core.Extensions; +using DS.Module.Core.Helpers; +using DS.Module.SqlSugar; +using DS.Module.UserModule; +using DS.WMS.Core.Code.Entity; +using DS.WMS.Core.Map.Entity; +using DS.WMS.Core.System.Entity; using Microsoft.Extensions.DependencyInjection; -using SqlSugar; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; using NLog; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using DS.Module.SqlSugar; -using DS.Module.Core; +using SqlSugar; namespace DS.Module.CrawlerData { - public class CrawlerDataService: ICrawlerDataService - { + public class CrawlerDataService : ICrawlerDataService + { private readonly IServiceProvider _serviceProvider; private readonly ISqlSugarClient db; private readonly IUser user; @@ -31,7 +33,91 @@ namespace DS.Module.CrawlerData saasService = _serviceProvider.GetRequiredService(); } + /// + /// 异步调取出口运踪场站详情(按箱明细显示) + /// + /// + /// + public async Task> GetYardData(YardDataReq req) + { + + var tenantDb = saasService.GetBizDbScopeById(user.TenantId); + var account = tenantDb.Queryable().Where(x => x.CustomerId == req.YardId && x.AccountType == "BillTrace").First(); + + var userKey = db.Queryable().Where(x => x.Code == "spiderUserKeyBilltrace").WithCache().First().Value; + var userSecret = db.Queryable().Where(x => x.Code == "spiderUserSecretBilltrace").WithCache().First().Value; + var spiderServerUrl = db.Queryable().Where(x => x.Code == "spiderServerUrlBillTraceNew").WithCache().First().Value; + var tenantName = db.Queryable().Filter(null, true).Where(x => x.Id == long.Parse(user.TenantId)).WithCache().First().Name; + if (account.IsNull()) + { + return await Task.FromResult(DataResult.Failed("未配置出口运踪场站第三方账号信息!")); + } + + var yardMap = tenantDb.Queryable().Where(x => x.LinkId == req.YardId && x.Module == "BillTrace").First(); + if (yardMap.IsNull()) + { + return await Task.FromResult(DataResult.Failed($"场站代号配置未找到:{req.YardId}")); + } + var objSend = new + { + user_key = userKey, + user_secret = userSecret, + customer_id = user.TenantId, + customer_name = tenantName, + web_code = yardMap.MapCode, + bno = req.MBLNO, + req_type = req.IsWeb ? "1" : "0", + web_user = account.AppKey, + web_psw = account.AppSecret, + }; + var urlYard = spiderServerUrl; + if (!urlYard.EndsWith("/")) + { + urlYard += "/"; + } + + urlYard += "real/query"; + + var res = RequestHelper.Post(JsonConvert.SerializeObject(objSend), urlYard); + var rtnObj = JObject.Parse(res); + if (rtnObj.GetIntValue("code") != 200) + { + return await Task.FromResult(DataResult.Failed("$\"获取场站数失败:{rtnObj.GetStringValue(\"msg\")}\"!")); + } + else + { + var rtnData = rtnObj.GetStringValue("data"); + if (req.IsWeb) + { + var viewstatehtml = GetDataHtmlList(rtnData, "__VIEWSTATE", "/>"); + if (viewstatehtml != "") + { + rtnData = rtnData.Replace(viewstatehtml, ""); + } + } + return await Task.FromResult(DataResult.Success(rtnData)); + } + + + } + + - //public DataResult GetYardData(string url) { } + + private static string GetDataHtmlList(string html, string startstr, string endstr) + { + var subhtml = html; + var htmllength = subhtml.Length; + var startindex = subhtml.IndexOf(startstr); + //if (startindex == -1 || startindex == 0) return ""; + if (startindex == -1) return ""; + subhtml = subhtml.Substring(startindex + startstr.Length, htmllength - startindex - startstr.Length); + var endindex = subhtml.IndexOf(endstr); + if (endindex != -1 && endindex != 0) + subhtml = subhtml.Substring(0, endindex); + + return subhtml; + + } } } diff --git a/ds-wms-service/DS.Module.CrawlerData/CrawlerModuleInstall.cs b/ds-wms-service/DS.Module.CrawlerData/CrawlerModuleInstall.cs new file mode 100644 index 00000000..dcab16fe --- /dev/null +++ b/ds-wms-service/DS.Module.CrawlerData/CrawlerModuleInstall.cs @@ -0,0 +1,27 @@ +using Microsoft.Extensions.DependencyInjection; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DS.Module.CrawlerData +{ + /// + /// 注入运踪服务 + /// + public static class CrawlerModuleInstall + { + /// + /// + /// + /// + /// + public static void AddCrawlerModuleInstall(this IServiceCollection services) + { + if (services == null) throw new ArgumentNullException(nameof(services)); + + services.AddScoped(); + } + } +} diff --git a/ds-wms-service/DS.Module.CrawlerData/DS.Module.CrawlerData.csproj b/ds-wms-service/DS.Module.CrawlerData/DS.Module.CrawlerData.csproj index 8d79ff0d..506bc4e1 100644 --- a/ds-wms-service/DS.Module.CrawlerData/DS.Module.CrawlerData.csproj +++ b/ds-wms-service/DS.Module.CrawlerData/DS.Module.CrawlerData.csproj @@ -13,8 +13,4 @@ - - - - diff --git a/ds-wms-service/DS.Module.CrawlerData/ICrawlerDataService.cs b/ds-wms-service/DS.Module.CrawlerData/ICrawlerDataService.cs index c7d111b4..c1b1e1ba 100644 --- a/ds-wms-service/DS.Module.CrawlerData/ICrawlerDataService.cs +++ b/ds-wms-service/DS.Module.CrawlerData/ICrawlerDataService.cs @@ -1,4 +1,5 @@ -using System; +using DS.Module.Core; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -8,5 +9,12 @@ namespace DS.Module.CrawlerData { public interface ICrawlerDataService { + + /// + /// 异步调取出口运踪场站详情(按箱明细显示) + /// + /// + /// + public Task> GetYardData(YardDataReq req); } } diff --git a/ds-wms-service/DS.Module.CrawlerData/YardDataReq.cs b/ds-wms-service/DS.Module.CrawlerData/YardDataReq.cs new file mode 100644 index 00000000..da604689 --- /dev/null +++ b/ds-wms-service/DS.Module.CrawlerData/YardDataReq.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DS.Module.CrawlerData +{ + /// + /// + /// + public class YardDataReq + { + ///// + ///// 用户名ID + ///// + //public long UserId { get; set; } + + ///// + ///// 租户ID + ///// + //public long TenantId { get; set; } + + ///// + ///// 租户名称 + ///// + //public string TenantName { get; set; } + /// + /// 提单号 + /// + public string MBLNO { get; set; } + + /// + /// 场站ID + /// + public long YardId { get; set; } + + /// + /// 是否网站 + /// + public bool IsWeb { get; set; } = true; + } +} diff --git a/ds-wms-service/DS.WMS.Core/Code/Method/CodeThirdPartyService.cs b/ds-wms-service/DS.WMS.Core/Code/Method/CodeThirdPartyService.cs index 79930aa4..50ed66dd 100644 --- a/ds-wms-service/DS.WMS.Core/Code/Method/CodeThirdPartyService.cs +++ b/ds-wms-service/DS.WMS.Core/Code/Method/CodeThirdPartyService.cs @@ -31,9 +31,11 @@ namespace DS.WMS.Core.Code.Method public DataResult> GetListByPage(PageRequest request) { + var tenantDb = saasService.GetBizDbScopeById(user.TenantId); + //序列化查询条件 var whereList = db.ConfigQuery.Context.Utilities.JsonToConditionalModels(request.QueryCondition); - var data = db.Queryable() + var data = tenantDb.Queryable() .Where(whereList) .Select().ToQueryPage(request.PageCondition); return data; @@ -41,34 +43,36 @@ namespace DS.WMS.Core.Code.Method public DataResult EditCodeThirdParty(CodeThirdPartyReq req) { + var tenantDb = saasService.GetBizDbScopeById(user.TenantId); if (req.Id == 0) { - if (db.Queryable().Where(x => x.AccountType == req.AccountType.Trim()&& x.CustomerId == req.CustomerId).Any()) + if (tenantDb.Queryable().Where(x => x.AccountType == req.AccountType.Trim()&& x.CustomerId == req.CustomerId).Any()) { return DataResult.Failed("第三方账号已存在!", MultiLanguageConst.CodeThirdPartyExist); } var data = req.Adapt(); - var entity = db.Insertable(data).ExecuteReturnEntity(); + var entity = tenantDb.Insertable(data).ExecuteReturnEntity(); return DataResult.Successed("添加成功!", entity.Id, MultiLanguageConst.DataCreateSuccess); } else { - var info = db.Queryable().Where(x => x.Id == req.Id).First(); + var info = tenantDb.Queryable().Where(x => x.Id == req.Id).First(); info = req.Adapt(info); - db.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand(); + tenantDb.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand(); return DataResult.Successed("更新成功!", MultiLanguageConst.DataUpdateSuccess); } } public DataResult GetCodeThirdPartyInfo(string id) { - var data = db.Queryable() + var tenantDb = saasService.GetBizDbScopeById(user.TenantId); + var data = tenantDb.Queryable() .Where(a => a.Id == long.Parse(id)) .Select() .First(); diff --git a/ds-wms-service/DS.WMS.Core/Fee/Dtos/FeeTemplateReq.cs b/ds-wms-service/DS.WMS.Core/Fee/Dtos/FeeTemplateReq.cs index a5880279..ab18e600 100644 --- a/ds-wms-service/DS.WMS.Core/Fee/Dtos/FeeTemplateReq.cs +++ b/ds-wms-service/DS.WMS.Core/Fee/Dtos/FeeTemplateReq.cs @@ -20,7 +20,7 @@ public class FeeTemplateReq /// /// 业务类型(海运出口、海运进口、空运出口、空运进口) /// - public int OpType { get; set; } + public string OpType { get; set; } /// /// 收付类型(收、付) /// diff --git a/ds-wms-service/DS.WMS.Core/Fee/Dtos/FeeTemplateRes.cs b/ds-wms-service/DS.WMS.Core/Fee/Dtos/FeeTemplateRes.cs index 8413d5da..cbe1c388 100644 --- a/ds-wms-service/DS.WMS.Core/Fee/Dtos/FeeTemplateRes.cs +++ b/ds-wms-service/DS.WMS.Core/Fee/Dtos/FeeTemplateRes.cs @@ -20,7 +20,7 @@ public class FeeTemplateRes /// /// 业务类型(海运出口、海运进口、空运出口、空运进口) /// - public int OpType { get; set; } + public string OpType { get; set; } /// /// 收付类型(收、付) /// diff --git a/ds-wms-service/DS.WMS.Core/Fee/Entity/FeeTemplate.cs b/ds-wms-service/DS.WMS.Core/Fee/Entity/FeeTemplate.cs index 36d400d4..cc4e0db6 100644 --- a/ds-wms-service/DS.WMS.Core/Fee/Entity/FeeTemplate.cs +++ b/ds-wms-service/DS.WMS.Core/Fee/Entity/FeeTemplate.cs @@ -17,8 +17,8 @@ public class FeeTemplate: BaseOrgModel /// /// 业务类型(海运出口、海运进口、空运出口、空运进口) /// - [SugarColumn(ColumnDescription = "业务类型 海运出口、海运进口、空运出口、空运进口", IsNullable = false, DefaultValue = "0")] - public int OpType { get; set; } + [SugarColumn(ColumnDescription = "业务类型 海运出口、海运进口、空运出口、空运进口", IsNullable = false, Length = 20)] + public string OpType { get; set; } /// /// 收付类型(收、付) /// diff --git a/ds-wms-service/DS.WMS.Core/Map/Dtos/MappingCtnReq.cs b/ds-wms-service/DS.WMS.Core/Map/Dtos/MappingCtnReq.cs new file mode 100644 index 00000000..5b830bde --- /dev/null +++ b/ds-wms-service/DS.WMS.Core/Map/Dtos/MappingCtnReq.cs @@ -0,0 +1,76 @@ +using DS.Module.Core; +using DS.WMS.Core.Code.Dtos; +using FluentValidation; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DS.WMS.Core.Map.Dtos +{ + /// + /// 箱型映射信息请求 + /// + public class MappingCtnReq + { + /// + /// 主键Id + /// + public long Id { get; set; } + + /// + /// 关联业务id + /// + public long LinkId { get; set; } + + /// + /// 模块 + /// + public string Module { get; set; } + + /// + /// 映射代码 + /// + public string MapCode { get; set; } + + /// + /// 映射名称 + /// + public string MapName { get; set; } + + /// + /// 船司Id + /// + public long CarrierId { get; set; } + + /// + /// 状态 0 启用 1 禁用 + /// + public StatusEnum? Status { get; set; } = StatusEnum.Enable; + /// + /// 备注 + /// + public string Note { get; set; } = ""; + } + /// + /// 验证 + /// + public class MappingCtnReqValidator : AbstractValidator + { + /// + /// 构造函数 + /// + public MappingCtnReqValidator() + { + this.RuleFor(o => o.LinkId) + .NotEmpty().WithName("箱型Id"); + this.RuleFor(o => o.Module) + .NotEmpty().WithName("模块"); + this.RuleFor(o => o.MapCode) + .NotEmpty().WithName("映射代码"); + this.RuleFor(o => o.MapName) + .NotEmpty().WithName("映射名称"); + } + } +} diff --git a/ds-wms-service/DS.WMS.Core/Map/Dtos/MappingCtnRes.cs b/ds-wms-service/DS.WMS.Core/Map/Dtos/MappingCtnRes.cs new file mode 100644 index 00000000..56161f18 --- /dev/null +++ b/ds-wms-service/DS.WMS.Core/Map/Dtos/MappingCtnRes.cs @@ -0,0 +1,61 @@ +using DS.Module.Core; +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DS.WMS.Core.Map.Dtos +{ + /// + /// 箱型映射信息返回 + /// + public class MappingCtnRes + { + /// + /// 主键Id + /// + public long Id { get; set; } + + /// + /// 关联业务id + /// + public long LinkId { get; set; } + + + + /// + /// 模块 + /// + public string Module { get; set; } + + /// + /// 映射代码 + /// + public string MapCode { get; set; } + + /// + /// 映射名称 + /// + public string MapName { get; set; } + + /// + /// 船司Id + /// + public long CarrierId { get; set; } + + /// + /// 状态 0 启用 1 禁用 + /// + public StatusEnum? Status { get; set; } = StatusEnum.Enable; + /// + /// 备注 + /// + public string Note { get; set; } = ""; + /// + /// 创建时间 + /// + public DateTime CreateTime { get; set; } + } +} diff --git a/ds-wms-service/DS.WMS.Core/Map/Dtos/MappingYardReq.cs b/ds-wms-service/DS.WMS.Core/Map/Dtos/MappingYardReq.cs new file mode 100644 index 00000000..603602e6 --- /dev/null +++ b/ds-wms-service/DS.WMS.Core/Map/Dtos/MappingYardReq.cs @@ -0,0 +1,77 @@ +using DS.Module.Core; +using DS.WMS.Core.Code.Dtos; +using FluentValidation; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DS.WMS.Core.Map.Dtos +{ + /// + /// 场站映射信息请求 + /// + public class MappingYardReq + { + /// + /// 主键Id + /// + public long Id { get; set; } + + /// + /// 关联业务id + /// + public long LinkId { get; set; } + + + /// + /// 模块 + /// + public string Module { get; set; } + + /// + /// 映射代码 + /// + public string MapCode { get; set; } + + /// + /// 映射名称 + /// + public string MapName { get; set; } + + /// + /// 船司Id + /// + public long CarrierId { get; set; } + + /// + /// 状态 0 启用 1 禁用 + /// + public StatusEnum? Status { get; set; } = StatusEnum.Enable; + /// + /// 备注 + /// + public string Note { get; set; } = ""; + } + /// + /// 验证 + /// + public class MappingYardReqValidator : AbstractValidator + { + /// + /// 构造函数 + /// + public MappingYardReqValidator() + { + this.RuleFor(o => o.LinkId) + .NotEmpty().WithName("场站Id"); + this.RuleFor(o => o.Module) + .NotEmpty().WithName("模块"); + this.RuleFor(o => o.MapCode) + .NotEmpty().WithName("映射代码"); + this.RuleFor(o => o.MapName) + .NotEmpty().WithName("映射名称"); + } + } +} diff --git a/ds-wms-service/DS.WMS.Core/Map/Dtos/MappingYardRes.cs b/ds-wms-service/DS.WMS.Core/Map/Dtos/MappingYardRes.cs new file mode 100644 index 00000000..83cb00b3 --- /dev/null +++ b/ds-wms-service/DS.WMS.Core/Map/Dtos/MappingYardRes.cs @@ -0,0 +1,61 @@ +using DS.Module.Core; +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DS.WMS.Core.Map.Dtos +{ + /// + /// 场站映射信息返回 + /// + public class MappingYardRes + { + /// + /// 主键Id + /// + public long Id { get; set; } + + /// + /// 关联业务id + /// + public long LinkId { get; set; } + + + + /// + /// 模块 + /// + public string Module { get; set; } + + /// + /// 映射代码 + /// + public string MapCode { get; set; } + + /// + /// 映射名称 + /// + public string MapName { get; set; } + + /// + /// 船司Id + /// + public long CarrierId { get; set; } + + /// + /// 状态 0 启用 1 禁用 + /// + public StatusEnum? Status { get; set; } = StatusEnum.Enable; + /// + /// 备注 + /// + public string Note { get; set; } = ""; + /// + /// 创建时间 + /// + public DateTime CreateTime { get; set; } + } +} diff --git a/ds-wms-service/DS.WMS.Core/Map/Entity/MappingCtn.cs b/ds-wms-service/DS.WMS.Core/Map/Entity/MappingCtn.cs new file mode 100644 index 00000000..457e75f9 --- /dev/null +++ b/ds-wms-service/DS.WMS.Core/Map/Entity/MappingCtn.cs @@ -0,0 +1,46 @@ +using DS.Module.Core.Data; +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DS.WMS.Core.Map.Entity +{ + /// + /// 箱型映射信息 + /// + [SqlSugar.SugarTable("op_map_ctn", "箱型映射信息")] + public class MappingCtn : BaseModel + { + /// + /// 关联业务id + /// + public long LinkId { get; set; } + + /// + /// 模块 + /// + [SugarColumn(ColumnDescription = "模块", Length = 100, IsNullable = false)] + public string Module { get; set; } + + /// + /// 映射代码 + /// + [SugarColumn(ColumnDescription = "映射代码", Length = 100, IsNullable = false)] + public string MapCode { get; set; } + + /// + /// 映射名称 + /// + [SugarColumn(ColumnDescription = "映射名称", Length = 100, IsNullable = true)] + public string MapName { get; set; } + + /// + /// 船司Id + /// + [SugarColumn(ColumnDescription = "船司Id", IsNullable = true,DefaultValue ="0")] + public long CarrierId { get; set; } + } +} diff --git a/ds-wms-service/DS.WMS.Core/Map/Entity/MappingYard.cs b/ds-wms-service/DS.WMS.Core/Map/Entity/MappingYard.cs new file mode 100644 index 00000000..4cfb6f2b --- /dev/null +++ b/ds-wms-service/DS.WMS.Core/Map/Entity/MappingYard.cs @@ -0,0 +1,47 @@ +using DS.Module.Core.Data; +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DS.WMS.Core.Map.Entity +{ + /// + /// 场站映射信息 + /// + [SqlSugar.SugarTable("op_map_yard", "场站映射信息")] + public class MappingYard : BaseModel + { + /// + /// 关联业务id + /// + public long LinkId { get; set; } + + + /// + /// 模块 + /// + [SugarColumn(ColumnDescription = "模块", Length = 100, IsNullable = false)] + public string Module { get; set; } + + /// + /// 映射代码 + /// + [SugarColumn(ColumnDescription = "映射代码", Length = 100, IsNullable = false)] + public string MapCode { get; set; } + + /// + /// 映射名称 + /// + [SugarColumn(ColumnDescription = "映射名称", Length = 100, IsNullable = true)] + public string MapName { get; set; } + + /// + /// 船司Id + /// + [SugarColumn(ColumnDescription = "船司Id", IsNullable = true,DefaultValue ="0")] + public long CarrierId { get; set; } + } +} diff --git a/ds-wms-service/DS.WMS.Core/Map/Interface/IMappingCtnService.cs b/ds-wms-service/DS.WMS.Core/Map/Interface/IMappingCtnService.cs new file mode 100644 index 00000000..d35f6e7b --- /dev/null +++ b/ds-wms-service/DS.WMS.Core/Map/Interface/IMappingCtnService.cs @@ -0,0 +1,49 @@ +using DS.Module.Core; +using DS.Module.Core.Data; +using DS.WMS.Core.Map.Dtos; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DS.WMS.Core.Map.Interface +{ + public interface IMappingCtnService + { + /// + /// 列表 + /// + /// + /// + DataResult> GetListByPage(PageRequest request); + + + /// + /// 编辑 + /// + /// + /// + DataResult EditMappingCtn(MappingCtnReq req); + + /// + /// 获取详情 + /// + /// + /// + DataResult GetMappingCtnInfo(string id); + + /// + /// 删除 + /// + /// + /// + public DataResult DelMappingCtn(IdModel req); + /// + /// 批量删除 + /// + /// + /// + public DataResult BatchDelMappingCtn(IdModel req); + } +} diff --git a/ds-wms-service/DS.WMS.Core/Map/Interface/IMappingYardService.cs b/ds-wms-service/DS.WMS.Core/Map/Interface/IMappingYardService.cs new file mode 100644 index 00000000..70cedec6 --- /dev/null +++ b/ds-wms-service/DS.WMS.Core/Map/Interface/IMappingYardService.cs @@ -0,0 +1,49 @@ +using DS.Module.Core; +using DS.Module.Core.Data; +using DS.WMS.Core.Map.Dtos; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DS.WMS.Core.Map.Interface +{ + public interface IMappingYardService + { + /// + /// 列表 + /// + /// + /// + DataResult> GetListByPage(PageRequest request); + + + /// + /// 编辑 + /// + /// + /// + DataResult EditMappingYard(MappingYardReq req); + + /// + /// 获取详情 + /// + /// + /// + DataResult GetMappingYardInfo(string id); + + /// + /// 删除 + /// + /// + /// + public DataResult DelMappingYard(IdModel req); + /// + /// 批量删除 + /// + /// + /// + public DataResult BatchDelMappingYard(IdModel req); + } +} diff --git a/ds-wms-service/DS.WMS.Core/Map/Method/MappingCtnService.cs b/ds-wms-service/DS.WMS.Core/Map/Method/MappingCtnService.cs new file mode 100644 index 00000000..b41df08d --- /dev/null +++ b/ds-wms-service/DS.WMS.Core/Map/Method/MappingCtnService.cs @@ -0,0 +1,116 @@ +using DS.Module.Core; +using DS.Module.Core.Data; +using DS.Module.SqlSugar; +using DS.Module.UserModule; +using DS.WMS.Core.Code.Dtos; +using DS.WMS.Core.Info.Dtos; +using DS.WMS.Core.Info.Entity; +using DS.WMS.Core.Map.Dtos; +using DS.WMS.Core.Map.Entity; +using DS.WMS.Core.Map.Interface; +using Microsoft.Extensions.DependencyInjection; +using SqlSugar; +using DS.Module.Core.Extensions; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Org.BouncyCastle.Ocsp; +using Mapster; +using DS.WMS.Core.Fee.Entity; + +namespace DS.WMS.Core.Map.Method +{ + public class MappingCtnService : IMappingCtnService + { + private readonly IServiceProvider _serviceProvider; + private readonly ISqlSugarClient db; + private readonly IUser user; + private readonly ISaasDbService saasService; + /// + /// + /// + /// + public MappingCtnService(IServiceProvider serviceProvider) + { + _serviceProvider = serviceProvider; + db = _serviceProvider.GetRequiredService(); + user = _serviceProvider.GetRequiredService(); + saasService = _serviceProvider.GetRequiredService(); + } + public DataResult BatchDelMappingCtn(IdModel req) + { + var tenantDb = saasService.GetBizDbScopeById(user.TenantId); + var list = tenantDb.Queryable().Where(x => req.Ids.Contains(x.Id)).ToList(); + ; + if (list.Count > 0) + { + tenantDb.Deleteable(list).ExecuteCommand(); + } + return DataResult.Successed("删除成功!", MultiLanguageConst.DataDelSuccess); + } + + public DataResult DelMappingCtn(IdModel req) + { + var tenantDb = saasService.GetBizDbScopeById(user.TenantId); + var info = tenantDb.Queryable().Where(x => x.Id == long.Parse(req.Id)).First(); + if (info == null) + { + return DataResult.Failed("箱型映射信息不存在!", MultiLanguageConst.MappingCtnNotExist); + } + + tenantDb.Deleteable(info).ExecuteCommand(); + return DataResult.Successed("删除成功!", MultiLanguageConst.DataDelSuccess); + } + + public DataResult EditMappingCtn(MappingCtnReq req) + { + var tenantDb = saasService.GetBizDbScopeById(user.TenantId); + if (req.Id == 0) + { + + if (tenantDb.Queryable().Where(x => x.LinkId == req.LinkId && x.Module == req.Module).Any()) + { + return DataResult.Failed("箱型映射信息已存在!", MultiLanguageConst.MappingCtnExist); + } + + var data = req.Adapt(); + + var entity = tenantDb.Insertable(data).ExecuteReturnEntity(); + + return DataResult.Successed("添加成功!", entity.Id, MultiLanguageConst.DataCreateSuccess); + } + else + { + var info = tenantDb.Queryable().Where(x => x.Id == req.Id).First(); + + info = req.Adapt(info); + + tenantDb.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand(); + return DataResult.Successed("更新成功!", MultiLanguageConst.DataUpdateSuccess); + } + } + + public DataResult> GetListByPage(PageRequest request) + { + var tenantDb = saasService.GetBizDbScopeById(user.TenantId); + //序列化查询条件 + var whereList = db.ConfigQuery.Context.Utilities.JsonToConditionalModels(request.QueryCondition); + var data = tenantDb.Queryable() + .Where(whereList) + .Select().ToQueryPage(request.PageCondition); + return data; + } + + public DataResult GetMappingCtnInfo(string id) + { + var tenantDb = saasService.GetBizDbScopeById(user.TenantId); + var data = tenantDb.Queryable() + .Where(a => a.Id == long.Parse(id)) + .Select() + .First(); + return DataResult.Success(data, MultiLanguageConst.DataQuerySuccess); + } + } +} diff --git a/ds-wms-service/DS.WMS.Core/Map/Method/MappingYardService.cs b/ds-wms-service/DS.WMS.Core/Map/Method/MappingYardService.cs new file mode 100644 index 00000000..4f709b9c --- /dev/null +++ b/ds-wms-service/DS.WMS.Core/Map/Method/MappingYardService.cs @@ -0,0 +1,116 @@ +using DS.Module.Core; +using DS.Module.Core.Data; +using DS.Module.SqlSugar; +using DS.Module.UserModule; +using DS.WMS.Core.Code.Dtos; +using DS.WMS.Core.Info.Dtos; +using DS.WMS.Core.Info.Entity; +using DS.WMS.Core.Map.Dtos; +using DS.WMS.Core.Map.Entity; +using DS.WMS.Core.Map.Interface; +using Microsoft.Extensions.DependencyInjection; +using SqlSugar; +using DS.Module.Core.Extensions; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Org.BouncyCastle.Ocsp; +using Mapster; +using DS.WMS.Core.Fee.Entity; + +namespace DS.WMS.Core.Map.Method +{ + public class MappingYardService : IMappingYardService + { + private readonly IServiceProvider _serviceProvider; + private readonly ISqlSugarClient db; + private readonly IUser user; + private readonly ISaasDbService saasService; + /// + /// + /// + /// + public MappingYardService(IServiceProvider serviceProvider) + { + _serviceProvider = serviceProvider; + db = _serviceProvider.GetRequiredService(); + user = _serviceProvider.GetRequiredService(); + saasService = _serviceProvider.GetRequiredService(); + } + public DataResult BatchDelMappingYard(IdModel req) + { + var tenantDb = saasService.GetBizDbScopeById(user.TenantId); + var list = tenantDb.Queryable().Where(x => req.Ids.Contains(x.Id)).ToList(); + ; + if (list.Count > 0) + { + tenantDb.Deleteable(list).ExecuteCommand(); + } + return DataResult.Successed("删除成功!", MultiLanguageConst.DataDelSuccess); + } + + public DataResult DelMappingYard(IdModel req) + { + var tenantDb = saasService.GetBizDbScopeById(user.TenantId); + var info = tenantDb.Queryable().Where(x => x.Id == long.Parse(req.Id)).First(); + if (info == null) + { + return DataResult.Failed("场站映射信息不存在!", MultiLanguageConst.MappingYardNotExist); + } + + tenantDb.Deleteable(info).ExecuteCommand(); + return DataResult.Successed("删除成功!", MultiLanguageConst.DataDelSuccess); + } + + public DataResult EditMappingYard(MappingYardReq req) + { + var tenantDb = saasService.GetBizDbScopeById(user.TenantId); + if (req.Id == 0) + { + + if (tenantDb.Queryable().Where(x => x.LinkId == req.LinkId && x.Module == req.Module).Any()) + { + return DataResult.Failed("场站映射信息已存在!", MultiLanguageConst.MappingYardExist); + } + + var data = req.Adapt(); + + var entity = tenantDb.Insertable(data).ExecuteReturnEntity(); + + return DataResult.Successed("添加成功!", entity.Id, MultiLanguageConst.DataCreateSuccess); + } + else + { + var info = tenantDb.Queryable().Where(x => x.Id == req.Id).First(); + + info = req.Adapt(info); + + tenantDb.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand(); + return DataResult.Successed("更新成功!", MultiLanguageConst.DataUpdateSuccess); + } + } + + public DataResult> GetListByPage(PageRequest request) + { + var tenantDb = saasService.GetBizDbScopeById(user.TenantId); + //序列化查询条件 + var whereList = db.ConfigQuery.Context.Utilities.JsonToConditionalModels(request.QueryCondition); + var data = tenantDb.Queryable() + .Where(whereList) + .Select().ToQueryPage(request.PageCondition); + return data; + } + + public DataResult GetMappingYardInfo(string id) + { + var tenantDb = saasService.GetBizDbScopeById(user.TenantId); + var data = tenantDb.Queryable() + .Where(a => a.Id == long.Parse(id)) + .Select() + .First(); + return DataResult.Success(data, MultiLanguageConst.DataQuerySuccess); + } + } +} diff --git a/ds-wms-service/DS.WMS.Core/Op/Dtos/SeaExportReq.cs b/ds-wms-service/DS.WMS.Core/Op/Dtos/SeaExportReq.cs index affb8627..c5f44672 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Dtos/SeaExportReq.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Dtos/SeaExportReq.cs @@ -1014,6 +1014,14 @@ public class SeaExportReq /// public string TransRemark { get; set; } + /// + /// 截单备注 + /// + public string CloseDocRemark { get; set; } + /// + /// 订舱备注 + /// + public string BookingRemark { get; set; } /// /// 预录 /// diff --git a/ds-wms-service/DS.WMS.Core/Op/Dtos/SeaExportRes.cs b/ds-wms-service/DS.WMS.Core/Op/Dtos/SeaExportRes.cs index e9eeeea1..fa87542e 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Dtos/SeaExportRes.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Dtos/SeaExportRes.cs @@ -1023,9 +1023,16 @@ public class SeaExportRes /// 创建时间 /// public DateTime CreateTime { get; set; } - - - + + /// + /// 截单备注 + /// + public string CloseDocRemark { get; set; } + /// + /// 订舱备注 + /// + public string BookingRemark { get; set; } + /// /// Desc:提单签发状态 /// diff --git a/ds-wms-service/DS.WMS.Core/Op/Entity/SeaExport.cs b/ds-wms-service/DS.WMS.Core/Op/Entity/SeaExport.cs index de496b3a..e2120eea 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Entity/SeaExport.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Entity/SeaExport.cs @@ -826,6 +826,16 @@ public class SeaExport : BaseOrgModel [SqlSugar.SugarColumn(ColumnDescription = "截单日期", IsNullable = false)] public DateTime CloseDocDate { get; set; } + /// + /// 截单备注 + /// + [SqlSugar.SugarColumn(ColumnDescription = "截单备注", IsNullable = true, ColumnDataType = StaticConfig.CodeFirst_BigString)] + public string CloseDocRemark { get; set; } + /// + /// 订舱备注 + /// + [SqlSugar.SugarColumn(ColumnDescription = "订舱备注", IsNullable = true, ColumnDataType = StaticConfig.CodeFirst_BigString)] + public string BookingRemark { get; set; } /// /// 集港日期 /// diff --git a/ds-wms-service/DS.WMS.Core/System/Method/CommonService.cs b/ds-wms-service/DS.WMS.Core/System/Method/CommonService.cs index 3408b1e8..52b0a17f 100644 --- a/ds-wms-service/DS.WMS.Core/System/Method/CommonService.cs +++ b/ds-wms-service/DS.WMS.Core/System/Method/CommonService.cs @@ -99,7 +99,7 @@ public class CommonService : ICommonService // GID = userInfo.GID, TenantId = tenantId.ToString(), }; - var refreshToken = JwtHelper.Encrypt(tokenModel, true); + var refreshToken = JwtHelper.Encrypt(tokenModel, true,false); var data = db.Queryable().Filter(null, true).Where(x => x.Id == userId) .Select(a => new CurrentUserViewModel @@ -321,17 +321,19 @@ public class CommonService : ICommonService var userId = long.Parse(user.UserId); var tenantId = user.GetTenantId(); + var orgId = user.GetOrgId(); var tokenModel = new JwtHelper.JwtTokenModel { Uid = user.UserId, Name = db.Queryable().Filter(null, true).First(x => x.Id == userId).UserName, + OrgId = orgId.ToString(), TenantId = tenantId.ToString(), }; var data = new RefreshTokenRes { - AccessToken = JwtHelper.Encrypt(tokenModel), - RefreshToken = JwtHelper.Encrypt(tokenModel, true) + AccessToken = JwtHelper.Encrypt(tokenModel,false,true), + RefreshToken = JwtHelper.Encrypt(tokenModel, true, true) }; return DataResult.Success(data); } @@ -368,9 +370,6 @@ public class CommonService : ICommonService return DataResult.Failed("密码错误!"); } - //取第一个机构 - var orgRelation = db.Queryable() - .First(x => x.UserId == userInfo.Id); var tokenModel = new JwtHelper.JwtTokenModel { Uid = userInfo.Id.ToString(), diff --git a/ds-wms-service/DS.WMS.MainApi/Controllers/MappingCtnController.cs b/ds-wms-service/DS.WMS.MainApi/Controllers/MappingCtnController.cs new file mode 100644 index 00000000..5e4238a8 --- /dev/null +++ b/ds-wms-service/DS.WMS.MainApi/Controllers/MappingCtnController.cs @@ -0,0 +1,92 @@ +using DS.Module.Core; +using DS.Module.Core.Data; +using DS.WMS.Core.Code.Dtos; +using DS.WMS.Core.Code.Interface; +using DS.WMS.Core.Map.Dtos; +using DS.WMS.Core.Map.Interface; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; + +namespace DS.WMS.MainApi.Controllers +{ + /// + /// 箱型映射信息 模块 + /// + public class MappingCtnController : ApiController + { + private readonly IMappingCtnService _invokeService; + + /// + /// 构造函数 + /// + /// + public MappingCtnController(IMappingCtnService invokeService) + { + _invokeService = invokeService; + } + /// + /// 列表 + /// + /// + /// + [HttpPost] + [Route("GetMappingCtnList")] + public DataResult> GetMappingCtnList([FromBody] PageRequest request) + { + var res = _invokeService.GetListByPage(request); + return res; + } + + /// + /// 编辑 + /// + /// + /// + [HttpPost] + [Route("EditMappingCtn")] + public DataResult EditMappingCtn([FromBody] MappingCtnReq req) + { + var res = _invokeService.EditMappingCtn(req); + return res; + } + + /// + /// 详情 + /// + /// Id + /// + [HttpGet] + [Route("GetMappingCtnInfo")] + public DataResult GetMappingCtnInfo([FromQuery] string id) + { + var res = _invokeService.GetMappingCtnInfo(id); + return res; + } + + /// + /// 删除 + /// + /// Id + /// + [HttpPost] + [Route("DelMappingCtn")] + public DataResult DelMappingCtn([FromBody] IdModel req) + { + var res = _invokeService.DelMappingCtn(req); + return res; + } + + /// + ///批量删除 + /// + /// Id + /// + [HttpPost] + [Route("BatchDelMappingCtn")] + public DataResult BatchDelMappingCtn([FromBody] IdModel req) + { + var res = _invokeService.BatchDelMappingCtn(req); + return res; + } + } +} diff --git a/ds-wms-service/DS.WMS.MainApi/Controllers/MappingYardController.cs b/ds-wms-service/DS.WMS.MainApi/Controllers/MappingYardController.cs new file mode 100644 index 00000000..a3872c61 --- /dev/null +++ b/ds-wms-service/DS.WMS.MainApi/Controllers/MappingYardController.cs @@ -0,0 +1,92 @@ +using DS.Module.Core; +using DS.Module.Core.Data; +using DS.WMS.Core.Code.Dtos; +using DS.WMS.Core.Code.Interface; +using DS.WMS.Core.Map.Dtos; +using DS.WMS.Core.Map.Interface; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; + +namespace DS.WMS.MainApi.Controllers +{ + /// + /// 场站映射信息 模块 + /// + public class MappingYardController : ApiController + { + private readonly IMappingYardService _invokeService; + + /// + /// 构造函数 + /// + /// + public MappingYardController(IMappingYardService invokeService) + { + _invokeService = invokeService; + } + /// + /// 列表 + /// + /// + /// + [HttpPost] + [Route("GetMappingYardList")] + public DataResult> GetMappingYardList([FromBody] PageRequest request) + { + var res = _invokeService.GetListByPage(request); + return res; + } + + /// + /// 编辑 + /// + /// + /// + [HttpPost] + [Route("EditMappingYard")] + public DataResult EditMappingYard([FromBody] MappingYardReq req) + { + var res = _invokeService.EditMappingYard(req); + return res; + } + + /// + /// 详情 + /// + /// Id + /// + [HttpGet] + [Route("GetMappingYardInfo")] + public DataResult GetMappingYardInfo([FromQuery] string id) + { + var res = _invokeService.GetMappingYardInfo(id); + return res; + } + + /// + /// 删除 + /// + /// Id + /// + [HttpPost] + [Route("DelMappingYard")] + public DataResult DelMappingYard([FromBody] IdModel req) + { + var res = _invokeService.DelMappingYard(req); + return res; + } + + /// + ///批量删除 + /// + /// Id + /// + [HttpPost] + [Route("BatchDelMappingYard")] + public DataResult BatchDelMappingYard([FromBody] IdModel req) + { + var res = _invokeService.BatchDelMappingYard(req); + return res; + } + } +} diff --git a/ds-wms-service/DS.WMS.Test/SaasTest.cs b/ds-wms-service/DS.WMS.Test/SaasTest.cs index 5df7600c..b591f643 100644 --- a/ds-wms-service/DS.WMS.Test/SaasTest.cs +++ b/ds-wms-service/DS.WMS.Test/SaasTest.cs @@ -34,7 +34,8 @@ public class SaasTest { Type[] types = Assembly .LoadFrom("DS.WMS.Core.dll")//如果 .dll报错,可以换成 xxx.exe 有些生成的是exe - .GetTypes().Where(it => it.FullName.Contains("DS.WMS.Core.Code.Entity.") || it.FullName.Contains("DS.WMS.Core.Info.Entity.") || it.FullName.Contains("DS.WMS.Core.Op.Entity.") || it.FullName.Contains("DS.WMS.Core.Fee.Entity."))//命名空间过滤,当然你也可以写其他条件过滤 + .GetTypes().Where(it => it.FullName.Contains("DS.WMS.Core.Code.Entity.") || it.FullName.Contains("DS.WMS.Core.Info.Entity.") || it.FullName.Contains("DS.WMS.Core.Op.Entity.") + || it.FullName.Contains("DS.WMS.Core.Fee.Entity.") || it.FullName.Contains("DS.WMS.Core.Map.Entity."))//命名空间过滤,当然你也可以写其他条件过滤 .ToArray(); var tenantDb = saasService.GetBizDbScopeById("1750335377144680448"); // var temp = tenantDb.CodeFirst.GetDifferenceTables(types);