数据分析平台 测试良率计算公式调整

This commit is contained in:
jh_peng 2025-04-29 18:05:31 +08:00
parent 06d52c108e
commit 8aa2e451ab

View File

@ -1489,8 +1489,8 @@ func FTList(r *request.FTList) ([]*model.FTShowList, int64) {
firstPassQuantityDecimal, _ := decimal.NewFromString(ftShowList.FirstPassQuantity) firstPassQuantityDecimal, _ := decimal.NewFromString(ftShowList.FirstPassQuantity)
passQuantityDecimal, _ := decimal.NewFromString(ftShowList.PassQuantity) passQuantityDecimal, _ := decimal.NewFromString(ftShowList.PassQuantity)
reportPassQuantityDecimal, _ := decimal.NewFromString(ftShowList.ReportPassQuantity) reportPassQuantityDecimal, _ := decimal.NewFromString(ftShowList.ReportPassQuantity)
if !testQuantityDecimal.IsZero() { if !reportTestQuantityDecimal.IsZero() {
diff := reportTestQuantityDecimal.Sub(testQuantityDecimal).Div(testQuantityDecimal).Round(4). diff := reportTestQuantityDecimal.Sub(testQuantityDecimal).Div(reportTestQuantityDecimal).Round(4).
Mul(decimal.NewFromInt(100)) Mul(decimal.NewFromInt(100))
if reportTestQuantityDecimal.Sub(testQuantityDecimal).LessThan(decimal.NewFromInt(0)) || if reportTestQuantityDecimal.Sub(testQuantityDecimal).LessThan(decimal.NewFromInt(0)) ||
decimal.NewFromInt(5).LessThanOrEqual(diff) { decimal.NewFromInt(5).LessThanOrEqual(diff) {
@ -1498,6 +1498,10 @@ func FTList(r *request.FTList) ([]*model.FTShowList, int64) {
} }
ftShowList.TestQuantityDiff = diff.String() + "%" ftShowList.TestQuantityDiff = diff.String() + "%"
ftShowList.TestQuantityDiffLabel = testQuantityDiffLabel ftShowList.TestQuantityDiffLabel = testQuantityDiffLabel
}
if !testQuantityDecimal.IsZero() {
//diff := reportTestQuantityDecimal.Sub(testQuantityDecimal).Div(testQuantityDecimal).Round(4).
// Mul(decimal.NewFromInt(100))
probability := passQuantityDecimal.Sub(firstPassQuantityDecimal).Div(testQuantityDecimal).Round(4). probability := passQuantityDecimal.Sub(firstPassQuantityDecimal).Div(testQuantityDecimal).Round(4).
Mul(decimal.NewFromInt(100)) Mul(decimal.NewFromInt(100))
if probability.LessThan(decimal.NewFromInt(0)) || if probability.LessThan(decimal.NewFromInt(0)) ||