You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

40 lines
754 B

package schedule
import (
"leit.com/LAPP_GAAS_GFrame/models"
"time"
)
type WorkShiftSrv struct {
WorkShiftNr int
ShiftType string
StartTime time.Time
EndTime time.Time
Wsstab models.Workshift
}
func( wss *WorkShiftSrv)Init(wstab models.Workshift){
wss.WorkShiftNr = wstab.Plantnr
wss.Wsstab = wstab
}
// 基于指定的人数获取效率
func( wss *WorkShiftSrv)GetEff(pesqty int)(eff float32){
var(
i int
found bool
)
found = false
for i = 0; i < len(wss.Wsstab.Efflst); i++ {
if pesqty >= wss.Wsstab.Efflst[i].Planpersonlclqty && pesqty <= wss.Wsstab.Efflst[i].Planpersonuclqty {
found = true
eff = wss.Wsstab.Efflst[i].Planefficiency
break
}
}
if !found {
eff = wss.Wsstab.Planefficiency
}
return
}