liusheng
2025-04-02 acd62c1684cbde71954252ffdf89d0918491e6fc
smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskDetailServiceImpl.java
@@ -246,7 +246,6 @@
            Long totalCount = serviceSubtaskDetailTargets.stream().filter(target -> target.getMatchedtext() == null || target.getMatchedtext().isEmpty()).mapToLong(target -> target.getCount() != null ? target.getCount() : 0) // 确保 count 为 0 如果为 null
                    .sum();
            Long allShowCount = 0L;
            // 遍历列表,将 matchedText 为""赋值给 null
@@ -272,7 +271,8 @@
                target.setTargetShowCount(allShowCount.toString());
                BigDecimal count = new BigDecimal(target.getCount() != null ? target.getCount().toString() : "0");
                BigDecimal allCount = new BigDecimal(allShowCount.toString());
                target.setPercentage(count.divide(allCount, 2, RoundingMode.HALF_UP).toString());
                if (allCount.compareTo(BigDecimal.ZERO) == 0)
                    target.setPercentage(count.divide(allCount, 2, RoundingMode.HALF_UP).toString());
            }
        }