Commit 46996c3a authored by suhuiguang's avatar suhuiguang

1.修改空指针

parent 6b621fd7
......@@ -295,8 +295,7 @@ public class View3dServiceImpl implements IView3dService {
}
Optional<RiskSource> optional = iRiskSourceDao.findByOrgCodeAndParentId(orgCode,0L);
TodaySafetyIndexVo vo = new TodaySafetyIndexVo();
if(optional.isPresent()){
//1.按照等级进行转换rpn为分数-机构
if(optional.isPresent()){ //1.按照等级进行转换rpn为分数-机构
RiskSource riskSource = optional.get();
double safetyIndex = this.changeRpnToSafetyIndex(riskSource.getRpn());
vo.setSafetyIndex(safetyIndex);
......@@ -420,7 +419,8 @@ public class View3dServiceImpl implements IView3dService {
List<RiskSource> regionList = iRiskSourceDao.findByParentIdAndIsRegion(optional.get().getId(),RiskSourceRegionEum.TRUE.getCode());
exceptionList = regionList.stream().filter(riskSource -> {
BigDecimal rpn = riskSource.getRpn() == null ? new BigDecimal("0") : riskSource.getRpn();
return rpn.subtract(riskSource.getRpni()).doubleValue() > 0;
BigDecimal rpni = riskSource.getRpni() == null ? new BigDecimal("0") : riskSource.getRpni();
return rpn.subtract(rpni).doubleValue() > 0;
}).map(riskSource -> {
ExceptionRegionVo regionVo = new ExceptionRegionVo();
regionVo.setId(riskSource.getId());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment