From b8f63236cc261fea713dfbccbf34ec969a4f995d Mon Sep 17 00:00:00 2001 From: zhangxiaofeng <1939543722@qq.com> Date: Tue, 9 Apr 2024 14:38:10 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=AE=A2=E6=88=B7=E8=AE=A2=E8=88=B1?= =?UTF-8?q?=E4=B8=8B=E5=8D=95=E6=8E=A5=E5=8F=A3=EF=BC=9A=E4=B8=AD=E8=BF=9C?= =?UTF-8?q?=E7=BA=A6=E5=8F=B7=E6=9C=80=E9=95=BF8=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BookingCustomerOrder/BookingCustomerOrderService.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Myshipping.Application/Service/BookingCustomerOrder/BookingCustomerOrderService.cs b/Myshipping.Application/Service/BookingCustomerOrder/BookingCustomerOrderService.cs index 3b13c688..60e238eb 100644 --- a/Myshipping.Application/Service/BookingCustomerOrder/BookingCustomerOrderService.cs +++ b/Myshipping.Application/Service/BookingCustomerOrder/BookingCustomerOrderService.cs @@ -1809,6 +1809,11 @@ namespace Myshipping.Application throw Oops.Bah($"未找到匹配的船司代码:{input.CARRIERID}"); } + // 2024-4-9:中远约号最长8位 + if (input.CARRIERID == "COSCO" && input.CONTRACTNO.Length > 8) + { + throw Oops.Bah($"约号超长,【中远】约号最长8位,请检查"); + } if (!input.ETD.HasValue) { From 756b8c8b0b0bc362c2faffff988c41ab6466d9de Mon Sep 17 00:00:00 2001 From: zhangxiaofeng <1939543722@qq.com> Date: Tue, 9 Apr 2024 16:28:02 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=BC=95=E5=85=A5=E5=9C=BA=E7=AB=99?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E6=8E=A5=E5=8F=A3=E8=BF=94=E5=9B=9E=E8=81=94?= =?UTF-8?q?=E7=B3=BB=E4=BA=BA=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Helper/YardDataHelper.cs | 26 +++++++------- .../BookingOrder/BookingOrderService.cs | 17 ++++++---- .../BookingOrder/BookingValueAddedService.cs | 2 +- .../BookingOrder/Dto/BookingYardData.cs | 34 ++++++++++++++++++- 4 files changed, 58 insertions(+), 21 deletions(-) diff --git a/Myshipping.Application/Helper/YardDataHelper.cs b/Myshipping.Application/Helper/YardDataHelper.cs index d82567cd..ad355347 100644 --- a/Myshipping.Application/Helper/YardDataHelper.cs +++ b/Myshipping.Application/Helper/YardDataHelper.cs @@ -29,7 +29,7 @@ namespace Myshipping.Application.Helper /// 场站ID /// 是否网站 /// 返回场站详情(按箱明细显示) - public static async Task> GetYardData(long userId, long tenantId, string tenantName, string mblno, string yardid, bool isWeb = true) + public static async Task<(bool isSuccess, string data, string contact)> GetYardData(long userId, long tenantId, string tenantName, string mblno, string yardid, bool isWeb = true) { var cacheService = App.GetService(); var webAccService = App.GetService(); @@ -53,7 +53,7 @@ namespace Myshipping.Application.Helper if (ygtAcc == null || string.IsNullOrEmpty(ygtAcc.Account) || string.IsNullOrEmpty(ygtAcc.Password)) { - return new KeyValuePair(false, "未找到云港通账号、密码配置,请到账号维护模块中添加"); + return (false, "未找到云港通账号、密码配置,请到账号维护模块中添加", ""); } webAcc = ygtAcc.Account; @@ -68,7 +68,7 @@ namespace Myshipping.Application.Helper if (ygtAcc == null || string.IsNullOrEmpty(ygtAcc.Account) || string.IsNullOrEmpty(ygtAcc.Password)) { - return new KeyValuePair(false, "未找到陆海通账号、密码配置,请到账号维护模块中添加"); + return (false, "未找到陆海通账号、密码配置,请到账号维护模块中添加", ""); } webAcc = ygtAcc.Account; @@ -79,7 +79,7 @@ namespace Myshipping.Application.Helper var ym = yardMappings.FirstOrDefault(x => x.Code.ToLower() == yardid.ToLower() && x.Module == "BillTrace"); if (ym == null) { - return new KeyValuePair(false, $"场站代号配置未找到:{yardid}"); + return (false, $"场站代号配置未找到:{yardid}", ""); } var objSend = new @@ -110,7 +110,7 @@ namespace Myshipping.Application.Helper var rtnObj = JObject.Parse(rtn); if (rtnObj.GetIntValue("code") != 200) { - return new KeyValuePair(false, $"获取场站数失败:{rtnObj.GetStringValue("msg")}"); + return (false, $"获取场站数失败:{rtnObj.GetStringValue("msg")}", ""); } else { @@ -123,8 +123,8 @@ namespace Myshipping.Application.Helper rtnData = rtnData.Replace(viewstatehtml, ""); } } - - return new KeyValuePair(true, rtnData); + var rtnContact = rtnObj.GetJArrayValue("contact_list")?.ToJsonString() ?? ""; + return (true, rtnData, rtnContact); } } @@ -139,15 +139,15 @@ namespace Myshipping.Application.Helper /// 场站ID /// 是否网站 /// 返回场站详情(按箱明细显示,并对箱型做了本地转换) - public static async Task GetYardDataWithTranslateAsync(long userId, long tenantId, string tenantName, string mblno, + public static async Task GetYardDataWithTranslateAsync(long userId, long tenantId, string tenantName, string mblno, string yardid, bool isWeb = true) { - var rtn = await GetYardData(userId, tenantId, tenantName, mblno, yardid, isWeb); + (bool isSuccess, string data, string contact) rtn = await GetYardData(userId, tenantId, tenantName, mblno, yardid, isWeb); - if (!rtn.Key) + if (!rtn.isSuccess) { - throw Oops.Bah(rtn.Value); - } + throw Oops.Bah(rtn.data); + } var _cache = App.GetService(); @@ -155,7 +155,7 @@ namespace Myshipping.Application.Helper var ctnList = await _cache.GetAllCodeCtn(); var mapCtn = await _cache.GetAllMappingCtn(); - var jData = JArray.Parse(rtn.Value); + var jData = JArray.Parse(rtn.data); foreach (JObject item in jData) { var ctnall = item.GetStringValue("CTNALL"); diff --git a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs index c982ae52..7620846e 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs @@ -9216,17 +9216,17 @@ namespace Myshipping.Application /// private async Task> GetYardDataAndMappingSystem(BookingOrder order, bool isWeb = false) { - - var rtn = await YardDataHelper.GetYardData(App.User.FindFirst(ClaimConst.CLAINM_USERID) == null ? order.CreatedUserId.Value : UserManager.UserId, order.TenantId.Value, order.TenantName, order.MBLNO, order.YARDID, isWeb); - if (!rtn.Key) + (bool isSuccess, string data, string contact) rtn = await YardDataHelper.GetYardData(App.User.FindFirst(ClaimConst.CLAINM_USERID) == null ? order.CreatedUserId.Value : UserManager.UserId, order.TenantId.Value, order.TenantName, order.MBLNO, order.YARDID, isWeb); + if (!rtn.isSuccess) { - throw Oops.Bah(rtn.Value); + throw Oops.Bah(rtn.data); } //场站引入的数据,转换为订舱箱型,且带上箱型代码 var ctnList = await _cache.GetAllCodeCtn(); var mapCtn = await _cache.GetAllMappingCtn(); - var listRtn = JsonConvert.DeserializeObject>(rtn.Value); + var listRtn = JsonConvert.DeserializeObject>(rtn.data); + var contact = JsonConvert.DeserializeObject>(rtn.contact)?.FirstOrDefault(); foreach (var item in listRtn) { @@ -9249,9 +9249,14 @@ namespace Myshipping.Application { throw Oops.Bah($"未找到箱型{ctnall}的场站引入配置"); } - } + // 赋值联系人信息 + item.contact_tel = !string.IsNullOrEmpty(contact?.contact_tel1) ? contact?.contact_tel1 : contact?.contact_tel2; + item.contact_name = contact?.contact_name; + item.contact_email = contact?.contact_email; + } return listRtn; + } /// diff --git a/Myshipping.Application/Service/BookingOrder/BookingValueAddedService.cs b/Myshipping.Application/Service/BookingOrder/BookingValueAddedService.cs index 9c2cd24a..8311b254 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingValueAddedService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingValueAddedService.cs @@ -2633,7 +2633,7 @@ namespace Myshipping.Application try { - if (id < 0) + if (id <= 0) throw Oops.Oh($"订舱ID为空"); var order = await _bookingOrderRepository.AsQueryable().FirstAsync(a => a.Id == id); diff --git a/Myshipping.Application/Service/BookingOrder/Dto/BookingYardData.cs b/Myshipping.Application/Service/BookingOrder/Dto/BookingYardData.cs index 6b82920d..018ee44f 100644 --- a/Myshipping.Application/Service/BookingOrder/Dto/BookingYardData.cs +++ b/Myshipping.Application/Service/BookingOrder/Dto/BookingYardData.cs @@ -127,11 +127,43 @@ namespace Myshipping.Application.Service.BookingOrder.Dto } - public class BookingGetYardDataDto: BookingYardDataRtn + public class BookingGetYardDataDto : BookingYardDataRtn { /// /// 箱型代码 /// public string CtnCode { get; set; } + /// + /// 联系人姓名 + /// + public string contact_name { get; set; } + /// + /// 联系方式 + /// + public string contact_tel { get; set; } + /// + /// 联系邮箱 + /// + public string contact_email { get; set; } + } + public class YardContactDto + { + /// + /// 联系人姓名 + /// + public string contact_name { get; set; } + /// + /// 联系方式1 + /// + public string contact_tel1 { get; set; } + /// + /// 联系方式2 + /// + public string contact_tel2 { get; set; } + /// + /// 联系邮箱 + /// + public string contact_email { get; set; } + } }