新增BookingAmendment任务写入

optimize
jianghaiqing 10 months ago
parent c2c99d37ec
commit efd31af347

@ -125,5 +125,11 @@ namespace Myshipping.Application
/// </summary> /// </summary>
[Description("派车")] [Description("派车")]
TRUCK_DISPATCH, TRUCK_DISPATCH,
/// <summary>
/// Booking Amendment
/// </summary>
[Description("BC变更")]
BC_MODIFY
} }
} }

@ -23,6 +23,16 @@ namespace Myshipping.Application
[Description("Booking Confirmation Notice")] [Description("Booking Confirmation Notice")]
BC_NOTICE, BC_NOTICE,
/// <summary> /// <summary>
/// Booking Confirmation
/// </summary>
[Description("Booking Amendment")]
BC_MODIFY,
/// <summary>
/// Booking Confirmation通知
/// </summary>
[Description("Booking Amendment Notice")]
BC_MODIFY_NOTICE,
/// <summary>
/// 空 /// 空
/// </summary> /// </summary>
[Description("NONE")] [Description("NONE")]

@ -58,6 +58,12 @@ namespace Myshipping.Application
const string CONST_BC_NOTICE_FILE_CODE = "bc_notice"; const string CONST_BC_NOTICE_FILE_CODE = "bc_notice";
const string CONST_BC_NOTICE_FILE_NAME = "Booking Confirmation Notice"; const string CONST_BC_NOTICE_FILE_NAME = "Booking Confirmation Notice";
const string CONST_BC_MODIFY_FILE_CODE = "bc_modify";
const string CONST_BC_MODIFY_FILE_NAME = "Booking Amendment";
const string CONST_BC_MODIFY_NOTICE_FILE_CODE = "bc_moidfynotice";
const string CONST_BC_MODIFY_NOTICE_FILE_NAME = "Booking Amendment Notice";
public BookingSlotService(SqlSugarRepository<BookingSlotBase> repBase, public BookingSlotService(SqlSugarRepository<BookingSlotBase> repBase,
SqlSugarRepository<BookingSlotCtn> repCtn, SqlSugarRepository<BookingSlotCtn> repCtn,
SqlSugarRepository<BookingSlotStock> repStock, SqlSugarRepository<BookingSlotStock> repStock,
@ -368,6 +374,41 @@ namespace Myshipping.Application
} }
await InsLog("Update", model.Id, typeof(BookingSlotBaseApiSaveDto), oldObj, dto.DataObj, "CtnList"); await InsLog("Update", model.Id, typeof(BookingSlotBaseApiSaveDto), oldObj, dto.DataObj, "CtnList");
string batchNo = IDGen.NextID().ToString();
//处理附件
if (file != null)
{
_logger.LogInformation($"请求文件名:{file.FileName}");
var fileFullPath = await FileAttachHelper.SaveFileDirect(model.Id.ToString(), file.FileBytes, batchNo, file.FileName, "bcmoidfyfiles");
_logger.LogInformation($"保存文件路径:{fileFullPath}");
if (!string.IsNullOrWhiteSpace(fileFullPath))
{
//将格式单附件写入订舱的附件
SaveEDIFile(id, fileFullPath, file.FileName, UserManager.TENANT_ID,
CONST_BC_MODIFY_FILE_CODE, CONST_BC_MODIFY_FILE_NAME).GetAwaiter();
}
}
if (modifyFile != null)
{
_logger.LogInformation($"请求文件名(变更文件):{modifyFile.FileName}");
var fileFullPath = await FileAttachHelper.SaveFileDirect(model.Id.ToString(), modifyFile.FileBytes, batchNo, modifyFile.FileName, "bcmoidfynoticefiles");
_logger.LogInformation($"保存文件路径(变更文件):{fileFullPath}");
if (!string.IsNullOrWhiteSpace(fileFullPath))
{
//将格式单附件写入订舱的附件
SaveEDIFile(id, fileFullPath, modifyFile.FileName, UserManager.TENANT_ID,
CONST_BC_MODIFY_NOTICE_FILE_CODE, CONST_BC_MODIFY_NOTICE_FILE_NAME).GetAwaiter();
}
}
} }
else if (dto.OpType == "del") else if (dto.OpType == "del")
{ {

@ -433,6 +433,11 @@ namespace Myshipping.Application
fileInfo.FILE_CATEGORY = TaskFileCategoryEnum.BC.ToString(); fileInfo.FILE_CATEGORY = TaskFileCategoryEnum.BC.ToString();
fileInfo.FILE_CATEGORY_NAME = TaskFileCategoryEnum.BC.GetDescription(); fileInfo.FILE_CATEGORY_NAME = TaskFileCategoryEnum.BC.GetDescription();
} }
else if (TaskBaseTypeEnum.BC_MODIFY.ToString() == taskInfo.TASK_BASE_TYPE)
{
fileInfo.FILE_CATEGORY = TaskFileCategoryEnum.BC_MODIFY.ToString();
fileInfo.FILE_CATEGORY_NAME = TaskFileCategoryEnum.BC_MODIFY.GetDescription();
}
} }
else else
{ {
@ -660,7 +665,7 @@ namespace Myshipping.Application
#endregion #endregion
#region BC 任务 #region BC 任务
if (info.Main.TaskType == TaskBaseTypeEnum.BC) if (info.Main.TaskType == TaskBaseTypeEnum.BC || info.Main.TaskType == TaskBaseTypeEnum.BC_MODIFY)
{ {
//异步写入 //异步写入
var bcInfo = info.Main.BCInfo.Adapt<TaskBCInfo>(); var bcInfo = info.Main.BCInfo.Adapt<TaskBCInfo>();
@ -680,7 +685,7 @@ namespace Myshipping.Application
bcInfo.BOOKING_SLOT_ID = info.Main.BCInfo.BookingSlotId.Value; bcInfo.BOOKING_SLOT_ID = info.Main.BCInfo.BookingSlotId.Value;
await _taskBCInfoRepository.InsertAsync(bcInfo); await _taskBCInfoRepository.InsertAsync(bcInfo);
//异步写入集装箱 //异步写入集装箱
info.Main.BCInfo.CtnList.ForEach(async ctn => info.Main.BCInfo.CtnList.ForEach(async ctn =>
{ {

Loading…
Cancel
Save