From 96a914a3804dce299fa8fe37d7c9154feb1d7bce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=98=95?= Date: Wed, 7 Feb 2024 10:33:11 +0800 Subject: [PATCH] =?UTF-8?q?OCT=201.=20=E4=BF=AE=E6=AD=A3=E5=AD=97=E5=85=B8?= =?UTF-8?q?=E5=8A=A0=E8=BD=BD=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cf/configure/DictProviderConfigure.java | 3 +- .../service/impl/DictionaryServiceImpl.java | 28 ++++++++----------- 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/src/main/java/com/cmhi/cf/configure/DictProviderConfigure.java b/src/main/java/com/cmhi/cf/configure/DictProviderConfigure.java index 3f9c240..9dcd46c 100644 --- a/src/main/java/com/cmhi/cf/configure/DictProviderConfigure.java +++ b/src/main/java/com/cmhi/cf/configure/DictProviderConfigure.java @@ -1,5 +1,6 @@ package com.cmhi.cf.configure; +import com.cmhi.cf.common.CommonStatus; import com.cmhi.cf.database.common.mapper.DictTypeMapper; import com.houkunlin.system.dict.starter.bean.DictTypeVo; import com.houkunlin.system.dict.starter.provider.DictProvider; @@ -27,7 +28,7 @@ public class DictProviderConfigure implements DictProvider { dictTypeMapper.selectAllWithRelations().forEach(k -> { DictTypeVo.DictTypeBuilder builder = DictTypeVo.newBuilder(k.getDictType(), k.getDictName(), k.getRemark()); k.getDictDataList() - .stream().filter(m -> "0".equals(m.getStatus())) + .stream().filter(m -> m.getStatus().equals(CommonStatus.NORMAL.getValue())) .forEach(v -> builder.add(v.getDictValue(), v.getDictLabel(), v.getDictSort())); dictItems.add(builder.build()); }); diff --git a/src/main/java/com/cmhi/cf/service/impl/DictionaryServiceImpl.java b/src/main/java/com/cmhi/cf/service/impl/DictionaryServiceImpl.java index 3581557..6c3a169 100644 --- a/src/main/java/com/cmhi/cf/service/impl/DictionaryServiceImpl.java +++ b/src/main/java/com/cmhi/cf/service/impl/DictionaryServiceImpl.java @@ -53,13 +53,11 @@ public class DictionaryServiceImpl implements DictionaryService { SystemDictStarter.getBean(SystemDictProvider.class).dictTypeIterator().forEachRemaining(k -> { if (dictType.contains(k.getType())) { List children = new ArrayList<>(); - k.getChildren().forEach(m -> { - children.add(DictDetails.builder() - .title(m.getTitle()) - .value((Integer) m.getValue()) - .disabled(false) - .build()); - }); + k.getChildren().forEach(m -> children.add(DictDetails.builder() + .title(m.getTitle()) + .value((Integer) m.getValue()) + .disabled(false) + .build())); sysDictList.add(DictContent.builder() .dictName(k.getType()) .children(children) @@ -174,15 +172,13 @@ public class DictionaryServiceImpl implements DictionaryService { ret.forEach(k -> { List children = new ArrayList<>(); - k.getDictDataList().forEach(m -> { - children.add(DictDetails.builder() - .id(m.getId()) - .title(m.getDictLabel()) - .value(m.getDictValue()) - .sorted(m.getDictSort()) - .disabled(m.getStatus() != 0) - .build()); - }); + k.getDictDataList().forEach(m -> children.add(DictDetails.builder() + .id(m.getId()) + .title(m.getDictLabel()) + .value(m.getDictValue()) + .sorted(m.getDictSort()) + .disabled(m.getStatus() != 0) + .build())); resp.add(DictContent.builder() .dictId(k.getId())