From e67802cd15e273da46bfb734e339a947b7d1eceb Mon Sep 17 00:00:00 2001
From: zhangqian <zhangqian@123.com>
Date: 星期五, 15 九月 2023 16:01:04 +0800
Subject: [PATCH] debug
---
model/common/common.go | 79 +++++++++++++++++++++++++++++++++++++--
1 files changed, 75 insertions(+), 4 deletions(-)
diff --git a/model/common/common.go b/model/common/common.go
index 4bbc606..5eafc0d 100644
--- a/model/common/common.go
+++ b/model/common/common.go
@@ -1,6 +1,9 @@
package common
-import "github.com/shopspring/decimal"
+import (
+ "apsClient/constvar"
+ "github.com/shopspring/decimal"
+)
// 鎺掔▼浠诲姟涓嬪彂
type (
@@ -44,9 +47,10 @@
StartTime int64 `gorm:"comment:璁″垝寮�濮嬫椂闂�" json:"startTime"`
EndTime int64 `gorm:"comment:璁″垝缁撴潫鏃堕棿" json:"endTime"`
WorkHours decimal.Decimal `gorm:"type:decimal(35,18);comment:宸ユ椂" json:"workHours"`
- InputMaterials []*ProcedureMaterial `json:"inputMaterials"` // 杈撳叆鐗╂枡鍒楄〃
- OutputMaterials []*ProcedureMaterial `json:"outputMaterials"` // 杈撳嚭鐗╂枡鍒楄〃
- Workers []*ProcedureWorker `json:"workers"` // 浜哄憳鍒楄〃
+ InputMaterials []*ProcedureMaterial `json:"inputMaterials"` // 杈撳叆鐗╂枡鍒楄〃
+ OutputMaterials []*ProcedureMaterial `json:"outputMaterials"` // 杈撳嚭鐗╂枡鍒楄〃
+ Workers []*ProcedureWorker `json:"workers"` // 浜哄憳鍒楄〃
+ AllProcedureNames []string `json:"allProcedureNames"` // 鎵�灞炲伐鍗曞伐搴忓垪琛�
}
DeliverScheduleTask struct {
@@ -54,3 +58,70 @@
Procedures []*ProductProcedure `json:"procedures"` // 宸ュ簭鍒楄〃
}
)
+
+// PLC鍐欏叆鍦板潃
+type (
+ RequestPlcAddress struct {
+ DeviceId string
+ }
+ ResponsePlcAddress struct {
+ KeyData []byte
+ AddressData []byte
+ DeviceId string
+ PlcAddressList []*PlcAddress
+ PlcConfig PlcConfig
+ }
+
+ PlcConfig struct {
+ Brand string `gorm:"type:varchar(191);comment:PLC鍝佺墝" json:"brand"`
+ Method constvar.PlcMethod `gorm:"type:varchar(191);comment:鎺ュ彛鏂瑰紡" json:"method"`
+ Address string `gorm:"type:varchar(191);comment:PLC鍦板潃" json:"address"` //plc ip鍦板潃锛� method = modbusTCP鐢�
+ Port int `gorm:"type:int(11);comment:绔彛" json:"port"` //plc 绔彛鍙凤紝 method = modbusTCP鐢�
+ BaudRate int `gorm:"type:int(11);comment:娉㈢壒鐜�" json:"baudRate"` //涓插彛娉㈢壒鐜囷紝 method = serial鏃� 鐢�
+ SerialName string `gorm:"type:int(11);comment:涓插彛鍚嶇О" json:"serialName"` //涓插彛鍚嶇О锛宮ethod = serial鏃� 鐢�
+ IsOpen bool `gorm:"type:tinyint(1);comment:鏄惁寮�鍚�" json:"isOpen"`
+ Detail string `gorm:"type:varchar(2048);comment:鏁版嵁璇︽儏" json:"-"`
+ Details []*PlcAddress `gorm:"-" json:"details"`
+ }
+
+ PlcAddress struct {
+ DeviceID string `json:"deviceID"` // 璁惧id
+ Position int `json:"position"` // 鐢熶骇浣嶇疆锛屼竴涓満鍣ㄥ彲鑳芥湁澶氫釜鏈轰綅锛岄渶瑕佸垎鍒厤缃畃lc鍦板潃
+ StartAddress int `json:"startAddress"` // 鏁版嵁璧峰鍦板潃
+ Length int `json:"length"` // 鏁版嵁闀垮害
+ Type string `json:"type"` // 鏁版嵁绫诲瀷
+ FieldName constvar.PlcStartAddressType `json:"fieldName"` // 瀵瑰簲绯荤粺瀛楁锛屽畬鎴愰噺鎴栨�婚噺
+ }
+)
+
+// 宸ヨ壓鍙傛暟
+type (
+ RequestProcessParams struct {
+ WorkOrder string `json:"workOrder,omitempty" form:"workOrder"` //宸ュ簭缂栧彿
+ OrderId string `json:"orderId"` // 璁㈠崟鍙�
+ Product string `json:"password"` // 浜у搧
+ Procedure string `json:"procedure"` // 宸ュ簭
+ Device string `json:"device"` // 璁惧
+ DeviceId string `json:"deviceId" gorm:"-"` //鐢ㄤ簬杩囨护鑾峰彇nsq娑堟伅
+ }
+ ResponseProcessParams struct {
+ Number string `json:"number"` //宸ヨ壓妯″瀷缂栧彿
+ OrderId string `json:"orderId"` //璁㈠崟id
+ Product string `json:"product"` //浜у搧鍚嶇О
+ Procedure string `json:"procedure"` //宸ュ簭
+ WorkOrder string `json:"workOrder"` //宸ュ崟
+ Device string `json:"device"` //璁惧
+ Params string `json:"params"`
+ ParamsMap map[string]interface{} `json:"paramsMap"`
+ DeviceId string `json:"deviceId" gorm:"-"` //鐢ㄤ簬杩囨护鑾峰彇nsq娑堟伅
+ }
+)
+
+// MsgTaskStatusUpdate 浠诲姟鐘舵�佹敼鍙�
+type MsgTaskStatusUpdate struct {
+ WorkOrderId string `json:"workOrderId"` //宸ュ崟缂栧彿
+ ProcedureID string `json:"procedureId"` // 宸ュ簭
+ DeviceId string `json:"deviceId"` //鐢ㄤ簬杩囨护鑾峰彇nsq娑堟伅
+ IsProcessing bool //鏄惁澶勭悊涓�
+ IsFinish bool //鏄惁瀹屾垚
+}
--
Gitblit v1.8.0