From 764ad191dbcccbe98e01cd37f335cc2318c92875 Mon Sep 17 00:00:00 2001 From: wet <1034391973@qq.com> Date: Tue, 6 Dec 2022 09:42:36 +0800 Subject: [PATCH 01/21] =?UTF-8?q?=E8=AE=A2=E8=88=B1=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BookingOrder/BookingOrderService.cs | 101 ++++++++++++++++-- 1 file changed, 91 insertions(+), 10 deletions(-) diff --git a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs index 9b751a0b..f85ba0a2 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs @@ -901,7 +901,15 @@ namespace Myshipping.Application bookingStatusLog.OpTime = item.OpTime; bookingStatusLog.MBLNO = item.MBLNO; await _repStatuslog.InsertAsync(bookingStatusLog); - //var list=_repBookingStatus.AsQueryable().InnerJoin>((d,t)=>d.StaCode==t.C) + var list = await _repBookingStatus.AsQueryable().InnerJoin((d, t) => d.StaCode == t.Code && d.StaCate == "book_sta_cate_billtrace" && d.BookingId == item.BookingId).Select((d, t) => new + { + BookingId = d.BookingId, + StaCode = d.StaCode, + StaName = d.StaName, + StaTime = d.StaTime, + Code = t.Code, + Value = t.Value + }).ToListAsync(); if (item.detail != null && item.detail.Count > 0) { foreach (var dt in item.detail) @@ -912,21 +920,94 @@ namespace Myshipping.Application BookingStatusLogDetail.CNTRNO = dt.CNTRNO; BookingStatusLogDetail.OPTime = dt.OPTime; await _statuslogdetail.InsertAsync(BookingStatusLogDetail); - if (dt.Status== "舱单") { - - - - - + #region 订舱状态 + if (dt.Status == "舱单") + { + if (list.Where(x => x.Code == "sta_cangdan").FirstOrDefault() == null) + { + BookingStatus bookingStatus = new BookingStatus(); + bookingStatus.BookingId = item.BookingId; + bookingStatus.StaCode = "sta_cangdan"; + bookingStatus.StaName = list.Where(x => x.Code == "sta_cangdan").Select(x => x.Value).First(); + bookingStatus.StaTime = dt.OPTime; + bookingStatus.StaCate = "book_sta_cate_billtrace"; + await _repBookingStatus.InsertAsync(bookingStatus); + } } - + if (dt.Status == "报关") + { + if (list.Where(x => x.Code == "sta_haifang").FirstOrDefault() == null) + { + BookingStatus bookingStatus = new BookingStatus(); + bookingStatus.BookingId = item.BookingId; + bookingStatus.StaCode = "sta_haifang"; + bookingStatus.StaName = list.Where(x => x.Code == "sta_haifang").Select(x => x.Value).First(); + bookingStatus.StaTime = dt.OPTime; + bookingStatus.StaCate = "book_sta_cate_billtrace"; + await _repBookingStatus.InsertAsync(bookingStatus); + } + } + if (dt.Status == "装载") + { + if (list.Where(x => x.Code == "sta_zhuangzai").FirstOrDefault() == null) + { + BookingStatus bookingStatus = new BookingStatus(); + bookingStatus.BookingId = item.BookingId; + bookingStatus.StaCode = "sta_zhuangzai"; + bookingStatus.StaName = list.Where(x => x.Code == "sta_zhuangzai").Select(x => x.Value).First(); + bookingStatus.StaTime = dt.OPTime; + bookingStatus.StaCate = "book_sta_cate_billtrace"; + await _repBookingStatus.InsertAsync(bookingStatus); + } + } + if (dt.Status == "码放") + { + if (list.Where(x => x.Code == "sta_mafang").FirstOrDefault() == null) + { + BookingStatus bookingStatus = new BookingStatus(); + bookingStatus.BookingId = item.BookingId; + bookingStatus.StaCode = "sta_mafang"; + bookingStatus.StaName = list.Where(x => x.Code == "sta_mafang").Select(x => x.Value).First(); + bookingStatus.StaTime = dt.OPTime; + bookingStatus.StaCate = "book_sta_cate_billtrace"; + await _repBookingStatus.InsertAsync(bookingStatus); + } + } + if (dt.Status == "装船") + { + if (list.Where(x => x.Code == "sta_zhuangchuan").FirstOrDefault() == null) + { + BookingStatus bookingStatus = new BookingStatus(); + bookingStatus.BookingId = item.BookingId; + bookingStatus.StaCode = "sta_zhuangchuan"; + bookingStatus.StaName = list.Where(x => x.Code == "sta_zhuangchuan").Select(x => x.Value).First(); + bookingStatus.StaTime = dt.OPTime; + bookingStatus.StaCate = "book_sta_cate_billtrace"; + await _repBookingStatus.InsertAsync(bookingStatus); + } + } + if (dt.Status == "ATD") + { + if (list.Where(x => x.Code == "sta_atd").FirstOrDefault() == null) + { + BookingStatus bookingStatus = new BookingStatus(); + bookingStatus.BookingId = item.BookingId; + bookingStatus.StaCode = "sta_atd"; + bookingStatus.StaName = list.Where(x => x.Code == "sta_atd").Select(x => x.Value).First(); + bookingStatus.StaTime = dt.OPTime; + bookingStatus.StaCate = "book_sta_cate_billtrace"; + await _repBookingStatus.InsertAsync(bookingStatus); + } + } + #endregion } + } } } #endregion - + @@ -1281,7 +1362,7 @@ namespace Myshipping.Application } var fileName = HttpUtility.UrlEncode($"{bookingId}_{DateTime.Now.Ticks}.{fileType}", Encoding.GetEncoding("UTF-8"));////名称 - //var result = new FileContentResult(bs, "application/octet-stream") { FileDownloadName = fileName }; + //var result = new FileContentResult(bs, "application/octet-stream") { FileDownloadName = fileName }; var opt = App.GetOptions().Path; var serverpath = Path.Combine(App.WebHostEnvironment.WebRootPath, opt);//服务器路径 if (!Directory.Exists(serverpath)) From 91f6fed668769324d0c4613de9324b7b2034de05 Mon Sep 17 00:00:00 2001 From: wet <1034391973@qq.com> Date: Tue, 6 Dec 2022 11:31:19 +0800 Subject: [PATCH 02/21] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/BookingOrder/BookingOrderService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs index d8d38977..8919a888 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs @@ -867,7 +867,7 @@ namespace Myshipping.Application billdto.Children = billTraceList; billdto.Key = key.Account; billdto.PWD = key.Password; - billdto.url = url.FirstOrDefault(x => x.TypeCode == "url_set" && x.Code == "response_seae_billtraceurl").Value; + billdto.url = url.FirstOrDefault(x => x.TypeCode == "url_set" && x.Code == "request_seae_billtraceurl").Value; billdto.Gid = UserManager.DjyUserId; var json = billdto.ToJsonString(); var html = await url.FirstOrDefault(x => x.TypeCode == "url_set" && x.Code == "request_seae_billtraceurl").Value.SetHttpMethod(HttpMethod.Post).SetQueries(new { msg = json }).SetRetryPolicy(3, 5000).SendAsAsync(); From 2af2e9c8bbe6f92d9968c7abfa90e639437333b6 Mon Sep 17 00:00:00 2001 From: wet <1034391973@qq.com> Date: Tue, 6 Dec 2022 11:35:18 +0800 Subject: [PATCH 03/21] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/BookingOrder/BookingOrderService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs index 8919a888..d8d38977 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs @@ -867,7 +867,7 @@ namespace Myshipping.Application billdto.Children = billTraceList; billdto.Key = key.Account; billdto.PWD = key.Password; - billdto.url = url.FirstOrDefault(x => x.TypeCode == "url_set" && x.Code == "request_seae_billtraceurl").Value; + billdto.url = url.FirstOrDefault(x => x.TypeCode == "url_set" && x.Code == "response_seae_billtraceurl").Value; billdto.Gid = UserManager.DjyUserId; var json = billdto.ToJsonString(); var html = await url.FirstOrDefault(x => x.TypeCode == "url_set" && x.Code == "request_seae_billtraceurl").Value.SetHttpMethod(HttpMethod.Post).SetQueries(new { msg = json }).SetRetryPolicy(3, 5000).SendAsAsync(); From 09ab1939ee1b78d7f522a16e6b5dedfc936e8c40 Mon Sep 17 00:00:00 2001 From: wet <1034391973@qq.com> Date: Tue, 6 Dec 2022 15:48:47 +0800 Subject: [PATCH 04/21] =?UTF-8?q?=E8=B0=83=E7=94=A8=E8=BF=90=E8=B8=AA?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/BookingOrder/BookingOrderService.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs index d8d38977..fb9d15fc 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs @@ -844,7 +844,7 @@ namespace Myshipping.Application [NonAction] public async Task SendTrace(string BusinessId, string YARDID, string YARD, string MBLNO) { - _logger.LogInformation("提单号:" + MBLNO + " 调用运踪接口"); + _logger.LogInformation("调用运踪接口提单号:" + MBLNO + " 调用运踪接口"); var key = _webAccountConfig.GetAccountConfig("seae_billtraceurl", UserManager.UserId).Result; if (key == null) { @@ -870,8 +870,9 @@ namespace Myshipping.Application billdto.url = url.FirstOrDefault(x => x.TypeCode == "url_set" && x.Code == "response_seae_billtraceurl").Value; billdto.Gid = UserManager.DjyUserId; var json = billdto.ToJsonString(); + _logger.LogInformation("调用运踪接口发送josn:" + json); var html = await url.FirstOrDefault(x => x.TypeCode == "url_set" && x.Code == "request_seae_billtraceurl").Value.SetHttpMethod(HttpMethod.Post).SetQueries(new { msg = json }).SetRetryPolicy(3, 5000).SendAsAsync(); - _logger.LogInformation("提单号:" + MBLNO + " 调用运踪接口返回" + html.ToJsonString()); + _logger.LogInformation("调用运踪接口提单号:" + MBLNO + " 调用运踪接口返回" + html.ToJsonString()); } /// From c982b2c85a7d3edab662d6ca923164885865e372 Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Tue, 6 Dec 2022 15:53:24 +0800 Subject: [PATCH 05/21] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E4=B8=AD=E8=BD=AC?= =?UTF-8?q?=E6=B8=AF=E7=9A=84=E5=9B=BD=E5=AE=B6=E4=BB=A3=E7=A0=81=E5=AF=B9?= =?UTF-8?q?=E5=BA=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Myshipping.Application.xml | 17 ++++++++- .../RulesEngineOrderBookingMainInfo.cs | 17 ++++++++- .../RulesEngine/RulesEngineClientService.cs | 36 +++++++++++++++++-- 3 files changed, 65 insertions(+), 5 deletions(-) diff --git a/Myshipping.Application/Myshipping.Application.xml b/Myshipping.Application/Myshipping.Application.xml index b1cf62d8..58088976 100644 --- a/Myshipping.Application/Myshipping.Application.xml +++ b/Myshipping.Application/Myshipping.Application.xml @@ -8553,7 +8553,7 @@ 是否拼箱 - + 卸货港国家代码 @@ -8568,6 +8568,21 @@ 卸货港国家中文 + + + 中转港国家代码 + + + + + 中转港国家英文 + + + + + 中转港国家中文 + + 箱信息 diff --git a/Myshipping.Application/Service/RulesEngine/Dtos/OrderBooking/RulesEngineOrderBookingMainInfo.cs b/Myshipping.Application/Service/RulesEngine/Dtos/OrderBooking/RulesEngineOrderBookingMainInfo.cs index e3466ae6..101ad17c 100644 --- a/Myshipping.Application/Service/RulesEngine/Dtos/OrderBooking/RulesEngineOrderBookingMainInfo.cs +++ b/Myshipping.Application/Service/RulesEngine/Dtos/OrderBooking/RulesEngineOrderBookingMainInfo.cs @@ -645,7 +645,7 @@ namespace Myshipping.Application /// /// 卸货港国家代码 /// - public string PortDischargeNo { get; set; } + public string PortDischargeCountryNo { get; set; } /// /// 卸货港国家英文 @@ -657,6 +657,21 @@ namespace Myshipping.Application /// public string PortDischargeCN { get; set; } + /// + /// 中转港国家代码 + /// + public string TransportCountryNo { get; set; } + + /// + /// 中转港国家英文 + /// + public string TransportEN { get; set; } + + /// + /// 中转港国家中文 + /// + public string TransportCN { get; set; } + /// /// 箱信息 /// diff --git a/Myshipping.Application/Service/RulesEngine/RulesEngineClientService.cs b/Myshipping.Application/Service/RulesEngine/RulesEngineClientService.cs index 059eab05..38d0901d 100644 --- a/Myshipping.Application/Service/RulesEngine/RulesEngineClientService.cs +++ b/Myshipping.Application/Service/RulesEngine/RulesEngineClientService.cs @@ -297,6 +297,8 @@ namespace Myshipping.Application msgModel.Main.BusinessInfo = mainInfo; + List codePortList = new List(); + //根据卸货港翻译航线信息 if (!string.IsNullOrWhiteSpace(mainInfo.PortDischargeId)) { @@ -320,25 +322,53 @@ namespace Myshipping.Application msgModel.Main.BusinessInfo.LaneName = lineModel?.CnName; } + codePortList = _cache.GetAllCodePort().GetAwaiter().GetResult(); + //翻译卸货港对应的国家 - var portInfo = _cache.GetAllCodePort().GetAwaiter().GetResult().FirstOrDefault(t => t.Code.Equals(mainInfo.PortDischargeId, StringComparison.OrdinalIgnoreCase)); + var portInfo = codePortList.FirstOrDefault(t => t.Code.Equals(mainInfo.PortDischargeId, StringComparison.OrdinalIgnoreCase)); _logger.LogInformation("批次={no} 检索港口完成 lane={lane} msg={msg}", batchNo, mainInfo.PortDischargeId, JSON.Serialize(portInfo)); if (portInfo == null || string.IsNullOrWhiteSpace(portInfo.CountryCode)) - throw Oops.Oh($"港口代码{mainInfo.PortDischargeId}获取港口基础数据失败"); + throw Oops.Oh($"卸货港口代码{mainInfo.PortDischargeId}获取港口基础数据失败"); var countryInfo = _cache.GetAllCodeCountry().GetAwaiter().GetResult().FirstOrDefault(t => t.Code.Equals(portInfo.CountryCode, StringComparison.OrdinalIgnoreCase)); if (countryInfo == null || string.IsNullOrWhiteSpace(portInfo.EnName)) throw Oops.Oh($"国家代码{portInfo.CountryCode}获取国家基础数据失败"); - msgModel.Main.BusinessInfo.PortDischargeNo = countryInfo.Code; + msgModel.Main.BusinessInfo.PortDischargeCountryNo = countryInfo.Code; msgModel.Main.BusinessInfo.PortDischargeEN = countryInfo.EnName; msgModel.Main.BusinessInfo.PortDischargeCN = countryInfo.CnName; } + //中转港 + if (!string.IsNullOrWhiteSpace(mainInfo.TransportId)) + { + if(codePortList.Count == 0) + { + codePortList = _cache.GetAllCodePort().GetAwaiter().GetResult(); + } + + //翻译中转港对应的国家 + var portInfo = codePortList.FirstOrDefault(t => t.Code.Equals(mainInfo.TransportId, StringComparison.OrdinalIgnoreCase)); + + _logger.LogInformation("批次={no} 检索港口完成 port={lane} msg={msg}", batchNo, mainInfo.TransportId, JSON.Serialize(portInfo)); + + if (portInfo == null || string.IsNullOrWhiteSpace(portInfo.CountryCode)) + throw Oops.Oh($"中转港口代码{mainInfo.TransportId}获取港口基础数据失败"); + + var countryInfo = _cache.GetAllCodeCountry().GetAwaiter().GetResult().FirstOrDefault(t => t.Code.Equals(portInfo.CountryCode, StringComparison.OrdinalIgnoreCase)); + + if (countryInfo == null || string.IsNullOrWhiteSpace(portInfo.EnName)) + throw Oops.Oh($"国家代码{portInfo.CountryCode}获取国家基础数据失败"); + + msgModel.Main.BusinessInfo.TransportCountryNo = countryInfo.Code; + msgModel.Main.BusinessInfo.TransportEN = countryInfo.EnName; + msgModel.Main.BusinessInfo.TransportCN = countryInfo.CnName; + } + //对应签单方式 if (!string.IsNullOrWhiteSpace(mainInfo.IssueType)) { From e845bb56979dc6227eaf14ba0cbae93ce50e7547 Mon Sep 17 00:00:00 2001 From: wet <1034391973@qq.com> Date: Wed, 7 Dec 2022 11:29:55 +0800 Subject: [PATCH 06/21] =?UTF-8?q?=E8=BF=90=E8=B8=AA=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E5=AF=B9=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BookingOrder/BookingOrderService.cs | 34 ++++++++++--------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs index fb9d15fc..c3e14b27 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs @@ -69,7 +69,7 @@ namespace Myshipping.Application private readonly SqlSugarRepository _bookinglogdetail; private readonly SqlSugarRepository _bookingremark; private readonly SqlSugarRepository _bookingfile; - private readonly SqlSugarRepository _dicdata; + private readonly SqlSugarRepository _repPrint; private readonly ILogger _logger; private readonly ISysCacheService _cache; @@ -112,7 +112,7 @@ namespace Myshipping.Application this._bookingremark = bookingremark; this._bookingfile = bookingfile; this._repPrint = repPrint; - this._dicdata = dicdata; + this._cache = cache; this._webAccountConfig = webAccountConfig; this._repStatuslog = statuslog; @@ -883,16 +883,17 @@ namespace Myshipping.Application [HttpPost("/BookingOrder/AddBookingStatusLog")] public async Task AddBookingStatusLog(List all) { - + //清空原有数据 + var old = await _repStatuslog.AsQueryable().Where(x => x.BookingId == all[0].BookingId && x.Category == "ship").ToListAsync(); + await _repStatuslog.DeleteAsync(x => x.BookingId == all[0].BookingId && x.Category == "ship"); + foreach (var ot in old) + { + await _statuslogdetail.DeleteAsync(x => x.PId == ot.Id); + } + var dicdatalist = _cache.GetAllDictData().Result; foreach (var item in all) { - //清空原有数据 - var old = await _repStatuslog.AsQueryable().Where(x => x.BookingId == item.BookingId && x.Category == "ship").ToListAsync(); - await _repStatuslog.DeleteAsync(x => x.BookingId == item.BookingId && x.Category == "ship"); - foreach (var ot in old) - { - await _statuslogdetail.DeleteAsync(x => x.PId == ot.Id); - } + //新增数据 var bookingStatusLog = new BookingStatusLog(); bookingStatusLog.BookingId = item.BookingId; @@ -911,6 +912,7 @@ namespace Myshipping.Application Code = t.Code, Value = t.Value }).ToListAsync(); + if (item.detail != null && item.detail.Count > 0) { foreach (var dt in item.detail) @@ -929,7 +931,7 @@ namespace Myshipping.Application BookingStatus bookingStatus = new BookingStatus(); bookingStatus.BookingId = item.BookingId; bookingStatus.StaCode = "sta_cangdan"; - bookingStatus.StaName = list.Where(x => x.Code == "sta_cangdan").Select(x => x.Value).First(); + bookingStatus.StaName = dicdatalist.Where(x => x.Code == "sta_cangdan").Select(x => x.Value).FirstOrDefault(); bookingStatus.StaTime = dt.OPTime; bookingStatus.StaCate = "book_sta_cate_billtrace"; await _repBookingStatus.InsertAsync(bookingStatus); @@ -942,7 +944,7 @@ namespace Myshipping.Application BookingStatus bookingStatus = new BookingStatus(); bookingStatus.BookingId = item.BookingId; bookingStatus.StaCode = "sta_haifang"; - bookingStatus.StaName = list.Where(x => x.Code == "sta_haifang").Select(x => x.Value).First(); + bookingStatus.StaName = dicdatalist.Where(x => x.Code == "sta_haifang").Select(x => x.Value).FirstOrDefault(); bookingStatus.StaTime = dt.OPTime; bookingStatus.StaCate = "book_sta_cate_billtrace"; await _repBookingStatus.InsertAsync(bookingStatus); @@ -955,7 +957,7 @@ namespace Myshipping.Application BookingStatus bookingStatus = new BookingStatus(); bookingStatus.BookingId = item.BookingId; bookingStatus.StaCode = "sta_zhuangzai"; - bookingStatus.StaName = list.Where(x => x.Code == "sta_zhuangzai").Select(x => x.Value).First(); + bookingStatus.StaName = dicdatalist.Where(x => x.Code == "sta_zhuangzai").Select(x => x.Value).FirstOrDefault(); bookingStatus.StaTime = dt.OPTime; bookingStatus.StaCate = "book_sta_cate_billtrace"; await _repBookingStatus.InsertAsync(bookingStatus); @@ -968,7 +970,7 @@ namespace Myshipping.Application BookingStatus bookingStatus = new BookingStatus(); bookingStatus.BookingId = item.BookingId; bookingStatus.StaCode = "sta_mafang"; - bookingStatus.StaName = list.Where(x => x.Code == "sta_mafang").Select(x => x.Value).First(); + bookingStatus.StaName = dicdatalist.Where(x => x.Code == "sta_mafang").Select(x => x.Value).FirstOrDefault(); bookingStatus.StaTime = dt.OPTime; bookingStatus.StaCate = "book_sta_cate_billtrace"; await _repBookingStatus.InsertAsync(bookingStatus); @@ -981,7 +983,7 @@ namespace Myshipping.Application BookingStatus bookingStatus = new BookingStatus(); bookingStatus.BookingId = item.BookingId; bookingStatus.StaCode = "sta_zhuangchuan"; - bookingStatus.StaName = list.Where(x => x.Code == "sta_zhuangchuan").Select(x => x.Value).First(); + bookingStatus.StaName = dicdatalist.Where(x => x.Code == "sta_zhuangchuan").Select(x => x.Value).FirstOrDefault(); bookingStatus.StaTime = dt.OPTime; bookingStatus.StaCate = "book_sta_cate_billtrace"; await _repBookingStatus.InsertAsync(bookingStatus); @@ -994,7 +996,7 @@ namespace Myshipping.Application BookingStatus bookingStatus = new BookingStatus(); bookingStatus.BookingId = item.BookingId; bookingStatus.StaCode = "sta_atd"; - bookingStatus.StaName = list.Where(x => x.Code == "sta_atd").Select(x => x.Value).First(); + bookingStatus.StaName = dicdatalist.Where(x => x.Code == "sta_atd").Select(x => x.Value).FirstOrDefault(); bookingStatus.StaTime = dt.OPTime; bookingStatus.StaCate = "book_sta_cate_billtrace"; await _repBookingStatus.InsertAsync(bookingStatus); From f75e4cf89298b852af8eb9437fa4e25d4428b824 Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Thu, 8 Dec 2022 11:23:42 +0800 Subject: [PATCH 07/21] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AE=A2=E8=88=B1?= =?UTF-8?q?=E5=8F=91=E9=80=81EDI=E5=8A=9F=E8=83=BD=EF=BC=8C=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=8F=91=E9=80=81=E6=97=B6=E8=87=AA=E5=8A=A8=E5=86=99?= =?UTF-8?q?=E5=85=A5=E5=88=B0=E9=99=84=E4=BB=B6=20=E4=BF=AE=E6=94=B9EDI?= =?UTF-8?q?=E6=96=B9=E6=B3=95=EF=BC=8C=E5=8E=BB=E6=8E=89=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Myshipping.Application/EDI/PILEdiHelper.cs | 28 ++++-- Myshipping.Application/EDI/TSLEdiHelper.cs | 16 +-- Myshipping.Application/EDI/WYEdiHelper.cs | 8 +- Myshipping.Application/EDI/YMLEdiHelper.cs | 20 ++-- Myshipping.Application/EDI/YTEdiHelper.cs | 8 +- .../Myshipping.Application.xml | 12 +++ .../BookingOrder/BookingOrderService.cs | 99 +++++++++++++++++-- .../applicationsettings.json | 2 +- 8 files changed, 150 insertions(+), 43 deletions(-) diff --git a/Myshipping.Application/EDI/PILEdiHelper.cs b/Myshipping.Application/EDI/PILEdiHelper.cs index 9ece3325..80eb2168 100644 --- a/Myshipping.Application/EDI/PILEdiHelper.cs +++ b/Myshipping.Application/EDI/PILEdiHelper.cs @@ -1,5 +1,6 @@ using Myshipping.Application.EDI.ESL; using MySqlX.XDevAPI.Common; +using StackExchange.Profiling.Internal; using System; using System.Collections.Generic; using System.IO; @@ -670,16 +671,25 @@ namespace Myshipping.Application.EDI.PIL var SENDCODE = ""; SENDCODE = InttrEdi.SENDCODE; // - string filename = InttrEdi.filerpath + "\\" + InttrEdi.BSLIST[0].MBLNO + estr + ".pms"; + + string dir = InttrEdi.filerpath + "\\" + DateTime.Now.ToString("yyyyMMddHHmmssfff") + "\\"; + //string filename = + InttrEdi.BSLIST[0].MBLNO + estr + ".pms"; //如果是部署linux需要修改路径 if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) - filename = filename.Replace("\\", "/"); + dir = dir.Replace("\\", "/"); - if (System.IO.File.Exists(filename)) + if (!Directory.Exists(dir)) { - System.IO.File.Delete(filename); + Directory.CreateDirectory(dir); } + + string filename = dir + InttrEdi.BSLIST[0].MBLNO + estr + ".pms"; + + //if (System.IO.File.Exists(filename)) + //{ + // System.IO.File.Delete(filename); + //} FileStream f = new FileStream(filename, FileMode.Create); StreamWriter r = new StreamWriter(f, Encoding.Default); var icount = 0; @@ -959,8 +969,8 @@ namespace Myshipping.Application.EDI.PIL tempstr += GetSpaceStr("001", 3);//4 //Booking Party Code//O//X(3)//16 //18 //webcsm Partner Subcode//mandtory,订舱单位代码(customer code) } tempstr += GetSpaceStr("", 4);//5 //Filler//M//X(4)//19 //22 //Spaces - int iLs = InttrEdi.ForWarderName.Length / 35; - int iLs2 = InttrEdi.ForWarderName.Length % 35; + int iLs = (!string.IsNullOrWhiteSpace(InttrEdi.ForWarderName)?InttrEdi.ForWarderName.Length:0) / 35; + int iLs2 = (!string.IsNullOrWhiteSpace(InttrEdi.ForWarderName)?InttrEdi.ForWarderName.Length:0) % 35; int n = 0; for (int i = 0; i < iLs; i++) { @@ -1669,7 +1679,7 @@ namespace Myshipping.Application.EDI.PIL if (InttrEdi.filetype == "E") { //欧盟港口、伊朗港口、KHI - if (bill.cKHI != "") + if (!string.IsNullOrWhiteSpace(bill.cKHI)) { Shipping = bill.cKHI; List ShippingListLs = formatlengthStr(Shipping, 120); @@ -1684,7 +1694,7 @@ namespace Myshipping.Application.EDI.PIL } //南美东 - if (bill.cNCM != "") + if (!string.IsNullOrWhiteSpace(bill.cNCM)) { Shipping = bill.cNCM; List ShippingListLs = formatlengthStr(Shipping, 120); @@ -1699,7 +1709,7 @@ namespace Myshipping.Application.EDI.PIL } //巴西线的木质包装情况 - if (bill.wNCM != "") + if (!string.IsNullOrWhiteSpace(bill.wNCM)) { Shipping = bill.wNCM; List ShippingListLs = formatlengthStr(Shipping, 120); diff --git a/Myshipping.Application/EDI/TSLEdiHelper.cs b/Myshipping.Application/EDI/TSLEdiHelper.cs index 7a18b402..de6521e6 100644 --- a/Myshipping.Application/EDI/TSLEdiHelper.cs +++ b/Myshipping.Application/EDI/TSLEdiHelper.cs @@ -727,10 +727,10 @@ namespace Myshipping.Application.EDI.TSL if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) filename = filename.Replace("\\", "/"); - if (System.IO.File.Exists(filename)) - { - System.IO.File.Delete(filename); - } + //if (System.IO.File.Exists(filename)) + //{ + // System.IO.File.Delete(filename); + //} FileStream f = new FileStream(filename, FileMode.Create); StreamWriter r = new StreamWriter(f, Encoding.Default); var icount = 0; @@ -1330,10 +1330,10 @@ namespace Myshipping.Application.EDI.TSL string filename = InttrEdi.filerpath + "\\" + InttrEdi.BSLIST[0].MBLNO + DateTime.Now.ToString("yyyyMMddHHmmssfff") + ".txt"; - if (System.IO.File.Exists(filename)) - { - System.IO.File.Delete(filename); - } + //if (System.IO.File.Exists(filename)) + //{ + // System.IO.File.Delete(filename); + //} FileStream f = new FileStream(filename, FileMode.Create); StreamWriter r = new StreamWriter(f, Encoding.Default); diff --git a/Myshipping.Application/EDI/WYEdiHelper.cs b/Myshipping.Application/EDI/WYEdiHelper.cs index 7e7a095b..44326d7a 100644 --- a/Myshipping.Application/EDI/WYEdiHelper.cs +++ b/Myshipping.Application/EDI/WYEdiHelper.cs @@ -630,10 +630,10 @@ namespace Myshipping.Application.EDI.WY if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) filename = filename.Replace("\\", "/"); - if (System.IO.File.Exists(filename)) - { - System.IO.File.Delete(filename); - } + //if (System.IO.File.Exists(filename)) + //{ + // System.IO.File.Delete(filename); + //} FileStream f = new FileStream(filename, FileMode.Create); StreamWriter r = new StreamWriter(f, Encoding.Default); var icount = 0; diff --git a/Myshipping.Application/EDI/YMLEdiHelper.cs b/Myshipping.Application/EDI/YMLEdiHelper.cs index fb8da775..fe9ea658 100644 --- a/Myshipping.Application/EDI/YMLEdiHelper.cs +++ b/Myshipping.Application/EDI/YMLEdiHelper.cs @@ -656,10 +656,10 @@ namespace Myshipping.Application.EDI.YML if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) filename = filename.Replace("\\", "/"); - if (System.IO.File.Exists(filename)) - { - System.IO.File.Delete(filename); - } + //if (System.IO.File.Exists(filename)) + //{ + // System.IO.File.Delete(filename); + //} FileStream f = new FileStream(filename, FileMode.Create); StreamWriter r = new StreamWriter(f, Encoding.Default); var icount = 0; @@ -984,10 +984,14 @@ namespace Myshipping.Application.EDI.YML string filename = InttrEdi.filerpath + "\\" + InttrEdi.BSLIST[0].MBLNO + DateTime.Now.ToString("yyyyMMddHHmmssfff") + ".txt"; - if (System.IO.File.Exists(filename)) - { - System.IO.File.Delete(filename); - } + //如果是部署linux需要修改路径 + if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) + filename = filename.Replace("\\", "/"); + + //if (System.IO.File.Exists(filename)) + //{ + // System.IO.File.Delete(filename); + //} FileStream f = new FileStream(filename, FileMode.Create); StreamWriter r = new StreamWriter(f, Encoding.Default); diff --git a/Myshipping.Application/EDI/YTEdiHelper.cs b/Myshipping.Application/EDI/YTEdiHelper.cs index 7ff7817b..af50800d 100644 --- a/Myshipping.Application/EDI/YTEdiHelper.cs +++ b/Myshipping.Application/EDI/YTEdiHelper.cs @@ -645,10 +645,10 @@ namespace Myshipping.Application.EDI.YT if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) filename = filename.Replace("\\", "/"); - if (System.IO.File.Exists(filename)) - { - System.IO.File.Delete(filename); - } + //if (System.IO.File.Exists(filename)) + //{ + // System.IO.File.Delete(filename); + //} FileStream f = new FileStream(filename, FileMode.Create); StreamWriter r = new StreamWriter(f, Encoding.Default); var icount = 0; diff --git a/Myshipping.Application/Myshipping.Application.xml b/Myshipping.Application/Myshipping.Application.xml index 58088976..3a18ea08 100644 --- a/Myshipping.Application/Myshipping.Application.xml +++ b/Myshipping.Application/Myshipping.Application.xml @@ -4934,6 +4934,18 @@ 订舱、截单EDI请求 返回回执 + + + 下载订舱、截单EDI + + 订单主键 + 订单号 + 是否使用货代代码 + 货代代码 + 文件功能 (9原始,1 更新,5 退舱 ) + 发送类型 B-订舱 E-截单 + + 上传FTP diff --git a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs index fb9d15fc..5cc27fb8 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs @@ -2138,6 +2138,12 @@ namespace Myshipping.Application /// 返回回执 [HttpPost("/BookingOrder/SendBookingOrClosingEDI")] public async Task SendBookingOrClosingEDI(BookingOrClosingEDIOrderDto model) + { + return await InnerBookingOrClosingEDI(model); + } + #endregion + + public async Task InnerBookingOrClosingEDI(BookingOrClosingEDIOrderDto model) { string batchNo = IDGen.NextID().ToString(); @@ -2199,8 +2205,6 @@ namespace Myshipping.Application throw Oops.Bah($"CARRIERID={order.CARRIERID} 发送SO(SI)的船公司EDI代码未找到"); - - var ediModel = new EDIBaseModel(); var ftpSet = _cache.GetAllEdiSetting().GetAwaiter().GetResult() @@ -2221,10 +2225,28 @@ namespace Myshipping.Application //读取文件配置 var fileCfg = App.GetOptions(); - string filePath = $"{Path.Combine(!string.IsNullOrWhiteSpace(fileCfg.basePath) ? fileCfg.basePath : App.WebHostEnvironment.WebRootPath, fileCfg.relativePath)}\\edifiles\\{order.BOOKINGNO}"; + string filePath = String.Empty; + string relativePath = string.Empty; + + if(!model.send) + { + var opt = App.GetOptions().Path; + + filePath = $"{Path.Combine(App.WebHostEnvironment.WebRootPath, opt)}\\{order.BOOKINGNO}";//服务器路径 + } + else + { + relativePath = $"{fileCfg.relativePath}\\edifiles\\{order.BOOKINGNO}"; + + filePath = $"{(!string.IsNullOrWhiteSpace(fileCfg.basePath) ? fileCfg.basePath : App.WebHostEnvironment.WebRootPath)}\\{relativePath}"; + } if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) + { + relativePath = relativePath.Replace("\\", "/"); filePath = filePath.Replace("\\", "/"); + } + _logger.LogInformation("批次={no} 生成文件保存路径完成 路由={filePath} 服务器系统={system}", batchNo, filePath, RuntimeInformation.OSDescription); //预先创建目录 @@ -2363,6 +2385,20 @@ namespace Myshipping.Application if (model.send) { + string currFilePath = string.Empty; + + if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) + { + currFilePath = System.Text.RegularExpressions.Regex.Match(result.extra.ToString(), relativePath.Replace("/", "\\/") + ".*").Value; + } + else + { + currFilePath = System.Text.RegularExpressions.Regex.Match(result.extra.ToString(), relativePath.Replace("\\", "\\\\") + ".*").Value; + } + + //这里先写入附件表 + await SaveEDIFile(model.Id, currFilePath, new System.IO.FileInfo(currFilePath).Name); + _logger.LogInformation("批次={no} 直接发送FTP 文件访问地址={filepath}", batchNo, result.extra.ToString()); DateTime bDate = DateTime.Now; @@ -2385,6 +2421,57 @@ namespace Myshipping.Application return result.extra.ToString(); } + + [NonAction] + private async Task SaveEDIFile(long boookId,string FilePath,string fileName,string fileTypeCode= "edi", string fileTypeName= "EDI文件") + { + /* + 直接将附件信息写入附件表 + */ + //EDI文件 + var bookFile = new BookingFile + { + Id = YitIdHelper.NextId(), + FileName = fileName, + FilePath = FilePath, + TypeCode = fileTypeCode, + TypeName = fileTypeName, + BookingId = boookId, + }; + + await _bookingfile.InsertAsync(bookFile); + } + #region 下载订舱、截单EDI + /// + /// 下载订舱、截单EDI + /// + /// 订单主键 + /// 订单号 + /// 是否使用货代代码 + /// 货代代码 + /// 文件功能 (9原始,1 更新,5 退舱 ) + /// 发送类型 B-订舱 E-截单 + /// + [HttpGet("/BookingOrder/DownloadBookingOrClosingEDI")] + public IActionResult DownloadBookingOrClosingEDI([FromQuery] long id, [FromQuery] string orderNo, [FromQuery] bool useForwarderCode, + [FromQuery] string forwarderName, [FromQuery] string fileRole, [FromQuery] string sendType) + { + var model = new BookingOrClosingEDIOrderDto { + Id = id, + orderNo = orderNo, + useForwarderCode = useForwarderCode, + forwarderName = forwarderName, + fileRole = fileRole, + send = false, + sendType = sendType + }; + var filePath = InnerBookingOrClosingEDI(model).GetAwaiter().GetResult(); + + var fileInfo = new FileInfo(filePath); + + var result = new FileStreamResult(new FileStream(filePath, FileMode.Open), "application/octet-stream") { FileDownloadName = fileInfo.Name }; + return result; + } #endregion #region 上传FTP @@ -2501,12 +2588,6 @@ namespace Myshipping.Application result.succ = currRlt.succ; result.extra = currRlt.succ ? currRlt.extra.ToString() : ""; - - //鐩存帴鍙戦€佹姤鏂囧埌FTP鏈嶅姟鍣? - if (model.send) - { - - } } else if (ediRouteEnum == EDIRouteEnum.WY) { diff --git a/Myshipping.Application/applicationsettings.json b/Myshipping.Application/applicationsettings.json index 9ace34ed..ec84f6de 100644 --- a/Myshipping.Application/applicationsettings.json +++ b/Myshipping.Application/applicationsettings.json @@ -9,6 +9,6 @@ "BookingAttach": { "basePath": "", //基础路径,不配置则使用当前系统目录 "relativePath": "BookingAttach", - "fileType": [ ".xls", ".xlsx", ".pdf" ] + "fileType": [ ".xls", ".xlsx", ".pdf", ".txt", ".pms" ] } } \ No newline at end of file From efb6dd394359b10c51e04eb3f0e930946933bc98 Mon Sep 17 00:00:00 2001 From: wet <1034391973@qq.com> Date: Thu, 8 Dec 2022 14:20:21 +0800 Subject: [PATCH 08/21] =?UTF-8?q?=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/BookingOrder/BookingOrderService.cs | 7 +++++-- Myshipping.Core/Extension/InputBase.cs | 9 +++------ Myshipping.Core/Extension/PageInputOrder.cs | 8 +++----- Myshipping.Core/Myshipping.Core.xml | 13 +++---------- 4 files changed, 14 insertions(+), 23 deletions(-) diff --git a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs index c3e14b27..9ceec5da 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs @@ -53,6 +53,7 @@ using System.Xml.Linq; using Myshipping.Application.Helper; using System.Net; using Furion.DistributedIDGenerator; +using System.Linq.Expressions; namespace Myshipping.Application { @@ -141,6 +142,7 @@ namespace Myshipping.Application public async Task Page([FromQuery] BookingOrderInput input) { List userlist = await DataFilterExtensions.GetDataScopeIdList(); + var entities = await _rep.AsQueryable().Where(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) @@ -287,12 +289,13 @@ namespace Myshipping.Application .WhereIF(!string.IsNullOrWhiteSpace(input.LANECODE), u => u.LANECODE == input.LANECODE) .WhereIF(!string.IsNullOrWhiteSpace(input.LANENAME), u => u.LANENAME.Contains(input.LANENAME)) .WhereIF(!string.IsNullOrWhiteSpace(input.FREIGHTPAYER), u => u.FREIGHTPAYER.Contains(input.FREIGHTPAYER)) - .Where(u => userlist.Contains((long)u.CreatedUserId)) + .Where(u => userlist.Contains((long)u.CreatedUserId)).OrderByIF(true, x=>x.ATD, OrderByType.Asc) + .OrderBy(PageInputOrder.OrderBuilder(input.SortField,input.descSort)) .ToPagedListAsync(input.PageNo, input.PageSize); return entities.XnPagedResult(); } - + [HttpPost("/BookingOrder/AddOrUpdate")] public async Task AddOrUpdate(BookingOrderDto Dto) { diff --git a/Myshipping.Core/Extension/InputBase.cs b/Myshipping.Core/Extension/InputBase.cs index 31fc6cec..a1963e46 100644 --- a/Myshipping.Core/Extension/InputBase.cs +++ b/Myshipping.Core/Extension/InputBase.cs @@ -59,12 +59,9 @@ public class PageInputBase public virtual string SortField { get; set; } /// - /// 排序方法,默认升序,否则降序(配合antd前端,约定参数为 Ascend,Dscend) + /// 排序方法,默认降序 /// - public virtual string SortOrder { get; set; } + public virtual bool descSort { get; set; } = true; - /// - /// 降序排序(不要问我为什么是descend不是desc,前端约定参数就是这样) - /// - public virtual string DescStr { get; set; } = "descend"; + } diff --git a/Myshipping.Core/Extension/PageInputOrder.cs b/Myshipping.Core/Extension/PageInputOrder.cs index 219c2e29..ac41209b 100644 --- a/Myshipping.Core/Extension/PageInputOrder.cs +++ b/Myshipping.Core/Extension/PageInputOrder.cs @@ -8,18 +8,16 @@ public class PageInputOrder /// /// 排序方式(默认降序) /// - /// - /// 是否降序 /// - public static string OrderBuilder(PageInputBase pageInput, bool descSort = true) + public static string OrderBuilder(string SortField,bool descSort = true) { // 约定默认每张表都有Id排序 var orderStr = descSort ? "Id Desc" : "Id Asc"; // 排序是否可用-排序字段和排序顺序都为非空才启用排序 - if (!string.IsNullOrEmpty(pageInput.SortField) && !string.IsNullOrEmpty(pageInput.SortOrder)) + if (!string.IsNullOrEmpty(SortField)) { - orderStr = $"{pageInput.SortField} {(pageInput.SortOrder == pageInput.DescStr ? "Desc" : "Asc")}"; + orderStr = $"{SortField} {(descSort ? "Desc" : "Asc")}"; } return orderStr; } diff --git a/Myshipping.Core/Myshipping.Core.xml b/Myshipping.Core/Myshipping.Core.xml index 00494c25..69d8177a 100644 --- a/Myshipping.Core/Myshipping.Core.xml +++ b/Myshipping.Core/Myshipping.Core.xml @@ -5087,14 +5087,9 @@ 排序字段 - + - 排序方法,默认升序,否则降序(配合antd前端,约定参数为 Ascend,Dscend) - - - - - 降序排序(不要问我为什么是descend不是desc,前端约定参数就是这样) + 排序方法,默认降序 @@ -5172,12 +5167,10 @@ 通用输入帮助类 - + 排序方式(默认降序) - - 是否降序 From 418ae00c8d97098240776e1264b34283d9fe3469 Mon Sep 17 00:00:00 2001 From: wet <1034391973@qq.com> Date: Thu, 8 Dec 2022 14:44:51 +0800 Subject: [PATCH 09/21] =?UTF-8?q?=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/BookingOrder/BookingOrderService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs index ac029c24..88312ab8 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs @@ -289,7 +289,7 @@ namespace Myshipping.Application .WhereIF(!string.IsNullOrWhiteSpace(input.LANECODE), u => u.LANECODE == input.LANECODE) .WhereIF(!string.IsNullOrWhiteSpace(input.LANENAME), u => u.LANENAME.Contains(input.LANENAME)) .WhereIF(!string.IsNullOrWhiteSpace(input.FREIGHTPAYER), u => u.FREIGHTPAYER.Contains(input.FREIGHTPAYER)) - .Where(u => userlist.Contains((long)u.CreatedUserId)).OrderByIF(true, x=>x.ATD, OrderByType.Asc) + .Where(u => userlist.Contains((long)u.CreatedUserId)) .OrderBy(PageInputOrder.OrderBuilder(input.SortField,input.descSort)) .ToPagedListAsync(input.PageNo, input.PageSize); return entities.XnPagedResult(); From 6f5466a5b563a855456a83ea963a802d0a511ae5 Mon Sep 17 00:00:00 2001 From: wet <1034391973@qq.com> Date: Thu, 8 Dec 2022 15:30:31 +0800 Subject: [PATCH 10/21] =?UTF-8?q?=E9=99=84=E4=BB=B6=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/BookingOrder/BookingOrderService.cs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs index 88312ab8..22cafc69 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs @@ -1366,9 +1366,18 @@ namespace Myshipping.Application { throw Oops.Bah("类型参数不正确"); } + var mblno= await _rep.AsQueryable().Where(x=>x.Id==bookingId).Select(x=>x.MBLNO).FirstAsync(); + string fileName = string.Empty; + if (string.IsNullOrWhiteSpace(mblno)) + { + fileName = HttpUtility.UrlEncode($"{bookingId}_{DateTime.Now.Ticks}.{fileType}", Encoding.GetEncoding("UTF-8"));////名称 + + } + else { - var fileName = HttpUtility.UrlEncode($"{bookingId}_{DateTime.Now.Ticks}.{fileType}", Encoding.GetEncoding("UTF-8"));////名称 - //var result = new FileContentResult(bs, "application/octet-stream") { FileDownloadName = fileName }; + fileName = HttpUtility.UrlEncode($"{mblno}_{DateTime.Now.Ticks}.{fileType}", Encoding.GetEncoding("UTF-8"));////名称 + } + //var result = new FileContentResult(bs, "application/octet-stream") { FileDownloadName = fileName }; var opt = App.GetOptions().Path; var serverpath = Path.Combine(App.WebHostEnvironment.WebRootPath, opt);//服务器路径 if (!Directory.Exists(serverpath)) From 65567f9c5d426ee63a2455ccbb6278402a1d0c7c Mon Sep 17 00:00:00 2001 From: wet <1034391973@qq.com> Date: Fri, 9 Dec 2022 11:54:28 +0800 Subject: [PATCH 11/21] =?UTF-8?q?=E6=94=BE=E8=88=B1=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/BookingOrder/BookingOrderService.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs index 22cafc69..21d56ed1 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs @@ -1097,6 +1097,23 @@ namespace Myshipping.Application } } + + + /// + /// 删除放舱 + /// + /// + /// + [SqlSugarUnitOfWork] + [HttpPost("/BookingLetteryard/LetterYardDelete")] + public async Task LetterYardDelete(long Id) + { + await _repLetterYard.DeleteAsync(x => x.BookingId == Id); + _logger.LogInformation(Id + "放舱删除成功!"); + } + + + /// /// 放舱发送 /// From b03353209c3d08acfa169ce62d102c695e0599fe Mon Sep 17 00:00:00 2001 From: wet <1034391973@qq.com> Date: Fri, 9 Dec 2022 15:36:11 +0800 Subject: [PATCH 12/21] =?UTF-8?q?=E5=85=B3=E7=B3=BB=E4=BA=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/BookingOrderContact/BookingOrderContactService.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Myshipping.Application/Service/BookingOrderContact/BookingOrderContactService.cs b/Myshipping.Application/Service/BookingOrderContact/BookingOrderContactService.cs index 8b03ea43..e1bf3861 100644 --- a/Myshipping.Application/Service/BookingOrderContact/BookingOrderContactService.cs +++ b/Myshipping.Application/Service/BookingOrderContact/BookingOrderContactService.cs @@ -9,6 +9,7 @@ using System.Threading.Tasks; using Myshipping.Application.Entity; using Microsoft.Extensions.Logging; using System.Collections.Generic; +using Furion.FriendlyException; namespace Myshipping.Application { @@ -111,6 +112,9 @@ namespace Myshipping.Application [HttpPost("/BookingOrderContact/savebatch"), SqlSugarUnitOfWork] public async Task SaveBatch(List input) { + if (input!=null&&input.Count>0) { + throw Oops.Oh($"请传入正确数据"); + } var bookingId = input.First().BookingId; _rep.Delete(x => x.BookingId == bookingId); foreach (var item in input) From 084715fe39379f156babbf01887a5cab06d4860f Mon Sep 17 00:00:00 2001 From: wet <1034391973@qq.com> Date: Fri, 9 Dec 2022 15:58:49 +0800 Subject: [PATCH 13/21] =?UTF-8?q?=E5=85=B3=E7=B3=BB=E4=BA=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/BookingOrderContact/BookingOrderContactService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Myshipping.Application/Service/BookingOrderContact/BookingOrderContactService.cs b/Myshipping.Application/Service/BookingOrderContact/BookingOrderContactService.cs index e1bf3861..fc8c8295 100644 --- a/Myshipping.Application/Service/BookingOrderContact/BookingOrderContactService.cs +++ b/Myshipping.Application/Service/BookingOrderContact/BookingOrderContactService.cs @@ -112,7 +112,7 @@ namespace Myshipping.Application [HttpPost("/BookingOrderContact/savebatch"), SqlSugarUnitOfWork] public async Task SaveBatch(List input) { - if (input!=null&&input.Count>0) { + if (input!=null||input.Count==0) { throw Oops.Oh($"请传入正确数据"); } var bookingId = input.First().BookingId; From 504b642ba264c231c31e43021ad51793dab0011c Mon Sep 17 00:00:00 2001 From: wet <1034391973@qq.com> Date: Fri, 9 Dec 2022 16:22:11 +0800 Subject: [PATCH 14/21] =?UTF-8?q?=E5=85=B3=E7=B3=BB=E4=BA=BA=E4=BF=9D?= =?UTF-8?q?=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BookingOrderContactService.cs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/Myshipping.Application/Service/BookingOrderContact/BookingOrderContactService.cs b/Myshipping.Application/Service/BookingOrderContact/BookingOrderContactService.cs index fc8c8295..4cadd0fc 100644 --- a/Myshipping.Application/Service/BookingOrderContact/BookingOrderContactService.cs +++ b/Myshipping.Application/Service/BookingOrderContact/BookingOrderContactService.cs @@ -110,17 +110,16 @@ namespace Myshipping.Application /// /// [HttpPost("/BookingOrderContact/savebatch"), SqlSugarUnitOfWork] - public async Task SaveBatch(List input) + public async Task SaveBatch(List input,long bookingId) { - if (input!=null||input.Count==0) { - throw Oops.Oh($"请传入正确数据"); - } - var bookingId = input.First().BookingId; _rep.Delete(x => x.BookingId == bookingId); - foreach (var item in input) - { - await _rep.InsertAsync(item.Adapt()); + if (input!=null&&input.Count>0) { + foreach (var item in input) + { + await _rep.InsertAsync(item.Adapt()); + } } + } ///// From 9783bef16b93b02c892f4017cd8ab949dee21796 Mon Sep 17 00:00:00 2001 From: wet <1034391973@qq.com> Date: Mon, 12 Dec 2022 10:22:37 +0800 Subject: [PATCH 15/21] =?UTF-8?q?=E5=88=97=E8=A1=A8=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BookingOrder/Dto/PageBookingOrder.cs | 759 ++++++++++++++++++ 1 file changed, 759 insertions(+) create mode 100644 Myshipping.Application/Service/BookingOrder/Dto/PageBookingOrder.cs diff --git a/Myshipping.Application/Service/BookingOrder/Dto/PageBookingOrder.cs b/Myshipping.Application/Service/BookingOrder/Dto/PageBookingOrder.cs new file mode 100644 index 00000000..1f36953a --- /dev/null +++ b/Myshipping.Application/Service/BookingOrder/Dto/PageBookingOrder.cs @@ -0,0 +1,759 @@ +using Myshipping.Application.Entity; +using Myshipping.Core.Entity; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Myshipping.Application.Service.BookingOrder.Dto +{ + public class PageBookingOrder : DBEntityTenant + { + /// + /// 业务编号 + /// + //[Description("业务编号")] + public string BSNO { get; set; } + /// + /// 业务状态 + /// + //[Description("业务状态")] + public string BSSTATUS { get; set; } + /// + /// 业务状态名称 + /// + //[Description("业务状态名称")] + public string BSSTATUSNAME { get; set; } + /// + /// 业务日期 + /// + //[Description("业务日期")] + public DateTime? BSDATE { get; set; } + /// + /// 主提单号 + /// + [Description("主提单号")] + public string MBLNO { get; set; } + /// + /// 分提单号 + /// + [Description("分提单号")] + public string HBLNO { get; set; } + /// + /// 订舱编号 + /// + [Description("订舱编号")] + public string BOOKINGNO { get; set; } + /// + /// 合约号 + /// + [Description("合约号")] + public string CONTRACTNO { get; set; } + /// + /// 客户合同号 + /// + [Description("客户合同号")] + public string SERVICECONTRACTNO { get; set; } + /// + /// 发货人代码 + /// + //[Description("发货人代码")] + public string SHIPPERID { get; set; } + /// + /// 收货人代码 + /// + //[Description("收货人代码")] + public string CONSIGNEEID { get; set; } + /// + /// 通知人代码 + /// + //[Description("通知人代码")] + public string NOTIFYPARTYID { get; set; } + /// + /// 发货人 + /// + [Description("发货人")] + public string SHIPPER { get; set; } + /// + /// 收货人 + /// + [Description("收货人")] + public string CONSIGNEE { get; set; } + /// + /// 通知人 + /// + [Description("通知人")] + public string NOTIFYPARTY { get; set; } + /// + /// 第二通知人 + /// + [Description("第二通知人")] + public string NOTIFYPARTY2 { get; set; } + /// + /// 场站代码 + /// + //[Description("场站代码")] + public string YARDID { get; set; } + /// + /// 场站 + /// + [Description("场站")] + public string YARD { get; set; } + /// + /// 船舶呼号 + /// + [Description("船舶呼号")] + public string VESSELID { get; set; } + /// + /// 船名 + /// + [Description("船名")] + public string VESSEL { get; set; } + /// + /// 海关航次 + /// + [Description("海关航次")] + public string VOYNO { get; set; } + /// + /// 内部航次 + /// + [Description("内部航次")] + public string VOYNOINNER { get; set; } + /// + /// 开船日期 + /// + [Description("开船日期")] + public DateTime? ETD { get; set; } + /// + /// 实际开船日期 + /// + [Description("实际开船日期")] + public DateTime? ATD { get; set; } + /// + /// 截港日期 + /// + [Description("截港日期")] + public DateTime? CLOSINGDATE { get; set; } + /// + /// 截单日期 + /// + [Description("截单日期")] + public DateTime? CLOSEDOCDATE { get; set; } + /// + /// 截VGM时间 + /// + [Description("截VGM时间")] + public DateTime? CLOSEVGMDATE { get; set; } + /// + /// 预计到港日期 + /// + [Description("预计到港日期")] + public DateTime? ETA { get; set; } + /// + /// 收货地代码 + /// + //[Description("收货地代码")] + public string PLACERECEIPTID { get; set; } + /// + /// 收货地 + /// + [Description("收货地")] + public string PLACERECEIPT { get; set; } + /// + /// 起运港代码 + /// + [Description("起运港代码")] + public string PORTLOADID { get; set; } + /// + /// 起运港 + /// + [Description("起运港")] + public string PORTLOAD { get; set; } + /// + /// 卸货港代码 + /// + [Description("卸货港代码")] + public string PORTDISCHARGEID { get; set; } + /// + /// 卸货港 + /// + [Description("卸货港")] + public string PORTDISCHARGE { get; set; } + /// + /// 交货地代码 + /// + [Description("交货地代码")] + public string PLACEDELIVERYID { get; set; } + /// + /// 交货地 + /// + [Description("交货地")] + public string PLACEDELIVERY { get; set; } + /// + /// 目的地代码 + /// + [Description("目的地代码")] + public string DESTINATIONID { get; set; } + /// + /// 目的地 + /// + [Description("目的地")] + public string DESTINATION { get; set; } + /// + /// 提单份数 + /// + [Description("提单份数")] + public string NOBILL { get; set; } + /// + /// 副本提单份数 + /// + [Description("副本提单份数")] + public string COPYNOBILL { get; set; } + /// + /// 签单方式 + /// + [Description("签单方式")] + public string ISSUETYPE { get; set; } + /// + /// 签单日期 + /// + [Description("签单日期")] + public DateTime? ISSUEDATE { get; set; } + /// + /// 签单地点代码 + /// + [Description("签单地点代码")] + public string ISSUEPLACEID { get; set; } + /// + /// 签单地点 + /// + [Description("签单地点")] + public string ISSUEPLACE { get; set; } + /// + /// 付费方式 + /// + [Description("付费方式")] + public string BLFRT { get; set; } + /// + /// 预付地点 + /// + [Description("预付地点")] + public string PREPARDAT { get; set; } + /// + /// 到付地点 + /// + [Description("到付地点")] + public string PAYABLEAT { get; set; } + /// + /// 运输条款 + /// + [Description("运输条款")] + public string SERVICE { get; set; } + /// + /// 唛头 + /// + [Description("唛头")] + public string MARKS { get; set; } + /// + /// HS代码 + /// + [Description("HS代码")] + public string HSCODE { get; set; } + /// + /// 货描 + /// + [Description("货描")] + public string DESCRIPTION { 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 string TOTALNO { get; set; } + /// + /// 集装箱 + /// + [Description("集装箱")] + public string CNTRTOTAL { get; set; } + /// + /// 船公司代号 + /// + [Description("船公司代号")] + public string CARRIERID { get; set; } + /// + /// 船公司 + /// + [Description("船公司")] + public string CARRIER { get; set; } + /// + /// 货物标识 + /// + [Description("货物标识")] + public string CARGOID { get; set; } + /// + /// 危险品类别 + /// + [Description("危险品类别")] + public string DCLASS { get; set; } + /// + /// 危险品编号 + /// + [Description("危险品编号")] + public string DUNNO { get; set; } + /// + /// 危险品页号 + /// + [Description("危险品页号")] + public string DPAGE { get; set; } + /// + /// 危险品标签 + /// + [Description("危险品标签")] + public string DLABEL { get; set; } + /// + /// 危险品联系人 + /// + [Description("危险品联系人")] + public string LINKMAN { get; set; } + /// + /// 温度单位 + /// + [Description("温度单位")] + public string TEMPID { get; set; } + /// + /// 设置温度 + /// + [Description("设置温度")] + public string TEMPSET { get; set; } + /// + /// 通风度 + /// + [Description("通风度")] + public string REEFERF { get; set; } + /// + /// 湿度 + /// + [Description("湿度")] + public string HUMIDITY { get; set; } + /// + /// 最低温度 + /// + [Description("最低温度")] + public string TEMPMIN { get; set; } + /// + /// 最高温度 + /// + [Description("最高温度")] + public string TEMPMAX { get; set; } + /// + /// 是否SOC箱 + /// + [Description("是否SOC箱")] + public bool? ISCONTAINERSOC { get; set; } + /// + /// SO备注 + /// + [Description("SO备注")] + public string SOREMARK { get; set; } + /// + /// SI备注 + /// + [Description("SI备注")] + public string SIREMARK { get; set; } + /// + /// 场站备注 + /// + [Description("场站备注")] + public string YARDREMARK { get; set; } + /// + /// 公司ID + /// + //[Description("公司ID")] + public string COMPID { get; set; } + /// + /// 公司名称 + /// + [Description("公司名称")] + public string COMPNAME { get; set; } + /// + /// 发货人名称 + /// + [Description("发货人名称")] + public string SHIPPERNAME { get; set; } + /// + /// 发货人地址1 + /// + [Description("发货人地址1")] + public string SHIPPERADDR1 { get; set; } + /// + /// 发货人地址2 + /// + [Description("发货人地址2")] + public string SHIPPERADDR2 { get; set; } + /// + /// 发货人地址3 + /// + [Description("发货人地址3")] + public string SHIPPERADDR3 { get; set; } + /// + /// 发货人城市 + /// + [Description("发货人城市")] + public string SHIPPERCITY { get; set; } + /// + /// 发货人省份代码 + /// + [Description("发货人省份代码")] + public string SHIPPERPROVINCE { get; set; } + /// + /// 发货人邮编 + /// + [Description("发货人邮编")] + public string SHIPPERPOSTCODE { get; set; } + /// + /// 发货人国家代码 + /// + [Description("发货人国家代码")] + public string SHIPPERCOUNTRY { get; set; } + /// + /// 发货人联系人 + /// + [Description("发货人联系人")] + public string SHIPPERATTN { get; set; } + /// + /// 发货人电话 + /// + [Description("发货人电话")] + public string SHIPPERTEL { get; set; } + /// + /// 收货人名称 + /// + [Description("收货人名称")] + public string CONSIGNEENAME { get; set; } + /// + /// 收货人地址1 + /// + [Description("收货人地址1")] + public string CONSIGNEEADDR1 { get; set; } + /// + /// 收货人地址2 + /// + [Description("收货人地址2")] + public string CONSIGNEEADDR2 { get; set; } + /// + /// 收货人地址3 + /// + [Description("收货人地址3")] + public string CONSIGNEEADDR3 { get; set; } + /// + /// 收货人城市 + /// + [Description("收货人城市")] + public string CONSIGNEECITY { get; set; } + /// + /// 收货人省份代码 + /// + [Description("收货人省份代码")] + public string CONSIGNEEPROVINCE { get; set; } + /// + /// 收货人邮编 + /// + [Description("收货人邮编")] + public string CONSIGNEEPOSTCODE { get; set; } + /// + /// 收货人国家代码 + /// + [Description("收货人国家代码")] + public string CONSIGNEERCOUNTRY { get; set; } + /// + /// 收货人联系人 + /// + [Description("收货人联系人")] + public string CONSIGNEEATTN { get; set; } + /// + /// 收货人电话 + /// + [Description("收货人电话")] + public string CONSIGNEETEL { get; set; } + /// + /// 通知人名称 + /// + [Description("通知人名称")] + public string NOTIFYPARTYNAME { get; set; } + /// + /// 通知人地址1 + /// + [Description("通知人地址1")] + public string NOTIFYPARTYADDR1 { get; set; } + /// + /// 通知人地址2 + /// + [Description("通知人地址2")] + public string NOTIFYPARTYADDR2 { get; set; } + /// + /// 通知人地址3 + /// + [Description("通知人地址3")] + public string NOTIFYPARTYADDR3 { get; set; } + /// + /// 通知人城市 + /// + [Description("通知人城市")] + public string NOTIFYPARTYCITY { get; set; } + /// + /// 通知人省份代码 + /// + [Description("通知人省份代码")] + public string NOTIFYPARTYPROVINCE { get; set; } + /// + /// 通知人邮编 + /// + [Description("通知人邮编")] + public string NOTIFYPARTYPOSTCODE { get; set; } + /// + /// 通知人国家代码 + /// + [Description("通知人国家代码")] + public string NOTIFYPARTYCOUNTRY { get; set; } + /// + /// 通知人联系人 + /// + [Description("通知人联系人")] + public string NOTIFYPARTYATTN { get; set; } + /// + /// 通知人电话 + /// + [Description("通知人电话")] + public string NOTIFYPARTYTEL { get; set; } + /// + /// PO号 + /// + [Description("PO号")] + public string PONO { get; set; } + /// + /// 操作id + /// + [Description("操作id")] + public string OPID { get; set; } + /// + /// 单证id + /// + [Description("单证id")] + public string DOCID { get; set; } + /// + /// 操作 + /// + [Description("操作")] + public string OP { get; set; } + /// + /// 单证 + /// + //[Description("单证")] + public string DOC { get; set; } + /// + /// 销售ID + /// + //[Description("销售ID")] + public string SALEID { get; set; } + /// + /// 销售 + /// + [Description("销售")] + public string SALE { get; set; } + /// + /// 客服ID + /// + //[Description("客服ID")] + public string CUSTSERVICEID { get; set; } + /// + /// 客服 + /// + [Description("客服")] + public string CUSTSERVICE { get; set; } + /// + /// 客户 + /// + [Description("客户")] + public string CUSTOMERNAME { get; set; } + /// + /// 订舱代理 + /// + [Description("订舱代理")] + public string FORWARDER { get; set; } + /// + /// 船代 + /// + [Description("船代")] + public string SHIPAGENCY { get; set; } + /// + /// 报关行 + /// + [Description("报关行")] + public string CUSTOMSER { get; set; } + /// + /// 车队 + /// + [Description("车队")] + public string TRUCKER { get; set; } + /// + /// 国外代理 + /// + [Description("国外代理")] + public string AGENTID { get; set; } + /// + /// 客户ID + /// + //[Description("客户ID")] + public long? CUSTOMERID { get; set; } + /// + /// 订舱代理ID + /// + [Description("订舱代理ID")] + public string FORWARDERID { get; set; } + /// + /// 船代ID + /// + //[Description("船代ID")] + public string SHIPAGENCYID { get; set; } + /// + /// 报关行ID + /// + [Description("报关行ID")] + public string CUSTOMSERID { get; set; } + /// + /// 车队ID + /// + //[Description("车队ID")] + public string TRUCKERID { get; set; } + /// + /// 国外代理名称 + /// + [Description("国外代理名称")] + public string AGENTNAME { get; set; } + /// + /// 委托方 + /// + [Description("委托方")] + public string WEITUO { get; set; } + /// + /// 收货人DOOR地址 + /// + [Description("收货人DOOR地址")] + public string CONSIGNEEDOORADDR { get; set; } + /// + /// 发货人DOOR地址 + /// + [Description("发货人DOOR地址")] + public string SHIPPERDOORADDR { get; set; } + /// + /// SCAC代码 + /// + [Description("SCAC代码")] + public string SCACCODE { get; set; } + /// + /// ITN编号 + /// + [Description("ITN编号")] + public string ITNCODE { get; set; } + /// + /// 预付地点ID + /// + //[Description("预付地点ID")] + public string PREPARDATID { get; set; } + /// + /// 到付地点ID + /// + //[Description("到付地点ID")] + public string PAYABLEATID { get; set; } + /// + /// 客户系统编号 + /// + [Description("客户系统编号")] + public string CUSTNO { get; set; } + /// + /// 中转港代码 + /// + [Description("中转港代码")] + public string TRANSPORTID { get; set; } + /// + /// 中转港 + /// + [Description("中转港")] + public string TRANSPORT { get; set; } + /// + /// 第三付款地 + /// + [Description("第三付款地")] + public string THIRDPAYADDR { get; set; } + /// + /// 场站联系人 + /// + [Description("场站联系人")] + public string YARDCONTRACT { get; set; } + /// + /// 场站联系人电话 + /// + [Description("场站联系人电话")] + public string YARDCONTRACTTEL { get; set; } + /// + /// 场站联系人邮箱 + /// + [Description("场站联系人邮箱")] + public string YARDCONTRACTEMAIL { get; set; } + /// + /// 费用自结 + /// + [Description("费用自结")] + public bool? FEESELF { get; set; } + /// + /// 航线代码 + /// + [Description("航线代码")] + public string LANECODE { get; set; } + /// + /// 航线名称 + /// + [Description("航线名称")] + public string LANENAME { get; set; } + /// + /// 付款方 + /// + [Description("付款方")] + public string FREIGHTPAYER { get; set; } + /// + /// 租户名称 + /// + //[Description("租户名称")] + public string TenantName { get; set; } + /// + /// 主单ID + /// + //[Description("主单ID")] + public long? ParentId { get; set; } + + + + public List bookstatus { get; set; } + } +} From 0f6fe2326888870a1e8fde706e84c38d14cddc89 Mon Sep 17 00:00:00 2001 From: wet <1034391973@qq.com> Date: Mon, 12 Dec 2022 10:23:04 +0800 Subject: [PATCH 16/21] =?UTF-8?q?=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/BookingOrder/BookingOrderService.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs index 21d56ed1..31b2353b 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs @@ -292,7 +292,16 @@ namespace Myshipping.Application .Where(u => userlist.Contains((long)u.CreatedUserId)) .OrderBy(PageInputOrder.OrderBuilder(input.SortField,input.descSort)) .ToPagedListAsync(input.PageNo, input.PageSize); - return entities.XnPagedResult(); + var list = entities.Adapt>(); + + foreach (var item in list.Items) + { + var sta = await _repBookingStatus.AsQueryable().Where(x => x.BookingId == item.Id).ToListAsync(); + if (sta != null) { item.bookstatus = sta; } + + + } + return list; } From 239e9a72106282d28696abce549a8f66a20ff970 Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Mon, 12 Dec 2022 10:42:19 +0800 Subject: [PATCH 17/21] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=9F=BA=E7=A1=80?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=9B=BD=E5=AE=B6=E4=BF=9D=E5=AD=98=E6=96=B9?= =?UTF-8?q?=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Myshipping.Core/Service/CommonDB/CommonDBService.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Myshipping.Core/Service/CommonDB/CommonDBService.cs b/Myshipping.Core/Service/CommonDB/CommonDBService.cs index e6d6725a..e70bd01a 100644 --- a/Myshipping.Core/Service/CommonDB/CommonDBService.cs +++ b/Myshipping.Core/Service/CommonDB/CommonDBService.cs @@ -1177,7 +1177,7 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie if (model != null) { - var checkModel = _codeCountryRep.AsQueryable().Where(t => t.Code == entity.Code && t.GID != entity.GID); + var checkModel = _codeCountryRep.AsQueryable().Where(t => t.Code == entity.Code && t.GID != entity.GID).First(); if (checkModel != null) throw Oops.Bah(ErrorCode.D1006); @@ -1194,7 +1194,7 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie } else { - var model = _codeCountryRep.AsQueryable().Where(t => t.Code == entity.Code); + var model = _codeCountryRep.AsQueryable().Where(t => t.Code == entity.Code).First(); if (model != null) throw Oops.Bah(ErrorCode.D1006); From e213bf8253c457fd6ddbc22f2fa74bf6d897a79c Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Mon, 12 Dec 2022 11:10:03 +0800 Subject: [PATCH 18/21] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=88=B9=E5=85=AC?= =?UTF-8?q?=E5=8F=B8=E5=AD=97=E6=AE=B5=EF=BC=8C=E5=8E=9F=E6=9D=A5=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E6=8B=BC=E5=86=99=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/RulesEngine/Dtos/OceanBookingMapper.cs | 4 ++-- .../Dtos/OrderBooking/RulesEngineOrderBookingMainInfo.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Myshipping.Application/Service/RulesEngine/Dtos/OceanBookingMapper.cs b/Myshipping.Application/Service/RulesEngine/Dtos/OceanBookingMapper.cs index 95714fb3..7d04a75f 100644 --- a/Myshipping.Application/Service/RulesEngine/Dtos/OceanBookingMapper.cs +++ b/Myshipping.Application/Service/RulesEngine/Dtos/OceanBookingMapper.cs @@ -67,7 +67,7 @@ namespace Myshipping.Application .Map(dest => dest.TotalNO, src => src.TOTALNO) .Map(dest => dest.CntrTotal, src => src.CNTRTOTAL) .Map(dest => dest.CarrierId, src => src.CARRIERID) - .Map(dest => dest.Carrirer, src => src.CARRIER) + .Map(dest => dest.Carrier, src => src.CARRIER) .Map(dest => dest.CargoId, src => src.CARGOID) .Map(dest => dest.DClass, src => src.DCLASS) .Map(dest => dest.DUnno, src => src.DUNNO) @@ -204,7 +204,7 @@ namespace Myshipping.Application .Map(dest => dest.TotalNO, src => src.TOTALNO) .Map(dest => dest.CntrTotal, src => src.CNTRTOTAL) .Map(dest => dest.CarrierId, src => src.CARRIERID) - .Map(dest => dest.Carrirer, src => src.CARRIER) + .Map(dest => dest.Carrier, src => src.CARRIER) .Map(dest => dest.CargoId, src => src.CARGOID) .Map(dest => dest.DClass, src => src.DCLASS) .Map(dest => dest.DUnno, src => src.DUNNO) diff --git a/Myshipping.Application/Service/RulesEngine/Dtos/OrderBooking/RulesEngineOrderBookingMainInfo.cs b/Myshipping.Application/Service/RulesEngine/Dtos/OrderBooking/RulesEngineOrderBookingMainInfo.cs index 101ad17c..e8e64a20 100644 --- a/Myshipping.Application/Service/RulesEngine/Dtos/OrderBooking/RulesEngineOrderBookingMainInfo.cs +++ b/Myshipping.Application/Service/RulesEngine/Dtos/OrderBooking/RulesEngineOrderBookingMainInfo.cs @@ -251,7 +251,7 @@ namespace Myshipping.Application /// /// 船公司 /// - public string Carrirer { get; set; } + public string Carrier { get; set; } /// /// 货物标识 /// From 1d9c10043bd49ef0b3fa5e752eecbfd4bc448a7b Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Mon, 12 Dec 2022 11:19:59 +0800 Subject: [PATCH 19/21] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=9B=BD=E5=AE=B6?= =?UTF-8?q?=E7=9A=84=E6=9F=A5=E8=AF=A2=E6=96=B9=E6=B3=95=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/CommonDB/CommonDBService.cs | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/Myshipping.Core/Service/CommonDB/CommonDBService.cs b/Myshipping.Core/Service/CommonDB/CommonDBService.cs index e70bd01a..a990a8ea 100644 --- a/Myshipping.Core/Service/CommonDB/CommonDBService.cs +++ b/Myshipping.Core/Service/CommonDB/CommonDBService.cs @@ -1081,10 +1081,10 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie List list = await _sysCacheService.GetAllCodeLane(); var queryList = list.WhereIF(!string.IsNullOrEmpty(input.KeyWord), - x => x.Code.Contains(input.KeyWord, System.StringComparison.CurrentCultureIgnoreCase) - || x.EnName.Contains(input.KeyWord, System.StringComparison.CurrentCultureIgnoreCase) - || x.CnName.Contains(input.KeyWord, System.StringComparison.CurrentCultureIgnoreCase) - || x.LaneType.Contains(input.KeyWord, System.StringComparison.CurrentCultureIgnoreCase) + x => (!string.IsNullOrWhiteSpace(x.Code) && x.Code.Contains(input.KeyWord, System.StringComparison.CurrentCultureIgnoreCase)) + || (!string.IsNullOrWhiteSpace(x.EnName) && x.EnName.Contains(input.KeyWord, System.StringComparison.CurrentCultureIgnoreCase)) + || (!string.IsNullOrWhiteSpace(x.CnName) && x.CnName.Contains(input.KeyWord, System.StringComparison.CurrentCultureIgnoreCase)) + || (!string.IsNullOrWhiteSpace(x.LaneType) && x.LaneType.Contains(input.KeyWord, System.StringComparison.CurrentCultureIgnoreCase)) ); @@ -1149,10 +1149,10 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie // throw Oops.Bah("参数过多,请传入模块查询"); //} var queryList = list.Where(x => x.Module == input.Module) - .WhereIF(!string.IsNullOrEmpty(input.LaneCode), x => x.LaneCode.Contains(input.LaneCode, System.StringComparison.CurrentCultureIgnoreCase)) - .WhereIF(!string.IsNullOrEmpty(input.CarrierCode), x => x.CarrierCode.Contains(input.CarrierCode, System.StringComparison.CurrentCultureIgnoreCase)) - .WhereIF(!string.IsNullOrEmpty(input.PortCode), x => x.PortCode.Contains(input.PortCode, System.StringComparison.CurrentCultureIgnoreCase)) - .WhereIF(!string.IsNullOrEmpty(input.Module), x => x.Module.Contains(input.Module, System.StringComparison.CurrentCultureIgnoreCase)); + .WhereIF(!string.IsNullOrEmpty(input.LaneCode), x => !string.IsNullOrWhiteSpace(x.LaneCode) && x.LaneCode.Contains(input.LaneCode, System.StringComparison.CurrentCultureIgnoreCase)) + .WhereIF(!string.IsNullOrEmpty(input.CarrierCode), x => !string.IsNullOrWhiteSpace(x.CarrierCode) && x.CarrierCode.Contains(input.CarrierCode, System.StringComparison.CurrentCultureIgnoreCase)) + .WhereIF(!string.IsNullOrEmpty(input.PortCode), x => !string.IsNullOrWhiteSpace(x.PortCode) && x.PortCode.Contains(input.PortCode, System.StringComparison.CurrentCultureIgnoreCase)) + .WhereIF(!string.IsNullOrEmpty(input.Module), x => !string.IsNullOrWhiteSpace(x.Module) && x.Module.Contains(input.Module, System.StringComparison.CurrentCultureIgnoreCase)); return queryList.ToList(); } #endregion @@ -1221,11 +1221,11 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie List list = await _sysCacheService.GetAllCodeCountry(); var queryList = list.WhereIF(!string.IsNullOrEmpty(input.KeyWord), - x => x.Code.Contains(input.KeyWord, System.StringComparison.CurrentCultureIgnoreCase) - || x.EnName.Contains(input.KeyWord, System.StringComparison.CurrentCultureIgnoreCase) - || x.CnName.Contains(input.KeyWord, System.StringComparison.CurrentCultureIgnoreCase) - || x.Capital.Contains(input.KeyWord, System.StringComparison.CurrentCultureIgnoreCase) - || x.Continent.Contains(input.KeyWord, System.StringComparison.CurrentCultureIgnoreCase) + x => (!string.IsNullOrWhiteSpace(x.Code) && x.Code.Contains(input.KeyWord, System.StringComparison.CurrentCultureIgnoreCase)) + || (!string.IsNullOrWhiteSpace(x.EnName) && x.EnName.Contains(input.KeyWord, System.StringComparison.CurrentCultureIgnoreCase)) + || (!string.IsNullOrWhiteSpace(x.CnName) && x.CnName.Contains(input.KeyWord, System.StringComparison.CurrentCultureIgnoreCase)) + || (!string.IsNullOrWhiteSpace(x.Capital) && x.Capital.Contains(input.KeyWord, System.StringComparison.CurrentCultureIgnoreCase)) + || (!string.IsNullOrWhiteSpace(x.Continent) && x.Continent.Contains(input.KeyWord, System.StringComparison.CurrentCultureIgnoreCase)) ); return queryList.ToList(); From 289ba48e2ce5712369fc7e784bf448107afcf86f Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Mon, 12 Dec 2022 15:36:27 +0800 Subject: [PATCH 20/21] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=88=AA=E7=BA=BF?= =?UTF-8?q?=E7=9A=84=E6=9F=A5=E8=AF=A2=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Myshipping.Core/Service/CommonDB/CommonDBService.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Myshipping.Core/Service/CommonDB/CommonDBService.cs b/Myshipping.Core/Service/CommonDB/CommonDBService.cs index a990a8ea..29de8786 100644 --- a/Myshipping.Core/Service/CommonDB/CommonDBService.cs +++ b/Myshipping.Core/Service/CommonDB/CommonDBService.cs @@ -1122,6 +1122,14 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie } else { + var model = _relaPortCarrierLaneRep.AsQueryable().Where(t => t.LaneCode == entity.LaneCode + && t.Module == entity.Module + && t.CarrierCode == entity.CarrierCode + && t.PortCode == entity.PortCode).First(); + + if (model != null) + throw Oops.Bah(ErrorCode.D1006); + entity.GID = Guid.NewGuid().ToString(); entity.CreateTime = DateTime.Now; entity.CreateUser = UserManager.DjyUserId; @@ -1148,7 +1156,8 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie //{ // throw Oops.Bah("参数过多,请传入模块查询"); //} - var queryList = list.Where(x => x.Module == input.Module) + var queryList = list + .WhereIF(!string.IsNullOrEmpty(input.Module), x => !string.IsNullOrWhiteSpace(x.Module) && x.Module.Equals(input.LaneCode, System.StringComparison.CurrentCultureIgnoreCase)) .WhereIF(!string.IsNullOrEmpty(input.LaneCode), x => !string.IsNullOrWhiteSpace(x.LaneCode) && x.LaneCode.Contains(input.LaneCode, System.StringComparison.CurrentCultureIgnoreCase)) .WhereIF(!string.IsNullOrEmpty(input.CarrierCode), x => !string.IsNullOrWhiteSpace(x.CarrierCode) && x.CarrierCode.Contains(input.CarrierCode, System.StringComparison.CurrentCultureIgnoreCase)) .WhereIF(!string.IsNullOrEmpty(input.PortCode), x => !string.IsNullOrWhiteSpace(x.PortCode) && x.PortCode.Contains(input.PortCode, System.StringComparison.CurrentCultureIgnoreCase)) From fddb9cb48d6b4384d1ecc95bd3db34c65f3b2376 Mon Sep 17 00:00:00 2001 From: wet <1034391973@qq.com> Date: Mon, 12 Dec 2022 15:42:58 +0800 Subject: [PATCH 21/21] =?UTF-8?q?=E8=BF=90=E8=B8=AA=E8=AE=A2=E9=98=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Myshipping.Application.xml | 749 +++++++++++++++++- .../BookingOrder/BookingOrderService.cs | 165 ++-- 2 files changed, 832 insertions(+), 82 deletions(-) diff --git a/Myshipping.Application/Myshipping.Application.xml b/Myshipping.Application/Myshipping.Application.xml index 3a18ea08..1e5b1cbc 100644 --- a/Myshipping.Application/Myshipping.Application.xml +++ b/Myshipping.Application/Myshipping.Application.xml @@ -4463,7 +4463,7 @@ - + 批量保存关系人(同时新增、删除、修改) @@ -4797,6 +4797,13 @@ + + + 删除放舱 + + + + 放舱发送 @@ -5234,6 +5241,746 @@ 状态时间 + + + 业务编号 + + + + + 业务状态 + + + + + 业务状态名称 + + + + + 业务日期 + + + + + 主提单号 + + + + + 分提单号 + + + + + 订舱编号 + + + + + 合约号 + + + + + 客户合同号 + + + + + 发货人代码 + + + + + 收货人代码 + + + + + 通知人代码 + + + + + 发货人 + + + + + 收货人 + + + + + 通知人 + + + + + 第二通知人 + + + + + 场站代码 + + + + + 场站 + + + + + 船舶呼号 + + + + + 船名 + + + + + 海关航次 + + + + + 内部航次 + + + + + 开船日期 + + + + + 实际开船日期 + + + + + 截港日期 + + + + + 截单日期 + + + + + 截VGM时间 + + + + + 预计到港日期 + + + + + 收货地代码 + + + + + 收货地 + + + + + 起运港代码 + + + + + 起运港 + + + + + 卸货港代码 + + + + + 卸货港 + + + + + 交货地代码 + + + + + 交货地 + + + + + 目的地代码 + + + + + 目的地 + + + + + 提单份数 + + + + + 副本提单份数 + + + + + 签单方式 + + + + + 签单日期 + + + + + 签单地点代码 + + + + + 签单地点 + + + + + 付费方式 + + + + + 预付地点 + + + + + 到付地点 + + + + + 运输条款 + + + + + 唛头 + + + + + HS代码 + + + + + 货描 + + + + + 件数 + + + + + 包装 + + + + + 毛重 + + + + + 尺码 + + + + + 件数大写 + + + + + 集装箱 + + + + + 船公司代号 + + + + + 船公司 + + + + + 货物标识 + + + + + 危险品类别 + + + + + 危险品编号 + + + + + 危险品页号 + + + + + 危险品标签 + + + + + 危险品联系人 + + + + + 温度单位 + + + + + 设置温度 + + + + + 通风度 + + + + + 湿度 + + + + + 最低温度 + + + + + 最高温度 + + + + + 是否SOC箱 + + + + + SO备注 + + + + + SI备注 + + + + + 场站备注 + + + + + 公司ID + + + + + 公司名称 + + + + + 发货人名称 + + + + + 发货人地址1 + + + + + 发货人地址2 + + + + + 发货人地址3 + + + + + 发货人城市 + + + + + 发货人省份代码 + + + + + 发货人邮编 + + + + + 发货人国家代码 + + + + + 发货人联系人 + + + + + 发货人电话 + + + + + 收货人名称 + + + + + 收货人地址1 + + + + + 收货人地址2 + + + + + 收货人地址3 + + + + + 收货人城市 + + + + + 收货人省份代码 + + + + + 收货人邮编 + + + + + 收货人国家代码 + + + + + 收货人联系人 + + + + + 收货人电话 + + + + + 通知人名称 + + + + + 通知人地址1 + + + + + 通知人地址2 + + + + + 通知人地址3 + + + + + 通知人城市 + + + + + 通知人省份代码 + + + + + 通知人邮编 + + + + + 通知人国家代码 + + + + + 通知人联系人 + + + + + 通知人电话 + + + + + PO号 + + + + + 操作id + + + + + 单证id + + + + + 操作 + + + + + 单证 + + + + + 销售ID + + + + + 销售 + + + + + 客服ID + + + + + 客服 + + + + + 客户 + + + + + 订舱代理 + + + + + 船代 + + + + + 报关行 + + + + + 车队 + + + + + 国外代理 + + + + + 客户ID + + + + + 订舱代理ID + + + + + 船代ID + + + + + 报关行ID + + + + + 车队ID + + + + + 国外代理名称 + + + + + 委托方 + + + + + 收货人DOOR地址 + + + + + 发货人DOOR地址 + + + + + SCAC代码 + + + + + ITN编号 + + + + + 预付地点ID + + + + + 到付地点ID + + + + + 客户系统编号 + + + + + 中转港代码 + + + + + 中转港 + + + + + 第三付款地 + + + + + 场站联系人 + + + + + 场站联系人电话 + + + + + 场站联系人邮箱 + + + + + 费用自结 + + + + + 航线代码 + + + + + 航线名称 + + + + + 付款方 + + + + + 租户名称 + + + + + 主单ID + + EDI扩展 diff --git a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs index 31b2353b..77ce61f1 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs @@ -924,7 +924,90 @@ namespace Myshipping.Application Code = t.Code, Value = t.Value }).ToListAsync(); - + + + #region 订舱状态 + if (item.Status == "舱单") + { + if (list.Where(x => x.Code == "sta_cangdan").FirstOrDefault() == null) + { + BookingStatus bookingStatus = new BookingStatus(); + bookingStatus.BookingId = item.BookingId; + bookingStatus.StaCode = "sta_cangdan"; + bookingStatus.StaName = dicdatalist.Where(x => x.Code == "sta_cangdan").Select(x => x.Value).FirstOrDefault(); + bookingStatus.StaTime = item.OpTime; + bookingStatus.StaCate = "book_sta_cate_billtrace"; + await _repBookingStatus.InsertAsync(bookingStatus); + } + } + if (item.Status == "报关") + { + if (list.Where(x => x.Code == "sta_haifang").FirstOrDefault() == null) + { + BookingStatus bookingStatus = new BookingStatus(); + bookingStatus.BookingId = item.BookingId; + bookingStatus.StaCode = "sta_haifang"; + bookingStatus.StaName = dicdatalist.Where(x => x.Code == "sta_haifang").Select(x => x.Value).FirstOrDefault(); + bookingStatus.StaTime = item.OpTime; + bookingStatus.StaCate = "book_sta_cate_billtrace"; + await _repBookingStatus.InsertAsync(bookingStatus); + } + } + if (item.Status == "装载") + { + if (list.Where(x => x.Code == "sta_zhuangzai").FirstOrDefault() == null) + { + BookingStatus bookingStatus = new BookingStatus(); + bookingStatus.BookingId = item.BookingId; + bookingStatus.StaCode = "sta_zhuangzai"; + bookingStatus.StaName = dicdatalist.Where(x => x.Code == "sta_zhuangzai").Select(x => x.Value).FirstOrDefault(); + bookingStatus.StaTime = item.OpTime; + bookingStatus.StaCate = "book_sta_cate_billtrace"; + await _repBookingStatus.InsertAsync(bookingStatus); + } + } + if (item.Status == "码放") + { + if (list.Where(x => x.Code == "sta_mafang").FirstOrDefault() == null) + { + BookingStatus bookingStatus = new BookingStatus(); + bookingStatus.BookingId = item.BookingId; + bookingStatus.StaCode = "sta_mafang"; + bookingStatus.StaName = dicdatalist.Where(x => x.Code == "sta_mafang").Select(x => x.Value).FirstOrDefault(); + bookingStatus.StaTime = item.OpTime; + bookingStatus.StaCate = "book_sta_cate_billtrace"; + await _repBookingStatus.InsertAsync(bookingStatus); + } + } + if (item.Status == "装船") + { + if (list.Where(x => x.Code == "sta_zhuangchuan").FirstOrDefault() == null) + { + BookingStatus bookingStatus = new BookingStatus(); + bookingStatus.BookingId = item.BookingId; + bookingStatus.StaCode = "sta_zhuangchuan"; + bookingStatus.StaName = dicdatalist.Where(x => x.Code == "sta_zhuangchuan").Select(x => x.Value).FirstOrDefault(); + bookingStatus.StaTime = item.OpTime; + bookingStatus.StaCate = "book_sta_cate_billtrace"; + await _repBookingStatus.InsertAsync(bookingStatus); + } + } + if (item.Status == "ATD") + { + if (list.Where(x => x.Code == "sta_atd").FirstOrDefault() == null) + { + BookingStatus bookingStatus = new BookingStatus(); + bookingStatus.BookingId = item.BookingId; + bookingStatus.StaCode = "sta_atd"; + bookingStatus.StaName = dicdatalist.Where(x => x.Code == "sta_atd").Select(x => x.Value).FirstOrDefault(); + bookingStatus.StaTime = item.OpTime; + bookingStatus.StaCate = "book_sta_cate_billtrace"; + await _repBookingStatus.InsertAsync(bookingStatus); + } + } + #endregion + + if (item.detail != null && item.detail.Count > 0) { foreach (var dt in item.detail) @@ -935,86 +1018,6 @@ namespace Myshipping.Application BookingStatusLogDetail.CNTRNO = dt.CNTRNO; BookingStatusLogDetail.OPTime = dt.OPTime; await _statuslogdetail.InsertAsync(BookingStatusLogDetail); - #region 订舱状态 - if (dt.Status == "舱单") - { - if (list.Where(x => x.Code == "sta_cangdan").FirstOrDefault() == null) - { - BookingStatus bookingStatus = new BookingStatus(); - bookingStatus.BookingId = item.BookingId; - bookingStatus.StaCode = "sta_cangdan"; - bookingStatus.StaName = dicdatalist.Where(x => x.Code == "sta_cangdan").Select(x => x.Value).FirstOrDefault(); - bookingStatus.StaTime = dt.OPTime; - bookingStatus.StaCate = "book_sta_cate_billtrace"; - await _repBookingStatus.InsertAsync(bookingStatus); - } - } - if (dt.Status == "报关") - { - if (list.Where(x => x.Code == "sta_haifang").FirstOrDefault() == null) - { - BookingStatus bookingStatus = new BookingStatus(); - bookingStatus.BookingId = item.BookingId; - bookingStatus.StaCode = "sta_haifang"; - bookingStatus.StaName = dicdatalist.Where(x => x.Code == "sta_haifang").Select(x => x.Value).FirstOrDefault(); - bookingStatus.StaTime = dt.OPTime; - bookingStatus.StaCate = "book_sta_cate_billtrace"; - await _repBookingStatus.InsertAsync(bookingStatus); - } - } - if (dt.Status == "装载") - { - if (list.Where(x => x.Code == "sta_zhuangzai").FirstOrDefault() == null) - { - BookingStatus bookingStatus = new BookingStatus(); - bookingStatus.BookingId = item.BookingId; - bookingStatus.StaCode = "sta_zhuangzai"; - bookingStatus.StaName = dicdatalist.Where(x => x.Code == "sta_zhuangzai").Select(x => x.Value).FirstOrDefault(); - bookingStatus.StaTime = dt.OPTime; - bookingStatus.StaCate = "book_sta_cate_billtrace"; - await _repBookingStatus.InsertAsync(bookingStatus); - } - } - if (dt.Status == "码放") - { - if (list.Where(x => x.Code == "sta_mafang").FirstOrDefault() == null) - { - BookingStatus bookingStatus = new BookingStatus(); - bookingStatus.BookingId = item.BookingId; - bookingStatus.StaCode = "sta_mafang"; - bookingStatus.StaName = dicdatalist.Where(x => x.Code == "sta_mafang").Select(x => x.Value).FirstOrDefault(); - bookingStatus.StaTime = dt.OPTime; - bookingStatus.StaCate = "book_sta_cate_billtrace"; - await _repBookingStatus.InsertAsync(bookingStatus); - } - } - if (dt.Status == "装船") - { - if (list.Where(x => x.Code == "sta_zhuangchuan").FirstOrDefault() == null) - { - BookingStatus bookingStatus = new BookingStatus(); - bookingStatus.BookingId = item.BookingId; - bookingStatus.StaCode = "sta_zhuangchuan"; - bookingStatus.StaName = dicdatalist.Where(x => x.Code == "sta_zhuangchuan").Select(x => x.Value).FirstOrDefault(); - bookingStatus.StaTime = dt.OPTime; - bookingStatus.StaCate = "book_sta_cate_billtrace"; - await _repBookingStatus.InsertAsync(bookingStatus); - } - } - if (dt.Status == "ATD") - { - if (list.Where(x => x.Code == "sta_atd").FirstOrDefault() == null) - { - BookingStatus bookingStatus = new BookingStatus(); - bookingStatus.BookingId = item.BookingId; - bookingStatus.StaCode = "sta_atd"; - bookingStatus.StaName = dicdatalist.Where(x => x.Code == "sta_atd").Select(x => x.Value).FirstOrDefault(); - bookingStatus.StaTime = dt.OPTime; - bookingStatus.StaCate = "book_sta_cate_billtrace"; - await _repBookingStatus.InsertAsync(bookingStatus); - } - } - #endregion } }