修改马士基API订舱

master
jianghaiqing 9 months ago
parent 8409ab2194
commit ce374ce57d

@ -126,6 +126,11 @@ namespace Myshipping.Application.Entity
/// </summary>
public string PLACERECEIPT_UNLOC_CODE { get; set; }
/// <summary>
/// 收货地国家代码
/// </summary>
public string PLACERECEIPT_COUNTRY_CODE { get; set; }
/// <summary>
/// 收货地代码
/// </summary>
@ -146,6 +151,11 @@ namespace Myshipping.Application.Entity
/// </summary>
public string PLACEDELIVERY_UNLOC_CODE { get; set; }
/// <summary>
/// 交货地国家代码
/// </summary>
public string PLACEDELIVERY_COUNTRY_CODE { get; set; }
/// <summary>
/// 预计开船日期
/// </summary>
@ -156,6 +166,11 @@ namespace Myshipping.Application.Entity
/// </summary>
public Nullable<DateTime> ETA { get; set; }
/// <summary>
/// 预计航行天数
/// </summary>
public Nullable<int> EST_SAILING_DAYS { get; set; }
/// <summary>
/// 船名
/// </summary>

@ -824,6 +824,22 @@ namespace Myshipping.Application.Service.BookingOrder
model = entity.Adapt<BookingDeliveryRecordDto>();
var ctnList = _bookingDeliveryRecordCtnRep.AsQueryable()
.Where(a => a.RECORD_ID == id && a.IsDeleted == false).ToList();
if (ctnList.Count > 0)
{
model.ctns = ctnList.Select(a => new BookingDeliveryRecordCtnDto {
id = a.Id,
ctnCode = a.CTN_CODE,
carrierCtnCode = a.CARRIER_CTN_CODE,
ctnNum = a.CTN_NUM,
ctnSufferWeight = a.CTN_SUFFER_WEIGHT,
stuffingMeasurementType = a.STUFFING_MEASUREMENT_TYPE,
stuffingMeasurementUnit = a.STUFFING_MEASUREMENT_UNIT
}).ToList();
}
return model;
}
#endregion
@ -855,9 +871,76 @@ namespace Myshipping.Application.Service.BookingOrder
x.BOOKING_REFERENCE,
x.BookingId,
x.REQUEST_ACKNOWLEDGEMENT_ID,
x.STATUS
x.STATUS,
x.TenantId,
}).ExecuteCommandAsync();
if (model.ctns != null && model.ctns.Count > 0)
{
var ctnEntityList = _bookingDeliveryRecordCtnRep.AsQueryable()
.Where(a => a.RECORD_ID == entity.Id && a.IsDeleted == false).ToList();
model.ctns.ForEach(ctn =>
{
if (ctn.id.HasValue && ctn.id.Value > 0)
{
if (ctnEntityList.Any(x => x.Id == ctn.id.Value))
{
ctnEntityList.Remove(ctnEntityList.FirstOrDefault(x => x.Id == ctn.id.Value));
}
//更新
var ctnEntity = ctn.Adapt<BookingDeliveryRecordCtn>();
ctnEntity.Id = ctn.id.Value;
ctnEntity.UpdatedTime = nowDate;
ctnEntity.UpdatedUserId = UserManager.UserId;
ctnEntity.UpdatedUserName = UserManager.Name;
_bookingDeliveryRecordCtnRep.AsUpdateable(ctnEntity).IgnoreColumns(x => new {
x.CreatedUserId,
x.CreatedUserName,
x.CreatedTime,
x.TenantId,
x.STUFFING_MEASUREMENT_TYPE,
x.STUFFING_MEASUREMENT_UNIT
}).ExecuteCommand();
}
else
{
var ctnEntity = ctn.Adapt<BookingDeliveryRecordCtn>();
ctnEntity.RECORD_ID = entity.Id;
ctnEntity.CreatedTime = nowDate;
ctnEntity.UpdatedTime = nowDate;
ctnEntity.CreatedUserId = UserManager.UserId;
ctnEntity.CreatedUserName = UserManager.Name;
ctnEntity.STUFFING_MEASUREMENT_TYPE = "WEIGHT";
ctnEntity.STUFFING_MEASUREMENT_UNIT = "KGS";
_bookingDeliveryRecordCtnRep.Insert(ctnEntity);
}
});
if(ctnEntityList.Count > 0)
{
ctnEntityList.ForEach(async ctn => {
ctn.IsDeleted = true;
ctn.UpdatedTime = nowDate;
ctn.UpdatedUserId = UserManager.UserId;
ctn.UpdatedUserName = UserManager.Name;
await _bookingDeliveryRecordCtnRep.AsUpdateable(ctn).UpdateColumns(x => new {
x.IsDeleted,
x.UpdatedTime,
x.UpdatedUserId,
x.UpdatedUserName
}).ExecuteCommandAsync();
});
}
}
return model.id.Value;
}
else
@ -868,6 +951,7 @@ namespace Myshipping.Application.Service.BookingOrder
entity.UpdatedTime = nowDate;
entity.CreatedUserId = UserManager.UserId;
entity.CreatedUserName = UserManager.Name;
entity.STATUS = "TEMP";
await _bookingDeliveryRecordRep.InsertAsync(entity);
@ -875,7 +959,6 @@ namespace Myshipping.Application.Service.BookingOrder
{
model.ctns.ForEach(ctn =>
{
var ctnEntity = ctn.Adapt<BookingDeliveryRecordCtn>();
ctnEntity.RECORD_ID = entity.Id;

@ -2590,7 +2590,10 @@ namespace Myshipping.Application
vgmWeight = t.VGM_WEIGHT,
vgmWeightMethod = t.VGM_METHOD,
vgmWeightUnit = t.VGM_WEIGHT_UNIT,
recvDate = t.REC_TIME
recvDate = t.REC_TIME,
isMatch = t.IS_MATCH,
isMissing = t.IS_MISSING,
submissionDeadLine = t.SUBMISSION_DEADLINE
}).ToList();
return list;

@ -45,5 +45,15 @@ namespace Myshipping.Application
/// 接收时间
/// </summary>
public Nullable<DateTime> recvDate { get; set; }
/// <summary>
/// 是否未提交VGM
/// </summary>
public bool isMissing { get; set; }
/// <summary>
/// 最晚提交期限
/// </summary>
public Nullable<DateTime> submissionDeadLine { get; set; }
}
}

