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
14e73c87
Commit
14e73c87
authored
Oct 28, 2022
by
高建强
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
item:应急处置解决动作执行实时性问题
parent
003b5213
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
31 deletions
+25
-31
ContingencyAction.java
...m/yeejoin/amos/fas/business/action/ContingencyAction.java
+25
-31
No files found.
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/action/ContingencyAction.java
View file @
14e73c87
...
@@ -52,8 +52,7 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -52,8 +52,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.springframework.transaction.support.TransactionSynchronization
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.support.TransactionSynchronizationManager
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
...
@@ -353,6 +352,7 @@ public class ContingencyAction implements CustomerAction {
...
@@ -353,6 +352,7 @@ public class ContingencyAction implements CustomerAction {
* @param paramObj 预案对象
* @param paramObj 预案对象
*/
*/
@RuleMethod
(
methodLabel
=
"执行记录"
,
project
=
"换流站消防专项预案"
)
@RuleMethod
(
methodLabel
=
"执行记录"
,
project
=
"换流站消防专项预案"
)
@Transactional
public
void
messageRecord
(
@MethodParam
(
paramLabel
=
"消息内容"
)
String
content
,
@MethodParam
(
paramLabel
=
"对象"
)
Object
paramObj
)
{
public
void
messageRecord
(
@MethodParam
(
paramLabel
=
"消息内容"
)
String
content
,
@MethodParam
(
paramLabel
=
"对象"
)
Object
paramObj
)
{
ContingencyRo
contingencyRo
=
(
ContingencyRo
)
paramObj
;
ContingencyRo
contingencyRo
=
(
ContingencyRo
)
paramObj
;
String
batchNo
=
contingencyRo
.
getBatchNo
();
String
batchNo
=
contingencyRo
.
getBatchNo
();
...
@@ -372,36 +372,30 @@ public class ContingencyAction implements CustomerAction {
...
@@ -372,36 +372,30 @@ public class ContingencyAction implements CustomerAction {
content
=
instedParams
(
content
,
contingencyRo
);
content
=
instedParams
(
content
,
contingencyRo
);
iContingencyInstance
.
createInstanceRecord
(
contingencyRo
.
getBatchNo
(),
""
,
"DEFAULT"
,
content
,
"MESSAGE"
,
""
);
iContingencyInstance
.
createInstanceRecord
(
contingencyRo
.
getBatchNo
(),
""
,
"DEFAULT"
,
content
,
"MESSAGE"
,
""
);
TransactionSynchronizationManager
.
registerSynchronization
(
new
TransactionSynchronization
()
{
SafteyPlanResult
result
=
new
SafteyPlanResult
();
@Override
Map
<
String
,
Object
>
tempmap1
=
new
HashMap
<>();
public
void
afterCommit
()
{
try
{
// 事物提交后业务逻辑
SimpleDateFormat
sdf1
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
SafteyPlanResult
result
=
new
SafteyPlanResult
();
List
<
ContingencyPlanInstance
>
list
=
iContingencyInstance
.
queryForTimeLine
(
contingencyRo
.
getBatchNo
(),
"MESSAGE"
);
Map
<
String
,
Object
>
tempmap1
=
new
HashMap
<>();
ArrayList
records
=
new
ArrayList
<>();
try
{
if
(!
ObjectUtils
.
isEmpty
(
list
))
{
SimpleDateFormat
sdf1
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
list
.
forEach
(
action
->
{
List
<
ContingencyPlanInstance
>
list
=
iContingencyInstance
.
queryForTimeLine
(
contingencyRo
.
getBatchNo
(),
"MESSAGE"
);
HashMap
map
=
new
HashMap
();
ArrayList
records
=
new
ArrayList
<>();
map
.
put
(
"time"
,
sdf1
.
format
(
action
.
getCreateDate
().
getTime
()));
if
(!
ObjectUtils
.
isEmpty
(
list
))
{
map
.
put
(
"stepName"
,
action
.
getContent
());
list
.
forEach
(
action
->
{
records
.
add
(
map
);
HashMap
map
=
new
HashMap
();
});
map
.
put
(
"time"
,
sdf1
.
format
(
action
.
getCreateDate
().
getTime
()));
map
.
put
(
"stepName"
,
action
.
getContent
());
records
.
add
(
map
);
});
}
tempmap1
.
put
(
"content"
,
records
);
tempmap1
.
put
(
"status"
,
PlanRecordStatusEnum
.
OPERATION
.
getCode
());
}
catch
(
Exception
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
result
.
add
(
tempmap1
);
System
.
out
.
println
(
"--------------------messageRecord----------------------"
+
result
);
sendcmd
(
"recordarea"
,
paramObj
,
result
);
sendweb
(
"recordarea"
,
paramObj
,
result
);
}
}
});
tempmap1
.
put
(
"content"
,
records
);
tempmap1
.
put
(
"status"
,
PlanRecordStatusEnum
.
OPERATION
.
getCode
());
}
catch
(
Exception
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
result
.
add
(
tempmap1
);
System
.
out
.
println
(
"--------------------messageRecord----------------------"
+
result
);
sendcmd
(
"recordarea"
,
paramObj
,
result
);
sendweb
(
"recordarea"
,
paramObj
,
result
);
}
}
}
}
...
...
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