|
|
|
@ -95,26 +95,26 @@ public class DeviceInterfaceServiceImpl implements IDeviceInterfaceService {
|
|
|
|
|
runTime += diffTime;
|
|
|
|
|
}
|
|
|
|
|
// 计算维修质量(故障时间(小时)/故障次数)
|
|
|
|
|
double rapairQuantity = runTime / 3600000 / workOrderList.size();
|
|
|
|
|
equipmentVO.setRapairQuantity(Double.valueOf(rapairQuantity));
|
|
|
|
|
Double rapairQuantity = runTime / 3600000 / workOrderList.size();
|
|
|
|
|
String douStr = String.format("%.2f", rapairQuantity);
|
|
|
|
|
equipmentVO.setRapairQuantity(douStr);
|
|
|
|
|
} else {
|
|
|
|
|
// 没有该记录则默认为0
|
|
|
|
|
equipmentVO.setRapairQuantity(0D);
|
|
|
|
|
equipmentVO.setRapairQuantity("0.00");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 按照raparQuantity字段进行排序,并使用subList获取前10个结果
|
|
|
|
|
List<IEquipmentVO> top10 = equipmentVOList.stream()
|
|
|
|
|
.sorted(Comparator.comparingDouble(IEquipmentVO::getRapairQuantity)) // 排序
|
|
|
|
|
.limit(10) // 限制结果数量为10
|
|
|
|
|
.collect(Collectors.toList()); // 将结果收集到List中
|
|
|
|
|
|
|
|
|
|
.sorted(Comparator.comparing(IEquipmentVO::getRapairQuantity).reversed())// 由正序改为 反转排序 倒序
|
|
|
|
|
// .limit(10) // 限制结果数量为10 改为不限制结果数量
|
|
|
|
|
.collect(Collectors.toList()); //将结果收集到List中
|
|
|
|
|
return success(top10);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 设备稳定性-MTBF top10
|
|
|
|
|
* 设备稳定性-MTBF
|
|
|
|
|
* 公式:实际运转时间/停机次数
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
@ -132,7 +132,7 @@ public class DeviceInterfaceServiceImpl implements IDeviceInterfaceService {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 完好设备占比
|
|
|
|
|
* 公式:维修/故障设备
|
|
|
|
|
* 公式:(所有设备-故障设备)/所有设备
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
@DS("#header.poolName")
|
|
|
|
|