修改马士基订舱台账

master
jianghaiqing 9 months ago
parent 118cab438c
commit fa1a6075a6

@ -41,5 +41,15 @@ namespace Myshipping.Application.Entity
/// 箱内货物重量 /// 箱内货物重量
/// </summary> /// </summary>
public int CTN_SUFFER_WEIGHT { get; set; } public int CTN_SUFFER_WEIGHT { get; set; }
/// <summary>
/// 箱计量单位
/// </summary>
public string STUFFING_MEASUREMENT_TYPE { get; set; }
/// <summary>
/// 重量或者体积的计量单位
/// </summary>
public string STUFFING_MEASUREMENT_UNIT { get; set; }
} }
} }

@ -399,32 +399,17 @@ namespace Myshipping.Application.Service.BookingOrder
}); });
} }
recordInfo.CreatedTime = nowDate; var id = await Save(model);
recordInfo.UpdatedTime = nowDate;
recordInfo.CreatedUserId = UserManager.UserId;
recordInfo.CreatedUserName = UserManager.Name;
_bookingDeliveryRecordRep.Insert(recordInfo);
if (recordCtnList.Count > 0)
{
recordCtnList.ForEach(async x =>
{
x.RECORD_ID = recordInfo.Id;
x.CreatedTime = nowDate;
x.UpdatedTime = nowDate;
x.CreatedUserId = UserManager.UserId;
x.CreatedUserName = UserManager.Name;
await _bookingDeliveryRecordCtnRep.InsertAsync(x);
});
}
MSKAPIBookingResultDto resultInfo = null; MSKAPIBookingResultDto resultInfo = null;
_logger.LogInformation($"开始请求MSK API订舱JSON={JSON.Serialize(bookingDto)}");
var rlt = await sendUrl.SetBody(bookingDto) var rlt = await sendUrl.SetBody(bookingDto)
.PostAsStringAsync(); .PostAsStringAsync();
_logger.LogInformation($"开始请求MSK API订舱返回结果 JSON={JSON.Serialize(rlt)}");
if (!string.IsNullOrWhiteSpace(rlt)) if (!string.IsNullOrWhiteSpace(rlt))
{ {
try try
@ -672,6 +657,7 @@ namespace Myshipping.Application.Service.BookingOrder
/// </summary> /// </summary>
/// <param name="QuerySearch">查询条件</param> /// <param name="QuerySearch">查询条件</param>
/// <returns>返回台账列表</returns> /// <returns>返回台账列表</returns>
[HttpPost("/BookingMSKAPI/GetPage")]
public async Task<SqlSugarPagedList<BookingDeliveryRecordPageDto>> GetPageAsync([FromBody] QueryBookingDeliveryRecordDto QuerySearch) public async Task<SqlSugarPagedList<BookingDeliveryRecordPageDto>> GetPageAsync([FromBody] QueryBookingDeliveryRecordDto QuerySearch)
{ {
@ -806,6 +792,11 @@ namespace Myshipping.Application.Service.BookingOrder
.WhereIF(jobEnd != DateTime.MinValue, t => t.JOB_TIME.HasValue && t.JOB_TIME.Value < jobEnd) .WhereIF(jobEnd != DateTime.MinValue, t => t.JOB_TIME.HasValue && t.JOB_TIME.Value < jobEnd)
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.PriceReference), t => t.PRICE_REFERENCE.Contains(QuerySearch.PriceReference)) .WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.PriceReference), t => t.PRICE_REFERENCE.Contains(QuerySearch.PriceReference))
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.BookedByCompanyName), t => t.BOOKEDBY_COMPANY_NAME.Contains(QuerySearch.BookedByCompanyName)) .WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.BookedByCompanyName), t => t.BOOKEDBY_COMPANY_NAME.Contains(QuerySearch.BookedByCompanyName))
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.BookedByCompanyPartyCode), t => t.BOOKEDBY_COMPANY_PARTYCODE.Contains(QuerySearch.BookedByCompanyPartyCode))
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.PriceOwnerCompanyName), t => t.PRICE_OWNER_COMPANY_NAME.Contains(QuerySearch.PriceOwnerCompanyName))
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.PriceOwnerCompanyPartyCode), t => t.PRICE_OWNER_COMPANY_PARTYCODE.Contains(QuerySearch.PriceOwnerCompanyPartyCode))
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.PlaceReceiptCity), t => t.PLACERECEIPT_CITY.Contains(QuerySearch.PlaceReceiptCity) || t.PLACERECEIPT_UNLOC_CODE.Contains(QuerySearch.PlaceReceiptCity))
.WhereIF(!string.IsNullOrWhiteSpace(QuerySearch.PlaceDeliveryCity), t => t.PLACEDELIVERY_CITY.Contains(QuerySearch.PlaceDeliveryCity) || t.PLACEDELIVERY_UNLOC_CODE.Contains(QuerySearch.PlaceDeliveryCity))
.OrderBy(entityOrderCol + (QuerySearch.descSort ? " asc " : " desc ")) .OrderBy(entityOrderCol + (QuerySearch.descSort ? " asc " : " desc "))
.ToPagedListAsync(QuerySearch.PageNo, QuerySearch.PageSize); .ToPagedListAsync(QuerySearch.PageNo, QuerySearch.PageSize);
@ -820,6 +811,7 @@ namespace Myshipping.Application.Service.BookingOrder
/// </summary> /// </summary>
/// <param name="id">马士基API订舱ID</param> /// <param name="id">马士基API订舱ID</param>
/// <returns>返回详情</returns> /// <returns>返回详情</returns>
[HttpGet("/BookingMSKAPI/GetInfo")]
public async Task<BookingDeliveryRecordDto> GetInfo(long id) public async Task<BookingDeliveryRecordDto> GetInfo(long id)
{ {
BookingDeliveryRecordDto model = null; BookingDeliveryRecordDto model = null;
@ -835,5 +827,72 @@ namespace Myshipping.Application.Service.BookingOrder
return model; return model;
} }
#endregion #endregion
#region 保存
/// <summary>
/// 保存
/// </summary>
/// <param name="model">请求订舱详情</param>
/// <returns>返回ID</returns>
[HttpPost("/BookingMSKAPI/Save")]
public async Task<long> Save([FromBody] MSKBookingDto model)
{
DateTime nowDate = DateTime.Now;
if (model.id.HasValue && model.id.Value > 0)
{
BookingDeliveryRecord entity = model.Adapt<BookingDeliveryRecord>();
entity.UpdatedTime = nowDate;
entity.UpdatedUserId = UserManager.UserId;
entity.UpdatedUserName = UserManager.Name;
await _bookingDeliveryRecordRep.AsUpdateable(entity).IgnoreColumns(x => new
{
x.CreatedTime,
x.CreatedUserId,
x.CreatedUserName,
x.BOOKING_REFERENCE,
x.BookingId,
x.REQUEST_ACKNOWLEDGEMENT_ID,
x.STATUS
}).ExecuteCommandAsync();
return model.id.Value;
}
else
{
BookingDeliveryRecord entity = model.Adapt<BookingDeliveryRecord>();
entity.CreatedTime = nowDate;
entity.UpdatedTime = nowDate;
entity.CreatedUserId = UserManager.UserId;
entity.CreatedUserName = UserManager.Name;
await _bookingDeliveryRecordRep.InsertAsync(entity);
if (model.ctns != null && model.ctns.Count > 0)
{
model.ctns.ForEach(ctn =>
{
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);
});
}
return entity.Id;
}
}
#endregion
} }
} }

