修改CMA BC舱位增加字段

master
jianghaiqing 5 months ago
parent efa1a0a1ae
commit edc8f428a8

@ -391,5 +391,24 @@ namespace Myshipping.Application
/// </summary> /// </summary>
[Description("计费日期")] [Description("计费日期")]
public DateTime? PRICE_CALCULATION_DATE { get; set; } public DateTime? PRICE_CALCULATION_DATE { get; set; }
/// <summary>
/// 系统平台代码
/// </summary>
[Description("系统平台代码")]
public string SYSTEM_CODE { get; set; }
/// <summary>
/// 系统平台名称
/// </summary>
[Description("系统平台名称")]
public string SYSTEM_NAME { get; set; }
/// <summary>
/// 船公司航次
/// </summary>
[Description("船公司航次")]
public string CARRIER_VOYNO { get; set; }
} }
} }

@ -18,6 +18,7 @@ using Furion.DynamicApiController;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using Myshipping.Application.Helper; using Myshipping.Application.Helper;
using Myshipping.Core.Const; using Myshipping.Core.Const;
using Yitter.IdGenerator;
namespace Myshipping.Application.Service.BookingOrder namespace Myshipping.Application.Service.BookingOrder
{ {
@ -107,7 +108,7 @@ namespace Myshipping.Application.Service.BookingOrder
{ {
userKey = App.Configuration["MSKAPIDjyUserKey"], userKey = App.Configuration["MSKAPIDjyUserKey"],
userSecret = App.Configuration["MSKAPIDjyUserSecret"], userSecret = App.Configuration["MSKAPIDjyUserSecret"],
operatingEnvironment = App.Configuration["MSKAPIOPEnvironment"], operatingEnvironment = "PRODUCTION",//App.Configuration["MSKAPIOPEnvironment"],
spot_api_key = webAccountConfig.Account, spot_api_key = webAccountConfig.Account,
brandScac = model.carrierCode, brandScac = model.carrierCode,
originPrefix = model.cityName originPrefix = model.cityName
@ -285,6 +286,11 @@ namespace Myshipping.Application.Service.BookingOrder
&& resultInfo.data != null && resultInfo.data.Count > 0) && resultInfo.data != null && resultInfo.data.Count > 0)
{ {
list = resultInfo.data; list = resultInfo.data;
foreach (var scheduleModel in list)
{
await CacheShipSailingSchedule(scheduleModel);
}
} }
else else
{ {
@ -302,6 +308,47 @@ namespace Myshipping.Application.Service.BookingOrder
} }
#endregion #endregion
#region 缓存船期数据
/// <summary>
/// 缓存船期数据
/// </summary>
/// <param name="model">船期查询结果明细</param>
/// <param name="busiType">船期类型 MSKSPOT-马士基即期</param>
/// <returns>返回主键ID</returns>
private async Task<long> CacheShipSailingSchedule(MSKAPISPOTSearchScheduleRateResultDataDto model,string busiType = "MSKSPOT")
{
/*
1IDKEY
2JSONMD5
3ID
*/
var newModel = model.Adapt<MSKAPISPOTSearchScheduleRateResultDataDto>();
newModel.priceID = null;
var json = Newtonsoft.Json.JsonConvert.SerializeObject(newModel);
model.PId = YitIdHelper.NextId();
string md5 = json.ToMd5();
model.MD5 = md5;
var shareKey = model.PId.ToString();
DateTime nowDate = DateTime.Now;
DateTime expireDateTime = DateTime.Now.AddHours(1);
var expireTimeSpan = expireDateTime.Subtract(nowDate).Duration();
if (!_cache.Exists(shareKey))
{
await _cache.SetTimeoutAsync(shareKey, Newtonsoft.Json.JsonConvert.SerializeObject(model), expireTimeSpan);
}
return model.PId;
}
#endregion
#region 发送马士基订舱请求 #region 发送马士基订舱请求
/// <summary> /// <summary>
/// 发送马士基订舱请求 /// 发送马士基订舱请求

@ -27,7 +27,23 @@ namespace Myshipping.Application
/// <summary> /// <summary>
/// 马士基即期船期查询结果 /// 马士基即期船期查询结果
/// </summary> /// </summary>
public class MSKAPISPOTSearchScheduleRateResultDataDto public class MSKAPISPOTSearchScheduleRateResultDataDto: MSKAPISPOTSearchScheduleRateResultDataBaseDto
{
/// <summary>
/// 船期MD5
/// </summary>
public string MD5 { get; set; }
/// <summary>
/// 主键ID
/// </summary>
public long PId { get; set; }
}
/// <summary>
/// 马士基即期船期查询结果
/// </summary>
public class MSKAPISPOTSearchScheduleRateResultDataBaseDto
{ {
/// <summary> /// <summary>
/// 价格id, 可进一步通过API进行其他操作 /// 价格id, 可进一步通过API进行其他操作
@ -148,6 +164,11 @@ namespace Myshipping.Application
/// 总费用币种 /// 总费用币种
/// </summary> /// </summary>
public string totalCurrency { get; set; } public string totalCurrency { get; set; }
/// <summary>
/// 航程明细
/// </summary>
public List<MSKAPISPOTSearchScheduleRateResultDetailDto> scheduleDetails { get; set; }
} }
/// <summary> /// <summary>
@ -312,11 +333,6 @@ namespace Myshipping.Application
/// 航次号 /// 航次号
/// </summary> /// </summary>
public string voyageNumber { get; set; } public string voyageNumber { get; set; }
/// <summary>
/// 五子码
/// </summary>
public string unLocCode { get; set; }
} }

