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/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)
{
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; }
+
}
}