zhangqian
2023-10-19 eba4eb850f0ecfb5839395aa125955ceaa2a454f
model/work_order.go
@@ -3,25 +3,25 @@
import (
   "apsClient/pkg/sqlitex"
   "fmt"
   "github.com/jinzhu/gorm"
   "github.com/shopspring/decimal"
   "gorm.io/gorm"
)
type (
   Order struct {
      gorm.Model  `json:"-"`
      WorkOrderID string          `gorm:"index;type:varchar(191);not null;comment:工单ID" json:"workOrderId"`
      OrderID     string          `gorm:"index;type:varchar(191);not null;comment:订单ID" json:"orderId"`
      ProductID   string          `gorm:"type:varchar(191);comment:产品ID" json:"productId"`
      ProductName string          `gorm:"type:varchar(191);comment:产品名称" json:"productName"`
      Parameter   string          `gorm:"type:varchar(1024);comment:参数需求" json:"parameter"`
      Customer    string          `gorm:"type:varchar(191);comment:客户编码" json:"customer"`
      DeliverDate string          `gorm:"type:varchar(100);comment:交货日期" json:"deliverDate"`
      gorm.Model
      WorkOrderID string          `gorm:"index;type:varchar(191);not null" json:"workOrderId"`
      OrderID     string          `gorm:"index;type:varchar(191);not null" json:"orderId"`
      ProductID   string          `gorm:"type:varchar(191)" json:"productId"`
      ProductName string          `gorm:"type:varchar(191)" json:"productName"`
      Parameter   string          `gorm:"type:varchar(1024)" json:"parameter"`
      Customer    string          `gorm:"type:varchar(191)" json:"customer"`
      DeliverDate string          `gorm:"type:varchar(100)" json:"deliverDate"`
      OrderAttr   string          `json:"orderAttr"` // 订单属性拼接的字符串,即货物描述
      Amount      decimal.Decimal `gorm:"type:decimal(35,18);comment:数量" json:"amount"`
      Unit        string          `gorm:"type:varchar(100);comment:单位" json:"unit"`
      StartTime   int64           `gorm:"comment:计划开始时间" json:"startTime"`
      EndTime     int64           `gorm:"comment:计划结束时间" json:"endTime"`
      Amount      decimal.Decimal `gorm:"type:decimal(35,18)" json:"amount"`
      Unit        string          `gorm:"type:varchar(100)" json:"unit"`
      StartTime   int64           `json:"startTime"`
      EndTime     int64           `json:"endTime"`
      Status      OrderStatus
   }
@@ -132,7 +132,7 @@
   }
   if len(slf.StatusList) != 0 {
      db = db.Where("status in ?", slf.StatusList)
      db = db.Where("status IN (?)", slf.StatusList)
   }
   if slf.StartTimeMax != 0 {