mirror of https://gitee.com/stylefeng/roses
【8.0】【config】整理字典和配置的基础类
parent
826787f901
commit
555f70c3af
|
@ -31,7 +31,6 @@ import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
import javax.validation.constraints.NotBlank;
|
import javax.validation.constraints.NotBlank;
|
||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -47,7 +46,7 @@ public class SysConfigTypeParam extends BaseRequest {
|
||||||
/**
|
/**
|
||||||
* 配置类型id
|
* 配置类型id
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "配置类型id不能为空", groups = {edit.class, delete.class, detail.class})
|
@NotNull(message = "配置类型id不能为空", groups = {edit.class, delete.class, detail.class})
|
||||||
@ChineseDescription("配置类型id")
|
@ChineseDescription("配置类型id")
|
||||||
private Long configTypeId;
|
private Long configTypeId;
|
||||||
|
|
||||||
|
|
|
@ -298,10 +298,8 @@ public class SysConfigServiceImpl extends ServiceImpl<SysConfigMapper, SysConfig
|
||||||
String searchText = sysConfigParam.getSearchText();
|
String searchText = sysConfigParam.getSearchText();
|
||||||
if (ObjectUtil.isNotEmpty(searchText)) {
|
if (ObjectUtil.isNotEmpty(searchText)) {
|
||||||
queryWrapper.and(wq -> {
|
queryWrapper.and(wq -> {
|
||||||
wq.like(SysConfig::getConfigName, searchText)
|
wq.like(SysConfig::getConfigName, searchText).or().like(SysConfig::getConfigCode, searchText).or()
|
||||||
.or().like(SysConfig::getConfigCode, searchText)
|
.like(SysConfig::getConfigValue, searchText).or().like(SysConfig::getRemark, searchText);
|
||||||
.or().like(SysConfig::getConfigValue, searchText)
|
|
||||||
.or().like(SysConfig::getRemark, searchText);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,6 @@ package cn.stylefeng.roses.kernel.dict.modular.pojo.request;
|
||||||
import cn.stylefeng.roses.kernel.dict.modular.entity.SysDict;
|
import cn.stylefeng.roses.kernel.dict.modular.entity.SysDict;
|
||||||
import cn.stylefeng.roses.kernel.rule.annotation.ChineseDescription;
|
import cn.stylefeng.roses.kernel.rule.annotation.ChineseDescription;
|
||||||
import cn.stylefeng.roses.kernel.rule.pojo.request.BaseRequest;
|
import cn.stylefeng.roses.kernel.rule.pojo.request.BaseRequest;
|
||||||
import cn.stylefeng.roses.kernel.rule.pojo.request.BaseRequest.batchDelete;
|
|
||||||
import cn.stylefeng.roses.kernel.validator.api.validators.status.StatusValue;
|
import cn.stylefeng.roses.kernel.validator.api.validators.status.StatusValue;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
@ -154,7 +153,7 @@ public class DictRequest extends BaseRequest {
|
||||||
@NotEmpty(message = "dictId集合不能为空", groups = batchDelete.class)
|
@NotEmpty(message = "dictId集合不能为空", groups = batchDelete.class)
|
||||||
@ChineseDescription("dictId集合,用在批量删除")
|
@ChineseDescription("dictId集合,用在批量删除")
|
||||||
private Set<Long> dictIdList;
|
private Set<Long> dictIdList;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取树形列表
|
* 获取树形列表
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -141,21 +141,17 @@ public class DictServiceImpl extends ServiceImpl<DictMapper, SysDict> implements
|
||||||
// 填充拼音
|
// 填充拼音
|
||||||
sysDict.setDictNamePinyin(pinYinApi.parseEveryPinyinFirstLetter(sysDict.getDictName()));
|
sysDict.setDictNamePinyin(pinYinApi.parseEveryPinyinFirstLetter(sysDict.getDictName()));
|
||||||
|
|
||||||
// 填充pids
|
|
||||||
//String pids = this.createPids(sysDict.getDictParentId());
|
|
||||||
//sysDict.setDictPids(pids);
|
|
||||||
|
|
||||||
this.updateById(sysDict);
|
this.updateById(sysDict);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SysDict detail(DictRequest dictRequest) {
|
public SysDict detail(DictRequest dictRequest) {
|
||||||
SysDict sysDict= this.querySysDict(dictRequest);
|
SysDict sysDict = this.querySysDict(dictRequest);
|
||||||
if(ObjectUtil.isNotEmpty(sysDict.getDictTypeId())) {
|
if (ObjectUtil.isNotEmpty(sysDict.getDictTypeId())) {
|
||||||
SysDictType sysDictType=dictTypeService.getById(sysDict.getDictTypeId());
|
SysDictType sysDictType = dictTypeService.getById(sysDict.getDictTypeId());
|
||||||
sysDict.setDictTypeName(sysDictType.getDictTypeName());
|
sysDict.setDictTypeName(sysDictType.getDictTypeName());
|
||||||
}
|
}
|
||||||
return sysDict;
|
return sysDict;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -362,11 +358,10 @@ public class DictServiceImpl extends ServiceImpl<DictMapper, SysDict> implements
|
||||||
// 根据名称或者编码进行查询
|
// 根据名称或者编码进行查询
|
||||||
String searchText = dictRequest.getSearchText();
|
String searchText = dictRequest.getSearchText();
|
||||||
if (ObjectUtil.isNotEmpty(searchText)) {
|
if (ObjectUtil.isNotEmpty(searchText)) {
|
||||||
queryWrapper.and(wq -> {
|
queryWrapper.and(wq -> {
|
||||||
wq.like(SysDict::getDictName, searchText)
|
wq.like(SysDict::getDictName, searchText).or().like(SysDict::getDictCode, searchText).or()
|
||||||
.or().like(SysDict::getDictCode, searchText)
|
.like(SysDict::getDictNamePinyin, searchText);
|
||||||
.or().like(SysDict::getDictNamePinyin, searchText);
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 根据字典类型id查询字典
|
// 根据字典类型id查询字典
|
||||||
|
@ -452,9 +447,9 @@ public class DictServiceImpl extends ServiceImpl<DictMapper, SysDict> implements
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void batchDelete(DictRequest dictRequest) {
|
public void batchDelete(DictRequest dictRequest) {
|
||||||
this.removeBatchByIds(dictRequest.getDictIdList());
|
this.removeBatchByIds(dictRequest.getDictIdList());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue