Browse Source

健康诊断报错

zyg 1 year ago
parent
commit
eb741f63bb

+ 1 - 1
hz-business/src/main/java/com/hz/business/service/impl/BatteryServiceImpl.java

@@ -2533,7 +2533,7 @@ public class BatteryServiceImpl extends ServiceImpl<BatteryMapper, Battery> impl
             if (i > 1) {
             if (i > 1) {
                 BigDecimal b1 = BigDecimal.valueOf(singleList.get(i).getOdo() - singleList.get(i - 1).getOdo());
                 BigDecimal b1 = BigDecimal.valueOf(singleList.get(i).getOdo() - singleList.get(i - 1).getOdo());
                 BigDecimal b2 = BigDecimal.valueOf(Double.parseDouble(String.valueOf(singleList.get(i).getTimeSt().getTime() / (1000 * 60 * 60 * 24) - singleList.get(i - 1).getTimeSt().getTime() / (1000 * 60 * 60 * 24))));
                 BigDecimal b2 = BigDecimal.valueOf(Double.parseDouble(String.valueOf(singleList.get(i).getTimeSt().getTime() / (1000 * 60 * 60 * 24) - singleList.get(i - 1).getTimeSt().getTime() / (1000 * 60 * 60 * 24))));
-                if (b1.compareTo(new BigDecimal(0)) != 0 || b2.compareTo(new BigDecimal(0)) != 0) {
+                if (b1.compareTo(new BigDecimal(0)) != 0 && b2.compareTo(new BigDecimal(0)) != 0) {
                     if (b1.divide(b2, 1, RoundingMode.UP).compareTo(new BigDecimal("400.0")) > 0) {
                     if (b1.divide(b2, 1, RoundingMode.UP).compareTo(new BigDecimal("400.0")) > 0) {
                         singleList.remove(i);
                         singleList.remove(i);
                         i--;
                         i--;