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
f8b583d3
Commit
f8b583d3
authored
Mar 08, 2023
by
KeYong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
预案修改
parent
e16b6900
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
170 additions
and
59 deletions
+170
-59
EquipmentFireEquipmentController.java
...business/controller/EquipmentFireEquipmentController.java
+13
-0
EquipmentFireEquipmentServiceImpl.java
...iness/service/impl/EquipmentFireEquipmentServiceImpl.java
+87
-0
IEquipmentFireEquipmentService.java
...usiness/service/intfc/IEquipmentFireEquipmentService.java
+2
-0
PlanStepJsonVO.java
...java/com/yeejoin/amos/fas/business/vo/PlanStepJsonVO.java
+22
-0
application-dev.properties
...utoSysStart/src/main/resources/application-dev.properties
+1
-1
plan-step.json
...osFireAutoSysStart/src/main/resources/json/plan-step.json
+45
-58
No files found.
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/EquipmentFireEquipmentController.java
View file @
f8b583d3
...
@@ -35,4 +35,16 @@ public class EquipmentFireEquipmentController {
...
@@ -35,4 +35,16 @@ public class EquipmentFireEquipmentController {
return
equipmentFireEquipmentService
.
automaticExecute
(
equipmentId
,
equipCode
,
equipSpeCode
,
type
,
indexKeys
,
value
);
return
equipmentFireEquipmentService
.
automaticExecute
(
equipmentId
,
equipCode
,
equipSpeCode
,
type
,
indexKeys
,
value
);
}
}
@ApiOperation
(
value
=
"判断节点是否自动执行"
,
notes
=
"判断节点是否自动执行"
)
@GetMapping
(
"/automaticExecutePoint"
)
public
Object
automaticExecutePoint
(
@RequestParam
(
required
=
false
)
String
equipmentId
,
@RequestParam
(
required
=
false
)
String
equipCode
,
@RequestParam
(
required
=
false
)
String
equipSpeCode
,
@RequestParam
(
required
=
false
)
String
type
,
@RequestParam
(
required
=
false
)
String
indexKeys
,
@RequestParam
(
required
=
false
)
String
value
,
@RequestParam
(
required
=
false
)
String
index
)
{
return
equipmentFireEquipmentService
.
automaticExecutePoint
(
equipmentId
,
equipCode
,
equipSpeCode
,
type
,
indexKeys
,
value
,
index
);
}
}
}
\ No newline at end of file
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/EquipmentFireEquipmentServiceImpl.java
View file @
f8b583d3
package
com
.
yeejoin
.
amos
.
fas
.
business
.
service
.
impl
;
package
com
.
yeejoin
.
amos
.
fas
.
business
.
service
.
impl
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.fas.business.dao.repository.IEquipmentFireEquipmentDao
;
import
com.yeejoin.amos.fas.business.dao.repository.IEquipmentFireEquipmentDao
;
import
com.yeejoin.amos.fas.business.service.intfc.EquipmentSpecificIndexService
;
import
com.yeejoin.amos.fas.business.service.intfc.EquipmentSpecificIndexService
;
import
com.yeejoin.amos.fas.business.service.intfc.IEquipmentFireEquipmentService
;
import
com.yeejoin.amos.fas.business.service.intfc.IEquipmentFireEquipmentService
;
import
com.yeejoin.amos.fas.business.vo.PlanStepJsonVO
;
import
com.yeejoin.amos.fas.common.enums.SqlKeyWordEnum
;
import
com.yeejoin.amos.fas.common.enums.SqlKeyWordEnum
;
import
com.yeejoin.amos.fas.dao.entity.EquipmentFireEquipment
;
import
com.yeejoin.amos.fas.dao.entity.EquipmentFireEquipment
;
import
org.apache.commons.io.IOUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
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.core.io.Resource
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.CollectionUtils
;
import
java.io.IOException
;
import
java.nio.charset.StandardCharsets
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -43,6 +50,9 @@ public class EquipmentFireEquipmentServiceImpl implements IEquipmentFireEquipmen
...
@@ -43,6 +50,9 @@ public class EquipmentFireEquipmentServiceImpl implements IEquipmentFireEquipmen
@Autowired
@Autowired
private
IEquipmentFireEquipmentDao
equipmentFireEquipmentDao
;
private
IEquipmentFireEquipmentDao
equipmentFireEquipmentDao
;
@Value
(
"classpath:/json/plan-step.json"
)
private
Resource
planStepResource
;
@Override
@Override
public
List
<
EquipmentFireEquipment
>
findByEquipmentId
(
Long
equipmentId
)
{
public
List
<
EquipmentFireEquipment
>
findByEquipmentId
(
Long
equipmentId
)
{
return
equipmentFireEquipmentDao
.
findAllByEquipmentId
(
equipmentId
);
return
equipmentFireEquipmentDao
.
findAllByEquipmentId
(
equipmentId
);
...
@@ -119,4 +129,81 @@ public class EquipmentFireEquipmentServiceImpl implements IEquipmentFireEquipmen
...
@@ -119,4 +129,81 @@ public class EquipmentFireEquipmentServiceImpl implements IEquipmentFireEquipmen
}
}
return
false
;
return
false
;
}
}
@Override
public
Object
automaticExecutePoint
(
String
equipmentId
,
String
equipCode
,
String
equipSpeCode
,
String
type
,
String
indexKeys
,
String
value
,
String
index
)
{
String
json
;
try
{
json
=
IOUtils
.
toString
(
planStepResource
.
getInputStream
(),
String
.
valueOf
(
StandardCharsets
.
UTF_8
));
}
catch
(
IOException
e
)
{
throw
new
RuntimeException
(
"获取预案节点信息失败!"
);
}
List
<
PlanStepJsonVO
>
result
=
JSONObject
.
parseArray
(
json
,
PlanStepJsonVO
.
class
);
if
(!
CollectionUtils
.
isEmpty
(
result
))
{
}
Map
<
String
,
Object
>
map
=
null
;
if
(
StringUtils
.
isBlank
(
equipCode
)){
return
false
;
}
if
(
StringUtils
.
isBlank
(
type
))
{
type
=
TYPE
;
}
if
(
StringUtils
.
isBlank
(
value
))
{
value
=
VALUE
;
}
if
(
StringUtils
.
isNotBlank
(
equipmentId
))
{
// 1. 查询重点设备绑定的消防设备
List
<
EquipmentFireEquipment
>
list
=
null
;
if
(
StringUtils
.
isBlank
(
equipSpeCode
))
{
if
(
StringUtils
.
isBlank
(
equipCode
))
{
list
=
equipmentFireEquipmentService
.
findByEquipmentId
(
Long
.
parseLong
(
equipmentId
));
}
else
{
list
=
equipmentFireEquipmentService
.
findByEquipIdAndEquipCodeIn
(
Long
.
parseLong
(
equipmentId
),
equipCode
.
split
(
","
));
}
}
else
{
list
=
equipmentFireEquipmentService
.
findByEquipIdAndEquipSpeCodeIn
(
Long
.
parseLong
(
equipmentId
),
equipSpeCode
.
split
(
","
));
}
if
(!
CollectionUtils
.
isEmpty
(
list
))
{
List
<
Long
>
equipSpecificIdList
=
list
.
stream
().
map
(
EquipmentFireEquipment:
:
getFireEquipmentId
).
collect
(
Collectors
.
toList
());
// 2 获取消防设备满足条件的集合
if
(
StringUtils
.
isNotBlank
(
indexKeys
))
{
map
=
equipmentSpecificIndexService
.
countEquipIndexAndValueOfNum
(
equipSpecificIdList
,
null
,
null
,
indexKeys
.
split
(
","
),
value
);
}
else
{
map
=
equipmentSpecificIndexService
.
countEquipIndexAndValueOfNum
(
equipSpecificIdList
,
null
,
null
,
null
,
value
);
}
}
}
else
{
// 不存在重点设备,直接查消防设备
if
(
StringUtils
.
isNotBlank
(
equipSpeCode
))
{
if
(
StringUtils
.
isNotBlank
(
indexKeys
))
{
map
=
equipmentSpecificIndexService
.
countEquipIndexAndValueOfNum
(
null
,
null
,
equipSpeCode
.
split
(
","
),
indexKeys
.
split
(
","
),
value
);
}
else
{
map
=
equipmentSpecificIndexService
.
countEquipIndexAndValueOfNum
(
null
,
null
,
equipSpeCode
.
split
(
","
),
null
,
value
);
}
}
else
if
(
StringUtils
.
isNotBlank
(
equipCode
))
{
if
(
StringUtils
.
isNotBlank
(
indexKeys
))
{
map
=
equipmentSpecificIndexService
.
countEquipIndexAndValueOfNum
(
null
,
equipCode
.
split
(
","
),
null
,
indexKeys
.
split
(
","
),
value
);
}
else
{
map
=
equipmentSpecificIndexService
.
countEquipIndexAndValueOfNum
(
null
,
equipCode
.
split
(
","
),
null
,
null
,
value
);
}
}
}
if
(!
CollectionUtils
.
isEmpty
(
map
))
{
Integer
total
=
Integer
.
parseInt
(
map
.
get
(
"total"
).
toString
());
Integer
count
=
Integer
.
parseInt
(
map
.
get
(
"count"
).
toString
());
if
(
SqlKeyWordEnum
.
AND
.
getKey
().
equalsIgnoreCase
(
type
))
{
return
total
.
equals
(
count
);
}
else
if
(
SqlKeyWordEnum
.
OR
.
getKey
().
equalsIgnoreCase
(
type
))
{
return
count
!=
0
;
}
}
return
false
;
}
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/IEquipmentFireEquipmentService.java
View file @
f8b583d3
...
@@ -21,4 +21,6 @@ public interface IEquipmentFireEquipmentService {
...
@@ -21,4 +21,6 @@ public interface IEquipmentFireEquipmentService {
List
<
EquipmentFireEquipment
>
findByEquipIdAndEquipSpeCodeIn
(
Long
equipmentId
,
String
[]
equipSpeCodes
);
List
<
EquipmentFireEquipment
>
findByEquipIdAndEquipSpeCodeIn
(
Long
equipmentId
,
String
[]
equipSpeCodes
);
Object
automaticExecute
(
String
equipmentId
,
String
equipCode
,
String
equipSpeCode
,
String
type
,
String
indexKeys
,
String
value
);
Object
automaticExecute
(
String
equipmentId
,
String
equipCode
,
String
equipSpeCode
,
String
type
,
String
indexKeys
,
String
value
);
Object
automaticExecutePoint
(
String
equipmentId
,
String
equipCode
,
String
equipSpeCode
,
String
type
,
String
indexKeys
,
String
value
,
String
index
);
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/vo/PlanStepJsonVO.java
View file @
f8b583d3
...
@@ -2,6 +2,8 @@ package com.yeejoin.amos.fas.business.vo;
...
@@ -2,6 +2,8 @@ package com.yeejoin.amos.fas.business.vo;
import
lombok.Data
;
import
lombok.Data
;
import
java.util.List
;
@Data
@Data
public
class
PlanStepJsonVO
{
public
class
PlanStepJsonVO
{
private
String
stepCode
;
private
String
stepCode
;
...
@@ -25,4 +27,24 @@ public class PlanStepJsonVO {
...
@@ -25,4 +27,24 @@ public class PlanStepJsonVO {
* 进度索引
* 进度索引
*/
*/
private
int
index
;
private
int
index
;
/**
* 节点物联动作判断条件
*/
private
List
condition
;
/**
* 节点物联设备指标之间关系
*/
private
String
inAndOr
;
/**
* 节点物联设备之间关系
*/
private
String
outAndOr
;
/**
* 1自动,0非自动
*/
private
Integer
isAuto
;
}
}
YeeAmosFireAutoSysStart/src/main/resources/application-dev.properties
View file @
f8b583d3
...
@@ -19,7 +19,7 @@ amos.system.user.product=STUDIO_APP_WEB
...
@@ -19,7 +19,7 @@ amos.system.user.product=STUDIO_APP_WEB
eureka.client.serviceUrl.defaultZone
=
http://172.16.11.201:10001/eureka/
eureka.client.serviceUrl.defaultZone
=
http://172.16.11.201:10001/eureka/
eureka.client.register-with-eureka
=
true
eureka.client.register-with-eureka
=
true
eureka.client.fetch-registry
=
true
eureka.client.fetch-registry
=
true
eureka.client.healthcheck.enabled
=
tru
e
eureka.client.healthcheck.enabled
=
fals
e
eureka.client.fetchRegistry
=
true
eureka.client.fetchRegistry
=
true
eureka.instance.prefer-ip-address
=
true
eureka.instance.prefer-ip-address
=
true
...
...
YeeAmosFireAutoSysStart/src/main/resources/json/plan-step.json
View file @
f8b583d3
...
@@ -6,29 +6,42 @@
...
@@ -6,29 +6,42 @@
"buttonCode"
:
"FIRE_CONFIRM"
,
"buttonCode"
:
"FIRE_CONFIRM"
,
"isParallel"
:
"1"
,
"isParallel"
:
"1"
,
"roleCode"
:
"Digital_Responsing_Plan_A"
,
"roleCode"
:
"Digital_Responsing_Plan_A"
,
"index"
:
0
"index"
:
0
,
"condition"
:
[
{
"equipName"
:
"ONL-直流电源"
,
"equipCode"
:
"92100300MNL44"
,
"equipSpeName"
:
"ONL-直流电源"
,
"equipSpeCode"
:
"SBMC0001"
,
"equipSpeIndexKey"
:
"ONL_DCPower_Fault"
,
"standardValue"
:
"true"
,
"inAndOr"
:
"and"
}
],
"outAndOr"
:
"and"
,
"isAuto"
:
0
},
},
{
{
"stepCode"
:
"
1
"
,
"stepCode"
:
"
2
"
,
"stepName"
:
"
停运换流阀
"
,
"stepName"
:
"
拨打报警电话
"
,
"stepStatus"
:
"
0
"
,
"stepStatus"
:
"
1
"
,
"buttonCode"
:
"
STOP_COMMUTATION
"
,
"buttonCode"
:
"
CALL_PHONE
"
,
"isParallel"
:
"1"
,
"isParallel"
:
"1"
,
"roleCode"
:
"Digital_Responsing_Plan_A"
,
"roleCode"
:
"Digital_Responsing_Plan_A"
,
"index"
:
1
"index"
:
1
},
},
{
{
"stepCode"
:
"
2
"
,
"stepCode"
:
"
1
"
,
"stepName"
:
"
拨打报警电话
"
,
"stepName"
:
"
停运换流阀
"
,
"stepStatus"
:
"0"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"
CALL_PHONE
"
,
"buttonCode"
:
"
STOP_COMMUTATION
"
,
"isParallel"
:
"0"
,
"isParallel"
:
"0"
,
"roleCode"
:
"Digital_Responsing_Plan_A"
,
"roleCode"
:
"Digital_Responsing_Plan_A"
,
"index"
:
2
"index"
:
2
},
},
{
{
"stepCode"
:
"3"
,
"stepCode"
:
"3"
,
"stepName"
:
"确认
油枕
排油系统已开启"
,
"stepName"
:
"确认排油系统已开启"
,
"stepStatus"
:
"0"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"DRAIN_OIL_CONFIRM"
,
"buttonCode"
:
"DRAIN_OIL_CONFIRM"
,
"isParallel"
:
"0"
,
"isParallel"
:
"0"
,
...
@@ -37,93 +50,66 @@
...
@@ -37,93 +50,66 @@
},
},
{
{
"stepCode"
:
"4"
,
"stepCode"
:
"4"
,
"stepName"
:
"确认
水喷雾
系统已开启"
,
"stepName"
:
"确认
泡沫喷淋
系统已开启"
,
"stepStatus"
:
"0"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"OPEN_WATERSYSTEM"
,
"buttonCode"
:
"OPEN_WATERSYSTEM"
,
"isParallel"
:
"
0
"
,
"isParallel"
:
"
1
"
,
"roleCode"
:
"Digital_Responsing_Plan_A"
,
"roleCode"
:
"Digital_Responsing_Plan_A"
,
"index"
:
4
"index"
:
4
},
},
{
{
"stepCode"
:
"
5
"
,
"stepCode"
:
"
7
"
,
"stepName"
:
"
断开上级电源
"
,
"stepName"
:
"
一键开启消防炮
"
,
"stepStatus"
:
"
0
"
,
"stepStatus"
:
"
1
"
,
"buttonCode"
:
"
OFF_POWER
"
,
"buttonCode"
:
"
MONITOR_START
"
,
"isParallel"
:
"0"
,
"isParallel"
:
"0"
,
"roleCode"
:
"Digital_Responsing_Plan_A"
,
"roleCode"
:
"Digital_Responsing_Plan_A"
,
"index"
:
5
"index"
:
5
},
},
{
{
"stepCode"
:
"
6
"
,
"stepCode"
:
"
5
"
,
"stepName"
:
"
停运阀厅空调系统
"
,
"stepName"
:
"
断开上级电源
"
,
"stepStatus"
:
"0"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"
STOP_AIRCON
"
,
"buttonCode"
:
"
OFF_POWER
"
,
"isParallel"
:
"0"
,
"isParallel"
:
"0"
,
"roleCode"
:
"Digital_Responsing_Plan_A"
,
"roleCode"
:
"Digital_Responsing_Plan_A"
,
"index"
:
6
"index"
:
6
},
},
{
{
"stepCode"
:
"
7
"
,
"stepCode"
:
"
11
"
,
"stepName"
:
"
一键开启消防炮
"
,
"stepName"
:
"
电缆沟封堵
"
,
"stepStatus"
:
"0"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"
MONITOR_START
"
,
"buttonCode"
:
"
PLUG_CABLETRENCH
"
,
"isParallel"
:
"0"
,
"isParallel"
:
"0"
,
"roleCode"
:
"Digital_Responsing_Plan_
A
"
,
"roleCode"
:
"Digital_Responsing_Plan_
B
"
,
"index"
:
7
"index"
:
7
},
},
{
{
"stepCode"
:
"
8
"
,
"stepCode"
:
"
6
"
,
"stepName"
:
"
驻站消防队指挥权交接
"
,
"stepName"
:
"
停运阀厅空调系统
"
,
"stepStatus"
:
"0"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"
HANDOVER_COMMAND
"
,
"buttonCode"
:
"
STOP_AIRCON
"
,
"isParallel"
:
"1"
,
"isParallel"
:
"1"
,
"roleCode"
:
"Digital_Responsing_Plan_
B
"
,
"roleCode"
:
"Digital_Responsing_Plan_
A
"
,
"index"
:
8
"index"
:
8
},
},
{
{
"stepCode"
:
"
9
"
,
"stepCode"
:
"
8
"
,
"stepName"
:
"
确认本体排油已开启
"
,
"stepName"
:
"
驻站消防队指挥权交接
"
,
"stepStatus"
:
"0"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"
OWNER_DRAIN_OIL
"
,
"buttonCode"
:
"
HANDOVER_COMMAND
"
,
"isParallel"
:
"0"
,
"isParallel"
:
"0"
,
"roleCode"
:
"Digital_Responsing_Plan_B"
,
"roleCode"
:
"Digital_Responsing_Plan_B"
,
"index"
:
9
"index"
:
9
},
},
{
{
"stepCode"
:
"10"
,
"stepName"
:
"启动阀厅应急预案"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"START_VALVE_HALL_CONTINGENCY"
,
"isParallel"
:
"0"
,
"roleCode"
:
"Digital_Responsing_Plan_B"
,
"index"
:
10
},
{
"stepCode"
:
"11"
,
"stepName"
:
"电缆沟封堵"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"PLUG_CABLETRENCH"
,
"isParallel"
:
"0"
,
"roleCode"
:
"Digital_Responsing_Plan_B"
,
"index"
:
11
},
{
"stepCode"
:
"12"
,
"stepName"
:
"政府消防队指挥权交接"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"HANDOVER_FIGTHHING"
,
"isParallel"
:
"0"
,
"roleCode"
:
"Digital_Responsing_Plan_B"
,
"index"
:
12
},
{
"stepCode"
:
"13"
,
"stepCode"
:
"13"
,
"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"
:
1
3
"index"
:
1
0
},
},
{
{
"stepCode"
:
"14"
,
"stepCode"
:
"14"
,
...
@@ -132,6 +118,6 @@
...
@@ -132,6 +118,6 @@
"buttonCode"
:
"END_EMERGENCY"
,
"buttonCode"
:
"END_EMERGENCY"
,
"isParallel"
:
"1"
,
"isParallel"
:
"1"
,
"roleCode"
:
"Digital_Responsing_Plan_B"
,
"roleCode"
:
"Digital_Responsing_Plan_B"
,
"index"
:
1
4
"index"
:
1
1
}
}
]
]
\ No newline at end of file
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