| | |
| | | } |
| | | |
| | | 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 { |
| | |
| | | } |
| | | |
| | | PlcAddress struct { |
| | | DeviceID string `json:"deviceID"` // 设备id |
| | | Channel int `json:"channel"` // 生产通道on,一个机器可能有多个机位,需要分别配置plc地址 |
| | | 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,一个机器可能有多个机位,需要分别配置plc地址 |
| | | 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)"` // 字节存储顺序,big(ABCD)/little(CDBA)/mix(CDAB) |
| | | } |
| | | ) |
| | | |
| | |
| | | |
| | | // 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 下发到终端的设备信息 |
| | |
| | | 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 |
| | | } |
| | |
| | | StopBit int `gorm:"type:int(11)" json:"stopBit"` //停止位,method = modbusRTU 用 |
| | | Parity constvar.Parity `gorm:"type:int(11)" json:"parity"` //校验方式,method = modbusRTU 用 |
| | | } |
| | | |
| | | // MsgReportData 数据上报 |
| | | type MsgReportData struct { |
| | | ReportType constvar.ReportType `json:"reportType"` //上报类型 |
| | | Content string `json:"Content"` |
| | | } |