Selaa lähdekoodia

快手报表-

zhaoxian 2 vuotta sitten
vanhempi
commit
628b52fde2

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

@@ -229,9 +229,10 @@ public class KuaiShouAccountReportServiceImpl implements IKuaiShouAccountReportS
     private JSONObject countTotal(JSONObject after, JSONObject before) {
         JSONObject jsonObject = new JSONObject();
         after.forEach((k, v) -> {
-            if (!Check.isNull(v)) {
+            String bv = before.getString(k);
+            if (!Check.isNull(v) && !Check.isNull(bv)) {
                 //去除没法计算的字段
-                if ("accountId".equals(k) || "authName".equals(k) || v.toString().contains("%") || before.getString(k).contains("%")) {
+                if ("accountId".equals(k) || "authName".equals(k) || v.toString().contains("%") || bv.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) + "%");