@ -121,6 +121,11 @@ namespace Myshipping.Application
/// </summary>
public string placeReceiptUnlocCode { get; set; }
/// <summary>
/// 收货地国家代码
/// </summary>
public string placeOfReceiptCountryCode { get; set; }
/// <summary>
/// 收货地代码
/// </summary>
@ -141,6 +146,11 @@ namespace Myshipping.Application
/// </summary>
public string placeDeliveryUnlocCode { get; set; }
/// <summary>
/// 交货地国家代码
/// </summary>
public string placeOfDeliveryCountryCode { get; set; }
/// <summary>
/// 预计开船日期
/// </summary>
@ -151,6 +161,11 @@ namespace Myshipping.Application
/// </summary>
public Nullable<DateTime> atd { get; set; }
/// <summary>
/// 预计航行天数
/// </summary>
public Nullable<int> EstSailingDays { get; set; }
/// <summary>
/// 船名
/// </summary>
@ -371,5 +386,48 @@ namespace Myshipping.Application
/// 定时时间
/// </summary>
public Nullable<DateTime> jobTime { get; set; }
/// <summary>
/// 集装箱
/// </summary>
public List<BookingDeliveryRecordCtnDto> ctns { get; set; }
}
public class BookingDeliveryRecordCtnDto
{
/// <summary>
/// 箱型
/// </summary>
public string ctnCode { get; set; }
/// <summary>
/// 对应船公司箱型
/// </summary>
public string carrierCtnCode { get; set; }
/// <summary>
/// 箱量
/// </summary>
public Nullable<int> ctnNum { get; set; }
/// <summary>
/// 箱内重量
/// </summary>
public Nullable<decimal> ctnSufferWeight { get; set; }
/// <summary>
/// 集装箱主键
/// </summary>
public Nullable<long> id { get; set; }
/// <summary>
/// 箱计量单位
/// </summary>
public string stuffingMeasurementType { get; set; }
/// <summary>
/// 重量或者体积的计量单位
/// </summary>
public string stuffingMeasurementUnit { get; set; }
}
}

