| | |
| | | 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 |
| | |
| | | } |
| | | |
| | | @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 |
| | |
| | | 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) { |