|
|
|
@ -34,8 +34,11 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="request"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public async Task<DataResult> CreateSubTaskAsync(IEnumerable<TaskCreationRequest> request)
|
|
|
|
|
public async Task CreateSubTaskAsync(IEnumerable<TaskCreationRequest> request)
|
|
|
|
|
{
|
|
|
|
|
if (request == null || !request.Any())
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
long userId = long.Parse(User.UserId);
|
|
|
|
|
long tenatId = long.Parse(User.TenantId);
|
|
|
|
|
string tenatName = Db.Queryable<SysTenant>().Where(x => x.Id == tenatId).Select(x => x.Name).First();
|
|
|
|
@ -46,6 +49,7 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
|
|
|
|
|
var biz = await TenantDb.Queryable<SeaExport>().Select(x => new
|
|
|
|
|
{
|
|
|
|
|
x.Id,
|
|
|
|
|
x.CustomerNo,
|
|
|
|
|
x.MBLNO,
|
|
|
|
|
x.Vessel,
|
|
|
|
|
x.Voyno,
|
|
|
|
@ -81,7 +85,7 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
|
|
|
|
|
IsCheckExistsByTaskType = true
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
info.Main.TaskDesp = info.Main.TaskTitle = $"【{item.TaskType.GetDescription()}】 {biz?.Vessel} {biz?.Voyno} ETD:{biz?.ETD?.ToString("yyyy-MM-dd")} BLNo:{biz?.MBLNO}";
|
|
|
|
|
info.Main.TaskDesp = info.Main.TaskTitle = $"【{item.TaskType.GetDescription()}】{biz?.CustomerNo} {biz?.Vessel} {biz?.Voyno} ETD:{biz?.ETD?.ToString("yyyy-MM-dd")}";
|
|
|
|
|
|
|
|
|
|
var result = await ManagerService.InitTaskJob(info);
|
|
|
|
|
if (!result.Succeeded)
|
|
|
|
@ -101,7 +105,6 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
await TenantDb.Insertable(taskList).ExecuteCommandAsync();
|
|
|
|
|
return DataResult.Success;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -117,16 +120,16 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
|
|
|
|
|
var task = await GetQuery(request.BusinessId, request.BusinessType, request.TaskType).FirstAsync();
|
|
|
|
|
if (task != null)
|
|
|
|
|
{
|
|
|
|
|
var list = Array.FindAll(await GetSubRequestAsync(request.BusinessId, request.BusinessType, task.RecvUserIdArray), x => !string.IsNullOrEmpty(x.TaskTypeName));
|
|
|
|
|
await CreateSubTaskAsync(list);
|
|
|
|
|
var list = await GetSubRequestAsync(request.BusinessId, request.BusinessType, task.RecvUserIdArray);
|
|
|
|
|
await CreateSubTaskAsync(list.FindAll(x => x.TaskType != TaskBaseTypeEnum.NOT_SPECIFIED).OrderBy(x => x.TaskType));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
internal async Task<TaskCreationRequest[]> GetSubRequestAsync(long id, BusinessType businessType, params long[]? recvUsers)
|
|
|
|
|
internal async Task<List<TaskCreationRequest>> GetSubRequestAsync(long id, BusinessType businessType, params long[]? recvUsers)
|
|
|
|
|
{
|
|
|
|
|
var svcList = await GetServicesAsync(id);
|
|
|
|
|
var list = new TaskCreationRequest[svcList.Length];
|
|
|
|
|
var list = new List<TaskCreationRequest>(svcList.Length);
|
|
|
|
|
for (int i = 0; i < svcList.Length; i++)
|
|
|
|
|
{
|
|
|
|
|
var dto = new TaskCreationRequest { BusinessId = id, BusinessType = businessType, RecvUserIdList = recvUsers };
|
|
|
|
@ -156,8 +159,16 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
|
|
|
|
|
dto.TaskTypeName = TaskBaseTypeEnum.WAIT_TUOCHE.ToString();
|
|
|
|
|
else if (svcName == "保险")
|
|
|
|
|
dto.TaskTypeName = TaskBaseTypeEnum.WAIT_Insurance.ToString();
|
|
|
|
|
|
|
|
|
|
list[i] = dto;
|
|
|
|
|
else if (svcName == "出号")
|
|
|
|
|
dto.TaskTypeName = TaskBaseTypeEnum.WAIT_CHUHAO.ToString();
|
|
|
|
|
else if (svcName == "内点入货")
|
|
|
|
|
dto.TaskTypeName = TaskBaseTypeEnum.WAIT_NDRH.ToString();
|
|
|
|
|
else if (svcName == "快递")
|
|
|
|
|
dto.TaskTypeName = TaskBaseTypeEnum.WAIT_DELIVERY.ToString();
|
|
|
|
|
else if (svcName == "箱使")
|
|
|
|
|
dto.TaskTypeName = TaskBaseTypeEnum.WAIT_XIANGSHI.ToString();
|
|
|
|
|
|
|
|
|
|
list.Add(dto);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return list;
|
|
|
|
|