数据分析平台 FT记录晶圆型号抓取规则调整

This commit is contained in:
jh_peng 2025-02-27 18:22:14 +08:00
parent 988d303aca
commit b743772d8f
2 changed files with 24 additions and 7 deletions

View File

@ -8,6 +8,7 @@ type TcSfcFile struct {
TcSfc04 string `json:"tc_sfc04"` // 厂商编号 TcSfc04 string `json:"tc_sfc04"` // 厂商编号
PmcFile PmcFile `gorm:"foreignKey:Pmc01;references:TcSfc04"` PmcFile PmcFile `gorm:"foreignKey:Pmc01;references:TcSfc04"`
TcSfc08 string `json:"tc_sfc08"` // 加工类型 TcSfc08 string `json:"tc_sfc08"` // 加工类型
TcSfc10 string `json:"tc_sfc10"` // 重测否
TcSfdFile []TcSfdFile `gorm:"foreignKey:TcSfd01;references:TcSfc01"` TcSfdFile []TcSfdFile `gorm:"foreignKey:TcSfd01;references:TcSfc01"`
TcSfeFile []TcSfeFile `gorm:"foreignKey:TcSfe01;references:TcSfc01"` TcSfeFile []TcSfeFile `gorm:"foreignKey:TcSfe01;references:TcSfc01"`
} }
@ -38,6 +39,7 @@ type TcSfeFile struct {
TcSfe02 int `json:"tc_sfe02"` // 回货项次 TcSfe02 int `json:"tc_sfe02"` // 回货项次
TcSfe04 string `json:"tc_sfe04"` // 料号 TcSfe04 string `json:"tc_sfe04"` // 料号
ImaFile ImaFile `gorm:"foreignKey:Ima01;references:TcSfe04"` ImaFile ImaFile `gorm:"foreignKey:Ima01;references:TcSfe04"`
BmbFile BmbFile `gorm:"foreignKey:Bmb01;references:TcSfe04"`
TcSfe10 string `json:"tc_sfe10"` // 晶圆批号 TcSfe10 string `json:"tc_sfe10"` // 晶圆批号
TcSfe12 float64 `json:"tc_sfe12"` // 发料数量 TcSfe12 float64 `json:"tc_sfe12"` // 发料数量
TcSfe14 float64 `json:"tc_sfe14"` // 参考数量 TcSfe14 float64 `json:"tc_sfe14"` // 参考数量
@ -154,3 +156,11 @@ type SfbFile struct {
} }
func (SfbFile) TableName() string { return "sfb_file" } func (SfbFile) TableName() string { return "sfb_file" }
type BmbFile struct {
Bmb01 string `json:"bmb01"` // 料号
Bmb03 string `json:"bmb03"` // 晶圆料号
ImaFile ImaFile `json:"ima_file" gorm:"foreignKey:Ima01;references:Bmb03"`
}
func (BmbFile) TableName() string { return "bmb_file" }

View File

@ -797,7 +797,9 @@ func CronCPList() {
return db.Preload("IddFile").Preload("RvaFile") return db.Preload("IddFile").Preload("RvaFile")
}) })
}).Preload("TcSfeFile", func(db *gorm.DB) *gorm.DB { }).Preload("TcSfeFile", func(db *gorm.DB) *gorm.DB {
return db.Preload("ImaFile").Preload("BmbFile", func(db *gorm.DB) *gorm.DB {
return db.Preload("ImaFile") return db.Preload("ImaFile")
})
}).Preload("PmcFile").Find(&pageTcSfcFile) }).Preload("PmcFile").Find(&pageTcSfcFile)
newTcSfcFile = append(newTcSfcFile, pageTcSfcFile...) newTcSfcFile = append(newTcSfcFile, pageTcSfcFile...)
} }
@ -1023,6 +1025,7 @@ func CronFTList() {
"return_quantity": returnQuantity, "return_quantity": returnQuantity,
"pass_quantity": passQuantity, "pass_quantity": passQuantity,
"fail_quantity": failQuantity, "fail_quantity": failQuantity,
"test_program_version": tcSfd.TcImbFile.TcImb04,
}) })
for k, v := range orderDateStockMap { for k, v := range orderDateStockMap {
var ftListStock *model.FTListStock var ftListStock *model.FTListStock
@ -1104,9 +1107,13 @@ func CronFTList() {
var waferProduct string var waferProduct string
for _, tcSfe := range tcSfc.TcSfeFile { for _, tcSfe := range tcSfc.TcSfeFile {
if tcSfe.TcSfe01 == tcSfc.TcSfc01 && tcSfe.TcSfe02 == tcSfd.TcSfd02 { if tcSfe.TcSfe01 == tcSfc.TcSfc01 && tcSfe.TcSfe02 == tcSfd.TcSfd02 {
if tcSfc.TcSfc08 == "FT" {
waferProduct = tcSfe.BmbFile.ImaFile.Ima02
} else {
waferProduct = tcSfe.ImaFile.Ima02 waferProduct = tcSfe.ImaFile.Ima02
} }
} }
}
var returnQuantity, passQuantity, failQuantity float64 var returnQuantity, passQuantity, failQuantity float64
orderDateStockMap := make(map[string][]float64) orderDateStockMap := make(map[string][]float64)
for _, rvb := range tcSfd.RvbFile { for _, rvb := range tcSfd.RvbFile {