|
|
package domain
|
|
|
|
|
|
import "time"
|
|
|
import (
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/utils"
|
|
|
"time"
|
|
|
)
|
|
|
|
|
|
// 员工生产记录
|
|
|
type WorkshopProductRecord struct {
|
...
|
...
|
@@ -89,8 +92,12 @@ func (employeeProductRecord *WorkshopProductRecord) QualificationRate() int { |
|
|
if realProductWeigh == 0 {
|
|
|
return 0
|
|
|
}
|
|
|
devoteWeigh := employeeProductRecord.DevotedProductWeigh()
|
|
|
if devoteWeigh == 0 {
|
|
|
return 0
|
|
|
}
|
|
|
// 合格率 = 产能重量 / (总投入重量 - 上级损耗重量)
|
|
|
result := int(realProductWeigh * 100 / (employeeProductRecord.ProductWeigh - employeeProductRecord.ProductRecordInfo.OtherSecondLevelWeigh()))
|
|
|
result := int(utils.Round(realProductWeigh*100/devoteWeigh, 0))
|
|
|
return result
|
|
|
}
|
|
|
func (employeeProductRecord *WorkshopProductRecord) DevotedProductWeigh() float64 {
|
...
|
...
|
|