Commit 1ff71201 authored by suhuiguang's avatar suhuiguang

1.修改异常区域

parent f56dffa2
...@@ -411,9 +411,8 @@ public class View3dServiceImpl implements IView3dService { ...@@ -411,9 +411,8 @@ public class View3dServiceImpl implements IView3dService {
if (optional.isPresent()) { if (optional.isPresent()) {
List<RiskSource> regionList = iRiskSourceDao.findByParentIdAndIsRegion(optional.get().getId(),RiskSourceRegionEum.TRUE.getCode()); List<RiskSource> regionList = iRiskSourceDao.findByParentIdAndIsRegion(optional.get().getId(),RiskSourceRegionEum.TRUE.getCode());
exceptionList = regionList.stream().filter(riskSource -> { exceptionList = regionList.stream().filter(riskSource -> {
//TODO:待毛颖确认,增加判断故障的规则(统计数据:故障或者rpn上升) BigDecimal rpn = riskSource.getRpn() == null ? new BigDecimal("0") : riskSource.getRpn();
BigDecimal rpnBig = riskSource.getRpn() == null ? new BigDecimal("0") : riskSource.getRpn(); return rpn.subtract(riskSource.getRpni()).doubleValue() > 0;
return rpnBig.subtract(riskSource.getRpni()).doubleValue() > 0;
}).map(riskSource -> { }).map(riskSource -> {
ExceptionRegionVo regionVo = new ExceptionRegionVo(); ExceptionRegionVo regionVo = new ExceptionRegionVo();
regionVo.setId(riskSource.getId()); regionVo.setId(riskSource.getId());
...@@ -421,7 +420,8 @@ public class View3dServiceImpl implements IView3dService { ...@@ -421,7 +420,8 @@ public class View3dServiceImpl implements IView3dService {
regionVo.setUe4Rotation(getInitJSONArray(riskSource.getUe4Rotation())); regionVo.setUe4Rotation(getInitJSONArray(riskSource.getUe4Rotation()));
regionVo.setUe4Extent(getInitJSONArray(riskSource.getUe4Extent())); regionVo.setUe4Extent(getInitJSONArray(riskSource.getUe4Extent()));
regionVo.setSafetyIndex(changeRpnToSafetyIndex(riskSource.getRpn())); regionVo.setSafetyIndex(changeRpnToSafetyIndex(riskSource.getRpn()));
regionVo.setBreakdown(isBreakDown(riskSource.getId())); regionVo.setBreakdown(isBreakDown(riskSource.getId()));//待后期去掉,前端图标显示统一不在细分
regionVo.setRoutePath(this.changeStringToJson(riskSource.getRoutePath()));
return regionVo; return regionVo;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
} }
...@@ -436,8 +436,15 @@ public class View3dServiceImpl implements IView3dService { ...@@ -436,8 +436,15 @@ public class View3dServiceImpl implements IView3dService {
} }
} }
private JSONObject changeStringToJson(String str){
if(StringUtil.isNotEmpty(str)){
return JSON.parseObject(str);
}else {
return new JSONObject();
}
}
private Boolean isBreakDown(Long id){ private Boolean isBreakDown(Long id){
//TODO:判断是否故障,待毛颖确认
return true; return true;
} }
......
package com.yeejoin.amos.fas.business.vo; package com.yeejoin.amos.fas.business.vo;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import springfox.documentation.spring.web.json.Json;
/** /**
* @author suhg * @author suhg
*/ */
...@@ -32,6 +36,11 @@ public class ExceptionRegionVo { ...@@ -32,6 +36,11 @@ public class ExceptionRegionVo {
*/ */
private JSONArray ue4Extent; private JSONArray ue4Extent;
/**
* 自研3维区域参数
*/
private JSONObject routePath;
public Long getId() { public Long getId() {
return id; return id;
} }
...@@ -68,6 +77,14 @@ public class ExceptionRegionVo { ...@@ -68,6 +77,14 @@ public class ExceptionRegionVo {
return ue4Extent; return ue4Extent;
} }
public JSONObject getRoutePath() {
return routePath;
}
public void setRoutePath(JSONObject routePath) {
this.routePath = routePath;
}
public void setUe4Extent(JSONArray ue4Extent) { public void setUe4Extent(JSONArray ue4Extent) {
this.ue4Extent = ue4Extent; this.ue4Extent = ue4Extent;
} }
......
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