From 466b7688470f8f2368afca59d4f08b159ea53d11 Mon Sep 17 00:00:00 2001 From: wet <1034391973@qq.com> Date: Wed, 4 Jan 2023 08:54:46 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=88=86=E6=8F=90=E5=8D=95=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/BookingOrder/BookingOrderService.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs index eed58ca0..57748a00 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs @@ -145,7 +145,8 @@ namespace Myshipping.Application { List userlist = await _right.GetDataScopeList(351064299098181); //List userlist = await DataFilterExtensions.GetDataScopeIdList(); - var entities = await _rep.AsQueryable().Where(x => x.ParentId == 0) + var entities = await _rep.AsQueryable(). + WhereIF(string.IsNullOrWhiteSpace(input.HBLNO),x => x.ParentId == 0) .WhereIF(!string.IsNullOrWhiteSpace(input.BSNO), u => u.BSNO.Contains(input.BSNO)) .WhereIF(!string.IsNullOrWhiteSpace(input.BSSTATUS), u => u.BSSTATUS == input.BSSTATUS) .WhereIF(input.BBSDATE != null, u => u.BSDATE >= input.BBSDATE) From 2831c5483ae9b3c7d2061a61d9aa2f5956806afd Mon Sep 17 00:00:00 2001 From: wet <1034391973@qq.com> Date: Wed, 4 Jan 2023 10:44:15 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=AE=9A=E6=97=B6=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Myshipping.Application/Entity/BookingCtn.cs | 23 +++++- .../Entity/BookingEDIExt.cs | 28 ++++++- .../Myshipping.Application.xml | 5 ++ .../BookingOrder/BookingOrderService.cs | 62 -------------- .../BookingTemplate/BookingTemplateService.cs | 45 +++++++++- Myshipping.Core/Entity/DJY/DjyVesselInfo.cs | 74 +++++++++++++++++ Myshipping.Core/Job/LogJobWorker.cs | 22 +++-- Myshipping.Core/Myshipping.Core.xml | 82 ++++++++++++++++++- .../DjyVesselInfo/DjyVesselInfoService.cs | 38 +++++---- .../DjyVesselInfo/IDjyVesselInfoService.cs | 2 +- 10 files changed, 293 insertions(+), 88 deletions(-) diff --git a/Myshipping.Application/Entity/BookingCtn.cs b/Myshipping.Application/Entity/BookingCtn.cs index 37ea76e9..e1660568 100644 --- a/Myshipping.Application/Entity/BookingCtn.cs +++ b/Myshipping.Application/Entity/BookingCtn.cs @@ -14,92 +14,113 @@ namespace Myshipping.Application.Entity /// /// 单据ID /// - [Description("单据ID")] + public long? BILLID { get; set; } /// /// 箱型代码 /// + [Description("箱型代码")] public string CTNCODE { get; set; } /// /// 箱型 /// + [Description("箱型")] public string CTNALL { get; set; } /// /// 箱量 /// + [Description("箱量")] public int? CTNNUM { get; set; } /// /// TEU /// + [Description("TEU")] public int? TEU { get; set; } /// /// 箱号 /// + [Description("箱号")] public string CNTRNO { get; set; } /// /// 封号 /// + [Description("封号")] public string SEALNO { get; set; } /// /// 件数 /// + [Description("件数")] public int? PKGS { get; set; } /// /// 包装 /// + [Description("包装")] public string KINDPKGS { get; set; } /// /// 毛重 /// + [Description("毛重")] public decimal? KGS { get; set; } /// /// 尺码 /// + [Description("尺码")] public decimal? CBM { get; set; } /// /// 皮重 /// + [Description("皮重")] public decimal? TAREWEIGHT { get; set; } /// /// 箱状态 /// + [Description("箱状态")] public string CTNSTATUS { get; set; } /// /// 称重方式 /// + [Description("称重方式")] public string WEIGHTYPE { get; set; } /// /// 称重重量 /// + [Description("称重重量")] public decimal? WEIGHKGS { get; set; } /// /// 称重联系人 /// + [Description("称重联系人")] public string WEIGHATTN { get; set; } /// /// VGM联系公司 /// + [Description("VGM联系公司")] public string VGMCONNCOM { get; set; } /// /// VGM联系电话 /// + [Description("VGM联系电话")] public string WEIGHTEL { get; set; } /// /// 称重日期 /// + [Description("称重日期")] public string WEIGHDATE { get; set; } /// /// VGM地址 /// + [Description("VGM地址")] public string VGMADDR { get; set; } /// /// VGM邮箱 /// + [Description("VGM邮箱")] public string VGMEMAIL { get; set; } /// /// 备注 /// + [Description("备注")] public string REMARK { get; set; } } } \ No newline at end of file diff --git a/Myshipping.Application/Entity/BookingEDIExt.cs b/Myshipping.Application/Entity/BookingEDIExt.cs index aae20876..ccd896f0 100644 --- a/Myshipping.Application/Entity/BookingEDIExt.cs +++ b/Myshipping.Application/Entity/BookingEDIExt.cs @@ -14,136 +14,162 @@ namespace Myshipping.Application.Entity /// /// 订舱ID /// - [Description("订舱ID")] + public long? BookingId { get; set; } /// /// 委托方 /// + [Description("委托方")] public string WeiTuoFang { get; set; } /// /// 发送方EDI代码 /// + [Description("发送方EDI代码")] public string SendCode { get; set; } /// /// 接收方EDI代码 /// + [Description("接收方EDI代码")] public string ReceiveCode { get; set; } /// /// 通知放EDI代码 /// + [Description("通知放EDI代码")] public string NotifyCdoe { get; set; } /// /// 销售EDI代码 /// + [Description("销售EDI代码")] public string SalerCode { get; set; } /// /// Master Bol Indicator /// + [Description("Master Bol Indicator")] public string MasterBolIndicator { get; set; } /// /// EMANIFEST HBL /// + [Description("EMANIFEST HBL")] public string EmanifestHbl { get; set; } /// /// 收货人EDI代码 /// + [Description("收货人EDI代码")] public string ConsigneeEdiCode { get; set; } /// /// 发货人EDI代码 /// + [Description("发货人EDI代码")] public string ShipperEdiCode { get; set; } /// /// EDI联系人名称 /// + [Description("EDI联系人名称")] public string EDIAttn { get; set; } /// /// EDI联系人电话 /// + [Description("EDI联系人电话")] public string EDIAttnTel { get; set; } /// /// EDI联系人邮箱 /// + [Description("EDI联系人邮箱")] public string EDIAttnMail { get; set; } /// /// AMS收货人 /// + [Description("AMS收货人")] public string AMSConsignee { get; set; } /// /// AMS通知人 /// + [Description("AMS通知人")] public string AMSNotifyParty { get; set; } /// /// 操作英文名称 /// + [Description("操作英文名称")] public string OpEName { get; set; } /// /// 操作电话 /// + [Description("操作电话")] public string OpTel { get; set; } /// /// 操作邮箱 /// + [Description("操作邮箱")] public string OpEmail { get; set; } /// /// ACI HBL /// + [Description("ACI HBL")] public string ACIHBL { get; set; } /// /// S0C C0C /// + [Description("S0C C0C")] public string S0CC0C { get; set; } /// /// 商品名称 /// + [Description("商品名称")] public string GoodsName { get; set; } /// /// Master Bol Indicator名称 /// + [Description("Master Bol Indicator名称")] public string MasterBolIndicatorName { get; set; } /// /// 销售EDI名称 /// + [Description("销售EDI名称")] public string SalerCodeName { get; set; } /// /// 欧盟港口、伊朗港口、KHI /// + [Description("欧盟港口、伊朗港口、KHI")] public string CKHI { get; set; } /// /// 南美东 /// + [Description("南美东")] public string CNCM { get; set; } /// /// 巴西线的木质包装情况 /// + [Description("巴西线的木质包装情况")] public string WNCM { get; set; } /// /// 订舱人说明 /// + [Description("订舱人说明")] public string OrderRemark { get; set; } } } diff --git a/Myshipping.Application/Myshipping.Application.xml b/Myshipping.Application/Myshipping.Application.xml index aefa92e4..bca69b49 100644 --- a/Myshipping.Application/Myshipping.Application.xml +++ b/Myshipping.Application/Myshipping.Application.xml @@ -4636,6 +4636,11 @@ 未指定 + + + 阿联酋航运 + + 任务类型基础枚举 diff --git a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs index f52ea4d4..c04625a5 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs @@ -3463,67 +3463,5 @@ namespace Myshipping.Application } } #endregion - [HttpGet("/BookingOrder/test")] - public void test() { - - var opt = App.GetOptions(); - var dirAbs = opt.Path; - var RemainHours = Convert.ToDouble(opt.RemainHours); - var fileFullPath = Path.Combine(App.WebHostEnvironment.WebRootPath, dirAbs); - string[] Files = Directory.GetFiles(fileFullPath); //当前目录下的文件: - foreach (string it in Files) - { - FileInfo fi = new FileInfo(it); - var date = fi.CreationTime.AddHours(RemainHours); - if (date < DateTime.Now) - { - File.Delete(it); - } - } - string[] _Files = Directory.GetDirectories(fileFullPath); //当前目录下的文件夹: - if (_Files.Length>0) { - foreach (string it in _Files) - { - //FileInfo fi = new FileInfo(it); - //var date = fi.CreationTime.AddHours(RemainHours); - //if (date < DateTime.Now) - //{ - // File.Delete(it); - //} - test1( it); - } - - } - - } - public void test1(string path) { - var opt = App.GetOptions(); - var RemainHours = Convert.ToDouble(opt.RemainHours); - string[] Files = Directory.GetFiles(path); //当前目录下的文件: - foreach (string it in Files) - { - FileInfo fi = new FileInfo(it); - var date = fi.CreationTime.AddHours(RemainHours); - if (date < DateTime.Now) - { - File.Delete(it); - } - } - string[] _Files = Directory.GetDirectories(path); //当前目录下的文件夹: - if (_Files.Length>0) { - foreach (string it in _Files) - { - test1(it); - } - - } - - } - - - - - - } } diff --git a/Myshipping.Application/Service/BookingTemplate/BookingTemplateService.cs b/Myshipping.Application/Service/BookingTemplate/BookingTemplateService.cs index 362b4f2c..4d9e54d0 100644 --- a/Myshipping.Application/Service/BookingTemplate/BookingTemplateService.cs +++ b/Myshipping.Application/Service/BookingTemplate/BookingTemplateService.cs @@ -129,6 +129,11 @@ namespace Myshipping.Application public async Task GetFieldName() { BookingOrder order = new BookingOrder(); + BookingCtn ctn = new BookingCtn(); + BookingEDIExt ext = new BookingEDIExt(); + List> list = new List>(); + + ////bookingorder Dictionary dic = new Dictionary(); foreach (PropertyDescriptor descriptor in TypeDescriptor.GetProperties(order)) { @@ -142,7 +147,41 @@ namespace Myshipping.Application dic.Add(descriptor.Name, descriptor.Description); } } - return dic; + list.Add(dic); + + + Dictionary dic1 = new Dictionary(); + foreach (PropertyDescriptor descriptor in TypeDescriptor.GetProperties(ctn)) + { + string name = descriptor.Name; + if (name == "TenantId" || name == "CreatedTime" || name == "UpdatedTime" || name == "CreatedUserId" || name == "CreatedUserName") + { + continue; + } + if (!string.IsNullOrWhiteSpace(descriptor.Description)) + { + dic1.Add(descriptor.Name, descriptor.Description); + } + } + list.Add(dic1); + + + Dictionary dic2 = new Dictionary(); + foreach (PropertyDescriptor descriptor in TypeDescriptor.GetProperties(ext)) + { + string name = descriptor.Name; + if (name == "TenantId" || name == "CreatedTime" || name == "UpdatedTime" || name == "CreatedUserId" || name == "CreatedUserName") + { + continue; + } + if (!string.IsNullOrWhiteSpace(descriptor.Description)) + { + dic2.Add(descriptor.Name, descriptor.Description); + } + } + list.Add(dic2); + + return list; } /// @@ -265,5 +304,9 @@ namespace Myshipping.Application //var result = new FileStreamResult(new FileStream(Path.Combine(fileFullPath, fileName), FileMode.Open), "application/octet-stream") { FileDownloadName = fileName }; return fileName; } + + + + } } diff --git a/Myshipping.Core/Entity/DJY/DjyVesselInfo.cs b/Myshipping.Core/Entity/DJY/DjyVesselInfo.cs index c060f469..4e2bc34c 100644 --- a/Myshipping.Core/Entity/DJY/DjyVesselInfo.cs +++ b/Myshipping.Core/Entity/DJY/DjyVesselInfo.cs @@ -81,4 +81,78 @@ namespace Myshipping.Application.Entity /// public string VoynoInside { get; set; } } + + + + + public class DjyVesselInfoDto { + + public virtual long Id { get; set; } + /// + /// 船名 + /// + public string Vessel { get; set; } + /// + /// 航次 + /// + public string Voyno { get; set; } + /// + /// 装货港 + /// + public string PortLoading { get; set; } + /// + /// 中转港 + /// + public string PortTransit { get; set; } + /// + /// 卸货港 + /// + public string PortDischarge { get; set; } + /// + /// 装货港ID + /// + public string PortLoadingId { get; set; } + /// + /// 装货港ID + /// + public string PortTransitId { get; set; } + /// + /// 卸货港ID + /// + public string PortDischargeId { get; set; } + /// + /// 开船日期 + /// + public DateTime? ETD { get; set; } + /// + /// 截港日期 + /// + public DateTime? ClosingDate { get; set; } + /// + /// 预抵日期 + /// + public DateTime? ETA { get; set; } + /// + /// 默认码头 + /// + public string Wharf { get; set; } + + /// + /// 实际离港日期 + /// + public DateTime? ATD { get; set; } + /// + /// 船公司 + /// + public string CARRIER { get; set; } + /// + /// 船公司ID + /// + public string CARRIERID { get; set; } + /// + /// 内部航次 + /// + public string VoynoInside { get; set; } + + } } \ No newline at end of file diff --git a/Myshipping.Core/Job/LogJobWorker.cs b/Myshipping.Core/Job/LogJobWorker.cs index daf8818f..5bfabaed 100644 --- a/Myshipping.Core/Job/LogJobWorker.cs +++ b/Myshipping.Core/Job/LogJobWorker.cs @@ -282,13 +282,18 @@ public class LogJobWorker : ISpareTimeWorker, IDynamicApiController, ITransient { foreach (string it in _Files) { - - TemporaryDirectories(it); + DirectoryInfo fi = new DirectoryInfo(it); + var date = fi.CreationTime.AddHours(RemainHours); + if (date < DateTime.Now) + { + fi.Delete(true); + } + else { + TemporaryDirectories(it); + } + } - } - - } @@ -313,8 +318,11 @@ public class LogJobWorker : ISpareTimeWorker, IDynamicApiController, ITransient { TemporaryDirectories(it); } - } - + else + { + DirectoryInfo fi = new DirectoryInfo(path); + fi.Delete(true); + } } } diff --git a/Myshipping.Core/Myshipping.Core.xml b/Myshipping.Core/Myshipping.Core.xml index 1331cede..a55833fe 100644 --- a/Myshipping.Core/Myshipping.Core.xml +++ b/Myshipping.Core/Myshipping.Core.xml @@ -10991,7 +10991,7 @@ - + 新增编辑 @@ -17006,5 +17006,85 @@ 内部航次 + + + 船名 + + + + + 航次 + + + + + 装货港 + + + + + 中转港 + + + + + 卸货港 + + + + + 装货港ID + + + + + 装货港ID + + + + + 卸货港ID + + + + + 开船日期 + + + + + 截港日期 + + + + + 预抵日期 + + + + + 默认码头 + + + + + 实际离港日期 + + + + + 船公司 + + + + + 船公司ID + + + + + 内部航次 + + diff --git a/Myshipping.Core/Service/DjyVesselInfo/DjyVesselInfoService.cs b/Myshipping.Core/Service/DjyVesselInfo/DjyVesselInfoService.cs index bc475a44..9cb2b9b1 100644 --- a/Myshipping.Core/Service/DjyVesselInfo/DjyVesselInfoService.cs +++ b/Myshipping.Core/Service/DjyVesselInfo/DjyVesselInfoService.cs @@ -33,9 +33,13 @@ namespace Myshipping.Core.Service /// /// [HttpGet("/DjyVesselInfoService/GetListPage")] - public async Task GetListPage([FromQuery] string KeyWord) { + public async Task GetListPage([FromQuery] string KeyWord) + { - return await _rep.AsQueryable().WhereIF(!string.IsNullOrWhiteSpace(KeyWord), x => x.Vessel.Contains(KeyWord)).ToListAsync(); + return await _rep.AsQueryable().WhereIF(!string.IsNullOrWhiteSpace(KeyWord), x => x.Vessel.Contains(KeyWord) + || x.CARRIER.Contains(KeyWord) || x.Voyno.Contains(KeyWord) || x.PortLoading.Contains(KeyWord) || x.PortTransit.Contains(KeyWord) || + x.PortDischarge.Contains(KeyWord) || x.VoynoInside.Contains(KeyWord) + ).ToListAsync(); } /// @@ -59,7 +63,7 @@ namespace Myshipping.Core.Service /// /// [HttpPost("/DjyVesselInfoService/AddOrUpdate")] - public async Task AddOrUpdate(DjyVesselInfo dto) + public async Task AddOrUpdate(DjyVesselInfoDto dto) { if (dto == null) { @@ -67,11 +71,15 @@ namespace Myshipping.Core.Service } if (dto.Id == 0) { - await _rep.InsertAsync(dto); + var entity = dto.Adapt(); + + await _rep.InsertAsync(entity); } else { - await _rep.AsUpdateable(dto).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync(); + var entity = dto.Adapt(); + + await _rep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync(); } return dto.Id; } @@ -82,31 +90,33 @@ namespace Myshipping.Core.Service /// /// [HttpGet("/DjyVesselInfoService/GetList")] - public async Task GetList([FromQuery] string KeyWord, string CarrierID) + public async Task GetList([FromQuery] string CarrierID, string KeyWord = "") { //获取船名 List list = await _sysCacheService.GetAllCodeVessel(); - var tlist = await _rep.AsQueryable().Where(x => x.Vessel.Contains(KeyWord) && x.CARRIERID == CarrierID&&x.ETD>DateTime.Now.AddDays(-7)). - Select(x=> new { - Voyno =x.Voyno, - VoynoInside =x.VoynoInside, + var tlist = await _rep.AsQueryable().WhereIF(!string.IsNullOrWhiteSpace(KeyWord), x => x.Vessel.Contains(KeyWord)). + Where(x=> x.CARRIERID == CarrierID && x.ETD > DateTime.Now.AddDays(-7)). + Select(x => new + { + Voyno = x.Voyno, + VoynoInside = x.VoynoInside, Vessel = x.Vessel, - ETD =x.ETD, + ETD = x.ETD, ATD = x.ATD, }).Take(20). ToListAsync(); if (tlist.Count() == 0) { - return list.Where(x => x.Name.Contains(KeyWord)).Select(x => new + return list.WhereIF(!string.IsNullOrWhiteSpace(KeyWord), x => x.Name.Contains(KeyWord)).Select(x => new { Voyno = "", - VoynoInside="", + VoynoInside = "", Vessel = x.Name, ETD = "", - ATD="", + ATD = "", }).Take(20).ToList(); } else diff --git a/Myshipping.Core/Service/DjyVesselInfo/IDjyVesselInfoService.cs b/Myshipping.Core/Service/DjyVesselInfo/IDjyVesselInfoService.cs index 5567606e..49f179bc 100644 --- a/Myshipping.Core/Service/DjyVesselInfo/IDjyVesselInfoService.cs +++ b/Myshipping.Core/Service/DjyVesselInfo/IDjyVesselInfoService.cs @@ -8,7 +8,7 @@ namespace Myshipping.Core.Service { public interface IDjyVesselInfoService { - Task AddOrUpdate(DjyVesselInfo dto); + Task AddOrUpdate(DjyVesselInfoDto dto); Task GetList(string KeyWord, string CarrierID); } } \ No newline at end of file