104 lines
5.5 KiB
Go
104 lines
5.5 KiB
Go
package model
|
||
|
||
import (
|
||
"gorm.io/gorm"
|
||
"time"
|
||
)
|
||
|
||
type Warning struct {
|
||
ID int64 `json:"id" gorm:"primaryKey"`
|
||
ProductionControl []ProductionControl `json:"production_control" gorm:"foreignKey:WarningID;references:ID"`
|
||
PassProbabilityDiff []PassProbabilityDiff `json:"pass_probability_diff" gorm:"foreignKey:WarningID;references:ID"`
|
||
BinControl []BinControl `json:"bin_control" gorm:"foreignKey:WarningID;references:ID"`
|
||
SelectionDiffControl []SelectionDiffControl `json:"selection_diff_control" gorm:"foreignKey:WarningID;references:ID"`
|
||
StackingMaterialsWarning []StackingMaterialsWarning `json:"stacking_materials_warning" gorm:"foreignKey:WarningID;references:ID"`
|
||
HistogramSelection []HistogramSelection `json:"histogram_selection" gorm:"foreignKey:WarningID;references:ID"`
|
||
ScatterSelection []ScatterSelection `json:"scatter_selection" gorm:"foreignKey:WarningID;references:ID"`
|
||
Product string `json:"product"` // 成品型号
|
||
Step string `json:"step"` // 工序
|
||
FirstPassProbabilityLimitL string `json:"first_pass_probability_limit_l"` // 一次通过率下限
|
||
ReturnProbabilityLimitH string `json:"return_probability_limit_h"` // 回收率上限
|
||
PassProbabilityLimitL string `json:"pass_probability_limit_l"` // 良率下限
|
||
AveragePassProbability string `json:"average_pass_probability"` // 平均良率
|
||
CreatedAt time.Time `json:"created_at"`
|
||
UpdatedAt time.Time `json:"-"`
|
||
DeletedAt gorm.DeletedAt `json:"-" gorm:"index"`
|
||
}
|
||
|
||
type ProductionControl struct {
|
||
ID int64 `json:"id" gorm:"primaryKey"`
|
||
WarningID int64 `json:"warning_id"`
|
||
Factory string `json:"factory"`
|
||
TestQuantityDiffH string `json:"test_quantity_diff_h"` // 测试数量差异上限
|
||
TestQuantityDiffL string `json:"test_quantity_diff_l"` // 测试数量差异下限
|
||
PassQuantityDiffH string `json:"pass_quantity_diff_h"` // 良品数量差异上限
|
||
PassQuantityDiffL string `json:"pass_quantity_diff_l"` // 良品数量差异下限
|
||
CreatedAt time.Time `json:"created_at"`
|
||
UpdatedAt time.Time `json:"-"`
|
||
DeletedAt gorm.DeletedAt `json:"-" gorm:"index"`
|
||
}
|
||
|
||
type PassProbabilityDiff struct {
|
||
ID int64 `json:"id" gorm:"primaryKey"`
|
||
WarningID int64 `json:"warning_id"`
|
||
SitePassProbabilityDiff string `json:"site_pass_probability_diff"` // 各SITE良率差异设置(一次通过率)
|
||
PassProbabilityDiff string `json:"pass_probability_diff"` // 良率差异设置(报表良率)
|
||
PassProbabilityWave string `json:"pass_probability_wave"` // 良率波动设置(报表良率)
|
||
CreatedAt time.Time `json:"created_at"`
|
||
UpdatedAt time.Time `json:"-"`
|
||
DeletedAt gorm.DeletedAt `json:"-" gorm:"index"`
|
||
}
|
||
|
||
type BinControl struct {
|
||
ID int64 `json:"id" gorm:"primaryKey"`
|
||
WarningID int64 `json:"warning_id"`
|
||
Bin string `json:"bin"`
|
||
Description string `json:"description"` // BIN描述
|
||
BinFailLimitH string `json:"bin_fail_limit_h"` // 关键Bin失效上限
|
||
CreatedAt time.Time `json:"created_at"`
|
||
UpdatedAt time.Time `json:"-"`
|
||
DeletedAt gorm.DeletedAt `json:"-" gorm:"index"`
|
||
}
|
||
|
||
type SelectionDiffControl struct {
|
||
ID int64 `json:"id" gorm:"primaryKey"`
|
||
WarningID int64 `json:"warning_id"`
|
||
Selection string `json:"selection"` // 参数
|
||
SiteDiff string `json:"site_diff"` // SITE间差异(均值最大值-均值最小值)
|
||
SubBatchDiff string `json:"sub_batch_diff"` // 批次间差异(均值最大值-均值最小值)
|
||
CreatedAt time.Time `json:"created_at"`
|
||
UpdatedAt time.Time `json:"-"`
|
||
DeletedAt gorm.DeletedAt `json:"-" gorm:"index"`
|
||
}
|
||
|
||
type StackingMaterialsWarning struct {
|
||
ID int64 `json:"id" gorm:"primaryKey"`
|
||
WarningID int64 `json:"warning_id"`
|
||
Selection string `json:"selection"` // 参数
|
||
Diff string `json:"diff"` // 差异
|
||
Unit string `json:"unit"` // 单位
|
||
Quantity int `json:"quantity"` // 数量
|
||
CreatedAt time.Time `json:"created_at"`
|
||
UpdatedAt time.Time `json:"-"`
|
||
DeletedAt gorm.DeletedAt `json:"-" gorm:"index"`
|
||
}
|
||
|
||
type HistogramSelection struct {
|
||
ID int64 `json:"id" gorm:"primaryKey"`
|
||
WarningID int64 `json:"warning_id"`
|
||
Selection string `json:"selection"` // 参数
|
||
CreatedAt time.Time `json:"created_at"`
|
||
UpdatedAt time.Time `json:"-"`
|
||
DeletedAt gorm.DeletedAt `json:"-" gorm:"index"`
|
||
}
|
||
|
||
type ScatterSelection struct {
|
||
ID int64 `json:"id" gorm:"primaryKey"`
|
||
WarningID int64 `json:"warning_id"`
|
||
XSelection string `json:"x_selection"` // 参数-X
|
||
YSelection string `json:"y_selection"` // 参数-Y
|
||
CreatedAt time.Time `json:"created_at"`
|
||
UpdatedAt time.Time `json:"-"`
|
||
DeletedAt gorm.DeletedAt `json:"-" gorm:"index"`
|
||
}
|