|
|
|
@ -553,6 +553,50 @@ namespace Myshipping.Application
|
|
|
|
|
/*
|
|
|
|
|
获取所有当票预甩的所有没有BOOKING_ID的明细记录,并用SHIPMENT(提单号),检索订舱数据,能匹配的更新
|
|
|
|
|
*/
|
|
|
|
|
var list = _taskRollingNominationInfoRepository.AsQueryable().Filter(null, true)
|
|
|
|
|
.InnerJoin<TaskRollingNominationDetailInfo>((nom, detail) => nom.PK_ID == detail.NOM_ID)
|
|
|
|
|
.Where((nom, detail) => nom.PK_ID == nominationId
|
|
|
|
|
&& detail.IsDeleted == false && !detail.BOOKING_ID.HasValue)
|
|
|
|
|
.Select((nom, detail) => detail).ToList();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (list.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
var mblNoArg = list.Select(a=>a.SHIPMENT).Distinct().ToList();
|
|
|
|
|
|
|
|
|
|
var orderList = _bookingOrderRepository.AsQueryable()
|
|
|
|
|
.Where(a => mblNoArg.Contains(a.MBLNO) && !a.ParentId.HasValue && a.IsDeleted == false).ToList();
|
|
|
|
|
|
|
|
|
|
DateTime nowDate = DateTime.Now;
|
|
|
|
|
|
|
|
|
|
if (orderList.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
orderList.ForEach(ord =>
|
|
|
|
|
{
|
|
|
|
|
var dlist = list.Where(b => b.SHIPMENT.Equals(ord.MBLNO)).ToList();
|
|
|
|
|
|
|
|
|
|
if (dlist.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
dlist.ForEach(dt =>
|
|
|
|
|
{
|
|
|
|
|
dt.BOOKING_ID = ord.Id;
|
|
|
|
|
dt.UpdatedTime = nowDate;
|
|
|
|
|
dt.UpdatedUserId = UserManager.UserId;
|
|
|
|
|
dt.UpdatedUserName = UserManager.Name;
|
|
|
|
|
|
|
|
|
|
_taskRollingNominationDetailInfoRepository.AsUpdateable(dt)
|
|
|
|
|
.UpdateColumns(it => new
|
|
|
|
|
{
|
|
|
|
|
it.BOOKING_ID,
|
|
|
|
|
it.UpdatedTime,
|
|
|
|
|
it.UpdatedUserId,
|
|
|
|
|
it.UpdatedUserName
|
|
|
|
|
}).ExecuteCommand();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
@ -569,18 +613,42 @@ namespace Myshipping.Application
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 查看分享链接
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="batchId">预甩任务主键</param>
|
|
|
|
|
/// <param name="dispatchBatchId">预甩调度批次号</param>
|
|
|
|
|
/// <returns>返回回执</returns>
|
|
|
|
|
[HttpGet("/TaskManageRollingNomination/GetUrl")]
|
|
|
|
|
public async Task<TaskManageOrderResultDto> GetUrl(string batchId)
|
|
|
|
|
public async Task<TaskManageOrderResultDto> GetUrl(string dispatchBatchId)
|
|
|
|
|
{
|
|
|
|
|
TaskManageOrderResultDto result = new TaskManageOrderResultDto();
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
/*
|
|
|
|
|
用预甩调度的batchId关联分享表的BUSI_ID获取分享KEY
|
|
|
|
|
用预甩调度的dispatchBatchId关联分享表的BUSI_ID获取分享KEY
|
|
|
|
|
*/
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(dispatchBatchId))
|
|
|
|
|
throw Oops.Oh($"预甩调度批次号不能为空");
|
|
|
|
|
|
|
|
|
|
var dispatchInfo = _taskRollingNominationDispatchInfoRepository.AsQueryable()
|
|
|
|
|
.First(a => a.BATCH_ID == dispatchBatchId);
|
|
|
|
|
|
|
|
|
|
if (dispatchInfo == null)
|
|
|
|
|
{
|
|
|
|
|
throw Oops.Oh($"获取预甩调度信息失败,不存在或已作废");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(string.IsNullOrWhiteSpace(dispatchInfo.SHARE_LINK_KEY))
|
|
|
|
|
throw Oops.Oh($"链接访问KEY不存在,请生成分享链接");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string[] statusArg = new string[] { RollingNominationDispatchStatusEnum.CANCEL.ToString(),
|
|
|
|
|
RollingNominationDispatchStatusEnum.EXPIRE.ToString() };
|
|
|
|
|
|
|
|
|
|
if (statusArg.Any(a => a.Equals(dispatchInfo.STATUS, StringComparison.OrdinalIgnoreCase)))
|
|
|
|
|
throw Oops.Oh($"链接访问KEY状态不可用");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
result.succ = true;
|
|
|
|
|
result.ext = dispatchInfo.SHARE_LINK_KEY;
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
@ -815,5 +883,45 @@ namespace Myshipping.Application
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 获取用户反馈信息
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取用户反馈信息
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="dispatchBatchId">预甩调度批次ID</param>
|
|
|
|
|
/// <returns>返回回执</returns>
|
|
|
|
|
public async Task<TaskManageOrderResultDto> GetUserFeedBack(string dispatchBatchId)
|
|
|
|
|
{
|
|
|
|
|
TaskManageOrderResultDto result = new TaskManageOrderResultDto();
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
if (string.IsNullOrWhiteSpace(dispatchBatchId))
|
|
|
|
|
{
|
|
|
|
|
throw Oops.Oh($"预甩调度批次ID不能为空");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var list = _taskRollingNominationDispatchInfoRepository.AsQueryable()
|
|
|
|
|
.Where(a => a.BATCH_ID == dispatchBatchId).ToList();
|
|
|
|
|
|
|
|
|
|
if (list.Count == 0)
|
|
|
|
|
throw Oops.Oh($"预甩调度批次ID无法获取业务信息");
|
|
|
|
|
|
|
|
|
|
result.succ = true;
|
|
|
|
|
result.ext = new
|
|
|
|
|
{
|
|
|
|
|
userOpinion = list.FirstOrDefault().USER_OPINION,
|
|
|
|
|
userOpinionTxt = list.FirstOrDefault().USER_OPINION_TXT
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
result.succ = false;
|
|
|
|
|
result.msg = $"获取用户反馈信息异常,原因:{ex.Message}";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|