|
@@ -7,6 +7,7 @@ import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
|
import cn.iocoder.yudao.framework.datapermission.core.annotation.DataPermission;
|
|
import cn.iocoder.yudao.framework.datapermission.core.annotation.DataPermission;
|
|
import cn.iocoder.yudao.module.pms.controller.admin.vo.IotInfoClassifyListReqVO;
|
|
import cn.iocoder.yudao.module.pms.controller.admin.vo.IotInfoClassifyListReqVO;
|
|
import cn.iocoder.yudao.module.pms.controller.admin.vo.IotInfoClassifySaveReqVO;
|
|
import cn.iocoder.yudao.module.pms.controller.admin.vo.IotInfoClassifySaveReqVO;
|
|
|
|
+import cn.iocoder.yudao.module.pms.dal.dataobject.IotDeviceDO;
|
|
import cn.iocoder.yudao.module.pms.dal.dataobject.IotInfoClassifyDO;
|
|
import cn.iocoder.yudao.module.pms.dal.dataobject.IotInfoClassifyDO;
|
|
import cn.iocoder.yudao.module.pms.dal.mysql.IotInfoClassifyMapper;
|
|
import cn.iocoder.yudao.module.pms.dal.mysql.IotInfoClassifyMapper;
|
|
import cn.iocoder.yudao.module.pms.dal.dataobject.IotTreeDO;
|
|
import cn.iocoder.yudao.module.pms.dal.dataobject.IotTreeDO;
|
|
@@ -48,6 +49,10 @@ public class IotInfoClassifyServiceImpl implements IotInfoClassifyService {
|
|
private IotTreeMapper iotTreeMapper;
|
|
private IotTreeMapper iotTreeMapper;
|
|
@Autowired
|
|
@Autowired
|
|
private IotInfoMapper iotInfoMapper;
|
|
private IotInfoMapper iotInfoMapper;
|
|
|
|
+ @Autowired
|
|
|
|
+ private DeviceServiceImpl deviceServiceImpl;
|
|
|
|
+ @Autowired
|
|
|
|
+ private IotDeviceService iotDeviceService;
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@CacheEvict(cacheNames = RedisKeyConstants.IOT_INFO_CHILDREN_ID_LIST,
|
|
@CacheEvict(cacheNames = RedisKeyConstants.IOT_INFO_CHILDREN_ID_LIST,
|
|
@@ -70,7 +75,8 @@ public class IotInfoClassifyServiceImpl implements IotInfoClassifyService {
|
|
iotTreeDO.setType("file");
|
|
iotTreeDO.setType("file");
|
|
iotTreeDO.setOriginId(infoClassifyDO.getId());
|
|
iotTreeDO.setOriginId(infoClassifyDO.getId());
|
|
iotTreeDO.setName(infoClassifyDO.getName());
|
|
iotTreeDO.setName(infoClassifyDO.getName());
|
|
- iotTreeDO.setDeptId(infoClassifyDO.getDeptId());
|
|
|
|
|
|
+ IotDeviceDO iotDevice = iotDeviceService.getIotDevice(infoClassifyDO.getDeviceId());
|
|
|
|
+ iotTreeDO.setDeptId(Objects.isNull(iotDevice) ? null : iotDevice.getDeptId());
|
|
List<IotTreeDO> iotTreeDOS = iotTreeMapper.selectListByOriginId(infoClassifyDO.getDeviceId(),"device");
|
|
List<IotTreeDO> iotTreeDOS = iotTreeMapper.selectListByOriginId(infoClassifyDO.getDeviceId(),"device");
|
|
List<IotTreeDO> iotTreeDOSs = iotTreeMapper.selectListByOriginId(infoClassifyDO.getParentId(),"file");
|
|
List<IotTreeDO> iotTreeDOSs = iotTreeMapper.selectListByOriginId(infoClassifyDO.getParentId(),"file");
|
|
if (CollUtil.isEmpty(iotTreeDOSs)) {
|
|
if (CollUtil.isEmpty(iotTreeDOSs)) {
|