Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
slm-bi
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
林锐标
slm-bi
Commits
8cc93b56
Commit
8cc93b56
authored
Jun 04, 2021
by
linruibiao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
接口编写
parent
515da94d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
40 deletions
+17
-40
InstrumentPanelInitServiceImpl.java
...lm/slmbi/service/impl/InstrumentPanelInitServiceImpl.java
+17
-40
No files found.
src/main/java/com/syc/slm/slmbi/service/impl/InstrumentPanelInitServiceImpl.java
View file @
8cc93b56
...
@@ -88,44 +88,16 @@ public class InstrumentPanelInitServiceImpl extends ServiceImpl<InstrumentPanelM
...
@@ -88,44 +88,16 @@ public class InstrumentPanelInitServiceImpl extends ServiceImpl<InstrumentPanelM
one
=
panelGroupService
.
getById
(
groupId
);
one
=
panelGroupService
.
getById
(
groupId
);
}
}
init
(
appId
,
one
,
initConfig1
,
initPanelName1
);
LambdaQueryWrapper
<
InstrumentPanel
>
where1
=
new
LambdaQueryWrapper
<>();
init
(
appId
,
one
,
initConfig2
,
initPanelName2
);
where1
.
eq
(
BaseEntity:
:
getAppId
,
appId
);
return
null
;
where1
.
eq
(
InstrumentPanel:
:
getName
,
initPanelName1
);
where1
.
eq
(
BaseEntity:
:
getRecordStatus
,
SlmConstants
.
DATA_VALID
);
InstrumentPanel
panel
=
baseMapper
.
selectOne
(
where1
);
if
(
ObjectUtils
.
isEmpty
(
panel
)){
InstrumentPanelConfig
panelConfig
=
configService
.
getById
(
initConfig1
);
String
config
=
null
;
try
{
config
=
URLDecoder
.
decode
(
panelConfig
.
getConfigDetails
(),
StandardCharsets
.
UTF_8
.
name
());
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
throw
new
SysException
(
"仪表板配置详情解密异常"
);
}
InstrumentPanelTree
tree
=
treeService
.
getById
(
panelConfig
.
getPanelId
());
LambdaQueryWrapper
<
InstrumentPanelTree
>
where
=
new
LambdaQueryWrapper
<>();
where
.
eq
(
BaseEntity:
:
getRecordStatus
,
SlmConstants
.
DATA_VALID
);
where
.
likeRight
(
InstrumentPanelTree:
:
getFullId
,
tree
.
getFullId
()
+
"."
);
where
.
orderByAsc
(
InstrumentPanelTree:
:
getAssemblyKey
);
List
<
InstrumentPanelTree
>
panelTrees
=
treeService
.
list
(
where
);
configService
.
publish
(
appId
,
setConfig
(
one
,
appId
,
initPanelName1
,
config
,
panelTrees
));
}
}
private
void
init
(
String
appId
,
InstrumentPanelGroup
one
,
String
initConfig
,
String
initPanelName
)
{
LambdaQueryWrapper
<
InstrumentPanel
>
where2
=
new
LambdaQueryWrapper
<>();
InstrumentPanelConfig
panelConfig
=
configService
.
getById
(
initConfig
);
where2
.
eq
(
BaseEntity:
:
getAppId
,
appId
);
String
config
;
where2
.
eq
(
InstrumentPanel:
:
getName
,
initPanelName2
);
where2
.
eq
(
BaseEntity:
:
getRecordStatus
,
SlmConstants
.
DATA_VALID
);
InstrumentPanel
panel2
=
baseMapper
.
selectOne
(
where2
);
if
(
ObjectUtils
.
isEmpty
(
panel2
)){
InstrumentPanelConfig
panelConfig
=
configService
.
getById
(
initConfig2
);
String
config
=
null
;
try
{
try
{
config
=
URLDecoder
.
decode
(
panelConfig
.
getConfigDetails
(),
StandardCharsets
.
UTF_8
.
name
());
config
=
URLDecoder
.
decode
(
panelConfig
.
getConfigDetails
(),
StandardCharsets
.
UTF_8
.
name
());
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
throw
new
SysException
(
"仪表板配置详情解密异常"
);
throw
new
SysException
(
"仪表板配置详情解密异常"
);
...
@@ -136,18 +108,23 @@ public class InstrumentPanelInitServiceImpl extends ServiceImpl<InstrumentPanelM
...
@@ -136,18 +108,23 @@ public class InstrumentPanelInitServiceImpl extends ServiceImpl<InstrumentPanelM
where
.
likeRight
(
InstrumentPanelTree:
:
getFullId
,
tree
.
getFullId
()
+
"."
);
where
.
likeRight
(
InstrumentPanelTree:
:
getFullId
,
tree
.
getFullId
()
+
"."
);
where
.
orderByAsc
(
InstrumentPanelTree:
:
getAssemblyKey
);
where
.
orderByAsc
(
InstrumentPanelTree:
:
getAssemblyKey
);
List
<
InstrumentPanelTree
>
panelTrees
=
treeService
.
list
(
where
);
List
<
InstrumentPanelTree
>
panelTrees
=
treeService
.
list
(
where
);
configService
.
publish
(
appId
,
setConfig
(
one
,
appId
,
initPanelName2
,
config
,
panelTrees
));
configService
.
publish
(
appId
,
setConfig
(
one
,
appId
,
initPanelName
,
config
,
panelTrees
));
}
return
null
;
}
}
private
InstrumentPanelConfigDTO
setConfig
(
InstrumentPanelGroup
one
,
String
appId
,
String
panelName
,
String
panelConfig
,
List
<
InstrumentPanelTree
>
panelTrees
){
private
InstrumentPanelConfigDTO
setConfig
(
InstrumentPanelGroup
one
,
String
appId
,
String
panelName
,
String
panelConfig
,
List
<
InstrumentPanelTree
>
panelTrees
){
LambdaQueryWrapper
<
InstrumentPanel
>
where1
=
new
LambdaQueryWrapper
<>();
where1
.
eq
(
BaseEntity:
:
getAppId
,
appId
);
where1
.
eq
(
InstrumentPanel:
:
getName
,
initPanelName1
);
where1
.
eq
(
BaseEntity:
:
getRecordStatus
,
SlmConstants
.
DATA_VALID
);
InstrumentPanel
instrumentPanel
=
baseMapper
.
selectOne
(
where1
);
if
(
ObjectUtils
.
isEmpty
(
instrumentPanel
))
{
SaveInstrumentPanelDTO
panelDto
=
new
SaveInstrumentPanelDTO
();
SaveInstrumentPanelDTO
panelDto
=
new
SaveInstrumentPanelDTO
();
panelDto
.
setName
(
panelName
);
panelDto
.
setName
(
panelName
);
panelDto
.
setGroupId
(
one
.
getId
());
panelDto
.
setGroupId
(
one
.
getId
());
String
panelId
=
panelService
.
savePanel
(
appId
,
panelDto
);
String
panelId
=
panelService
.
savePanel
(
appId
,
panelDto
);
InstrumentPanel
instrumentPanel
=
baseMapper
.
selectById
(
panelId
);
instrumentPanel
=
baseMapper
.
selectById
(
panelId
);
}
InstrumentPanelConfigDTO
config
=
new
InstrumentPanelConfigDTO
();
InstrumentPanelConfigDTO
config
=
new
InstrumentPanelConfigDTO
();
List
<
InstrumentPanelAssemblyDTO
>
assemblys
=
Lists
.
newArrayList
();
List
<
InstrumentPanelAssemblyDTO
>
assemblys
=
Lists
.
newArrayList
();
panelTrees
.
forEach
(
x
->{
panelTrees
.
forEach
(
x
->{
...
...
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