Browse Source

岸电情况分年度对比分析表 合计中同比增减和同比增减率计算bug修改

sbj 3 weeks ago
parent
commit
7270526f65

+ 5 - 2
src/main/java/com/shcd/service/impl/SpStatementShipUsageMonthServiceImpl.java

@@ -567,7 +567,8 @@ public class SpStatementShipUsageMonthServiceImpl extends
             spShipUsageTimeBefore.getData().add(sum.getShorePowerTimeMonth()));
         spShipUsageTimeTotal.setDataType(1);
         spShipUsageTimeTotal.setCircleDiff(
-            spShipUsageTimeTotal.getData().subtract(spShipUsageTimeBefore.getData())
+            spShipUsageTimeTotal.getData().subtract(
+                    list.stream().filter(i -> i.getDataType() == 1).collect(Collectors.toList()).get(0).getData())
                 .setScale(2, RoundingMode.HALF_UP));
         spShipUsageTimeTotal.setCircleDiffRatio(
             list.stream().filter(i -> i.getDataType() == 1).collect(Collectors.toList()).get(0)
@@ -617,7 +618,9 @@ public class SpStatementShipUsageMonthServiceImpl extends
             spShipUsageElecTimeTotalBefore.getData().add(sum.getShorePowerCountMonth()));
         spShipUsageElecTimeTotal.setDataType(2);
         spShipUsageElecTimeTotal.setCircleDiff(
-            spShipUsageElecTimeTotal.getData().subtract(spShipUsageElecTimeTotalBefore.getData())
+            spShipUsageElecTimeTotal.getData().subtract(
+                    list.stream().filter(i -> i.getDataType() == 2)
+                            .collect(Collectors.toList()).get(0).getData())
                 .setScale(2, RoundingMode.HALF_UP));
         spShipUsageElecTimeTotal.setCircleDiffRatio(
             list.stream().filter(i -> i.getDataType() == 2).collect(Collectors.toList()).get(0)

File diff suppressed because it is too large
+ 1 - 1
src/main/resources/profile/dev/application.properties