|
|
@ -6,21 +6,23 @@ import cn.hutool.core.lang.tree.Tree; |
|
|
|
import cn.hutool.core.lang.tree.TreeNode; |
|
|
|
import cn.hutool.core.lang.tree.TreeNode; |
|
|
|
import cn.hutool.core.lang.tree.TreeUtil; |
|
|
|
import cn.hutool.core.lang.tree.TreeUtil; |
|
|
|
import cn.hutool.json.JSONUtil; |
|
|
|
import cn.hutool.json.JSONUtil; |
|
|
|
import com.dxhy.order.constant.ConfigureConstant; |
|
|
|
|
|
|
|
import com.dxhy.order.constant.OrderInfoEnum; |
|
|
|
|
|
|
|
import com.dxhy.order.constant.OrderManagementConstant; |
|
|
|
|
|
|
|
import com.dxhy.order.model.R; |
|
|
|
|
|
|
|
import com.dxhy.order.utils.DistributedKeyMaker; |
|
|
|
|
|
|
|
import com.dxhy.order.baseservice.module.groupmanagement.dao.GroupManagementMapper; |
|
|
|
import com.dxhy.order.baseservice.module.groupmanagement.dao.GroupManagementMapper; |
|
|
|
import com.dxhy.order.baseservice.module.groupmanagement.model.GroupDataStatusUpdate; |
|
|
|
import com.dxhy.order.baseservice.module.groupmanagement.model.GroupDataStatusUpdate; |
|
|
|
import com.dxhy.order.baseservice.module.groupmanagement.model.GroupManagementEntity; |
|
|
|
import com.dxhy.order.baseservice.module.groupmanagement.model.GroupManagementEntity; |
|
|
|
import com.dxhy.order.baseservice.module.groupmanagement.model.GroupManagementQuery; |
|
|
|
import com.dxhy.order.baseservice.module.groupmanagement.model.GroupManagementQuery; |
|
|
|
import com.dxhy.order.baseservice.module.groupmanagement.model.GroupTreeVO; |
|
|
|
import com.dxhy.order.baseservice.module.groupmanagement.model.GroupTreeVO; |
|
|
|
import com.dxhy.order.baseservice.module.groupmanagement.service.GroupManagementService; |
|
|
|
import com.dxhy.order.baseservice.module.groupmanagement.service.GroupManagementService; |
|
|
|
|
|
|
|
import com.dxhy.order.baseservice.module.thirdservice.user.model.DeptEntity; |
|
|
|
import com.dxhy.order.baseservice.module.thirdservice.user.model.TaxPlayerCodeDept; |
|
|
|
import com.dxhy.order.baseservice.module.thirdservice.user.model.TaxPlayerCodeDept; |
|
|
|
import com.dxhy.order.baseservice.module.thirdservice.user.model.UserEntity; |
|
|
|
import com.dxhy.order.baseservice.module.thirdservice.user.model.UserEntity; |
|
|
|
import com.dxhy.order.baseservice.module.thirdservice.user.model.bo.UserInfoQuery; |
|
|
|
import com.dxhy.order.baseservice.module.thirdservice.user.model.bo.UserInfoQuery; |
|
|
|
import com.dxhy.order.baseservice.module.thirdservice.user.service.UserInfoService; |
|
|
|
import com.dxhy.order.baseservice.module.thirdservice.user.service.UserInfoService; |
|
|
|
|
|
|
|
import com.dxhy.order.constant.ConfigureConstant; |
|
|
|
|
|
|
|
import com.dxhy.order.constant.OrderInfoEnum; |
|
|
|
|
|
|
|
import com.dxhy.order.constant.OrderManagementConstant; |
|
|
|
|
|
|
|
import com.dxhy.order.model.R; |
|
|
|
|
|
|
|
import com.dxhy.order.utils.DistributedKeyMaker; |
|
|
|
|
|
|
|
import com.google.common.collect.Lists; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
@ -209,9 +211,9 @@ public class GroupManagementServiceImpl implements GroupManagementService { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public List<GroupTreeVO> buildGroupTree(List<TaxPlayerCodeDept> taxplayercodeDeptList) { |
|
|
|
public List<GroupTreeVO> buildGroupTree(List<TaxPlayerCodeDept> taxplayercodeDeptList) { |
|
|
|
//查找出level最小的节点
|
|
|
|
//查找出level最小的节点
|
|
|
|
TaxPlayerCodeDept taxPlayerCodeDeptMinLevel = taxplayercodeDeptList.stream().min(Comparator.comparing(TaxPlayerCodeDept::getLevel)).get(); |
|
|
|
// TaxPlayerCodeDept taxPlayerCodeDeptMinLevel = taxplayercodeDeptList.stream().min(Comparator.comparing(TaxPlayerCodeDept::getLevel)).get();
|
|
|
|
String parentId = StringUtils.isBlank(taxPlayerCodeDeptMinLevel.getParentId()) ? "0" : taxPlayerCodeDeptMinLevel.getParentId(); |
|
|
|
// String parentId = StringUtils.isBlank(taxPlayerCodeDeptMinLevel.getParentId()) ? "0" : taxPlayerCodeDeptMinLevel.getParentId();
|
|
|
|
|
|
|
|
List<String> parentIdList = taxplayercodeDeptList.stream().map(DeptEntity::getParentId).collect(Collectors.toList()); |
|
|
|
List<TreeNode<String>> nodeList = CollUtil.newArrayList(); |
|
|
|
List<TreeNode<String>> nodeList = CollUtil.newArrayList(); |
|
|
|
taxplayercodeDeptList.forEach(taxPlayerCodeDept -> { |
|
|
|
taxplayercodeDeptList.forEach(taxPlayerCodeDept -> { |
|
|
|
TreeNode<String> treeNode; |
|
|
|
TreeNode<String> treeNode; |
|
|
@ -228,9 +230,13 @@ public class GroupManagementServiceImpl implements GroupManagementService { |
|
|
|
treeNode.setExtra(extra); |
|
|
|
treeNode.setExtra(extra); |
|
|
|
nodeList.add(treeNode); |
|
|
|
nodeList.add(treeNode); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
List<GroupTreeVO> tree = Lists.newArrayList(); |
|
|
|
List<Tree<String>> treeList = TreeUtil.build(nodeList, parentId); |
|
|
|
for (String parentId : parentIdList) { |
|
|
|
return transGroupTreeVo(treeList); |
|
|
|
List<Tree<String>> treeList = TreeUtil.build(nodeList, parentId); |
|
|
|
|
|
|
|
List<GroupTreeVO> treeVOS = transGroupTreeVo(treeList); |
|
|
|
|
|
|
|
tree.addAll(treeVOS); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return tree; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|