Browse Source

设备管理-20240913

thing_master
xiezw 1 year ago
parent
commit
979be9ed8d
  1. 2
      modules/equipment/src/main/java/com/thing/eq/eqmanager/service/impl/IotThingsServiceImpl.java
  2. 1
      modules/thing/src/main/java/com/thing/thing/relation/detail/service/IotThingRelationDetailService.java
  3. 9
      modules/thing/src/main/java/com/thing/thing/relation/detail/service/impl/IotThingRelationDetailServiceImpl.java

2
modules/equipment/src/main/java/com/thing/eq/eqmanager/service/impl/IotThingsServiceImpl.java

@ -195,7 +195,7 @@ public class IotThingsServiceImpl implements IotThingsService {
//保存设备的关系 //保存设备的关系
List<IotThingRelationDetailDTO> relationDetailDTOS = List<IotThingRelationDetailDTO> relationDetailDTOS =
iotThingRelationDetailService.findRootDetailChildNodeByRootIdAndFromIdAndRootThingId(dto.getRelationTypeId(), parentThing.getId(), dto.getRelationTopId());
iotThingRelationDetailService.findRootDetailChildNodeByRootIdAndToIdAndRootThingId(dto.getRelationTypeId(), parentThing.getId(), dto.getRelationTopId());
IotThingRelationDetailParamDTO relationDTO = new IotThingRelationDetailParamDTO(); IotThingRelationDetailParamDTO relationDTO = new IotThingRelationDetailParamDTO();
relationDTO.setRootId(dto.getRelationTypeId()); relationDTO.setRootId(dto.getRelationTypeId());

1
modules/thing/src/main/java/com/thing/thing/relation/detail/service/IotThingRelationDetailService.java

@ -75,4 +75,5 @@ public interface IotThingRelationDetailService extends IBaseService<IotThingRela
void saveRelationNodes(ThingRelationDTO relationDTO); void saveRelationNodes(ThingRelationDTO relationDTO);
List<IotThingRelationDetailDTO> findRootDetailChildNodeByRootIdAndToIdAndRootThingId(Long relationTypeId, Long id, Long relationTopId);
} }

9
modules/thing/src/main/java/com/thing/thing/relation/detail/service/impl/IotThingRelationDetailServiceImpl.java

@ -708,6 +708,15 @@ public class IotThingRelationDetailServiceImpl extends BaseServiceImpl<IotThingR
, IotThingRelationDetailDTO.class); , IotThingRelationDetailDTO.class);
} }
@Override
public List<IotThingRelationDetailDTO> findRootDetailChildNodeByRootIdAndToIdAndRootThingId(Long rootId, Long toId, Long rootThingId) {
return mapper.selectListByQueryAs(QueryWrapper.create()
.eq(IotThingRelationDetailEntity::getRootId, rootId)
.eq(IotThingRelationDetailEntity::getToId, toId)
.eq(IotThingRelationDetailEntity::getRootThingId, rootThingId, ObjectUtil.isNotNull(rootThingId))
, IotThingRelationDetailDTO.class);
}
@Override @Override
public IotThingRelationDetailDTO findRootDetailParentNodeByRootIdAndToIdAndRootThingId(Long rootId, Long toId, Long rootThingId) { public IotThingRelationDetailDTO findRootDetailParentNodeByRootIdAndToIdAndRootThingId(Long rootId, Long toId, Long rootThingId) {
return mapper.selectOneByQueryAs(QueryWrapper.create() return mapper.selectOneByQueryAs(QueryWrapper.create()

Loading…
Cancel
Save