@ -176,8 +176,65 @@ namespace Myshipping.Application
.Map(dest => dest.goodsName, src => src.GOODSNAME) .Map(dest => dest.goodsName, src => src.GOODSNAME)
.Map(dest => dest.isReefer, src => src.IS_REEFER) .Map(dest => dest.isReefer, src => src.IS_REEFER)
.Map(dest => dest.cargoType, src => src.CARGO_TYPE) .Map(dest => dest.cargoType, src => src.CARGO_TYPE)
.Map(dest => dest.placeDeliveryId, src => src.PLACEDELIVERYID)
.Map(dest => dest.placeDelivery, src => src.PLACEDELIVERY)
.Map(dest => dest.portLoadId, src => src.PORTLOADID)
.Map(dest => dest.portLoad, src => src.PORTLOAD)
.Map(dest => dest.portDischargeId, src => src.PORTDISCHARGEID)
.Map(dest => dest.portDischarge, src => src.PORTDISCHARGE)
.Map(dest => dest.laneCode, src => src.LANECODE)
.Map(dest => dest.laneName, src => src.LANENAME)
.Map(dest => dest.carriageType, src => src.CARRIAGE_TYPE)
.Map(dest => dest.carriageTypeName, src => src.CARRIAGE_TYPE_NAME)
.Map(dest => dest.bookingSlotType, src => src.BOOKING_SLOT_TYPE)
.Map(dest => dest.bookingSlotTypeName, src => src.BOOKING_SLOT_TYPE_NAME)
.Map(dest => dest.issueType, src => src.ISSUETYPE)
.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);
config.ForType<BookingDeliveryRecord, BookingDeliveryRecordPageDto>()
.Map(dest => dest.id, src => src.Id)
.Map(dest => dest.carrierId, src => src.CARRIERID)
.Map(dest => dest.priceReference, src => src.PRICE_REFERENCE)
.Map(dest => dest.productCode, src => src.PRODUCT_CODE)
.Map(dest => dest.sender, src => src.SENDER)
.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.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)
.Map(dest => dest.priceOwnerCompanyContact, src => src.PRICE_OWNER_COMPANY_CONTACT)
.Map(dest => dest.priceOwnerCompanyContactEmail, src => src.PRICE_OWNER_COMPANY_CONTACT_EMAIL)
.Map(dest => dest.carrierCode, src => src.CARRIER_CODE)
.Map(dest => dest.earliestDepartureDate, src => src.EARLIEST_DEPARTURE_DATE)
.Map(dest => dest.exportServiceMode, src => src.EXPORT_SERVICE_MODE)
.Map(dest => dest.importServiceMode, src => src.IMPORT_SERVICE_MODE)
.Map(dest => dest.placeReceiptCity, src => src.PLACERECEIPT_CITY)
.Map(dest => dest.placeReceiptUnlocCode, src => src.PLACERECEIPT_UNLOC_CODE)
.Map(dest => dest.placeDeliveryCity, src => src.PLACEDELIVERY_CITY)
.Map(dest => dest.placeDeliveryUnlocCode, src => src.PLACEDELIVERY_UNLOC_CODE)
.Map(dest => dest.etd, src => src.ETD)
.Map(dest => dest.atd, src => src.ETA)
.Map(dest => dest.vessel, src => src.VESSEL)
.Map(dest => dest.vesselCode, src => src.VESSEL_CODE)
.Map(dest => dest.voyno, src => src.VOYNO)
.Map(dest => dest.transportMode, src => src.TRANSPORT_MODE)
.Map(dest => dest.totalCargoWeight, src => src.TOTAL_CARGO_WEIGHT)
.Map(dest => dest.noOfProbes, src => src.NO_OF_PROBES)
.Map(dest => dest.tempSet, src => src.TEMPSET)
.Map(dest => dest.tempId, src => src.TEMPID)
.Map(dest => dest.vent, src => src.VENT)
.Map(dest => dest.humidity, src => src.HUMIDITY)
.Map(dest => dest.commodityCodeType, src => src.COMMODITY_CODE_TYPE)
.Map(dest => dest.goodsCode, src => src.GOODSCODE)
.Map(dest => dest.goodsName, src => src.GOODSNAME)
.Map(dest => dest.isReefer, src => src.IS_REEFER)
.Map(dest => dest.cargoType, src => src.CARGO_TYPE)
.Map(dest => dest.placeDeliveryId, src => src.PLACEDELIVERYID) .Map(dest => dest.placeDeliveryId, src => src.PLACEDELIVERYID)
.Map(dest => dest.placeDelivery, src => src.PLACEDELIVERY) .Map(dest => dest.placeDelivery, src => src.PLACEDELIVERY)
.Map(dest => dest.portLoadId, src => src.PORTLOADID) .Map(dest => dest.portLoadId, src => src.PORTLOADID)

