V0
This commit is contained in:
parent
eda1a52022
commit
3cda69ad12
@ -1744,6 +1744,50 @@ func ExportFT() string {
|
||||
testQuantity, passQuantity, passProbability, returnProbability,
|
||||
testQuantityDiff, passQuantityDiff, hardBinState, siteDiffState,
|
||||
stackingMaterials})
|
||||
|
||||
if warning.FirstPassProbabilityLimitL != "" {
|
||||
s := strings.ReplaceAll(firstPassProbability, "%", "")
|
||||
sDecimal, _ := decimal.NewFromString(s)
|
||||
firstPassProbabilityLimitLDecimal, _ := decimal.NewFromString(strings.ReplaceAll(warning.FirstPassProbabilityLimitL, "%", ""))
|
||||
if sDecimal.LessThan(firstPassProbabilityLimitLDecimal) {
|
||||
_ = file.SetCellStyle(sheetName, "L"+strconv.Itoa(ftRecordIndex), "L"+strconv.Itoa(ftRecordIndex), ExportWarningStyle(file))
|
||||
}
|
||||
}
|
||||
if warning.PassProbabilityLimitL != "" {
|
||||
s := strings.ReplaceAll(passProbability, "%", "")
|
||||
sDecimal, _ := decimal.NewFromString(s)
|
||||
passProbabilityLimitLDecimal, _ := decimal.NewFromString(strings.ReplaceAll(warning.PassProbabilityLimitL, "%", ""))
|
||||
if sDecimal.LessThan(passProbabilityLimitLDecimal) {
|
||||
_ = file.SetCellStyle(sheetName, "O"+strconv.Itoa(ftRecordIndex), "O"+strconv.Itoa(ftRecordIndex), ExportWarningStyle(file))
|
||||
}
|
||||
}
|
||||
if warning.ReturnProbabilityLimitH != "" {
|
||||
s := strings.ReplaceAll(returnProbability, "%", "")
|
||||
sDecimal, _ := decimal.NewFromString(s)
|
||||
returnProbabilityLimitHDecimal, _ := decimal.NewFromString(strings.ReplaceAll(warning.ReturnProbabilityLimitH, "%", ""))
|
||||
if returnProbabilityLimitHDecimal.LessThan(sDecimal) {
|
||||
_ = file.SetCellStyle(sheetName, "P"+strconv.Itoa(ftRecordIndex), "P"+strconv.Itoa(ftRecordIndex), ExportWarningStyle(file))
|
||||
}
|
||||
}
|
||||
for _, productionControl := range warning.ProductionControl {
|
||||
if productionControl.Factory == ftList.Factory {
|
||||
testQuantityDiffStr := strings.ReplaceAll(testQuantityDiff, "%", "")
|
||||
sDecimal, _ := decimal.NewFromString(testQuantityDiffStr)
|
||||
testQuantityDiffHDecimal, _ := decimal.NewFromString(strings.ReplaceAll(productionControl.TestQuantityDiffH, "%", ""))
|
||||
testQuantityDiffLDecimal, _ := decimal.NewFromString(strings.ReplaceAll(productionControl.TestQuantityDiffL, "%", ""))
|
||||
if sDecimal.LessThan(testQuantityDiffLDecimal) || testQuantityDiffHDecimal.LessThan(sDecimal) {
|
||||
_ = file.SetCellStyle(sheetName, "Q"+strconv.Itoa(ftRecordIndex), "Q"+strconv.Itoa(ftRecordIndex), ExportWarningStyle(file))
|
||||
}
|
||||
passQuantityDiffStr := strings.ReplaceAll(passQuantityDiff, "%", "")
|
||||
saDecimal, _ := decimal.NewFromString(passQuantityDiffStr)
|
||||
passQuantityDiffHDecimal, _ := decimal.NewFromString(strings.ReplaceAll(productionControl.PassQuantityDiffH, "%", ""))
|
||||
passQuantityDiffLDecimal, _ := decimal.NewFromString(strings.ReplaceAll(productionControl.PassQuantityDiffL, "%", ""))
|
||||
if saDecimal.LessThan(passQuantityDiffLDecimal) || passQuantityDiffHDecimal.LessThan(saDecimal) {
|
||||
_ = file.SetCellStyle(sheetName, "R"+strconv.Itoa(ftRecordIndex), "R"+strconv.Itoa(ftRecordIndex), ExportWarningStyle(file))
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
if hardBinState == "异常" {
|
||||
_ = file.SetCellStyle(sheetName, "S"+strconv.Itoa(ftRecordIndex), "S"+strconv.Itoa(ftRecordIndex), ExportWarningStyle(file))
|
||||
}
|
||||
@ -1754,7 +1798,7 @@ func ExportFT() string {
|
||||
_ = file.SetCellStyle(sheetName, "U"+strconv.Itoa(ftRecordIndex), "U"+strconv.Itoa(ftRecordIndex), ExportWarningStyle(file))
|
||||
}
|
||||
if len(finalReports) > 0 {
|
||||
ExportFTDetailsSheet(finalReports, file)
|
||||
ExportFTDetailsSheet(finalReports, file, warning.BinControl)
|
||||
}
|
||||
if warning != nil {
|
||||
ExportFTHistogramSheet(warning, ftList, file)
|
||||
@ -1793,7 +1837,7 @@ func ExportFTSumSheet(exportFTs []*model.ExportFT, f *excelize.File) {
|
||||
_ = f.SetColWidth(sheetName, "A", "U", 20)
|
||||
}
|
||||
|
||||
func ExportFTDetailsSheet(finalReports []*model.FinalReport, f *excelize.File) {
|
||||
func ExportFTDetailsSheet(finalReports []*model.FinalReport, f *excelize.File, binControls []model.BinControl) {
|
||||
sheetName := "FT记录BIN表"
|
||||
_, _ = f.NewSheet(sheetName)
|
||||
_ = f.SetSheetRow(sheetName, "A1", &[]interface{}{"成品型号", "晶圆批次", "PBI", "测试厂", "测试程序", "下单日期", "丝印",
|
||||
@ -1802,6 +1846,39 @@ func ExportFTDetailsSheet(finalReports []*model.FinalReport, f *excelize.File) {
|
||||
})
|
||||
_ = f.SetCellStyle(sheetName, "A1", "Y1", ExportFTSheetTitleStyle(f))
|
||||
for index, finalReport := range finalReports {
|
||||
for _, binControl := range binControls {
|
||||
var bin string
|
||||
binControl.Bin = strings.ToUpper(binControl.Bin)
|
||||
if binControl.Bin == "BIN1" {
|
||||
bin = finalReport.Bin1
|
||||
} else if binControl.Bin == "BIN2" {
|
||||
bin = finalReport.Bin2
|
||||
} else if binControl.Bin == "BIN3" {
|
||||
bin = finalReport.Bin3
|
||||
} else if binControl.Bin == "BIN4" {
|
||||
bin = finalReport.Bin4
|
||||
} else if binControl.Bin == "BIN5" {
|
||||
bin = finalReport.Bin5
|
||||
} else if binControl.Bin == "BIN6" {
|
||||
bin = finalReport.Bin6
|
||||
} else if binControl.Bin == "BIN7" {
|
||||
bin = finalReport.Bin7
|
||||
} else if binControl.Bin == "BIN8" {
|
||||
bin = finalReport.Bin8
|
||||
} else if binControl.Bin == "BIN9" {
|
||||
bin = finalReport.Bin9
|
||||
} else if binControl.Bin == "BIN10" {
|
||||
bin = finalReport.Bin10
|
||||
}
|
||||
if binControl.BinFailLimitH != "" {
|
||||
s := strings.ReplaceAll(bin, "%", "")
|
||||
sDecimal, _ := decimal.NewFromString(s)
|
||||
binFailLimitHDecimal, _ := decimal.NewFromString(strings.ReplaceAll(binControl.BinFailLimitH, "%", ""))
|
||||
if binFailLimitHDecimal.LessThan(sDecimal) {
|
||||
_ = f.SetCellStyle(sheetName, "L"+strconv.Itoa(index+2), "L"+strconv.Itoa(index+2), ExportWarningStyle(f))
|
||||
}
|
||||
}
|
||||
}
|
||||
_ = f.SetSheetRow(sheetName, "A"+strconv.Itoa(index+2), &[]interface{}{finalReport.Product, finalReport.Lot,
|
||||
finalReport.PBI, finalReport.Factory, finalReport.TestProgram, finalReport.OrderDate, finalReport.Seal,
|
||||
finalReport.SubBatch, finalReport.ReportTestQuantity, finalReport.ReportPassQuantity, finalReport.ReportPassProbability,
|
||||
|
@ -545,12 +545,14 @@ func PassProbability(r *request.PassProbability) (interface{}, string) {
|
||||
x = append(x, k)
|
||||
y = append(y, decimal.NewFromFloat(average).Round(2).String())
|
||||
}
|
||||
line := &model.Line{
|
||||
Name: "良率 折线图",
|
||||
X: x,
|
||||
Y: y,
|
||||
if len(r.Group) == 0 {
|
||||
line := &model.Line{
|
||||
Name: "良率 折线图",
|
||||
X: x,
|
||||
Y: y,
|
||||
}
|
||||
lines = append(lines, line)
|
||||
}
|
||||
lines = append(lines, line)
|
||||
for group, passProbabilityGroup := range passProbabilityGroupMap {
|
||||
var groupY []string
|
||||
for _, s := range x {
|
||||
@ -583,12 +585,14 @@ func PassProbability(r *request.PassProbability) (interface{}, string) {
|
||||
x = append(x, k)
|
||||
values = append(values, v)
|
||||
}
|
||||
boxPlot := &model.BoxPlot{
|
||||
Name: "良率 箱型图",
|
||||
X: x,
|
||||
Values: values,
|
||||
if len(r.Group) == 0 {
|
||||
boxPlot := &model.BoxPlot{
|
||||
Name: "良率 箱型图",
|
||||
X: x,
|
||||
Values: values,
|
||||
}
|
||||
boxPlots = append(boxPlots, boxPlot)
|
||||
}
|
||||
boxPlots = append(boxPlots, boxPlot)
|
||||
for group, passProbabilityGroup := range passProbabilityGroupMap {
|
||||
var groupY [][]float64
|
||||
for _, s := range x {
|
||||
@ -741,12 +745,14 @@ func BinProbability(r *request.BinProbability) (interface{}, string) {
|
||||
x = append(x, k)
|
||||
y = append(y, decimal.NewFromFloat(average).Round(2).String())
|
||||
}
|
||||
line := &model.Line{
|
||||
Name: "Bin 折线图",
|
||||
X: x,
|
||||
Y: y,
|
||||
if len(r.Group) == 0 {
|
||||
line := &model.Line{
|
||||
Name: "Bin 折线图",
|
||||
X: x,
|
||||
Y: y,
|
||||
}
|
||||
lines = append(lines, line)
|
||||
}
|
||||
lines = append(lines, line)
|
||||
for group, passProbabilityGroup := range passProbabilityGroupMap {
|
||||
var groupY []string
|
||||
for _, s := range x {
|
||||
@ -777,12 +783,14 @@ func BinProbability(r *request.BinProbability) (interface{}, string) {
|
||||
x = append(x, k)
|
||||
values = append(values, v)
|
||||
}
|
||||
boxPlot := &model.BoxPlot{
|
||||
Name: "良率 箱型图",
|
||||
X: x,
|
||||
Values: values,
|
||||
if len(r.Group) == 0 {
|
||||
boxPlot := &model.BoxPlot{
|
||||
Name: "良率 箱型图",
|
||||
X: x,
|
||||
Values: values,
|
||||
}
|
||||
boxPlots = append(boxPlots, boxPlot)
|
||||
}
|
||||
boxPlots = append(boxPlots, boxPlot)
|
||||
for group, passProbabilityGroup := range passProbabilityGroupMap {
|
||||
var groupY [][]float64
|
||||
for _, s := range x {
|
||||
|
Loading…
Reference in New Issue
Block a user