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
f98fa9f3
Commit
f98fa9f3
authored
Mar 03, 2020
by
xukaiqiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug
parent
845352cf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
28 deletions
+32
-28
RemoteRuleServer.java
...com/yeejoin/amos/fas/business/feign/RemoteRuleServer.java
+4
-2
RiskSourceServiceImpl.java
...amos/fas/business/service/impl/RiskSourceServiceImpl.java
+28
-26
No files found.
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/feign/RemoteRuleServer.java
View file @
f98fa9f3
...
...
@@ -51,6 +51,7 @@ public class RemoteRuleServer {
public
Object
fireRule
(
RiskSourceRuleRo
riskSourceRuleRo
,
String
packageId
)
throws
Exception
{
Map
<
String
,
String
>
map
=
new
HashMap
<>();
String
data
=
JSONUtil
.
toJson
(
riskSourceRuleRo
);
log
.
info
(
data
);
map
.
put
(
"resFact"
,
data
);
map
.
put
(
"packageId"
,
packageId
);
map
.
put
(
"className"
,
riskSourceRuleRo
.
getClass
().
getName
());
...
...
@@ -83,8 +84,10 @@ public class RemoteRuleServer {
* @return
*/
public
Object
fireRuleFlow
(
BasicsRo
resFact
,
String
packageId
,
String
processId
)
throws
Exception
{
String
data
=
JSONUtil
.
toJson
(
resFact
);
log
.
info
(
"调用规则请求====================>"
+
data
);
Map
<
String
,
String
>
map
=
new
HashMap
<
String
,
String
>();
map
.
put
(
"resFact"
,
JSONUtil
.
toJson
(
resFact
)
);
map
.
put
(
"resFact"
,
data
);
map
.
put
(
"packageId"
,
packageId
);
map
.
put
(
"processId"
,
processId
);
map
.
put
(
"className"
,
resFact
.
getClass
().
getName
());
...
...
@@ -96,7 +99,6 @@ public class RemoteRuleServer {
headers
.
setContentType
(
type
);
headers
.
add
(
"Accept"
,
MediaType
.
APPLICATION_JSON
.
toString
());
HttpEntity
<
Map
<
String
,
String
>>
formEntity
=
new
HttpEntity
<
Map
<
String
,
String
>>(
map
,
headers
);
ResponseEntity
responseEntity
=
restTemplate
.
exchange
(
url
+
"urule/rule/fireRuleFlow"
,
HttpMethod
.
POST
,
formEntity
,
String
.
class
);
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/RiskSourceServiceImpl.java
View file @
f98fa9f3
...
...
@@ -1487,29 +1487,31 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
if
(
fmea
==
null
)
{
return
;
}
List
<
FmeaEquipmentPoint
>
equipmentPoints
=
fmeaEquipmentPointMapper
.
listFmeaByFmeaId
(
fmeaId
);
List
<
FmeaPointInputitem
>
pointInputitems
=
fmeaPointInputitemMapper
.
listFmeaByFmeaId
(
fmeaId
);
Double
maxRate
=
getMaxRate
(
equipmentPoints
,
pointInputitems
);
if
(
maxRate
!=
null
)
{
List
<
EvaluationModel
>
oModels
=
iEvaluationModelDao
.
findAllByType
(
"O"
);
EvaluationModel
oEvaluationModel
=
getBetweenModel
(
maxRate
,
oModels
);
if
(
oEvaluationModel
!=
null
)
{
BigDecimal
newOidValue
=
new
BigDecimal
(
oEvaluationModel
.
getCoefficient
());
BigDecimal
sidValue
=
new
BigDecimal
(
fmea
.
getSidValue
());
BigDecimal
didValue
=
new
BigDecimal
(
fmea
.
getDidValue
());
BigDecimal
rpn
=
newOidValue
.
multiply
(
sidValue
).
multiply
(
didValue
);
List
<
RiskLevel
>
levels
=
riskLevelDao
.
findAll
();
RiskLevel
newLevel
=
getBetweenLevel
(
rpn
,
levels
);
fmea
.
setRpn
(
rpn
);
fmea
.
setNewEvaluationOid
(
oEvaluationModel
.
getId
());
String
jpushTarget
=
null
;
if
(
newLevel
!=
null
)
{
jpushTarget
=
getJpushTarget
(
fmea
,
newLevel
.
getLevel
());
fmea
.
setRiskLevelId
(
newLevel
.
getId
());
if
(
fmea
.
getEvaluationOid
()
!=
null
&&
fmea
.
getEvaluationSid
()
!=
null
&&
fmea
.
getEvaluationDid
()
!=
null
)
{
List
<
FmeaEquipmentPoint
>
equipmentPoints
=
fmeaEquipmentPointMapper
.
listFmeaByFmeaId
(
fmeaId
);
List
<
FmeaPointInputitem
>
pointInputitems
=
fmeaPointInputitemMapper
.
listFmeaByFmeaId
(
fmeaId
);
Double
maxRate
=
getMaxRate
(
equipmentPoints
,
pointInputitems
);
if
(
maxRate
!=
null
)
{
List
<
EvaluationModel
>
oModels
=
iEvaluationModelDao
.
findAllByType
(
"O"
);
EvaluationModel
oEvaluationModel
=
getBetweenModel
(
maxRate
,
oModels
);
if
(
oEvaluationModel
!=
null
)
{
BigDecimal
newOidValue
=
new
BigDecimal
(
oEvaluationModel
.
getCoefficient
());
BigDecimal
sidValue
=
new
BigDecimal
(
fmea
.
getSidValue
());
BigDecimal
didValue
=
new
BigDecimal
(
fmea
.
getDidValue
());
BigDecimal
rpn
=
newOidValue
.
multiply
(
sidValue
).
multiply
(
didValue
);
List
<
RiskLevel
>
levels
=
riskLevelDao
.
findAll
();
RiskLevel
newLevel
=
getBetweenLevel
(
rpn
,
levels
);
fmea
.
setRpn
(
rpn
);
fmea
.
setNewEvaluationOid
(
oEvaluationModel
.
getId
());
String
jpushTarget
=
null
;
if
(
newLevel
!=
null
)
{
jpushTarget
=
getJpushTarget
(
fmea
,
newLevel
.
getLevel
());
fmea
.
setRiskLevelId
(
newLevel
.
getId
());
}
fmeaMapper
.
updateRpn
(
fmea
);
saveRpnLog
(
fmea
.
getRiskSourceId
(),
fmeaId
,
rpn
,
fmea
.
getRpni
());
this
.
notifyRiskSource
(
fmea
.
getRiskSourceId
(),
notifyType
,
jpushTarget
);
}
fmeaMapper
.
updateRpn
(
fmea
);
saveRpnLog
(
fmea
.
getRiskSourceId
(),
fmeaId
,
rpn
,
fmea
.
getRpni
());
this
.
notifyRiskSource
(
fmea
.
getRiskSourceId
(),
notifyType
,
jpushTarget
);
}
}
}
...
...
@@ -1584,7 +1586,6 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
if
(
riskSource
==
null
)
{
return
;
}
RiskLevel
oldRiskLevel
=
iRiskLevelDao
.
findById
(
riskSource
.
getRiskLevelId
());
List
<
Fmea
>
fmeas
=
fmeaMapper
.
listByRiskSourceId
(
riskSourceId
);
if
(
CollectionUtils
.
isEmpty
(
fmeas
))
{
BigDecimal
resetValue
=
new
BigDecimal
(
"0"
);
...
...
@@ -1624,6 +1625,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
BigDecimal
rpni
=
maxDidValue
.
multiply
(
maxSidValue
).
multiply
(
averageOidValue
);
List
<
RiskLevel
>
levels
=
riskLevelDao
.
findAll
();
RiskLevel
newRiskLevel
=
getBetweenLevel
(
rpn
,
levels
);
RiskLevel
oldRiskLevel
=
getBetweenLevel
(
rpni
,
levels
);
if
(
newRiskLevel
!=
null
)
{
riskSource
.
setRpn
(
rpn
);
riskSource
.
setRpni
(
rpni
);
...
...
@@ -1650,11 +1652,11 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
int
level
=
oldLevel
-
newLevel
;
String
changeType
;
if
(
level
>
0
)
{
changeType
=
"
down
"
;
changeType
=
"
up
"
;
}
else
if
(
level
==
0
)
{
changeType
=
"no"
;
}
else
{
changeType
=
"
up
"
;
changeType
=
"
down
"
;
}
RiskSourceRuleRo
riskSourceRuleRo
=
new
RiskSourceRuleRo
();
riskSourceRuleRo
.
setId
(
id
);
...
...
@@ -1663,7 +1665,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
riskSourceRuleRo
.
setLevelChangeType
(
changeType
);
riskSourceRuleRo
.
setNotifyType
(
notifyType
);
BigDecimal
rg
=
rpnr
.
subtract
(
rpni
);
Integer
frequency
=
0
;
int
frequency
=
0
;
if
(
"up"
.
equals
(
changeType
)
&&
rg
.
intValue
()
>
0
)
{
frequency
=
3
;
}
else
if
(
"no"
.
equals
(
changeType
)
&&
rg
.
intValue
()
>
0
)
{
...
...
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