From 2d6875c93b25d0b7336c7fa11e066d213259fe2e Mon Sep 17 00:00:00 2001 From: zhangqian <zhangqian@123.com> Date: 星期四, 25 四月 2024 10:02:01 +0800 Subject: [PATCH] 更改定时任务时区设置 --- model/common/common.go | 65 +++++++++++++++++++------------- 1 files changed, 39 insertions(+), 26 deletions(-) diff --git a/model/common/common.go b/model/common/common.go index c84e16d..d918026 100644 --- a/model/common/common.go +++ b/model/common/common.go @@ -38,20 +38,21 @@ } ProductProcedure struct { - ProcedureID string `gorm:"uniqueIndex:idx_product_procedure;type:varchar(191);comment:宸ュ簭ID" json:"procedureId"` - ProcedureName string `gorm:"type:varchar(191);comment:宸ュ簭鍚嶇О锛屼粎鏌ヨ鐢�" json:"procedureName"` - NextProcedureID string `json:"nextProcedureId"` - NextProcedureName string `json:"nextProcedureName"` - DeviceID string `gorm:"type:varchar(191);not null;comment:璁惧ID" json:"deviceId"` - DeviceName string `json:"deviceName"` - 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"` // 浜哄憳鍒楄〃 - AllProcedureNames []string `json:"allProcedureNames"` // 鎵�灞炲伐鍗曞伐搴忓垪琛� - Channel int32 `json:"channel"` //閫氶亾搴忓彿 + ProductProcedureID string `gorm:"index;type:varchar(191);not null;comment:浜у搧宸ュ簭ID" json:"productProcedureID"` + ProcedureID string `gorm:"uniqueIndex:idx_product_procedure;type:varchar(191);comment:宸ュ簭ID" json:"procedureId"` + ProcedureName string `gorm:"type:varchar(191);comment:宸ュ簭鍚嶇О锛屼粎鏌ヨ鐢�" json:"procedureName"` + NextProcedureID string `json:"nextProcedureId"` + NextProcedureName string `json:"nextProcedureName"` + DeviceID string `gorm:"type:varchar(191);not null;comment:璁惧ID" json:"deviceId"` + DeviceName string `json:"deviceName"` + 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"` // 浜哄憳鍒楄〃 + AllProcedureNames []string `json:"allProcedureNames"` // 鎵�灞炲伐鍗曞伐搴忓垪琛� + Channel int32 `json:"channel"` //閫氶亾搴忓彿 } DeliverScheduleTask struct { @@ -89,12 +90,13 @@ } PlcAddress struct { - DeviceID string `json:"deviceID"` // 璁惧id - Channel int `json:"channel"` // 鐢熶骇閫氶亾on锛屼竴涓満鍣ㄥ彲鑳芥湁澶氫釜鏈轰綅锛岄渶瑕佸垎鍒厤缃畃lc鍦板潃 - StartAddress int `json:"startAddress"` // 鏁版嵁璧峰鍦板潃 - Length int `json:"length"` // 鏁版嵁闀垮害 - Type string `json:"type"` // 鏁版嵁绫诲瀷 - FieldName constvar.PlcStartAddressType `json:"fieldName"` // 瀵瑰簲绯荤粺瀛楁锛屽畬鎴愰噺鎴栨�婚噺 + DeviceID string `json:"deviceID"` // 璁惧id + Channel int `json:"channel"` // 鐢熶骇閫氶亾on锛屼竴涓満鍣ㄥ彲鑳芥湁澶氫釜鏈轰綅锛岄渶瑕佸垎鍒厤缃畃lc鍦板潃 + StartAddress int `json:"startAddress"` // 鏁版嵁璧峰鍦板潃 + Length int `json:"length"` // 鏁版嵁闀垮害 + Type string `json:"type"` // 鏁版嵁绫诲瀷 + FieldName constvar.PlcStartAddressType `json:"fieldName"` // 瀵瑰簲绯荤粺瀛楁锛屽畬鎴愰噺鎴栨�婚噺 + Endian constvar.EndianType `json:"endian" gorm:"type:varchar(255)"` // 瀛楄妭瀛樺偍椤哄簭锛宐ig(ABCD)/little(CDBA)/mix(CDAB) } ) @@ -120,11 +122,15 @@ // MsgTaskStatusUpdate 浠诲姟鐘舵�佹敼鍙� type MsgTaskStatusUpdate struct { - WorkOrderId string `json:"workOrderId"` //宸ュ崟缂栧彿 - ProcedureID string `json:"procedureId"` // 宸ュ簭 - DeviceId string `json:"deviceId"` //鐢ㄤ簬杩囨护鑾峰彇nsq娑堟伅 - IsProcessing bool //鏄惁澶勭悊涓� - IsFinish bool //鏄惁瀹屾垚 + WorkOrderId string `json:"workOrderId"` //宸ュ崟缂栧彿 + ProcedureID string `json:"procedureId"` // 宸ュ簭 + DeviceId string `json:"deviceId"` //鐢ㄤ簬杩囨护鑾峰彇nsq娑堟伅 + IsProcessing bool //鏄惁澶勭悊涓� + IsFinish bool //鏄惁瀹屾垚 + FinishAmount int `json:"finishAmount"` //isFinish = true鏃跺彇宸ュ簭鏈�缁堝姞宸ユ暟浼犱笂鍘� + ProductProcedureID string `json:"productProcedureID"` //浜у搧宸ュ簭id + StartTs int64 `json:"start_ts"` //寮�濮嬫椂闂� + FinishTs int64 `json:"finish_ts"` //缁撴潫鏃堕棿 } // DeviceMsg 涓嬪彂鍒扮粓绔殑璁惧淇℃伅 @@ -132,7 +138,8 @@ ID string `gorm:"comment:涓婚敭ID;primaryKey;type:varchar(191);" json:"id"` DeviceProcedureAttr []*DeviceProcedureAttr `json:"deviceProcedureAttr"` // 璁惧宸ュ簭灞炴�у垪琛� ExtChannelAmount int `gorm:"type:tinyint;comment:棰濆鐨勯�氶亾鏁伴噺;default:0;" json:"extChannelAmount"` - DeviceMac string `gorm:"type:varchar(191);comment:璁惧MAC" json:"deviceMac"` + DeviceName string `json:"deviceName"` + DeviceMac string `json:"deviceMac"` PlcAddressList []*PlcAddress PlcConfig *PlcConfig } @@ -167,3 +174,9 @@ StopBit int `gorm:"type:int(11)" json:"stopBit"` //鍋滄浣嶏紝method = modbusRTU 鐢� Parity constvar.Parity `gorm:"type:int(11)" json:"parity"` //鏍¢獙鏂瑰紡锛宮ethod = modbusRTU 鐢� } + +// MsgReportData 鏁版嵁涓婃姤 +type MsgReportData struct { + ReportType constvar.ReportType `json:"reportType"` //涓婃姤绫诲瀷 + Content string `json:"Content"` +} -- Gitblit v1.8.0