瀏覽代碼

用水量精度调整 PengDi@2021/4/1

pengdi@zoniot.com 3 年之前
父節點
當前提交
0e626d2841

+ 3 - 2
meter-reading-common/src/main/java/com/huaxu/zoniot/service/impl/MeterReadRecordServiceImpl.java

@@ -451,9 +451,10 @@ public class MeterReadRecordServiceImpl implements MeterReadRecordService {
                 throw new ServiceException(ResultStatus.READING_ERROR_4);
             }
             // 计算今日用水量
-            Double todayCost = calculateTodayCost(currentReading,
+            Double todayCost = new BigDecimal(calculateTodayCost(currentReading,
                     new Double(getMeterLastValid(waterMeter,readDay)),
-                    record);
+                    record)).setScale(3,BigDecimal.ROUND_HALF_UP).doubleValue();
+
             MeterReadRecord update = new MeterReadRecord();
             update.setId(record.getId());
             update.setLastCost(todayCost);