Browse Source

基于时间模型计算

feature_zx
娄文智 2 years ago
parent
commit
573725c7c9
1 changed files with 5 additions and 5 deletions
  1. +5
    -5
      services/pln/implments/CustOrder.Dashborad.impl.go

+ 5
- 5
services/pln/implments/CustOrder.Dashborad.impl.go View File

@ -1684,6 +1684,7 @@ func (impl *CustOrderServiceImplement) SelectPic3(user *global.User, DayModelHou
key := hours[i]
recordKey := utils.TimeFormat(nowTime, "yyyy-MM-dd HH:00")
preTime, _ := time.ParseInLocation("2006-01-02 15:04", key, utils.TimezoneLocation)
endTime := preTime.Add(1 * time.Hour)
headInfo, err := headDao.SelectOneByKey(workLineId, utils.TimeFormat(preTime.Add(1*time.Hour), "yyyy-MM-dd HH:00"))
if err != nil {
fmt.Println(err)
@ -1694,12 +1695,11 @@ func (impl *CustOrderServiceImplement) SelectPic3(user *global.User, DayModelHou
//判断是否是当前时间
if headInfo != nil && headInfo.CurrentTempo != 0 {
if key != recordKey {
DashboardData3.CompleteNumber += 3600 / headInfo.CurrentTempo
usedTime := impl.GetUsefulTime(preTime,endTime, timeModelList)
DashboardData3.CompleteNumber += usedTime / headInfo.CurrentTempo
} else {
nowCurrentTime, _ := time.ParseInLocation("2006-01-02 15:04", key, utils.TimezoneLocation)
lenTime := nowTime.Sub(nowCurrentTime).Minutes()
perTime := float64(lenTime / 60)
DashboardData3.CompleteNumber += utils.ValueToInt(float64(3600/headInfo.CurrentTempo)*perTime, 0)
usedTime := impl.GetUsefulTime(preTime,nowTime, timeModelList)
DashboardData3.CompleteNumber += utils.ValueToInt(float64(usedTime/headInfo.CurrentTempo), 0)
}
}
continue


Loading…
Cancel
Save