| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.PostConstruct; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | */ |
| | | @Service |
| | | public class SysDictTypeServiceImpl extends ServiceImpl<SysDictTypeMapper, SysDictType> implements ISysDictTypeService { |
| | | |
| | | @Autowired |
| | | private SysDictTypeMapper dictTypeMapper; |
| | | |
| | | @Autowired |
| | | private SysDictDataMapper dictDataMapper; |
| | |
| | | .eq(SysDictData::getDictType, dictType.getDictType())) > 0) { |
| | | throw new CustomException(String.format("%1$s已分配,不能删除", dictType.getDictName())); |
| | | } |
| | | dictTypeMapper.deleteById(dictId); |
| | | DictUtils.removeDictCache(dictType.getDictType()); |
| | | } |
| | | baseMapper.deleteBatchIds(Arrays.asList(dictIds)); |
| | | } |
| | | |
| | | /** |