Browse Source

Merge pull request '修改dashboard和异步派工的bug' (#229) from develop into master

Reviewed-on: http://101.201.121.115:3000/leo/LAPP_Acura_MES_Backend/pulls/229
fix_dashboard V1.2.12
zhangxin 2 years ago
parent
commit
d5530a72af
2 changed files with 9 additions and 4 deletions
  1. +3
    -2
      services/pln/implments/CustOrder.Dashborad.impl.go
  2. +6
    -2
      services/pln/implments/CustOrderLogic.service.impl.go

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

@ -1147,14 +1147,15 @@ func (impl *CustOrderServiceImplement) SelectPic1(user *global.User, dayModel *b
}
currentTime = todayStartTime.Add(time.Hour * time.Duration(hour))
for _, productFamilyProductData := range productDataLi {
usedTime := impl.GetUsefulTime(currentTime, productFamilyProductData.LastDoneTime, timeModelList)
currentTime = productFamilyProductData.LastDoneTime
meter := productFamilyMeterMap[productFamilyProductData.ProductFamilyId]
var percent float64
if productFamilyProductData.Qty != 0 && usedTime != 0 && hourAllUsedTime != 0 && meter != 0 {
percent = float64(productFamilyProductData.Qty) / (meter * (float64(usedTime) / float64(hourAllUsedTime)))
//percent = meter / (float64(usedTime) / float64(productFamilyProductData.Qty)) * (float64(usedTime) / float64(hourAllUsedTime))
percent = (meter / (float64(usedTime) / float64(productFamilyProductData.Qty))) * (float64(usedTime) / float64(hourAllUsedTime))
}
hourPercent += percent
}
result.ProduceData = append(result.ProduceData, utils.Decimal(hourPercent, 2))


+ 6
- 2
services/pln/implments/CustOrderLogic.service.impl.go View File

@ -81,7 +81,9 @@ func (impl *CustOrderServiceImplement) LockCustOrder(user *global.User, custOrde
sort.Slice(custOrderLi, func(i, j int) bool {
itemI := custOrderLi[i]
itemJ := custOrderLi[j]
return itemJ.PlanStartTime.Restore().Before(itemI.PlanStartTime.Restore())
iUnix := itemI.PlanStartTime.Restore().Unix()
jUnix := itemJ.PlanStartTime.Restore().Unix()
return iUnix < jUnix
})
plantNr := user.PlantNr
channel, exist := common.ReleaseTaskChannel[plantNr]
@ -266,7 +268,9 @@ func (impl *CustOrderServiceImplement) AnalysisPlanFromExcel(user *global.User,
sort.Slice(releaseCustOrderLi, func(i, j int) bool {
itemI := releaseCustOrderLi[i]
itemJ := releaseCustOrderLi[j]
return itemI.PlanStartTime.Restore().Before(itemJ.PlanStartTime.Restore())
iUnix := itemI.PlanStartTime.Restore().Unix()
jUnix := itemJ.PlanStartTime.Restore().Unix()
return iUnix < jUnix
})
plantNr := user.PlantNr
channel, exist := common.ReleaseTaskChannel[plantNr]


Loading…
Cancel
Save