|
|
@ -1,10 +1,12 @@
|
|
|
|
using Furion;
|
|
|
|
using Furion;
|
|
|
|
|
|
|
|
using Furion.FriendlyException;
|
|
|
|
using Furion.Logging;
|
|
|
|
using Furion.Logging;
|
|
|
|
using Furion.RemoteRequest.Extensions;
|
|
|
|
using Furion.RemoteRequest.Extensions;
|
|
|
|
using Myshipping.Application.Entity;
|
|
|
|
using Myshipping.Application.Entity;
|
|
|
|
using Myshipping.Core;
|
|
|
|
using Myshipping.Core;
|
|
|
|
using Myshipping.Core.Entity;
|
|
|
|
using Myshipping.Core.Entity;
|
|
|
|
using Myshipping.Core.Service;
|
|
|
|
using Myshipping.Core.Service;
|
|
|
|
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
using Newtonsoft.Json.Linq;
|
|
|
|
using Newtonsoft.Json.Linq;
|
|
|
|
using System;
|
|
|
|
using System;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Collections.Generic;
|
|
|
@ -47,17 +49,17 @@ namespace Myshipping.Application.EDI
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var sysConfigList = await cache.GetAllSysConfig();
|
|
|
|
var sysConfigList = await cache.GetAllSysConfig();
|
|
|
|
var sCfgSpiderUrl = sysConfigList.FirstOrDefault(x => x.Code == "EMCApiSpiderUrl" && x.GroupCode == "DJY_CONST");
|
|
|
|
var sCfgSpiderUrl = sysConfigList.FirstOrDefault(x => x.Code == "BookingPostApiServerAddr" && x.GroupCode == "DJY_CONST");
|
|
|
|
if (sCfgSpiderUrl == null)
|
|
|
|
if (sCfgSpiderUrl == null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return new KeyValuePair<bool, string>(false, "EMC订舱API的爬虫URL地址未配置,请联系管理员");
|
|
|
|
return new KeyValuePair<bool, string>(false, "订舱API的爬虫URL地址未配置,请联系管理员");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var sCfgUserKey = sysConfigList.FirstOrDefault(x => x.Code == "EMCApiSpiderKey" && x.GroupCode == "DJY_CONST");
|
|
|
|
var sCfgUserKey = sysConfigList.FirstOrDefault(x => x.Code == "BookingPostApiKey" && x.GroupCode == "DJY_CONST");
|
|
|
|
var sCfgUserSecret = sysConfigList.FirstOrDefault(x => x.Code == "EMCApiSpiderSecret" && x.GroupCode == "DJY_CONST");
|
|
|
|
var sCfgUserSecret = sysConfigList.FirstOrDefault(x => x.Code == "BookingPostApiSecret" && x.GroupCode == "DJY_CONST");
|
|
|
|
if (sCfgUserKey == null || sCfgUserSecret == null)
|
|
|
|
if (sCfgUserKey == null || sCfgUserSecret == null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return new KeyValuePair<bool, string>(false, "EMC订舱API的KEY和密钥未配置,请联系管理员");
|
|
|
|
return new KeyValuePair<bool, string>(false, "订舱API的KEY和密钥未配置,请联系管理员");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -65,17 +67,8 @@ namespace Myshipping.Application.EDI
|
|
|
|
DjyCustomerContact custContact = null;
|
|
|
|
DjyCustomerContact custContact = null;
|
|
|
|
var postModel = new EMCSoApiModel();
|
|
|
|
var postModel = new EMCSoApiModel();
|
|
|
|
|
|
|
|
|
|
|
|
JObject extObj = null;
|
|
|
|
postModel.webAccount = custOrder.BookingAccount;
|
|
|
|
if (!string.IsNullOrEmpty(custOrder.ExtendData))
|
|
|
|
postModel.webPassword = custOrder.BookingPassword;
|
|
|
|
{
|
|
|
|
|
|
|
|
extObj = JObject.Parse(custOrder.ExtendData);
|
|
|
|
|
|
|
|
postModel.webAccount = extObj.GetStringValue("Account");
|
|
|
|
|
|
|
|
postModel.webPassword = extObj.GetStringValue("Password");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return new KeyValuePair<bool, string>(false, "未找到订舱账号信息");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//查找模板:
|
|
|
|
//查找模板:
|
|
|
|
//1.根据客户订舱信息中的BookingUserId和BookingTenantId,去客户信息中根据CustSysId查找客户(公司)及联系人(员工)信息
|
|
|
|
//1.根据客户订舱信息中的BookingUserId和BookingTenantId,去客户信息中根据CustSysId查找客户(公司)及联系人(员工)信息
|
|
|
@ -115,18 +108,32 @@ namespace Myshipping.Application.EDI
|
|
|
|
|
|
|
|
|
|
|
|
postModel.uploadType = template.Category; //DRAFT, TEMPLATE, BOOKING分别对应:草稿, 模板, 订舱
|
|
|
|
postModel.uploadType = template.Category; //DRAFT, TEMPLATE, BOOKING分别对应:草稿, 模板, 订舱
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//收货地
|
|
|
|
|
|
|
|
var mapPlaceReceipt = mappingPortLoad.FirstOrDefault(x => x.Module == "DjyCustBooking" && x.CarrierCode == "EMC" && x.Code == custOrder.PLACERECEIPTCODE);
|
|
|
|
|
|
|
|
if (mapPlaceReceipt == null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
throw Oops.Bah($"未找到收货地映射信息:{custOrder.PLACERECEIPTCODE}");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//起运港
|
|
|
|
//起运港
|
|
|
|
var mapPortLoad = mappingPortLoad.FirstOrDefault(x => x.Module == "DjyCustBooking" && x.CarrierCode == "EMC" && x.Code == custOrder.PORTLOADCODE);
|
|
|
|
var mapPortLoad = mappingPortLoad.FirstOrDefault(x => x.Module == "DjyCustBooking" && x.CarrierCode == "EMC" && x.Code == custOrder.PORTLOADCODE);
|
|
|
|
if (mapPortLoad == null)
|
|
|
|
if (mapPortLoad == null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return new KeyValuePair<bool, string>(false, $"未找到起运港映射信息:{custOrder.PORTLOADCODE}");
|
|
|
|
throw Oops.Bah($"未找到起运港映射信息:{custOrder.PORTLOADCODE}");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//卸货港
|
|
|
|
|
|
|
|
var mapPort = mappingPort.FirstOrDefault(x => x.Module == "DjyCustBooking" && x.CarrierCode == "EMC" && x.Code == custOrder.PORTDISCHARGECODE);
|
|
|
|
|
|
|
|
if (mapPort == null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
throw Oops.Bah($"未找到卸货港映射信息:{custOrder.PORTDISCHARGECODE}");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//目的地
|
|
|
|
//目的地
|
|
|
|
var mapPort = mappingPort.FirstOrDefault(x => x.Module == "DjyCustBooking" && x.CarrierCode == "EMC" && x.Code == custOrder.DESTINATIONCODE);
|
|
|
|
var mapDestination = mappingPort.FirstOrDefault(x => x.Module == "DjyCustBooking" && x.CarrierCode == "EMC" && x.Code == custOrder.DESTINATIONCODE);
|
|
|
|
if (mapPort == null)
|
|
|
|
if (mapPort == null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return new KeyValuePair<bool, string>(false, $"未找到目的地映射信息:{custOrder.DESTINATIONCODE}");
|
|
|
|
throw Oops.Bah($"未找到目的地映射信息:{custOrder.DESTINATIONCODE}");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
////运输条款
|
|
|
|
////运输条款
|
|
|
@ -150,12 +157,12 @@ namespace Myshipping.Application.EDI
|
|
|
|
postModel.routes = new EMCSoApiRoute()
|
|
|
|
postModel.routes = new EMCSoApiRoute()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
searchConditionDate = custOrder.ETD.Value.AddDays(startDay).ToString("yyyy-MM-dd"),
|
|
|
|
searchConditionDate = custOrder.ETD.Value.AddDays(startDay).ToString("yyyy-MM-dd"),
|
|
|
|
originName = mapPortLoad.MapCode,
|
|
|
|
originName = mapPlaceReceipt.MapCode,
|
|
|
|
destinationName = mapPort.MapCode,
|
|
|
|
destinationName = mapDestination.MapCode,
|
|
|
|
polPortName = extObj?.GetStringValue("PolPortName"),
|
|
|
|
polPortName = mapPortLoad.MapCode,
|
|
|
|
podPortName = extObj?.GetStringValue("PodPortName"),
|
|
|
|
podPortName = mapPort.MapCode,
|
|
|
|
serviceType = extObj?.GetStringValue("YSFS"),
|
|
|
|
serviceType = custOrder.ServiceType,
|
|
|
|
serviceMode = extObj?.GetStringValue("YSXT"),
|
|
|
|
serviceMode = custOrder.ServiceMode,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
//货物信息(箱信息)
|
|
|
|
//货物信息(箱信息)
|
|
|
@ -189,7 +196,32 @@ namespace Myshipping.Application.EDI
|
|
|
|
postModel.cargoInfos.Add(apiBox);
|
|
|
|
postModel.cargoInfos.Add(apiBox);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//合约信息
|
|
|
|
|
|
|
|
postModel.contractInfo = new EMCSoApiContractInfo()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
bookingOffice = template.BookingAddress,
|
|
|
|
|
|
|
|
issuePlace = custOrder.BillSignLoc,
|
|
|
|
|
|
|
|
billNum = custOrder.BillCount
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//船期数据
|
|
|
|
|
|
|
|
if (string.IsNullOrEmpty(custOrder.ExtendData))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return new KeyValuePair<bool, string>(false, $"船期数据信息不存在");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var extData = JObject.Parse(custOrder.ExtendData);
|
|
|
|
|
|
|
|
postModel.shipInfo = extData.GetJObjectValue("shipInfo");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//订舱公司详情
|
|
|
|
|
|
|
|
postModel.companyInfo = new EMCSoApiCompanyInfo()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
receiveBookingNotice = template.NotifyNext ? "YES" : "NO",
|
|
|
|
|
|
|
|
referenceNO = template.CustomerInnerCode
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#region 收发通及货代
|
|
|
|
#region 收发通及货代
|
|
|
|
|
|
|
|
var companyName = "";
|
|
|
|
var telCountryCode = "";
|
|
|
|
var telCountryCode = "";
|
|
|
|
var telAreaCode = "";
|
|
|
|
var telAreaCode = "";
|
|
|
|
var telNumber = "";
|
|
|
|
var telNumber = "";
|
|
|
@ -197,37 +229,57 @@ namespace Myshipping.Application.EDI
|
|
|
|
//发货人
|
|
|
|
//发货人
|
|
|
|
if (string.IsNullOrEmpty(template.ShipperName))
|
|
|
|
if (string.IsNullOrEmpty(template.ShipperName))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
companyName = custOrder.ShipperName;
|
|
|
|
telCountryCode = custOrder.ShipperPhoneCountryCode;
|
|
|
|
telCountryCode = custOrder.ShipperPhoneCountryCode;
|
|
|
|
telAreaCode = custOrder.ShipperPhoneCode;
|
|
|
|
telAreaCode = custOrder.ShipperPhoneCode;
|
|
|
|
telNumber = custOrder.ShipperPhone;
|
|
|
|
telNumber = custOrder.ShipperPhone;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
companyName = template.ShipperName;
|
|
|
|
telCountryCode = template.ShipperPhoneCountryCode;
|
|
|
|
telCountryCode = template.ShipperPhoneCountryCode;
|
|
|
|
telAreaCode = template.ShipperPhoneCode;
|
|
|
|
telAreaCode = template.ShipperPhoneCode;
|
|
|
|
telNumber = template.ShipperPhone;
|
|
|
|
telNumber = template.ShipperPhone;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var bcMail = "";
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(custOrder.OpMail)) //优先使用东胜上传的邮箱
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
bcMail = custOrder.OpMail;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (!string.IsNullOrEmpty(custContact.Email))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
bcMail = custContact.Email;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
bcMail = template.BcReceiveEmail;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
postModel.shipperInfo = new EMCSoApiSFTInfo()
|
|
|
|
postModel.shipperInfo = new EMCSoApiSFTInfo()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
companyName = "",
|
|
|
|
companyName = companyName,
|
|
|
|
contactTitle = "",
|
|
|
|
contactTitle = template.ShipperSex,
|
|
|
|
contactLName = string.IsNullOrEmpty(template.ShipperName) ? custOrder.ShipperFirstName : template.ShipperFirstName,
|
|
|
|
contactLName = string.IsNullOrEmpty(template.ShipperFirstName) ? custOrder.ShipperFirstName : template.ShipperFirstName,
|
|
|
|
contactFName = string.IsNullOrEmpty(template.ShipperLastName) ? custOrder.ShipperLastName : template.ShipperLastName,
|
|
|
|
contactFName = string.IsNullOrEmpty(template.ShipperLastName) ? custOrder.ShipperLastName : template.ShipperLastName,
|
|
|
|
tel1 = telCountryCode,
|
|
|
|
tel1 = telCountryCode,
|
|
|
|
tel2 = telAreaCode,
|
|
|
|
tel2 = telAreaCode,
|
|
|
|
tel3 = telNumber,
|
|
|
|
tel3 = telNumber,
|
|
|
|
|
|
|
|
referenceNO = template.ShipperInnerCode,
|
|
|
|
|
|
|
|
email = bcMail
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
//收货人
|
|
|
|
//收货人
|
|
|
|
if (string.IsNullOrEmpty(template.ConsigneeName))
|
|
|
|
if (string.IsNullOrEmpty(template.ConsigneeName))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
companyName = custOrder.ConsigneeName;
|
|
|
|
telCountryCode = custOrder.ConsigneePhoneCountryCode;
|
|
|
|
telCountryCode = custOrder.ConsigneePhoneCountryCode;
|
|
|
|
telAreaCode = custOrder.ConsigneePhoneCode;
|
|
|
|
telAreaCode = custOrder.ConsigneePhoneCode;
|
|
|
|
telNumber = custOrder.ConsigneePhone;
|
|
|
|
telNumber = custOrder.ConsigneePhone;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
companyName = template.ConsigneeName;
|
|
|
|
telCountryCode = template.ConsigneePhoneCountryCode;
|
|
|
|
telCountryCode = template.ConsigneePhoneCountryCode;
|
|
|
|
telAreaCode = template.ConsigneePhoneCode;
|
|
|
|
telAreaCode = template.ConsigneePhoneCode;
|
|
|
|
telNumber = template.ConsigneePhone;
|
|
|
|
telNumber = template.ConsigneePhone;
|
|
|
@ -235,24 +287,27 @@ namespace Myshipping.Application.EDI
|
|
|
|
|
|
|
|
|
|
|
|
postModel.consigneeInfo = new EMCSoApiSFTInfo()
|
|
|
|
postModel.consigneeInfo = new EMCSoApiSFTInfo()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
companyName = "",
|
|
|
|
companyName = companyName,
|
|
|
|
contactTitle = "",
|
|
|
|
contactTitle = template.ConsigneeSex,
|
|
|
|
contactLName = string.IsNullOrEmpty(template.ConsigneeFirstName) ? custOrder.ConsigneeFirstName : template.ConsigneeFirstName,
|
|
|
|
contactLName = string.IsNullOrEmpty(template.ConsigneeFirstName) ? custOrder.ConsigneeFirstName : template.ConsigneeFirstName,
|
|
|
|
contactFName = string.IsNullOrEmpty(template.ConsigneeLastName) ? custOrder.ConsigneeLastName : template.ConsigneeLastName,
|
|
|
|
contactFName = string.IsNullOrEmpty(template.ConsigneeLastName) ? custOrder.ConsigneeLastName : template.ConsigneeLastName,
|
|
|
|
tel1 = telCountryCode,
|
|
|
|
tel1 = telCountryCode,
|
|
|
|
tel2 = telAreaCode,
|
|
|
|
tel2 = telAreaCode,
|
|
|
|
tel3 = telNumber,
|
|
|
|
tel3 = telNumber,
|
|
|
|
|
|
|
|
referenceNO = template.ConsigneeInnerCode
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
//通知人
|
|
|
|
//通知人
|
|
|
|
if (string.IsNullOrEmpty(template.NotifypartName))
|
|
|
|
if (string.IsNullOrEmpty(template.NotifypartName))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
companyName = custOrder.NotifypartName;
|
|
|
|
telCountryCode = custOrder.NotifypartPhoneCountryCode;
|
|
|
|
telCountryCode = custOrder.NotifypartPhoneCountryCode;
|
|
|
|
telAreaCode = custOrder.NotifypartPhoneCode;
|
|
|
|
telAreaCode = custOrder.NotifypartPhoneCode;
|
|
|
|
telNumber = custOrder.NotifypartPhone;
|
|
|
|
telNumber = custOrder.NotifypartPhone;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
companyName = template.NotifypartName;
|
|
|
|
telCountryCode = template.NotifypartPhoneCountryCode;
|
|
|
|
telCountryCode = template.NotifypartPhoneCountryCode;
|
|
|
|
telAreaCode = template.NotifypartPhoneCode;
|
|
|
|
telAreaCode = template.NotifypartPhoneCode;
|
|
|
|
telNumber = template.NotifypartPhone;
|
|
|
|
telNumber = template.NotifypartPhone;
|
|
|
@ -260,68 +315,56 @@ namespace Myshipping.Application.EDI
|
|
|
|
|
|
|
|
|
|
|
|
postModel.notifyInfo = new EMCSoApiSFTInfo()
|
|
|
|
postModel.notifyInfo = new EMCSoApiSFTInfo()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
companyName = "",
|
|
|
|
companyName = companyName,
|
|
|
|
contactTitle = "",
|
|
|
|
contactTitle = template.NotifypartSex,
|
|
|
|
contactLName = string.IsNullOrEmpty(template.NotifypartFirstName) ? custOrder.NotifypartFirstName : template.NotifypartFirstName,
|
|
|
|
contactLName = string.IsNullOrEmpty(template.NotifypartFirstName) ? custOrder.NotifypartFirstName : template.NotifypartFirstName,
|
|
|
|
contactFName = string.IsNullOrEmpty(template.NotifypartLastName) ? custOrder.NotifypartLastName : template.NotifypartLastName,
|
|
|
|
contactFName = string.IsNullOrEmpty(template.NotifypartLastName) ? custOrder.NotifypartLastName : template.NotifypartLastName,
|
|
|
|
tel1 = telCountryCode,
|
|
|
|
tel1 = telCountryCode,
|
|
|
|
tel2 = telAreaCode,
|
|
|
|
tel2 = telAreaCode,
|
|
|
|
tel3 = telNumber,
|
|
|
|
tel3 = telNumber,
|
|
|
|
|
|
|
|
referenceNO = template.NotifypartInnerCode
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
//货代
|
|
|
|
//货代
|
|
|
|
if (string.IsNullOrEmpty(template.BookingName))
|
|
|
|
if (string.IsNullOrEmpty(template.BookingName))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
companyName = custOrder.BookingName;
|
|
|
|
telCountryCode = custOrder.BookingPhoneCountryCode;
|
|
|
|
telCountryCode = custOrder.BookingPhoneCountryCode;
|
|
|
|
telAreaCode = custOrder.BookingPhoneCode;
|
|
|
|
telAreaCode = custOrder.BookingPhoneCode;
|
|
|
|
telNumber = custOrder.BookingPhone;
|
|
|
|
telNumber = custOrder.BookingPhone;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
companyName = template.BookingName;
|
|
|
|
telCountryCode = template.BookingPhoneCountryCode;
|
|
|
|
telCountryCode = template.BookingPhoneCountryCode;
|
|
|
|
telAreaCode = template.BookingPhoneCode;
|
|
|
|
telAreaCode = template.BookingPhoneCode;
|
|
|
|
telNumber = template.BookingPhone;
|
|
|
|
telNumber = template.BookingPhone;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var djyBookMail = sysConfigList.FirstOrDefault(x => x.Code == "DjyCustomerBookReceiveBcMail");
|
|
|
|
postModel.forwarderInfo = new EMCSoApiSFTInfo()
|
|
|
|
postModel.forwarderInfo = new EMCSoApiSFTInfo()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
companyName = "",
|
|
|
|
companyName = companyName,
|
|
|
|
contactTitle = "",
|
|
|
|
contactTitle = template.BookingSex,
|
|
|
|
contactLName = string.IsNullOrEmpty(template.BookingFirstName) ? custOrder.BookingFirstName : template.BookingFirstName,
|
|
|
|
contactLName = string.IsNullOrEmpty(template.BookingFirstName) ? custOrder.BookingFirstName : template.BookingFirstName,
|
|
|
|
contactFName = string.IsNullOrEmpty(template.BookingLastName) ? custOrder.BookingLastName : template.BookingLastName,
|
|
|
|
contactFName = string.IsNullOrEmpty(template.BookingLastName) ? custOrder.BookingLastName : template.BookingLastName,
|
|
|
|
tel1 = telCountryCode,
|
|
|
|
tel1 = telCountryCode,
|
|
|
|
tel2 = telAreaCode,
|
|
|
|
tel2 = telAreaCode,
|
|
|
|
tel3 = telNumber,
|
|
|
|
tel3 = telNumber,
|
|
|
|
|
|
|
|
referenceNO = template.BookingInnerCode,
|
|
|
|
|
|
|
|
email = djyBookMail.Value
|
|
|
|
};
|
|
|
|
};
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var apiUrl = sCfgSpiderUrl.Value;
|
|
|
|
|
|
|
|
if (!apiUrl.EndsWith("/"))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
apiUrl += "/";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
apiUrl += "v1/emc/booking/auto";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Log.Information($"发送API数据给爬虫({apiUrl}):{postModel.ToJsonString()}");
|
|
|
|
////大简云客户订舱接收BC邮箱
|
|
|
|
var rtn = await apiUrl.SetBody(postModel)
|
|
|
|
//var djyBookMail = sysConfigList.FirstOrDefault(x => x.Code == "DjyCustomerBookReceiveBcMail");
|
|
|
|
|
|
|
|
//var bcMail = custContact.Email;
|
|
|
|
|
|
|
|
//if (extObj != null) //优先使用东胜上传的邮箱
|
|
|
|
|
|
|
|
//{
|
|
|
|
|
|
|
|
// var opMail = extObj.GetStringValue("OpMail");
|
|
|
|
|
|
|
|
// if (!string.IsNullOrEmpty(opMail))
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// bcMail = opMail;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//if (djyBookMail != null)
|
|
|
|
|
|
|
|
//{
|
|
|
|
|
|
|
|
// bcMail += ";" + djyBookMail.Value;
|
|
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//postModel.special = new EMCSoApiSpecial()
|
|
|
|
|
|
|
|
//{
|
|
|
|
|
|
|
|
// emailAddresses = bcMail,
|
|
|
|
|
|
|
|
// remarksForEntireBooking = custOrder.SOREMARK
|
|
|
|
|
|
|
|
//};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Log.Information($"发送API数据给爬虫({sCfgSpiderUrl.Value}):{postModel.ToJsonString()}");
|
|
|
|
|
|
|
|
var rtn = await sCfgSpiderUrl.Value.SetBody(postModel)
|
|
|
|
|
|
|
|
.PostAsStringAsync();
|
|
|
|
.PostAsStringAsync();
|
|
|
|
|
|
|
|
|
|
|
|
Log.Information($"爬虫返回:{rtn}");
|
|
|
|
Log.Information($"爬虫返回:{rtn}");
|
|
|
@ -335,8 +378,6 @@ namespace Myshipping.Application.EDI
|
|
|
|
return new KeyValuePair<bool, string>(false, jobjRtn.GetStringValue("msg"));
|
|
|
|
return new KeyValuePair<bool, string>(false, jobjRtn.GetStringValue("msg"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -390,7 +431,7 @@ namespace Myshipping.Application.EDI
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// 船期数据
|
|
|
|
/// 船期数据
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
public EMCSoApiShipInfo shipInfo { get; set; }
|
|
|
|
public dynamic shipInfo { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// 订舱公司详情
|
|
|
|
/// 订舱公司详情
|
|
|
@ -601,113 +642,113 @@ namespace Myshipping.Application.EDI
|
|
|
|
public int? billNum { get; set; } = 1;
|
|
|
|
public int? billNum { get; set; } = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
///// <summary>
|
|
|
|
/// 船期数据
|
|
|
|
///// 船期数据
|
|
|
|
/// 船期查询的结果总选择的数据集, 原样上传
|
|
|
|
///// 船期查询的结果总选择的数据集, 原样上传
|
|
|
|
/// </summary>
|
|
|
|
///// </summary>
|
|
|
|
public class EMCSoApiShipInfo
|
|
|
|
//public class EMCSoApiShipInfo
|
|
|
|
{
|
|
|
|
//{
|
|
|
|
/// <summary>
|
|
|
|
// /// <summary>
|
|
|
|
/// 收货地
|
|
|
|
// /// 收货地
|
|
|
|
/// </summary>
|
|
|
|
// /// </summary>
|
|
|
|
public string originName { get; set; }
|
|
|
|
// public string originName { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
// /// <summary>
|
|
|
|
/// 交货地
|
|
|
|
// /// 交货地
|
|
|
|
/// </summary>
|
|
|
|
// /// </summary>
|
|
|
|
public string destinationName { get; set; }
|
|
|
|
// public string destinationName { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
// /// <summary>
|
|
|
|
/// 本地截止时间
|
|
|
|
// /// 本地截止时间
|
|
|
|
/// </summary>
|
|
|
|
// /// </summary>
|
|
|
|
public string cutOffLocalDate { get; set; }
|
|
|
|
// public string cutOffLocalDate { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
// /// <summary>
|
|
|
|
/// 开航时间
|
|
|
|
// /// 开航时间
|
|
|
|
/// </summary>
|
|
|
|
// /// </summary>
|
|
|
|
public string departureDate { get; set; }
|
|
|
|
// public string departureDate { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
// /// <summary>
|
|
|
|
/// 航线代码
|
|
|
|
// /// 航线代码
|
|
|
|
/// </summary>
|
|
|
|
// /// </summary>
|
|
|
|
public string serviceCode { get; set; }
|
|
|
|
// public string serviceCode { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
// /// <summary>
|
|
|
|
/// 船名
|
|
|
|
// /// 船名
|
|
|
|
/// </summary>
|
|
|
|
// /// </summary>
|
|
|
|
public string vesselName { get; set; }
|
|
|
|
// public string vesselName { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
// /// <summary>
|
|
|
|
/// 航次
|
|
|
|
// /// 航次
|
|
|
|
/// </summary>
|
|
|
|
// /// </summary>
|
|
|
|
public string voyageNumber { get; set; }
|
|
|
|
// public string voyageNumber { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
// /// <summary>
|
|
|
|
/// 下一段航线代码
|
|
|
|
// /// 下一段航线代码
|
|
|
|
/// </summary>
|
|
|
|
// /// </summary>
|
|
|
|
public string nextServiceCode { get; set; }
|
|
|
|
// public string nextServiceCode { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
// /// <summary>
|
|
|
|
/// 总航程
|
|
|
|
// /// 总航程
|
|
|
|
/// </summary>
|
|
|
|
// /// </summary>
|
|
|
|
public string estimatedTransitTimeInDays { get; set; }
|
|
|
|
// public string estimatedTransitTimeInDays { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
// /// <summary>
|
|
|
|
/// 详情参数, 订舱时需要原样上传
|
|
|
|
// /// 详情参数, 订舱时需要原样上传
|
|
|
|
/// </summary>
|
|
|
|
// /// </summary>
|
|
|
|
public string paramsText { get; set; }
|
|
|
|
// public string paramsText { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
// /// <summary>
|
|
|
|
/// 后续请求需要使用, 原样上传即可
|
|
|
|
// /// 后续请求需要使用, 原样上传即可
|
|
|
|
/// </summary>
|
|
|
|
// /// </summary>
|
|
|
|
public string buttonText { get; set; }
|
|
|
|
// public string buttonText { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
// /// <summary>
|
|
|
|
/// 航线详情
|
|
|
|
// /// 航线详情
|
|
|
|
/// </summary>
|
|
|
|
// /// </summary>
|
|
|
|
public EMCSoApiShipInfoOceanLegs oceanLegs { get; set; }
|
|
|
|
// public List<EMCSoApiShipInfoOceanLegs> oceanLegs { get; set; }
|
|
|
|
}
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
///// <summary>
|
|
|
|
/// 航线详情
|
|
|
|
///// 航线详情
|
|
|
|
/// </summary>
|
|
|
|
///// </summary>
|
|
|
|
public class EMCSoApiShipInfoOceanLegs
|
|
|
|
//public class EMCSoApiShipInfoOceanLegs
|
|
|
|
{
|
|
|
|
//{
|
|
|
|
/// <summary>
|
|
|
|
// /// <summary>
|
|
|
|
/// 起运港
|
|
|
|
// /// 起运港
|
|
|
|
/// </summary>
|
|
|
|
// /// </summary>
|
|
|
|
public string polPortName { get; set; }
|
|
|
|
// public string polPortName { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
// /// <summary>
|
|
|
|
/// 目的港
|
|
|
|
// /// 目的港
|
|
|
|
/// </summary>
|
|
|
|
// /// </summary>
|
|
|
|
public string podPortName { get; set; }
|
|
|
|
// public string podPortName { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
// /// <summary>
|
|
|
|
/// ETD
|
|
|
|
// /// ETD
|
|
|
|
/// </summary>
|
|
|
|
// /// </summary>
|
|
|
|
public string polETD { get; set; }
|
|
|
|
// public string polETD { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
// /// <summary>
|
|
|
|
/// ETA
|
|
|
|
// /// ETA
|
|
|
|
/// </summary>
|
|
|
|
// /// </summary>
|
|
|
|
public string podETA { get; set; }
|
|
|
|
// public string podETA { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
// /// <summary>
|
|
|
|
/// 航线代码
|
|
|
|
// /// 航线代码
|
|
|
|
/// </summary>
|
|
|
|
// /// </summary>
|
|
|
|
public string serviceCode { get; set; }
|
|
|
|
// public string serviceCode { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
// /// <summary>
|
|
|
|
/// 船名航线字符
|
|
|
|
// /// 船名航线字符
|
|
|
|
/// </summary>
|
|
|
|
// /// </summary>
|
|
|
|
public string vesselAndVoyage { get; set; }
|
|
|
|
// public string vesselAndVoyage { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
// /// <summary>
|
|
|
|
/// 航程
|
|
|
|
// /// 航程
|
|
|
|
/// </summary>
|
|
|
|
// /// </summary>
|
|
|
|
public string days { get; set; }
|
|
|
|
// public string days { get; set; }
|
|
|
|
}
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// 订舱公司详情
|
|
|
|
/// 订舱公司详情
|
|
|
@ -782,4 +823,5 @@ namespace Myshipping.Application.EDI
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
public string email { get; set; }
|
|
|
|
public string email { get; set; }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|