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
623f8997
Commit
623f8997
authored
Sep 15, 2020
by
高东东
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
*)修改规则动作bug
parent
5b8f9a9f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
3 deletions
+22
-3
ContingencyAction.java
...m/yeejoin/amos/fas/business/action/ContingencyAction.java
+22
-3
No files found.
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/action/ContingencyAction.java
View file @
623f8997
...
@@ -13,7 +13,8 @@ import java.util.HashMap;
...
@@ -13,7 +13,8 @@ import java.util.HashMap;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.concurrent.ConcurrentHashMap
;
import
java.util.concurrent.ConcurrentHashMap
;
import
java.util.concurrent.ConcurrentMap
;
import
java.util.regex.Matcher
;
import
java.util.regex.Pattern
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
...
@@ -31,6 +32,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
...
@@ -31,6 +32,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
import
com.yeejoin.amos.component.rule.MethodParam
;
import
com.yeejoin.amos.component.rule.MethodParam
;
import
com.yeejoin.amos.component.rule.RuleActionBean
;
import
com.yeejoin.amos.component.rule.RuleActionBean
;
import
com.yeejoin.amos.component.rule.RuleMethod
;
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.ContingencyEvent
;
import
com.yeejoin.amos.fas.business.action.model.ContingencyRo
;
import
com.yeejoin.amos.fas.business.action.model.ContingencyRo
;
import
com.yeejoin.amos.fas.business.action.model.DeviceRo
;
import
com.yeejoin.amos.fas.business.action.model.DeviceRo
;
...
@@ -385,14 +387,31 @@ public class ContingencyAction implements CustomerAction {
...
@@ -385,14 +387,31 @@ public class ContingencyAction implements CustomerAction {
content
=
content
.
replaceAll
(
"\\$\\{"
+
field
.
getName
()
+
"}"
,
value
);
content
=
content
.
replaceAll
(
"\\$\\{"
+
field
.
getName
()
+
"}"
,
value
);
}
}
content
=
content
.
replaceAll
(
"\\$\\{"
,
""
);
content
=
getNative
(
content
);
content
=
content
.
replaceAll
(
"}"
,
""
);
// content = content.replaceAll("\\$\\{", "");
// content = content.replaceAll("}", "");
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
return
content
;
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
;
}
/**
/**
* 交互动作
* 交互动作
...
...
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