修改BC变更增加批次号

optimize
jianghaiqing 10 months ago
parent 9bfaa14499
commit 7b079a5297

@ -49,5 +49,12 @@ namespace Myshipping.Application
[SugarColumn(ColumnName = "COMPARE_DIFF_NUM")] [SugarColumn(ColumnName = "COMPARE_DIFF_NUM")]
[Description("比对差异项数")] [Description("比对差异项数")]
public Nullable<int> COMPARE_DIFF_NUM { get; set; } public Nullable<int> COMPARE_DIFF_NUM { get; set; }
/// <summary>
/// 比对批次号
/// </summary>
[SugarColumn(ColumnName = "COMPARE_BATCHNO")]
[Description("比对批次号")]
public string COMPARE_BATCHNO { get; set; }
} }
} }

@ -346,5 +346,10 @@ namespace Myshipping.Application
/// 订舱确认时间 /// 订舱确认时间
/// </summary> /// </summary>
public Nullable<DateTime> BOOKING_COMFIRM_DATE { get; set; } public Nullable<DateTime> BOOKING_COMFIRM_DATE { get; set; }
/// <summary>
/// 批次号
/// </summary>
public string BATCH_NO { get; set; }
} }
} }

@ -458,7 +458,7 @@ namespace Myshipping.Application
} }
//一般更新数据指的是Booking Amendment,需要与舱位进行数据比对 //一般更新数据指的是Booking Amendment,需要与舱位进行数据比对
await PushCompareBCInfo(bcSrcDto, bcTargetDto,id); await PushCompareBCInfo(bcSrcDto, bcTargetDto,id, dto.BatchNo);
} }
else if (dto.OpType == "del") else if (dto.OpType == "del")
{ {
@ -976,8 +976,9 @@ namespace Myshipping.Application
/// <param name="bcSrcDto">原舱位详情</param> /// <param name="bcSrcDto">原舱位详情</param>
/// <param name="bcTargetDto">变更后舱位详情</param> /// <param name="bcTargetDto">变更后舱位详情</param>
/// <param name="slotId">舱位主键</param> /// <param name="slotId">舱位主键</param>
/// <param name="reqBatchNo">请求批次号用来区分对应的哪个批次任务</param>
/// <returns></returns> /// <returns></returns>
private async Task PushCompareBCInfo(TaskBCInfoDto bcSrcDto, TaskBCInfoDto bcTargetDto,long slotId) private async Task PushCompareBCInfo(TaskBCInfoDto bcSrcDto, TaskBCInfoDto bcTargetDto,long slotId,string reqBatchNo)
{ {
string batchNo = IDGen.NextID().ToString(); string batchNo = IDGen.NextID().ToString();
@ -999,6 +1000,7 @@ namespace Myshipping.Application
BookingSlotCompare entity = new BookingSlotCompare BookingSlotCompare entity = new BookingSlotCompare
{ {
SLOT_ID = slotId, SLOT_ID = slotId,
COMPARE_BATCHNO = reqBatchNo,
COMPARE_DIFF_NUM = compareResult.extra.IsExistsDiff? compareResult.extra.ShowDetailList.Count : 0, COMPARE_DIFF_NUM = compareResult.extra.IsExistsDiff? compareResult.extra.ShowDetailList.Count : 0,
CreatedTime = nowDate, CreatedTime = nowDate,
UpdatedTime = nowDate, UpdatedTime = nowDate,
@ -1078,6 +1080,32 @@ namespace Myshipping.Application
return model; return model;
} }
#endregion #endregion
#region 获取舱位变更比对结果
/// <summary>
/// 获取舱位变更比对结果
/// </summary>
/// <param name="id">舱位主键</param>
/// <param name="batchNo">批次号</param>
/// <returns>返回舱位变更比对结果</returns>
public async Task<List<CompareResultDetailInfo>> GetSlotCompareResult(long id,string batchNo)
{
var compareInfo = await _bookingSlotCompareRepository.AsQueryable()
.FirstAsync(t => t.SLOT_ID == id && t.COMPARE_BATCHNO == batchNo);
if (compareInfo == null)
{
throw Oops.Oh($"舱位变更比对结果不存在");
}
if (string.IsNullOrWhiteSpace(compareInfo.COMPARE_RLT))
{
throw Oops.Oh($"获取舱位变更比对结果错误,比对内容不存在");
}
return JSON.Deserialize<List<CompareResultDetailInfo>>(compareInfo.COMPARE_RLT);
}
#endregion
} }
public class DynameFileInfo public class DynameFileInfo

@ -452,6 +452,11 @@ namespace Myshipping.Application.Service.BookingSlot.Dto
/// 数据对象 /// 数据对象
/// </summary> /// </summary>
public BookingSlotBaseApiSaveDto DataObj { get; set; } public BookingSlotBaseApiSaveDto DataObj { get; set; }
/// <summary>
/// 批次号
/// </summary>
public string BatchNo { get; set; }
} }
/// <summary> /// <summary>

