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