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

1.资产效率值表判断除数为null的情况

GouGengquan преди 4 месеца
родител
ревизия
f226dd1823
променени са 1 файла, в които са добавени 7 реда и са изтрити 7 реда
  1. 7 7
      service/src/main/java/com/dayou/service/impl/AssetsStatisticalStatementServiceImpl.java

+ 7 - 7
service/src/main/java/com/dayou/service/impl/AssetsStatisticalStatementServiceImpl.java

@@ -170,13 +170,13 @@ public class AssetsStatisticalStatementServiceImpl implements IAssetsStatistical
                 efficiencyVO.setCurrentPeriodOrderHasReportVolume(0.0);
             }
             // 计算同比出单率
-            if (efficiencyVO.getYoYReportVolume() > 0) {
+            if (efficiencyVO.getYoYReportVolume() > 0 && efficiencyVO.getYoYOrderVolume() > 0) {
                 efficiencyVO.setYoYOrderHasReportVolume(NumberUtil.round((efficiencyVO.getCurrentPeriodOrderHasReportVolume() - (efficiencyVO.getYoYReportVolume() / efficiencyVO.getYoYOrderVolume())) / (efficiencyVO.getYoYReportVolume() / efficiencyVO.getYoYOrderVolume()) * 100, 2).doubleValue());
             } else {
                 efficiencyVO.setYoYOrderHasReportVolume(NumberUtil.round(efficiencyVO.getCurrentPeriodOrderHasReportVolume() * 100, 2).doubleValue());
             }
             // 计算环比出单率
-            if (efficiencyVO.getQoQReportVolume() > 0) {
+            if (efficiencyVO.getQoQReportVolume() > 0 && efficiencyVO.getYoYOrderVolume() > 0) {
                 efficiencyVO.setQoQOrderHasReportVolume(NumberUtil.round((efficiencyVO.getCurrentPeriodOrderHasReportVolume() - (efficiencyVO.getQoQReportVolume() / efficiencyVO.getQoQOrderVolume())) / (efficiencyVO.getQoQReportVolume() / efficiencyVO.getQoQOrderVolume()) * 100, 2).doubleValue());
             } else {
                 efficiencyVO.setQoQOrderHasReportVolume(NumberUtil.round(efficiencyVO.getCurrentPeriodOrderHasReportVolume() * 100, 2).doubleValue());
@@ -260,7 +260,7 @@ public class AssetsStatisticalStatementServiceImpl implements IAssetsStatistical
                 efficiencyVO.setCurrentPeriodOrderHasReportVolume(0.0);
             }
             // 计算同比出单率
-            if (efficiencyVO.getYoYReportVolume() > 0) {
+            if (efficiencyVO.getYoYReportVolume() > 0 && efficiencyVO.getYoYOrderVolume() > 0) {
                 efficiencyVO.setYoYOrderHasReportVolume(NumberUtil.round((efficiencyVO.getCurrentPeriodOrderHasReportVolume() - (efficiencyVO.getYoYReportVolume() / efficiencyVO.getYoYOrderVolume())) / (efficiencyVO.getYoYReportVolume() / efficiencyVO.getYoYOrderVolume()) * 100, 2).doubleValue());
             } else {
                 efficiencyVO.setYoYOrderHasReportVolume(NumberUtil.round(efficiencyVO.getCurrentPeriodOrderHasReportVolume() * 100, 2).doubleValue());
@@ -497,7 +497,7 @@ public class AssetsStatisticalStatementServiceImpl implements IAssetsStatistical
                 efficiencyVO.setYoYOrderHasReportVolume(NumberUtil.round(efficiencyVO.getCurrentPeriodOrderHasReportVolume() * 100, 2).doubleValue());
             }
             // 计算环比出单率
-            if (efficiencyVO.getQoQReportVolume() > 0) {
+            if (efficiencyVO.getQoQReportVolume() > 0 && efficiencyVO.getQoQOrderVolume() > 0) {
                 efficiencyVO.setQoQOrderHasReportVolume(NumberUtil.round((efficiencyVO.getCurrentPeriodOrderHasReportVolume() - (efficiencyVO.getQoQReportVolume() / efficiencyVO.getQoQOrderVolume())) / (efficiencyVO.getQoQReportVolume() / efficiencyVO.getQoQOrderVolume()) * 100, 2).doubleValue());
             } else {
                 efficiencyVO.setQoQOrderHasReportVolume(NumberUtil.round(efficiencyVO.getCurrentPeriodOrderHasReportVolume() * 100, 2).doubleValue());
@@ -590,13 +590,13 @@ public class AssetsStatisticalStatementServiceImpl implements IAssetsStatistical
         for (AssetsCustomerEfficiencyVO efficiencyVO : efficiencyVOList) {
 
             // 计算当期出单率
-            if (efficiencyVO.getCurrentPeriodReportVolume() > 0) { // 当期出报告书大于0
+            if (efficiencyVO.getCurrentPeriodReportVolume() > 0 && efficiencyVO.getCurrentPeriodOrderVolume() > 0) { // 当期出报告书大于0
                 efficiencyVO.setCurrentPeriodOrderHasReportVolume((efficiencyVO.getCurrentPeriodReportVolume().doubleValue() / efficiencyVO.getCurrentPeriodOrderVolume().doubleValue()));
             } else {
                 efficiencyVO.setCurrentPeriodOrderHasReportVolume(0.0);
             }
             // 计算同比出单率
-            if (efficiencyVO.getYoYReportVolume() > 0) {
+            if (efficiencyVO.getYoYReportVolume() > 0 && efficiencyVO.getYoYOrderVolume() > 0) {
                 efficiencyVO.setYoYOrderHasReportVolume(NumberUtil.round((efficiencyVO.getCurrentPeriodOrderHasReportVolume() - (efficiencyVO.getYoYReportVolume() / efficiencyVO.getYoYOrderVolume())) / (efficiencyVO.getYoYReportVolume() / efficiencyVO.getYoYOrderVolume()) * 100, 2).doubleValue());
             } else {
                 efficiencyVO.setYoYOrderHasReportVolume(NumberUtil.round(efficiencyVO.getCurrentPeriodOrderHasReportVolume() * 100, 2).doubleValue());
@@ -701,7 +701,7 @@ public class AssetsStatisticalStatementServiceImpl implements IAssetsStatistical
         for (AssetsCustomerEfficiencyVO efficiencyVO : efficiencyVOList) {
 
             // 计算当期出单率
-            if (efficiencyVO.getCurrentPeriodReportVolume() > 0) { // 当期出报告书大于0
+            if (efficiencyVO.getCurrentPeriodReportVolume() > 0 && efficiencyVO.getCurrentPeriodOrderVolume() > 0) { // 当期出报告书大于0
                 efficiencyVO.setCurrentPeriodOrderHasReportVolume((efficiencyVO.getCurrentPeriodReportVolume().doubleValue() / efficiencyVO.getCurrentPeriodOrderVolume().doubleValue()));
             } else {
                 efficiencyVO.setCurrentPeriodOrderHasReportVolume(0.0);