V0
This commit is contained in:
parent
badd99a9a7
commit
e798008109
@ -63,13 +63,14 @@ func PackagePassProbabilityLine(r *request.PackagePassProbabilityLine) ([]*model
|
||||
x = append(x, carbon.Parse(r.OrderDateStart).AddYears(i).Format("Y"))
|
||||
}
|
||||
}
|
||||
max := math.MinInt
|
||||
min := math.MaxInt
|
||||
maxValue := math.MinInt
|
||||
minValue := math.MaxInt
|
||||
var line []*model.Line
|
||||
for _, factory := range factories {
|
||||
var pmc *model.PmcFile
|
||||
global.Oracle.Where("pmc01 = ?", factory).Find(&pmc)
|
||||
var tcSfcFile []*model.TcSfcFile
|
||||
global.Oracle.Where("tc_sfc08 LIKE ? AND tc_sfc04 = ?", "%AB%", factory).Where(sql).
|
||||
Preload("PmcFile").
|
||||
Preload("TcSfdFile", func(db *gorm.DB) *gorm.DB {
|
||||
return db.Preload("ImaFile").Preload("RvaFile", func(db *gorm.DB) *gorm.DB {
|
||||
return db.Preload("IddFile")
|
||||
@ -131,11 +132,11 @@ func PackagePassProbabilityLine(r *request.PackagePassProbabilityLine) ([]*model
|
||||
Round(4).Mul(decimal.NewFromFloat(100))
|
||||
|
||||
passProbabilityInt, _ := strconv.Atoi(passProbability.Round(0).String())
|
||||
if passProbabilityInt > max {
|
||||
max = passProbabilityInt + 1
|
||||
if passProbabilityInt > maxValue {
|
||||
maxValue = passProbabilityInt + 1
|
||||
}
|
||||
if passProbabilityInt < min {
|
||||
min = passProbabilityInt - 1
|
||||
if passProbabilityInt < minValue {
|
||||
minValue = passProbabilityInt - 1
|
||||
}
|
||||
y = append(y, passProbability.String())
|
||||
}
|
||||
@ -144,12 +145,12 @@ func PackagePassProbabilityLine(r *request.PackagePassProbabilityLine) ([]*model
|
||||
}
|
||||
}
|
||||
line = append(line, &model.Line{
|
||||
Name: factory,
|
||||
Name: pmc.Pmc03,
|
||||
X: x,
|
||||
Y: y,
|
||||
})
|
||||
}
|
||||
return line, max, min
|
||||
return line, maxValue, minValue
|
||||
}
|
||||
|
||||
func OrderNumberHistogram(r *request.PackagePassProbabilityLine) []*model.Histogram {
|
||||
|
Loading…
Reference in New Issue
Block a user