zhangqian
2023-08-19 066a30751bdc20f9e83b34539de71ae392783e1b
model/request/schedule_task.go
@@ -1,54 +1 @@
package request
import "github.com/shopspring/decimal"
// 排程任务下发
type (
   WorkOrder struct {
      WorkOrderID string          `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"`
      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"`
   }
   ProcedureMaterial struct {
      MaterialID   string          `gorm:"type:varchar(191);comment:物料编号" json:"materialId"`
      MaterialName string          `gorm:"unique;type:varchar(191);not null;comment:物料名称" json:"materialName"`
      Amount       decimal.Decimal `gorm:"type:decimal(35,18);comment:数量" json:"amount"`
      Unit         string          `gorm:"type:varchar(191);comment:单位" json:"unit"`
   }
   ProcedureWorker struct {
      WorkerID   string `gorm:"type:varchar(2048);comment:人员ID" json:"workerId"`
      WorkerName string `gorm:"unique;type:varchar(191);not null;comment:人员姓名" json:"workerName"`
      PhoneNum   string `gorm:"type:varchar(191);comment:手机号" json:"phoneNum"`
      StartTime  int64  `gorm:"comment:开始时间" json:"startTime"`
      EndTime    int64  `gorm:"comment:结束时间" json:"endTime"`
   }
   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"`
      DeviceID        string               `gorm:"type:varchar(191);not null;comment:设备ID" json:"deviceId"`
      DeviceName      string               `gorm:"type:varchar(191);not null;comment:设备名称" 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"`         // 人员列表
   }
   DeliverScheduleTask struct {
      WorkOrder  WorkOrder           `json:"workOrder"`
      Procedures []*ProductProcedure `json:"procedures"` // 工序列表
   }
)