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
1e3b8f04
Commit
1e3b8f04
authored
Jul 14, 2023
by
maoying
Browse files
Options
Browse Files
Download
Plain Diff
解决冲突
parents
ef097bf2
824e5c01
Hide whitespace changes
Inline
Side-by-side
Showing
51 changed files
with
2920 additions
and
382 deletions
+2920
-382
pom.xml
YeeAmosFireAutoSysCommon/pom.xml
+1
-1
ContingencyPlanInstance.java
.../yeejoin/amos/fas/dao/entity/ContingencyPlanInstance.java
+22
-2
EmergencyRelation.java
...va/com/yeejoin/amos/fas/dao/entity/EmergencyRelation.java
+38
-0
EmergencyRelationTree.java
...om/yeejoin/amos/fas/dao/entity/EmergencyRelationTree.java
+39
-0
EmergencyTaskContent.java
...com/yeejoin/amos/fas/dao/entity/EmergencyTaskContent.java
+39
-0
pom.xml
YeeAmosFireAutoSysService/pom.xml
+2
-2
ContingencyAction.java
...m/yeejoin/amos/fas/business/action/ContingencyAction.java
+73
-22
ContingencyPlanController.java
...os/fas/business/controller/ContingencyPlanController.java
+40
-1
EmergencyTaskController.java
...amos/fas/business/controller/EmergencyTaskController.java
+182
-0
PlanVisual3dController.java
.../amos/fas/business/controller/PlanVisual3dController.java
+56
-3
TimeLineController.java
...join/amos/fas/business/controller/TimeLineController.java
+10
-0
ContingencyInstanceInfoMapper.java
...as/business/dao/mapper/ContingencyInstanceInfoMapper.java
+12
-0
ContingencyPlanInstanceMapper.java
...as/business/dao/mapper/ContingencyPlanInstanceMapper.java
+6
-0
EmergencyTaskMapper.java
...oin/amos/fas/business/dao/mapper/EmergencyTaskMapper.java
+31
-0
PlanMessageMapper.java
...ejoin/amos/fas/business/dao/mapper/PlanMessageMapper.java
+3
-0
PlanOperationRecordMapper.java
...os/fas/business/dao/mapper/PlanOperationRecordMapper.java
+13
-0
IContingencyPlanInstanceRepository.java
...ss/dao/repository/IContingencyPlanInstanceRepository.java
+1
-1
BizContingencyHandler.java
...eejoin/amos/fas/business/event/BizContingencyHandler.java
+13
-1
FireContingencyHandler.java
...ejoin/amos/fas/business/event/FireContingencyHandler.java
+52
-4
JcsFeign.java
...in/java/com/yeejoin/amos/fas/business/feign/JcsFeign.java
+9
-1
ContingencyInstanceImpl.java
...os/fas/business/service/impl/ContingencyInstanceImpl.java
+153
-29
ContingencyPlanServiceImpl.java
...fas/business/service/impl/ContingencyPlanServiceImpl.java
+160
-32
EmergencyTaskServiceImpl.java
...s/fas/business/service/impl/EmergencyTaskServiceImpl.java
+200
-0
EquipmentFireEquipmentServiceImpl.java
...iness/service/impl/EquipmentFireEquipmentServiceImpl.java
+27
-20
PlanStepServiceImpl.java
...n/amos/fas/business/service/impl/PlanStepServiceImpl.java
+6
-0
PlanVisual3dServiceImpl.java
...os/fas/business/service/impl/PlanVisual3dServiceImpl.java
+180
-80
IContingencyInstance.java
...amos/fas/business/service/intfc/IContingencyInstance.java
+3
-0
IContingencyPlanService.java
...s/fas/business/service/intfc/IContingencyPlanService.java
+5
-4
IEmergencyTaskService.java
...mos/fas/business/service/intfc/IEmergencyTaskService.java
+32
-0
IPlanStepService.java
...oin/amos/fas/business/service/intfc/IPlanStepService.java
+2
-0
IPlanVisual3dService.java
...amos/fas/business/service/intfc/IPlanVisual3dService.java
+17
-2
ContingencyPlanInstanceVO.java
...ejoin/amos/fas/business/vo/ContingencyPlanInstanceVO.java
+5
-1
EmergencyRelationVo.java
...com/yeejoin/amos/fas/business/vo/EmergencyRelationVo.java
+16
-0
EmergencyTaskContentVo.java
.../yeejoin/amos/fas/business/vo/EmergencyTaskContentVo.java
+44
-0
pom.xml
YeeAmosFireAutoSysStart/pom.xml
+2
-2
application.properties
...ireAutoSysStart/src/main/resources/application.properties
+2
-2
fas-2.0.1.xml
...utoSysStart/src/main/resources/db/changelog/fas-2.0.1.xml
+83
-0
fas-sql-task.xml
...SysStart/src/main/resources/db/changelog/fas-sql-task.xml
+11
-10
ContingencyInstanceInfoMapper.xml
...ain/resources/db/mapper/ContingencyInstanceInfoMapper.xml
+291
-2
ContingencyPlanInstanceMapper.xml
...ain/resources/db/mapper/ContingencyPlanInstanceMapper.xml
+62
-0
PlanMessage.xml
...AutoSysStart/src/main/resources/db/mapper/PlanMessage.xml
+18
-0
PlanOperationRecordMapper.xml
...rc/main/resources/db/mapper/PlanOperationRecordMapper.xml
+11
-0
dbTemplate_emergency_task.xml
...rc/main/resources/db/mapper/dbTemplate_emergency_task.xml
+134
-0
dbTemplate_equipment_specific_index.xml
...sources/db/mapper/dbTemplate_equipment_specific_index.xml
+2
-2
dbTemplate_fire_equip.xml
...rt/src/main/resources/db/mapper/dbTemplate_fire_equip.xml
+5
-2
plan-setp-qiantangjiang.json
...tart/src/main/resources/json/plan-setp-qiantangjiang.json
+255
-0
plan-step-poyanghu.json
...oSysStart/src/main/resources/json/plan-step-poyanghu.json
+2
-2
plan-step-shaoxing.json
...oSysStart/src/main/resources/json/plan-step-shaoxing.json
+255
-0
plan-step-yinan-yingji1.0.json
...rt/src/main/resources/json/plan-step-yinan-yingji1.0.json
+218
-0
plan-step.json
...osFireAutoSysStart/src/main/resources/json/plan-step.json
+76
-153
pom.xml
pom.xml
+1
-1
No files found.
YeeAmosFireAutoSysCommon/pom.xml
View file @
1e3b8f04
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
<parent>
<parent>
<groupId>
com.yeejoin.amos
</groupId>
<groupId>
com.yeejoin.amos
</groupId>
<artifactId>
YeeAmosFireAutoSysRoot
</artifactId>
<artifactId>
YeeAmosFireAutoSysRoot
</artifactId>
<version>
3.7.0.
8
</version>
<version>
3.7.0.
9
</version>
</parent>
</parent>
<!-- <dependencies>
<!-- <dependencies>
...
...
YeeAmosFireAutoSysCommon/src/main/java/com/yeejoin/amos/fas/dao/entity/ContingencyPlanInstance.java
View file @
1e3b8f04
...
@@ -79,6 +79,28 @@ public class ContingencyPlanInstance extends BusinessEntity{
...
@@ -79,6 +79,28 @@ public class ContingencyPlanInstance extends BusinessEntity{
@Column
(
name
=
"person_img"
)
@Column
(
name
=
"person_img"
)
private
String
personImg
;
private
String
personImg
;
@Column
(
name
=
"task_sort"
)
private
Integer
taskSort
;
@Column
(
name
=
"step_code"
)
private
String
stepCode
;
public
void
setTaskSort
(
Integer
taskSort
)
{
this
.
taskSort
=
taskSort
;
}
public
void
setStepCode
(
String
stepCode
)
{
this
.
stepCode
=
stepCode
;
}
public
Integer
getTaskSort
()
{
return
taskSort
;
}
public
String
getStepCode
()
{
return
stepCode
;
}
public
String
getPersonImg
()
{
public
String
getPersonImg
()
{
return
personImg
;
return
personImg
;
}
}
...
@@ -184,8 +206,6 @@ public class ContingencyPlanInstance extends BusinessEntity{
...
@@ -184,8 +206,6 @@ public class ContingencyPlanInstance extends BusinessEntity{
this
.
content
=
content
;
this
.
content
=
content
;
}
}
public
String
getIcon
()
{
public
String
getIcon
()
{
return
icon
;
return
icon
;
}
}
...
...
YeeAmosFireAutoSysCommon/src/main/java/com/yeejoin/amos/fas/dao/entity/EmergencyRelation.java
0 → 100644
View file @
1e3b8f04
package
com
.
yeejoin
.
amos
.
fas
.
dao
.
entity
;
import
lombok.Data
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.NamedQuery
;
import
javax.persistence.Table
;
/**
* The persistent class for the equipment_fire_equipment database table.
*/
@Entity
@Data
@Table
(
name
=
"c_emergency_relation"
)
@NamedQuery
(
name
=
"EmergencyRelation.findAll"
,
query
=
"SELECT e FROM EmergencyRelation e"
)
public
class
EmergencyRelation
extends
BasicEntity
{
private
static
final
long
serialVersionUID
=
1L
;
//职责id
@Column
(
name
=
"obligationId"
)
private
Long
obligationId
;
//人员id
@Column
(
name
=
"person_id"
)
private
Long
personId
;
//分工内容id
@Column
(
name
=
"amos_id"
)
private
Long
amosOrgId
;
//人员名称
@Column
(
name
=
"person_name"
)
private
String
personName
;
}
\ No newline at end of file
YeeAmosFireAutoSysCommon/src/main/java/com/yeejoin/amos/fas/dao/entity/EmergencyRelationTree.java
0 → 100644
View file @
1e3b8f04
package
com
.
yeejoin
.
amos
.
fas
.
dao
.
entity
;
import
lombok.Data
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.NamedQuery
;
import
javax.persistence.Table
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* The persistent class for the equipment_fire_equipment database table.
*/
@Data
public
class
EmergencyRelationTree
extends
BasicEntity
{
private
static
final
long
serialVersionUID
=
1L
;
private
String
sequenceNbr
;
//职责id
private
Long
obligationId
;
//人员名称
private
String
name
;
//子级
private
List
<
EmergencyRelationTree
>
children
=
new
ArrayList
<>();
//树节点展示标识
private
String
type
;
private
String
code
;
}
\ No newline at end of file
YeeAmosFireAutoSysCommon/src/main/java/com/yeejoin/amos/fas/dao/entity/EmergencyTaskContent.java
0 → 100644
View file @
1e3b8f04
package
com
.
yeejoin
.
amos
.
fas
.
dao
.
entity
;
import
lombok.Data
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.NamedQuery
;
import
javax.persistence.Table
;
/**
* The persistent class for the c_emergency_task_content database table.
*/
@Entity
@Table
(
name
=
"c_emergency_task_content"
)
@Data
public
class
EmergencyTaskContent
extends
BasicEntity
{
private
static
final
long
serialVersionUID
=
1L
;
//分工内容id
@Column
(
name
=
"content"
)
private
String
content
;
//人员名称
@Column
(
name
=
"code"
)
private
String
code
;
//人员名称
@Column
(
name
=
"obligation_id"
)
private
Long
obligationId
;
//人员名称
@Column
(
name
=
"obligation_name"
)
private
String
obligationName
;
}
\ No newline at end of file
YeeAmosFireAutoSysService/pom.xml
View file @
1e3b8f04
...
@@ -14,14 +14,14 @@
...
@@ -14,14 +14,14 @@
<parent>
<parent>
<groupId>
com.yeejoin.amos
</groupId>
<groupId>
com.yeejoin.amos
</groupId>
<artifactId>
YeeAmosFireAutoSysRoot
</artifactId>
<artifactId>
YeeAmosFireAutoSysRoot
</artifactId>
<version>
3.7.0.
8
</version>
<version>
3.7.0.
9
</version>
</parent>
</parent>
<dependencies>
<dependencies>
<dependency>
<dependency>
<groupId>
com.yeejoin.amos
</groupId>
<groupId>
com.yeejoin.amos
</groupId>
<artifactId>
YeeAmosFireAutoSysCommon
</artifactId>
<artifactId>
YeeAmosFireAutoSysCommon
</artifactId>
<version>
3.7.0.
8
</version>
<version>
3.7.0.
9
</version>
</dependency>
</dependency>
<dependency>
<dependency>
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/action/ContingencyAction.java
View file @
1e3b8f04
package
com
.
yeejoin
.
amos
.
fas
.
business
.
action
;
package
com
.
yeejoin
.
amos
.
fas
.
business
.
action
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.yeejoin.amos.component.rule.MethodParam
;
import
com.yeejoin.amos.component.rule.MethodParam
;
import
com.yeejoin.amos.component.rule.RuleActionBean
;
import
com.yeejoin.amos.component.rule.RuleActionBean
;
import
com.yeejoin.amos.component.rule.RuleMethod
;
import
com.yeejoin.amos.component.rule.RuleMethod
;
...
@@ -23,13 +24,9 @@ import com.yeejoin.amos.fas.business.dao.repository.IPlanOperationRecordDao;
...
@@ -23,13 +24,9 @@ import com.yeejoin.amos.fas.business.dao.repository.IPlanOperationRecordDao;
import
com.yeejoin.amos.fas.business.feign.RemoteSecurityService
;
import
com.yeejoin.amos.fas.business.feign.RemoteSecurityService
;
import
com.yeejoin.amos.fas.business.service.impl.RuleRunigSnapshotServiceImpl
;
import
com.yeejoin.amos.fas.business.service.impl.RuleRunigSnapshotServiceImpl
;
import
com.yeejoin.amos.fas.business.service.intfc.*
;
import
com.yeejoin.amos.fas.business.service.intfc.*
;
import
com.yeejoin.amos.fas.business.service.model.ContingencyDeviceStatus
;
import
com.yeejoin.amos.fas.business.service.model.ToipResponse
;
import
com.yeejoin.amos.fas.business.service.model.ToipResponse
;
import
com.yeejoin.amos.fas.business.util.JSONUtil
;
import
com.yeejoin.amos.fas.business.util.JSONUtil
;
import
com.yeejoin.amos.fas.business.vo.ButtonJsonVO
;
import
com.yeejoin.amos.fas.business.vo.*
;
import
com.yeejoin.amos.fas.business.vo.MessageVO
;
import
com.yeejoin.amos.fas.business.vo.PlanStepJsonVO
;
import
com.yeejoin.amos.fas.business.vo.Toke
;
import
com.yeejoin.amos.fas.common.enums.ContingencyPlanStatusEnum
;
import
com.yeejoin.amos.fas.common.enums.ContingencyPlanStatusEnum
;
import
com.yeejoin.amos.fas.common.enums.PlanRecordStatusEnum
;
import
com.yeejoin.amos.fas.common.enums.PlanRecordStatusEnum
;
import
com.yeejoin.amos.fas.core.enums.NumberEnum
;
import
com.yeejoin.amos.fas.core.enums.NumberEnum
;
...
@@ -40,12 +37,14 @@ import com.yeejoin.amos.fas.dao.entity.PlanDetail;
...
@@ -40,12 +37,14 @@ import com.yeejoin.amos.fas.dao.entity.PlanDetail;
import
com.yeejoin.amos.fas.dao.entity.PlanOperationRecord
;
import
com.yeejoin.amos.fas.dao.entity.PlanOperationRecord
;
import
com.yeejoin.amos.fas.datasync.bo.PlanDetailSyncBo
;
import
com.yeejoin.amos.fas.datasync.bo.PlanDetailSyncBo
;
import
com.yeejoin.amos.fas.datasync.bo.PlanOperationRecordSyncBo
;
import
com.yeejoin.amos.fas.datasync.bo.PlanOperationRecordSyncBo
;
import
org.apache.commons.io.IOUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.time.DateFormatUtils
;
import
org.apache.commons.lang3.time.DateFormatUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.core.io.Resource
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
...
@@ -59,6 +58,7 @@ import java.io.IOException;
...
@@ -59,6 +58,7 @@ import java.io.IOException;
import
java.lang.reflect.Constructor
;
import
java.lang.reflect.Constructor
;
import
java.lang.reflect.Field
;
import
java.lang.reflect.Field
;
import
java.lang.reflect.Method
;
import
java.lang.reflect.Method
;
import
java.nio.charset.StandardCharsets
;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.*
;
import
java.util.concurrent.ConcurrentHashMap
;
import
java.util.concurrent.ConcurrentHashMap
;
...
@@ -66,6 +66,8 @@ import java.util.regex.Matcher;
...
@@ -66,6 +66,8 @@ import java.util.regex.Matcher;
import
java.util.regex.Pattern
;
import
java.util.regex.Pattern
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
static
org
.
typroject
.
tyboot
.
core
.
foundation
.
context
.
RequestContext
.*;
@Component
@Component
@RuleActionBean
(
beanLabel
=
"动态预案"
)
@RuleActionBean
(
beanLabel
=
"动态预案"
)
...
@@ -94,9 +96,6 @@ public class ContingencyAction implements CustomerAction {
...
@@ -94,9 +96,6 @@ public class ContingencyAction implements CustomerAction {
private
ContingencyLogPublisher
contingencyLogPublisher
;
private
ContingencyLogPublisher
contingencyLogPublisher
;
@Autowired
@Autowired
private
IRiskSourceService
riskSourceService
;
@Autowired
private
IEquipmentService
equipmentService
;
private
IEquipmentService
equipmentService
;
@Autowired
@Autowired
...
@@ -126,6 +125,9 @@ public class ContingencyAction implements CustomerAction {
...
@@ -126,6 +125,9 @@ public class ContingencyAction implements CustomerAction {
@Autowired
@Autowired
private
IPlanStepService
planStepService
;
private
IPlanStepService
planStepService
;
@Autowired
private
IEmergencyTaskService
emergencyTaskService
;
@Value
(
"${rocket-plan-topic}"
)
@Value
(
"${rocket-plan-topic}"
)
private
String
rocketTopic
;
private
String
rocketTopic
;
...
@@ -150,7 +152,10 @@ public class ContingencyAction implements CustomerAction {
...
@@ -150,7 +152,10 @@ public class ContingencyAction implements CustomerAction {
private
IPlanOperationRecordDao
planOperationRecordDao
;
private
IPlanOperationRecordDao
planOperationRecordDao
;
@Autowired
@Autowired
private
com
.
yeejoin
.
amos
.
component
.
rule
.
RuleTrigger
ruleTrigger
;
private
com
.
yeejoin
.
amos
.
component
.
rule
.
RuleTrigger
ruleTrigger
;
@Autowired
private
IEquipmentFireEquipmentService
equipmentFireEquipmentService
;
@Value
(
"classpath:/json/plan-step.json"
)
private
Resource
planStepResource
;
/**
/**
* @param stepCode 当前步骤编号
* @param stepCode 当前步骤编号
...
@@ -201,6 +206,17 @@ public class ContingencyAction implements CustomerAction {
...
@@ -201,6 +206,17 @@ public class ContingencyAction implements CustomerAction {
this
.
sendcmd
(
"steparea"
,
contingencyRo
,
result
);
this
.
sendcmd
(
"steparea"
,
contingencyRo
,
result
);
}
}
public
void
sendcmdT
(
String
msgType
,
Object
contingency
,
SafteyPlanResult
result
)
{
ToipResponse
toipResponse
=
new
ToipResponse
();
toipResponse
.
setMsgType
(
msgType
);
toipResponse
.
setMsgContext
(
result
.
toJson
());
toipResponse
.
setContingency
(
contingency
);
String
topic
=
String
.
format
(
"/%s/%s/%s"
,
serviceName
,
stationName
,
"plan"
);
log
.
info
(
String
.
format
(
"mqtt[%s]:【 %s 】"
,
topic
,
toipResponse
.
toJsonStr
()));
webMqttComponent
.
publish
(
topic
,
toipResponse
.
toJsonStr
());
}
public
void
sendcmd
(
String
msgType
,
Object
contingency
,
SafteyPlanResult
result
)
{
public
void
sendcmd
(
String
msgType
,
Object
contingency
,
SafteyPlanResult
result
)
{
ContingencyRo
ro
=
(
ContingencyRo
)
contingency
;
ContingencyRo
ro
=
(
ContingencyRo
)
contingency
;
...
@@ -373,6 +389,12 @@ public class ContingencyAction implements CustomerAction {
...
@@ -373,6 +389,12 @@ public class ContingencyAction implements CustomerAction {
result
.
add
(
tempmap1
);
result
.
add
(
tempmap1
);
this
.
sendcmd
(
"helparea"
,
paramObj
,
result
);
this
.
sendcmd
(
"helparea"
,
paramObj
,
result
);
String
topic
=
String
.
format
(
"/%s/%s/%s"
,
serviceName
,
stationName
,
"plan"
);
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"contingency"
,
new
ContingencyRo
());
map
.
put
(
"msgContext"
,
Collections
.
EMPTY_MAP
);
map
.
put
(
"msgType"
,
"refreshTaskRecord"
);
webMqttComponent
.
publish
(
topic
,
JSON
.
toJSONString
(
map
));
}
}
}
}
...
@@ -457,20 +479,12 @@ public class ContingencyAction implements CustomerAction {
...
@@ -457,20 +479,12 @@ public class ContingencyAction implements CustomerAction {
try
{
try
{
ButtonJsonVO
buttonJsonVO
=
JSONObject
.
parseObject
(
buttonJson
,
ButtonJsonVO
.
class
);
ButtonJsonVO
buttonJsonVO
=
JSONObject
.
parseObject
(
buttonJson
,
ButtonJsonVO
.
class
);
Map
<
String
,
Object
>
map
=
buttonJsonVO
.
getOperate
().
get
(
buttonJsonVO
.
getOperate
().
size
()
-
1
);
Map
<
String
,
Object
>
map
=
buttonJsonVO
.
getOperate
().
get
(
buttonJsonVO
.
getOperate
().
size
()
-
1
);
iContingencyInstance
.
fire
(
batchNo
,
buttonJsonVO
.
getStepCode
(),
buttonJson
,
contingencyPlanId
,
map
.
get
(
"code"
).
toString
(),
"CANCEL_0"
,
"A"
,
"false"
,
"false"
,
RequestContext
.
getToken
(),
RequestContext
.
getProduct
(),
RequestContext
.
getAppKey
(),
null
);
iContingencyInstance
.
fire
(
batchNo
,
buttonJsonVO
.
getStepCode
(),
buttonJson
,
contingencyPlanId
,
map
.
get
(
"code"
).
toString
(),
"CANCEL_0"
,
"A"
,
"false"
,
"false"
,
getToken
(),
getProduct
(),
getAppKey
(),
null
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"optionarea 加入队列失败-->"
+
e
.
getMessage
());
log
.
error
(
"optionarea 加入队列失败-->"
+
e
.
getMessage
());
}
}
MessageVO
messageVO
=
new
MessageVO
();
messageVO
.
setTitle
(
"应急处置事项提醒"
);
messageVO
.
setBody
(
"【"
+
actionName
+
"】"
+
DateFormatUtils
.
format
(
new
Date
(),
"yyyy-MM-dd HH:mm:ss"
));
messageVO
.
setMsgType
(
"emergencyPlan"
);
messageVO
.
setCategory
(
1
);
messageVO
.
setIsSendApp
(
true
);
messageVO
.
setIsSendWeb
(
true
);
messageVO
.
setRelationId
(
batchNo
);
planVisual3dService
.
sendMessage
(
buttonCode
,
messageVO
);
}
}
}
}
...
@@ -715,6 +729,9 @@ public class ContingencyAction implements CustomerAction {
...
@@ -715,6 +729,9 @@ public class ContingencyAction implements CustomerAction {
this
.
sendcmd
(
"message"
,
paramObj
,
result
);
this
.
sendcmd
(
"message"
,
paramObj
,
result
);
redisTemplate
.
delete
(
"contingencyRo"
);
redisTemplate
.
delete
(
"contingencyRo"
);
// 预案结束清空redis
planStepService
.
initPlanStep
();
planStepService
.
initPlanTask
();
}
}
...
@@ -764,7 +781,7 @@ public class ContingencyAction implements CustomerAction {
...
@@ -764,7 +781,7 @@ public class ContingencyAction implements CustomerAction {
}
}
@RuleMethod
(
methodLabel
=
"清除步骤执行"
,
project
=
"换流站消防专项预案"
)
@RuleMethod
(
methodLabel
=
"清除步骤执行"
,
project
=
"换流站消防专项预案"
)
public
void
clearExecute
(
@MethodParam
(
paramLabel
=
"步骤编号"
)
String
stepCode
,
@MethodParam
(
paramLabel
=
"按钮编码"
)
String
buttonCode
,
@MethodParam
(
paramLabel
=
"重点设备ID"
)
String
fireEquipmentId
)
{
public
void
clearExecute
(
@MethodParam
(
paramLabel
=
"步骤编号"
)
String
stepCode
,
@MethodParam
(
paramLabel
=
"按钮编码"
)
String
buttonCode
,
@MethodParam
(
paramLabel
=
"重点设备ID"
)
String
fireEquipmentId
,
@MethodParam
(
paramLabel
=
"步骤状态"
)
String
stepState
,
@MethodParam
(
paramLabel
=
"按钮状态"
)
String
buttonState
,
@MethodParam
(
paramLabel
=
"按钮json字符串"
)
String
buttonJson
,
@MethodParam
(
paramLabel
=
"步骤名称"
)
String
stepName
)
throws
Exception
{
SafteyPlanResult
result
=
new
SafteyPlanResult
();
SafteyPlanResult
result
=
new
SafteyPlanResult
();
Map
<
String
,
Object
>
tempmap1
=
new
HashMap
<>();
Map
<
String
,
Object
>
tempmap1
=
new
HashMap
<>();
Map
<
String
,
Object
>
content
=
new
HashMap
<>();
Map
<
String
,
Object
>
content
=
new
HashMap
<>();
...
@@ -783,7 +800,22 @@ public class ContingencyAction implements CustomerAction {
...
@@ -783,7 +800,22 @@ public class ContingencyAction implements CustomerAction {
tempmap1
.
put
(
"type"
,
"buttonCache"
);
tempmap1
.
put
(
"type"
,
"buttonCache"
);
tempmap1
.
put
(
"content"
,
content
);
tempmap1
.
put
(
"content"
,
content
);
result
.
add
(
tempmap1
);
result
.
add
(
tempmap1
);
String
instanceId
=
iContingencyInstance
.
getInstanceIdByBatchNOAndCategory
(
"OPERATE"
,
stepName
,
batchNo
);
String
json
;
try
{
json
=
IOUtils
.
toString
(
planStepResource
.
getInputStream
(),
String
.
valueOf
(
StandardCharsets
.
UTF_8
));
}
catch
(
IOException
e
)
{
throw
new
RuntimeException
(
"获取预案节点信息失败!"
);
}
List
<
PlanStepJsonVO
>
res
=
JSONObject
.
parseArray
(
json
,
PlanStepJsonVO
.
class
);
PlanStepJsonVO
vo
=
res
.
stream
().
filter
(
x
->
x
.
getStepCode
().
equals
(
stepCode
)).
collect
(
Collectors
.
toList
()).
get
(
0
);
Object
obj
=
equipmentFireEquipmentService
.
automaticExecutePoint
(
vo
.
getIndex
());
if
(
Boolean
.
TRUE
==
obj
)
{
iContingencyInstance
.
fire
(
batchNo
,
stepCode
,
buttonJson
,
instanceId
,
buttonCode
,
buttonState
,
stepState
,
"true"
,
"true"
,
getToken
(),
getProduct
(),
getAppKey
(),
"系统执行自动步骤"
);
}
this
.
sendcmd
(
"message"
,
result
);
this
.
sendcmd
(
"message"
,
result
);
}
}
...
@@ -814,7 +846,7 @@ public class ContingencyAction implements CustomerAction {
...
@@ -814,7 +846,7 @@ public class ContingencyAction implements CustomerAction {
try
{
try
{
contingencyPlanInstance
.
setRoleCode
(
planStepService
.
getPlanStepRoleCodeByButtonCode
(
buttonCode
));
contingencyPlanInstance
.
setRoleCode
(
planStepService
.
getPlanStepRoleCodeByButtonCode
(
buttonCode
));
contingencyPlanInstanceRepository
.
save
(
contingencyPlanInstance
);
contingencyPlanInstanceRepository
.
save
(
contingencyPlanInstance
);
contingencyInstance
.
fire
(
contingencyRo
.
getBatchNo
(),
stepCode
,
buttonJson
,
contingencyPlanId
,
buttonCode
,
confirm
,
stepState
,
"true"
,
"true"
,
RequestContext
.
getToken
(),
RequestContext
.
getProduct
(),
RequestContext
.
getAppKey
(),
null
);
contingencyInstance
.
fire
(
contingencyRo
.
getBatchNo
(),
stepCode
,
buttonJson
,
contingencyPlanId
,
buttonCode
,
confirm
,
stepState
,
"true"
,
"true"
,
getToken
(),
getProduct
(),
getAppKey
(),
null
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
...
@@ -904,4 +936,23 @@ public class ContingencyAction implements CustomerAction {
...
@@ -904,4 +936,23 @@ public class ContingencyAction implements CustomerAction {
private
Boolean
findByBatchNoAndStatus
(
String
batchNo
)
{
private
Boolean
findByBatchNoAndStatus
(
String
batchNo
)
{
return
CollectionUtils
.
isEmpty
(
planOperationRecordDao
.
findByBatchNoAndStatus
(
batchNo
,
0
));
return
CollectionUtils
.
isEmpty
(
planOperationRecordDao
.
findByBatchNoAndStatus
(
batchNo
,
0
));
}
}
/**
* 任务动作保存
* @param taskName 任务名称
*
*/
@RuleMethod
(
methodLabel
=
"任务动作保存"
,
project
=
"换流站消防专项预案"
)
@Transactional
public
void
saveTaskInfo
(
@MethodParam
(
paramLabel
=
"任务名称"
)
String
taskName
,
@MethodParam
(
paramLabel
=
"角色编码"
)
String
roleCode
,
@MethodParam
(
paramLabel
=
"任务编号"
)
Integer
taskNum
,
@MethodParam
(
paramLabel
=
"步骤编码"
)
String
stepCode
,
@MethodParam
(
paramLabel
=
"按钮json字符串"
)
String
buttonJson
,
@MethodParam
(
paramLabel
=
"预案对象"
)
Object
paramObj
)
{
ContingencyRo
contingencyRo
=
(
ContingencyRo
)
paramObj
;
String
batchNo
=
contingencyRo
.
getBatchNo
();
if
(!
findByBatchNoAndStatus
(
batchNo
))
{
String
instanceId
=
iContingencyInstance
.
getInstanceIdByBatchNOAndCategory
(
"TASKOPERATE"
,
taskName
,
batchNo
);
if
(!
StringUtils
.
isEmpty
(
instanceId
))
{
return
;
}
emergencyTaskService
.
saveTask
(
"-2"
,
batchNo
);
}
}
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/ContingencyPlanController.java
View file @
1e3b8f04
...
@@ -2,6 +2,7 @@ package com.yeejoin.amos.fas.business.controller;
...
@@ -2,6 +2,7 @@ package com.yeejoin.amos.fas.business.controller;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.fas.business.service.intfc.IContingencyPlanService
;
import
com.yeejoin.amos.fas.business.service.intfc.IContingencyPlanService
;
import
com.yeejoin.amos.fas.business.service.intfc.IEmergencyTaskService
;
import
com.yeejoin.amos.fas.business.vo.*
;
import
com.yeejoin.amos.fas.business.vo.*
;
import
com.yeejoin.amos.fas.config.Permission
;
import
com.yeejoin.amos.fas.config.Permission
;
import
com.yeejoin.amos.fas.core.util.CommonResponseUtil2
;
import
com.yeejoin.amos.fas.core.util.CommonResponseUtil2
;
...
@@ -28,6 +29,9 @@ public class ContingencyPlanController extends BaseController {
...
@@ -28,6 +29,9 @@ public class ContingencyPlanController extends BaseController {
@Autowired
@Autowired
private
IContingencyPlanService
contingencyPlanService
;
private
IContingencyPlanService
contingencyPlanService
;
@Autowired
private
IEmergencyTaskService
emergencyTaskService
;
/**
/**
* 创建数字预案
* 创建数字预案
*/
*/
...
@@ -171,7 +175,7 @@ public class ContingencyPlanController extends BaseController {
...
@@ -171,7 +175,7 @@ public class ContingencyPlanController extends BaseController {
vo
.
setUserName
(
user
.
getRealName
());
vo
.
setUserName
(
user
.
getRealName
());
ContingencyPlanResponseVo
result
=
null
;
ContingencyPlanResponseVo
result
=
null
;
try
{
try
{
result
=
contingencyPlanService
.
planStart
(
vo
,
toke
);
result
=
contingencyPlanService
.
planStart
(
vo
,
toke
);
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
e
.
printStackTrace
();
e
.
printStackTrace
();
return
CommonResponseUtil2
.
failure
();
return
CommonResponseUtil2
.
failure
();
...
@@ -257,4 +261,39 @@ public class ContingencyPlanController extends BaseController {
...
@@ -257,4 +261,39 @@ public class ContingencyPlanController extends BaseController {
return
CommonResponseUtil2
.
success
(
contingencyPlanService
.
getUserOperateCountAndPlanName
(
roleModelList
));
return
CommonResponseUtil2
.
success
(
contingencyPlanService
.
getUserOperateCountAndPlanName
(
roleModelList
));
}
}
@ApiOperation
(
value
=
"获取当前登录人待处置任务及预案信息"
)
@RequestMapping
(
value
=
"/getUserOperateCountAndTaskName"
,
method
=
RequestMethod
.
GET
)
public
ResponseModel
getUserOperateCountAndTaskName
()
{
AgencyUserModel
user
=
getUserInfo
();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
String
obligationIds
=
emergencyTaskService
.
getRolesByUserId
(
user
.
getUserId
());
map
.
put
(
"roleCodes"
,
obligationIds
);
List
<
String
>
list
=
new
ArrayList
<>();
if
(!
StringUtils
.
isEmpty
(
obligationIds
))
{
String
[]
ids
=
new
String
(
obligationIds
).
split
(
","
);
list
=
Arrays
.
asList
(
ids
);
}
return
CommonResponseUtil2
.
success
(
contingencyPlanService
.
getUserOperateCountAndTaskName
(
list
,
map
));
}
@ApiOperation
(
value
=
"获取当前登录人待处置任务及预案信息"
)
@GetMapping
(
value
=
"/task/page"
)
public
ResponseModel
selectTaskActionPage
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
,
@RequestParam
(
value
=
"batchNo"
,
required
=
false
)
String
batchNo
,
@RequestParam
(
value
=
"runState"
,
required
=
false
)
String
runState
,
@RequestParam
(
value
=
"updateDate"
,
required
=
false
)
String
updateDate
,
@RequestParam
(
value
=
"roleName"
,
required
=
false
)
String
roleName
)
{
if
(
current
<
1
||
size
<
1
)
{
throw
new
YeeException
(
"分页参数有误"
);
}
List
<
String
>
list
=
new
ArrayList
<>();
if
(!
StringUtils
.
isEmpty
(
roleName
))
{
String
[]
ids
=
new
String
(
roleName
).
split
(
","
);
list
=
Arrays
.
asList
(
ids
);
}
return
CommonResponseUtil2
.
success
(
contingencyPlanService
.
selectTaskActionPage
(
current
,
size
,
batchNo
,
runState
,
updateDate
,
list
));
}
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/EmergencyTaskController.java
0 → 100644
View file @
1e3b8f04
package
com
.
yeejoin
.
amos
.
fas
.
business
.
controller
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.fas.business.feign.JcsFeign
;
import
com.yeejoin.amos.fas.business.service.intfc.IDictService
;
import
com.yeejoin.amos.fas.business.service.intfc.IEmergencyTaskService
;
import
com.yeejoin.amos.fas.business.vo.EmergencyRelationVo
;
import
com.yeejoin.amos.fas.core.common.request.CommonPageable
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.core.util.CommonResponseUtil
;
import
com.yeejoin.amos.fas.dao.entity.Dict
;
import
com.yeejoin.amos.fas.dao.entity.EmergencyRelation
;
import
com.yeejoin.amos.fas.dao.entity.EmergencyRelationTree
;
import
com.yeejoin.amos.fas.dao.entity.EmergencyTaskContent
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Lazy
;
import
org.springframework.data.domain.Page
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.stream.Collectors
;
@Controller
@RequestMapping
(
"/api/emergency"
)
@Api
(
tags
=
"应急人员分工Api"
)
public
class
EmergencyTaskController
extends
BaseController
{
@Autowired
JcsFeign
jcsFeign
;
@Lazy
@Autowired
IEmergencyTaskService
iEmergencyTaskService
;
@Autowired
private
IDictService
dictService
;
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"岗位人员树"
,
notes
=
"岗位人员树"
)
@RequestMapping
(
value
=
"/tree"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
tree
(){
Dict
dict
=
new
Dict
();
dict
.
setDictCode
(
"YJZC"
);
//查询应急角色
List
<
Dict
>
dictList
=
dictService
.
getDictList
(
dict
);
List
<
EmergencyRelationTree
>
list
=
new
ArrayList
<>();
List
<
EmergencyRelationTree
>
root
=
new
ArrayList
<>();
List
<
EmergencyRelationTree
>
treeNodes
=
iEmergencyTaskService
.
treeList
();
//组装对应人员节点
dictList
.
forEach
(
e
->{
EmergencyRelationTree
tree
=
new
EmergencyRelationTree
();
tree
.
setId
(
e
.
getId
());
tree
.
setName
(
e
.
getDictName
());
tree
.
setType
(
"0"
);
tree
.
setSequenceNbr
(
String
.
valueOf
(
e
.
getId
()));
tree
.
setCode
(
e
.
getDictValue
());
tree
.
setChildren
(
treeNodes
.
stream
().
filter
(
t
->
t
.
getObligationId
().
equals
(
e
.
getId
())).
collect
(
Collectors
.
toList
()));
list
.
add
(
tree
);
});
//增加根节点
EmergencyRelationTree
tree
=
new
EmergencyRelationTree
();
tree
.
setId
(
0
);
tree
.
setSequenceNbr
(
"0"
);
tree
.
setName
(
"全部"
);
tree
.
setType
(
"3"
);
tree
.
setCode
(
"0"
);
tree
.
setChildren
(
list
);
root
.
add
(
tree
);
return
CommonResponseUtil
.
success
(
root
);
}
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"分工内容列表"
,
notes
=
"分工内容列表"
)
@RequestMapping
(
value
=
"/list"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
list
(
Long
obligationId
,
@RequestParam
int
pageNumber
,
@RequestParam
int
pageSize
){
if
(
pageNumber
>=
1
){
pageNumber
=
pageNumber
-
1
;
}
if
(
obligationId
==
0
){
obligationId
=
null
;
}
CommonPageable
commonPageable
=
new
CommonPageable
(
pageNumber
,
pageSize
);
Page
<
EmergencyTaskContent
>
list
=
iEmergencyTaskService
.
list
(
obligationId
,
commonPageable
);
return
CommonResponseUtil
.
success
(
list
);
}
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"树人员节点删除"
,
notes
=
"树人员节点删除"
)
@RequestMapping
(
value
=
"/deleteTreeNode"
,
method
=
RequestMethod
.
DELETE
)
public
CommonResponse
deleteTreeNode
(
Long
obligationId
,
Long
id
){
iEmergencyTaskService
.
deleteTreeNode
(
obligationId
,
id
);
return
CommonResponseUtil
.
success
();
}
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增树人员节点"
,
notes
=
"新增树人员节点"
)
@PostMapping
(
value
=
"/savePerson"
,
produces
=
"application/json;charset=UTF-8"
)
public
CommonResponse
savePerson
(
@RequestBody
EmergencyRelationVo
vo
){
List
<
Long
>
personIds
=
vo
.
getPersonIds
();
List
<
Long
>
oldPersonIds
=
iEmergencyTaskService
.
getPersonIds
(
vo
.
getObligationId
());
String
ids
=
StringUtils
.
join
(
oldPersonIds
,
","
);
List
<
Object
>
objects
=
jcsFeign
.
listCompanyByIds
(
personIds
);
StringBuffer
stringBuffer
=
new
StringBuffer
();
for
(
Object
e
:
objects
)
{
String
json
=
JSONObject
.
toJSONString
(
e
);
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
json
);
if
(
ids
.
contains
(
jsonObject
.
get
(
"sequenceNbr"
).
toString
())){
stringBuffer
.
append
(
jsonObject
.
get
(
"bizOrgName"
).
toString
()+
" "
);
continue
;
}
EmergencyRelation
emergencyRelation
=
new
EmergencyRelation
();
emergencyRelation
.
setObligationId
(
vo
.
getObligationId
());
emergencyRelation
.
setPersonId
(
Long
.
valueOf
(
jsonObject
.
get
(
"sequenceNbr"
).
toString
()));
emergencyRelation
.
setPersonName
(
jsonObject
.
get
(
"bizOrgName"
).
toString
());
emergencyRelation
.
setAmosOrgId
(
Long
.
valueOf
(
jsonObject
.
get
(
"amosOrgId"
).
toString
()));
emergencyRelation
.
setCreateDate
(
new
Date
());
iEmergencyTaskService
.
save
(
emergencyRelation
);
}
if
(
stringBuffer
.
length
()>
0
){
stringBuffer
.
append
(
"已存在"
);
return
CommonResponseUtil
.
failure
(
stringBuffer
.
toString
());
}
return
CommonResponseUtil
.
success
();
}
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"编辑树人员节点"
,
notes
=
"编辑树人员节点"
)
@PostMapping
(
value
=
"/editPerson"
,
produces
=
"application/json;charset=UTF-8"
)
public
CommonResponse
editPerson
(
@RequestBody
EmergencyRelationVo
vo
){
this
.
deleteTreeNode
(
vo
.
getObligationId
(),
null
);
List
<
Long
>
personIds
=
vo
.
getPersonIds
();
List
<
Object
>
objects
=
jcsFeign
.
listCompanyByIds
(
personIds
);
objects
.
forEach
(
e
->
{
String
json
=
JSONObject
.
toJSONString
(
e
);
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
json
);
EmergencyRelation
emergencyRelation
=
new
EmergencyRelation
();
emergencyRelation
.
setObligationId
(
vo
.
getObligationId
());
emergencyRelation
.
setPersonId
(
Long
.
valueOf
(
jsonObject
.
get
(
"sequenceNbr"
).
toString
()));
emergencyRelation
.
setPersonName
(
jsonObject
.
get
(
"bizOrgName"
).
toString
());
emergencyRelation
.
setAmosOrgId
(
Long
.
valueOf
(
jsonObject
.
get
(
"amosOrgId"
).
toString
()));
emergencyRelation
.
setCreateDate
(
new
Date
());
iEmergencyTaskService
.
save
(
emergencyRelation
);
}
);
return
CommonResponseUtil
.
success
();
}
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取当前节点绑定人员"
,
notes
=
"获取当前节点绑定人员"
)
@RequestMapping
(
value
=
"/getPersons"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
getPersons
(
@RequestParam
Long
obligationId
){
EmergencyRelationVo
emergencyRelationVo
=
new
EmergencyRelationVo
();
emergencyRelationVo
.
setPersonIds
(
iEmergencyTaskService
.
getPersonIds
(
obligationId
));
return
CommonResponseUtil
.
success
(
emergencyRelationVo
);
}
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增流程任务"
,
notes
=
"新增流程任务"
)
@PostMapping
(
value
=
"/task/add"
,
produces
=
"application/json; charset=UTF-8"
)
public
CommonResponse
addTaskContent
(
@RequestBody
String
stepCode
){
iEmergencyTaskService
.
saveTask
(
stepCode
,
null
);
return
CommonResponseUtil
.
success
();
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/PlanVisual3dController.java
View file @
1e3b8f04
package
com
.
yeejoin
.
amos
.
fas
.
business
.
controller
;
package
com
.
yeejoin
.
amos
.
fas
.
business
.
controller
;
import
com.yeejoin.amos.fas.business.service.intfc.IEmergencyTaskService
;
import
com.yeejoin.amos.fas.business.service.intfc.IPlanVisual3dService
;
import
com.yeejoin.amos.fas.business.service.intfc.IPlanVisual3dService
;
import
com.yeejoin.amos.fas.business.util.StringUtil
;
import
com.yeejoin.amos.fas.business.util.StringUtil
;
import
com.yeejoin.amos.fas.business.vo.ContingencyPlanInstanceVO
;
import
com.yeejoin.amos.fas.business.vo.ContingencyPlanInstanceVO
;
...
@@ -27,9 +28,7 @@ import org.springframework.web.bind.annotation.*;
...
@@ -27,9 +28,7 @@ import org.springframework.web.bind.annotation.*;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.*
;
import
java.io.*
;
import
java.util.ArrayList
;
import
java.util.*
;
import
java.util.List
;
import
java.util.Map
;
@RestController
@RestController
@RequestMapping
(
value
=
"/api/visual"
)
@RequestMapping
(
value
=
"/api/visual"
)
...
@@ -46,6 +45,9 @@ public class PlanVisual3dController extends BaseController {
...
@@ -46,6 +45,9 @@ public class PlanVisual3dController extends BaseController {
private
IPlanVisual3dService
planVisual3dService
;
private
IPlanVisual3dService
planVisual3dService
;
@Autowired
@Autowired
private
IEmergencyTaskService
emergencyTaskService
;
@Autowired
HttpServletResponse
response
;
HttpServletResponse
response
;
@Autowired
@Autowired
HttpServletRequest
request
;
HttpServletRequest
request
;
...
@@ -251,9 +253,60 @@ public class PlanVisual3dController extends BaseController {
...
@@ -251,9 +253,60 @@ public class PlanVisual3dController extends BaseController {
}
}
@Permission
@Permission
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"分页查询预案下处置动作列表"
,
notes
=
"分页查询预案下处置动作列表"
)
@GetMapping
(
value
=
"/plan/selectTaskActionPage"
)
public
ResponseModel
selectTaskActionPage
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
,
@RequestParam
(
value
=
"batchNo"
)
String
batchNo
,
@RequestParam
(
value
=
"dataType"
)
int
dataType
)
{
if
(
current
<
1
||
size
<
1
)
{
throw
new
YeeException
(
"分页参数有误"
);
}
AgencyUserModel
user
=
getUserInfo
();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
String
obligationIds
=
emergencyTaskService
.
getRolesByUserId
(
user
.
getUserId
());
map
.
put
(
"roleCodes"
,
obligationIds
);
List
<
String
>
list
=
new
ArrayList
<>();
if
(!
StringUtils
.
isEmpty
(
obligationIds
))
{
String
[]
ids
=
new
String
(
obligationIds
).
split
(
","
);
list
=
Arrays
.
asList
(
ids
);
}
return
CommonResponseUtil2
.
success
(
planVisual3dService
.
selectTaskActionPage
(
current
,
size
,
batchNo
,
list
,
dataType
));
}
@Permission
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询预案下处置动作列表"
,
notes
=
"查询预案下处置动作列表"
)
@GetMapping
(
value
=
"/plan/selectTaskActionList"
)
public
ResponseModel
selectTaskActionList
(
@RequestParam
(
value
=
"batchNo"
)
String
batchNo
,
@RequestParam
(
value
=
"dataType"
)
int
dataType
)
{
AgencyUserModel
user
=
getUserInfo
();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
String
obligationIds
=
emergencyTaskService
.
getRolesByUserId
(
user
.
getUserId
());
map
.
put
(
"roleCodes"
,
obligationIds
);
List
<
String
>
list
=
new
ArrayList
<>();
if
(!
StringUtils
.
isEmpty
(
obligationIds
))
{
String
[]
ids
=
new
String
(
obligationIds
).
split
(
","
);
list
=
Arrays
.
asList
(
ids
);
}
return
CommonResponseUtil2
.
success
(
planVisual3dService
.
selectTaskActionList
(
batchNo
,
list
,
dataType
));
}
@Permission
@ApiOperation
(
value
=
"修改动作执行状态"
,
notes
=
"修改动作执行状态"
)
@ApiOperation
(
value
=
"修改动作执行状态"
,
notes
=
"修改动作执行状态"
)
@PostMapping
(
value
=
"/updateStatusById"
)
@PostMapping
(
value
=
"/updateStatusById"
)
public
ResponseModel
updateStatusById
(
@RequestParam
(
"id"
)
String
id
,
@RequestParam
(
"runStatus"
)
Boolean
runStatus
)
{
public
ResponseModel
updateStatusById
(
@RequestParam
(
"id"
)
String
id
,
@RequestParam
(
"runStatus"
)
Boolean
runStatus
)
{
return
CommonResponseUtil
.
successNew
(
planVisual3dService
.
updateStatusById
(
id
,
runStatus
));
return
CommonResponseUtil
.
successNew
(
planVisual3dService
.
updateStatusById
(
id
,
runStatus
));
}
}
@Permission
@ApiOperation
(
value
=
"修改任务动作执行状态"
,
notes
=
"修改任务动作执行状态"
)
@PostMapping
(
value
=
"/status/modify"
)
public
ResponseModel
updateTaskStatusById
(
@RequestParam
(
"id"
)
String
id
,
@RequestParam
(
"runStatus"
)
Boolean
runStatus
)
{
AgencyUserModel
user
=
getUserInfo
();
String
roleNames
=
emergencyTaskService
.
getRolesNameByUserId
(
user
.
getUserId
());
return
CommonResponseUtil
.
successNew
(
planVisual3dService
.
updateTaskStatusById
(
id
,
runStatus
,
user
.
getRealName
(),
user
.
getUserId
(),
roleNames
));
}
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/TimeLineController.java
View file @
1e3b8f04
...
@@ -79,6 +79,16 @@ public class TimeLineController extends BaseController {
...
@@ -79,6 +79,16 @@ public class TimeLineController extends BaseController {
}
}
@Permission
@Permission
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"点击按钮"
,
notes
=
"点击按钮"
)
@RequestMapping
(
value
=
"/click"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
public
CommonResponse
clickButton
(
@RequestBody
PlanExecuteVo
vo
)
throws
Exception
{
AgencyUserModel
userInfo
=
getUserInfo
();
String
user
=
userInfo
.
getRealName
();
iContingencyInstance
.
clickButton
(
vo
.
getBatchNo
(),
vo
.
getStepCode
(),
vo
.
getButtonJson
(),
vo
.
getContingencyPlanId
(),
vo
.
getButtonCode
(),
vo
.
getConfirm
(),
vo
.
getStepState
(),
"true"
,
"false"
,
getToken
(),
getProduct
(),
getAppKey
(),
user
);
return
CommonResponseUtil
.
success
(
"SUCCESS"
);
}
@Permission
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"点击按钮"
,
notes
=
"点击按钮"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"点击按钮"
,
notes
=
"点击按钮"
)
@RequestMapping
(
value
=
"/fire/exit"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
PUT
)
@RequestMapping
(
value
=
"/fire/exit"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
PUT
)
public
CommonResponse
fireExit
(
@RequestParam
(
"batchNo"
)
String
batchNo
,
public
CommonResponse
fireExit
(
@RequestParam
(
"batchNo"
)
String
batchNo
,
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/mapper/ContingencyInstanceInfoMapper.java
View file @
1e3b8f04
...
@@ -26,8 +26,20 @@ public interface ContingencyInstanceInfoMapper extends BaseMapper<ContingencyIns
...
@@ -26,8 +26,20 @@ public interface ContingencyInstanceInfoMapper extends BaseMapper<ContingencyIns
List
<
ContingencyPlanInstanceVO
>
selectDisposalActionPage
(
@Param
(
"current"
)
int
current
,
@Param
(
"size"
)
int
size
,
@Param
(
"type"
)
String
type
,
@Param
(
"status"
)
String
status
,
@Param
(
"list"
)
List
<
String
>
roles
,
@Param
(
"batchNo"
)
String
batchNo
);
List
<
ContingencyPlanInstanceVO
>
selectDisposalActionPage
(
@Param
(
"current"
)
int
current
,
@Param
(
"size"
)
int
size
,
@Param
(
"type"
)
String
type
,
@Param
(
"status"
)
String
status
,
@Param
(
"list"
)
List
<
String
>
roles
,
@Param
(
"batchNo"
)
String
batchNo
);
List
<
ContingencyPlanInstanceVO
>
selectTaskActionPage
(
@Param
(
"current"
)
int
current
,
@Param
(
"size"
)
int
size
,
@Param
(
"type"
)
String
type
,
@Param
(
"status"
)
String
status
,
@Param
(
"list"
)
List
<
String
>
roles
,
@Param
(
"batchNo"
)
String
batchNo
);
int
selectCountDisposalActionPage
(
@Param
(
"type"
)
String
type
,
@Param
(
"status"
)
String
status
,
@Param
(
"list"
)
List
<
String
>
roles
,
@Param
(
"batchNo"
)
String
batchNo
);
int
selectCountDisposalActionPage
(
@Param
(
"type"
)
String
type
,
@Param
(
"status"
)
String
status
,
@Param
(
"list"
)
List
<
String
>
roles
,
@Param
(
"batchNo"
)
String
batchNo
);
int
selectCountTaskActionPage
(
@Param
(
"type"
)
String
type
,
@Param
(
"status"
)
String
status
,
@Param
(
"list"
)
List
<
String
>
roles
,
@Param
(
"batchNo"
)
String
batchNo
);
List
<
ContingencyPlanInstanceVO
>
selectDisposalActionList
(
@Param
(
"type"
)
String
type
,
@Param
(
"status"
)
String
status
,
@Param
(
"list"
)
List
<
String
>
roles
,
@Param
(
"batchNo"
)
String
batchNo
);
List
<
ContingencyPlanInstanceVO
>
selectDisposalActionList
(
@Param
(
"type"
)
String
type
,
@Param
(
"status"
)
String
status
,
@Param
(
"list"
)
List
<
String
>
roles
,
@Param
(
"batchNo"
)
String
batchNo
);
List
<
ContingencyPlanInstanceVO
>
selectTaskActionList
(
@Param
(
"type"
)
String
type
,
@Param
(
"status"
)
String
status
,
@Param
(
"list"
)
List
<
String
>
roles
,
@Param
(
"batchNo"
)
String
batchNo
);
List
<
ContingencyPlanInstanceVO
>
getTaskActionList
(
@Param
(
"type"
)
String
type
,
@Param
(
"status"
)
String
status
,
@Param
(
"batchNo"
)
String
batchNo
);
int
countTaskPage
(
@Param
(
"type"
)
String
type
,
@Param
(
"batchNo"
)
String
batchNo
,
@Param
(
"list"
)
List
<
String
>
roles
);
List
<
ContingencyPlanInstanceVO
>
getTaskActionPage
(
@Param
(
"current"
)
int
current
,
@Param
(
"size"
)
int
size
,
@Param
(
"batchNo"
)
String
batchNo
,
@Param
(
"type"
)
String
type
,
@Param
(
"runState"
)
String
runState
,
@Param
(
"updateDate"
)
String
updateDate
,
@Param
(
"list"
)
List
<
String
>
roles
);
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/mapper/ContingencyPlanInstanceMapper.java
View file @
1e3b8f04
...
@@ -44,4 +44,10 @@ public interface ContingencyPlanInstanceMapper extends BaseMapper<ContingencyPla
...
@@ -44,4 +44,10 @@ public interface ContingencyPlanInstanceMapper extends BaseMapper<ContingencyPla
long
countWater
(
@Param
(
"bizOrgCode"
)
String
bizOrgCode
);
long
countWater
(
@Param
(
"bizOrgCode"
)
String
bizOrgCode
);
Integer
getPlanInstanceCountByCondition
(
@Param
(
"category"
)
String
category
,
@Param
(
"recordType"
)
String
recordType
,
@Param
(
"batchNo"
)
String
batchNo
,
@Param
(
"content"
)
String
content
);
Integer
getPlanInstanceCountByCondition
(
@Param
(
"category"
)
String
category
,
@Param
(
"recordType"
)
String
recordType
,
@Param
(
"batchNo"
)
String
batchNo
,
@Param
(
"content"
)
String
content
);
String
getInstanceIdByBatchNOAndCategory
(
@Param
(
"recordType"
)
String
recordType
,
@Param
(
"category"
)
String
category
,
@Param
(
"batchNo"
)
String
batchNo
);
Boolean
updateTaskStatusById
(
@Param
(
"id"
)
String
id
,
@Param
(
"content"
)
String
content
,
Boolean
runStatus
,
@Param
(
"userName"
)
String
userName
,
@Param
(
"userId"
)
String
userId
,
@Param
(
"personImg"
)
String
personImg
,
@Param
(
"fileType"
)
String
fileType
,
@Param
(
"roleNames"
)
String
roleNames
);
Integer
getPlanInstanceByRunState
(
@Param
(
"stepCode"
)
String
stepCode
,
@Param
(
"batchNo"
)
String
batchNo
);
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/mapper/EmergencyTaskMapper.java
0 → 100644
View file @
1e3b8f04
package
com
.
yeejoin
.
amos
.
fas
.
business
.
dao
.
mapper
;
import
com.yeejoin.amos.fas.business.vo.EmergencyTaskContentVo
;
import
com.yeejoin.amos.fas.dao.entity.EmergencyRelation
;
import
com.yeejoin.amos.fas.dao.entity.EmergencyRelationTree
;
import
com.yeejoin.amos.fas.dao.entity.EmergencyTaskContent
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
public
interface
EmergencyTaskMapper
extends
BaseMapper
{
List
<
EmergencyTaskContent
>
getEmergencyTaskList
(
Long
obligationId
,
Long
offset
,
int
pageSize
);
int
getEmergencyTaskCount
(
Long
obligationId
);
List
<
EmergencyRelationTree
>
treeList
();
void
deleteTreeNode
(
Long
obligationId
,
Long
personId
);
void
save
(
EmergencyRelation
emergencyRelation
);
List
<
String
>
roleCodes
(
String
amosOrgId
);
List
<
Long
>
getPersonIds
(
Long
obligationId
);
List
<
String
>
roleNames
(
String
amosOrgId
);
List
<
EmergencyTaskContentVo
>
getContentList
(
@Param
(
"stepCode"
)
String
stepCode
);
List
<
EmergencyTaskContentVo
>
getMustTaskList
(
@Param
(
"stepCode"
)
String
stepCode
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/mapper/PlanMessageMapper.java
View file @
1e3b8f04
...
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
...
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import
com.yeejoin.amos.fas.dao.entity.PlanMessage
;
import
com.yeejoin.amos.fas.dao.entity.PlanMessage
;
import
org.springframework.stereotype.Repository
;
import
org.springframework.stereotype.Repository
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -17,4 +18,6 @@ import java.util.Map;
...
@@ -17,4 +18,6 @@ import java.util.Map;
public
interface
PlanMessageMapper
extends
BaseMapper
<
PlanMessage
>
{
public
interface
PlanMessageMapper
extends
BaseMapper
<
PlanMessage
>
{
List
<
Map
<
String
,
String
>>
getPlanMessageList
(
String
batchNo
,
Integer
stepIndex
);
List
<
Map
<
String
,
String
>>
getPlanMessageList
(
String
batchNo
,
Integer
stepIndex
);
int
getPlanMessageCount
(
String
batchNo
,
Integer
stepIndex
,
Date
indexUpdateTime
);
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/mapper/PlanOperationRecordMapper.java
View file @
1e3b8f04
...
@@ -5,6 +5,7 @@ import com.yeejoin.amos.fas.dao.entity.PlanRule;
...
@@ -5,6 +5,7 @@ import com.yeejoin.amos.fas.dao.entity.PlanRule;
import
com.yeejoin.amos.fas.datasync.bo.PlanOperationRecordSyncBo
;
import
com.yeejoin.amos.fas.datasync.bo.PlanOperationRecordSyncBo
;
import
org.springframework.stereotype.Repository
;
import
org.springframework.stereotype.Repository
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -42,6 +43,18 @@ public interface PlanOperationRecordMapper {
...
@@ -42,6 +43,18 @@ public interface PlanOperationRecordMapper {
*/
*/
String
getLastBatchNo
();
String
getLastBatchNo
();
/**
* 获取userId
* @return
*/
List
<
String
>
getArraysUserIds
(
String
roleCode
);
/**
* 获取用户名称
* @return
*/
List
<
String
>
getArraysUserName
(
String
roleCode
);
Map
<
String
,
Object
>
getLatestFireEquipId
();
Map
<
String
,
Object
>
getLatestFireEquipId
();
PlanRule
getPlanRuleByBatchNo
(
String
batchNo
);
PlanRule
getPlanRuleByBatchNo
(
String
batchNo
);
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/repository/IContingencyPlanInstanceRepository.java
View file @
1e3b8f04
...
@@ -29,7 +29,7 @@ public interface IContingencyPlanInstanceRepository extends BaseDao<ContingencyP
...
@@ -29,7 +29,7 @@ public interface IContingencyPlanInstanceRepository extends BaseDao<ContingencyP
" t.batch_no = ?"
+
" t.batch_no = ?"
+
" AND t.record_type = ?"
+
" AND t.record_type = ?"
+
" ORDER BY"
+
" ORDER BY"
+
" t.
sort
ASC"
,
nativeQuery
=
true
)
" t.
create_date
ASC"
,
nativeQuery
=
true
)
List
<
ContingencyPlanInstance
>
queryForCategory
(
String
batch_no
,
String
recordType
);
List
<
ContingencyPlanInstance
>
queryForCategory
(
String
batch_no
,
String
recordType
);
@Query
(
value
=
@Query
(
value
=
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/event/BizContingencyHandler.java
View file @
1e3b8f04
...
@@ -11,6 +11,7 @@ import com.yeejoin.amos.fas.business.service.impl.RiskSourceServiceImpl;
...
@@ -11,6 +11,7 @@ import com.yeejoin.amos.fas.business.service.impl.RiskSourceServiceImpl;
import
com.yeejoin.amos.fas.business.service.intfc.*
;
import
com.yeejoin.amos.fas.business.service.intfc.*
;
import
com.yeejoin.amos.fas.business.service.model.Operate
;
import
com.yeejoin.amos.fas.business.service.model.Operate
;
import
com.yeejoin.amos.fas.business.service.model.OperateGroup
;
import
com.yeejoin.amos.fas.business.service.model.OperateGroup
;
import
com.yeejoin.amos.fas.business.vo.ContingencyPlanInstanceVO
;
import
com.yeejoin.amos.fas.dao.entity.ContingencyOriginalData
;
import
com.yeejoin.amos.fas.dao.entity.ContingencyOriginalData
;
import
com.yeejoin.amos.fas.dao.entity.ContingencyPlanInstance
;
import
com.yeejoin.amos.fas.dao.entity.ContingencyPlanInstance
;
import
com.yeejoin.amos.fas.dao.entity.Equipment
;
import
com.yeejoin.amos.fas.dao.entity.Equipment
;
...
@@ -116,7 +117,7 @@ public class BizContingencyHandler implements EventHandler{
...
@@ -116,7 +117,7 @@ public class BizContingencyHandler implements EventHandler{
event
.
getPlanExecute
().
getButtonCode
(),
event
.
getPlanExecute
().
getButtonCode
(),
event
.
getPlanExecute
().
getIsExecute
(),
event
.
getPlanExecute
().
getIsExecute
(),
event
.
getPlanExecute
().
getIsAuto
());
event
.
getPlanExecute
().
getIsAuto
());
setButtonExecuted
(
event
.
getPlanExecute
().
getBatchNo
(),
setButtonExecuted
(
event
.
getPlanExecute
().
getBatchNo
(),
event
.
getPlanExecute
().
getContingencyPlanId
(),
event
.
getPlanExecute
().
getContingencyPlanId
(),
event
.
getPlanExecute
().
getButtonCode
(),
event
.
getPlanExecute
().
getButtonCode
(),
event
.
getPlanExecute
().
getConfirm
(),
event
.
getPlanExecute
().
getConfirm
(),
...
@@ -220,6 +221,17 @@ public class BizContingencyHandler implements EventHandler{
...
@@ -220,6 +221,17 @@ public class BizContingencyHandler implements EventHandler{
result
.
put
(
"msgContext"
,
Collections
.
EMPTY_MAP
);
result
.
put
(
"msgContext"
,
Collections
.
EMPTY_MAP
);
result
.
put
(
"msgType"
,
"getStepList"
);
result
.
put
(
"msgType"
,
"getStepList"
);
result
.
put
(
"planStep"
,
objects
);
result
.
put
(
"planStep"
,
objects
);
String
planTask
=
""
;
if
(
redisTemplate
.
hasKey
(
"planTask"
))
{
planTask
=
Objects
.
requireNonNull
(
redisTemplate
.
opsForValue
().
get
(
"planTask"
)).
toString
();
}
else
{
List
<
ContingencyPlanInstanceVO
>
list
=
planVisual3dService
.
getTaskActionList
(
batchNo
,
1
);
if
(
0
<
list
.
size
())
{
planTask
=
JSON
.
toJSONString
(
list
);
}
}
JSONArray
taskObjects
=
JSON
.
parseArray
(
planTask
);
result
.
put
(
"planTask"
,
taskObjects
);
webMqttComponent
.
publish
(
topic
,
JSON
.
toJSONString
(
result
));
webMqttComponent
.
publish
(
topic
,
JSON
.
toJSONString
(
result
));
}
}
});
});
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/event/FireContingencyHandler.java
View file @
1e3b8f04
...
@@ -5,12 +5,16 @@ import com.yeejoin.amos.component.rule.RuleTrigger;
...
@@ -5,12 +5,16 @@ import com.yeejoin.amos.component.rule.RuleTrigger;
import
com.yeejoin.amos.fas.business.action.ContingencyAction
;
import
com.yeejoin.amos.fas.business.action.ContingencyAction
;
import
com.yeejoin.amos.fas.business.action.model.ContingencyEvent
;
import
com.yeejoin.amos.fas.business.action.model.ContingencyEvent
;
import
com.yeejoin.amos.fas.business.action.model.ContingencyRo
;
import
com.yeejoin.amos.fas.business.action.model.ContingencyRo
;
import
com.yeejoin.amos.fas.business.action.result.SafteyPlanResult
;
import
com.yeejoin.amos.fas.business.action.util.ContingencyLogPublisher
;
import
com.yeejoin.amos.fas.business.action.util.ContingencyLogPublisher
;
import
com.yeejoin.amos.fas.business.dao.mapper.*
;
import
com.yeejoin.amos.fas.business.dao.mapper.*
;
import
com.yeejoin.amos.fas.business.dao.repository.IContingencyOriginalDataDao
;
import
com.yeejoin.amos.fas.business.dao.repository.IContingencyOriginalDataDao
;
import
com.yeejoin.amos.fas.business.dao.repository.IContingencyPlanInstanceRepository
;
import
com.yeejoin.amos.fas.business.service.intfc.*
;
import
com.yeejoin.amos.fas.business.service.intfc.*
;
import
com.yeejoin.amos.fas.business.service.model.ToipResponse
;
import
com.yeejoin.amos.fas.business.vo.ContingencyInstanceInfoVO
;
import
com.yeejoin.amos.fas.business.vo.ContingencyInstanceInfoVO
;
import
com.yeejoin.amos.fas.dao.entity.ContingencyOriginalData
;
import
com.yeejoin.amos.fas.dao.entity.ContingencyOriginalData
;
import
com.yeejoin.amos.fas.dao.entity.ContingencyPlanInstance
;
import
com.yeejoin.amos.fas.dao.entity.Equipment
;
import
com.yeejoin.amos.fas.dao.entity.Equipment
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.commons.lang.StringUtils
;
...
@@ -25,6 +29,8 @@ import org.springframework.stereotype.Component;
...
@@ -25,6 +29,8 @@ import org.springframework.stereotype.Component;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -63,12 +69,22 @@ public class FireContingencyHandler implements EventHandler{
...
@@ -63,12 +69,22 @@ public class FireContingencyHandler implements EventHandler{
@Autowired
@Autowired
private
ContingencyInstanceInfoService
contingencyInstanceInfoService
;
private
ContingencyInstanceInfoService
contingencyInstanceInfoService
;
@Autowired
@Autowired
private
RuleTrigger
ruleTrigger
;
private
IContingencyInstance
iContingencyInstance
;
@Autowired
@Autowired
ContingencyAction
contingencyAction
;
ContingencyAction
contingencyAction
;
@Autowired
IContingencyOriginalDataDao
contingencyOriginalDataDao
;
@Autowired
private
ContingencyInstanceInfoMapper
contingencyInstanceInfoMapper
;
@Autowired
private
RuleTrigger
ruleTrigger
;
private
static
Map
<
String
,
String
>
stepMap
=
new
HashMap
<>();
private
static
Map
<
String
,
String
>
stepMap
=
new
HashMap
<>();
@Value
(
"${spring.application.name}"
)
@Value
(
"${spring.application.name}"
)
...
@@ -88,7 +104,8 @@ public class FireContingencyHandler implements EventHandler{
...
@@ -88,7 +104,8 @@ public class FireContingencyHandler implements EventHandler{
event
.
getPlanExecute
().
getContingencyPlanId
(),
event
.
getPlanExecute
().
getContingencyPlanId
(),
event
.
getPlanExecute
().
getButtonCode
(),
event
.
getPlanExecute
().
getButtonCode
(),
event
.
getPlanExecute
().
getConfirm
(),
event
.
getPlanExecute
().
getConfirm
(),
event
.
getPlanExecute
().
getStepState
());
event
.
getPlanExecute
().
getStepState
(),
event
.
getPlanExecute
().
getIsAuto
());
}
}
@Override
@Override
...
@@ -97,7 +114,7 @@ public class FireContingencyHandler implements EventHandler{
...
@@ -97,7 +114,7 @@ public class FireContingencyHandler implements EventHandler{
}
}
public
void
fire
(
String
batchNo
,
String
stepCode
,
String
contingencyPlanId
,
String
buttonCode
,
String
buttonState
,
String
stepStateOnbutton
)
throws
Exception
{
public
void
fire
(
String
batchNo
,
String
stepCode
,
String
contingencyPlanId
,
String
buttonCode
,
String
buttonState
,
String
stepStateOnbutton
,
String
isAuto
)
throws
Exception
{
//火灾误报
//火灾误报
ContingencyOriginalData
contingencyOriginalData
=
iContingencyOriginalDataDao
.
findByBatchNo
(
batchNo
);
ContingencyOriginalData
contingencyOriginalData
=
iContingencyOriginalDataDao
.
findByBatchNo
(
batchNo
);
...
@@ -134,7 +151,13 @@ public class FireContingencyHandler implements EventHandler{
...
@@ -134,7 +151,13 @@ public class FireContingencyHandler implements EventHandler{
ContingencyRo
contingencyRo
=
new
ContingencyRo
();
ContingencyRo
contingencyRo
=
new
ContingencyRo
();
contingencyRo
.
setButtonCode
(
buttonCode
);
contingencyRo
.
setButtonCode
(
buttonCode
);
contingencyRo
.
setButtonState
(
buttonState
);
contingencyRo
.
setButtonState
(
buttonState
);
if
(
"true"
.
equals
(
isAuto
))
{
// 用路线字段标识是否是自动执行
contingencyRo
.
setFireTruckRoute
(
"true"
);
}
else
{
contingencyRo
.
setFireTruckRoute
(
"false"
);
}
// //需要优化
// //需要优化
// ContingencyInstanceInfoVO infoVO = contingencyInstanceInfoService.selectDisposalDetails(batchNo);
// ContingencyInstanceInfoVO infoVO = contingencyInstanceInfoService.selectDisposalDetails(batchNo);
// if (!ObjectUtils.isEmpty(infoVO.getPosition())) {
// if (!ObjectUtils.isEmpty(infoVO.getPosition())) {
...
@@ -186,6 +209,31 @@ public class FireContingencyHandler implements EventHandler{
...
@@ -186,6 +209,31 @@ public class FireContingencyHandler implements EventHandler{
batchNo
batchNo
);
);
SafteyPlanResult
result
=
new
SafteyPlanResult
();
Map
<
String
,
Object
>
tempmap1
=
new
HashMap
<>();
try
{
SimpleDateFormat
sdf1
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
List
<
ContingencyPlanInstance
>
list
=
iContingencyInstance
.
queryForTimeLine
(
contingencyRo
.
getBatchNo
(),
"MESSAGE"
);
ArrayList
records
=
new
ArrayList
<>();
if
(!
ObjectUtils
.
isEmpty
(
list
))
{
list
.
forEach
(
action
->
{
HashMap
map
=
new
HashMap
();
map
.
put
(
"time"
,
sdf1
.
format
(
action
.
getCreateDate
().
getTime
()));
map
.
put
(
"stepName"
,
action
.
getContent
());
records
.
add
(
map
);
});
}
tempmap1
.
put
(
"content"
,
records
);
}
catch
(
Exception
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
result
.
add
(
tempmap1
);
ContingencyRo
paramObj
=
new
ContingencyRo
();
paramObj
.
setBatchNo
(
contingencyRo
.
getBatchNo
());
paramObj
.
setEquipmentId
(
contingencyRo
.
getEquipmentId
());
contingencyAction
.
sendcmdT
(
"recordarea"
,
paramObj
,
result
);
if
(
StringUtils
.
isNotEmpty
(
contingencyOriginalData
.
getEquipmentName
()))
{
if
(
StringUtils
.
isNotEmpty
(
contingencyOriginalData
.
getEquipmentName
()))
{
publisherPlanLog
(
stepCode
,
buttonCode
,
batchNo
);
publisherPlanLog
(
stepCode
,
buttonCode
,
batchNo
);
}
}
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/feign/JcsFeign.java
View file @
1e3b8f04
...
@@ -6,6 +6,8 @@ import com.yeejoin.amos.fas.core.util.ResponseModel;
...
@@ -6,6 +6,8 @@ import com.yeejoin.amos.fas.core.util.ResponseModel;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
/**
/**
* 消息推送
* 消息推送
...
@@ -34,5 +36,11 @@ public interface JcsFeign {
...
@@ -34,5 +36,11 @@ public interface JcsFeign {
*/
*/
@RequestMapping
(
value
=
"/jcs/common/duty-person/person/on_duty/list"
,
method
=
RequestMethod
.
GET
,
consumes
=
"application/json"
)
@RequestMapping
(
value
=
"/jcs/common/duty-person/person/on_duty/list"
,
method
=
RequestMethod
.
GET
,
consumes
=
"application/json"
)
ResponseModel
dutyPersonList
();
ResponseModel
dutyPersonList
();
@RequestMapping
(
value
=
"/jcs//org-person/listCompanyByIds"
,
method
=
RequestMethod
.
GET
,
consumes
=
"application/json"
)
List
<
Object
>
listCompanyByIds
(
@RequestParam
List
<
Long
>
ids
);
@RequestMapping
(
value
=
"/jcs/org-person/person/img/{id}"
,
method
=
RequestMethod
.
GET
,
consumes
=
"application/json"
)
ResponseModel
getPersonImage
(
@PathVariable
String
id
);
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/ContingencyInstanceImpl.java
View file @
1e3b8f04
package
com
.
yeejoin
.
amos
.
fas
.
business
.
service
.
impl
;
package
com
.
yeejoin
.
amos
.
fas
.
business
.
service
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.component.rule.RuleTrigger
;
import
com.yeejoin.amos.component.rule.RuleTrigger
;
...
@@ -16,6 +17,7 @@ import com.yeejoin.amos.fas.business.dao.repository.IContingencyPlanInstanceRepo
...
@@ -16,6 +17,7 @@ import com.yeejoin.amos.fas.business.dao.repository.IContingencyPlanInstanceRepo
import
com.yeejoin.amos.fas.business.event.ContingecyExecEvent
;
import
com.yeejoin.amos.fas.business.event.ContingecyExecEvent
;
import
com.yeejoin.amos.fas.business.event.EventHandler
;
import
com.yeejoin.amos.fas.business.event.EventHandler
;
import
com.yeejoin.amos.fas.business.event.EventType
;
import
com.yeejoin.amos.fas.business.event.EventType
;
import
com.yeejoin.amos.fas.business.feign.JcsFeign
;
import
com.yeejoin.amos.fas.business.feign.RemoteSecurityService
;
import
com.yeejoin.amos.fas.business.feign.RemoteSecurityService
;
import
com.yeejoin.amos.fas.business.service.intfc.*
;
import
com.yeejoin.amos.fas.business.service.intfc.*
;
import
com.yeejoin.amos.fas.business.service.model.Operate
;
import
com.yeejoin.amos.fas.business.service.model.Operate
;
...
@@ -23,13 +25,13 @@ import com.yeejoin.amos.fas.business.service.model.OperateGroup;
...
@@ -23,13 +25,13 @@ import com.yeejoin.amos.fas.business.service.model.OperateGroup;
import
com.yeejoin.amos.fas.business.util.DateUtils
;
import
com.yeejoin.amos.fas.business.util.DateUtils
;
import
com.yeejoin.amos.fas.business.vo.*
;
import
com.yeejoin.amos.fas.business.vo.*
;
import
com.yeejoin.amos.fas.common.enums.PlanReplyMessageEnum
;
import
com.yeejoin.amos.fas.common.enums.PlanReplyMessageEnum
;
import
com.yeejoin.amos.fas.core.util.ResponseModel
;
import
com.yeejoin.amos.fas.dao.entity.ContingencyOriginalData
;
import
com.yeejoin.amos.fas.dao.entity.ContingencyOriginalData
;
import
com.yeejoin.amos.fas.dao.entity.ContingencyPlanInstance
;
import
com.yeejoin.amos.fas.dao.entity.ContingencyPlanInstance
;
import
com.yeejoin.amos.fas.dao.entity.Equipment
;
import
com.yeejoin.amos.fas.dao.entity.Equipment
;
import
com.yeejoin.amos.fas.datasync.bo.ContingencyOriginalDataSyncBo
;
import
com.yeejoin.amos.fas.datasync.bo.ContingencyOriginalDataSyncBo
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.RoleModel
;
import
org.apache.commons.lang3.ArrayUtils
;
import
org.apache.commons.lang3.ArrayUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.codehaus.jackson.map.ObjectMapper
;
import
org.codehaus.jackson.map.ObjectMapper
;
...
@@ -47,7 +49,6 @@ import org.springframework.util.ObjectUtils;
...
@@ -47,7 +49,6 @@ import org.springframework.util.ObjectUtils;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
java.util.*
;
import
java.util.*
;
import
java.util.stream.Collectors
;
@Service
@Service
public
class
ContingencyInstanceImpl
implements
IContingencyInstance
{
public
class
ContingencyInstanceImpl
implements
IContingencyInstance
{
...
@@ -56,6 +57,8 @@ public class ContingencyInstanceImpl implements IContingencyInstance {
...
@@ -56,6 +57,8 @@ public class ContingencyInstanceImpl implements IContingencyInstance {
static
LinkedList
<
Map
<
String
,
String
>>
fireQueue
=
new
LinkedList
<>();
static
LinkedList
<
Map
<
String
,
String
>>
fireQueue
=
new
LinkedList
<>();
// public final static List<String> list = Arrays.asList("0", "1", "2", "5", "9", "10", "11");
@Autowired
@Autowired
private
IContingencyPlanInstanceRepository
repository
;
private
IContingencyPlanInstanceRepository
repository
;
...
@@ -132,6 +135,12 @@ public class ContingencyInstanceImpl implements IContingencyInstance {
...
@@ -132,6 +135,12 @@ public class ContingencyInstanceImpl implements IContingencyInstance {
@Autowired
@Autowired
private
ApplicationEventPublisher
applicationContext
;
private
ApplicationEventPublisher
applicationContext
;
@Autowired
private
IEmergencyTaskService
emergencyTaskService
;
@Autowired
JcsFeign
jcsFeign
;
/**
/**
* 创建预案执行记录
* 创建预案执行记录
*
*
...
@@ -153,6 +162,10 @@ public class ContingencyInstanceImpl implements IContingencyInstance {
...
@@ -153,6 +162,10 @@ public class ContingencyInstanceImpl implements IContingencyInstance {
planInstance
.
setCategory
(
category
);
planInstance
.
setCategory
(
category
);
planInstance
.
setBatchNo
(
instanceNo
);
planInstance
.
setBatchNo
(
instanceNo
);
planInstance
.
setCreateDate
(
new
Date
());
planInstance
.
setCreateDate
(
new
Date
());
if
(
"OPERATE"
.
equalsIgnoreCase
(
recordType
))
{
JSONObject
obj
=
JSON
.
parseObject
(
content
);
planInstance
.
setStepCode
(
String
.
valueOf
(
obj
.
get
(
"stepCode"
)));
}
//计算序号
//计算序号
int
count
=
repository
.
countByBatchNo
(
instanceNo
);
int
count
=
repository
.
countByBatchNo
(
instanceNo
);
planInstance
.
setSort
(++
count
);
planInstance
.
setSort
(++
count
);
...
@@ -351,6 +364,7 @@ public class ContingencyInstanceImpl implements IContingencyInstance {
...
@@ -351,6 +364,7 @@ public class ContingencyInstanceImpl implements IContingencyInstance {
redisTemplate
.
delete
(
RiskSourceServiceImpl
.
cacheKeyForCanBeRunning
());
redisTemplate
.
delete
(
RiskSourceServiceImpl
.
cacheKeyForCanBeRunning
());
// 应急处置中断,初始化planStep,json数据
// 应急处置中断,初始化planStep,json数据
planStepService
.
initPlanStep
();
planStepService
.
initPlanStep
();
planStepService
.
initPlanTask
();
// 应急处置中断,更新预案信息表结束时间
// 应急处置中断,更新预案信息表结束时间
contingencyInstanceInfoService
.
updateEndTimeById
(
batchNo
);
contingencyInstanceInfoService
.
updateEndTimeById
(
batchNo
);
}
}
...
@@ -396,8 +410,9 @@ public class ContingencyInstanceImpl implements IContingencyInstance {
...
@@ -396,8 +410,9 @@ public class ContingencyInstanceImpl implements IContingencyInstance {
@Override
@Override
public
void
updateStep
(
String
step
,
String
batchNo
)
{
public
void
updateStep
(
String
step
,
String
batchNo
)
{
int
update
=
iContingencyOriginalDataDao
.
updateByButtonStep
(
step
,
batchNo
);
int
update
=
iContingencyOriginalDataDao
.
updateByButtonStep
(
step
,
batchNo
);
emergencyTaskService
.
saveTask
(
step
,
batchNo
);
// 异步数据同步之消息发送
// 异步数据同步之消息发送
// contingencyOriginalDataDataSync(batchNo, update);
// contingencyOriginalDataDataSync(batchNo, update);
}
}
@Override
@Override
...
@@ -438,6 +453,98 @@ public class ContingencyInstanceImpl implements IContingencyInstance {
...
@@ -438,6 +453,98 @@ public class ContingencyInstanceImpl implements IContingencyInstance {
return
Optional
.
empty
();
return
Optional
.
empty
();
}
}
@Override
public
Optional
<
Equipment
>
clickButton
(
String
batchNo
,
String
stepCode
,
String
buttonJson
,
String
contingencyPlanId
,
String
buttonCode
,
String
buttonState
,
String
stepStateOnbutton
,
String
isExecute
,
String
isAuto
,
String
token
,
String
product
,
String
appKey
,
String
startUserName
)
throws
Exception
{
if
(
"0"
.
equals
(
stepCode
))
{
contingencyInstance
.
fire
(
batchNo
,
stepCode
,
buttonJson
,
contingencyPlanId
,
"FIRE_CONFIRM"
,
buttonState
,
stepStateOnbutton
,
"true"
,
"false"
,
token
,
product
,
appKey
,
startUserName
);
}
ContingencyPlanInstance
instance
=
contingencyPlanInstanceMapper
.
getMessageById
(
contingencyPlanId
);
instance
.
setId
(
null
);
instance
.
setRecordType
(
"REPLYMESSAGE"
);
instance
.
setCreateDate
(
new
Date
());
instance
.
setContent
(
instance
.
getCategory
());
ContingencyPlanInstance
res
=
repository
.
save
(
instance
);
if
(!
ObjectUtils
.
isEmpty
(
res
))
{
List
<
EmergencyTaskContentVo
>
mustTasks
=
emergencyTaskService
.
getMustTaskList
(
stepCode
);
boolean
flag
=
judgeIfConfirmed
(
mustTasks
,
batchNo
);
if
(!
"-1"
.
equals
(
stepCode
)
&&
flag
)
{
PlanExecuteVo
vo
=
new
PlanExecuteVo
();
vo
.
setConfirm
(
buttonState
);
vo
.
setStepState
(
stepStateOnbutton
);
vo
.
setBatchNo
(
batchNo
);
vo
.
setStepCode
(
stepCode
);
vo
.
setButtonCode
(
buttonCode
);
vo
.
setContingencyPlanId
(
contingencyPlanId
);
vo
.
setButtonJson
(
buttonJson
);
vo
.
setIsAuto
(
isAuto
);
vo
.
setIsExecute
(
isExecute
);
ContingecyExecEvent
fireEvent
=
new
ContingecyExecEvent
(
this
);
fireEvent
.
setEventType
(
EventType
.
FIRE_NEXT_RULE
.
name
());
fireEvent
.
setPlanExecute
(
vo
);
fireEvent
.
setContext
(
RequestContext
.
cloneRequestContext
());
applicationContext
.
publishEvent
(
fireEvent
);
ContingecyExecEvent
updateEvent
=
new
ContingecyExecEvent
(
this
);
updateEvent
.
setEventType
(
EventType
.
UPDATE_CONTINGENCY_DATE
.
name
());
updateEvent
.
setPlanExecute
(
vo
);
updateEvent
.
setContext
(
RequestContext
.
cloneRequestContext
());
try
{
applicationContext
.
publishEvent
(
updateEvent
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
else
{
String
planStep
=
""
;
if
(
redisTemplate
.
hasKey
(
"planStep"
))
{
planStep
=
Objects
.
requireNonNull
(
redisTemplate
.
opsForValue
().
get
(
"planStep"
)).
toString
();
}
else
{
planStep
=
planStepService
.
getPlanStep
();
}
JSONArray
objects
=
JSON
.
parseArray
(
planStep
);
String
topic
=
String
.
format
(
"/%s/%s/%s"
,
serviceName
,
stationName
,
"plan"
);
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
result
.
put
(
"contingency"
,
new
ContingencyRo
());
result
.
put
(
"msgContext"
,
Collections
.
EMPTY_MAP
);
result
.
put
(
"msgType"
,
"getStepList"
);
result
.
put
(
"planStep"
,
objects
);
String
planTask
=
""
;
if
(
redisTemplate
.
hasKey
(
"planTask"
))
{
planTask
=
Objects
.
requireNonNull
(
redisTemplate
.
opsForValue
().
get
(
"planTask"
)).
toString
();
}
else
{
List
<
ContingencyPlanInstanceVO
>
lists
=
planVisual3dService
.
getTaskActionList
(
batchNo
,
1
);
planTask
=
JSON
.
toJSONString
(
lists
);
}
JSONArray
taskObjects
=
JSON
.
parseArray
(
planTask
);
result
.
put
(
"planTask"
,
taskObjects
);
webMqttComponent
.
publish
(
topic
,
JSON
.
toJSONString
(
result
));
}
String
topic
=
String
.
format
(
"/%s/%s/%s"
,
serviceName
,
stationName
,
"plan"
);
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"contingency"
,
new
ContingencyRo
());
map
.
put
(
"msgContext"
,
Collections
.
EMPTY_MAP
);
map
.
put
(
"msgType"
,
"refreshTaskRecord"
);
webMqttComponent
.
publish
(
topic
,
JSON
.
toJSONString
(
map
));
}
return
Optional
.
empty
();
}
private
boolean
judgeIfConfirmed
(
List
<
EmergencyTaskContentVo
>
mustTasks
,
String
batchNo
)
{
if
(
0
==
mustTasks
.
size
())
{
return
true
;
}
EmergencyTaskContentVo
vo
=
mustTasks
.
get
(
0
);
Integer
count
=
contingencyPlanInstanceMapper
.
getPlanInstanceByRunState
(
vo
.
getStepCode
(),
batchNo
);
if
(
0
==
count
)
{
return
true
;
}
else
{
return
false
;
}
}
@Autowired
@Autowired
List
<
EventHandler
>
handlers
;
List
<
EventHandler
>
handlers
;
...
@@ -467,37 +574,48 @@ public class ContingencyInstanceImpl implements IContingencyInstance {
...
@@ -467,37 +574,48 @@ public class ContingencyInstanceImpl implements IContingencyInstance {
FeignClientResult
<
AgencyUserModel
>
feignClientResult
=
Privilege
.
agencyUserClient
.
getme
();
FeignClientResult
<
AgencyUserModel
>
feignClientResult
=
Privilege
.
agencyUserClient
.
getme
();
AgencyUserModel
user
=
(
AgencyUserModel
)
feignClientResult
.
getResult
();
AgencyUserModel
user
=
(
AgencyUserModel
)
feignClientResult
.
getResult
();
List
<
PlanStepJsonVO
>
result
=
planStepService
.
getPlanStepJsonVOS
();
// List<PlanStepJsonVO> result = planStepService.getPlanStepJsonVOS();
List
<
String
>
roleCode
=
result
.
stream
().
map
(
PlanStepJsonVO:
:
getRoleCode
).
distinct
().
collect
(
Collectors
.
toList
());
// List<String> roleCode = result.stream().map(PlanStepJsonVO::getRoleCode).distinct().collect(Collectors.toList());
//
// List<RoleModel> roleModelList = new ArrayList<>();
// for (Long key : user.getOrgRoles().keySet()) {
// roleModelList.addAll(user.getOrgRoles().get(key));
// }
// List<String> roleCodeList = new ArrayList<>();
// List<String> roleNameList = new ArrayList<>();
// List<String> realRoleCode = roleModelList.stream().map(RoleModel::getRoleName).distinct().collect(Collectors.toList());
// realRoleCode.forEach(item -> {
// if (roleCode.contains(item)) {
// roleCodeList.add(item);
// }
// });
// roleModelList.forEach(item -> {
// if (!roleNameList.contains(item.getRoleDesc()) && roleCode.contains(item.getRoleName())) {
// roleNameList.add(item.getRoleDesc());
// }
// });
String
roleCodes
=
emergencyTaskService
.
getRolesByUserId
(
user
.
getUserId
());
String
roleNames
=
emergencyTaskService
.
getRolesNameByUserId
(
user
.
getUserId
());
List
<
String
>
roleCodeList
=
Arrays
.
asList
(
roleCodes
.
split
(
","
));
List
<
String
>
roleNameList
=
Arrays
.
asList
(
roleNames
.
split
(
","
));
List
<
RoleModel
>
roleModelList
=
new
ArrayList
<>();
for
(
Long
key
:
user
.
getOrgRoles
().
keySet
())
{
roleModelList
.
addAll
(
user
.
getOrgRoles
().
get
(
key
));
}
List
<
String
>
roleCodeList
=
new
ArrayList
<>();
List
<
String
>
roleNameList
=
new
ArrayList
<>();
List
<
String
>
realRoleCode
=
roleModelList
.
stream
().
map
(
RoleModel:
:
getRoleName
).
distinct
().
collect
(
Collectors
.
toList
());
realRoleCode
.
forEach
(
item
->
{
if
(
roleCode
.
contains
(
item
))
{
roleCodeList
.
add
(
item
);
}
});
roleModelList
.
forEach
(
item
->
{
if
(!
roleNameList
.
contains
(
item
.
getRoleDesc
())
&&
roleCode
.
contains
(
item
.
getRoleName
()))
{
roleNameList
.
add
(
item
.
getRoleDesc
());
}
});
contingencyPlanInstance
.
setRoleCode
(
String
.
join
(
"-"
,
roleCodeList
));
contingencyPlanInstance
.
setRoleCode
(
String
.
join
(
"-"
,
roleCodeList
));
contingencyPlanInstance
.
setRoleName
(
String
.
join
(
"-"
,
roleNameList
));
contingencyPlanInstance
.
setRoleName
(
String
.
join
(
"-"
,
roleNameList
));
contingencyPlanInstance
.
setStartUserId
(
user
.
getUserId
());
contingencyPlanInstance
.
setStartUserId
(
user
.
getUserId
());
contingencyPlanInstance
.
setStartUserName
(
user
.
getRealName
());
contingencyPlanInstance
.
setStartUserName
(
user
.
getRealName
());
Map
<
String
,
String
>
userInfo
=
contingencyPlanInstanceMapper
.
getUserByUserId
(
user
.
getUserId
());
ResponseModel
responseModel
=
null
;
if
(!
ObjectUtils
.
isEmpty
(
userInfo
))
{
try
{
String
img
=
userInfo
.
get
(
"personImg"
);
responseModel
=
jcsFeign
.
getPersonImage
(
user
.
getUserId
());
contingencyPlanInstance
.
setPersonImg
(
StringUtils
.
isBlank
(
img
)
?
personImg
:
img
);
}
catch
(
Exception
e
)
{
}
else
{
e
.
printStackTrace
();
contingencyPlanInstance
.
setPersonImg
(
personImg
);
}
String
img
=
null
;
if
(
responseModel
!=
null
&&
"SUCCESS"
.
equals
(
responseModel
.
getDevMessage
()))
{
String
resStr
=
JSON
.
toJSONString
(
responseModel
.
getResult
()).
replace
(
"\""
,
""
);
img
=
"null"
.
equalsIgnoreCase
(
resStr
)
?
null
:
img
;
}
}
img
=
StringUtils
.
isEmpty
(
img
)
?
personImg
:
img
;
contingencyPlanInstance
.
setPersonImg
(
img
);
}
}
return
contingencyPlanInstance
;
return
contingencyPlanInstance
;
}
}
...
@@ -521,7 +639,7 @@ public class ContingencyInstanceImpl implements IContingencyInstance {
...
@@ -521,7 +639,7 @@ public class ContingencyInstanceImpl implements IContingencyInstance {
}
}
// @Scheduled(cron = "*/2 * * * * ?")
// @Scheduled(cron = "*/2 * * * * ?")
public
void
runFireQueue
()
throws
Exception
{
public
void
runFireQueue
()
throws
Exception
{
if
(
fireQueue
.
size
()
==
0
)
if
(
fireQueue
.
size
()
==
0
)
...
@@ -574,4 +692,10 @@ public class ContingencyInstanceImpl implements IContingencyInstance {
...
@@ -574,4 +692,10 @@ public class ContingencyInstanceImpl implements IContingencyInstance {
return
contingencyPlanInstanceMapper
.
getMessageById
(
id
);
return
contingencyPlanInstanceMapper
.
getMessageById
(
id
);
}
}
@Override
public
String
getInstanceIdByBatchNOAndCategory
(
String
type
,
String
name
,
String
batchNo
)
{
return
contingencyPlanInstanceMapper
.
getInstanceIdByBatchNOAndCategory
(
type
,
name
,
batchNo
);
}
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/ContingencyPlanServiceImpl.java
View file @
1e3b8f04
...
@@ -29,6 +29,7 @@ import org.apache.commons.lang3.StringUtils;
...
@@ -29,6 +29,7 @@ import org.apache.commons.lang3.StringUtils;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.apache.logging.log4j.Logger
;
import
org.eclipse.paho.client.mqttv3.MqttException
;
import
org.eclipse.paho.client.mqttv3.MqttException
;
import
org.eclipse.paho.client.mqttv3.MqttMessage
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.beans.factory.annotation.Qualifier
;
...
@@ -36,8 +37,12 @@ import org.springframework.beans.factory.annotation.Value;
...
@@ -36,8 +37,12 @@ import org.springframework.beans.factory.annotation.Value;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.support.TransactionSynchronization
;
import
org.springframework.transaction.support.TransactionSynchronizationManager
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
import
org.typroject.tyboot.component.emq.EmqxListener
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
...
@@ -89,6 +94,9 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
...
@@ -89,6 +94,9 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
private
String
serviceName
;
private
String
serviceName
;
@Autowired
@Autowired
private
ContingencyInstanceInfoMapper
contingencyInstanceInfoMapper
;
@Autowired
private
IDataSyncService
dataSyncService
;
private
IDataSyncService
dataSyncService
;
private
final
PlanOperationRecordMapper
planOperationRecordMapper
;
private
final
PlanOperationRecordMapper
planOperationRecordMapper
;
private
final
IPlanDetailDao
planDetailDao
;
private
final
IPlanDetailDao
planDetailDao
;
...
@@ -107,6 +115,9 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
...
@@ -107,6 +115,9 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
@Autowired
@Autowired
private
RedisTemplate
<
String
,
String
>
redisTemplate
;
private
RedisTemplate
<
String
,
String
>
redisTemplate
;
@Autowired
private
IEmergencyTaskService
emergencyTaskService
;
@Autowired
@Autowired
public
ContingencyPlanServiceImpl
(
IPlanDetailDao
planDetailDao
,
IPlanDocDao
planDocDao
,
IPlanEquipmentDao
planEquipmentDao
,
public
ContingencyPlanServiceImpl
(
IPlanDetailDao
planDetailDao
,
IPlanDocDao
planDocDao
,
IPlanEquipmentDao
planEquipmentDao
,
...
@@ -236,7 +247,43 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
...
@@ -236,7 +247,43 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
contingencyInstanceInfoService
.
addDisposalDetails
(
instanceInfo
);
contingencyInstanceInfoService
.
addDisposalDetails
(
instanceInfo
);
result
.
setMessage
(
ReserveEnum
.
RUN
.
getText
());
result
.
setMessage
(
ReserveEnum
.
RUN
.
getText
());
result
.
setBatchNo
(
batchNo
);
result
.
setBatchNo
(
batchNo
);
equipmentHandlerService
.
executeDynamicPlan
(
batchNo
,
deviceData
,
equipment
,
equipmentSpecific
,
toke
,
operationRecord
.
getId
());
TransactionSynchronizationManager
.
registerSynchronization
(
new
TransactionSynchronization
()
{
@Override
public
void
afterCommit
()
{
equipmentHandlerService
.
executeDynamicPlan
(
batchNo
,
deviceData
,
equipment
,
equipmentSpecific
,
toke
,
operationRecord
.
getId
());
emergencyTaskService
.
saveTask
(
"0"
,
batchNo
);
}
});
// app端使用
ContingencyRo
contingencyRo
=
new
ContingencyRo
();
contingencyRo
.
setBatchNo
(
batchNo
);
contingencyRo
.
setEquipmentId
(
String
.
valueOf
(
equipment
.
getId
()));
contingencyRo
.
setEquipmentName
(
equipment
.
getName
());
contingencyRo
.
setFireEquipmentId
(
String
.
valueOf
(
equipmentSpecific
.
getId
()));
contingencyRo
.
setFireEquipmentName
(
equipmentSpecific
.
getName
());
contingencyRo
.
setFireEquipmentCode
(
equipmentSpecific
.
getCode
());
contingencyRo
.
setStep
(
"0"
);
contingencyRo
.
setConfirm
(
"NONE"
);
contingencyRo
.
setFireTruckRoute
(
equipment
.
getFireTruckRoute
());
contingencyRo
.
setRunstep
(
false
);
contingencyRo
.
setEquipmentPosition3d
(
equipment
.
getPosition3d
());
contingencyRo
.
setEquipmentCode
(
equipment
.
getCode
());
contingencyRo
.
setEquipmentOrgCode
(
equipment
.
getOrgCode
());
contingencyRo
.
getParams
().
put
(
"equipmentId"
,
equipment
.
getId
());
contingencyRo
.
setPosition
(
equipmentSpecific
.
getPosition
());
String
topic
=
String
.
format
(
"/%s/%s/%s"
,
serviceName
,
stationName
,
"plan"
);
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
JSONObject
msgContext
=
new
JSONObject
();
msgContext
.
put
(
"content"
,
"startPlanFirst"
);
map
.
put
(
"contingency"
,
new
ContingencyRo
());
// map.put("msgContext", "{\"content\":\"startPlan\"}");
// msgContext.put("content", "startPlan");
map
.
put
(
"contingency"
,
contingencyRo
);
map
.
put
(
"msgContext"
,
msgContext
);
map
.
put
(
"msgType"
,
"refreshRecord"
);
webMqttComponent
.
publish
(
topic
,
JSON
.
toJSONString
(
map
));
}
}
return
result
;
return
result
;
}
}
...
@@ -689,50 +736,60 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
...
@@ -689,50 +736,60 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
@Override
@Override
public
void
subscribeTopic
()
{
public
void
subscribeTopic
()
{
try
{
try
{
emqKeeper
.
getMqttClient
().
subscribe
(
DELETE_SYNC_PLAN_DOC
,
(
s
,
mqttMessage
)
->
{
emqKeeper
.
subscript
(
DELETE_SYNC_PLAN_DOC
,
1
,
new
EmqxListener
()
{
byte
[]
payload
=
mqttMessage
.
getPayload
();
@Override
try
{
public
void
processMessage
(
String
topic
,
MqttMessage
message
)
{
List
<
Long
>
ids
=
(
List
<
Long
>)
ClazzUtils
.
deserializableObject
(
payload
);
if
(!
ValidationUtil
.
isEmpty
(
ids
))
{
byte
[]
payload
=
message
.
getPayload
();
planDocMapper
.
logicDeleteByDocIdList
(
ids
);
try
{
}
List
<
Long
>
ids
=
(
List
<
Long
>)
ClazzUtils
.
deserializableObject
(
payload
);
}
catch
(
Exception
e
)
{
if
(!
ValidationUtil
.
isEmpty
(
ids
))
{
logger
.
error
(
"预案文档删除同步出错"
,
e
);
planDocMapper
.
logicDeleteByDocIdList
(
ids
);
}
}
catch
(
Exception
e
)
{
logger
.
error
(
"预案文档删除同步出错"
,
e
);
}
}
}
});
});
}
catch
(
Mqtt
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
fatal
(
"订阅文档删除同步消息失败,资源删除或取消无法同步"
,
e
);
logger
.
fatal
(
"订阅文档删除同步消息失败,资源删除或取消无法同步"
,
e
);
}
}
try
{
try
{
emqKeeper
.
getMqttClient
().
subscribe
(
DELETE_SYNC_PLAN_RULE
,
(
s
,
mqttMessage
)
->
{
emqKeeper
.
subscript
(
DELETE_SYNC_PLAN_RULE
,
1
,
new
EmqxListener
()
{
byte
[]
payload
=
mqttMessage
.
getPayload
();
@Override
try
{
public
void
processMessage
(
String
topic
,
MqttMessage
message
)
{
String
[]
ids
=
new
String
(
payload
).
split
(
","
);
byte
[]
payload
=
message
.
getPayload
();
if
(!
ValidationUtil
.
isEmpty
(
ids
))
{
try
{
planRuleMapper
.
logicDeleteByRuleIdList
(
Arrays
.
asList
(
ids
));
String
[]
ids
=
new
String
(
payload
).
split
(
","
);
}
if
(!
ValidationUtil
.
isEmpty
(
ids
))
{
}
catch
(
Exception
e
)
{
planRuleMapper
.
logicDeleteByRuleIdList
(
Arrays
.
asList
(
ids
));
logger
.
error
(
"预案规则删除同步出错"
,
e
);
}
}
catch
(
Exception
e
)
{
logger
.
error
(
"预案规则删除同步出错"
,
e
);
}
}
}
});
});
}
catch
(
Mqtt
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
fatal
(
"订阅规则删除同步消息失败,资源删除或取消无法同步"
,
e
);
logger
.
fatal
(
"订阅规则删除同步消息失败,资源删除或取消无法同步"
,
e
);
}
}
try
{
try
{
emqKeeper
.
getMqttClient
().
subscribe
(
VIEW_3D_OPEN_STATUS
,
(
s
,
mqttMessage
)
->
{
emqKeeper
.
subscript
(
VIEW_3D_OPEN_STATUS
,
1
,
new
EmqxListener
()
{
Map
msg
=
JSON
.
parseObject
(
mqttMessage
.
toString
());
@Override
if
(
msg
.
containsKey
(
"status"
)
&&
msg
.
containsKey
(
"seq"
))
{
public
void
processMessage
(
String
topic
,
MqttMessage
message
)
{
String
seq
=
msg
.
get
(
"seq"
).
toString
();
Map
msg
=
JSON
.
parseObject
(
message
.
toString
());
String
status
=
msg
.
get
(
"status"
).
toString
();
if
(
msg
.
containsKey
(
"status"
)
&&
msg
.
containsKey
(
"seq"
))
{
String
key
=
KEY_VIEW_3D_PAGE
+
seq
;
String
seq
=
msg
.
get
(
"seq"
).
toString
();
if
(
"offLine"
.
equals
(
status
))
{
String
status
=
msg
.
get
(
"status"
).
toString
();
redisTemplate
.
delete
(
key
);
String
key
=
KEY_VIEW_3D_PAGE
+
seq
;
}
else
{
if
(
"offLine"
.
equals
(
status
))
{
redisTemplate
.
opsForValue
().
set
(
key
,
status
);
redisTemplate
.
delete
(
key
);
}
else
{
redisTemplate
.
opsForValue
().
set
(
key
,
status
);
}
}
}
}
}
});
});
}
catch
(
Mqtt
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
fatal
(
"订阅规则删除同步消息失败,资源删除或取消无法同步"
,
e
);
logger
.
fatal
(
"订阅规则删除同步消息失败,资源删除或取消无法同步"
,
e
);
}
}
}
}
...
@@ -766,6 +823,29 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
...
@@ -766,6 +823,29 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
});
});
}
}
<<<<<<<
HEAD
=======
// 异步数据同步之消息发送
if
(!
planList
.
isEmpty
()
&&
dataSyncSwitch
)
{
try
{
dataSyncService
.
asyncInvoke
(()
->
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"status"
,
"2"
);
List
<
PlanDetailSyncBo
>
planDetailSyncBoList
=
planDetailMapper
.
getPlanDetailSyncBoList
(
map
);
dataSyncService
.
syncCreatedPlanDetailSyncBo
(
planDetailSyncBoList
);
Map
<
String
,
Object
>
mapRecord
=
new
HashMap
<>();
mapRecord
.
put
(
"status"
,
"1"
);
List
<
PlanOperationRecordSyncBo
>
planOperationRecordSyncBoList
=
planOperationRecordMapper
.
getPlanOperationRecordSyncBoList
(
mapRecord
);
dataSyncService
.
syncCreatedPlanOperationRecordSyncBo
(
planOperationRecordSyncBoList
);
});
}
catch
(
Exception
e
)
{
logger
.
info
(
"数据同步之消息发送. [method='{}']"
,
"activatePlan==>syncCreatedPlanDetailSyncBo==>syncCreatedPlanOperationRecordSyncBo"
,
e
);
}
}
planStepService
.
initPlanStep
();
planStepService
.
initPlanTask
();
>>>>>>>
824
e5c019383569502d9457a413770a699dd18ce
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
bool
.
set
(
false
);
bool
.
set
(
false
);
e
.
printStackTrace
();
e
.
printStackTrace
();
...
@@ -789,6 +869,35 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
...
@@ -789,6 +869,35 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
}
}
@Override
@Override
public
Page
<
ContingencyPlanInstanceVO
>
selectTaskActionPage
(
int
current
,
int
size
,
String
batchNo
,
String
runState
,
String
updateDate
,
List
<
String
>
roleList
)
{
String
type
=
"TASKOPERATE"
;
Page
<
ContingencyPlanInstanceVO
>
page
=
new
Page
<>(
current
,
size
);
int
total
=
0
;
total
=
contingencyInstanceInfoMapper
.
countTaskPage
(
type
,
batchNo
,
roleList
);
long
start
=
(
page
.
getCurrent
()
-
1
)
*
page
.
getSize
();
if
(
total
==
0
)
{
page
.
setCurrent
(
1
);
}
else
{
if
(
total
<
start
)
{
page
.
setCurrent
(
1
);
start
=
0
;
}
List
<
ContingencyPlanInstanceVO
>
list
=
contingencyInstanceInfoMapper
.
getTaskActionPage
((
int
)
start
,
size
,
batchNo
,
type
,
runState
,
updateDate
,
roleList
);
list
.
stream
().
forEach
(
e
->{
if
(
ObjectUtils
.
isEmpty
(
e
.
getCreateUser
()))
{
List
<
String
>
userName
=
planVisual3dService
.
getUserName
(
e
.
getRoleCode
());
String
[]
objects
=
new
String
[
userName
.
size
()];
String
[]
strings
=
userName
.
toArray
(
objects
);
e
.
setStartUserName
(
String
.
join
(
","
,
strings
));
}
});
page
.
setRecords
(
list
);
page
.
setTotal
(
total
);
}
return
page
;
}
@Override
public
Map
<
String
,
Object
>
getUserOperateCountAndPlanName
(
List
<
RoleModel
>
roleModelList
)
{
public
Map
<
String
,
Object
>
getUserOperateCountAndPlanName
(
List
<
RoleModel
>
roleModelList
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
List
<
PlanOperationRecord
>
recordList
=
planOperationRecordDao
.
findByStatus
(
0
);
List
<
PlanOperationRecord
>
recordList
=
planOperationRecordDao
.
findByStatus
(
0
);
...
@@ -806,4 +915,22 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
...
@@ -806,4 +915,22 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
return
map
;
return
map
;
}
}
@Override
public
Map
<
String
,
Object
>
getUserOperateCountAndTaskName
(
List
<
String
>
roleList
,
Map
<
String
,
Object
>
map
)
{
List
<
PlanOperationRecord
>
recordList
=
planOperationRecordDao
.
findByStatus
(
0
);
if
(!
CollectionUtils
.
isEmpty
(
recordList
))
{
PlanOperationRecord
record
=
recordList
.
get
(
0
);
String
batchNo
=
record
.
getBatchNo
();
ContingencyInstanceInfoVO
instanceInfo
=
contingencyInstanceInfoService
.
selectDisposalDetails
(
batchNo
);
if
(
instanceInfo
!=
null
)
{
map
.
put
(
"planName"
,
instanceInfo
.
getName
());
map
.
put
(
"batchNo"
,
batchNo
);
List
<
ContingencyPlanInstanceVO
>
list
=
planVisual3dService
.
selectTaskActionList
(
batchNo
,
roleList
,
1
);
map
.
put
(
"taskNum"
,
list
.
size
());
}
}
return
map
;
}
}
}
\ No newline at end of file
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/EmergencyTaskServiceImpl.java
0 → 100644
View file @
1e3b8f04
package
com
.
yeejoin
.
amos
.
fas
.
business
.
service
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.yeejoin.amos.fas.business.action.model.ContingencyRo
;
import
com.yeejoin.amos.fas.business.action.mq.WebMqttComponent
;
import
com.yeejoin.amos.fas.business.dao.mapper.EmergencyTaskMapper
;
import
com.yeejoin.amos.fas.business.dao.mapper.PlanOperationRecordMapper
;
import
com.yeejoin.amos.fas.business.dao.repository.IContingencyPlanInstanceRepository
;
import
com.yeejoin.amos.fas.business.dao.repository.IPlanOperationRecordDao
;
import
com.yeejoin.amos.fas.business.service.intfc.IContingencyInstance
;
import
com.yeejoin.amos.fas.business.service.intfc.IEmergencyTaskService
;
import
com.yeejoin.amos.fas.business.service.intfc.IPlanStepService
;
import
com.yeejoin.amos.fas.business.service.intfc.IPlanVisual3dService
;
import
com.yeejoin.amos.fas.business.vo.ContingencyPlanInstanceVO
;
import
com.yeejoin.amos.fas.business.vo.EmergencyTaskContentVo
;
import
com.yeejoin.amos.fas.business.vo.MessageVO
;
import
com.yeejoin.amos.fas.core.common.request.CommonPageable
;
import
com.yeejoin.amos.fas.core.util.StringUtil
;
import
com.yeejoin.amos.fas.dao.entity.ContingencyPlanInstance
;
import
com.yeejoin.amos.fas.dao.entity.EmergencyRelation
;
import
com.yeejoin.amos.fas.dao.entity.EmergencyRelationTree
;
import
com.yeejoin.amos.fas.dao.entity.EmergencyTaskContent
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.time.DateFormatUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageImpl
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.support.TransactionSynchronization
;
import
org.springframework.transaction.support.TransactionSynchronizationManager
;
import
org.springframework.util.CollectionUtils
;
import
java.util.*
;
@Service
public
class
EmergencyTaskServiceImpl
implements
IEmergencyTaskService
{
@Autowired
private
EmergencyTaskMapper
emergencyTaskMapper
;
@Autowired
private
IContingencyInstance
iContingencyInstance
;
@Autowired
private
IPlanOperationRecordDao
planOperationRecordDao
;
@Autowired
private
IContingencyPlanInstanceRepository
contingencyPlanInstanceRepository
;
@Autowired
private
RedisTemplate
redisTemplate
;
@Autowired
private
IPlanVisual3dService
planVisual3dService
;
@Autowired
private
IPlanStepService
planStepService
;
@Autowired
private
WebMqttComponent
webMqttComponent
;
@Autowired
private
PlanOperationRecordMapper
planOperationRecordMapper
;
@Value
(
"${spring.application.name}"
)
private
String
serviceName
;
@Value
(
"${station.name}"
)
private
String
stationName
;
@Override
public
Page
<
EmergencyTaskContent
>
list
(
Long
obligationId
,
CommonPageable
pageable
)
{
int
total
=
emergencyTaskMapper
.
getEmergencyTaskCount
(
obligationId
);
List
<
EmergencyTaskContent
>
emergencyTaskList
=
emergencyTaskMapper
.
getEmergencyTaskList
(
obligationId
,
pageable
.
getOffset
(),
pageable
.
getPageSize
());
Page
<
EmergencyTaskContent
>
result
=
new
PageImpl
<>(
emergencyTaskList
,
pageable
,
total
);
return
result
;
}
@Override
public
List
<
EmergencyRelationTree
>
treeList
()
{
return
emergencyTaskMapper
.
treeList
();
}
@Override
public
void
deleteTreeNode
(
Long
obligationId
,
Long
personId
)
{
emergencyTaskMapper
.
deleteTreeNode
(
obligationId
,
personId
);
}
@Override
public
void
save
(
EmergencyRelation
emergencyRelation
)
{
emergencyTaskMapper
.
save
(
emergencyRelation
);
}
@Override
public
String
getRolesByUserId
(
String
userId
)
{
List
<
String
>
list
=
emergencyTaskMapper
.
roleCodes
(
userId
);
String
roleCodes
=
String
.
join
(
","
,
list
);
return
roleCodes
;
}
@Override
public
String
getRolesNameByUserId
(
String
userId
)
{
List
<
String
>
list
=
emergencyTaskMapper
.
roleNames
(
userId
);
String
roleNames
=
String
.
join
(
","
,
list
);
return
roleNames
;
}
@Override
public
List
<
Long
>
getPersonIds
(
Long
obligationId
)
{
return
emergencyTaskMapper
.
getPersonIds
(
obligationId
);
}
@Async
@Transactional
@Override
public
void
saveTask
(
String
stepCode
,
String
batchId
)
{
List
<
EmergencyTaskContentVo
>
list
=
emergencyTaskMapper
.
getContentList
(
stepCode
);
if
(
0
<
list
.
size
())
{
String
batchNo
=
StringUtil
.
isNotEmpty
(
batchId
)
?
batchId
:
planOperationRecordMapper
.
getLastBatchNo
();
if
(!
findByBatchNoAndStatus
(
batchNo
))
{
for
(
EmergencyTaskContentVo
vo
:
list
)
{
String
taskName
=
vo
.
getContent
();
String
roleCode
=
vo
.
getRoleCode
();
Integer
taskNum
=
Integer
.
valueOf
(
vo
.
getTaskNum
());
String
buttonJson
=
vo
.
getButtonJson
();
String
instanceId
=
iContingencyInstance
.
getInstanceIdByBatchNOAndCategory
(
"TASKOPERATE"
,
taskName
,
batchNo
);
if
(!
StringUtils
.
isEmpty
(
instanceId
))
{
return
;
}
ContingencyPlanInstance
contingencyPlanInstance
=
new
ContingencyPlanInstance
();
contingencyPlanInstance
.
setBatchNo
(
batchNo
);
contingencyPlanInstance
.
setRecordType
(
"TASKOPERATE"
);
contingencyPlanInstance
.
setRoleCode
(
roleCode
);
contingencyPlanInstance
.
setCategory
(
taskName
);
contingencyPlanInstance
.
setCreateDate
(
new
Date
());
contingencyPlanInstance
.
setTaskSort
(
taskNum
);
contingencyPlanInstance
.
setStepCode
(
stepCode
);
contingencyPlanInstance
.
setContent
(
buttonJson
);
contingencyPlanInstanceRepository
.
save
(
contingencyPlanInstance
);
if
(
"0"
.
equals
(
stepCode
))
{
TransactionSynchronizationManager
.
registerSynchronization
(
new
TransactionSynchronization
()
{
@Override
public
void
afterCommit
()
{
String
planStep
=
""
;
if
(
redisTemplate
.
hasKey
(
"planStep"
))
{
planStep
=
Objects
.
requireNonNull
(
redisTemplate
.
opsForValue
().
get
(
"planStep"
)).
toString
();
}
else
{
planStep
=
planStepService
.
getPlanStep
();
}
JSONArray
objects
=
JSON
.
parseArray
(
planStep
);
String
topic
=
String
.
format
(
"/%s/%s/%s"
,
serviceName
,
stationName
,
"plan"
);
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
result
.
put
(
"contingency"
,
new
ContingencyRo
());
result
.
put
(
"msgContext"
,
Collections
.
EMPTY_MAP
);
result
.
put
(
"msgType"
,
"getStepList"
);
result
.
put
(
"planStep"
,
objects
);
String
planTask
=
""
;
if
(
redisTemplate
.
hasKey
(
"planTask"
))
{
planTask
=
Objects
.
requireNonNull
(
redisTemplate
.
opsForValue
().
get
(
"planTask"
)).
toString
();
}
else
{
List
<
ContingencyPlanInstanceVO
>
lists
=
planVisual3dService
.
getTaskActionList
(
batchNo
,
1
);
planTask
=
JSON
.
toJSONString
(
lists
);
}
JSONArray
taskObjects
=
JSON
.
parseArray
(
planTask
);
result
.
put
(
"planTask"
,
taskObjects
);
webMqttComponent
.
publish
(
topic
,
JSON
.
toJSONString
(
result
));
}
});
}
MessageVO
messageVO
=
new
MessageVO
();
messageVO
.
setTitle
(
"应急处置事项提醒"
);
messageVO
.
setBody
(
"【"
+
taskName
+
"】"
+
DateFormatUtils
.
format
(
new
Date
(),
"yyyy-MM-dd HH:mm:ss"
));
messageVO
.
setMsgType
(
"emergencyPlan"
);
messageVO
.
setCategory
(
1
);
messageVO
.
setIsSendApp
(
true
);
messageVO
.
setIsSendWeb
(
true
);
messageVO
.
setRelationId
(
batchNo
);
planVisual3dService
.
sendMessage
(
roleCode
,
messageVO
);
}
}
}
}
private
Boolean
findByBatchNoAndStatus
(
String
batchNo
)
{
return
CollectionUtils
.
isEmpty
(
planOperationRecordDao
.
findByBatchNoAndStatus
(
batchNo
,
0
));
}
@Override
public
List
<
EmergencyTaskContentVo
>
getMustTaskList
(
String
stepCode
)
{
return
emergencyTaskMapper
.
getMustTaskList
(
stepCode
);
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/EquipmentFireEquipmentServiceImpl.java
View file @
1e3b8f04
...
@@ -2,6 +2,7 @@ package com.yeejoin.amos.fas.business.service.impl;
...
@@ -2,6 +2,7 @@ package com.yeejoin.amos.fas.business.service.impl;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.yeejoin.amos.fas.business.dao.mapper.EquipmentSpecificIndexMapper
;
import
com.yeejoin.amos.fas.business.dao.mapper.EquipmentSpecificIndexMapper
;
import
com.yeejoin.amos.fas.business.dao.mapper.EquipmentSpecificMapper
;
import
com.yeejoin.amos.fas.business.dao.mapper.EquipmentSpecificMapper
;
import
com.yeejoin.amos.fas.business.dao.mapper.PlanMessageMapper
;
import
com.yeejoin.amos.fas.business.dao.mapper.PlanMessageMapper
;
...
@@ -190,20 +191,20 @@ public class EquipmentFireEquipmentServiceImpl implements IEquipmentFireEquipmen
...
@@ -190,20 +191,20 @@ public class EquipmentFireEquipmentServiceImpl implements IEquipmentFireEquipmen
String
fireEquipId
=
String
.
valueOf
(
map
.
get
(
"fireEquipId"
));
String
fireEquipId
=
String
.
valueOf
(
map
.
get
(
"fireEquipId"
));
List
<
Long
>
fireEquipments
=
new
ArrayList
<>();
List
<
Long
>
fireEquipments
=
new
ArrayList
<>();
// 若是停运本极对端换流器,则需查出本极对应的电力设备列表,暂用电力设备名称过滤出本极电力设备,注意此处的电力设备按照标准有两极(极I,极II)
// 若是停运本极对端换流器,则需查出本极对应的电力设备列表,暂用电力设备名称过滤出本极电力设备,注意此处的电力设备按照标准有两极(极I,极II)
if
(
stepIndex
==
index
)
{
//
if (stepIndex == index) {
Optional
<
Equipment
>
equipment
=
iEquipmentDao
.
findById
(
Long
.
valueOf
(
fireEquipId
));
//
Optional<Equipment> equipment = iEquipmentDao.findById(Long.valueOf(fireEquipId));
if
(
equipment
.
get
()
!=
null
)
{
//
if (equipment.get() != null) {
String
fireEquipNamePrefix
=
equipment
.
get
().
getName
().
substring
(
0
,
2
);
//
String fireEquipNamePrefix = equipment.get().getName().substring(0, 2);
List
<
String
>
fireEquipIdList
=
equipmentSpecificMapper
.
getFireEquipIdsByNamePrefix
(
fireEquipNamePrefix
);
//
List<String> fireEquipIdList = equipmentSpecificMapper.getFireEquipIdsByNamePrefix(fireEquipNamePrefix);
String
[]
strings
=
fireEquipIdList
.
toArray
(
new
String
[
fireEquipIdList
.
size
()]);
//
String[] strings = fireEquipIdList.toArray(new String[fireEquipIdList.size()]);
// 获取消防设备id列表
//
// 获取消防设备id列表
fireEquipments
=
equipmentFireEquipmentService
.
findFireEquipmentIdsByEquipmentId
(
strings
);
//
fireEquipments = equipmentFireEquipmentService.findFireEquipmentIdsByEquipmentId(strings);
}
//
}
}
else
{
//
} else {
String
[]
fireEquipIds
=
new
String
[]{
fireEquipId
};
String
[]
fireEquipIds
=
new
String
[]{
fireEquipId
};
// 获取消防设备id列表
// 获取消防设备id列表
fireEquipments
=
equipmentFireEquipmentService
.
findFireEquipmentIdsByEquipmentId
(
fireEquipIds
);
fireEquipments
=
equipmentFireEquipmentService
.
findFireEquipmentIdsByEquipmentId
(
fireEquipIds
);
}
//
}
PlanStepJsonVO
vo
=
result
.
stream
().
filter
(
x
->
x
.
getIndex
()
==
index
).
collect
(
Collectors
.
toList
()).
get
(
0
);
PlanStepJsonVO
vo
=
result
.
stream
().
filter
(
x
->
x
.
getIndex
()
==
index
).
collect
(
Collectors
.
toList
()).
get
(
0
);
List
<
ConditionVO
>
list
=
vo
.
getCondition
();
List
<
ConditionVO
>
list
=
vo
.
getCondition
();
...
@@ -223,13 +224,19 @@ public class EquipmentFireEquipmentServiceImpl implements IEquipmentFireEquipmen
...
@@ -223,13 +224,19 @@ public class EquipmentFireEquipmentServiceImpl implements IEquipmentFireEquipmen
planMessage
.
setStepIndex
(
vo
.
getIndex
());
planMessage
.
setStepIndex
(
vo
.
getIndex
());
return
planMessage
;
return
planMessage
;
}).
collect
(
Collectors
.
toList
());
}).
collect
(
Collectors
.
toList
());
planMessageDao
.
saveAll
(
messages
);
for
(
PlanMessage
message
:
messages
)
{
}
int
count
=
planMessageMapper
.
getPlanMessageCount
(
String
.
valueOf
(
map
.
get
(
"batchNo"
)),
index
,
message
.
getIndexCreateTime
());
if
(
pumpStepIndex
==
index
)
{
if
(
0
<
count
)
{
return
0
<
resultSize
;
continue
;
}
else
{
}
return
(
0
<
resultSize
&&
num
==
resultSize
);
planMessageDao
.
save
(
message
);
}
}
}
// if (pumpStepIndex == index) {
// return 0 < resultSize;
// } else {
return
(
0
<
resultSize
&&
num
==
resultSize
);
// }
}
else
{
}
else
{
return
false
;
return
false
;
}
}
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/PlanStepServiceImpl.java
View file @
1e3b8f04
...
@@ -77,4 +77,10 @@ public class PlanStepServiceImpl implements IPlanStepService {
...
@@ -77,4 +77,10 @@ public class PlanStepServiceImpl implements IPlanStepService {
redisTemplate
.
opsForValue
().
set
(
"planStep"
,
getPlanStep
());
redisTemplate
.
opsForValue
().
set
(
"planStep"
,
getPlanStep
());
redisTemplate
.
delete
(
"isMock"
);
redisTemplate
.
delete
(
"isMock"
);
}
}
@Override
public
void
initPlanTask
()
{
redisTemplate
.
delete
(
"planTask"
);
// redisTemplate.opsForValue().set("planTask", "");
}
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/PlanVisual3dServiceImpl.java
View file @
1e3b8f04
...
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
...
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.sun.media.jfxmedia.logging.Logger
;
import
com.yeejoin.amos.component.feign.config.InnerInvokException
;
import
com.yeejoin.amos.component.feign.config.InnerInvokException
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.fas.business.action.model.ContingencyRo
;
import
com.yeejoin.amos.fas.business.action.model.ContingencyRo
;
...
@@ -11,19 +12,23 @@ import com.yeejoin.amos.fas.business.action.mq.WebMqttComponent;
...
@@ -11,19 +12,23 @@ import com.yeejoin.amos.fas.business.action.mq.WebMqttComponent;
import
com.yeejoin.amos.fas.business.constants.FasConstant
;
import
com.yeejoin.amos.fas.business.constants.FasConstant
;
import
com.yeejoin.amos.fas.business.dao.mapper.*
;
import
com.yeejoin.amos.fas.business.dao.mapper.*
;
import
com.yeejoin.amos.fas.business.dao.repository.*
;
import
com.yeejoin.amos.fas.business.dao.repository.*
;
import
com.yeejoin.amos.fas.business.feign.JcsFeign
;
import
com.yeejoin.amos.fas.business.feign.PrivilegeFeign
;
import
com.yeejoin.amos.fas.business.feign.PrivilegeFeign
;
import
com.yeejoin.amos.fas.business.feign.RemoteSecurityService
;
import
com.yeejoin.amos.fas.business.feign.RemoteSecurityService
;
import
com.yeejoin.amos.fas.business.service.intfc.IDictService
;
import
com.yeejoin.amos.fas.business.service.intfc.IDictService
;
import
com.yeejoin.amos.fas.business.service.intfc.IEmergencyTaskService
;
import
com.yeejoin.amos.fas.business.service.intfc.IPlanStepService
;
import
com.yeejoin.amos.fas.business.service.intfc.IPlanStepService
;
import
com.yeejoin.amos.fas.business.service.intfc.IPlanVisual3dService
;
import
com.yeejoin.amos.fas.business.service.intfc.IPlanVisual3dService
;
import
com.yeejoin.amos.fas.business.service.model.ToipResponse
;
import
com.yeejoin.amos.fas.business.service.model.ToipResponse
;
import
com.yeejoin.amos.fas.business.util.DateUtils
;
import
com.yeejoin.amos.fas.business.util.JSONUtil
;
import
com.yeejoin.amos.fas.business.util.JSONUtil
;
import
com.yeejoin.amos.fas.business.util.StringUtil
;
import
com.yeejoin.amos.fas.business.util.StringUtil
;
import
com.yeejoin.amos.fas.business.vo.*
;
import
com.yeejoin.amos.fas.business.vo.*
;
import
com.yeejoin.amos.fas.common.enums.PlanReplyMessageEnum
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.core.util.CommonResponseUtil
;
import
com.yeejoin.amos.fas.core.util.CommonResponseUtil
;
import
com.yeejoin.amos.fas.core.util.ResponseModel
;
import
com.yeejoin.amos.fas.dao.entity.*
;
import
com.yeejoin.amos.fas.dao.entity.*
;
import
com.yeejoin.amos.fas.exception.YeeException
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.RoleModel
;
import
com.yeejoin.amos.feign.privilege.model.RoleModel
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
...
@@ -40,6 +45,7 @@ import org.springframework.util.CollectionUtils;
...
@@ -40,6 +45,7 @@ import org.springframework.util.CollectionUtils;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -118,6 +124,12 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService {
...
@@ -118,6 +124,12 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService {
@Value
(
"${aurora.push.switch}"
)
@Value
(
"${aurora.push.switch}"
)
private
Boolean
auroraPushSwitch
;
private
Boolean
auroraPushSwitch
;
@Autowired
JcsFeign
jcsFeign
;
@Autowired
private
IEmergencyTaskService
emergencyTaskService
;
@Override
@Override
public
void
uploadTextPlan
(
String
appId
,
Map
<
String
,
String
>
pathNameMap
)
{
public
void
uploadTextPlan
(
String
appId
,
Map
<
String
,
String
>
pathNameMap
)
{
if
(
null
!=
pathNameMap
&&
!
pathNameMap
.
isEmpty
())
{
if
(
null
!=
pathNameMap
&&
!
pathNameMap
.
isEmpty
())
{
...
@@ -448,48 +460,68 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService {
...
@@ -448,48 +460,68 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService {
@Override
@Override
public
ContingencyPlanInstance
replyMessage
(
AgencyUserModel
user
,
ContingencyPlanInstance
dto
)
{
public
ContingencyPlanInstance
replyMessage
(
AgencyUserModel
user
,
ContingencyPlanInstance
dto
)
{
String
json
=
planStepService
.
getPlanStep
();
// String json = planStepService.getPlanStep();
List
<
PlanStepJsonVO
>
result
=
JSONObject
.
parseArray
(
json
,
PlanStepJsonVO
.
class
);
// List<PlanStepJsonVO> result = JSONObject.parseArray(json, PlanStepJsonVO.class);
List
<
String
>
roleCode
=
result
.
stream
().
map
(
PlanStepJsonVO:
:
getRoleCode
).
distinct
().
collect
(
Collectors
.
toList
());
// List<String> roleCode = result.stream().map(PlanStepJsonVO::getRoleCode).distinct().collect(Collectors.toList());
List
<
RoleModel
>
roleModelList
=
new
ArrayList
<>();
String
roleCodes
=
emergencyTaskService
.
getRolesByUserId
(
user
.
getUserId
());
for
(
Long
key
:
user
.
getOrgRoles
().
keySet
())
{
String
roleNames
=
emergencyTaskService
.
getRolesNameByUserId
(
user
.
getUserId
());
roleModelList
.
addAll
(
user
.
getOrgRoles
().
get
(
key
));
List
<
String
>
roleModelList
=
Arrays
.
asList
(
roleCodes
.
split
(
","
));
}
List
<
String
>
roleNameList
=
Arrays
.
asList
(
roleNames
.
split
(
","
));
List
<
String
>
roleCodeList
=
new
ArrayList
<>();
List
<
String
>
roleNameList
=
new
ArrayList
<>();
// List<RoleModel> roleModelList = new ArrayList<>();
List
<
String
>
realRoleCode
=
roleModelList
.
stream
().
map
(
RoleModel:
:
getRoleName
).
distinct
().
collect
(
Collectors
.
toList
());
// for (Long key : user.getOrgRoles().keySet()) {
realRoleCode
.
forEach
(
item
->
{
// roleModelList.addAll(user.getOrgRoles().get(key));
if
(
roleCode
.
contains
(
item
))
{
// }
roleCodeList
.
add
(
item
);
// List<String> roleCodeList = new ArrayList<>();
}
// List<String> roleNameList = new ArrayList<>();
});
// List<String> realRoleCode = roleModelList.stream().map(RoleModel::getRoleName).distinct().collect(Collectors.toList());
roleModelList
.
forEach
(
item
->
{
// realRoleCode.forEach(item -> {
if
(!
roleNameList
.
contains
(
item
.
getRoleDesc
())
&&
roleCode
.
contains
(
item
.
getRoleName
()))
{
// if (roleCode.contains(item)) {
roleNameList
.
add
(
item
.
getRoleDesc
());
// roleCodeList.add(item);
}
// }
});
// });
dto
.
setRoleCode
(
String
.
join
(
"-"
,
roleCodeList
));
// roleModelList.forEach(item -> {
// if (!roleNameList.contains(item.getRoleDesc()) && roleCode.contains(item.getRoleName())) {
// roleNameList.add(item.getRoleDesc());
// }
// });
dto
.
setRoleCode
(
String
.
join
(
"-"
,
roleModelList
));
dto
.
setRoleName
(
String
.
join
(
"-"
,
roleNameList
));
dto
.
setRoleName
(
String
.
join
(
"-"
,
roleNameList
));
dto
.
setStartUserId
(
user
.
getUserId
());
dto
.
setStartUserId
(
user
.
getUserId
());
dto
.
setStartUserName
(
user
.
getRealName
());
dto
.
setStartUserName
(
user
.
getRealName
());
dto
.
setRecordType
(
"REPLYMESSAGE"
);
dto
.
setRecordType
(
"REPLYMESSAGE"
);
dto
.
setCreateDate
(
new
Date
());
dto
.
setCreateDate
(
new
Date
());
Map
<
String
,
String
>
userInfo
=
contingencyPlanInstanceMapper
.
getUserByUserId
(
user
.
getUserId
());
ResponseModel
responseModel
=
null
;
if
(!
ObjectUtils
.
isEmpty
(
userInfo
))
{
try
{
String
img
=
userInfo
.
get
(
"personImg"
);
responseModel
=
jcsFeign
.
getPersonImage
(
user
.
getUserId
());
dto
.
setPersonImg
(
StringUtils
.
isBlank
(
img
)
?
personImg
:
img
);
}
catch
(
Exception
e
)
{
}
else
{
e
.
printStackTrace
();
dto
.
setPersonImg
(
personImg
);
}
String
img
=
""
;
if
(
responseModel
!=
null
&&
"SUCCESS"
.
equals
(
responseModel
.
getDevMessage
()))
{
String
resStr
=
JSON
.
toJSONString
(
responseModel
.
getResult
()).
replace
(
"\""
,
""
);
img
=
"null"
.
equalsIgnoreCase
(
resStr
)
?
null
:
img
;
}
}
img
=
StringUtils
.
isEmpty
(
img
)
?
personImg
:
img
;
// Map<String, String> userInfo = contingencyPlanInstanceMapper.getUserByUserId(user.getUserId());
// if (!ObjectUtils.isEmpty(userInfo)) {
// String img = userInfo.get("personImg");
// dto.setPersonImg(StringUtils.isBlank(img) ? personImg : img);
// } else {
// dto.setPersonImg(personImg);
// }
dto
.
setPersonImg
(
img
);
dto
.
setContent
(
StringUtil
.
isNotEmpty
(
dto
.
getContent
())
?
dto
.
getContent
()
:
""
);
dto
.
setContent
(
StringUtil
.
isNotEmpty
(
dto
.
getContent
())
?
dto
.
getContent
()
:
""
);
repository
.
save
(
dto
);
ContingencyPlanInstance
instance
=
repository
.
save
(
dto
);
String
topic
=
String
.
format
(
"/%s/%s/%s"
,
serviceName
,
stationName
,
"plan"
);
if
(!
ObjectUtils
.
isEmpty
(
instance
))
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
String
topic
=
String
.
format
(
"/%s/%s/%s"
,
serviceName
,
stationName
,
"plan"
);
map
.
put
(
"contingency"
,
new
ContingencyRo
());
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"msgContext"
,
Collections
.
EMPTY_MAP
);
map
.
put
(
"contingency"
,
new
ContingencyRo
());
map
.
put
(
"msgType"
,
"replayMessage"
);
map
.
put
(
"msgContext"
,
Collections
.
EMPTY_MAP
);
webMqttComponent
.
publish
(
topic
,
JSON
.
toJSONString
(
map
));
map
.
put
(
"msgType"
,
"replayMessage"
);
webMqttComponent
.
publish
(
topic
,
JSON
.
toJSONString
(
map
));
}
return
dto
;
return
dto
;
}
}
...
@@ -534,6 +566,68 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService {
...
@@ -534,6 +566,68 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService {
}
}
@Override
@Override
public
Page
<
ContingencyPlanInstanceVO
>
selectTaskActionPage
(
int
current
,
int
size
,
String
disposalId
,
List
<
String
>
roleModelList
,
int
dataType
)
{
String
type
=
"TASKOPERATE"
;
String
status
=
""
;
Page
<
ContingencyPlanInstanceVO
>
page
=
new
Page
<>(
current
,
size
);
// for (RoleModel roleModel : roleModelList) {
// roles.add(roleModel.getRoleName());
// }
if
(
null
!=
roleModelList
&&
roleModelList
.
size
()
==
0
)
{
return
new
Page
<>();
}
if
(
"1"
.
equals
(
String
.
valueOf
(
dataType
)))
{
// 根据当前用户预案角色、未执行动作 (dataType = 2 查询所有)
status
=
"1"
;
}
int
total
=
0
;
if
(
ObjectUtils
.
isEmpty
(
status
))
{
total
=
contingencyInstanceInfoMapper
.
selectCountTaskActionPage
(
type
,
null
,
roleModelList
,
disposalId
);
}
else
{
total
=
contingencyInstanceInfoMapper
.
selectCountTaskActionPage
(
type
,
status
,
roleModelList
,
disposalId
);
}
long
start
=
(
page
.
getCurrent
()
-
1
)
*
page
.
getSize
();
if
(
total
==
0
)
{
page
.
setCurrent
(
1
);
}
else
{
if
(
total
<
start
)
{
page
.
setCurrent
(
1
);
start
=
0
;
}
List
<
ContingencyPlanInstanceVO
>
list
=
contingencyInstanceInfoMapper
.
selectTaskActionPage
((
int
)
start
,
size
,
type
,
status
,
roleModelList
,
disposalId
);
page
.
setRecords
(
list
);
page
.
setTotal
(
total
);
}
return
page
;
}
@Override
public
List
<
ContingencyPlanInstanceVO
>
getTaskActionList
(
String
batchNo
,
int
dataType
)
{
String
type
=
"TASKOPERATE"
;
String
status
=
""
;
if
(
"1"
.
equals
(
String
.
valueOf
(
dataType
)))
{
// 根据当前用户预案角色、未执行动作 (dataType = 2 查询所有)
status
=
"1"
;
}
return
contingencyInstanceInfoMapper
.
getTaskActionList
(
type
,
status
,
batchNo
);
}
@Override
public
List
<
ContingencyPlanInstanceVO
>
selectTaskActionList
(
String
batchNo
,
List
<
String
>
roleModelList
,
int
dataType
)
{
String
type
=
"TASKOPERATE"
;
String
status
=
""
;
if
(
"1"
.
equals
(
String
.
valueOf
(
dataType
)))
{
// 根据当前用户预案角色、未执行动作 (dataType = 2 查询所有)
status
=
"1"
;
}
if
(
null
!=
roleModelList
&&
roleModelList
.
size
()
==
0
)
{
return
new
ArrayList
<>();
}
return
contingencyInstanceInfoMapper
.
selectTaskActionList
(
type
,
status
,
roleModelList
,
batchNo
);
}
@Override
public
List
<
ContingencyPlanInstanceVO
>
selectDisposalActionList
(
String
batchNo
,
List
<
RoleModel
>
roleModelList
,
int
dataType
)
{
public
List
<
ContingencyPlanInstanceVO
>
selectDisposalActionList
(
String
batchNo
,
List
<
RoleModel
>
roleModelList
,
int
dataType
)
{
List
<
String
>
roles
=
new
ArrayList
<>();
List
<
String
>
roles
=
new
ArrayList
<>();
String
type
=
"OPERATE"
;
String
type
=
"OPERATE"
;
...
@@ -554,10 +648,10 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService {
...
@@ -554,10 +648,10 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService {
}
}
@Override
@Override
public
void
sendMessage
(
String
button
Code
,
MessageVO
messageVO
)
{
public
void
sendMessage
(
String
role
Code
,
MessageVO
messageVO
)
{
// 添加极光推送开关
// 添加极光推送开关
if
(
auroraPushSwitch
)
{
if
(
auroraPushSwitch
)
{
List
<
String
>
userIds
=
getUserIds
(
button
Code
);
List
<
String
>
userIds
=
getUserIds
(
role
Code
);
if
(!
CollectionUtils
.
isEmpty
(
userIds
))
{
if
(!
CollectionUtils
.
isEmpty
(
userIds
))
{
messageVO
.
setRecivers
(
userIds
);
messageVO
.
setRecivers
(
userIds
);
sendMessage
(
messageVO
);
sendMessage
(
messageVO
);
...
@@ -610,6 +704,48 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService {
...
@@ -610,6 +704,48 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService {
}
}
@Override
@Override
public
boolean
updateTaskStatusById
(
String
id
,
Boolean
runStatus
,
String
userName
,
String
userId
,
String
roleNames
)
{
long
start
=
System
.
currentTimeMillis
();
boolean
bool
=
false
;
ResponseModel
responseModel
=
null
;
try
{
responseModel
=
jcsFeign
.
getPersonImage
(
userId
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
long
end
=
System
.
currentTimeMillis
();
System
.
out
.
println
(
"调用jcs查询用户图像用时:"
+
(
end
-
start
)
+
"ms"
);
String
img
=
""
;
if
(
responseModel
!=
null
&&
"SUCCESS"
.
equals
(
responseModel
.
getDevMessage
()))
{
String
resStr
=
JSON
.
toJSONString
(
responseModel
.
getResult
()).
replace
(
"\""
,
""
);
img
=
"null"
.
equalsIgnoreCase
(
resStr
)
?
null
:
img
;
}
img
=
StringUtils
.
isEmpty
(
img
)
?
personImg
:
img
;
if
(
runStatus
)
{
ContingencyPlanInstance
instance
=
contingencyPlanInstanceMapper
.
getMessageById
(
id
);
ContingencyPlanInstance
contingencyPlanInstance
=
deleteButton
(
instance
);
bool
=
contingencyPlanInstanceMapper
.
updateTaskStatusById
(
id
,
contingencyPlanInstance
.
getContent
(),
runStatus
,
userName
,
userId
,
img
,
PlanReplyMessageEnum
.
TEXT
.
getCode
(),
roleNames
);
}
else
{
bool
=
contingencyPlanInstanceMapper
.
updateTaskStatusById
(
id
,
null
,
runStatus
,
userName
,
userId
,
img
,
PlanReplyMessageEnum
.
TEXT
.
getCode
(),
roleNames
);
}
if
(
bool
)
{
if
(
redisTemplate
.
hasKey
(
"planTask"
))
{
redisTemplate
.
delete
(
"planTask"
);
String
planTask
=
""
;
ContingencyPlanInstance
instance
=
contingencyPlanInstanceMapper
.
getMessageById
(
id
);
List
<
ContingencyPlanInstanceVO
>
list
=
this
.
getTaskActionList
(
instance
.
getBatchNo
(),
1
);
if
(
0
<
list
.
size
())
{
planTask
=
JSON
.
toJSONString
(
list
);
}
JSONArray
taskObjects
=
JSON
.
parseArray
(
planTask
);
redisTemplate
.
opsForValue
().
set
(
"planTask"
,
taskObjects
);
}
}
return
bool
;
}
@Override
public
ContingencyPlanInstance
updateStatusByIdWeb
(
ContingencyPlanInstance
contingencyPlanInstance
,
Boolean
runStatus
)
{
public
ContingencyPlanInstance
updateStatusByIdWeb
(
ContingencyPlanInstance
contingencyPlanInstance
,
Boolean
runStatus
)
{
if
(
runStatus
)
{
if
(
runStatus
)
{
deleteButton
(
contingencyPlanInstance
);
deleteButton
(
contingencyPlanInstance
);
...
@@ -635,50 +771,14 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService {
...
@@ -635,50 +771,14 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService {
return
contingencyPlanInstance
;
return
contingencyPlanInstance
;
}
}
private
List
<
String
>
getUserIds
(
String
buttonCode
)
{
private
List
<
String
>
getUserIds
(
String
roleCode
)
{
String
planStepJson
=
planStepService
.
getPlanStep
();
List
<
PlanStepJsonVO
>
planStepJsonList
=
JSONObject
.
parseArray
(
planStepJson
,
PlanStepJsonVO
.
class
);
List
<
String
>
collect
=
planStepJsonList
.
stream
().
filter
(
code
->
code
.
getButtonCode
().
equals
(
buttonCode
)).
map
(
PlanStepJsonVO:
:
getRoleCode
).
collect
(
Collectors
.
toList
());
Toke
toke
=
remoteSecurityService
.
getServerToken
();
RequestContext
.
setToken
(
toke
.
getToke
());
RequestContext
.
setProduct
(
toke
.
product
);
RequestContext
.
setAppKey
(
toke
.
appKey
);
ArrayList
<
String
>
userIds
=
new
ArrayList
<>();
ArrayList
<
String
>
roleIds
=
new
ArrayList
<>();
// 查询按钮下角色id
for
(
String
roleName
:
collect
)
{
FeignClientResult
roleList
;
List
<
Map
>
roleModelList
=
null
;
try
{
roleList
=
privilegeFeign
.
getRoleList
(
RequestContext
.
getAppKey
(),
RequestContext
.
getProduct
(),
RequestContext
.
getToken
(),
roleName
);
roleModelList
=
(
List
<
Map
>)
roleList
.
getResult
();
}
catch
(
InnerInvokException
e
)
{
e
.
printStackTrace
();
}
if
(!
CollectionUtils
.
isEmpty
(
roleModelList
))
{
for
(
Map
map
:
roleModelList
)
{
return
planOperationRecordMapper
.
getArraysUserIds
(
roleCode
);
roleIds
.
add
(
String
.
valueOf
(
map
.
get
(
"sequenceNbr"
)));
}
}
}
}
// 查询角色下用户
public
List
<
String
>
getUserName
(
String
roleCode
)
{
FeignClientResult
userResult
;
List
<
Map
>
userList
=
null
;
return
planOperationRecordMapper
.
getArraysUserName
(
roleCode
);
try
{
userResult
=
privilegeFeign
.
getUserByRoleIds
(
RequestContext
.
getAppKey
(),
RequestContext
.
getProduct
(),
RequestContext
.
getToken
(),
String
.
join
(
","
,
roleIds
));
userList
=
(
List
<
Map
>)
userResult
.
getResult
();
}
catch
(
InnerInvokException
e
)
{
e
.
printStackTrace
();
}
if
(!
CollectionUtils
.
isEmpty
(
userList
))
{
for
(
Map
map
:
userList
)
{
userIds
.
add
(
String
.
valueOf
(
map
.
get
(
"userId"
)));
}
}
return
userIds
;
}
}
@Override
@Override
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/IContingencyInstance.java
View file @
1e3b8f04
...
@@ -25,6 +25,8 @@ public interface IContingencyInstance {
...
@@ -25,6 +25,8 @@ public interface IContingencyInstance {
Optional
<
Equipment
>
fire
(
String
batchNo
,
String
stepCode
,
String
buttonJson
,
String
contingencyPlanId
,
String
buttonCode
,
String
buttonState
,
String
stepStateOnbutton
,
String
isExecute
,
String
isAuto
,
String
token
,
String
product
,
String
appKey
,
String
startUserName
)
throws
Exception
;
Optional
<
Equipment
>
fire
(
String
batchNo
,
String
stepCode
,
String
buttonJson
,
String
contingencyPlanId
,
String
buttonCode
,
String
buttonState
,
String
stepStateOnbutton
,
String
isExecute
,
String
isAuto
,
String
token
,
String
product
,
String
appKey
,
String
startUserName
)
throws
Exception
;
Optional
<
Equipment
>
clickButton
(
String
batchNo
,
String
stepCode
,
String
buttonJson
,
String
contingencyPlanId
,
String
buttonCode
,
String
buttonState
,
String
stepStateOnbutton
,
String
isExecute
,
String
isAuto
,
String
token
,
String
product
,
String
appKey
,
String
startUserName
)
throws
Exception
;
/**
/**
* 扩展属性赋值
* 扩展属性赋值
* @param contingencyPlanInstance
* @param contingencyPlanInstance
...
@@ -39,4 +41,5 @@ public interface IContingencyInstance {
...
@@ -39,4 +41,5 @@ public interface IContingencyInstance {
*/
*/
ContingencyPlanInstance
getMessageById
(
String
id
);
ContingencyPlanInstance
getMessageById
(
String
id
);
String
getInstanceIdByBatchNOAndCategory
(
String
type
,
String
name
,
String
batchNo
);
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/IContingencyPlanService.java
View file @
1e3b8f04
package
com
.
yeejoin
.
amos
.
fas
.
business
.
service
.
intfc
;
package
com
.
yeejoin
.
amos
.
fas
.
business
.
service
.
intfc
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.fas.business.vo.ContingencyPlanParamVo
;
import
com.yeejoin.amos.fas.business.vo.*
;
import
com.yeejoin.amos.fas.business.vo.ContingencyPlanResponseVo
;
import
com.yeejoin.amos.fas.business.vo.PlanDetailVo
;
import
com.yeejoin.amos.fas.business.vo.Toke
;
import
com.yeejoin.amos.fas.dao.entity.PlanDetail
;
import
com.yeejoin.amos.fas.dao.entity.PlanDetail
;
import
com.yeejoin.amos.fas.dao.entity.PlanOperationRecord
;
import
com.yeejoin.amos.fas.dao.entity.PlanOperationRecord
;
import
com.yeejoin.amos.fas.exception.YeeException
;
import
com.yeejoin.amos.fas.exception.YeeException
;
...
@@ -141,5 +138,9 @@ public interface IContingencyPlanService {
...
@@ -141,5 +138,9 @@ public interface IContingencyPlanService {
Map
<
String
,
Object
>
getUserOperateCountAndPlanName
(
List
<
RoleModel
>
roleModelList
);
Map
<
String
,
Object
>
getUserOperateCountAndPlanName
(
List
<
RoleModel
>
roleModelList
);
Map
<
String
,
Object
>
getUserOperateCountAndTaskName
(
List
<
String
>
list
,
Map
<
String
,
Object
>
map
);
String
getPlanBatchNo
();
String
getPlanBatchNo
();
Page
<
ContingencyPlanInstanceVO
>
selectTaskActionPage
(
int
current
,
int
size
,
String
batchNo
,
String
runState
,
String
updateDate
,
List
<
String
>
roleList
);
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/IEmergencyTaskService.java
0 → 100644
View file @
1e3b8f04
package
com
.
yeejoin
.
amos
.
fas
.
business
.
service
.
intfc
;
import
com.yeejoin.amos.fas.business.vo.EmergencyTaskContentVo
;
import
com.yeejoin.amos.fas.core.common.request.CommonPageable
;
import
com.yeejoin.amos.fas.dao.entity.EmergencyRelation
;
import
com.yeejoin.amos.fas.dao.entity.EmergencyRelationTree
;
import
com.yeejoin.amos.fas.dao.entity.EmergencyTaskContent
;
import
org.springframework.data.domain.Page
;
import
java.util.List
;
public
interface
IEmergencyTaskService
{
Page
<
EmergencyTaskContent
>
list
(
Long
obligationId
,
CommonPageable
pageable
);
List
<
EmergencyRelationTree
>
treeList
();
void
deleteTreeNode
(
Long
obligationId
,
Long
personId
);
void
save
(
EmergencyRelation
emergencyRelation
);
String
getRolesByUserId
(
String
userId
);
List
<
Long
>
getPersonIds
(
Long
obligationId
);
String
getRolesNameByUserId
(
String
userId
);
void
saveTask
(
String
stepCode
,
String
batchNo
);
List
<
EmergencyTaskContentVo
>
getMustTaskList
(
String
stepCode
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/IPlanStepService.java
View file @
1e3b8f04
...
@@ -27,4 +27,6 @@ public interface IPlanStepService {
...
@@ -27,4 +27,6 @@ public interface IPlanStepService {
String
getPlanStep
();
String
getPlanStep
();
void
initPlanStep
();
void
initPlanStep
();
void
initPlanTask
();
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/IPlanVisual3dService.java
View file @
1e3b8f04
...
@@ -91,6 +91,8 @@ public interface IPlanVisual3dService {
...
@@ -91,6 +91,8 @@ public interface IPlanVisual3dService {
Page
<
ContingencyPlanInstanceVO
>
selectDisposalActionPage
(
int
current
,
int
size
,
String
batchNo
,
List
<
RoleModel
>
roleModelList
,
int
dataType
);
Page
<
ContingencyPlanInstanceVO
>
selectDisposalActionPage
(
int
current
,
int
size
,
String
batchNo
,
List
<
RoleModel
>
roleModelList
,
int
dataType
);
Page
<
ContingencyPlanInstanceVO
>
selectTaskActionPage
(
int
current
,
int
size
,
String
batchNo
,
List
<
String
>
roleModelList
,
int
dataType
);
/**
/**
* 根据批次号获取预案的消息等记录
* 根据批次号获取预案的消息等记录
*
*
...
@@ -103,13 +105,24 @@ public interface IPlanVisual3dService {
...
@@ -103,13 +105,24 @@ public interface IPlanVisual3dService {
List
<
ContingencyPlanInstanceVO
>
selectDisposalActionList
(
String
batchNo
,
List
<
RoleModel
>
roleModelList
,
int
dataType
);
List
<
ContingencyPlanInstanceVO
>
selectDisposalActionList
(
String
batchNo
,
List
<
RoleModel
>
roleModelList
,
int
dataType
);
List
<
ContingencyPlanInstanceVO
>
selectTaskActionList
(
String
batchNo
,
List
<
String
>
roleModelList
,
int
dataType
);
List
<
ContingencyPlanInstanceVO
>
getTaskActionList
(
String
batchNo
,
int
dataType
);
/**
/**
* 极光推送消息
* 极光推送消息
*
*
* @param
button
Code
* @param
role
Code
* @param messageVO
* @param messageVO
*/
*/
void
sendMessage
(
String
buttonCode
,
MessageVO
messageVO
);
void
sendMessage
(
String
roleCode
,
MessageVO
messageVO
);
/**
* 获取用户名称
*
* @param roleCode
*/
List
<
String
>
getUserName
(
String
roleCode
);
/**
/**
...
@@ -120,6 +133,8 @@ public interface IPlanVisual3dService {
...
@@ -120,6 +133,8 @@ public interface IPlanVisual3dService {
*/
*/
boolean
updateStatusById
(
String
id
,
Boolean
runStatus
);
boolean
updateStatusById
(
String
id
,
Boolean
runStatus
);
boolean
updateTaskStatusById
(
String
id
,
Boolean
runStatus
,
String
userName
,
String
userId
,
String
roleNames
);
/**
/**
* 修改动作执行状态-web
* 修改动作执行状态-web
* @param contingencyPlanInstance
* @param contingencyPlanInstance
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/vo/ContingencyPlanInstanceVO.java
View file @
1e3b8f04
...
@@ -12,7 +12,7 @@ public class ContingencyPlanInstanceVO {
...
@@ -12,7 +12,7 @@ public class ContingencyPlanInstanceVO {
protected
String
id
;
protected
String
id
;
private
String
recordType
;
// 记录类型:消息MESSAGE,操作OPERATE
,回复消息REPLYMESSAG
E
private
String
recordType
;
// 记录类型:消息MESSAGE,操作OPERATE
, 回复消息REPLYMESSAGE, 任务指令TASKOPERAT
E
private
String
content
;
// 记录内容:文本信息或者json数据
private
String
content
;
// 记录内容:文本信息或者json数据
...
@@ -58,6 +58,10 @@ public class ContingencyPlanInstanceVO {
...
@@ -58,6 +58,10 @@ public class ContingencyPlanInstanceVO {
private
String
updateUser
;
private
String
updateUser
;
private
String
createTime
;
private
String
updateTime
;
private
Boolean
isDelete
=
false
;
private
Boolean
isDelete
=
false
;
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/vo/EmergencyRelationVo.java
0 → 100644
View file @
1e3b8f04
package
com
.
yeejoin
.
amos
.
fas
.
business
.
vo
;
import
lombok.Data
;
import
java.util.List
;
@Data
public
class
EmergencyRelationVo
{
//职责id
private
Long
obligationId
;
//人员id
private
List
<
Long
>
personIds
;
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/vo/EmergencyTaskContentVo.java
0 → 100644
View file @
1e3b8f04
package
com
.
yeejoin
.
amos
.
fas
.
business
.
vo
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.util.Date
;
/**
* @author keyong
* @title: EmergencyTaskContentVo
* <pre>
* @description: TODO
* </pre>
* @date 2023/6/20 14:24
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public
class
EmergencyTaskContentVo
{
private
Long
id
;
private
String
content
;
private
String
code
;
private
Date
createDate
;
private
Integer
obligationId
;
private
String
obligationName
;
private
String
stepCode
;
private
String
roleCode
;
private
String
buttonJson
;
private
String
taskNum
;
private
boolean
isMust
=
false
;
}
YeeAmosFireAutoSysStart/pom.xml
View file @
1e3b8f04
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
<parent>
<parent>
<groupId>
com.yeejoin.amos
</groupId>
<groupId>
com.yeejoin.amos
</groupId>
<artifactId>
YeeAmosFireAutoSysRoot
</artifactId>
<artifactId>
YeeAmosFireAutoSysRoot
</artifactId>
<version>
3.7.0.
8
</version>
<version>
3.7.0.
9
</version>
</parent>
</parent>
<dependencies>
<dependencies>
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
<dependency>
<dependency>
<groupId>
com.yeejoin.amos
</groupId>
<groupId>
com.yeejoin.amos
</groupId>
<artifactId>
YeeAmosFireAutoSysService
</artifactId>
<artifactId>
YeeAmosFireAutoSysService
</artifactId>
<version>
3.7.0.
8
</version>
<version>
3.7.0.
9
</version>
</dependency>
</dependency>
</dependencies>
</dependencies>
...
...
YeeAmosFireAutoSysStart/src/main/resources/application.properties
View file @
1e3b8f04
...
@@ -95,4 +95,4 @@ outSystem.user.password=a1234560
...
@@ -95,4 +95,4 @@ outSystem.user.password=a1234560
privilege.fegin.name
=
AMOS-API-PRIVILEGE
privilege.fegin.name
=
AMOS-API-PRIVILEGE
#\u9884\u6848\u6307\u6807\u914D\u7F6E
#\u9884\u6848\u6307\u6807\u914D\u7F6E
plan.index
=
ONL_OilDischargeDeviceOilPillowDischargeOpen,CAFS_CAFSFireGunEquipmentValveStatus,DCCP_DCCPStreamTransformerCharged,WSS_DelugeValve_Start,ONL_OilDischargeDeviceOilyPillowDischargeOpen
plan.index
=
ONL_OilDischargeDeviceOilPillowDischargeOpen,CAFS_CAFSFireGunEquipmentValveStatus,DCCP_DCCPStreamTransformerCharged,WSS_DelugeValve_Start,ONL_OilDischargeDeviceOilyPillowDischargeOpen,Running_Alarm,ONL_DrainOilValve_Open,CAFS_CompAirFoamHost_Outfire,CAFS_GunValve_Open,FHS_FirePump_Start,normal_running_state,AIRCS_Fan_Start
\ No newline at end of file
\ No newline at end of file
YeeAmosFireAutoSysStart/src/main/resources/db/changelog/fas-2.0.1.xml
View file @
1e3b8f04
...
@@ -872,4 +872,86 @@
...
@@ -872,4 +872,86 @@
<changeSet
author=
"keyong"
id=
"1682647357"
>
<preConditions
onFail=
"MARK_RAN"
>
<not>
<columnExists
tableName=
"contingency_plan_instance"
columnName=
"task_sort"
/>
</not>
</preConditions>
<comment>
增加任务动作相关字段
</comment>
<sql>
ALTER TABLE `contingency_plan_instance`
ADD COLUMN `task_sort` int DEFAULT NULL AFTER `person_img`,
ADD COLUMN `step_code` varchar(20) NULL AFTER `task_sort`;
</sql>
</changeSet>
<changeSet
author=
"CZ"
id=
"202305101936"
>
<preConditions
onFail=
"MARK_RAN"
>
</preConditions>
<comment>
增加应急角色
</comment>
<sql>
REPLACE INTO `f_dict`(`id`, `dict_name`, `dict_code`, `parent_id`, `is_delete`, `dict_value`, `dict_order`, `remark`) VALUES (47, '管理人员G1', 'YJZC', 0, b'0', 'adminG1', 0, '预案角色');
REPLACE INTO `f_dict`(`id`, `dict_name`, `dict_code`, `parent_id`, `is_delete`, `dict_value`, `dict_order`, `remark`) VALUES (48, '值班长S1', 'YJZC', 0, b'0', 'dutyLeaderS1', 1, '预案角色');
REPLACE INTO `f_dict`(`id`, `dict_name`, `dict_code`, `parent_id`, `is_delete`, `dict_value`, `dict_order`, `remark`) VALUES (49, '副值班长S2', 'YJZC', 0, b'0', 'deputyDutyLeaderS2', 2, '预案角色');
REPLACE INTO `f_dict`(`id`, `dict_name`, `dict_code`, `parent_id`, `is_delete`, `dict_value`, `dict_order`, `remark`) VALUES (50, '值班员A1', 'YJZC', 0, b'0', 'dutyCivilianA1', 3, '预案角色');
REPLACE INTO `f_dict`(`id`, `dict_name`, `dict_code`, `parent_id`, `is_delete`, `dict_value`, `dict_order`, `remark`) VALUES (51, '值班员A2', 'YJZC', 0, b'0', 'dutyCivilianA2', 4, '预案角色');
REPLACE INTO `f_dict`(`id`, `dict_name`, `dict_code`, `parent_id`, `is_delete`, `dict_value`, `dict_order`, `remark`) VALUES (52, '值班员A3', 'YJZC', 0, b'0', 'dutyCivilianA3', 5, '预案角色');
REPLACE INTO `f_dict`(`id`, `dict_name`, `dict_code`, `parent_id`, `is_delete`, `dict_value`, `dict_order`, `remark`) VALUES (53, '白班B1', 'YJZC', 0, b'0', 'dayShiftB1', 6, '预案角色');
REPLACE INTO `f_dict`(`id`, `dict_name`, `dict_code`, `parent_id`, `is_delete`, `dict_value`, `dict_order`, `remark`) VALUES (54, '白班B2', 'YJZC', 0, b'0', 'nightShiftB2', 7, '预案角色');
</sql>
</changeSet>
<changeSet
author=
"chenzhao"
id=
"20230510-1"
>
<preConditions
onFail=
"MARK_RAN"
>
<not>
<tableExists
tableName=
"c_emergency_relation"
/>
</not>
</preConditions>
<comment>
create table c_emergency_relation
</comment>
<sql>
CREATE TABLE `c_emergency_relation` (
`id` int NOT NULL AUTO_INCREMENT COMMENT '主键',
`obligationId` bigint DEFAULT NULL COMMENT '职责id\r\n',
`person_id` bigint DEFAULT NULL COMMENT '人员id',
`amos_id` bigint DEFAULT NULL COMMENT '平台人员id',
`person_name` varchar(255) DEFAULT NULL COMMENT '人员名称',
`create_date` datetime DEFAULT NULL COMMENT '创建时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=85 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
</sql>
</changeSet>
<changeSet
author=
"chenzhao"
id=
"20230510-2"
>
<preConditions
onFail=
"MARK_RAN"
>
<not>
<tableExists
tableName=
"c_emergency_task_content"
/>
</not>
</preConditions>
<comment>
create table c_emergency_task_content
</comment>
<sql>
CREATE TABLE `c_emergency_task_content` (
`id` bigint NOT NULL AUTO_INCREMENT,
`content` varchar(1000) DEFAULT NULL COMMENT '分工内容\r\n',
`code` varchar(255) DEFAULT NULL COMMENT '编码',
`create_date` datetime DEFAULT NULL COMMENT '创建时间',
`obligation_id` bigint DEFAULT NULL COMMENT '职责id',
`obligation_name` varchar(255) DEFAULT NULL COMMENT '职责名称',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
</sql>
</changeSet>
<changeSet
author=
"keyong"
id=
"1682647357-1"
>
<preConditions
onFail=
"MARK_RAN"
>
<not>
<columnExists
tableName=
"contingency_plan_instance"
columnName=
"category"
/>
</not>
</preConditions>
<comment>
修改contingency_plan_instance表结构
</comment>
<sql>
ALTER TABLE `contingency_plan_instance` MODIFY COLUMN `category` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '一级分类' AFTER `record_type`;
</sql>
</changeSet>
</databaseChangeLog>
</databaseChangeLog>
\ No newline at end of file
YeeAmosFireAutoSysStart/src/main/resources/db/changelog/fas-sql-task.xml
View file @
1e3b8f04
...
@@ -5,10 +5,10 @@
...
@@ -5,10 +5,10 @@
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://www.liquibase.org/xml/ns/dbchangelog
xsi:schemaLocation=
"http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.4.xsd"
>
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.4.xsd"
>
<changeSet
author=
"suhg"
id=
"1561454393001-
1
"
runAlways=
"true"
>
<changeSet
author=
"suhg"
id=
"1561454393001-
2
"
runAlways=
"true"
>
<comment>
update f_fmea_equipment_point 更新触发器创建
</comment>
<comment>
update f_fmea_equipment_point 更新触发器创建
</comment>
<sql
endDelimiter=
"#"
>
<sql
endDelimiter=
"#"
>
DROP TRIGGER IF EXISTS `trigger_fmea_equipment_point_update`
;
DROP TRIGGER IF EXISTS `trigger_fmea_equipment_point_update`
#
CREATE TRIGGER trigger_fmea_equipment_point_update AFTER UPDATE on f_fmea_equipment_point FOR EACH ROW
CREATE TRIGGER trigger_fmea_equipment_point_update AFTER UPDATE on f_fmea_equipment_point FOR EACH ROW
BEGIN
BEGIN
DECLARE riskSourceId BIGINT (20);
DECLARE riskSourceId BIGINT (20);
...
@@ -56,10 +56,10 @@
...
@@ -56,10 +56,10 @@
<!-- END#-->
<!-- END#-->
<!-- </sql>-->
<!-- </sql>-->
<!-- </changeSet>-->
<!-- </changeSet>-->
<changeSet
author=
"shanqiyun"
id=
"1588901126339-
1
"
runAlways=
"true"
>
<changeSet
author=
"shanqiyun"
id=
"1588901126339-
2
"
runAlways=
"true"
>
<comment>
f_risk_source 查询所有子节点id
</comment>
<comment>
f_risk_source 查询所有子节点id
</comment>
<sql
endDelimiter=
"#"
>
<sql
endDelimiter=
"#"
>
DROP FUNCTION IF EXISTS queryRiskSourceChildrenIds
;
DROP FUNCTION IF EXISTS queryRiskSourceChildrenIds
#
CREATE FUNCTION queryRiskSourceChildrenIds(id INT)
CREATE FUNCTION queryRiskSourceChildrenIds(id INT)
RETURNS VARCHAR(4000)
RETURNS VARCHAR(4000)
BEGIN
BEGIN
...
@@ -78,10 +78,10 @@
...
@@ -78,10 +78,10 @@
</sql>
</sql>
</changeSet>
</changeSet>
<changeSet
author=
"maoying"
id=
"1589954524001-
1
"
runAlways=
"true"
>
<changeSet
author=
"maoying"
id=
"1589954524001-
2
"
runAlways=
"true"
>
<comment>
updatePointConfig 触发器创建
</comment>
<comment>
updatePointConfig 触发器创建
</comment>
<sql
endDelimiter=
"#"
>
<sql
endDelimiter=
"#"
>
DROP TRIGGER IF EXISTS `updatePointConfig`
;
DROP TRIGGER IF EXISTS `updatePointConfig`
#
CREATE TRIGGER `updatePointConfig` AFTER UPDATE ON `p_point` FOR EACH ROW
CREATE TRIGGER `updatePointConfig` AFTER UPDATE ON `p_point` FOR EACH ROW
BEGIN
BEGIN
IF (new.name != old.name)
IF (new.name != old.name)
...
@@ -92,10 +92,10 @@
...
@@ -92,10 +92,10 @@
END#
END#
</sql>
</sql>
</changeSet>
</changeSet>
<changeSet
author=
"shanqiyun"
id=
"1597831211781-
1
"
runAlways=
"true"
>
<changeSet
author=
"shanqiyun"
id=
"1597831211781-
2
"
runAlways=
"true"
>
<comment>
create view toip_biz_message
</comment>
<comment>
create view toip_biz_message
</comment>
<sql>
<sql
endDelimiter=
"#"
>
DROP VIEW IF EXISTS toip_biz_message
;
DROP VIEW IF EXISTS toip_biz_message
#
CREATE ALGORITHM = UNDEFINED DEFINER = `root` @`%` SQL SECURITY DEFINER VIEW `toip_biz_message` AS SELECT
CREATE ALGORITHM = UNDEFINED DEFINER = `root` @`%` SQL SECURITY DEFINER VIEW `toip_biz_message` AS SELECT
`m`.`id` AS `id`,
`m`.`id` AS `id`,
`m`.`id` AS `originId`,
`m`.`id` AS `originId`,
...
@@ -146,7 +146,7 @@
...
@@ -146,7 +146,7 @@
FROM
FROM
( `toip_sys_message` `m` JOIN `f_risk_source` `n` )
( `toip_sys_message` `m` JOIN `f_risk_source` `n` )
WHERE
WHERE
( ( `n`.`id` = `m`.`biz_id` ) AND ( `m`.`bizclass_name` = 'class com.yeejoin.amos.fas.business.service.model.RiskSourceRuleRo' ) )
;
( ( `n`.`id` = `m`.`biz_id` ) AND ( `m`.`bizclass_name` = 'class com.yeejoin.amos.fas.business.service.model.RiskSourceRuleRo' ) )
#
</sql>
</sql>
</changeSet>
</changeSet>
</databaseChangeLog>
</databaseChangeLog>
\ No newline at end of file
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/ContingencyInstanceInfoMapper.xml
View file @
1e3b8f04
...
@@ -64,6 +64,105 @@
...
@@ -64,6 +64,105 @@
order by cpi.`create_date` ASC
order by cpi.`create_date` ASC
LIMIT #{current}, #{size}
LIMIT #{current}, #{size}
</select>
</select>
<select
id=
"selectTaskActionPage"
resultType=
"com.yeejoin.amos.fas.business.vo.ContingencyPlanInstanceVO"
>
SELECT * FROM (
select cpi.id, cpi.`record_type`, cpi.`category`, cpi.`content`, cpi.`icon`, cpi.`sort`, cpi.`sequence_num`
, cpi.`batch_no`, cpi.`create_date`, cpi.`create_user`, cpi.`update_date`
, cpi.`update_user`, cpi.`is_delete`, cpi.`tips`, IFNULL(cpi.`runstate`, 0) AS runstate, cpi.`file_path`
, `file_type`, `role_name`, `role_code`, `start_user_name`
, cpi.`start_user_id`, cpi.`person_img`,cii.name
from contingency_plan_instance cpi left join contingency_instance_info cii
on cpi.batch_no = cii.id
<where>
cpi.step_code != "-1"
<if
test=
"batchNo != null and batchNo != ''"
>
AND cpi.batch_no = #{batchNo}
</if>
<if
test=
"type != null and type != ''"
>
and cpi.record_type = #{type}
</if>
<if
test=
"status != null and status != ''"
>
and (cpi.runstate is null or cpi.runstate = 0)
</if>
<if
test=
"list != null and list.size() >0"
>
<foreach
collection=
"list"
item=
"role"
index=
"index"
open=
"and ("
close=
") "
separator=
"or"
>
cpi.role_code like concat('%',#{role},'%')
</foreach>
</if>
</where>
UNION ALL
select cpi.id, cpi.`record_type`, cpi.`category`, cpi.`content`, cpi.`icon`, cpi.`sort`, cpi.`sequence_num`
, cpi.`batch_no`, cpi.`create_date`, cpi.`create_user`, cpi.`update_date`
, cpi.`update_user`, cpi.`is_delete`, cpi.`tips`, IFNULL(cpi.`runstate`, 0) AS runstate, cpi.`file_path`
, `file_type`, `role_name`, `role_code`, `start_user_name`
, cpi.`start_user_id`, cpi.`person_img`,cii.name
from contingency_plan_instance cpi left join contingency_instance_info cii
on cpi.batch_no = cii.id
<where>
cpi.step_code = "-1"
<if
test=
"batchNo != null and batchNo != ''"
>
AND cpi.batch_no = #{batchNo}
</if>
<if
test=
"type != null and type != ''"
>
and cpi.record_type = #{type}
</if>
<if
test=
"status != null and status != ''"
>
and (cpi.runstate is null or cpi.runstate = 0)
</if>
<if
test=
"list != null and list.size() >0"
>
<foreach
collection=
"list"
item=
"role"
index=
"index"
open=
"and ("
close=
") "
separator=
"or"
>
cpi.role_code like concat('%',#{role},'%')
</foreach>
</if>
</where>
) tmp
ORDER BY tmp.create_date ASC
LIMIT #{current}, #{size}
</select>
<select
id=
"selectCountTaskActionPage"
resultType=
"java.lang.Integer"
>
select sum(tmpcount) from
( select count(1) AS tmpcount from contingency_plan_instance
<where>
step_code != "-1"
<if
test=
"batchNo != null and batchNo != ''"
>
and batch_no = #{batchNo}
</if>
<if
test=
"type != null and type != ''"
>
and record_type = #{type}
</if>
<if
test=
"status != null and status != ''"
>
and (runstate is null or runstate = 0)
</if>
<if
test=
"list != null and list.size() >0"
>
<foreach
collection=
"list"
item=
"role"
index=
"index"
open=
"and ("
close=
") "
separator=
"or"
>
role_code like concat('%',#{role},'%')
</foreach>
</if>
</where>
UNION ALL
select count(1) AS tmpcount from contingency_plan_instance
<where>
step_code = "-1"
<if
test=
"batchNo != null and batchNo != ''"
>
and batch_no = #{batchNo}
</if>
<if
test=
"type != null and type != ''"
>
and record_type = #{type}
</if>
<if
test=
"status != null and status != ''"
>
and (runstate is null or runstate = 0)
</if>
<if
test=
"list != null and list.size() >0"
>
<foreach
collection=
"list"
item=
"role"
index=
"index"
open=
"and ("
close=
") "
separator=
"or"
>
role_code like concat('%',#{role},'%')
</foreach>
</if>
</where>
) a
</select>
<select
id=
"selectCountDisposalActionPage"
resultType=
"java.lang.Integer"
>
<select
id=
"selectCountDisposalActionPage"
resultType=
"java.lang.Integer"
>
select count(1) from contingency_plan_instance
select count(1) from contingency_plan_instance
<where>
<where>
...
@@ -77,14 +176,13 @@
...
@@ -77,14 +176,13 @@
and (runstate is null or runstate = 0)
and (runstate is null or runstate = 0)
</if>
</if>
<if
test=
"list != null and list.size() >0"
>
<if
test=
"list != null and list.size() >0"
>
<foreach
collection=
"list"
item=
"role"
index=
"index"
open=
"and ("
close=
") "
separator=
"or"
>
<foreach
collection=
"list"
item=
"role"
index=
"index"
open=
"and ("
close=
") "
separator=
"or"
>
role_code like concat('%',#{role},'%')
role_code like concat('%',#{role},'%')
</foreach>
</foreach>
</if>
</if>
</where>
</where>
</select>
</select>
<select
id=
"selectDisposalActionList"
resultType=
"com.yeejoin.amos.fas.business.vo.ContingencyPlanInstanceVO"
>
<select
id=
"selectDisposalActionList"
resultType=
"com.yeejoin.amos.fas.business.vo.ContingencyPlanInstanceVO"
>
select cpi.id, cpi.`record_type`, cpi.`category`, cpi.`content`, cpi.`icon`, cpi.`sort`, cpi.`sequence_num`
select cpi.id, cpi.`record_type`, cpi.`category`, cpi.`content`, cpi.`icon`, cpi.`sort`, cpi.`sequence_num`
, cpi.`batch_no`, cpi.`create_date`, cpi.`create_user`, cpi.`update_date`
, cpi.`batch_no`, cpi.`create_date`, cpi.`create_user`, cpi.`update_date`
...
@@ -112,5 +210,196 @@
...
@@ -112,5 +210,196 @@
</where>
</where>
order by cpi.`create_date`
order by cpi.`create_date`
</select>
</select>
<select
id=
"selectTaskActionList"
resultType=
"com.yeejoin.amos.fas.business.vo.ContingencyPlanInstanceVO"
>
SELECT * FROM (
select cpi.id, cpi.`record_type`, cpi.`category`, cpi.`content`, cpi.`icon`, cpi.`sort`, cpi.`sequence_num`
, cpi.`batch_no`, cpi.`create_date`, DATE_FORMAT(cpi.`create_date`,'%Y-%m-%d %H:%i:%s') AS createTime, cpi.`create_user`, cpi.`update_date`
, DATE_FORMAT(cpi.`update_date`,'%Y-%m-%d %H:%i:%s') AS updateTime, cpi.`update_user`, cpi.`is_delete`, cpi.`tips`, IFNULL(cpi.`runstate`, 0) AS runstate, cpi.`file_path`
, `file_type`, `role_name`, `role_code`, `start_user_name`
, cpi.`start_user_id`, cpi.`person_img`,cii.name
from contingency_plan_instance cpi left join contingency_instance_info cii
on cpi.batch_no = cii.id
<where>
cpi.step_code != "-1"
<if
test=
"batchNo != null and batchNo != ''"
>
AND cpi.batch_no = #{batchNo}
</if>
<if
test=
"type != null and type != ''"
>
and cpi.record_type = #{type}
</if>
<if
test=
"status != null and status != ''"
>
and (cpi.runstate is null or cpi.runstate = 0)
</if>
<if
test=
"list != null and list.size() >0"
>
<foreach
collection=
"list"
item=
"role"
index=
"index"
open=
"and ("
close=
") "
separator=
"or"
>
cpi.role_code like concat('%',#{role},'%')
</foreach>
</if>
</where>
UNION ALL
select cpi.id, cpi.`record_type`, cpi.`category`, cpi.`content`, cpi.`icon`, cpi.`sort`, cpi.`sequence_num`
, cpi.`batch_no`, cpi.`create_date`, DATE_FORMAT(cpi.`create_date`,'%Y-%m-%d %H:%i:%s') AS createTime, cpi.`create_user`, cpi.`update_date`
, DATE_FORMAT(cpi.`update_date`,'%Y-%m-%d %H:%i:%s') AS updateTime, cpi.`update_user`, cpi.`is_delete`, cpi.`tips`, IFNULL(cpi.`runstate`, 0) AS runstate, cpi.`file_path`
, `file_type`, `role_name`, `role_code`, `start_user_name`
, cpi.`start_user_id`, cpi.`person_img`,cii.name
from contingency_plan_instance cpi left join contingency_instance_info cii
on cpi.batch_no = cii.id
<where>
cpi.step_code = "-1"
<if
test=
"batchNo != null and batchNo != ''"
>
AND cpi.batch_no = #{batchNo}
</if>
<if
test=
"type != null and type != ''"
>
and cpi.record_type = #{type}
</if>
<if
test=
"status != null and status != ''"
>
and (cpi.runstate is null or cpi.runstate = 0)
</if>
<if
test=
"list != null and list.size() >0"
>
<foreach
collection=
"list"
item=
"role"
index=
"index"
open=
"and ("
close=
") "
separator=
"or"
>
cpi.role_code like concat('%',#{role},'%')
</foreach>
</if>
</where>
) tmp
ORDER BY tmp.create_date ASC
</select>
<select
id=
"getTaskActionList"
resultType=
"com.yeejoin.amos.fas.business.vo.ContingencyPlanInstanceVO"
>
SELECT * FROM (
select cpi.id, cpi.`record_type`, cpi.`category`, cpi.`content`, cpi.`icon`, cpi.`sort`, cpi.`sequence_num`
, cpi.`batch_no`, cpi.`create_date`, DATE_FORMAT(cpi.`create_date`,'%Y-%m-%d %H:%i:%s') AS createTime, cpi.`create_user`, cpi.`update_date`
, DATE_FORMAT(cpi.`update_date`,'%Y-%m-%d %H:%i:%s') AS updateTime, cpi.`update_user`, cpi.`is_delete`, cpi.`tips`, IFNULL(cpi.`runstate`, 0) AS runstate, cpi.`file_path`
, `file_type`, `role_name`, `role_code`, `start_user_name`
, cpi.`start_user_id`, cpi.`person_img`,cii.name
from contingency_plan_instance cpi left join contingency_instance_info cii
on cpi.batch_no = cii.id
<where>
cpi.step_code != "-1"
<if
test=
"batchNo != null and batchNo != ''"
>
AND cpi.batch_no = #{batchNo}
</if>
<if
test=
"type != null and type != ''"
>
and cpi.record_type = #{type}
</if>
</where>
UNION ALL
select cpi.id, cpi.`record_type`, cpi.`category`, cpi.`content`, cpi.`icon`, cpi.`sort`, cpi.`sequence_num`
, cpi.`batch_no`, cpi.`create_date`, DATE_FORMAT(cpi.`create_date`,'%Y-%m-%d %H:%i:%s') AS createTime, cpi.`create_user`, cpi.`update_date`
, DATE_FORMAT(cpi.`update_date`,'%Y-%m-%d %H:%i:%s') AS updateTime, cpi.`update_user`, cpi.`is_delete`, cpi.`tips`, IFNULL(cpi.`runstate`, 0) AS runstate, cpi.`file_path`
, `file_type`, `role_name`, `role_code`, `start_user_name`
, cpi.`start_user_id`, cpi.`person_img`,cii.name
from contingency_plan_instance cpi left join contingency_instance_info cii
on cpi.batch_no = cii.id
<where>
cpi.step_code = "-1"
<if
test=
"batchNo != null and batchNo != ''"
>
AND cpi.batch_no = #{batchNo}
</if>
<if
test=
"type != null and type != ''"
>
and cpi.record_type = #{type}
</if>
</where>
) tmp
ORDER BY tmp.create_date ASC
</select>
<select
id=
"countTaskPage"
resultType=
"java.lang.Integer"
>
select sum(tmpcount) from
( select count(1) AS tmpcount from contingency_plan_instance
<where>
step_code != "-1"
<if
test=
"batchNo != null and batchNo != ''"
>
AND batch_no = #{batchNo}
</if>
<if
test=
"type != null and type != ''"
>
and record_type = #{type}
</if>
<if
test=
"list != null and list.size() >0"
>
<foreach
collection=
"list"
item=
"role"
index=
"index"
open=
"and ("
close=
") "
separator=
"or"
>
role_code like concat('%',#{role},'%')
</foreach>
</if>
</where>
UNION ALL
select count(1) AS tmpcount from contingency_plan_instance
<where>
step_code = "-1"
<if
test=
"batchNo != null and batchNo != ''"
>
and batch_no = #{batchNo}
</if>
<if
test=
"type != null and type != ''"
>
and record_type = #{type}
</if>
<if
test=
"list != null and list.size() >0"
>
<foreach
collection=
"list"
item=
"role"
index=
"index"
open=
"and ("
close=
") "
separator=
"or"
>
role_code like concat('%',#{role},'%')
</foreach>
</if>
</where>
) a
</select>
<select
id=
"getTaskActionPage"
resultType=
"com.yeejoin.amos.fas.business.vo.ContingencyPlanInstanceVO"
>
SELECT * FROM (
select cpi.id, cpi.`record_type`, cpi.`category`, cpi.`content`, cpi.`icon`, cpi.`sort`, cpi.`sequence_num`
, cpi.`batch_no`, cpi.`create_date`, cpi.`create_user`, cpi.`update_date`
, cpi.`update_user`, cpi.`is_delete`, cpi.`tips`, IFNULL(cpi.`runstate`, 0) AS runstate, cpi.`file_path`
, `file_type`, `role_name`, `role_code`, `start_user_name`
, cpi.`start_user_id`, cpi.`person_img`,cii.name
from contingency_plan_instance cpi left join contingency_instance_info cii
on cpi.batch_no = cii.id
<where>
cpi.step_code != "-1"
<if
test=
"batchNo != null and batchNo != ''"
>
and cpi.batch_no = #{batchNo}
</if>
<if
test=
"type != null and type != ''"
>
and cpi.record_type = #{type}
</if>
<if
test=
"list != null and list.size() >0"
>
<foreach
collection=
"list"
item=
"role"
index=
"index"
open=
"and ("
close=
") "
separator=
"or"
>
cpi.role_code like concat('%',#{role},'%')
</foreach>
</if>
</where>
UNION ALL
select cpi.id, cpi.`record_type`, cpi.`category`, cpi.`content`, cpi.`icon`, cpi.`sort`, cpi.`sequence_num`
, cpi.`batch_no`, cpi.`create_date`, cpi.`create_user`, cpi.`update_date`
, cpi.`update_user`, cpi.`is_delete`, cpi.`tips`, IFNULL(cpi.`runstate`, 0) AS runstate, cpi.`file_path`
, `file_type`, `role_name`, `role_code`, `start_user_name`
, cpi.`start_user_id`, cpi.`person_img`,cii.name
from contingency_plan_instance cpi left join contingency_instance_info cii
on cpi.batch_no = cii.id
<where>
cpi.step_code = "-1"
<if
test=
"batchNo != null and batchNo != ''"
>
AND cpi.batch_no = #{batchNo}
</if>
<if
test=
"type != null and type != ''"
>
and cpi.record_type = #{type}
</if>
<if
test=
"list != null and list.size() >0"
>
<foreach
collection=
"list"
item=
"role"
index=
"index"
open=
"and ("
close=
") "
separator=
"or"
>
cpi.role_code like concat('%',#{role},'%')
</foreach>
</if>
</where>
) tmp
<if
test=
"updateDate != null and updateDate != '' and updateDate == 0"
>
order by tmp.`update_date` DESC
</if>
<if
test=
"updateDate != null and updateDate != '' and updateDate == 1"
>
order by tmp.`update_date` ASC
</if>
<if
test=
"runState != null and runState != '' and runState == 0"
>
order by tmp.runstate DESC
</if>
<if
test=
"runState != null and runState != '' and runState == 1"
>
order by tmp.runstate ASC
</if>
LIMIT #{current}, #{size}
</select>
</mapper>
</mapper>
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/ContingencyPlanInstanceMapper.xml
View file @
1e3b8f04
...
@@ -12,6 +12,32 @@
...
@@ -12,6 +12,32 @@
</if>
</if>
where id = #{id}
where id = #{id}
</update>
</update>
<update
id=
"updateTaskStatusById"
>
UPDATE
contingency_plan_instance
SET
runstate = ${runStatus}
<if
test=
"content != null and content != ''"
>
, content = #{content}
</if>
<if
test=
"userName != null and userName != ''"
>
, start_user_name = #{userName}
</if>
<if
test=
"userId != null and userId != ''"
>
, start_user_id = #{userId}
</if>
<if
test=
"personImg != null and personImg != ''"
>
, person_img = #{personImg}
</if>
<if
test=
"fileType != null and fileType != ''"
>
, file_type = #{fileType}
</if>
<if
test=
"roleNames != null and roleNames != ''"
>
, role_name = #{roleNames}
</if>
where id = #{id}
</update>
<update
id=
"updateMessageById"
>
<update
id=
"updateMessageById"
>
UPDATE `contingency_plan_instance`
UPDATE `contingency_plan_instance`
SET
SET
...
@@ -408,4 +434,39 @@
...
@@ -408,4 +434,39 @@
AND content = #{content}
AND content = #{content}
</if>
</if>
</select>
</select>
<select
id=
"getInstanceIdByBatchNOAndCategory"
resultType=
"String"
>
select
id
from
contingency_plan_instance
where
is_delete = 0
<if
test=
"category!=null and category!=''"
>
AND category = #{category}
</if>
<if
test=
"recordType!=null and recordType!=''"
>
AND record_type = #{recordType}
</if>
<if
test=
"batchNo!=null and batchNo!=''"
>
AND batch_no = #{batchNo}
</if>
limit 1
</select>
<select
id=
"getPlanInstanceByRunState"
resultType=
"Integer"
>
SELECT
COUNT(1)
FROM
contingency_plan_instance
<where>
runstate IS NULL AND record_type = 'TASKOPERATE'
<if
test=
"stepCode != null and stepCode != ''"
>
AND step_code = #{stepCode}
</if>
<if
test=
"batchNo != null and batchNo != ''"
>
AND batch_no = #{batchNo}
</if>
</where>
</select>
</mapper>
</mapper>
\ No newline at end of file
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/PlanMessage.xml
View file @
1e3b8f04
...
@@ -24,4 +24,21 @@
...
@@ -24,4 +24,21 @@
ORDER BY
ORDER BY
m.index_create_time DESC
m.index_create_time DESC
</select>
</select>
<select
id=
"getPlanMessageCount"
resultType=
"int"
>
SELECT
count(m.id)
FROM
c_plan_message m
where
<if
test=
"batchNo != null and batchNo != ''"
>
m.batch_no = #{batchNo}
</if>
<if
test=
"stepIndex != null"
>
AND m.step_index = ${stepIndex}
</if>
<if
test=
"indexUpdateTime != null"
>
AND m.index_create_time = #{indexUpdateTime}
</if>
</select>
</mapper>
</mapper>
\ No newline at end of file
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/PlanOperationRecordMapper.xml
View file @
1e3b8f04
...
@@ -140,4 +140,14 @@
...
@@ -140,4 +140,14 @@
<select
id=
"getLastPlanPattern"
resultType=
"java.lang.Integer"
>
<select
id=
"getLastPlanPattern"
resultType=
"java.lang.Integer"
>
select plan_pattern as planPattern from c_plan_operation_record where is_delete = 0 order by create_date desc limit 1
select plan_pattern as planPattern from c_plan_operation_record where is_delete = 0 order by create_date desc limit 1
</select>
</select>
<select
id=
"getArraysUserIds"
resultType=
"java.lang.String"
>
SELECT amos_id from c_emergency_relation cer where obligationId in (
select id from f_dict fd where dict_value = #{roleCode}
)
</select>
<select
id=
"getArraysUserName"
resultType=
"java.lang.String"
>
SELECT person_name from c_emergency_relation cer where obligationId in (
select id from f_dict fd where dict_value = #{roleCode}
)
</select>
</mapper>
</mapper>
\ No newline at end of file
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/dbTemplate_emergency_task.xml
0 → 100644
View file @
1e3b8f04
<?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.EmergencyTaskMapper"
>
<select
id=
"getEmergencyTaskList"
resultType=
"com.yeejoin.amos.fas.dao.entity.EmergencyTaskContent"
>
SELECT
id,
content,
code,
obligation_name as obligationName
FROM
c_emergency_task_content
<where>
<if
test=
"obligationId != null "
>
obligation_id = #{obligationId}
</if>
</where>
LIMIT #{offset}, #{pageSize}
</select>
<select
id=
"getEmergencyTaskCount"
resultType=
"int"
>
SELECT
count(1)
FROM
c_emergency_task_content
<where>
<if
test=
"_parameter != null "
>
obligation_id = #{obligationId}
</if>
</where>
</select>
<select
id=
"treeList"
resultType=
"com.yeejoin.amos.fas.dao.entity.EmergencyRelationTree"
>
SELECT
cer.person_id as id,
cer.person_id as sequenceNbr,
cer.person_name as name,
cer.obligationId as obligationId,
'1' as type
FROM
c_emergency_relation cer
</select>
<select
id=
"roleCodes"
resultType=
"string"
>
SELECT
f.dict_value
FROM
c_emergency_relation cer LEFT JOIN f_dict f ON cer.obligationId = f.id
<where>
<if
test=
"_parameter != null "
>
cer.amos_id = #{amosOrgId}
</if>
</where>
</select>
<select
id=
"roleNames"
resultType=
"string"
>
SELECT
f.dict_name AS dictName
FROM
c_emergency_relation cer LEFT JOIN f_dict f ON cer.obligationId = f.id
<where>
<if
test=
"_parameter != null "
>
cer.amos_id = #{amosOrgId}
</if>
</where>
</select>
<select
id=
"getPersonIds"
resultType=
"long"
>
SELECT
cer.person_id AS persons
FROM
c_emergency_relation cer
<where>
<if
test=
"_parameter != null "
>
cer.obligationId = #{obligationId}
</if>
</where>
</select>
<delete
id=
"deleteTreeNode"
>
delete from c_emergency_relation cer
<where>
<if
test=
"obligationId != null "
>
cer.obligationId = #{obligationId}
</if>
<if
test=
"personId != null "
>
and cer.person_id = #{personId}
</if>
</where>
</delete>
<insert
id=
"save"
parameterType=
"com.yeejoin.amos.fas.dao.entity.EmergencyRelation"
>
INSERT INTO `c_emergency_relation`(id, `obligationId`, `person_id`, `amos_id`, `person_name`, `create_date`)
VALUES (#{id}, #{obligationId}, #{personId}, #{amosOrgId}, #{personName},#{createDate});
</insert>
<select
id=
"getContentList"
resultType=
"com.yeejoin.amos.fas.business.vo.EmergencyTaskContentVo"
>
SELECT
*
FROM
c_emergency_task_content
<where>
<if
test=
"stepCode != null and stepCode != '' and stepCode != '-2'"
>
step_code = #{stepCode}
</if>
<if
test=
"stepCode != null and stepCode != '' and stepCode == '-2'"
>
step_code = -1
</if>
</where>
</select>
<select
id=
"getMustTaskList"
resultType=
"com.yeejoin.amos.fas.business.vo.EmergencyTaskContentVo"
>
SELECT
*
FROM
c_emergency_task_content
<where>
is_must = true
<if
test=
"stepCode != null and stepCode != ''"
>
and step_code = #{stepCode}
</if>
</where>
</select>
</mapper>
\ No newline at end of file
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/dbTemplate_equipment_specific_index.xml
View file @
1e3b8f04
...
@@ -143,14 +143,14 @@
...
@@ -143,14 +143,14 @@
<when
test =
"outAndOr != null and outAndOr != '' and outAndOr == 'and'"
>
<when
test =
"outAndOr != null and outAndOr != '' and outAndOr == 'and'"
>
<if
test=
"list != null and list.size() > 0"
>
<if
test=
"list != null and list.size() > 0"
>
<foreach
collection=
"list"
item=
"item"
index=
"index"
open=
"("
close=
")"
separator=
"and"
>
<foreach
collection=
"list"
item=
"item"
index=
"index"
open=
"("
close=
")"
separator=
"and"
>
esi.equipment_index_key = #{item.equipSpeIndexKey} and es.equipment_code = #{item.equipCode}
and esi.`value` = #{item.standardValue}
esi.equipment_index_key = #{item.equipSpeIndexKey} and es.equipment_code = #{item.equipCode}
</foreach>
</foreach>
</if>
</if>
</when>
</when>
<otherwise>
<otherwise>
<if
test=
"list != null and list.size() > 0"
>
<if
test=
"list != null and list.size() > 0"
>
<foreach
collection=
"list"
item=
"item"
index=
"index"
open=
"("
close=
")"
separator=
"or"
>
<foreach
collection=
"list"
item=
"item"
index=
"index"
open=
"("
close=
")"
separator=
"or"
>
esi.equipment_index_key = #{item.equipSpeIndexKey} and es.equipment_code = #{item.equipCode}
and esi.`value` = #{item.standardValue}
esi.equipment_index_key = #{item.equipSpeIndexKey} and es.equipment_code = #{item.equipCode}
</foreach>
</foreach>
</if>
</if>
</otherwise>
</otherwise>
...
...
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/dbTemplate_fire_equip.xml
View file @
1e3b8f04
...
@@ -175,11 +175,14 @@
...
@@ -175,11 +175,14 @@
efe.fire_equipment_id = ind.equipment_specific_id
efe.fire_equipment_id = ind.equipment_specific_id
) equipmentName,
) equipmentName,
ind.update_date as create_date,
ind.update_date as create_date,
ifnull(fs.`name`,'') AS systemName
( SELECT
IFNULL(GROUP_CONCAT( temp.name SEPARATOR ','),'') AS systemName
FROM
( SELECT NAME FROM f_fire_fighting_system fs WHERE FIND_IN_SET( fs.id, spe.system_id ) ) temp
) AS systemName
FROM
FROM
wl_equipment_specific_index as ind
wl_equipment_specific_index as ind
left join wl_equipment_specific as spe on spe.id = ind.equipment_specific_id
left join wl_equipment_specific as spe on spe.id = ind.equipment_specific_id
LEFT JOIN f_fire_fighting_system fs ON FIND_IN_SET( fs.id, spe.system_id )
left join wl_equipment_detail as det on spe.equipment_detail_id = det.id
left join wl_equipment_detail as det on spe.equipment_detail_id = det.id
left join wl_equipment_index as ein on ind.equipment_index_id = ein.id
left join wl_equipment_index as ein on ind.equipment_index_id = ein.id
left join wl_stock_detail as sto on sto.equipment_specific_id = spe.id
left join wl_stock_detail as sto on sto.equipment_specific_id = spe.id
...
...
YeeAmosFireAutoSysStart/src/main/resources/json/plan-setp-qiantangjiang.json
0 → 100644
View file @
1e3b8f04
[
{
"stepCode"
:
"0"
,
"stepName"
:
"检查确认火情"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"FIRE_CONFIRM"
,
"isParallel"
:
"1"
,
"roleCode"
:
"Digital_Responsing_Plan_A"
,
"index"
:
0
,
"checkYesOrNo"
:
""
},
{
"stepCode"
:
"1"
,
"stepName"
:
"检查相应阀组是否停用、交流进线开关是否已跳开"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"STOP_COMMUTATION"
,
"isParallel"
:
"1"
,
"roleCode"
:
"Digital_Responsing_Plan_A"
,
"index"
:
1
,
"checkYesOrNo"
:
""
},
{
"stepCode"
:
"2"
,
"stepName"
:
"向各级领导、调度汇报火情"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"LEADER_REPORT_FIRE"
,
"isParallel"
:
"0"
,
"roleCode"
:
"Digital_Responsing_Plan_B"
,
"index"
:
2
,
"checkYesOrNo"
:
""
},
{
"stepCode"
:
"3"
,
"stepName"
:
"申请主控站转移、停用本级对端换流器"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"STOP_LOCAL_END_TRANSVERTER"
,
"isParallel"
:
"0"
,
"roleCode"
:
"Digital_Responsing_Plan_B"
,
"index"
:
3
,
"checkYesOrNo"
:
""
},
{
"stepCode"
:
"4"
,
"stepName"
:
"通知专职消防队、值班领导或驻站检修负责人及保安人员"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"NOTICE_STATION_ALL_PERSON"
,
"isParallel"
:
"0"
,
"roleCode"
:
"Digital_Responsing_Plan_B"
,
"index"
:
4
,
"checkYesOrNo"
:
""
},
{
"stepCode"
:
"5"
,
"stepName"
:
"拨打119火警电话、全站广播通报火情"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"CALL_PHONE"
,
"isParallel"
:
"0"
,
"roleCode"
:
"Digital_Responsing_Plan_A"
,
"index"
:
5
,
"checkYesOrNo"
:
""
},
{
"stepCode"
:
"6"
,
"stepName"
:
"起火换流变转检修"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"FIRE_TRANSVERTER_TO_OVERHAUL"
,
"isParallel"
:
"0"
,
"roleCode"
:
"Digital_Responsing_Plan_B"
,
"index"
:
6
,
"checkYesOrNo"
:
""
},
{
"stepCode"
:
"7"
,
"stepName"
:
"驻站消防队开始灭火"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"FIRETEAM_START_OUTFIRE"
,
"isParallel"
:
"1"
,
"roleCode"
:
"Digital_Responsing_Plan_A"
,
"index"
:
7
,
"checkYesOrNo"
:
""
},
{
"stepCode"
:
"8"
,
"stepName"
:
"调整工业视频监视工业水池、现场火势情况"
,
"stepStatus"
:
"1"
,
"buttonCode"
:
"ADJUST_VIDEO_TO_POOL"
,
"isParallel"
:
"0"
,
"roleCode"
:
"Digital_Responsing_Plan_A"
,
"index"
:
8
,
"checkYesOrNo"
:
""
},
{
"stepCode"
:
"9"
,
"stepName"
:
"CAFS喷淋系统已开启"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"OPEN_WATERSYSTEM"
,
"isParallel"
:
"0"
,
"roleCode"
:
"Digital_Responsing_Plan_A"
,
"index"
:
9
,
"checkYesOrNo"
:
""
,
"condition"
:
[
{
"equipName"
:
"雨淋阀"
,
"equipCode"
:
"92130300BH644"
,
"equipSpeName"
:
""
,
"equipSpeCode"
:
""
,
"equipSpeIndexKey"
:
"WSS_DelugeValve_Start"
,
"standardValue"
:
"true"
,
"inAndOr"
:
"and"
}
],
"outAndOr"
:
"and"
,
"isAuto"
:
0
},
{
"stepCode"
:
"10"
,
"stepName"
:
"开启换流变挑檐炮"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"MONITOR_START"
,
"isParallel"
:
"0"
,
"roleCode"
:
"Digital_Responsing_Plan_A"
,
"index"
:
10
,
"condition"
:
[
{
"equipName"
:
"CAFS消防炮"
,
"equipCode"
:
"92032200BUX44"
,
"equipSpeName"
:
""
,
"equipSpeCode"
:
""
,
"equipSpeIndexKey"
:
"CAFS_GunValve_Open"
,
"standardValue"
:
"true"
,
"inAndOr"
:
"and"
}
],
"outAndOr"
:
"and"
,
"isAuto"
:
0
,
"checkYesOrNo"
:
""
},
{
"stepCode"
:
"11"
,
"stepName"
:
"停运阀冷系统、阀厅空调系统"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"STOP_VALVE_COOL_SYS"
,
"isParallel"
:
"0"
,
"roleCode"
:
"Digital_Responsing_Plan_A"
,
"index"
:
11
,
"checkYesOrNo"
:
""
,
"condition"
:
[
{
"equipName"
:
"AIRCS-风机"
,
"equipCode"
:
"92230600UH244"
,
"equipSpeName"
:
""
,
"equipSpeCode"
:
""
,
"equipSpeIndexKey"
:
"AIRCS_Fan_Start"
,
"standardValue"
:
"false"
,
"inAndOr"
:
"and"
}
],
"outAndOr"
:
"and"
,
"isAuto"
:
0
},
{
"stepCode"
:
"12"
,
"stepName"
:
"断开交直流电源"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"OFF_POWER"
,
"isParallel"
:
"0"
,
"roleCode"
:
"Digital_Responsing_Plan_A"
,
"index"
:
12
,
"checkYesOrNo"
:
""
},
{
"stepCode"
:
"13"
,
"stepName"
:
"启动着火换流变排油装置"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"DRAIN_OIL_CONFIRM"
,
"isParallel"
:
"1"
,
"roleCode"
:
"Digital_Responsing_Plan_A"
,
"index"
:
13
,
"checkYesOrNo"
:
""
,
"condition"
:
[
{
"equipName"
:
"排油阀"
,
"equipCode"
:
"92102700EBA44"
,
"equipSpeName"
:
""
,
"equipSpeCode"
:
""
,
"equipSpeIndexKey"
:
"ONL_OilDischargeDeviceOilPillowDischargeOpen"
,
"standardValue"
:
"true"
,
"inAndOr"
:
"and"
}
],
"outAndOr"
:
"and"
,
"isAuto"
:
0
},
{
"stepCode"
:
"14"
,
"stepName"
:
"对阀侧套管、阀厅进行降温"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"COOL_SYS_COOL_DOWN"
,
"isParallel"
:
"0"
,
"roleCode"
:
"Digital_Responsing_Plan_B"
,
"index"
:
14
,
"checkYesOrNo"
:
""
},
{
"stepCode"
:
"15"
,
"stepName"
:
"驻站消防队指挥权交接"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"HANDOVER_COMMAND"
,
"isParallel"
:
"0"
,
"roleCode"
:
"Digital_Responsing_Plan_B"
,
"index"
:
15
,
"checkYesOrNo"
:
""
},
{
"stepCode"
:
"16"
,
"stepName"
:
"确认明火扑灭"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"FIRE_EXTINCT"
,
"isParallel"
:
"0"
,
"roleCode"
:
"Digital_Responsing_Plan_B"
,
"index"
:
16
,
"checkYesOrNo"
:
""
},
{
"stepCode"
:
"17"
,
"stepName"
:
"确认无复燃情况"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"CONFIRM_REKINDLE"
,
"isParallel"
:
"0"
,
"roleCode"
:
"Digital_Responsing_Plan_B"
,
"index"
:
17
,
"checkYesOrNo"
:
""
},
{
"stepCode"
:
"18"
,
"stepName"
:
"向各级领导、调度、指挥中心汇报已灭火"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"LEADER_REPORT_FIRE_EXTINCT"
,
"isParallel"
:
"0"
,
"roleCode"
:
"Digital_Responsing_Plan_B"
,
"index"
:
18
,
"checkYesOrNo"
:
""
},
{
"stepCode"
:
"19"
,
"stepName"
:
"应急处置结束"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"END_EMERGENCY"
,
"isParallel"
:
"1"
,
"roleCode"
:
"Digital_Responsing_Plan_B"
,
"index"
:
19
,
"checkYesOrNo"
:
""
}
]
\ No newline at end of file
YeeAmosFireAutoSysStart/src/main/resources/json/plan-step-poyanghu.json
View file @
1e3b8f04
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
},
},
{
{
"stepCode"
:
"15"
,
"stepCode"
:
"15"
,
"stepName"
:
"全站广播通报火情"
,
"stepName"
:
"全站广播通报火情
、通知驻站消防队
"
,
"stepStatus"
:
"0"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"ALL_STATION_PA"
,
"buttonCode"
:
"ALL_STATION_PA"
,
"isParallel"
:
"1"
,
"isParallel"
:
"1"
,
...
@@ -34,7 +34,7 @@
...
@@ -34,7 +34,7 @@
},
},
{
{
"stepCode"
:
"16"
,
"stepCode"
:
"16"
,
"stepName"
:
"停运起火换流器"
,
"stepName"
:
"停运起火换流器
、驻站消防队开始灭火
"
,
"stepStatus"
:
"0"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"STOP_FIRE_TRANSVERTER"
,
"buttonCode"
:
"STOP_FIRE_TRANSVERTER"
,
"isParallel"
:
"0"
,
"isParallel"
:
"0"
,
...
...
YeeAmosFireAutoSysStart/src/main/resources/json/plan-step-shaoxing.json
0 → 100644
View file @
1e3b8f04
[
{
"stepCode"
:
"0"
,
"stepName"
:
"检查确认火情"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"FIRE_CONFIRM"
,
"isParallel"
:
"1"
,
"roleCode"
:
"Digital_Responsing_Plan_A"
,
"index"
:
0
,
"checkYesOrNo"
:
""
},
{
"stepCode"
:
"1"
,
"stepName"
:
"检查相应阀组是否停用、交流进线开关是否已跳开"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"STOP_COMMUTATION"
,
"isParallel"
:
"1"
,
"roleCode"
:
"Digital_Responsing_Plan_A"
,
"index"
:
1
,
"checkYesOrNo"
:
""
},
{
"stepCode"
:
"2"
,
"stepName"
:
"向各级领导、调度汇报火情"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"LEADER_REPORT_FIRE"
,
"isParallel"
:
"0"
,
"roleCode"
:
"Digital_Responsing_Plan_B"
,
"index"
:
2
,
"checkYesOrNo"
:
""
},
{
"stepCode"
:
"3"
,
"stepName"
:
"申请主控站转移、停用本级对端换流器"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"STOP_LOCAL_END_TRANSVERTER"
,
"isParallel"
:
"0"
,
"roleCode"
:
"Digital_Responsing_Plan_B"
,
"index"
:
3
,
"checkYesOrNo"
:
""
},
{
"stepCode"
:
"4"
,
"stepName"
:
"通知专职消防队、值班领导或驻站检修负责人及保安人员"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"NOTICE_STATION_ALL_PERSON"
,
"isParallel"
:
"0"
,
"roleCode"
:
"Digital_Responsing_Plan_B"
,
"index"
:
4
,
"checkYesOrNo"
:
""
},
{
"stepCode"
:
"5"
,
"stepName"
:
"拨打119火警电话、全站广播通报火情"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"CALL_PHONE"
,
"isParallel"
:
"0"
,
"roleCode"
:
"Digital_Responsing_Plan_A"
,
"index"
:
5
,
"checkYesOrNo"
:
""
},
{
"stepCode"
:
"6"
,
"stepName"
:
"起火换流变转检修"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"FIRE_TRANSVERTER_TO_OVERHAUL"
,
"isParallel"
:
"0"
,
"roleCode"
:
"Digital_Responsing_Plan_B"
,
"index"
:
6
,
"checkYesOrNo"
:
""
},
{
"stepCode"
:
"7"
,
"stepName"
:
"驻站消防队开始灭火"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"FIRETEAM_START_OUTFIRE"
,
"isParallel"
:
"1"
,
"roleCode"
:
"Digital_Responsing_Plan_A"
,
"index"
:
7
,
"checkYesOrNo"
:
""
},
{
"stepCode"
:
"8"
,
"stepName"
:
"调整工业视频监视工业水池、现场火势情况"
,
"stepStatus"
:
"1"
,
"buttonCode"
:
"ADJUST_VIDEO_TO_POOL"
,
"isParallel"
:
"0"
,
"roleCode"
:
"Digital_Responsing_Plan_A"
,
"index"
:
8
,
"checkYesOrNo"
:
""
},
{
"stepCode"
:
"9"
,
"stepName"
:
"水喷雾系统已开启"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"OPEN_WATERSYSTEM"
,
"isParallel"
:
"0"
,
"roleCode"
:
"Digital_Responsing_Plan_A"
,
"index"
:
9
,
"checkYesOrNo"
:
""
,
"condition"
:
[
{
"equipName"
:
"雨淋阀"
,
"equipCode"
:
"92130300BH644"
,
"equipSpeName"
:
""
,
"equipSpeCode"
:
""
,
"equipSpeIndexKey"
:
"WSS_DelugeValve_Start"
,
"standardValue"
:
"true"
,
"inAndOr"
:
"and"
}
],
"outAndOr"
:
"and"
,
"isAuto"
:
0
},
{
"stepCode"
:
"10"
,
"stepName"
:
"开启换流变挑檐炮、广场涡扇炮"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"MONITOR_START"
,
"isParallel"
:
"0"
,
"roleCode"
:
"Digital_Responsing_Plan_A"
,
"index"
:
10
,
"condition"
:
[
{
"equipName"
:
"CAFS消防炮"
,
"equipCode"
:
"92032200BUX44"
,
"equipSpeName"
:
""
,
"equipSpeCode"
:
""
,
"equipSpeIndexKey"
:
"CAFS_GunValve_Open"
,
"standardValue"
:
"true"
,
"inAndOr"
:
"and"
}
],
"outAndOr"
:
"and"
,
"isAuto"
:
0
,
"checkYesOrNo"
:
""
},
{
"stepCode"
:
"11"
,
"stepName"
:
"停运阀冷系统、阀厅空调系统"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"STOP_VALVE_COOL_SYS"
,
"isParallel"
:
"0"
,
"roleCode"
:
"Digital_Responsing_Plan_A"
,
"index"
:
11
,
"checkYesOrNo"
:
""
,
"condition"
:
[
{
"equipName"
:
"AIRCS-风机"
,
"equipCode"
:
"92230600UH244"
,
"equipSpeName"
:
""
,
"equipSpeCode"
:
""
,
"equipSpeIndexKey"
:
"AIRCS_Fan_Start"
,
"standardValue"
:
"false"
,
"inAndOr"
:
"and"
}
],
"outAndOr"
:
"and"
,
"isAuto"
:
0
},
{
"stepCode"
:
"12"
,
"stepName"
:
"断开交直流电源"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"OFF_POWER"
,
"isParallel"
:
"0"
,
"roleCode"
:
"Digital_Responsing_Plan_A"
,
"index"
:
12
,
"checkYesOrNo"
:
""
},
{
"stepCode"
:
"13"
,
"stepName"
:
"启动着火换流变排油装置"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"DRAIN_OIL_CONFIRM"
,
"isParallel"
:
"1"
,
"roleCode"
:
"Digital_Responsing_Plan_A"
,
"index"
:
13
,
"checkYesOrNo"
:
""
,
"condition"
:
[
{
"equipName"
:
"排油阀"
,
"equipCode"
:
"92102700EBA44"
,
"equipSpeName"
:
""
,
"equipSpeCode"
:
""
,
"equipSpeIndexKey"
:
"ONL_OilDischargeDeviceOilPillowDischargeOpen"
,
"standardValue"
:
"true"
,
"inAndOr"
:
"and"
}
],
"outAndOr"
:
"and"
,
"isAuto"
:
0
},
{
"stepCode"
:
"14"
,
"stepName"
:
"对阀侧套管、阀厅进行降温"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"COOL_SYS_COOL_DOWN"
,
"isParallel"
:
"0"
,
"roleCode"
:
"Digital_Responsing_Plan_B"
,
"index"
:
14
,
"checkYesOrNo"
:
""
},
{
"stepCode"
:
"15"
,
"stepName"
:
"驻站消防队指挥权交接"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"HANDOVER_COMMAND"
,
"isParallel"
:
"0"
,
"roleCode"
:
"Digital_Responsing_Plan_B"
,
"index"
:
15
,
"checkYesOrNo"
:
""
},
{
"stepCode"
:
"16"
,
"stepName"
:
"确认明火扑灭"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"FIRE_EXTINCT"
,
"isParallel"
:
"0"
,
"roleCode"
:
"Digital_Responsing_Plan_B"
,
"index"
:
16
,
"checkYesOrNo"
:
""
},
{
"stepCode"
:
"17"
,
"stepName"
:
"确认无复燃情况"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"CONFIRM_REKINDLE"
,
"isParallel"
:
"0"
,
"roleCode"
:
"Digital_Responsing_Plan_B"
,
"index"
:
17
,
"checkYesOrNo"
:
""
},
{
"stepCode"
:
"18"
,
"stepName"
:
"向各级领导、调度、指挥中心汇报已灭火"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"LEADER_REPORT_FIRE_EXTINCT"
,
"isParallel"
:
"0"
,
"roleCode"
:
"Digital_Responsing_Plan_B"
,
"index"
:
18
,
"checkYesOrNo"
:
""
},
{
"stepCode"
:
"19"
,
"stepName"
:
"应急处置结束"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"END_EMERGENCY"
,
"isParallel"
:
"1"
,
"roleCode"
:
"Digital_Responsing_Plan_B"
,
"index"
:
19
,
"checkYesOrNo"
:
""
}
]
\ No newline at end of file
YeeAmosFireAutoSysStart/src/main/resources/json/plan-step-yinan-yingji1.0.json
0 → 100644
View file @
1e3b8f04
[
{
"stepCode"
:
"0"
,
"stepName"
:
"确认灾情"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"FIRE_CONFIRM"
,
"isParallel"
:
"1"
,
"roleCode"
:
"Digital_Responsing_Plan_A"
,
"index"
:
0
,
"checkYesOrNo"
:
""
},
{
"stepCode"
:
"1"
,
"stepName"
:
"停运换流阀"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"STOP_COMMUTATION"
,
"isParallel"
:
"1"
,
"roleCode"
:
"Digital_Responsing_Plan_A"
,
"index"
:
1
,
"checkYesOrNo"
:
""
,
"condition"
:
[
{
"equipName"
:
"换流器"
,
"equipCode"
:
"92261200S7944"
,
"equipSpeName"
:
""
,
"equipSpeCode"
:
""
,
"equipSpeIndexKey"
:
"DCCP_DCCPStreamTransformerCharged"
,
"standardValue"
:
"true"
,
"inAndOr"
:
"and"
}
],
"outAndOr"
:
"and"
,
"isAuto"
:
0
},
{
"stepCode"
:
"2"
,
"stepName"
:
"拨打报警电话"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"CALL_PHONE"
,
"isParallel"
:
"0"
,
"roleCode"
:
"Digital_Responsing_Plan_A"
,
"index"
:
2
,
"checkYesOrNo"
:
""
},
{
"stepCode"
:
"3"
,
"stepName"
:
"确认油枕排油系统已开启"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"DRAIN_OIL_CONFIRM"
,
"isParallel"
:
"0"
,
"roleCode"
:
"Digital_Responsing_Plan_A"
,
"index"
:
3
,
"checkYesOrNo"
:
""
,
"condition"
:
[
{
"equipName"
:
"排油阀"
,
"equipCode"
:
"92102700EBA44"
,
"equipSpeName"
:
""
,
"equipSpeCode"
:
""
,
"equipSpeIndexKey"
:
"ONL_OilDischargeDeviceOilPillowDischargeOpen"
,
"standardValue"
:
"true"
,
"inAndOr"
:
"and"
}
],
"outAndOr"
:
"and"
,
"isAuto"
:
0
},
{
"stepCode"
:
"4"
,
"stepName"
:
"确认水喷雾系统已开启"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"OPEN_WATERSYSTEM"
,
"isParallel"
:
"0"
,
"roleCode"
:
"Digital_Responsing_Plan_A"
,
"index"
:
4
,
"checkYesOrNo"
:
""
,
"condition"
:
[
{
"equipName"
:
"雨淋阀"
,
"equipCode"
:
"92130300BH644"
,
"equipSpeName"
:
""
,
"equipSpeCode"
:
""
,
"equipSpeIndexKey"
:
"WSS_DelugeValve_Start"
,
"standardValue"
:
"true"
,
"inAndOr"
:
"and"
}
],
"outAndOr"
:
"and"
,
"isAuto"
:
0
},
{
"stepCode"
:
"5"
,
"stepName"
:
"断开上级电源"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"OFF_POWER"
,
"isParallel"
:
"0"
,
"roleCode"
:
"Digital_Responsing_Plan_A"
,
"index"
:
5
,
"checkYesOrNo"
:
""
},
{
"stepCode"
:
"6"
,
"stepName"
:
"停运阀厅空调系统"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"STOP_AIRCON"
,
"isParallel"
:
"0"
,
"roleCode"
:
"Digital_Responsing_Plan_A"
,
"index"
:
6
,
"checkYesOrNo"
:
""
},
{
"stepCode"
:
"7"
,
"stepName"
:
"一键开启消防炮"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"MONITOR_START"
,
"isParallel"
:
"0"
,
"roleCode"
:
"Digital_Responsing_Plan_A"
,
"index"
:
7
,
"checkYesOrNo"
:
""
,
"condition"
:
[
{
"equipName"
:
"消防炮阀"
,
"equipCode"
:
"92032200BUX44"
,
"equipSpeName"
:
""
,
"equipSpeCode"
:
""
,
"equipSpeIndexKey"
:
"CAFS_CAFSFireGunEquipmentValveStatus"
,
"standardValue"
:
"true"
,
"inAndOr"
:
"and"
}
],
"outAndOr"
:
"and"
,
"isAuto"
:
0
},
{
"stepCode"
:
"8"
,
"stepName"
:
"驻站消防队指挥权交接"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"HANDOVER_COMMAND"
,
"isParallel"
:
"1"
,
"roleCode"
:
"Digital_Responsing_Plan_B"
,
"index"
:
8
,
"checkYesOrNo"
:
""
},
{
"stepCode"
:
"9"
,
"stepName"
:
"确认本体排油已开启"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"OWNER_DRAIN_OIL"
,
"isParallel"
:
"0"
,
"roleCode"
:
"Digital_Responsing_Plan_B"
,
"index"
:
9
,
"checkYesOrNo"
:
""
,
"condition"
:
[
{
"equipName"
:
"排油阀"
,
"equipCode"
:
"92102700EBA44"
,
"equipSpeName"
:
""
,
"equipSpeCode"
:
""
,
"equipSpeIndexKey"
:
"ONL_OilDischargeDeviceOilyPillowDischargeOpen"
,
"standardValue"
:
"true"
,
"inAndOr"
:
"and"
}
],
"outAndOr"
:
"and"
,
"isAuto"
:
0
},
{
"stepCode"
:
"10"
,
"stepName"
:
"启动阀厅应急预案"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"START_VALVE_HALL_CONTINGENCY"
,
"isParallel"
:
"0"
,
"roleCode"
:
"Digital_Responsing_Plan_B"
,
"index"
:
10
,
"checkYesOrNo"
:
""
},
{
"stepCode"
:
"11"
,
"stepName"
:
"电缆沟封堵"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"PLUG_CABLETRENCH"
,
"isParallel"
:
"0"
,
"roleCode"
:
"Digital_Responsing_Plan_B"
,
"index"
:
11
,
"checkYesOrNo"
:
""
},
{
"stepCode"
:
"12"
,
"stepName"
:
"政府消防队指挥权交接"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"HANDOVER_FIGTHHING"
,
"isParallel"
:
"0"
,
"roleCode"
:
"Digital_Responsing_Plan_B"
,
"index"
:
12
,
"checkYesOrNo"
:
""
},
{
"stepCode"
:
"13"
,
"stepName"
:
"确认明火扑灭"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"FIRE_EXTINCT"
,
"isParallel"
:
"0"
,
"roleCode"
:
"Digital_Responsing_Plan_B"
,
"index"
:
13
,
"checkYesOrNo"
:
""
},
{
"stepCode"
:
"14"
,
"stepName"
:
"应急处置结束"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"END_EMERGENCY"
,
"isParallel"
:
"1"
,
"roleCode"
:
"Digital_Responsing_Plan_B"
,
"index"
:
14
,
"checkYesOrNo"
:
""
}
]
\ No newline at end of file
YeeAmosFireAutoSysStart/src/main/resources/json/plan-step.json
View file @
1e3b8f04
[
[
{
{
"stepCode"
:
"0"
,
"stepCode"
:
"0"
,
"stepName"
:
"确认火情"
,
"stepName"
:
"
检查
确认火情"
,
"stepStatus"
:
"0"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"FIRE_CONFIRM"
,
"buttonCode"
:
"FIRE_CONFIRM"
,
"isParallel"
:
"1"
,
"isParallel"
:
"1"
,
"roleCode"
:
"Digital_Responsing_Plan_A"
,
"roleCode"
:
"Digital_Responsing_Plan_A"
,
"index"
:
0
,
"index"
:
0
,
"isAuto"
:
0
,
"checkYesOrNo"
:
""
"checkYesOrNo"
:
""
},
},
{
{
"stepCode"
:
"1
5
"
,
"stepCode"
:
"1"
,
"stepName"
:
"
全站广播通报火情
"
,
"stepName"
:
"
检查相应阀组是否停用、交流进线开关是否已跳开
"
,
"stepStatus"
:
"0"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"
ALL_STATION_PA
"
,
"buttonCode"
:
"
STOP_COMMUTATION
"
,
"isParallel"
:
"1"
,
"isParallel"
:
"1"
,
"roleCode"
:
"Digital_Responsing_Plan_A"
,
"roleCode"
:
"Digital_Responsing_Plan_A"
,
"index"
:
1
,
"index"
:
1
,
"isAuto"
:
0
,
"checkYesOrNo"
:
""
"checkYesOrNo"
:
""
},
},
{
{
"stepCode"
:
"2"
,
"stepCode"
:
"2"
,
"stepName"
:
"
拨打火警电话
"
,
"stepName"
:
"
向各级领导、调度汇报火情
"
,
"stepStatus"
:
"0"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"
CALL_PHON
E"
,
"buttonCode"
:
"
LEADER_REPORT_FIR
E"
,
"isParallel"
:
"0"
,
"isParallel"
:
"0"
,
"roleCode"
:
"Digital_Responsing_Plan_
A
"
,
"roleCode"
:
"Digital_Responsing_Plan_
B
"
,
"index"
:
2
,
"index"
:
2
,
"isAuto"
:
0
,
"checkYesOrNo"
:
""
"checkYesOrNo"
:
""
},
},
{
{
"stepCode"
:
"
16
"
,
"stepCode"
:
"
3
"
,
"stepName"
:
"
停运起火
换流器"
,
"stepName"
:
"
申请主控站转移、停用本级对端
换流器"
,
"stepStatus"
:
"0"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"STOP_
FIRE
_TRANSVERTER"
,
"buttonCode"
:
"STOP_
LOCAL_END
_TRANSVERTER"
,
"isParallel"
:
"0"
,
"isParallel"
:
"0"
,
"roleCode"
:
"Digital_Responsing_Plan_
A
"
,
"roleCode"
:
"Digital_Responsing_Plan_
B
"
,
"index"
:
3
,
"index"
:
3
,
"condition"
:
[
{
"equipName"
:
"开关"
,
"equipCode"
:
"590000003EB44"
,
"equipSpeName"
:
""
,
"equipSpeCode"
:
""
,
"equipSpeIndexKey"
:
"Running_Alarm"
,
"standardValue"
:
"false"
,
"inAndOr"
:
"and"
}
],
"outAndOr"
:
"and"
,
"isAuto"
:
0
,
"checkYesOrNo"
:
""
"checkYesOrNo"
:
""
},
},
{
{
"stepCode"
:
"
3
"
,
"stepCode"
:
"
4
"
,
"stepName"
:
"
确认油枕排油系统已开启
"
,
"stepName"
:
"
通知专职消防队、值班领导或驻站检修负责人及保安人员
"
,
"stepStatus"
:
"0"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"
DRAIN_OIL_CONFIRM
"
,
"buttonCode"
:
"
NOTICE_STATION_ALL_PERSON
"
,
"isParallel"
:
"0"
,
"isParallel"
:
"0"
,
"roleCode"
:
"Digital_Responsing_Plan_
A
"
,
"roleCode"
:
"Digital_Responsing_Plan_
B
"
,
"index"
:
4
,
"index"
:
4
,
"condition"
:
[
{
"equipName"
:
"排油阀"
,
"equipCode"
:
"92100400VWE44"
,
"equipSpeName"
:
""
,
"equipSpeCode"
:
""
,
"equipSpeIndexKey"
:
"ONL_DrainOilValve_Open"
,
"standardValue"
:
"true"
,
"inAndOr"
:
"and"
}
],
"outAndOr"
:
"and"
,
"isAuto"
:
0
,
"checkYesOrNo"
:
""
"checkYesOrNo"
:
""
},
},
{
{
"stepCode"
:
"
4
"
,
"stepCode"
:
"
5
"
,
"stepName"
:
"
泡沫喷淋系统已开启
"
,
"stepName"
:
"
拨打119火警电话、全站广播通报火情
"
,
"stepStatus"
:
"0"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"
OPEN_WATERSYSTEM
"
,
"buttonCode"
:
"
CALL_PHONE
"
,
"isParallel"
:
"0"
,
"isParallel"
:
"0"
,
"roleCode"
:
"Digital_Responsing_Plan_A"
,
"roleCode"
:
"Digital_Responsing_Plan_A"
,
"index"
:
5
,
"index"
:
5
,
"condition"
:
[
{
"equipName"
:
"主机"
,
"equipCode"
:
"92030100TGX44"
,
"equipSpeName"
:
""
,
"equipSpeCode"
:
""
,
"equipSpeIndexKey"
:
"CAFS_CompAirFoamHost_Outfire"
,
"standardValue"
:
"true"
,
"inAndOr"
:
"and"
}
],
"outAndOr"
:
"and"
,
"isAuto"
:
0
,
"checkYesOrNo"
:
""
"checkYesOrNo"
:
""
},
},
{
{
"stepCode"
:
"
7
"
,
"stepCode"
:
"
6
"
,
"stepName"
:
"
一键启动消防炮
"
,
"stepName"
:
"
起火换流变转检修
"
,
"stepStatus"
:
"0"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"
MONITOR_START
"
,
"buttonCode"
:
"
FIRE_TRANSVERTER_TO_OVERHAUL
"
,
"isParallel"
:
"0"
,
"isParallel"
:
"0"
,
"roleCode"
:
"Digital_Responsing_Plan_
A
"
,
"roleCode"
:
"Digital_Responsing_Plan_
B
"
,
"index"
:
6
,
"index"
:
6
,
"condition"
:
[
{
"equipName"
:
"CAFS消防炮"
,
"equipCode"
:
"92032200BUX44"
,
"equipSpeName"
:
""
,
"equipSpeCode"
:
""
,
"equipSpeIndexKey"
:
"CAFS_GunValve_Open"
,
"standardValue"
:
"true"
,
"inAndOr"
:
"and"
}
],
"outAndOr"
:
"and"
,
"isAuto"
:
0
,
"checkYesOrNo"
:
""
"checkYesOrNo"
:
""
},
},
{
{
"stepCode"
:
"
1
7"
,
"stepCode"
:
"7"
,
"stepName"
:
"
消防泵正常启动
"
,
"stepName"
:
"
驻站消防队开始灭火
"
,
"stepStatus"
:
"0"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"FIRE
_PUMP_START
"
,
"buttonCode"
:
"FIRE
TEAM_START_OUTFIRE
"
,
"isParallel"
:
"1"
,
"isParallel"
:
"1"
,
"roleCode"
:
"Digital_Responsing_Plan_A"
,
"roleCode"
:
"Digital_Responsing_Plan_A"
,
"index"
:
7
,
"index"
:
7
,
"condition"
:
[
{
"equipName"
:
"消防泵"
,
"equipCode"
:
"920106007GV44"
,
"equipSpeName"
:
""
,
"equipSpeCode"
:
""
,
"equipSpeIndexKey"
:
"FHS_FirePump_Start"
,
"standardValue"
:
"true"
,
"inAndOr"
:
"or"
}
],
"outAndOr"
:
"and"
,
"isAuto"
:
0
,
"checkYesOrNo"
:
""
"checkYesOrNo"
:
""
},
},
{
{
"stepCode"
:
"
1
8"
,
"stepCode"
:
"8"
,
"stepName"
:
"
向各级调度、领导汇报火情
"
,
"stepName"
:
"
调整工业视频监视工业水池、现场火势情况
"
,
"stepStatus"
:
"
0
"
,
"stepStatus"
:
"
1
"
,
"buttonCode"
:
"
LEADER_REPORT_FIRE
"
,
"buttonCode"
:
"
ADJUST_VIDEO_TO_POOL
"
,
"isParallel"
:
"0"
,
"isParallel"
:
"0"
,
"roleCode"
:
"Digital_Responsing_Plan_
B
"
,
"roleCode"
:
"Digital_Responsing_Plan_
A
"
,
"index"
:
8
,
"index"
:
8
,
"isAuto"
:
0
,
"checkYesOrNo"
:
""
"checkYesOrNo"
:
""
},
},
{
{
"stepCode"
:
"
1
9"
,
"stepCode"
:
"9"
,
"stepName"
:
"
停运本极对端换流器
"
,
"stepName"
:
"
CAFS喷淋系统已开启
"
,
"stepStatus"
:
"0"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"
STOP_LOCAL_END_TRANSVERTER
"
,
"buttonCode"
:
"
OPEN_WATERSYSTEM
"
,
"isParallel"
:
"0"
,
"isParallel"
:
"0"
,
"roleCode"
:
"Digital_Responsing_Plan_
B
"
,
"roleCode"
:
"Digital_Responsing_Plan_
A
"
,
"index"
:
9
,
"index"
:
9
,
"checkYesOrNo"
:
""
,
"condition"
:
[
"condition"
:
[
{
{
"equipName"
:
"
开关
"
,
"equipName"
:
"
雨淋阀
"
,
"equipCode"
:
"
590000003EB
44"
,
"equipCode"
:
"
92130300BH6
44"
,
"equipSpeName"
:
""
,
"equipSpeName"
:
""
,
"equipSpeCode"
:
""
,
"equipSpeCode"
:
""
,
"equipSpeIndexKey"
:
"
Running_Alarm
"
,
"equipSpeIndexKey"
:
"
WSS_DelugeValve_Start
"
,
"standardValue"
:
"
fals
e"
,
"standardValue"
:
"
tru
e"
,
"inAndOr"
:
"and"
"inAndOr"
:
"and"
}
}
],
],
"outAndOr"
:
"and"
,
"outAndOr"
:
"and"
,
"isAuto"
:
0
,
"isAuto"
:
0
"checkYesOrNo"
:
""
},
},
{
{
"stepCode"
:
"
2
0"
,
"stepCode"
:
"
1
0"
,
"stepName"
:
"
停运阀冷系统
"
,
"stepName"
:
"
开启换流变挑檐炮
"
,
"stepStatus"
:
"0"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"
STOP_VALVE_COOL_SYS
"
,
"buttonCode"
:
"
MONITOR_START
"
,
"isParallel"
:
"0"
,
"isParallel"
:
"0"
,
"roleCode"
:
"Digital_Responsing_Plan_
B
"
,
"roleCode"
:
"Digital_Responsing_Plan_
A
"
,
"index"
:
10
,
"index"
:
10
,
"condition"
:
[
"condition"
:
[
{
{
"equipName"
:
"
阀冷系统主机
"
,
"equipName"
:
"
CAFS消防炮
"
,
"equipCode"
:
"
59000000H9G
44"
,
"equipCode"
:
"
92032200BUX
44"
,
"equipSpeName"
:
""
,
"equipSpeName"
:
""
,
"equipSpeCode"
:
""
,
"equipSpeCode"
:
""
,
"equipSpeIndexKey"
:
"
normal_running_state
"
,
"equipSpeIndexKey"
:
"
CAFS_GunValve_Open
"
,
"standardValue"
:
"
fals
e"
,
"standardValue"
:
"
tru
e"
,
"inAndOr"
:
"and"
"inAndOr"
:
"and"
}
}
],
],
...
@@ -205,13 +136,14 @@
...
@@ -205,13 +136,14 @@
"checkYesOrNo"
:
""
"checkYesOrNo"
:
""
},
},
{
{
"stepCode"
:
"
6
"
,
"stepCode"
:
"
11
"
,
"stepName"
:
"停运阀厅空调系统"
,
"stepName"
:
"停运阀
冷系统、阀
厅空调系统"
,
"stepStatus"
:
"0"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"STOP_
AIRCON
"
,
"buttonCode"
:
"STOP_
VALVE_COOL_SYS
"
,
"isParallel"
:
"0"
,
"isParallel"
:
"0"
,
"roleCode"
:
"Digital_Responsing_Plan_
B
"
,
"roleCode"
:
"Digital_Responsing_Plan_
A
"
,
"index"
:
11
,
"index"
:
11
,
"checkYesOrNo"
:
""
,
"condition"
:
[
"condition"
:
[
{
{
"equipName"
:
"AIRCS-风机"
,
"equipName"
:
"AIRCS-风机"
,
...
@@ -224,107 +156,99 @@
...
@@ -224,107 +156,99 @@
}
}
],
],
"outAndOr"
:
"and"
,
"outAndOr"
:
"and"
,
"isAuto"
:
0
,
"isAuto"
:
0
"checkYesOrNo"
:
""
},
},
{
{
"stepCode"
:
"
5
"
,
"stepCode"
:
"
12
"
,
"stepName"
:
"断开
冷却器上级
电源"
,
"stepName"
:
"断开
交直流
电源"
,
"stepStatus"
:
"0"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"OFF_POWER"
,
"buttonCode"
:
"OFF_POWER"
,
"isParallel"
:
"0"
,
"isParallel"
:
"0"
,
"roleCode"
:
"Digital_Responsing_Plan_
B
"
,
"roleCode"
:
"Digital_Responsing_Plan_
A
"
,
"index"
:
12
,
"index"
:
12
,
"isAuto"
:
0
,
"checkYesOrNo"
:
""
"checkYesOrNo"
:
""
},
},
{
{
"stepCode"
:
"
21
"
,
"stepCode"
:
"
13
"
,
"stepName"
:
"
起火换流器转检修
"
,
"stepName"
:
"
启动着火换流变排油装置
"
,
"stepStatus"
:
"0"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"
FIRE_TRANSVERTER_TO_OVERHAUL
"
,
"buttonCode"
:
"
DRAIN_OIL_CONFIRM
"
,
"isParallel"
:
"
0
"
,
"isParallel"
:
"
1
"
,
"roleCode"
:
"Digital_Responsing_Plan_
B
"
,
"roleCode"
:
"Digital_Responsing_Plan_
A
"
,
"index"
:
13
,
"index"
:
13
,
"checkYesOrNo"
:
""
,
"condition"
:
[
"condition"
:
[
{
{
"equipName"
:
"
地刀
"
,
"equipName"
:
"
排油阀
"
,
"equipCode"
:
"
59000000SAT
44"
,
"equipCode"
:
"
92102700EBA
44"
,
"equipSpeName"
:
""
,
"equipSpeName"
:
""
,
"equipSpeCode"
:
""
,
"equipSpeCode"
:
""
,
"equipSpeIndexKey"
:
"
Running_Alarm
"
,
"equipSpeIndexKey"
:
"
ONL_OilDischargeDeviceOilPillowDischargeOpen
"
,
"standardValue"
:
"true"
,
"standardValue"
:
"true"
,
"inAndOr"
:
"and"
"inAndOr"
:
"and"
}
}
],
],
"outAndOr"
:
"and"
,
"outAndOr"
:
"and"
,
"isAuto"
:
0
,
"isAuto"
:
0
"checkYesOrNo"
:
""
},
},
{
{
"stepCode"
:
"
22
"
,
"stepCode"
:
"
14
"
,
"stepName"
:
"对阀侧套管、阀厅进行降温"
,
"stepName"
:
"对阀侧套管、阀厅进行降温"
,
"stepStatus"
:
"0"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"
VALVE_HALL_COOL
"
,
"buttonCode"
:
"
COOL_SYS_COOL_DOWN
"
,
"isParallel"
:
"
1
"
,
"isParallel"
:
"
0
"
,
"roleCode"
:
"Digital_Responsing_Plan_B"
,
"roleCode"
:
"Digital_Responsing_Plan_B"
,
"index"
:
14
,
"index"
:
14
,
"isAuto"
:
0
,
"checkYesOrNo"
:
""
"checkYesOrNo"
:
""
},
},
{
{
"stepCode"
:
"
8
"
,
"stepCode"
:
"
15
"
,
"stepName"
:
"驻站消防队指挥权交接"
,
"stepName"
:
"驻站消防队指挥权交接"
,
"stepStatus"
:
"0"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"HANDOVER_COMMAND"
,
"buttonCode"
:
"HANDOVER_COMMAND"
,
"isParallel"
:
"0"
,
"isParallel"
:
"0"
,
"roleCode"
:
"Digital_Responsing_Plan_B"
,
"roleCode"
:
"Digital_Responsing_Plan_B"
,
"index"
:
15
,
"index"
:
15
,
"isAuto"
:
0
,
"checkYesOrNo"
:
""
"checkYesOrNo"
:
""
},
},
{
{
"stepCode"
:
"1
3
"
,
"stepCode"
:
"1
6
"
,
"stepName"
:
"确认明火扑灭"
,
"stepName"
:
"确认明火扑灭"
,
"stepStatus"
:
"0"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"FIRE_EXTINCT"
,
"buttonCode"
:
"FIRE_EXTINCT"
,
"isParallel"
:
"0"
,
"isParallel"
:
"0"
,
"roleCode"
:
"Digital_Responsing_Plan_B"
,
"roleCode"
:
"Digital_Responsing_Plan_B"
,
"index"
:
16
,
"index"
:
16
,
"isAuto"
:
0
,
"checkYesOrNo"
:
""
"checkYesOrNo"
:
""
},
},
{
{
"stepCode"
:
"
23
"
,
"stepCode"
:
"
17
"
,
"stepName"
:
"确认无复燃情况"
,
"stepName"
:
"确认无复燃情况"
,
"stepStatus"
:
"0"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"CONFIRM_REKINDLE"
,
"buttonCode"
:
"CONFIRM_REKINDLE"
,
"isParallel"
:
"0"
,
"isParallel"
:
"0"
,
"roleCode"
:
"Digital_Responsing_Plan_B"
,
"roleCode"
:
"Digital_Responsing_Plan_B"
,
"index"
:
17
,
"index"
:
17
,
"isAuto"
:
0
,
"checkYesOrNo"
:
""
"checkYesOrNo"
:
""
},
},
{
{
"stepCode"
:
"
24
"
,
"stepCode"
:
"
18
"
,
"stepName"
:
"向各级
调度、领导
汇报已灭火"
,
"stepName"
:
"向各级
领导、调度、指挥中心
汇报已灭火"
,
"stepStatus"
:
"0"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"LEADER_REPORT_FIRE_EXTINCT"
,
"buttonCode"
:
"LEADER_REPORT_FIRE_EXTINCT"
,
"isParallel"
:
"0"
,
"isParallel"
:
"0"
,
"roleCode"
:
"Digital_Responsing_Plan_B"
,
"roleCode"
:
"Digital_Responsing_Plan_B"
,
"index"
:
18
,
"index"
:
18
,
"isAuto"
:
0
,
"checkYesOrNo"
:
""
"checkYesOrNo"
:
""
},
},
{
{
"stepCode"
:
"1
4
"
,
"stepCode"
:
"1
9
"
,
"stepName"
:
"应急处置结束"
,
"stepName"
:
"应急处置结束"
,
"stepStatus"
:
"0"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"END_EMERGENCY"
,
"buttonCode"
:
"END_EMERGENCY"
,
"isParallel"
:
"1"
,
"isParallel"
:
"1"
,
"roleCode"
:
"Digital_Responsing_Plan_B"
,
"roleCode"
:
"Digital_Responsing_Plan_B"
,
"index"
:
19
,
"index"
:
19
,
"isAuto"
:
0
,
"checkYesOrNo"
:
""
"checkYesOrNo"
:
""
}
}
]
]
\ No newline at end of file
pom.xml
View file @
1e3b8f04
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
<groupId>
com.yeejoin.amos
</groupId>
<groupId>
com.yeejoin.amos
</groupId>
<artifactId>
YeeAmosFireAutoSysRoot
</artifactId>
<artifactId>
YeeAmosFireAutoSysRoot
</artifactId>
<version>
3.7.0.
8
</version>
<version>
3.7.0.
9
</version>
<packaging>
pom
</packaging>
<packaging>
pom
</packaging>
<name>
YeeAmosFireAutoSysRoot
</name>
<name>
YeeAmosFireAutoSysRoot
</name>
...
...
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