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
eca9d81c
Commit
eca9d81c
authored
Oct 25, 2022
by
高建强
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
item:应急处置流程优化
parent
d30cbfff
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
60 additions
and
15 deletions
+60
-15
ContingencyAction.java
...m/yeejoin/amos/fas/business/action/ContingencyAction.java
+3
-2
ContingencyPlanController.java
...os/fas/business/controller/ContingencyPlanController.java
+8
-1
ContingencyInstanceImpl.java
...os/fas/business/service/impl/ContingencyInstanceImpl.java
+26
-9
ContingencyPlanServiceImpl.java
...fas/business/service/impl/ContingencyPlanServiceImpl.java
+12
-2
IContingencyInstance.java
...amos/fas/business/service/intfc/IContingencyInstance.java
+7
-0
IContingencyPlanService.java
...s/fas/business/service/intfc/IContingencyPlanService.java
+4
-1
No files found.
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/action/ContingencyAction.java
View file @
eca9d81c
...
@@ -502,8 +502,9 @@ public class ContingencyAction implements CustomerAction {
...
@@ -502,8 +502,9 @@ public class ContingencyAction implements CustomerAction {
this
.
sendcmd
(
"optionarea"
,
paramObj
,
result
);
this
.
sendcmd
(
"optionarea"
,
paramObj
,
result
);
ContingencyPlanInstance
instance
=
contingencyInstance
.
getMessageById
(
contingencyPlanId
);
ContingencyPlanInstance
instance
=
contingencyInstance
.
getMessageById
(
contingencyPlanId
);
if
(
instance
!=
null
)
{
if
(
instance
!=
null
)
{
ContingencyPlanInstance
planInstance
=
contingencyInstance
.
updateExtendColumn
(
instance
);
// ContingencyPlanInstance planInstance = contingencyInstance.updateExtendColumn(instance);
contingencyPlanInstanceMapper
.
updateMessageById
(
planInstance
);
instance
.
setRoleCode
(
contingencyInstance
.
getPlanStepRoleCodeByButtonCode
(
buttonCode
));
contingencyPlanInstanceMapper
.
updateMessageById
(
instance
);
}
}
MessageVO
messageVO
=
new
MessageVO
();
MessageVO
messageVO
=
new
MessageVO
();
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/ContingencyPlanController.java
View file @
eca9d81c
...
@@ -14,6 +14,7 @@ import io.swagger.annotations.ApiOperation;
...
@@ -14,6 +14,7 @@ import io.swagger.annotations.ApiOperation;
import
io.swagger.annotations.ApiParam
;
import
io.swagger.annotations.ApiParam
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.*
;
import
java.util.*
;
...
@@ -236,7 +237,13 @@ public class ContingencyPlanController extends BaseController {
...
@@ -236,7 +237,13 @@ public class ContingencyPlanController extends BaseController {
@ApiOperation
(
value
=
"获取预案状态"
)
@ApiOperation
(
value
=
"获取预案状态"
)
@RequestMapping
(
value
=
"/getPlanStatus"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/getPlanStatus"
,
method
=
RequestMethod
.
GET
)
public
ResponseModel
getPlanStatus
()
{
public
ResponseModel
getPlanStatus
()
{
return
CommonResponseUtil2
.
success
(
contingencyPlanService
.
getPlanStatus
());
return
CommonResponseUtil2
.
success
(
CollectionUtils
.
isEmpty
(
contingencyPlanService
.
getPlanStatus
()));
}
@ApiOperation
(
value
=
"获取执行预案序列号"
)
@RequestMapping
(
value
=
"/getPlanBatchNo"
,
method
=
RequestMethod
.
GET
)
public
ResponseModel
getPlanBatchNo
()
{
return
CommonResponseUtil2
.
success
(
contingencyPlanService
.
getPlanBatchNo
());
}
}
@ApiOperation
(
value
=
"获取当前登录人待处置任务及预案信息"
)
@ApiOperation
(
value
=
"获取当前登录人待处置任务及预案信息"
)
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/ContingencyInstanceImpl.java
View file @
eca9d81c
...
@@ -365,8 +365,8 @@ public class ContingencyInstanceImpl implements IContingencyInstance {
...
@@ -365,8 +365,8 @@ public class ContingencyInstanceImpl implements IContingencyInstance {
contingencyPlanInstance
.
setContent
(
operateJson
);
contingencyPlanInstance
.
setContent
(
operateJson
);
if
(
buttonState
.
equals
(
"CONFIRM"
))
{
if
(
buttonState
.
equals
(
"CONFIRM"
))
{
contingencyPlanInstance
.
setRunstate
(
true
);
contingencyPlanInstance
.
setRunstate
(
true
);
ContingencyPlanInstance
planInstance
=
contingencyInstance
.
updateExtendColumn
(
contingencyPlanInstance
);
//
ContingencyPlanInstance planInstance = contingencyInstance.updateExtendColumn(contingencyPlanInstance);
BeanUtils
.
copyProperties
(
planInstance
,
contingencyPlanInstance
);
//
BeanUtils.copyProperties(planInstance, contingencyPlanInstance);
String
topic
=
String
.
format
(
"/%s/%s/%s"
,
serviceName
,
stationName
,
"plan"
);
String
topic
=
String
.
format
(
"/%s/%s/%s"
,
serviceName
,
stationName
,
"plan"
);
webMqttComponent
.
publish
(
topic
,
"应急处置执行任务完成提醒"
);
webMqttComponent
.
publish
(
topic
,
"应急处置执行任务完成提醒"
);
}
}
...
@@ -455,13 +455,7 @@ public class ContingencyInstanceImpl implements IContingencyInstance {
...
@@ -455,13 +455,7 @@ 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
();
String
json
=
""
;
List
<
PlanStepJsonVO
>
result
=
getPlanStepJsonVOS
();
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
);
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
<>();
List
<
RoleModel
>
roleModelList
=
new
ArrayList
<>();
...
@@ -490,6 +484,17 @@ public class ContingencyInstanceImpl implements IContingencyInstance {
...
@@ -490,6 +484,17 @@ public class ContingencyInstanceImpl implements IContingencyInstance {
return
contingencyPlanInstance
;
return
contingencyPlanInstance
;
}
}
private
List
<
PlanStepJsonVO
>
getPlanStepJsonVOS
()
{
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
);
return
result
;
}
private
void
sendPlanAlarm
(
String
batchNo
,
String
buttonCode
)
{
private
void
sendPlanAlarm
(
String
batchNo
,
String
buttonCode
)
{
//确警后推送报警数据
//确警后推送报警数据
List
<
FirePlanAlarmBo
>
list
=
new
ArrayList
<
FirePlanAlarmBo
>();
List
<
FirePlanAlarmBo
>
list
=
new
ArrayList
<
FirePlanAlarmBo
>();
...
@@ -550,4 +555,16 @@ public class ContingencyInstanceImpl implements IContingencyInstance {
...
@@ -550,4 +555,16 @@ public class ContingencyInstanceImpl implements IContingencyInstance {
public
ContingencyPlanInstance
getMessageById
(
String
id
)
{
public
ContingencyPlanInstance
getMessageById
(
String
id
)
{
return
contingencyPlanInstanceMapper
.
getMessageById
(
id
);
return
contingencyPlanInstanceMapper
.
getMessageById
(
id
);
}
}
@Override
public
String
getPlanStepRoleCodeByButtonCode
(
String
buttonCode
)
{
if
(
StringUtils
.
isNotBlank
(
buttonCode
))
{
List
<
PlanStepJsonVO
>
result
=
getPlanStepJsonVOS
();
List
<
PlanStepJsonVO
>
collect
=
result
.
stream
().
filter
(
x
->
buttonCode
.
equalsIgnoreCase
(
x
.
getButtonCode
())).
collect
(
Collectors
.
toList
());
if
(!
CollectionUtils
.
isEmpty
(
collect
))
{
return
collect
.
get
(
0
).
getRoleCode
();
}
}
return
null
;
}
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/ContingencyPlanServiceImpl.java
View file @
eca9d81c
...
@@ -841,8 +841,18 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
...
@@ -841,8 +841,18 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
}
}
@Override
@Override
public
Boolean
getPlanStatus
()
{
public
List
<
PlanOperationRecord
>
getPlanStatus
()
{
return
CollectionUtils
.
isEmpty
(
planOperationRecordDao
.
findByStatus
(
0
));
return
planOperationRecordDao
.
findByStatus
(
0
);
// return CollectionUtils.isEmpty(planOperationRecordDao.findByStatus(0));
}
@Override
public
String
getPlanBatchNo
()
{
List
<
PlanOperationRecord
>
records
=
planOperationRecordDao
.
findByStatus
(
0
);
if
(!
CollectionUtils
.
isEmpty
(
records
))
{
return
records
.
get
(
0
).
getBatchNo
();
}
return
""
;
}
}
@Override
@Override
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/IContingencyInstance.java
View file @
eca9d81c
...
@@ -38,4 +38,11 @@ public interface IContingencyInstance {
...
@@ -38,4 +38,11 @@ public interface IContingencyInstance {
* @return
* @return
*/
*/
ContingencyPlanInstance
getMessageById
(
String
id
);
ContingencyPlanInstance
getMessageById
(
String
id
);
/**
* 通过buttonCode获取执行角色编码
* @param buttonCode
* @return
*/
String
getPlanStepRoleCodeByButtonCode
(
String
buttonCode
);
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/IContingencyPlanService.java
View file @
eca9d81c
...
@@ -6,6 +6,7 @@ import com.yeejoin.amos.fas.business.vo.ContingencyPlanResponseVo;
...
@@ -6,6 +6,7 @@ import com.yeejoin.amos.fas.business.vo.ContingencyPlanResponseVo;
import
com.yeejoin.amos.fas.business.vo.PlanDetailVo
;
import
com.yeejoin.amos.fas.business.vo.PlanDetailVo
;
import
com.yeejoin.amos.fas.business.vo.Toke
;
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.exception.YeeException
;
import
com.yeejoin.amos.fas.exception.YeeException
;
import
com.yeejoin.amos.feign.privilege.model.RoleModel
;
import
com.yeejoin.amos.feign.privilege.model.RoleModel
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
...
@@ -136,7 +137,9 @@ public interface IContingencyPlanService {
...
@@ -136,7 +137,9 @@ public interface IContingencyPlanService {
AtomicBoolean
planReset
();
AtomicBoolean
planReset
();
Boolean
getPlanStatus
();
List
<
PlanOperationRecord
>
getPlanStatus
();
Map
<
String
,
Object
>
getUserOperateCountAndPlanName
(
List
<
RoleModel
>
roleModelList
);
Map
<
String
,
Object
>
getUserOperateCountAndPlanName
(
List
<
RoleModel
>
roleModelList
);
String
getPlanBatchNo
();
}
}
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