# Conflicts: # frontend/config/proxy.tsshengtang
@@ -1431,6 +1431,16 @@ | |||
工单状态(信息系统 --> 中控系统) | |||
</summary> | |||
</member> | |||
<member name="F:BPA.MES.Base.Application.Topics.ExecuteReplyTopic"> | |||
<summary> | |||
任务下发成功 回调 | |||
</summary> | |||
</member> | |||
<member name="F:BPA.MES.Base.Application.Topics.LoadAndUnloadTopic"> | |||
<summary> | |||
上下料回调 | |||
</summary> | |||
</member> | |||
<member name="T:BPA.MES.Base.Application.Services.AgvLineDto"> | |||
<summary> | |||
名 称 : | |||
@@ -1602,6 +1612,196 @@ | |||
主键 | |||
</summary> | |||
</member> | |||
<member name="T:BPA.MES.Base.Application.Services.AGVService.Dtos.AGVExecuteReplyDto"> | |||
<summary> | |||
任务完成回报Dto | |||
</summary> | |||
</member> | |||
<member name="P:BPA.MES.Base.Application.Services.AGVService.Dtos.AGVExecuteReplyDto.robotJobId"> | |||
<summary> | |||
上游系统任务号,全局唯一 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.MES.Base.Application.Services.AGVService.Dtos.AGVExecuteReplyDto.warehouseId"> | |||
<summary> | |||
仓库编号 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.MES.Base.Application.Services.AGVService.Dtos.AGVExecuteReplyDto.jobId"> | |||
<summary> | |||
任务快仓系统编号 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.MES.Base.Application.Services.AGVService.Dtos.AGVExecuteReplyDto.state"> | |||
<summary> | |||
</summary> | |||
</member> | |||
<member name="P:BPA.MES.Base.Application.Services.AGVService.Dtos.AGVExecuteReplyDto.jobType"> | |||
<summary> | |||
内部任务类型 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.MES.Base.Application.Services.AGVService.Dtos.AGVExecuteReplyDto.jobData"> | |||
<summary> | |||
数据字段 | |||
</summary> | |||
</member> | |||
<member name="T:BPA.MES.Base.Application.Services.AGVService.Dtos.AGVLoadAndUnloadDto"> | |||
<summary> | |||
上下料交互请求DTO | |||
</summary> | |||
</member> | |||
<member name="P:BPA.MES.Base.Application.Services.AGVService.Dtos.AGVLoadAndUnloadDto.agvCode"> | |||
<summary> | |||
AGV编号 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.MES.Base.Application.Services.AGVService.Dtos.AGVLoadAndUnloadDto.containerCode"> | |||
<summary> | |||
容器编号,如果一次上/下多个容器,则多个容器用英文逗号分隔 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.MES.Base.Application.Services.AGVService.Dtos.AGVLoadAndUnloadDto.equipmentId"> | |||
<summary> | |||
上游设备ID | |||
</summary> | |||
</member> | |||
<member name="P:BPA.MES.Base.Application.Services.AGVService.Dtos.AGVLoadAndUnloadDto.equipmentIds"> | |||
<summary> | |||
上游设备ID,多个用英文逗号分隔 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.MES.Base.Application.Services.AGVService.Dtos.AGVLoadAndUnloadDto.jobId"> | |||
<summary> | |||
快仓任务编号 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.MES.Base.Application.Services.AGVService.Dtos.AGVLoadAndUnloadDto.msgId"> | |||
<summary> | |||
消息ID | |||
</summary> | |||
</member> | |||
<member name="P:BPA.MES.Base.Application.Services.AGVService.Dtos.AGVLoadAndUnloadDto.command"> | |||
<summary> | |||
交互阶段LOAD:上料阶段 UNLOAD:下料阶段 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.MES.Base.Application.Services.AGVService.Dtos.AGVLoadAndUnloadDto.robotJobId"> | |||
<summary> | |||
上游任务号 | |||
</summary> | |||
</member> | |||
<member name="T:BPA.MES.Base.Application.Services.AGVService.Dtos.GoodsToGoods"> | |||
<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线路管理 | |||
@@ -1662,6 +1862,69 @@ | |||
<returns></returns> | |||
<exception cref="T:System.NotImplementedException"></exception> | |||
</member> | |||
<member name="M:BPA.MES.Base.Application.Services.AGVService.Services.AGVThirdPartyService.ExecuteAsync(BPA.AGV.KCExecuteRequest)"> | |||
<summary> | |||
下发任务 | |||
</summary> | |||
<param name="cExecuteRequest"></param> | |||
<returns></returns> | |||
</member> | |||
<member name="M:BPA.MES.Base.Application.Services.AGVService.Services.AGVThirdPartyService.CancelAsync(BPA.AGV.KCCancelRequest)"> | |||
<summary> | |||
取消任务 | |||
</summary> | |||
<param name="kCCancelRequest"></param> | |||
<returns></returns> | |||
</member> | |||
<member name="M:BPA.MES.Base.Application.Services.AGVService.Services.AGVThirdPartyService.RollerJobExecuteAsync(BPA.AGV.RollerJobRequest)"> | |||
<summary> | |||
</summary> | |||
<param name="rollerJobRequest"></param> | |||
<returns></returns> | |||
</member> | |||
<member name="M:BPA.MES.Base.Application.Services.AGVService.Services.AGVThirdPartyService.ExecuteReplyAsync(BPA.MES.Base.Application.Services.AGVService.Dtos.AGVExecuteReplyRequest)"> | |||
<summary> | |||
任务回调 | |||
</summary> | |||
<param name="input"></param> | |||
<returns></returns> | |||
</member> | |||
<member name="M:BPA.MES.Base.Application.Services.AGVService.Services.AGVThirdPartyService.LoadAndUnloadAsync(BPA.MES.Base.Application.Services.AGVService.Dtos.AGVLoadAndUnloadRequest)"> | |||
<summary> | |||
AGV上下料交互请求 | |||
</summary> | |||
<param name="input"></param> | |||
<returns></returns> | |||
</member> | |||
<member name="M:BPA.MES.Base.Application.Services.AGVService.Services.IAGVThirdPartyService.ExecuteAsync(BPA.AGV.KCExecuteRequest)"> | |||
<summary> | |||
下发任务 | |||
</summary> | |||
<param name="cExecuteRequest"></param> | |||
<returns></returns> | |||
</member> | |||
<member name="M:BPA.MES.Base.Application.Services.AGVService.Services.IAGVThirdPartyService.CancelAsync(BPA.AGV.KCCancelRequest)"> | |||
<summary> | |||
取消任务 | |||
</summary> | |||
<param name="kCCancelRequest"></param> | |||
<returns></returns> | |||
</member> | |||
<member name="M:BPA.MES.Base.Application.Services.AGVService.Services.IAGVThirdPartyService.ExecuteReplyAsync(BPA.MES.Base.Application.Services.AGVService.Dtos.AGVExecuteReplyRequest)"> | |||
<summary> | |||
任务回调 | |||
</summary> | |||
<param name="input"></param> | |||
<returns></returns> | |||
</member> | |||
<member name="M:BPA.MES.Base.Application.Services.AGVService.Services.IAGVThirdPartyService.LoadAndUnloadAsync(BPA.MES.Base.Application.Services.AGVService.Dtos.AGVLoadAndUnloadRequest)"> | |||
<summary> | |||
AGV上下料交互请求 | |||
</summary> | |||
<param name="input"></param> | |||
<returns></returns> | |||
</member> | |||
<member name="T:BPA.MES.Base.Application.Services.AgvPointService"> | |||
<summary> | |||
名 称 :AGV点位管理 | |||
@@ -4496,6 +4759,16 @@ | |||
数量 | |||
</summary> | |||
</member> | |||
<member name="T:BPA.MES.Base.Application.Services.OrderService.Dtos.OrderWorkLimit"> | |||
<summary> | |||
成品数量限制 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.MES.Base.Application.Services.OrderService.Dtos.OrderWorkLimit.FinalslId"> | |||
<summary> | |||
成品 | |||
</summary> | |||
</member> | |||
<member name="M:BPA.MES.Base.Application.Services.OrderService.Service.IOrderService.PagedList(BPA.MES.Base.Application.Services.OrderService.Dtos.OrderQueryPageInput)"> | |||
<summary> | |||
分页列表 | |||
@@ -4530,6 +4803,13 @@ | |||
<param name="inputDto"></param> | |||
<returns></returns> | |||
</member> | |||
<member name="M:BPA.MES.Base.Application.Services.OrderService.Service.IOrderService.GetFinalslLImit(System.String)"> | |||
<summary> | |||
获取成品剩余制作数量 | |||
</summary> | |||
<param name="id"></param> | |||
<returns></returns> | |||
</member> | |||
<member name="M:BPA.MES.Base.Application.Services.OrderService.Service.OrderService.PagedList(BPA.MES.Base.Application.Services.OrderService.Dtos.OrderQueryPageInput)"> | |||
<summary> | |||
分页列表 | |||
@@ -4571,6 +4851,19 @@ | |||
<param name="inputDto"></param> | |||
<returns></returns> | |||
</member> | |||
<member name="M:BPA.MES.Base.Application.Services.OrderService.Service.OrderService.VerifyOrderProduct(System.Collections.Generic.List{BPA.MES.Base.Application.Services.OrderService.Dtos.OrderInfoBaseDto})"> | |||
<summary> | |||
生成工单时验证成品数量 | |||
</summary> | |||
<param name="inputDto"></param> | |||
</member> | |||
<member name="M:BPA.MES.Base.Application.Services.OrderService.Service.OrderService.GetFinalslLImit(System.String)"> | |||
<summary> | |||
获取成品剩余制作数量 | |||
</summary> | |||
<param name="id"></param> | |||
<returns></returns> | |||
</member> | |||
<member name="T:BPA.MES.Base.Application.Services.GroupInfoDto"> | |||
<summary> | |||
名 称 :产品分组 | |||
@@ -5574,9 +5867,23 @@ | |||
<param name="inputDto"></param> | |||
<returns></returns> | |||
</member> | |||
<member name="M:BPA.MES.Base.Application.Services.ReportService.IReportService.GetMaterialsReport(BPA.MES.Base.Application.Services.ReportService.Dtos.MaterialsInputDto)"> | |||
<summary> | |||
获取物料统计 | |||
</summary> | |||
<param name="inputDto"></param> | |||
<returns></returns> | |||
</member> | |||
<member name="M:BPA.MES.Base.Application.Services.ReportService.ReportService.GetProductReport(BPA.MES.Base.Application.Services.ReportService.Dtos.ProductInputDto)"> | |||
<summary> | |||
获取产品生产统计 | |||
获取成品生产统计 | |||
</summary> | |||
<param name="inputDto"></param> | |||
<returns></returns> | |||
</member> | |||
<member name="M:BPA.MES.Base.Application.Services.ReportService.ReportService.GetMaterialsReport(BPA.MES.Base.Application.Services.ReportService.Dtos.MaterialsInputDto)"> | |||
<summary> | |||
获取物料统计 | |||
</summary> | |||
<param name="inputDto"></param> | |||
<returns></returns> | |||
@@ -5828,6 +6135,16 @@ | |||
工单工艺步骤Id | |||
</summary> | |||
</member> | |||
<member name="P:BPA.MES.Base.Application.Services.WorkInfoCraftstepRecordUpdateInput.WorkId"> | |||
<summary> | |||
工单Id | |||
</summary> | |||
</member> | |||
<member name="P:BPA.MES.Base.Application.Services.WorkInfoCraftstepRecordUpdateInput.PotNum"> | |||
<summary> | |||
锅数 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.MES.Base.Application.Services.WorkInfoCraftstepRecordUpdateInput.Status"> | |||
<summary> | |||
状态 | |||
@@ -5931,6 +6248,21 @@ | |||
主键 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.MES.Base.Application.Services.WorkInfoQueryInput.Status"> | |||
<summary> | |||
工单状态 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.MES.Base.Application.Services.WorkInfoQueryInput.StartTime"> | |||
<summary> | |||
起始时间 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.MES.Base.Application.Services.WorkInfoQueryInput.EndTime"> | |||
<summary> | |||
结束时间 | |||
</summary> | |||
</member> | |||
<member name="T:BPA.MES.Base.Application.Services.WorkInfoQueryPageInput"> | |||
<summary> | |||
分页 | |||
@@ -5946,6 +6278,21 @@ | |||
编码 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.MES.Base.Application.Services.WorkInfoQueryPageInput.Status"> | |||
<summary> | |||
工单状态 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.MES.Base.Application.Services.WorkInfoQueryPageInput.StartTime"> | |||
<summary> | |||
起始时间 | |||
</summary> | |||
</member> | |||
<member name="P:BPA.MES.Base.Application.Services.WorkInfoQueryPageInput.EndTime"> | |||
<summary> | |||
结束时间 | |||
</summary> | |||
</member> | |||
<member name="T:BPA.MES.Base.Application.Services.WorkPublishInput"> | |||
<summary> | |||
工单下发 | |||
@@ -39,7 +39,6 @@ namespace BPA.MES.Base.Application | |||
try | |||
{ | |||
payload.MessageId = messageId; | |||
payload.MessageId = MessageID.WorkOrderIssued; | |||
payload.MsgVersion = new Version(1, 0, 0, 0); | |||
MsgPackage mp = new MsgPackage(); | |||
mp.Message = payload; | |||
@@ -68,6 +67,8 @@ namespace BPA.MES.Base.Application | |||
} | |||
return result; | |||
} | |||
} | |||
public class MqttResult | |||
@@ -5,7 +5,10 @@ | |||
public const int DevcieControl = 1;//设备控制ID | |||
public const int WorkOrderIssued = 2;//工单下发ID | |||
public const int DeviceData = 3;//设备上报数据 | |||
public const int TaskState = 4;//AGV任务状态上报 | |||
public const int LoadAndUnload = 8;//AGV上下料上报 | |||
public const int PowerId = 12;// 权限验证 | |||
public const int StateChange = 13;//状态改变 | |||
} | |||
} | |||
@@ -26,6 +26,17 @@ | |||
/// 工单状态(信息系统 --> 中控系统) | |||
/// </summary> | |||
public const string STWorkState = "BPAProline/CentralControl/Proline/WorkState"; | |||
/// <summary> | |||
/// 任务下发成功 回调 | |||
/// </summary> | |||
public const string ExecuteReplyTopic = "robotjob.report"; | |||
/// <summary> | |||
/// 上下料回调 | |||
/// </summary> | |||
public const string LoadAndUnloadTopic = "rollerjob.upstreamrequest"; | |||
} | |||
} |
@@ -0,0 +1,278 @@ | |||
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 AGVExecuteReplyRequest | |||
{ | |||
public AGVExecuteReplyDto Event { get; set; } | |||
} | |||
public class AGVExecuteReplyMQTT: IMessage | |||
{ | |||
public AGVExecuteReplyDto Event { get; set; } | |||
public int MessageId { get; set; } | |||
public Version MsgVersion { get; set; } | |||
} | |||
public class AGVLoadAndUnloadRequest | |||
{ | |||
public AGVLoadAndUnloadDto Event { get; set; } | |||
} | |||
public class AGVLoadAndUnloadMQTT : IMessage | |||
{ | |||
public AGVLoadAndUnloadDto Event { get; set; } | |||
public int MessageId { get; set; } | |||
public Version MsgVersion { get; set; } | |||
} | |||
/// <summary> | |||
/// 任务完成回报Dto | |||
/// </summary> | |||
public class AGVExecuteReplyDto | |||
{ | |||
/// <summary> | |||
/// 上游系统任务号,全局唯一 | |||
/// </summary> | |||
public string robotJobId { get; set; } | |||
/// <summary> | |||
/// 仓库编号 | |||
/// </summary> | |||
public long warehouseId { get; set; } | |||
/// <summary> | |||
/// 任务快仓系统编号 | |||
/// </summary> | |||
public string jobId { get; set; } | |||
/// <summary> | |||
/// | |||
/// </summary> | |||
public string state { get; set; } | |||
/// <summary> | |||
/// 内部任务类型 | |||
/// </summary> | |||
public string jobType { get; set; } | |||
/// <summary> | |||
/// 数据字段 | |||
/// </summary> | |||
public PointToPoint jobData { get; set; } | |||
} | |||
/// <summary> | |||
/// 上下料交互请求DTO | |||
/// </summary> | |||
public class AGVLoadAndUnloadDto | |||
{ | |||
/// <summary> | |||
/// AGV编号 | |||
/// </summary> | |||
public string agvCode { get; set; } | |||
/// <summary> | |||
/// 容器编号,如果一次上/下多个容器,则多个容器用英文逗号分隔 | |||
/// </summary> | |||
public string containerCode { get; set; } | |||
/// <summary> | |||
/// 上游设备ID | |||
/// </summary> | |||
public long equipmentId { get; set; } | |||
/// <summary> | |||
/// 上游设备ID,多个用英文逗号分隔 | |||
/// </summary> | |||
public string equipmentIds { get; set; } | |||
/// <summary> | |||
/// 快仓任务编号 | |||
/// </summary> | |||
public string jobId { get; set; } | |||
/// <summary> | |||
/// 消息ID | |||
/// </summary> | |||
public string msgId { get; set; } | |||
/// <summary> | |||
/// 交互阶段LOAD:上料阶段 UNLOAD:下料阶段 | |||
/// </summary> | |||
public string command { get; set; } | |||
/// <summary> | |||
/// 上游任务号 | |||
/// </summary> | |||
public string robotJobId { get; set; } | |||
} | |||
/// <summary> | |||
/// 货到货 | |||
/// </summary> | |||
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, | |||
POINT_ROLLER_MOVE=2 | |||
} | |||
} |
@@ -0,0 +1,124 @@ | |||
using BPA.AGV; | |||
using BPA.MES.Base.Application.Services.AGVService.Dtos; | |||
using MQTTnet.Client; | |||
using MQTTnet.Client.Publishing; | |||
using Newtonsoft.Json; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPA.MES.Base.Application.Services.AGVService.Services | |||
{ | |||
[AllowAnonymous, NonUnify] | |||
[ApiDescriptionSettings("AGV管理", Name = "AgvThirdParty", Tag = "AGV第三方api", KeepName = true, SplitCamelCase = true, KeepVerb = true)] | |||
public class AGVThirdPartyService:IAGVThirdPartyService, ITransient, IDynamicApiController | |||
{ | |||
private readonly AGVHandler _aGVHandler; | |||
private readonly IMQTTService _MQTTService; | |||
public AGVThirdPartyService(AGVHandler aGVHandler, IMQTTService MQTTService) | |||
{ | |||
_aGVHandler = aGVHandler; | |||
_MQTTService = MQTTService; | |||
} | |||
/// <summary> | |||
/// 下发任务 | |||
/// </summary> | |||
/// <param name="cExecuteRequest"></param> | |||
/// <returns></returns> | |||
[HttpPost] | |||
public async Task<KCResponse> ExecuteAsync(KCExecuteRequest cExecuteRequest) | |||
{ | |||
if (cExecuteRequest.JobData != null) | |||
cExecuteRequest = new KCExecuteRequest | |||
{ | |||
Url = cExecuteRequest.Url,//http://[IP:Port]/api/quicktron/wcs/standardized.robot.job.submit | |||
RobotJobId = Guid.NewGuid().ToString(), | |||
WarehouseId = cExecuteRequest.WarehouseId, | |||
JobPriority = cExecuteRequest.JobPriority, | |||
JobPriorityType = cExecuteRequest.JobPriorityType, | |||
JobData = new KCJobDataRequest | |||
{ | |||
StartPoint = cExecuteRequest.JobData.StartPoint, | |||
EndPoint = cExecuteRequest.JobData.EndPoint, | |||
} | |||
}; | |||
return await _aGVHandler.ExecuteAsync(cExecuteRequest); | |||
} | |||
/// <summary> | |||
/// 取消任务 | |||
/// </summary> | |||
/// <param name="kCCancelRequest"></param> | |||
/// <returns></returns> | |||
[HttpPost] | |||
public async Task<KCResponse> CancelAsync(KCCancelRequest kCCancelRequest) | |||
{ | |||
//http://[IP:Port]/api/quicktron/wcs/standardized.robot.job.cancel | |||
return await _aGVHandler.CancelAsync(kCCancelRequest); | |||
} | |||
/// <summary> | |||
/// | |||
/// </summary> | |||
/// <param name="rollerJobRequest"></param> | |||
/// <returns></returns> | |||
public async Task<RollerJobResponse> RollerJobExecuteAsync(RollerJobRequest rollerJobRequest) | |||
{ | |||
//http://[IP:Port]/api/quicktron/wcs/standardized.roller.job.upstream.response | |||
return await _aGVHandler.RollerJobExecuteAsync(rollerJobRequest); | |||
} | |||
/// <summary> | |||
/// 任务回调 | |||
/// </summary> | |||
/// <param name="input"></param> | |||
/// <returns></returns> | |||
[HttpPost] | |||
public async Task<bool> ExecuteReplyAsync(AGVExecuteReplyRequest input) | |||
{ | |||
try | |||
{ | |||
var data = new AGVExecuteReplyMQTT() | |||
{ | |||
Event = input.Event, | |||
}; | |||
return await _MQTTService.MqttPublish(data, Topics.ExecuteReplyTopic, MessageID.TaskState); | |||
} | |||
catch (Exception e) | |||
{ | |||
return false; | |||
} | |||
} | |||
/// <summary> | |||
/// AGV上下料交互请求 | |||
/// </summary> | |||
/// <param name="input"></param> | |||
/// <returns></returns> | |||
[HttpPost] | |||
public async Task<bool> LoadAndUnloadAsync(AGVLoadAndUnloadRequest input) | |||
{ | |||
try | |||
{ | |||
var data = new AGVLoadAndUnloadMQTT() | |||
{ | |||
Event = input.Event, | |||
}; | |||
return await _MQTTService.MqttPublish(data, Topics.LoadAndUnloadTopic, MessageID.LoadAndUnload); | |||
} | |||
catch (Exception e) | |||
{ | |||
return false; | |||
} | |||
} | |||
} | |||
} |
@@ -0,0 +1,44 @@ | |||
using BPA.AGV; | |||
using BPA.MES.Base.Application.Services.AGVService.Dtos; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPA.MES.Base.Application.Services.AGVService.Services | |||
{ | |||
public interface IAGVThirdPartyService | |||
{ | |||
/// <summary> | |||
/// 下发任务 | |||
/// </summary> | |||
/// <param name="cExecuteRequest"></param> | |||
/// <returns></returns> | |||
Task<KCResponse> ExecuteAsync(KCExecuteRequest cExecuteRequest); | |||
/// <summary> | |||
/// 取消任务 | |||
/// </summary> | |||
/// <param name="kCCancelRequest"></param> | |||
/// <returns></returns> | |||
Task<KCResponse> CancelAsync(KCCancelRequest kCCancelRequest); | |||
/// <summary> | |||
/// 任务回调 | |||
/// </summary> | |||
/// <param name="input"></param> | |||
/// <returns></returns> | |||
Task<bool> ExecuteReplyAsync(AGVExecuteReplyRequest input); | |||
/// <summary> | |||
/// AGV上下料交互请求 | |||
/// </summary> | |||
/// <param name="input"></param> | |||
/// <returns></returns> | |||
Task<bool> LoadAndUnloadAsync(AGVLoadAndUnloadRequest input); | |||
} | |||
} |
@@ -61,4 +61,18 @@ namespace BPA.MES.Base.Application.Services.OrderService.Dtos | |||
public decimal Number { get; set; } | |||
public WorkOrderStatusEnum? Status { get; set; } | |||
} | |||
/// <summary> | |||
/// 成品数量限制 | |||
/// </summary> | |||
public class OrderWorkLimit | |||
{ | |||
/// <summary> | |||
/// 成品 | |||
/// </summary> | |||
public string FinalslId { get; set; } | |||
public decimal Limit { get; set; } | |||
} | |||
} |
@@ -45,6 +45,13 @@ namespace BPA.MES.Base.Application.Services.OrderService.Service | |||
/// <returns></returns> | |||
Task<bool> OrderAssociationWork(List<OrderInfoBaseDto> inputDto); | |||
/// <summary> | |||
/// 获取成品剩余制作数量 | |||
/// </summary> | |||
/// <param name="id"></param> | |||
/// <returns></returns> | |||
Task<List<OrderWorkLimit>> GetFinalslLImit(string OrderId); | |||
Task<bool> CodeFirst(); | |||
} | |||
} |
@@ -220,6 +220,8 @@ namespace BPA.MES.Base.Application.Services.OrderService.Service | |||
{ | |||
var result = false; | |||
var orderId = inputDto.Select(x => x.OrderId).First(); | |||
//验证 | |||
VerifyOrderProduct(inputDto); | |||
_dbContext.Ado.BeginTran(); | |||
try | |||
@@ -292,6 +294,72 @@ namespace BPA.MES.Base.Application.Services.OrderService.Service | |||
return true; | |||
} | |||
/// <summary> | |||
/// 生成工单时验证成品数量 | |||
/// </summary> | |||
/// <param name="inputDto"></param> | |||
private void VerifyOrderProduct(List<OrderInfoBaseDto> inputDto) | |||
{ | |||
var orderId = inputDto.Select(x => x.OrderId).First(); | |||
var data=_dbContext.Queryable<OrderInfoEntity, Pztj_FinalsInfoEntity>((a,b)=>new JoinQueryInfos( | |||
JoinType.Left,a.FinalslId==b.Id | |||
)).Where((a,b)=>a.OrderId==orderId). | |||
Select((a,b)=>new | |||
{ | |||
orderId = a.OrderId, | |||
ProductId = a.FinalslId, | |||
productName = b.Name, | |||
a.Number | |||
}).ToList(); | |||
foreach (var item in data) | |||
{ | |||
var productCount = inputDto.Where(x => x.FinalslId == item.ProductId).Sum(x => x.Number); | |||
var count= item.Number - productCount; | |||
if (count<0) | |||
{ | |||
throw Oops.Bah($"{item.productName}成品生成工单数量大于订单数量,多【{System.Math.Abs(count)}】"); | |||
} | |||
if (count>0) | |||
{ | |||
throw Oops.Bah($"{item.productName}成品生成工单数量小于订单数量,差【{count}】"); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取成品剩余制作数量 | |||
/// </summary> | |||
/// <param name="id"></param> | |||
/// <returns></returns> | |||
public async Task<List<OrderWorkLimit>> GetFinalslLImit(string OrderId) | |||
{ | |||
var result = new List<OrderWorkLimit>(); | |||
var orderInfo=_dbContext.Queryable<OrderInfoEntity>().Where(x=>x.OrderId==OrderId).ToList(); | |||
var list=_dbContext.Queryable<OrderWorkEntity , Pztj_WorkInfoEntity>((a,b)=>new JoinQueryInfos( | |||
JoinType.Left,a.WorkId==b.Id)) | |||
.Where((a, b) => a.OrderId==OrderId) | |||
.Select((a,b)=>new OrderWorkLimit() | |||
{ | |||
FinalslId=b.FinalId, | |||
Limit=0 | |||
}).ToList(); | |||
foreach (var item in orderInfo) | |||
{ | |||
var data=list.Where(x=>x.FinalslId==item.FinalslId).ToList(); | |||
result.Add(new OrderWorkLimit() | |||
{ | |||
FinalslId=item.FinalslId, | |||
Limit=item.Number-data.Sum(x=>x.Limit), | |||
}); | |||
} | |||
return result; | |||
} | |||
[HttpGet] | |||
public Task<bool> CodeFirst() | |||
@@ -0,0 +1,15 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPA.MES.Base.Application.Services.ReportService.Dtos | |||
{ | |||
public class MaterialsInputDto | |||
{ | |||
public DateTime? StartTime { get; set; } | |||
public DateTime? EndTime { get; set; } | |||
public string MaterialsName { get; set; } | |||
} | |||
} |
@@ -0,0 +1,15 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace BPA.MES.Base.Application.Services.ReportService.Dtos | |||
{ | |||
public class MaterialsOutDto | |||
{ | |||
public string MaterialId { get; set; } | |||
public string MaterialName { get; set; } | |||
public decimal Count { get; set; } | |||
} | |||
} |
@@ -15,5 +15,12 @@ namespace BPA.MES.Base.Application.Services.ReportService | |||
/// <param name="inputDto"></param> | |||
/// <returns></returns> | |||
Task<List<ProductOutDto>> GetProductReport(ProductInputDto inputDto); | |||
/// <summary> | |||
/// 获取物料统计 | |||
/// </summary> | |||
/// <param name="inputDto"></param> | |||
/// <returns></returns> | |||
Task<List<MaterialsOutDto>> GetMaterialsReport(MaterialsInputDto inputDto); | |||
} | |||
} |
@@ -18,7 +18,7 @@ namespace BPA.MES.Base.Application.Services.ReportService | |||
} | |||
/// <summary> | |||
/// 获取产品生产统计 | |||
/// 获取成品生产统计 | |||
/// </summary> | |||
/// <param name="inputDto"></param> | |||
/// <returns></returns> | |||
@@ -46,5 +46,70 @@ namespace BPA.MES.Base.Application.Services.ReportService | |||
return res; | |||
} | |||
/// <summary> | |||
/// 获取物料统计 | |||
/// </summary> | |||
/// <param name="inputDto"></param> | |||
/// <returns></returns> | |||
[HttpPost] | |||
public async Task<List<MaterialsOutDto>> GetMaterialsReport(MaterialsInputDto inputDto) | |||
{ | |||
var result = new List<MaterialsOutDto>(); | |||
var res = await _dbContext.Queryable<Pztj_WorkInfoEntity, Pztj_WorkInfoStatusEntity, Pztj_FinalsInfoEntity> | |||
((a, b, c) => | |||
new JoinQueryInfos( | |||
JoinType.Left, a.Id == b.WorkId, | |||
JoinType.Left, a.FinalId == c.Id) | |||
) | |||
.Where((a, b, c) => b.Status != WorkOrderStatusEnum.Draft) | |||
.WhereIF(inputDto.StartTime.HasVal(), (a, b, c) => b.CreateTime >= inputDto.StartTime.Value) | |||
.WhereIF(inputDto.EndTime.HasVal(), (a, b, c) => b.CreateTime >= inputDto.EndTime.Value) | |||
.Select((a, b, c) => new | |||
{ | |||
ProductId = a.FinalId, | |||
Count = SqlFunc.AggregateSum(Convert.ToInt32(a.Number)), | |||
c.RecipeId | |||
}).ToListAsync(); | |||
var recipeId = res.Select(x => x.RecipeId).ToList(); | |||
var recipes = await _dbContext.Queryable<RecipeMaterialEntity>() | |||
.Where(x => recipeId.Contains(x.RecipesId)) | |||
.Select(x => new | |||
{ | |||
x.MaterialId, | |||
x.Weight, | |||
x.RecipesId | |||
}) .ToListAsync(); | |||
var materialsId= recipes.Select(x => x.MaterialId).ToList(); | |||
var materials = await _dbContext.Queryable<Pztj_MaterialsInfoEntity>() | |||
.Where(x=> materialsId.Contains(x.Id)) | |||
.WhereIF(!string.IsNullOrEmpty(inputDto.MaterialsName),x=>x.Name.Contains(inputDto.MaterialsName)) | |||
.ToListAsync(); | |||
foreach (var item in materials) | |||
{ | |||
var count = 0; | |||
foreach (var item2 in res.GroupBy(x=>x.RecipeId)) | |||
{ | |||
var data = recipes.Where(x=>x.RecipesId==item2.Key &&x.MaterialId==item.Id).FirstOrDefault(); | |||
count=item2.First().Count*Convert.ToInt32(data==null? 0: data.Weight); | |||
} | |||
result.Add(new MaterialsOutDto() | |||
{ | |||
MaterialId=item.Id, | |||
MaterialName=item.Name, | |||
Count= count, | |||
}); | |||
} | |||
return result; | |||
} | |||
} | |||
} |
@@ -49,6 +49,14 @@ | |||
/// </summary> | |||
public string WorkCraftstepId { get; set; } | |||
/// <summary> | |||
/// 工单Id | |||
/// </summary> | |||
public string WorkId { get; set; } | |||
/// <summary> | |||
/// 锅数 | |||
/// </summary> | |||
public string PotNum { get; set; } | |||
/// <summary> | |||
/// 状态 | |||
/// </summary> | |||
public RecipeStatus Status { get; set; } | |||
@@ -73,6 +73,18 @@ | |||
/// 主键 | |||
/// </summary> | |||
public string Id { get; set; } | |||
/// <summary> | |||
/// 工单状态 | |||
/// </summary> | |||
public WorkOrderStatusEnum?[] Status { get; set; } | |||
/// <summary> | |||
/// 起始时间 | |||
/// </summary> | |||
public DateTime? StartTime { get; set; } | |||
/// <summary> | |||
/// 结束时间 | |||
/// </summary> | |||
public DateTime? EndTime { get; set; } | |||
} | |||
/// <summary> | |||
/// 分页 | |||
@@ -87,6 +99,18 @@ | |||
/// 编码 | |||
/// </summary> | |||
public string Id { get; set; } | |||
/// <summary> | |||
/// 工单状态 | |||
/// </summary> | |||
public WorkOrderStatusEnum?[] Status { get; set; } | |||
/// <summary> | |||
/// 起始时间 | |||
/// </summary> | |||
public DateTime? StartTime { get; set; } | |||
/// <summary> | |||
/// 结束时间 | |||
/// </summary> | |||
public DateTime? EndTime { get; set; } | |||
} | |||
/// <summary> | |||
/// 工单下发 | |||
@@ -140,6 +140,9 @@ namespace BPA.MES.Base.Application.Services.WorkInfoService.Services | |||
.LeftJoin<Pztj_WorkInfoStatusEntity>((a, b, c, d) => d.Id == SqlFunc.Subqueryable<Pztj_WorkInfoStatusEntity>().Where(s => s.WorkId == a.Id).OrderByDesc(s => s.CreateTime).Select(s => s.Id)) | |||
.WhereIF(!string.IsNullOrEmpty(input.Name), (a, b, c, d) => b.Name.Contains(input.Name)) | |||
.WhereIF(!string.IsNullOrEmpty(input.Id), (a, b, c, d) => a.Id.Contains(input.Id)) | |||
.WhereIF(input.Status != null, (a, b, c, d) => input.Status.Contains(d.Status)) | |||
.WhereIF(input.StartTime!=null,(a, b, c, d) => input.StartTime<= Convert.ToDateTime(a.CreateTime)) | |||
.WhereIF(input.EndTime != null, (a, b, c, d) => input.EndTime.Value.AddHours(23).AddMinutes(59).AddSeconds(59) >= Convert.ToDateTime(a.CreateTime)) | |||
.Select((a, b, c, d) => new WorkInfoOutput | |||
{ | |||
Id = a.Id.SelectAll(), | |||
@@ -163,6 +166,9 @@ namespace BPA.MES.Base.Application.Services.WorkInfoService.Services | |||
.LeftJoin<Pztj_WorkInfoStatusEntity>((a, b, c, d) => d.Id == SqlFunc.Subqueryable<Pztj_WorkInfoStatusEntity>().Where(s => s.WorkId == a.Id).OrderByDesc(s => s.CreateTime).Select(s => s.Id)) | |||
.WhereIF(!string.IsNullOrEmpty(input.Name), (a, b, c, d) => b.Name.Contains(input.Name)) | |||
.WhereIF(!string.IsNullOrEmpty(input.Id), (a, b, c, d) => a.Id.Contains(input.Id)) | |||
.WhereIF(input.Status != null, (a, b, c, d) => input.Status.Contains(d.Status)) | |||
.WhereIF(input.StartTime != null, (a, b, c, d) => input.StartTime <= Convert.ToDateTime(a.CreateTime)) | |||
.WhereIF(input.EndTime != null, (a, b, c, d) => input.EndTime.Value.AddHours(23).AddMinutes(59).AddSeconds(59) >= Convert.ToDateTime(a.CreateTime)) | |||
.Select((a, b, c, d) => new WorkInfoOutput | |||
{ | |||
Id = a.Id.SelectAll(), | |||
@@ -359,15 +365,30 @@ namespace BPA.MES.Base.Application.Services.WorkInfoService.Services | |||
[HttpPost] | |||
public async Task<bool> UpdateWorkCraftStepsStatus(WorkInfoCraftstepRecordUpdateInput input) | |||
{ | |||
WorkInfoCraftstepRecordEntity entity = new() | |||
var entityFrist = await _dbContext.Queryable<WorkInfoCraftstepRecordEntity>().Where(x => x.Id == input.WorkCraftstepId).FirstAsync(); | |||
if (!string.IsNullOrEmpty(input.WorkId)) | |||
{ | |||
Id = input.WorkCraftstepId, | |||
Status = input.Status, | |||
UpdateTime = DateTime.Now | |||
}; | |||
bool res = await _dbContext.Updateable(entity).IgnoreColumns(true).ExecuteCommandHasChangeAsync(); | |||
return res; | |||
bool res = await _dbContext.Updateable<WorkInfoCraftstepRecordEntity>() | |||
.SetColumns(x=>x.Status==input.Status) | |||
.SetColumns(x=>x.UpdateTime==DateTime.Now).IgnoreColumns(true).Where(x=>x.WorkId==input.WorkId && x.PotNum==input.PotNum).ExecuteCommandHasChangeAsync(); | |||
return res; | |||
} | |||
else | |||
{ | |||
WorkInfoCraftstepRecordEntity entity = new() | |||
{ | |||
Id = input.WorkCraftstepId, | |||
Status = input.Status, | |||
UpdateTime = DateTime.Now, | |||
Step = entityFrist.Step | |||
}; | |||
bool res = await _dbContext.Updateable(entity).IgnoreColumns(true).ExecuteCommandHasChangeAsync(); | |||
return res; | |||
} | |||
} | |||
/// <summary> | |||
/// 强制结束工单 | |||
/// </summary> | |||
@@ -13,6 +13,9 @@ | |||
</ItemGroup> | |||
<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" /> | |||
@@ -1,11 +1,21 @@ | |||
using BPA.MES.Base.Application; | |||
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; | |||
@@ -14,6 +24,7 @@ public class Startup : AppStartup | |||
{ | |||
public void ConfigureServices(IServiceCollection services) | |||
{ | |||
services.AddConsoleFormatter(); | |||
services.AddJwt<JwtHandler>(enableGlobalAuthorize: true); | |||
services.AddCorsAccessor(); | |||
@@ -30,6 +41,50 @@ public class Startup : AppStartup | |||
builder.AddSubscriber(typeof(ToDoEventSubscriber)); | |||
}); | |||
services.AddRemoteRequest(); | |||
services.AddWebApiClient(); | |||
services.AddAGV(op => | |||
{ | |||
op.Header = new KCOption() | |||
{ | |||
AppKey = "43", | |||
AppSecret = "12", | |||
RequestId = "43", | |||
Timestamp = "2234234324", | |||
Version = "2.9" | |||
}; | |||
op.Sign = "123456"; | |||
}); | |||
//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(); | |||
} | |||
@@ -6,7 +6,7 @@ | |||
export default { | |||
dev: { | |||
'/api/': { | |||
target: 'http://10.2.1.26:21674/api', | |||
target: 'http://localhost:5002', | |||
pathRewrite: { | |||
'/api': '/api' | |||
}, | |||
@@ -71,6 +71,7 @@ | |||
path: '/report', icon: 'SettingOutlined', name: '统计报表', | |||
routes: [ | |||
{ path: '/report/product', name: '成品统计', component: './report/product' }, | |||
{ path: '/report/material', name: '原料统计', component: './report/material' }, | |||
] | |||
}, | |||
{ path: '*', layout: false, component: './404' }, | |||
@@ -76,6 +76,17 @@ export default { | |||
}); | |||
}, | |||
/** | |||
* 获取成品可制造数量 | |||
* @param parms | |||
* @returns | |||
*/ | |||
getFinalslLImit(parms:string) { | |||
return request('/api/order/getfinalsllimit/'+parms, { | |||
method: 'get', | |||
}); | |||
}, | |||
} | |||
@@ -8,13 +8,27 @@ export default { | |||
* @param parms | |||
* @returns | |||
*/ | |||
PagedList(parms: ReportType.ProductReportInput) { | |||
PagedList(parms: ReportType.ReportInput) { | |||
return request('/api/report/getproductreport', { | |||
method: 'POST', | |||
data: { | |||
...parms, | |||
}, | |||
}); | |||
}, | |||
/** | |||
* 获取原料统计 | |||
* @param parms | |||
* @returns | |||
*/ | |||
PagedMaterialList(parms: ReportType.ReportInput) { | |||
return request('/api/report/getmaterialsreport', { | |||
method: 'POST', | |||
data: { | |||
...parms, | |||
}, | |||
}); | |||
} | |||
} |
@@ -157,7 +157,7 @@ export default () => { | |||
{ | |||
title: '主键', | |||
dataIndex: 'id', | |||
// hideInTable: true, | |||
hideInTable: true, | |||
hideInForm: true, | |||
search: true, | |||
}, | |||
@@ -167,9 +167,7 @@ export default () => { | |||
ellipsis: true, | |||
hindeInForm: true, | |||
search: false, | |||
// hideInTable: true, | |||
hideInTable: true, | |||
}, | |||
{ | |||
title: '编码', | |||
@@ -222,7 +222,7 @@ export default () => { | |||
if (res.data) { | |||
message.success('添加成功'); | |||
actionRef.current?.reload(); | |||
setIsModalOpen(false); | |||
setIsWorkModalOpen(false); | |||
} else { | |||
message.error(res.errors || '添加失败'); | |||
} | |||
@@ -478,7 +478,7 @@ export default () => { | |||
}, | |||
]} | |||
> | |||
<Select style={{ width: 200, }} disabled > | |||
<Select style={{ width: 200, }} > | |||
{productSelect.map((item) => ( | |||
<Select.Option key={item.key} value={item.key}> | |||
{item.value} | |||
@@ -522,10 +522,16 @@ export default () => { | |||
labelCol={{ span: 8 }} | |||
rules={[{ required: true, message: '请输入数量!', },]} | |||
> | |||
<Input type="number" disabled style={{ width: '110px' }} /> | |||
<Input type="number" style={{ width: '110px' }} /> | |||
</Form.Item> | |||
<MinusCircleOutlined hidden={isRead} onClick={() => remove(name)} /> | |||
</Space> | |||
))} | |||
<Form.Item> | |||
<Button type="dashed" onClick={() => add()} block icon={<PlusOutlined />}> | |||
添加产品 | |||
</Button> | |||
</Form.Item> | |||
</> | |||
)} | |||
</Form.List> | |||
@@ -0,0 +1,90 @@ | |||
import { useEffect, useRef, useState } from 'react'; | |||
import { Button, Space } from 'antd'; | |||
import { ProTable } from '@ant-design/pro-components'; | |||
import type { | |||
ActionType, ProColumns, | |||
EditableFormInstance, | |||
ProFormInstance, | |||
} from '@ant-design/pro-components'; | |||
import api from '@/api/reportService'; | |||
export default () => { | |||
const actionRef = useRef<ActionType>(); | |||
const columns: ProColumns<ReportType.MaterialReport>[] = [ | |||
{ | |||
title: 'materialId', | |||
dataIndex: 'materialId', | |||
hideInSearch: true, | |||
hideInTable:true, | |||
align: 'center', | |||
}, | |||
{ | |||
title: '成品名称', | |||
dataIndex: 'materialName', | |||
align: 'center', | |||
}, | |||
{ | |||
title: '生产数量', | |||
dataIndex: 'count', | |||
hideInSearch: true, | |||
align: 'center', | |||
}, | |||
{ | |||
title: '生产时间', | |||
dataIndex: 'dateTime', | |||
valueType: 'dateRange', | |||
hideInTable:true, | |||
align: 'center', | |||
} | |||
] | |||
return ( | |||
<ProTable<ReportType.MaterialReport> | |||
key="myTable" | |||
columns={columns} | |||
actionRef={actionRef} | |||
cardBordered | |||
request={async (params = {}) => { | |||
const jsonData: ReportType.ReportInput = { | |||
endTime:params.dateTime?params.dateTime[1]:undefined, | |||
startTime:params.dateTime?params.dateTime[0]:undefined, | |||
productName:params.productName||"" | |||
}; | |||
const response = await api.PagedMaterialList(jsonData); | |||
if (response.statusCode === 200) { | |||
return { | |||
data: response.data, | |||
success: true, | |||
total: 1, | |||
}; | |||
} else { | |||
return { | |||
data: [], | |||
success: false, | |||
total: 0, | |||
}; | |||
} | |||
}} | |||
rowKey="productId" | |||
pagination={{ | |||
pageSize: 10, | |||
}} | |||
dateFormatter="string" | |||
headerTitle="工单列表" | |||
toolBarRender={() => [ | |||
<Button | |||
key="button" | |||
type="primary" | |||
onClick={() => { | |||
}} | |||
> | |||
新建工单 | |||
</Button>, | |||
]} | |||
/> | |||
); | |||
}; |
@@ -48,7 +48,7 @@ export default () => { | |||
actionRef={actionRef} | |||
cardBordered | |||
request={async (params = {}) => { | |||
const jsonData: ReportType.ProductReportInput = { | |||
const jsonData: ReportType.ReportInput = { | |||
endTime:params.dateTime?params.dateTime[1]:undefined, | |||
startTime:params.dateTime?params.dateTime[0]:undefined, | |||
productName:params.productName||"" | |||
@@ -1,7 +1,7 @@ | |||
declare namespace ReportType { | |||
interface ProductReportInput { | |||
interface ReportInput { | |||
productName: string, | |||
startTime?:string, | |||
endTime?:string | |||
@@ -13,5 +13,12 @@ declare namespace ReportType { | |||
productName: string, | |||
count: number, | |||
} | |||
// 原料统计 | |||
interface MaterialReport { | |||
materialId: string, | |||
materialName: string, | |||
count: number, | |||
} | |||
} | |||