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
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
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.yeejoin.amos.component.rule.MethodParam
;
...
...
@@ -387,6 +388,12 @@ public class ContingencyAction implements CustomerAction {
result
.
add
(
tempmap1
);
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
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
);
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{
if
(
redisTemplate
.
hasKey
(
"planTask"
))
{
planTask
=
Objects
.
requireNonNull
(
redisTemplate
.
opsForValue
().
get
(
"planTask"
)).
toString
();
}
else
{
List
<
ContingencyPlanInstanceVO
>
list
=
planVisual3dService
.
selectTaskActionList
(
batchNo
,
null
,
1
);
List
<
ContingencyPlanInstanceVO
>
list
=
planVisual3dService
.
getTaskActionList
(
batchNo
,
1
);
if
(
0
<
list
.
size
())
{
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 {
@RequestMapping
(
value
=
"/jcs//org-person/listCompanyByIds"
,
method
=
RequestMethod
.
GET
,
consumes
=
"application/json"
)
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
import
com.yeejoin.amos.fas.business.event.ContingecyExecEvent
;
import
com.yeejoin.amos.fas.business.event.EventHandler
;
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.service.intfc.*
;
import
com.yeejoin.amos.fas.business.service.model.Operate
;
...
...
@@ -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.vo.*
;
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.ContingencyPlanInstance
;
import
com.yeejoin.amos.fas.dao.entity.Equipment
;
...
...
@@ -138,6 +140,12 @@ public class ContingencyInstanceImpl implements IContingencyInstance {
@Autowired
private
ApplicationEventPublisher
applicationContext
;
@Autowired
private
EmergencyTaskServiceImpl
emergencyTaskService
;
@Autowired
JcsFeign
jcsFeign
;
/**
* 创建预案执行记录
*
...
...
@@ -505,19 +513,6 @@ public class ContingencyInstanceImpl implements IContingencyInstance {
instance
.
setContent
(
instance
.
getCategory
());
ContingencyPlanInstance
res
=
repository
.
save
(
instance
);
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
())
{
PlanExecuteVo
vo
=
new
PlanExecuteVo
();
vo
.
setConfirm
(
buttonState
);
...
...
@@ -562,7 +557,7 @@ public class ContingencyInstanceImpl implements IContingencyInstance {
if
(
redisTemplate
.
hasKey
(
"planTask"
))
{
planTask
=
Objects
.
requireNonNull
(
redisTemplate
.
opsForValue
().
get
(
"planTask"
)).
toString
();
}
else
{
List
<
ContingencyPlanInstanceVO
>
lists
=
planVisual3dService
.
selectTaskActionList
(
batchNo
,
models
,
1
);
List
<
ContingencyPlanInstanceVO
>
lists
=
planVisual3dService
.
getTaskActionList
(
batchNo
,
1
);
if
(
0
<
list
.
size
())
{
planTask
=
JSON
.
toJSONString
(
lists
);
}
...
...
@@ -611,37 +606,47 @@ public class ContingencyInstanceImpl implements IContingencyInstance {
FeignClientResult
<
AgencyUserModel
>
feignClientResult
=
Privilege
.
agencyUserClient
.
getme
();
AgencyUserModel
user
=
(
AgencyUserModel
)
feignClientResult
.
getResult
();
List
<
PlanStepJsonVO
>
result
=
planStepService
.
getPlanStepJsonVOS
();
List
<
String
>
roleCode
=
result
.
stream
().
map
(
PlanStepJsonVO:
:
getRoleCode
).
distinct
().
collect
(
Collectors
.
toList
());
// List<PlanStepJsonVO> result = planStepService.getPlanStepJsonVOS();
// 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
.
setRoleName
(
String
.
join
(
"-"
,
roleNameList
));
contingencyPlanInstance
.
setStartUserId
(
user
.
getUserId
());
contingencyPlanInstance
.
setStartUserName
(
user
.
getRealName
());
Map
<
String
,
String
>
userInfo
=
contingencyPlanInstanceMapper
.
getUserByUserId
(
user
.
getUserId
());
if
(!
ObjectUtils
.
isEmpty
(
userInfo
))
{
String
img
=
userInfo
.
get
(
"personImg"
);
contingencyPlanInstance
.
setPersonImg
(
StringUtils
.
isBlank
(
img
)
?
personImg
:
img
);
}
else
{
contingencyPlanInstance
.
setPersonImg
(
personImg
);
ResponseModel
responseModel
=
null
;
try
{
responseModel
=
jcsFeign
.
getPersonImage
(
user
.
getUserId
());
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
String
img
=
""
;
if
(
"SUCCESS"
.
equals
(
responseModel
.
getDevMessage
()))
{
img
=
JSON
.
toJSONString
(
responseModel
.
getResult
()).
replace
(
"\""
,
""
);
}
img
=
StringUtils
.
isEmpty
(
img
)
?
personImg
:
img
;
contingencyPlanInstance
.
setPersonImg
(
img
);
}
return
contingencyPlanInstance
;
}
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/PlanVisual3dServiceImpl.java
View file @
b62157bf
...
...
@@ -11,6 +11,7 @@ import com.yeejoin.amos.fas.business.action.mq.WebMqttComponent;
import
com.yeejoin.amos.fas.business.constants.FasConstant
;
import
com.yeejoin.amos.fas.business.dao.mapper.*
;
import
com.yeejoin.amos.fas.business.dao.repository.*
;
import
com.yeejoin.amos.fas.business.feign.JcsFeign
;
import
com.yeejoin.amos.fas.business.feign.PrivilegeFeign
;
import
com.yeejoin.amos.fas.business.feign.RemoteSecurityService
;
import
com.yeejoin.amos.fas.business.service.intfc.IDictService
;
...
...
@@ -23,8 +24,8 @@ import com.yeejoin.amos.fas.business.vo.*;
import
com.yeejoin.amos.fas.common.enums.PlanReplyMessageEnum
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.core.util.CommonResponseUtil
;
import
com.yeejoin.amos.fas.core.util.ResponseModel
;
import
com.yeejoin.amos.fas.dao.entity.*
;
import
com.yeejoin.amos.fas.exception.YeeException
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.RoleModel
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
...
...
@@ -120,7 +121,10 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService {
private
Boolean
auroraPushSwitch
;
@Autowired
private
IPlanVisual3dService
planVisual3dService
;
JcsFeign
jcsFeign
;
@Autowired
private
EmergencyTaskServiceImpl
emergencyTaskService
;
@Override
public
void
uploadTextPlan
(
String
appId
,
Map
<
String
,
String
>
pathNameMap
)
{
...
...
@@ -452,40 +456,57 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService {
@Override
public
ContingencyPlanInstance
replyMessage
(
AgencyUserModel
user
,
ContingencyPlanInstance
dto
)
{
String
json
=
planStepService
.
getPlanStep
();
List
<
PlanStepJsonVO
>
result
=
JSONObject
.
parseArray
(
json
,
PlanStepJsonVO
.
class
);
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
());
}
});
dto
.
setRoleCode
(
String
.
join
(
"-"
,
roleCodeList
));
// String json = planStepService.getPlanStep();
// List<PlanStepJsonVO> result = JSONObject.parseArray(json, PlanStepJsonVO.class);
// List<String> roleCode = result.stream().map(PlanStepJsonVO::getRoleCode).distinct().collect(Collectors.toList());
String
roleCodes
=
emergencyTaskService
.
getRolesByUserId
(
user
.
getUserId
());
String
roleNames
=
emergencyTaskService
.
getRolesNameByUserId
(
user
.
getUserId
());
List
<
String
>
roleModelList
=
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());
// }
// });
dto
.
setRoleCode
(
String
.
join
(
"-"
,
roleModelList
));
dto
.
setRoleName
(
String
.
join
(
"-"
,
roleNameList
));
dto
.
setStartUserId
(
user
.
getUserId
());
dto
.
setStartUserName
(
user
.
getRealName
());
dto
.
setRecordType
(
"REPLYMESSAGE"
);
dto
.
setCreateDate
(
new
Date
());
Map
<
String
,
String
>
userInfo
=
contingencyPlanInstanceMapper
.
getUserByUserId
(
user
.
getUserId
());
if
(!
ObjectUtils
.
isEmpty
(
userInfo
))
{
String
img
=
userInfo
.
get
(
"personImg"
);
dto
.
setPersonImg
(
StringUtils
.
isBlank
(
img
)
?
personImg
:
img
);
}
else
{
dto
.
setPersonImg
(
personImg
);
ResponseModel
responseModel
=
null
;
try
{
responseModel
=
jcsFeign
.
getPersonImage
(
user
.
getUserId
());
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
String
img
=
""
;
if
(
"SUCCESS"
.
equals
(
responseModel
.
getDevMessage
()))
{
img
=
JSON
.
toJSONString
(
responseModel
.
getResult
()).
replace
(
"\""
,
""
);
}
img
=
StringUtils
.
isEmpty
(
img
)
?
personImg
:
img
;
// Map<String, String> userInfo = contingencyPlanInstanceMapper.getUserByUserId(user.getUserId());
// if (!ObjectUtils.isEmpty(userInfo)) {
// String img = userInfo.get("personImg");
// dto.setPersonImg(StringUtils.isBlank(img) ? personImg : img);
// } else {
// dto.setPersonImg(personImg);
// }
dto
.
setPersonImg
(
img
);
dto
.
setContent
(
StringUtil
.
isNotEmpty
(
dto
.
getContent
())
?
dto
.
getContent
()
:
""
);
ContingencyPlanInstance
instance
=
repository
.
save
(
dto
);
if
(!
ObjectUtils
.
isEmpty
(
instance
))
{
...
...
@@ -577,6 +598,17 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService {
}
@Override
public
List
<
ContingencyPlanInstanceVO
>
getTaskActionList
(
String
batchNo
,
int
dataType
)
{
String
type
=
"TASKOPERATE"
;
String
status
=
""
;
if
(
"1"
.
equals
(
String
.
valueOf
(
dataType
)))
{
// 根据当前用户预案角色、未执行动作 (dataType = 2 查询所有)
status
=
"1"
;
}
return
contingencyInstanceInfoMapper
.
getTaskActionList
(
type
,
status
,
batchNo
);
}
@Override
public
List
<
ContingencyPlanInstanceVO
>
selectTaskActionList
(
String
batchNo
,
List
<
String
>
roleModelList
,
int
dataType
)
{
String
type
=
"TASKOPERATE"
;
String
status
=
""
;
...
...
@@ -669,39 +701,38 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService {
@Override
public
boolean
updateTaskStatusById
(
String
id
,
Boolean
runStatus
,
String
userName
,
String
userId
,
String
roleNames
)
{
boolean
bool
=
false
;
Map
<
String
,
String
>
userInfo
=
contingencyPlanInstanceMapper
.
getUserByUserId
(
userId
);
if
(!
ObjectUtils
.
isEmpty
(
userInfo
))
{
String
img
=
userInfo
.
get
(
"personImg"
);
personImg
=
(
StringUtils
.
isBlank
(
img
)
?
personImg
:
img
);
ResponseModel
responseModel
=
null
;
try
{
responseModel
=
jcsFeign
.
getPersonImage
(
userId
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
String
img
=
""
;
if
(
"SUCCESS"
.
equals
(
responseModel
.
getDevMessage
()))
{
img
=
JSON
.
toJSONString
(
responseModel
.
getResult
()).
replace
(
"\""
,
""
);
}
img
=
StringUtils
.
isEmpty
(
img
)
?
personImg
:
img
;
if
(
runStatus
)
{
ContingencyPlanInstance
instance
=
contingencyPlanInstanceMapper
.
getMessageById
(
id
);
ContingencyPlanInstance
contingencyPlanInstance
=
deleteButton
(
instance
);
bool
=
contingencyPlanInstanceMapper
.
updateTaskStatusById
(
id
,
contingencyPlanInstance
.
getContent
(),
runStatus
,
userName
,
userId
,
personI
mg
,
PlanReplyMessageEnum
.
TEXT
.
getCode
(),
roleNames
);
bool
=
contingencyPlanInstanceMapper
.
updateTaskStatusById
(
id
,
contingencyPlanInstance
.
getContent
(),
runStatus
,
userName
,
userId
,
i
mg
,
PlanReplyMessageEnum
.
TEXT
.
getCode
(),
roleNames
);
}
else
{
bool
=
contingencyPlanInstanceMapper
.
updateTaskStatusById
(
id
,
null
,
runStatus
,
userName
,
userId
,
personI
mg
,
PlanReplyMessageEnum
.
TEXT
.
getCode
(),
roleNames
);
bool
=
contingencyPlanInstanceMapper
.
updateTaskStatusById
(
id
,
null
,
runStatus
,
userName
,
userId
,
i
mg
,
PlanReplyMessageEnum
.
TEXT
.
getCode
(),
roleNames
);
}
if
(
redisTemplate
.
hasKey
(
"planTask"
))
{
redisTemplate
.
delete
(
"planTask"
);
String
planTask
=
""
;
ContingencyPlanInstance
instance
=
contingencyPlanInstanceMapper
.
getMessageById
(
id
);
List
<
String
>
models
=
new
ArrayList
<>();
models
.
add
(
instance
.
getRoleCode
());
List
<
ContingencyPlanInstanceVO
>
list
=
this
.
selectTaskActionList
(
instance
.
getBatchNo
(),
models
,
1
);
if
(
0
<
list
.
size
())
{
planTask
=
JSON
.
toJSONString
(
list
);
if
(
bool
)
{
if
(
redisTemplate
.
hasKey
(
"planTask"
))
{
redisTemplate
.
delete
(
"planTask"
);
String
planTask
=
""
;
ContingencyPlanInstance
instance
=
contingencyPlanInstanceMapper
.
getMessageById
(
id
);
List
<
ContingencyPlanInstanceVO
>
list
=
this
.
getTaskActionList
(
instance
.
getBatchNo
(),
1
);
if
(
0
<
list
.
size
())
{
planTask
=
JSON
.
toJSONString
(
list
);
}
JSONArray
taskObjects
=
JSON
.
parseArray
(
planTask
);
redisTemplate
.
opsForValue
().
set
(
"planTask"
,
taskObjects
);
}
JSONArray
taskObjects
=
JSON
.
parseArray
(
planTask
);
redisTemplate
.
opsForValue
().
set
(
"planTask"
,
taskObjects
);
}
// if (bool) {
// 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));
// }
}
return
bool
;
}
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/IPlanVisual3dService.java
View file @
b62157bf
...
...
@@ -107,6 +107,8 @@ public interface IPlanVisual3dService {
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 @@
ORDER BY tmp.create_date ASC
</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 sum(tmpcount) from
( 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