增加设备和门禁的关联关系

This commit is contained in:
lxj
2025-08-06 12:35:22 +08:00
parent 2a36ddf688
commit 70fe6d713a
18 changed files with 561 additions and 87 deletions

View File

@@ -5,17 +5,14 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
import org.dromara.common.core.domain.TreeNode;
import org.dromara.common.core.utils.MapstructUtils;
import org.dromara.common.redis.utils.RedisUtils;
import org.dromara.property.api.RemoteFloorService;
import org.dromara.property.api.domain.vo.RemoteFloorVo;
import org.dromara.property.domain.vo.TbBuildingVo;
import org.dromara.property.domain.vo.TbCommunityVo;
import org.dromara.property.domain.vo.TbFloorVo;
import org.dromara.property.domain.vo.TbUnitVo;
import org.dromara.property.service.ITbBuildingService;
import org.dromara.property.service.ITbCommunityService;
import org.dromara.property.service.ITbFloorService;
import org.dromara.property.service.ITbUnitService;
import java.util.ArrayList;
import java.util.List;
@@ -32,7 +29,6 @@ public class RemoteFloorServiceImpl implements RemoteFloorService {
private final ITbCommunityService tbCommunityService;
private final ITbBuildingService tbBuildingService;
private final ITbUnitService unitService;
private final ITbFloorService floorService;
@Override
@@ -72,20 +68,6 @@ public class RemoteFloorServiceImpl implements RemoteFloorService {
return node;
}).toList();
treeList.addAll(l2);
List<TbUnitVo> tbUnitVos = unitService.queryAll();
if (tbUnitVos == null || tbUnitVos.isEmpty()) {
return treeList;
}
List<TreeNode<Long>> l3 = tbUnitVos.stream().map(item -> {
TreeNode<Long> node = new TreeNode<>();
node.setLevel(3);
node.setCode(item.getId());
node.setParentCode(item.getBuildingId());
node.setLabel(item.getUnitName());
return node;
}).toList();
treeList.addAll(l3);
List<TbFloorVo> tbFloorVos = floorService.queryAll();
if (tbFloorVos == null || tbFloorVos.isEmpty()) {
return treeList;
@@ -94,7 +76,7 @@ public class RemoteFloorServiceImpl implements RemoteFloorService {
TreeNode<Long> node = new TreeNode<>();
node.setLevel(4);
node.setCode(item.getId());
node.setParentCode(item.getUnitId());
node.setParentCode(item.getBuildingId());
node.setLabel(item.getFloorName());
return node;
}).toList();
@@ -109,7 +91,7 @@ public class RemoteFloorServiceImpl implements RemoteFloorService {
* @return 楼层
*/
@Override
public List<RemoteFloorVo> queryByBuildingId(Long buildingId){
public List<RemoteFloorVo> queryByBuildingId(Long buildingId) {
List<TbFloorVo> tbFloorVo = floorService.queryByBuildingId(buildingId);
List<RemoteFloorVo> remoteFloorVos = new ArrayList<>();