@ -74,5 +74,13 @@ namespace Myshipping.Application
/// <param name="modifyFile"></param> /// <param name="modifyFile"></param>
/// <returns></returns> /// <returns></returns>
Task<long> InnerApiReceive(BookingSlotBaseApiDto dto, DynameFileInfo file = null, DynameFileInfo modifyFile = null); Task<long> InnerApiReceive(BookingSlotBaseApiDto dto, DynameFileInfo file = null, DynameFileInfo modifyFile = null);
/// <summary>
/// 获取舱位变更比对结果
/// </summary>
/// <param name="id">舱位主键</param>
/// <param name="batchNo">批次号</param>
/// <returns>返回舱位变更比对结果</returns>
Task<List<CompareResultDetailInfo>> GetSlotCompareResult(long id, string batchNo);
} }
} }

@ -371,6 +371,11 @@ namespace Myshipping.Application
/// 任务状态 /// 任务状态
/// </summary> /// </summary>
public string taskStatus { get; set; } public string taskStatus { get; set; }
/// <summary>
/// 批次号
/// </summary>
public string BatchNo { get; set; }
} }
public class TaskBCShowBaseKeywordDto public class TaskBCShowBaseKeywordDto

@ -367,5 +367,9 @@ namespace Myshipping.Application
/// </summary> /// </summary>
public Nullable<DateTime> BookingConfirmDate { get; set; } public Nullable<DateTime> BookingConfirmDate { get; set; }
/// <summary>
/// 批次号
/// </summary>
public string BatchNo { get; set; }
} }
} }

