新增,任务链类型枚举
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Tnb.WarehouseMgr.Entities.Enums
|
||||
{
|
||||
/// <summary>
|
||||
/// 任务链类型
|
||||
/// </summary>
|
||||
public enum EnumTaskChainType
|
||||
{
|
||||
CTU = 1,
|
||||
KIVA = 2,
|
||||
AGV = 3,
|
||||
}
|
||||
}
|
||||
@@ -11,6 +11,7 @@ using JNPF.Logging;
|
||||
using JNPF.Systems.Interfaces.System;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Newtonsoft.Json;
|
||||
using NPOI.OpenXmlFormats;
|
||||
using Senparc.NeuChar.ApiHandlers;
|
||||
using SqlSugar;
|
||||
@@ -109,16 +110,16 @@ namespace Tnb.WarehouseMgr
|
||||
switch (input.status)
|
||||
{
|
||||
case "CREATED": break;
|
||||
case "ALLOCATED":
|
||||
case "ALLOCATED":break;
|
||||
case "PROCESSING":
|
||||
var disTasks = await _db.Queryable<WmsDistaskH>().Where(it => it.bill_code.Contains(input.taskChainCode)).ToListAsync();
|
||||
var eps = await _db.Queryable<EqpEquipment>().Where(it => it.code.Contains(input.deviceID)).ToListAsync();
|
||||
var eps = await _db.Queryable<EqpEquipment>().Where(it => it.code.Contains(input.deviceID)).ToListAsync();
|
||||
TaskExecuteUpInput taskExecuteUpInput = new()
|
||||
{
|
||||
disTaskIds = disTasks.Select(x => x.id).ToList(),
|
||||
EqpIds = eps.Select(x => x.id).ToList(),
|
||||
};
|
||||
await _wareHouseService.TaskExecute(taskExecuteUpInput); break;
|
||||
case "PROGRESSING": break;
|
||||
case "CANCELLED": break;
|
||||
case "SUCCEED": break;
|
||||
case "FAILURE": break;
|
||||
@@ -142,10 +143,12 @@ namespace Tnb.WarehouseMgr
|
||||
[HttpPost, NonUnify, AllowAnonymous]
|
||||
public async Task<Result> TaskCallback(TaskCallBackInput input)
|
||||
{
|
||||
Log.Information($"接收参数:{JsonConvert.SerializeObject(input)}");
|
||||
try
|
||||
{
|
||||
|
||||
var disTasks = await _db.Queryable<WmsDistaskH>().Where(it => it.bill_code.Contains(input.taskCode)).ToListAsync();
|
||||
if (input.action == "取货")
|
||||
if (input.action == "LOAD")
|
||||
{
|
||||
TaskExecuteAfterUpInput taskExecuteAfterUpInput = new()
|
||||
{
|
||||
@@ -153,7 +156,7 @@ namespace Tnb.WarehouseMgr
|
||||
};
|
||||
await _wareHouseService.TaskExecuteAfter(taskExecuteAfterUpInput);
|
||||
}
|
||||
else if (input.action == "放货")
|
||||
else if (input.action == "UNLOAD")
|
||||
{
|
||||
TaskCompleUpInput taskCompleUpInput = new()
|
||||
{
|
||||
|
||||
@@ -359,7 +359,7 @@ namespace Tnb.WarehouseMgr
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
JNPF.Logging.Log.Error("生成预任务执行时出现错误", ex);
|
||||
Log.Error("生成预任务执行时出现错误", ex);
|
||||
await db.Ado.RollbackTranAsync();
|
||||
cts?.Cancel();
|
||||
throw;
|
||||
|
||||
Reference in New Issue
Block a user