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
c3dba51e
Commit
c3dba51e
authored
Feb 02, 2021
by
吴俊凯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug修改提交
parent
401bdb47
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
66 additions
and
23 deletions
+66
-23
PlanOperationRecord.java
.../com/yeejoin/amos/fas/dao/entity/PlanOperationRecord.java
+12
-0
PlanDetailMapper.java
...eejoin/amos/fas/business/dao/mapper/PlanDetailMapper.java
+1
-1
IPlanDocDao.java
...yeejoin/amos/fas/business/dao/repository/IPlanDocDao.java
+4
-0
IPlanEquipmentDao.java
...n/amos/fas/business/dao/repository/IPlanEquipmentDao.java
+3
-1
IPlanRuleDao.java
...eejoin/amos/fas/business/dao/repository/IPlanRuleDao.java
+4
-2
IDutyModeServer.java
.../com/yeejoin/amos/fas/business/feign/IDutyModeServer.java
+3
-3
ContingencyInstanceImpl.java
...os/fas/business/service/impl/ContingencyInstanceImpl.java
+5
-4
ContingencyPlanServiceImpl.java
...fas/business/service/impl/ContingencyPlanServiceImpl.java
+16
-0
RiskSourceServiceImpl.java
...amos/fas/business/service/impl/RiskSourceServiceImpl.java
+11
-11
ReserveEnum.java
...ain/java/com/yeejoin/amos/fas/core/enums/ReserveEnum.java
+4
-1
PlanDetailMapper.xml
...ysStart/src/main/resources/db/mapper/PlanDetailMapper.xml
+3
-0
No files found.
YeeAmosFireAutoSysCommon/src/main/java/com/yeejoin/amos/fas/dao/entity/PlanOperationRecord.java
View file @
c3dba51e
...
@@ -83,5 +83,16 @@ public class PlanOperationRecord extends BasicEntity {
...
@@ -83,5 +83,16 @@ public class PlanOperationRecord extends BasicEntity {
*/
*/
@Column
(
name
=
"equipment_name"
)
@Column
(
name
=
"equipment_name"
)
private
String
equipmentName
;
private
String
equipmentName
;
/**
* 装备id
*/
@Column
(
name
=
"equipment_id"
)
private
Long
equipmentId
;
/**
* 电力装备id
*/
@Column
(
name
=
"fire_equipment_id"
)
private
Long
fireEquipmentId
;
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
}
}
\ No newline at end of file
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/mapper/PlanDetailMapper.java
View file @
c3dba51e
...
@@ -44,5 +44,5 @@ public interface PlanDetailMapper {
...
@@ -44,5 +44,5 @@ public interface PlanDetailMapper {
*/
*/
List
<
PlanDetailVo
>
filterList
(
@Param
(
"planName"
)
String
planName
,
@Param
(
"classifyId"
)
List
<
Long
>
classifyId
,
@Param
(
"planRange"
)
List
<
String
>
planRange
,
@Param
(
"editOrgName"
)
String
editOrgName
,
@Param
(
"implementationTimeLeft"
)
Date
implementationTimeLeft
,
@Param
(
"implementationTimeRight"
)
Date
implementationTimeRight
,
@Param
(
"start"
)
int
start
,
@Param
(
"size"
)
int
size
);
List
<
PlanDetailVo
>
filterList
(
@Param
(
"planName"
)
String
planName
,
@Param
(
"classifyId"
)
List
<
Long
>
classifyId
,
@Param
(
"planRange"
)
List
<
String
>
planRange
,
@Param
(
"editOrgName"
)
String
editOrgName
,
@Param
(
"implementationTimeLeft"
)
Date
implementationTimeLeft
,
@Param
(
"implementationTimeRight"
)
Date
implementationTimeRight
,
@Param
(
"start"
)
int
start
,
@Param
(
"size"
)
int
size
);
String
getRuleIdByEquipment
(
@Param
(
"id"
)
Long
id
);
List
<
String
>
getRuleIdByEquipment
(
@Param
(
"id"
)
Long
id
);
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/repository/IPlanDocDao.java
View file @
c3dba51e
package
com
.
yeejoin
.
amos
.
fas
.
business
.
dao
.
repository
;
package
com
.
yeejoin
.
amos
.
fas
.
business
.
dao
.
repository
;
import
com.yeejoin.amos.fas.dao.entity.PlanDoc
;
import
com.yeejoin.amos.fas.dao.entity.PlanDoc
;
import
org.springframework.data.jpa.repository.Query
;
import
org.springframework.stereotype.Repository
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
import
java.util.List
;
...
@@ -21,4 +22,7 @@ public interface IPlanDocDao extends BaseDao<PlanDoc, Long> {
...
@@ -21,4 +22,7 @@ public interface IPlanDocDao extends BaseDao<PlanDoc, Long> {
List
<
PlanDoc
>
findAllByPlanIdIn
(
List
<
Long
>
planId
);
List
<
PlanDoc
>
findAllByPlanIdIn
(
List
<
Long
>
planId
);
List
<
PlanDoc
>
findAllByIsDelete
(
Boolean
isDelete
);
List
<
PlanDoc
>
findAllByIsDelete
(
Boolean
isDelete
);
@Query
(
value
=
"SELECT * from c_plan_doc where plan_id in (?1) AND is_delete = 0 "
,
nativeQuery
=
true
)
List
<
PlanDoc
>
findAllByPlanId
(
Long
planId
);
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/repository/IPlanEquipmentDao.java
View file @
c3dba51e
...
@@ -20,12 +20,14 @@ public interface IPlanEquipmentDao extends BaseDao<PlanEquipment, Long> {
...
@@ -20,12 +20,14 @@ public interface IPlanEquipmentDao extends BaseDao<PlanEquipment, Long> {
void
deleteByPlanId
(
long
planId
);
void
deleteByPlanId
(
long
planId
);
List
<
PlanEquipment
>
getPlanDocsByPlanId
(
Long
planId
);
List
<
PlanEquipment
>
getPlanDocsByPlanId
(
Long
planId
);
@Query
(
value
=
"SELECT * from c_plan_equipment where plan_id = ?1 AND is_delete = 0 "
,
nativeQuery
=
true
)
List
<
PlanEquipment
>
findByPlanId
(
Long
planId
);
List
<
PlanEquipment
>
findByPlanId
(
Long
planId
);
List
<
PlanEquipment
>
findAllByIsDelete
(
Boolean
isDelete
);
List
<
PlanEquipment
>
findAllByIsDelete
(
Boolean
isDelete
);
List
<
PlanEquipment
>
findAllByPlanIdIn
(
List
<
Long
>
planId
);
List
<
PlanEquipment
>
findAllByPlanIdIn
(
List
<
Long
>
planId
);
@Query
(
value
=
"SELECT * from c_plan_equipment where fire_equipment_id in (?1) AND is_delete = 0 "
,
nativeQuery
=
true
)
List
<
PlanEquipment
>
findAllByFireEquipmentIdIn
(
List
<
Long
>
id
);
List
<
PlanEquipment
>
findAllByFireEquipmentIdIn
(
List
<
Long
>
id
);
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/repository/IPlanRuleDao.java
View file @
c3dba51e
package
com
.
yeejoin
.
amos
.
fas
.
business
.
dao
.
repository
;
package
com
.
yeejoin
.
amos
.
fas
.
business
.
dao
.
repository
;
import
com.yeejoin.amos.fas.dao.entity.PlanDoc
;
import
com.yeejoin.amos.fas.dao.entity.PlanRule
;
import
com.yeejoin.amos.fas.dao.entity.PlanRule
;
import
org.springframework.data.jpa.repository.Query
;
import
org.springframework.stereotype.Repository
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
* <h1><h1>
* <h1><h1>
...
@@ -23,4 +22,7 @@ public interface IPlanRuleDao extends BaseDao<PlanRule, Long>{
...
@@ -23,4 +22,7 @@ public interface IPlanRuleDao extends BaseDao<PlanRule, Long>{
List
<
PlanRule
>
findAllByIsDelete
(
Boolean
isDelete
);
List
<
PlanRule
>
findAllByIsDelete
(
Boolean
isDelete
);
List
<
PlanRule
>
findAllByPlanIdIn
(
List
<
Long
>
planIds
);
List
<
PlanRule
>
findAllByPlanIdIn
(
List
<
Long
>
planIds
);
@Query
(
value
=
"SELECT * from c_plan_rule where plan_id in (?1) AND is_delete = 0 "
,
nativeQuery
=
true
)
List
<
PlanRule
>
findAllByPlanId
(
Long
planId
);
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/feign/IDutyModeServer.java
View file @
c3dba51e
...
@@ -8,8 +8,8 @@ import com.yeejoin.amos.fas.core.util.CommonResponse;
...
@@ -8,8 +8,8 @@ import com.yeejoin.amos.fas.core.util.CommonResponse;
@FeignClient
(
name
=
"${dutyMode.fegin.name}"
,
fallback
=
DutyModeServerFallback
.
class
,
configuration
=
FeignConfiguration
.
class
)
@FeignClient
(
name
=
"${dutyMode.fegin.name}"
,
fallback
=
DutyModeServerFallback
.
class
,
configuration
=
FeignConfiguration
.
class
)
public
interface
IDutyModeServer
{
public
interface
IDutyModeServer
{
@RequestMapping
(
value
=
"/duty/listByDay"
,
method
=
RequestMethod
.
POST
,
consumes
=
"application/json"
)
@RequestMapping
(
value
=
"/duty/
duty/
listByDay"
,
method
=
RequestMethod
.
POST
,
consumes
=
"application/json"
)
public
CommonResponse
dutyListByDay
(
public
CommonResponse
dutyListByDay
(
@RequestHeader
(
name
=
"appKey"
,
required
=
true
)
String
appKey
,
@RequestHeader
(
name
=
"appKey"
,
required
=
true
)
String
appKey
,
@RequestHeader
(
name
=
"product"
,
required
=
true
)
String
product
,
@RequestHeader
(
name
=
"product"
,
required
=
true
)
String
product
,
...
@@ -17,7 +17,7 @@ public interface IDutyModeServer {
...
@@ -17,7 +17,7 @@ public interface IDutyModeServer {
@RequestHeader
(
name
=
"orgCode"
,
required
=
true
)
String
orgCode
,
@RequestHeader
(
name
=
"orgCode"
,
required
=
true
)
String
orgCode
,
@RequestBody
String
param
);
@RequestBody
String
param
);
@RequestMapping
(
value
=
"/duty/dutyListByDate"
,
method
=
RequestMethod
.
POST
,
consumes
=
"application/json"
)
@RequestMapping
(
value
=
"/duty/duty
/duty
ListByDate"
,
method
=
RequestMethod
.
POST
,
consumes
=
"application/json"
)
public
CommonResponse
dutyListByDate
(
public
CommonResponse
dutyListByDate
(
@RequestHeader
(
name
=
"appKey"
,
required
=
true
)
String
appKey
,
@RequestHeader
(
name
=
"appKey"
,
required
=
true
)
String
appKey
,
@RequestHeader
(
name
=
"product"
,
required
=
true
)
String
product
,
@RequestHeader
(
name
=
"product"
,
required
=
true
)
String
product
,
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/ContingencyInstanceImpl.java
View file @
c3dba51e
...
@@ -196,8 +196,9 @@ public class ContingencyInstanceImpl /*extends GenericManagerImpl<ContingencyPla
...
@@ -196,8 +196,9 @@ public class ContingencyInstanceImpl /*extends GenericManagerImpl<ContingencyPla
contingencyRo
.
setEquipmentCode
(
equipment
.
getCode
());
contingencyRo
.
setEquipmentCode
(
equipment
.
getCode
());
String
plan
=
this
.
getNumberPlan
(
Long
.
parseLong
(
contingencyRo
.
getEquipmentId
()));
List
<
String
>
plan
=
this
.
getNumberPlan
(
Long
.
parseLong
(
contingencyRo
.
getEquipmentId
()));
ruleTrigger
.
publish
(
contingencyRo
,
"换流站消防专项预案/"
+
plan
,
ArrayUtils
.
toArray
(
equipment
.
getName
()));
ruleTrigger
.
publish
(
contingencyRo
,
"换流站消防专项预案/"
+
plan
.
get
(
0
),
ArrayUtils
.
toArray
(
equipment
.
getName
()));
publisherPlanLog
(
stepCode
,
buttonCode
,
batchNo
);
publisherPlanLog
(
stepCode
,
buttonCode
,
batchNo
);
}
}
...
@@ -309,8 +310,8 @@ public class ContingencyInstanceImpl /*extends GenericManagerImpl<ContingencyPla
...
@@ -309,8 +310,8 @@ public class ContingencyInstanceImpl /*extends GenericManagerImpl<ContingencyPla
iContingencyOriginalDataDao
.
updateByButtonStep
(
step
,
batchNo
);
iContingencyOriginalDataDao
.
updateByButtonStep
(
step
,
batchNo
);
}
}
public
String
getNumberPlan
(
Long
id
)
{
public
List
<
String
>
getNumberPlan
(
Long
id
)
{
String
ruleId
=
planDetailMapper
.
getRuleIdByEquipment
(
id
);
List
<
String
>
ruleId
=
planDetailMapper
.
getRuleIdByEquipment
(
id
);
return
ruleId
;
return
ruleId
;
}
}
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/ContingencyPlanServiceImpl.java
View file @
c3dba51e
...
@@ -150,6 +150,8 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
...
@@ -150,6 +150,8 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
planOperationRecord
.
setStartUserName
(
vo
.
getUserName
());
planOperationRecord
.
setStartUserName
(
vo
.
getUserName
());
planOperationRecord
.
setEquipmentCode
(
equipmentSpecific
.
getCode
());
planOperationRecord
.
setEquipmentCode
(
equipmentSpecific
.
getCode
());
planOperationRecord
.
setEquipmentName
(
equipmentSpecific
.
getName
());
planOperationRecord
.
setEquipmentName
(
equipmentSpecific
.
getName
());
planOperationRecord
.
setEquipmentId
(
equipmentSpecific
.
getId
());
planOperationRecord
.
setFireEquipmentId
(
equipment
.
getId
());
if
(
ContingencyPlanStatusEnum
.
SIMULATION_START
.
getCode
()
==
vo
.
getStatus
())
{
if
(
ContingencyPlanStatusEnum
.
SIMULATION_START
.
getCode
()
==
vo
.
getStatus
())
{
planOperationRecord
.
setExecutionType
(
ExecutionTypeEnum
.
PLANCHECK
.
getCode
());
planOperationRecord
.
setExecutionType
(
ExecutionTypeEnum
.
PLANCHECK
.
getCode
());
}
else
{
}
else
{
...
@@ -226,6 +228,20 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
...
@@ -226,6 +228,20 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
public
ReserveEnum
runCheck
(
ContingencyPlanParamVo
vo
)
throws
Exception
{
public
ReserveEnum
runCheck
(
ContingencyPlanParamVo
vo
)
throws
Exception
{
if
(
EquipmentRiskTypeEnum
.
HZGJ
.
getCode
().
equals
(
vo
.
getRiskType
())
||
StringUtils
.
isBlank
(
vo
.
getRiskType
()))
{
if
(
EquipmentRiskTypeEnum
.
HZGJ
.
getCode
().
equals
(
vo
.
getRiskType
())
||
StringUtils
.
isBlank
(
vo
.
getRiskType
()))
{
List
<
PlanDoc
>
planDocs
=
planDocDao
.
findAllByPlanId
(
Long
.
valueOf
(
vo
.
getPlanId
()));
if
(
planDocs
.
size
()==
0
){
return
ReserveEnum
.
PLAN_DOC_IS_DELETE
;
}
//判断预案文档是否删除
List
<
PlanRule
>
planRules
=
planRuleDao
.
findAllByPlanId
(
Long
.
valueOf
(
vo
.
getPlanId
()));
if
(
planRules
.
size
()==
0
){
return
ReserveEnum
.
PLAN_RULE_IS_DELETE
;
}
//判断预案文档是否删除
List
<
PlanEquipment
>
planEquipments
=
planEquipmentDao
.
findByPlanId
(
Long
.
valueOf
(
vo
.
getPlanId
()));
if
(
planEquipments
.
size
()==
0
){
return
ReserveEnum
.
PLAN_EQUIP_IS_DELETE
;
}
List
<
PlanOperationRecord
>
recordList
=
planOperationRecordDao
.
findByPlanId1
(
Long
.
valueOf
(
vo
.
getPlanId
()));
List
<
PlanOperationRecord
>
recordList
=
planOperationRecordDao
.
findByPlanId1
(
Long
.
valueOf
(
vo
.
getPlanId
()));
if
(
recordList
.
size
()
>
0
&&
vo
.
getStatus
()!=
ContingencyPlanStatusEnum
.
ONGOING
.
getCode
())
{
if
(
recordList
.
size
()
>
0
&&
vo
.
getStatus
()!=
ContingencyPlanStatusEnum
.
ONGOING
.
getCode
())
{
return
ReserveEnum
.
THISRUNNING
;
return
ReserveEnum
.
THISRUNNING
;
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/RiskSourceServiceImpl.java
View file @
c3dba51e
...
@@ -591,15 +591,15 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -591,15 +591,15 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
}
}
contingencyRo
.
setTelemetryMap
(
telemetryMap
);
contingencyRo
.
setTelemetryMap
(
telemetryMap
);
String
plan
=
this
.
getNumberPlan
(
Long
.
parseLong
(
contingencyRo
.
getEquipmentId
()));
List
<
String
>
plan
=
this
.
getNumberPlan
(
Long
.
parseLong
(
contingencyRo
.
getEquipmentId
()));
log
.
debug
(
"开始调用规则"
);
if
(
plan
.
size
()>
0
){
Object
result
=
ruleTrigger
.
publish
(
contingencyRo
,
equipment
.
getReservePlan
(),
ArrayUtils
.
toArray
(
equipment
.
getName
())
);
log
.
debug
(
"开始调用规则"
);
Object
result
=
ruleTrigger
.
publish
(
contingencyRo
,
"换流站消防专项预案/"
+
plan
.
get
(
0
),
ArrayUtils
.
toArray
(
equipment
.
getName
()));
log
.
debug
(
"规则调用返回=="
,
result
);
log
.
debug
(
"规则调用返回=="
,
result
);
ContingencyOriginalData
contingencyOriginalData
=
new
ContingencyOriginalData
();
ContingencyOriginalData
contingencyOriginalData
=
new
ContingencyOriginalData
(
);
BeanUtils
.
copyProperties
(
contingencyRo
,
contingencyOriginalData
);
BeanUtils
.
copyProperties
(
contingencyRo
,
contingencyOriginalData
);
iContingencyOriginalDataDao
.
save
(
contingencyOriginalData
);
iContingencyOriginalDataDao
.
save
(
contingencyOriginalData
);
}
}
}
...
@@ -1918,8 +1918,8 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
...
@@ -1918,8 +1918,8 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
return
null
;
return
null
;
}
}
public
String
getNumberPlan
(
Long
id
){
public
List
<
String
>
getNumberPlan
(
Long
id
){
String
ruleId
=
planDetailMapper
.
getRuleIdByEquipment
(
id
);
List
<
String
>
ruleId
=
planDetailMapper
.
getRuleIdByEquipment
(
id
);
return
ruleId
;
return
ruleId
;
}
}
}
}
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/core/enums/ReserveEnum.java
View file @
c3dba51e
...
@@ -17,7 +17,10 @@ public enum ReserveEnum {
...
@@ -17,7 +17,10 @@ public enum ReserveEnum {
NOFIRENOPLAN
(
5
,
"非火灾告警没有预案"
),
NOFIRENOPLAN
(
5
,
"非火灾告警没有预案"
),
PLANSTATUSERROR
(
6
,
"预案启动状态不正确"
),
PLANSTATUSERROR
(
6
,
"预案启动状态不正确"
),
NOPLAN
(
7
,
"预案模型未绑定预案"
),
NOPLAN
(
7
,
"预案模型未绑定预案"
),
THISRUNNING
(
8
,
"此预案正在启动中"
);
THISRUNNING
(
8
,
"此预案正在启动中"
),
PLAN_DOC_IS_DELETE
(
9
,
"预案文档已经被删除,无法启动"
),
PLAN_RULE_IS_DELETE
(
10
,
"预案规则已经被删除,无法启动"
),
PLAN_EQUIP_IS_DELETE
(
10
,
"电力设备已经被删除,无法启动"
);
private
Integer
status
;
private
Integer
status
;
private
String
text
;
private
String
text
;
...
...
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/PlanDetailMapper.xml
View file @
c3dba51e
...
@@ -115,5 +115,7 @@
...
@@ -115,5 +115,7 @@
LEFT JOIN f_equipment equipment ON equipment.id = equip.fire_equipment_id
LEFT JOIN f_equipment equipment ON equipment.id = equip.fire_equipment_id
where
where
equipment.id = #{id}
equipment.id = #{id}
AND equip.is_delete != 1
AND rule.is_delete !=1
</select>
</select>
</mapper>
</mapper>
\ 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