747575620@qq.com vor 1 Jahr
Ursprung
Commit
7e60d8e060
5 geänderte Dateien mit 380 neuen und 2 gelöschten Zeilen
  1. +135
    -0
      backend/BPA.MES.Base.Application/BPA.MES.Base.Application.xml
  2. +200
    -0
      backend/BPA.MES.Base.Application/Services/AGVService/Dtos/AGVThirdPartyDto.cs
  3. +1
    -1
      backend/BPA.MES.Base.Application/Services/AGVService/Services/AGVThirdPartyService.cs
  4. +2
    -0
      backend/BPA.MES.Base.Core/BPA.MES.Base.Core.csproj
  5. +42
    -1
      backend/BPA.MES.Base.Web.Core/Startup.cs

+ 135
- 0
backend/BPA.MES.Base.Application/BPA.MES.Base.Application.xml Datei anzeigen

@@ -1602,6 +1602,141 @@
主键
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.AGVService.Dtos.AGVThirdPartyInputBaseDto.robotJobId">
<summary>
上游系统任务号,全局唯一
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.AGVService.Dtos.AGVThirdPartyInputBaseDto.warehouseId">
<summary>
仓库编号
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.AGVService.Dtos.AGVThirdPartyInputBaseDto.jobId">
<summary>
任务快仓系统编号
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.AGVService.Dtos.AGVThirdPartyInputBaseDto.state">
<summary>
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.AGVService.Dtos.AGVThirdPartyInputBaseDto.jobType">
<summary>
内部任务类型
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.AGVService.Dtos.AGVThirdPartyInputBaseDto.jobData">
<summary>
数据字段
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.AGVService.Dtos.GoodsToGoods.agvCode">
<summary>
AGV编号
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.AGVService.Dtos.GoodsToGoods.containerCode">
<summary>
容器编号
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.AGVService.Dtos.GoodsToGoods.startPointCode">
<summary>
上料点位
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.AGVService.Dtos.GoodsToGoods.startSlotCode">
<summary>
上料货位编号
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.AGVService.Dtos.GoodsToGoods.targetPointCode">
<summary>
下料点位
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.AGVService.Dtos.GoodsToGoods.targetSlotCode">
<summary>
下料货位编号
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.AGVService.Dtos.GoodsToGoods.loadInteractive">
<summary>
是否需要上料交互
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Services.AGVService.Dtos.PointToPoint">
<summary>
点到点
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.AGVService.Dtos.PointToPoint.agvCode">
<summary>
AGV编号
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.AGVService.Dtos.PointToPoint.containerCode">
<summary>
容器编号
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.AGVService.Dtos.PointToPoint.startPointCode">
<summary>
上料点位
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.AGVService.Dtos.PointToPoint.targetPointCode">
<summary>
下料点位
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.AGVService.Dtos.PointToPoint.loadInteractive">
<summary>
是否需要上料交互
</summary>
</member>
<member name="F:BPA.MES.Base.Application.Services.AGVService.Dtos.AGVState.LIFT_UP_DONE">
<summary>
顶升完成
</summary>
</member>
<member name="F:BPA.MES.Base.Application.Services.AGVService.Dtos.AGVState.MOVE_BEGIN">
<summary>
开始移动
</summary>
</member>
<member name="F:BPA.MES.Base.Application.Services.AGVService.Dtos.AGVState.PUT_DOWN_DONE">
<summary>
放下完成
</summary>
</member>
<member name="F:BPA.MES.Base.Application.Services.AGVService.Dtos.AGVState.DONE">
<summary>
任务完成
</summary>
</member>
<member name="F:BPA.MES.Base.Application.Services.AGVService.Dtos.AGVState.CANCEL">
<summary>
任务取消
</summary>
</member>
<member name="F:BPA.MES.Base.Application.Services.AGVService.Dtos.AGVState.ABNORMAL_CANCEL">
<summary>
任务异常取消
</summary>
</member>
<member name="F:BPA.MES.Base.Application.Services.AGVService.Dtos.AGVState.ABNORMAL_COMPLETED">
<summary>
任务异常完成
</summary>
</member>
<member name="F:BPA.MES.Base.Application.Services.AGVService.Dtos.jobType.SLOT_ROLLER_MOVE">
<summary>
1) 辊筒货位到货位搬运
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Services.AGVService.Services.AgvLineService">
<summary>
名 称 :AGV线路管理


