|
|
|
@ -1115,16 +1115,29 @@ namespace Myshipping.Application
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
//_taskBaseInfoRepository.AsQueryable().LeftJoin(_taskFileInfoRepository.AsQueryable(),)
|
|
|
|
|
//根据任务主键获取所有主单号列表
|
|
|
|
|
var mblnoList = _taskBaseInfoRepository.AsQueryable().Where(t => PKIds.Contains(t.PK_ID) && !string.IsNullOrWhiteSpace(t.MBL_NO))
|
|
|
|
|
.Select(t => t.MBL_NO).Distinct().ToList();
|
|
|
|
|
|
|
|
|
|
if (mblnoList.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
//根据主单号获取任务类型是DRAFT的任务,取时间最新的
|
|
|
|
|
var taskList = _taskBaseInfoRepository.AsQueryable()
|
|
|
|
|
.LeftJoin(_taskFileInfoRepository.AsQueryable(), (tsk, file) => tsk.PK_ID == file.TASK_PKID)
|
|
|
|
|
.Where((tsk, file) => PKIds.Contains(tsk.PK_ID) && tsk.TASK_TYPE == TaskBusiTypeEnum.DRAFT.ToString() && file != null)
|
|
|
|
|
.OrderByDescending(tsk => tsk.CreatedTime)
|
|
|
|
|
.Select((tsk, file) => new { tsk = tsk, file = file }).ToList();
|
|
|
|
|
|
|
|
|
|
//var taskList = _taskBaseInfoRepository.AsQueryable().Where(t => PKIds.Contains(t.PK_ID)).ToList();
|
|
|
|
|
|
|
|
|
|
//_logger.LogInformation("批次={no} 获取任务完成,Num={Num}", batchNo, taskList.Count);
|
|
|
|
|
list = mblnoList.Select((mbl,idx) => {
|
|
|
|
|
var calcInfo = new LaraPaperCalcInfo();
|
|
|
|
|
|
|
|
|
|
//taskList.ForEach(async tsk => {
|
|
|
|
|
calcInfo.Indx = idx + 1;
|
|
|
|
|
|
|
|
|
|
// await InnerManualTask(batchNo, tsk, TaskOperTypeEnum.PENDING_TASK);
|
|
|
|
|
//});
|
|
|
|
|
|
|
|
|
|
return calcInfo;
|
|
|
|
|
}).ToList();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|