...
|
...
|
@@ -25,7 +25,7 @@ type ProductRecordStaticInfo struct { |
|
|
// 历史最好产出量
|
|
|
BestOutputWeight float64 `json:"bestOutputWeight"`
|
|
|
// 合格率
|
|
|
QualificationRate int `json:"qualificationRate"`
|
|
|
QualificationRate float64 `json:"qualificationRate"`
|
|
|
|
|
|
// 其他工段二级品的重量合计
|
|
|
TotalOtherSecondLevelWeigh float64 `json:"totalOtherSecondLevelWeigh"`
|
...
|
...
|
@@ -38,7 +38,7 @@ func (info *ProductRecordStaticInfo) OtherSecondLevelWeigh() float64 { |
|
|
for _, v := range info.OtherSectionSecondLevelWeigh {
|
|
|
result += v
|
|
|
}
|
|
|
return result
|
|
|
return utils.Round(result, 1)
|
|
|
}
|
|
|
|
|
|
// AddSectionWeight 添加工段的二级品
|
...
|
...
|
@@ -57,9 +57,9 @@ func (info *ProductRecordStaticInfo) AddSectionWeight(section string, weight flo |
|
|
// bestWeight 最佳产能
|
|
|
func (info *ProductRecordStaticInfo) PreStatistics(productWeight float64, secondWeight float64, yesterdayWeight float64, bestWeight float64) {
|
|
|
totalOtherSecondLevelWeigh := info.OtherSecondLevelWeigh()
|
|
|
info.InputWeight = productWeight - totalOtherSecondLevelWeigh
|
|
|
info.OutputWeight = info.InputWeight - secondWeight
|
|
|
info.SecondLevelWeight = secondWeight
|
|
|
info.InputWeight = utils.Round(productWeight-totalOtherSecondLevelWeigh, 1)
|
|
|
info.OutputWeight = utils.Round(info.InputWeight-secondWeight, 1)
|
|
|
info.SecondLevelWeight = utils.Round(secondWeight, 1)
|
|
|
if info.YesterdayOutputWeight == 0 && info.BestOutputWeight == 0 {
|
|
|
info.YesterdayOutputWeight = yesterdayWeight
|
|
|
info.BestOutputWeight = bestWeight
|
...
|
...
|
@@ -68,5 +68,5 @@ func (info *ProductRecordStaticInfo) PreStatistics(productWeight float64, second |
|
|
info.BestOutputWeight = info.OutputWeight
|
|
|
}
|
|
|
info.TotalOtherSecondLevelWeigh = totalOtherSecondLevelWeigh
|
|
|
info.QualificationRate = int(utils.Round(info.OutputWeight/info.InputWeight*100, 2))
|
|
|
info.QualificationRate = utils.Round(info.OutputWeight*100.0/info.InputWeight, 0)
|
|
|
} |
...
|
...
|
|