+ 200
- 0
backend/BPA.MES.Base.Application/Services/AGVService/Dtos/AGVThirdPartyDto.cs Datei anzeigen

@@ -0,0 +1,200 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPA.MES.Base.Application.Services.AGVService.Dtos
{
public class AGVThirdPartyInputBaseDto
{
/// <summary>
/// 上游系统任务号,全局唯一
/// </summary>
public string robotJobId { get; set; }

/// <summary>
/// 仓库编号
/// </summary>
public long warehouseId { get; set; }

/// <summary>
/// 任务快仓系统编号
/// </summary>
public string jobId { get; set; }

/// <summary>
///
/// </summary>
public AGVState state { get; set; }

/// <summary>
/// 内部任务类型
/// </summary>
public jobType jobType { get; set; }

/// <summary>
/// 数据字段
/// </summary>
public Object jobData { get; set; }

}


public class GoodsToGoods
{
/// <summary>
/// AGV编号
/// </summary>
public string agvCode { get; set; }

/// <summary>
/// 容器编号
/// </summary>
public string containerCode { get; set; }

/// <summary>
/// 上料点位
/// </summary>
public string startPointCode { get; set; }

/// <summary>
/// 上料货位编号
/// </summary>
public string startSlotCode { get; set; }

/// <summary>
/// 下料点位
/// </summary>
public string targetPointCode { get; set; }

/// <summary>
/// 下料货位编号
/// </summary>
public string targetSlotCode { get; set; }

/// <summary>
/// 是否需要上料交互
/// </summary>
public bool loadInteractive { get; set; }
}

/// <summary>
/// 点到点
/// </summary>
public class PointToPoint
{
/// <summary>
/// AGV编号
/// </summary>
public string agvCode { get; set; }

/// <summary>
/// 容器编号
/// </summary>
public string containerCode { get; set; }

/// <summary>
/// 上料点位
/// </summary>
public string startPointCode { get; set; }

/// <summary>
/// 下料点位
/// </summary>
public string targetPointCode { get; set; }

/// <summary>
/// 是否需要上料交互
/// </summary>
public bool loadInteractive { get; set; }
}

public enum AGVState
{

//任务状态:
//1)货架/货位/点到点货架搬运任务枚举:
//LIFT_UP_DONE:顶升完成
//MOVE_BEGIN:开始移动
//PUT_DOWN_DONE:放下完成
//DONE:任务完成
//CANCEL:任务取消
//ABNORMAL_CANCEL:任务异常取消
//ABNORMAL_COMPLETED:任务异常完成
//2)货位到货位/点到点辊筒料箱搬运任务枚举:
//ROLLER_LOAD_DOING:正在上料
//ROLLER_LOAD_FINISH:上料完成
//ROLLER_UNLOAD_DOING:正在下料
//DONE:下料完成
//ABNORMAL_CANCEL:任务异常取消
//ABNORMAL_COMPLETED:任务异常完成
//3)AGV移动任务枚举:
//DONE:任务完成
//CANCEL:任务取消
//ABNORMAL_CANCEL:任务异常取消
//ABNORMAL_COMPLETED:任务异常完成
//4) 纯料箱任务枚举:
//MOVE_BEGIN:开始移动(仅单插臂或单夹报,2.8.1后)
//ENTER_STATION:到站
//DONE:任务完成
//LOAD_COMPLETED:取料完成
//UNLOAD_COMPLETED:放料完成
//ABNORMAL_CANCEL:任务异常取消ABNORMAL_COMPLETED:任务异常完成
//5) 小皮带任务枚举:
//DONE:任务完成
//6) QuickPick任务枚举:
//ENTER_STATION:到站
//DONE:任务完成
//CANCEL:任务取消
//LEAVE_STATION离站
//ROLLBACK 回滚(有其他任务,当前任务可不执行)


/// <summary>
/// 顶升完成
/// </summary>
LIFT_UP_DONE = 1,

/// <summary>
/// 开始移动
/// </summary>
MOVE_BEGIN = 2,

/// <summary>
/// 放下完成
/// </summary>
PUT_DOWN_DONE = 3,

/// <summary>
/// 任务完成
/// </summary>
DONE = 4,


/// <summary>
/// 任务取消
/// </summary>
CANCEL = 5,

/// <summary>
/// 任务异常取消
/// </summary>
ABNORMAL_CANCEL = 6,

/// <summary>
/// 任务异常完成
/// </summary>
ABNORMAL_COMPLETED = 7

}

public enum jobType
{
/// <summary>
/// 1) 辊筒货位到货位搬运
/// </summary>
SLOT_ROLLER_MOVE = 1,
}

}

