|
|
|
@ -773,7 +773,7 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
|
|
|
|
|
bookingDto.bookingBody.transport = new MSKAPIBookingTransport
|
|
|
|
|
{
|
|
|
|
|
carrierCode = model.carrierCode,
|
|
|
|
|
carrierCode = model.vesselCarrierCode,
|
|
|
|
|
//earliestDepartureDate = model.earliestDepartureDate.Value.ToString("yyyy-MM-ddTHH:mm:ss"),
|
|
|
|
|
exportServiceMode = model.exportServiceMode,
|
|
|
|
|
importServiceMode = model.importServiceMode,
|
|
|
|
@ -962,7 +962,7 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
{
|
|
|
|
|
model.ctns.ForEach(ctn =>
|
|
|
|
|
{
|
|
|
|
|
var ctnMapping = mappingCtnService.QueryMappingCtn(model.carrierId, CONST_MSK_API_BOOKING_URL, ctn.ctnCode).GetAwaiter().GetResult()?.Data;
|
|
|
|
|
var ctnMapping = mappingCtnService.QueryMappingCtn(model.carrierId.Value, CONST_MSK_API_BOOKING_URL, ctn.ctnCode).GetAwaiter().GetResult()?.Data;
|
|
|
|
|
|
|
|
|
|
MSKAPIBookingEquipmentAndHaulage haulage = new MSKAPIBookingEquipmentAndHaulage
|
|
|
|
|
{
|
|
|
|
@ -1397,10 +1397,76 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
|
|
|
|
|
var entity = await tenantDb.Queryable<SpaceBookingOrder>().FirstAsync(a => a.Id == id);
|
|
|
|
|
|
|
|
|
|
//if (entity == null)
|
|
|
|
|
//throw Oops.Oh($"获取马士基API订舱详情失败,不存在或已作废");
|
|
|
|
|
if (entity == null)
|
|
|
|
|
throw new Exception(MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.SpaceBookingAPIOrderDeletedOrNoExists)));
|
|
|
|
|
|
|
|
|
|
model = entity.Adapt<MSKSPOTBookingDto>();
|
|
|
|
|
model = new MSKSPOTBookingDto
|
|
|
|
|
{
|
|
|
|
|
id = entity.Id,
|
|
|
|
|
carrierCode = entity.CarrierCode,
|
|
|
|
|
vesselCarrierCode = entity.vesselCarrierCode,
|
|
|
|
|
carrierId = entity.CarrierId,
|
|
|
|
|
priceReference = entity.PriceReference,
|
|
|
|
|
productCode = entity.ProductCode,
|
|
|
|
|
sender = entity.Sender,
|
|
|
|
|
bookedByCompanyName = entity.BookedByCompanyName,
|
|
|
|
|
bookedByMaerskPartyCode = entity.BookedByCompanyPartyCode,
|
|
|
|
|
bookedByCompanyContactName = entity.BookedByCompanyContact,
|
|
|
|
|
bookedByCompanyContactEmail = entity.BookedByCompanyContactEmail,
|
|
|
|
|
isBookingPartOwnPrice = entity.IsBookingPartOwnPrice,
|
|
|
|
|
priceOwnerCompanyName = entity.PriceOwnerCompanyName,
|
|
|
|
|
priceOwnerMaerskPartyCode = entity.PriceOwnerCompanyPartyCode,
|
|
|
|
|
priceOwnerContactName = entity.PriceOwnerCompanyContact,
|
|
|
|
|
priceOwnerContactEmail = entity.PriceOwnerCompanyContactEmail,
|
|
|
|
|
earliestDepartureDate = entity.EarliestDepartureDate,
|
|
|
|
|
exportServiceMode = entity.ExportServiceMode,
|
|
|
|
|
importServiceMode = entity.ImportServiceMode,
|
|
|
|
|
placeOfReceiptCityName = entity.PlaceReceiptCity,
|
|
|
|
|
placeOfReceiptUnLocCode = entity.PlaceReceiptUnlocCode,
|
|
|
|
|
placeOfDeliveryCityName = entity.PlaceDeliveryCity,
|
|
|
|
|
placeOfDeliveryUnLocCode = entity.PlaceDeliveryUnlocCode,
|
|
|
|
|
originDepartureDateTimeLocal = entity.ETD,
|
|
|
|
|
destinationArrivalDateTimeLocal = entity.ETA,
|
|
|
|
|
vesselName = entity.Vessel,
|
|
|
|
|
carrierVesselCode = entity.VesselCode,
|
|
|
|
|
exportVoyageNumber = entity.Voyno,
|
|
|
|
|
transportMode = entity.TransportMode,
|
|
|
|
|
totalCargoWeight = entity.TotalCargoWeight,
|
|
|
|
|
noOfProbes = entity.NoOfProbes,
|
|
|
|
|
temperature = !string.IsNullOrWhiteSpace(entity.TempSet) ? decimal.Parse(entity.TempSet) : null,
|
|
|
|
|
ventilation = entity.Vent,
|
|
|
|
|
humidity = entity.Humidity,
|
|
|
|
|
commodityCodeType = entity.CommodityCodeType,
|
|
|
|
|
commodityCode = entity.GoodsCode,
|
|
|
|
|
commodityName = entity.GoodsName,
|
|
|
|
|
isReefer = entity.IsReefer,
|
|
|
|
|
cargoType = entity.CargoType,
|
|
|
|
|
placeOfReceiptCountryCode = entity.PlaceReceiptCountryCode,
|
|
|
|
|
placeOfDeliveryCountryCode = entity.PlaceDeliveryCountryCode,
|
|
|
|
|
EstSailingDays = entity.EstSailingDays,
|
|
|
|
|
priceReferenceId = entity.PriceOwnerReferenceId,
|
|
|
|
|
priceReferenceName = entity.PriceOwnerReference,
|
|
|
|
|
priceOwnerReferenceId = entity.PriceOwnerReferenceId.HasValue ? entity.PriceOwnerReferenceId.Value.ToString() : "",
|
|
|
|
|
priceOwnerReference = entity.PriceOwnerReference,
|
|
|
|
|
priceOwnerReferenceName = entity.PriceOwnerReferenceName,
|
|
|
|
|
isShipperOwned = entity.IsShipperOwner,
|
|
|
|
|
isImportReturned = entity.IsImportReturned,
|
|
|
|
|
carrierProductId = entity.CarrierProductId,
|
|
|
|
|
isSendNoSchedule = entity.IsSendNoSchedule,
|
|
|
|
|
placeOfReceiptCountryName = entity.PlaceReceiptCountryName,
|
|
|
|
|
placeOfReceiptRegionName = entity.PlaceReceiptRegionName,
|
|
|
|
|
placeOfDeliveryCountryName = entity.PlaceDeliveryCountryName,
|
|
|
|
|
placeOfDeliveryRegionName = entity.PlaceDeliveryRegionName,
|
|
|
|
|
PId = entity.ShipRatePId.HasValue? entity.ShipRatePId.Value:0,
|
|
|
|
|
MD5 = entity.ShipRateMD5,
|
|
|
|
|
bookingChannelTypeName = entity.BookingChannelType,
|
|
|
|
|
bookingChannelType = entity.BookingChannelTypeName,
|
|
|
|
|
carrierCollectionOriginGeoID = entity.PlaceReceiptGeoId,
|
|
|
|
|
carrierDeliveryDestinationGeoID = entity.PlaceDeliveryGeoId,
|
|
|
|
|
priceID = entity.PriceId,
|
|
|
|
|
ShipRateTotalAmount = entity.ShipRateTotalAmount,
|
|
|
|
|
ShipRateTotalCurrency = entity.ShipRateTotalCurrency
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var ctnList = tenantDb.Queryable<SpaceBookingOrderCtn>().Where(a => a.RecordId == id && a.Deleted == false).ToList();
|
|
|
|
|
|
|
|
|
@ -1495,22 +1561,26 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
selectedShipSchedule = JsonConvert.DeserializeObject<MSKAPISPOTSearchScheduleRateResultDataDto>(shipScheduleRecord.ShipJson);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//if (selectedShipSchedule == null)
|
|
|
|
|
// throw Oops.Oh("船期数据校验失败,请重新查询船期信息");
|
|
|
|
|
//船期数据校验失败,请重新查询船期信息
|
|
|
|
|
if (selectedShipSchedule == null)
|
|
|
|
|
throw new Exception(MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.SpaceBookingAPIShipScheduleCheckFailNotNull)));
|
|
|
|
|
|
|
|
|
|
//if (!selectedShipSchedule.priceID.Equals(model.priceID))
|
|
|
|
|
//{
|
|
|
|
|
// _logger.LogInformation($"请求当前船期请求参数错误 priceID={model.priceID} 缓存priceID={selectedShipSchedule.priceID} PId={model.PId}");
|
|
|
|
|
if (!selectedShipSchedule.priceID.Equals(model.priceID))
|
|
|
|
|
{
|
|
|
|
|
Logger.Log(NLog.LogLevel.Info, $"请求当前船期请求参数错误 priceID={model.priceID} 缓存priceID={selectedShipSchedule.priceID} PId={model.PId}");
|
|
|
|
|
|
|
|
|
|
// throw Oops.Oh("船期数据校验失败,当前船期请求参数错误,请重新查询船期信息");
|
|
|
|
|
//}
|
|
|
|
|
//船期数据校验失败,当前船期请求参数错误,请重新查询船期信息
|
|
|
|
|
throw new Exception(MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.SpaceBookingAPIShipScheduleCheckFailPriceIDNotEqual)));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//if (selectedShipSchedule.totalAmount.Value != model.ShipRateTotalAmount.Value)
|
|
|
|
|
//{
|
|
|
|
|
// _logger.LogInformation($"请求当前船期请求参数错误 totalAmount={selectedShipSchedule.totalAmount.Value} 缓存totalAmount={model.ShipRateTotalAmount.Value} PId={model.PId}");
|
|
|
|
|
if (selectedShipSchedule.totalAmount.Value != model.ShipRateTotalAmount.Value)
|
|
|
|
|
{
|
|
|
|
|
Logger.Log(NLog.LogLevel.Info, $"请求当前船期请求参数错误 totalAmount={selectedShipSchedule.totalAmount.Value} 缓存totalAmount={model.ShipRateTotalAmount.Value} PId={model.PId}");
|
|
|
|
|
|
|
|
|
|
// throw Oops.Oh("船期数据校验失败,当前船期请求参数错误,价格发生差异,请重新查询船期信息");
|
|
|
|
|
//}
|
|
|
|
|
//船期数据校验失败,当前船期请求参数错误,价格发生差异,请重新查询船期信息
|
|
|
|
|
throw new Exception(MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.SpaceBookingAPIShipScheduleCheckFailAmountChange)));
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
model.placeOfReceiptCountryName = selectedShipSchedule.originCountryName;
|
|
|
|
|
model.placeOfReceiptRegionName = selectedShipSchedule.originRegionName;
|
|
|
|
@ -1532,24 +1602,89 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
var oldInfo = tenantDb.Queryable<SpaceBookingOrder>()
|
|
|
|
|
.First(a => a.Id == model.id);
|
|
|
|
|
|
|
|
|
|
//if (oldInfo == null)
|
|
|
|
|
//throw Oops.Oh("订舱数据不存在或已作废");
|
|
|
|
|
if (oldInfo == null)
|
|
|
|
|
throw new Exception(MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.SpaceBookingRecordDeletedOrNoExists)));
|
|
|
|
|
|
|
|
|
|
if (oldInfo.Status == "SUCC")
|
|
|
|
|
{
|
|
|
|
|
//if (isSendApi)
|
|
|
|
|
//throw Oops.Oh("订舱数据已发送成功,不能重复发送");
|
|
|
|
|
|
|
|
|
|
//throw Oops.Oh("订舱数据已发送成功,不能修改");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SpaceBookingOrder entity = model.Adapt<SpaceBookingOrder>();
|
|
|
|
|
if (isSendApi)
|
|
|
|
|
throw new Exception(MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.SpaceBookingBeSendNotRepeat)));
|
|
|
|
|
|
|
|
|
|
//预订舱数据已发送成功,不能修改
|
|
|
|
|
throw new Exception(MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.SpaceBookingBeSendNotModify)));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#region 赋值
|
|
|
|
|
SpaceBookingOrder entity = new SpaceBookingOrder
|
|
|
|
|
{
|
|
|
|
|
CarrierCode = model.carrierCode,
|
|
|
|
|
vesselCarrierCode = model.vesselCarrierCode,
|
|
|
|
|
CarrierId = model.carrierId,
|
|
|
|
|
PriceReference = model.priceReference,
|
|
|
|
|
ProductCode = model.productCode,
|
|
|
|
|
Sender = model.sender,
|
|
|
|
|
BookedByCompanyName = model.bookedByCompanyName,
|
|
|
|
|
BookedByCompanyPartyCode = model.bookedByMaerskPartyCode,
|
|
|
|
|
BookedByCompanyContact = model.bookedByCompanyContactName,
|
|
|
|
|
BookedByCompanyContactEmail = model.bookedByCompanyContactEmail,
|
|
|
|
|
IsBookingPartOwnPrice = model.isBookingPartOwnPrice,
|
|
|
|
|
PriceOwnerCompanyName = model.priceOwnerCompanyName,
|
|
|
|
|
PriceOwnerCompanyPartyCode = model.priceOwnerMaerskPartyCode,
|
|
|
|
|
PriceOwnerCompanyContact = model.priceOwnerContactName,
|
|
|
|
|
PriceOwnerCompanyContactEmail = model.priceOwnerContactEmail,
|
|
|
|
|
EarliestDepartureDate = model.earliestDepartureDate,
|
|
|
|
|
ExportServiceMode = model.exportServiceMode,
|
|
|
|
|
ImportServiceMode = model.importServiceMode,
|
|
|
|
|
PlaceReceiptCity = model.placeOfReceiptCityName,
|
|
|
|
|
PlaceReceiptUnlocCode = model.placeOfReceiptUnLocCode,
|
|
|
|
|
PlaceDeliveryCity = model.placeOfDeliveryCityName,
|
|
|
|
|
PlaceDeliveryUnlocCode = model.placeOfDeliveryUnLocCode,
|
|
|
|
|
ETD = model.originDepartureDateTimeLocal,
|
|
|
|
|
ETA = model.destinationArrivalDateTimeLocal,
|
|
|
|
|
Vessel = model.vesselName,
|
|
|
|
|
VesselCode = model.carrierVesselCode,
|
|
|
|
|
Voyno = model.exportVoyageNumber,
|
|
|
|
|
TransportMode = model.transportMode,
|
|
|
|
|
TotalCargoWeight = model.totalCargoWeight,
|
|
|
|
|
NoOfProbes = model.noOfProbes,
|
|
|
|
|
TempSet = model.temperature.HasValue ? model.temperature.Value.ToString() : "",
|
|
|
|
|
Vent = model.ventilation,
|
|
|
|
|
Humidity = model.humidity,
|
|
|
|
|
CommodityCodeType = model.commodityCodeType,
|
|
|
|
|
GoodsCode = model.commodityCode,
|
|
|
|
|
GoodsName = model.commodityName,
|
|
|
|
|
CargoType = model.cargoType,
|
|
|
|
|
PlaceReceiptCountryCode = model.placeOfReceiptCountryCode,
|
|
|
|
|
PlaceDeliveryCountryCode = model.placeOfDeliveryCountryCode,
|
|
|
|
|
EstSailingDays = model.EstSailingDays,
|
|
|
|
|
PriceReferenceId = model.priceReferenceId,
|
|
|
|
|
PriceReferenceName = model.priceReferenceName,
|
|
|
|
|
PriceOwnerReferenceId = !string.IsNullOrWhiteSpace(model.priceOwnerReferenceId) ? long.Parse(model.priceOwnerReferenceId) : null,
|
|
|
|
|
PriceOwnerReference = model.priceOwnerReference,
|
|
|
|
|
PriceOwnerReferenceName = model.priceOwnerReferenceName,
|
|
|
|
|
IsReefer = model.isReefer,
|
|
|
|
|
IsShipperOwner = model.isShipperOwned,
|
|
|
|
|
IsImportReturned = model.isImportReturned,
|
|
|
|
|
CarrierProductId = model.carrierProductId,
|
|
|
|
|
IsSendNoSchedule = model.isSendNoSchedule,
|
|
|
|
|
PlaceReceiptCountryName = model.placeOfReceiptCountryName,
|
|
|
|
|
PlaceReceiptRegionName = model.placeOfReceiptRegionName,
|
|
|
|
|
PlaceDeliveryRegionName = model.placeOfDeliveryRegionName,
|
|
|
|
|
PlaceDeliveryCountryName = model.userPlaceOfDeliveryCountryName,
|
|
|
|
|
ShipRatePId = model.PId,
|
|
|
|
|
ShipRateMD5 = model.MD5,
|
|
|
|
|
PlaceReceiptGeoId = model.carrierCollectionOriginGeoID,
|
|
|
|
|
PlaceDeliveryGeoId = model.carrierDeliveryDestinationGeoID,
|
|
|
|
|
PriceId = model.priceID,
|
|
|
|
|
ShipRateTotalAmount = model.ShipRateTotalAmount,
|
|
|
|
|
ShipRateTotalCurrency = model.ShipRateTotalCurrency
|
|
|
|
|
};
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
entity.Id = model.id.Value;
|
|
|
|
|
entity.UpdateTime = nowDate;
|
|
|
|
|
entity.UpdateBy = long.Parse(user.UserId);
|
|
|
|
|
//entity.UpdatedUserName = UserManager.Name;
|
|
|
|
|
entity.UpdateUserName = user.UserName;
|
|
|
|
|
entity.CtnStat = ctnStat;
|
|
|
|
|
entity.BookingChannelType = "SPOT_API";
|
|
|
|
|
entity.BookingChannelTypeName = "SPOT订舱";
|
|
|
|
@ -1558,7 +1693,7 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
{
|
|
|
|
|
x.CreateTime,
|
|
|
|
|
x.CreateBy,
|
|
|
|
|
//x.CreatedUserName,
|
|
|
|
|
x.CreateUserName,
|
|
|
|
|
x.BookingReference,
|
|
|
|
|
x.BookingId,
|
|
|
|
|
x.RequestAcknowledgementId,
|
|
|
|
@ -1585,17 +1720,23 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//更新
|
|
|
|
|
var ctnEntity = ctn.Adapt<SpaceBookingOrderCtn>();
|
|
|
|
|
var ctnEntity = new SpaceBookingOrderCtn
|
|
|
|
|
{
|
|
|
|
|
CtnCode = ctn.ctnCode,
|
|
|
|
|
CtnName = ctn.ctnName,
|
|
|
|
|
CtnNum = ctn.ctnNum,
|
|
|
|
|
CtnSufferWeight = ctn.ctnSufferWeight.HasValue ? (int)ctn.ctnSufferWeight.Value : 0
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
ctnEntity.Id = ctn.id.Value;
|
|
|
|
|
ctnEntity.RecordId = entity.Id;
|
|
|
|
|
ctnEntity.UpdateTime = nowDate;
|
|
|
|
|
ctnEntity.UpdateBy = long.Parse(user.UserId);
|
|
|
|
|
//ctnEntity.UpdatedUserName = UserManager.Name;
|
|
|
|
|
ctnEntity.UpdateUserName = user.UserName;
|
|
|
|
|
|
|
|
|
|
tenantDb.Updateable<SpaceBookingOrderCtn>(ctnEntity).IgnoreColumns(x => new {
|
|
|
|
|
x.CreateBy,
|
|
|
|
|
//x.CreatedUserName,
|
|
|
|
|
x.CreateUserName,
|
|
|
|
|
x.CreateTime,
|
|
|
|
|
//x.TenantId,
|
|
|
|
|
x.StuffingMeasurementType,
|
|
|
|
@ -1617,7 +1758,7 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
ctnEntity.CreateTime = nowDate;
|
|
|
|
|
ctnEntity.UpdateTime = nowDate;
|
|
|
|
|
ctnEntity.CreateBy = long.Parse(user.UserId);
|
|
|
|
|
//ctnEntity.CreatedUserName = UserManager.Name;
|
|
|
|
|
ctnEntity.CreateUserName = user.UserName;
|
|
|
|
|
ctnEntity.StuffingMeasurementType = "WEIGHT";
|
|
|
|
|
ctnEntity.StuffingMeasurementUnit = "KGS";
|
|
|
|
|
|
|
|
|
@ -1632,13 +1773,13 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
ctn.Deleted = true;
|
|
|
|
|
ctn.DeleteTime = nowDate;
|
|
|
|
|
ctn.DeleteBy = long.Parse(user.UserId);
|
|
|
|
|
//ctn.UpdatedUserName = UserManager.Name;
|
|
|
|
|
ctn.UpdateUserName = user.UserName;
|
|
|
|
|
|
|
|
|
|
await tenantDb.Updateable<SpaceBookingOrderCtn>(ctn).UpdateColumns(x => new {
|
|
|
|
|
x.Deleted,
|
|
|
|
|
x.DeleteTime,
|
|
|
|
|
x.DeleteBy,
|
|
|
|
|
//x.UpdatedUserName
|
|
|
|
|
x.UpdateUserName
|
|
|
|
|
}).ExecuteCommandAsync();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
@ -1658,7 +1799,7 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
CreateTime = nowDate,
|
|
|
|
|
UpdateTime = nowDate,
|
|
|
|
|
CreateBy = long.Parse(user.UserId),
|
|
|
|
|
//CreatedUserName = UserManager.Name
|
|
|
|
|
CreateUserName = user.UserName
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
await tenantDb.Insertable<SpaceBookingOrderShipSchedule>(shipScheduleRecord).ExecuteCommandAsync();
|
|
|
|
@ -1669,12 +1810,77 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
SpaceBookingOrder entity = model.Adapt<SpaceBookingOrder>();
|
|
|
|
|
#region 赋值
|
|
|
|
|
SpaceBookingOrder entity = new SpaceBookingOrder
|
|
|
|
|
{
|
|
|
|
|
CarrierCode = model.carrierCode,
|
|
|
|
|
vesselCarrierCode = model.vesselCarrierCode,
|
|
|
|
|
CarrierId = model.carrierId,
|
|
|
|
|
PriceReference = model.priceReference,
|
|
|
|
|
ProductCode = model.productCode,
|
|
|
|
|
Sender = model.sender,
|
|
|
|
|
BookedByCompanyName = model.bookedByCompanyName,
|
|
|
|
|
BookedByCompanyPartyCode = model.bookedByMaerskPartyCode,
|
|
|
|
|
BookedByCompanyContact = model.bookedByCompanyContactName,
|
|
|
|
|
BookedByCompanyContactEmail = model.bookedByCompanyContactEmail,
|
|
|
|
|
IsBookingPartOwnPrice = model.isBookingPartOwnPrice,
|
|
|
|
|
PriceOwnerCompanyName = model.priceOwnerCompanyName,
|
|
|
|
|
PriceOwnerCompanyPartyCode = model.priceOwnerMaerskPartyCode,
|
|
|
|
|
PriceOwnerCompanyContact = model.priceOwnerContactName,
|
|
|
|
|
PriceOwnerCompanyContactEmail = model.priceOwnerContactEmail,
|
|
|
|
|
EarliestDepartureDate = model.earliestDepartureDate,
|
|
|
|
|
ExportServiceMode = model.exportServiceMode,
|
|
|
|
|
ImportServiceMode = model.importServiceMode,
|
|
|
|
|
PlaceReceiptCity = model.placeOfReceiptCityName,
|
|
|
|
|
PlaceReceiptUnlocCode = model.placeOfReceiptUnLocCode,
|
|
|
|
|
PlaceDeliveryCity = model.placeOfDeliveryCityName,
|
|
|
|
|
PlaceDeliveryUnlocCode = model.placeOfDeliveryUnLocCode,
|
|
|
|
|
ETD = model.originDepartureDateTimeLocal,
|
|
|
|
|
ETA = model.destinationArrivalDateTimeLocal,
|
|
|
|
|
Vessel = model.vesselName,
|
|
|
|
|
VesselCode = model.carrierVesselCode,
|
|
|
|
|
Voyno = model.exportVoyageNumber,
|
|
|
|
|
TransportMode = model.transportMode,
|
|
|
|
|
TotalCargoWeight = model.totalCargoWeight,
|
|
|
|
|
NoOfProbes = model.noOfProbes,
|
|
|
|
|
TempSet = model.temperature.HasValue ? model.temperature.Value.ToString() : "",
|
|
|
|
|
Vent = model.ventilation,
|
|
|
|
|
Humidity = model.humidity,
|
|
|
|
|
CommodityCodeType = model.commodityCodeType,
|
|
|
|
|
GoodsCode = model.commodityCode,
|
|
|
|
|
GoodsName = model.commodityName,
|
|
|
|
|
CargoType = model.cargoType,
|
|
|
|
|
PlaceReceiptCountryCode = model.placeOfReceiptCountryCode,
|
|
|
|
|
PlaceDeliveryCountryCode = model.placeOfDeliveryCountryCode,
|
|
|
|
|
EstSailingDays = model.EstSailingDays,
|
|
|
|
|
PriceReferenceId = model.priceReferenceId,
|
|
|
|
|
PriceReferenceName = model.priceReferenceName,
|
|
|
|
|
PriceOwnerReferenceId = !string.IsNullOrWhiteSpace(model.priceOwnerReferenceId) ? long.Parse(model.priceOwnerReferenceId) : null,
|
|
|
|
|
PriceOwnerReference = model.priceOwnerReference,
|
|
|
|
|
PriceOwnerReferenceName = model.priceOwnerReferenceName,
|
|
|
|
|
IsReefer = model.isReefer,
|
|
|
|
|
IsShipperOwner = model.isShipperOwned,
|
|
|
|
|
IsImportReturned = model.isImportReturned,
|
|
|
|
|
CarrierProductId = model.carrierProductId,
|
|
|
|
|
IsSendNoSchedule = model.isSendNoSchedule,
|
|
|
|
|
PlaceReceiptCountryName = model.placeOfReceiptCountryName,
|
|
|
|
|
PlaceReceiptRegionName = model.placeOfReceiptRegionName,
|
|
|
|
|
PlaceDeliveryRegionName = model.placeOfDeliveryRegionName,
|
|
|
|
|
PlaceDeliveryCountryName = model.userPlaceOfDeliveryCountryName,
|
|
|
|
|
ShipRatePId = model.PId,
|
|
|
|
|
ShipRateMD5 = model.MD5,
|
|
|
|
|
PlaceReceiptGeoId = model.carrierCollectionOriginGeoID,
|
|
|
|
|
PlaceDeliveryGeoId = model.carrierDeliveryDestinationGeoID,
|
|
|
|
|
PriceId = model.priceID,
|
|
|
|
|
ShipRateTotalAmount = model.ShipRateTotalAmount,
|
|
|
|
|
ShipRateTotalCurrency = model.ShipRateTotalCurrency
|
|
|
|
|
};
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
entity.CreateTime = nowDate;
|
|
|
|
|
entity.UpdateTime = nowDate;
|
|
|
|
|
entity.CreateBy = long.Parse(user.UserId);
|
|
|
|
|
//entity.CreatedUserName = UserManager.Name;
|
|
|
|
|
entity.CreateUserName = user.UserName;
|
|
|
|
|
entity.Status = "TEMP";
|
|
|
|
|
entity.StatusName = "暂存";
|
|
|
|
|
entity.CtnStat = ctnStat;
|
|
|
|
@ -1699,7 +1905,7 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
ctnEntity.CreateTime = nowDate;
|
|
|
|
|
ctnEntity.UpdateTime = nowDate;
|
|
|
|
|
ctnEntity.CreateBy = long.Parse(user.UserId);
|
|
|
|
|
//ctnEntity.CreatedUserName = UserManager.Name;
|
|
|
|
|
ctnEntity.CreateUserName = user.UserName;
|
|
|
|
|
ctnEntity.StuffingMeasurementType = "WEIGHT";
|
|
|
|
|
ctnEntity.StuffingMeasurementUnit = "KGS";
|
|
|
|
|
|
|
|
|
@ -1721,7 +1927,7 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
CreateTime = nowDate,
|
|
|
|
|
UpdateTime = nowDate,
|
|
|
|
|
CreateBy = long.Parse(user.UserId),
|
|
|
|
|
//CreatedUserName = UserManager.Name
|
|
|
|
|
CreateUserName = user.UserName
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
await tenantDb.Insertable<SpaceBookingOrderShipSchedule>(shipScheduleRecord).ExecuteCommandAsync();
|
|
|
|
@ -1732,17 +1938,18 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
//只有船期发生变化时才重新写入新的船期记录
|
|
|
|
|
if (model.PId != shipScheduleRecord.ShipRatePid.Value)
|
|
|
|
|
{
|
|
|
|
|
//_logger.LogInformation($"MSK CON id={model.id} 换了船期 原记录:{selectedShipSchedule.PId} 新记录:{model.PId} 作废原船期,插入新船期");
|
|
|
|
|
Logger.Log(NLog.LogLevel.Info, $"MSK CON id={model.id} 换了船期 原记录:{selectedShipSchedule.PId} 新记录:{model.PId} 作废原船期,插入新船期");
|
|
|
|
|
|
|
|
|
|
shipScheduleRecord.Deleted = true;
|
|
|
|
|
shipScheduleRecord.DeleteTime = nowDate;
|
|
|
|
|
shipScheduleRecord.DeleteBy = long.Parse(user.UserId);
|
|
|
|
|
//shipScheduleRecord.UpdatedUserName = UserManager.Name;
|
|
|
|
|
shipScheduleRecord.DeleteUserName = user.UserName;
|
|
|
|
|
|
|
|
|
|
await tenantDb.Updateable<SpaceBookingOrderShipSchedule>(shipScheduleRecord).UpdateColumns(x => new {
|
|
|
|
|
x.Deleted,
|
|
|
|
|
x.DeleteTime,
|
|
|
|
|
x.DeleteBy,
|
|
|
|
|
x.DeleteUserName
|
|
|
|
|
//x.UpdatedTime
|
|
|
|
|
}).ExecuteCommandAsync();
|
|
|
|
|
|
|
|
|
@ -1756,14 +1963,14 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
CreateTime = nowDate,
|
|
|
|
|
UpdateTime = nowDate,
|
|
|
|
|
CreateBy = long.Parse(user.UserId),
|
|
|
|
|
//CreatedUserName = UserManager.Name
|
|
|
|
|
CreateUserName = user.UserName
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
await tenantDb.Insertable<SpaceBookingOrderShipSchedule>(shipScheduleRecord).ExecuteCommandAsync();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
//_logger.LogInformation($"MSK CON id={model.id} 船期没变化 model.PId={model.PId} shipScheduleRecord.SHIP_RATE_PID={shipScheduleRecord.SHIP_RATE_PID.Value}");
|
|
|
|
|
Logger.Log(NLog.LogLevel.Info, $"MSK CON id={model.id} 船期没变化 model.PId={model.PId} shipScheduleRecord.SHIP_RATE_PID={shipScheduleRecord.ShipRatePid.Value}");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1790,7 +1997,7 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
info.Deleted = true;
|
|
|
|
|
info.DeleteTime = DateTime.Now;
|
|
|
|
|
info.DeleteBy = long.Parse(user.UserId);
|
|
|
|
|
//info.UpdatedUserName = UserManager.Name;
|
|
|
|
|
info.UpdateUserName = user.UserName;
|
|
|
|
|
|
|
|
|
|
await tenantDb.Updateable<SpaceBookingOrder>(info).UpdateColumns(x => new {
|
|
|
|
|
x.Deleted,
|
|
|
|
@ -1878,20 +2085,24 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
/// <returns>返回执行结果消息</returns>
|
|
|
|
|
public async Task<DataResult<string>> BatchCopy(MSKAPISPOTBookingCopyDto model)
|
|
|
|
|
{
|
|
|
|
|
//if (model.copyNum < 1)
|
|
|
|
|
// throw Oops.Oh($"复制数量不能小于1");
|
|
|
|
|
//复制数量不能小于1
|
|
|
|
|
if (model.copyNum < 1)
|
|
|
|
|
throw new Exception(MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.SpaceBookingAPICopyLowNum)));
|
|
|
|
|
|
|
|
|
|
//if (model.copyNum > 1000)
|
|
|
|
|
// throw Oops.Oh($"复制数量不能大于1000");
|
|
|
|
|
//复制数量不能大于1000
|
|
|
|
|
if (model.copyNum > 1000)
|
|
|
|
|
throw new Exception(MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.SpaceBookingAPICopyLimitNum)));
|
|
|
|
|
|
|
|
|
|
//if (string.IsNullOrWhiteSpace(model.opType))
|
|
|
|
|
// throw Oops.Oh($"请求的操作类型不能为空");
|
|
|
|
|
//请求的操作类型不能为空
|
|
|
|
|
if (string.IsNullOrWhiteSpace(model.opType))
|
|
|
|
|
throw new Exception(MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.SpaceBookingAPIOpTypeNull)));
|
|
|
|
|
|
|
|
|
|
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
|
|
|
|
|
var entity = await tenantDb.Queryable<SpaceBookingOrder>().FirstAsync(a => a.Id == model.originalId);
|
|
|
|
|
|
|
|
|
|
//if (entity == null)
|
|
|
|
|
// throw Oops.Oh($"获取马士基API订舱详情失败,不存在或已作废");
|
|
|
|
|
//预订舱数据不存在或已作废
|
|
|
|
|
if (entity == null)
|
|
|
|
|
throw new Exception(MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.SpaceBookingRecordDeletedOrNoExists)));
|
|
|
|
|
|
|
|
|
|
var ctnList = tenantDb.Queryable<SpaceBookingOrderCtn>()
|
|
|
|
|
.Where(a => a.RecordId == model.originalId && a.Deleted == false).ToList();
|
|
|
|
@ -1900,7 +2111,7 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
|
|
|
|
|
DateTime nowDate = DateTime.Now;
|
|
|
|
|
|
|
|
|
|
//_logger.LogInformation("获取到批量复制功能");
|
|
|
|
|
Logger.Log(NLog.LogLevel.Info, "获取到批量复制功能");
|
|
|
|
|
|
|
|
|
|
//如果是指定的编辑信息需要先把编辑数据同步到实体类,再进行复制
|
|
|
|
|
if (model.opType == "copy_edit")
|
|
|
|
@ -1920,14 +2131,14 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
{
|
|
|
|
|
CtnCode = ctn.ctnCode,
|
|
|
|
|
CtnName = ctn.ctnName,
|
|
|
|
|
CtnNum = ctn.ctnNum.Value,
|
|
|
|
|
CtnNum = ctn.ctnNum.HasValue? ctn.ctnNum.Value:0,
|
|
|
|
|
CtnSufferWeight = (int)ctn.ctnSufferWeight.Value,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
ctnEntity.CreateTime = nowDate;
|
|
|
|
|
ctnEntity.UpdateTime = nowDate;
|
|
|
|
|
ctnEntity.CreateBy = long.Parse(user.UserId);
|
|
|
|
|
//ctnEntity.CreatedUserName = UserManager.Name;
|
|
|
|
|
ctnEntity.CreateUserName = user.UserName;
|
|
|
|
|
ctnEntity.StuffingMeasurementType = "WEIGHT";
|
|
|
|
|
ctnEntity.StuffingMeasurementUnit = "KGS";
|
|
|
|
|
|
|
|
|
@ -1940,7 +2151,7 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
entity.CreateTime = nowDate;
|
|
|
|
|
entity.UpdateTime = nowDate;
|
|
|
|
|
entity.CreateBy = long.Parse(user.UserId);
|
|
|
|
|
//entity.CreatedUserName = UserManager.Name;
|
|
|
|
|
entity.CreateUserName = user.UserName;
|
|
|
|
|
entity.Status = "TEMP";
|
|
|
|
|
entity.StatusName = "暂存";
|
|
|
|
|
entity.CtnStat = ctnStat;
|
|
|
|
@ -1968,10 +2179,11 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
{
|
|
|
|
|
var copyEntity = entity.Adapt<SpaceBookingOrder>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
copyEntity.Id = 0;
|
|
|
|
|
copyEntity.CreateTime = nowDate;
|
|
|
|
|
copyEntity.CreateBy = long.Parse(user.UserId);
|
|
|
|
|
//copyEntity.CreatedUserName = UserManager.Name;
|
|
|
|
|
copyEntity.CreateUserName = user.UserName;
|
|
|
|
|
copyEntity.UpdateTime = nowDate;
|
|
|
|
|
copyEntity.Status = "TEMP";
|
|
|
|
|
copyEntity.StatusName = "暂存";
|
|
|
|
@ -1998,7 +2210,7 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
ctnEntity.CreateTime = nowDate;
|
|
|
|
|
ctnEntity.UpdateTime = nowDate;
|
|
|
|
|
ctnEntity.CreateBy = long.Parse(user.UserId);
|
|
|
|
|
//ctnEntity.CreatedUserName = UserManager.Name;
|
|
|
|
|
ctnEntity.CreateUserName = user.UserName;
|
|
|
|
|
|
|
|
|
|
await tenantDb.Insertable<SpaceBookingOrderCtn>(ctnEntity).ExecuteReturnEntityAsync();
|
|
|
|
|
});
|
|
|
|
@ -2019,7 +2231,7 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
CreateTime = nowDate,
|
|
|
|
|
UpdateTime = nowDate,
|
|
|
|
|
CreateBy = long.Parse(user.UserId),
|
|
|
|
|
//CreatedUserName = UserManager.Name
|
|
|
|
|
CreateUserName = user.UserName
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
await tenantDb.Insertable<SpaceBookingOrderShipSchedule>(shipScheduleRecord).ExecuteReturnEntityAsync();
|
|
|
|
@ -2060,7 +2272,7 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
model.LstRecvBCDate = nowDate;
|
|
|
|
|
model.UpdateTime = nowDate;
|
|
|
|
|
model.UpdateBy = long.Parse(user.UserId);
|
|
|
|
|
//model.UpdatedUserName = UserManager.Name;
|
|
|
|
|
model.UpdateUserName = user.UserName;
|
|
|
|
|
|
|
|
|
|
await tenantDb.Updateable<SpaceBookingOrder>(model).UpdateColumns(x => new
|
|
|
|
|
{
|
|
|
|
@ -2068,7 +2280,7 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
x.LstRecvBCDate,
|
|
|
|
|
x.UpdateTime,
|
|
|
|
|
x.UpdateBy,
|
|
|
|
|
//x.UpdatedUserName
|
|
|
|
|
x.UpdateUserName
|
|
|
|
|
}).ExecuteCommandAsync();
|
|
|
|
|
}
|
|
|
|
|
else if (opTypeName == "Cancellation")
|
|
|
|
@ -2077,7 +2289,7 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
model.LstRecvBKCancelDate = nowDate;
|
|
|
|
|
model.UpdateTime = nowDate;
|
|
|
|
|
model.UpdateBy = long.Parse(user.UserId);
|
|
|
|
|
//model.UpdatedUserName = UserManager.Name;
|
|
|
|
|
model.UpdateUserName = user.UserName;
|
|
|
|
|
|
|
|
|
|
await tenantDb.Updateable<SpaceBookingOrder>(model).UpdateColumns(x => new
|
|
|
|
|
{
|
|
|
|
@ -2085,7 +2297,7 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
x.LstRecvBKCancelDate,
|
|
|
|
|
x.UpdateTime,
|
|
|
|
|
x.UpdateBy,
|
|
|
|
|
//x.UpdatedUserName
|
|
|
|
|
x.UpdateUserName
|
|
|
|
|
}).ExecuteCommandAsync();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|