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
340b3168
Commit
340b3168
authored
Jun 24, 2020
by
单奇雲
Browse files
Options
Browse Files
Download
Plain Diff
bug
parents
427d3c0c
b0822c9c
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
89 additions
and
66 deletions
+89
-66
WeatherController.java
...ejoin/amos/fas/business/controller/WeatherController.java
+6
-2
IEquipmentFireEquipmentDao.java
...s/business/dao/repository/IEquipmentFireEquipmentDao.java
+4
-0
EquipmentServiceImpl.java
.../amos/fas/business/service/impl/EquipmentServiceImpl.java
+5
-0
RiskSourceServiceImpl.java
...amos/fas/business/service/impl/RiskSourceServiceImpl.java
+72
-63
application.properties
...ireAutoSysStart/src/main/resources/application.properties
+2
-1
No files found.
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/WeatherController.java
View file @
340b3168
...
@@ -7,13 +7,13 @@ import java.net.URLConnection;
...
@@ -7,13 +7,13 @@ import java.net.URLConnection;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.itextpdf.text.pdf.PdfStructTreeController.returnType
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.core.util.CommonResponseUtil
;
import
com.yeejoin.amos.fas.core.util.CommonResponseUtil
;
...
@@ -25,6 +25,10 @@ import io.swagger.annotations.ApiOperation;
...
@@ -25,6 +25,10 @@ import io.swagger.annotations.ApiOperation;
@Api
(
tags
=
"天气api"
)
@Api
(
tags
=
"天气api"
)
public
class
WeatherController
extends
BaseController
{
public
class
WeatherController
extends
BaseController
{
@Value
(
"${param.weather.url}"
)
private
String
weatherUrl
;
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"天气查询"
,
notes
=
"天气查询"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"天气查询"
,
notes
=
"天气查询"
)
@GetMapping
(
"/{address}"
)
@GetMapping
(
"/{address}"
)
public
CommonResponse
getWeather
(
@PathVariable
(
"address"
)
String
address
)
{
public
CommonResponse
getWeather
(
@PathVariable
(
"address"
)
String
address
)
{
...
@@ -32,7 +36,7 @@ public class WeatherController extends BaseController {
...
@@ -32,7 +36,7 @@ public class WeatherController extends BaseController {
String
result
=
""
;
String
result
=
""
;
BufferedReader
in
=
null
;
BufferedReader
in
=
null
;
try
{
try
{
String
urlNameString
=
"http://t.weather.sojson.com/api/weather/city/"
+
address
;
String
urlNameString
=
weatherUrl
+
address
;
URL
realUrl
=
new
URL
(
urlNameString
);
URL
realUrl
=
new
URL
(
urlNameString
);
// 打开和URL之间的连接
// 打开和URL之间的连接
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/repository/IEquipmentFireEquipmentDao.java
View file @
340b3168
...
@@ -3,6 +3,8 @@ package com.yeejoin.amos.fas.business.dao.repository;
...
@@ -3,6 +3,8 @@ package com.yeejoin.amos.fas.business.dao.repository;
import
com.yeejoin.amos.fas.dao.entity.EquipmentFireEquipment
;
import
com.yeejoin.amos.fas.dao.entity.EquipmentFireEquipment
;
import
org.springframework.data.jpa.repository.Modifying
;
import
org.springframework.data.jpa.repository.Modifying
;
import
java.util.List
;
import
org.springframework.data.jpa.repository.Query
;
import
org.springframework.data.jpa.repository.Query
;
import
org.springframework.stereotype.Repository
;
import
org.springframework.stereotype.Repository
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
...
@@ -20,6 +22,8 @@ public interface IEquipmentFireEquipmentDao extends BaseDao<EquipmentFireEquipme
...
@@ -20,6 +22,8 @@ public interface IEquipmentFireEquipmentDao extends BaseDao<EquipmentFireEquipme
@Query
(
value
=
"select count(1) from f_equipment_fire_equipment WHERE equipment_id = ?1 and fire_equipment_id = ?2"
,
nativeQuery
=
true
)
@Query
(
value
=
"select count(1) from f_equipment_fire_equipment WHERE equipment_id = ?1 and fire_equipment_id = ?2"
,
nativeQuery
=
true
)
int
findByEqmtIdAndFireEqmtId
(
Long
equipmentId
,
Long
fireEquipmentId
);
int
findByEqmtIdAndFireEqmtId
(
Long
equipmentId
,
Long
fireEquipmentId
);
List
<
EquipmentFireEquipment
>
findAllByEquipmentId
(
Long
equipmentId
);
@Query
(
value
=
"SELECT count(1) FROM `f_equipment_fire_equipment` WHERE fire_equipment_id in ?1"
,
nativeQuery
=
true
)
@Query
(
value
=
"SELECT count(1) FROM `f_equipment_fire_equipment` WHERE fire_equipment_id in ?1"
,
nativeQuery
=
true
)
int
countImpEquipByIds
(
String
[]
ids
);
int
countImpEquipByIds
(
String
[]
ids
);
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/EquipmentServiceImpl.java
View file @
340b3168
...
@@ -133,6 +133,11 @@ public class EquipmentServiceImpl implements IEquipmentService {
...
@@ -133,6 +133,11 @@ public class EquipmentServiceImpl implements IEquipmentService {
equipment
=
equipment1
.
get
();
equipment
=
equipment1
.
get
();
}
}
if
(
equipment
!=
null
)
{
if
(
equipment
!=
null
)
{
List
<
EquipmentFireEquipment
>
eqFireEqs
=
equipmentFireEquipmentDao
.
findAllByEquipmentId
(
equipment
.
getId
());
if
(!
eqFireEqs
.
isEmpty
()){
equipmentFireEquipmentDao
.
deleteAll
(
eqFireEqs
);
}
this
.
iEquipmentDao
.
deleteById
(
Long
.
parseLong
(
id
));
this
.
iEquipmentDao
.
deleteById
(
Long
.
parseLong
(
id
));
}
else
{
}
else
{
throw
new
Exception
(
"找不到指定的对象:"
+
id
);
throw
new
Exception
(
"找不到指定的对象:"
+
id
);
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/RiskSourceServiceImpl.java
View file @
340b3168
...
@@ -3,7 +3,6 @@ package com.yeejoin.amos.fas.business.service.impl;
...
@@ -3,7 +3,6 @@ package com.yeejoin.amos.fas.business.service.impl;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
import
com.google.common.base.Joiner
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Maps
;
import
com.google.common.collect.Maps
;
import
com.google.common.collect.Sets
;
import
com.google.common.collect.Sets
;
...
@@ -26,10 +25,9 @@ import com.yeejoin.amos.fas.business.service.intfc.IDataRefreshService;
...
@@ -26,10 +25,9 @@ import com.yeejoin.amos.fas.business.service.intfc.IDataRefreshService;
import
com.yeejoin.amos.fas.business.service.intfc.IEquipmentService
;
import
com.yeejoin.amos.fas.business.service.intfc.IEquipmentService
;
import
com.yeejoin.amos.fas.business.service.intfc.IRiskSourceService
;
import
com.yeejoin.amos.fas.business.service.intfc.IRiskSourceService
;
import
com.yeejoin.amos.fas.business.service.model.*
;
import
com.yeejoin.amos.fas.business.service.model.*
;
import
com.yeejoin.amos.fas.business.util.DateUtils
;
import
com.yeejoin.amos.fas.business.util.*
;
import
com.yeejoin.amos.fas.business.util.JexlUtil
;
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.business.vo.Toke
;
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.CheckStatusEnum
;
import
com.yeejoin.amos.fas.common.enums.DataRefreshTypeEum
;
import
com.yeejoin.amos.fas.common.enums.DataRefreshTypeEum
;
...
@@ -41,8 +39,6 @@ import com.yeejoin.amos.fas.core.util.StringUtil;
...
@@ -41,8 +39,6 @@ import com.yeejoin.amos.fas.core.util.StringUtil;
import
com.yeejoin.amos.fas.dao.entity.*
;
import
com.yeejoin.amos.fas.dao.entity.*
;
import
com.yeejoin.amos.fas.exception.YeeException
;
import
com.yeejoin.amos.fas.exception.YeeException
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.DepartmentModel
;
import
org.apache.commons.lang3.ArrayUtils
;
import
org.apache.commons.lang3.ArrayUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
...
@@ -84,6 +80,10 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -84,6 +80,10 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
private
static
final
String
DATETYPE_YYYY
=
"yyyy"
;
//年
private
static
final
String
DATETYPE_YYYY
=
"yyyy"
;
//年
private
static
final
String
TOKE
=
"TOKE"
;
private
static
CacheMap
cacheMap
=
CacheFactory
.
newChacheMap
();
@Autowired
@Autowired
private
IRiskSourceDao
iRiskSourceDao
;
private
IRiskSourceDao
iRiskSourceDao
;
...
@@ -212,7 +212,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -212,7 +212,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
int
count
=
iRiskSourceDao
.
countByParentId
(
rId
);
int
count
=
iRiskSourceDao
.
countByParentId
(
rId
);
Optional
<
RiskSource
>
rs
=
iRiskSourceDao
.
findById
(
rId
);
Optional
<
RiskSource
>
rs
=
iRiskSourceDao
.
findById
(
rId
);
rs
.
ifPresent
(
riskSource
->
parentIds
.
add
(
riskSource
.
getParentId
()));
rs
.
ifPresent
(
riskSource
->
parentIds
.
add
(
riskSource
.
getParentId
()));
if
(
parentIds
.
contains
(
0
l
))
{
if
(
parentIds
.
contains
(
0
l
))
{
throw
new
YeeException
(
"公司节点不能删除"
);
throw
new
YeeException
(
"公司节点不能删除"
);
}
}
if
(
count
>
0
)
{
if
(
count
>
0
)
{
...
@@ -364,9 +364,9 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -364,9 +364,9 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
if
(!
CollectionUtils
.
isEmpty
(
returnList
)
&&
equipment
!=
null
)
{
if
(!
CollectionUtils
.
isEmpty
(
returnList
)
&&
equipment
!=
null
)
{
fmeaEquipmentPointMapper
.
saveBatch
(
returnList
);
fmeaEquipmentPointMapper
.
saveBatch
(
returnList
);
}
}
if
(
equipment
!=
null
)
{
if
(
equipment
!=
null
)
{
RsDataQueue
rsDataQueue
=
RsDataQueue
.
getInstance
();
RsDataQueue
rsDataQueue
=
RsDataQueue
.
getInstance
();
rsDataQueue
.
addEquipmentMessage
(
fmeaId
,
equipment
.
getName
());
rsDataQueue
.
addEquipmentMessage
(
fmeaId
,
equipment
.
getName
());
}
}
return
returnList
;
return
returnList
;
}
}
...
@@ -496,7 +496,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -496,7 +496,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
}
}
//Object result = remoteRuleServer.fireRuleFlow(contingencyRo, equipment.getReservePlan(), equipment.getName());
//Object result = remoteRuleServer.fireRuleFlow(contingencyRo, equipment.getReservePlan(), equipment.getName());
ruleTrigger
.
publish
(
contingencyRo
,
equipment
.
getReservePlan
(),
ArrayUtils
.
toArray
(
equipment
.
getName
()));
ruleTrigger
.
publish
(
contingencyRo
,
equipment
.
getReservePlan
(),
ArrayUtils
.
toArray
(
equipment
.
getName
()));
ContingencyOriginalData
contingencyOriginalData
=
new
ContingencyOriginalData
();
ContingencyOriginalData
contingencyOriginalData
=
new
ContingencyOriginalData
();
BeanUtils
.
copyProperties
(
contingencyRo
,
contingencyOriginalData
);
BeanUtils
.
copyProperties
(
contingencyRo
,
contingencyOriginalData
);
iContingencyOriginalDataDao
.
save
(
contingencyOriginalData
);
iContingencyOriginalDataDao
.
save
(
contingencyOriginalData
);
...
@@ -536,7 +536,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -536,7 +536,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
}
}
@Override
@Override
public
Page
<
Map
<
String
,
Object
>>
listFmeaPointInputitem
(
String
toke
,
String
product
,
String
appKey
,
Long
fmeaId
,
Integer
pageNumber
,
Integer
pageSize
)
{
public
Page
<
Map
<
String
,
Object
>>
listFmeaPointInputitem
(
String
toke
,
String
product
,
String
appKey
,
Long
fmeaId
,
Integer
pageNumber
,
Integer
pageSize
)
{
List
<
Map
<
String
,
Object
>>
content
=
Lists
.
newArrayList
();
List
<
Map
<
String
,
Object
>>
content
=
Lists
.
newArrayList
();
CommonPageable
pageable
=
new
CommonPageable
(
pageNumber
,
pageSize
);
CommonPageable
pageable
=
new
CommonPageable
(
pageNumber
,
pageSize
);
long
total
=
fmeaPointInputitemMapper
.
countByFmeaId
(
fmeaId
);
long
total
=
fmeaPointInputitemMapper
.
countByFmeaId
(
fmeaId
);
...
@@ -544,26 +544,26 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -544,26 +544,26 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
return
new
PageImpl
<>(
content
,
pageable
,
total
);
return
new
PageImpl
<>(
content
,
pageable
,
total
);
}
}
content
=
fmeaPointInputitemMapper
.
listByFmeaId
(
fmeaId
,
pageNumber
,
pageSize
);
content
=
fmeaPointInputitemMapper
.
listByFmeaId
(
fmeaId
,
pageNumber
,
pageSize
);
if
(!
CollectionUtils
.
isEmpty
(
content
))
{
if
(!
CollectionUtils
.
isEmpty
(
content
))
{
Set
<
Object
>
userIds
=
content
.
stream
().
filter
(
x
->
!
StringUtils
.
isEmpty
(
x
.
get
(
"userId"
))).
map
(
arg0
->
arg0
.
get
(
"userId"
)).
collect
(
Collectors
.
toSet
());
Set
<
Object
>
userIds
=
content
.
stream
().
filter
(
x
->
!
StringUtils
.
isEmpty
(
x
.
get
(
"userId"
))).
map
(
arg0
->
arg0
.
get
(
"userId"
)).
collect
(
Collectors
.
toSet
());
Set
<
Object
>
deptIds
=
content
.
stream
().
filter
(
x
->
!
StringUtils
.
isEmpty
(
x
.
get
(
"deptId"
))).
map
(
arg0
->
arg0
.
get
(
"deptId"
)).
collect
(
Collectors
.
toSet
());
Set
<
Object
>
deptIds
=
content
.
stream
().
filter
(
x
->
!
StringUtils
.
isEmpty
(
x
.
get
(
"deptId"
))).
map
(
arg0
->
arg0
.
get
(
"deptId"
)).
collect
(
Collectors
.
toSet
());
Map
<
String
,
AgencyUserModel
>
userMap
=
new
HashMap
<>();
Map
<
String
,
AgencyUserModel
>
userMap
=
new
HashMap
<>();
if
(!
CollectionUtils
.
isEmpty
(
userIds
))
{
if
(!
CollectionUtils
.
isEmpty
(
userIds
))
{
userMap
=
remoteSecurityService
.
getUsersMap
(
toke
,
product
,
appKey
,
userIds
);
userMap
=
remoteSecurityService
.
getUsersMap
(
toke
,
product
,
appKey
,
userIds
);
}
}
Map
<
Long
,
String
>
deptMap
=
new
HashMap
<>();
Map
<
Long
,
String
>
deptMap
=
new
HashMap
<>();
if
(!
CollectionUtils
.
isEmpty
(
deptIds
))
{
if
(!
CollectionUtils
.
isEmpty
(
deptIds
))
{
deptMap
=
remoteSecurityService
.
getDepName
(
toke
,
product
,
appKey
,
deptIds
);
deptMap
=
remoteSecurityService
.
getDepName
(
toke
,
product
,
appKey
,
deptIds
);
}
}
for
(
int
i
=
0
;
i
<
content
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
content
.
size
();
i
++)
{
if
(
StringUtil
.
isNotEmpty
(
content
.
get
(
i
).
get
(
"userId"
))
&&
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
(
StringUtil
.
isNotEmpty
(
content
.
get
(
i
).
get
(
"deptId"
))
&&
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
())));
}
}
}
}
...
@@ -622,17 +622,18 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -622,17 +622,18 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
}
}
RsDataQueue
rsDataQueue
=
RsDataQueue
.
getInstance
();
RsDataQueue
rsDataQueue
=
RsDataQueue
.
getInstance
();
fmeaIds
.
forEach
(
fmeaId
->
fmeaIds
.
forEach
(
fmeaId
->
rsDataQueue
.
addPatrolMessage
(
fmeaId
,
protalData
.
getCheckUser
(),
protalData
.
getName
(),
protalData
.
getNodeState
()));
rsDataQueue
.
addPatrolMessage
(
fmeaId
,
protalData
.
getCheckUser
(),
protalData
.
getName
(),
protalData
.
getNodeState
()));
}
}
iDataRefreshService
.
refreshViewData
(
DataRefreshTypeEum
.
check
.
getCode
());
iDataRefreshService
.
refreshViewData
(
DataRefreshTypeEum
.
check
.
getCode
());
}
}
/**
/**
* 巡检消息规则推送
* 巡检消息规则推送
*
* @param protalData
* @param protalData
*/
*/
@Async
@Async
void
protalRuleMessagePush
(
ProtalDataRo
protalData
,
String
token
,
String
product
,
String
appKey
){
void
protalRuleMessagePush
(
ProtalDataRo
protalData
,
String
token
,
String
product
,
String
appKey
)
{
String
bacthNo
=
UUID
.
randomUUID
().
toString
();
String
bacthNo
=
UUID
.
randomUUID
().
toString
();
protalData
.
setBatchNo
(
bacthNo
);
protalData
.
setBatchNo
(
bacthNo
);
protalData
.
setOriginalNodeState
(
protalData
.
getNodeState
());
protalData
.
setOriginalNodeState
(
protalData
.
getNodeState
());
...
@@ -707,8 +708,14 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -707,8 +708,14 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
if
(
alarmParam
==
null
)
{
if
(
alarmParam
==
null
)
{
log
.
warn
(
"alarmParam is empty!"
);
log
.
warn
(
"alarmParam is empty!"
);
}
else
{
}
else
{
Toke
toke
=
cacheMap
.
getValue
(
TOKE
);
if
(
toke
==
null
)
{
toke
=
remoteSecurityService
.
come
();
Long
times
=
(
long
)
(
20
*
24
*
60
*
60
);
cacheMap
.
setex
(
TOKE
,
toke
,
times
);
}
try
{
try
{
processFireData
(
alarmParam
);
processFireData
(
alarmParam
,
toke
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"parse alarmParam happened error"
,
e
);
log
.
error
(
"parse alarmParam happened error"
,
e
);
// 失败处理
// 失败处理
...
@@ -720,7 +727,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -720,7 +727,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
}
}
private
void
processFireData
(
AlarmParam
deviceData
)
throws
Exception
{
private
void
processFireData
(
AlarmParam
deviceData
,
Toke
toke
)
throws
Exception
{
//处理设备和巡检数据
//处理设备和巡检数据
deviceData
.
setNodeState
(
deviceData
.
getState
());
deviceData
.
setNodeState
(
deviceData
.
getState
());
FireEquipmentPoint
fireEquipmentPoint
=
iFireEquipmentPointDao
.
findOneByCode
(
deviceData
.
getPointCode
());
FireEquipmentPoint
fireEquipmentPoint
=
iFireEquipmentPointDao
.
findOneByCode
(
deviceData
.
getPointCode
());
...
@@ -744,20 +751,21 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -744,20 +751,21 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
equipment
=
impAndFireEquipMapper
.
queryImpEqumtByFireEquipmt
(
fireEquipmentPoint
.
getFireEquipmentId
());
equipment
=
impAndFireEquipMapper
.
queryImpEqumtByFireEquipmt
(
fireEquipmentPoint
.
getFireEquipmentId
());
if
(
equipment
!=
null
&&
"alarm_type_fire"
.
equals
(
fireEquipmentPointType
))
{
if
(
equipment
!=
null
&&
"alarm_type_fire"
.
equals
(
fireEquipmentPointType
))
{
//动态预案执行
//动态预案执行
dynamicPlan
(
deviceData
,
equipment
,
fireEquipment
,
fireEquipmentPointTyp
e
);
dynamicPlan
(
deviceData
,
equipment
,
fireEquipment
,
fireEquipmentPointType
,
tok
e
);
}
}
}
}
}
}
/**
/**
* 预案执行
* 预案执行
*
* @param deviceData
* @param deviceData
* @param equipment
* @param equipment
* @param fireEquipment
* @param fireEquipment
* @param fireEquipmentPointType
* @param fireEquipmentPointType
*/
*/
@Async
@Async
void
dynamicPlan
(
AlarmParam
deviceData
,
Equipment
equipment
,
FireEquipment
fireEquipment
,
String
fireEquipmentPointType
)
{
void
dynamicPlan
(
AlarmParam
deviceData
,
Equipment
equipment
,
FireEquipment
fireEquipment
,
String
fireEquipmentPointType
,
Toke
toke
)
{
String
batchNo
=
null
;
String
batchNo
=
null
;
Object
batch
=
null
;
Object
batch
=
null
;
Dict
dict
=
null
;
Dict
dict
=
null
;
...
@@ -789,6 +797,8 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -789,6 +797,8 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
Object
canBeRunning
=
redisTemplate
.
opsForValue
().
get
(
cacheKeyForCanBeRunning
());
Object
canBeRunning
=
redisTemplate
.
opsForValue
().
get
(
cacheKeyForCanBeRunning
());
if
(
canBeRunning
==
null
)
{
if
(
canBeRunning
==
null
)
{
try
{
try
{
RequestContext
.
setToken
(
toke
.
getToke
());
RequestContext
.
setProduct
(
toke
.
getProduct
());
alermContingency
(
batchNo
,
fireEquipment
,
equipment
);
alermContingency
(
batchNo
,
fireEquipment
,
equipment
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"调用规则失败"
,
e
);
log
.
error
(
"调用规则失败"
,
e
);
...
@@ -818,20 +828,20 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -818,20 +828,20 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
private
void
saveFireEquipmentData
(
FireEquipmentPoint
fireEquipmentPoint
,
FireEquipment
fireEquipment
,
AlarmParam
deviceData
,
String
fireEquipmentPointType
)
{
private
void
saveFireEquipmentData
(
FireEquipmentPoint
fireEquipmentPoint
,
FireEquipment
fireEquipment
,
AlarmParam
deviceData
,
String
fireEquipmentPointType
)
{
if
(
"alarm_type_fire"
.
equals
(
fireEquipmentPointType
)
||
"alarm_type_trouble"
.
equals
(
fireEquipmentPointType
))
{
if
(
"alarm_type_fire"
.
equals
(
fireEquipmentPointType
)
||
"alarm_type_trouble"
.
equals
(
fireEquipmentPointType
))
{
Alarm
alarm
=
iAlarmDao
.
findByStatusTrueAndFireEquipmentPointCode
(
deviceData
.
getPointCode
());
Alarm
alarm
=
iAlarmDao
.
findByStatusTrueAndFireEquipmentPointCode
(
deviceData
.
getPointCode
());
if
(
alarm
!=
null
)
{
if
(
alarm
!=
null
)
{
alarm
.
setFireEquipmentPointValue
(
deviceData
.
getState
());
alarm
.
setFireEquipmentPointValue
(
deviceData
.
getState
());
if
(
"false"
.
equals
(
deviceData
.
getState
()))
{
if
(
"false"
.
equals
(
deviceData
.
getState
()))
{
alarm
.
setRecoveryDate
(
new
Date
());
alarm
.
setRecoveryDate
(
new
Date
());
alarm
.
setStatus
(
false
);
alarm
.
setStatus
(
false
);
}
else
{
}
else
{
alarm
.
setFrequency
((
alarm
.
getFrequency
()+
1
));
alarm
.
setFrequency
((
alarm
.
getFrequency
()
+
1
));
alarm
.
setUpdateDate
(
new
Date
());
alarm
.
setUpdateDate
(
new
Date
());
}
}
iAlarmDao
.
save
(
alarm
);
iAlarmDao
.
save
(
alarm
);
}
else
{
}
else
{
if
(
"true"
.
equals
(
deviceData
.
getState
()))
{
if
(
"true"
.
equals
(
deviceData
.
getState
()))
{
alarm
=
new
Alarm
();
alarm
=
new
Alarm
();
alarm
.
setFireEquipmentCode
(
fireEquipment
.
getCode
());
alarm
.
setFireEquipmentCode
(
fireEquipment
.
getCode
());
alarm
.
setFireEquipmentId
(
fireEquipment
.
getId
());
alarm
.
setFireEquipmentId
(
fireEquipment
.
getId
());
...
@@ -845,17 +855,17 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -845,17 +855,17 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
iAlarmDao
.
save
(
alarm
);
iAlarmDao
.
save
(
alarm
);
}
}
}
}
if
(
alarm
!=
null
)
{
if
(
alarm
!=
null
)
{
if
(
"alarm_type_trouble"
.
equals
(
fireEquipmentPointType
))
{
if
(
"alarm_type_trouble"
.
equals
(
fireEquipmentPointType
))
{
//通知刷新3d页面相关故障数据
//通知刷新3d页面相关故障数据
notifyAlarm
(
fireEquipmentPoint
,
deviceData
);
notifyAlarm
(
fireEquipmentPoint
,
deviceData
);
}
else
{
}
else
{
//通知刷新3d页面告警数据
//通知刷新3d页面告警数据
iDataRefreshService
.
refreshViewData
(
DataRefreshTypeEum
.
alarm
.
getCode
());
iDataRefreshService
.
refreshViewData
(
DataRefreshTypeEum
.
alarm
.
getCode
());
}
}
}
}
}
else
{
}
else
{
if
(
"SWITCH"
.
equals
(
fireEquipmentPoint
.
getType
()))
{
//保存遥信信号数据到mysql中
if
(
"SWITCH"
.
equals
(
fireEquipmentPoint
.
getType
()))
{
//保存遥信信号数据到mysql中
FireEquipmentData
fireEquipmentData
=
new
FireEquipmentData
();
FireEquipmentData
fireEquipmentData
=
new
FireEquipmentData
();
fireEquipmentData
.
setEqPointCode
(
deviceData
.
getPointCode
());
fireEquipmentData
.
setEqPointCode
(
deviceData
.
getPointCode
());
fireEquipmentData
.
seteValue
(
deviceData
.
getState
());
fireEquipmentData
.
seteValue
(
deviceData
.
getState
());
...
@@ -885,7 +895,6 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -885,7 +895,6 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
}
}
@Override
@Override
public
void
saveData
(
List
<
AlarmParam
>
deviceDatas
,
String
type
)
{
public
void
saveData
(
List
<
AlarmParam
>
deviceDatas
,
String
type
)
{
List
<
EquipCommunicationData
>
list
=
deviceDatas
.
stream
().
map
(
param
->
{
List
<
EquipCommunicationData
>
list
=
deviceDatas
.
stream
().
map
(
param
->
{
...
@@ -962,10 +971,10 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -962,10 +971,10 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
if
(
ids
.
size
()
>
0
)
{
if
(
ids
.
size
()
>
0
)
{
fmeaEquipmentPointMapper
.
updateStateByIds
(
state
,
ids
);
fmeaEquipmentPointMapper
.
updateStateByIds
(
state
,
ids
);
}
}
final
Integer
st
=
state
;
final
Integer
st
=
state
;
String
monitor
=
fireEquipMapper
.
findById
(
fireEquipPointMapper
.
getByCode
(
param
.
getPointCode
()).
getFireEquipmentId
()).
getName
();
String
monitor
=
fireEquipMapper
.
findById
(
fireEquipPointMapper
.
getByCode
(
param
.
getPointCode
()).
getFireEquipmentId
()).
getName
();
RsDataQueue
rsDataQueue
=
RsDataQueue
.
getInstance
();
RsDataQueue
rsDataQueue
=
RsDataQueue
.
getInstance
();
fmeaIds
.
forEach
(
fmeaId
->
rsDataQueue
.
addEquipmentMessage
(
fmeaId
,
monitor
,
st
));
fmeaIds
.
forEach
(
fmeaId
->
rsDataQueue
.
addEquipmentMessage
(
fmeaId
,
monitor
,
st
));
}
}
}
}
...
@@ -1065,8 +1074,8 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -1065,8 +1074,8 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
if
(!
ObjectUtils
.
isEmpty
(
map
.
get
(
"area"
)))
{
if
(!
ObjectUtils
.
isEmpty
(
map
.
get
(
"area"
)))
{
area
=
Double
.
valueOf
(
map
.
get
(
"area"
).
toString
());
area
=
Double
.
valueOf
(
map
.
get
(
"area"
).
toString
());
}
}
String
maxlevel
=
map
.
get
(
"max_level"
)
!=
null
?
map
.
get
(
"max_level"
).
toString
():
"0.0"
;
String
maxlevel
=
map
.
get
(
"max_level"
)
!=
null
?
map
.
get
(
"max_level"
).
toString
()
:
"0.0"
;
String
level
=
map
.
get
(
"value"
)
!=
null
&&
StringUtil
.
isNumeric
(
map
.
get
(
"value"
).
toString
())?
String
.
format
(
"%.2f"
,
(
Double
.
valueOf
(
map
.
get
(
"value"
).
toString
()))):
maxlevel
;
String
level
=
map
.
get
(
"value"
)
!=
null
&&
StringUtil
.
isNumeric
(
map
.
get
(
"value"
).
toString
())
?
String
.
format
(
"%.2f"
,
(
Double
.
valueOf
(
map
.
get
(
"value"
).
toString
())))
:
maxlevel
;
String
volume
=
String
.
format
(
"%.2f"
,
Double
.
valueOf
(
level
)
*
area
);
String
volume
=
String
.
format
(
"%.2f"
,
Double
.
valueOf
(
level
)
*
area
);
if
(
hashOperations
.
size
(
"Analogue"
)
>
0
)
{
if
(
hashOperations
.
size
(
"Analogue"
)
>
0
)
{
...
@@ -1076,8 +1085,8 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -1076,8 +1085,8 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
continue
;
continue
;
}
}
EquipCommunicationData
data
=
(
EquipCommunicationData
)
hashOperations
.
get
(
"Analogue"
,
map
.
get
(
"CODE"
));
EquipCommunicationData
data
=
(
EquipCommunicationData
)
hashOperations
.
get
(
"Analogue"
,
map
.
get
(
"CODE"
));
map
.
put
(
"level"
,
StringUtil
.
isNumeric
(
data
.
getState
())?
data
.
getState
():
level
);
map
.
put
(
"level"
,
StringUtil
.
isNumeric
(
data
.
getState
())
?
data
.
getState
()
:
level
);
map
.
put
(
"volume"
,
String
.
format
(
"%.2f"
,
(
Double
.
valueOf
(
map
.
get
(
"level"
).
toString
())*
area
)));
map
.
put
(
"volume"
,
String
.
format
(
"%.2f"
,
(
Double
.
valueOf
(
map
.
get
(
"level"
).
toString
())
*
area
)));
}
else
{
}
else
{
map
.
put
(
"level"
,
level
);
map
.
put
(
"level"
,
level
);
map
.
put
(
"volume"
,
volume
);
map
.
put
(
"volume"
,
volume
);
...
@@ -1110,7 +1119,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -1110,7 +1119,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
* 修改、添加导致rpn、rpni改变
* 修改、添加导致rpn、rpni改变
*/
*/
@Override
@Override
public
void
notifyFmeaFromUpdate
(
String
toke
,
String
product
,
String
appKey
,
Long
fmeaId
,
String
nofityType
,
String
userName
)
{
public
void
notifyFmeaFromUpdate
(
String
toke
,
String
product
,
String
appKey
,
Long
fmeaId
,
String
nofityType
,
String
userName
)
{
Fmea
fmea
=
fmeaMapper
.
getById
(
fmeaId
);
Fmea
fmea
=
fmeaMapper
.
getById
(
fmeaId
);
if
(
fmea
==
null
)
{
if
(
fmea
==
null
)
{
return
;
return
;
...
@@ -1126,11 +1135,11 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -1126,11 +1135,11 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
//1.2未评价过,计算绑定的巡检点项 设备点位故障率
//1.2未评价过,计算绑定的巡检点项 设备点位故障率
if
(
fmea
.
getNewEvaluationOid
()
==
null
)
{
if
(
fmea
.
getNewEvaluationOid
()
==
null
)
{
EvaluationModel
evaluationModel
=
this
.
getEvaluationModel
(
fmeaId
);
EvaluationModel
evaluationModel
=
this
.
getEvaluationModel
(
fmeaId
);
if
(
evaluationModel
!=
null
)
{
//已经绑定点位或者巡检点项且匹配到风险模型,则更新为计算后的结果
if
(
evaluationModel
!=
null
)
{
//已经绑定点位或者巡检点项且匹配到风险模型,则更新为计算后的结果
BigDecimal
newOidValue
=
new
BigDecimal
(
evaluationModel
.
getCoefficient
());
BigDecimal
newOidValue
=
new
BigDecimal
(
evaluationModel
.
getCoefficient
());
rpn
=
newOidValue
.
multiply
(
sidValue
).
multiply
(
didValue
).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
);
rpn
=
newOidValue
.
multiply
(
sidValue
).
multiply
(
didValue
).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
);
fmea
.
setNewEvaluationOid
(
evaluationModel
.
getId
());
fmea
.
setNewEvaluationOid
(
evaluationModel
.
getId
());
}
else
{
//未绑定点位或者巡检点项或者匹配不到风险模型,则更新为rpn与rpni一致
}
else
{
//未绑定点位或者巡检点项或者匹配不到风险模型,则更新为rpn与rpni一致
fmea
.
setNewEvaluationOid
(
fmea
.
getEvaluationOid
());
fmea
.
setNewEvaluationOid
(
fmea
.
getEvaluationOid
());
rpn
=
rpni
;
rpn
=
rpni
;
}
}
...
@@ -1162,11 +1171,11 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -1162,11 +1171,11 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
}
}
}
}
private
JpushMsgBo
getJushMessageInfo
(
MsgParamBo
msgParam
){
private
JpushMsgBo
getJushMessageInfo
(
MsgParamBo
msgParam
)
{
JpushMsgBo
msgBo
=
new
JpushMsgBo
();
JpushMsgBo
msgBo
=
new
JpushMsgBo
();
Optional
<
RiskFactor
>
optional
=
iRiskFactorDao
.
findById
(
msgParam
.
getFmea
().
getRiskFactorsId
());
Optional
<
RiskFactor
>
optional
=
iRiskFactorDao
.
findById
(
msgParam
.
getFmea
().
getRiskFactorsId
());
if
(
optional
.
isPresent
())
{
if
(
optional
.
isPresent
())
{
JpushMsgContentBo
jpushMsgContentBo
=
new
JpushMsgContentBo
(
optional
.
get
().
getName
(),
msgParam
.
getNotifyType
());
JpushMsgContentBo
jpushMsgContentBo
=
new
JpushMsgContentBo
(
optional
.
get
().
getName
(),
msgParam
.
getNotifyType
());
jpushMsgContentBo
.
setExecute
(
msgParam
.
getUserName
());
jpushMsgContentBo
.
setExecute
(
msgParam
.
getUserName
());
jpushMsgContentBo
.
setLevelIsChange
(
msgParam
.
getLevelIsChange
());
jpushMsgContentBo
.
setLevelIsChange
(
msgParam
.
getLevelIsChange
());
jpushMsgContentBo
.
setLevel
(
msgParam
.
getLevel
());
jpushMsgContentBo
.
setLevel
(
msgParam
.
getLevel
());
...
@@ -1219,7 +1228,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -1219,7 +1228,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
@Override
@Override
public
void
notifyFmeaFromAbnormal
(
public
void
notifyFmeaFromAbnormal
(
String
toke
,
String
product
,
String
appKey
,
String
toke
,
String
product
,
String
appKey
,
Long
fmeaId
,
String
notifyType
,
String
userName
,
String
relationName
,
String
checkStatus
)
{
Long
fmeaId
,
String
notifyType
,
String
userName
,
String
relationName
,
String
checkStatus
)
{
Fmea
fmea
=
fmeaMapper
.
getById
(
fmeaId
);
Fmea
fmea
=
fmeaMapper
.
getById
(
fmeaId
);
if
(
fmea
==
null
)
{
if
(
fmea
==
null
)
{
return
;
return
;
...
@@ -1269,7 +1278,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -1269,7 +1278,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
}
}
}
}
private
void
saveRpnLog
(
Long
riskSourceId
,
Long
fmeaId
,
BigDecimal
rpn
,
BigDecimal
rpni
,
String
notifyType
)
{
private
void
saveRpnLog
(
Long
riskSourceId
,
Long
fmeaId
,
BigDecimal
rpn
,
BigDecimal
rpni
,
String
notifyType
)
{
RpnChangeLog
rpnChangeLog
=
new
RpnChangeLog
();
RpnChangeLog
rpnChangeLog
=
new
RpnChangeLog
();
rpnChangeLog
.
setRiskSourceId
(
riskSourceId
);
rpnChangeLog
.
setRiskSourceId
(
riskSourceId
);
rpnChangeLog
.
setRpn
(
rpn
);
rpnChangeLog
.
setRpn
(
rpn
);
...
@@ -1325,14 +1334,14 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -1325,14 +1334,14 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
if
(
rpnValueBo
.
isEmpty
())
{
if
(
rpnValueBo
.
isEmpty
())
{
return
;
return
;
}
}
Fmea
caluFmea
=
fmeaMapper
.
getById
(
fmeaId
);
Fmea
caluFmea
=
fmeaMapper
.
getById
(
fmeaId
);
Integer
rpnDiffer
=
0
;
Integer
rpnDiffer
=
0
;
if
(
caluFmea
!=
null
)
{
if
(
caluFmea
!=
null
)
{
rpnDiffer
=
caluFmea
.
getRpn
().
intValue
()-
caluFmea
.
getRpni
().
intValue
();
rpnDiffer
=
caluFmea
.
getRpn
().
intValue
()
-
caluFmea
.
getRpni
().
intValue
();
}
}
String
checkStatus
=
""
;
String
checkStatus
=
""
;
if
(
jpushMsgBo
!=
null
)
{
if
(
jpushMsgBo
!=
null
)
{
checkStatus
=
jpushMsgBo
.
getMsg
().
getCheckStatus
();
checkStatus
=
jpushMsgBo
.
getMsg
().
getCheckStatus
();
}
}
BigDecimal
rpn
=
rpnValueBo
.
getRpn
();
BigDecimal
rpn
=
rpnValueBo
.
getRpn
();
BigDecimal
rpni
=
rpnValueBo
.
getRpni
();
BigDecimal
rpni
=
rpnValueBo
.
getRpni
();
...
@@ -1343,8 +1352,8 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -1343,8 +1352,8 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
riskSource
.
setRpn
(
rpn
);
riskSource
.
setRpn
(
rpn
);
riskSource
.
setRpni
(
rpni
);
riskSource
.
setRpni
(
rpni
);
riskSource
.
setRiskLevelId
(
newRiskLevel
.
getId
());
riskSource
.
setRiskLevelId
(
newRiskLevel
.
getId
());
String
changeType
=
RpnUtils
.
calChangeTypeByLevel
(
oldRiskLevel
.
getLevel
(),
newRiskLevel
.
getLevel
());
String
changeType
=
RpnUtils
.
calChangeTypeByLevel
(
oldRiskLevel
.
getLevel
(),
newRiskLevel
.
getLevel
());
riskSource
.
setFlickerFrequency
(
RpnUtils
.
calRiskPointFrequency
(
rpn
,
rpni
,
changeType
));
riskSource
.
setFlickerFrequency
(
RpnUtils
.
calRiskPointFrequency
(
rpn
,
rpni
,
changeType
));
//1.更新fmea对应风险点rpn、rpni、level
//1.更新fmea对应风险点rpn、rpni、level
riskSourceMapper
.
updateRpn
(
riskSource
);
riskSourceMapper
.
updateRpn
(
riskSource
);
//2.记录风险点rpn变化流水
//2.记录风险点rpn变化流水
...
@@ -1353,12 +1362,12 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -1353,12 +1362,12 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
//3.更新父节点rpn、rpni、风险等级
//3.更新父节点rpn、rpni、风险等级
this
.
updateParentRpn
(
riskSource
.
getParentId
());
this
.
updateParentRpn
(
riskSource
.
getParentId
());
//4.极光推送给手机客户端
//4.极光推送给手机客户端
if
(
"recovery"
.
equals
(
notifyType
)
||
"fmeaUpdate"
.
equals
(
notifyType
)
||
(
"alarm"
.
equals
(
notifyType
)&&
rpnDiffer
>
0
)||(
"patrol"
.
equals
(
notifyType
)
&&
rpnDiffer
>
0
&&
CheckStatusEnum
.
UNQUALIFIED
.
getName
().
equals
(
checkStatus
)))
{
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.规则告警(消息)
//5.规则告警(消息)
if
(
"recovery"
.
equals
(
notifyType
)
||
"fmeaUpdate"
.
equals
(
notifyType
)
||
(
"alarm"
.
equals
(
notifyType
)&&
rpnDiffer
>
0
)
||(
notifyType
==
"patrol"
&&
rpnDiffer
>
0
&&
CheckStatusEnum
.
UNQUALIFIED
.
getName
().
equals
(
checkStatus
)))
{
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
());
...
@@ -1529,11 +1538,11 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -1529,11 +1538,11 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
riskSourceMapper
.
batchSaveRegionUe4
(
regionBoList
);
riskSourceMapper
.
batchSaveRegionUe4
(
regionBoList
);
}
}
private
EvaluationModel
getEvaluationModel
(
Long
fmeaId
){
private
EvaluationModel
getEvaluationModel
(
Long
fmeaId
)
{
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
=
RpnUtils
.
getMaxRate
(
equipmentPoints
,
pointInputitems
);
Double
maxRate
=
RpnUtils
.
getMaxRate
(
equipmentPoints
,
pointInputitems
);
if
(
maxRate
!=
null
)
{
if
(
maxRate
!=
null
)
{
List
<
EvaluationModel
>
oModels
=
iEvaluationModelDao
.
findAllByType
(
"O"
);
List
<
EvaluationModel
>
oModels
=
iEvaluationModelDao
.
findAllByType
(
"O"
);
EvaluationModel
oEvaluationModel
=
getBetweenModel
(
maxRate
,
oModels
);
EvaluationModel
oEvaluationModel
=
getBetweenModel
(
maxRate
,
oModels
);
return
oEvaluationModel
;
return
oEvaluationModel
;
...
...
YeeAmosFireAutoSysStart/src/main/resources/application.properties
View file @
340b3168
spring.application.name
=
Amos-autosys
-sqy
spring.application.name
=
Amos-autosys
server.port
=
8083
server.port
=
8083
...
@@ -52,3 +52,4 @@ windows.img.path = F:\\
...
@@ -52,3 +52,4 @@ windows.img.path = F:\\
linux.img.path = /
linux.img.path = /
param.safetyIndexChange.cron
=
0 0 2 * * ?
param.safetyIndexChange.cron
=
0 0 2 * * ?
param.weather.url
=
http://t.weather.sojson.com/api/weather/city/
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