From bbc47c627f3a27b8a6c025f6ea403bc4eb71617f Mon Sep 17 00:00:00 2001 From: guoshengxiong <1923636941@qq.com> Date: Wed, 2 Apr 2025 09:49:33 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9E=8D=E9=92=A2bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xz/controller/XzRiskPredictionController.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/zhgd/xmgl/modules/xz/controller/XzRiskPredictionController.java b/src/main/java/com/zhgd/xmgl/modules/xz/controller/XzRiskPredictionController.java index bbe851c99..87e321882 100644 --- a/src/main/java/com/zhgd/xmgl/modules/xz/controller/XzRiskPredictionController.java +++ b/src/main/java/com/zhgd/xmgl/modules/xz/controller/XzRiskPredictionController.java @@ -448,6 +448,10 @@ public class XzRiskPredictionController { return new BigDecimal(35); } + @Lazy + @Autowired + SafetyInspectionStandardBigScreenController safetyInspectionStandardBigScreenController; + @ApiOperation(value = "总包(含下面分包)事故风险预测趋势by项目", notes = "总包(含下面分包)事故风险预测趋势by项目", httpMethod = "POST") @ApiImplicitParams({ @ApiImplicitParam(name = "projectSn", value = "项目sn", paramType = "body", required = true, dataType = "String"), @@ -468,8 +472,11 @@ public class XzRiskPredictionController { long specialNotCount = inspectionRecords.stream().filter(r -> r.getStatus() != 5 && r.getType() != null && r.getType() != 1).count(); long specialCount = inspectionRecords.stream().filter(r -> r.getType() != null && r.getType() != 1).count(); o.setTotalSpecialOperationsRiskRate(NumberUtils.div(specialNotCount, specialCount, 2)); - JSONObject ssJo = BeanUtil.toBean(securityQualityInspectionRecordController.getStatScore(projectSn), JSONObject.class); - o.setMonthlySafetyScoreRate(NumberUtils.subtract(1D, NumberUtils.div(ssJo.getJSONObject("result").getDouble("total"), 100D, 2), 2)); + JSONObject ssJo = BeanUtil.toBean(safetyInspectionStandardBigScreenController.getFiveScores(new MapBuilder() + .put("projectSn", projectSn) + .build()), JSONObject.class); +// JSONObject ssJo = BeanUtil.toBean(securityQualityInspectionRecordController.getStatScore(projectSn), JSONObject.class); + o.setMonthlySafetyScoreRate(NumberUtils.subtract(1D, NumberUtils.div(ssJo.getJSONObject("result").getDouble("monthScore"), 100D, 2), 2)); long inspectionCount = inspectionRecords.stream().filter(r -> true).count(); long inspectionNotCount = inspectionRecords.stream().filter(r -> r.getStatus() != 5).count(); o.setUnclosedHiddenDangersRate(NumberUtils.div(inspectionNotCount, inspectionCount, 2));