From 78959d72873a1a6a16fc8e354d85d51bb86b277f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?ZR20090193-=E9=99=88=E6=95=AC=E5=8B=87?= Date: Fri, 19 Apr 2024 17:01:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=B9=E9=87=8F=E7=BC=96=E8=BE=91=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E5=8F=8A=E6=8C=87=E5=AE=9A=E5=88=97=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Constants/MultiLanguageConst.cs | 8 + .../DS.Module.Core/Enum/TenantTypeEnum.cs | 28 ++ .../Extensions/EntityExtensions.cs | 67 ++++ .../DS.Module.PrintModule/HttpUtillib.cs | 1 - .../Op/Dtos/SeaExportBatchEditReq.cs | 346 ++++++++++++++++++ .../Dtos/SeaExportBatchEditShipagencyReq.cs | 29 ++ .../DS.WMS.Core/Op/Dtos/SeaExportReq.cs | 90 +++-- .../DS.WMS.Core/Op/Dtos/SeaExportRes.cs | 83 ++++- .../DS.WMS.Core/Op/Entity/SeaExport.cs | 122 ++++-- .../Op/Interface/ISeaExportService.cs | 9 + .../DS.WMS.Core/Op/Method/SeaExportService.cs | 45 ++- .../Controllers/SeaExportController.cs | 13 + ds-wms-service/DS.WMS.Test/DS.WMS.Test.csproj | 2 +- ds-wms-service/DS.WMS.Test/SaasTest.cs | 57 ++- 14 files changed, 820 insertions(+), 80 deletions(-) create mode 100644 ds-wms-service/DS.Module.Core/Enum/TenantTypeEnum.cs create mode 100644 ds-wms-service/DS.WMS.Core/Op/Dtos/SeaExportBatchEditReq.cs create mode 100644 ds-wms-service/DS.WMS.Core/Op/Dtos/SeaExportBatchEditShipagencyReq.cs diff --git a/ds-wms-service/DS.Module.Core/Constants/MultiLanguageConst.cs b/ds-wms-service/DS.Module.Core/Constants/MultiLanguageConst.cs index 59cde91b..ad96cb7f 100644 --- a/ds-wms-service/DS.Module.Core/Constants/MultiLanguageConst.cs +++ b/ds-wms-service/DS.Module.Core/Constants/MultiLanguageConst.cs @@ -303,6 +303,14 @@ public static class MultiLanguageConst [Description("海运出口信息已存在")] public const string SeaExportExist = "Sea_Export_Exist"; + [Description("海运出口信息业务已锁定")] + public const string SeaExportBusinessLock = "Sea_Export_Business_Lock"; + [Description("海运出口信息费用已锁定")] + public const string SeaExportFeeLock = "Sea_Export_Fee_Lock"; + + [Description("海运出口批量编辑未勾选")] + public const string SeaExportBatchEditNoSelect = "Sea_Export_Batch_Edit_No_Select"; + [Description("函电信息不存在")] public const string LetterNotExist = "Letter_Not_Exist"; diff --git a/ds-wms-service/DS.Module.Core/Enum/TenantTypeEnum.cs b/ds-wms-service/DS.Module.Core/Enum/TenantTypeEnum.cs new file mode 100644 index 00000000..47cfbff1 --- /dev/null +++ b/ds-wms-service/DS.Module.Core/Enum/TenantTypeEnum.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DS.Module.Core +{ + /// + /// 租户类型枚举 + /// + [Description("租户类型枚举")] + public enum TenantTypeEnum + { + /// + /// 普通租户 + /// + [Description("普通租户")] + Common = 0, + + /// + /// 系统租户 + /// + [Description("系统租户")] + System = 1, + } +} diff --git a/ds-wms-service/DS.Module.Core/Extensions/EntityExtensions.cs b/ds-wms-service/DS.Module.Core/Extensions/EntityExtensions.cs index 3ffa4960..d358e7d5 100644 --- a/ds-wms-service/DS.Module.Core/Extensions/EntityExtensions.cs +++ b/ds-wms-service/DS.Module.Core/Extensions/EntityExtensions.cs @@ -118,6 +118,73 @@ public static class EntityExtensions return res; } + + /// + /// 获取实体有值内容 + /// + /// + /// + /// + public static Dictionary GetProperties(this T t) + { + Dictionary ret = new Dictionary(); + + if (t == null) + { + return null; + } + System.Reflection.PropertyInfo[] properties = t.GetType().GetProperties(System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public); + + if (properties.Length <= 0) + { + return null; + } + foreach (System.Reflection.PropertyInfo item in properties) + { + string name = item.Name; //实体类字段名称 + string value = item.GetValue(t, null).ToString(); //该字段的值 + + if (item.PropertyType.IsValueType || item.PropertyType.Name.StartsWith("String")) + { + ret.Add(name, value); //在此可转换value的类型 + } + } + + return ret; + } + /// + /// 获取实体有值内容 + /// + /// + /// + /// + public static string[] GetPropertiesArray(this T t) + { + List ret = new List(); + + if (t == null) + { + return null; + } + System.Reflection.PropertyInfo[] properties = t.GetType().GetProperties(System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public); + + if (properties.Length <= 0) + { + return null; + } + foreach (System.Reflection.PropertyInfo item in properties) + { + string name = item.Name; //实体类字段名称 + object value = item.GetValue(t, null); //该字段的值 + + if ((item.PropertyType.IsValueType || item.PropertyType.Name.StartsWith("String")) && value.IsNotNull()) + { + ret.Add(name); //在此可转换value的类型 + } + } + + return ret.ToArray(); + } } public class EntityFieldProperty diff --git a/ds-wms-service/DS.Module.PrintModule/HttpUtillib.cs b/ds-wms-service/DS.Module.PrintModule/HttpUtillib.cs index 438bbb27..e7bb207c 100644 --- a/ds-wms-service/DS.Module.PrintModule/HttpUtillib.cs +++ b/ds-wms-service/DS.Module.PrintModule/HttpUtillib.cs @@ -8,7 +8,6 @@ using System.Net.Security; using System.Security.Cryptography.X509Certificates; using System.Text; using System.Threading.Tasks; -using static SKIT.FlurlHttpClient.Wechat.Api.Models.TCBGetPressureTestReportResponse.Types; using static System.Net.Mime.MediaTypeNames; namespace DS.Module.PrintModule diff --git a/ds-wms-service/DS.WMS.Core/Op/Dtos/SeaExportBatchEditReq.cs b/ds-wms-service/DS.WMS.Core/Op/Dtos/SeaExportBatchEditReq.cs new file mode 100644 index 00000000..4c9e203e --- /dev/null +++ b/ds-wms-service/DS.WMS.Core/Op/Dtos/SeaExportBatchEditReq.cs @@ -0,0 +1,346 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DS.WMS.Core.Op.Dtos +{ + /// + /// 海运出口批量编辑请求 + /// + public class SeaExportBatchEditReq + { + /// + /// 业务Ids + /// + public List Ids { get; set; } + /// + /// 场站Id t_crm_client CUSTNAME + /// + public long YardId { get; set; } + /// + /// 场站 t_crm_client CUSTNAME + /// + public string Yard { get; set; } + + /// + /// 船公司Id + /// + public long CarrierId { get; set; } + /// + /// 船公司 + /// + public string Carrier { get; set; } + /// + /// 货代公司Id + /// + public long ForwarderId { get; set; } + /// + /// 货代公司 + /// + public string Forwarder { get; set; } + + /// + /// 分提单号 + /// + public string HBLNO { get; set; } + + /// + /// 航线Id + /// + public long LaneId { get; set; } + + /// + /// 航线 + /// + public string Lane { get; set; } + /// + /// 揽货人Id + /// + public long SaleId { get; set; } + /// + /// 揽货人 + /// + public string Sale { get; set; } + + /// + /// 报关行Id + /// + public long CustomserId { get; set; } + /// + /// 报关行 + /// + public string Customser { get; set; } + + /// + /// 承运车队Id + /// + public long TruckerId { get; set; } + /// + /// 承运车队 + /// + public string Trucker { get; set; } + + /// + /// 装货港代码 + /// + public long LoadPortId { get; set; } + + /// + /// 装货港 + /// + public string LoadPort { get; set; } + + /// + /// 卸货港代码 + /// + public long DischargePortId { get; set; } + + /// + /// 卸货港 + /// + public string DischargePort { get; set; } + + /// + /// 船名 + /// + public string Vessel { get; set; } + + /// + /// 船名Id + /// + public long VesselId { get; set; } + /// + /// 内部航次 + /// + public string InnerVoyno { get; set; } + /// + /// 航次 + /// + public string Voyno { get; set; } + + /// + /// 国外代理人Id t_info_client CUSTNAME + /// + public long? AgentId { get; set; } + /// + /// 国外代理人 t_info_client CUSTNAME + /// + public string Agent { get; set; } + + /// + /// 装运方式 整箱、拼箱单票、拼箱主票、拼箱分票 + /// + public string BLType { get; set; } + + /// + /// Desc:单证 + /// + public long Doc { get; set; } + + /// + /// 客服 + /// + public long CustomerService { get; set; } + + /// + /// 海外客服 + /// + public long ForeignCustomerService { get; set; } + /// + /// 操作员 + /// + public long OperatorId { get; set; } + /// + /// ATD + /// + public DateTime? ATD { get; set; } + /// + /// 开船日期 + /// + public DateTime? ETD { get; set; } + /// + /// 截港日期 + /// + public DateTime? ClosingDate { get; set; } + /// + /// 截单日期 + /// + public DateTime? CloseDocDate { get; set; } + + /// + /// 运费协议号 + /// + public string ContractNo { get; set; } + + + /// + /// Desc:服务合同号 + /// + public string ServiceContractNo { get; set; } + + /// + /// Desc:业务来源Id + /// + public long SourceId { get; set; } + + /// + /// Desc:业务来源明细Id + /// + public long SourceDetailId { get; set; } + + + + /// + /// 船代Id + /// + public long ShipAgencyId { get; set; } + + /// + /// 船代 + /// + public long ShipAgency { get; set; } + + + + ///// + ///// 海关航次 + ///// + //public string Voyno { get; set; } + + + /// + /// 目的地代码 + /// + public string DestinationId { get; set; } + /// + /// 目的地 + /// + public string Destination { get; set; } + /// + /// 交货地代码 + /// + public long DeliveryPlaceId { get; set; } + + /// + /// 交货地 + /// + public string DeliveryPlace { get; set; } + + + + /// + /// 签单日期 + /// + public DateTime? IssueDate { get; set; } + + /// + /// 签单地点Id + /// + public long IssuePlaceId { get; set; } + + /// + /// 签单地点 + /// + public string IssuePlace { get; set; } + /// + /// Desc:海关代码 + /// + public string HSCode { get; set; } + + /// + /// Desc:订舱编号 + /// + public string OrderNo { get; set; } + + /// + /// Desc:所属业务部门 + /// + public long SaleDeptId { get; set; } + + /// + /// 代理内容 + /// + public string AgentContent { get; set; } + + /// + /// Desc:备注 + /// + public string Remark { get; set; } + + /// + /// 委托单位Id + /// + public long CustomerId { get; set; } + /// + /// 委托单位 t_info_client CUSTNAME + /// + public string CustomerName { get; set; } + + /// + /// 财务日期 + /// + public string AccountDate { get; set; } + /// + /// 销售公司Id + /// + public long SaleOrgId { get; set; } + + /// + /// 货物标识 S/R/D/O + /// + public string CargoId { get; set; } + /// + /// 设置温度 + /// + public string TemperatureSet { get; set; } + + + /// + /// 场站联系人 + /// + public string YardATTN { get; set; } + + /// + /// 场站联系方式 + /// + public string YardTel { get; set; } + + + /// + /// Desc:报检 + /// + public bool? IsInspection { get; set; } = false; + + /// + /// Desc:仅报关 + /// + public bool? IsCustoms { get; set; } = false; + + /// + /// Desc:订舱 + /// + public bool? IsBooking { get; set; } = false; + /// + /// Desc:分单签单 + /// + public bool? IsHBLNO { get; set; } = false; + + /// + /// Desc:陆运 + /// + public bool? IsLand { get; set; } = false; + + /// + /// Desc:使用代理 + /// + public bool? IsAgent { get; set; } = false; + + /// + /// Desc:仓储 + /// + public bool? IsStorage { get; set; } = false; + } +} diff --git a/ds-wms-service/DS.WMS.Core/Op/Dtos/SeaExportBatchEditShipagencyReq.cs b/ds-wms-service/DS.WMS.Core/Op/Dtos/SeaExportBatchEditShipagencyReq.cs new file mode 100644 index 00000000..634d9372 --- /dev/null +++ b/ds-wms-service/DS.WMS.Core/Op/Dtos/SeaExportBatchEditShipagencyReq.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DS.WMS.Core.Op.Dtos +{ + /// + /// + /// + public class SeaExportBatchEditShipagencyReq + { + /// + /// 业务Ids + /// + public List Ids { get; set; } + + /// + /// 船代 + /// + public string ShipAgency { get; set; } + + /// + /// 船代ID + /// + public string ShipAgencyId { get; set; } + } +} 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 d9e34dd8..28b92c08 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Dtos/SeaExportReq.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Dtos/SeaExportReq.cs @@ -1,5 +1,6 @@ using DS.Module.Core; using FluentValidation; +using SqlSugar; namespace DS.WMS.Core.Op.Dtos; @@ -13,16 +14,11 @@ public class SeaExportReq /// public long Id { get; set; } - /// - /// 业务编号 - /// - public string BSNO { get; set; } - /// - /// 主票业务编号 + /// 主单Id /// - public string MasterNo { get; set; } - + public long ParentId { get; set; } = 0; + /// /// 业务状态 /// @@ -38,6 +34,16 @@ public class SeaExportReq /// public DateTime BillFeeStatusTime { get; set; } + ///// + ///// Desc:是否业务锁定 + ///// + //[SugarColumn(ColumnDescription = "是否业务锁定", DefaultValue = "0")] + //public bool? IsBusinessLocking { get; set; } = false; + ///// + ///// Desc:是否费用锁定 + ///// + //[SugarColumn(ColumnDescription = "是否费用锁定", DefaultValue = "0")] + //public bool? IsFeeLocking { get; set; } = false; /// /// 费用状态 /// @@ -73,6 +79,10 @@ public class SeaExportReq /// public string TransNo { get; set; } + /// + /// 委托单位Id + /// + public long CustomerId { get; set; } /// /// 委托单位 t_info_client CUSTNAME /// @@ -98,10 +108,15 @@ public class SeaExportReq /// public long? NotifyPartyId { get; set; } + /// - /// 国外代理人 t_info_client CUSTNAME + /// 国外代理人Id t_info_client CUSTNAME /// public long? AgentId { get; set; } + /// + /// 国外代理人 t_info_client CUSTNAME + /// + public string Agent { get; set; } /// /// 发货人内容 @@ -123,6 +138,10 @@ public class SeaExportReq /// public string AgentContent { get; set; } + /// + /// 场站Id t_crm_client CUSTNAME + /// + public long YardId { get; set; } /// /// 场站 t_crm_client CUSTNAME /// @@ -414,35 +433,59 @@ public class SeaExportReq /// public long ForeignCustomerService { get; set; } + /// - /// 航线 + /// 航线Id /// public long LaneId { get; set; } + /// + /// 航线 + /// + public string Lane { get; set; } + /// + /// 揽货人Id + /// + public long SaleId { get; set; } /// /// 揽货人 /// - public long Sale { get; set; } - + public string Sale { get; set; } + /// + /// 船公司Id + /// + public long CarrierId { get; set; } /// /// 船公司 /// - public long Carrier { get; set; } + public string Carrier { get; set; } + /// + /// 货代公司Id + /// + public long ForwarderId { get; set; } /// /// 货代公司 /// - public long Forwarder { get; set; } + public string Forwarder { get; set; } + /// + /// 报关行Id + /// + public long CustomserId { get; set; } /// /// 报关行 /// - public long Customser { get; set; } + public string Customser { get; set; } + /// + /// 承运车队Id + /// + public long TruckerId { get; set; } /// /// 承运车队 /// - public long Trucker { get; set; } + public string Trucker { get; set; } /// @@ -639,7 +682,7 @@ public class SeaExportReq /// /// Desc:单证 /// - public string Doc { get; set; } + public long Doc { get; set; } /// /// Desc:装箱类型 @@ -686,6 +729,10 @@ public class SeaExportReq /// Desc:委托方式 /// public string OrderType { get; set; } + /// + /// Desc:订舱编号 + /// + public string OrderNo { get; set; } /// /// Desc:操作员代码 @@ -835,6 +882,11 @@ public class SeaExportReq /// public long ShipAgencyId { get; set; } + /// + /// 船代 + /// + public long ShipAgency { get; set; } + /// /// Desc:湿度 /// @@ -980,10 +1032,6 @@ public class SeaExportReqValidator : AbstractValidator /// public SeaExportReqValidator() { - this.RuleFor(o => o.BSNO) - .NotEmpty().WithName("业务编号"); - this.RuleFor(o => o.MasterNo) - .NotEmpty().WithName("主票业务编号"); this.RuleFor(o => o.BusinessDate) .NotEmpty().WithName("录入日期"); this.RuleFor(o => o.AccountDate) 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 0d142fdb..60f50497 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Dtos/SeaExportRes.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Dtos/SeaExportRes.cs @@ -1,4 +1,5 @@ using DS.Module.Core; +using SqlSugar; namespace DS.WMS.Core.Op.Dtos; @@ -13,15 +14,10 @@ public class SeaExportRes public long Id { get; set; } /// - /// 业务编号 + /// 主单Id /// - public string BSNO { get; set; } - - /// - /// 主票业务编号 - /// - public string MasterNo { get; set; } - + public long ParentId { get; set; } + /// /// 业务状态 /// @@ -42,6 +38,14 @@ public class SeaExportRes /// public int FeeStatus { get; set; } + /// + /// Desc:是否业务锁定 + /// + public bool? IsBusinessLocking { get; set; } = false; + /// + /// Desc:是否费用锁定 + /// + public bool? IsFeeLocking { get; set; } = false; /// /// 录入日期 /// @@ -72,6 +76,10 @@ public class SeaExportRes /// public string TransNo { get; set; } + /// + /// 委托单位Id + /// + public long CustomerId { get; set; } /// /// 委托单位 t_info_client CUSTNAME /// @@ -97,10 +105,15 @@ public class SeaExportRes /// public long? NotifyPartyId { get; set; } + /// - /// 国外代理人 t_info_client CUSTNAME + /// 国外代理人Id t_info_client CUSTNAME /// public long? AgentId { get; set; } + /// + /// 国外代理人 t_info_client CUSTNAME + /// + public string Agent { get; set; } /// /// 发货人内容 @@ -122,6 +135,10 @@ public class SeaExportRes /// public string AgentContent { get; set; } + /// + /// 场站Id t_crm_client CUSTNAME + /// + public long YardId { get; set; } /// /// 场站 t_crm_client CUSTNAME /// @@ -413,35 +430,60 @@ public class SeaExportRes /// public long ForeignCustomerService { get; set; } + /// - /// 航线 + /// 航线Id /// public long LaneId { get; set; } + /// + /// 航线 + /// + public string Lane { get; set; } + /// + /// 揽货人Id + /// + public long SaleId { get; set; } /// /// 揽货人 /// - public long Sale { get; set; } + public string Sale { get; set; } + /// + /// 船公司Id + /// + public long CarrierId { get; set; } /// /// 船公司 /// - public long Carrier { get; set; } + public string Carrier { get; set; } + /// + /// 货代公司Id + /// + public long ForwarderId { get; set; } /// /// 货代公司 /// - public long Forwarder { get; set; } + public string Forwarder { get; set; } + /// + /// 报关行Id + /// + public long CustomserId { get; set; } /// /// 报关行 /// - public long Customser { get; set; } + public string Customser { get; set; } + /// + /// 承运车队Id + /// + public long TruckerId { get; set; } /// /// 承运车队 /// - public long Trucker { get; set; } + public string Trucker { get; set; } /// @@ -638,7 +680,7 @@ public class SeaExportRes /// /// Desc:单证 /// - public string Doc { get; set; } + public long Doc { get; set; } /// /// Desc:装箱类型 @@ -686,6 +728,11 @@ public class SeaExportRes /// public string OrderType { get; set; } + /// + /// Desc:订舱编号 + /// + public string OrderNo { get; set; } + /// /// Desc:操作员代码 /// @@ -834,6 +881,10 @@ public class SeaExportRes /// public long ShipAgencyId { get; set; } + /// + /// 船代 + /// + public long ShipAgency { 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 0821819b..12a2662c 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Entity/SeaExport.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Entity/SeaExport.cs @@ -8,19 +8,13 @@ namespace DS.WMS.Core.Op.Entity; /// [SqlSugar.SugarTable("op_sea_export", "海运出口表")] public class SeaExport : BaseOrgModel -{ - /// - /// 业务编号 - /// - [SqlSugar.SugarColumn(ColumnDescription = "业务编号", IsNullable = false, Length = 100)] - public string BSNO { get; set; } +{ /// - /// 主票业务编号 + /// 主单Id /// - [SqlSugar.SugarColumn(ColumnDescription = "主票业务编号", IsNullable = false, Length = 100)] - public string MasterNo { get; set; } - + [SqlSugar.SugarColumn(ColumnDescription = "主单Id", IsNullable = false,DefaultValue = "0")] + public long ParentId { get; set; } /// /// 业务状态 /// @@ -45,6 +39,17 @@ public class SeaExport : BaseOrgModel [SqlSugar.SugarColumn(ColumnDescription = "费用状态", IsNullable = false, DefaultValue = "0")] public int FeeStatus { get; set; } + + /// + /// Desc:是否业务锁定 + /// + [SugarColumn(ColumnDescription = "是否业务锁定", DefaultValue = "0")] + public bool? IsBusinessLocking { get; set; } = false; + /// + /// Desc:是否费用锁定 + /// + [SugarColumn(ColumnDescription = "是否费用锁定", DefaultValue = "0")] + public bool? IsFeeLocking { get; set; } = false; /// /// 录入日期 /// @@ -80,7 +85,11 @@ public class SeaExport : BaseOrgModel /// [SqlSugar.SugarColumn(ColumnDescription = "运单号", IsNullable = true, Length = 30)] public string TransNo { get; set; } - + /// + /// 委托单位Id + /// + [SqlSugar.SugarColumn(ColumnDescription = "委托单位Id", IsNullable = false, DefaultValue = "0")] + public long CustomerId { get; set; } /// /// 委托单位 t_info_client CUSTNAME /// @@ -112,11 +121,15 @@ public class SeaExport : BaseOrgModel public long? NotifyPartyId { get; set; } /// - /// 国外代理人 t_info_client CUSTNAME + /// 国外代理人Id t_info_client CUSTNAME /// - [SqlSugar.SugarColumn(ColumnDescription = "国外代理人", IsNullable = true)] + [SqlSugar.SugarColumn(ColumnDescription = "国外代理人Id", IsNullable = true)] public long? AgentId { get; set; } - + /// + /// 国外代理人 t_info_client CUSTNAME + /// + [SqlSugar.SugarColumn(ColumnDescription = "国外代理人", IsNullable = true, Length = 600)] + public string Agent { get; set; } /// /// 发货人内容 /// @@ -141,10 +154,15 @@ public class SeaExport : BaseOrgModel [SqlSugar.SugarColumn(ColumnDescription = "国外代理内容", IsNullable = true, Length = 600)] public string AgentContent { get; set; } + /// + /// 场站Id t_crm_client CUSTNAME + /// + [SqlSugar.SugarColumn(ColumnDescription = "场站Id", IsNullable = true, DefaultValue ="0")] + public long YardId { get; set; } /// /// 场站 t_crm_client CUSTNAME /// - [SqlSugar.SugarColumn(ColumnDescription = "场站", IsNullable = true, Length = 20)] + [SqlSugar.SugarColumn(ColumnDescription = "场站", IsNullable = true, Length = 100)] public string Yard { get; set; } /// @@ -491,41 +509,68 @@ public class SeaExport : BaseOrgModel public long ForeignCustomerService { get; set; } /// - /// 航线 + /// 航线Id /// - [SugarColumn(ColumnDescription = "航线", IsNullable = true, DefaultValue = "0")] + [SugarColumn(ColumnDescription = "航线Id", IsNullable = true, DefaultValue = "0")] public long LaneId { get; set; } /// - /// 揽货人 + /// 航线 /// - [SugarColumn(ColumnDescription = "揽货人", IsNullable = true, DefaultValue = "0")] - public long Sale { get; set; } + [SugarColumn(ColumnDescription = "航线", IsNullable = true, Length = 100 )] + public string Lane { get; set; } + /// + /// 揽货人Id + /// + [SugarColumn(ColumnDescription = "揽货人Id", IsNullable = true, DefaultValue = "0")] + public long SaleId { get; set; } + /// + /// 揽货人 + /// + [SugarColumn(ColumnDescription = "揽货人", IsNullable = true, Length = 100)] + public string Sale { get; set; } + /// + /// 船公司Id + /// + [SugarColumn(ColumnDescription = "船公司Id", IsNullable = true, DefaultValue = "0")] + public long CarrierId { get; set; } /// /// 船公司 /// - [SugarColumn(ColumnDescription = "船公司", IsNullable = true, DefaultValue = "0")] - public long Carrier { get; set; } - + [SugarColumn(ColumnDescription = "船公司", IsNullable = true, Length = 100)] + public string Carrier { get; set; } + /// + /// 货代公司Id + /// + [SugarColumn(ColumnDescription = "货代公司Id", IsNullable = true, DefaultValue = "0")] + public long ForwarderId { get; set; } /// /// 货代公司 /// - [SugarColumn(ColumnDescription = "货代公司", IsNullable = true, DefaultValue = "0")] - public long Forwarder { get; set; } + [SugarColumn(ColumnDescription = "货代公司", IsNullable = true, Length = 100)] + public string Forwarder { get; set; } + /// + /// 报关行Id + /// + [SugarColumn(ColumnDescription = "报关行Id", IsNullable = true, DefaultValue = "0")] + public long CustomserId { get; set; } /// /// 报关行 /// - [SugarColumn(ColumnDescription = "报关行", IsNullable = true, DefaultValue = "0")] - public long Customser { get; set; } - + [SugarColumn(ColumnDescription = "报关行", IsNullable = true, Length = 100)] + public string Customser { get; set; } + /// + /// 承运车队Id + /// + [SugarColumn(ColumnDescription = "承运车队Id", IsNullable = true, DefaultValue = "0")] + public long TruckerId { get; set; } /// /// 承运车队 /// - [SugarColumn(ColumnDescription = "承运车队", IsNullable = true, DefaultValue = "0")] - public long Trucker { get; set; } - + [SugarColumn(ColumnDescription = "承运车队", IsNullable = true, Length = 100)] + public string Trucker { get; set; } /// /// 发票号 @@ -759,8 +804,8 @@ public class SeaExport : BaseOrgModel /// /// Desc:单证 /// - [SugarColumn(ColumnDescription = "单证", IsNullable = true, Length = 10)] - public string Doc { get; set; } + [SugarColumn(ColumnDescription = "单证", IsNullable = true, DefaultValue = "0")] + public long Doc { get; set; } /// /// Desc:装箱类型 @@ -817,6 +862,12 @@ public class SeaExport : BaseOrgModel [SugarColumn(ColumnDescription = "委托方式", IsNullable = true, Length = 10)] public string OrderType { get; set; } + /// + /// Desc:订舱编号 + /// + [SugarColumn(ColumnDescription = "订舱编号", IsNullable = true, Length = 100)] + public string OrderNo { get; set; } + /// /// Desc:操作员代码 /// @@ -988,6 +1039,11 @@ public class SeaExport : BaseOrgModel [SugarColumn(ColumnDescription = "报检项目", Length = 20, IsNullable = true)] public string InsperctService { get; set; } + /// + /// 船代 + /// + [SqlSugar.SugarColumn(ColumnDescription = "船代", IsNullable = true,Length = 100)] + public long ShipAgency { get; set; } /// /// 船代Id /// diff --git a/ds-wms-service/DS.WMS.Core/Op/Interface/ISeaExportService.cs b/ds-wms-service/DS.WMS.Core/Op/Interface/ISeaExportService.cs index 1261039c..a5881aa8 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Interface/ISeaExportService.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Interface/ISeaExportService.cs @@ -26,4 +26,13 @@ public interface ISeaExportService /// /// DataResult GetSeaExportInfo(string id); + + + /// + /// 批量编辑单据 + /// + /// + /// + DataResult SeaExportBatchEdit(SeaExportBatchEditReq req); + } \ No newline at end of file diff --git a/ds-wms-service/DS.WMS.Core/Op/Method/SeaExportService.cs b/ds-wms-service/DS.WMS.Core/Op/Method/SeaExportService.cs index 008db3c4..e1cdd2bb 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Method/SeaExportService.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Method/SeaExportService.cs @@ -55,9 +55,9 @@ public class SeaExportService:ISeaExportService if (req.Id == 0) { - if (tenantDb.Queryable().Where(x=>x.MasterNo == req.MasterNo.Trim()).Any()) + if (tenantDb.Queryable().Where(x=>x.CustomerNo == req.CustomerNo.Trim()).Any()) { - return DataResult.Failed("客户银行信息已存在!",MultiLanguageConst.SeaExportExist); + return DataResult.Failed("海运出口信息已存在!",MultiLanguageConst.SeaExportExist); } var data = req.Adapt(); @@ -90,4 +90,45 @@ public class SeaExportService:ISeaExportService .First(); return DataResult.Success(data,MultiLanguageConst.DataQuerySuccess); } + /// + /// 批量更新 + /// + /// + /// + public DataResult SeaExportBatchEdit(SeaExportBatchEditReq req) + { + var tenantDb = saasService.GetBizDbScopeById(user.TenantId); + if (req.Ids.Count == 0) + { + return DataResult.Failed("海运出口批量编辑未勾选!", MultiLanguageConst.SeaExportBatchEditNoSelect); + } + if (tenantDb.Queryable().Where(x => !req.Ids.Contains(x.Id)).Any()) + { + return DataResult.Failed("不存在的海运出口信息!", MultiLanguageConst.SeaExportExist); + } + if (tenantDb.Queryable().Where(x => req.Ids.Contains(x.Id)&& x.IsBusinessLocking == true).Any()) + { + return DataResult.Failed("海运出口信息业务已锁定!", MultiLanguageConst.SeaExportBusinessLock); + } + + if (req.AccountDate.ToString().IsNotNull()) + { + if (tenantDb.Queryable().Where(x => req.Ids.Contains(x.Id) && x.IsFeeLocking == true).Any()) + { + return DataResult.Failed("海运出口信息费用已锁定!", MultiLanguageConst.SeaExportFeeLock); + } + } + var orderList = tenantDb.Queryable().Where(x => req.Ids.Contains(x.Id)).ToList(); + + var dic = req.GetPropertiesArray(); + + foreach (var item in orderList) + { + var info = item; + info = req.Adapt(info); + tenantDb.Updateable(info).UpdateColumns(dic).EnableDiffLogEvent().ExecuteCommand(); + } + + return DataResult.Successed("更新成功!", MultiLanguageConst.DataUpdateSuccess); + } } \ No newline at end of file diff --git a/ds-wms-service/DS.WMS.OpApi/Controllers/SeaExportController.cs b/ds-wms-service/DS.WMS.OpApi/Controllers/SeaExportController.cs index 95dec429..e5d6e768 100644 --- a/ds-wms-service/DS.WMS.OpApi/Controllers/SeaExportController.cs +++ b/ds-wms-service/DS.WMS.OpApi/Controllers/SeaExportController.cs @@ -63,4 +63,17 @@ public class SeaExportController : ApiController var res = _invokeService.GetSeaExportInfo(id); return res; } + + /// + /// 批量编辑 + /// + /// + /// + [HttpPost] + [Route("SeaExportBatchEdit")] + public DataResult SeaExportBatchEdit([FromBody] SeaExportBatchEditReq req) + { + var res = _invokeService.SeaExportBatchEdit(req); + return res; + } } \ No newline at end of file diff --git a/ds-wms-service/DS.WMS.Test/DS.WMS.Test.csproj b/ds-wms-service/DS.WMS.Test/DS.WMS.Test.csproj index 0cae444a..06db10a7 100644 --- a/ds-wms-service/DS.WMS.Test/DS.WMS.Test.csproj +++ b/ds-wms-service/DS.WMS.Test/DS.WMS.Test.csproj @@ -10,7 +10,7 @@ - + diff --git a/ds-wms-service/DS.WMS.Test/SaasTest.cs b/ds-wms-service/DS.WMS.Test/SaasTest.cs index fbea0b98..1f045639 100644 --- a/ds-wms-service/DS.WMS.Test/SaasTest.cs +++ b/ds-wms-service/DS.WMS.Test/SaasTest.cs @@ -2,8 +2,12 @@ using System.Reflection; using DS.Module.Core; using DS.Module.Core.Extensions; using DS.Module.SqlSugar; +using DS.WMS.Core.Info.Entity; using DS.WMS.Core.System.Entity; +using Mapster; using Microsoft.Extensions.DependencyInjection; +using Microsoft.Owin.BuilderProperties; +using Org.BouncyCastle.Ocsp; using SqlSugar; using SqlSugar.IOC; using Xunit; @@ -23,16 +27,16 @@ public class SaasTest } [Fact] - public void SaasTest1() + public void SaasTest1() { - Type[] types= Assembly + 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."))//命名空间过滤,当然你也可以写其他条件过滤 .ToArray(); var tenantDb = saasService.GetBizDbScopeById("1750335377144680448"); // var temp = tenantDb.CodeFirst.GetDifferenceTables(types); // var diffString= tenantDb.CodeFirst.GetDifferenceTables(types).ToDiffString(); - StaticConfig.CodeFirst_MySqlCollate="utf8mb4_0900_ai_ci";//较高版本支持 + StaticConfig.CodeFirst_MySqlCollate = "utf8mb4_0900_ai_ci";//较高版本支持 tenantDb.CodeFirst.InitTables(types); // //初始化数库 // tenantDb.DbMaintenance.CreateDatabase(); @@ -40,7 +44,48 @@ public class SaasTest // tenantDb.CodeFirst.InitTables(typeof(CodeCountry)); Assert.True(true); } + [Fact] + + public void ClientBatchEdit() + { + var tenantDb = saasService.GetBizDbScopeById("1750335377144680448"); + + var info = tenantDb.Queryable().Filter(null,true).Where(x => x.Id == 1772138307266940928).First(); + + var temp = new ClientTemp + { + Address = "4", + Name = "4", + }; + var dic = temp.GetPropertiesArray(); + + info = temp.Adapt(info); + tenantDb.Updateable(info).UpdateColumns(dic).ExecuteCommand(); + - - + Assert.True(true); + } + + public class ClientTemp + { + /// + /// Desc:客户中文名称或描述信息 + /// + public string Description { get; set; } + + /// + /// Desc:客户英文简称 + /// + public string Name { get; set; } + + /// + /// Desc:客户英文全称 + /// + public string EnFullName { get; set; } + + /// + /// Desc:通讯地址 + /// + public string Address { get; set; } + } } \ No newline at end of file