V0 MT737 report保存
This commit is contained in:
parent
9a162d1e2b
commit
f4403a9e3e
@ -366,4 +366,33 @@ func MT737(summary, dataLog *model.FileText) {
|
|||||||
"title_info": string(titleInfo),
|
"title_info": string(titleInfo),
|
||||||
"size": utils.FormatFileSize(float64(newFile.Size())),
|
"size": utils.FormatFileSize(float64(newFile.Size())),
|
||||||
})
|
})
|
||||||
|
var report *model.Report
|
||||||
|
var step string
|
||||||
|
if dataLog.Procedure == "FT" || dataLog.Procedure == "RT" {
|
||||||
|
step = "FT"
|
||||||
|
} else if strings.Contains(dataLog.Procedure, "CP") {
|
||||||
|
step = "CP"
|
||||||
|
}
|
||||||
|
if errors.Is(global.PostGreSQL.Where("product = ? AND pbi = ? AND factory = ? AND lot = ? AND step = ? AND sub_batch = ? AND wafer_id = ?",
|
||||||
|
dataLog.ProductName, dataLog.PBI, dataLog.Factory, dataLog.Lot, step, dataLog.SubBatch, dataLog.ChipNum).First(&report).Error, gorm.ErrRecordNotFound) {
|
||||||
|
orderDate := carbon.Parse("20" + dataLog.PBI[5:11]).Format("Y-m-d")
|
||||||
|
report = &model.Report{
|
||||||
|
Product: dataLog.ProductName,
|
||||||
|
PBI: dataLog.PBI,
|
||||||
|
Factory: dataLog.Factory,
|
||||||
|
Step: step,
|
||||||
|
Lot: dataLog.Lot,
|
||||||
|
SubBatch: dataLog.SubBatch,
|
||||||
|
TestMachine: details["Tester ID"],
|
||||||
|
TestProgram: details["Program"],
|
||||||
|
WaferID: dataLog.ChipNum,
|
||||||
|
OrderDate: orderDate,
|
||||||
|
}
|
||||||
|
global.PostGreSQL.Create(&report)
|
||||||
|
}
|
||||||
|
if strings.Contains(dataLog.Procedure, "CP") {
|
||||||
|
SaveCP(report)
|
||||||
|
} else {
|
||||||
|
SaveFT(report)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user