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
2f292c3f
Commit
2f292c3f
authored
Aug 30, 2022
by
高建强
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
item:修改根据批次号更新预案步骤按钮的状态接口
parent
c47c8202
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
190 additions
and
46 deletions
+190
-46
ContingencyAction.java
...m/yeejoin/amos/fas/business/action/ContingencyAction.java
+6
-1
PlanVisual3dController.java
.../amos/fas/business/controller/PlanVisual3dController.java
+13
-12
IContingencyPlanInstanceRepository.java
...ss/dao/repository/IContingencyPlanInstanceRepository.java
+3
-0
ContingencyInstanceImpl.java
...os/fas/business/service/impl/ContingencyInstanceImpl.java
+10
-1
PlanRuleServiceImpl.java
...n/amos/fas/business/service/impl/PlanRuleServiceImpl.java
+40
-0
PlanVisual3dServiceImpl.java
...os/fas/business/service/impl/PlanVisual3dServiceImpl.java
+12
-20
IPlanRuleService.java
...oin/amos/fas/business/service/intfc/IPlanRuleService.java
+8
-0
IPlanVisual3dService.java
...amos/fas/business/service/intfc/IPlanVisual3dService.java
+3
-8
PlanStepVo.java
...ain/java/com/yeejoin/amos/fas/business/vo/PlanStepVo.java
+2
-4
plan-step.json
...osFireAutoSysStart/src/main/resources/json/plan-step.json
+93
-0
No files found.
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/action/ContingencyAction.java
View file @
2f292c3f
...
...
@@ -119,6 +119,9 @@ public class ContingencyAction implements CustomerAction {
@Autowired
private
PlanDetailMapper
planDetailMapper
;
@Autowired
private
IPlanRuleService
planRuleService
;
@Value
(
"${rocket-plan-topic}"
)
private
String
rocketTopic
;
...
...
@@ -971,7 +974,9 @@ public class ContingencyAction implements CustomerAction {
result
.
add
(
tempmap1
);
//数字预案业务屏web端发送消息
this
.
sendweb
(
"recordarea"
,
contingencyRo
,
result
);
updateNumberPlan
(
contingencyRo
.
getBatchNo
());
updateNumberPlan
(
batchNo
);
// 应急处置中断,初始化planStep,json数据
planRuleService
.
updatePlanRuleByBatchNo
(
batchNo
);
}
/**
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/PlanVisual3dController.java
View file @
2f292c3f
...
...
@@ -2,6 +2,7 @@ package com.yeejoin.amos.fas.business.controller;
import
com.yeejoin.amos.fas.business.service.intfc.IPlanVisual3dService
;
import
com.yeejoin.amos.fas.business.util.StringUtil
;
import
com.yeejoin.amos.fas.business.vo.PlanStepVo
;
import
com.yeejoin.amos.fas.config.Permission
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.core.util.CommonResponseUtil
;
...
...
@@ -128,24 +129,24 @@ public class PlanVisual3dController extends BaseController {
List
<
Map
<
String
,
Object
>>
list
=
planVisual3dService
.
getResourceById
(
type
,
id
);
return
CommonResponseUtil
.
success
(
list
);
}
@Permission
@ApiOperation
(
value
=
"预案应用树"
,
notes
=
"预案应用树"
)
@GetMapping
(
value
=
"/plan/textPlanTree/{appId}"
)
public
CommonResponse
getPlanTree
(
@PathVariable
(
"appId"
)
String
appId
)
{
return
CommonResponseUtil
.
success
(
planVisual3dService
.
getTextPlanBySubjectId
(
appId
));
}
@Permission
@ApiOperation
(
value
=
"删除预案文件"
,
notes
=
"删除预案文件"
)
@DeleteMapping
(
value
=
"/plan/textPlan/{id}"
)
public
CommonResponse
deleteTextPlanFile
(
@PathVariable
(
"id"
)
Long
id
)
{
try
{
planVisual3dService
.
deleteTextPlanFile
(
id
);
return
CommonResponseUtil
.
success
();
}
catch
(
Exception
e
)
{
return
CommonResponseUtil
.
failure
(
e
.
getMessage
());
}
try
{
planVisual3dService
.
deleteTextPlanFile
(
id
);
return
CommonResponseUtil
.
success
();
}
catch
(
Exception
e
)
{
return
CommonResponseUtil
.
failure
(
e
.
getMessage
());
}
}
@Permission
...
...
@@ -162,10 +163,10 @@ public class PlanVisual3dController extends BaseController {
}
@Permission
@ApiOperation
(
value
=
"根据批次号更新预案
步骤按钮的状态"
,
notes
=
"根据批次号更新预案步骤按钮的状态
"
)
@
GetMapping
(
value
=
"/plan/updatePlanStepStatus
"
)
public
ResponseModel
updatePlanStep
Status
(
@RequestParam
(
"batchNo"
)
String
batchNo
,
@RequestParam
(
"buttonCode"
)
String
buttonCode
,
@RequestParam
(
"status"
)
String
status
)
{
return
CommonResponseUtil
.
successNew
(
planVisual3dService
.
updatePlanStep
Status
(
batchNo
,
buttonCode
,
status
));
@ApiOperation
(
value
=
"根据批次号更新预案
的步骤"
,
notes
=
"根据批次号更新预案的步骤
"
)
@
PostMapping
(
value
=
"/plan/updatePlanStep
"
)
public
ResponseModel
updatePlanStep
(
@RequestBody
PlanStepVo
planStepVo
)
{
return
CommonResponseUtil
.
successNew
(
planVisual3dService
.
updatePlanStep
(
planStepVo
));
}
@Permission
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/repository/IContingencyPlanInstanceRepository.java
View file @
2f292c3f
...
...
@@ -81,4 +81,7 @@ public interface IContingencyPlanInstanceRepository extends BaseDao<ContingencyP
" ORDER BY"
+
" t.create_date DESC limit 1"
,
nativeQuery
=
true
)
String
queryRecordOne
(
String
batchNo
,
String
recordType
);
@Query
(
value
=
"SELECT * FROM `contingency_plan_instance` WHERE batch_no = ?1"
,
nativeQuery
=
true
)
List
<
ContingencyPlanInstance
>
findByBatchNo
(
String
batchNo
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/ContingencyInstanceImpl.java
View file @
2f292c3f
...
...
@@ -8,6 +8,7 @@ import java.util.List;
import
java.util.Map
;
import
java.util.Optional
;
import
com.yeejoin.amos.fas.business.service.intfc.IPlanRuleService
;
import
com.yeejoin.amos.fas.datasync.bo.ContingencyOriginalDataSyncBo
;
import
org.apache.commons.lang3.ArrayUtils
;
import
org.apache.commons.lang3.StringUtils
;
...
...
@@ -92,6 +93,9 @@ public class ContingencyInstanceImpl /*extends GenericManagerImpl<ContingencyPla
@Autowired
private
ContingencyOriginalMapper
contingencyOriginalMapper
;
@Autowired
private
IPlanRuleService
planRuleService
;
private
static
Map
<
String
,
String
>
stepMap
=
new
HashMap
<>();
...
...
@@ -313,8 +317,13 @@ public class ContingencyInstanceImpl /*extends GenericManagerImpl<ContingencyPla
if
(
"CONFIRM"
.
equals
(
buttonState
))
{
if
(
code
.
equals
(
operate
.
getCode
()))
{
operate
.
setState
(
"executed"
);
if
(
"FIRE_CANCEL"
.
equals
(
code
)
||
"END_EMERGENCY"
.
equals
(
code
))
if
(
"FIRE_CANCEL"
.
equals
(
code
)
||
"END_EMERGENCY"
.
equals
(
code
))
{
redisTemplate
.
delete
(
RiskSourceServiceImpl
.
cacheKeyForCanBeRunning
());
}
if
(
"END_EMERGENCY"
.
equals
(
code
))
{
// 应急处置中断,初始化planStep,json数据
planRuleService
.
updatePlanRuleByBatchNo
(
batchNo
);
}
}
else
{
operate
.
setState
(
"disable"
);
}
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/PlanRuleServiceImpl.java
0 → 100644
View file @
2f292c3f
package
com
.
yeejoin
.
amos
.
fas
.
business
.
service
.
impl
;
import
com.yeejoin.amos.fas.business.dao.mapper.PlanOperationRecordMapper
;
import
com.yeejoin.amos.fas.business.dao.repository.IPlanRuleDao
;
import
com.yeejoin.amos.fas.business.service.intfc.IPlanRuleService
;
import
com.yeejoin.amos.fas.dao.entity.PlanRule
;
import
org.apache.commons.io.IOUtils
;
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
java.io.IOException
;
import
java.nio.charset.StandardCharsets
;
@Service
public
class
PlanRuleServiceImpl
implements
IPlanRuleService
{
@Autowired
private
IPlanRuleDao
planRuleDao
;
@Autowired
private
PlanOperationRecordMapper
planOperationRecordMapper
;
@Value
(
"classpath:/json/plan-step.json"
)
private
Resource
planStepResource
;
@Override
public
void
updatePlanRuleByBatchNo
(
String
batchNo
)
{
try
{
// 根据批次号查询预案步骤
PlanRule
planRule
=
planOperationRecordMapper
.
getPlanRuleByBatchNo
(
batchNo
);
String
json
=
IOUtils
.
toString
(
planStepResource
.
getInputStream
(),
String
.
valueOf
(
StandardCharsets
.
UTF_8
));
planRule
.
setPlanStep
(
json
);
planRuleDao
.
save
(
planRule
);
}
catch
(
IOException
e
)
{
throw
new
RuntimeException
(
"初始化预案规则planStep数据失败!"
);
}
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/PlanVisual3dServiceImpl.java
View file @
2f292c3f
...
...
@@ -21,10 +21,7 @@ import com.yeejoin.amos.fas.business.vo.PlanStepVo;
import
com.yeejoin.amos.fas.business.vo.TreeSubjectVo
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.core.util.CommonResponseUtil
;
import
com.yeejoin.amos.fas.dao.entity.ContingencyOriginalData
;
import
com.yeejoin.amos.fas.dao.entity.Dict
;
import
com.yeejoin.amos.fas.dao.entity.PlanRule
;
import
com.yeejoin.amos.fas.dao.entity.TextPlan
;
import
com.yeejoin.amos.fas.dao.entity.*
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -274,7 +271,13 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService {
msgContext
.
put
(
"currentStep"
,
contingencyOriginalData
.
getStep
());
msgContext
.
put
(
"confirm"
,
contingencyOriginalData
.
getConfirm
());
msgContext
.
put
(
"createDate"
,
contingencyOriginalData
.
getCreateDate
());
msgContext
.
put
(
"batchNo"
,
contingencyOriginalData
.
getBatchNo
());
List
<
ContingencyPlanInstance
>
list
=
contingencyPlanInstanceRepository
.
findByBatchNo
(
batchNo
);
if
(!
CollectionUtils
.
isEmpty
(
list
))
{
List
<
ContingencyPlanInstance
>
collect
=
list
.
stream
().
filter
(
x
->
"OPERATE"
.
equals
(
x
.
getRecordType
())).
collect
(
Collectors
.
toList
());
if
(!
CollectionUtils
.
isEmpty
(
collect
))
{
msgContext
.
put
(
"caseId"
,
collect
.
get
(
0
).
getId
());
}
}
toipResponse
.
setMsgType
(
"steparea"
);
toipResponse
.
setMsgContext
(
msgContext
);
toipResponse
.
setContingency
(
contingencyOriginalData
);
...
...
@@ -315,21 +318,10 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService {
@Override
@Transactional
public
ToipResponse
updatePlanStepStatus
(
String
batchNo
,
String
buttonCode
,
String
status
)
{
ToipResponse
toipResponse
=
new
ToipResponse
();
public
PlanRule
updatePlanStep
(
PlanStepVo
planStepVo
)
{
// 根据批次号查询预案步骤
PlanRule
planRule
=
planOperationRecordMapper
.
getPlanRuleByBatchNo
(
batchNo
);
String
planStep
=
planRule
.
getPlanStep
();
if
(
StringUtil
.
isNotEmpty
(
planStep
))
{
List
<
PlanStepVo
>
list
=
JSON
.
parseArray
(
planStep
,
PlanStepVo
.
class
);
List
<
PlanStepVo
>
collect
=
list
.
stream
().
peek
(
x
->
{
if
(
StringUtils
.
isNotBlank
(
buttonCode
)
&&
buttonCode
.
equalsIgnoreCase
(
x
.
getButtonCode
()))
{
x
.
setStepStatus
(
status
);
}
}).
collect
(
Collectors
.
toList
());
planRule
.
setPlanStep
(
JSON
.
toJSONString
(
collect
));
planRuleDao
.
save
(
planRule
);
}
return
toipResponse
;
PlanRule
planRule
=
planOperationRecordMapper
.
getPlanRuleByBatchNo
(
planStepVo
.
getBatchNo
());
planRule
.
setPlanStep
(
planStepVo
.
getPlanStep
());
return
planRuleDao
.
save
(
planRule
);
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/IPlanRuleService.java
0 → 100644
View file @
2f292c3f
package
com
.
yeejoin
.
amos
.
fas
.
business
.
service
.
intfc
;
import
com.yeejoin.amos.fas.dao.entity.PlanRule
;
public
interface
IPlanRuleService
{
void
updatePlanRuleByBatchNo
(
String
batchNo
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/IPlanVisual3dService.java
View file @
2f292c3f
package
com
.
yeejoin
.
amos
.
fas
.
business
.
service
.
intfc
;
import
com.yeejoin.amos.fas.business.service.model.ToipResponse
;
import
com.yeejoin.amos.fas.business.vo.PlanStepVo
;
import
com.yeejoin.amos.fas.business.vo.TreeSubjectVo
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.dao.entity.PlanRule
;
import
com.yeejoin.amos.fas.dao.entity.TextPlan
;
import
java.util.List
;
...
...
@@ -69,12 +71,5 @@ public interface IPlanVisual3dService {
*/
ToipResponse
getPlaneRecordOneByBatchNo
(
String
batchNo
);
/**
* 根据批次号更新预案步骤按钮的状态
* @param batchNo 批次号
* @param buttonCode 按钮编码
* @param status 按钮状态:0-点击,1-已执行,2-点击未执行
* @return ToipResponse
*/
ToipResponse
updatePlanStepStatus
(
String
batchNo
,
String
buttonCode
,
String
status
);
PlanRule
updatePlanStep
(
PlanStepVo
planStepVo
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/vo/PlanStepVo.java
View file @
2f292c3f
...
...
@@ -5,8 +5,6 @@ import lombok.Data;
@Data
public
class
PlanStepVo
{
private
String
stepCode
;
private
String
stepName
;
private
String
stepStatus
;
private
String
buttonCode
;
private
String
batchNo
;
private
String
planStep
;
}
YeeAmosFireAutoSysStart/src/main/resources/json/plan-step.json
0 → 100644
View file @
2f292c3f
[
{
"stepCode"
:
"0"
,
"stepName"
:
"确认灾情"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"FIRE_CONFIRM"
},
{
"stepCode"
:
"1"
,
"stepName"
:
"停运换流阀"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"STOP_COMMUTATION"
},
{
"stepCode"
:
"2"
,
"stepName"
:
"拨打报警电话"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"CALL_PHONE"
},
{
"stepCode"
:
"3"
,
"stepName"
:
"确认油枕排油系统已开启"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"DRAIN_OIL_CONFIRM"
},
{
"stepCode"
:
"4"
,
"stepName"
:
"确认水喷雾系统已开启"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"OPEN_WATERSYSTEM"
},
{
"stepCode"
:
"5"
,
"stepName"
:
"断开上级电源"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"OFF_POWER"
},
{
"stepCode"
:
"6"
,
"stepName"
:
"停运阀厅空调系统"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"STOP_AIRCON"
},
{
"stepCode"
:
"7"
,
"stepName"
:
"一键开启消防炮"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"MONITOR_START"
},
{
"stepCode"
:
"8"
,
"stepName"
:
"驻站消防队指挥权交接"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"HANDOVER_COMMAND"
},
{
"stepCode"
:
"9"
,
"stepName"
:
"确认本体排油已开启"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"OWNER_DRAIN_OIL"
},
{
"stepCode"
:
"10"
,
"stepName"
:
"启动阀厅应急预案"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"START_VALVE_HALL_CONTINGENCY"
},
{
"stepCode"
:
"11"
,
"stepName"
:
"电缆沟封堵"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"PLUG_CABLETRENCH"
},
{
"stepCode"
:
"12"
,
"stepName"
:
"政府消防队指挥权交接"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"HANDOVER_FIGTHHING"
},
{
"stepCode"
:
"13"
,
"stepName"
:
"确认明火扑灭"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"FIRE_EXTINCT"
},
{
"stepCode"
:
"14"
,
"stepName"
:
"应急处置结束"
,
"stepStatus"
:
"0"
,
"buttonCode"
:
"END_EMERGENCY"
}
]
\ 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