fix echarts partner为false加1情况

master
luoyang 5 years ago
parent b20384f400
commit 698ec55577

@ -9,7 +9,7 @@
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>manage</artifactId> <artifactId>manage</artifactId>
<version>1.4.14</version> <version>1.4.15</version>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jib-maven-plugin.version>1.8.0</jib-maven-plugin.version> <jib-maven-plugin.version>1.8.0</jib-maven-plugin.version>

@ -6,6 +6,7 @@ import au.com.royalpay.payment.tools.utils.PageListUtils;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds; import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList; import com.github.miemiedev.mybatis.paginator.domain.PageList;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateFormatUtils; import org.apache.commons.lang3.time.DateFormatUtils;
import org.apache.commons.lang3.time.DateUtils; import org.apache.commons.lang3.time.DateUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -76,6 +77,10 @@ public class DataAnalysisServiceImpl implements DataAnalysisService {
BigDecimal totalClients = new BigDecimal(clientAnalysisMapper.countValidClientsAll(industry)); BigDecimal totalClients = new BigDecimal(clientAnalysisMapper.countValidClientsAll(industry));
for (JSONObject detail : data) { for (JSONObject detail : data) {
BigDecimal industryClients = detail.getBigDecimal("industry_trans_clients"); BigDecimal industryClients = detail.getBigDecimal("industry_trans_clients");
if (!StringUtils.equalsIgnoreCase("0", industry)) {
industryClients = industryClients.subtract(new BigDecimal(1));
detail.put("industry_trans_clients", industryClients.setScale(0, RoundingMode.DOWN));
}
detail.put("total_client", totalClients.setScale(0, RoundingMode.DOWN)); detail.put("total_client", totalClients.setScale(0, RoundingMode.DOWN));
detail.put("in_total_pcent", industryClients.divide(totalClients, 4, RoundingMode.HALF_UP).multiply(new BigDecimal(100))); detail.put("in_total_pcent", industryClients.divide(totalClients, 4, RoundingMode.HALF_UP).multiply(new BigDecimal(100)));
} }

Loading…
Cancel
Save