feat(视图): 同比环比

This commit is contained in:
junjie 2021-12-20 11:33:23 +08:00
parent b05581c198
commit 76e83b6896

View File

@ -509,7 +509,7 @@ public class ChartViewService {
if (StringUtils.equalsIgnoreCase(resultData, "sub")) { if (StringUtils.equalsIgnoreCase(resultData, "sub")) {
item[dataIndex] = new BigDecimal(cValue).subtract(new BigDecimal(lastValue)).toString(); item[dataIndex] = new BigDecimal(cValue).subtract(new BigDecimal(lastValue)).toString();
} else if (StringUtils.equalsIgnoreCase(resultData, "percent")) { } else if (StringUtils.equalsIgnoreCase(resultData, "percent")) {
if (Integer.parseInt(lastValue) == 0) { if (new BigDecimal(lastValue).compareTo(BigDecimal.ZERO) == 0) {
item[dataIndex] = null; item[dataIndex] = null;
} else { } else {
item[dataIndex] = new BigDecimal(cValue) item[dataIndex] = new BigDecimal(cValue)