From 328747d6346dfc09fa5a889209e76b2b6404b844 Mon Sep 17 00:00:00 2001 From: louwenzhi Date: Mon, 23 May 2022 14:52:46 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B9=B3=E5=9D=87=E6=AF=8F=E5=B0=8F=E6=97=B6?= =?UTF-8?q?=E4=BA=A7=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pln/implments/CustOrder.Dashborad.impl.go | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/services/pln/implments/CustOrder.Dashborad.impl.go b/services/pln/implments/CustOrder.Dashborad.impl.go index 7cbf2c1..ebd42dc 100644 --- a/services/pln/implments/CustOrder.Dashborad.impl.go +++ b/services/pln/implments/CustOrder.Dashborad.impl.go @@ -848,7 +848,13 @@ func (impl *CustOrderServiceImplement) SelectTeamTemPo(user *global.User, dayMod packTimes := impl.GetUsefulTime(WorkShift1StartTime, time.Now(), timeModelList) if countPack > 0 { TeamTemPoNumber = utils.Decimal(float64(packTimes)/float64(countPack), 2) - PerTeamTemPoNumber = utils.Decimal(float64(countPack)/float64(num), 4) + if packTimes > 0 { + packHours := packTimes / 3600 + PerTeamTemPoNumber = utils.Decimal(float64(countPack)/float64(num)/float64(packHours), 4) + } else { + PerTeamTemPoNumber = 0 + } + } else { TeamTemPoNumber = 0 PerTeamTemPoNumber = 0 @@ -872,7 +878,12 @@ func (impl *CustOrderServiceImplement) SelectTeamTemPo(user *global.User, dayMod packTimes := impl.GetUsefulTime(WorkShift2StartTime, time.Now(), timeModelList) if countPack > 0 { TeamTemPoNumber = utils.Decimal(float64(packTimes)/float64(countPack), 2) - PerTeamTemPoNumber = utils.Decimal(float64(countPack)/float64(num), 4) + if packTimes > 0 { + packHours := packTimes / 3600 + PerTeamTemPoNumber = utils.Decimal(float64(countPack)/float64(num)/float64(packHours), 4) + } else { + PerTeamTemPoNumber = 0 + } } else { TeamTemPoNumber = 0 PerTeamTemPoNumber = 0 @@ -895,7 +906,12 @@ func (impl *CustOrderServiceImplement) SelectTeamTemPo(user *global.User, dayMod packTimes := impl.GetUsefulTime(WorkShift3StartTime, time.Now(), timeModelList) if countPack > 0 { TeamTemPoNumber = utils.Decimal(float64(packTimes)/float64(countPack), 2) - PerTeamTemPoNumber = utils.Decimal(float64(countPack)/float64(num), 4) + if packTimes > 0 { + packHours := packTimes / 3600 + PerTeamTemPoNumber = utils.Decimal(float64(countPack)/float64(num)/float64(packHours), 4) + } else { + PerTeamTemPoNumber = 0 + } } else { TeamTemPoNumber = 0 PerTeamTemPoNumber = 0