鞍钢bug修改

This commit is contained in:
guoshengxiong 2025-04-02 09:49:33 +08:00
parent b6f534ab44
commit bbc47c627f

View File

@ -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<String, Object>()
.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));