Browse Source

销售成本报表

yumeng 1 năm trước cách đây
mục cha
commit
f90f25a00d

+ 8 - 2
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/report/service/impl/SalesBudgetServiceImpl.java

@@ -64,7 +64,10 @@ public class SalesBudgetServiceImpl implements ISalesBudgetService {
                             costJson.put("cost", cost);
                             costJson.put("setCost", maxValue);
                             costJson.put("name", ocpxName.replace("成本", ""));
-                            BigDecimal subtract = cost.subtract(maxValue);
+                            BigDecimal subtract = new BigDecimal(0);
+                            if (!Check.isNull(maxValue)) {
+                                subtract = cost.subtract(maxValue);
+                            }
                             int compare = subtract.compareTo(new BigDecimal(0));
                             costJson.put("compare", compare);
                             costArray.add(costJson);
@@ -136,7 +139,10 @@ public class SalesBudgetServiceImpl implements ISalesBudgetService {
                             costJson.put("cost", cost);
                             costJson.put("setCost", maxValue);
                             costJson.put("name", ocpxName.replace("成本", ""));
-                            BigDecimal subtract = cost.subtract(maxValue);
+                            BigDecimal subtract = new BigDecimal(0);
+                            if (!Check.isNull(maxValue)) {
+                                subtract = cost.subtract(maxValue);
+                            }
                             int compare = subtract.compareTo(new BigDecimal(0));
                             costJson.put("compare", compare);
                             costArray.add(costJson);