增加字典tag类型
This commit is contained in:
parent
7eb5d18d87
commit
51bd733444
|
@ -27,6 +27,10 @@ public class SysDictDataEntity extends BaseEntity {
|
||||||
*/
|
*/
|
||||||
private String dictValue;
|
private String dictValue;
|
||||||
/**
|
/**
|
||||||
|
* 字典tag类型
|
||||||
|
*/
|
||||||
|
private String tagType;
|
||||||
|
/**
|
||||||
* 备注
|
* 备注
|
||||||
*/
|
*/
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
|
@ -43,12 +43,12 @@ public class SysDictTypeServiceImpl extends BaseServiceImpl<SysDictTypeDao, SysD
|
||||||
private final DictionaryTransService dictionaryTransService;
|
private final DictionaryTransService dictionaryTransService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageResult<SysDictTypeVO> page(SysDictTypeQuery query) {
|
public PageResult<SysDictTypeVO> page (SysDictTypeQuery query) {
|
||||||
IPage<SysDictTypeEntity> page = baseMapper.selectPage(getPage(query), getWrapper(query));
|
IPage<SysDictTypeEntity> page = baseMapper.selectPage(getPage(query), getWrapper(query));
|
||||||
return new PageResult<>(SysDictTypeConvert.INSTANCE.convertList(page.getRecords()), page.getTotal());
|
return new PageResult<>(SysDictTypeConvert.INSTANCE.convertList(page.getRecords()), page.getTotal());
|
||||||
}
|
}
|
||||||
|
|
||||||
private Wrapper<SysDictTypeEntity> getWrapper(SysDictTypeQuery query) {
|
private Wrapper<SysDictTypeEntity> getWrapper (SysDictTypeQuery query) {
|
||||||
LambdaQueryWrapper<SysDictTypeEntity> wrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<SysDictTypeEntity> wrapper = new LambdaQueryWrapper<>();
|
||||||
wrapper.like(StrUtil.isNotBlank(query.getDictType()), SysDictTypeEntity::getDictType, query.getDictType());
|
wrapper.like(StrUtil.isNotBlank(query.getDictType()), SysDictTypeEntity::getDictType, query.getDictType());
|
||||||
wrapper.like(StrUtil.isNotBlank(query.getDictName()), SysDictTypeEntity::getDictName, query.getDictName());
|
wrapper.like(StrUtil.isNotBlank(query.getDictName()), SysDictTypeEntity::getDictName, query.getDictName());
|
||||||
|
@ -59,7 +59,7 @@ public class SysDictTypeServiceImpl extends BaseServiceImpl<SysDictTypeDao, SysD
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void save(SysDictTypeVO vo) {
|
public void save (SysDictTypeVO vo) {
|
||||||
SysDictTypeEntity entity = SysDictTypeConvert.INSTANCE.convert(vo);
|
SysDictTypeEntity entity = SysDictTypeConvert.INSTANCE.convert(vo);
|
||||||
|
|
||||||
baseMapper.insert(entity);
|
baseMapper.insert(entity);
|
||||||
|
@ -67,7 +67,7 @@ public class SysDictTypeServiceImpl extends BaseServiceImpl<SysDictTypeDao, SysD
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void update(SysDictTypeVO vo) {
|
public void update (SysDictTypeVO vo) {
|
||||||
SysDictTypeEntity entity = SysDictTypeConvert.INSTANCE.convert(vo);
|
SysDictTypeEntity entity = SysDictTypeConvert.INSTANCE.convert(vo);
|
||||||
|
|
||||||
updateById(entity);
|
updateById(entity);
|
||||||
|
@ -75,12 +75,12 @@ public class SysDictTypeServiceImpl extends BaseServiceImpl<SysDictTypeDao, SysD
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void delete(List<Long> idList) {
|
public void delete (List<Long> idList) {
|
||||||
removeByIds(idList);
|
removeByIds(idList);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<SysDictVO.DictData> getDictSql(Long id) {
|
public List<SysDictVO.DictData> getDictSql (Long id) {
|
||||||
SysDictTypeEntity entity = this.getById(id);
|
SysDictTypeEntity entity = this.getById(id);
|
||||||
try {
|
try {
|
||||||
return sysDictDataDao.getListForSql(entity.getDictSql());
|
return sysDictDataDao.getListForSql(entity.getDictSql());
|
||||||
|
@ -90,7 +90,7 @@ public class SysDictTypeServiceImpl extends BaseServiceImpl<SysDictTypeDao, SysD
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<SysDictVO> getDictList() {
|
public List<SysDictVO> getDictList () {
|
||||||
// 全部字典类型列表
|
// 全部字典类型列表
|
||||||
List<SysDictTypeEntity> typeList = this.list(Wrappers.emptyWrapper());
|
List<SysDictTypeEntity> typeList = this.list(Wrappers.emptyWrapper());
|
||||||
|
|
||||||
|
@ -106,7 +106,7 @@ public class SysDictTypeServiceImpl extends BaseServiceImpl<SysDictTypeDao, SysD
|
||||||
|
|
||||||
for (SysDictDataEntity data : dataList) {
|
for (SysDictDataEntity data : dataList) {
|
||||||
if (type.getId().equals(data.getDictTypeId())) {
|
if (type.getId().equals(data.getDictTypeId())) {
|
||||||
dict.getDataList().add(new SysDictVO.DictData(data.getDictLabel(), data.getDictValue()));
|
dict.getDataList().add(new SysDictVO.DictData(data.getDictLabel(), data.getDictValue(), data.getTagType()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -128,11 +128,11 @@ public class SysDictTypeServiceImpl extends BaseServiceImpl<SysDictTypeDao, SysD
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void afterPropertiesSet() {
|
public void afterPropertiesSet () {
|
||||||
refreshTransCache();
|
refreshTransCache();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void refreshTransCache() {
|
public void refreshTransCache () {
|
||||||
// 异步不阻塞主线程,不会 增加启动用时
|
// 异步不阻塞主线程,不会 增加启动用时
|
||||||
CompletableFuture.supplyAsync(() -> {
|
CompletableFuture.supplyAsync(() -> {
|
||||||
// 获取所有的字典项数据
|
// 获取所有的字典项数据
|
||||||
|
|
|
@ -32,6 +32,9 @@ public class SysDictDataVO implements Serializable {
|
||||||
@NotBlank(message = "字典标签不能为空")
|
@NotBlank(message = "字典标签不能为空")
|
||||||
private String dictLabel;
|
private String dictLabel;
|
||||||
|
|
||||||
|
@Schema(description = "字典tag类型")
|
||||||
|
private String tagType;
|
||||||
|
|
||||||
@Schema(description = "字典值")
|
@Schema(description = "字典值")
|
||||||
private String dictValue;
|
private String dictValue;
|
||||||
|
|
||||||
|
|
|
@ -30,5 +30,8 @@ public class SysDictVO {
|
||||||
|
|
||||||
@Schema(description = "字典值")
|
@Schema(description = "字典值")
|
||||||
private String dictValue;
|
private String dictValue;
|
||||||
|
|
||||||
|
@Schema(description = "字典tag类型")
|
||||||
|
private String tagType;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user