Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YeeAmosFireAutoSysRoot
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
station
YeeAmosFireAutoSysRoot
Commits
bc9bdd42
Commit
bc9bdd42
authored
Apr 24, 2020
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.异常区域查询-全景监控
parent
f71058be
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
138 additions
and
3 deletions
+138
-3
View3dController.java
...eejoin/amos/fas/business/controller/View3dController.java
+12
-0
View3dServiceImpl.java
...oin/amos/fas/business/service/impl/View3dServiceImpl.java
+41
-3
IView3dService.java
...ejoin/amos/fas/business/service/intfc/IView3dService.java
+3
-0
ExceptionRegionVo.java
...a/com/yeejoin/amos/fas/business/vo/ExceptionRegionVo.java
+82
-0
No files found.
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/View3dController.java
View file @
bc9bdd42
...
...
@@ -3,6 +3,7 @@ package com.yeejoin.amos.fas.business.controller;
import
com.yeejoin.amos.fas.business.bo.BindPointBo
;
import
com.yeejoin.amos.fas.business.bo.BindRegionBo
;
import
com.yeejoin.amos.fas.business.service.intfc.IView3dService
;
import
com.yeejoin.amos.fas.business.vo.ExceptionRegionVo
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.core.util.CommonResponseUtil
;
import
io.swagger.annotations.ApiOperation
;
...
...
@@ -121,4 +122,15 @@ public class View3dController extends BaseController {
return
CommonResponseUtil
.
success
(
view3dService
.
getSystemOnlineDate
(
orgCode
));
}
@ApiOperation
(
value
=
"异常区域信息查询"
,
notes
=
"异常区域信息查询"
)
@GetMapping
(
value
=
"region/exception/list"
)
public
CommonResponse
getExceptionRegion
(){
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
orgCode
=
this
.
getOrgCode
(
reginParams
);
//TODO:测试数据待删除
orgCode
=
"1*2"
;
List
<
ExceptionRegionVo
>
exceptionRegionVoList
=
view3dService
.
getExceptionRegion
(
orgCode
);
return
CommonResponseUtil
.
success
(
exceptionRegionVoList
);
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/View3dServiceImpl.java
View file @
bc9bdd42
...
...
@@ -24,6 +24,7 @@ import com.yeejoin.amos.fas.business.dao.mapper.PatrolMapper;
import
com.yeejoin.amos.fas.business.dao.repository.*
;
import
com.yeejoin.amos.fas.business.service.intfc.IView3dService
;
import
com.yeejoin.amos.fas.business.vo.ErrorContentVo
;
import
com.yeejoin.amos.fas.business.vo.ExceptionRegionVo
;
import
com.yeejoin.amos.fas.business.vo.SafetyIndexDetailVo
;
import
com.yeejoin.amos.fas.business.vo.TodaySafetyIndexVo
;
import
com.yeejoin.amos.fas.common.enums.CheckStatusEnum
;
...
...
@@ -240,7 +241,7 @@ public class View3dServiceImpl implements IView3dService {
if
(
optional
.
isPresent
()){
//1.按照等级进行转换rpn为分数-机构
RiskSource
riskSource
=
optional
.
get
();
double
safetyIndex
=
this
.
c
alSafetyIndex
(
riskSource
);
double
safetyIndex
=
this
.
c
hangeRpnToSafetyIndex
(
riskSource
.
getRpn
()
);
vo
.
setSafetyIndex
(
safetyIndex
);
//2.统计风险上升异常数量(风险点)-日期+机构
Long
upperNum
=
this
.
getRiskUpperNum
(
orgCode
,
date
);
...
...
@@ -321,8 +322,8 @@ public class View3dServiceImpl implements IView3dService {
return
view3dMapper
.
countUpperRiskPoint
(
param
);
}
private
double
c
alSafetyIndex
(
RiskSource
riskSource
)
{
BigDecimal
rpn
=
new
BigDecimal
(
String
.
valueOf
(
riskSource
.
getRpn
()
==
null
?
"0"
:
riskSource
.
getRpn
()))
;
private
double
c
hangeRpnToSafetyIndex
(
BigDecimal
rpn
)
{
BigDecimal
rpn
Big
=
rpn
==
null
?
new
BigDecimal
(
"0"
)
:
rpn
;
//计算规则:除10 减100 求绝对值,结果保留1位小数
return
rpn
.
divide
(
new
BigDecimal
(
"10"
)).
subtract
(
new
BigDecimal
(
"100"
)).
abs
().
setScale
(
1
,
BigDecimal
.
ROUND_HALF_UP
).
doubleValue
();
}
...
...
@@ -338,4 +339,41 @@ public class View3dServiceImpl implements IView3dService {
Date
now
=
DateUtil
.
getNow
();
return
DateUtil
.
dayComparePrecise
(
beginDate
,
now
);
}
@Override
public
List
<
ExceptionRegionVo
>
getExceptionRegion
(
String
orgCode
)
{
Optional
<
RiskSource
>
optional
=
iRiskSourceDao
.
findByOrgCodeAndParentId
(
orgCode
,
0L
);
List
<
ExceptionRegionVo
>
exceptionList
=
new
ArrayList
<>();
if
(
optional
.
isPresent
())
{
List
<
RiskSource
>
regionList
=
iRiskSourceDao
.
findByParentId
(
optional
.
get
().
getId
());
exceptionList
=
regionList
.
stream
().
filter
(
riskSource
->
{
//TODO:待毛颖确认,增加判断故障的规则(统计数据:故障或者rpn上升)
BigDecimal
rpnBig
=
riskSource
.
getRpn
()
==
null
?
new
BigDecimal
(
"0"
)
:
riskSource
.
getRpn
();
return
rpnBig
.
subtract
(
riskSource
.
getRpni
()).
doubleValue
()
>
0
;
}).
map
(
riskSource
->
{
ExceptionRegionVo
regionVo
=
new
ExceptionRegionVo
();
regionVo
.
setId
(
riskSource
.
getId
());
regionVo
.
setUe4Location
(
getInitJSONArray
(
riskSource
.
getUe4Location
()));
regionVo
.
setUe4Rotation
(
getInitJSONArray
(
riskSource
.
getUe4Rotation
()));
regionVo
.
setUe4Extent
(
getInitJSONArray
(
riskSource
.
getUe4Extent
()));
regionVo
.
setSafetyIndex
(
changeRpnToSafetyIndex
(
riskSource
.
getRpn
()));
regionVo
.
setBreakdown
(
isBreakDown
(
riskSource
.
getId
()));
return
regionVo
;
}).
collect
(
Collectors
.
toList
());
}
return
exceptionList
;
}
private
JSONArray
getInitJSONArray
(
String
str
){
if
(
StringUtil
.
isNotEmpty
(
str
)){
return
JSON
.
parseArray
(
str
);
}
else
{
return
new
JSONArray
();
}
}
private
Boolean
isBreakDown
(
Long
id
){
//TODO:判断是否故障,待毛颖确认
return
true
;
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/IView3dService.java
View file @
bc9bdd42
...
...
@@ -2,6 +2,7 @@ package com.yeejoin.amos.fas.business.service.intfc;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.fas.business.bo.BindPointBo
;
import
com.yeejoin.amos.fas.business.vo.ExceptionRegionVo
;
import
com.yeejoin.amos.fas.business.vo.SafetyIndexDetailVo
;
import
com.yeejoin.amos.fas.business.vo.TodaySafetyIndexVo
;
import
com.yeejoin.amos.fas.core.common.response.RegionTreeResponse
;
...
...
@@ -78,4 +79,6 @@ public interface IView3dService {
* @return eg:10年3月2天
*/
Map
<
String
,
Object
>
getSystemOnlineDate
(
String
orgCode
);
List
<
ExceptionRegionVo
>
getExceptionRegion
(
String
orgCode
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/vo/ExceptionRegionVo.java
0 → 100644
View file @
bc9bdd42
package
com
.
yeejoin
.
amos
.
fas
.
business
.
vo
;
import
com.alibaba.fastjson.JSONArray
;
/**
* @author suhg
*/
public
class
ExceptionRegionVo
{
/**
* 风险点id
*/
private
Long
id
;
/**
* 安全指数
*/
private
Double
safetyIndex
;
/**
* 是否故障
*/
private
boolean
breakdown
;
/**
* ue4点坐标
*/
private
JSONArray
ue4Location
;
/**
* ue4旋转
*/
private
JSONArray
ue4Rotation
;
/**
* ue4缩放
*/
private
JSONArray
ue4Extent
;
public
Long
getId
()
{
return
id
;
}
public
void
setId
(
Long
id
)
{
this
.
id
=
id
;
}
public
Double
getSafetyIndex
()
{
return
safetyIndex
;
}
public
void
setSafetyIndex
(
Double
safetyIndex
)
{
this
.
safetyIndex
=
safetyIndex
;
}
public
JSONArray
getUe4Location
()
{
return
ue4Location
;
}
public
void
setUe4Location
(
JSONArray
ue4Location
)
{
this
.
ue4Location
=
ue4Location
;
}
public
JSONArray
getUe4Rotation
()
{
return
ue4Rotation
;
}
public
void
setUe4Rotation
(
JSONArray
ue4Rotation
)
{
this
.
ue4Rotation
=
ue4Rotation
;
}
public
JSONArray
getUe4Extent
()
{
return
ue4Extent
;
}
public
void
setUe4Extent
(
JSONArray
ue4Extent
)
{
this
.
ue4Extent
=
ue4Extent
;
}
public
boolean
isBreakdown
()
{
return
breakdown
;
}
public
void
setBreakdown
(
boolean
breakdown
)
{
this
.
breakdown
=
breakdown
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment