| | |
| | | type ( |
| | | ProductionProgress struct { |
| | | gorm.Model |
| | | WorkOrderID string `gorm:"index;type:varchar(191);not null" json:"workOrderID"` |
| | | OrderID string `gorm:"index;type:varchar(191);not null" json:"orderID"` |
| | | ProcedureID string `gorm:"type:varchar(191)" json:"procedureId"` |
| | | DeviceID string `gorm:"type:varchar(191);not null" json:"deviceId"` |
| | | FinishedQuantity int64 `gorm:"type:int;not null" json:"finishedQuantity"` |
| | | Channel int32 `gorm:"type:int" json:"channel"` //通道 |
| | | TotalQuantity int64 `gorm:"type:int;not null" json:"totalQuantity"` |
| | | ProceduresID uint `gorm:"index;type:varchar(191)" json:"proceduresId"` //procedures表的id |
| | | WorkOrderID string `gorm:"index;type:varchar(191);not null" json:"workOrderID"` |
| | | OrderID string `gorm:"index;type:varchar(191);not null" json:"orderID"` |
| | | ProcedureID string `gorm:"type:varchar(191)" json:"procedureId"` |
| | | ProductProcedureID string `gorm:"type:varchar(191);not null" json:"productProcedureID"` //产品工序id |
| | | DeviceID string `gorm:"type:varchar(191);not null" json:"deviceId"` |
| | | FinishedQuantity int64 `gorm:"type:int;not null" json:"finishedQuantity"` |
| | | Channel int32 `gorm:"type:int" json:"channel"` //通道 |
| | | TotalQuantity int64 `gorm:"type:int;not null" json:"totalQuantity"` |
| | | } |
| | | |
| | | ProductionProgressSearch struct { |
| | |
| | | return slf |
| | | } |
| | | |
| | | func (slf *ProductionProgressSearch) SetProceduresId(proceduresId uint) *ProductionProgressSearch { |
| | | slf.ProceduresID = proceduresId |
| | | return slf |
| | | } |
| | | |
| | | func (slf *ProductionProgressSearch) SetDeviceId(id string) *ProductionProgressSearch { |
| | | slf.DeviceID = id |
| | | return slf |
| | |
| | | db = db.Where("procedure_id = ?", slf.ProcedureID) |
| | | } |
| | | |
| | | if slf.ProceduresID != 0 { |
| | | db = db.Where("procedures_id = ?", slf.ProceduresID) |
| | | } |
| | | |
| | | if slf.DeviceID != "" { |
| | | db = db.Where("device_id = ?", slf.DeviceID) |
| | | } |