|
|
|
@ -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
|
|
|
|
|
{
|
|
|
|
@ -74,7 +76,7 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
private readonly ICodePortService _codePortService;
|
|
|
|
|
private readonly IMappingPortService _mappingPortService;
|
|
|
|
|
private readonly ICodeCountryService _codeCountryService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private readonly string bcCompareUrl;
|
|
|
|
@ -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,9 +192,9 @@ 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)
|
|
|
|
|
{
|
|
|
|
|
foreach (var ctn in input.CtnList)
|
|
|
|
@ -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")
|
|
|
|
|
{
|
|
|
|
@ -946,7 +1063,7 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
portCodeList = allPortCodeList.Data;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var portInfo = await PlaceDeliveryToPort(portEnName, portCodeList, () => _mappingPortService.GetAllList());
|
|
|
|
|
|
|
|
|
|
if (portInfo.Succeeded)
|
|
|
|
@ -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);
|
|
|
|
|
|
|
|
|
@ -970,12 +1087,12 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
dto.DataObj.PortDischargeId = portInfo.Data.EdiCode;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Logger.Log(NLog.LogLevel.Info, $"交货地分割后得到的城市名称为空,订舱编号:{ dto.DataObj.SlotBookingNo}");
|
|
|
|
|
Logger.Log(NLog.LogLevel.Info, $"交货地分割后得到的城市名称为空,订舱编号:{dto.DataObj.SlotBookingNo}");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
@ -1106,7 +1223,7 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
|
|
|
|
|
//提取箱信息
|
|
|
|
|
var ctnList = tenantDb.Queryable<BookingSlotCtn>()
|
|
|
|
|
.Where(x => x.SlotId == model.Id).ToList();
|
|
|
|
|
.Where(x => x.SlotId == model.Id).ToList();
|
|
|
|
|
|
|
|
|
|
if (ctnList != null)
|
|
|
|
|
{
|
|
|
|
@ -1178,8 +1295,8 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
{
|
|
|
|
|
await tenantDb.Deleteable<BookingSlotCtn>(p).ExecuteCommandAsync();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
foreach (var ctn in dto.DataObj.CtnList)
|
|
|
|
|
{
|
|
|
|
|
var newCtn = ctn.Adapt<BookingSlotCtn>();
|
|
|
|
@ -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);
|
|
|
|
@ -1369,7 +1486,7 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
|
|
|
|
|
if (string.IsNullOrEmpty(portEnName))
|
|
|
|
|
{
|
|
|
|
|
return DataResult<CodePortRes>.FailedData(portInfo);
|
|
|
|
|
return DataResult<CodePortRes>.FailedData(portInfo);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 匹配方式1:精准匹配
|
|
|
|
@ -1703,7 +1820,7 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
.Select(a => string.Format(MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.BookingSlotMergeCheckPartRecordNoConsistentFail)), string.Join(",", a.Select(b => b.SlotBookingNo).ToArray()), a.Key)).ToArray());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 查询可用舱位及箱子列表
|
|
|
|
|
return rlt;
|
|
|
|
|
}
|
|
|
|
@ -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)
|
|
|
|
|
{
|
|
|
|
@ -2056,7 +2173,7 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
{
|
|
|
|
|
carrierInfo = allMapCarrierList.Data.FirstOrDefault(t => t.LinkId == bookingSlotBase.CarrierId.Value && t.Module == CONST_MAPPING_CARRIER_MODULE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var custNo = bookingSlotBase.SlotBookingNo.Trim();
|
|
|
|
|
|
|
|
|
|
SeaExportReq bkModel = new SeaExportReq
|
|
|
|
@ -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,
|
|
|
|
@ -2447,10 +2565,10 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
.Ignore(dest => dest.UpdateTime)
|
|
|
|
|
.Ignore(dest => dest.CreateBy)
|
|
|
|
|
.Ignore(dest => dest.UpdateBy);
|
|
|
|
|
//.Ignore(dest => dest.CreatedUserName)
|
|
|
|
|
//.Ignore(dest => dest.UpdatedUserName)
|
|
|
|
|
//.Ignore(dest => dest.TenantId)
|
|
|
|
|
//.Ignore(dest => dest.TenantName);
|
|
|
|
|
//.Ignore(dest => dest.CreatedUserName)
|
|
|
|
|
//.Ignore(dest => dest.UpdatedUserName)
|
|
|
|
|
//.Ignore(dest => dest.TenantId)
|
|
|
|
|
//.Ignore(dest => dest.TenantName);
|
|
|
|
|
|
|
|
|
|
var newSlotAllocation = latestSlot.Adapt<BookingSlotAllocation>(config);
|
|
|
|
|
newSlotAllocation.Id = 0;
|
|
|
|
@ -2512,14 +2630,14 @@ 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,
|
|
|
|
|
PortLoadId = latestSlot.PortLoadCode,
|
|
|
|
|
PortDischargeId = latestSlot.PortLoadCode,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
finally
|
|
|
|
@ -2599,7 +2717,7 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
var model = tenantDb.Queryable<BookingSlotBase>().First(x => x.SlotBookingNo == slotBookingNo && x.CarrierCode == CarrierId);
|
|
|
|
|
|
|
|
|
|
//if (model == null)
|
|
|
|
|
//throw Oops.Bah("舱位信息不存在");
|
|
|
|
|
//throw Oops.Bah("舱位信息不存在");
|
|
|
|
|
|
|
|
|
|
id = model.Id;
|
|
|
|
|
}
|
|
|
|
@ -2627,7 +2745,7 @@ namespace DS.WMS.Core.Op.Method
|
|
|
|
|
var result = tenantDb.Queryable<BookingSlotStock>()
|
|
|
|
|
.Select<BookingSlotStockDto>()
|
|
|
|
|
.Where(whereList);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var list = result.ToList();
|
|
|
|
|
|
|
|
|
|
return await result.ToQueryPageAsync(querySearch.PageCondition);
|
|
|
|
|