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
f6fa54f6
Commit
f6fa54f6
authored
May 09, 2020
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.计算rpn
parent
cc82472f
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
365 additions
and
24 deletions
+365
-24
RpnChangeLogTypeEum.java
...om/yeejoin/amos/fas/common/enums/RpnChangeLogTypeEum.java
+36
-0
TriggerRpnChangeTypeEum.java
...eejoin/amos/fas/common/enums/TriggerRpnChangeTypeEum.java
+40
-0
RiskLevel.java
.../main/java/com/yeejoin/amos/fas/dao/entity/RiskLevel.java
+11
-0
RpnCalculationBo.java
...va/com/yeejoin/amos/fas/business/bo/RpnCalculationBo.java
+49
-0
FmeaMapper.java
.../com/yeejoin/amos/fas/business/dao/mapper/FmeaMapper.java
+2
-0
IFmeaDao.java
...om/yeejoin/amos/fas/business/dao/repository/IFmeaDao.java
+4
-1
FmeaServiceImpl.java
...ejoin/amos/fas/business/service/impl/FmeaServiceImpl.java
+1
-4
RiskSourceServiceImpl.java
...amos/fas/business/service/impl/RiskSourceServiceImpl.java
+0
-0
IRiskSourceService.java
...n/amos/fas/business/service/intfc/IRiskSourceService.java
+6
-1
RpnUtils.java
...ain/java/com/yeejoin/amos/fas/business/util/RpnUtils.java
+144
-0
RsDataQueue.java
.../java/com/yeejoin/amos/fas/client/invoke/RsDataQueue.java
+25
-15
fas-1.0.2.xml
...utoSysStart/src/main/resources/db/changelog/fas-1.0.2.xml
+12
-1
dbTemplate_fmea.xml
...SysStart/src/main/resources/db/mapper/dbTemplate_fmea.xml
+24
-0
pom.xml
pom.xml
+11
-2
No files found.
YeeAmosFireAutoSysCommon/src/main/java/com/yeejoin/amos/fas/common/enums/RpnChangeLogTypeEum.java
0 → 100644
View file @
f6fa54f6
package
com
.
yeejoin
.
amos
.
fas
.
common
.
enums
;
/**
* rpn变化类型枚举
*/
public
enum
RpnChangeLogTypeEum
{
/**
* 类型枚举
*/
upper
(
"上升"
,
0
),
down
(
"下降"
,
1
),
unChange
(
"未发生变化"
,
2
);
private
String
name
;
private
int
code
;
RpnChangeLogTypeEum
(
String
name
,
int
code
){
this
.
name
=
name
;
this
.
code
=
code
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
int
getCode
()
{
return
code
;
}
public
void
setCode
(
int
code
)
{
this
.
code
=
code
;
}
}
YeeAmosFireAutoSysCommon/src/main/java/com/yeejoin/amos/fas/common/enums/TriggerRpnChangeTypeEum.java
0 → 100644
View file @
f6fa54f6
package
com
.
yeejoin
.
amos
.
fas
.
common
.
enums
;
/**
* @author DELL
*/
public
enum
TriggerRpnChangeTypeEum
{
/**
* 触发类型枚举
*/
patrol
(
"巡检"
,
"patrol"
),
equipment
(
"设备告警"
,
"equipment"
),
fmeaUpdate
(
"危险因素评价"
,
"fmeaUpdate"
),
fmeaDelete
(
"危险因素删除"
,
"fmeaDelete"
),
riskDelete
(
"风险点删除"
,
"riskDelete"
);
private
String
name
;
private
String
code
;
TriggerRpnChangeTypeEum
(
String
name
,
String
code
){
this
.
name
=
name
;
this
.
code
=
code
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getCode
()
{
return
code
;
}
public
void
setCode
(
String
code
)
{
this
.
code
=
code
;
}
}
YeeAmosFireAutoSysCommon/src/main/java/com/yeejoin/amos/fas/dao/entity/RiskLevel.java
View file @
f6fa54f6
...
@@ -47,6 +47,8 @@ public class RiskLevel extends BasicEntity {
...
@@ -47,6 +47,8 @@ public class RiskLevel extends BasicEntity {
@Column
(
name
=
"down_limit"
)
@Column
(
name
=
"down_limit"
)
private
BigDecimal
downLimit
;
private
BigDecimal
downLimit
;
private
Integer
manageLevel
;
private
String
remark
;
private
String
remark
;
private
String
severity
;
private
String
severity
;
...
@@ -125,4 +127,12 @@ public class RiskLevel extends BasicEntity {
...
@@ -125,4 +127,12 @@ public class RiskLevel extends BasicEntity {
public
void
setDownLimit
(
BigDecimal
downLimit
)
{
public
void
setDownLimit
(
BigDecimal
downLimit
)
{
this
.
downLimit
=
downLimit
;
this
.
downLimit
=
downLimit
;
}
}
public
Integer
getManageLevel
()
{
return
manageLevel
;
}
public
void
setManageLevel
(
Integer
manageLevel
)
{
this
.
manageLevel
=
manageLevel
;
}
}
}
\ No newline at end of file
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/bo/RpnCalculationBo.java
0 → 100644
View file @
f6fa54f6
package
com
.
yeejoin
.
amos
.
fas
.
business
.
bo
;
import
java.math.BigDecimal
;
/**
* @author DELL
*/
public
class
RpnCalculationBo
{
/**
* rpn
*/
BigDecimal
rpn
;
/**
* rpni
*/
BigDecimal
rpni
;
/**
* 长度
*/
long
size
;
public
long
getSize
()
{
return
size
;
}
public
void
setSize
(
long
size
)
{
this
.
size
=
size
;
}
public
BigDecimal
getRpn
()
{
return
rpn
;
}
public
void
setRpn
(
BigDecimal
rpn
)
{
this
.
rpn
=
rpn
;
}
public
BigDecimal
getRpni
()
{
return
rpni
;
}
public
void
setRpni
(
BigDecimal
rpni
)
{
this
.
rpni
=
rpni
;
}
public
boolean
isEmpty
(){
return
size
<=
0
;
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/mapper/FmeaMapper.java
View file @
f6fa54f6
...
@@ -36,5 +36,7 @@ public interface FmeaMapper extends BaseMapper {
...
@@ -36,5 +36,7 @@ public interface FmeaMapper extends BaseMapper {
List
<
Fmea
>
listByRiskSourceId
(
Long
riskSourceId
);
List
<
Fmea
>
listByRiskSourceId
(
Long
riskSourceId
);
List
<
Fmea
>
listByRiskSourceIds
(
@Param
(
"ids"
)
List
<
Long
>
ids
);
void
updateRpn
(
Fmea
fmea
);
void
updateRpn
(
Fmea
fmea
);
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/repository/IFmeaDao.java
View file @
f6fa54f6
...
@@ -29,7 +29,7 @@ public interface IFmeaDao extends BaseDao<Fmea, Long> {
...
@@ -29,7 +29,7 @@ public interface IFmeaDao extends BaseDao<Fmea, Long> {
/**
/**
* 根据ID删除fmea对象
* 根据ID删除fmea对象
*
*
* @param
riskSourceId
* @param
fmeaIds
*/
*/
@Modifying
@Modifying
@Transactional
@Transactional
...
@@ -44,4 +44,7 @@ public interface IFmeaDao extends BaseDao<Fmea, Long> {
...
@@ -44,4 +44,7 @@ public interface IFmeaDao extends BaseDao<Fmea, Long> {
@Query
(
value
=
"SELECT count(1) FROM `f_fmea_equipment_point` WHERE fmea_id in ?1"
,
nativeQuery
=
true
)
@Query
(
value
=
"SELECT count(1) FROM `f_fmea_equipment_point` WHERE fmea_id in ?1"
,
nativeQuery
=
true
)
int
countAssociatedEquipPointByIds
(
String
[]
ids
);
int
countAssociatedEquipPointByIds
(
String
[]
ids
);
@Query
(
value
=
"select * from `f_fmea` where id in ?1"
,
nativeQuery
=
true
)
List
<
Fmea
>
findAllByRiskSourceIds
(
List
<
Long
>
ids
);
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/FmeaServiceImpl.java
View file @
f6fa54f6
...
@@ -66,10 +66,7 @@ public class FmeaServiceImpl implements IFmeaService {
...
@@ -66,10 +66,7 @@ public class FmeaServiceImpl implements IFmeaService {
fmeas
.
forEach
(
fmea
->
{
fmeas
.
forEach
(
fmea
->
{
String
userId
=
paramMap
.
get
(
"user_id"
)
==
null
?
"0"
:
paramMap
.
get
(
"user_id"
).
toString
();
String
userId
=
paramMap
.
get
(
"user_id"
)
==
null
?
"0"
:
paramMap
.
get
(
"user_id"
).
toString
();
fmea
.
setCreateBy
(
Integer
.
parseInt
(
userId
));
fmea
.
setCreateBy
(
Integer
.
parseInt
(
userId
));
// RiskSource riskSource = iRiskSourceDao.findById(fmea.getRiskSourceId());
// fmea.setRiskSource(riskSource);
iFmeaDao
.
save
(
fmea
);
iFmeaDao
.
save
(
fmea
);
//updateRpniInfo(fmea.getRiskSourceId());
});
});
}
}
...
@@ -255,7 +252,7 @@ public class FmeaServiceImpl implements IFmeaService {
...
@@ -255,7 +252,7 @@ public class FmeaServiceImpl implements IFmeaService {
Map
map
=
(
Map
)
result
;
Map
map
=
(
Map
)
result
;
RPNi
=
new
BigDecimal
(
Double
.
parseDouble
(
String
.
valueOf
(
map
.
get
(
"RPNi"
)
)));
RPNi
=
new
BigDecimal
(
String
.
valueOf
(
map
.
get
(
"RPNi"
)));
if
(
RPNi
!=
null
)
{
if
(
RPNi
!=
null
)
{
riskSource
.
setRpni
(
RPNi
);
riskSource
.
setRpni
(
RPNi
);
this
.
iRiskSourceDao
.
save
(
riskSource
);
this
.
iRiskSourceDao
.
save
(
riskSource
);
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/RiskSourceServiceImpl.java
View file @
f6fa54f6
This diff is collapsed.
Click to expand it.
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/IRiskSourceService.java
View file @
f6fa54f6
...
@@ -16,6 +16,7 @@ import org.springframework.data.domain.Page;
...
@@ -16,6 +16,7 @@ import org.springframework.data.domain.Page;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.Set
;
public
interface
IRiskSourceService
{
public
interface
IRiskSourceService
{
...
@@ -111,5 +112,9 @@ public interface IRiskSourceService {
...
@@ -111,5 +112,9 @@ public interface IRiskSourceService {
void
notifyFmeaFromUpdate
(
Long
fmeaId
,
String
nofityType
);
void
notifyFmeaFromUpdate
(
Long
fmeaId
,
String
nofityType
);
void
notifyRiskSource
(
Long
riskSourceId
,
String
notifyType
,
String
jpushTarget
);
void
notifyRiskSource
(
Long
fmeaId
,
Long
riskSourceId
,
String
notifyType
,
Set
<
String
>
jpushTargets
);
void
notifyFmeaFromDelete
(
Long
handId
,
String
from
);
void
notifyRiskSourceDelete
(
Long
handId
);
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/util/RpnUtils.java
0 → 100644
View file @
f6fa54f6
package
com
.
yeejoin
.
amos
.
fas
.
business
.
util
;
import
com.yeejoin.amos.fas.business.bo.RpnCalculationBo
;
import
com.yeejoin.amos.fas.common.enums.RpnChangeLogTypeEum
;
import
com.yeejoin.amos.fas.dao.entity.Fmea
;
import
com.yeejoin.amos.fas.dao.entity.FmeaEquipmentPoint
;
import
com.yeejoin.amos.fas.dao.entity.FmeaPointInputitem
;
import
com.yeejoin.amos.fas.dao.entity.RiskLevel
;
import
org.springframework.util.CollectionUtils
;
import
java.math.BigDecimal
;
import
java.util.List
;
/**
* @author DELL
*/
public
class
RpnUtils
{
/**
* 计算风险值
* @param fmeas
* @return RpnCalculationBo
*/
public
static
RpnCalculationBo
calRpnAndRpni
(
List
<
Fmea
>
fmeas
){
BigDecimal
maxSidValue
=
new
BigDecimal
(
"0"
);
BigDecimal
maxDidValue
=
new
BigDecimal
(
"0"
);
BigDecimal
totalOidValue
=
new
BigDecimal
(
"0"
);
BigDecimal
totalNewOidValue
=
new
BigDecimal
(
"0"
);
long
count
=
0L
;
for
(
Fmea
fmea
:
fmeas
)
{
if
(
fmea
.
getEvaluationDid
()
!=
null
&&
fmea
.
getEvaluationSid
()
!=
null
&&
fmea
.
getEvaluationOid
()
!=
null
&&
fmea
.
getNewEvaluationOid
()
!=
null
)
{
BigDecimal
didValue
=
new
BigDecimal
(
fmea
.
getDidValue
());
BigDecimal
sidValue
=
new
BigDecimal
(
fmea
.
getSidValue
());
BigDecimal
oidValue
=
new
BigDecimal
(
fmea
.
getOidValue
());
BigDecimal
newOidValue
=
new
BigDecimal
(
fmea
.
getNewOidValue
());
if
(
didValue
.
compareTo
(
maxDidValue
)
==
1
)
{
maxDidValue
=
didValue
;
}
if
(
sidValue
.
compareTo
(
maxSidValue
)
==
1
)
{
maxSidValue
=
sidValue
;
}
totalOidValue
=
totalOidValue
.
add
(
oidValue
);
totalNewOidValue
=
totalNewOidValue
.
add
(
newOidValue
);
count
++;
}
}
RpnCalculationBo
rpnValue
=
new
RpnCalculationBo
();
rpnValue
.
setSize
(
count
);
if
(
count
==
0
)
{
return
rpnValue
;
}
BigDecimal
averageOidValue
=
totalOidValue
.
divide
(
BigDecimal
.
valueOf
(
count
),
2
,
BigDecimal
.
ROUND_HALF_UP
);
BigDecimal
averageNewOidValue
=
totalNewOidValue
.
divide
(
BigDecimal
.
valueOf
(
count
),
2
,
BigDecimal
.
ROUND_HALF_UP
);
BigDecimal
rpn
=
maxDidValue
.
multiply
(
maxSidValue
).
multiply
(
averageNewOidValue
).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
);
BigDecimal
rpni
=
maxDidValue
.
multiply
(
maxSidValue
).
multiply
(
averageOidValue
).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
);
rpnValue
.
setRpn
(
rpn
);
rpnValue
.
setRpni
(
rpni
);
return
rpnValue
;
}
/**
* 计算最大故障率
* @param equipmentPoints
* @param pointInputitems
* @return
*/
public
static
Double
getMaxRate
(
List
<
FmeaEquipmentPoint
>
equipmentPoints
,
List
<
FmeaPointInputitem
>
pointInputitems
)
{
Double
pointInputitemRate
=
null
;
if
(!
CollectionUtils
.
isEmpty
(
pointInputitems
))
{
int
totalPointInputitem
=
pointInputitems
.
size
();
int
pointInputitemUnNormal
=
0
;
for
(
FmeaPointInputitem
pointInputitem
:
pointInputitems
)
{
if
(
pointInputitem
.
getState
()
==
1
)
{
pointInputitemUnNormal
++;
}
}
pointInputitemRate
=
pointInputitemUnNormal
*
1.0
/
totalPointInputitem
;
}
Double
equipmentPointRate
=
null
;
if
(!
CollectionUtils
.
isEmpty
(
equipmentPoints
))
{
int
totalEquipmentPoint
=
equipmentPoints
.
size
();
int
equipmentPointUnNormal
=
0
;
for
(
FmeaEquipmentPoint
equipmentPoint
:
equipmentPoints
)
{
if
(
equipmentPoint
.
getState
()
==
1
)
{
equipmentPointUnNormal
++;
}
}
equipmentPointRate
=
equipmentPointUnNormal
*
1.0
/
totalEquipmentPoint
;
}
if
(
equipmentPointRate
==
null
)
{
if
(
pointInputitemRate
==
null
)
{
return
null
;
}
else
{
return
pointInputitemRate
;
}
}
else
{
if
(
pointInputitemRate
==
null
)
{
return
equipmentPointRate
;
}
else
{
if
(
pointInputitemRate
<
equipmentPointRate
)
{
return
equipmentPointRate
;
}
else
{
return
pointInputitemRate
;
}
}
}
}
/**
* 获得风险等级
* @param rpni
* @param levels
* @return
*/
public
static
RiskLevel
getBetweenLevel
(
BigDecimal
rpni
,
List
<
RiskLevel
>
levels
)
{
if
(
CollectionUtils
.
isEmpty
(
levels
))
{
return
null
;
}
for
(
RiskLevel
level
:
levels
)
{
int
downResult
=
level
.
getDownLimit
().
compareTo
(
rpni
);
int
topResult
=
level
.
getTopLimit
().
compareTo
(
rpni
);
if
(
downResult
==
-
1
&&
topResult
!=
-
1
)
{
return
level
;
}
}
return
null
;
}
/**
* 获取风险变化类型
* @param rpn
* @param rpni
* @return
*/
public
static
int
getChangeType
(
BigDecimal
rpn
,
BigDecimal
rpni
)
{
if
(
rpn
.
subtract
(
rpni
).
doubleValue
()
>
0
){
return
RpnChangeLogTypeEum
.
upper
.
getCode
();
}
else
if
(
rpn
.
subtract
(
rpni
).
doubleValue
()
<
0
){
return
RpnChangeLogTypeEum
.
down
.
getCode
();
}
else
{
return
RpnChangeLogTypeEum
.
unChange
.
getCode
();
}
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/client/invoke/RsDataQueue.java
View file @
f6fa54f6
package
com
.
yeejoin
.
amos
.
fas
.
client
.
invoke
;
package
com
.
yeejoin
.
amos
.
fas
.
client
.
invoke
;
import
com.yeejoin.amos.fas.business.service.intfc.IRiskSourceService
;
import
com.yeejoin.amos.fas.business.service.intfc.IRiskSourceService
;
import
com.yeejoin.amos.fas.common.enums.TriggerRpnChangeTypeEum
;
import
com.yeejoin.amos.fas.context.IotContext
;
import
com.yeejoin.amos.fas.context.IotContext
;
import
org.apache.log4j.Logger
;
import
org.apache.log4j.Logger
;
import
java.util.concurrent.BlockingQueue
;
import
java.util.concurrent.BlockingQueue
;
import
java.util.concurrent.Executors
;
import
java.util.concurrent.Executors
;
import
java.util.concurrent.LinkedBlockingQueue
;
import
java.util.concurrent.LinkedBlockingQueue
;
...
@@ -24,7 +24,10 @@ public class RsDataQueue {
...
@@ -24,7 +24,10 @@ public class RsDataQueue {
riskSourceService
=
(
IRiskSourceService
)
IotContext
.
getInstance
().
getBean
(
IRiskSourceService
.
class
);
riskSourceService
=
(
IRiskSourceService
)
IotContext
.
getInstance
().
getBean
(
IRiskSourceService
.
class
);
}
}
//获取RsDataQueue 的实例
/**
* 获取RsDataQueue 的实例
* @return 获RsDataQueue
*/
public
static
RsDataQueue
getInstance
()
{
public
static
RsDataQueue
getInstance
()
{
//先检查实例是否存在,如果不存在才进入下面的同步块
//先检查实例是否存在,如果不存在才进入下面的同步块
if
(
instance
==
null
)
{
if
(
instance
==
null
)
{
...
@@ -49,22 +52,27 @@ public class RsDataQueue {
...
@@ -49,22 +52,27 @@ public class RsDataQueue {
}
}
public
void
addUpdateMessage
(
Long
fmeaId
)
{
public
void
addUpdateMessage
(
Long
fmeaId
)
{
blockingQueue
.
add
(
new
FmeaMessage
(
fmeaId
,
"update"
));
blockingQueue
.
add
(
new
FmeaMessage
(
fmeaId
,
TriggerRpnChangeTypeEum
.
fmeaUpdate
.
getCode
()
));
}
}
public
void
addPatrolMessage
(
Long
fmeaId
)
{
public
void
addPatrolMessage
(
Long
fmeaId
)
{
blockingQueue
.
add
(
new
FmeaMessage
(
fmeaId
,
"patrol"
));
blockingQueue
.
add
(
new
FmeaMessage
(
fmeaId
,
TriggerRpnChangeTypeEum
.
patrol
.
getCode
()
));
}
}
public
void
addEquipmentMessage
(
Long
fmeaId
)
{
public
void
addEquipmentMessage
(
Long
fmeaId
)
{
blockingQueue
.
add
(
new
FmeaMessage
(
fmeaId
,
"equipment"
));
blockingQueue
.
add
(
new
FmeaMessage
(
fmeaId
,
TriggerRpnChangeTypeEum
.
equipment
.
getCode
()
));
}
}
public
void
addDeleteMessage
(
Long
riskSourceId
)
{
public
void
addDeleteMessage
(
Long
riskSourceId
)
{
blockingQueue
.
add
(
new
FmeaMessage
(
riskSourceId
,
"delete"
));
blockingQueue
.
add
(
new
FmeaMessage
(
riskSourceId
,
TriggerRpnChangeTypeEum
.
fmeaDelete
.
getCode
()));
}
public
void
addRiskSourcePointDeleteMessage
(
Long
parentId
){
blockingQueue
.
add
(
new
FmeaMessage
(
parentId
,
TriggerRpnChangeTypeEum
.
riskDelete
.
getCode
()));
}
}
Runnable
task_runnable
=
new
Runnable
()
{
private
Runnable
task_runnable
=
new
Runnable
()
{
@Override
public
void
run
()
{
public
void
run
()
{
while
(
true
)
{
while
(
true
)
{
try
{
try
{
...
@@ -72,23 +80,25 @@ public class RsDataQueue {
...
@@ -72,23 +80,25 @@ public class RsDataQueue {
if
(
riskSourceService
!=
null
)
{
if
(
riskSourceService
!=
null
)
{
String
from
=
fmeaMessage
.
getNorifyFrom
();
String
from
=
fmeaMessage
.
getNorifyFrom
();
Long
handId
=
fmeaMessage
.
getHandId
();
Long
handId
=
fmeaMessage
.
getHandId
();
if
(
from
.
equals
(
"patrol"
))
{
if
(
from
.
equals
(
TriggerRpnChangeTypeEum
.
patrol
.
getCode
()
))
{
//巡检不合格通知
//巡检不合格通知
riskSourceService
.
notifyFmeaFromAbnormal
(
handId
,
from
);
riskSourceService
.
notifyFmeaFromAbnormal
(
handId
,
from
);
}
else
if
(
from
.
equals
(
"equipment"
))
{
}
else
if
(
from
.
equals
(
TriggerRpnChangeTypeEum
.
equipment
.
getCode
()
))
{
//设备告警
//设备告警
riskSourceService
.
notifyFmeaFromAbnormal
(
handId
,
from
);
riskSourceService
.
notifyFmeaFromAbnormal
(
handId
,
from
);
}
else
if
(
from
.
equals
(
"update"
))
{
}
else
if
(
from
.
equals
(
TriggerRpnChangeTypeEum
.
fmeaUpdate
.
getCode
()
))
{
//修改通知
//
危险因素评价
修改通知
riskSourceService
.
notifyFmeaFromUpdate
(
handId
,
from
);
riskSourceService
.
notifyFmeaFromUpdate
(
handId
,
from
);
}
else
if
(
from
.
equals
(
"delete"
))
{
}
else
if
(
from
.
equals
(
TriggerRpnChangeTypeEum
.
fmeaDelete
.
getCode
()))
{
//删除通知
//危险因素删除通知
riskSourceService
.
notifyRiskSource
(
handId
,
from
,
null
);
riskSourceService
.
notifyFmeaFromDelete
(
handId
,
from
);
}
else
if
(
from
.
equals
(
TriggerRpnChangeTypeEum
.
riskDelete
.
getCode
())){
//风险点删除通知
riskSourceService
.
notifyRiskSourceDelete
(
handId
);
}
}
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
Logger
.
getLogger
(
this
.
getClass
()).
error
(
e
.
getMessage
());
Logger
.
getLogger
(
this
.
getClass
()).
error
(
e
.
getMessage
());
e
.
printStackTrace
();
}
}
}
}
}
}
...
...
YeeAmosFireAutoSysStart/src/main/resources/db/changelog/fas-1.0.2.xml
View file @
f6fa54f6
...
@@ -367,6 +367,16 @@
...
@@ -367,6 +367,16 @@
ALTER TABLE `f_topography_node_detail`
ALTER TABLE `f_topography_node_detail`
MODIFY COLUMN `nodeid` varchar(36) DEFAULT NULL;
MODIFY COLUMN `nodeid` varchar(36) DEFAULT NULL;
</sql>
</sql>
</changeSet>
</changeSet>
<changeSet
author=
"suhuiguang"
id=
"1588990926789-1"
>
<preConditions
onFail=
"MARK_RAN"
>
<columnExists
tableName=
"f_risk_level "
columnName=
"manage_level"
/>
</preConditions>
<comment>
f_risk_level add column manage_level 管控级别
</comment>
<sql>
ALTER TABLE `f_risk_level`
add COLUMN `manage_level` tinyint(4) DEFAULT NULL COMMENT '管控级别';
</sql>
</changeSet>
</databaseChangeLog>
</databaseChangeLog>
\ No newline at end of file
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/dbTemplate_fmea.xml
View file @
f6fa54f6
...
@@ -154,4 +154,27 @@
...
@@ -154,4 +154,27 @@
</set>
</set>
where id = #{id}
where id = #{id}
</update>
</update>
<select
id=
"listByRiskSourceIds"
resultType=
"com.yeejoin.amos.fas.dao.entity.Fmea"
>
select
a.id,
a.risk_source_id as riskSourceId,
a.risk_factors_id as riskFactorsId,
a.evaluation_sid as evaluationSid,
a.evaluation_oid as evaluationOid,
a.evaluation_did as evaluationDid,
a.new_evaluation_oid as newEvaluationOid,
a.rpni,
a.rpn,
(select coefficient from f_evaluation_model where id = a.evaluation_sid) as sidValue,
(select coefficient from f_evaluation_model where id = a.evaluation_oid) as oidValue,
(select coefficient from f_evaluation_model where id = a.evaluation_did) as didValue,
(select coefficient from f_evaluation_model where id = a.new_evaluation_oid) as newOidValue
from
f_fmea as a
where
a.risk_source_id in
<foreach
collection=
"ids"
item=
"item"
index=
"index"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</select>
</mapper>
</mapper>
\ No newline at end of file
pom.xml
View file @
f6fa54f6
...
@@ -240,7 +240,7 @@
...
@@ -240,7 +240,7 @@
</dependencyManagement>
</dependencyManagement>
<repositories>
<repositories>
<repository>
<repository>
<id>
public
</id>
<id>
public
</id>
<name>
Public Repositories
</name>
<name>
Public Repositories
</name>
...
@@ -251,7 +251,16 @@
...
@@ -251,7 +251,16 @@
<name>
maven-public
</name>
<name>
maven-public
</name>
<url>
http://172.16.1.6:8081/nexus/content/repositories/maven-public/
</url>
<url>
http://172.16.1.6:8081/nexus/content/repositories/maven-public/
</url>
</repository>
</repository>
<repository>
<id>
maven-public
</id>
<name>
maven-public
</name>
<url>
http://repo.typroject.org:8081/repository/maven-public/
</url>
</repository>
<repository>
<id>
maven-snapshot
</id>
<name>
maven-snapshot
</name>
<url>
http://repo.typroject.org:8081/repository/maven-snapshots/
</url>
</repository>
</repositories>
</repositories>
<pluginRepositories>
<pluginRepositories>
...
...
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