+ 1
- 1
backend/BPA.MES.Base.Application/Services/AGVService/Services/AGVThirdPartyService.cs Datei anzeigen

@@ -54,6 +54,6 @@ namespace BPA.MES.Base.Application.Services.AGVService.Services
return await _aGVHandler.CancelAsync(kCCancelRequest);
}

}
}

+ 2
- 0
backend/BPA.MES.Base.Core/BPA.MES.Base.Core.csproj Datei anzeigen

@@ -14,6 +14,8 @@

<ItemGroup>
<PackageReference Include="BPA.AGV" Version="1.0.1" />
<PackageReference Include="BPA.MQTTClient" Version="1.0.11" />
<PackageReference Include="BPA.WebApiClient" Version="1.0.4" />
<PackageReference Include="Furion.Extras.Authentication.JwtBearer" Version="4.8.6.6" />
<PackageReference Include="Furion.Extras.ObjectMapper.Mapster" Version="4.8.6.6" />
<PackageReference Include="Furion.Pure" Version="4.8.6.6" />


+ 42
- 1
backend/BPA.MES.Base.Web.Core/Startup.cs Datei anzeigen

@@ -1,12 +1,21 @@
using BPA.AGV;
using System;
using System.Threading.Tasks;
using BPA.AGV;
using BPA.ApiClient;
using BPA.MES.Base.Application;
using BPA.MES.Base.Application.Subscriber;
using BPA.MES.Base.Core;
using BPA.MQTTClient;
using Furion;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using MQTTnet.Client;
using MQTTnet.Client.Connecting;
using MQTTnet.Client.Disconnecting;
using MQTTnet.Client.Options;
using Newtonsoft.Json.Linq;
using Yitter.IdGenerator;

namespace BPA.MES.Base.Web.Core;
@@ -15,6 +24,7 @@ public class Startup : AppStartup
{
public void ConfigureServices(IServiceCollection services)
{

services.AddConsoleFormatter();
services.AddJwt<JwtHandler>(enableGlobalAuthorize: true);
services.AddCorsAccessor();
@@ -31,6 +41,8 @@ public class Startup : AppStartup
builder.AddSubscriber(typeof(ToDoEventSubscriber));
});
services.AddRemoteRequest();

services.AddWebApiClient();
services.AddAGV(op =>
{
op = new AGVOptions()
@@ -46,6 +58,35 @@ public class Startup : AppStartup
};
});

services.AddMqttClientHostedService(op =>
{
op.Port = 1883;
op.Server = "10.2.1.21";
op.UserName = "emqx_u_block";
op.Password = "emqx_p_admin8765490789";
op.mqttClientConnectedHandlerDelegate = new MqttClientConnectedHandlerDelegate(async e =>
{
Console.WriteLine("MQTT连接成功");
});
op.mqttClientDisconnectedHandlerDelegate = new MqttClientDisconnectedHandlerDelegate(async e =>
{
Console.WriteLine("MQTT断开连接");
await Task.Delay(TimeSpan.FromSeconds(5));
try
{
//var options = builder.Build().Services.GetService<IMqttClientOptions>();
//await builder.Build().Services.GetService<IMqttClient>().ConnectAsync(options);
}
catch (global::System.Exception)
{
}
});
op.MqttApplicationMessageReceivedHandler = new MQTTnet.Client.Receiving.MqttApplicationMessageReceivedHandlerDelegate(async e =>
{

});
});

services.AddControllers()
.AddInjectWithUnifyResult();
}


Laden…
Abbrechen
Speichern