|
|
|
@ -48,6 +48,8 @@ using DS.WMS.Core.Code.Method;
|
|
|
|
|
using DS.WMS.Core.Map.Method;
|
|
|
|
|
using DS.Module.Core.Extensions;
|
|
|
|
|
using DS.Module.Core.Constants;
|
|
|
|
|
using DS.Module.Core.Data;
|
|
|
|
|
using DS.WMS.Core.TaskPlat.Dtos;
|
|
|
|
|
|
|
|
|
|
namespace DS.WMS.Core.Op.Method
|
|
|
|
|
{
|
|
|
|
@ -125,6 +127,7 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
_codeCtnService = _serviceProvider.GetRequiredService<ICodeCtnService>();
|
|
|
|
|
_codePortService = _serviceProvider.GetRequiredService<ICodePortService>();
|
|
|
|
|
_mappingPortService = _serviceProvider.GetRequiredService<IMappingPortService>();
|
|
|
|
|
_mappingCarrierService = _serviceProvider.GetRequiredService<IMappingCarrierService>();
|
|
|
|
|
_codeCountryService = _serviceProvider.GetRequiredService<ICodeCountryService>();
|
|
|
|
|
|
|
|
|
|
bcCompareUrl = AppSetting.app(new string[] { "BCCompare", "Url" });
|
|
|
|
@ -189,7 +192,7 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
|
|
|
|
|
var delCtnList = tenantDb.Queryable<BookingSlotCtn>().Where(x => x.SlotId == model.Id).ToList();
|
|
|
|
|
|
|
|
|
|
if(delCtnList.Count > 0)
|
|
|
|
|
if (delCtnList.Count > 0)
|
|
|
|
|
await tenantDb.Deleteable<BookingSlotCtn>(delCtnList).ExecuteCommandAsync();
|
|
|
|
|
|
|
|
|
|
if (input.CtnList != null)
|
|
|
|
@ -554,7 +557,7 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
{
|
|
|
|
|
Logger.Log(NLog.LogLevel.Error, $"自动生成舱位标签失败,原因:{e.Message}");
|
|
|
|
|
|
|
|
|
|
return DataResult<string>.Failed(string.Format(MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.BookingSlotSlotBookingNoExists)),e.Message));
|
|
|
|
|
return DataResult<string>.Failed(string.Format(MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.BookingSlotSlotBookingNoExists)), e.Message));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return DataResult<string>.Success(string.Empty);
|
|
|
|
@ -800,6 +803,118 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
|
|
|
|
|
return DataResult<long>.Success(id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 舱位接收保存、取消接口(任务台使用)
|
|
|
|
|
/// </summary>
|
|
|
|
|
public async Task<DataResult<long>> ApiReceiveTask(TaskFlowDataContext dataContext)
|
|
|
|
|
{
|
|
|
|
|
var a = user.UserId;
|
|
|
|
|
var b = user.UserName;
|
|
|
|
|
var c = user.TenantId;
|
|
|
|
|
var messageInfo = dataContext.Get<TaskManageOrderMessageInfo>(TaskFlowDataNameConst.TaskManageOrderMessageInfo);
|
|
|
|
|
if (messageInfo == null)
|
|
|
|
|
{
|
|
|
|
|
throw new ArgumentNullException($"缺少参数:{TaskFlowDataNameConst.TaskManageOrderMessageInfo}");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DynameFileInfo bcFileInfo = null;
|
|
|
|
|
DynameFileInfo bcNoticeFileInfo = null;
|
|
|
|
|
|
|
|
|
|
var bcfile = dataContext.Get<IFormFile>(TaskFlowDataNameConst.BCFile);
|
|
|
|
|
if (bcfile != null)
|
|
|
|
|
{
|
|
|
|
|
bcFileInfo = new DynameFileInfo
|
|
|
|
|
{
|
|
|
|
|
FileBytes = bcfile.ToByteArray(),
|
|
|
|
|
FileName = bcfile.FileName
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var bcNoticeFile = dataContext.Get<IFormFile>(TaskFlowDataNameConst.AmendmentFile);
|
|
|
|
|
if (bcNoticeFile != null)
|
|
|
|
|
{
|
|
|
|
|
bcNoticeFileInfo = new DynameFileInfo
|
|
|
|
|
{
|
|
|
|
|
FileBytes = bcNoticeFile.ToByteArray(),
|
|
|
|
|
FileName = bcNoticeFile.FileName
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var taskBCInfoDto = messageInfo.Main.BCInfo;
|
|
|
|
|
|
|
|
|
|
var allMapCarrierList = await _mappingCarrierService.GetAllList();
|
|
|
|
|
MappingCarrierRes? carrierInfo = null;
|
|
|
|
|
|
|
|
|
|
if (allMapCarrierList.Succeeded)
|
|
|
|
|
{
|
|
|
|
|
//carrierInfo = allMapCarrierList.Data.FirstOrDefault(t => t.LinkId == taskBCInfoDto.CarrierId && t.Module == CONST_MAPPING_CARRIER_MODULE);
|
|
|
|
|
carrierInfo = allMapCarrierList.Data.Where(t => t.MapCode.Equals(taskBCInfoDto.CarrierId, StringComparison.OrdinalIgnoreCase) && t.Module == CONST_MAPPING_CARRIER_MODULE).FirstOrDefault();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BookingSlotBaseApiDto slotModel = new BookingSlotBaseApiDto
|
|
|
|
|
{
|
|
|
|
|
DataObj = new BookingSlotBaseApiSaveDto
|
|
|
|
|
{
|
|
|
|
|
CarrierId = carrierInfo?.LinkId,
|
|
|
|
|
CarrierCode = carrierInfo?.Code,
|
|
|
|
|
SlotBookingNo = taskBCInfoDto.MBLNo,
|
|
|
|
|
BookingParty = taskBCInfoDto.BookingParty,
|
|
|
|
|
BookingSlotType = taskBCInfoDto.BookingSlotType,
|
|
|
|
|
BookingSlotTypeName = taskBCInfoDto.BookingSlotTypeName,
|
|
|
|
|
Vessel = taskBCInfoDto.Vessel,
|
|
|
|
|
Voyno = taskBCInfoDto.VoyNo,
|
|
|
|
|
VGMSubmissionCutDate = taskBCInfoDto.VGMCutoffTime,
|
|
|
|
|
//WeekAt = taskBCInfoDto.WeekAt,
|
|
|
|
|
CarriageType = taskBCInfoDto.CarriageType,
|
|
|
|
|
CarriageTypeName = taskBCInfoDto.CarriageTypeName,
|
|
|
|
|
ContractNo = taskBCInfoDto.ContractNo,
|
|
|
|
|
CtnStat = taskBCInfoDto.CtnStat,
|
|
|
|
|
CYCutDate = taskBCInfoDto.CYCutoffTime,
|
|
|
|
|
DetensionFreeDays = taskBCInfoDto.DetensionFreeDays,
|
|
|
|
|
ETD = taskBCInfoDto.ETD,
|
|
|
|
|
ETA = taskBCInfoDto.ETA,
|
|
|
|
|
LaneCode = taskBCInfoDto.LaneCode,
|
|
|
|
|
LaneName = taskBCInfoDto.LaneName,
|
|
|
|
|
ManifestCutDate = taskBCInfoDto.ManifestCutDate,
|
|
|
|
|
MDGFCutDate = taskBCInfoDto.MDGFCutDate,
|
|
|
|
|
PlaceDelivery = taskBCInfoDto.PlaceDelivery,
|
|
|
|
|
PlaceReceipt = taskBCInfoDto.PlaceReceipt,
|
|
|
|
|
PortDischarge = taskBCInfoDto.PortDischarge,
|
|
|
|
|
PortLoad = taskBCInfoDto.Portload,
|
|
|
|
|
SICutDate = taskBCInfoDto.SICutDate,
|
|
|
|
|
//CustomSICutDate = taskBCInfoDto.CustomSICutDate,
|
|
|
|
|
TransferPort1 = taskBCInfoDto.TransferPort1,
|
|
|
|
|
TransferPort2 = taskBCInfoDto.TransferPort2,
|
|
|
|
|
PriceCalculationDate = taskBCInfoDto.PriceCalculationDate,
|
|
|
|
|
CtnList = new List<BookingSlotCtnSaveInput>()
|
|
|
|
|
},
|
|
|
|
|
OpType = "add"
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
if (int.TryParse(taskBCInfoDto.WeekAt, out int week))
|
|
|
|
|
{
|
|
|
|
|
slotModel.DataObj.WeekAt = week;
|
|
|
|
|
}
|
|
|
|
|
if (taskBCInfoDto.CtnList.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
taskBCInfoDto.CtnList.ForEach(t =>
|
|
|
|
|
{
|
|
|
|
|
BookingSlotCtnSaveInput ctn = new BookingSlotCtnSaveInput
|
|
|
|
|
{
|
|
|
|
|
CtnAll = t.CtnALL,
|
|
|
|
|
CtnNum = t.CTNNUM.HasValue ? t.CTNNUM.Value : 1
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
slotModel.DataObj.CtnList.Add(ctn);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var rlt = await InnerApiReceive(slotModel, bcFileInfo, bcNoticeFileInfo);
|
|
|
|
|
|
|
|
|
|
return rlt;
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 舱位接收保存、取消接口(内部接口)
|
|
|
|
@ -816,6 +931,8 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
|
|
|
|
|
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
|
|
|
|
|
|
|
|
|
|
var slotBase = await tenantDb.Queryable<BookingSlotBase>().Where(x => x.Id == 1814212362220212224).ToListAsync();
|
|
|
|
|
|
|
|
|
|
//接口方法直接调用save、delete等方法会报错,可能因为非token授权登录导致,故重写一遍保存、删除代码
|
|
|
|
|
if (dto.OpType == "add" || dto.OpType == "update" || dto.OpType == "del" || dto.OpType == "cancellation")
|
|
|
|
|
{
|
|
|
|
@ -957,7 +1074,7 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
{
|
|
|
|
|
var allCountryCodeList = await _codeCountryService.GetAllList();
|
|
|
|
|
|
|
|
|
|
if(allCountryCodeList.Succeeded)
|
|
|
|
|
if (allCountryCodeList.Succeeded)
|
|
|
|
|
{
|
|
|
|
|
var countryInfo = allCountryCodeList.Data.FirstOrDefault(p => p.Id == portInfo.Data.CountryId);
|
|
|
|
|
|
|
|
|
@ -975,7 +1092,7 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Logger.Log(NLog.LogLevel.Info, $"交货地分割后得到的城市名称为空,订舱编号:{ dto.DataObj.SlotBookingNo}");
|
|
|
|
|
Logger.Log(NLog.LogLevel.Info, $"交货地分割后得到的城市名称为空,订舱编号:{dto.DataObj.SlotBookingNo}");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
@ -1314,7 +1431,7 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(id == 0)
|
|
|
|
|
if (id == 0)
|
|
|
|
|
return DataResult<long>.FailedData(id);
|
|
|
|
|
|
|
|
|
|
return DataResult<long>.Success(id);
|
|
|
|
@ -1863,7 +1980,7 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
/// <returns>返回附件列表</returns>
|
|
|
|
|
public async Task<DataResult<List<OpFileRes>>> GetFile(long id)
|
|
|
|
|
{
|
|
|
|
|
return _opFileService.GetOpFileList(id.ToString()) ;
|
|
|
|
|
return _opFileService.GetOpFileList(id.ToString());
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
@ -1977,7 +2094,7 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
if (model.CustomerContactList != null && model.CustomerContactList.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
//取委托客户下面所有的联系人列表
|
|
|
|
|
var djyCustomerInfo = _clientInfoService.GetClientInfoWithContact(new Info.Dtos.QueryClientInfo { ClientId = model.CustomerId.Value,IsController = true }).GetAwaiter().GetResult().Data;
|
|
|
|
|
var djyCustomerInfo = _clientInfoService.GetClientInfoWithContact(new Info.Dtos.QueryClientInfo { ClientId = model.CustomerId.Value, IsController = true }).GetAwaiter().GetResult().Data;
|
|
|
|
|
|
|
|
|
|
if (djyCustomerInfo == null)
|
|
|
|
|
{
|
|
|
|
@ -2073,7 +2190,7 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
InnerVoyno = bookingSlotBase.Voyno?.ToUpper()?.Trim(),
|
|
|
|
|
ETD = bookingSlotBase.ETD,
|
|
|
|
|
ETA = bookingSlotBase.ETA,
|
|
|
|
|
SaleId = generateModel.SaleId.HasValue? generateModel.SaleId.Value:0,
|
|
|
|
|
SaleId = generateModel.SaleId.HasValue ? generateModel.SaleId.Value : 0,
|
|
|
|
|
Sale = generateModel.SaleName,
|
|
|
|
|
OperatorId = generateModel.OpId.HasValue ? generateModel.OpId.Value : 0,
|
|
|
|
|
//op = generateModel.OpName,
|
|
|
|
@ -2092,7 +2209,7 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
//CUSTSERVICE = generateModel.CustServiceName,
|
|
|
|
|
|
|
|
|
|
LoadPort = bookingSlotBase.PortLoad,
|
|
|
|
|
LoadPortId = bookingSlotBase.PortLoadId.HasValue? bookingSlotBase.PortLoadId.Value:0,
|
|
|
|
|
LoadPortId = bookingSlotBase.PortLoadId.HasValue ? bookingSlotBase.PortLoadId.Value : 0,
|
|
|
|
|
DischargePortId = bookingSlotBase.PortDischargeId.HasValue ? bookingSlotBase.PortLoadId.Value : 0,
|
|
|
|
|
DischargePort = bookingSlotBase.PortDischarge,
|
|
|
|
|
|
|
|
|
@ -2239,7 +2356,8 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
if (id > 0)
|
|
|
|
|
{
|
|
|
|
|
////对应订舱和舱位关系
|
|
|
|
|
var allocRlt = await ImportSlots(new ImportSlotsDto {
|
|
|
|
|
var allocRlt = await ImportSlots(new ImportSlotsDto
|
|
|
|
|
{
|
|
|
|
|
slots = importSlots,
|
|
|
|
|
bookingOrderId = id,
|
|
|
|
|
isCheck = false,
|
|
|
|
@ -2512,7 +2630,7 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
await _bookingSlotStockService.BookingSlotStock(new BookingSlotStockUpdateModel
|
|
|
|
|
{
|
|
|
|
|
BookingSlotType = latestSlot.BookingSlotType,
|
|
|
|
|
CarrierId = latestSlot.CarrierId.HasValue? latestSlot.CarrierId.Value:0,
|
|
|
|
|
CarrierId = latestSlot.CarrierId.HasValue ? latestSlot.CarrierId.Value : 0,
|
|
|
|
|
ContractNo = latestSlot.ContractNo,
|
|
|
|
|
Vessel = latestSlot.Vessel,
|
|
|
|
|
Voyno = latestSlot.Voyno,
|
|
|
|
|