@ -683,8 +683,8 @@ namespace Myshipping.Application
.Map(dest => dest.SecondETD, src => src.SECOND_ETD) .Map(dest => dest.SecondETD, src => src.SECOND_ETD)
.Map(dest => dest.SecondETA, src => src.SECOND_ETA) .Map(dest => dest.SecondETA, src => src.SECOND_ETA)
.Map(dest => dest.BookingSlotId, src => src.BOOKING_SLOT_ID) .Map(dest => dest.BookingSlotId, src => src.BOOKING_SLOT_ID)
.Map(dest => dest.BookingConfirmDate, src => src.BOOKING_COMFIRM_DATE); .Map(dest => dest.BookingConfirmDate, src => src.BOOKING_COMFIRM_DATE)
.Map(dest => dest.BatchNo, src => src.BATCH_NO);
config.ForType<TaskBCInfo, TaskBCShowBaseDto>() config.ForType<TaskBCInfo, TaskBCShowBaseDto>()
.Map(dest => dest.PKId, src => src.PK_ID) .Map(dest => dest.PKId, src => src.PK_ID)
@ -754,7 +754,8 @@ namespace Myshipping.Application
.Map(dest => dest.SecondETD, src => src.SECOND_ETD) .Map(dest => dest.SecondETD, src => src.SECOND_ETD)
.Map(dest => dest.SecondETA, src => src.SECOND_ETA) .Map(dest => dest.SecondETA, src => src.SECOND_ETA)
.Map(dest => dest.BookingSlotId, src => src.BOOKING_SLOT_ID) .Map(dest => dest.BookingSlotId, src => src.BOOKING_SLOT_ID)
.Map(dest => dest.BookingConfirmDate, src => src.BOOKING_COMFIRM_DATE); .Map(dest => dest.BookingConfirmDate, src => src.BOOKING_COMFIRM_DATE)
.Map(dest => dest.BatchNo, src => src.BATCH_NO);
config.ForType<TaskManageOrderBCInfo, TaskBCInfo>() config.ForType<TaskManageOrderBCInfo, TaskBCInfo>()
.Map(dest => dest.BUSI_TYPE, src => src.BusiType) .Map(dest => dest.BUSI_TYPE, src => src.BusiType)
@ -816,7 +817,8 @@ namespace Myshipping.Application
.Map(dest => dest.SECOND_VOYNO, src => src.SecondVoyno) .Map(dest => dest.SECOND_VOYNO, src => src.SecondVoyno)
.Map(dest => dest.SECOND_ETD, src => src.SecondETD) .Map(dest => dest.SECOND_ETD, src => src.SecondETD)
.Map(dest => dest.SECOND_ETA, src => src.SecondETA) .Map(dest => dest.SECOND_ETA, src => src.SecondETA)
.Map(dest => dest.BOOKING_COMFIRM_DATE, src => src.BookingConfirmDate); .Map(dest => dest.BOOKING_COMFIRM_DATE, src => src.BookingConfirmDate)
.Map(dest => dest.BATCH_NO, src => src.BatchNo);
config.ForType<TaskBCCTNInfo, TaskBCCTNInfoDto>() config.ForType<TaskBCCTNInfo, TaskBCCTNInfoDto>()
.Map(dest => dest.CtnCode, src => src.CTNCODE) .Map(dest => dest.CtnCode, src => src.CTNCODE)

@ -341,5 +341,10 @@ namespace Myshipping.Application
/// 舱位主键 /// 舱位主键
/// </summary> /// </summary>
public Nullable<long> BookingSlotId { get; set; } public Nullable<long> BookingSlotId { get; set; }
/// <summary>
/// 批次号
/// </summary>
public string BatchNo { get; set; }
} }
} }

@ -82,5 +82,12 @@ namespace Myshipping.Application
/// <param name="taskPKId">BC任务主键</param> /// <param name="taskPKId">BC任务主键</param>
/// <returns>返回回执</returns> /// <returns>返回回执</returns>
Task<TaskManageOrderResultDto> SendEmail(string taskPKId); Task<TaskManageOrderResultDto> SendEmail(string taskPKId);
/// <summary>
/// 获取当前比对结果
/// </summary>
/// <param name="taskPKId">BC任务主键</param>
/// <returns>返回回执</returns>
Task<TaskManageOrderResultDto> GetCompareResult(string taskPKId);
} }
} }

@ -1732,6 +1732,31 @@ namespace Myshipping.Application
return await GenerateSendEmail(bcOrder); return await GenerateSendEmail(bcOrder);
} }
#endregion #endregion
/// <summary>
/// 获取当前比对结果
/// </summary>
/// <param name="taskPKId">BC任务主键</param>
/// <returns>返回回执</returns>
[HttpGet("/TaskManageBC/GetCompareResult")]
public async Task<TaskManageOrderResultDto> GetCompareResult(string taskPKId)
{
if (string.IsNullOrWhiteSpace(taskPKId))
throw Oops.Oh($"BC任务主键不能为空");
var bcTaskInfo = await _taskBaseRepository.AsQueryable().FirstAsync(u => u.PK_ID == taskPKId);
if (bcTaskInfo == null)
{
throw Oops.Oh($"任务主键{taskPKId}无法获取业务信息");
}
var bcOrder = _taskBCInfoRepository.AsQueryable().First(a => a.TASK_ID == bcTaskInfo.PK_ID);
if (bcOrder == null)
throw Oops.Oh($"任务主键{taskPKId}无法获取BC业务信息");
_bookingSlotService.GetSlotCompareResult(bcOrder.BOOKING_SLOT_ID,);
}
} }
/// <summary> /// <summary>

Loading…
Cancel
Save