|
@@ -9,6 +9,7 @@ import cn.iocoder.yudao.module.pms.dal.dataobject.inspect.IotInspectOrderDO;
|
|
|
import cn.iocoder.yudao.module.pms.dal.dataobject.inspect.IotInspectOrderDetailDO;
|
|
|
import cn.iocoder.yudao.module.pms.dal.mysql.inspect.IotInspectOrderDetailMapper;
|
|
|
import cn.iocoder.yudao.module.pms.dal.mysql.inspect.IotInspectOrderMapper;
|
|
|
+import cn.iocoder.yudao.module.system.service.dept.DeptService;
|
|
|
import com.google.common.collect.ImmutableMap;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -16,9 +17,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
-import java.util.Objects;
|
|
|
+import java.util.*;
|
|
|
|
|
|
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
|
|
import static cn.iocoder.yudao.module.pms.enums.ErrorCodeConstant.IOT_INSPECT_ORDER_DETAIL_NOT_EXISTS;
|
|
@@ -37,6 +36,8 @@ public class IotInspectOrderServiceImpl implements IotInspectOrderService {
|
|
|
private IotInspectOrderMapper iotInspectOrderMapper;
|
|
|
@Autowired
|
|
|
private IotInspectOrderDetailMapper iotInspectOrderDetailMapper;
|
|
|
+ @Resource
|
|
|
+ private DeptService deptService;
|
|
|
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@@ -149,7 +150,12 @@ public class IotInspectOrderServiceImpl implements IotInspectOrderService {
|
|
|
|
|
|
@Override
|
|
|
public PageResult<IotInspectOrderDO> getIotInspectOrderPage(IotInspectOrderPageReqVO pageReqVO) {
|
|
|
- return iotInspectOrderMapper.selectPage(pageReqVO);
|
|
|
+ Set<Long> ids = new HashSet<>();
|
|
|
+ if (Objects.nonNull(pageReqVO.getDeptId())) {
|
|
|
+ ids = deptService.getChildDeptIdListFromCache(pageReqVO.getDeptId());
|
|
|
+ ids.add(pageReqVO.getDeptId());
|
|
|
+ }
|
|
|
+ return iotInspectOrderMapper.selectPage(pageReqVO, ids);
|
|
|
}
|
|
|
|
|
|
}
|