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
95688d2d
Commit
95688d2d
authored
Nov 24, 2022
by
高建强
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
item:删除预案调用值班编码匹配人业务逻辑
parent
2608d58a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
2 deletions
+55
-2
ContingencyAction.java
...m/yeejoin/amos/fas/business/action/ContingencyAction.java
+55
-2
No files found.
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/action/ContingencyAction.java
View file @
95688d2d
...
...
@@ -6,6 +6,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
import
com.yeejoin.amos.component.rule.MethodParam
;
import
com.yeejoin.amos.component.rule.RuleActionBean
;
import
com.yeejoin.amos.component.rule.RuleMethod
;
import
com.yeejoin.amos.fas.business.action.el.ELEvaluationContext
;
import
com.yeejoin.amos.fas.business.action.model.ContingencyEvent
;
import
com.yeejoin.amos.fas.business.action.model.ContingencyRo
;
import
com.yeejoin.amos.fas.business.action.model.DeviceRo
;
...
...
@@ -53,9 +54,13 @@ import org.typroject.tyboot.core.foundation.context.RequestContext;
import
java.io.IOException
;
import
java.lang.reflect.Constructor
;
import
java.lang.reflect.Field
;
import
java.lang.reflect.Method
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.concurrent.ConcurrentHashMap
;
import
java.util.regex.Matcher
;
import
java.util.regex.Pattern
;
@Component
...
...
@@ -137,6 +142,7 @@ public class ContingencyAction implements CustomerAction {
private
static
Map
<
String
,
String
>
OPERATE_RECORD_ID
=
new
HashMap
<>();
private
static
Map
<
String
,
Map
<
String
,
String
>>
stringStringMap
=
new
HashMap
<>();
static
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"HH:mm:ss"
);
public
static
ConcurrentHashMap
<
String
,
Map
<
String
,
Object
>>
pointCache
=
new
ConcurrentHashMap
<>();
...
...
@@ -312,6 +318,7 @@ public class ContingencyAction implements CustomerAction {
redisTemplate
.
opsForValue
().
set
(
"action:token"
,
params
.
getOrDefault
(
"token"
,
""
).
toString
());
//转换content中的变量
content
=
instedParams
(
content
,
contingencyRo
);
iContingencyInstance
.
createInstanceRecord
(
contingencyRo
.
getBatchNo
(),
""
,
"DEFAULT"
,
content
,
"MESSAGE"
,
""
);
SafteyPlanResult
result
=
new
SafteyPlanResult
();
...
...
@@ -335,7 +342,7 @@ public class ContingencyAction implements CustomerAction {
e
.
printStackTrace
();
}
result
.
add
(
tempmap1
);
System
.
out
.
print
ln
(
"--------------------messageRecord----------------------"
+
result
);
System
.
out
.
print
f
(
"=========recordarea=====396====%s=========%s=========%n"
,
JSONObject
.
toJSONString
(
paramObj
),
JSONObject
.
toJSONString
(
result
)
);
sendcmd
(
"recordarea"
,
paramObj
,
result
);
sendweb
(
"recordarea"
,
paramObj
,
result
);
}
...
...
@@ -361,6 +368,9 @@ public class ContingencyAction implements CustomerAction {
if
(!
findByBatchNoAndStatus
(
batchNo
))
{
stopSnapshop
(
contingencyRo
);
//转换智能辅助中的变量
content
=
instedParams
(
content
,
contingencyRo
);
SafteyPlanResult
result
=
new
SafteyPlanResult
();
Map
<
String
,
Object
>
tempmap1
=
new
HashMap
<>();
...
...
@@ -377,6 +387,40 @@ public class ContingencyAction implements CustomerAction {
}
}
private
String
instedParams
(
String
content
,
ContingencyRo
contingencyRo
)
{
Field
[]
fields
=
contingencyRo
.
getClass
().
getDeclaredFields
();
Method
getMethod
=
null
;
try
{
for
(
Field
field
:
fields
)
{
if
(
field
.
getName
().
equals
(
"serialVersionUID"
))
continue
;
String
fileNameInMethod
=
String
.
valueOf
(
field
.
getName
().
charAt
(
0
)).
toUpperCase
()
+
field
.
getName
().
substring
(
1
);
getMethod
=
contingencyRo
.
getClass
().
getMethod
(
"get"
+
fileNameInMethod
);
String
value
=
String
.
valueOf
(
getMethod
.
invoke
(
contingencyRo
));
content
=
content
.
replaceAll
(
"\\$\\{"
+
field
.
getName
()
+
"}"
,
value
);
}
content
=
getNative
(
content
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
content
;
}
public
String
getNative
(
String
str
)
{
Pattern
p
=
Pattern
.
compile
(
"\\$\\{(.*?)\\}"
);
Matcher
m
=
p
.
matcher
(
str
);
while
(
m
.
find
())
{
String
parameter
=
m
.
group
();
Object
parametervalue
=
ELEvaluationContext
.
getValue
(
parameter
.
substring
(
1
,
parameter
.
length
()
-
1
));
if
(
parametervalue
!=
null
)
str
=
str
.
replace
(
parameter
,
parametervalue
!=
null
?
parametervalue
.
toString
()
:
null
);
}
return
str
;
}
/**
* 交互动作
*
...
...
@@ -394,6 +438,9 @@ public class ContingencyAction implements CustomerAction {
stopSnapshop
(
contingencyRo
);
String
buttonCode
=
contingencyRo
.
getButtonCode
();
//转换content中的变量
tips
=
instedParams
(
tips
,
contingencyRo
);
SafteyPlanResult
result
=
new
SafteyPlanResult
();
Map
<
String
,
Object
>
tempmap1
=
new
HashMap
<>();
...
...
@@ -489,6 +536,7 @@ public class ContingencyAction implements CustomerAction {
e
.
printStackTrace
();
}
result
.
add
(
tempmap1
);
System
.
out
.
printf
(
"=========recordarea=====595====%s=========%s=========%n"
,
JSONObject
.
toJSONString
(
paramObj
),
JSONObject
.
toJSONString
(
result
));
this
.
sendcmd
(
"recordarea"
,
paramObj
,
result
);
}
}
...
...
@@ -543,13 +591,14 @@ public class ContingencyAction implements CustomerAction {
String
batchNo
=
contingencyRo
.
getBatchNo
();
if
(!
findByBatchNoAndStatus
(
batchNo
))
{
stopSnapshop
(
contingencyRo
);
String
parameter
=
instedParams
(
paramJSON
,
contingencyRo
);
SafteyPlanResult
result
=
new
SafteyPlanResult
();
Map
<
String
,
Object
>
tempmap1
=
new
HashMap
<>();
tempmap1
.
put
(
"key"
,
actionName
);
tempmap1
.
put
(
"content"
,
actionType
);
tempmap1
.
put
(
"parameter"
,
param
JSON
);
tempmap1
.
put
(
"parameter"
,
param
eter
);
result
.
add
(
tempmap1
);
this
.
sendcmd
(
"maparea"
,
paramObj
,
result
);
}
...
...
@@ -571,6 +620,8 @@ public class ContingencyAction implements CustomerAction {
SafteyPlanResult
result
=
new
SafteyPlanResult
();
Map
<
String
,
Object
>
tempmap1
=
new
HashMap
<>();
//转换content中的变量
content
=
instedParams
(
content
,
contingencyRo
);
tempmap1
.
put
(
"content"
,
content
);
tempmap1
.
put
(
"type"
,
messageType
);
//消息类型 messageType 黑色框消息类型 CONTINGENCY,,滚动消息:CURRENTMESSAGE
...
...
@@ -655,6 +706,7 @@ public class ContingencyAction implements CustomerAction {
planDetailDataSync
(
detail
);
}
//数字预案业务屏web端发送消息
System
.
out
.
printf
(
"=========recordarea====765=====%s=========%s=========%n"
,
JSONObject
.
toJSONString
(
paramObj
),
JSONObject
.
toJSONString
(
result
));
this
.
sendweb
(
"recordarea"
,
paramObj
,
result
);
}
...
...
@@ -842,6 +894,7 @@ public class ContingencyAction implements CustomerAction {
tempmap1
.
put
(
"status"
,
PlanRecordStatusEnum
.
INTERRUPT
.
getCode
());
result
.
add
(
tempmap1
);
//数字预案业务屏web端发送消息
System
.
out
.
printf
(
"=========recordarea====953=====%s=========%s=========%n"
,
JSONObject
.
toJSONString
(
contingencyRo
),
JSONObject
.
toJSONString
(
result
));
this
.
sendweb
(
"recordarea"
,
contingencyRo
,
result
);
updateNumberPlan
(
batchNo
);
// 应急处置中断,初始化planStep,json数据;更新预案结束时间
...
...
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