diff --git a/repository/test.data/STS8200.go b/repository/test.data/STS8200.go index 79db269..39b34b7 100644 --- a/repository/test.data/STS8200.go +++ b/repository/test.data/STS8200.go @@ -369,7 +369,12 @@ func HandleSTS8200Excel(fileText *model.FileText) error { } if errors.Is(global.PostGreSQL.Where("product = ? AND pbi = ? AND factory = ? AND lot = ? AND step = ? AND sub_batch = ? AND wafer_id = ?", fileText.ProductName, fileText.PBI, fileText.Factory, fileText.Lot, step, fileText.SubBatch, fileText.ChipNum).First(&report).Error, gorm.ErrRecordNotFound) { - orderDate := carbon.Parse("20" + fileText.PBI[5:11]).Format("Y-m-d") + orderDate := "" + if len(fileText.PBI) == 12 { + orderDate = carbon.Parse(fileText.PBI[:8]).Format("Y-m-d") + } else { + orderDate = carbon.Parse("20" + fileText.PBI[5:11]).Format("Y-m-d") + } report = &model.Report{ Product: fileText.ProductName, PBI: fileText.PBI,