排程任务下发增加productProcedureID,报工表和工序表增加productProcedureID
| | |
| | | "procedureName": { |
| | | "type": "string" |
| | | }, |
| | | "productProcedureID": { |
| | | "type": "string" |
| | | }, |
| | | "startTime": { |
| | | "type": "integer" |
| | | }, |
| | |
| | | "description": "工艺模型编号", |
| | | "type": "string" |
| | | }, |
| | | "productProcedureID": { |
| | | "description": "产品工序id", |
| | | "type": "string" |
| | | }, |
| | | "realEndTime": { |
| | | "type": "integer" |
| | | }, |
| | |
| | | "properties": { |
| | | "barCode": { |
| | | "description": "条形码", |
| | | "type": "integer" |
| | | "type": "string" |
| | | }, |
| | | "channel": { |
| | | "description": "通道", |
| | |
| | | "description": "procedures表的id", |
| | | "type": "integer" |
| | | }, |
| | | "productProcedureID": { |
| | | "description": "产品工序id", |
| | | "type": "string" |
| | | }, |
| | | "reportAmount": { |
| | | "description": "报工数量", |
| | | "type": "integer" |
| | |
| | | "procedureName": { |
| | | "type": "string" |
| | | }, |
| | | "productProcedureID": { |
| | | "type": "string" |
| | | }, |
| | | "startTime": { |
| | | "type": "integer" |
| | | }, |
| | |
| | | "description": "工艺模型编号", |
| | | "type": "string" |
| | | }, |
| | | "productProcedureID": { |
| | | "description": "产品工序id", |
| | | "type": "string" |
| | | }, |
| | | "realEndTime": { |
| | | "type": "integer" |
| | | }, |
| | |
| | | "properties": { |
| | | "barCode": { |
| | | "description": "条形码", |
| | | "type": "integer" |
| | | "type": "string" |
| | | }, |
| | | "channel": { |
| | | "description": "通道", |
| | |
| | | "description": "procedures表的id", |
| | | "type": "integer" |
| | | }, |
| | | "productProcedureID": { |
| | | "description": "产品工序id", |
| | | "type": "string" |
| | | }, |
| | | "reportAmount": { |
| | | "description": "报工数量", |
| | | "type": "integer" |
| | |
| | | type: string |
| | | procedureName: |
| | | type: string |
| | | productProcedureID: |
| | | type: string |
| | | startTime: |
| | | type: integer |
| | | workHours: |
| | |
| | | processModelNumber: |
| | | description: 工艺模型编号 |
| | | type: string |
| | | productProcedureID: |
| | | description: 产品工序id |
| | | type: string |
| | | realEndTime: |
| | | type: integer |
| | | realStartTime: |
| | |
| | | properties: |
| | | barCode: |
| | | description: 条形码 |
| | | type: integer |
| | | type: string |
| | | channel: |
| | | description: 通道 |
| | | type: integer |
| | |
| | | proceduresId: |
| | | description: procedures表的id |
| | | type: integer |
| | | productProcedureID: |
| | | description: 产品工序id |
| | | type: string |
| | | reportAmount: |
| | | description: 报工数量 |
| | | type: integer |
| | |
| | | } |
| | | |
| | | ProductProcedure struct { |
| | | 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"` |
| | |
| | | type ( |
| | | Procedures struct { |
| | | gorm.Model |
| | | ProductProcedureID string `gorm:"index;type:varchar(191);not null" json:"productProcedureID"` //产品工序id |
| | | WorkOrderID string `gorm:"index;type:varchar(191);not null" json:"-"` |
| | | OrderID string `gorm:"index;type:varchar(191);not null" json:"-"` |
| | | DeviceID string `gorm:"index;type:varchar(191)" json:"deviceId"` |
| | |
| | | ReportWork struct { |
| | | gorm.Model |
| | | ProceduresID uint `gorm:"index;type:varchar(191)" json:"proceduresId"` //procedures表的id |
| | | ProductProcedureID string `gorm:"index;type:varchar(191);not null" json:"productProcedureID"` //产品工序id |
| | | WorkOrderID string `gorm:"index;type:varchar(191);not null" json:"workOrderId"` |
| | | DeviceID string `gorm:"index;type:varchar(191)" json:"deviceId"` |
| | | DeviceName string `gorm:"index;type:varchar(191)" json:"deviceName"` |
| | |
| | | procedureRecords := make([]*model.Procedures, 0, len(task.Procedures)) |
| | | for _, procedure := range task.Procedures { |
| | | procedureRecord := model.Procedures{ |
| | | ProductProcedureID: procedure.ProductProcedureID, |
| | | WorkOrderID: task.WorkOrder.WorkOrderID, |
| | | OrderID: task.WorkOrder.OrderID, |
| | | DeviceID: procedure.DeviceID, |
| | |
| | | |
| | | record := &model.ReportWork{ |
| | | ProceduresID: params.ProcedureId, |
| | | ProductProcedureID: procedure.ProductProcedureID, |
| | | WorkOrderID: procedure.WorkOrderID, |
| | | DeviceID: procedure.DeviceID, |
| | | DeviceName: procedure.ProceduresInfo.DeviceName, |