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
5af9b1ad
Commit
5af9b1ad
authored
Jun 16, 2020
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.修改缺陷703
重新评价危险因素,确定RPNr值时,需要查询关联的巡检点或者设备是否有报警, 如果有报警或巡检不合格,则根据报警指标值计算Or、RPNr 后保存。 如果无报警和巡检不合格,则默认Or、RPNr的值为Oi,RPNi的值
parent
02d97a0b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
10 deletions
+35
-10
RiskSourceServiceImpl.java
...amos/fas/business/service/impl/RiskSourceServiceImpl.java
+35
-10
No files found.
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/RiskSourceServiceImpl.java
View file @
5af9b1ad
...
@@ -31,6 +31,7 @@ import com.yeejoin.amos.fas.business.util.JexlUtil;
...
@@ -31,6 +31,7 @@ import com.yeejoin.amos.fas.business.util.JexlUtil;
import
com.yeejoin.amos.fas.business.util.RpnUtils
;
import
com.yeejoin.amos.fas.business.util.RpnUtils
;
import
com.yeejoin.amos.fas.business.vo.EquipCommunicationData
;
import
com.yeejoin.amos.fas.business.vo.EquipCommunicationData
;
import
com.yeejoin.amos.fas.client.invoke.RsDataQueue
;
import
com.yeejoin.amos.fas.client.invoke.RsDataQueue
;
import
com.yeejoin.amos.fas.common.enums.CheckStatusEnum
;
import
com.yeejoin.amos.fas.common.enums.DataRefreshTypeEum
;
import
com.yeejoin.amos.fas.common.enums.DataRefreshTypeEum
;
import
com.yeejoin.amos.fas.common.enums.View3dRefreshAreaEum
;
import
com.yeejoin.amos.fas.common.enums.View3dRefreshAreaEum
;
import
com.yeejoin.amos.fas.core.common.request.CommonPageable
;
import
com.yeejoin.amos.fas.core.common.request.CommonPageable
;
...
@@ -361,6 +362,8 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -361,6 +362,8 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
Equipment
equipment
=
equipmentService
.
queryOne
(
importantEquipId
);
Equipment
equipment
=
equipmentService
.
queryOne
(
importantEquipId
);
if
(!
CollectionUtils
.
isEmpty
(
returnList
)
&&
equipment
!=
null
)
{
if
(!
CollectionUtils
.
isEmpty
(
returnList
)
&&
equipment
!=
null
)
{
fmeaEquipmentPointMapper
.
saveBatch
(
returnList
);
fmeaEquipmentPointMapper
.
saveBatch
(
returnList
);
}
if
(
equipment
!=
null
){
RsDataQueue
rsDataQueue
=
RsDataQueue
.
getInstance
();
RsDataQueue
rsDataQueue
=
RsDataQueue
.
getInstance
();
rsDataQueue
.
addEquipmentMessage
(
fmeaId
,
equipment
.
getName
());
rsDataQueue
.
addEquipmentMessage
(
fmeaId
,
equipment
.
getName
());
}
}
...
@@ -383,9 +386,9 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -383,9 +386,9 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
}
}
if
(!
CollectionUtils
.
isEmpty
(
returnList
))
{
if
(!
CollectionUtils
.
isEmpty
(
returnList
))
{
fmeaPointInputitemMapper
.
saveBatch
(
returnList
);
fmeaPointInputitemMapper
.
saveBatch
(
returnList
);
}
RsDataQueue
rsDataQueue
=
RsDataQueue
.
getInstance
();
RsDataQueue
rsDataQueue
=
RsDataQueue
.
getInstance
();
rsDataQueue
.
addPatrolMessage
(
fmeaId
);
rsDataQueue
.
addPatrolMessage
(
fmeaId
);
}
return
returnList
;
return
returnList
;
}
}
...
@@ -554,12 +557,12 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -554,12 +557,12 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
}
}
for
(
int
i
=
0
;
i
<
content
.
size
();
i
++){
for
(
int
i
=
0
;
i
<
content
.
size
();
i
++){
if
(
content
.
get
(
i
).
get
(
"userId"
)
!=
null
&&
userMap
.
containsKey
(
content
.
get
(
i
).
get
(
"userId"
))){
if
(
StringUtil
.
isNotEmpty
(
content
.
get
(
i
).
get
(
"userId"
))
&&
userMap
.
containsKey
(
content
.
get
(
i
).
get
(
"userId"
))){
AgencyUserModel
user
=
userMap
.
get
(
content
.
get
(
i
).
get
(
"userId"
));
AgencyUserModel
user
=
userMap
.
get
(
content
.
get
(
i
).
get
(
"userId"
));
content
.
get
(
i
).
put
(
"userName"
,
user
.
getRealName
());
content
.
get
(
i
).
put
(
"userName"
,
user
.
getRealName
());
content
.
get
(
i
).
put
(
"tel"
,
user
.
getMobile
());
content
.
get
(
i
).
put
(
"tel"
,
user
.
getMobile
());
}
}
if
(
content
.
get
(
i
).
get
(
"deptId"
)
!=
null
&&
deptMap
.
containsKey
(
Long
.
valueOf
(
content
.
get
(
i
).
get
(
"deptId"
).
toString
()))){
if
(
StringUtil
.
isNotEmpty
(
content
.
get
(
i
).
get
(
"deptId"
))
&&
deptMap
.
containsKey
(
Long
.
valueOf
(
content
.
get
(
i
).
get
(
"deptId"
).
toString
()))){
content
.
get
(
i
).
put
(
"deptName"
,
deptMap
.
get
(
Long
.
valueOf
(
content
.
get
(
i
).
get
(
"deptId"
).
toString
())));
content
.
get
(
i
).
put
(
"deptName"
,
deptMap
.
get
(
Long
.
valueOf
(
content
.
get
(
i
).
get
(
"deptId"
).
toString
())));
}
}
}
}
...
@@ -628,7 +631,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -628,7 +631,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
* @param protalData
* @param protalData
*/
*/
@Async
@Async
private
void
protalRuleMessagePush
(
ProtalDataRo
protalData
){
void
protalRuleMessagePush
(
ProtalDataRo
protalData
){
String
bacthNo
=
UUID
.
randomUUID
().
toString
();
String
bacthNo
=
UUID
.
randomUUID
().
toString
();
protalData
.
setBatchNo
(
bacthNo
);
protalData
.
setBatchNo
(
bacthNo
);
protalData
.
setOriginalNodeState
(
protalData
.
getNodeState
());
protalData
.
setOriginalNodeState
(
protalData
.
getNodeState
());
...
@@ -1116,18 +1119,24 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -1116,18 +1119,24 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
BigDecimal
sidValue
=
new
BigDecimal
(
fmea
.
getSidValue
());
BigDecimal
sidValue
=
new
BigDecimal
(
fmea
.
getSidValue
());
BigDecimal
didValue
=
new
BigDecimal
(
fmea
.
getDidValue
());
BigDecimal
didValue
=
new
BigDecimal
(
fmea
.
getDidValue
());
//1.1计算rpni
//1.1计算rpni
BigDecimal
rpni
=
oidValue
.
multiply
(
sidValue
).
multiply
(
didValue
).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
);
BigDecimal
rpni
=
oidValue
.
multiply
(
sidValue
).
multiply
(
didValue
).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
);
BigDecimal
rpn
;
BigDecimal
rpn
;
//1.2计算rpn:为空则rpni = rpn;不为空则重新计算s*d*newo
//1.2计算rpn:为空则rpni = rpn;不为空则重新计算s*d*newo
//未评价过,计算绑定的巡检点项 设备点位故障率
if
(
fmea
.
getNewEvaluationOid
()
==
null
)
{
if
(
fmea
.
getNewEvaluationOid
()
==
null
)
{
EvaluationModel
evaluationModel
=
this
.
getEvaluationModel
(
fmeaId
);
if
(
evaluationModel
!=
null
){
//存在则更新为计算后的结果
BigDecimal
newOidValue
=
new
BigDecimal
(
evaluationModel
.
getCoefficient
());
rpn
=
newOidValue
.
multiply
(
sidValue
).
multiply
(
didValue
).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
);
fmea
.
setNewEvaluationOid
(
evaluationModel
.
getId
());
}
else
{
//不存在则更新为rpn与rpni一致
fmea
.
setNewEvaluationOid
(
fmea
.
getEvaluationOid
());
fmea
.
setNewEvaluationOid
(
fmea
.
getEvaluationOid
());
rpn
=
rpni
;
rpn
=
rpni
;
}
}
else
{
}
else
{
BigDecimal
newOidValue
=
new
BigDecimal
(
fmea
.
getNewOidValue
());
BigDecimal
newOidValue
=
new
BigDecimal
(
fmea
.
getNewOidValue
());
rpn
=
newOidValue
.
multiply
(
sidValue
).
multiply
(
didValue
).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
);
rpn
=
newOidValue
.
multiply
(
sidValue
).
multiply
(
didValue
).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
);
}
}
List
<
RiskLevel
>
levels
=
riskLevelDao
.
findAll
();
List
<
RiskLevel
>
levels
=
riskLevelDao
.
findAll
();
RiskLevel
newLevel
=
RpnUtils
.
getBetweenLevel
(
rpn
,
levels
);
RiskLevel
newLevel
=
RpnUtils
.
getBetweenLevel
(
rpn
,
levels
);
...
@@ -1344,11 +1353,13 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -1344,11 +1353,13 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
//3.更新父节点rpn、rpni、风险等级
//3.更新父节点rpn、rpni、风险等级
this
.
updateParentRpn
(
riskSource
.
getParentId
());
this
.
updateParentRpn
(
riskSource
.
getParentId
());
//4.极光推送给手机客户端
//4.极光推送给手机客户端
if
(
notifyType
==
"recovery"
||
notifyType
==
"fmeaUpdate"
||(
notifyType
==
"alarm"
&&
rpnDiffer
>
0
)||(
notifyType
==
"patrol"
&&
rpnDiffer
>
0
&&
checkStatus
.
equals
(
"不合格"
)))
if
(
"recovery"
.
equals
(
notifyType
)
||
"fmeaUpdate"
.
equals
(
notifyType
)
||
(
"alarm"
.
equals
(
notifyType
)&&
rpnDiffer
>
0
)||(
"patrol"
.
equals
(
notifyType
)
&&
rpnDiffer
>
0
&&
CheckStatusEnum
.
UNQUALIFIED
.
getName
().
equals
(
checkStatus
))){
jpushRiskSourceMessage
(
jpushMsgBo
);
jpushRiskSourceMessage
(
jpushMsgBo
);
//5.规则告警(消息)TODO
}
if
(
notifyType
==
"recovery"
||
notifyType
==
"fmeaUpdate"
||(
notifyType
==
"alarm"
&&
rpnDiffer
>
0
)||(
notifyType
==
"patrol"
&&
rpnDiffer
>
0
&&
checkStatus
.
equals
(
"不合格"
)))
//5.规则告警(消息)
if
(
"recovery"
.
equals
(
notifyType
)
||
"fmeaUpdate"
.
equals
(
notifyType
)
||
(
"alarm"
.
equals
(
notifyType
)&&
rpnDiffer
>
0
)
||(
notifyType
==
"patrol"
&&
rpnDiffer
>
0
&&
CheckStatusEnum
.
UNQUALIFIED
.
getName
().
equals
(
checkStatus
))){
notifyRule
(
riskSourceId
,
rpn
,
rpni
,
notifyType
,
changeType
,
jpushMsgBo
.
getMsg
());
notifyRule
(
riskSourceId
,
rpn
,
rpni
,
notifyType
,
changeType
,
jpushMsgBo
.
getMsg
());
}
//6.通知全景监控屏幕数据刷新
//6.通知全景监控屏幕数据刷新
iDataRefreshService
.
refreshViewData
(
DataRefreshTypeEum
.
rpn
.
getCode
());
iDataRefreshService
.
refreshViewData
(
DataRefreshTypeEum
.
rpn
.
getCode
());
}
}
...
@@ -1516,4 +1527,18 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -1516,4 +1527,18 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
public
void
batchSaveRegionUe4
(
List
<
BindRegionBo
>
regionBoList
)
{
public
void
batchSaveRegionUe4
(
List
<
BindRegionBo
>
regionBoList
)
{
riskSourceMapper
.
batchSaveRegionUe4
(
regionBoList
);
riskSourceMapper
.
batchSaveRegionUe4
(
regionBoList
);
}
}
private
EvaluationModel
getEvaluationModel
(
Long
fmeaId
){
List
<
FmeaEquipmentPoint
>
equipmentPoints
=
fmeaEquipmentPointMapper
.
listFmeaByFmeaId
(
fmeaId
);
List
<
FmeaPointInputitem
>
pointInputitems
=
fmeaPointInputitemMapper
.
listFmeaByFmeaId
(
fmeaId
);
Double
maxRate
=
RpnUtils
.
getMaxRate
(
equipmentPoints
,
pointInputitems
);
if
(
maxRate
!=
null
){
List
<
EvaluationModel
>
oModels
=
iEvaluationModelDao
.
findAllByType
(
"O"
);
EvaluationModel
oEvaluationModel
=
getBetweenModel
(
maxRate
,
oModels
);
return
oEvaluationModel
;
}
return
null
;
}
}
}
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