| | |
| | | |
| | | @Override |
| | | public IPage<GdSupplyDemandVO> selectGdSupplyDemandPage(IPage<GdSupplyDemandVO> page, GdSupplyDemandPageParam gdSupplyDemand) { |
| | | return page.setRecords(baseMapper.selectGdSupplyDemandPage(page, gdSupplyDemand, buildDeptIdList())); |
| | | return page.setRecords(baseMapper.selectGdSupplyDemandPage(page, gdSupplyDemand, SysCache.getDeptChildIds(Long.valueOf(AuthUtil.getDeptId())))); |
| | | } |
| | | |
| | | @Override |
| | |
| | | if (Func.isEmpty(gdSupplyDemand)) { |
| | | throw new ServiceException("需求参数不能为空"); |
| | | } |
| | | GdSupplyDemandEntity detail = baseMapper.selectGdSupplyDemandDetail(gdSupplyDemand, buildDeptIdList()); |
| | | GdSupplyDemandEntity detail = baseMapper.selectGdSupplyDemandDetail(gdSupplyDemand, SysCache.getDeptChildIds(Long.valueOf(AuthUtil.getDeptId()))); |
| | | if (detail == null) { |
| | | throw new ServiceException("未查询到数据"); |
| | | } |
| | |
| | | } |
| | | GdSupplyDemandDTO query = new GdSupplyDemandDTO(); |
| | | query.setId(demandId); |
| | | GdSupplyDemandEntity detail = baseMapper.selectGdSupplyDemandDetail(query, buildDeptIdList()); |
| | | GdSupplyDemandEntity detail = baseMapper.selectGdSupplyDemandDetail(query, SysCache.getDeptChildIds(Long.valueOf(AuthUtil.getDeptId()))); |
| | | if (detail == null) { |
| | | throw new ServiceException("需求数据不存在"); |
| | | } |
| | | return detail; |
| | | } |
| | | |
| | | private List<Long> buildDeptIdList() { |
| | | if (AuthUtil.isAdministrator()) { |
| | | return null; |
| | | } |
| | | Long deptId = Long.valueOf(AuthUtil.getDeptId()); |
| | | List<Long> deptIdList = SysCache.getDeptChildIds(deptId); |
| | | List<Long> result = new ArrayList<>(); |
| | | if (Func.isNotEmpty(deptIdList)) { |
| | | result.addAll(deptIdList); |
| | | } |
| | | if (!result.contains(deptId)) { |
| | | result.add(deptId); |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | @Override |