@ -12,6 +12,11 @@ namespace Myshipping.Application
/// </summary> /// </summary>
public class MSKBookingDto public class MSKBookingDto
{ {
/// <summary>
/// 记录ID
/// </summary>
public Nullable<long> id { get; set; }
/// <summary> /// <summary>
/// 船公司代码 /// 船公司代码
/// </summary> /// </summary>

@ -132,5 +132,15 @@ namespace Myshipping.Application
/// 价格所有者代码 /// 价格所有者代码
/// </summary> /// </summary>
public string PriceOwnerCompanyPartyCode { get; set; } public string PriceOwnerCompanyPartyCode { get; set; }
/// <summary>
/// 始发地
/// </summary>
public string PlaceReceiptCity { get; set; }
/// <summary>
/// 目的地
/// </summary>
public string PlaceDeliveryCity { get; set; }
} }
} }

@ -51,5 +51,12 @@ namespace Myshipping.Application
/// <param name="id">马士基API订舱ID</param> /// <param name="id">马士基API订舱ID</param>
/// <returns>返回详情</returns> /// <returns>返回详情</returns>
Task<BookingDeliveryRecordDto> GetInfo(long id); Task<BookingDeliveryRecordDto> GetInfo(long id);
/// <summary>
/// 保存
/// </summary>
/// <param name="model">请求订舱详情</param>
/// <returns>返回ID</returns>
Task<long> Save(MSKBookingDto model);
} }
} }

@ -651,8 +651,6 @@ namespace Myshipping.Application
} }
#endregion #endregion
#region 派车任务 #region 派车任务
if (info.Main.TaskType == TaskBaseTypeEnum.TRUCK_DISPATCH) if (info.Main.TaskType == TaskBaseTypeEnum.TRUCK_DISPATCH)
{ {

Loading…
Cancel
Save