|
|
@ -652,7 +652,7 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
|
|
|
|
|
|
|
bookingDto.bookingBody.transport = new MSKAPIBookingTransport
|
|
|
|
bookingDto.bookingBody.transport = new MSKAPIBookingTransport
|
|
|
|
{
|
|
|
|
{
|
|
|
|
carrierCode = model.carrierCode,
|
|
|
|
carrierCode = model.vesselCarrierCode,
|
|
|
|
earliestDepartureDate = model.earliestDepartureDate.Value.ToString("yyyy-MM-ddTHH:mm:ss"),
|
|
|
|
earliestDepartureDate = model.earliestDepartureDate.Value.ToString("yyyy-MM-ddTHH:mm:ss"),
|
|
|
|
exportServiceMode = model.exportServiceMode,
|
|
|
|
exportServiceMode = model.exportServiceMode,
|
|
|
|
importServiceMode = model.importServiceMode,
|
|
|
|
importServiceMode = model.importServiceMode,
|
|
|
@ -1416,8 +1416,8 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
placeOfReceiptCountryCode = entity.PlaceReceiptCountryCode,
|
|
|
|
placeOfReceiptCountryCode = entity.PlaceReceiptCountryCode,
|
|
|
|
placeOfDeliveryCountryCode = entity.PlaceDeliveryCountryCode,
|
|
|
|
placeOfDeliveryCountryCode = entity.PlaceDeliveryCountryCode,
|
|
|
|
EstSailingDays = entity.EstSailingDays,
|
|
|
|
EstSailingDays = entity.EstSailingDays,
|
|
|
|
priceReferenceId = entity.PriceOwnerReferenceId,
|
|
|
|
priceReferenceId = entity.PriceReferenceId,
|
|
|
|
priceReferenceName = entity.PriceOwnerReference,
|
|
|
|
priceReferenceName = entity.PriceReferenceName,
|
|
|
|
priceOwnerReferenceId = entity.PriceOwnerReferenceId.HasValue? entity.PriceOwnerReferenceId.Value.ToString():"",
|
|
|
|
priceOwnerReferenceId = entity.PriceOwnerReferenceId.HasValue? entity.PriceOwnerReferenceId.Value.ToString():"",
|
|
|
|
priceOwnerReference = entity.PriceOwnerReference,
|
|
|
|
priceOwnerReference = entity.PriceOwnerReference,
|
|
|
|
priceOwnerReferenceName = entity.PriceOwnerReferenceName,
|
|
|
|
priceOwnerReferenceName = entity.PriceOwnerReferenceName,
|
|
|
@ -1434,7 +1434,7 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
bookingChannelTypeName = entity.BookingChannelType,
|
|
|
|
bookingChannelTypeName = entity.BookingChannelType,
|
|
|
|
bookingChannelType = entity.BookingChannelTypeName,
|
|
|
|
bookingChannelType = entity.BookingChannelTypeName,
|
|
|
|
carrierCollectionOriginGeoID = entity.PlaceReceiptGeoId,
|
|
|
|
carrierCollectionOriginGeoID = entity.PlaceReceiptGeoId,
|
|
|
|
carrierDeliveryDestinationGeoID = entity.PlaceDeliveryGeoId
|
|
|
|
carrierDeliveryDestinationGeoID = entity.PlaceDeliveryGeoId,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
var ctnList = tenantDb.Queryable<SpaceBookingOrderCtn>().Where(a => a.RecordId == id && a.Deleted == false).ToList();
|
|
|
|
var ctnList = tenantDb.Queryable<SpaceBookingOrderCtn>().Where(a => a.RecordId == id && a.Deleted == false).ToList();
|
|
|
@ -1671,7 +1671,13 @@ 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.Id = ctn.id.Value;
|
|
|
|
ctnEntity.RecordId = entity.Id;
|
|
|
|
ctnEntity.RecordId = entity.Id;
|
|
|
@ -2031,20 +2037,24 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
/// <returns>返回执行结果消息</returns>
|
|
|
|
/// <returns>返回执行结果消息</returns>
|
|
|
|
public async Task<DataResult<string>> BatchCopy(MSKAPIBookingCopyDto model)
|
|
|
|
public async Task<DataResult<string>> BatchCopy(MSKAPIBookingCopyDto model)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//if (model.copyNum < 1)
|
|
|
|
//复制数量不能小于1
|
|
|
|
// throw Oops.Oh($"复制数量不能小于1");
|
|
|
|
if (model.copyNum < 1)
|
|
|
|
|
|
|
|
throw new Exception(MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.SpaceBookingAPICopyLowNum)));
|
|
|
|
|
|
|
|
|
|
|
|
//if (model.copyNum > 1000)
|
|
|
|
//复制数量不能大于1000
|
|
|
|
// throw Oops.Oh($"复制数量不能大于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 tenantDb = saasService.GetBizDbScopeById(user.TenantId);
|
|
|
|
var entity = await tenantDb.Queryable<SpaceBookingOrder>().FirstAsync(a => a.Id == model.originalId);
|
|
|
|
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>()
|
|
|
|
var ctnList = tenantDb.Queryable<SpaceBookingOrderCtn>()
|
|
|
|
.Where(a => a.RecordId == model.originalId && a.Deleted == false).ToList();
|
|
|
|
.Where(a => a.RecordId == model.originalId && a.Deleted == false).ToList();
|
|
|
@ -2053,7 +2063,7 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
|
|
|
|
|
|
|
DateTime nowDate = DateTime.Now;
|
|
|
|
DateTime nowDate = DateTime.Now;
|
|
|
|
|
|
|
|
|
|
|
|
//_logger.LogInformation("获取到批量复制功能");
|
|
|
|
Logger.Log(NLog.LogLevel.Info, "获取到批量复制功能");
|
|
|
|
|
|
|
|
|
|
|
|
//如果是指定的编辑信息需要先把编辑数据同步到实体类,再进行复制
|
|
|
|
//如果是指定的编辑信息需要先把编辑数据同步到实体类,再进行复制
|
|
|
|
if (model.opType == "copy_edit")
|
|
|
|
if (model.opType == "copy_edit")
|
|
|
@ -2073,14 +2083,14 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CtnCode = ctn.ctnCode,
|
|
|
|
CtnCode = ctn.ctnCode,
|
|
|
|
CtnName = ctn.ctnName,
|
|
|
|
CtnName = ctn.ctnName,
|
|
|
|
CtnNum = ctn.ctnNum.Value,
|
|
|
|
CtnNum = ctn.ctnNum.HasValue? ctn.ctnNum.Value:0,
|
|
|
|
CtnSufferWeight = (int)ctn.ctnSufferWeight.Value,
|
|
|
|
CtnSufferWeight = (int)ctn.ctnSufferWeight.Value,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
ctnEntity.CreateTime = nowDate;
|
|
|
|
ctnEntity.CreateTime = nowDate;
|
|
|
|
ctnEntity.UpdateTime = nowDate;
|
|
|
|
ctnEntity.UpdateTime = nowDate;
|
|
|
|
ctnEntity.CreateBy = long.Parse(user.UserId);
|
|
|
|
ctnEntity.CreateBy = long.Parse(user.UserId);
|
|
|
|
//ctnEntity.CreatedUserName = UserManager.Name;
|
|
|
|
ctnEntity.CreateUserName = user.UserName;
|
|
|
|
ctnEntity.StuffingMeasurementType = "WEIGHT";
|
|
|
|
ctnEntity.StuffingMeasurementType = "WEIGHT";
|
|
|
|
ctnEntity.StuffingMeasurementUnit = "KGS";
|
|
|
|
ctnEntity.StuffingMeasurementUnit = "KGS";
|
|
|
|
|
|
|
|
|
|
|
@ -2093,7 +2103,7 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
entity.CreateTime = nowDate;
|
|
|
|
entity.CreateTime = nowDate;
|
|
|
|
entity.UpdateTime = nowDate;
|
|
|
|
entity.UpdateTime = nowDate;
|
|
|
|
entity.CreateBy = long.Parse(user.UserId);
|
|
|
|
entity.CreateBy = long.Parse(user.UserId);
|
|
|
|
//entity.CreatedUserName = UserManager.Name;
|
|
|
|
entity.CreateUserName = user.UserName;
|
|
|
|
entity.Status = "TEMP";
|
|
|
|
entity.Status = "TEMP";
|
|
|
|
entity.StatusName = "暂存";
|
|
|
|
entity.StatusName = "暂存";
|
|
|
|
entity.CtnStat = ctnStat;
|
|
|
|
entity.CtnStat = ctnStat;
|
|
|
@ -2110,7 +2120,7 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
copyEntity.Id = 0;
|
|
|
|
copyEntity.Id = 0;
|
|
|
|
copyEntity.CreateTime = nowDate;
|
|
|
|
copyEntity.CreateTime = nowDate;
|
|
|
|
copyEntity.CreateBy = long.Parse(user.UserId);
|
|
|
|
copyEntity.CreateBy = long.Parse(user.UserId);
|
|
|
|
//copyEntity.CreatedUserName = UserManager.Name;
|
|
|
|
copyEntity.CreateUserName = user.UserName;
|
|
|
|
copyEntity.UpdateTime = nowDate;
|
|
|
|
copyEntity.UpdateTime = nowDate;
|
|
|
|
copyEntity.Status = "TEMP";
|
|
|
|
copyEntity.Status = "TEMP";
|
|
|
|
copyEntity.StatusName = "暂存";
|
|
|
|
copyEntity.StatusName = "暂存";
|
|
|
@ -2137,7 +2147,7 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
ctnEntity.CreateTime = nowDate;
|
|
|
|
ctnEntity.CreateTime = nowDate;
|
|
|
|
ctnEntity.UpdateTime = nowDate;
|
|
|
|
ctnEntity.UpdateTime = nowDate;
|
|
|
|
ctnEntity.CreateBy = long.Parse(user.UserId);
|
|
|
|
ctnEntity.CreateBy = long.Parse(user.UserId);
|
|
|
|
//ctnEntity.CreatedUserName = UserManager.Name;
|
|
|
|
ctnEntity.CreateUserName = user.UserName;
|
|
|
|
|
|
|
|
|
|
|
|
await tenantDb.Insertable<SpaceBookingOrderCtn>(ctnEntity).ExecuteReturnEntityAsync();
|
|
|
|
await tenantDb.Insertable<SpaceBookingOrderCtn>(ctnEntity).ExecuteReturnEntityAsync();
|
|
|
|
});
|
|
|
|
});
|
|
|
|