数据分析平台 自动生成PBI导致日期错误
This commit is contained in:
parent
37300badf3
commit
2238399926
@ -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 = ?",
|
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) {
|
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{
|
report = &model.Report{
|
||||||
Product: fileText.ProductName,
|
Product: fileText.ProductName,
|
||||||
PBI: fileText.PBI,
|
PBI: fileText.PBI,
|
||||||
|
Loading…
Reference in New Issue
Block a user