V0 图表工序模糊
This commit is contained in:
parent
8664dd811a
commit
289e2438a2
@ -1608,3 +1608,16 @@
|
|||||||
2024-10-12 10:24:07 INFO | 192.168.0.172 | 200 | 34.1357627s | POST | 未登录 | /testData/upload
|
2024-10-12 10:24:07 INFO | 192.168.0.172 | 200 | 34.1357627s | POST | 未登录 | /testData/upload
|
||||||
2024-10-12 10:25:24 INFO | 192.168.0.172 | 200 | 9.8706437s | POST | 未登录 | /testData/upload
|
2024-10-12 10:25:24 INFO | 192.168.0.172 | 200 | 9.8706437s | POST | 未登录 | /testData/upload
|
||||||
2024-10-12 11:07:57 INFO | 192.168.0.172 | 200 | 3.6585071s | POST | 未登录 | /testData/upload
|
2024-10-12 11:07:57 INFO | 192.168.0.172 | 200 | 3.6585071s | POST | 未登录 | /testData/upload
|
||||||
|
2024-10-25 11:45:36 INFO | 192.168.0.172 | 200 | 8.9895476s | POST | 未登录 | /testData/report/fTPassProbabilityByFactory
|
||||||
|
2024-10-25 11:45:54 INFO | 192.168.0.172 | 200 | 12.0813898s | POST | 未登录 | /testData/report/fTPassProbabilityByFactory
|
||||||
|
2024-10-25 11:47:59 INFO | 192.168.0.172 | 200 | 1m7.2460034s | POST | 未登录 | /testData/report/fTPassProbabilityByFactory
|
||||||
|
2024-10-25 11:47:59 INFO | 192.168.0.172 | 200 | 537.1648ms | POST | 未登录 | /testData/report/fTPassProbabilityByFactory
|
||||||
|
2024-10-25 11:48:04 INFO | 192.168.0.172 | 200 | 1.3197859s | POST | 未登录 | /testData/report/fTPassProbabilityByFactory
|
||||||
|
2024-10-25 13:38:18 INFO | 192.168.0.172 | 200 | 1h50m8.5600005s | POST | 未登录 | /testData/report/fTPassProbabilityByFactory
|
||||||
|
2024-10-25 14:18:57 INFO | 192.168.0.172 | 200 | 2.76ms | POST | 未登录 | /testData/report/fTPassProbabilityByProduct
|
||||||
|
2024-10-25 14:19:00 INFO | 192.168.0.172 | 200 | 1.8711ms | POST | 未登录 | /testData/report/fTPassProbabilityByProduct
|
||||||
|
2024-10-25 14:19:03 INFO | 192.168.0.172 | 200 | 1.7605ms | POST | 未登录 | /testData/report/fTPassProbabilityByProduct
|
||||||
|
2024-10-25 14:19:04 INFO | 192.168.0.172 | 200 | 1.6458ms | POST | 未登录 | /testData/report/fTPassProbabilityByProduct
|
||||||
|
2024-10-25 14:19:05 INFO | 192.168.0.172 | 200 | 690.6µs | POST | 未登录 | /testData/report/fTPassProbabilityByProduct
|
||||||
|
2024-10-25 14:21:11 INFO | 192.168.0.172 | 200 | 12.1305132s | POST | 未登录 | /testData/report/fTPassProbabilityByProduct
|
||||||
|
2024-10-25 14:21:27 INFO | 192.168.0.172 | 200 | 2.3926672s | POST | 未登录 | /testData/report/fTPassProbabilityByProduct
|
||||||
|
@ -274,8 +274,8 @@ func OrderNumberHistogram(r *request.PackagePassProbabilityLine) []*model.Histog
|
|||||||
func PassProbabilityByFactory(r *request.PassProbabilityByFactory) ([]*model.Line, []*model.Histogram, int, int) {
|
func PassProbabilityByFactory(r *request.PassProbabilityByFactory) ([]*model.Line, []*model.Histogram, int, int) {
|
||||||
var lines []*model.Line
|
var lines []*model.Line
|
||||||
var histogram []*model.Histogram
|
var histogram []*model.Histogram
|
||||||
max := math.MinInt
|
maxValue := math.MinInt
|
||||||
min := math.MaxInt
|
minValue := math.MaxInt
|
||||||
startDate := carbon.Now().SubYear().StartOfMonth().Format("Y-m-d")
|
startDate := carbon.Now().SubYear().StartOfMonth().Format("Y-m-d")
|
||||||
endDate := carbon.Now().EndOfMonth().Format("Y-m-d")
|
endDate := carbon.Now().EndOfMonth().Format("Y-m-d")
|
||||||
var factorys []string
|
var factorys []string
|
||||||
@ -288,7 +288,7 @@ func PassProbabilityByFactory(r *request.PassProbabilityByFactory) ([]*model.Lin
|
|||||||
for _, factory := range factorys {
|
for _, factory := range factorys {
|
||||||
var x, lineY, histogramY []string
|
var x, lineY, histogramY []string
|
||||||
var reports []*model.Report
|
var reports []*model.Report
|
||||||
global.PostGreSQL.Where("step = ? AND factory = ? AND order_date BETWEEN ? AND ?", "%"+r.Type+"%", factory, startDate, endDate).
|
global.PostGreSQL.Where("step LIKE ? AND factory = ? AND order_date BETWEEN ? AND ?", "%"+r.Type+"%", factory, startDate, endDate).
|
||||||
Find(&reports)
|
Find(&reports)
|
||||||
factoryMap := make(map[string][]string)
|
factoryMap := make(map[string][]string)
|
||||||
for _, report := range reports {
|
for _, report := range reports {
|
||||||
@ -318,11 +318,11 @@ func PassProbabilityByFactory(r *request.PassProbabilityByFactory) ([]*model.Lin
|
|||||||
passProbability := passQuantity.Div(testQuantity).
|
passProbability := passQuantity.Div(testQuantity).
|
||||||
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
|
||||||
}
|
}
|
||||||
lineY = append(lineY, passProbability.String())
|
lineY = append(lineY, passProbability.String())
|
||||||
histogramY = append(histogramY, factoryMap[month][0])
|
histogramY = append(histogramY, factoryMap[month][0])
|
||||||
@ -340,14 +340,14 @@ func PassProbabilityByFactory(r *request.PassProbabilityByFactory) ([]*model.Lin
|
|||||||
Y: histogramY,
|
Y: histogramY,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
return lines, histogram, max, min
|
return lines, histogram, maxValue, minValue
|
||||||
}
|
}
|
||||||
|
|
||||||
func FTPassProbabilityByProduct(r *request.PassProbabilityByProduct) (*model.Line, *model.Histogram, *model.Line, *model.Histogram) {
|
func FTPassProbabilityByProduct(r *request.PassProbabilityByProduct) (*model.Line, *model.Histogram, *model.Line, *model.Histogram) {
|
||||||
var line, binLine *model.Line
|
var line, binLine *model.Line
|
||||||
var histogram, binHistogram *model.Histogram
|
var histogram, binHistogram *model.Histogram
|
||||||
max := math.MinInt
|
maxValue := math.MinInt
|
||||||
min := math.MaxInt
|
minValue := math.MaxInt
|
||||||
startDate := carbon.Now().SubYear().StartOfMonth().Format("Y-m-d")
|
startDate := carbon.Now().SubYear().StartOfMonth().Format("Y-m-d")
|
||||||
endDate := carbon.Now().EndOfMonth().Format("Y-m-d")
|
endDate := carbon.Now().EndOfMonth().Format("Y-m-d")
|
||||||
var sql string
|
var sql string
|
||||||
@ -402,11 +402,11 @@ func FTPassProbabilityByProduct(r *request.PassProbabilityByProduct) (*model.Lin
|
|||||||
passProbability := passQuantity.Div(testQuantity).
|
passProbability := passQuantity.Div(testQuantity).
|
||||||
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
|
||||||
}
|
}
|
||||||
lineY = append(lineY, passProbability.String())
|
lineY = append(lineY, passProbability.String())
|
||||||
histogramY = append(histogramY, productMap[month][0])
|
histogramY = append(histogramY, productMap[month][0])
|
||||||
|
Loading…
Reference in New Issue
Block a user