Преглед на файлове

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

pengdi@zoniot.com преди 3 години
родител
ревизия
0e626d2841
променени са 1 файла, в които са добавени 3 реда и са изтрити 2 реда
  1. 3 2
      meter-reading-common/src/main/java/com/huaxu/zoniot/service/impl/MeterReadRecordServiceImpl.java

+ 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);