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
b62157bf
Commit
b62157bf
authored
May 10, 2023
by
KeYong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新
parent
0681b859
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
185 additions
and
96 deletions
+185
-96
ContingencyAction.java
...m/yeejoin/amos/fas/business/action/ContingencyAction.java
+7
-0
ContingencyInstanceInfoMapper.java
...as/business/dao/mapper/ContingencyInstanceInfoMapper.java
+2
-0
BizContingencyHandler.java
...eejoin/amos/fas/business/event/BizContingencyHandler.java
+1
-1
JcsFeign.java
...in/java/com/yeejoin/amos/fas/business/feign/JcsFeign.java
+3
-0
ContingencyInstanceImpl.java
...os/fas/business/service/impl/ContingencyInstanceImpl.java
+44
-39
PlanVisual3dServiceImpl.java
...os/fas/business/service/impl/PlanVisual3dServiceImpl.java
+87
-56
IPlanVisual3dService.java
...amos/fas/business/service/intfc/IPlanVisual3dService.java
+2
-0
ContingencyInstanceInfoMapper.xml
...ain/resources/db/mapper/ContingencyInstanceInfoMapper.xml
+39
-0
No files found.
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/action/ContingencyAction.java
View file @
b62157bf
package
com
.
yeejoin
.
amos
.
fas
.
business
.
action
;
package
com
.
yeejoin
.
amos
.
fas
.
business
.
action
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.yeejoin.amos.component.rule.MethodParam
;
import
com.yeejoin.amos.component.rule.MethodParam
;
...
@@ -387,6 +388,12 @@ public class ContingencyAction implements CustomerAction {
...
@@ -387,6 +388,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
));
}
}
}
}
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/mapper/ContingencyInstanceInfoMapper.java
View file @
b62157bf
...
@@ -36,6 +36,8 @@ public interface ContingencyInstanceInfoMapper extends BaseMapper<ContingencyIns
...
@@ -36,6 +36,8 @@ public interface ContingencyInstanceInfoMapper extends BaseMapper<ContingencyIns
List
<
ContingencyPlanInstanceVO
>
selectTaskActionList
(
@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
);
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
);
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/event/BizContingencyHandler.java
View file @
b62157bf
...
@@ -225,7 +225,7 @@ public class BizContingencyHandler implements EventHandler{
...
@@ -225,7 +225,7 @@ public class BizContingencyHandler implements EventHandler{
if
(
redisTemplate
.
hasKey
(
"planTask"
))
{
if
(
redisTemplate
.
hasKey
(
"planTask"
))
{
planTask
=
Objects
.
requireNonNull
(
redisTemplate
.
opsForValue
().
get
(
"planTask"
)).
toString
();
planTask
=
Objects
.
requireNonNull
(
redisTemplate
.
opsForValue
().
get
(
"planTask"
)).
toString
();
}
else
{
}
else
{
List
<
ContingencyPlanInstanceVO
>
list
=
planVisual3dService
.
selectTaskActionList
(
batchNo
,
null
,
1
);
List
<
ContingencyPlanInstanceVO
>
list
=
planVisual3dService
.
getTaskActionList
(
batchNo
,
1
);
if
(
0
<
list
.
size
())
{
if
(
0
<
list
.
size
())
{
planTask
=
JSON
.
toJSONString
(
list
);
planTask
=
JSON
.
toJSONString
(
list
);
}
}
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/feign/JcsFeign.java
View file @
b62157bf
...
@@ -40,4 +40,7 @@ public interface JcsFeign {
...
@@ -40,4 +40,7 @@ public interface JcsFeign {
@RequestMapping
(
value
=
"/jcs//org-person/listCompanyByIds"
,
method
=
RequestMethod
.
GET
,
consumes
=
"application/json"
)
@RequestMapping
(
value
=
"/jcs//org-person/listCompanyByIds"
,
method
=
RequestMethod
.
GET
,
consumes
=
"application/json"
)
List
<
Object
>
listCompanyByIds
(
@RequestParam
List
<
Long
>
ids
);
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 @
b62157bf
...
@@ -17,6 +17,7 @@ import com.yeejoin.amos.fas.business.dao.repository.IContingencyPlanInstanceRepo
...
@@ -17,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
;
...
@@ -24,6 +25,7 @@ import com.yeejoin.amos.fas.business.service.model.OperateGroup;
...
@@ -24,6 +25,7 @@ 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
;
...
@@ -138,6 +140,12 @@ public class ContingencyInstanceImpl implements IContingencyInstance {
...
@@ -138,6 +140,12 @@ public class ContingencyInstanceImpl implements IContingencyInstance {
@Autowired
@Autowired
private
ApplicationEventPublisher
applicationContext
;
private
ApplicationEventPublisher
applicationContext
;
@Autowired
private
EmergencyTaskServiceImpl
emergencyTaskService
;
@Autowired
JcsFeign
jcsFeign
;
/**
/**
* 创建预案执行记录
* 创建预案执行记录
*
*
...
@@ -505,19 +513,6 @@ public class ContingencyInstanceImpl implements IContingencyInstance {
...
@@ -505,19 +513,6 @@ public class ContingencyInstanceImpl implements IContingencyInstance {
instance
.
setContent
(
instance
.
getCategory
());
instance
.
setContent
(
instance
.
getCategory
());
ContingencyPlanInstance
res
=
repository
.
save
(
instance
);
ContingencyPlanInstance
res
=
repository
.
save
(
instance
);
if
(!
ObjectUtils
.
isEmpty
(
res
))
{
if
(!
ObjectUtils
.
isEmpty
(
res
))
{
List
<
String
>
models
=
new
ArrayList
<>();
models
.
add
(
instance
.
getRoleCode
());
List
<
ContingencyPlanInstanceVO
>
list
=
planVisual3dService
.
selectTaskActionList
(
instance
.
getBatchNo
(),
models
,
1
);
if
(
redisTemplate
.
hasKey
(
"planTask"
))
{
redisTemplate
.
delete
(
"planTask"
);
String
planTask
=
""
;
List
<
ContingencyPlanInstanceVO
>
arr
=
list
.
stream
().
filter
(
x
->
!
x
.
getId
().
equalsIgnoreCase
(
contingencyPlanId
)).
collect
(
Collectors
.
toList
());
if
(
0
<
list
.
size
())
{
planTask
=
JSON
.
toJSONString
(
arr
);
}
JSONArray
taskObjects
=
JSON
.
parseArray
(
planTask
);
redisTemplate
.
opsForValue
().
set
(
"planTask"
,
taskObjects
);
}
if
(
0
<
strs
.
size
())
{
if
(
0
<
strs
.
size
())
{
PlanExecuteVo
vo
=
new
PlanExecuteVo
();
PlanExecuteVo
vo
=
new
PlanExecuteVo
();
vo
.
setConfirm
(
buttonState
);
vo
.
setConfirm
(
buttonState
);
...
@@ -562,7 +557,7 @@ public class ContingencyInstanceImpl implements IContingencyInstance {
...
@@ -562,7 +557,7 @@ public class ContingencyInstanceImpl implements IContingencyInstance {
if
(
redisTemplate
.
hasKey
(
"planTask"
))
{
if
(
redisTemplate
.
hasKey
(
"planTask"
))
{
planTask
=
Objects
.
requireNonNull
(
redisTemplate
.
opsForValue
().
get
(
"planTask"
)).
toString
();
planTask
=
Objects
.
requireNonNull
(
redisTemplate
.
opsForValue
().
get
(
"planTask"
)).
toString
();
}
else
{
}
else
{
List
<
ContingencyPlanInstanceVO
>
lists
=
planVisual3dService
.
selectTaskActionList
(
batchNo
,
models
,
1
);
List
<
ContingencyPlanInstanceVO
>
lists
=
planVisual3dService
.
getTaskActionList
(
batchNo
,
1
);
if
(
0
<
list
.
size
())
{
if
(
0
<
list
.
size
())
{
planTask
=
JSON
.
toJSONString
(
lists
);
planTask
=
JSON
.
toJSONString
(
lists
);
}
}
...
@@ -611,37 +606,47 @@ public class ContingencyInstanceImpl implements IContingencyInstance {
...
@@ -611,37 +606,47 @@ 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
=
""
;
if
(
"SUCCESS"
.
equals
(
responseModel
.
getDevMessage
()))
{
img
=
JSON
.
toJSONString
(
responseModel
.
getResult
()).
replace
(
"\""
,
""
);
}
}
img
=
StringUtils
.
isEmpty
(
img
)
?
personImg
:
img
;
contingencyPlanInstance
.
setPersonImg
(
img
);
}
}
return
contingencyPlanInstance
;
return
contingencyPlanInstance
;
}
}
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/PlanVisual3dServiceImpl.java
View file @
b62157bf
This diff is collapsed.
Click to expand it.
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/IPlanVisual3dService.java
View file @
b62157bf
...
@@ -107,6 +107,8 @@ public interface IPlanVisual3dService {
...
@@ -107,6 +107,8 @@ public interface IPlanVisual3dService {
List
<
ContingencyPlanInstanceVO
>
selectTaskActionList
(
String
batchNo
,
List
<
String
>
roleModelList
,
int
dataType
);
List
<
ContingencyPlanInstanceVO
>
selectTaskActionList
(
String
batchNo
,
List
<
String
>
roleModelList
,
int
dataType
);
List
<
ContingencyPlanInstanceVO
>
getTaskActionList
(
String
batchNo
,
int
dataType
);
/**
/**
* 极光推送消息
* 极光推送消息
*
*
...
...
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/ContingencyInstanceInfoMapper.xml
View file @
b62157bf
...
@@ -266,6 +266,45 @@
...
@@ -266,6 +266,45 @@
ORDER BY tmp.create_date ASC
ORDER BY tmp.create_date ASC
</select>
</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
id=
"countTaskPage"
resultType=
"java.lang.Integer"
>
select sum(tmpcount) from
select sum(tmpcount) from
( select count(1) AS tmpcount from contingency_plan_instance
( select count(1) AS tmpcount from contingency_plan_instance
...
...
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