fix(property):
This commit is contained in:
parent
f45442e954
commit
a198e0c720
@ -114,7 +114,10 @@ public class RemoteFloorServiceImpl implements RemoteFloorService {
|
||||
List<RemoteFloorVo> remoteFloorVos = new ArrayList<>();
|
||||
|
||||
tbFloorVo.forEach(item -> {
|
||||
RemoteFloorVo remoteFloorVo = MapstructUtils.convert(item, RemoteFloorVo.class);
|
||||
RemoteFloorVo remoteFloorVo = new RemoteFloorVo();
|
||||
remoteFloorVo.setId(item.getId());
|
||||
remoteFloorVo.setFloorName(item.getFloorName());
|
||||
remoteFloorVo.setFloorNumber(item.getFloorNumber());
|
||||
remoteFloorVos.add(remoteFloorVo);
|
||||
});
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
package org.dromara.sis.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.dromara.sis.domain.SisAuthRecord;
|
||||
import org.dromara.sis.domain.vo.SisAuthRecordVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
@ -12,6 +13,7 @@ import java.util.List;
|
||||
* @author lsm
|
||||
* @since 2025-07-14
|
||||
*/
|
||||
@Mapper
|
||||
public interface SisAuthRecordMapper extends BaseMapperPlus<SisAuthRecord, SisAuthRecordVo> {
|
||||
List<SisAuthRecordVo> checkAuth(Long personId);
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package org.dromara.sis.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import org.apache.dubbo.config.annotation.DubboReference;
|
||||
import org.dromara.common.core.domain.TreeNode;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
@ -11,6 +12,8 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.property.api.RemoteFloorService;
|
||||
import org.dromara.property.api.domain.vo.RemoteFloorVo;
|
||||
import org.dromara.sis.domain.bo.SisAccessControlBo;
|
||||
import org.dromara.sis.domain.bo.SisElevatorInfoBo;
|
||||
import org.dromara.sis.domain.vo.SisAccessControlVo;
|
||||
@ -25,6 +28,7 @@ import org.dromara.sis.mapper.SisAuthRecordMapper;
|
||||
import org.dromara.sis.service.ISisAuthRecordService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
@ -45,6 +49,9 @@ public class SisAuthRecordServiceImpl implements ISisAuthRecordService {
|
||||
private final ISisAccessControlService accessControlService;
|
||||
private final ISisElevatorInfoService elevatorInfoService;
|
||||
|
||||
@DubboReference
|
||||
private RemoteFloorService remoteFloorService;
|
||||
|
||||
/**
|
||||
* 查询授权记录
|
||||
*
|
||||
@ -247,19 +254,36 @@ public class SisAuthRecordServiceImpl implements ISisAuthRecordService {
|
||||
return node;
|
||||
}).toList();
|
||||
|
||||
List<TreeNode<Long>> eleChildrenList = eleVoList.stream().map(item -> {
|
||||
TreeNode<Long> node = new TreeNode<>();
|
||||
node.setLevel(2);
|
||||
node.setCode(item.getElevatorId());
|
||||
node.setParentCode(2L);
|
||||
node.setLabel(item.getElevatorName());
|
||||
return node;
|
||||
}).toList();
|
||||
List<TreeNode<Long>> eleChildrenList = new ArrayList<>();
|
||||
eleVoList.forEach(item -> {
|
||||
// 电梯子节点
|
||||
TreeNode<Long> eleNode = new TreeNode<>();
|
||||
eleNode.setLevel(2);
|
||||
eleNode.setParentCode(2L);
|
||||
eleNode.setCode(item.getElevatorId());
|
||||
eleNode.setLabel(item.getElevatorName());
|
||||
|
||||
// 楼层节点
|
||||
List<TreeNode<Long>> floorTree = new ArrayList<>();
|
||||
// 获取楼层
|
||||
List<RemoteFloorVo> floorInfoList = remoteFloorService.queryByUnitId(item.getUnitId());
|
||||
floorInfoList.forEach(floor -> {
|
||||
TreeNode<Long> floorNode = new TreeNode<>();
|
||||
floorNode.setLevel(3);
|
||||
floorNode.setCode(floor.getId());
|
||||
floorNode.setLabel(floor.getFloorName());
|
||||
floorNode.setParentCode(item.getElevatorId());
|
||||
floorTree.add(floorNode);
|
||||
});
|
||||
eleNode.setChildren(floorTree);
|
||||
eleChildrenList.add(eleNode);
|
||||
});
|
||||
|
||||
// 将子节点列表分别添加到对应的父节点
|
||||
accessNode.setChildren(acChildrenList);
|
||||
elevatorNode.setChildren(eleChildrenList);
|
||||
|
||||
|
||||
// 最后将两个父节点添加到根节点
|
||||
root.setChildren(List.of(accessNode, elevatorNode));
|
||||
return List.of(root);
|
||||
|
Loading…
Reference in New Issue
Block a user