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
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
6 deletions
+10
-6
RemoteRuleServer.java
...com/yeejoin/amos/fas/business/feign/RemoteRuleServer.java
+4
-2
RiskSourceServiceImpl.java
...amos/fas/business/service/impl/RiskSourceServiceImpl.java
+6
-4
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 {
...
@@ -51,6 +51,7 @@ public class RemoteRuleServer {
public
Object
fireRule
(
RiskSourceRuleRo
riskSourceRuleRo
,
String
packageId
)
throws
Exception
{
public
Object
fireRule
(
RiskSourceRuleRo
riskSourceRuleRo
,
String
packageId
)
throws
Exception
{
Map
<
String
,
String
>
map
=
new
HashMap
<>();
Map
<
String
,
String
>
map
=
new
HashMap
<>();
String
data
=
JSONUtil
.
toJson
(
riskSourceRuleRo
);
String
data
=
JSONUtil
.
toJson
(
riskSourceRuleRo
);
log
.
info
(
data
);
map
.
put
(
"resFact"
,
data
);
map
.
put
(
"resFact"
,
data
);
map
.
put
(
"packageId"
,
packageId
);
map
.
put
(
"packageId"
,
packageId
);
map
.
put
(
"className"
,
riskSourceRuleRo
.
getClass
().
getName
());
map
.
put
(
"className"
,
riskSourceRuleRo
.
getClass
().
getName
());
...
@@ -83,8 +84,10 @@ public class RemoteRuleServer {
...
@@ -83,8 +84,10 @@ public class RemoteRuleServer {
* @return
* @return
*/
*/
public
Object
fireRuleFlow
(
BasicsRo
resFact
,
String
packageId
,
String
processId
)
throws
Exception
{
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
<
String
,
String
>
map
=
new
HashMap
<
String
,
String
>();
map
.
put
(
"resFact"
,
JSONUtil
.
toJson
(
resFact
)
);
map
.
put
(
"resFact"
,
data
);
map
.
put
(
"packageId"
,
packageId
);
map
.
put
(
"packageId"
,
packageId
);
map
.
put
(
"processId"
,
processId
);
map
.
put
(
"processId"
,
processId
);
map
.
put
(
"className"
,
resFact
.
getClass
().
getName
());
map
.
put
(
"className"
,
resFact
.
getClass
().
getName
());
...
@@ -96,7 +99,6 @@ public class RemoteRuleServer {
...
@@ -96,7 +99,6 @@ public class RemoteRuleServer {
headers
.
setContentType
(
type
);
headers
.
setContentType
(
type
);
headers
.
add
(
"Accept"
,
MediaType
.
APPLICATION_JSON
.
toString
());
headers
.
add
(
"Accept"
,
MediaType
.
APPLICATION_JSON
.
toString
());
HttpEntity
<
Map
<
String
,
String
>>
formEntity
=
new
HttpEntity
<
Map
<
String
,
String
>>(
map
,
headers
);
HttpEntity
<
Map
<
String
,
String
>>
formEntity
=
new
HttpEntity
<
Map
<
String
,
String
>>(
map
,
headers
);
ResponseEntity
responseEntity
=
restTemplate
.
exchange
(
url
+
"urule/rule/fireRuleFlow"
,
ResponseEntity
responseEntity
=
restTemplate
.
exchange
(
url
+
"urule/rule/fireRuleFlow"
,
HttpMethod
.
POST
,
formEntity
,
String
.
class
);
HttpMethod
.
POST
,
formEntity
,
String
.
class
);
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/RiskSourceServiceImpl.java
View file @
f98fa9f3
...
@@ -1487,6 +1487,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -1487,6 +1487,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
if
(
fmea
==
null
)
{
if
(
fmea
==
null
)
{
return
;
return
;
}
}
if
(
fmea
.
getEvaluationOid
()
!=
null
&&
fmea
.
getEvaluationSid
()
!=
null
&&
fmea
.
getEvaluationDid
()
!=
null
)
{
List
<
FmeaEquipmentPoint
>
equipmentPoints
=
fmeaEquipmentPointMapper
.
listFmeaByFmeaId
(
fmeaId
);
List
<
FmeaEquipmentPoint
>
equipmentPoints
=
fmeaEquipmentPointMapper
.
listFmeaByFmeaId
(
fmeaId
);
List
<
FmeaPointInputitem
>
pointInputitems
=
fmeaPointInputitemMapper
.
listFmeaByFmeaId
(
fmeaId
);
List
<
FmeaPointInputitem
>
pointInputitems
=
fmeaPointInputitemMapper
.
listFmeaByFmeaId
(
fmeaId
);
Double
maxRate
=
getMaxRate
(
equipmentPoints
,
pointInputitems
);
Double
maxRate
=
getMaxRate
(
equipmentPoints
,
pointInputitems
);
...
@@ -1513,6 +1514,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -1513,6 +1514,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
}
}
}
}
}
}
}
private
void
saveRpnLog
(
Long
riskSourceId
,
Long
fmeaId
,
BigDecimal
rpn
,
BigDecimal
rpni
)
{
private
void
saveRpnLog
(
Long
riskSourceId
,
Long
fmeaId
,
BigDecimal
rpn
,
BigDecimal
rpni
)
{
RpnChangeLog
rpnChangeLog
=
new
RpnChangeLog
();
RpnChangeLog
rpnChangeLog
=
new
RpnChangeLog
();
...
@@ -1584,7 +1586,6 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -1584,7 +1586,6 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
if
(
riskSource
==
null
)
{
if
(
riskSource
==
null
)
{
return
;
return
;
}
}
RiskLevel
oldRiskLevel
=
iRiskLevelDao
.
findById
(
riskSource
.
getRiskLevelId
());
List
<
Fmea
>
fmeas
=
fmeaMapper
.
listByRiskSourceId
(
riskSourceId
);
List
<
Fmea
>
fmeas
=
fmeaMapper
.
listByRiskSourceId
(
riskSourceId
);
if
(
CollectionUtils
.
isEmpty
(
fmeas
))
{
if
(
CollectionUtils
.
isEmpty
(
fmeas
))
{
BigDecimal
resetValue
=
new
BigDecimal
(
"0"
);
BigDecimal
resetValue
=
new
BigDecimal
(
"0"
);
...
@@ -1624,6 +1625,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -1624,6 +1625,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
BigDecimal
rpni
=
maxDidValue
.
multiply
(
maxSidValue
).
multiply
(
averageOidValue
);
BigDecimal
rpni
=
maxDidValue
.
multiply
(
maxSidValue
).
multiply
(
averageOidValue
);
List
<
RiskLevel
>
levels
=
riskLevelDao
.
findAll
();
List
<
RiskLevel
>
levels
=
riskLevelDao
.
findAll
();
RiskLevel
newRiskLevel
=
getBetweenLevel
(
rpn
,
levels
);
RiskLevel
newRiskLevel
=
getBetweenLevel
(
rpn
,
levels
);
RiskLevel
oldRiskLevel
=
getBetweenLevel
(
rpni
,
levels
);
if
(
newRiskLevel
!=
null
)
{
if
(
newRiskLevel
!=
null
)
{
riskSource
.
setRpn
(
rpn
);
riskSource
.
setRpn
(
rpn
);
riskSource
.
setRpni
(
rpni
);
riskSource
.
setRpni
(
rpni
);
...
@@ -1650,11 +1652,11 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -1650,11 +1652,11 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
int
level
=
oldLevel
-
newLevel
;
int
level
=
oldLevel
-
newLevel
;
String
changeType
;
String
changeType
;
if
(
level
>
0
)
{
if
(
level
>
0
)
{
changeType
=
"
down
"
;
changeType
=
"
up
"
;
}
else
if
(
level
==
0
)
{
}
else
if
(
level
==
0
)
{
changeType
=
"no"
;
changeType
=
"no"
;
}
else
{
}
else
{
changeType
=
"
up
"
;
changeType
=
"
down
"
;
}
}
RiskSourceRuleRo
riskSourceRuleRo
=
new
RiskSourceRuleRo
();
RiskSourceRuleRo
riskSourceRuleRo
=
new
RiskSourceRuleRo
();
riskSourceRuleRo
.
setId
(
id
);
riskSourceRuleRo
.
setId
(
id
);
...
@@ -1663,7 +1665,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -1663,7 +1665,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
riskSourceRuleRo
.
setLevelChangeType
(
changeType
);
riskSourceRuleRo
.
setLevelChangeType
(
changeType
);
riskSourceRuleRo
.
setNotifyType
(
notifyType
);
riskSourceRuleRo
.
setNotifyType
(
notifyType
);
BigDecimal
rg
=
rpnr
.
subtract
(
rpni
);
BigDecimal
rg
=
rpnr
.
subtract
(
rpni
);
Integer
frequency
=
0
;
int
frequency
=
0
;
if
(
"up"
.
equals
(
changeType
)
&&
rg
.
intValue
()
>
0
)
{
if
(
"up"
.
equals
(
changeType
)
&&
rg
.
intValue
()
>
0
)
{
frequency
=
3
;
frequency
=
3
;
}
else
if
(
"no"
.
equals
(
changeType
)
&&
rg
.
intValue
()
>
0
)
{
}
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