|
|
@@ -284,11 +284,10 @@ public class IotRyDailyReportServiceImpl implements IotRyDailyReportService {
|
|
|
if (ObjUtil.isNotEmpty(detail.getStartDateTime())) {
|
|
|
tempDetail.setReportDate(detail.getStartDateTime());
|
|
|
}
|
|
|
- // 计算定额时效 = 1-((时长-定额时长)/定额时长)
|
|
|
- if (ObjUtil.isNotEmpty(detail.getAllocatedTime()) && detail.getAllocatedTime().compareTo(BigDecimal.ZERO) > 0) {
|
|
|
- BigDecimal subtrahend = (detail.getDuration().subtract(detail.getAllocatedTime())).divide(detail.getAllocatedTime(), 2, RoundingMode.HALF_UP);
|
|
|
- BigDecimal minuend = new BigDecimal("1");
|
|
|
- tempDetail.setAllocatedEfficiency(minuend.subtract(subtrahend));
|
|
|
+ // 计算定额时效 = 定额时长/实际时长
|
|
|
+ if (ObjUtil.isNotEmpty(detail.getAllocatedTime()) && ObjUtil.isNotEmpty(detail.getDuration()) && detail.getDuration().compareTo(BigDecimal.ZERO) > 0) {
|
|
|
+ BigDecimal subtrahend = detail.getAllocatedTime().divide(detail.getDuration(), 4, RoundingMode.HALF_UP);
|
|
|
+ tempDetail.setAllocatedEfficiency(subtrahend);
|
|
|
}
|
|
|
reportDOs.add(tempDetail);
|
|
|
});
|