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
3d4be07d
Commit
3d4be07d
authored
May 25, 2020
by
单奇雲
Browse files
Options
Browse Files
Download
Plain Diff
冲突
parents
13dcc79b
42a577ae
Show whitespace changes
Inline
Side-by-side
Showing
75 changed files
with
3230 additions
and
526 deletions
+3230
-526
ManageLevelEum.java
...ava/com/yeejoin/amos/fas/common/enums/ManageLevelEum.java
+1
-0
TriggerRpnChangeTypeEum.java
...eejoin/amos/fas/common/enums/TriggerRpnChangeTypeEum.java
+2
-1
Alarm.java
.../src/main/java/com/yeejoin/amos/fas/dao/entity/Alarm.java
+145
-47
FireEquipment.java
...n/java/com/yeejoin/amos/fas/dao/entity/FireEquipment.java
+7
-2
RiskSource.java
...main/java/com/yeejoin/amos/fas/dao/entity/RiskSource.java
+8
-8
RpnChangeLog.java
...in/java/com/yeejoin/amos/fas/dao/entity/RpnChangeLog.java
+1
-0
ContingencyAction.java
...m/yeejoin/amos/fas/business/action/ContingencyAction.java
+431
-0
CustomerAction.java
.../com/yeejoin/amos/fas/business/action/CustomerAction.java
+4
-0
AbstractActionResult.java
...amos/fas/business/action/result/AbstractActionResult.java
+29
-0
ActionResult.java
...yeejoin/amos/fas/business/action/result/ActionResult.java
+15
-0
BubbleTipResult.java
...join/amos/fas/business/action/result/BubbleTipResult.java
+23
-0
RiskSituationResult.java
.../amos/fas/business/action/result/RiskSituationResult.java
+23
-0
SimpleResult.java
...yeejoin/amos/fas/business/action/result/SimpleResult.java
+55
-0
TipResult.java
...om/yeejoin/amos/fas/business/action/result/TipResult.java
+23
-0
AbstractActionResultMessage.java
...ss/action/result/message/AbstractActionResultMessage.java
+78
-0
ActionResultMessage.java
...s/business/action/result/message/ActionResultMessage.java
+20
-0
BubbleTipResultMessage.java
...usiness/action/result/message/BubbleTipResultMessage.java
+20
-0
RiskSituationResultMessage.java
...ess/action/result/message/RiskSituationResultMessage.java
+20
-0
SimpleResultMessage.java
...s/business/action/result/message/SimpleResultMessage.java
+25
-0
TipResultMessage.java
.../fas/business/action/result/message/TipResultMessage.java
+20
-0
ReflectUtil.java
...om/yeejoin/amos/fas/business/action/util/ReflectUtil.java
+363
-0
RuleWebSocket.java
...oin/amos/fas/business/action/websocket/RuleWebSocket.java
+169
-0
JpushMsgBo.java
...ain/java/com/yeejoin/amos/fas/business/bo/JpushMsgBo.java
+33
-0
JpushMsgContentBo.java
...a/com/yeejoin/amos/fas/business/bo/JpushMsgContentBo.java
+173
-0
MsgParamBo.java
...ain/java/com/yeejoin/amos/fas/business/bo/MsgParamBo.java
+110
-0
SafetyExecuteBo.java
...ava/com/yeejoin/amos/fas/business/bo/SafetyExecuteBo.java
+7
-0
BaseController.java
.../yeejoin/amos/fas/business/controller/BaseController.java
+0
-1
CommonController.java
...eejoin/amos/fas/business/controller/CommonController.java
+2
-2
FireEquimtPointController.java
...os/fas/business/controller/FireEquimtPointController.java
+1
-1
FireSourceController.java
...in/amos/fas/business/controller/FireSourceController.java
+0
-1
RiskLevelController.java
...oin/amos/fas/business/controller/RiskLevelController.java
+15
-9
RiskModelController.java
...oin/amos/fas/business/controller/RiskModelController.java
+2
-2
RiskSourceController.java
...in/amos/fas/business/controller/RiskSourceController.java
+1
-6
View3dController.java
...eejoin/amos/fas/business/controller/View3dController.java
+7
-39
RuleRuningSnapshotMapper.java
...mos/fas/business/dao/mapper/RuleRuningSnapshotMapper.java
+12
-0
View3dMapper.java
...om/yeejoin/amos/fas/business/dao/mapper/View3dMapper.java
+29
-0
IAlarmDao.java
...m/yeejoin/amos/fas/business/dao/repository/IAlarmDao.java
+1
-0
RemoteSecurityService.java
...eejoin/amos/fas/business/feign/RemoteSecurityService.java
+39
-50
AppMessagePushService.java
...eejoin/amos/fas/business/jpush/AppMessagePushService.java
+4
-11
AccidentTypeServiceImpl.java
...os/fas/business/service/impl/AccidentTypeServiceImpl.java
+22
-25
ContingencyInstanceImpl.java
...os/fas/business/service/impl/ContingencyInstanceImpl.java
+5
-0
EquipmentServiceImpl.java
.../amos/fas/business/service/impl/EquipmentServiceImpl.java
+4
-4
FireCarServiceImpl.java
...in/amos/fas/business/service/impl/FireCarServiceImpl.java
+6
-9
FireEquipPointServiceImpl.java
.../fas/business/service/impl/FireEquipPointServiceImpl.java
+5
-1
FmeaServiceImpl.java
...ejoin/amos/fas/business/service/impl/FmeaServiceImpl.java
+29
-70
RiskFactorServiceImpl.java
...amos/fas/business/service/impl/RiskFactorServiceImpl.java
+27
-30
RiskLevelServiceImpl.java
.../amos/fas/business/service/impl/RiskLevelServiceImpl.java
+16
-16
RiskSourceServiceImpl.java
...amos/fas/business/service/impl/RiskSourceServiceImpl.java
+197
-129
RuleRunigSnapshotServiceImpl.java
...s/business/service/impl/RuleRunigSnapshotServiceImpl.java
+198
-0
View3dServiceImpl.java
...oin/amos/fas/business/service/impl/View3dServiceImpl.java
+52
-28
IContingencyInstance.java
...amos/fas/business/service/intfc/IContingencyInstance.java
+1
-1
IFmeaService.java
...yeejoin/amos/fas/business/service/intfc/IFmeaService.java
+1
-1
IRiskSourceService.java
...n/amos/fas/business/service/intfc/IRiskSourceService.java
+4
-3
IRuleRunningSnapshotService.java
...s/business/service/intfc/IRuleRunningSnapshotService.java
+19
-0
IView3dService.java
...ejoin/amos/fas/business/service/intfc/IView3dService.java
+1
-1
ProtalDataRo.java
...yeejoin/amos/fas/business/service/model/ProtalDataRo.java
+13
-0
RuleRuningSnapshot.java
...n/amos/fas/business/service/model/RuleRuningSnapshot.java
+129
-0
ToipResponse.java
...yeejoin/amos/fas/business/service/model/ToipResponse.java
+123
-0
ExceptionRegionVo.java
...a/com/yeejoin/amos/fas/business/vo/ExceptionRegionVo.java
+17
-0
FmeaMessage.java
.../java/com/yeejoin/amos/fas/client/invoke/FmeaMessage.java
+52
-0
RsDataQueue.java
.../java/com/yeejoin/amos/fas/client/invoke/RsDataQueue.java
+17
-11
StringUtil.java
.../main/java/com/yeejoin/amos/fas/core/util/StringUtil.java
+3
-2
application-dev.properties
...utoSysStart/src/main/resources/application-dev.properties
+16
-3
application-docker.properties
...SysStart/src/main/resources/application-docker.properties
+14
-1
application-test.properties
...toSysStart/src/main/resources/application-test.properties
+14
-1
application.properties
...ireAutoSysStart/src/main/resources/application.properties
+1
-1
fas-2.0.1.xml
...utoSysStart/src/main/resources/db/changelog/fas-2.0.1.xml
+40
-0
fas-sql-task.xml
...SysStart/src/main/resources/db/changelog/fas-sql-task.xml
+15
-0
fas-init-data.sql
...rt/src/main/resources/db/changelog/init/fas-init-data.sql
+181
-0
dbTemplate_fire_equippoint.xml
...c/main/resources/db/mapper/dbTemplate_fire_equippoint.xml
+2
-5
dbTemplate_risk_level.xml
...rt/src/main/resources/db/mapper/dbTemplate_risk_level.xml
+1
-0
dbTemplate_risk_source.xml
...t/src/main/resources/db/mapper/dbTemplate_risk_source.xml
+4
-3
dbTemplate_rule_runing_snapshot.xml
...n/resources/db/mapper/dbTemplate_rule_runing_snapshot.xml
+16
-0
dbTemplate_view3d.xml
...sStart/src/main/resources/db/mapper/dbTemplate_view3d.xml
+62
-1
pom.xml
pom.xml
+5
-0
No files found.
YeeAmosFireAutoSysCommon/src/main/java/com/yeejoin/amos/fas/common/enums/ManageLevelEum.java
View file @
3d4be07d
...
...
@@ -59,3 +59,4 @@ public enum ManageLevelEum {
this
.
manageLevel
=
manageLevel
;
}
}
YeeAmosFireAutoSysCommon/src/main/java/com/yeejoin/amos/fas/common/enums/TriggerRpnChangeTypeEum.java
View file @
3d4be07d
...
...
@@ -9,7 +9,8 @@ public enum TriggerRpnChangeTypeEum {
* 触发类型枚举
*/
patrol
(
"巡检"
,
"patrol"
),
equipment
(
"设备告警"
,
"equipment"
),
alarm
(
"设备告警"
,
"alarm"
),
alarmRecovery
(
"设备告警恢复"
,
"recovery"
),
fmeaUpdate
(
"危险因素评价"
,
"fmeaUpdate"
),
fmeaDelete
(
"危险因素删除"
,
"fmeaDelete"
),
riskDelete
(
"风险点删除"
,
"riskDelete"
);
...
...
YeeAmosFireAutoSysCommon/src/main/java/com/yeejoin/amos/fas/dao/entity/Alarm.java
View file @
3d4be07d
...
...
@@ -18,53 +18,79 @@ import java.util.Date;
@NamedQuery
(
name
=
"Alarm.findAll"
,
query
=
"SELECT a FROM Alarm a"
)
public
class
Alarm
extends
BasicEntity
{
private
static
final
long
serialVersionUID
=
1L
;
@Temporal
(
TemporalType
.
TIMESTAMP
)
@Column
(
name
=
"alarm_time"
)
private
Date
alarmTime
;
/**
*
指标或者报警信息
*
消防设备id
*/
@Lob
private
String
metric
;
private
String
code
;
@Column
(
name
=
"fire_equipment_id"
)
private
Long
fireEquipmentId
;
/**
* 消防设备名称
*/
@Column
(
name
=
"fire_equipment_name"
)
private
String
fireEquipmentName
;
/**
* 消防设备编码
*/
@Column
(
name
=
"fire_equipment_code"
)
private
String
fireEquipmentCode
;
/**
* 消防点位id
*/
@Column
(
name
=
"fire_equipment_point_id"
)
private
Long
fireEquipmentPointId
;
/**
* 消防点位名称
*/
@Column
(
name
=
"fire_equipment_point_name"
)
private
String
fireEquipmentPointName
;
/**
* 消防点位编码
*/
@Column
(
name
=
"fire_equipment_point_code"
)
private
String
fireEquipmentPointCode
;
/**
* 消防点位上传值
*/
@Column
(
name
=
"fire_equipment_point_value"
)
private
String
fireEquipmentPointValue
;
/**
*
报警类别
*
发生频率
*/
@Column
(
name
=
"alarm_type"
)
private
String
alarmType
;
@Column
(
name
=
"frequency"
)
private
int
frequency
=
1
;
/**
* 告警状态
*/
@Column
(
name
=
"status"
)
private
Boolean
status
=
true
;
/**
* 报警类型:alarm_type_fire(火灾报警)/alarm_type_trouble(故障告警)
*/
@Column
(
name
=
"type"
)
private
String
type
;
/**
* 创建时间
*/
@Column
(
name
=
"create_date"
)
private
Date
createDate
=
new
Date
();
/**
* 更新时间
*/
@Column
(
name
=
"update_date"
)
private
Date
updateDate
=
new
Date
();
/**
* 告警恢复时间
*/
@Column
(
name
=
"recovery_date"
)
private
Date
recoveryDate
;
@Column
(
name
=
"fire_equipment_id"
)
private
Long
fireEquipmentId
;
@Column
(
name
=
"org_code"
)
private
String
orgCode
;
private
String
remark
;
public
Alarm
()
{
}
public
Date
getAlarmTime
()
{
return
this
.
alarmTime
;
}
public
void
setAlarmTime
(
Date
alarmTime
)
{
this
.
alarmTime
=
alarmTime
;
}
public
String
getCode
()
{
return
this
.
code
;
}
public
void
setCode
(
String
code
)
{
this
.
code
=
code
;
}
public
Long
getFireEquipmentId
()
{
return
this
.
fireEquipmentId
;
}
...
...
@@ -81,28 +107,99 @@ public class Alarm extends BasicEntity {
this
.
orgCode
=
orgCode
;
}
public
String
getRemark
()
{
return
this
.
remark
;
public
String
getFireEquipmentName
()
{
return
fireEquipmentName
;
}
public
void
setFireEquipmentName
(
String
fireEquipmentName
)
{
this
.
fireEquipmentName
=
fireEquipmentName
;
}
public
String
getFireEquipmentCode
()
{
return
fireEquipmentCode
;
}
public
void
setFireEquipmentCode
(
String
fireEquipmentCode
)
{
this
.
fireEquipmentCode
=
fireEquipmentCode
;
}
public
Long
getFireEquipmentPointId
()
{
return
fireEquipmentPointId
;
}
public
void
setRemark
(
String
remark
)
{
this
.
remark
=
remark
;
public
void
setFireEquipmentPointId
(
Long
fireEquipmentPointId
)
{
this
.
fireEquipmentPointId
=
fireEquipmentPointId
;
}
public
String
getMetric
()
{
return
metric
;
public
String
getFireEquipmentPointName
()
{
return
fireEquipmentPointName
;
}
public
void
setMetric
(
String
metric
)
{
this
.
metric
=
metric
;
public
void
setFireEquipmentPointName
(
String
fireEquipmentPointName
)
{
this
.
fireEquipmentPointName
=
fireEquipmentPointName
;
}
public
String
getAlarmTyp
e
()
{
return
alarmTyp
e
;
public
String
getFireEquipmentPointCod
e
()
{
return
fireEquipmentPointCod
e
;
}
public
void
setAlarmType
(
String
alarmTyp
e
)
{
this
.
alarmType
=
alarmTyp
e
;
public
void
setFireEquipmentPointCode
(
String
fireEquipmentPointCod
e
)
{
this
.
fireEquipmentPointCode
=
fireEquipmentPointCod
e
;
}
public
String
getFireEquipmentPointValue
()
{
return
fireEquipmentPointValue
;
}
public
void
setFireEquipmentPointValue
(
String
fireEquipmentPointValue
)
{
this
.
fireEquipmentPointValue
=
fireEquipmentPointValue
;
}
public
int
getFrequency
()
{
return
frequency
;
}
public
void
setFrequency
(
int
frequency
)
{
this
.
frequency
=
frequency
;
}
public
Boolean
getStatus
()
{
return
status
;
}
public
void
setStatus
(
Boolean
status
)
{
this
.
status
=
status
;
}
public
String
getType
()
{
return
type
;
}
public
void
setType
(
String
type
)
{
this
.
type
=
type
;
}
public
Date
getCreateDate
()
{
return
createDate
;
}
public
void
setCreateDate
(
Date
createDate
)
{
this
.
createDate
=
createDate
;
}
public
Date
getUpdateDate
()
{
return
updateDate
;
}
public
void
setUpdateDate
(
Date
updateDate
)
{
this
.
updateDate
=
updateDate
;
}
public
Date
getRecoveryDate
()
{
return
recoveryDate
;
}
public
void
setRecoveryDate
(
Date
recoveryDate
)
{
this
.
recoveryDate
=
recoveryDate
;
}
}
\ No newline at end of file
YeeAmosFireAutoSysCommon/src/main/java/com/yeejoin/amos/fas/dao/entity/FireEquipment.java
View file @
3d4be07d
package
com
.
yeejoin
.
amos
.
fas
.
dao
.
entity
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
java.math.BigDecimal
;
import
java.util.Date
;
...
...
@@ -39,7 +42,8 @@ public class FireEquipment extends BasicEntity {
@Column
(
name
=
"create_by"
)
private
String
createBy
;
@Temporal
(
TemporalType
.
DATE
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
)
@Column
(
name
=
"effective_date"
)
private
Date
effectiveDate
;
...
...
@@ -66,7 +70,8 @@ public class FireEquipment extends BasicEntity {
@Column
(
name
=
"production_area"
)
private
String
productionArea
;
@Temporal
(
TemporalType
.
DATE
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
)
@Column
(
name
=
"production_date"
)
private
Date
productionDate
;
...
...
YeeAmosFireAutoSysCommon/src/main/java/com/yeejoin/amos/fas/dao/entity/RiskSource.java
View file @
3d4be07d
...
...
@@ -95,14 +95,6 @@ public class RiskSource extends BasicEntity {
return
rpni
;
}
public
Integer
getFlickerFrequency
()
{
return
flickerFrequency
;
}
public
void
setFlickerFrequency
(
Integer
flickerFrequency
)
{
this
.
flickerFrequency
=
flickerFrequency
;
}
public
void
setRpni
(
BigDecimal
rpni
)
{
this
.
rpni
=
rpni
;
}
...
...
@@ -111,6 +103,14 @@ public class RiskSource extends BasicEntity {
return
increment
;
}
public
Integer
getFlickerFrequency
()
{
return
flickerFrequency
;
}
public
void
setFlickerFrequency
(
Integer
flickerFrequency
)
{
this
.
flickerFrequency
=
flickerFrequency
;
}
public
void
setIncrement
(
BigDecimal
increment
)
{
this
.
increment
=
increment
;
}
...
...
YeeAmosFireAutoSysCommon/src/main/java/com/yeejoin/amos/fas/dao/entity/RpnChangeLog.java
View file @
3d4be07d
...
...
@@ -32,6 +32,7 @@ public class RpnChangeLog extends BasicEntity {
/**
* 触发变化类型(巡检、告警、评价、删除)
* 变化类型(巡检、评价、告警)
*/
@Column
(
name
=
"trigger_type"
)
private
String
triggerType
;
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/action/ContingencyAction.java
0 → 100644
View file @
3d4be07d
package
com
.
yeejoin
.
amos
.
fas
.
business
.
action
;
import
java.io.IOException
;
import
java.lang.reflect.Constructor
;
import
java.lang.reflect.Field
;
import
java.lang.reflect.Method
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.http.HttpEntity
;
import
org.springframework.http.HttpMethod
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.web.client.RestTemplate
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.yeejoin.amos.fas.business.action.result.ActionResult
;
import
com.yeejoin.amos.fas.business.action.result.BubbleTipResult
;
import
com.yeejoin.amos.fas.business.action.result.message.ActionResultMessage
;
import
com.yeejoin.amos.fas.business.service.impl.FireStrengthServiceImpl
;
import
com.yeejoin.amos.fas.business.service.intfc.FireStengthService
;
import
com.yeejoin.amos.fas.business.service.intfc.IContingencyInstance
;
import
com.yeejoin.amos.fas.business.service.model.ContingencyRo
;
import
com.yeejoin.amos.fas.business.util.StringUtil
;
import
com.yeejoin.amos.fas.dao.entity.ContingencyPlanInstance
;
import
com.yeejoin.amos.fas.dao.entity.FireStrength
;
@Component
public
class
ContingencyAction
implements
CustomerAction
{
private
static
String
PACKAGEURL
=
"com.yeejoin.amos.rule.map.action.result.message."
;
@Autowired
private
IContingencyInstance
iContingencyInstance
;
@Autowired
private
FireStengthService
fireStrengthService
;
private
RestTemplate
restTemplate
=
new
RestTemplate
();
@Value
(
"${bussunis.domain}"
)
private
String
bussunisDomain
;
private
static
Map
<
String
,
String
>
OPERATE_RECORD_ID
=
new
HashMap
<>();
private
static
Map
<
String
,
Map
<
String
,
String
>>
stringStringMap
=
new
HashMap
<>();
static
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"HH:mm:ss"
);
//当值值班长(S1)、副值班长(S2)、值班员(A1,A2,A3)、白班值班员、保安人员、驻站消防队长(F1)
/* private static Map<String, String> positionMap = new HashMap<String, String>() {{
put("S1", "S1");
put("S2", "S2");
put("A1", "A1");
put("A2", "A2");
put("A3", "A3");
put("F1", "F1");
}};
*/
private
Map
<
String
,
String
>
getStrengthMap
(
String
batchNo
)
{
Map
<
String
,
String
>
returnMap
=
stringStringMap
.
get
(
batchNo
);
if
(
CollectionUtils
.
isEmpty
(
returnMap
))
{
stringStringMap
=
new
HashMap
<>();
returnMap
=
new
HashMap
<>();
Date
now
=
new
Date
();
String
time
=
sdf
.
format
(
now
);
List
<
FireStrength
>
strengths
=
null
;
//fireStrengthService.
// List<FireStrength> strengths = iStrengthRepository.queryForStrengthList(time);
if
(!
CollectionUtils
.
isEmpty
(
strengths
))
{
for
(
FireStrength
fireStrength
:
strengths
)
{
String
name
=
returnMap
.
get
(
fireStrength
.
getPosition
());
if
(
StringUtil
.
isNotEmpty
(
name
))
{
returnMap
.
put
(
fireStrength
.
getPosition
(),
name
+
"、"
+
fireStrength
.
getUsername
());
}
else
{
returnMap
.
put
(
fireStrength
.
getPosition
(),
fireStrength
.
getUsername
());
}
}
}
stringStringMap
.
put
(
batchNo
,
returnMap
);
}
return
returnMap
;
}
public
void
sendcmd
(
String
firstStr
,
String
secondStr
,
String
thirdStr
,
BubbleTipResult
result
)
{
Constructor
<?>
constructor
;
try
{
constructor
=
Class
.
forName
(
PACKAGEURL
+
result
.
getClass
().
getSimpleName
()
+
"Message"
)
.
getConstructor
(
ActionResult
.
class
);
ActionResultMessage
<?>
action
=
(
ActionResultMessage
<?>)
constructor
.
newInstance
(
result
);
action
.
execute
(
firstStr
,
secondStr
,
thirdStr
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
/**
* @param stepCode 当前步骤编号
* @param stepName 当前步骤名称
* @param state 当前步骤状态
* @param nextStepCode 下一步编号
* @param nextStepName 下一步名称
* @param stepType 步骤类型,总览步骤、详细步骤
* @param paramObj 预案对象
*/
public
void
stepInfo
(
String
stepCode
,
String
stepName
,
String
state
,
String
nextStepCode
,
String
nextStepName
,
String
stepType
,
Object
paramObj
)
{
ContingencyRo
contingencyRo
=
(
ContingencyRo
)
paramObj
;
stopSnapshop
(
contingencyRo
);
BubbleTipResult
result
=
new
BubbleTipResult
();
Map
<
String
,
Object
>
tempmap1
=
new
HashMap
<>();
tempmap1
.
put
(
"stepCode"
,
stepCode
);
tempmap1
.
put
(
"stepName"
,
stepName
);
tempmap1
.
put
(
"state"
,
state
);
tempmap1
.
put
(
"nextStepCode"
,
nextStepCode
);
tempmap1
.
put
(
"nextStepName"
,
nextStepName
);
tempmap1
.
put
(
"batchNo"
,
contingencyRo
.
getBatchNo
());
tempmap1
.
put
(
"contingencyRo"
,
contingencyRo
);
result
.
add
(
tempmap1
);
this
.
sendcmd
(
"fromws"
,
"stepArea"
,
stepType
,
result
);
}
/**
* @param stepCode 当前步骤编号
* @param paramObj 预案对象
*/
public
void
saveStepInfo
(
String
stepCode
,
Object
paramObj
)
{
ContingencyRo
contingencyRo
=
(
ContingencyRo
)
paramObj
;
iContingencyInstance
.
updateStep
(
stepCode
,
contingencyRo
.
getBatchNo
());
}
/**
* @param content 消息内容
* @param paramObj 预案对象
*/
public
void
messageRecord
(
String
content
,
Object
paramObj
)
{
ContingencyRo
contingencyRo
=
(
ContingencyRo
)
paramObj
;
stopSnapshop
(
contingencyRo
);
//转换content中的变量
content
=
instedParams
(
content
,
contingencyRo
);
BubbleTipResult
result
=
new
BubbleTipResult
();
Map
<
String
,
Object
>
tempmap1
=
new
HashMap
<>();
tempmap1
.
put
(
"refresh"
,
"refresh"
);
tempmap1
.
put
(
"batchNo"
,
contingencyRo
.
getBatchNo
());
result
.
add
(
tempmap1
);
iContingencyInstance
.
createInstanceRecord
(
contingencyRo
.
getBatchNo
(),
""
,
"DEFAULT"
,
content
,
"MESSAGE"
,
""
);
this
.
sendcmd
(
"fromws"
,
"recordArea"
,
"refresh"
,
result
);
}
/**
* <pre>
* 智能辅助
* </pre>
*
* @param step 当前步骤
* @param icon 图标
* @param title 标题
* @param image 图片集合
* @param table 表格
* @param content 内容
* @param paramObj 预案对象
*/
public
void
help
(
String
step
,
String
icon
,
String
title
,
String
image
,
String
table
,
String
content
,
Object
paramObj
)
{
ContingencyRo
contingencyRo
=
(
ContingencyRo
)
paramObj
;
stopSnapshop
(
contingencyRo
);
//转换智能辅助中的变量
content
=
instedParams
(
content
,
contingencyRo
);
BubbleTipResult
result
=
new
BubbleTipResult
();
Map
<
String
,
Object
>
tempmap1
=
new
HashMap
<>();
tempmap1
.
put
(
"icon"
,
icon
);
tempmap1
.
put
(
"step"
,
step
);
tempmap1
.
put
(
"title"
,
title
);
tempmap1
.
put
(
"content"
,
content
);
tempmap1
.
put
(
"image"
,
image
);
tempmap1
.
put
(
"table"
,
table
);
tempmap1
.
put
(
"batchNo"
,
contingencyRo
.
getBatchNo
());
tempmap1
.
put
(
"contingencyRo"
,
contingencyRo
);
result
.
add
(
tempmap1
);
this
.
sendcmd
(
"fromws"
,
"helpArea"
,
""
,
result
);
}
private
String
instedParams
(
String
content
,
ContingencyRo
contingencyRo
)
{
Map
<
String
,
String
>
strengthMap
=
this
.
getStrengthMap
(
contingencyRo
.
getBatchNo
());
for
(
String
key
:
strengthMap
.
keySet
())
content
=
content
.
replaceAll
(
"\\$\\{"
+
key
+
"}"
,
strengthMap
.
get
(
key
));
/* for (String key : positionMap.keySet())
c ontent = content.replaceAll("\\$\\{" + key + "}", positionMap.get(key));
*/
Field
[]
fields
=
contingencyRo
.
getClass
().
getDeclaredFields
();
Method
getMethod
=
null
;
try
{
for
(
Field
field
:
fields
)
{
if
(
field
.
getName
().
equals
(
"serialVersionUID"
))
continue
;
String
fileNameInMethod
=
String
.
valueOf
(
field
.
getName
().
charAt
(
0
)).
toUpperCase
()
+
field
.
getName
().
substring
(
1
);
getMethod
=
contingencyRo
.
getClass
().
getMethod
(
"get"
+
fileNameInMethod
);
String
value
=
String
.
valueOf
(
getMethod
.
invoke
(
contingencyRo
));
content
=
content
.
replaceAll
(
"\\$\\{"
+
field
.
getName
()
+
"}"
,
value
);
}
content
=
content
.
replaceAll
(
"\\$\\{"
,
""
);
content
=
content
.
replaceAll
(
"}"
,
""
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
content
;
}
/**
* 交互动作
*
* @param actionName 动作名称
* @param icon 图标
* @param tips 提示信息
* @param buttonJson 按钮json字符串
* @param paramObj 预案对象
*/
public
void
operation
(
String
actionName
,
String
icon
,
String
tips
,
String
buttonJson
,
Object
paramObj
)
{
ContingencyRo
contingencyRo
=
(
ContingencyRo
)
paramObj
;
stopSnapshop
(
contingencyRo
);
//转换content中的变量
tips
=
instedParams
(
tips
,
contingencyRo
);
BubbleTipResult
result
=
new
BubbleTipResult
();
Map
<
String
,
Object
>
tempmap1
=
new
HashMap
<>();
String
contingencyPlanId
=
getContingencyPlanId
(
contingencyRo
.
getBatchNo
(),
actionName
,
icon
,
tips
,
buttonJson
);
tempmap1
.
put
(
"actionName"
,
actionName
);
tempmap1
.
put
(
"icon"
,
icon
);
tempmap1
.
put
(
"tips"
,
tips
);
tempmap1
.
put
(
"buttonJson"
,
buttonJson
);
tempmap1
.
put
(
"batchNo"
,
contingencyRo
.
getBatchNo
());
tempmap1
.
put
(
"contingencyRo"
,
contingencyRo
);
tempmap1
.
put
(
"contingencyPlanId"
,
contingencyPlanId
);
result
.
add
(
tempmap1
);
this
.
sendcmd
(
"fromws"
,
"optionArea"
,
""
,
result
);
sendButton
(
contingencyRo
.
getBatchNo
(),
contingencyPlanId
,
contingencyRo
.
getEquipmentId
(),
actionName
,
buttonJson
);
}
private
boolean
sendButton
(
String
batchNo
,
String
contingencyPlanId
,
String
equipmentId
,
String
actionName
,
String
buttonJson
)
{
String
url
=
bussunisDomain
+
"/api/risksource/contingency/setup"
;
ObjectMapper
objectMapper
=
new
ObjectMapper
();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
/**
* batchNo
* stepCode
* buttonCode
* confirm
* contingencyPlanId
* stepState
*/
try
{
Map
button
=
objectMapper
.
readValue
(
buttonJson
,
Map
.
class
);
Map
operateInstance
=
(
Map
)((
List
)
button
.
get
(
"operate"
)).
get
(
0
);
map
.
put
(
"batchNo"
,
batchNo
);
map
.
put
(
"actionName"
,
actionName
);
map
.
put
(
"equipmentId"
,
equipmentId
);
map
.
put
(
"stepCode"
,
button
.
get
(
"stepCode"
));
map
.
put
(
"buttonCode"
,
operateInstance
.
get
(
"code"
));
map
.
put
(
"confirm"
,
"CONFIRM"
);
map
.
put
(
"stepState"
,
operateInstance
.
get
(
"stepState"
));
map
.
put
(
"contingencyPlanId"
,
contingencyPlanId
);
HttpEntity
<
Map
>
entity
=
new
HttpEntity
<>(
map
);
restTemplate
.
exchange
(
url
,
HttpMethod
.
POST
,
entity
,
Map
.
class
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
return
false
;
}
/**
* 保存交互动作
*
* @param actionName 动作名称
* @param icon 图标
* @param tips 提示信息
* @param buttonJson 按钮json字符串
* @param paramObj 预案对象
*/
public
void
saveOperation
(
String
actionName
,
String
icon
,
String
tips
,
String
buttonJson
,
Object
paramObj
)
{
ContingencyRo
contingencyRo
=
(
ContingencyRo
)
paramObj
;
stopSnapshop
(
contingencyRo
);
//转换content中的变量
tips
=
instedParams
(
tips
,
contingencyRo
);
BubbleTipResult
result1
=
new
BubbleTipResult
();
Map
<
String
,
Object
>
tempmap2
=
new
HashMap
<>();
tempmap2
.
put
(
"refresh"
,
"refresh"
);
tempmap2
.
put
(
"batchNo"
,
contingencyRo
.
getBatchNo
());
result1
.
add
(
tempmap2
);
String
contingencyPlanId
=
getContingencyPlanId
(
contingencyRo
.
getBatchNo
(),
actionName
,
icon
,
tips
,
buttonJson
);
this
.
sendcmd
(
"fromws"
,
"recordArea"
,
"refresh"
,
result1
);
}
private
String
getContingencyPlanId
(
String
batchNo
,
String
actionName
,
String
icon
,
String
tips
,
String
buttonJson
)
{
String
cacheKey
=
batchNo
+
actionName
;
String
contingencyPlanId
=
null
;
ContingencyPlanInstance
contingencyPlanInstance
=
null
;
if
(
OPERATE_RECORD_ID
.
get
(
cacheKey
)
==
null
)
{
contingencyPlanInstance
=
iContingencyInstance
.
createInstanceRecord
(
batchNo
,
actionName
,
"DEFAULT"
,
buttonJson
,
"OPERATE"
,
icon
);
contingencyPlanId
=
contingencyPlanInstance
.
getId
();
OPERATE_RECORD_ID
.
put
(
cacheKey
,
contingencyPlanId
);
}
else
{
contingencyPlanId
=
OPERATE_RECORD_ID
.
get
(
cacheKey
);
OPERATE_RECORD_ID
.
remove
(
cacheKey
);
}
return
contingencyPlanId
;
}
/**
* 地图动作推送
*
* @param actionName 动作名称标识
* @param paramObj 预案对象
*/
public
void
mapAction
(
String
actionName
,
Object
paramObj
)
{
ContingencyRo
contingencyRo
=
(
ContingencyRo
)
paramObj
;
stopSnapshop
(
contingencyRo
);
BubbleTipResult
result
=
new
BubbleTipResult
();
Map
<
String
,
Object
>
tempmap1
=
new
HashMap
<>();
tempmap1
.
put
(
"actionName"
,
actionName
);
tempmap1
.
put
(
"batchNo"
,
contingencyRo
.
getBatchNo
());
tempmap1
.
put
(
"contingencyRo"
,
contingencyRo
);
result
.
add
(
tempmap1
);
this
.
sendcmd
(
"fromws"
,
"mapArea"
,
actionName
,
result
);
}
/**
* 顶部消息提示
*
* @param content 消息内容
* @param messageType 消息类型 messageType 黑色框消息类型CONTINGENCY,,滚动消息:CURRENTMESSAGE
* @param paramObj 预案对象
*/
public
void
topMessage
(
String
content
,
String
messageType
,
Object
paramObj
)
{
ContingencyRo
contingencyRo
=
(
ContingencyRo
)
paramObj
;
stopSnapshop
(
contingencyRo
);
BubbleTipResult
result
=
new
BubbleTipResult
();
Map
<
String
,
Object
>
tempmap1
=
new
HashMap
<>();
//转换content中的变量
content
=
instedParams
(
content
,
contingencyRo
);
tempmap1
.
put
(
"content"
,
content
);
tempmap1
.
put
(
"messageType"
,
messageType
);
//消息类型 messageType 黑色框消息类型 CONTINGENCY,,滚动消息:CURRENTMESSAGE
tempmap1
.
put
(
"batchNo"
,
contingencyRo
.
getBatchNo
());
tempmap1
.
put
(
"contingencyRo"
,
contingencyRo
);
result
.
add
(
tempmap1
);
this
.
sendcmd
(
"fromws"
,
"topArea"
,
messageType
,
result
);
}
private
void
stopSnapshop
(
ContingencyRo
contingencyRo
)
{
// if (RuleRunigSnapshotServiceImpl.getReplayBatchNo() != null && !RuleRunigSnapshotServiceImpl.getReplayBatchNo().equals(contingencyRo.getBatchNo()))
// RuleRunigSnapshotServiceImpl.setReplayBatchNoToNull();
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/action/CustomerAction.java
0 → 100644
View file @
3d4be07d
package
com
.
yeejoin
.
amos
.
fas
.
business
.
action
;
public
interface
CustomerAction
{
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/action/result/AbstractActionResult.java
0 → 100644
View file @
3d4be07d
package
com
.
yeejoin
.
amos
.
fas
.
business
.
action
.
result
;
import
com.yeejoin.amos.fas.business.service.model.ToipResponse
;
import
com.yeejoin.amos.fas.dao.entity.BusinessEntity
;
public
abstract
class
AbstractActionResult
implements
ActionResult
{
public
ToipResponse
toipResponse
;
/**
* 智能体业务对象
*/
private
BusinessEntity
bizObj
;
public
ToipResponse
getToipResponse
()
{
return
toipResponse
;
}
public
void
setToipResponse
(
ToipResponse
toipResponse
)
{
this
.
toipResponse
=
toipResponse
;
}
public
BusinessEntity
getBizObj
()
{
return
bizObj
;
}
public
void
setBizObj
(
BusinessEntity
bizObj
)
{
this
.
bizObj
=
bizObj
;
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/action/result/ActionResult.java
0 → 100644
View file @
3d4be07d
package
com
.
yeejoin
.
amos
.
fas
.
business
.
action
.
result
;
import
java.util.List
;
import
com.alibaba.fastjson.JSON
;
public
interface
ActionResult
{
public
JSON
toJson
();
public
void
addAll
(
List
<
Object
>
data
);
public
void
add
(
Object
data
);
public
List
<?>
getData
();
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/action/result/BubbleTipResult.java
0 → 100644
View file @
3d4be07d
package
com
.
yeejoin
.
amos
.
fas
.
business
.
action
.
result
;
import
java.util.HashMap
;
import
java.util.Map
;
import
com.alibaba.fastjson.JSON
;
public
class
BubbleTipResult
extends
SimpleResult
{
@Override
public
JSON
toJson
()
{
// TODO Auto-generated method stub
Map
<
String
,
Object
>
results
=
new
HashMap
<>();
for
(
Map
<
String
,
Object
>
tempMap
:
data
)
{
for
(
Map
.
Entry
<
String
,
Object
>
entry
:
tempMap
.
entrySet
())
{
results
.
put
(
entry
.
getKey
(),
entry
.
getValue
());
}
}
return
(
JSON
)
JSON
.
toJSON
(
results
);
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/action/result/RiskSituationResult.java
0 → 100644
View file @
3d4be07d
package
com
.
yeejoin
.
amos
.
fas
.
business
.
action
.
result
;
import
java.util.HashMap
;
import
java.util.Map
;
import
com.alibaba.fastjson.JSON
;
public
class
RiskSituationResult
extends
SimpleResult
{
@Override
public
JSON
toJson
()
{
// TODO Auto-generated method stub
Map
<
String
,
Object
>
results
=
new
HashMap
<>();
for
(
Map
<
String
,
Object
>
tempMap
:
data
)
{
for
(
Map
.
Entry
<
String
,
Object
>
entry
:
tempMap
.
entrySet
())
{
results
.
put
(
entry
.
getKey
(),
entry
.
getValue
());
}
}
return
(
JSON
)
JSON
.
toJSON
(
results
);
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/action/result/SimpleResult.java
0 → 100644
View file @
3d4be07d
package
com
.
yeejoin
.
amos
.
fas
.
business
.
action
.
result
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
com.alibaba.fastjson.JSON
;
import
com.yeejoin.amos.fas.business.util.JSONUtil
;
public
class
SimpleResult
extends
AbstractActionResult
implements
ActionResult
{
List
<
Map
<
String
,
Object
>>
data
=
new
ArrayList
<>();
@Override
public
JSON
toJson
()
{
List
<
Map
<
String
,
Object
>>
results
=
new
ArrayList
<>();
for
(
Map
<
String
,
Object
>
tempMap
:
data
)
{
for
(
Map
.
Entry
<
String
,
Object
>
entry
:
tempMap
.
entrySet
())
{
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
result
.
put
(
"label"
,
entry
.
getKey
());
result
.
put
(
"value"
,
entry
.
getValue
());
results
.
add
(
result
);
}
}
return
(
JSON
)
JSON
.
toJSON
(
results
);
}
@Override
public
void
addAll
(
List
<
Object
>
data
)
{
// this.data.addAll((Collection<? extends Map<String, Object>>) data);
}
@Override
public
void
add
(
Object
data
)
{
this
.
data
.
add
(
JSONUtil
.
toMap
(
JSONUtil
.
toJson
(
data
)));
}
public
void
add
(
String
key
,
Object
value
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
key
,
value
);
this
.
data
.
add
(
map
);
}
@Override
public
List
<
Map
<
String
,
Object
>>
getData
()
{
// TODO Auto-generated method stub
return
data
;
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/action/result/TipResult.java
0 → 100644
View file @
3d4be07d
package
com
.
yeejoin
.
amos
.
fas
.
business
.
action
.
result
;
import
java.util.HashMap
;
import
java.util.Map
;
import
com.alibaba.fastjson.JSON
;
public
class
TipResult
extends
SimpleResult
{
@Override
public
JSON
toJson
()
{
// TODO Auto-generated method stub
Map
<
String
,
Object
>
results
=
new
HashMap
<>();
for
(
Map
<
String
,
Object
>
tempMap
:
data
)
{
for
(
Map
.
Entry
<
String
,
Object
>
entry
:
tempMap
.
entrySet
())
{
results
.
put
(
entry
.
getKey
(),
entry
.
getValue
());
}
}
return
(
JSON
)
JSON
.
toJSON
(
results
);
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/action/result/message/AbstractActionResultMessage.java
0 → 100644
View file @
3d4be07d
package
com
.
yeejoin
.
amos
.
fas
.
business
.
action
.
result
.
message
;
import
java.io.IOException
;
import
com.yeejoin.amos.fas.business.action.result.AbstractActionResult
;
import
com.yeejoin.amos.fas.business.action.result.ActionResult
;
import
com.yeejoin.amos.fas.business.action.websocket.RuleWebSocket
;
import
com.yeejoin.amos.fas.business.service.model.ToipResponse
;
import
com.yeejoin.amos.fas.business.util.Constants
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
public
abstract
class
AbstractActionResultMessage
<
R
extends
ToipResponse
>
implements
ActionResultMessage
<
ToipResponse
>
{
protected
ActionResult
actionResult
;
@Override
public
ToipResponse
execute
(
String
firstStr
,
String
secondStr
,
String
thirdStr
)
throws
IOException
,
Exception
{
ToipResponse
response
=
buildResponse
(
firstStr
,
secondStr
,
thirdStr
,
getActionResultByDataFormat
()
==
null
?
actionResult
.
getData
():
getActionResultByDataFormat
(),
actionResult
);
if
(!
actionResult
.
getData
().
isEmpty
())
{
sendResponse
(
response
);
}
return
response
;
}
protected
abstract
Object
getActionResultByDataFormat
();
/**
*
* <pre>
* 构建对象
* </pre>
*
* @param viewTemp
* @param obj
* @return
*/
public
ToipResponse
buildResponse
(
String
firstIfDomain
,
String
secondIfDomain
,
String
thirdIfDomain
,
Object
obj
,
ActionResult
actionResult
)
{
ToipResponse
toipResponse
=
new
ToipResponse
();
toipResponse
.
setIFDomain
(
firstIfDomain
);
toipResponse
.
setTemplate
(
secondIfDomain
+
"_"
+
thirdIfDomain
);
toipResponse
.
setGroup
(
""
);
// group值暂填充至temolate中
// toipResponse.setActionId(ruleAction.getId());
// toipResponse.setBizId(
// ((AbstractActionResult) actionResult).getBizObj().getId());
toipResponse
.
setBizObj
(((
AbstractActionResult
)
actionResult
).
getBizObj
());
toipResponse
.
setResult
(
Constants
.
RESULT_SUCCESS
);
toipResponse
.
setDataList
(
obj
);
return
toipResponse
;
}
/**
*
* <pre>
* 发送数据
* </pre>
*
* @param response
* @throws IOException
* @throws Exception
*/
protected
void
sendResponse
(
CommonResponse
response
)
throws
IOException
,
Exception
{
RuleWebSocket
.
sendInfo
(
response
.
toJsonStr
());
System
.
out
.
println
(
"数据发送成功>>>>>>>>"
+
response
.
toJsonStr
());
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/action/result/message/ActionResultMessage.java
0 → 100644
View file @
3d4be07d
package
com
.
yeejoin
.
amos
.
fas
.
business
.
action
.
result
.
message
;
import
java.io.IOException
;
public
interface
ActionResultMessage
<
T
>
{
/**
*
* <pre>
*
* </pre>
*
* @param firstStr 一级界面域
* @param secondStr 二级界面域
* @param thirdStr 三级界面域
* @return
* @throws IOException
* @throws Exception
*/
T
execute
(
String
firstStr
,
String
secondStr
,
String
thirdStr
)
throws
IOException
,
Exception
;
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/action/result/message/BubbleTipResultMessage.java
0 → 100644
View file @
3d4be07d
package
com
.
yeejoin
.
amos
.
fas
.
business
.
action
.
result
.
message
;
import
com.yeejoin.amos.fas.business.action.result.ActionResult
;
/**
*
* <pre>
* 气泡消息提示
* </pre>
*
* @author amos
* @version $Id: BubbleTipResultMessage.java, v 0.1 2019年5月16日 下午1:52:36 amos Exp $
*/
public
class
BubbleTipResultMessage
extends
SimpleResultMessage
{
public
BubbleTipResultMessage
(
ActionResult
actionResult
)
{
super
(
actionResult
);
// TODO Auto-generated constructor stub
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/action/result/message/RiskSituationResultMessage.java
0 → 100644
View file @
3d4be07d
package
com
.
yeejoin
.
amos
.
fas
.
business
.
action
.
result
.
message
;
import
com.yeejoin.amos.fas.business.action.result.ActionResult
;
/**
*
* <pre>
* 气泡消息提示
* </pre>
*
* @author amos
* @version $Id: BubbleTipResultMessage.java, v 0.1 2019年5月16日 下午1:52:36 amos Exp $
*/
public
class
RiskSituationResultMessage
extends
SimpleResultMessage
{
public
RiskSituationResultMessage
(
ActionResult
actionResult
)
{
super
(
actionResult
);
// TODO Auto-generated constructor stub
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/action/result/message/SimpleResultMessage.java
0 → 100644
View file @
3d4be07d
package
com
.
yeejoin
.
amos
.
fas
.
business
.
action
.
result
.
message
;
import
com.yeejoin.amos.fas.business.action.result.ActionResult
;
import
com.yeejoin.amos.fas.business.service.model.ToipResponse
;
/**
*
* <pre>
* 简单文本输入
* </pre>
*
* @author amos
* @version $Id: SimpleResultMessage.java, v 0.1 2019年4月25日 下午1:57:33 amos Exp $
*/
public
class
SimpleResultMessage
extends
AbstractActionResultMessage
<
ToipResponse
>
{
public
SimpleResultMessage
(
ActionResult
actionResult
)
{
this
.
actionResult
=
actionResult
;
}
@Override
protected
Object
getActionResultByDataFormat
()
{
return
actionResult
.
toJson
();
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/action/result/message/TipResultMessage.java
0 → 100644
View file @
3d4be07d
package
com
.
yeejoin
.
amos
.
fas
.
business
.
action
.
result
.
message
;
import
com.yeejoin.amos.fas.business.action.result.ActionResult
;
/**
*
* <pre>
* 消息提示
* </pre>
*
* @author amos
* @version $Id: TipResultMessage.java, v 0.1 2019年4月25日 上午11:47:13 amos Exp $
*/
public
class
TipResultMessage
extends
SimpleResultMessage
{
public
TipResultMessage
(
ActionResult
actionResult
)
{
super
(
actionResult
);
// TODO Auto-generated constructor stub
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/action/util/ReflectUtil.java
0 → 100644
View file @
3d4be07d
package
com
.
yeejoin
.
amos
.
fas
.
business
.
action
.
util
;
import
java.lang.annotation.Annotation
;
import
java.lang.reflect.AnnotatedElement
;
import
java.lang.reflect.Field
;
import
java.lang.reflect.Method
;
import
java.lang.reflect.Modifier
;
import
java.util.ArrayList
;
import
java.util.List
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
/**
*
* <pre>
* 反射工具类
* </pre>
*
* @author HK
* @version $Id: ReflectUtil.java, v 0.1 2017年12月25日 下午8:05:45 HK Exp $
*/
public
class
ReflectUtil
{
private
final
static
Logger
logger
=
LoggerFactory
.
getLogger
(
ReflectUtil
.
class
);
/**
*
* <pre>
* 设置属性值
* </pre>
*
* @param target
* 目标对象
* @param fname
* 字段名称
* @param ftype
* 字典类型
* @param fvalue
* 字段值
*/
@SuppressWarnings
({
"rawtypes"
,
"unchecked"
})
public
static
void
setFieldValue
(
Object
target
,
String
fname
,
Class
ftype
,
Object
fvalue
)
{
// 设置字段值 如:username 字段,setUsername(String username)
if
(
target
==
null
||
fname
==
null
||
""
.
equals
(
fname
)
||
(
fvalue
!=
null
&&
!
ftype
.
isAssignableFrom
(
fvalue
.
getClass
())))
{
// 如果类型不匹配,直接退出
return
;
}
Class
clazz
=
target
.
getClass
();
try
{
// 先通过setXxx()方法设置类属性值
String
methodname
=
"set"
+
Character
.
toUpperCase
(
fname
.
charAt
(
0
))
+
fname
.
substring
(
1
);
// System.out.println(methodname);
Method
method
=
clazz
.
getDeclaredMethod
(
methodname
,
ftype
);
// 获取定义的方法
if
(!
Modifier
.
isPublic
(
method
.
getModifiers
()))
{
// 设置非共有方法权限
method
.
setAccessible
(
true
);
}
method
.
invoke
(
target
,
fvalue
);
// 执行方法回调
}
catch
(
Exception
me
)
{
// 如果set方法不存在,则直接设置类属性值
try
{
Field
field
=
clazz
.
getDeclaredField
(
fname
);
// 获取定义的类属性
if
(!
Modifier
.
isPublic
(
field
.
getModifiers
()))
{
// 设置非共有类属性权限
field
.
setAccessible
(
true
);
}
field
.
set
(
target
,
fvalue
);
// 设置类属性值
}
catch
(
Exception
fe
)
{
if
(
logger
.
isDebugEnabled
())
{
logger
.
debug
(
fe
.
getMessage
());
}
}
}
}
/**
*
* <pre>
* 获取属性值
* </pre>
*
* @param target
* 目标对象
* @param fname
* 字段名称
* @param ftype
* 字段类型
* @return
*/
@SuppressWarnings
({
"rawtypes"
,
"unchecked"
})
public
static
Object
getFieldValue
(
Object
target
,
String
fname
,
Class
ftype
)
{
// 获取字段值 如:username 字段,getUsername()
if
(
target
==
null
||
fname
==
null
||
""
.
equals
(
fname
))
{
return
null
;
}
Class
clazz
=
target
.
getClass
();
try
{
// 先通过getXxx()方法获取类属性值
String
methodname
=
"get"
+
Character
.
toUpperCase
(
fname
.
charAt
(
0
))
+
fname
.
substring
(
1
);
// System.out.println(methodname);
Method
method
=
clazz
.
getDeclaredMethod
(
methodname
);
// 获取定义的方法
if
(!
Modifier
.
isPublic
(
method
.
getModifiers
()))
{
// 设置非共有方法权限
method
.
setAccessible
(
true
);
}
return
method
.
invoke
(
target
);
// 方法回调,返回值
}
catch
(
Exception
me
)
{
// 如果get方法不存在,则直接获取类属性值
if
(
logger
.
isDebugEnabled
())
{
logger
.
debug
(
me
.
getMessage
());
}
try
{
Field
field
=
clazz
.
getDeclaredField
(
fname
);
// 获取定义的类属性
if
(!
Modifier
.
isPublic
(
field
.
getModifiers
()))
{
// 设置非共有类属性权限
field
.
setAccessible
(
true
);
}
return
field
.
get
(
target
);
// 返回类属性值
}
catch
(
Exception
fe
)
{
if
(
logger
.
isDebugEnabled
())
{
logger
.
debug
(
fe
.
getMessage
());
}
}
}
return
null
;
}
public
static
<
E
>
E
newInstance
(
final
Class
<?
extends
E
>
clazz
)
{
try
{
return
clazz
.
newInstance
();
}
catch
(
final
Exception
e
)
{
logger
.
warn
(
"Could not instantiate {}: {}"
,
clazz
,
e
);
if
(
e
instanceof
RuntimeException
)
{
throw
(
RuntimeException
)
e
;
}
throw
new
IllegalStateException
(
e
);
}
}
public
static
<
A
extends
Annotation
>
A
getAnnotation
(
final
Enum
<?>
enumConstant
,
final
Class
<
A
>
annotationClass
)
{
try
{
final
Field
field
=
enumConstant
.
getClass
()
.
getDeclaredField
(
enumConstant
.
name
());
return
getAnnotation
(
field
,
annotationClass
);
}
catch
(
final
Exception
e
)
{
throw
new
IllegalStateException
(
e
);
}
}
public
static
<
A
extends
Annotation
>
A
getAnnotation
(
final
AnnotatedElement
element
,
final
Class
<
A
>
annotationClass
)
{
final
A
annotation
=
element
.
getAnnotation
(
annotationClass
);
if
(
annotation
==
null
&&
element
instanceof
Method
)
{
// check for annotations on overridden methods. Since Java 8
// those are not returned by .getAnnotation(...)
final
Method
m
=
(
Method
)
element
;
final
Class
<?>
declaringClass
=
m
.
getDeclaringClass
();
final
Class
<?>
superClass
=
declaringClass
.
getSuperclass
();
final
String
methodName
=
m
.
getName
();
final
Class
<?>[]
methodParameterTypes
=
m
.
getParameterTypes
();
if
(
superClass
!=
null
)
{
try
{
final
Method
overriddenMethod
=
superClass
.
getMethod
(
methodName
,
methodParameterTypes
);
return
getAnnotation
(
overriddenMethod
,
annotationClass
);
}
catch
(
final
NoSuchMethodException
e
)
{
logger
.
debug
(
"Failed to get overridden method '{}' from {}"
,
methodName
,
superClass
);
}
}
// check for annotations on interface methods too.
final
Class
<?>[]
interfaces
=
declaringClass
.
getInterfaces
();
for
(
final
Class
<?>
interfaceClass
:
interfaces
)
{
try
{
final
Method
overriddenMethod
=
interfaceClass
.
getMethod
(
methodName
,
methodParameterTypes
);
return
getAnnotation
(
overriddenMethod
,
annotationClass
);
}
catch
(
final
NoSuchMethodException
e
)
{
logger
.
debug
(
"Failed to get overridden method '{}' from {}"
,
methodName
,
interfaceClass
);
}
}
}
if
(
annotation
==
null
&&
element
instanceof
Class
<?>){
final
Class
<?>
clazz
=
(
Class
<?>)
element
;
// final Class<?> declaringClass = clazz.getDeclaringClass();
final
Class
<?>
superClass
=
clazz
.
getSuperclass
();
if
(
superClass
!=
null
)
{
return
getAnnotation
(
superClass
,
annotationClass
);
}
}
return
annotation
;
}
public
static
boolean
isAnnotationPresent
(
final
Enum
<?>
enumConstant
,
final
Class
<?
extends
Annotation
>
annotationClass
)
{
try
{
final
Field
field
=
enumConstant
.
getClass
()
.
getDeclaredField
(
enumConstant
.
name
());
return
isAnnotationPresent
(
field
,
annotationClass
);
}
catch
(
final
Exception
e
)
{
throw
new
IllegalStateException
(
e
);
}
}
public
static
boolean
isAnnotationPresent
(
final
AnnotatedElement
element
,
final
Class
<?
extends
Annotation
>
annotationClass
)
{
return
getAnnotation
(
element
,
annotationClass
)
!=
null
;
}
public
static
Field
[]
getAllFields
(
String
clazzName
,
final
Class
<?
extends
Annotation
>
withAnnotation
)
throws
ClassNotFoundException
{
final
List
<
Field
>
result
=
new
ArrayList
<>();
final
Field
[]
fields
=
getAllFields
(
Class
.
forName
(
clazzName
));
for
(
final
Field
field
:
fields
)
{
if
(
isAnnotationPresent
(
field
,
withAnnotation
))
{
result
.
add
(
field
);
}
}
return
result
.
toArray
(
new
Field
[
result
.
size
()]);
}
public
static
Field
[]
getAllFields
(
final
Class
<?>
clazz
,
final
Class
<?
extends
Annotation
>
withAnnotation
)
{
final
List
<
Field
>
result
=
new
ArrayList
<>();
final
Field
[]
fields
=
getAllFields
(
clazz
);
for
(
final
Field
field
:
fields
)
{
if
(
isAnnotationPresent
(
field
,
withAnnotation
))
{
result
.
add
(
field
);
}
}
return
result
.
toArray
(
new
Field
[
result
.
size
()]);
}
public
static
Field
[]
getAllFields
(
final
Class
<?>
clazz
)
{
final
List
<
Field
>
allFields
=
new
ArrayList
<>();
addFields
(
allFields
,
clazz
);
return
allFields
.
toArray
(
new
Field
[
allFields
.
size
()]);
}
private
static
void
addFields
(
final
List
<
Field
>
allFields
,
final
Class
<?>
clazz
)
{
addFields
(
allFields
,
clazz
,
false
);
}
private
static
void
addFields
(
final
List
<
Field
>
allFields
,
final
Class
<?>
clazz
,
final
boolean
excludeSynthetic
)
{
if
(
clazz
==
Object
.
class
)
{
return
;
}
final
Field
[]
f
=
clazz
.
getDeclaredFields
();
for
(
final
Field
field
:
f
)
{
if
(
excludeSynthetic
&&
field
.
isSynthetic
())
{
continue
;
}
allFields
.
add
(
field
);
}
final
Class
<?>
superclass
=
clazz
.
getSuperclass
();
addFields
(
allFields
,
superclass
,
excludeSynthetic
);
}
public
static
Method
[]
getMethods
(
final
Class
<?>
clazz
,
final
Class
<?
extends
Annotation
>
withAnnotation
)
{
final
List
<
Method
>
result
=
new
ArrayList
<>();
final
Method
[]
methods
=
getMethods
(
clazz
);
for
(
final
Method
method
:
methods
)
{
if
(
isAnnotationPresent
(
method
,
withAnnotation
))
{
result
.
add
(
method
);
}
}
return
result
.
toArray
(
new
Method
[
result
.
size
()]);
}
public
static
Method
[]
getMethods
(
final
Class
<?>
clazz
)
{
final
List
<
Method
>
allMethods
=
new
ArrayList
<>();
addMethods
(
allMethods
,
clazz
);
return
allMethods
.
toArray
(
new
Method
[
allMethods
.
size
()]);
}
private
static
void
addMethods
(
final
List
<
Method
>
allMethods
,
final
Class
<?>
clazz
)
{
if
(
clazz
==
Object
.
class
||
clazz
==
null
)
{
return
;
}
final
Method
[]
methods
=
clazz
.
getMethods
();
for
(
final
Method
method
:
methods
)
{
final
Class
<?>
declaringClass
=
method
.
getDeclaringClass
();
if
(
declaringClass
!=
Object
.
class
)
{
allMethods
.
add
(
method
);
}
}
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/action/websocket/RuleWebSocket.java
0 → 100644
View file @
3d4be07d
package
com
.
yeejoin
.
amos
.
fas
.
business
.
action
.
websocket
;
import
java.io.IOException
;
import
java.util.Observable
;
import
java.util.Observer
;
import
java.util.concurrent.CopyOnWriteArraySet
;
import
javax.websocket.OnClose
;
import
javax.websocket.OnError
;
import
javax.websocket.OnMessage
;
import
javax.websocket.OnOpen
;
import
javax.websocket.Session
;
import
javax.websocket.server.ServerEndpoint
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.stereotype.Component
;
/**
*
* <pre>
* rule webSocket定义
* </pre>
*
* @author amos
* @version $Id: RuleWebSocket.java, v 0.1 2019年5月20日 下午4:59:50 amos Exp $
*/
@Component
@ServerEndpoint
(
value
=
"/rule.ws"
)
public
class
RuleWebSocket
implements
Observer
{
private
final
static
Logger
log
=
LoggerFactory
.
getLogger
(
RuleWebSocket
.
class
);
// 静态变量,用来记录当前在线连接数。应该把它设计成线程安全的。
private
static
int
onlineCount
=
0
;
// concurrent包的线程安全Set,用来存放每个客户端对应的MyWebSocket对象。
private
static
CopyOnWriteArraySet
<
RuleWebSocket
>
webSocketSet
=
new
CopyOnWriteArraySet
<
RuleWebSocket
>();
// 与某个客户端的连接会话,需要通过它来给客户端发送数据
private
Session
session
;
private
Observable
ob
;
private
String
name
;
/**
* 连接建立成功调用的方法
*/
@OnOpen
public
void
onOpen
(
Session
session
)
{
this
.
session
=
session
;
webSocketSet
.
add
(
this
);
// 加入set中
addOnlineCount
();
// 在线数加1
log
.
debug
(
"有新连接加入!当前在线人数为"
+
getOnlineCount
());
subscribeTopics
(
session
);
}
/**
*
* <pre>
* 订阅指挥
* </pre>
*
*/
public
void
subscribeTopics
(
Session
session
)
{
// this.ob = GlobalDispatch.getInstance();
// GlobalDispatch.getInstance().addObserver(this);
log
.
info
(
"成功加入规则主题"
);
}
/**
* 连接关闭调用的方法
*/
@OnClose
public
void
onClose
()
{
webSocketSet
.
remove
(
this
);
// 从set中删除
subOnlineCount
();
// 在线数减1
log
.
debug
(
"有一连接关闭!当前在线人数为"
+
getOnlineCount
());
if
(
ob
!=
null
)
{
ob
.
deleteObserver
(
this
);
}
}
/**
* 收到客户端消息后调用的方法
*
* @param message
* 客户端发送过来的消息
*/
@OnMessage
public
void
onMessage
(
String
message
,
Session
session
)
{
log
.
info
(
"来自客户端的消息:"
+
message
);
}
@OnError
public
void
onError
(
Session
session
,
Throwable
error
)
{
log
.
error
(
"发生错误"
,
error
);
}
public
void
sendMessage
(
String
message
)
throws
IOException
{
this
.
session
.
getBasicRemote
().
sendText
(
message
);
// this.session.getAsyncRemote().sendText(message);
}
/**
* 群发自定义消息
*/
public
static
void
sendInfo
(
String
message
)
throws
IOException
{
log
.
debug
(
"——----RuleWebSocket开始群发消息------"
);
log
.
debug
(
"消息内容为:"
+
message
);
for
(
RuleWebSocket
item
:
webSocketSet
)
{
try
{
item
.
sendMessage
(
message
);
}
catch
(
IOException
e
)
{
log
.
error
(
item
.
session
.
getId
()
+
"消息发送失败"
,
e
);
continue
;
}
}
log
.
debug
(
"——----RuleWebSocket结束群发消息------"
);
}
public
static
synchronized
int
getOnlineCount
()
{
return
onlineCount
;
}
public
static
synchronized
void
addOnlineCount
()
{
RuleWebSocket
.
onlineCount
++;
}
public
static
synchronized
void
subOnlineCount
()
{
RuleWebSocket
.
onlineCount
--;
}
@Override
public
void
update
(
Observable
o
,
Object
arg
)
{
try
{
if
(
session
.
isOpen
())
{
sendMessage
(
arg
.
toString
());
log
.
debug
(
"session"
+
name
+
"消息发送成功"
);
}
else
{
o
.
deleteObserver
(
this
);
log
.
debug
(
"session"
+
name
+
"消息发送失败:"
+
"session已经失去连接"
);
}
}
catch
(
Exception
e
)
{
log
.
error
(
"session"
+
name
+
"消息发送失败:"
+
e
.
getMessage
());
}
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/bo/JpushMsgBo.java
0 → 100644
View file @
3d4be07d
package
com
.
yeejoin
.
amos
.
fas
.
business
.
bo
;
import
java.util.Set
;
/**
* 手机消息对象
*/
public
class
JpushMsgBo
{
/**
* 接收人集合
*/
Set
<
String
>
target
;
/**
* 消息体
*/
JpushMsgContentBo
msg
;
public
Set
<
String
>
getTarget
()
{
return
target
;
}
public
void
setTarget
(
Set
<
String
>
target
)
{
this
.
target
=
target
;
}
public
JpushMsgContentBo
getMsg
()
{
return
msg
;
}
public
void
setMsg
(
JpushMsgContentBo
msg
)
{
this
.
msg
=
msg
;
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/bo/JpushMsgContentBo.java
0 → 100644
View file @
3d4be07d
package
com
.
yeejoin
.
amos
.
fas
.
business
.
bo
;
import
com.yeejoin.amos.fas.common.enums.TriggerRpnChangeTypeEum
;
import
com.yeejoin.amos.fas.core.util.DateUtil
;
import
java.math.BigDecimal
;
/**
* 手机消息推送内容
*/
public
class
JpushMsgContentBo
{
/**
* 危险因素名称
*/
private
String
fmeaName
;
/**
* 触发类型
*/
private
String
notifyType
;
/**
* 巡检状态
*/
private
String
checkStatus
;
/**
* 执行日期
*/
private
String
executeDate
=
DateUtil
.
getLongCurrentDate
();
/**
* 执行人
*/
private
String
execute
;
/**
* 等级变化范围
*/
private
int
levelIsChange
;
/**
* 当前rpn
*/
private
BigDecimal
rpn
;
/**
*风险等级
*/
private
String
level
;
/**
*标题
*/
private
String
subject
;
/**
* 关联名称
*/
private
String
relationName
;
/**
* 是否需要发送
*/
private
Boolean
isSend
;
public
JpushMsgContentBo
(
String
fmeaName
,
String
notifyType
){
this
.
fmeaName
=
fmeaName
;
this
.
notifyType
=
notifyType
;
this
.
setSubject
(
notifyType
);
}
public
Boolean
getSend
()
{
return
isSend
;
}
private
void
setSubject
(
String
notifyType
){
if
(
notifyType
.
equals
(
TriggerRpnChangeTypeEum
.
patrol
.
getCode
())){
//巡检
this
.
subject
=
"风险预警"
;
this
.
isSend
=
true
;
}
else
if
(
notifyType
.
equals
(
TriggerRpnChangeTypeEum
.
alarm
.
getCode
())){
//设备告警
this
.
subject
=
"风险预警"
;
this
.
isSend
=
true
;
}
else
if
(
notifyType
.
equals
(
TriggerRpnChangeTypeEum
.
alarmRecovery
.
getCode
())){
//告警恢复
this
.
subject
=
"告警恢复"
;
this
.
isSend
=
true
;
}
else
if
(
notifyType
.
equals
(
TriggerRpnChangeTypeEum
.
fmeaUpdate
.
getCode
())){
//风险评价
this
.
subject
=
"风险评价"
;
this
.
isSend
=
true
;
}
}
public
String
genMessage
(){
StringBuilder
message
=
new
StringBuilder
();
if
(
notifyType
.
equals
(
TriggerRpnChangeTypeEum
.
patrol
.
getCode
())){
//巡检
message
.
append
(
"执行人:"
).
append
(
execute
).
append
(
"\n"
);
message
.
append
(
"执行时间:"
).
append
(
executeDate
).
append
(
"\n"
);
message
.
append
(
"危险因素名称:"
).
append
(
fmeaName
).
append
(
"\n"
);
message
.
append
(
"描述:"
).
append
(
"当前风险值上升到"
).
append
(
rpn
).
append
(
",风险等级"
).
append
(
getLevelChangeType
()).
append
(
level
).
append
(
"\n"
);
message
.
append
(
"触发原因:"
).
append
(
"关联巡检点"
).
append
(
relationName
).
append
(
"检查"
).
append
(
checkStatus
);
}
else
if
(
notifyType
.
equals
(
TriggerRpnChangeTypeEum
.
alarm
.
getCode
())){
//设备告警
message
.
append
(
"执行时间:"
).
append
(
executeDate
).
append
(
"\n"
);
message
.
append
(
"危险因素名称:"
).
append
(
fmeaName
).
append
(
"\n"
);
message
.
append
(
"描述:"
).
append
(
"当前风险值上升到"
).
append
(
rpn
).
append
(
",风险等级"
).
append
(
getLevelChangeType
()).
append
(
level
).
append
(
"\n"
);
message
.
append
(
"触发原因:"
).
append
(
"关联设备"
).
append
(
relationName
).
append
(
"指标项报警"
);
}
else
if
(
notifyType
.
equals
(
TriggerRpnChangeTypeEum
.
alarmRecovery
.
getCode
())){
//告警恢复
message
.
append
(
relationName
).
append
(
"设备告警解除"
);
}
else
if
(
notifyType
.
equals
(
TriggerRpnChangeTypeEum
.
fmeaUpdate
.
getCode
())){
//风险评价
message
.
append
(
"评价人:"
).
append
(
execute
).
append
(
"\n"
);;
message
.
append
(
"评价时间:"
).
append
(
executeDate
).
append
(
"\n"
);
message
.
append
(
"评价内容:"
).
append
(
fmeaName
).
append
(
"\n"
);
message
.
append
(
"评价等级:"
).
append
(
level
);
}
return
message
.
toString
();
}
private
String
getLevelChangeType
(){
String
changeType
=
""
;
if
(
levelIsChange
>
0
){
changeType
=
"上升到"
;
}
else
if
(
levelIsChange
==
0
){
changeType
=
"不变"
;
}
else
{
changeType
=
"下降到"
;
}
return
changeType
;
}
public
String
getExecute
()
{
return
execute
;
}
public
void
setExecute
(
String
execute
)
{
this
.
execute
=
execute
;
}
public
int
getLevelIsChange
()
{
return
levelIsChange
;
}
public
void
setLevelIsChange
(
int
levelIsChange
)
{
this
.
levelIsChange
=
levelIsChange
;
}
public
BigDecimal
getRpn
()
{
return
rpn
;
}
public
void
setRpn
(
BigDecimal
rpn
)
{
this
.
rpn
=
rpn
;
}
public
String
getLevel
()
{
return
level
;
}
public
void
setLevel
(
String
level
)
{
this
.
level
=
level
;
}
public
String
getRelationName
()
{
return
relationName
;
}
public
String
getSubject
()
{
return
subject
;
}
public
void
setRelationName
(
String
relationName
)
{
this
.
relationName
=
relationName
;
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/bo/MsgParamBo.java
0 → 100644
View file @
3d4be07d
package
com
.
yeejoin
.
amos
.
fas
.
business
.
bo
;
import
com.yeejoin.amos.fas.dao.entity.Fmea
;
import
java.math.BigDecimal
;
/**
* 参数对象
*/
public
class
MsgParamBo
{
private
String
toke
;
private
String
product
;
private
String
appKey
;
private
Fmea
fmea
;
private
Integer
managerLevel
;
private
String
notifyType
;
private
String
userName
;
private
int
levelIsChange
;
private
BigDecimal
rpn
;
private
String
level
;
private
String
relationName
;
public
String
getToke
()
{
return
toke
;
}
public
void
setToke
(
String
toke
)
{
this
.
toke
=
toke
;
}
public
String
getProduct
()
{
return
product
;
}
public
void
setProduct
(
String
product
)
{
this
.
product
=
product
;
}
public
String
getAppKey
()
{
return
appKey
;
}
public
void
setAppKey
(
String
appKey
)
{
this
.
appKey
=
appKey
;
}
public
Fmea
getFmea
()
{
return
fmea
;
}
public
void
setFmea
(
Fmea
fmea
)
{
this
.
fmea
=
fmea
;
}
public
Integer
getManagerLevel
()
{
return
managerLevel
;
}
public
void
setManagerLevel
(
Integer
managerLevel
)
{
this
.
managerLevel
=
managerLevel
;
}
public
String
getNotifyType
()
{
return
notifyType
;
}
public
void
setNotifyType
(
String
notifyType
)
{
this
.
notifyType
=
notifyType
;
}
public
String
getUserName
()
{
return
userName
;
}
public
void
setUserName
(
String
userName
)
{
this
.
userName
=
userName
;
}
public
int
getLevelIsChange
()
{
return
levelIsChange
;
}
public
void
setLevelIsChange
(
int
levelIsChange
)
{
this
.
levelIsChange
=
levelIsChange
;
}
public
BigDecimal
getRpn
()
{
return
rpn
;
}
public
void
setRpn
(
BigDecimal
rpn
)
{
this
.
rpn
=
rpn
;
}
public
String
getLevel
()
{
return
level
;
}
public
void
setLevel
(
String
level
)
{
this
.
level
=
level
;
}
public
String
getRelationName
()
{
return
relationName
;
}
public
void
setRelationName
(
String
relationName
)
{
this
.
relationName
=
relationName
;
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/bo/SafetyExecuteBo.java
View file @
3d4be07d
...
...
@@ -7,6 +7,7 @@ public class SafetyExecuteBo {
private
String
label
;
private
String
pointId
;
private
String
type
;
private
String
status
;
//指标状态
private
String
changeDate
;
public
Long
getId
()
{
return
id
;
...
...
@@ -44,4 +45,10 @@ public class SafetyExecuteBo {
public
void
setChangeDate
(
String
changeDate
)
{
this
.
changeDate
=
changeDate
;
}
public
String
getStatus
()
{
return
status
;
}
public
void
setStatus
(
String
status
)
{
this
.
status
=
status
;
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/BaseController.java
View file @
3d4be07d
...
...
@@ -153,7 +153,6 @@ public class BaseController {
RequestContext
.
setToken
(
getToken
());
RequestContext
.
setProduct
(
getProduct
());
RequestContext
.
setAppKey
(
getAppKey
());
FeignClientResult
feignClientResult
;
try
{
feignClientResult
=
Privilege
.
agencyUserClient
.
getme
();
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/CommonController.java
View file @
3d4be07d
...
...
@@ -169,8 +169,8 @@ public class CommonController extends BaseController {
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取公司下人员列表"
,
notes
=
"获取公司下人员列表"
)
@GetMapping
(
value
=
"/user/list"
,
produces
=
"application/json;charset=UTF-8"
)
public
CommonResponse
getAllUser
()
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
compCode
=
getOrgCode
(
reginParams
);
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
compCode
=
getOrgCode
(
reginParams
);
List
<
AgencyUserModel
>
users
=
commonService
.
getAllUser
(
getToken
(),
getProduct
(),
getAppKey
(),
compCode
);
return
CommonResponseUtil
.
success
(
users
);
}
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/FireEquimtPointController.java
View file @
3d4be07d
...
...
@@ -100,7 +100,7 @@ public class FireEquimtPointController extends BaseController {
@ApiParam
(
value
=
"监测点编号或者监测点名称模糊匹配"
)
@RequestParam
(
required
=
false
)
String
searchValue
,
@ApiParam
(
value
=
"类型(模拟量:ANALOGUE;开关量:SWITCH)"
)
@RequestParam
(
required
=
false
)
String
type
)
{
Map
<
String
,
Object
>
queryMap
=
Maps
.
newHashMap
();
queryMap
.
put
(
"
pageNumber"
,
pageNumber
);
queryMap
.
put
(
"
offset"
,
pageNumber
*
pageSize
);
queryMap
.
put
(
"pageSize"
,
pageSize
);
if
(
isBindDevice
!=
null
&&
isBindDevice
==
0
)
{
queryMap
.
put
(
"fireEquipmentId"
,
0
);
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/FireSourceController.java
View file @
3d4be07d
...
...
@@ -90,7 +90,6 @@ public class FireSourceController extends BaseController {
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询消防车"
,
notes
=
"查询消防车"
)
@RequestMapping
(
value
=
"/fire-car/det/{id}"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
queryFireCar
(
@ApiParam
(
value
=
"查询条件"
,
required
=
true
)
@PathVariable
Long
id
)
{
FireCarDetailVo
car
=
fireCarService
.
findFireCarById
(
getToken
(),
getProduct
(),
getAppKey
(),
id
);
return
CommonResponseUtil
.
success
(
car
);
}
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/RiskLevelController.java
View file @
3d4be07d
package
com
.
yeejoin
.
amos
.
fas
.
business
.
controller
;
import
java.util.HashMap
;
import
java.util.List
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.yeejoin.amos.fas.business.param.CommonPageInfoParam
;
import
com.yeejoin.amos.fas.business.service.intfc.IRiskLevelService
;
import
com.yeejoin.amos.fas.business.util.CommonPageParamUtil
;
...
...
@@ -11,18 +25,10 @@ import com.yeejoin.amos.fas.core.util.CommonResponse;
import
com.yeejoin.amos.fas.core.util.CommonResponseUtil
;
import
com.yeejoin.amos.fas.dao.entity.RiskLevel
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
@RestController
@RequestMapping
(
"/api/riskLevel"
)
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/RiskModelController.java
View file @
3d4be07d
...
...
@@ -125,7 +125,7 @@ public class RiskModelController extends BaseController {
RsDataQueue
rs
=
RsDataQueue
.
getInstance
();
params
.
forEach
(
param
->
{
if
(!
ObjectUtils
.
isEmpty
(
param
.
getId
()))
{
rs
.
addUpdateMessage
(
param
.
getId
());
rs
.
addUpdateMessage
(
param
.
getId
()
,
user
.
getRealName
()
);
}
});
return
CommonResponseUtil
.
success
();
...
...
@@ -163,7 +163,7 @@ public class RiskModelController extends BaseController {
public
CommonResponse
queryFmeaByPage
(
@ApiParam
(
value
=
"查询条件"
)
@RequestBody
(
required
=
false
)
List
<
CommonRequest
>
queryRequests
,
@ApiParam
(
value
=
"分页参数"
,
required
=
true
)
CommonPageable
commonPageable
)
{
CommonPageInfoParam
param
=
CommonPageParamUtil
.
fillCommonPageInfoParam
(
queryRequests
,
commonPageable
);
Page
<
HashMap
<
String
,
Object
>>
fmeaList
=
fmeaService
.
queryFmeaList
(
param
);
Page
<
HashMap
<
String
,
Object
>>
fmeaList
=
fmeaService
.
queryFmeaList
(
param
,
getToken
(),
getProduct
(),
getAppKey
()
);
return
CommonResponseUtil
.
success
(
fmeaList
);
}
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/RiskSourceController.java
View file @
3d4be07d
...
...
@@ -513,12 +513,7 @@ public class RiskSourceController extends BaseController {
return
CommonResponseUtil
.
success
(
riskSourceService
.
bindFireEquiment
(
fmeaBindParam
));
}
// @ApiOperation(httpMethod = "DELETE", value = "移除消防设备绑定关系", notes = "移除消防设备绑定关系")
// @RequestMapping(value = "/fireequiment/relation/{ids}", produces = "application/json;charset=UTF-8", method = RequestMethod.DELETE)
// public CommonResponse removeFireEquiment(@PathVariable("ids") String ids) throws Exception {
// String[] idArray = ids.split(",");
// return CommonResponseUtil.success(this.riskSourceService.removeBoundRelation(idArray));
// }
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询绑定关系设备"
,
notes
=
"查询绑定关系包含已绑定和未绑定"
)
@RequestMapping
(
value
=
"/fireequiment/relation/all"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/View3dController.java
View file @
3d4be07d
package
com
.
yeejoin
.
amos
.
fas
.
business
.
controller
;
import
java.util.HashMap
;
import
java.util.List
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.itextpdf.text.pdf.PdfStructTreeController.returnType
;
import
com.yeejoin.amos.fas.business.bo.BindPointBo
;
import
com.yeejoin.amos.fas.business.bo.BindRegionBo
;
import
com.yeejoin.amos.fas.business.service.intfc.IRiskSourceService
;
import
com.yeejoin.amos.fas.business.service.intfc.IView3dService
;
import
com.yeejoin.amos.fas.business.util.StringUtil
;
import
com.yeejoin.amos.fas.business.vo.ExceptionRegionVo
;
import
com.yeejoin.amos.fas.business.vo.ReginParams
;
import
com.yeejoin.amos.fas.common.enums.ResourceTypeDefEnum
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.core.util.CommonResponseUtil
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
import
io.swagger.annotations.Authorization
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
@RestController
@RequestMapping
(
"/api/view3d"
)
...
...
@@ -49,8 +40,6 @@ public class View3dController extends BaseController {
public
CommonResponse
getRegionTree
()
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
orgCode
=
this
.
getOrgCode
(
reginParams
);
//TODO:待删除
orgCode
=
"1*2"
;
String
channelType
=
this
.
getChannelType
();
return
CommonResponseUtil
.
success
(
riskSourceService
.
findRegionTree
(
channelType
,
orgCode
));
}
...
...
@@ -60,8 +49,6 @@ public class View3dController extends BaseController {
public
CommonResponse
getRegionDetail
(
@PathVariable
(
"riskSourceId"
)
Long
riskSourceId
)
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
orgCode
=
this
.
getOrgCode
(
reginParams
);
//TODO:待删除
orgCode
=
"1"
;
String
channelType
=
this
.
getChannelType
();
return
CommonResponseUtil
.
success
(
riskSourceService
.
findRegionById
(
riskSourceId
,
orgCode
,
channelType
));
}
...
...
@@ -89,8 +76,6 @@ public class View3dController extends BaseController {
if
(
ResourceTypeDefEnum
.
containsTypeCode
(
type
))
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
orgCode
=
this
.
getOrgCode
(
reginParams
);
//TODO:待删除
orgCode
=
"1*2"
;
String
channelType
=
this
.
getChannelType
();
return
CommonResponseUtil
.
success
(
view3dService
.
getPointTreeByType
(
type
,
orgCode
,
channelType
));
}
...
...
@@ -102,8 +87,6 @@ public class View3dController extends BaseController {
public
CommonResponse
getPointDetail
(
String
type
,
Long
pointId
)
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
orgCode
=
this
.
getOrgCode
(
reginParams
);
//TODO:待删除
orgCode
=
"1"
;
return
CommonResponseUtil
.
success
(
view3dService
.
getPointDetailByTypeAndId
(
type
,
pointId
,
orgCode
));
}
...
...
@@ -112,8 +95,6 @@ public class View3dController extends BaseController {
public
CommonResponse
safetyIndexWeek
(
String
type
,
Long
pointId
)
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
orgCode
=
this
.
getOrgCode
(
reginParams
);
//TODO:待删除
orgCode
=
"1*2"
;
return
CommonResponseUtil
.
success
(
view3dService
.
getSafetyIndexWeek
(
orgCode
));
}
...
...
@@ -122,8 +103,6 @@ public class View3dController extends BaseController {
public
CommonResponse
getSafetyIndexInfoByDate
(
@RequestParam
(
name
=
"date"
,
required
=
false
)
String
date
){
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
orgCode
=
this
.
getOrgCode
(
reginParams
);
//TODO:待删除
orgCode
=
"1*2"
;
return
CommonResponseUtil
.
success
(
view3dService
.
getSafetyIndexInfoByDate
(
orgCode
,
date
));
}
...
...
@@ -132,7 +111,6 @@ public class View3dController extends BaseController {
public
CommonResponse
getSafetyIndexDetail
(
@ApiParam
(
value
=
"risk-风险异常,check-巡检异常,equip-设备故障"
)
@PathVariable
String
type
){
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
orgCode
=
this
.
getOrgCode
(
reginParams
);
orgCode
=
"1*2"
;
return
CommonResponseUtil
.
success
(
view3dService
.
getSafetyIndexDetail
(
type
,
orgCode
));
}
...
...
@@ -150,8 +128,6 @@ public class View3dController extends BaseController {
public
CommonResponse
getStatisticsCheck
(){
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
orgCode
=
this
.
getOrgCode
(
reginParams
);
//TODO:待删除
orgCode
=
"1*2"
;
return
CommonResponseUtil
.
success
(
view3dService
.
getStatisticsCheck
(
orgCode
));
}
...
...
@@ -160,8 +136,6 @@ public class View3dController extends BaseController {
public
CommonResponse
getSafetyExecuteListTop5
(
@PathVariable
(
"type"
)
String
type
){
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
orgCode
=
this
.
getOrgCode
(
reginParams
);
//TODO:待删除
orgCode
=
"1*2"
;
return
CommonResponseUtil
.
success
(
view3dService
.
getSafetyExecuteListTop5
(
type
,
orgCode
));
}
...
...
@@ -170,7 +144,6 @@ public class View3dController extends BaseController {
public
CommonResponse
getStatisticsDuty
(){
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
orgCode
=
this
.
getOrgCode
(
reginParams
);
orgCode
=
"1*2"
;
CommonResponse
statisticsDuty
=
view3dService
.
getStatisticsDuty
(
getAppKey
(),
getProduct
(),
orgCode
);
return
statisticsDuty
;
}
...
...
@@ -180,7 +153,6 @@ public class View3dController extends BaseController {
public
CommonResponse
getExceptionRegion
(){
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
orgCode
=
this
.
getOrgCode
(
reginParams
);
orgCode
=
"1*2"
;
List
<
ExceptionRegionVo
>
exceptionRegionVoList
=
view3dService
.
getExceptionRegion
(
orgCode
);
return
CommonResponseUtil
.
success
(
exceptionRegionVoList
);
}
...
...
@@ -198,8 +170,6 @@ public class View3dController extends BaseController {
public
CommonResponse
initViewNode
(
String
type
,
Long
riskSourceId
){
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
orgCode
=
this
.
getOrgCode
(
reginParams
);
//TODO:待删除
orgCode
=
"1*2"
;
return
CommonResponseUtil
.
success
(
view3dService
.
initViewErrorNode
(
type
,
riskSourceId
,
orgCode
));
}
...
...
@@ -237,8 +207,6 @@ public class View3dController extends BaseController {
@ApiParam
(
value
=
"区域ID"
,
required
=
false
)
@RequestParam
(
required
=
false
)
Long
riskSourceId
)
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
orgCode
=
this
.
getOrgCode
(
reginParams
);
//TODO:待删除
orgCode
=
"1*2"
;
return
CommonResponseUtil
.
success
(
view3dService
.
find3dViewDataByType
(
type
,
riskSourceId
,
orgCode
));
}
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/mapper/RuleRuningSnapshotMapper.java
0 → 100644
View file @
3d4be07d
package
com
.
yeejoin
.
amos
.
fas
.
business
.
dao
.
mapper
;
import
java.util.List
;
import
com.yeejoin.amos.fas.business.service.model.RuleRuningSnapshot
;
public
interface
RuleRuningSnapshotMapper
extends
BaseMapper
{
RuleRuningSnapshot
querForObject
(
String
batchNo
);
List
<
RuleRuningSnapshot
>
querForObjectList
(
String
batchNo
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/mapper/View3dMapper.java
View file @
3d4be07d
...
...
@@ -47,6 +47,13 @@ public interface View3dMapper extends BaseMapper{
Long
countCheckException
(
Map
<
String
,
Object
>
param
);
/**
* 统计故障告警数量(不合格、漏检)-日期+机构
* @param param
* @return
*/
Long
countFireException
(
Map
<
String
,
Object
>
param
);
/**
* 今日安全指数详情
* @param params orgCode,date
* @return list
...
...
@@ -67,6 +74,14 @@ public interface View3dMapper extends BaseMapper{
*/
List
<
CheckErrorBo
>
getAllErrorPatrolPoint
(
Map
<
String
,
Object
>
params
);
/**
* 今日安全指数故障告警详情
* @param params orgCode,date
* @return list
*/
List
<
CheckErrorBo
>
getAllFaultAlarm
(
Map
<
String
,
Object
>
params
);
/**
* 今日巡检统计接口
* @param orgCode
...
...
@@ -89,6 +104,20 @@ public interface View3dMapper extends BaseMapper{
List
<
SafetyExecuteBo
>
getCheckErrorTop5
(
String
orgCode
);
/**
* 火灾告警最新5条
* @param orgCode
* @return
*/
List
<
SafetyExecuteBo
>
getFireAlarmTop5
(
String
orgCode
);
/**
* 设备状态最新5条
* @param orgCode
* @return
*/
List
<
SafetyExecuteBo
>
getEquipStatusTop5
(
String
orgCode
);
/**
* 按照类型查询点
* @param params {orgCode,type}
* @return 列表
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/repository/IAlarmDao.java
View file @
3d4be07d
...
...
@@ -7,4 +7,5 @@ import com.yeejoin.amos.fas.dao.entity.Alarm;
@Repository
(
"iAlarmDao"
)
public
interface
IAlarmDao
extends
BaseDao
<
Alarm
,
Long
>
{
Alarm
findByStatusTrueAndFireEquipmentPointCode
(
String
code
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/feign/RemoteSecurityService.java
View file @
3d4be07d
...
...
@@ -4,25 +4,19 @@ package com.yeejoin.amos.fas.business.feign;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
com.yeejoin.amos.component.feign.config.InnerInvokException
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.fas.business.vo.Toke
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
import
com.yeejoin.amos.feign.privilege.model.DepartmentModel
;
import
com.yeejoin.amos.feign.privilege.model.IdPasswordAuthModel
;
import
com.yeejoin.amos.feign.privilege.model.PermissionModel
;
import
com.yeejoin.amos.feign.privilege.model.*
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
java.util.
LinkedHashMap
;
import
java.util.
ArrayList
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -219,42 +213,44 @@ public class RemoteSecurityService {
}
return
agencyUserModel
;
}
//根据orgCode查询机构用户
/**
* 根据orgCode查询机构用户
* @param toke toke
* @param product product
* @param appKey appKey
* @param orgCode orgCode
* @return List<AgencyUserModel>
*/
public
List
<
AgencyUserModel
>
listUserByOrgCode
(
String
toke
,
String
product
,
String
appKey
,
String
orgCode
)
{
if
(
orgCode
==
null
||
orgCode
.
equals
(
""
))
{
return
null
;
}
RequestContext
.
setToken
(
toke
);
RequestContext
.
setProduct
(
product
);
RequestContext
.
setAppKey
(
appKey
);
List
<
AgencyUserModel
>
agencyUserModel
=
null
;
FeignClientResult
feignClientResult
;
FeignClientResult
feignClientResult
=
new
FeignClientResult
()
;
try
{
feignClientResult
=
Privilege
.
agencyUserClient
.
queryByOrgCode
(
orgCode
);
agencyUserModel
=
(
List
<
AgencyUserModel
>)
feignClientResult
.
getResult
();
}
catch
(
InnerInvokException
e
)
{
e
.
printStackTrace
();
}
return
agencyUserModel
;
// CommonResponse commonResponse = iAmosSecurityServer.listUserByOrgCode(orgCode);
// return handleArray(commonResponse, UserModel.class);
return
handleArray
(
feignClientResult
,
AgencyUserModel
.
class
);
}
//根据orgCode查询机构
/**
* 根据orgCode查询机构
* @param toke toke
* @param product product
* @param appKey appKey
* @param orgCode orgCode
* @return Map<String, Object>
*/
public
Map
<
String
,
Object
>
listByOrgCode
(
String
toke
,
String
product
,
String
appKey
,
String
orgCode
)
{
if
(
orgCode
==
null
||
orgCode
.
equals
(
""
))
{
return
null
;
}
RequestContext
.
setToken
(
toke
);
RequestContext
.
setProduct
(
product
);
RequestContext
.
setAppKey
(
appKey
);
...
...
@@ -268,11 +264,6 @@ public class RemoteSecurityService {
e
.
printStackTrace
();
}
return
agencyUserModel
;
// CommonResponse commonResponse = iAmosSecurityServer.listUserByOrgCode(orgCode);
// return handleArray(commonResponse, UserModel.class);
}
...
...
@@ -363,37 +354,35 @@ public class RemoteSecurityService {
// CommonResponse commonResponse = iAmosSecurityServer.getDepartmentTreeByCompanyId(companyId);
// return handleArray(commonResponse, DepartmentBo.class);
}
//根据id批量获取部门信息
public
List
<
LinkedHashMap
>
listDepartmentByDeptIds
(
String
toke
,
String
product
,
String
appKey
,
String
departmentIds
)
{
/**
* 根据id批量获取部门信息
* @param toke token
* @param product product
* @param appKey appKey
* @param "200".equals(feignClientResult.getStatus())departmentIds 部门ids
* @return List<DepartmentModel>
*/
public
List
<
DepartmentModel
>
listDepartmentByDeptIds
(
String
toke
,
String
product
,
String
appKey
,
String
departmentIds
)
{
RequestContext
.
setToken
(
toke
);
RequestContext
.
setProduct
(
product
);
RequestContext
.
setAppKey
(
appKey
);
List
<
LinkedHashMap
>
departmentModel
=
null
;
FeignClientResult
feignClientResult
;
FeignClientResult
feignClientResult
=
new
FeignClientResult
();
try
{
feignClientResult
=
Privilege
.
departmentClient
.
queryDeptByIds
(
departmentIds
);
departmentModel
=
(
List
<
LinkedHashMap
>)
feignClientResult
.
getResult
();
}
catch
(
InnerInvokException
e
)
{
e
.
printStackTrace
();
}
return
departmentModel
;
//CommonResponse commonResponse = iAmosSecurityServer.listDepartmentByDeptIds(departmentIds);
//return handleArray(commonResponse, DepartmentBo.class);
return
handleArray
(
feignClientResult
,
DepartmentModel
.
class
);
}
private
<
T
>
List
<
T
>
handleArray
(
CommonResponse
commonResponse
,
Class
<
T
>
t
)
{
if
(
commonResponse
!=
null
&&
commonResponse
.
isSuccess
())
{
String
jsonStr
=
JSON
.
toJSONString
(
commonResponse
.
getDataList
());
return
JSONArray
.
parseArray
(
jsonStr
,
t
);
private
<
T
>
List
<
T
>
handleArray
(
FeignClientResult
feignClientResult
,
Class
<
T
>
t
)
{
List
<
T
>
list
=
new
ArrayList
<>();
if
(
feignClientResult
!=
null
&&
feignClientResult
.
getStatus
()
==
200
)
{
String
jsonStr
=
JSON
.
toJSONString
(
feignClientResult
.
getResult
());
list
=
JSONArray
.
parseArray
(
jsonStr
,
t
);
}
return
null
;
return
list
;
}
private
<
T
>
T
handleObj
(
CommonResponse
commonResponse
,
Class
<
T
>
t
)
{
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/jpush/AppMessagePushService.java
View file @
3d4be07d
...
...
@@ -72,18 +72,11 @@ public class AppMessagePushService {
}
public
void
sendMessage
(
PushMsgParam
response
)
{
try
{
CommonResponse
commonResponse
=
PushFeign
.
sendMessageone
(
response
);
// try {
// if (null != response && "true".equals(isPush)) {
// PushPayload payload = PushPayload.newBuilder().setPlatform(Platform.android())
// .setAudience(Audience.all())
// .setNotification(Notification.android(response.getContent(), response.getSubject(), response.getExtras()))
// .build();
// jpushClient.sendPush(payload);
// }
// } catch (Exception e) {
// log.error("极光推送异常", e);
// }
}
catch
(
Exception
e
)
{
log
.
error
(
"极光推送异常"
,
e
);
}
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/AccidentTypeServiceImpl.java
View file @
3d4be07d
package
com
.
yeejoin
.
amos
.
fas
.
business
.
service
.
impl
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.LinkedHashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
com.yeejoin.amos.feign.privilege.model.DepartmentModel
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageImpl
;
...
...
@@ -24,6 +21,7 @@ import com.yeejoin.amos.fas.dao.entity.AccidentType;
import
com.yeejoin.amos.fas.dao.entity.RiskFactor
;
import
com.yeejoin.amos.fas.exception.YeeException
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
org.springframework.util.CollectionUtils
;
@Service
(
"accidentTypeService"
)
public
class
AccidentTypeServiceImpl
implements
IAccidentTypeService
{
...
...
@@ -72,7 +70,6 @@ public class AccidentTypeServiceImpl implements IAccidentTypeService {
@Override
public
List
<
HashMap
<
String
,
Object
>>
queryAccidentType
(
String
orgCode
)
{
return
accidentTypeMapper
.
findAccidentTypeListByOrgCode
(
orgCode
);
}
...
...
@@ -80,35 +77,35 @@ public class AccidentTypeServiceImpl implements IAccidentTypeService {
public
Page
<
HashMap
<
String
,
Object
>>
queryAccidentTypePage
(
String
toke
,
String
product
,
String
appKey
,
CommonPageInfoParam
param
)
{
long
total
=
accidentTypeMapper
.
countPageData
(
param
);
List
<
HashMap
<
String
,
Object
>>
content
=
accidentTypeMapper
.
findAccidentTypePage
(
param
);
List
<
String
>
userIdList
=
new
ArrayList
<
String
>();
List
<
String
>
deptIdList
=
new
ArrayList
<
String
>();
if
(!
CollectionUtils
.
isEmpty
(
content
)){
Set
<
String
>
userIds
=
new
HashSet
<>();
Set
<
String
>
deptIds
=
new
HashSet
<>();
for
(
HashMap
<
String
,
Object
>
map
:
content
)
{
String
userId
=
String
.
valueOf
(
map
.
get
(
"createBy"
));
String
deptId
=
String
.
valueOf
(
map
.
get
(
"deptId"
));
if
(
userId
!=
null
&&!
userIdList
.
contains
(
userId
))
{
userIdList
.
add
(
userId
);
}
if
(
deptId
!=
null
&&!
deptIdList
.
contains
(
deptId
))
{
deptIdList
.
add
(
deptId
);
}
userIds
.
add
(
userId
);
deptIds
.
add
(
deptId
);
}
List
<
AgencyUserModel
>
users
=
remoteSecurityService
.
listUserByUserIds
(
toke
,
product
,
appKey
,
Joiner
.
on
(
","
).
join
(
userIdList
));
Map
<
String
,
String
>
userMap
=
new
HashMap
<
String
,
String
>();
for
(
int
i
=
0
;
i
<
users
.
size
();
i
++)
{
userMap
.
put
(
users
.
get
(
i
).
getUserId
(),
users
.
get
(
i
).
getUserName
());
userIds
.
remove
(
null
);
userIds
.
remove
(
""
);
deptIds
.
remove
(
null
);
deptIds
.
remove
(
""
);
List
<
AgencyUserModel
>
users
=
new
ArrayList
<>();
if
(!
CollectionUtils
.
isEmpty
(
userIds
)){
users
=
remoteSecurityService
.
listUserByUserIds
(
toke
,
product
,
appKey
,
Joiner
.
on
(
","
).
join
(
userIds
));
}
List
<
LinkedHashMap
>
depts
=
remoteSecurityService
.
listDepartmentByDeptIds
(
toke
,
product
,
appKey
,
Joiner
.
on
(
","
).
join
(
deptIdList
));
Map
<
String
,
String
>
deptMap
=
new
HashMap
<
String
,
String
>();
for
(
int
i
=
0
;
i
<
depts
.
size
();
i
++)
{
deptMap
.
put
(
depts
.
get
(
i
).
get
(
"sequenceNbr"
).
toString
(),
depts
.
get
(
i
).
get
(
"departmentName"
).
toString
(
));
Map
<
String
,
String
>
userMap
=
users
.
stream
().
collect
(
Collectors
.
toMap
(
AgencyUserModel:
:
getUserId
,
AgencyUserModel:
:
getRealName
));
List
<
DepartmentModel
>
depts
=
new
ArrayList
<
>();
if
(!
CollectionUtils
.
isEmpty
(
deptIds
))
{
depts
=
remoteSecurityService
.
listDepartmentByDeptIds
(
toke
,
product
,
appKey
,
Joiner
.
on
(
","
).
join
(
deptIds
));
}
Map
<
String
,
String
>
deptMap
=
depts
.
stream
().
collect
(
Collectors
.
toMap
(
e
->
e
.
getSequenceNbr
().
toString
(),
DepartmentModel:
:
getDepartmentName
));
content
.
forEach
(
e
->
{
e
.
put
(
"userName"
,
userMap
.
get
(
e
.
get
(
"createBy"
)));
e
.
put
(
"deptName"
,
deptMap
.
get
(
e
.
get
(
"deptId"
)));
});
}
Page
<
HashMap
<
String
,
Object
>>
result
=
new
PageImpl
<>(
content
,
param
,
total
);
return
result
;
}
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/ContingencyInstanceImpl.java
View file @
3d4be07d
...
...
@@ -258,4 +258,9 @@ public class ContingencyInstanceImpl /*extends GenericManagerImpl<ContingencyPla
}
@Override
public
void
updateStep
(
String
step
,
String
batchNo
)
{
// TODO Auto-generated method stub
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/EquipmentServiceImpl.java
View file @
3d4be07d
...
...
@@ -457,10 +457,10 @@ public class EquipmentServiceImpl implements IEquipmentService {
@Override
public
EquipCommunicationData
findFireEquipmentByPointCode
(
String
code
)
{
EquipCommunicationData
data
=
(
EquipCommunicationData
)
redisTemplate
.
opsForHash
().
get
(
"fireEquipData"
,
code
);
if
(
ObjectUtils
.
isEmpty
(
data
))
{
data
=
fireEquipMapper
.
findOneByPointCode
(
code
);
}
//
EquipCommunicationData data = (EquipCommunicationData) redisTemplate.opsForHash().get("fireEquipData", code);
//
if (ObjectUtils.isEmpty(data)) {
EquipCommunicationData
data
=
fireEquipMapper
.
findOneByPointCode
(
code
);
//
}
return
data
;
}
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/FireCarServiceImpl.java
View file @
3d4be07d
...
...
@@ -9,6 +9,7 @@ import java.util.List;
import
java.util.Map
;
import
java.util.Optional
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.assertj.core.util.Sets
;
...
...
@@ -100,18 +101,14 @@ public class FireCarServiceImpl implements IFireCarService {
Set
<
String
>
deptIds
=
Sets
.
newHashSet
(
Lists
.
transform
(
content
,
Map
->
Map
.
get
(
"dept_id"
)+
""
));
deptIds
.
remove
(
""
);
deptIds
.
remove
(
null
);
Map
<
String
,
String
>
deptMap
=
new
HashMap
<
String
,
String
>();
if
(!
CollectionUtils
.
isEmpty
(
deptIds
)){
List
<
LinkedHashMap
>
deptList
=
remoteSecurityService
.
listDepartmentByDeptIds
(
toke
,
product
,
appKey
,
Joiner
.
on
(
","
).
join
(
deptIds
));
for
(
int
i
=
0
;
i
<
deptList
.
size
();
i
++)
{
deptMap
.
put
(
deptList
.
get
(
i
).
get
(
"sequenceNbr"
).
toString
(),
deptList
.
get
(
i
).
get
(
"departmentName"
).
toString
());
}
}
Map
<
String
,
String
>
deptMapNew
=
deptMap
;
List
<
DepartmentModel
>
depts
=
remoteSecurityService
.
listDepartmentByDeptIds
(
toke
,
product
,
appKey
,
Joiner
.
on
(
","
).
join
(
deptIds
));
Map
<
Long
,
String
>
deptMap
=
depts
.
stream
().
collect
(
Collectors
.
toMap
(
DepartmentModel:
:
getSequenceNbr
,
DepartmentModel:
:
getDepartmentName
));
content
.
forEach
(
e
->
{
e
.
put
(
"departmentName"
,
deptMapNew
.
get
(
e
.
get
(
"dept_id"
)));
e
.
put
(
"departmentName"
,
deptMap
.
get
(
e
.
get
(
"dept_id"
)));
});
}
}
Page
<
HashMap
<
String
,
Object
>>
result
=
new
PageImpl
<
HashMap
<
String
,
Object
>>(
content
,
param
,
total
);
return
result
;
}
...
...
@@ -120,7 +117,7 @@ public class FireCarServiceImpl implements IFireCarService {
public
FireCarDetailVo
findFireCarById
(
String
toke
,
String
product
,
String
appKey
,
Long
truckId
)
{
FireCarDetailVo
carVo
=
fireCarMapper
.
getFireCarDetailById
(
truckId
);
DepartmentModel
departmentModel
=
remoteSecurityService
.
getDepartmentByDeptId
(
toke
,
product
,
appKey
,
carVo
.
getDeptId
());
carVo
.
setDepartmentName
(
departmentModel
.
getDepartmentName
()
);
carVo
.
setDepartmentName
(
departmentModel
!=
null
?
departmentModel
.
getDepartmentName
()
:
""
);
return
carVo
;
}
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/FireEquipPointServiceImpl.java
View file @
3d4be07d
...
...
@@ -53,6 +53,7 @@ public class FireEquipPointServiceImpl implements IFireEquipPontService {
return
fireCar
;
}
@Override
public
String
[]
deletePoint
(
String
[]
idArray
)
throws
Exception
{
for
(
String
id
:
idArray
)
{
Optional
<
FireEquipmentPoint
>
fireEquipmentPoint1
=
fireEquipmentPointDao
.
findById
(
Long
.
parseLong
(
id
));
...
...
@@ -95,8 +96,11 @@ public class FireEquipPointServiceImpl implements IFireEquipPontService {
if
(
total
.
equals
(
0L
))
{
return
CommonResponseUtil
.
success
(
new
PageImpl
<>(
Lists
.
newArrayList
(),
null
,
total
));
}
int
pageNumber
=
map
.
get
(
"pageNumber"
)
!=
null
?
Integer
.
parseInt
(
map
.
get
(
"pageNumber"
).
toString
())
:
0
;
int
pageSize
=
map
.
get
(
"pageSize"
)
!=
null
?
Integer
.
parseInt
(
map
.
get
(
"pageSize"
).
toString
())
:
0
;
CommonPageable
commonPageable
=
new
CommonPageable
(
pageNumber
,
pageSize
);
List
<
FireEquipmentPointEntity
>
list
=
fireEquipPointMapper
.
listByMap
(
map
);
return
CommonResponseUtil
.
success
(
new
PageImpl
<>(
list
,
null
,
total
));
return
CommonResponseUtil
.
success
(
new
PageImpl
<>(
list
,
commonPageable
,
total
));
}
@Override
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/FmeaServiceImpl.java
View file @
3d4be07d
package
com
.
yeejoin
.
amos
.
fas
.
business
.
service
.
impl
;
import
com.google.common.base.Joiner
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.fas.business.dao.mapper.FmeaEquipmentPointMapper
;
import
com.yeejoin.amos.fas.business.dao.mapper.FmeaMapper
;
...
...
@@ -10,6 +11,7 @@ import com.yeejoin.amos.fas.business.dao.repository.IRiskFactorDao;
import
com.yeejoin.amos.fas.business.dao.repository.IRiskLevelDao
;
import
com.yeejoin.amos.fas.business.dao.repository.IRiskSourceDao
;
import
com.yeejoin.amos.fas.business.feign.RemoteRuleServer
;
import
com.yeejoin.amos.fas.business.feign.RemoteSecurityService
;
import
com.yeejoin.amos.fas.business.param.CommonPageInfoParam
;
import
com.yeejoin.amos.fas.business.service.intfc.IFmeaService
;
import
com.yeejoin.amos.fas.business.service.model.RiskSourceRo
;
...
...
@@ -28,12 +30,8 @@ import org.springframework.stereotype.Service;
import
org.springframework.util.CollectionUtils
;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Optional
;
import
java.util.UUID
;
import
java.util.*
;
import
java.util.stream.Collectors
;
@Service
(
"fmeaService"
)
public
class
FmeaServiceImpl
implements
IFmeaService
{
...
...
@@ -58,7 +56,7 @@ public class FmeaServiceImpl implements IFmeaService {
IRiskFactorDao
iRiskFactorDao
;
@Autowired
private
Remote
RuleServer
remoteRuleServer
;
private
Remote
SecurityService
remoteSecurityService
;
@Autowired
private
FmeaEquipmentPointMapper
fmeaEquipmentPointMapper
;
...
...
@@ -84,76 +82,37 @@ public class FmeaServiceImpl implements IFmeaService {
}
@Override
public
Page
<
HashMap
<
String
,
Object
>>
queryFmeaList
(
CommonPageInfoParam
param
)
{
public
Page
<
HashMap
<
String
,
Object
>>
queryFmeaList
(
CommonPageInfoParam
param
,
String
toke
,
String
product
,
String
appKey
)
{
long
total
=
fmeaMapper
.
countPageData
(
param
);
List
<
HashMap
<
String
,
Object
>>
content
=
fmeaMapper
.
queryFmeaPage
(
param
);
StringBuffer
sb
=
new
StringBuffer
();
for
(
HashMap
<
String
,
Object
>
map
:
content
)
{
//String[] ids = sb.toString().split(",");
//String companyLeaderId = String.valueOf(map.get("companyLeaderId"));
sb
.
append
(
map
.
get
(
"companyLeaderId"
));
sb
.
append
(
map
.
get
(
","
));
//String departmentLeaderId = String.valueOf(map.get("departmentLeaderId"));
sb
.
append
(
map
.
get
(
"departmentLeaderId"
));
sb
.
append
(
map
.
get
(
","
));
//String groupLeaderId = String.valueOf(map.get("groupLeaderId"));
sb
.
append
(
map
.
get
(
"groupLeaderId"
));
sb
.
append
(
map
.
get
(
","
));
//String personLeaderId = String.valueOf(map.get("personLeaderId"));
sb
.
append
(
map
.
get
(
"personLeaderId"
));
sb
.
append
(
map
.
get
(
","
));
//String identifyUserId = String.valueOf(map.get("identifyUserId"));
sb
.
append
(
map
.
get
(
"identifyUserId"
));
sb
.
append
(
map
.
get
(
","
));
}
sb
.
deleteCharAt
(
sb
.
length
()-
1
);
FeignClientResult
<
List
<
AgencyUserModel
>>
resultSec
=
Privilege
.
agencyUserClient
.
queryByIds
(
sb
.
toString
());
for
(
HashMap
<
String
,
Object
>
map
:
content
)
{
String
companyLeaderId
=
String
.
valueOf
(
map
.
get
(
"companyLeaderId"
));
String
departmentLeaderId
=
String
.
valueOf
(
map
.
get
(
"departmentLeaderId"
));
String
groupLeaderId
=
String
.
valueOf
(
map
.
get
(
"groupLeaderId"
));
String
personLeaderId
=
String
.
valueOf
(
map
.
get
(
"personLeaderId"
));
String
identifyUserId
=
String
.
valueOf
(
map
.
get
(
"identifyUserId"
));
for
(
AgencyUserModel
user
:
resultSec
.
getResult
())
{
if
(
companyLeaderId
!=
null
&&
companyLeaderId
.
equals
(
user
.
getUserId
()))
{
map
.
put
(
"companyLeaderName"
,
user
.
getRealName
());
if
(!
CollectionUtils
.
isEmpty
(
content
))
{
Set
<
String
>
userIds
=
new
HashSet
<>();
for
(
HashMap
<
String
,
Object
>
map
:
content
)
{
userIds
.
add
(
String
.
valueOf
(
map
.
get
(
"companyLeaderId"
)));
userIds
.
add
(
String
.
valueOf
(
map
.
get
(
"departmentLeaderId"
)));
userIds
.
add
(
String
.
valueOf
(
map
.
get
(
"groupLeaderId"
)));
userIds
.
add
(
String
.
valueOf
(
map
.
get
(
"personLeaderId"
)));
userIds
.
add
(
String
.
valueOf
(
map
.
get
(
"identifyUserId"
)));
}
if
(
departmentLeaderId
!=
null
&&
departmentLeaderId
.
equals
(
user
.
getUserId
()))
{
map
.
put
(
"departmentLeaderName"
,
user
.
getRealName
());
}
if
(
groupLeaderId
!=
null
&&
groupLeaderId
.
equals
(
user
.
getUserId
()))
{
map
.
put
(
"groupLeaderName"
,
user
.
getRealName
());
}
if
(
personLeaderId
!=
null
&&
personLeaderId
.
equals
(
user
.
getUserId
()))
{
map
.
put
(
"personLeaderName"
,
user
.
getRealName
());
}
if
(
identifyUserId
!=
null
&&
identifyUserId
.
equals
(
user
.
getUserId
()))
{
map
.
put
(
"identifyUserName"
,
user
.
getRealName
());
userIds
.
remove
(
null
);
userIds
.
remove
(
""
);
if
(!
CollectionUtils
.
isEmpty
(
userIds
)){
List
<
AgencyUserModel
>
users
=
new
ArrayList
<>();
if
(!
CollectionUtils
.
isEmpty
(
userIds
)){
users
=
remoteSecurityService
.
listUserByUserIds
(
toke
,
product
,
appKey
,
Joiner
.
on
(
","
).
join
(
userIds
));
}
Map
<
String
,
String
>
userMap
=
users
.
stream
().
collect
(
Collectors
.
toMap
(
AgencyUserModel:
:
getUserId
,
AgencyUserModel:
:
getRealName
));
for
(
HashMap
<
String
,
Object
>
map
:
content
)
{
map
.
put
(
"companyLeaderName"
,
userMap
.
get
(
map
.
get
(
"companyLeaderId"
)));
map
.
put
(
"departmentLeaderName"
,
userMap
.
get
(
map
.
get
(
"departmentLeaderId"
)));
map
.
put
(
"groupLeaderName"
,
userMap
.
get
(
map
.
get
(
"groupLeaderId"
)));
map
.
put
(
"personLeaderName"
,
userMap
.
get
(
map
.
get
(
"personLeaderId"
)));
map
.
put
(
"identifyUserName"
,
userMap
.
get
(
map
.
get
(
"identifyUserId"
)));
}
}
Page
<
HashMap
<
String
,
Object
>>
result
=
new
PageImpl
<
HashMap
<
String
,
Object
>>(
content
,
param
,
total
);
return
result
;
}
return
new
PageImpl
<
HashMap
<
String
,
Object
>>(
content
,
param
,
total
)
;
}
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/RiskFactorServiceImpl.java
View file @
3d4be07d
package
com
.
yeejoin
.
amos
.
fas
.
business
.
service
.
impl
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.LinkedHashMap
;
import
java.util.List
;
import
java.util.Map
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageImpl
;
import
org.springframework.stereotype.Service
;
import
com.google.common.base.Joiner
;
import
com.yeejoin.amos.fas.business.dao.mapper.RiskFactorMapper
;
import
com.yeejoin.amos.fas.business.dao.mapper.RiskSourceMapper
;
...
...
@@ -25,6 +13,15 @@ import com.yeejoin.amos.fas.dao.entity.Fmea;
import
com.yeejoin.amos.fas.dao.entity.RiskFactor
;
import
com.yeejoin.amos.fas.exception.YeeException
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.DepartmentModel
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageImpl
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
java.util.*
;
import
java.util.stream.Collectors
;
@Service
(
"riskFactorService"
)
public
class
RiskFactorServiceImpl
implements
IRiskFactorService
{
...
...
@@ -46,35 +43,35 @@ public class RiskFactorServiceImpl implements IRiskFactorService {
public
Page
<
HashMap
<
String
,
Object
>>
queryRiskFactorPage
(
String
toke
,
String
product
,
String
appKey
,
CommonPageInfoParam
param
)
{
long
total
=
riskFactorMapper
.
countPageData
(
param
);
List
<
HashMap
<
String
,
Object
>>
content
=
riskFactorMapper
.
queryRiskFactorPage
(
param
);
List
<
String
>
userIdList
=
new
ArrayList
<
String
>();
List
<
String
>
deptIdList
=
new
ArrayList
<
String
>();
if
(!
CollectionUtils
.
isEmpty
(
content
)){
Set
<
String
>
userIds
=
new
HashSet
<>();
Set
<
String
>
deptIds
=
new
HashSet
<>();
for
(
HashMap
<
String
,
Object
>
map
:
content
)
{
String
userId
=
String
.
valueOf
(
map
.
get
(
"createBy"
));
String
deptId
=
String
.
valueOf
(
map
.
get
(
"deptId"
));
if
(
userId
!=
null
&&!
userIdList
.
contains
(
userId
))
{
userIdList
.
add
(
userId
);
}
if
(
deptId
!=
null
&&!
deptIdList
.
contains
(
deptId
))
{
deptIdList
.
add
(
deptId
);
userIds
.
add
(
userId
);
deptIds
.
add
(
deptId
);
}
userIds
.
remove
(
null
);
userIds
.
remove
(
""
);
deptIds
.
remove
(
null
);
deptIds
.
remove
(
""
);
List
<
AgencyUserModel
>
users
=
new
ArrayList
<>();
if
(!
CollectionUtils
.
isEmpty
(
userIds
)){
users
=
remoteSecurityService
.
listUserByUserIds
(
toke
,
product
,
appKey
,
Joiner
.
on
(
","
).
join
(
userIds
));
}
List
<
AgencyUserModel
>
users
=
remoteSecurityService
.
listUserByUserIds
(
toke
,
product
,
appKey
,
Joiner
.
on
(
","
).
join
(
userIdList
));
Map
<
String
,
String
>
userMap
=
new
HashMap
<
String
,
String
>();
for
(
int
i
=
0
;
i
<
users
.
size
();
i
++)
{
userMap
.
put
(
users
.
get
(
i
).
getUserId
(),
users
.
get
(
i
).
getUserName
());
}
List
<
LinkedHashMap
>
depts
=
remoteSecurityService
.
listDepartmentByDeptIds
(
toke
,
product
,
appKey
,
Joiner
.
on
(
","
).
join
(
deptIdList
));
Map
<
String
,
String
>
deptMap
=
new
HashMap
<
String
,
String
>();
for
(
int
i
=
0
;
i
<
depts
.
size
();
i
++)
{
deptMap
.
put
(
depts
.
get
(
i
).
get
(
"sequenceNbr"
).
toString
(),
depts
.
get
(
i
).
get
(
"departmentName"
).
toString
());
Map
<
String
,
String
>
userMap
=
users
.
stream
().
collect
(
Collectors
.
toMap
(
AgencyUserModel:
:
getUserId
,
AgencyUserModel:
:
getRealName
));
List
<
DepartmentModel
>
depts
=
new
ArrayList
<>();
if
(!
CollectionUtils
.
isEmpty
(
deptIds
)){
depts
=
remoteSecurityService
.
listDepartmentByDeptIds
(
toke
,
product
,
appKey
,
Joiner
.
on
(
","
).
join
(
deptIds
));
}
Map
<
String
,
String
>
deptMap
=
depts
.
stream
().
collect
(
Collectors
.
toMap
(
e
->
e
.
getSequenceNbr
().
toString
(),
DepartmentModel:
:
getDepartmentName
));
content
.
forEach
(
e
->
{
e
.
put
(
"userName"
,
userMap
.
get
(
e
.
get
(
"createBy"
)));
e
.
put
(
"deptName"
,
deptMap
.
get
(
e
.
get
(
"deptId"
)));
});
}
Page
<
HashMap
<
String
,
Object
>>
result
=
new
PageImpl
<>(
content
,
param
,
total
);
return
result
;
}
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/RiskLevelServiceImpl.java
View file @
3d4be07d
...
...
@@ -8,28 +8,26 @@ import java.util.HashSet;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.stream.Collector
;
import
java.util.stream.Collectors
;
import
com.yeejoin.amos.fas.business.util.StringUtil
;
import
com.yeejoin.amos.fas.common.enums.ManageLevelEum
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageImpl
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
com.google.common.base.Joiner
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.fas.business.dao.mapper.RiskLevelMapper
;
import
com.yeejoin.amos.fas.business.dao.repository.IRiskLevelDao
;
import
com.yeejoin.amos.fas.business.dao.repository.IRiskSourceDao
;
import
com.yeejoin.amos.fas.business.feign.RemoteSecurityService
;
import
com.yeejoin.amos.fas.business.param.CommonPageInfoParam
;
import
com.yeejoin.amos.fas.business.service.intfc.IRiskLevelService
;
import
com.yeejoin.amos.fas.business.util.StringUtil
;
import
com.yeejoin.amos.fas.common.enums.ManageLevelEum
;
import
com.yeejoin.amos.fas.dao.entity.RiskLevel
;
import
com.yeejoin.amos.fas.dao.entity.RiskSource
;
import
com.yeejoin.amos.fas.exception.YeeException
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
@Service
(
"riskLevelService"
)
public
class
RiskLevelServiceImpl
implements
IRiskLevelService
{
...
...
@@ -46,26 +44,28 @@ public class RiskLevelServiceImpl implements IRiskLevelService {
public
Page
<
HashMap
<
String
,
Object
>>
queryRiskLevelPage
(
String
toke
,
String
product
,
String
appKey
,
CommonPageInfoParam
param
)
{
long
total
=
riskLevelMapper
.
countPageData
(
param
);
List
<
HashMap
<
String
,
Object
>>
content
=
riskLevelMapper
.
queryRiskLevelPage
(
param
);
Set
<
String
>
userIdList
=
new
HashSet
<
String
>();
if
(!
CollectionUtils
.
isEmpty
(
content
)){
Set
<
String
>
userIds
=
new
HashSet
<
String
>();
for
(
HashMap
<
String
,
Object
>
map
:
content
)
{
userIdList
.
add
(
String
.
valueOf
(
map
.
get
(
"createBy"
)));
String
userId
=
String
.
valueOf
(
map
.
get
(
"createBy"
));
userIds
.
add
(
userId
);
}
Map
<
String
,
String
>
userMap
=
new
HashMap
<
String
,
String
>();
if
(
userIdList
.
size
()>
0
)
{
List
<
AgencyUserModel
>
users
=
remoteSecurityService
.
listUserByUserIds
(
toke
,
product
,
appKey
,
Joiner
.
on
(
","
).
join
(
userIdList
));
for
(
int
i
=
0
;
i
<
users
.
size
();
i
++)
{
userMap
.
put
(
users
.
get
(
i
).
getUserId
(),
users
.
get
(
i
).
getUserName
());
userIds
.
remove
(
null
);
userIds
.
remove
(
""
);
List
<
AgencyUserModel
>
users
=
new
ArrayList
<>();
if
(!
CollectionUtils
.
isEmpty
(
userIds
)){
users
=
remoteSecurityService
.
listUserByUserIds
(
toke
,
product
,
appKey
,
Joiner
.
on
(
","
).
join
(
userIds
));
}
}
Map
<
String
,
String
>
userMap
=
users
.
stream
().
collect
(
Collectors
.
toMap
(
AgencyUserModel:
:
getUserId
,
AgencyUserModel:
:
getRealName
));
content
.
forEach
(
e
->
{
e
.
put
(
"userName"
,
userMap
.
get
(
String
.
valueOf
(
e
.
get
(
"createBy"
))));
e
.
put
(
"userName"
,
userMap
.
get
(
String
.
valueOf
(
e
.
get
(
"createBy"
))));
e
.
put
(
"manageLevelName"
,
StringUtil
.
isNotEmpty
(
e
.
get
(
"manageLevel"
))
?
ManageLevelEum
.
getNameByManageLevel
(
Integer
.
parseInt
(
e
.
get
(
"manageLevel"
).
toString
()))
:
""
);
});
}
return
new
PageImpl
<>(
content
,
param
,
total
);
}
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/RiskSourceServiceImpl.java
View file @
3d4be07d
...
...
@@ -7,7 +7,6 @@ import java.util.ArrayList;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.HashSet
;
import
java.util.LinkedHashMap
;
import
java.util.LinkedHashSet
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -45,8 +44,12 @@ import com.google.common.base.Joiner;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Maps
;
import
com.google.common.collect.Sets
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.component.rule.RuleTrigger
;
import
com.yeejoin.amos.component.rule.action.ActionHandler
;
import
com.yeejoin.amos.fas.business.bo.BindRegionBo
;
import
com.yeejoin.amos.fas.business.bo.JpushMsgBo
;
import
com.yeejoin.amos.fas.business.bo.JpushMsgContentBo
;
import
com.yeejoin.amos.fas.business.bo.MsgParamBo
;
import
com.yeejoin.amos.fas.business.bo.RpnCalculationBo
;
import
com.yeejoin.amos.fas.business.constants.FasConstant
;
import
com.yeejoin.amos.fas.business.dao.mapper.FireEquipMapper
;
...
...
@@ -57,15 +60,15 @@ import com.yeejoin.amos.fas.business.dao.mapper.FmeaPointInputitemMapper;
import
com.yeejoin.amos.fas.business.dao.mapper.ImpAndFireEquipMapper
;
import
com.yeejoin.amos.fas.business.dao.mapper.RiskSourceMapper
;
import
com.yeejoin.amos.fas.business.dao.mongo.EquipCommunicationDao
;
import
com.yeejoin.amos.fas.business.dao.repository.IAlarmDao
;
import
com.yeejoin.amos.fas.business.dao.repository.IContingencyOriginalDataDao
;
import
com.yeejoin.amos.fas.business.dao.repository.IDictDao
;
import
com.yeejoin.amos.fas.business.dao.repository.IEvaluationModelDao
;
import
com.yeejoin.amos.fas.business.dao.repository.IFireEquipmentDao
;
import
com.yeejoin.amos.fas.business.dao.repository.IFireEquipmentDataDao
;
import
com.yeejoin.amos.fas.business.dao.repository.IFireEquipmentPointDao
;
import
com.yeejoin.amos.fas.business.dao.repository.IFmeaDao
;
import
com.yeejoin.amos.fas.business.dao.repository.IPPointDao
;
import
com.yeejoin.amos.fas.business.dao.repository.IPreplanPictureDao
;
import
com.yeejoin.amos.fas.business.dao.repository.IRiskFactorDao
;
import
com.yeejoin.amos.fas.business.dao.repository.IRiskLevelDao
;
import
com.yeejoin.amos.fas.business.dao.repository.IRiskSourceDao
;
import
com.yeejoin.amos.fas.business.dao.repository.IRpnChangeLogDao
;
...
...
@@ -97,6 +100,8 @@ import com.yeejoin.amos.fas.common.enums.DataRefreshTypeEum;
import
com.yeejoin.amos.fas.core.common.request.CommonPageable
;
import
com.yeejoin.amos.fas.core.common.response.RegionTreeResponse
;
import
com.yeejoin.amos.fas.core.common.response.RiskSourceTreeResponse
;
import
com.yeejoin.amos.fas.core.util.StringUtil
;
import
com.yeejoin.amos.fas.dao.entity.Alarm
;
import
com.yeejoin.amos.fas.dao.entity.ContingencyOriginalData
;
import
com.yeejoin.amos.fas.dao.entity.Dict
;
import
com.yeejoin.amos.fas.dao.entity.Equipment
;
...
...
@@ -107,15 +112,14 @@ import com.yeejoin.amos.fas.dao.entity.FireEquipmentPoint;
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.PPoint
;
import
com.yeejoin.amos.fas.dao.entity.PreplanPicture
;
import
com.yeejoin.amos.fas.dao.entity.RiskFactor
;
import
com.yeejoin.amos.fas.dao.entity.RiskLevel
;
import
com.yeejoin.amos.fas.dao.entity.RiskSource
;
import
com.yeejoin.amos.fas.dao.entity.RpnChangeLog
;
import
com.yeejoin.amos.fas.exception.YeeException
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.DepartmentModel
;
@Service
(
"riskSourceService"
)
public
class
RiskSourceServiceImpl
implements
IRiskSourceService
{
...
...
@@ -138,8 +142,6 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
@Autowired
private
AppMessagePushService
appMessagePushService
;
@Autowired
private
IFmeaDao
iFmeaDao
;
@Autowired
private
IRiskLevelDao
riskLevelDao
;
...
...
@@ -171,8 +173,6 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
@Autowired
private
IRiskLevelDao
iRiskLevelDao
;
@Autowired
private
IPPointDao
iPPointDao
;
@Autowired
private
RemoteSecurityService
remoteSecurityService
;
...
...
@@ -203,7 +203,6 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
@Autowired
private
IDictDao
dictDao
;
@Autowired
private
RedisTemplate
redisTemplate
;
...
...
@@ -216,6 +215,12 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
@Autowired
private
FmeaPointInputitemMapper
fmeaPointInputitemMapper
;
@Autowired
private
IAlarmDao
iAlarmDao
;
@Autowired
private
IRiskFactorDao
iRiskFactorDao
;
public
static
String
cacheKeyForCanBeRunning
()
{
return
Redis
.
genKey
(
CacheType
.
ERASABLE
.
name
(),
"CONTINGENCYRUNING"
);
}
...
...
@@ -223,6 +228,9 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
@Autowired
private
IDataRefreshService
iDataRefreshService
;
@Autowired
private
RuleTrigger
ruleTrigger
;
@Override
public
RiskSource
editRiskSource
(
HashMap
<
String
,
Object
>
map
)
throws
Exception
{
RiskSource
riskSource
=
(
RiskSource
)
map
.
get
(
"param"
);
...
...
@@ -404,10 +412,11 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
fmeaEquipmentPoint
.
setEquipmentPointId
(
equipmentPointId
);
returnList
.
add
(
fmeaEquipmentPoint
);
}
if
(!
CollectionUtils
.
isEmpty
(
returnList
))
{
Equipment
equipment
=
equipmentService
.
queryOne
(
importantEquipId
);
if
(!
CollectionUtils
.
isEmpty
(
returnList
)
&&
equipment
!=
null
)
{
fmeaEquipmentPointMapper
.
saveBatch
(
returnList
);
RsDataQueue
rsDataQueue
=
RsDataQueue
.
getInstance
();
rsDataQueue
.
addEquipmentMessage
(
fmeaId
);
rsDataQueue
.
addEquipmentMessage
(
fmeaId
,
equipment
.
getName
()
);
}
return
returnList
;
}
...
...
@@ -535,7 +544,9 @@ 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
());
ContingencyOriginalData
contingencyOriginalData
=
new
ContingencyOriginalData
();
BeanUtils
.
copyProperties
(
contingencyRo
,
contingencyOriginalData
);
iContingencyOriginalDataDao
.
save
(
contingencyOriginalData
);
...
...
@@ -582,44 +593,34 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
return
new
PageImpl
<>(
content
,
null
,
total
);
}
content
=
fmeaPointInputitemMapper
.
listByFmeaId
(
fmeaId
,
pageNumber
,
pageSize
);
List
<
String
>
userIdList
=
new
ArrayList
<
String
>();
List
<
String
>
deptIdList
=
new
ArrayList
<
String
>();
if
(!
CollectionUtils
.
isEmpty
(
content
)){
Set
<
String
>
userIds
=
new
HashSet
<>();
Set
<
String
>
deptIds
=
new
HashSet
<>();
for
(
Map
<
String
,
Object
>
map
:
content
)
{
String
userId
=
String
.
valueOf
(
map
.
get
(
"userId"
));
String
deptId
=
String
.
valueOf
(
map
.
get
(
"deptId"
));
if
(
userId
!=
null
&&!
userIdList
.
contains
(
userId
))
{
userIdList
.
add
(
userId
);
}
if
(
deptId
!=
null
&&!
deptIdList
.
contains
(
deptId
))
{
deptIdList
.
add
(
deptId
);
}
userIds
.
add
(
userId
);
deptIds
.
add
(
deptId
);
}
Map
<
String
,
String
>
userMap
=
new
HashMap
<
String
,
String
>();
Map
<
String
,
String
>
deptMap
=
new
HashMap
<
String
,
String
>();
if
(
userIdList
.
size
()>
0
)
{
List
<
AgencyUserModel
>
users
=
remoteSecurityService
.
listUserByUserIds
(
toke
,
product
,
appKey
,
Joiner
.
on
(
","
).
join
(
userIdList
));
for
(
int
i
=
0
;
i
<
users
.
size
();
i
++)
{
userMap
.
put
(
users
.
get
(
i
).
getUserId
(),
users
.
get
(
i
).
getUserName
());
}
}
if
(
deptIdList
.
size
()>
0
)
{
List
<
LinkedHashMap
>
depts
=
remoteSecurityService
.
listDepartmentByDeptIds
(
toke
,
product
,
appKey
,
Joiner
.
on
(
","
).
join
(
deptIdList
));
for
(
int
i
=
0
;
i
<
depts
.
size
();
i
++)
{
deptMap
.
put
(
depts
.
get
(
i
).
get
(
"sequenceNbr"
).
toString
(),
depts
.
get
(
i
).
get
(
"departmentName"
).
toString
());
userIds
.
remove
(
null
);
deptIds
.
remove
(
null
);
List
<
AgencyUserModel
>
users
=
new
ArrayList
<>();
if
(!
CollectionUtils
.
isEmpty
(
userIds
)){
users
=
remoteSecurityService
.
listUserByUserIds
(
toke
,
product
,
appKey
,
Joiner
.
on
(
","
).
join
(
userIds
));
}
Map
<
String
,
String
>
userMap
=
users
.
stream
().
collect
(
Collectors
.
toMap
(
AgencyUserModel:
:
getUserId
,
AgencyUserModel:
:
getRealName
));
List
<
DepartmentModel
>
depts
=
new
ArrayList
<>();
if
(!
CollectionUtils
.
isEmpty
(
deptIds
)){
depts
=
remoteSecurityService
.
listDepartmentByDeptIds
(
toke
,
product
,
appKey
,
Joiner
.
on
(
","
).
join
(
deptIds
));
}
Map
<
Long
,
String
>
deptMap
=
depts
.
stream
().
collect
(
Collectors
.
toMap
(
DepartmentModel:
:
getSequenceNbr
,
DepartmentModel:
:
getDepartmentName
));
content
.
forEach
(
e
->
{
e
.
put
(
"username"
,
userMap
.
get
(
String
.
valueOf
(
e
.
get
(
"userId"
)
)));
e
.
put
(
"depName"
,
deptMap
.
get
(
String
.
valueOf
(
e
.
get
(
"deptId"
)
)));
e
.
put
(
"userName"
,
userMap
.
get
(
e
.
get
(
"userId"
)));
e
.
put
(
"deptName"
,
deptMap
.
get
(
e
.
get
(
"deptId"
)));
e
.
put
(
"tel"
,
userMap
.
get
(
String
.
valueOf
(
e
.
get
(
"deptId"
)+
"tel"
)));
});
}
return
new
PageImpl
<>(
content
,
null
,
total
);
}
...
...
@@ -642,25 +643,6 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
@Override
@Async
public
void
processProtalData
(
String
toke
,
String
product
,
String
appKey
,
ProtalDataRo
protalData
)
{
String
bacthNo
=
UUID
.
randomUUID
().
toString
();
protalData
.
setBatchNo
(
bacthNo
);
Optional
<
PPoint
>
pPoint1
=
iPPointDao
.
findById
(
protalData
.
getId
());
PPoint
pPoint
=
null
;
if
(
pPoint1
.
isPresent
())
{
pPoint
=
pPoint1
.
get
();
}
if
(
pPoint
!=
null
)
{
protalData
.
setOriginalNodeState
(
pPoint
.
getStatus
());
protalData
.
setLevel
(
pPoint
.
getLevel
());
protalData
.
setPointNo
(
pPoint
.
getPointNo
());
protalData
.
setPointName
(
pPoint
.
getName
());
AgencyUserModel
sUser
=
remoteSecurityService
.
getUserById
(
toke
,
product
,
appKey
,
pPoint
.
getChargePersonId
());
if
(
sUser
!=
null
)
{
protalData
.
setUserName
(
sUser
.
getUserName
());
}
else
{
protalData
.
setUserName
(
""
);
}
}
if
(!
CollectionUtils
.
isEmpty
(
protalData
.
getItems
()))
{
Long
pointId
=
protalData
.
getId
();
List
<
Long
>
inputIds
=
Lists
.
newArrayList
();
...
...
@@ -690,7 +672,8 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
fmeaPointInputitemMapper
.
updateStateByIds
(
0
,
successIds
);
}
RsDataQueue
rsDataQueue
=
RsDataQueue
.
getInstance
();
fmeaIds
.
forEach
(
fmeaId
->
rsDataQueue
.
addPatrolMessage
(
fmeaId
));
fmeaIds
.
forEach
(
fmeaId
->
rsDataQueue
.
addPatrolMessage
(
fmeaId
,
protalData
.
getCheckUser
(),
protalData
.
getName
(),
protalData
.
getNodeState
()));
}
iDataRefreshService
.
refreshViewData
(
DataRefreshTypeEum
.
check
.
getCode
());
}
...
...
@@ -770,7 +753,6 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
private
void
processFireData
(
AlarmParam
deviceData
)
throws
Exception
{
//处理设备和巡检数据
deviceData
.
setNodeState
(
deviceData
.
getState
());
FireEquipmentPoint
fireEquipmentPoint
=
iFireEquipmentPointDao
.
findOneByCode
(
deviceData
.
getPointCode
());
fireEquipmentPoint
.
setValue
(
deviceData
.
getState
());
updateFirePointValue
(
fireEquipmentPoint
.
getId
(),
deviceData
.
getState
());
...
...
@@ -787,14 +769,25 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
Equipment
equipment
=
null
;
if
(
fireEquipment
!=
null
)
{
deviceData
.
setCode
(
fireEquipment
.
getCode
());
//保存实时数据
saveFireEquipmentData
(
fireEquipmentPoint
,
fireEquipment
,
deviceData
,
fireEquipmentPointType
);
equipment
=
impAndFireEquipMapper
.
queryImpEqumtByFireEquipmt
(
fireEquipmentPoint
.
getFireEquipmentId
());
//报警数据存库
saveFireEquipmentData
(
fireEquipmentPoint
,
deviceData
,
fireEquipmentPointType
);
List
<
AlarmParam
>
list
=
new
ArrayList
<>();
list
.
add
(
deviceData
);
//保存到mongo
saveData
(
list
,
"soe"
);
if
(
equipment
!=
null
)
{
//动态预案执行
dynamicPlan
(
deviceData
,
equipment
,
fireEquipment
,
fireEquipmentPointType
);
}
}
}
/**
* 预案执行
* @param deviceData
* @param equipment
* @param fireEquipment
* @param fireEquipmentPointType
*/
@Async
private
void
dynamicPlan
(
AlarmParam
deviceData
,
Equipment
equipment
,
FireEquipment
fireEquipment
,
String
fireEquipmentPointType
){
String
batchNo
=
null
;
Object
batch
=
null
;
Dict
dict
=
null
;
...
...
@@ -817,7 +810,6 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
return
;
}
deviceData
.
setBatchNo
(
batchNo
);
deviceData
.
setMonitor
(
equipment
.
getName
());
deviceData
.
setEquimentId
(
String
.
valueOf
(
equipment
.
getId
()));
if
(
"alarm_type_fire"
.
equals
(
fireEquipmentPointType
))
{
...
...
@@ -826,7 +818,6 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
}
Object
canBeRunning
=
redisTemplate
.
opsForValue
().
get
(
cacheKeyForCanBeRunning
());
if
(
canBeRunning
==
null
)
{
try
{
alermContingency
(
batchNo
,
fireEquipment
,
equipment
);
}
catch
(
Exception
e
)
{
...
...
@@ -838,14 +829,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
redisTemplate
.
opsForHash
().
put
(
"currentContingency"
,
"batchNo"
,
batchNo
);
redisTemplate
.
opsForHash
().
put
(
"currentContingency"
,
"contingencyPlan"
,
null
);
redisTemplate
.
opsForHash
().
put
(
"currentContingency"
,
"alarmType"
,
null
);
//通知刷新3d页面告警数据
iDataRefreshService
.
refreshViewData
(
DataRefreshTypeEum
.
alarm
.
getCode
());
}
else
{
if
(
"alarm_type_trouble"
.
equals
(
fireEquipmentPointType
))
{
notifyAlarm
(
fireEquipmentPoint
,
deviceData
);
//通知刷新3d页面相关故障数据
iDataRefreshService
.
refreshViewData
(
DataRefreshTypeEum
.
trouble
.
getCode
());
}
String
alarmType
=
(
String
)
redisTemplate
.
opsForHash
().
get
(
"currentContingency"
,
"alarmType"
);
if
(!
ObjectUtils
.
isEmpty
(
alarmType
)
&&
dict
.
getDictValue
().
equals
(
alarmType
))
{
ContingencyDeviceStatus
contingencyDeviceStatus
=
(
ContingencyDeviceStatus
)
redisTemplate
.
opsForHash
().
get
(
"currentContingency"
,
"contingencyPlan"
);
...
...
@@ -854,8 +838,6 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
}
}
}
}
}
@Override
@javax
.
transaction
.
Transactional
...
...
@@ -865,7 +847,48 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
}
private
void
saveFireEquipmentData
(
FireEquipmentPoint
fireEquipmentPoint
,
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
)){
Alarm
alarm
=
iAlarmDao
.
findByStatusTrueAndFireEquipmentPointCode
(
deviceData
.
getPointCode
());
if
(
alarm
!=
null
){
alarm
.
setFireEquipmentPointValue
(
deviceData
.
getState
());
if
(
"false"
.
equals
(
deviceData
.
getState
())){
alarm
.
setRecoveryDate
(
new
Date
());
alarm
.
setStatus
(
false
);
}
else
{
alarm
.
setFrequency
((
alarm
.
getFrequency
()+
1
));
alarm
.
setUpdateDate
(
new
Date
());
}
iAlarmDao
.
save
(
alarm
);
}
else
{
if
(
"true"
.
equals
(
deviceData
.
getState
())){
alarm
=
new
Alarm
();
alarm
.
setFireEquipmentCode
(
fireEquipment
.
getCode
());
alarm
.
setFireEquipmentId
(
fireEquipment
.
getId
());
alarm
.
setFireEquipmentName
(
fireEquipment
.
getName
());
alarm
.
setFireEquipmentPointCode
(
fireEquipmentPoint
.
getCode
());
alarm
.
setFireEquipmentPointId
(
fireEquipmentPoint
.
getId
());
alarm
.
setFireEquipmentPointName
(
fireEquipmentPoint
.
getName
());
alarm
.
setFireEquipmentPointValue
(
deviceData
.
getState
());
alarm
.
setOrgCode
(
fireEquipment
.
getOrgCode
());
alarm
.
setType
(
fireEquipmentPointType
);
iAlarmDao
.
save
(
alarm
);
}
}
if
(
alarm
!=
null
){
if
(
"alarm_type_trouble"
.
equals
(
fireEquipmentPointType
))
{
//通知刷新3d页面相关故障数据
if
(
alarm
.
getFrequency
()==
1
||
alarm
.
getStatus
()
==
false
){
notifyAlarm
(
fireEquipmentPoint
,
deviceData
);
iDataRefreshService
.
refreshViewData
(
DataRefreshTypeEum
.
trouble
.
getCode
());
}
}
else
{
//通知刷新3d页面告警数据
iDataRefreshService
.
refreshViewData
(
DataRefreshTypeEum
.
alarm
.
getCode
());
}
}
}
else
{
if
(
"SWITCH"
.
equals
(
fireEquipmentPoint
.
getType
())){
//保存遥信信号数据到mysql中
FireEquipmentData
fireEquipmentData
=
new
FireEquipmentData
();
fireEquipmentData
.
setEqPointCode
(
deviceData
.
getPointCode
());
fireEquipmentData
.
seteValue
(
deviceData
.
getState
());
...
...
@@ -876,25 +899,24 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
fireEquipmentData
.
setEqPointUnit
(
fireEquipmentPoint
.
getUnit
());
fireEquipmentData
.
setFireEquipmentPointId
(
fireEquipmentPoint
.
getId
());
fireEquipmentData
.
setFireEquipmentId
(
fireEquipmentPoint
.
getFireEquipmentId
());
if
(!
"alarm_type_fire"
.
equals
(
fireEquipmentPointType
))
{
fireEquipmentData
.
setType
(
"monitor"
);
}
iFireEquipmentDataDao
.
save
(
fireEquipmentData
);
if
(!
"alarm_type_fire"
.
equals
(
fireEquipmentPointType
))
{
Map
<
String
,
Object
>
content
=
new
HashMap
<>();
content
.
put
(
"id"
,
fireEquipmentData
.
getId
());
content
.
put
(
"label"
,
fireEquipmentData
.
getEqPointName
());
content
.
put
(
"changeDate"
,
fireEquipmentData
.
getCreateDate
());
Optional
<
FireEquipment
>
fireEquipment
=
iFireEquipmentDao
.
findById
(
fireEquipmentPoint
.
getFireEquipmentId
());
if
(
fireEquipment
.
isPresent
())
{
content
.
put
(
"orgCode"
,
fireEquipment
.
get
().
getOrgCode
());
}
else
{
log
.
info
(
fireEquipmentPoint
.
getFireEquipmentId
()
+
"设备不存在!!!"
);
}
content
.
put
(
"orgCode"
,
fireEquipment
.
getOrgCode
());
content
.
put
(
"status"
,
deviceData
.
getSoe
());
iDataRefreshService
.
sendRefreshDataWithArea
(
DataRefreshTypeEum
.
monitor
.
getCode
(),
content
);
}
}
List
<
AlarmParam
>
list
=
new
ArrayList
<>();
list
.
add
(
deviceData
);
//保存所有数据(遥测,遥信)到mongo
saveData
(
list
,
"soe"
);
}
@Override
public
void
saveData
(
List
<
AlarmParam
>
deviceDatas
,
String
type
)
{
...
...
@@ -972,7 +994,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
fmeaEquipmentPointMapper
.
updateStateByIds
(
state
,
ids
);
}
RsDataQueue
rsDataQueue
=
RsDataQueue
.
getInstance
();
fmeaIds
.
forEach
(
fmeaId
->
rsDataQueue
.
addEquipmentMessage
(
fmeaId
));
fmeaIds
.
forEach
(
fmeaId
->
rsDataQueue
.
addEquipmentMessage
(
fmeaId
,
param
.
getMonitor
()
));
}
}
...
...
@@ -1068,26 +1090,26 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
List
<
Map
>
list
=
riskSourceMapper
.
queryContingencyWater
();
HashOperations
hashOperations
=
redisTemplate
.
opsForHash
();
for
(
Map
map
:
list
)
{
if
(
hashOperations
.
size
(
"Analogue"
)
>
0
)
{
if
(
ObjectUtils
.
isEmpty
(
map
.
get
(
"CODE"
))
||
!
hashOperations
.
hasKey
(
"Analogue"
,
map
.
get
(
"CODE"
)))
{
map
.
put
(
"level"
,
0
);
map
.
put
(
"volume"
,
0
);
continue
;
}
EquipCommunicationData
data
=
(
EquipCommunicationData
)
hashOperations
.
get
(
"Analogue"
,
map
.
get
(
"CODE"
));
map
.
put
(
"level"
,
String
.
format
(
"%.2f"
,
Double
.
valueOf
(
data
.
getState
())));
if
(!
ObjectUtils
.
isEmpty
(
map
.
get
(
"level"
)))
{
double
area
=
0
;
if
(!
ObjectUtils
.
isEmpty
(
map
.
get
(
"area"
)))
{
area
=
Double
.
valueOf
(
map
.
get
(
"area"
).
toString
());
}
map
.
put
(
"volume"
,
String
.
format
(
"%.2f"
,
Double
.
valueOf
(
map
.
get
(
"level"
).
toString
())
*
area
));
}
else
{
map
.
put
(
"volume"
,
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
volume
=
String
.
format
(
"%.2f"
,
Double
.
valueOf
(
level
)
*
area
);
if
(
hashOperations
.
size
(
"Analogue"
)
>
0
)
{
if
(
ObjectUtils
.
isEmpty
(
map
.
get
(
"CODE"
))
||
!
hashOperations
.
hasKey
(
"Analogue"
,
map
.
get
(
"CODE"
)))
{
map
.
put
(
"level"
,
level
);
map
.
put
(
"volume"
,
volume
);
continue
;
}
EquipCommunicationData
data
=
(
EquipCommunicationData
)
hashOperations
.
get
(
"Analogue"
,
map
.
get
(
"CODE"
));
map
.
put
(
"level"
,
StringUtil
.
isNumeric
(
data
.
getState
())?
data
.
getState
():
level
);
map
.
put
(
"volume"
,
String
.
format
(
"%.2f"
,
(
Double
.
valueOf
(
map
.
get
(
"level"
).
toString
())*
area
)));
}
else
{
map
.
put
(
"level"
,
0
);
map
.
put
(
"volume"
,
0
);
map
.
put
(
"level"
,
level
);
map
.
put
(
"volume"
,
volume
);
}
}
return
list
;
...
...
@@ -1117,17 +1139,20 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
* 修改、添加导致rpn、rpni改变
*/
@Override
public
void
notifyFmeaFromUpdate
(
String
toke
,
String
product
,
String
appKey
,
Long
fmeaId
,
String
nofityType
)
{
public
void
notifyFmeaFromUpdate
(
String
toke
,
String
product
,
String
appKey
,
Long
fmeaId
,
String
nofityType
,
String
userName
)
{
Fmea
fmea
=
fmeaMapper
.
getById
(
fmeaId
);
if
(
fmea
==
null
)
{
return
;
}
if
(
fmea
.
getEvaluationOid
()
!=
null
&&
fmea
.
getEvaluationSid
()
!=
null
&&
fmea
.
getEvaluationDid
()
!=
null
)
{
MsgParamBo
msgParamBo
=
new
MsgParamBo
();
BigDecimal
oidValue
=
new
BigDecimal
(
fmea
.
getOidValue
());
BigDecimal
sidValue
=
new
BigDecimal
(
fmea
.
getSidValue
());
BigDecimal
didValue
=
new
BigDecimal
(
fmea
.
getDidValue
());
//1.1计算rpni
BigDecimal
rpni
=
oidValue
.
multiply
(
sidValue
).
multiply
(
didValue
).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
);
BigDecimal
rpn
;
//1.2计算rpn:为空则rpni = rpn;不为空则重新计算s*d*newo
if
(
fmea
.
getNewEvaluationOid
()
==
null
)
{
...
...
@@ -1136,29 +1161,53 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
}
else
{
BigDecimal
newOidValue
=
new
BigDecimal
(
fmea
.
getNewOidValue
());
rpn
=
newOidValue
.
multiply
(
sidValue
).
multiply
(
didValue
).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
);
;
}
List
<
RiskLevel
>
levels
=
riskLevelDao
.
findAll
();
RiskLevel
newLevel
=
RpnUtils
.
getBetweenLevel
(
rpn
,
levels
);
Set
<
String
>
jpushTargets
=
new
LinkedHashSet
<>
();
JpushMsgBo
jpushMsgBo
=
new
JpushMsgBo
();
fmea
.
setRpni
(
rpni
);
fmea
.
setRpn
(
rpn
);
if
(
newLevel
!=
null
)
{
fmea
.
setRiskLevelId
(
newLevel
.
getId
());
getJpushTarget
(
toke
,
product
,
appKey
,
fmea
,
newLevel
.
getManageLevel
());
msgParamBo
.
setAppKey
(
appKey
);
msgParamBo
.
setToke
(
toke
);
msgParamBo
.
setProduct
(
product
);
msgParamBo
.
setFmea
(
fmea
);
msgParamBo
.
setManagerLevel
(
newLevel
.
getManageLevel
());
msgParamBo
.
setLevel
(
newLevel
.
getName
());
msgParamBo
.
setUserName
(
userName
);
msgParamBo
.
setNotifyType
(
nofityType
);
jpushMsgBo
=
this
.
getJushMessageInfo
(
msgParamBo
);
}
//1.3更新fmea
fmeaMapper
.
updateRpn
(
fmea
);
//2.计算上级风险值(风险点及父节点)
this
.
notifyRiskSource
(
fmeaId
,
fmea
.
getRiskSourceId
(),
nofityType
,
jpush
Targets
);
this
.
notifyRiskSource
(
fmeaId
,
fmea
.
getRiskSourceId
(),
nofityType
,
jpush
MsgBo
);
}
}
private
Set
<
String
>
getJpushTarget
(
String
toke
,
String
product
,
String
appKey
,
Fmea
fmea
,
Integer
managerLevel
)
{
private
JpushMsgBo
getJushMessageInfo
(
MsgParamBo
msgParam
){
JpushMsgBo
msgBo
=
new
JpushMsgBo
();
Optional
<
RiskFactor
>
optional
=
iRiskFactorDao
.
findById
(
msgParam
.
getFmea
().
getRiskFactorsId
());
if
(
optional
.
isPresent
()){
JpushMsgContentBo
jpushMsgContentBo
=
new
JpushMsgContentBo
(
optional
.
get
().
getName
(),
msgParam
.
getNotifyType
());
jpushMsgContentBo
.
setExecute
(
msgParam
.
getUserName
());
jpushMsgContentBo
.
setLevelIsChange
(
msgParam
.
getLevelIsChange
());
jpushMsgContentBo
.
setLevel
(
msgParam
.
getLevel
());
jpushMsgContentBo
.
setRelationName
(
msgParam
.
getRelationName
());
jpushMsgContentBo
.
setRpn
(
msgParam
.
getRpn
());
msgBo
.
setTarget
(
this
.
getJpushTarget
(
msgParam
));
msgBo
.
setMsg
(
jpushMsgContentBo
);
}
return
msgBo
;
}
private
Set
<
String
>
getJpushTarget
(
MsgParamBo
msgParam
)
{
Set
<
String
>
targets
=
new
LinkedHashSet
<>();
Set
<
String
>
userIds
=
this
.
getUsersByLevel
(
m
anagerLevel
,
fmea
);
Set
<
String
>
userIds
=
this
.
getUsersByLevel
(
m
sgParam
.
getManagerLevel
(),
msgParam
.
getFmea
()
);
userIds
.
forEach
(
userId
->
{
AgencyUserModel
user
=
remoteSecurityService
.
getUserById
(
toke
,
product
,
appKey
,
userId
);
AgencyUserModel
user
=
remoteSecurityService
.
getUserById
(
msgParam
.
getToke
(),
msgParam
.
getProduct
(),
msgParam
.
getAppKey
()
,
userId
);
if
(
user
!=
null
)
{
String
target
=
user
.
getMobile
();
targets
.
add
(
target
);
...
...
@@ -1192,7 +1241,9 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
* 告警或者不合格项导致fmea的rpn、new_evaluation_oid改变
*/
@Override
public
void
notifyFmeaFromAbnormal
(
String
toke
,
String
product
,
String
appKey
,
Long
fmeaId
,
String
notifyType
)
{
public
void
notifyFmeaFromAbnormal
(
String
toke
,
String
product
,
String
appKey
,
Long
fmeaId
,
String
notifyType
,
String
userName
,
String
relationName
)
{
Fmea
fmea
=
fmeaMapper
.
getById
(
fmeaId
);
if
(
fmea
==
null
)
{
return
;
...
...
@@ -1215,22 +1266,32 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
RiskLevel
newLevel
=
RpnUtils
.
getBetweenLevel
(
rpn
,
levels
);
fmea
.
setRpn
(
rpn
);
fmea
.
setNewEvaluationOid
(
oEvaluationModel
.
getId
());
Set
<
String
>
jpushTargets
=
new
LinkedHashSet
<>();
JpushMsgBo
jpushMsgBo
=
new
JpushMsgBo
();
MsgParamBo
msgParamBo
=
new
MsgParamBo
();
if
(
newLevel
!=
null
)
{
//1.2根据风险等级对应的责任等级获取责任人
jpushTargets
=
getJpushTarget
(
toke
,
product
,
appKey
,
fmea
,
newLevel
.
getManageLevel
());
fmea
.
setRiskLevelId
(
newLevel
.
getId
());
msgParamBo
.
setAppKey
(
appKey
);
msgParamBo
.
setToke
(
toke
);
msgParamBo
.
setProduct
(
product
);
msgParamBo
.
setFmea
(
fmea
);
msgParamBo
.
setManagerLevel
(
newLevel
.
getManageLevel
());
msgParamBo
.
setLevel
(
newLevel
.
getName
());
msgParamBo
.
setUserName
(
userName
);
msgParamBo
.
setNotifyType
(
notifyType
);
msgParamBo
.
setRelationName
(
relationName
);
jpushMsgBo
=
this
.
getJushMessageInfo
(
msgParamBo
);
}
//1.3.更新fmea的rpn、风险等级及newOid
fmeaMapper
.
updateRpn
(
fmea
);
//2.计算风险点rpn、rpni、riskLevelId
this
.
notifyRiskSource
(
fmeaId
,
fmea
.
getRiskSourceId
(),
notifyType
,
jpush
Targets
);
this
.
notifyRiskSource
(
fmeaId
,
fmea
.
getRiskSourceId
(),
notifyType
,
jpush
MsgBo
);
}
}
}
}
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
.
setRiskSourceId
(
riskSourceId
);
rpnChangeLog
.
setRpn
(
rpn
);
...
...
@@ -1239,6 +1300,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
rpnChangeLog
.
setTriggerBy
(
fmeaId
);
rpnChangeLog
.
setTriggerType
(
notifyType
);
rpnChangeLog
.
setFmeaId
(
fmeaId
);
rpnChangeLog
.
setTriggerType
(
notifyType
);
iRpnChangeLogDao
.
save
(
rpnChangeLog
);
}
...
...
@@ -1256,7 +1318,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
* fmea的更新导致rpn、rpni的值改变
*/
@Override
public
void
notifyRiskSource
(
Long
fmeaId
,
Long
riskSourceId
,
String
notifyType
,
Set
<
String
>
jpushTargets
)
{
public
void
notifyRiskSource
(
Long
fmeaId
,
Long
riskSourceId
,
String
notifyType
,
JpushMsgBo
jpushMsgBo
)
{
Optional
<
RiskSource
>
riskSource1
=
iRiskSourceDao
.
findById
(
riskSourceId
);
RiskSource
riskSource
=
null
;
if
(
riskSource1
.
isPresent
())
{
...
...
@@ -1265,7 +1327,7 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
return
;
}
List
<
Fmea
>
fmeas
=
fmeaMapper
.
listByRiskSourceId
(
riskSourceId
);
if
(
CollectionUtils
.
isEmpty
(
fmeas
))
{
//fema删除
if
(
CollectionUtils
.
isEmpty
(
fmeas
))
{
//fema
全部
删除
BigDecimal
resetValue
=
new
BigDecimal
(
"0"
);
riskSource
.
setRpn
(
null
);
riskSource
.
setRpni
(
null
);
...
...
@@ -1275,9 +1337,10 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
riskSourceMapper
.
updateRpn
(
riskSource
);
//2.记录风险点rpn变化流水
this
.
saveRpnLog
(
riskSource
.
getId
(),
fmeaId
,
resetValue
,
resetValue
,
notifyType
);
//3.更新父节点rpn、rpni、风险等级
this
.
updateParentRpn
(
riskSource
.
getParentId
());
//4.知全景监控屏幕数据刷新
//4.
通
知全景监控屏幕数据刷新
iDataRefreshService
.
refreshViewData
(
DataRefreshTypeEum
.
rpn
.
getCode
());
}
else
{
//fmea评价、巡检、告警
RpnCalculationBo
rpnValueBo
=
RpnUtils
.
calRpnAndRpni
(
fmeas
);
...
...
@@ -1299,10 +1362,11 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
riskSourceMapper
.
updateRpn
(
riskSource
);
//2.记录风险点rpn变化流水
this
.
saveRpnLog
(
riskSource
.
getId
(),
fmeaId
,
rpn
,
rpni
,
notifyType
);
//3.更新父节点rpn、rpni、风险等级
this
.
updateParentRpn
(
riskSource
.
getParentId
());
//4.极光推送给手机客户端
jpushRiskSourceMessage
(
"风险预警"
,
jpushTargets
);
jpushRiskSourceMessage
(
jpushMsgBo
);
//5.规则告警(消息)TODO
notifyRule
(
riskSourceId
,
rpn
,
rpni
,
notifyType
,
changeType
);
//6.通知全景监控屏幕数据刷新
...
...
@@ -1385,17 +1449,21 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
/**
* 极光推送
*/
private
void
jpushRiskSourceMessage
(
String
content
,
Set
<
String
>
jpushTarget
)
{
if
(
CollectionUtils
.
isEmpty
(
jpushTarget
)
)
{
private
void
jpushRiskSourceMessage
(
JpushMsgBo
jpushMsgBo
)
{
if
(
jpushMsgBo
==
null
)
{
return
;
}
JpushMsgContentBo
jpushMsgContentBo
=
jpushMsgBo
.
getMsg
();
Set
<
String
>
target
=
jpushMsgBo
.
getTarget
();
if
(
jpushMsgContentBo
.
getSend
()){
PushMsgParam
pushMsgParam
=
new
PushMsgParam
();
pushMsgParam
.
setRecivers
(
Lists
.
newArrayList
(
jpushT
arget
));
pushMsgParam
.
setContent
(
content
);
pushMsgParam
.
setSubject
(
"风险点RPN值改变"
);
pushMsgParam
.
setRecivers
(
Lists
.
newArrayList
(
t
arget
));
pushMsgParam
.
setContent
(
jpushMsgContentBo
.
genMessage
()
);
pushMsgParam
.
setSubject
(
jpushMsgContentBo
.
getSubject
()
);
pushMsgParam
.
setType
(
JPushTypeEnum
.
ALIAS
.
getCode
());
appMessagePushService
.
sendMessage
(
pushMsgParam
);
}
}
/**
* 规则告警
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/RuleRunigSnapshotServiceImpl.java
0 → 100644
View file @
3d4be07d
package
com
.
yeejoin
.
amos
.
fas
.
business
.
service
.
impl
;
import
java.lang.reflect.Method
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.UUID
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.StringUtils
;
import
org.typroject.tyboot.core.foundation.context.SpringContextHelper
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.yeejoin.amos.fas.business.action.CustomerAction
;
import
com.yeejoin.amos.fas.business.dao.mapper.RuleRuningSnapshotMapper
;
import
com.yeejoin.amos.fas.business.service.intfc.IRuleRunningSnapshotService
;
import
com.yeejoin.amos.fas.business.service.model.BasicsRo
;
import
com.yeejoin.amos.fas.business.service.model.RuleRuningSnapshot
;
/**
*
* <pre>
* 三维节点与规则消息实体视图service实现
* </pre>
*
* @author amos
* @version $Id: NodeMsgViewServiceImpl.java, v 0.1 2018年11月28日 下午6:14:51 amos Exp
* $
*/
@Service
(
"ruleRunningSnapshotService"
)
public
class
RuleRunigSnapshotServiceImpl
implements
IRuleRunningSnapshotService
//,ExecuteMethodHook
{
//IRuleRuningSnapshotRepository repository;
private
RuleRuningSnapshotMapper
ruleRuningSnapshotMapper
;
private
static
String
replayBatchNo
=
null
;
static
ObjectMapper
objectMapper
;
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
RuleRunigSnapshotServiceImpl
.
class
);
static
{
objectMapper
=
new
ObjectMapper
();
}
// public RuleRunigSnapshotServiceImpl(IRuleRuningSnapshotRepository repository)
// {
// super(repository);
// // TODO Auto-generated constructor stub
// this.repository = repository;
// ExecuteMethodHook.hook.add(this);
// }
//
//
// /**
// * 保存动作记录
// * @param methodName
// * @param paramsAndTypes
// * @param matchedObj
// */
// public void process(Object bean,String methodName,String paramsAndTypes,Object matchedObj)
// {
//
// if(bean instanceof CustomerAction)
// {
// Set set = (Set) matchedObj;
// BasicsRo fireEquimentDataRo = (BasicsRo) set.iterator().next();
//
// RuleRuningSnapshot ruleRuningSnapshot = new RuleRuningSnapshot();
// ruleRuningSnapshot.setId(UUID.randomUUID().toString());
// ruleRuningSnapshot.setMethodClass(bean.getClass().getName());
// ruleRuningSnapshot.setMethodName(methodName);
// ruleRuningSnapshot.setMethodParam(paramsAndTypes);
//
// ruleRuningSnapshot.setBatchNo(fireEquimentDataRo.getBatchNo());
// ruleRuningSnapshot.setPackageId(fireEquimentDataRo.getPackageId());
// ruleRuningSnapshot.setEquipmentId(String.valueOf(fireEquimentDataRo.getId()));
//
// Date now = new Date();
// ruleRuningSnapshot.setCreateTime(now);
// ruleRuningSnapshot.setCreateMillisecond(String.valueOf(now.getTime()));
// ruleRuningSnapshot.setPreviousInterval(0L);
// RuleRuningSnapshot oldEntity = repository.querForObject(fireEquimentDataRo.getBatchNo());
// if(oldEntity != null)
// ruleRuningSnapshot.setPreviousInterval(now.getTime() - Long.parseLong(oldEntity.getCreateMillisecond()));
// this.repository.save(ruleRuningSnapshot);
// }
// }
@Async
public
void
replay
(
String
batchNo
)
throws
Exception
{
if
(
replayBatchNo
!=
null
)
throw
new
Exception
(
"一次只能回放一个预案记录."
);
try
{
replayBatchNo
=
batchNo
;
List
<
RuleRuningSnapshot
>
oldEntityList
=
ruleRuningSnapshotMapper
.
querForObjectList
(
batchNo
);
// List<RuleRuningSnapshot> oldEntityList = repository.querForObjectList(batchNo);
if
(!
CollectionUtils
.
isEmpty
(
oldEntityList
))
{
logger
.
info
(
"开始回放:batchNo="
+
batchNo
);
logger
.
info
(
"获取到动作记录个数:"
+
oldEntityList
.
size
());
int
count
=
0
;
for
(
RuleRuningSnapshot
snapshot
:
oldEntityList
)
{
if
(
replayBatchNo
==
null
)
return
;
//延迟
logger
.
info
(
"开始执行第"
+(++
count
)+
"个动作."
);
logger
.
info
(
"方法名:"
+
snapshot
.
getMethodClass
()+
"."
+
snapshot
.
getMethodName
());
logger
.
info
(
"需要延迟"
+
snapshot
.
getPreviousInterval
()+
"毫秒......."
);
Thread
.
sleep
(
snapshot
.
getPreviousInterval
());
try
{
Class
clzz
=
Class
.
forName
(
snapshot
.
getMethodClass
());
Object
obj
=
SpringContextHelper
.
getBean
(
clzz
);
Method
[]
methods
=
clzz
.
getMethods
();
if
(!
StringUtils
.
isEmpty
(
snapshot
.
getMethodParam
()))
{
for
(
Method
method:
methods
)
{
if
(
replayBatchNo
==
null
)
return
;
String
name
=
method
.
getName
();
if
(!
name
.
equals
(
snapshot
.
getMethodName
())){
continue
;
}
Map
paramsMap
=
objectMapper
.
readValue
(
snapshot
.
getMethodParam
(),
Map
.
class
);
List
<
String
>
datatypes
=
(
List
<
String
>)
paramsMap
.
get
(
"datatypes"
);
List
<
Object
>
values
=
(
List
<
Object
>)
paramsMap
.
get
(
"values"
);
Object
[]
params
=
new
Object
[
values
.
size
()];
for
(
int
i
=
0
;
i
<
datatypes
.
size
();
i
++)
{
if
(
replayBatchNo
==
null
)
return
;
String
typeStr
=
datatypes
.
get
(
i
);
Object
value
=
values
.
get
(
i
);
String
valueStr
=
objectMapper
.
writeValueAsString
(
value
);
Class
valueClzz
=
Class
.
forName
(
typeStr
);
params
[
i
]
=
objectMapper
.
readValue
(
valueStr
,
valueClzz
);
}
method
.
invoke
(
obj
,
params
);
}
}
else
{
Method
method
=
clzz
.
getMethod
(
snapshot
.
getMethodName
(),
new
Class
[]{});
method
.
invoke
(
obj
);
}
logger
.
info
(
"第"
+(
count
)+
"个动作执行成功."
);
}
catch
(
Exception
e
)
{
logger
.
info
(
"第"
+(
count
)+
"个动作执行失败."
);
e
.
printStackTrace
();
logger
.
error
(
e
.
getMessage
(),
e
);
}
}
}
}
catch
(
Exception
e
)
{
logger
.
info
(
"回放失败."
);
logger
.
error
(
e
.
getMessage
(),
e
);
}
finally
{
replayBatchNo
=
null
;
}
}
public
static
String
getReplayBatchNo
()
{
return
replayBatchNo
;
}
public
static
void
setReplayBatchNoToNull
()
{
RuleRunigSnapshotServiceImpl
.
replayBatchNo
=
null
;
}
}
\ No newline at end of file
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/View3dServiceImpl.java
View file @
3d4be07d
...
...
@@ -310,9 +310,8 @@ public class View3dServiceImpl implements IView3dService {
//3.统计巡检异常数量(不合格、漏检)-日期+机构
Long
checkExceptionNum
=
this
.
getCheckExceptionNum
(
orgCode
,
date
);
vo
.
setCheckExceptionNum
(
checkExceptionNum
);
//4.统计火灾报警数量-日期+机构
//TODO:待毛颖确认调整完成后继续
vo
.
setFireExceptionNum
(
0L
);
//4.统计故障数量-日期+机构
vo
.
setFireExceptionNum
(
getFireExceptionNum
(
orgCode
,
date
));
}
else
{
throw
new
YeeException
(
"机构:"
+
orgCode
+
" 不存在"
);
}
...
...
@@ -354,6 +353,15 @@ public class View3dServiceImpl implements IView3dService {
});
}
else
if
(
StatisticsErrorTypeEum
.
equip
.
getCode
().
equals
(
type
)){
//TODO:待毛颖确认调整完成后继续
List
<
CheckErrorBo
>
checkErrorBoList
=
view3dMapper
.
getAllFaultAlarm
(
params
);
Map
<
String
,
List
<
CheckErrorBo
>>
map
=
checkErrorBoList
.
stream
().
collect
(
Collectors
.
groupingBy
(
CheckErrorBo:
:
getStatus
));
map
.
forEach
((
k
,
v
)->{
SafetyIndexDetailVo
safetyIndexDetailVo
=
new
SafetyIndexDetailVo
();
safetyIndexDetailVo
.
setTypeCode
(
k
);
safetyIndexDetailVo
.
setTypeName
(
k
);
safetyIndexDetailVo
.
setContent
(
getErrorContentVos
(
v
));
resultList
.
add
(
safetyIndexDetailVo
);
});
}
return
resultList
;
}
...
...
@@ -383,6 +391,13 @@ public class View3dServiceImpl implements IView3dService {
return
view3dMapper
.
countUpperRiskPoint
(
param
);
}
private
Long
getFireExceptionNum
(
String
orgCode
,
String
date
)
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"orgCode"
,
orgCode
);
params
.
put
(
"date"
,
date
);
return
view3dMapper
.
countFireException
(
params
);
}
private
double
changeRpnToSafetyIndex
(
BigDecimal
rpn
)
{
BigDecimal
rpnBig
=
rpn
==
null
?
new
BigDecimal
(
"0"
)
:
rpn
;
//计算规则:除10 减100 求绝对值,结果保留1位小数
...
...
@@ -408,9 +423,8 @@ public class View3dServiceImpl implements IView3dService {
if
(
optional
.
isPresent
())
{
List
<
RiskSource
>
regionList
=
iRiskSourceDao
.
findByParentIdAndIsRegion
(
optional
.
get
().
getId
(),
RiskSourceRegionEum
.
TRUE
.
getCode
());
exceptionList
=
regionList
.
stream
().
filter
(
riskSource
->
{
//TODO:待毛颖确认,增加判断故障的规则(统计数据:故障或者rpn上升)
BigDecimal
rpnBig
=
riskSource
.
getRpn
()
==
null
?
new
BigDecimal
(
"0"
)
:
riskSource
.
getRpn
();
return
rpnBig
.
subtract
(
riskSource
.
getRpni
()).
doubleValue
()
>
0
;
BigDecimal
rpn
=
riskSource
.
getRpn
()
==
null
?
new
BigDecimal
(
"0"
)
:
riskSource
.
getRpn
();
return
rpn
.
subtract
(
riskSource
.
getRpni
()).
doubleValue
()
>
0
;
}).
map
(
riskSource
->
{
ExceptionRegionVo
regionVo
=
new
ExceptionRegionVo
();
regionVo
.
setId
(
riskSource
.
getId
());
...
...
@@ -418,7 +432,8 @@ public class View3dServiceImpl implements IView3dService {
regionVo
.
setUe4Rotation
(
getInitJSONArray
(
riskSource
.
getUe4Rotation
()));
regionVo
.
setUe4Extent
(
getInitJSONArray
(
riskSource
.
getUe4Extent
()));
regionVo
.
setSafetyIndex
(
changeRpnToSafetyIndex
(
riskSource
.
getRpn
()));
regionVo
.
setBreakdown
(
isBreakDown
(
riskSource
.
getId
()));
regionVo
.
setBreakdown
(
isBreakDown
(
riskSource
.
getId
()));
//待后期去掉,前端图标显示统一不在细分
regionVo
.
setRoutePath
(
this
.
changeStringToJson
(
riskSource
.
getRoutePath
()));
return
regionVo
;
}).
collect
(
Collectors
.
toList
());
}
...
...
@@ -433,8 +448,15 @@ public class View3dServiceImpl implements IView3dService {
}
}
private
JSONObject
changeStringToJson
(
String
str
){
if
(
StringUtil
.
isNotEmpty
(
str
)){
return
JSON
.
parseObject
(
str
);
}
else
{
return
new
JSONObject
();
}
}
private
Boolean
isBreakDown
(
Long
id
){
//TODO:判断是否故障,待毛颖确认
return
true
;
}
...
...
@@ -468,23 +490,24 @@ public class View3dServiceImpl implements IView3dService {
case
"check"
:
//巡检异常
return
view3dMapper
.
getCheckErrorTop5
(
orgCode
);
case
"fire"
:
return
JSON
.
parseArray
(
" [\r\n"
+
" {\r\n"
+
" \"id\": 35781,\r\n"
+
" \"code\": \"s001\",\r\n"
+
" \"label\": \"设备test\",\r\n"
+
" \"pointId\": \"1\",\r\n"
+
" \"type\": \"check\",\r\n"
+
" \"changeDate\": \"2020-04-23 14:31:31\"\r\n"
+
" },\r\n"
+
" {\r\n"
+
" \"id\": 35780,\r\n"
+
" \"code\": \"s002\",\r\n"
+
" \"label\": \"设备002\",\r\n"
+
" \"pointId\": \"23123\",\r\n"
+
" \"type\": \"check\",\r\n"
+
" \"changeDate\": \"2020-04-23 14:31:27\"\r\n"
+
" }]"
,
SafetyExecuteBo
.
class
);
return
view3dMapper
.
getFireAlarmTop5
(
orgCode
);
// return JSON.parseArray(" [\r\n" +
// " {\r\n" +
// " \"id\": 35781,\r\n" +
// " \"code\": \"s001\",\r\n" +
// " \"label\": \"设备test\",\r\n" +
// " \"pointId\": \"1\",\r\n" +
// " \"type\": \"check\",\r\n" +
// " \"changeDate\": \"2020-04-23 14:31:31\"\r\n" +
// " },\r\n" +
// " {\r\n" +
// " \"id\": 35780,\r\n" +
// " \"code\": \"s002\",\r\n" +
// " \"label\": \"设备002\",\r\n" +
// " \"pointId\": \"23123\",\r\n" +
// " \"type\": \"check\",\r\n" +
// " \"changeDate\": \"2020-04-23 14:31:27\"\r\n" +
// " }]", SafetyExecuteBo.class);
default
:
throw
new
YeeException
(
"不支持的类型 -->"
+
type
);
}
...
...
@@ -500,9 +523,10 @@ public class View3dServiceImpl implements IView3dService {
}
@Override
public
Object
getEquipStatusList
(
String
orgCode
)
{
return
JSON
.
parseArray
(
"[{\"id\":1,\"label\":\"设备1 label\",\"changeDate\":\"2020-04-26 10:00:00\"}"
+
",{\"id\":2,\"label\":\"设备2 label\",\"changeDate\":\"2020-04-25 10:00:00\"}]"
);
public
List
<
SafetyExecuteBo
>
getEquipStatusList
(
String
orgCode
)
{
return
view3dMapper
.
getEquipStatusTop5
(
orgCode
);
// return JSON.parseArray("[{\"id\":1,\"label\":\"设备1 label\",\"changeDate\":\"2020-04-26 10:00:00\"}"
// + ",{\"id\":2,\"label\":\"设备2 label\",\"changeDate\":\"2020-04-25 10:00:00\"}]");
}
@Override
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/IContingencyInstance.java
View file @
3d4be07d
...
...
@@ -20,5 +20,5 @@ public interface IContingencyInstance {
void
fire
(
String
batchNo
,
String
stepCode
,
String
contingencyPlanId
,
String
buttonCode
,
String
buttonState
,
String
stepStateOnbutton
)
throws
Exception
;
void
updateStep
(
String
step
,
String
batchNo
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/IFmeaService.java
View file @
3d4be07d
...
...
@@ -20,7 +20,7 @@ public interface IFmeaService {
/**
* 分页查询Fmea
*/
Page
<
HashMap
<
String
,
Object
>>
queryFmeaList
(
CommonPageInfoParam
param
);
Page
<
HashMap
<
String
,
Object
>>
queryFmeaList
(
CommonPageInfoParam
param
,
String
toke
,
String
product
,
String
appKey
);
//
// void updateRpniInfo(Long riskSourceId);
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/IRiskSourceService.java
View file @
3d4be07d
package
com
.
yeejoin
.
amos
.
fas
.
business
.
service
.
intfc
;
import
com.yeejoin.amos.fas.business.bo.BindRegionBo
;
import
com.yeejoin.amos.fas.business.bo.JpushMsgBo
;
import
com.yeejoin.amos.fas.business.param.AlarmParam
;
import
com.yeejoin.amos.fas.business.param.CommonPageInfoParam
;
import
com.yeejoin.amos.fas.business.param.FmeaBindParam
;
...
...
@@ -108,9 +109,9 @@ public interface IRiskSourceService {
Integer
getChildTypeByPid
(
Long
riskSourceId
);
void
notifyFmeaFromAbnormal
(
String
toke
,
String
product
,
String
appKey
,
Long
fmeaId
,
String
notifyType
);
void
notifyFmeaFromAbnormal
(
String
toke
,
String
product
,
String
appKey
,
Long
fmeaId
,
String
notifyType
,
String
userName
,
String
relationName
);
void
notifyFmeaFromUpdate
(
String
toke
,
String
product
,
String
appKey
,
Long
fmeaId
,
String
nofityType
);
void
notifyFmeaFromUpdate
(
String
toke
,
String
product
,
String
appKey
,
Long
fmeaId
,
String
nofityType
,
String
userName
);
/**
* 按照机构重新区域树
...
...
@@ -133,7 +134,7 @@ public interface IRiskSourceService {
*/
void
batchSaveRegionUe4
(
List
<
BindRegionBo
>
regionBoList
);
void
notifyRiskSource
(
Long
fmeaId
,
Long
riskSourceId
,
String
notifyType
,
Set
<
String
>
jpushTargets
);
void
notifyRiskSource
(
Long
fmeaId
,
Long
riskSourceId
,
String
notifyType
,
JpushMsgBo
jpushMsgBo
);
void
notifyFmeaFromDelete
(
Long
handId
,
String
from
);
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/IRuleRunningSnapshotService.java
0 → 100644
View file @
3d4be07d
package
com
.
yeejoin
.
amos
.
fas
.
business
.
service
.
intfc
;
/**
*
* <pre>
* 三维节点与规则消息实体视图service
* </pre>
*
* @version $Id: INodeMsgViewService.java, v 0.1 2019年1月2日 下午2:48:40 amos Exp $
*/
public
interface
IRuleRunningSnapshotService
{
void
replay
(
String
batchNo
)
throws
Exception
;
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/IView3dService.java
View file @
3d4be07d
...
...
@@ -112,7 +112,7 @@ public interface IView3dService {
* @param orgCode
* @return
*/
Object
getEquipStatusList
(
String
orgCode
);
List
<
SafetyExecuteBo
>
getEquipStatusList
(
String
orgCode
);
/**
* 左侧菜单(异常点)
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/model/ProtalDataRo.java
View file @
3d4be07d
...
...
@@ -21,6 +21,11 @@ public class ProtalDataRo extends BasicsRo {
private
String
userName
;
/**
* 巡检人员
*/
private
String
checkUser
;
/**
* 任务编号,如果无任务,则填充0
*/
private
long
taskId
=
0
;
...
...
@@ -92,6 +97,14 @@ public class ProtalDataRo extends BasicsRo {
this
.
originalTaskState
=
originalTaskState
;
}
public
String
getCheckUser
()
{
return
checkUser
;
}
public
void
setCheckUser
(
String
checkUser
)
{
this
.
checkUser
=
checkUser
;
}
public
String
getTaskName
()
{
return
taskName
;
}
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/model/RuleRuningSnapshot.java
0 → 100644
View file @
3d4be07d
package
com
.
yeejoin
.
amos
.
fas
.
business
.
service
.
model
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
import
java.io.Serializable
;
import
java.util.Date
;
@Entity
@Table
(
name
=
"toip_rm_snapshot"
)
public
class
RuleRuningSnapshot
implements
Serializable
{
private
static
final
long
serialVersionUID
=
292329658525267887L
;
@Id
private
String
id
;
@Column
(
name
=
"batch_no"
)
private
String
batchNo
;
// '规则执行的批次号',
@Column
(
name
=
"package_id"
)
private
String
packageId
;
// '规则包id',
@Column
(
name
=
"method_class"
)
private
String
methodClass
;
// 'bean方法的类名',
@Column
(
name
=
"method_name"
)
private
String
methodName
;
// 'bean方法名',
@Column
(
name
=
"equipment_id"
)
private
String
equipmentId
;
// '设备类型',
@Column
(
name
=
"method_param"
)
private
String
methodParam
;
// 方法参数',
@Column
(
name
=
"create_time"
)
private
Date
createTime
;
// 创建时间',
@Column
(
name
=
"create_millisecond"
)
private
String
createMillisecond
;
// 当前动作执行时的毫秒数',
@Column
(
name
=
"previous_interval"
)
private
Long
previousInterval
;
// 与上一次的动作执行的时间差',
public
String
getId
()
{
return
id
;
}
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
}
public
String
getBatchNo
()
{
return
batchNo
;
}
public
void
setBatchNo
(
String
batchNo
)
{
this
.
batchNo
=
batchNo
;
}
public
String
getPackageId
()
{
return
packageId
;
}
public
void
setPackageId
(
String
packageId
)
{
this
.
packageId
=
packageId
;
}
public
String
getMethodClass
()
{
return
methodClass
;
}
public
void
setMethodClass
(
String
methodClass
)
{
this
.
methodClass
=
methodClass
;
}
public
String
getMethodName
()
{
return
methodName
;
}
public
void
setMethodName
(
String
methodName
)
{
this
.
methodName
=
methodName
;
}
public
String
getEquipmentId
()
{
return
equipmentId
;
}
public
void
setEquipmentId
(
String
equipmentId
)
{
this
.
equipmentId
=
equipmentId
;
}
public
String
getMethodParam
()
{
return
methodParam
;
}
public
void
setMethodParam
(
String
methodParam
)
{
this
.
methodParam
=
methodParam
;
}
public
Date
getCreateTime
()
{
return
createTime
;
}
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
public
String
getCreateMillisecond
()
{
return
createMillisecond
;
}
public
void
setCreateMillisecond
(
String
createMillisecond
)
{
this
.
createMillisecond
=
createMillisecond
;
}
public
Long
getPreviousInterval
()
{
return
previousInterval
;
}
public
void
setPreviousInterval
(
Long
previousInterval
)
{
this
.
previousInterval
=
previousInterval
;
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/model/ToipResponse.java
0 → 100644
View file @
3d4be07d
package
com
.
yeejoin
.
amos
.
fas
.
business
.
service
.
model
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.dao.entity.BusinessEntity
;
/**
*
* <pre>
*
* </pre>
*
* @author HK
* @version $Id: ToipResponse.java, v 0.1 2018年1月26日 下午5:02:12 HK Exp $
*/
public
class
ToipResponse
extends
CommonResponse
{
// 具体界面域由三部分组成: [IFDomain].[group].[template], 其中 group可选 [IFDomain].[template]
// dispatch.map.marker.basic
/**
* <pre>
*
* </pre>
*/
private
static
final
long
serialVersionUID
=
1L
;
/**
* 界面域
* 例如
* dispatch.map
*/
private
String
IFDomain
;
/**
* 模板类型
* 例如
* basic
*/
private
String
template
;
/**
* 模板组
* 例如
* marker
*/
private
String
group
;
/**
* 智能体业务对象
*/
private
BusinessEntity
bizObj
;
/**
* 动作ID
*/
private
String
actionId
;
/**
* 火灾id
*/
private
String
fireId
;
private
String
domainView
;
public
String
getIFDomain
()
{
return
IFDomain
;
}
public
void
setIFDomain
(
String
iFDomain
)
{
IFDomain
=
iFDomain
;
}
public
String
getTemplate
()
{
return
template
;
}
public
void
setTemplate
(
String
template
)
{
this
.
template
=
template
;
}
public
String
getGroup
()
{
return
group
;
}
public
void
setGroup
(
String
group
)
{
this
.
group
=
group
;
}
public
BusinessEntity
getBizObj
()
{
return
bizObj
;
}
public
void
setBizObj
(
BusinessEntity
bizObj
)
{
this
.
bizObj
=
bizObj
;
}
public
String
getActionId
()
{
return
actionId
;
}
public
void
setActionId
(
String
actionId
)
{
this
.
actionId
=
actionId
;
}
public
String
getDomainView
()
{
return
domainView
;
}
public
void
setDomainView
(
String
domainView
)
{
this
.
domainView
=
domainView
;
}
public
String
getFireId
()
{
return
fireId
;
}
public
void
setFireId
(
String
fireId
)
{
this
.
fireId
=
fireId
;
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/vo/ExceptionRegionVo.java
View file @
3d4be07d
package
com
.
yeejoin
.
amos
.
fas
.
business
.
vo
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
springfox.documentation.spring.web.json.Json
;
/**
* @author suhg
*/
...
...
@@ -32,6 +36,11 @@ public class ExceptionRegionVo {
*/
private
JSONArray
ue4Extent
;
/**
* 自研3维区域参数
*/
private
JSONObject
routePath
;
public
Long
getId
()
{
return
id
;
}
...
...
@@ -68,6 +77,14 @@ public class ExceptionRegionVo {
return
ue4Extent
;
}
public
JSONObject
getRoutePath
()
{
return
routePath
;
}
public
void
setRoutePath
(
JSONObject
routePath
)
{
this
.
routePath
=
routePath
;
}
public
void
setUe4Extent
(
JSONArray
ue4Extent
)
{
this
.
ue4Extent
=
ue4Extent
;
}
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/client/invoke/FmeaMessage.java
View file @
3d4be07d
...
...
@@ -6,11 +6,39 @@ public class FmeaMessage {
private
String
norifyFrom
;
private
String
userName
;
/**
* 设备名称或者巡检点名称
*/
private
String
relationName
;
private
String
checkStatus
;
public
FmeaMessage
(
Long
handId
,
String
norifyFrom
,
String
userName
)
{
this
.
handId
=
handId
;
this
.
norifyFrom
=
norifyFrom
;
this
.
userName
=
userName
;
}
public
FmeaMessage
(
Long
handId
,
String
norifyFrom
)
{
this
.
handId
=
handId
;
this
.
norifyFrom
=
norifyFrom
;
}
public
FmeaMessage
(
Long
handId
,
String
norifyFrom
,
String
userName
,
String
relationName
,
String
checkStatus
)
{
this
.
handId
=
handId
;
this
.
norifyFrom
=
norifyFrom
;
this
.
userName
=
userName
;
this
.
relationName
=
relationName
;
this
.
checkStatus
=
checkStatus
;
}
public
Long
getHandId
()
{
return
handId
;
}
...
...
@@ -26,4 +54,28 @@ public class FmeaMessage {
public
void
setNorifyFrom
(
String
norifyFrom
)
{
this
.
norifyFrom
=
norifyFrom
;
}
public
String
getUserName
()
{
return
userName
;
}
public
void
setUserName
(
String
userName
)
{
this
.
userName
=
userName
;
}
public
String
getRelationName
()
{
return
relationName
;
}
public
void
setRelationName
(
String
relationName
)
{
this
.
relationName
=
relationName
;
}
public
String
getCheckStatus
()
{
return
checkStatus
;
}
public
void
setCheckStatus
(
String
checkStatus
)
{
this
.
checkStatus
=
checkStatus
;
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/client/invoke/RsDataQueue.java
View file @
3d4be07d
...
...
@@ -26,12 +26,11 @@ public class RsDataQueue {
private
IRiskSourceService
riskSourceService
;
private
volatile
static
RsDataQueue
instance
=
null
;
private
static
final
String
TOKE
=
"TOKE"
;
@Autowired
private
RemoteSecurityService
remoteSecurityService
;
private
RsDataQueue
()
{
riskSourceService
=
(
IRiskSourceService
)
IotContext
.
getInstance
().
getBean
(
IRiskSourceService
.
class
);
remoteSecurityService
=
(
RemoteSecurityService
)
IotContext
.
getInstance
().
getBean
(
RemoteSecurityService
.
class
);
}
/**
...
...
@@ -62,16 +61,21 @@ public class RsDataQueue {
service_apdu
.
execute
(
task_runnable
);
}
public
void
addUpdateMessage
(
Long
fmeaId
)
{
blockingQueue
.
add
(
new
FmeaMessage
(
fmeaId
,
TriggerRpnChangeTypeEum
.
fmeaUpdate
.
getCode
()));
public
void
addUpdateMessage
(
Long
fmeaId
,
String
userName
)
{
blockingQueue
.
add
(
new
FmeaMessage
(
fmeaId
,
TriggerRpnChangeTypeEum
.
fmeaUpdate
.
getCode
()
,
userName
));
}
public
void
addPatrolMessage
(
Long
fmeaId
)
{
blockingQueue
.
add
(
new
FmeaMessage
(
fmeaId
,
TriggerRpnChangeTypeEum
.
patrol
.
getCode
()));
}
public
void
addEquipmentMessage
(
Long
fmeaId
)
{
blockingQueue
.
add
(
new
FmeaMessage
(
fmeaId
,
TriggerRpnChangeTypeEum
.
equipment
.
getCode
()));
public
void
addPatrolMessage
(
Long
fmeaId
,
String
userName
,
String
pointName
,
String
checkStatus
)
{
blockingQueue
.
add
(
new
FmeaMessage
(
fmeaId
,
TriggerRpnChangeTypeEum
.
patrol
.
getCode
(),
userName
,
pointName
,
checkStatus
));
}
public
void
addEquipmentMessage
(
Long
fmeaId
,
String
equipmentName
)
{
blockingQueue
.
add
(
new
FmeaMessage
(
fmeaId
,
TriggerRpnChangeTypeEum
.
alarm
.
getCode
(),
""
,
equipmentName
,
""
));
}
public
void
addDeleteMessage
(
Long
riskSourceId
)
{
...
...
@@ -99,15 +103,17 @@ public class RsDataQueue {
}
String
from
=
fmeaMessage
.
getNorifyFrom
();
Long
handId
=
fmeaMessage
.
getHandId
();
String
userName
=
fmeaMessage
.
getUserName
();
String
relationName
=
fmeaMessage
.
getRelationName
();
if
(
from
.
equals
(
TriggerRpnChangeTypeEum
.
patrol
.
getCode
()))
{
//巡检不合格通知
riskSourceService
.
notifyFmeaFromAbnormal
(
toke
.
getToke
(),
toke
.
getProduct
(),
toke
.
getAppKey
(),
handId
,
from
);
}
else
if
(
from
.
equals
(
TriggerRpnChangeTypeEum
.
equipment
.
getCode
()))
{
riskSourceService
.
notifyFmeaFromAbnormal
(
toke
.
getToke
(),
toke
.
getProduct
(),
toke
.
getAppKey
(),
handId
,
from
,
userName
,
relationName
);
}
else
if
(
from
.
equals
(
TriggerRpnChangeTypeEum
.
alarm
.
getCode
()))
{
//设备告警
riskSourceService
.
notifyFmeaFromAbnormal
(
toke
.
getToke
(),
toke
.
getProduct
(),
toke
.
getAppKey
(),
handId
,
from
);
riskSourceService
.
notifyFmeaFromAbnormal
(
toke
.
getToke
(),
toke
.
getProduct
(),
toke
.
getAppKey
(),
handId
,
from
,
userName
,
relationName
);
}
else
if
(
from
.
equals
(
TriggerRpnChangeTypeEum
.
fmeaUpdate
.
getCode
()))
{
//危险因素评价修改通知
riskSourceService
.
notifyFmeaFromUpdate
(
toke
.
getToke
(),
toke
.
getProduct
(),
toke
.
getAppKey
(),
handId
,
from
);
riskSourceService
.
notifyFmeaFromUpdate
(
toke
.
getToke
(),
toke
.
getProduct
(),
toke
.
getAppKey
(),
handId
,
from
,
userName
);
}
else
if
(
from
.
equals
(
TriggerRpnChangeTypeEum
.
fmeaDelete
.
getCode
()))
{
//危险因素删除通知
riskSourceService
.
notifyFmeaFromDelete
(
handId
,
from
);
...
...
@@ -117,7 +123,7 @@ public class RsDataQueue {
}
}
}
catch
(
Exception
e
)
{
LoggerFactory
.
getLogger
(
this
.
getClass
()).
error
(
e
.
getMessage
());
LoggerFactory
.
getLogger
(
this
.
getClass
()).
error
(
e
.
getMessage
()
,
e
);
}
}
}
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/core/util/StringUtil.java
View file @
3d4be07d
...
...
@@ -62,14 +62,15 @@ public class StringUtil {
*/
public
static
boolean
isNumeric
(
String
str
)
{
// 该正则表达式可以匹配所有的数字 包括负数
Pattern
pattern
=
Pattern
.
compile
(
"-?[0-9]+(\\.[0-9]+)?"
);
String
bigStr
;
try
{
bigStr
=
new
BigDecimal
(
str
).
toString
();
}
catch
(
Exception
e
)
{
return
false
;
//
异常 说明包含非数字。
return
false
;
//
异常 说明包含非数字。
}
Matcher
isNum
=
numericP
attern
.
matcher
(
bigStr
);
// matcher是全匹配
Matcher
isNum
=
p
attern
.
matcher
(
bigStr
);
// matcher是全匹配
if
(!
isNum
.
matches
())
{
return
false
;
}
...
...
YeeAmosFireAutoSysStart/src/main/resources/application-dev.properties
View file @
3d4be07d
...
...
@@ -12,9 +12,9 @@ eureka.client.healthcheck.enabled = true
eureka.client.fetchRegistry
=
true
#DB properties:
spring.datasource.url
=
jdbc:mysql://
47.103.14.66:3306/91-safety-business
?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8
spring.datasource.url
=
jdbc:mysql://
172.16.11.33:3306/safety-business-2.0
?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8
spring.datasource.username
=
root
spring.datasource.password
=
root_123
spring.datasource.password
=
admin_1234
spring.datasource.driver-class-name
=
com.mysql.jdbc.Driver
spring.datasource.hikari.maxLifetime
=
1765000
spring.datasource.hikari.maximum-pool-size
=
10
...
...
@@ -30,7 +30,7 @@ spring.data.mongodb.uri = mongodb://172.16.11.33:27017/iecmonitor
params.remoteRuleUrl
=
http://magintursh.xicp.net:18080/
params.remoteWebsocketUrl
=
http://172.16.10.91:10600/
spring.redis.database
=
5
spring.redis.database
=
1
spring.redis.host
=
172.16.11.33
spring.redis.port
=
6379
spring.redis.password
=
1234560
...
...
@@ -45,3 +45,15 @@ file.uploadUrl=D:\\upload\\files\\
#picture read
file.readUrl
=
http://172.16.3.89:8083/file/getFile?in=
params.isPush
=
true
## emqx
emqx.clean-session
=
true
emqx.client-id
=
${spring.application.name}-${random.int[1024,65536]}
emqx.broker
=
tcp://172.16.10.85:1883
emqx.user-name
=
super
emqx.password
=
a123456
Push.fegin.name
=
PPMESSAGEPUSHSERVICE15
dutyMode.fegin.name
=
AMOS-DUTY
bussunis.domain
=
http://172.16.10.183:8083
\ No newline at end of file
YeeAmosFireAutoSysStart/src/main/resources/application-docker.properties
View file @
3d4be07d
...
...
@@ -30,7 +30,7 @@ spring.data.mongodb.uri = mongodb://amos-mongo:27017/iecmonitor
params.remoteRuleUrl
=
http://station-rule:8080/
params.remoteWebsocketUrl
=
http://station-websocket:10600/
spring.redis.database
=
5
spring.redis.database
=
1
spring.redis.host
=
amos-redis
spring.redis.port
=
6379
spring.redis.password
=
redis2020
...
...
@@ -45,3 +45,15 @@ file.uploadUrl=D:\\upload\\files\\
#picture read
file.readUrl
=
http://station-fireautosys:8083/file/getFile?in=
params.isPush
=
true
## emqx
emqx.clean-session
=
true
emqx.client-id
=
${spring.application.name}-${random.int[1024,65536]}
emqx.broker
=
tcp://172.16.10.85:1883
emqx.user-name
=
super
emqx.password
=
a123456
Push.fegin.name
=
AMOS-PUSH
dutyMode.fegin.name
=
AMOS-DUTY
bussunis.domain
=
http://172.16.10.183:8083
\ No newline at end of file
YeeAmosFireAutoSysStart/src/main/resources/application-test.properties
View file @
3d4be07d
...
...
@@ -30,7 +30,7 @@ spring.data.mongodb.uri = mongodb://172.16.11.33:27017/iecmonitor
params.remoteRuleUrl
=
http://magintursh.xicp.net:18080/
params.remoteWebsocketUrl
=
http://172.16.10.91:10600/
spring.redis.database
=
5
spring.redis.database
=
1
spring.redis.host
=
127.0.0.1
spring.redis.port
=
6379
spring.redis.password
=
...
...
@@ -45,3 +45,15 @@ file.uploadUrl=D:\\upload\\files\\
#picture read
file.readUrl
=
http://172.16.3.89:8083/file/getFile?in=
params.isPush
=
true
## emqx
emqx.clean-session
=
true
emqx.client-id
=
${spring.application.name}-${random.int[1024,65536]}
emqx.broker
=
tcp://172.16.10.85:1883
emqx.user-name
=
super
emqx.password
=
a123456
Push.fegin.name
=
PPMESSAGEPUSHSERVICE15
dutyMode.fegin.name
=
AMOS-DUTY
bussunis.domain
=
http://172.16.10.183:8083
\ No newline at end of file
YeeAmosFireAutoSysStart/src/main/resources/application.properties
View file @
3d4be07d
spring.application.name
=
AMOS-AUTOSYS
-XKQ1
spring.application.name
=
AMOS-AUTOSYS
server.port
=
8083
...
...
YeeAmosFireAutoSysStart/src/main/resources/db/changelog/fas-2.0.1.xml
View file @
3d4be07d
...
...
@@ -240,4 +240,43 @@
add COLUMN `flicker_frequency` int(11) DEFAULT 0 COMMENT '闪烁频率' after `status`;
</sql>
</changeSet>
<changeSet
author=
"maoying"
id=
"1589444792914-1"
>
<preConditions
onFail=
"MARK_RAN"
>
<tableExists
tableName=
"f_alarm"
/>
</preConditions>
<comment>
create table f_alarm
</comment>
<sql>
DROP TABLE IF EXISTS f_alarm;
CREATE TABLE `f_alarm` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`org_code` varchar(100) NOT NULL COMMENT '机构编号',
`fire_equipment_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '消防设备id',
`fire_equipment_code` varchar(255) NOT NULL COMMENT '设备编码',
`fire_equipment_name` varchar(255) NOT NULL COMMENT '设备名称',
`fire_equipment_point_id` bigint(20) NOT NULL COMMENT '消防点位id',
`fire_equipment_point_code` varchar(255) NOT NULL COMMENT '消防点位名称',
`fire_equipment_point_name` varchar(255) NOT NULL,
`fire_equipment_point_value` varchar(500) DEFAULT NULL COMMENT '报警值',
`frequency` int(10) NOT NULL DEFAULT '1' COMMENT '发生频次',
`status` bit(1) DEFAULT b'1' COMMENT '报警状态:1报警0恢复',
`type` varchar(50) NOT NULL COMMENT '报警类型:alarm_type_fire(火灾报警)/alarm_type_trouble(故障告警)',
`create_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_date` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`recovery_date` datetime DEFAULT NULL COMMENT '告警恢复时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='报警信息表';
</sql>
</changeSet>
<changeSet
author=
"suhuiguang"
id=
"1589769364577-1"
>
<preConditions
onFail=
"MARK_RAN"
>
<columnExists
tableName=
"f_risk_level "
columnName=
"manage_level"
/>
</preConditions>
<comment>
f_risk_level 增加管控级别 初始化数据
</comment>
<sql>
update f_risk_level set manage_level = 1 where level = '1';
update f_risk_level set manage_level = 2 where level = '2';
update f_risk_level set manage_level = 3 where level = '3';
update f_risk_level set manage_level = 4 where level = '4';
</sql>
</changeSet>
</databaseChangeLog>
\ No newline at end of file
YeeAmosFireAutoSysStart/src/main/resources/db/changelog/fas-sql-task.xml
View file @
3d4be07d
...
...
@@ -122,4 +122,18 @@
</sql>
</changeSet>
<changeSet
author=
"maoying"
id=
"1589954524000-1"
runOnChange=
"true"
>
<comment>
updatePointConfig 触发器创建
</comment>
<sql
endDelimiter=
"#"
>
DROP TRIGGER IF EXISTS `updatePointConfig`;
CREATE TRIGGER `updatePointConfig` AFTER UPDATE ON `p_point` FOR EACH ROW
BEGIN
IF (new.name != old.name)
THEN
UPDATE p_point_config pc SET pc.`name` = CONCAT(new.name,'合格') WHERE pc.name LIKE '%合格' AND pc.point_id = new.id;
UPDATE p_point_config pc SET pc.`name` = CONCAT(new.name,'漏检') WHERE pc.name LIKE '%漏检' AND pc.point_id = new.id;
END IF;
END#
</sql>
</changeSet>
</databaseChangeLog>
\ No newline at end of file
YeeAmosFireAutoSysStart/src/main/resources/db/changelog/init/fas-init-data.sql
View file @
3d4be07d
...
...
@@ -40,4 +40,184 @@ INSERT INTO `f_dict` VALUES ('40', '名称', 'hydrant', '0', '\0', 'name', '0',
INSERT
INTO
`f_dict`
VALUES
(
'41'
,
'编号'
,
'hydrant'
,
'0'
,
'
\0
'
,
'code'
,
'1'
,
null
,
null
);
INSERT
INTO
`f_dict`
VALUES
(
'42'
,
'名称'
,
'pool'
,
'0'
,
'
\0
'
,
'name'
,
'0'
,
null
,
null
);
INSERT
INTO
`f_dict`
VALUES
(
'43'
,
'编号'
,
'pool'
,
'0'
,
'
\0
'
,
'code'
,
'1'
,
null
,
null
);
INSERT
INTO
`f_risk_source`
(
`id`
,
`org_code`
,
`code`
,
`name`
,
`position3d`
,
`floor3d`
,
`is_indoor`
,
`parent_id`
,
`risk_level_id`
,
`rpn`
,
`remark`
,
`create_by`
,
`create_date`
,
`is_region`
,
`status`
,
`increment`
,
`rpni`
,
`sort_num`
)
VALUES
(
'1'
,
'1'
,
'100101'
,
'伊克昭换流站'
,
NULL
,
NULL
,
b
'1'
,
'0'
,
'0'
,
'0.00'
,
NULL
,
'0'
,
'2019-09-21 23:09:07'
,
'TRUE'
,
'NORMAL'
,
'0.00'
,
'0'
,
'99'
);
INSERT
INTO
`f_evaluation_model`
(
`id`
,
`org_code`
,
`name`
,
`standard`
,
`create_date`
,
`create_by`
,
`remark`
,
`coefficient`
,
`influence`
,
`describe`
,
`type`
)
VALUES
(
'22'
,
'1'
,
NULL
,
NULL
,
'2019-05-28 00:36:56'
,
'0'
,
NULL
,
'10'
,
'无警告的危害'
,
'在没有任何预兆的情况下发生,影响人员或设备安全,或违反有关法律法规的及严重的故障模式。'
,
'S'
);
INSERT
INTO
`f_evaluation_model`
(
`id`
,
`org_code`
,
`name`
,
`standard`
,
`create_date`
,
`create_by`
,
`remark`
,
`coefficient`
,
`influence`
,
`describe`
,
`type`
)
VALUES
(
'23'
,
'1'
,
NULL
,
NULL
,
'2019-05-28 00:36:56'
,
'0'
,
NULL
,
'9'
,
'有警告的危害'
,
'在有故障预兆的情况下发生,影响人员或设备安全,或违反有关法律法规的及严重的故障模式。'
,
'S'
);
INSERT
INTO
`f_evaluation_model`
(
`id`
,
`org_code`
,
`name`
,
`standard`
,
`create_date`
,
`create_by`
,
`remark`
,
`coefficient`
,
`influence`
,
`describe`
,
`type`
)
VALUES
(
'24'
,
'1'
,
NULL
,
NULL
,
'2019-05-28 00:36:56'
,
'0'
,
NULL
,
'8'
,
'很大'
,
'对生产造成较大的破坏,设备全部或主要功能无法正常运行,但设备是安全的。'
,
'S'
);
INSERT
INTO
`f_evaluation_model`
(
`id`
,
`org_code`
,
`name`
,
`standard`
,
`create_date`
,
`create_by`
,
`remark`
,
`coefficient`
,
`influence`
,
`describe`
,
`type`
)
VALUES
(
'25'
,
'1'
,
NULL
,
NULL
,
'2019-05-28 00:36:56'
,
'0'
,
NULL
,
'7'
,
'大'
,
'设备性能受到影响,但仍可实现功能并是安全的。'
,
'S'
);
INSERT
INTO
`f_evaluation_model`
(
`id`
,
`org_code`
,
`name`
,
`standard`
,
`create_date`
,
`create_by`
,
`remark`
,
`coefficient`
,
`influence`
,
`describe`
,
`type`
)
VALUES
(
'26'
,
'1'
,
NULL
,
NULL
,
'2019-05-28 00:36:56'
,
'0'
,
NULL
,
'6'
,
'中等'
,
'设备性能退化,但仍可以工作并是安全的。局部故障,但仍可以工作。不重要零件不能工作。'
,
'S'
);
INSERT
INTO
`f_evaluation_model`
(
`id`
,
`org_code`
,
`name`
,
`standard`
,
`create_date`
,
`create_by`
,
`remark`
,
`coefficient`
,
`influence`
,
`describe`
,
`type`
)
VALUES
(
'27'
,
'1'
,
NULL
,
NULL
,
'2019-05-28 00:36:56'
,
'0'
,
NULL
,
'5'
,
'小'
,
'对设备性能有中等程度的影响,不重要零件故障需要维修'
,
'S'
);
INSERT
INTO
`f_evaluation_model`
(
`id`
,
`org_code`
,
`name`
,
`standard`
,
`create_date`
,
`create_by`
,
`remark`
,
`coefficient`
,
`influence`
,
`describe`
,
`type`
)
VALUES
(
'28'
,
'1'
,
NULL
,
NULL
,
'2019-05-28 00:36:56'
,
'0'
,
NULL
,
'4'
,
'很小'
,
'队产品性能有较小影响。故障不需要维修'
,
'S'
);
INSERT
INTO
`f_evaluation_model`
(
`id`
,
`org_code`
,
`name`
,
`standard`
,
`create_date`
,
`create_by`
,
`remark`
,
`coefficient`
,
`influence`
,
`describe`
,
`type`
)
VALUES
(
'29'
,
'1'
,
NULL
,
NULL
,
'2019-05-28 00:36:56'
,
'0'
,
NULL
,
'3'
,
'轻微'
,
'对设备性能有轻微影响。'
,
'S'
);
INSERT
INTO
`f_evaluation_model`
(
`id`
,
`org_code`
,
`name`
,
`standard`
,
`create_date`
,
`create_by`
,
`remark`
,
`coefficient`
,
`influence`
,
`describe`
,
`type`
)
VALUES
(
'30'
,
'1'
,
NULL
,
NULL
,
'2019-05-28 00:36:56'
,
'0'
,
NULL
,
'2'
,
'很轻微'
,
'对设备性能有非常轻微的影响。'
,
'S'
);
INSERT
INTO
`f_evaluation_model`
(
`id`
,
`org_code`
,
`name`
,
`standard`
,
`create_date`
,
`create_by`
,
`remark`
,
`coefficient`
,
`influence`
,
`describe`
,
`type`
)
VALUES
(
'31'
,
'1'
,
NULL
,
NULL
,
'2019-05-28 00:36:56'
,
'0'
,
NULL
,
'1'
,
'无'
,
'无影响。'
,
'S'
);
INSERT
INTO
`f_evaluation_model`
(
`id`
,
`org_code`
,
`name`
,
`standard`
,
`create_date`
,
`create_by`
,
`remark`
,
`coefficient`
,
`influence`
,
`describe`
,
`type`
)
VALUES
(
'32'
,
'1'
,
NULL
,
NULL
,
'2019-05-28 00:36:56'
,
'0'
,
NULL
,
'10'
,
'几乎不可能'
,
'不可能探测或没有检查'
,
'D'
);
INSERT
INTO
`f_evaluation_model`
(
`id`
,
`org_code`
,
`name`
,
`standard`
,
`create_date`
,
`create_by`
,
`remark`
,
`coefficient`
,
`influence`
,
`describe`
,
`type`
)
VALUES
(
'33'
,
'1'
,
NULL
,
NULL
,
'2019-05-28 00:36:56'
,
'0'
,
NULL
,
'9'
,
'很微小'
,
'只能再失效发生后才能检测出'
,
'D'
);
INSERT
INTO
`f_evaluation_model`
(
`id`
,
`org_code`
,
`name`
,
`standard`
,
`create_date`
,
`create_by`
,
`remark`
,
`coefficient`
,
`influence`
,
`describe`
,
`type`
)
VALUES
(
'34'
,
'1'
,
NULL
,
NULL
,
'2019-05-28 00:36:56'
,
'0'
,
NULL
,
'8'
,
'微小'
,
'只能通过相关设备来进行探测'
,
'D'
);
INSERT
INTO
`f_evaluation_model`
(
`id`
,
`org_code`
,
`name`
,
`standard`
,
`create_date`
,
`create_by`
,
`remark`
,
`coefficient`
,
`influence`
,
`describe`
,
`type`
)
VALUES
(
'35'
,
'1'
,
NULL
,
NULL
,
'2019-05-28 00:36:56'
,
'0'
,
NULL
,
'7'
,
'很小'
,
'已全部纳管进安全执行系统或进行自动信号采集'
,
'D'
);
INSERT
INTO
`f_evaluation_model`
(
`id`
,
`org_code`
,
`name`
,
`standard`
,
`create_date`
,
`create_by`
,
`remark`
,
`coefficient`
,
`influence`
,
`describe`
,
`type`
)
VALUES
(
'36'
,
'1'
,
NULL
,
NULL
,
'2019-05-28 00:36:56'
,
'0'
,
NULL
,
'6'
,
'小'
,
'只能通过目测或手触来进行探测'
,
'D'
);
INSERT
INTO
`f_evaluation_model`
(
`id`
,
`org_code`
,
`name`
,
`standard`
,
`create_date`
,
`create_by`
,
`remark`
,
`coefficient`
,
`influence`
,
`describe`
,
`type`
)
VALUES
(
'37'
,
'1'
,
NULL
,
NULL
,
'2019-05-28 00:36:56'
,
'0'
,
NULL
,
'5'
,
'中等'
,
'只通过目测即可进行探测'
,
'D'
);
INSERT
INTO
`f_evaluation_model`
(
`id`
,
`org_code`
,
`name`
,
`standard`
,
`create_date`
,
`create_by`
,
`remark`
,
`coefficient`
,
`influence`
,
`describe`
,
`type`
)
VALUES
(
'38'
,
'1'
,
NULL
,
NULL
,
'2019-05-28 00:36:56'
,
'0'
,
NULL
,
'4'
,
'中等偏上'
,
'可通过仪表读数进行探测'
,
'D'
);
INSERT
INTO
`f_evaluation_model`
(
`id`
,
`org_code`
,
`name`
,
`standard`
,
`create_date`
,
`create_by`
,
`remark`
,
`coefficient`
,
`influence`
,
`describe`
,
`type`
)
VALUES
(
'39'
,
'1'
,
NULL
,
NULL
,
'2019-05-28 00:36:56'
,
'0'
,
NULL
,
'3'
,
'高'
,
'可通过中控仪表盘进行探测'
,
'D'
);
INSERT
INTO
`f_evaluation_model`
(
`id`
,
`org_code`
,
`name`
,
`standard`
,
`create_date`
,
`create_by`
,
`remark`
,
`coefficient`
,
`influence`
,
`describe`
,
`type`
)
VALUES
(
'40'
,
'1'
,
NULL
,
NULL
,
'2019-05-28 00:36:56'
,
'0'
,
NULL
,
'2'
,
'很高'
,
'有相应报警提示,出现故障后可在中控仪表盘中不断闪红'
,
'D'
);
INSERT
INTO
`f_evaluation_model`
(
`id`
,
`org_code`
,
`name`
,
`standard`
,
`create_date`
,
`create_by`
,
`remark`
,
`coefficient`
,
`influence`
,
`describe`
,
`type`
)
VALUES
(
'41'
,
'1'
,
NULL
,
NULL
,
'2019-05-28 00:36:56'
,
'0'
,
NULL
,
'1'
,
'几乎肯定能'
,
'有相应报警装置一旦出现故障可报警提示'
,
'D'
);
INSERT
INTO
`f_evaluation_model`
(
`id`
,
`org_code`
,
`name`
,
`standard`
,
`create_date`
,
`create_by`
,
`remark`
,
`coefficient`
,
`influence`
,
`describe`
,
`type`
)
VALUES
(
'42'
,
'1'
,
NULL
,
NULL
,
'2020-02-14 14:35:53'
,
'0'
,
NULL
,
'10'
,
'很高:故障几乎不可避免'
,
'0.9<O&&O<=1'
,
'O'
);
INSERT
INTO
`f_evaluation_model`
(
`id`
,
`org_code`
,
`name`
,
`standard`
,
`create_date`
,
`create_by`
,
`remark`
,
`coefficient`
,
`influence`
,
`describe`
,
`type`
)
VALUES
(
'43'
,
'1'
,
NULL
,
NULL
,
'2020-02-14 14:35:53'
,
'0'
,
NULL
,
'9'
,
'很高:故障几乎不可避免'
,
'0.8<O&&O<=0.9'
,
'O'
);
INSERT
INTO
`f_evaluation_model`
(
`id`
,
`org_code`
,
`name`
,
`standard`
,
`create_date`
,
`create_by`
,
`remark`
,
`coefficient`
,
`influence`
,
`describe`
,
`type`
)
VALUES
(
'44'
,
'1'
,
NULL
,
NULL
,
'2020-02-14 14:35:53'
,
'0'
,
NULL
,
'8'
,
'高:反复发生的故障'
,
'0.7<O&&O<=0.8'
,
'O'
);
INSERT
INTO
`f_evaluation_model`
(
`id`
,
`org_code`
,
`name`
,
`standard`
,
`create_date`
,
`create_by`
,
`remark`
,
`coefficient`
,
`influence`
,
`describe`
,
`type`
)
VALUES
(
'45'
,
'1'
,
NULL
,
NULL
,
'2020-02-14 14:35:53'
,
'0'
,
NULL
,
'7'
,
'高:反复发生的故障'
,
'0.6<O&&O<=0.7'
,
'O'
);
INSERT
INTO
`f_evaluation_model`
(
`id`
,
`org_code`
,
`name`
,
`standard`
,
`create_date`
,
`create_by`
,
`remark`
,
`coefficient`
,
`influence`
,
`describe`
,
`type`
)
VALUES
(
'46'
,
'1'
,
NULL
,
NULL
,
'2020-02-14 14:35:53'
,
'0'
,
NULL
,
'6'
,
'中等:偶尔发生的故障'
,
'0.5<O&&O<=0.6'
,
'O'
);
INSERT
INTO
`f_evaluation_model`
(
`id`
,
`org_code`
,
`name`
,
`standard`
,
`create_date`
,
`create_by`
,
`remark`
,
`coefficient`
,
`influence`
,
`describe`
,
`type`
)
VALUES
(
'47'
,
'1'
,
NULL
,
NULL
,
'2020-02-14 14:35:54'
,
'0'
,
NULL
,
'5'
,
'中等:偶尔发生的故障'
,
'0.4<O&&O<=0.5'
,
'O'
);
INSERT
INTO
`f_evaluation_model`
(
`id`
,
`org_code`
,
`name`
,
`standard`
,
`create_date`
,
`create_by`
,
`remark`
,
`coefficient`
,
`influence`
,
`describe`
,
`type`
)
VALUES
(
'48'
,
'1'
,
NULL
,
NULL
,
'2020-02-14 14:35:54'
,
'0'
,
NULL
,
'4'
,
'中等:偶尔发生的故障'
,
'0.3<O&&O<=0.4'
,
'O'
);
INSERT
INTO
`f_evaluation_model`
(
`id`
,
`org_code`
,
`name`
,
`standard`
,
`create_date`
,
`create_by`
,
`remark`
,
`coefficient`
,
`influence`
,
`describe`
,
`type`
)
VALUES
(
'49'
,
'1'
,
NULL
,
NULL
,
'2020-02-14 14:35:54'
,
'0'
,
NULL
,
'3'
,
'低:相对很少发生'
,
'0.2<O&&O<=0.3'
,
'O'
);
INSERT
INTO
`f_evaluation_model`
(
`id`
,
`org_code`
,
`name`
,
`standard`
,
`create_date`
,
`create_by`
,
`remark`
,
`coefficient`
,
`influence`
,
`describe`
,
`type`
)
VALUES
(
'50'
,
'1'
,
NULL
,
NULL
,
'2020-02-14 14:35:54'
,
'0'
,
NULL
,
'2'
,
'低:相对很少发生'
,
'0.1<O&&O<=0.2'
,
'O'
);
INSERT
INTO
`f_evaluation_model`
(
`id`
,
`org_code`
,
`name`
,
`standard`
,
`create_date`
,
`create_by`
,
`remark`
,
`coefficient`
,
`influence`
,
`describe`
,
`type`
)
VALUES
(
'51'
,
'1'
,
NULL
,
NULL
,
'2020-02-14 14:35:54'
,
'0'
,
NULL
,
'1'
,
'极低:几乎不可能发生'
,
'0<=O&&O<=0.1'
,
'O'
);
INSERT
INTO
`f_risk_level`
(
`id`
,
`org_code`
,
`level`
,
`evaluation_model_id`
,
`severity`
,
`name`
,
`color`
,
`create_by`
,
`create_date`
,
`remark`
,
`top_limit`
,
`down_limit`
)
VALUES
(
'1'
,
'10'
,
'1'
,
NULL
,
'大'
,
'1级'
,
'红色'
,
'1666891'
,
'2020-05-14 10:38:54'
,
NULL
,
'1000.00'
,
'501.00'
);
INSERT
INTO
`f_risk_level`
(
`id`
,
`org_code`
,
`level`
,
`evaluation_model_id`
,
`severity`
,
`name`
,
`color`
,
`create_by`
,
`create_date`
,
`remark`
,
`top_limit`
,
`down_limit`
)
VALUES
(
'2'
,
'10'
,
'2'
,
NULL
,
'较大'
,
'2级'
,
'橙色'
,
'1666891'
,
'2020-05-14 10:39:04'
,
NULL
,
'500.00'
,
'101.00'
);
INSERT
INTO
`f_risk_level`
(
`id`
,
`org_code`
,
`level`
,
`evaluation_model_id`
,
`severity`
,
`name`
,
`color`
,
`create_by`
,
`create_date`
,
`remark`
,
`top_limit`
,
`down_limit`
)
VALUES
(
'3'
,
'10'
,
'3'
,
NULL
,
'中等'
,
'3级'
,
'黄色'
,
'1666891'
,
'2020-05-14 10:39:09'
,
NULL
,
'100.00'
,
'51.00'
);
INSERT
INTO
`f_risk_level`
(
`id`
,
`org_code`
,
`level`
,
`evaluation_model_id`
,
`severity`
,
`name`
,
`color`
,
`create_by`
,
`create_date`
,
`remark`
,
`top_limit`
,
`down_limit`
)
VALUES
(
'4'
,
'10'
,
'4'
,
NULL
,
'小'
,
'4级'
,
'蓝色'
,
'1666891'
,
'2020-05-14 10:39:14'
,
NULL
,
'50.00'
,
'1.00'
);
INSERT
INTO
`f_accident_type`
(
`id`
,
`org_code`
,
`name`
,
`evaluation_sid`
,
`influence`
,
`severity`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'1'
,
'1*2'
,
'设备故障'
,
'26'
,
NULL
,
NULL
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:44:19'
,
NULL
);
INSERT
INTO
`f_accident_type`
(
`id`
,
`org_code`
,
`name`
,
`evaluation_sid`
,
`influence`
,
`severity`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'2'
,
'1*2'
,
'断电设备突然停运'
,
'27'
,
NULL
,
NULL
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:44:19'
,
NULL
);
INSERT
INTO
`f_accident_type`
(
`id`
,
`org_code`
,
`name`
,
`evaluation_sid`
,
`influence`
,
`severity`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'3'
,
'1*2'
,
'其他'
,
'30'
,
NULL
,
NULL
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:44:19'
,
NULL
);
INSERT
INTO
`f_accident_type`
(
`id`
,
`org_code`
,
`name`
,
`evaluation_sid`
,
`influence`
,
`severity`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'4'
,
'1*2'
,
'电源短路'
,
'25'
,
NULL
,
NULL
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:44:19'
,
NULL
);
INSERT
INTO
`f_accident_type`
(
`id`
,
`org_code`
,
`name`
,
`evaluation_sid`
,
`influence`
,
`severity`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'5'
,
'1*2'
,
'火灾'
,
'23'
,
NULL
,
NULL
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:44:20'
,
NULL
);
INSERT
INTO
`f_accident_type`
(
`id`
,
`org_code`
,
`name`
,
`evaluation_sid`
,
`influence`
,
`severity`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'6'
,
'1*2'
,
'其他伤害'
,
'29'
,
NULL
,
NULL
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:44:20'
,
NULL
);
INSERT
INTO
`f_accident_type`
(
`id`
,
`org_code`
,
`name`
,
`evaluation_sid`
,
`influence`
,
`severity`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'7'
,
'1*2'
,
'触电事故'
,
'25'
,
NULL
,
NULL
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:44:21'
,
NULL
);
INSERT
INTO
`f_accident_type`
(
`id`
,
`org_code`
,
`name`
,
`evaluation_sid`
,
`influence`
,
`severity`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'11'
,
'1*2'
,
'人身触电'
,
'25'
,
NULL
,
NULL
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:44:21'
,
NULL
);
INSERT
INTO
`f_accident_type`
(
`id`
,
`org_code`
,
`name`
,
`evaluation_sid`
,
`influence`
,
`severity`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'12'
,
'1*2'
,
'SF6气体防护'
,
'25'
,
NULL
,
NULL
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:44:21'
,
NULL
);
INSERT
INTO
`f_accident_type`
(
`id`
,
`org_code`
,
`name`
,
`evaluation_sid`
,
`influence`
,
`severity`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'13'
,
'1*2'
,
'高空坠落'
,
'26'
,
NULL
,
NULL
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:44:21'
,
NULL
);
INSERT
INTO
`f_accident_type`
(
`id`
,
`org_code`
,
`name`
,
`evaluation_sid`
,
`influence`
,
`severity`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'14'
,
'1*2'
,
'设备故障'
,
'24'
,
NULL
,
NULL
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:44:21'
,
NULL
);
INSERT
INTO
`f_accident_type`
(
`id`
,
`org_code`
,
`name`
,
`evaluation_sid`
,
`influence`
,
`severity`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'16'
,
'1*2'
,
'高空落物'
,
'26'
,
NULL
,
NULL
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:44:21'
,
NULL
);
INSERT
INTO
`f_accident_type`
(
`id`
,
`org_code`
,
`name`
,
`evaluation_sid`
,
`influence`
,
`severity`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'17'
,
'1*2'
,
'雷击事故'
,
'22'
,
NULL
,
NULL
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:44:21'
,
NULL
);
INSERT
INTO
`f_accident_type`
(
`id`
,
`org_code`
,
`name`
,
`evaluation_sid`
,
`influence`
,
`severity`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'18'
,
'1*2'
,
'静电及放射线事故'
,
'26'
,
NULL
,
NULL
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:44:22'
,
NULL
);
INSERT
INTO
`f_accident_type`
(
`id`
,
`org_code`
,
`name`
,
`evaluation_sid`
,
`influence`
,
`severity`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'19'
,
'1*2'
,
'小的事故类型'
,
'22'
,
NULL
,
NULL
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:44:22'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'1'
,
'1*2'
,
'设备老化产生故障'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:54'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'2'
,
'1*2'
,
'可能电源短路'
,
'5'
,
'1'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:54'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'3'
,
'1*2'
,
'设备运行故障,不能及时感知火灾'
,
'6'
,
'1'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:54'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'4'
,
'1*2'
,
'电线老化'
,
'7'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:54'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'5'
,
'1*2'
,
'电线接地'
,
'7'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:54'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'7'
,
'1*2'
,
'误碰、误动、误登运行设备,
\n
误入带电间隔。'
,
'11'
,
'3'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:54'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'8'
,
'1*2'
,
'误碰、误动、误登运行设备,
\n
误入带电间隔。'
,
'11'
,
'3'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:54'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'9'
,
'1*2'
,
'设备有接地故障时,巡视人员误入产生跨步电压。
\n
'
,
'11'
,
'3'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:54'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'12'
,
'1*2'
,
'登高检查设备,如登上开关机构平台检查设备时,感应电造成人员失去平衡,造成人员碰伤、摔伤。
\n
'
,
'13'
,
'3'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:54'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'13'
,
'1*2'
,
'高空落物伤人。
\n
'
,
'16'
,
'3'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:54'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'14'
,
'1*2'
,
'使用无线通讯设备,造成保护误动。
\n
'
,
'14'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:54'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'15'
,
'1*2'
,
'小动物进入,造成事故。
\n
'
,
'14'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:55'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'16'
,
'1*2'
,
'OWS上报出换流阀故障告警信号'
,
'14'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:55'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'17'
,
'1*2'
,
'阀塔设备冒烟、着火'
,
'5'
,
'1'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:55'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'18'
,
'1*2'
,
'阀塔设备、阀塔下方地面有水迹或阀塔水管喷水'
,
'3'
,
'3'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:55'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'19'
,
'1*2'
,
'阀塔设备、阀塔下方地面有水迹或阀塔水管喷水'
,
'3'
,
'3'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:55'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'20'
,
'1*2'
,
'换流阀运行声音有异常变化'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:55'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'21'
,
'1*2'
,
'换流变压器喷油、漏油、冒烟'
,
'14'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:55'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'22'
,
'1*2'
,
'换流变压器冒烟着火'
,
'5'
,
'1'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:56'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'23'
,
'1*2'
,
'换流变压器冒烟着火'
,
'5'
,
'1'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:56'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'24'
,
'1*2'
,
'换流变压器声音与正常运行时对比有明显增大且伴有各种噪音'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:56'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'25'
,
'1*2'
,
'换流变压器套管炸裂、严重漏油'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:56'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'26'
,
'1*2'
,
'套管SF6压力低'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:56'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'27'
,
'1*2'
,
'绕组温度/油温异常升高'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:56'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'28'
,
'1*2'
,
'空调机组停止运行'
,
'1'
,
'3'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:56'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'29'
,
'1*2'
,
'空调控制系统发压差传感器报警'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:56'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'30'
,
'1*2'
,
'空调控制系统发压差传感器报警'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:56'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'31'
,
'1*2'
,
'风挡卡住'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:56'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'32'
,
'1*2'
,
'风挡卡住'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:56'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'33'
,
'1*2'
,
'除湿机不工作'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:56'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'34'
,
'1*2'
,
'站间通讯中断'
,
'14'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:56'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'35'
,
'1*2'
,
'站间通讯中断'
,
'14'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:56'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'36'
,
'1*2'
,
'服务器死机'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:56'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'37'
,
'1*2'
,
'控制保护屏柜、板卡电源显示异常'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:57'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'38'
,
'1*2'
,
'UPS装置面板异常故障报警'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:57'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'39'
,
'1*2'
,
'空调外机异响、通风口异物、柜门密封差'
,
'3'
,
'3'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:57'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'41'
,
'1*2'
,
'实际位置与电气、机械位置指示不相符'
,
'3'
,
'3'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:57'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'42'
,
'1*2'
,
'压力管道渗漏'
,
'1'
,
'1'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:57'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'43'
,
'1*2'
,
'氮气动力源铅封破损,气体压力指示不是0MPa;氮气启动源源铅封破损,气体压力压力小于4MPa'
,
'3'
,
'1'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:57'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'44'
,
'1*2'
,
'电磁控制阀有碰撞变形及其它机械性损伤,表盘非“SHUT”状态;减压阀有碰撞变形及其它机械性损伤'
,
'3'
,
'1'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:57'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'45'
,
'1*2'
,
'水雾喷头异物堵塞'
,
'3'
,
'1'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:57'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'46'
,
'1*2'
,
'冬季检查泡沫消防间温度低于0℃'
,
'3'
,
'1'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:57'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'47'
,
'1*2'
,
'装置运行不正常、液晶显示不正确、有异常声音及气味'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:57'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'48'
,
'1*2'
,
'运行指示不正常,电源开关位置不正常,装置告警信号'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:57'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'49'
,
'1*2'
,
'主水回路管道及法兰连接处、仪表及传感器安装处、管道阀门及主水过滤器有渗漏'
,
'3'
,
'3'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:57'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'50'
,
'1*2'
,
'表计(压力表、压差表、氮气瓶压力等)指示不在正常范围内'
,
'3'
,
'3'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:57'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'51'
,
'1*2'
,
'各回路阀门位置未在指定正确方向'
,
'3'
,
'3'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:57'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'52'
,
'1*2'
,
'火灾报警控制器各指示灯显示异常,异常报警'
,
'1'
,
'1'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:57'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'53'
,
'1*2'
,
'控制柜各指示灯显示异常,有异常及告警信号,工作状态不正常'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:57'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'54'
,
'1*2'
,
'蓄电池有变形、凸出、漏液爆炸裂开、烧焦、螺丝连接处氧化物渗出'
,
'1'
,
'3'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:58'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'55'
,
'1*2'
,
'消防砂池开裂、漏砂'
,
'3'
,
'1'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:58'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'56'
,
'1*2'
,
'消防室杂乱有渗、漏雨;门窗有破损'
,
'3'
,
'1'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:58'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'57'
,
'1*2'
,
'消防箱、消防桶、消防铲、消防斧损旧、锈蚀、破损'
,
'3'
,
'1'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:58'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'58'
,
'1*2'
,
'进入户内SF6设备室或SF6设备发生故障气体外逸,巡视人员窒息或中毒。'
,
'12'
,
'3'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:58'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'59'
,
'1*2'
,
'机构箱、端子箱内加热器故障、防火封堵未到位'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:58'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'60'
,
'1*2'
,
'母线存在变形,异物,跨接线过大弧垂和摆动
\n
'
,
'3'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:58'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'61'
,
'1*2'
,
'母线终端、连接金具破损,接头松动,软连接有断片。
\n
'
,
'3'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:58'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'62'
,
'1*2'
,
'母线均压环外观不正常、母线有异常声音。'
,
'3'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:58'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'63'
,
'1*2'
,
'断路器分合状态指示正常,蝶(弹)簧在压缩位置,液压机构油位未在1/2处。
\n
'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:58'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'64'
,
'1*2'
,
'断路器压力指示指针未在绿色区域,SF6压力不正常。
\n
'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:58'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'65'
,
'1*2'
,
'断路器套管和液压机构观察孔污秽现象,断路器套管破损、裂纹。
\n
'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:58'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'66'
,
'1*2'
,
'基础有破损或开裂,基础有无下沉,支架是否锈蚀或变形。
\n
'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:58'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'67'
,
'1*2'
,
'汇控柜、端子箱、机构箱、动力箱温湿度控制器显示不正常、加热器运行不正常。(冬季)'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:58'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'68'
,
'1*2'
,
'实际位置与电气、机械位置指示不相符。
\n
'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:59'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'69'
,
'1*2'
,
'瓷柱无裂纹和破损,无污秽现象、无放电和闪络的痕迹。
\n
'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:59'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'70'
,
'1*2'
,
'连杆无弯曲、无松动、无锈蚀,开口销齐全。
\n
'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:59'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'71'
,
'1*2'
,
'引线连接部分无过热现象,引线弧度适中。
\n
'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:59'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'72'
,
'1*2'
,
'无影响设备安全运行的障碍物、附着物。
\n
'
,
'3'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:59'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'73'
,
'1*2'
,
'操作机构箱柜门密封良好,箱门锁紧,基础构架无变形。
\n
热器运行正常。(冬季)'
,
'3'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:59'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'74'
,
'1*2'
,
'构架及机构上无鸟巢、蜂巢。
\n
'
,
'3'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:59'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'75'
,
'1*2'
,
'机构箱温湿度控制器显示正常、加热器运行正常。(冬季)'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:59'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'76'
,
'1*2'
,
'电流互感器伞群、法兰等无破损、裂纹及放电闪络痕迹'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:59'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'77'
,
'1*2'
,
'电流互感器伞群污秽、不完整、存在裂纹、老化迹象。'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:59'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'78'
,
'1*2'
,
'电流互感器油位不正常,有渗、漏油现象'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:59'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'79'
,
'1*2'
,
'电流互感器引线异物,接头连接不牢固'
,
'3'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:59'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'80'
,
'1*2'
,
'电流互感器套管运行声音不正常'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:59'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'81'
,
'1*2'
,
'本体存在破损、污秽、有锈蚀、裂纹'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:59'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'82'
,
'1*2'
,
'电流互感器接线板发热松动,放电声不正常'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:59'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'83'
,
'1*2'
,
'平波电抗器顶部油温、绕组温度不正常'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:59'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'84'
,
'1*2'
,
'平波电抗器本体、阀门、冷却器有渗、漏油现象,有异物挂落,套管油位不在正常区域,油枕油位不正常'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:59'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'85'
,
'1*2'
,
'平波电抗器呼吸器外壳破裂现象,硅胶变色部分超过3/4'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:59'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'86'
,
'1*2'
,
'平波电抗器呼吸器外壳破裂现象,硅胶变色部分超过3/4'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:41:59'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'87'
,
'1*2'
,
'平波电抗器冷却器运行不正常, 散热片严重污秽现象,油流指示器指示不正常'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:42:00'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'88'
,
'1*2'
,
'电抗器冷却器控制柜内冷却器切换把手位置不正确'
,
'3'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:42:00'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'89'
,
'1*2'
,
'主变压器顶部油温、绕组温度正常。
\n
'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:42:00'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'90'
,
'1*2'
,
'主变压器本体、阀门、冷却器有渗、漏油现象,异物挂落,套管油位在非正常区域,本体油枕油位不正常;
\n
'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:42:00'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'91'
,
'1*2'
,
'主变压器呼吸器外壳存在破裂现象,硅胶变色部分超过2/3;'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:42:00'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'92'
,
'1*2'
,
'主变压器套管污秽现象, 闪络放电痕迹;
\n
'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:42:00'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'93'
,
'1*2'
,
'变压器冷却器运行不正常, 散热片严重污秽现象。
\n
'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:42:00'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'94'
,
'1*2'
,
'主变压器本体、冷却器运行声音不正常。
\n
'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:42:00'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'95'
,
'1*2'
,
'主变压器冷却器控制柜内冷却器操作把手位置不正确;
\n
'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:42:00'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'96'
,
'1*2'
,
'电容器存在渗漏油、生锈、鼓肚变形。
\n
'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:42:00'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'97'
,
'1*2'
,
'运行声音异常及其它异常现象。
\n
'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:42:00'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'98'
,
'1*2'
,
'各引线和接头有无松动、变色、过热现象。'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:42:00'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'99'
,
'1*2'
,
'电抗器本体存在破损、污秽、锈蚀、开裂。
\n
'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:42:00'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'100'
,
'1*2'
,
'电抗器接地良好。
\n
'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:42:00'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'101'
,
'1*2'
,
'电抗器接地良好。
\n
'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:42:00'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'102'
,
'1*2'
,
'电抗器各引线和接头有松动、变色、过热现象'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:42:01'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'103'
,
'1*2'
,
'避雷器引流线松股、断股和弛度过紧及过松现象;接头松动、发热或变色等现象。'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:42:01'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'104'
,
'1*2'
,
'
\n
避雷器均压环存在位移、变形、锈蚀现象,有放电痕迹。'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:42:01'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'105'
,
'1*2'
,
'避雷器瓷套部分裂纹、破损、放电现象,防污闪涂层有破裂、起皱、鼓泡、脱落;硅橡胶复合绝缘外套伞裙破损、变形。
\n
密封结构金属件和法兰盘裂纹、锈蚀。
\n
压力释放装置封闭破损异物。'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:42:01'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'106'
,
'1*2'
,
'避雷器设备基础有塌陷;底座固定牢固、整体倾斜;绝缘底座表面破损、积污。'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:42:01'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'107'
,
'1*2'
,
'避雷器接地引下线连接不可靠,锈蚀、断裂。
\n
引下线支持小套管碎裂,螺栓松动情况'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:42:01'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'108'
,
'1*2'
,
'避雷器运行时异常声响。
\n
'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:42:01'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'109'
,
'1*2'
,
'避雷器监测装置外观不完整、密封较差、连接不紧固,表计指示不正常,数值超标;放电计数器而问题,内部无受潮、进水。
\n
接地标识、设备铭牌、设备标示牌不齐全、模糊。
\n
'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:42:01'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'110'
,
'1*2'
,
'电阻器箱体破损变形,接头引线放电现象,运行声音不正常'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:42:01'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'111'
,
'1*2'
,
'电阻器箱体破损变形,接头引线放电现象,运行声音不正常'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:42:01'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'112'
,
'1*2'
,
'联络变油色谱在线监测柜灯状态异常'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:42:01'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'113'
,
'1*2'
,
'联络变风冷控制柜状态显示异常'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:42:01'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'114'
,
'1*2'
,
'呼吸器油杯油位、套管油位、开关油位、油枕油位调补变端子箱油温油位未在规定范围内'
,
'3'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:42:01'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'115'
,
'1*2'
,
'故障录波指示灯指示运行状态异常,打印机异常常,打印纸缺失'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:42:01'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'116'
,
'1*2'
,
'很大的危险因素'
,
'19'
,
'1'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:42:01'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'117'
,
'1*2'
,
'SCADA-系统
\n
1.中央报警系统故障告警。
\n
2.OWS上各界面显示异常。
\n
3.站控制监视系统屏柜内设备运行声音异常
\n
'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:42:01'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'118'
,
'1*2'
,
'消防系统-火灾检测:火灾报警后台上有报警。
\n
'
,
'1'
,
'1'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:42:01'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'119'
,
'1*2'
,
'
\"
图像监控系统:
\n
1.视频监控显示器显示、切换异常,摄像机控制不灵活。
\n
2.视频主机屏上指示灯异常,网络连接断开,交换机(网桥)指示灯异常。
\n
3.视频主机屏内设备存在发热、死机等现象。
\n\n\"\n
'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:42:01'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'120'
,
'1*2'
,
'直流控制保护系统面板、板卡等指示灯异常告警。
\n
'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:42:02'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'121'
,
'1*2'
,
'直流控制保护系统屏柜内有杂物,凝结水现象
\n
'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:42:02'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'122'
,
'1*2'
,
'
\"
直流控制保护系统电源开关异常,电源指示异常,接点抖动,异常声响,焦糊味,防火封堵有损。
\n\"\n
'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:42:02'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'123'
,
'1*2'
,
'直流控制保护系统压板、转换开关、按钮有损坏,位置偏移。
\n
'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:42:02'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'124'
,
'1*2'
,
'直流控制保护系统屏柜端子排存在放电现象。
\n
'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:42:02'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'125'
,
'1*2'
,
'直流控制保护系统OWS中央发出告警信号。
\n
'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:42:02'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'126'
,
'1*2'
,
'母线变形,有异物,跨接线存在过大弧垂和摆动。
\n
'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:42:02'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'127'
,
'1*2'
,
'母线终端、连接金具有破损、生锈,接头松动,软连接存在断片。
\n
'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:42:02'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'128'
,
'1*2'
,
'母线均压环外观正常。
\n
'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:42:02'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'129'
,
'1*2'
,
'瓷裙放电现象。
\n
'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:42:02'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'130'
,
'1*2'
,
'瓷裙、法兰裂纹、破损现象。
\n
'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:42:02'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'131'
,
'1*2'
,
'高压瓷柱绝缘支柱倾斜。
\n
'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:42:03'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'132'
,
'1*2'
,
'设备法兰及铁件等部分出现裂纹、裂缝现象。
\n
'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:42:03'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'133'
,
'1*2'
,
'互感器本体有异常声响、震动和气味有渗漏油现象。
\n
'
,
'1'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:42:03'
,
NULL
);
INSERT
INTO
`f_risk_factor`
(
`id`
,
`org_code`
,
`name`
,
`accident_type_id`
,
`type`
,
`dept_id`
,
`create_by`
,
`create_date`
,
`remark`
)
VALUES
(
'134'
,
'1*2'
,
'互感器本体有异物悬挂
\n
'
,
'3'
,
'2'
,
'1245230062576365570'
,
'1530151'
,
'2020-05-15 13:42:03'
,
NULL
);
SET
FOREIGN_KEY_CHECKS
=
1
;
\ No newline at end of file
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/dbTemplate_fire_equippoint.xml
View file @
3d4be07d
...
...
@@ -152,8 +152,8 @@
</if>
</where>
order by a.create_date desc
<if
test=
"pageSize!=null and pageSize!=-1 and
pageNumber
!=null"
>
limit #{
pageNumber
},#{pageSize}
<if
test=
"pageSize!=null and pageSize!=-1 and
offset
!=null"
>
limit #{
offset
},#{pageSize}
</if>
</select>
...
...
@@ -429,8 +429,6 @@
<foreach
collection=
"list"
item=
"item"
index=
"index"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
and
fire_equipment_id = 0
</delete>
</mapper>
\ No newline at end of file
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/dbTemplate_risk_level.xml
View file @
3d4be07d
...
...
@@ -24,6 +24,7 @@
a.name,
a.color,
a.create_by as createBy,
a.manage_level manageLevel,
a.create_date as createDate,
a.remark,
a.manage_level as manageLevel
...
...
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/dbTemplate_risk_source.xml
View file @
3d4be07d
...
...
@@ -609,7 +609,8 @@
wr.max_level,
wr.area,
ep.CODE,
wr.`name`
wr.`name`,
ep.value
FROM
f_fire_equipment_point ep
INNER JOIN f_water_resource_equipment wre ON wre.fire_equipment_id = ep.fire_equipment_id AND ep.type = 'ANALOGUE'
...
...
@@ -669,8 +670,8 @@
<if
test=
"riskLevelId != null"
>
risk_level_id = #{riskLevelId},
</if>
<if
test=
"flicker
_f
requency != null"
>
flicker_frequency = #{flicker
_f
requency}
<if
test=
"flicker
F
requency != null"
>
flicker_frequency = #{flicker
F
requency}
</if>
</set>
where id = #{id}
...
...
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/dbTemplate_rule_runing_snapshot.xml
0 → 100644
View file @
3d4be07d
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yeejoin.amos.fas.business.dao.mapper.RuleRuningSnapshotMapper"
>
<select
id=
"querForObject"
resultType=
"com.yeejoin.amos.fas.business.service.model.RuleRuningSnapshot"
>
SELECT * FROM toip_rm_snapshot t WHERE t.batch_no = #{batchNo} ORDER BY t.create_millisecond DESC limit 0,1
</select>
<select
id=
"querForObjectList"
resultType=
"com.yeejoin.amos.fas.business.service.model.RuleRuningSnapshot"
>
SELECT * FROM toip_rm_snapshot t WHERE t.batch_no = #{batchNo} ORDER BY t.create_millisecond
</select>
</mapper>
\ No newline at end of file
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/dbTemplate_view3d.xml
View file @
3d4be07d
...
...
@@ -436,6 +436,19 @@
) pt
where #{date} BETWEEN pt.begin_date and pt.end_date
</select>
<select
id=
"countFireException"
resultType=
"long"
>
SELECT
count(1)
FROM
f_alarm a
WHERE
`status` = TRUE
AND org_code = #{orgCode}
AND type = 'alarm_type_trouble'
AND date_format(a.update_date, '%Y-%m-%d') = #{date}
</select>
<select
id=
"getAllErrorRiskPoint"
resultType=
"com.yeejoin.amos.fas.business.bo.RiskPointRpnChangeBo"
>
SELECT
b.id,
...
...
@@ -468,6 +481,23 @@
and a.org_code = #{orgCode}
</select>
<select
id=
"getAllFaultAlarm"
resultType=
"com.yeejoin.amos.fas.business.bo.CheckErrorBo"
>
SELECT
a.id,
a.fire_equipment_point_name as `name`,
fe.equip_type as status,
a.update_date as changeDate
FROM
f_alarm a
LEFT JOIN f_fire_equipment fe ON fe.id = a.fire_equipment_id
WHERE
`status` = TRUE
AND type = 'alarm_type_trouble'
AND a.org_code = #{orgCode}
AND date_format(a.update_date, '%Y-%m-%d') =#{date}
</select>
<select
id=
"getStatisticsCheck"
resultType=
"java.util.HashMap"
>
<![CDATA[
SELECT d.status as type, count(1) as value
...
...
@@ -498,11 +528,42 @@
left join p_point I ON I.id = p.point_id
where p.is_ok IN ('2', '3')
AND I.is_delete = 0
AND p.org_code = #{org
_c
ode} or p.org_code like CONCAT(#{orgCode},'-','%')
AND p.org_code = #{org
C
ode} or p.org_code like CONCAT(#{orgCode},'-','%')
ORDER BY p.check_time desc
limit 0,5
</select>
<select
id=
"getFireAlarmTop5"
resultType=
"com.yeejoin.amos.fas.business.bo.SafetyExecuteBo"
>
SELECT
a.fire_equipment_id id,
a.fire_equipment_code code,
a.fire_equipment_point_name as `label`,
a.update_date as changeDate,
"monitorEquipment" type
FROM
f_alarm a
WHERE
a.org_code = #{orgCode}
AND a.`status` = TRUE
AND a.type = 'alarm_type_fire'
ORDER BY a.update_date DESC
limit 0,5
</select>
<select
id=
"getEquipStatusTop5"
resultType=
"com.yeejoin.amos.fas.business.bo.SafetyExecuteBo"
>
SELECT
fed.id,
fed.eq_point_name label,
fed.e_value status,
fed.create_date changeDate
FROM
f_fire_equipment_data fed
WHERE
fed.org_code = #{orgCode}
ORDER BY fed.create_date DESC
limit 0,5
</select>
<select
id=
"getPintsByType"
resultType=
"hashmap"
>
select CONCAT(type,'-',id) as `key`,sp.* from
(select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation ,'riskSource' as type,org_code as orgCode,
...
...
pom.xml
View file @
3d4be07d
...
...
@@ -32,6 +32,11 @@
<dependencies>
<dependency>
<groupId>
com.yeejoin
</groupId>
<artifactId>
amos-component-rule
</artifactId>
<version>
1.1.0-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-netflix-eureka-client
</artifactId>
</dependency>
...
...
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