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())