| | |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.core.utils.Utils; |
| | | import com.doumee.dao.business.YwBuildingMapper; |
| | | import com.doumee.dao.business.YwFloorMapper; |
| | | import com.doumee.dao.business.YwProjectMapper; |
| | | import com.doumee.dao.business.model.Company; |
| | | import com.doumee.dao.business.model.YwProject; |
| | | import com.doumee.dao.business.YwRoomMapper; |
| | | import com.doumee.dao.business.model.*; |
| | | import com.doumee.dao.business.vo.CompanyTree; |
| | | import com.doumee.dao.business.vo.ProjectDataVO; |
| | | import com.doumee.dao.business.vo.ProjectTree; |
| | | import com.doumee.service.business.YwProjectService; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import org.checkerframework.checker.units.qual.A; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | |
| | | |
| | | @Autowired |
| | | private YwProjectMapper ywProjectMapper; |
| | | |
| | | @Autowired |
| | | private YwFloorMapper ywFloorMapper; |
| | | |
| | | @Autowired |
| | | private YwRoomMapper ywRoomMapper; |
| | | |
| | | @Autowired |
| | | private YwBuildingMapper ywBuildingMapper; |
| | | |
| | | @Override |
| | | public Integer create(YwProject model) { |
| | |
| | | QueryWrapper<YwProject> wrapper = new QueryWrapper<>(ywProject); |
| | | return ywProjectMapper.selectCount(wrapper); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<ProjectDataVO> projectTree(){ |
| | | List<ProjectDataVO> projectDataVOList = new ArrayList<>(); |
| | | List<YwProject> ywProjectList = ywProjectMapper.selectList(new QueryWrapper<YwProject>().lambda() |
| | | .eq(YwProject::getIsdeleted,Constants.ZERO) |
| | | .eq(YwProject::getStatus,Constants.ZERO) |
| | | .orderByAsc(YwProject::getSortnum) |
| | | ); |
| | | for (YwProject ywProject:ywProjectList) { |
| | | ProjectDataVO projectDataVO = new ProjectDataVO(); |
| | | BeanUtils.copyProperties(ywProject,projectDataVO); |
| | | projectDataVO.setLv(Constants.ZERO); |
| | | projectDataVOList.add(projectDataVO); |
| | | } |
| | | |
| | | List<YwBuilding> ywBuildingList = ywBuildingMapper.selectList(new QueryWrapper<YwBuilding>().lambda() |
| | | .eq(YwBuilding::getIsdeleted,Constants.ZERO) |
| | | .eq(YwBuilding::getStatus,Constants.ZERO) |
| | | .orderByAsc(YwBuilding::getSortnum) |
| | | ); |
| | | |
| | | for (YwBuilding data:ywBuildingList) { |
| | | ProjectDataVO projectDataVO = new ProjectDataVO(); |
| | | BeanUtils.copyProperties(data,projectDataVO); |
| | | projectDataVO.setPId(data.getProjectId()); |
| | | projectDataVO.setLv(Constants.ONE); |
| | | projectDataVOList.add(projectDataVO); |
| | | } |
| | | |
| | | |
| | | List<YwFloor> ywFloorList = ywFloorMapper.selectList(new QueryWrapper<YwFloor>().lambda() |
| | | .eq(YwFloor::getIsdeleted,Constants.ZERO) |
| | | .eq(YwFloor::getStatus,Constants.ZERO) |
| | | .orderByAsc(YwFloor::getSortnum) |
| | | ); |
| | | |
| | | for (YwFloor data:ywFloorList) { |
| | | ProjectDataVO projectDataVO = new ProjectDataVO(); |
| | | BeanUtils.copyProperties(data,projectDataVO); |
| | | projectDataVO.setPId(data.getBuildingId()); |
| | | projectDataVO.setLv(Constants.TWO); |
| | | projectDataVOList.add(projectDataVO); |
| | | } |
| | | |
| | | |
| | | |
| | | List<YwRoom> ywRoomList = ywRoomMapper.selectList(new QueryWrapper<YwRoom>().lambda() |
| | | .eq(YwRoom::getIsdeleted,Constants.ZERO) |
| | | .eq(YwRoom::getStatus,Constants.ZERO) |
| | | .orderByAsc(YwRoom::getSortnum) |
| | | ); |
| | | |
| | | |
| | | for (YwRoom data:ywRoomList) { |
| | | ProjectDataVO projectDataVO = new ProjectDataVO(); |
| | | BeanUtils.copyProperties(data,projectDataVO); |
| | | projectDataVO.setName(data.getCode()); |
| | | projectDataVO.setPId(data.getFloor()); |
| | | projectDataVO.setLv(Constants.THREE); |
| | | projectDataVOList.add(projectDataVO); |
| | | } |
| | | |
| | | ProjectTree treeBuild = new ProjectTree(projectDataVOList); |
| | | projectDataVOList = treeBuild.buildTree(); |
| | | return projectDataVOList; |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |