zhangqian
2023-08-19 066a30751bdc20f9e83b34539de71ae392783e1b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package common
 
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"` // 工序列表
    }
)