@ -0,0 +1,361 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Application
{
public class MSKSPOTBookingDto
{
/// <summary>
/// 记录ID
/// </summary>
public Nullable<long> id { get; set; }
/// <summary>
/// 船公司代码
/// </summary>
public string carrierId { get; set; }
/// <summary>
/// 订舱ID
/// </summary>
public long bookingId { get; set; }
/// <summary>
/// 合同唯一id
/// </summary>
[RegularExpression("[a-zA-Z0-9_/,-]{1,50}", ErrorMessage = " [a-zA-Z0-9_/,-]{1,50}")]
public string priceReference { get; set; }
/// <summary>
/// 产品类型(MaerskSpot, SealandSpot, MaerskContract)
/// </summary>
public string productCode { get; set; }
/// <summary>
/// 请求类别, 目前只能传 BOOKAPI
/// </summary>
public string sender { get; set; }
/// <summary>
/// 订舱公司名称
/// </summary>
public string bookedByCompanyName { get; set; }
/// <summary>
/// 承运人id,用于识别预定方
/// </summary>
public string bookedByMaerskPartyCode { get; set; }
/// <summary>
/// 订舱公司名称联系人姓名
/// </summary>
public string bookedByCompanyContactName { get; set; }
/// <summary>
/// 订舱公司名称联系人邮箱
/// </summary>
public string bookedByCompanyContactEmail { get; set; }
/// <summary>
/// 订舱公司名称联系人电话号码
/// </summary>
public string bookedByCompanyContactPhone { get; set; }
/// <summary>
/// 当前订舱公司是否也是合约方 true-标识合约信息跟订舱公司一致false-标识有单独的合约方
/// </summary>
public bool isBookingPartOwnPrice { get; set; }
/// <summary>
/// 价格所有者公司名称
/// </summary>
public string priceOwnerCompanyName { get; set; }
/// <summary>
/// 价格所有者id
/// </summary>
public string priceOwnerMaerskPartyCode { get; set; }
/// <summary>
/// 价格所有者联系人姓名
/// </summary>
public string priceOwnerContactName { get; set; }
/// <summary>
/// 价格所有者联系人邮箱
/// </summary>
public string priceOwnerContactEmail { get; set; }
/// <summary>
/// 价格所有者联系人电话号码
/// </summary>
public string priceOwnerContactPhone { get; set; }
/// <summary>
/// 价格所有者合约号
/// </summary>
public string priceOwnerReference { get; set; }
/// <summary>
/// 价格所有者合约号主键
/// </summary>
public string priceOwnerReferenceId { get; set; }
/// <summary>
/// 价格所有者合约号名称
/// </summary>
public string priceOwnerReferenceName { get; set; }
/// <summary>
/// 承运人代码MAEU, SEAU, SEJJ, MCPU, MAEI
/// </summary>
public string carrierCode { get; set; }
/// <summary>
/// 最早起运日期, 不可小于当前日期
/// </summary>
public Nullable<DateTime> earliestDepartureDate { get; set; }
/// <summary>
/// 出口服务类型(CY, SD, CFS)
/// </summary>
public string exportServiceMode { get; set; }
/// <summary>
/// 进口服务类型
/// </summary>
public string importServiceMode { get; set; }
/// <summary>
/// 收货地UN地点代码
/// </summary>
public string placeOfReceiptUnLocCode { get; set; }
/// <summary>
/// 收货地城市英文名称
/// </summary>
public string placeOfReceiptCityName { get; set; }
/// <summary>
/// 收货地国家代码
/// </summary>
public string placeOfReceiptCountryCode { get; set; }
/// <summary>
/// 交货地UN地点代码
/// </summary>
public string placeOfDeliveryUnLocCode { get; set; }
/// <summary>
/// 交货地城市英文名称
/// </summary>
public string placeOfDeliveryCityName { get; set; }
/// <summary>
/// 交货地国家代码
/// </summary>
public string placeOfDeliveryCountryCode { get; set; }
/// <summary>
/// 出发时间, ISO时间格式
/// </summary>
public Nullable<DateTime> originDepartureDateTimeLocal { get; set; }
/// <summary>
/// 到达时间, ISO时间格式
/// </summary>
public Nullable<DateTime> destinationArrivalDateTimeLocal { get; set; }
/// <summary>
/// 是否冷冻处理
/// </summary>
public bool isReefer { get; set; } = false;
/// <summary>
/// 温度探头的数量
/// </summary>
public Nullable<int> noOfProbes { get; set; }
/// <summary>
/// 温度
/// </summary>
public Nullable<decimal> temperature { get; set; }
/// <summary>
/// 通风
/// </summary>
[Range(0, 285)]
public Nullable<int> ventilation { get; set; }
/// <summary>
/// 湿度
/// </summary>
public Nullable<int> humidity { get; set; }
/// <summary>
/// 货物代码
/// </summary>
[RegularExpression("^[0-9]{6}$", ErrorMessage = "6")]
public string commodityCode { get; set; }
/// <summary>
/// 货物名称
/// </summary>
public string commodityName { get; set; }
/// <summary>
/// 货物类型, 箱型, 为REEFER 时, 需要上传reeferSettings参数中的温度,通风,湿度等(DRY, REEFER)
/// </summary>
public string cargoType { get; set; }
/// <summary>
/// 重量
/// </summary>
public Nullable<int> totalCargoWeight { get; set; }
/// <summary>
/// 货物总体积
/// </summary>
public Nullable<decimal> totalCargoVolume { get; set; }
/// <summary>
/// 货物代码类型, 目前只能传 MaerskCode
/// </summary>
public string commodityCodeType { get; set; }
/// <summary>
/// 船名代码
/// </summary>
public string carrierVesselCode { get; set; }
/// <summary>
/// 船名
/// </summary>
public string vesselName { get; set; }
/// <summary>
/// 航次号
/// </summary>
public string exportVoyageNumber { get; set; }
/// <summary>
/// 运输方式(BAR, BCO, DST, FEF, FEO, MVS, RCO, RR, SSH, TRK, VSF, VSL, VSM)
/// </summary>
public string transportMode { get; set; }
/// <summary>
/// 预计航行天数
/// </summary>
public Nullable<int> EstSailingDays { get; set; }
/// <summary>
/// 合约号主键
/// </summary>
public Nullable<long> priceReferenceId { get; set; }
/// <summary>
/// 合约号名称
/// </summary>
public string priceReferenceName { get; set; }
/// <summary>
/// 我希望使用托运人自己的集装箱
/// </summary>
public bool isShipperOwned { get; set; }
/// <summary>
/// 我想使用进口退货集装箱或者其他三角集运选项
/// </summary>
public bool isImportReturned { get; set; }
/// <summary>
/// 查询船期ID
/// </summary>
public string carrierProductId { get; set; }
/// <summary>
/// 是否不使用船期表订舱
/// </summary>
public bool isSendNoSchedule { get; set; } = false;
/// <summary>
/// 收货地国家名称
/// </summary>
public string placeOfReceiptCountryName { get; set; }
/// <summary>
/// 收货地行政名称
/// </summary>
public string placeOfReceiptRegionName { get; set; }
/// <summary>
/// 交货地国家名称
/// </summary>
public string placeOfDeliveryCountryName { get; set; }
/// <summary>
/// 交货地行政名称
/// </summary>
public string placeOfDeliveryRegionName { get; set; }
/// <summary>
/// 用户录入收货地UN地点代码
/// </summary>
public string userPlaceOfReceiptUnLocCode { get; set; }
/// <summary>
/// 用户录入收货地城市英文名称
/// </summary>
public string userPlaceOfReceiptCityName { get; set; }
/// <summary>
/// 用户录入收货地国家代码
/// </summary>
public string userPlaceOfReceiptCountryCode { get; set; }
// <summary>
/// 用户录入收货地国家名称
/// </summary>
public string userPlaceOfReceiptCountryName { get; set; }
/// <summary>
/// 用户录入收货地行政名称
/// </summary>
public string userPlaceOfReceiptRegionName { get; set; }
/// <summary>
/// 用户录入交货地国家名称
/// </summary>
public string userPlaceOfDeliveryCountryName { get; set; }
/// <summary>
/// 用户录入交货地行政名称
/// </summary>
public string userPlaceOfDeliveryRegionName { get; set; }
/// <summary>
/// 用户录入交货地UN地点代码
/// </summary>
public string userPlaceOfDeliveryUnLocCode { get; set; }
/// <summary>
/// 用户录入交货地城市英文名称
/// </summary>
public string userPlaceOfDeliveryCityName { get; set; }
/// <summary>
/// 用户录入交货地国家代码
/// </summary>
public string userPlaceOfDeliveryCountryCode { get; set; }
/// <summary>
/// 箱型箱量列表
/// </summary>
public List<MSKBookingCtnInfo> ctns { get; set; }
}
}

@ -352,7 +352,50 @@ namespace Myshipping.Application
/// </summary> /// </summary>
public Nullable<DateTime> PriceCalculationDate { get; set; } public Nullable<DateTime> PriceCalculationDate { get; set; }
/// <summary>
/// 决定方
/// </summary>
public string DecidingParty { get; set; }
/// <summary>
/// 船公司航次
/// </summary>
public string CarrierVoyNo { get; set; }
/// <summary>
/// 订舱号
/// </summary>
public string OriginalBookingNo { get; set; }
/// <summary>
/// 是否危险品
/// </summary>
public bool IsHazardous { get; set; } = false;
/// <summary>
/// 是否熏蒸
/// </summary>
public bool IsFumigation { get; set; } = false;
/// <summary>
/// 是否冷冻
/// </summary>
public bool IsReefer { get; set; } = false;
// <summary>
/// 是否超限
/// </summary>
public bool IsOverSizedCargo { get; set; } = false;
/// <summary>
/// 是否液袋
/// </summary>
public bool IsFlexitank { get; set; } = false;
/// <summary>
/// 货物标志
/// </summary>
public string CARGOID { get; set; }
} }

Loading…
Cancel
Save