|
@@ -1,6 +1,8 @@
|
|
package cn.iocoder.yudao.module.pms.service.inspect;
|
|
package cn.iocoder.yudao.module.pms.service.inspect;
|
|
|
|
|
|
|
|
+import cn.hutool.core.collection.CollUtil;
|
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
|
|
+import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
|
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
|
import cn.iocoder.yudao.module.pms.controller.admin.inspect.item.vo.IotInspectItemPageReqVO;
|
|
import cn.iocoder.yudao.module.pms.controller.admin.inspect.item.vo.IotInspectItemPageReqVO;
|
|
import cn.iocoder.yudao.module.pms.controller.admin.inspect.item.vo.IotInspectItemSaveReqVO;
|
|
import cn.iocoder.yudao.module.pms.controller.admin.inspect.item.vo.IotInspectItemSaveReqVO;
|
|
@@ -8,6 +10,7 @@ import cn.iocoder.yudao.module.pms.controller.admin.inspect.route.vo.IotInspectR
|
|
import cn.iocoder.yudao.module.pms.dal.dataobject.IotProductClassifyDO;
|
|
import cn.iocoder.yudao.module.pms.dal.dataobject.IotProductClassifyDO;
|
|
import cn.iocoder.yudao.module.pms.dal.dataobject.inspect.IotInspectItemDO;
|
|
import cn.iocoder.yudao.module.pms.dal.dataobject.inspect.IotInspectItemDO;
|
|
import cn.iocoder.yudao.module.pms.dal.dataobject.inspect.IotInspectRouteDO;
|
|
import cn.iocoder.yudao.module.pms.dal.dataobject.inspect.IotInspectRouteDO;
|
|
|
|
+import cn.iocoder.yudao.module.pms.dal.mysql.IotProductClassifyMapper;
|
|
import cn.iocoder.yudao.module.pms.dal.mysql.inspect.IotInspectItemMapper;
|
|
import cn.iocoder.yudao.module.pms.dal.mysql.inspect.IotInspectItemMapper;
|
|
import cn.iocoder.yudao.module.pms.service.IotProductClassifyService;
|
|
import cn.iocoder.yudao.module.pms.service.IotProductClassifyService;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
@@ -36,6 +39,8 @@ public class IotInspectItemServiceImpl implements IotInspectItemService {
|
|
private IotInspectItemMapper iotInspectItemMapper;
|
|
private IotInspectItemMapper iotInspectItemMapper;
|
|
@Autowired
|
|
@Autowired
|
|
private IotProductClassifyService iotProductClassifyService;
|
|
private IotProductClassifyService iotProductClassifyService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private IotProductClassifyMapper iotProductClassifyMapper;
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public Long createIotInspectItem(IotInspectItemSaveReqVO createReqVO) {
|
|
public Long createIotInspectItem(IotInspectItemSaveReqVO createReqVO) {
|
|
@@ -88,6 +93,13 @@ public class IotInspectItemServiceImpl implements IotInspectItemService {
|
|
public PageResult<IotInspectItemDO> getRouteItem(IotInspectItemPageReqVO pageReqVO) {
|
|
public PageResult<IotInspectItemDO> getRouteItem(IotInspectItemPageReqVO pageReqVO) {
|
|
IPage<IotInspectItemDO> page = iotInspectItemMapper.getRouteItem(
|
|
IPage<IotInspectItemDO> page = iotInspectItemMapper.getRouteItem(
|
|
new Page<>(pageReqVO.getPageNo(), pageReqVO.getPageSize()), pageReqVO);
|
|
new Page<>(pageReqVO.getPageNo(), pageReqVO.getPageSize()), pageReqVO);
|
|
- return new PageResult<>(page.getRecords(), page.getTotal());
|
|
|
|
|
|
+ if (CollUtil.isNotEmpty(page.getRecords())) {
|
|
|
|
+ return new PageResult<>(page.getRecords(), page.getTotal());
|
|
|
|
+ }
|
|
|
|
+ IotProductClassifyDO iotProductClassifyDO = iotProductClassifyMapper.selectById(pageReqVO.getDeviceClassify());
|
|
|
|
+ pageReqVO.setDeviceClassify(iotProductClassifyDO.getParentId());
|
|
|
|
+ IPage<IotInspectItemDO> parentPage = iotInspectItemMapper.getRouteItem(
|
|
|
|
+ new Page<>(pageReqVO.getPageNo(), pageReqVO.getPageSize()), pageReqVO);
|
|
|
|
+ return new PageResult<>(parentPage.getRecords(), parentPage.getTotal());
|
|
}
|
|
}
|
|
}
|
|
}
|