diff --git a/MDM/Models/Process/ProcessOperation.cs b/MDM/Models/Process/ProcessOperation.cs
index bf3778f..b13d14e 100644
--- a/MDM/Models/Process/ProcessOperation.cs
+++ b/MDM/Models/Process/ProcessOperation.cs
@@ -37,6 +37,13 @@ namespace MDM.Model.Process
[SugarColumn(ColumnName = "operation_seq", Length = 50)]
public int? OperationSeq { get; set; }
+
+ ///
+ /// 上一站工序序号(工序流转号)
+ ///
+ [SugarColumn(ColumnName = "last_operation_seq", Length = 50)]
+ public int? LastOperationSeq { get; set; }
+
///
/// 工序类别
///
diff --git a/RIZO.Model/MES/product_trace/ProductLifecycle.cs b/RIZO.Model/MES/product_trace/ProductLifecycle.cs
new file mode 100644
index 0000000..66eb260
--- /dev/null
+++ b/RIZO.Model/MES/product_trace/ProductLifecycle.cs
@@ -0,0 +1,92 @@
+namespace RIZO.Model.MES.product_trace
+{
+ ///
+ /// 产品生命周期表
+ ///
+ [SugarTable("product_lifecycle")]
+ public class ProductLifecycle
+ {
+ ///
+ /// 主键ID
+ ///
+ [SugarColumn(ColumnName = "Id", IsPrimaryKey = true, IsIdentity = true)]
+ public int Id { get; set; }
+
+ ///
+ /// 工单号
+ ///
+ [SugarColumn(ColumnName = "workorder", Length = 50)]
+ [StringLength(50)]
+ public string Workorder { get; set; }
+
+ ///
+ /// 当前状态(0 未生产,1 生产中,2 完工中,3 返工中,4报废中)
+ ///
+ [SugarColumn(ColumnName = "product_current_status")]
+ public int? ProductCurrentStatus { get; set; }
+
+ ///
+ /// 产品SN
+ ///
+ [SugarColumn(ColumnName = "product_SN", Length = 50)]
+ [StringLength(50)]
+ public string ProductSN { get; set; }
+
+ ///
+ /// 线别
+ ///
+ [SugarColumn(ColumnName = "line_code", Length = 50)]
+ [StringLength(50)]
+ public string LineCode { get; set; }
+
+ ///
+ /// 组别
+ ///
+ [SugarColumn(ColumnName = "group_code", Length = 50)]
+ [StringLength(50)]
+ public string GroupCode { get; set; }
+
+ ///
+ /// 工艺路线
+ ///
+ [SugarColumn(ColumnName = "routing_code", Length = 50)]
+ [StringLength(50)]
+ public string RoutingCode { get; set; }
+
+ ///
+ /// 产品开工时间
+ ///
+ [SugarColumn(ColumnName = "product_start_time")]
+ public DateTime? ProductStartTime { get; set; }
+
+ ///
+ /// 产品返工时间
+ ///
+ [SugarColumn(ColumnName = "product_rework_time")]
+ public DateTime? ProductReworkTime { get; set; }
+
+ ///
+ /// 产品完工时间
+ ///
+ [SugarColumn(ColumnName = "product_finish_time")]
+ public DateTime? ProductFinishTime { get; set; }
+
+ ///
+ /// 产品报废时间
+ ///
+ [SugarColumn(ColumnName = "product_scrap_time")]
+ public DateTime? ProductScrapTime { get; set; }
+
+ ///
+ /// 创建时间
+ ///
+ [SugarColumn(ColumnName = "created_time")]
+ public DateTime? CreatedTime { get; set; }
+
+ ///
+ /// 更新时间
+ ///
+ [SugarColumn(ColumnName = "updated_time")]
+ public DateTime? UpdatedTime { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/RIZO.Model/MES/product_trace/ProductPassStationRecord.cs b/RIZO.Model/MES/product_trace/ProductPassStationRecord.cs
new file mode 100644
index 0000000..02887e8
--- /dev/null
+++ b/RIZO.Model/MES/product_trace/ProductPassStationRecord.cs
@@ -0,0 +1,132 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace RIZO.Model.MES.product_trace
+{
+ ///
+ /// 过站记录表
+ ///
+ [SugarTable("product_passstation_record")]
+ public class ProductPassStationRecord
+ {
+ ///
+ /// 主键ID
+ ///
+ [SugarColumn(ColumnName = "Id", IsPrimaryKey = true, IsIdentity = true)]
+ public long Id { get; set; }
+
+ ///
+ /// 工单号
+ ///
+ [SugarColumn(ColumnName = "workorder", Length = 50)]
+ [StringLength(50)]
+ public string Workorder { get; set; }
+
+ ///
+ /// 产品SN
+ ///
+ [SugarColumn(ColumnName = "product_SN", Length = 100)]
+ [StringLength(100)]
+ public string ProductSN { get; set; }
+
+ ///
+ /// 工站code
+ ///
+ [SugarColumn(ColumnName = "workstationCode", Length = 50)]
+ [StringLength(50)]
+ public string WorkstationCode { get; set; }
+
+ ///
+ /// 工艺路线code
+ ///
+ [SugarColumn(ColumnName = "routingcode", Length = 50)]
+ [StringLength(50)]
+ public string Routingcode { get; set; }
+
+ ///
+ /// 工序code
+ ///
+ [SugarColumn(ColumnName = "operationCode", Length = 50)]
+ [StringLength(50)]
+ public string OperationCode { get; set; }
+
+ ///
+ /// 当前产品处于的生命周期
+ ///
+ [SugarColumn(ColumnName = "production_life_stage")]
+ public int? ProductionLifeStage { get; set; }
+
+ ///
+ /// 过站类型(0 入站请求,1入站完毕,2出站请求,3出站完毕)
+ ///
+ [SugarColumn(ColumnName = "passtation_type")]
+ public int? PasstationType { get; set; }
+
+ ///
+ /// 过站描述
+ ///
+ [SugarColumn(ColumnName = "passtation_description", Length = 255)]
+ [StringLength(255)]
+ public string PasstationDescription { get; set; }
+
+ ///
+ /// 生效时间
+ ///
+ [SugarColumn(ColumnName = "effect_time")]
+ public DateTime? EffectTime { get; set; }
+
+ ///
+ /// 进站时间
+ ///
+ [SugarColumn(ColumnName = "InStationTime")]
+ public DateTime? InStationTime { get; set; }
+
+ ///
+ /// 出站时间
+ ///
+ [SugarColumn(ColumnName = "OutStationTime")]
+ public DateTime? OutStationTime { get; set; }
+
+ ///
+ /// 加工时间(s)
+ ///
+ [SugarColumn(ColumnName = "DurationSeconds")]
+ public int? DurationSeconds { get; set; }
+
+ ///
+ /// 操作人
+ ///
+ [SugarColumn(ColumnName = "operator", Length = 50)]
+ [StringLength(50)]
+ public string Operator { get; set; }
+
+ ///
+ /// 结果代码1 是OK 其他NG
+ ///
+ [SugarColumn(ColumnName = "result_code")]
+ public int? ResultCode { get; set; }
+
+ ///
+ /// 结果描述
+ ///
+ [SugarColumn(ColumnName = "result_description", Length = 255)]
+ [StringLength(255)]
+ public string ResultDescription { get; set; }
+
+ ///
+ /// 创建时间
+ ///
+ [SugarColumn(ColumnName = "created_time")]
+ public DateTime? CreatedTime { get; set; }
+
+ ///
+ /// 更新时间
+ ///
+ [SugarColumn(ColumnName = "updated_time")]
+ public DateTime? UpdatedTime { get; set; }
+ }
+}
diff --git a/RIZO.Service/PLCBackground/PlcConntectHepler.cs b/RIZO.Service/PLCBackground/PlcConntectHepler.cs
index 7b7ec49..8da255a 100644
--- a/RIZO.Service/PLCBackground/PlcConntectHepler.cs
+++ b/RIZO.Service/PLCBackground/PlcConntectHepler.cs
@@ -1,7 +1,8 @@
-using System;
+using S7.Net; // 确保引用 S7.Net 库
+using System;
+using System.Text;
using System.Threading;
using System.Threading.Tasks;
-using S7.Net; // 确保引用 S7.Net 库
namespace RIZO.Service.PLC
{
@@ -60,8 +61,15 @@ namespace RIZO.Service.PLC
}
}
}
+ ///
+ /// 读取指定类型数据
+ ///
+ ///
+ ///
+ ///
+ ///
- public async Task