| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.ObjectUtils; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | |
| | | import com.panzhihua.service_community.model.dos.ComMngStructBuildTypeDO; |
| | | import com.panzhihua.service_community.model.dos.ComMngStructOtherBuildDO; |
| | | import com.panzhihua.service_community.service.ComMngStructOtherBuildService; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.ObjectUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | |
| | | /** |
| | | * 新增其他建筑 |
| | | * |
| | | * @param comMngStructOtherBuildVO 建筑参数 |
| | | * @param comMngStructOtherBuildVO |
| | | * 建筑参数 |
| | | * @return 新增结果 |
| | | */ |
| | | @Override |
| | |
| | | @Override |
| | | public R listBuildType() { |
| | | List<ComMngStructBuildTypeVO>comMngStructBuildTypeVOS=new ArrayList<>(); |
| | | List<ComMngStructBuildTypeDO> comMngStructBuildTypeDOS = comMngStructBuildTypeDAO.selectList(new LambdaQueryWrapper<>()); |
| | | List<ComMngStructBuildTypeDO> comMngStructBuildTypeDOS = |
| | | comMngStructBuildTypeDAO.selectList(new LambdaQueryWrapper<>()); |
| | | if (!ObjectUtils.isEmpty(comMngStructBuildTypeDOS)) { |
| | | comMngStructBuildTypeDOS.forEach(comMngStructBuildTypeDO -> { |
| | | ComMngStructBuildTypeVO comMngStructBuildTypeVO=new ComMngStructBuildTypeVO(); |
| | |
| | | /** |
| | | * 分页查询 其他建筑 |
| | | * |
| | | * @param comMngStructOtherBuildVO 分页查询参数 |
| | | * @param comMngStructOtherBuildVO |
| | | * 分页查询参数 |
| | | * @return 查询结果 |
| | | */ |
| | | @Override |
| | |
| | | } |
| | | page.setSize(pageSize); |
| | | page.setCurrent(pageNum); |
| | | IPage<ComMngStructOtherBuildVO> iPage = comMngStructOtherBuildDAO.pageOtherBuild(page, comMngStructOtherBuildVO); |
| | | IPage<ComMngStructOtherBuildVO> iPage = |
| | | comMngStructOtherBuildDAO.pageOtherBuild(page, comMngStructOtherBuildVO); |
| | | return R.ok(iPage); |
| | | } |
| | | |
| | | /** |
| | | * 建筑类型 |
| | | * |
| | | * @param communityId 社区id |
| | | * @param communityId |
| | | * 社区id |
| | | * @return 建筑集合 |
| | | */ |
| | | @Override |
| | | public R listComMngStructBuildType(Long communityId) { |
| | | List<ComMngStructBuildTypeDO> comMngStructBuildTypeDOS = comMngStructBuildTypeDAO.selectList(new QueryWrapper<ComMngStructBuildTypeDO>().lambda().eq(ComMngStructBuildTypeDO::getCommunityId, communityId)); |
| | | List<ComMngStructBuildTypeDO> comMngStructBuildTypeDOS = |
| | | comMngStructBuildTypeDAO.selectList(new QueryWrapper<ComMngStructBuildTypeDO>().lambda() |
| | | .eq(ComMngStructBuildTypeDO::getCommunityId, communityId)); |
| | | if (ObjectUtils.isEmpty(comMngStructBuildTypeDOS)) { |
| | | return R.fail(); |
| | | } |
| | |
| | | /** |
| | | * 增加删除建筑类型 |
| | | * |
| | | * @param systemmanagementConfigVO 操作内容 |
| | | * @param systemmanagementConfigVO |
| | | * 操作内容 |
| | | * @return 操作结果 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R putComMngStructBuildType(SystemmanagementConfigVO systemmanagementConfigVO) { |
| | | Long communityId = systemmanagementConfigVO.getCommunityId(); |
| | | List<ComMngStructBuildTypeVO> comMngStructBuildTypeVOList = systemmanagementConfigVO.getComMngStructBuildTypeVOList(); |
| | | List<ComMngStructBuildTypeVO> comMngStructBuildTypeVOList = |
| | | systemmanagementConfigVO.getComMngStructBuildTypeVOList(); |
| | | if (ObjectUtils.isEmpty(comMngStructBuildTypeVOList)) { |
| | | return R.fail("建筑类型不能为空"); |
| | | } |
| | | List<Long> collect = comMngStructBuildTypeVOList.stream().map(comMngStructBuildTypeVO -> comMngStructBuildTypeVO.getId()).collect(Collectors.toList()); |
| | | List<Long> collect = comMngStructBuildTypeVOList.stream() |
| | | .map(comMngStructBuildTypeVO -> comMngStructBuildTypeVO.getId()).collect(Collectors.toList()); |
| | | List<Long> buildTypdIds= comMngStructOtherBuildDAO.selectAllBuildTypeIds(communityId); |
| | | buildTypdIds.forEach(aLong -> { |
| | | if (!collect.contains(aLong)) { |
| | |
| | | } |
| | | } |
| | | }); |
| | | comMngStructBuildTypeDAO.delete(new QueryWrapper<ComMngStructBuildTypeDO>().lambda().eq(ComMngStructBuildTypeDO::getCommunityId, communityId)); |
| | | comMngStructBuildTypeDAO.delete(new QueryWrapper<ComMngStructBuildTypeDO>().lambda() |
| | | .eq(ComMngStructBuildTypeDO::getCommunityId, communityId)); |
| | | comMngStructBuildTypeVOList.forEach(comMngStructBuildTypeVO -> { |
| | | String name = comMngStructBuildTypeVO.getName(); |
| | | if (ObjectUtils.isEmpty(name)) { |
| | |
| | | /** |
| | | * 其他建筑详情 |
| | | * |
| | | * @param id 主键id |
| | | * @param id |
| | | * 主键id |
| | | * @return 建筑内容 |
| | | */ |
| | | @Override |
| | |
| | | /** |
| | | * 编辑其他建筑 |
| | | * |
| | | * @param comMngStructOtherBuildVO 编辑内容 |
| | | * @param comMngStructOtherBuildVO |
| | | * 编辑内容 |
| | | * @return 编辑结果 |
| | | */ |
| | | @Override |
| | |
| | | /** |
| | | * 删除其他建筑 |
| | | * |
| | | * @param id 主键 |
| | | * @param id |
| | | * 主键 |
| | | * @return 删除结果 |
| | | */ |
| | | @Override |