调整调用第三方接口代码
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Tnb.WarehouseMgr.Entities.Dto.Inputs
|
||||
{
|
||||
/// <summary>
|
||||
/// 创建任务链输入参数
|
||||
/// </summary>
|
||||
public class ChainStatusReportingUpInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 任务链编号
|
||||
/// </summary>
|
||||
public string taskChainCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 任务链任务状态
|
||||
/// </summary>
|
||||
public string status { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -17,6 +17,10 @@ namespace Tnb.WarehouseMgr.Entities.Dto.Outputs
|
||||
/// 响应信息
|
||||
/// </summary>
|
||||
public string msg { get; set; }
|
||||
/// <summary>
|
||||
/// 错误提示消息
|
||||
/// </summary>
|
||||
public string error { get; set; }
|
||||
public DateTime? timestamp { get; set; }
|
||||
/// <summary>
|
||||
/// 响应数据
|
||||
|
||||
@@ -5,6 +5,7 @@ using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Senparc.NeuChar.ApiHandlers;
|
||||
using Tnb.WarehouseMgr.Entities.Dto.Inputs;
|
||||
using Tnb.WarehouseMgr.Entities.Dto.Outputs;
|
||||
|
||||
namespace Tnb.WarehouseMgr
|
||||
@@ -12,17 +13,18 @@ namespace Tnb.WarehouseMgr
|
||||
/// <summary>
|
||||
/// Wms设备接口提供程序服务类
|
||||
/// </summary>
|
||||
|
||||
|
||||
public class DeviceProviderService : BaseWareHouseService
|
||||
{
|
||||
/// <summary>
|
||||
/// 创建任务链
|
||||
/// 任务链状态上报
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<Result> CreateTaskChain()
|
||||
public async Task<Result> ChainStatusReporting(ChainStatusReportingUpInput input)
|
||||
{
|
||||
|
||||
return await Task.FromResult<Result>(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Dynamic;
|
||||
using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
@@ -19,6 +20,7 @@ using JNPF.DependencyInjection;
|
||||
using JNPF.DynamicApiController;
|
||||
using JNPF.Extras.CollectiveOAuth.Config;
|
||||
using JNPF.FriendlyException;
|
||||
using JNPF.Logging;
|
||||
using JNPF.Systems.Entitys.Dto.Module;
|
||||
using JNPF.Systems.Interfaces.System;
|
||||
using Mapster;
|
||||
@@ -213,6 +215,7 @@ namespace Tnb.WarehouseMgr
|
||||
[HttpPost]
|
||||
public async Task GenTaskExecute()
|
||||
{
|
||||
Stopwatch sw = Stopwatch.StartNew();
|
||||
//获取所有未下发的预任务申请
|
||||
var preTasks = await _db.Queryable<WmsPretaskH>().InnerJoin<WmsCarryH>((a, b) => a.startlocation_id == b.location_id && a.carry_id == b.id)
|
||||
.InnerJoin<WmsAreaH>((a, b, c) => a.area_id == c.id)
|
||||
@@ -316,6 +319,19 @@ namespace Tnb.WarehouseMgr
|
||||
row = await _db.Updateable<WmsPretaskH>().SetColumns(it => new WmsPretaskH { status = WmsWareHouseConst.PRETASK_BILL_STATUS_YXF_ID }).Where(it => preTaskIds.Contains(it.id)).ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
//调用AGV创建任务链接口
|
||||
var taskChainCodeDic = disTasks.Where(t => !t.groups.IsNullOrWhiteSpace()).GroupBy(g => g.groups!)
|
||||
.ToDictionary(x => x.Key, x => x.Select(it => new
|
||||
{
|
||||
taskCode = it.bill_code,
|
||||
sourceName = it.startlocation_code,
|
||||
targetName = it.endlocation_code
|
||||
}));
|
||||
|
||||
dynamic reqBody = new ExpandoObject();
|
||||
|
||||
sw.Stop();
|
||||
Log.Information($"程序运行耗时{sw.ElapsedMilliseconds}ms");
|
||||
await _db.Ado.CommitTranAsync();
|
||||
}
|
||||
catch (Exception)
|
||||
|
||||
Reference in New Issue
Block a user