@ -127,7 +127,11 @@ namespace Myshipping.Application
.Map(dest => dest.HUMIDITY, src => src.humidity)
.Map(dest => dest.COMMODITY_CODE_TYPE, src => src.commodityCodeType)
.Map(dest => dest.GOODSCODE, src => src.commodityCode)
.Map(dest => dest.GOODSNAME, src => src.commodityName);
.Map(dest => dest.GOODSNAME, src => src.commodityName)
.Map(dest => dest.CARGO_TYPE, src => src.cargoType)
.Map(dest => dest.PLACERECEIPT_COUNTRY_CODE, src => src.placeOfReceiptCountryCode)
.Map(dest => dest.PLACEDELIVERY_COUNTRY_CODE, src => src.placeOfDeliveryCountryCode)
.Map(dest => dest.EST_SAILING_DAYS, src => src.EstSailingDays);
config.ForType<MSKBookingCtnInfo, BookingDeliveryRecordCtn>()
@ -145,7 +149,7 @@ namespace Myshipping.Application
.Map(dest => dest.bookedByCompanyName, src => src.BOOKEDBY_COMPANY_NAME)
.Map(dest => dest.bookedByCompanyPartyCode, src => src.BOOKEDBY_COMPANY_PARTYCODE)
.Map(dest => dest.bookedByCompanyContact, src => src.BOOKEDBY_COMPANY_CONTACT)
.Map(dest => dest.bookedByCompanyEmail, src => src. BOOKEDBY_COMPANY_CONTACT_EMAIL)
.Map(dest => dest.bookedByCompanyEmail, src => src.BOOKEDBY_COMPANY_CONTACT_EMAIL)
.Map(dest => dest.isbookingPartOwnPrice, src => src.IS_BOOKING_PART_OWN_PRICE)
.Map(dest => dest.priceOwnerCompanyName, src => src.PRICE_OWNER_COMPANY_NAME)
.Map(dest => dest.priceOwnerCompanyPartyCode, src => src.PRICE_OWNER_COMPANY_PARTYCODE)
@ -192,7 +196,10 @@ namespace Myshipping.Application
.Map(dest => dest.ctnStat, src => src.CTN_STAT)
.Map(dest => dest.weekAt, src => src.WEEK_AT)
.Map(dest => dest.sendTime, src => src.SEND_TIME)
.Map(dest => dest.cargoType, src => src.CARGO_TYPE);
.Map(dest => dest.cargoType, src => src.CARGO_TYPE)
.Map(dest => dest.placeOfReceiptCountryCode, src => src.PLACERECEIPT_COUNTRY_CODE)
.Map(dest => dest.placeOfDeliveryCountryCode, src => src.PLACEDELIVERY_COUNTRY_CODE)
.Map(dest => dest.EstSailingDays, src => src.EST_SAILING_DAYS);
config.ForType<BookingDeliveryRecord, BookingDeliveryRecordPageDto>()

@ -128,6 +128,11 @@ namespace Myshipping.Application
/// </summary>
public string placeOfReceiptCityName { get; set; }
/// <summary>
/// 收货地国家代码
/// </summary>
public string placeOfReceiptCountryCode { get; set; }
/// <summary>
/// 交货地UN地点代码
/// </summary>
@ -138,6 +143,11 @@ namespace Myshipping.Application
/// </summary>
public string placeOfDeliveryCityName { get; set; }
/// <summary>
/// 交货地国家代码
/// </summary>
public string placeOfDeliveryCountryCode { get; set; }
/// <summary>
/// 出发时间, ISO时间格式
/// </summary>
@ -226,6 +236,11 @@ namespace Myshipping.Application
/// </summary>
public string transportMode { get; set; }
/// <summary>
/// 预计航行天数
/// </summary>
public Nullable<int> EstSailingDays { get; set; }
/// <summary>
/// 箱型箱量列表
/// </summary>
@ -248,5 +263,10 @@ namespace Myshipping.Application
/// 箱内重量
/// </summary>
public Nullable<decimal> ctnSufferWeight { get; set; }
/// <summary>
/// 集装箱主键
/// </summary>
public Nullable<long> id { get; set; }
}
}

Loading…
Cancel
Save