| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.system.mapper.TCleanerMapper; |
| | | import com.ruoyi.system.mapper.TLocationMapper; |
| | | import com.ruoyi.system.mapper.TProjectDeptMapper; |
| | | import com.ruoyi.system.model.TCleaner; |
| | | import com.ruoyi.system.model.TLocation; |
| | | import com.ruoyi.system.model.TProjectDept; |
| | | import com.ruoyi.system.query.LocationListQuery; |
| | | import com.ruoyi.system.service.TLocationService; |
| | | import com.ruoyi.system.vo.system.LocationListVO; |
| | | import com.ruoyi.system.vo.system.LocationTypeListVO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | @Service |
| | | public class TLocationServiceImpl extends ServiceImpl<TLocationMapper, TLocation> implements TLocationService { |
| | | |
| | | @Autowired |
| | | private TProjectDeptMapper projectDeptMapper; |
| | | @Autowired |
| | | private TCleanerMapper cleanerMapper; |
| | | @Override |
| | | public PageInfo<LocationListVO> pageList(LocationListQuery query) { |
| | | PageInfo<LocationListVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<LocationListVO> list = this.baseMapper.pageList(query,pageInfo); |
| | | for (LocationListVO locationListVO : list) { |
| | | TProjectDept tProjectDept = projectDeptMapper.selectById(locationListVO.getProjectId()); |
| | | if (tProjectDept!=null){ |
| | | if (!tProjectDept.getParentId().equals("0")){ |
| | | TProjectDept tProjectDept1 = projectDeptMapper.selectById(tProjectDept.getParentId()); |
| | | if (tProjectDept1!=null) |
| | | locationListVO.setProjectName(tProjectDept1.getProjectName()+">"+tProjectDept.getProjectName()); |
| | | }else{ |
| | | locationListVO.setProjectName(tProjectDept.getProjectName()); |
| | | } |
| | | } |
| | | } |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | | } |