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