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
180202b1
Commit
180202b1
authored
May 25, 2021
by
linruibiao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
接口编写
parent
c3259963
Pipeline
#9229
passed with stages
in 1 minute 59 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
4 deletions
+29
-4
InstrumentPanelConfigService.java
...m/syc/slm/slmbi/service/InstrumentPanelConfigService.java
+9
-0
InstrumentPanelConfigServiceImpl.java
.../slmbi/service/impl/InstrumentPanelConfigServiceImpl.java
+17
-0
InstrumentPanelServiceImpl.java
...yc/slm/slmbi/service/impl/InstrumentPanelServiceImpl.java
+3
-4
No files found.
src/main/java/com/syc/slm/slmbi/service/InstrumentPanelConfigService.java
View file @
180202b1
...
...
@@ -8,6 +8,7 @@ import com.syc.slm.slmbi.vo.InstrumentPanelConfigVo;
import
javax.validation.constraints.NotNull
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
/**
* slm-bi
...
...
@@ -90,4 +91,12 @@ public interface InstrumentPanelConfigService extends IService<InstrumentPanelCo
* @param panelId
*/
Map
<
String
,
String
>
getAssemblyConfig
(
@NotNull
String
panelId
);
/**
* 根据仪表板id获取对应已发布配置
* @param ids
* @return
*/
Set
<
String
>
getConfigByPanelIds
(
@NotNull
Set
<
String
>
ids
);
}
src/main/java/com/syc/slm/slmbi/service/impl/InstrumentPanelConfigServiceImpl.java
View file @
180202b1
...
...
@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import
com.baomidou.mybatisplus.core.toolkit.ObjectUtils
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.google.common.collect.Maps
;
import
com.google.common.collect.Sets
;
import
com.syc.slm.common.core.constant.SlmConstants
;
import
com.syc.slm.slmbi.dao.InstrumentPanelConfigMapper
;
import
com.syc.slm.slmbi.dto.InstrumentPanelConfigDTO
;
...
...
@@ -30,6 +31,7 @@ import java.net.URLEncoder;
import
java.nio.charset.StandardCharsets
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
/**
...
...
@@ -361,6 +363,21 @@ public class InstrumentPanelConfigServiceImpl extends ServiceImpl<InstrumentPane
return
maps
;
}
@Override
@Transactional
public
Set
<
String
>
getConfigByPanelIds
(
@NotNull
Set
<
String
>
ids
)
{
LambdaQueryWrapper
<
InstrumentPanelConfig
>
where
=
new
LambdaQueryWrapper
<>();
where
.
eq
(
BaseEntity:
:
getRecordStatus
,
SlmConstants
.
DATA_VALID
);
where
.
in
(
InstrumentPanelConfig:
:
getPanelId
,
ids
);
where
.
eq
(
InstrumentPanelConfig:
:
getPublished
,
PublishedStatus
.
WAIT_PUBLISHED
.
value
);
List
<
InstrumentPanelConfig
>
configs
=
baseMapper
.
selectList
(
where
);
if
(
CollectionUtils
.
isNotEmpty
(
configs
)){
return
configs
.
stream
().
map
(
InstrumentPanelConfig:
:
getPanelId
).
collect
(
Collectors
.
toSet
());
}
return
Sets
.
newHashSet
();
}
private
InstrumentPanelConfigVo
getInstrumentPanelConfigVo
(
String
instrumentPanelId
,
PublishedStatus
published
)
{
LambdaQueryWrapper
<
InstrumentPanelConfig
>
where
=
new
LambdaQueryWrapper
<>();
...
...
src/main/java/com/syc/slm/slmbi/service/impl/InstrumentPanelServiceImpl.java
View file @
180202b1
...
...
@@ -99,11 +99,10 @@ public class InstrumentPanelServiceImpl extends ServiceImpl<InstrumentPanelMappe
.
map
(
BaseEntity:
:
getId
)
.
collect
(
Collectors
.
toSet
());
if
(
CollectionUtils
.
isNotEmpty
(
ids
)){
List
<
InstrumentPanelDraft
>
drafts
=
draftService
.
getByIds
(
ids
);
if
(
CollectionUtils
.
isNotEmpty
(
drafts
)){
Set
<
String
>
draftIds
=
drafts
.
stream
().
map
(
InstrumentPanelDraft:
:
getPanelId
).
collect
(
Collectors
.
toSet
());
Set
<
String
>
waitIds
=
configService
.
getConfigByPanelIds
(
ids
);
if
(
CollectionUtils
.
isNotEmpty
(
waitIds
)){
response
.
getRecords
().
forEach
(
x
->{
if
(
draf
tIds
.
contains
(
x
.
getId
())){
if
(
wai
tIds
.
contains
(
x
.
getId
())){
x
.
setHasWaitPublish
(
"有未发布版本"
);
}
});
...
...
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