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
dae9c3a5
Commit
dae9c3a5
authored
Feb 14, 2020
by
xukaiqiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug
parent
d78bf1ff
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
35 additions
and
17 deletions
+35
-17
RiskModelController.java
...oin/amos/fas/business/controller/RiskModelController.java
+2
-4
RiskSourceServiceImpl.java
...amos/fas/business/service/impl/RiskSourceServiceImpl.java
+15
-3
IRiskSourceService.java
...n/amos/fas/business/service/intfc/IRiskSourceService.java
+2
-0
FmeaMessage.java
.../java/com/yeejoin/amos/fas/client/invoke/FmeaMessage.java
+7
-7
RsDataQueue.java
.../java/com/yeejoin/amos/fas/client/invoke/RsDataQueue.java
+9
-3
No files found.
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/RiskModelController.java
View file @
dae9c3a5
...
...
@@ -149,11 +149,9 @@ public class RiskModelController extends BaseController {
try
{
Long
[]
fmeaIds
=
param
.
getFmeaIds
();
fmeaService
.
deleteFmea
(
fmeaIds
);
if
(
fmeaIds
.
length
>
0
)
{
if
(
fmeaIds
.
length
>
0
&&
param
.
getRiskSourceId
()
!=
null
)
{
RsDataQueue
rsDataQueue
=
RsDataQueue
.
getInstance
();
for
(
Long
fmeaId
:
fmeaIds
)
{
rsDataQueue
.
addUpdateMessage
(
fmeaId
);
}
rsDataQueue
.
addDeleteMessage
(
param
.
getRiskSourceId
());
}
return
CommonResponseUtil
.
success
();
}
catch
(
Exception
e
)
{
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/RiskSourceServiceImpl.java
View file @
dae9c3a5
...
...
@@ -407,6 +407,8 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
}
if
(!
CollectionUtils
.
isEmpty
(
returnList
))
{
fmeaEquipmentPointMapper
.
saveBatch
(
returnList
);
RsDataQueue
rsDataQueue
=
RsDataQueue
.
getInstance
();
rsDataQueue
.
addAbnormalMessage
(
fmeaId
);
}
return
returnList
;
}
...
...
@@ -427,6 +429,8 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
}
if
(!
CollectionUtils
.
isEmpty
(
returnList
))
{
fmeaPointInputitemMapper
.
saveBatch
(
returnList
);
RsDataQueue
rsDataQueue
=
RsDataQueue
.
getInstance
();
rsDataQueue
.
addAbnormalMessage
(
fmeaId
);
}
return
returnList
;
}
...
...
@@ -1386,7 +1390,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
}
/**
* 修改、添加
、删除f_fmea
导致rpn、rpni改变
* 修改、添加导致rpn、rpni改变
*/
@Override
public
void
notifyFmeaFromUpdate
(
Long
fmeaId
)
{
...
...
@@ -1509,12 +1513,20 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
/**
* fmea的更新导致rpn、rpni的值改变
*/
private
void
notifyRiskSource
(
Long
riskSourceId
)
{
@Override
public
void
notifyRiskSource
(
Long
riskSourceId
)
{
RiskSource
riskSource
=
iRiskSourceDao
.
findById
(
riskSourceId
);
if
(
riskSource
==
null
)
{
return
;
}
List
<
Fmea
>
fmeas
=
fmeaMapper
.
listByRiskSourceId
(
riskSourceId
);
if
(
CollectionUtils
.
isEmpty
(
fmeas
))
{
BigDecimal
resetValue
=
new
BigDecimal
(
"0"
);
riskSource
.
setRpn
(
resetValue
);
riskSource
.
setRpni
(
resetValue
);
riskSource
.
setRiskLevelId
(
0L
);
riskSourceMapper
.
updateRpn
(
riskSource
);
}
BigDecimal
maxSidValue
=
new
BigDecimal
(
"0"
);
BigDecimal
maxDidValue
=
new
BigDecimal
(
"0"
);
BigDecimal
totalOidValue
=
new
BigDecimal
(
"0"
);
...
...
@@ -1537,7 +1549,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
count
++;
}
}
if
(
count
==
0
)
{
if
(
count
==
0
)
{
return
;
}
BigDecimal
averageOidValue
=
totalOidValue
.
divide
(
BigDecimal
.
valueOf
(
count
));
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/IRiskSourceService.java
View file @
dae9c3a5
...
...
@@ -110,4 +110,6 @@ public interface IRiskSourceService {
void
notifyFmeaFromAbnormal
(
Long
fmeaId
);
void
notifyFmeaFromUpdate
(
Long
fmeaId
);
void
notifyRiskSource
(
Long
riskSourceId
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/client/invoke/FmeaMessage.java
View file @
dae9c3a5
...
...
@@ -2,21 +2,21 @@ package com.yeejoin.amos.fas.client.invoke;
public
class
FmeaMessage
{
private
Long
fmea
Id
;
private
Long
hand
Id
;
private
String
norifyFrom
;
public
FmeaMessage
(
Long
fmea
Id
,
String
norifyFrom
)
{
this
.
fmeaId
=
fmea
Id
;
public
FmeaMessage
(
Long
hand
Id
,
String
norifyFrom
)
{
this
.
handId
=
hand
Id
;
this
.
norifyFrom
=
norifyFrom
;
}
public
Long
get
Fmea
Id
()
{
return
fmea
Id
;
public
Long
get
Hand
Id
()
{
return
hand
Id
;
}
public
void
set
FmeaId
(
Long
fmea
Id
)
{
this
.
fmeaId
=
fmea
Id
;
public
void
set
HandId
(
Long
hand
Id
)
{
this
.
handId
=
hand
Id
;
}
public
String
getNorifyFrom
()
{
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/client/invoke/RsDataQueue.java
View file @
dae9c3a5
...
...
@@ -56,6 +56,10 @@ public class RsDataQueue {
blockingQueue
.
add
(
new
FmeaMessage
(
fmeaId
,
"abnormal"
));
}
public
void
addDeleteMessage
(
Long
riskSourceId
)
{
blockingQueue
.
add
(
new
FmeaMessage
(
riskSourceId
,
"delete"
));
}
Runnable
task_runnable
=
new
Runnable
()
{
public
void
run
()
{
while
(
true
)
{
...
...
@@ -63,11 +67,13 @@ public class RsDataQueue {
FmeaMessage
fmeaMessage
=
blockingQueue
.
take
();
if
(
riskSourceService
!=
null
)
{
String
from
=
fmeaMessage
.
getNorifyFrom
();
Long
fmeaId
=
fmeaMessage
.
getFmea
Id
();
Long
handId
=
fmeaMessage
.
getHand
Id
();
if
(
from
.
equals
(
"abnormal"
))
{
riskSourceService
.
notifyFmeaFromAbnormal
(
fmea
Id
);
riskSourceService
.
notifyFmeaFromAbnormal
(
hand
Id
);
}
else
if
(
from
.
equals
(
"update"
))
{
riskSourceService
.
notifyFmeaFromUpdate
(
fmeaId
);
riskSourceService
.
notifyFmeaFromUpdate
(
handId
);
}
else
if
(
from
.
equals
(
"delete"
))
{
riskSourceService
.
notifyRiskSource
(
handId
);
}
}
}
catch
(
Exception
e
)
{
...
...
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