pms国网上送代码提交
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.njcn.system.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||
@@ -8,6 +9,7 @@ import com.njcn.system.pojo.vo.DictTreeVO;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -54,24 +56,22 @@ public class SysDicTreePOServiceImpl extends ServiceImpl<SysDicTreePOMapper, Sys
|
||||
|
||||
@Override
|
||||
public List<DictTreeVO> queryByPid(String pid) {
|
||||
List<DictTreeVO> collect = new ArrayList<>();
|
||||
LambdaQueryWrapper<SysDicTreePO> query = new LambdaQueryWrapper<>();
|
||||
query.clear();
|
||||
query.eq(SysDicTreePO::getPid, pid).eq(SysDicTreePO::getStatus,"0");
|
||||
List<SysDicTreePO> resultList = this.list(query);
|
||||
|
||||
SysDicTreePO byId = this.getById(pid);
|
||||
|
||||
if (resultList != null && resultList.size() > 0) {
|
||||
List<DictTreeVO> collect = resultList.stream().map(temp -> {
|
||||
if (CollUtil.isNotEmpty(resultList)) {
|
||||
collect = resultList.stream().map(temp -> {
|
||||
DictTreeVO resultVO = new DictTreeVO();
|
||||
BeanUtils.copyProperties(temp, resultVO);
|
||||
|
||||
resultVO.setPname(byId.getName());
|
||||
return resultVO;
|
||||
}).collect(Collectors.toList());
|
||||
return collect;
|
||||
}
|
||||
return null;
|
||||
return collect;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user