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
f090f8f3
Commit
f090f8f3
authored
May 08, 2023
by
KeYong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新
parent
70eaeaec
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
122 additions
and
68 deletions
+122
-68
PlanVisual3dController.java
.../amos/fas/business/controller/PlanVisual3dController.java
+2
-1
ContingencyPlanInstanceMapper.java
...as/business/dao/mapper/ContingencyPlanInstanceMapper.java
+1
-1
EmergencyTaskMapper.java
...oin/amos/fas/business/dao/mapper/EmergencyTaskMapper.java
+1
-0
ContingencyInstanceImpl.java
...os/fas/business/service/impl/ContingencyInstanceImpl.java
+73
-62
EmergencyTaskServiceImpl.java
...s/fas/business/service/impl/EmergencyTaskServiceImpl.java
+7
-0
PlanVisual3dServiceImpl.java
...os/fas/business/service/impl/PlanVisual3dServiceImpl.java
+9
-3
IEmergencyTaskService.java
...mos/fas/business/service/intfc/IEmergencyTaskService.java
+2
-0
IPlanVisual3dService.java
...amos/fas/business/service/intfc/IPlanVisual3dService.java
+1
-1
ContingencyInstanceInfoMapper.xml
...ain/resources/db/mapper/ContingencyInstanceInfoMapper.xml
+0
-0
ContingencyPlanInstanceMapper.xml
...ain/resources/db/mapper/ContingencyPlanInstanceMapper.xml
+12
-0
dbTemplate_emergency_task.xml
...rc/main/resources/db/mapper/dbTemplate_emergency_task.xml
+14
-0
No files found.
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/PlanVisual3dController.java
View file @
f090f8f3
...
...
@@ -306,6 +306,7 @@ public class PlanVisual3dController extends BaseController {
@PostMapping
(
value
=
"/status/modify"
)
public
ResponseModel
updateTaskStatusById
(
@RequestParam
(
"id"
)
String
id
,
@RequestParam
(
"runStatus"
)
Boolean
runStatus
)
{
AgencyUserModel
user
=
getUserInfo
();
return
CommonResponseUtil
.
successNew
(
planVisual3dService
.
updateTaskStatusById
(
id
,
runStatus
,
user
.
getRealName
()));
String
roleNames
=
emergencyTaskService
.
getRolesNameByUserId
(
user
.
getUserId
());
return
CommonResponseUtil
.
successNew
(
planVisual3dService
.
updateTaskStatusById
(
id
,
runStatus
,
user
.
getRealName
(),
user
.
getUserId
(),
roleNames
));
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/mapper/ContingencyPlanInstanceMapper.java
View file @
f090f8f3
...
...
@@ -47,5 +47,5 @@ public interface ContingencyPlanInstanceMapper extends BaseMapper<ContingencyPla
String
getInstanceIdByBatchNOAndCategory
(
@Param
(
"recordType"
)
String
recordType
,
@Param
(
"category"
)
String
category
,
@Param
(
"batchNo"
)
String
batchNo
);
Boolean
updateTaskStatusById
(
@Param
(
"id"
)
String
id
,
@Param
(
"content"
)
String
content
,
Boolean
runStatus
,
@Param
(
"userName"
)
String
userName
);
Boolean
updateTaskStatusById
(
@Param
(
"id"
)
String
id
,
@Param
(
"content"
)
String
content
,
Boolean
runStatus
,
@Param
(
"userName"
)
String
userName
,
@Param
(
"userId"
)
String
userId
,
@Param
(
"personImg"
)
String
personImg
,
@Param
(
"fileType"
)
String
fileType
,
@Param
(
"roleNames"
)
String
roleNames
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/dao/mapper/EmergencyTaskMapper.java
View file @
f090f8f3
...
...
@@ -18,4 +18,5 @@ public interface EmergencyTaskMapper extends BaseMapper {
List
<
String
>
roleCodes
(
String
amosOrgId
);
List
<
String
>
roleNames
(
String
amosOrgId
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/ContingencyInstanceImpl.java
View file @
f090f8f3
...
...
@@ -501,72 +501,83 @@ public class ContingencyInstanceImpl implements IContingencyInstance {
ContingencyPlanInstance
instance
=
contingencyPlanInstanceMapper
.
getMessageById
(
contingencyPlanId
);
instance
.
setId
(
null
);
instance
.
setRecordType
(
"MESSAGE"
);
repository
.
save
(
instance
);
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
);
vo
.
setStepState
(
stepStateOnbutton
);
vo
.
setBatchNo
(
batchNo
);
vo
.
setStepCode
(
stepCode
);
vo
.
setButtonCode
(
buttonCode
);
vo
.
setContingencyPlanId
(
contingencyPlanId
);
vo
.
setButtonJson
(
buttonJson
);
vo
.
setIsAuto
(
isAuto
);
vo
.
setIsExecute
(
isExecute
);
ContingecyExecEvent
fireEvent
=
new
ContingecyExecEvent
(
this
);
fireEvent
.
setEventType
(
EventType
.
FIRE_NEXT_RULE
.
name
());
fireEvent
.
setPlanExecute
(
vo
);
fireEvent
.
setContext
(
RequestContext
.
cloneRequestContext
());
applicationContext
.
publishEvent
(
fireEvent
);
ContingecyExecEvent
updateEvent
=
new
ContingecyExecEvent
(
this
);
updateEvent
.
setEventType
(
EventType
.
UPDATE_CONTINGENCY_DATE
.
name
());
updateEvent
.
setPlanExecute
(
vo
);
updateEvent
.
setContext
(
RequestContext
.
cloneRequestContext
());
try
{
applicationContext
.
publishEvent
(
updateEvent
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
else
{
String
planStep
=
""
;
if
(
redisTemplate
.
hasKey
(
"planStep"
))
{
planStep
=
Objects
.
requireNonNull
(
redisTemplate
.
opsForValue
().
get
(
"planStep"
)).
toString
();
}
else
{
planStep
=
planStepService
.
getPlanStep
();
}
JSONArray
objects
=
JSON
.
parseArray
(
planStep
);
String
topic
=
String
.
format
(
"/%s/%s/%s"
,
serviceName
,
stationName
,
"plan"
);
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
result
.
put
(
"contingency"
,
new
ContingencyRo
());
result
.
put
(
"msgContext"
,
Collections
.
EMPTY_MAP
);
result
.
put
(
"msgType"
,
"getStepList"
);
result
.
put
(
"planStep"
,
objects
);
String
planTask
=
""
;
instance
.
setCreateDate
(
new
Date
());
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"
))
{
planTask
=
Objects
.
requireNonNull
(
redisTemplate
.
opsForValue
().
get
(
"planTask"
)).
toString
(
);
}
else
{
List
<
ContingencyPlanInstanceVO
>
lists
=
planVisual3dService
.
selectTaskActionList
(
batchNo
,
models
,
1
);
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
(
lists
);
planTask
=
JSON
.
toJSONString
(
arr
);
}
JSONArray
taskObjects
=
JSON
.
parseArray
(
planTask
);
redisTemplate
.
opsForValue
().
set
(
"planTask"
,
taskObjects
);
}
JSONArray
taskObjects
=
JSON
.
parseArray
(
planTask
);
result
.
put
(
"planTask"
,
taskObjects
);
webMqttComponent
.
publish
(
topic
,
JSON
.
toJSONString
(
result
));
if
(
0
<
strs
.
size
())
{
PlanExecuteVo
vo
=
new
PlanExecuteVo
();
vo
.
setConfirm
(
buttonState
);
vo
.
setStepState
(
stepStateOnbutton
);
vo
.
setBatchNo
(
batchNo
);
vo
.
setStepCode
(
stepCode
);
vo
.
setButtonCode
(
buttonCode
);
vo
.
setContingencyPlanId
(
contingencyPlanId
);
vo
.
setButtonJson
(
buttonJson
);
vo
.
setIsAuto
(
isAuto
);
vo
.
setIsExecute
(
isExecute
);
ContingecyExecEvent
fireEvent
=
new
ContingecyExecEvent
(
this
);
fireEvent
.
setEventType
(
EventType
.
FIRE_NEXT_RULE
.
name
());
fireEvent
.
setPlanExecute
(
vo
);
fireEvent
.
setContext
(
RequestContext
.
cloneRequestContext
());
applicationContext
.
publishEvent
(
fireEvent
);
ContingecyExecEvent
updateEvent
=
new
ContingecyExecEvent
(
this
);
updateEvent
.
setEventType
(
EventType
.
UPDATE_CONTINGENCY_DATE
.
name
());
updateEvent
.
setPlanExecute
(
vo
);
updateEvent
.
setContext
(
RequestContext
.
cloneRequestContext
());
try
{
applicationContext
.
publishEvent
(
updateEvent
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
else
{
String
planStep
=
""
;
if
(
redisTemplate
.
hasKey
(
"planStep"
))
{
planStep
=
Objects
.
requireNonNull
(
redisTemplate
.
opsForValue
().
get
(
"planStep"
)).
toString
();
}
else
{
planStep
=
planStepService
.
getPlanStep
();
}
JSONArray
objects
=
JSON
.
parseArray
(
planStep
);
String
topic
=
String
.
format
(
"/%s/%s/%s"
,
serviceName
,
stationName
,
"plan"
);
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
result
.
put
(
"contingency"
,
new
ContingencyRo
());
result
.
put
(
"msgContext"
,
Collections
.
EMPTY_MAP
);
result
.
put
(
"msgType"
,
"getStepList"
);
result
.
put
(
"planStep"
,
objects
);
String
planTask
=
""
;
if
(
redisTemplate
.
hasKey
(
"planTask"
))
{
planTask
=
Objects
.
requireNonNull
(
redisTemplate
.
opsForValue
().
get
(
"planTask"
)).
toString
();
}
else
{
List
<
ContingencyPlanInstanceVO
>
lists
=
planVisual3dService
.
selectTaskActionList
(
batchNo
,
models
,
1
);
if
(
0
<
list
.
size
())
{
planTask
=
JSON
.
toJSONString
(
lists
);
}
}
JSONArray
taskObjects
=
JSON
.
parseArray
(
planTask
);
result
.
put
(
"planTask"
,
taskObjects
);
webMqttComponent
.
publish
(
topic
,
JSON
.
toJSONString
(
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
));
}
return
Optional
.
empty
();
}
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/EmergencyTaskServiceImpl.java
View file @
f090f8f3
...
...
@@ -51,4 +51,11 @@ public class EmergencyTaskServiceImpl implements IEmergencyTaskService {
String
roleCodes
=
String
.
join
(
","
,
list
);
return
roleCodes
;
}
@Override
public
String
getRolesNameByUserId
(
String
userId
)
{
List
<
String
>
list
=
emergencyTaskMapper
.
roleNames
(
userId
);
String
roleNames
=
String
.
join
(
","
,
list
);
return
roleNames
;
}
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/impl/PlanVisual3dServiceImpl.java
View file @
f090f8f3
...
...
@@ -20,6 +20,7 @@ import com.yeejoin.amos.fas.business.service.model.ToipResponse;
import
com.yeejoin.amos.fas.business.util.JSONUtil
;
import
com.yeejoin.amos.fas.business.util.StringUtil
;
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.dao.entity.*
;
...
...
@@ -660,14 +661,19 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService {
}
@Override
public
boolean
updateTaskStatusById
(
String
id
,
Boolean
runStatus
,
String
userName
)
{
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
);
}
if
(
runStatus
)
{
ContingencyPlanInstance
instance
=
contingencyPlanInstanceMapper
.
getMessageById
(
id
);
ContingencyPlanInstance
contingencyPlanInstance
=
deleteButton
(
instance
);
bool
=
contingencyPlanInstanceMapper
.
updateTaskStatusById
(
id
,
contingencyPlanInstance
.
getContent
(),
runStatus
,
userName
);
bool
=
contingencyPlanInstanceMapper
.
updateTaskStatusById
(
id
,
contingencyPlanInstance
.
getContent
(),
runStatus
,
userName
,
userId
,
personImg
,
PlanReplyMessageEnum
.
TEXT
.
getCode
(),
roleNames
);
}
else
{
bool
=
contingencyPlanInstanceMapper
.
updateTaskStatusById
(
id
,
null
,
runStatus
,
userName
);
bool
=
contingencyPlanInstanceMapper
.
updateTaskStatusById
(
id
,
null
,
runStatus
,
userName
,
userId
,
personImg
,
PlanReplyMessageEnum
.
TEXT
.
getCode
(),
roleNames
);
}
if
(
redisTemplate
.
hasKey
(
"planTask"
))
{
redisTemplate
.
delete
(
"planTask"
);
...
...
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/IEmergencyTaskService.java
View file @
f090f8f3
...
...
@@ -21,4 +21,6 @@ public interface IEmergencyTaskService {
String
getRolesByUserId
(
String
userId
);
String
getRolesNameByUserId
(
String
userId
);
}
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/service/intfc/IPlanVisual3dService.java
View file @
f090f8f3
...
...
@@ -124,7 +124,7 @@ public interface IPlanVisual3dService {
*/
boolean
updateStatusById
(
String
id
,
Boolean
runStatus
);
boolean
updateTaskStatusById
(
String
id
,
Boolean
runStatus
,
String
userName
);
boolean
updateTaskStatusById
(
String
id
,
Boolean
runStatus
,
String
userName
,
String
userId
,
String
roleNames
);
/**
* 修改动作执行状态-web
...
...
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/ContingencyInstanceInfoMapper.xml
View file @
f090f8f3
This diff is collapsed.
Click to expand it.
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/ContingencyPlanInstanceMapper.xml
View file @
f090f8f3
...
...
@@ -24,6 +24,18 @@
<if
test=
"userName != null and userName != ''"
>
, start_user_name = #{userName}
</if>
<if
test=
"userId != null and userId != ''"
>
, start_user_id = #{userId}
</if>
<if
test=
"personImg != null and personImg != ''"
>
, person_img = #{personImg}
</if>
<if
test=
"fileType != null and fileType != ''"
>
, file_type = #{fileType}
</if>
<if
test=
"roleNames != null and roleNames != ''"
>
, role_name = #{roleNames}
</if>
where id = #{id}
</update>
<update
id=
"updateMessageById"
>
...
...
YeeAmosFireAutoSysStart/src/main/resources/db/mapper/dbTemplate_emergency_task.xml
View file @
f090f8f3
...
...
@@ -59,6 +59,20 @@
</where>
</select>
<select
id=
"roleNames"
resultType=
"string"
>
SELECT
f.dict_name AS dictName
FROM
c_emergency_relation cer LEFT JOIN f_dict f ON cer.obligationId = f.id
<where>
<if
test=
"_parameter != null "
>
cer.amos_id = #{amosOrgId}
</if>
</where>
</select>
<delete
id=
"deleteTreeNode"
>
delete from c_emergency_relation where obligationId = #{obligationId} and person_id = #{personId}
...
...
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