diff --git a/backend/services/case-management/src/main/java/io/metersphere/functional/service/CaseReviewService.java b/backend/services/case-management/src/main/java/io/metersphere/functional/service/CaseReviewService.java index 9b643f539e..62a597e360 100644 --- a/backend/services/case-management/src/main/java/io/metersphere/functional/service/CaseReviewService.java +++ b/backend/services/case-management/src/main/java/io/metersphere/functional/service/CaseReviewService.java @@ -35,6 +35,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.math.BigDecimal; +import java.math.RoundingMode; import java.util.*; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -156,6 +157,9 @@ public class CaseReviewService { } caseReviewDTO.setPassCount(passList.size()); + BigDecimal passRate = BigDecimal.valueOf(caseReviewDTO.getPassCount()).divide(BigDecimal.valueOf(caseReviewDTO.getCaseCount()), 2, RoundingMode.HALF_UP); + caseReviewDTO.setPassRate(passRate.multiply(BigDecimal.valueOf(100))); + List unPassList = statusCaseMap.get(FunctionalCaseReviewStatus.UN_PASS.toString()); if (unPassList == null) { unPassList = new ArrayList<>();