微调
This commit is contained in:
@@ -50,6 +50,7 @@ public class PqSourceServiceImpl extends ServiceImpl<PqSourceMapper, PqSource> i
|
|||||||
public boolean addPqSource(PqSourceParam param) {
|
public boolean addPqSource(PqSourceParam param) {
|
||||||
PqSource pqSource = new PqSource();
|
PqSource pqSource = new PqSource();
|
||||||
BeanUtil.copyProperties(param, pqSource);
|
BeanUtil.copyProperties(param, pqSource);
|
||||||
|
pqSource.setParameter(StrUtil.isBlank(pqSource.getParameter()) ? null : pqSource.getParameter());
|
||||||
pqSource.setState(DataStateEnum.ENABLE.getCode());
|
pqSource.setState(DataStateEnum.ENABLE.getCode());
|
||||||
return this.save(pqSource);
|
return this.save(pqSource);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -80,4 +80,11 @@ public interface IDictDataService extends IService<DictData> {
|
|||||||
* @param queryParam 查询参数
|
* @param queryParam 查询参数
|
||||||
*/
|
*/
|
||||||
void exportDictData(DictDataParam.QueryParam queryParam);
|
void exportDictData(DictDataParam.QueryParam queryParam);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据字典类型id删除字典数据
|
||||||
|
* @param ids 字典类型id集合
|
||||||
|
* @return 成功返回true,失败返回false
|
||||||
|
*/
|
||||||
|
boolean deleteDictDataByDictTypeId(List<String> ids);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -166,6 +166,14 @@ public class DictDataServiceImpl extends ServiceImpl<DictDataMapper, DictData> i
|
|||||||
ExcelUtil.exportExcel("字典数据导出数据.xlsx", "字典数据", DictDataExcel.class, dictDataExcels);
|
ExcelUtil.exportExcel("字典数据导出数据.xlsx", "字典数据", DictDataExcel.class, dictDataExcels);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean deleteDictDataByDictTypeId(List<String> ids) {
|
||||||
|
QueryWrapper<DictData> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq("sys_dict_data.type_id", ids)
|
||||||
|
.ne("sys_dict_data.state", DataStateEnum.DELETED.getCode());
|
||||||
|
return this.remove(queryWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验参数,检查是否存在相同名称的字典类型
|
* 校验参数,检查是否存在相同名称的字典类型
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import com.njcn.gather.system.dictionary.mapper.DictTypeMapper;
|
|||||||
import com.njcn.gather.system.dictionary.pojo.param.DictTypeParam;
|
import com.njcn.gather.system.dictionary.pojo.param.DictTypeParam;
|
||||||
import com.njcn.gather.system.dictionary.pojo.po.DictType;
|
import com.njcn.gather.system.dictionary.pojo.po.DictType;
|
||||||
import com.njcn.gather.system.dictionary.pojo.vo.DictTypeExcel;
|
import com.njcn.gather.system.dictionary.pojo.vo.DictTypeExcel;
|
||||||
|
import com.njcn.gather.system.dictionary.service.IDictDataService;
|
||||||
import com.njcn.gather.system.dictionary.service.IDictTypeService;
|
import com.njcn.gather.system.dictionary.service.IDictTypeService;
|
||||||
import com.njcn.gather.system.pojo.enums.SystemResponseEnum;
|
import com.njcn.gather.system.pojo.enums.SystemResponseEnum;
|
||||||
import com.njcn.web.factory.PageFactory;
|
import com.njcn.web.factory.PageFactory;
|
||||||
@@ -30,6 +31,7 @@ import java.util.List;
|
|||||||
@Service
|
@Service
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class DictTypeServiceImpl extends ServiceImpl<DictTypeMapper, DictType> implements IDictTypeService {
|
public class DictTypeServiceImpl extends ServiceImpl<DictTypeMapper, DictType> implements IDictTypeService {
|
||||||
|
private final IDictDataService dictDataService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Page<DictType> listDictTypes(DictTypeParam.QueryParam queryParam) {
|
public Page<DictType> listDictTypes(DictTypeParam.QueryParam queryParam) {
|
||||||
@@ -71,6 +73,7 @@ public class DictTypeServiceImpl extends ServiceImpl<DictTypeMapper, DictType> i
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean deleteDictType(List<String> ids) {
|
public boolean deleteDictType(List<String> ids) {
|
||||||
|
dictDataService.deleteDictDataByDictTypeId(ids);
|
||||||
return this.lambdaUpdate()
|
return this.lambdaUpdate()
|
||||||
.set(DictType::getState, DataStateEnum.DELETED.getCode())
|
.set(DictType::getState, DataStateEnum.DELETED.getCode())
|
||||||
.in(DictType::getId, ids)
|
.in(DictType::getId, ids)
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ public interface SystemValidMessage {
|
|||||||
|
|
||||||
String CODE_NOT_BLANK = "编码不能为空,请检查code参数";
|
String CODE_NOT_BLANK = "编码不能为空,请检查code参数";
|
||||||
|
|
||||||
String CODE_FORMAT_ERROR = "编号格式错误,请检查code参数";
|
String CODE_FORMAT_ERROR = "编码格式错误,请检查code参数";
|
||||||
|
|
||||||
String SORT_NOT_NULL = "排序不能为空,请检查sort参数";
|
String SORT_NOT_NULL = "排序不能为空,请检查sort参数";
|
||||||
|
|
||||||
|
|||||||
@@ -158,9 +158,6 @@ public class SysFunctionServiceImpl extends ServiceImpl<SysFunctionMapper, SysFu
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据当前分类找出子类,递归找出子类的子类
|
|
||||||
*/
|
|
||||||
private <T extends SysFunction> List<SysFunction> getChildrenList(T currMenu, List<? extends SysFunction> categories) {
|
private <T extends SysFunction> List<SysFunction> getChildrenList(T currMenu, List<? extends SysFunction> categories) {
|
||||||
return categories.stream().filter(o -> Objects.equals(o.getPid(), currMenu.getId())).peek(o -> o.setChildren(getChildrenList(o, categories))).sorted(Comparator.comparingInt(SysFunction::getSort)).collect(Collectors.toList());
|
return categories.stream().filter(o -> Objects.equals(o.getPid(), currMenu.getId())).peek(o -> o.setChildren(getChildrenList(o, categories))).sorted(Comparator.comparingInt(SysFunction::getSort)).collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user