From 06d52c108eca66212d0227e9c13dca9c7f34db9e Mon Sep 17 00:00:00 2001 From: jh_peng Date: Tue, 29 Apr 2025 18:01:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=88=86=E6=9E=90=E5=B9=B3?= =?UTF-8?q?=E5=8F=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- repository/test.data/export.go | 44 +++++++++++++++++----------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/repository/test.data/export.go b/repository/test.data/export.go index a650723..7e3e103 100644 --- a/repository/test.data/export.go +++ b/repository/test.data/export.go @@ -1561,17 +1561,17 @@ func ExportFT() string { // String() + "%" //} } + var testQuantityDiff, passQuantityDiff string finalTestQuantityDecimal, _ := decimal.NewFromString(finalTestQuantity) finalPassQuantityDecimal, _ := decimal.NewFromString(finalPassQuantity) if !finalTestQuantityDecimal.IsZero() { finalPassProbability = finalPassQuantityDecimal.Div(finalTestQuantityDecimal).Round(4). Mul(decimal.NewFromInt(100)).String() + "%" + testQuantityDiff = testQuantityDecimal.Sub(finalTestQuantityDecimal).Div(finalTestQuantityDecimal).Round(4). + Mul(decimal.NewFromInt(100)).String() + "%" } - var testQuantityDiff, passQuantityDiff string hardBinState := "正常" if !testQuantityDecimal.IsZero() { - testQuantityDiff = testQuantityDecimal.Sub(finalTestQuantityDecimal).Div(testQuantityDecimal).Round(4). - Mul(decimal.NewFromInt(100)).String() + "%" passQuantityDiff = passQuantityDecimal.Sub(finalPassQuantityDecimal).Div(passQuantityDecimal).Round(4). Mul(decimal.NewFromInt(100)).String() + "%" for _, binControl := range warning.BinControl { @@ -1757,25 +1757,25 @@ func ExportFT() string { _ = 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 - } - } + //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)) }