zhangqian
2023-11-28 732e1e344addd02a4fa56531c7ffd0319e2d5b6c
model/production_progress.go
@@ -9,13 +9,15 @@
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 {
@@ -64,6 +66,11 @@
   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
@@ -107,6 +114,10 @@
      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)
   }