Browse Source

快手报表-

zhaoxian 2 years ago
parent
commit
ac6ba61b95

+ 7 - 5
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/report/service/impl/KuaiShouAccountReportServiceImpl.java

@@ -229,11 +229,13 @@ public class KuaiShouAccountReportServiceImpl implements IKuaiShouAccountReportS
     private JSONObject countTotal(JSONObject after, JSONObject before) {
         JSONObject jsonObject = new JSONObject();
         after.forEach((k, v) -> {
-            //去除没法计算的字段
-            if ("accountId".equals(k) || "authName".equals(k) || v.toString().contains("%") || before.getString(k).contains("%")) {
-                jsonObject.put(k, "-");
-            } else {
-                jsonObject.put(k, (LinkUtils.countLink(after.getBigDecimal(k) == null ? zero : after.getBigDecimal(k), before.getBigDecimal(k) == null ? zero : before.getBigDecimal(k))).multiply(BigDecimal.valueOf(100)).setScale(2, RoundingMode.HALF_UP) + "%");
+            if (!Check.isNull(v)) {
+                //去除没法计算的字段
+                if ("accountId".equals(k) || "authName".equals(k) || v.toString().contains("%") || before.getString(k).contains("%")) {
+                    jsonObject.put(k, "-");
+                } else {
+                    jsonObject.put(k, (LinkUtils.countLink(after.getBigDecimal(k) == null ? zero : after.getBigDecimal(k), before.getBigDecimal(k) == null ? zero : before.getBigDecimal(k))).multiply(BigDecimal.valueOf(100)).setScale(2, RoundingMode.HALF_UP) + "%");
+                }
             }
         });
         jsonObject.put("authName", "环比");