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 {