From ee9640fad074c9e874198f539cebd93bac96471c Mon Sep 17 00:00:00 2001 From: "DESKTOP-H7A6KL3\\wenzh" Date: Thu, 18 Aug 2022 13:18:22 +0800 Subject: [PATCH] =?UTF-8?q?dashborad=20=20=E5=AE=9E=E6=97=B6=E5=88=B7?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pln/implments/CustOrder.Dashborad.impl.go | 20 +++++++------------ 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/services/pln/implments/CustOrder.Dashborad.impl.go b/services/pln/implments/CustOrder.Dashborad.impl.go index 59258dd..b9a2c0e 100644 --- a/services/pln/implments/CustOrder.Dashborad.impl.go +++ b/services/pln/implments/CustOrder.Dashborad.impl.go @@ -1570,16 +1570,11 @@ func (impl *CustOrderServiceImplement) SelectPic3(user *global.User, DayModelHou hourData, exist := displayHourProductMap[key] if !exist { //判断是否是当前时间 - if headInfo != nil && headInfo.CurrentTempo != 0 { - if key != recordKey { - DashboardData3.CompleteNumber += 3600 / headInfo.CurrentTempo - } else { - nowCurrentTime, _ := time.ParseInLocation("2006-01-02 15:04", key, utils.TimezoneLocation) - lenTime := time.Now().Sub(nowCurrentTime).Minutes() - perTime := float64(lenTime / 60) - DashboardData3.CompleteNumber += utils.ValueToInt(float64(3600/headInfo.CurrentTempo)*perTime, 0) - } + if headInfo != nil && headInfo.CurrentTempo != 0 && key != recordKey { + DashboardData3.CompleteNumber += 3600 / headInfo.CurrentTempo } + glog.InfoExtln("目标达成率", "key", key) + glog.InfoExtln("目标达成率", "CompleteNumber", 3600/headInfo.CurrentTempo) continue } var hourPercent float64 @@ -1611,8 +1606,8 @@ func (impl *CustOrderServiceImplement) SelectPic3(user *global.User, DayModelHou glog.InfoExtln("计算时间", "nowTime", nowTime) lenSeconds := nowTime.Sub(currentTime).Seconds() glog.InfoExtln("计算时间", "lenSeconds", lenSeconds) - nowKey := utils.TimeFormat(currentTime, "yyyy-MM-dd HH:00") - if headInfo != nil && headInfo.CurrentTempo > 0 && key == recordKey{ + nowKey := utils.TimeFormat(currentTime, "yyyy-MM-dd HH:mm") + if headInfo != nil && headInfo.CurrentTempo > 0 && key == recordKey { if nowKey > recordKey { hourPercent += lenSeconds / float64(headInfo.CurrentTempo) } @@ -1632,10 +1627,9 @@ func (impl *CustOrderServiceImplement) SelectPic3(user *global.User, DayModelHou jPHPercent = jPHPercent * (float64(hourAllUsedTime) / 3600) } glog.InfoExtln("目标达成率", "key", key) - glog.InfoExtln("目标达成率", "jphVal", jphVal) - glog.InfoExtln("目标达成率", "jphVal", jphVal) glog.InfoExtln("目标达成率", "hourPercent", hourPercent) glog.InfoExtln("目标达成率", "jPHPercent", jPHPercent) + glog.InfoExtln("目标达成率", "CompleteNumber", utils.ValueToInt(utils.ValueToFloat(hourPercent, 0.0)*jPHPercent, 0)) jphMap[key] = jphVal DashboardData3.CompleteNumber += utils.ValueToInt(utils.ValueToFloat(hourPercent, 0.0)*jPHPercent, 0)