linwe
2024-08-09 8b7258c9427882bb1798f1502eaa35184c6e374e
src/main/java/org/springblade/modules/system/service/impl/DictBizServiceImpl.java
@@ -52,8 +52,9 @@
public class DictBizServiceImpl extends ServiceImpl<DictBizMapper, DictBiz> implements IDictBizService {
   @Override
   public List<DictBizVO> tree() {
      return ForestNodeMerger.merge(baseMapper.tree());
   public List<DictBizVO> tree(String code) {
      List<DictBizVO> tree = baseMapper.tree(code);
      return ForestNodeMerger.merge(tree);
   }
   @Override
@@ -67,8 +68,8 @@
   }
   @Override
   public List<DictBiz> getList(String code) {
      return baseMapper.getList(code);
   public List<DictBiz> getList(String code,Long parentId) {
      return baseMapper.getList(code,parentId);
   }
   @Override
@@ -76,7 +77,7 @@
      LambdaQueryWrapper<DictBiz> lqw = Wrappers.<DictBiz>query().lambda().eq(DictBiz::getCode, dict.getCode()).eq(DictBiz::getDictKey, dict.getDictKey());
      Long cnt = baseMapper.selectCount((Func.isEmpty(dict.getId())) ? lqw : lqw.notIn(DictBiz::getId, dict.getId()));
      if (cnt > 0L) {
         throw new ServiceException("当前字典键值已存在!");
         throw new ServiceException("当前键值已存在!");
      }
      // 修改顶级字典后同步更新下属字典的编号
      if (Func.isNotEmpty(dict.getId()) && dict.getParentId().longValue() == BladeConstant.TOP_PARENT_ID) {