|
|
@@ -13,14 +13,14 @@ import cn.iocoder.yudao.module.pms.dal.dataobject.iotwebtopoproject.IotWebtopoPr
|
|
|
import cn.iocoder.yudao.module.pms.dal.dataobject.iotwebtopoprojectdevice.IotWebtopoProjectDeviceDO;
|
|
|
import cn.iocoder.yudao.module.pms.dal.mysql.iotwebtopoproject.IotWebtopoProjectMapper;
|
|
|
import cn.iocoder.yudao.module.pms.dal.mysql.iotwebtopoprojectdevice.IotWebtopoProjectDeviceMapper;
|
|
|
+import cn.iocoder.yudao.module.system.service.dept.DeptService;
|
|
|
import com.google.common.collect.ImmutableMap;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import java.time.LocalDateTime;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.List;
|
|
|
+import java.util.*;
|
|
|
|
|
|
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
|
|
import static cn.iocoder.yudao.module.pms.enums.ErrorCodeConstant.IOT_WEBTOPO_PROJECT_NOT_EXISTS;
|
|
|
@@ -40,6 +40,9 @@ public class IotWebtopoProjectServiceImpl implements IotWebtopoProjectService {
|
|
|
@Resource
|
|
|
private IotWebtopoProjectDeviceMapper iotWebtopoProjectDeviceMapper;
|
|
|
|
|
|
+ @Resource
|
|
|
+ private DeptService deptService;
|
|
|
+
|
|
|
@Override
|
|
|
public Long createIotWebtopoProject(IotWebtopoProjectSaveReqVO createReqVO) {
|
|
|
// 插入
|
|
|
@@ -117,6 +120,13 @@ public class IotWebtopoProjectServiceImpl implements IotWebtopoProjectService {
|
|
|
|
|
|
@Override
|
|
|
public PageResult<IotWebtopoProjectDO> getIotWebtopoProjectPage(IotWebtopoProjectPageReqVO pageReqVO) {
|
|
|
+ // 查询指定部门下所有子部门的数据
|
|
|
+ Set<Long> ids = new HashSet<>();
|
|
|
+ if (Objects.nonNull(pageReqVO.getDeptId())) {
|
|
|
+ ids = deptService.getChildDeptIdListFromCache(pageReqVO.getDeptId());
|
|
|
+ ids.add(pageReqVO.getDeptId());
|
|
|
+ pageReqVO.setDeptIds(ids);
|
|
|
+ }
|
|
|
return iotWebtopoProjectMapper.selectPage(pageReqVO);
|
|
|
}
|
|
|
|