大屏评分bug修改

This commit is contained in:
guoshengxiong 2024-08-02 21:20:21 +08:00
parent 5549fe4386
commit 63e697627c

View File

@ -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 {