129 lines
8.2 KiB
Go
129 lines
8.2 KiB
Go
package model
|
|
|
|
import (
|
|
"gorm.io/gorm"
|
|
"time"
|
|
)
|
|
|
|
type Report struct {
|
|
ID int64 `json:"id" gorm:"primaryKey"`
|
|
Product string `json:"product"` // 成品型号
|
|
Lot string `json:"lot"` //晶圆批次
|
|
Factory string `json:"factory"` // 测试厂
|
|
TestMachine string `json:"test_machine"` // 测试机台
|
|
TestProgram string `json:"test_program"` // 测试程序
|
|
PBI string `json:"pbi"` // PBI
|
|
SubBatch string `json:"sub_batch"` // 子批次
|
|
OrderDate string `json:"order_date"` // 下单日期
|
|
Seal string `json:"seal"` // 丝印
|
|
TestQuantity string `json:"test_quantity"` // 测试数量
|
|
FirstPassQuantity string `json:"first_pass_quantity"` // 初测良品数量
|
|
FirstPassProbability string `json:"first_pass_probability"` // 初测良率
|
|
PassQuantity string `json:"pass_quantity"` // 良品数量(包括回收数据)
|
|
PassProbability string `json:"pass_probability"` // 良率(包括回收数据)
|
|
WaferID string `json:"wafer_id"` // 片号
|
|
TestTime string `json:"test_time"` // 测试时间
|
|
Step string `json:"step"` // 工序
|
|
StackingMaterials bool `json:"stacking_materials"` // 是否叠料
|
|
BinFail []BinFail `json:"bin_fail" gorm:"foreignKey:ReportID"` // 硬件和软件Bin的不良数量
|
|
Site []ReportSites `json:"site" gorm:"foreignKey:ReportID"` // Site测试情况
|
|
CreatedAt time.Time `json:"created_at"`
|
|
UpdatedAt time.Time `json:"-"`
|
|
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
|
|
}
|
|
|
|
type FinalReport struct {
|
|
ID int64 `json:"id" gorm:"primaryKey"`
|
|
Product string `json:"product"`
|
|
Lot string `json:"lot"`
|
|
PBI string `json:"pbi"`
|
|
Step string `json:"step"`
|
|
ReportTestQuantity string `json:"report_test_quantity"` // 报表测试数量
|
|
ReportPassQuantity string `json:"report_pass_quantity"` // 报表良品数量
|
|
ReportPassProbability string `json:"report_pass_probability"` // 报表良率
|
|
CreatedAt time.Time `json:"created_at"`
|
|
UpdatedAt time.Time `json:"-"`
|
|
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
|
|
}
|
|
|
|
type ReportSites struct {
|
|
ID int64 `json:"id" gorm:"primaryKey"`
|
|
ReportID int64 `json:"report_id"`
|
|
Site string `json:"site"` // Site
|
|
TestQuantity string `json:"test_quantity"` // 测试总数
|
|
PassQuantity string `json:"pass_quantity"` // 测试良品数
|
|
PassProbability string `json:"pass_probability"` // 良率
|
|
BinFail []BinFail `json:"bin_fail" gorm:"foreignKey:ReportSiteID"` // 硬件和软件Bin的不良数量
|
|
CreatedAt time.Time `json:"created_at"`
|
|
UpdatedAt time.Time `json:"-"`
|
|
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
|
|
}
|
|
|
|
type BinFail struct {
|
|
ID int64 `json:"id" gorm:"primaryKey"`
|
|
ReportID int64 `json:"report_id"`
|
|
ReportSiteID int64 `json:"report_site_id"`
|
|
HardBin string `json:"hard_bin"` // 硬件Bin名称
|
|
SoftBin string `json:"soft_bin"` // 软件Bin名称
|
|
Quantity string `json:"quantity"` // 数量
|
|
CreatedAt time.Time `json:"created_at"`
|
|
UpdatedAt time.Time `json:"-"`
|
|
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
|
|
}
|
|
|
|
type ReportList struct {
|
|
ID int64 `json:"id" gorm:"primaryKey"`
|
|
Product string `json:"product"` // 成品型号
|
|
Lot string `json:"lot"` //晶圆批次
|
|
Factory string `json:"factory"` // 测试厂
|
|
TestMachine string `json:"test_machine"` // 测试机台
|
|
TestProgram string `json:"test_program"` // 测试程序
|
|
PBI string `json:"pbi"` // PBI
|
|
SubBatch string `json:"sub_batch"` // 子批次
|
|
OrderDate string `json:"order_date"` // 下单日期
|
|
Seal string `json:"seal"` // 丝印
|
|
TestQuantity string `json:"test_quantity"` // 测试数量
|
|
FirstPassQuantity string `json:"first_pass_quantity"` // 初测良品数量
|
|
FirstPassProbability string `json:"first_pass_probability"` // 初测良率
|
|
PassQuantity string `json:"pass_quantity"` // 良品数量(包括回收数据)
|
|
PassProbability string `json:"pass_probability"` // 良率(包括回收数据)
|
|
ReportTestQuantity string `json:"report_test_quantity"` // 报表测试数量
|
|
ReportPassQuantity string `json:"report_pass_quantity"` // 报表良品数量
|
|
ReportPassProbability string `json:"report_pass_probability"` // 报表良率
|
|
WaferID string `json:"wafer_id"` // 片号
|
|
TestTime string `json:"test_time"` // 测试时间
|
|
Step string `json:"step"` // 工序
|
|
TestQuantityDiff string `json:"test_quantity_diff"` // 测试数量差异
|
|
TestQuantityDiffLabel bool `json:"test_quantity_diff_label"`
|
|
PassQuantityDiff string `json:"pass_quantity_diff"` // 良品数量差异
|
|
PassQuantityDiffLabel bool `json:"pass_quantity_diff_label"`
|
|
ReturnProbability string `json:"return_probability"` // 回收率
|
|
ReturnProbabilityLabel bool `json:"return_probability_label"`
|
|
StackingMaterials bool `json:"stacking_materials"` // 是否叠料
|
|
SoftBinFailMap map[string]float64 `json:"soft_bin_fail_map"` // 软件Bin的不良数量
|
|
HardBinFailMap map[string]float64 `json:"hard_bin_fail_map"` // 硬件Bin的不良数量
|
|
SoftBinFail []*ReportBinFail `json:"soft_bin_fail"` // 软件Bin的不良数量
|
|
HardBinFail []*ReportBinFail `json:"hard_bin_fail"` // 硬件Bin的不良数量
|
|
Site []*ReportListSites `json:"site"` // Site测试情况
|
|
}
|
|
|
|
type ReportListSites struct {
|
|
ID int64 `json:"id" gorm:"primaryKey"`
|
|
ReportID int64 `json:"report_id"`
|
|
Site string `json:"site"` // Site
|
|
TestQuantity string `json:"test_quantity"` // 测试总数
|
|
PassQuantity string `json:"pass_quantity"` // 测试良品数
|
|
PassProbability string `json:"pass_probability"` // 良率
|
|
SoftBinFailMap map[string]float64 `json:"soft_bin_fail_map"` // 软件Bin的不良数量
|
|
HardBinFailMap map[string]float64 `json:"hard_bin_fail_map"` // 硬件Bin的不良数量
|
|
SoftBinFail []*ReportBinFail `json:"soft_bin_fail"` // 软件Bin的不良数量
|
|
HardBinFail []*ReportBinFail `json:"hard_bin_fail"` // 硬件Bin的不良数量
|
|
}
|
|
|
|
type ReportBinFail struct {
|
|
Bin string `json:"bin"`
|
|
Quantity float64 `json:"quantity"`
|
|
Proportion string `json:"proportion"`
|
|
ReportProportion string `json:"report_proportion"`
|
|
}
|