Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
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
项目统一框架
amos-boot-biz
Commits
10360e70
Commit
10360e70
authored
Jan 20, 2025
by
麻笑宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.大屏业务模块详情提交
parent
9925645c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
29 deletions
+19
-29
DPSubServiceImpl.java
...t/module/statistcs/biz/service/impl/DPSubServiceImpl.java
+19
-29
No files found.
amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-biz/src/main/java/com/yeejoin/amos/boot/module/statistcs/biz/service/impl/DPSubServiceImpl.java
View file @
10360e70
...
...
@@ -333,15 +333,15 @@ public class DPSubServiceImpl {
private
JSONArray
processShowHideRules
(
JSONArray
children
,
Object
showHideRules
,
Object
apiResult
)
{
JSONObject
result
=
JSONObject
.
parseObject
(
apiResult
.
toString
());
result
.
put
(
"formType"
,
"detail"
);
result
.
put
(
"EQU_CATEGORY_CODE"
,
"8100"
);
Map
<
String
,
String
>
relationMap
=
new
HashMap
<>();
relationMap
.
put
(
"and"
,
"&&"
);
relationMap
.
put
(
"or"
,
"||"
);
if
(!
ValidationUtil
.
isEmpty
(
showHideRules
))
{
((
JSONArray
)
showHideRules
).
stream
().
forEach
(
x
->
{
JSONObject
xObj
=
(
JSONObject
)
x
;
boolean
hide
=
true
;
JSONArray
conditions
=
xObj
.
getJSONArray
(
"condition"
);
String
relation
=
null
;
boolean
lastConditionResult
=
false
;
String
relation
=
""
;
for
(
int
i
=
0
;
i
<
conditions
.
size
();
i
++)
{
JSONObject
conditionObj
=
conditions
.
getJSONObject
(
i
);
String
value
=
conditionObj
.
getString
(
"value"
);
...
...
@@ -349,32 +349,22 @@ public class DPSubServiceImpl {
JSONObject
item
=
this
.
findByEid
(
children
,
JsonValueUtils
.
getValueByKey
(
conditionObj
,
"name"
,
"name.key"
).
toString
());
Object
fieldvalue
=
result
.
get
(
JsonValueUtils
.
getValueByKey
(
item
,
"visualParams"
,
"visualParams.fieldKey"
));
if
(
ValidationUtil
.
isEmpty
(
relation
))
{
if
(
condition
.
equals
(
"notUndefined"
)
&&
!
ValidationUtil
.
isEmpty
(
fieldvalue
))
{
lastConditionResult
=
!
ValidationUtil
.
isEmpty
(
fieldvalue
);
hide
=
false
;
}
else
if
(
condition
.
equals
(
"unequal"
)
&&
!
ValidationUtil
.
isEmpty
(
fieldvalue
)
&&
!
fieldvalue
.
equals
(
value
))
{
lastConditionResult
=
!
fieldvalue
.
equals
(
value
);
hide
=
false
;
}
else
if
(
condition
.
equals
(
"equal"
)
&&
!
ValidationUtil
.
isEmpty
(
fieldvalue
)
&&
fieldvalue
.
equals
(
value
))
{
lastConditionResult
=
fieldvalue
.
equals
(
value
);
hide
=
false
;
}
}
else
{
if
(
lastConditionResult
&&
condition
.
equals
(
"notUndefined"
)
&&
!
ValidationUtil
.
isEmpty
(
fieldvalue
))
{
lastConditionResult
=
!
ValidationUtil
.
isEmpty
(
fieldvalue
);
hide
=
false
;
}
else
if
(
lastConditionResult
&&
condition
.
equals
(
"unequal"
)
&&
!
ValidationUtil
.
isEmpty
(
fieldvalue
)
&&
!
fieldvalue
.
equals
(
value
))
{
lastConditionResult
=
!
fieldvalue
.
equals
(
value
);
hide
=
false
;
}
else
if
(
lastConditionResult
&&
condition
.
equals
(
"equal"
)
&&
!
ValidationUtil
.
isEmpty
(
fieldvalue
)
&&
fieldvalue
.
equals
(
value
))
{
lastConditionResult
=
fieldvalue
.
equals
(
value
);
hide
=
false
;
}
else
{
hide
=
true
;
}
if
(
condition
.
equals
(
"notUndefined"
))
{
relation
+=
!
ValidationUtil
.
isEmpty
(
fieldvalue
);
}
else
if
(
condition
.
equals
(
"unequal"
))
{
relation
+=
!
value
.
equals
(
fieldvalue
);
}
else
if
(
condition
.
equals
(
"equal"
))
{
relation
+=
value
.
equals
(
fieldvalue
);
}
relation
=
conditionObj
.
getString
(
"relation"
);
relation
+=
relationMap
.
getOrDefault
(
conditionObj
.
getString
(
"relation"
),
""
);
}
// 获取 JavaScript 引擎
ScriptEngine
engine
=
new
ScriptEngineManager
().
getEngineByName
(
"javascript"
);
try
{
// 将结果转换为布尔值
hide
=
!(
Boolean
)
engine
.
eval
(
relation
);
}
catch
(
Exception
e
)
{
hide
=
true
;
}
if
(
hide
)
{
...
...
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