|
@@ -5,9 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.google.common.collect.Lists;
|
|
|
-import jodd.util.ArraysUtil;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
-import org.apache.commons.lang.ArrayUtils;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
import org.springblade.common.utils.FileUtils;
|
|
|
import org.springblade.common.utils.SnowFlakeUtil;
|
|
@@ -41,7 +39,6 @@ import org.springframework.web.multipart.MultipartFile;
|
|
|
import java.io.File;
|
|
|
import java.io.IOException;
|
|
|
import java.util.*;
|
|
|
-import java.util.function.Function;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
@Service
|
|
@@ -558,6 +555,35 @@ public class WbsTreeServiceImpl extends BaseServiceImpl<WbsTreeMapper, WbsTree>
|
|
|
return this.baseMapper.getTitleRange(Long.valueOf(projectId));
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public Object getQueryValueByNodeType(String wbsId, String projectId, String queryValue, Integer nodeType, Integer majorDataType) {
|
|
|
+ Set<WbsTreePrivate> resultNodes = new HashSet<>();
|
|
|
+ LambdaQueryWrapper<WbsTreePrivate> wrapper = Wrappers.<WbsTreePrivate>lambdaQuery()
|
|
|
+ .eq(WbsTreePrivate::getType, 1).eq(WbsTreePrivate::getWbsId, wbsId).eq(WbsTreePrivate::getProjectId, projectId).eq(WbsTreePrivate::getNodeType, nodeType);
|
|
|
+ if (majorDataType != null) {
|
|
|
+ if (majorDataType > 0) {
|
|
|
+ wrapper.eq(WbsTreePrivate::getMajorDataType, majorDataType);
|
|
|
+ } else if (majorDataType == -1) {
|
|
|
+ wrapper.and(wrapper1 -> wrapper1.isNull(WbsTreePrivate::getMajorDataType).or().eq(WbsTreePrivate::getMajorDataType, 0));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (queryValue != null && !queryValue.trim().isEmpty()) {
|
|
|
+ wrapper.like(WbsTreePrivate::getNodeName, queryValue);
|
|
|
+ }
|
|
|
+ List<WbsTreePrivate> wbsTreePrivates = wbsTreePrivateMapper.selectList(wrapper);
|
|
|
+ this.getParentNodesPrivateWbs(wbsTreePrivates, resultNodes, projectId, wbsId);
|
|
|
+ resultNodes.addAll(wbsTreePrivates);
|
|
|
+ List<WbsTreePrivateQueryValueVO> wbsTreePrivateQueryValueVOS = BeanUtil.copyProperties(resultNodes, WbsTreePrivateQueryValueVO.class);
|
|
|
+ if (wbsTreePrivateQueryValueVOS.size() > 0) {
|
|
|
+ List<WbsTreePrivateQueryValueVO> listRoot = wbsTreePrivateQueryValueVOS.stream().filter(f -> f.getParentId() == 0L).collect(Collectors.toList());
|
|
|
+ Map<Long, List<WbsTreePrivateQueryValueVO>> mapAll = wbsTreePrivateQueryValueVOS.stream().collect(Collectors.groupingBy(WbsTreePrivateQueryValueVO::getParentId));
|
|
|
+ this.buildWbsTreePrivateByGetQueryValueByType(listRoot, mapAll);
|
|
|
+ this.sortListPrivate(listRoot);
|
|
|
+ return listRoot;
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 公有排序
|
|
|
*/
|