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.NotNull;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
|
@ -47,7 +46,7 @@ public class SysConfigTypeParam extends BaseRequest {
|
|||
/**
|
||||
* 配置类型id
|
||||
*/
|
||||
@NotNull(message = "配置类型id不能为空", groups = {edit.class, delete.class, detail.class})
|
||||
@NotNull(message = "配置类型id不能为空", groups = {edit.class, delete.class, detail.class})
|
||||
@ChineseDescription("配置类型id")
|
||||
private Long configTypeId;
|
||||
|
||||
|
|
|
@ -298,10 +298,8 @@ public class SysConfigServiceImpl extends ServiceImpl<SysConfigMapper, SysConfig
|
|||
String searchText = sysConfigParam.getSearchText();
|
||||
if (ObjectUtil.isNotEmpty(searchText)) {
|
||||
queryWrapper.and(wq -> {
|
||||
wq.like(SysConfig::getConfigName, searchText)
|
||||
.or().like(SysConfig::getConfigCode, searchText)
|
||||
.or().like(SysConfig::getConfigValue, searchText)
|
||||
.or().like(SysConfig::getRemark, searchText);
|
||||
wq.like(SysConfig::getConfigName, searchText).or().like(SysConfig::getConfigCode, 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.rule.annotation.ChineseDescription;
|
||||
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 lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
@ -154,7 +153,7 @@ public class DictRequest extends BaseRequest {
|
|||
@NotEmpty(message = "dictId集合不能为空", groups = batchDelete.class)
|
||||
@ChineseDescription("dictId集合,用在批量删除")
|
||||
private Set<Long> dictIdList;
|
||||
|
||||
|
||||
/**
|
||||
* 获取树形列表
|
||||
*/
|
||||
|
|
|
@ -141,21 +141,17 @@ public class DictServiceImpl extends ServiceImpl<DictMapper, SysDict> implements
|
|||
// 填充拼音
|
||||
sysDict.setDictNamePinyin(pinYinApi.parseEveryPinyinFirstLetter(sysDict.getDictName()));
|
||||
|
||||
// 填充pids
|
||||
//String pids = this.createPids(sysDict.getDictParentId());
|
||||
//sysDict.setDictPids(pids);
|
||||
|
||||
this.updateById(sysDict);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SysDict detail(DictRequest dictRequest) {
|
||||
SysDict sysDict= this.querySysDict(dictRequest);
|
||||
if(ObjectUtil.isNotEmpty(sysDict.getDictTypeId())) {
|
||||
SysDictType sysDictType=dictTypeService.getById(sysDict.getDictTypeId());
|
||||
sysDict.setDictTypeName(sysDictType.getDictTypeName());
|
||||
}
|
||||
return sysDict;
|
||||
SysDict sysDict = this.querySysDict(dictRequest);
|
||||
if (ObjectUtil.isNotEmpty(sysDict.getDictTypeId())) {
|
||||
SysDictType sysDictType = dictTypeService.getById(sysDict.getDictTypeId());
|
||||
sysDict.setDictTypeName(sysDictType.getDictTypeName());
|
||||
}
|
||||
return sysDict;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -362,11 +358,10 @@ public class DictServiceImpl extends ServiceImpl<DictMapper, SysDict> implements
|
|||
// 根据名称或者编码进行查询
|
||||
String searchText = dictRequest.getSearchText();
|
||||
if (ObjectUtil.isNotEmpty(searchText)) {
|
||||
queryWrapper.and(wq -> {
|
||||
wq.like(SysDict::getDictName, searchText)
|
||||
.or().like(SysDict::getDictCode, searchText)
|
||||
.or().like(SysDict::getDictNamePinyin, searchText);
|
||||
});
|
||||
queryWrapper.and(wq -> {
|
||||
wq.like(SysDict::getDictName, searchText).or().like(SysDict::getDictCode, searchText).or()
|
||||
.like(SysDict::getDictNamePinyin, searchText);
|
||||
});
|
||||
}
|
||||
|
||||
// 根据字典类型id查询字典
|
||||
|
@ -452,9 +447,9 @@ public class DictServiceImpl extends ServiceImpl<DictMapper, SysDict> implements
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void batchDelete(DictRequest dictRequest) {
|
||||
this.removeBatchByIds(dictRequest.getDictIdList());
|
||||
}
|
||||
@Override
|
||||
public void batchDelete(DictRequest dictRequest) {
|
||||
this.removeBatchByIds(dictRequest.getDictIdList());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue