From 63e697627ced48f9445a15d6da713aa3840f3fa1 Mon Sep 17 00:00:00 2001 From: guoshengxiong <1923636941@qq.com> Date: Fri, 2 Aug 2024 21:20:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=A7=E5=B1=8F=E8=AF=84=E5=88=86bug?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...yInspectionStandardBigScreenController.java | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/zhgd/xmgl/modules/xz/controller/SafetyInspectionStandardBigScreenController.java b/src/main/java/com/zhgd/xmgl/modules/xz/controller/SafetyInspectionStandardBigScreenController.java index 9c79dd8ff..57c4c436f 100644 --- a/src/main/java/com/zhgd/xmgl/modules/xz/controller/SafetyInspectionStandardBigScreenController.java +++ b/src/main/java/com/zhgd/xmgl/modules/xz/controller/SafetyInspectionStandardBigScreenController.java @@ -171,8 +171,8 @@ public class SafetyInspectionStandardBigScreenController { } BigDecimal tScore; BigDecimal mustReduce = safetyScoreDetails.stream().filter(s -> Objects.equals(s.getProjectType(), 1)).map(s -> s.getScore()).reduce(BigDecimal.ZERO, BigDecimal::add); - if (safetyScoreDetails.stream().anyMatch(s -> s.getScore().compareTo(BigDecimal.ZERO) == 0) - || mustReduce.compareTo(new BigDecimal(40)) < 0) { + if (isNeedGuarantee(topType.getCode()) && (safetyScoreDetails.stream().anyMatch(s -> s.getScore().compareTo(BigDecimal.ZERO) == 0) + || mustReduce.compareTo(new BigDecimal(40)) < 0)) { //保证项目中有一项未得分或保证项目小计得分不足40分,此分项检查评分表不应得分 tScore = new BigDecimal(0); } else { @@ -201,6 +201,16 @@ public class SafetyInspectionStandardBigScreenController { return Result.success(vo); } + /** + * 需要计算保证项目的 + * + * @param code + * @return + */ + private boolean isNeedGuarantee(String code) { + return !(Objects.equals(code,"13") || Objects.equals(code,"19")); + } + @ApiOperation(value = "获取分项检查评分表列表", notes = "获取分项检查评分表列表", httpMethod = "POST") @ApiImplicitParams({ @ApiImplicitParam(name = "projectSn", value = "项目sn", paramType = "body", required = true, dataType = "String"), @@ -249,8 +259,8 @@ public class SafetyInspectionStandardBigScreenController { } BigDecimal tScore; BigDecimal mustReduce = safetyScoreDetails.stream().filter(s -> Objects.equals(s.getProjectType(), 1)).map(s -> s.getScore()).reduce(BigDecimal.ZERO, BigDecimal::add); - if (safetyScoreDetails.stream().anyMatch(s -> s.getScore().compareTo(BigDecimal.ZERO) == 0) - || mustReduce.compareTo(new BigDecimal(40)) < 0) { + if (isNeedGuarantee(topType.getCode()) && (safetyScoreDetails.stream().anyMatch(s -> s.getScore().compareTo(BigDecimal.ZERO) == 0) + || mustReduce.compareTo(new BigDecimal(40)) < 0)) { //保证项目中有一项未得分或保证项目小计得分不足40分,此分项检查评分表不应得分 tScore = BigDecimal.ZERO; } else {