|
@@ -13,6 +13,7 @@ import cn.iocoder.yudao.module.pms.dal.mysql.IotDeviceMapper;
|
|
|
import cn.iocoder.yudao.module.pms.dal.mysql.inspect.IotInspectRouteMapper;
|
|
|
import cn.iocoder.yudao.module.pms.enums.ErrorCodeConstant;
|
|
|
import cn.iocoder.yudao.module.pms.service.IotProductClassifyService;
|
|
|
+import cn.iocoder.yudao.module.system.service.dept.DeptService;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -20,7 +21,9 @@ import org.springframework.stereotype.Service;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
+import java.util.HashSet;
|
|
|
import java.util.Objects;
|
|
|
+import java.util.Set;
|
|
|
|
|
|
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
|
|
|
|
@@ -39,6 +42,8 @@ public class IotInspectRouteServiceImpl implements IotInspectRouteService {
|
|
|
private IotProductClassifyService iotProductClassifyService;
|
|
|
@Autowired
|
|
|
private IotDeviceMapper iotDeviceMapper;
|
|
|
+ @Autowired
|
|
|
+ private DeptService deptService;
|
|
|
|
|
|
@Override
|
|
|
public Long createIotInspectRoute(IotInspectRouteSaveReqVO createReqVO) {
|
|
@@ -91,7 +96,17 @@ public class IotInspectRouteServiceImpl implements IotInspectRouteService {
|
|
|
|
|
|
@Override
|
|
|
public PageResult<IotInspectRouteDO> getIotInspectRoutePage(IotInspectRoutePageReqVO pageReqVO) {
|
|
|
- return iotInspectRouteMapper.selectPage(pageReqVO);
|
|
|
+ Set<Long> classifies = new HashSet<>();
|
|
|
+ if (Objects.nonNull(pageReqVO.getDeviceClassify())) {
|
|
|
+ classifies = iotProductClassifyService.getChildIotProductClassifyList(pageReqVO.getDeviceClassify());
|
|
|
+ classifies.add(pageReqVO.getDeviceClassify());
|
|
|
+ }
|
|
|
+ Set<Long> ids = new HashSet<>();
|
|
|
+ if (Objects.nonNull(pageReqVO.getDeptId())) {
|
|
|
+ ids = deptService.getChildDeptIdListFromCache(pageReqVO.getDeptId());
|
|
|
+ ids.add(pageReqVO.getDeptId());
|
|
|
+ }
|
|
|
+ return iotInspectRouteMapper.selectPage(pageReqVO, classifies, ids);
|
|
|
}
|
|
|
|
|
|
@Override
|