| | |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.panzhihua.common.model.vos.community.ComMngVillageVO; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.ObjectUtils; |
| | |
| | | } else { |
| | | //非物业用户查看是否拥有菜单权限 |
| | | List<String> menuList = this.baseMapper.retrieveUserMenuList(userId); |
| | | if (menuList.isEmpty() || !menuList.contains("物业宣传")) { |
| | | if (menuList.isEmpty() || !menuList.contains("物业宣传栏")) { |
| | | return R.fail("暂无权限"); |
| | | } |
| | | } |
| | |
| | | ComPropertyPublicityDO comPropertyPublicityDO = this.baseMapper.selectById(comPropertyPublicityDTO.getId()); |
| | | if (isNull(comPropertyPublicityDO)) { |
| | | return R.fail("信息不存在"); |
| | | } |
| | | Long userId = comPropertyPublicityDTO.getUserId(); |
| | | ComProperty comProperty = comPropertyDao.selectOne(new QueryWrapper<ComProperty>().lambda().eq(ComProperty::getUserId, userId)); |
| | | if (isNull(comProperty) || !comProperty.getId().equals(comPropertyPublicityDO.getPropertyId())) { |
| | | return R.fail("暂无权限"); |
| | | } |
| | | BeanUtils.copyProperties(comPropertyPublicityDTO, comPropertyPublicityDO); |
| | | comPropertyPublicityDO.setUpdatedAt(new Date()); |
| | |
| | | propertyList = comPropertyDao.selectList(new QueryWrapper<ComProperty>().lambda().eq(ComProperty::getCommunityId, communityId)); |
| | | } |
| | | return R.ok(propertyList); |
| | | } |
| | | |
| | | /** |
| | | * 小区列表 |
| | | * @param propertyId |
| | | * @param communityId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R listVillage(Long propertyId, Long communityId) { |
| | | List<ComMngStructAreaVO> comMngStructAreaVOS = new ArrayList<>(); |
| | | List<ComMngStructAreaDO> comMngStructAreaDOS; |
| | | if (nonNull(propertyId)) { |
| | | ComProperty comProperty = comPropertyDao.selectById(propertyId); |
| | | comMngStructAreaDOS = comMngStructAreaDAO.selectList( |
| | | new QueryWrapper<ComMngStructAreaDO>().lambda().eq(ComMngStructAreaDO::getId, comProperty.getAreaId())); |
| | | } else { |
| | | comMngStructAreaDOS = comMngStructAreaDAO.selectList( |
| | | new QueryWrapper<ComMngStructAreaDO>().lambda().eq(ComMngStructAreaDO::getCommunityId, communityId)); |
| | | } |
| | | if (!ObjectUtils.isEmpty(comMngStructAreaDOS)) { |
| | | comMngStructAreaDOS.forEach(comMngStructAreaDO -> { |
| | | ComMngStructAreaVO comMngStructAreaVO = new ComMngStructAreaVO(); |
| | | BeanUtils.copyProperties(comMngStructAreaDO, comMngStructAreaVO); |
| | | comMngStructAreaVOS.add(comMngStructAreaVO); |
| | | }); |
| | | |
| | | } |
| | | return R.ok(comMngStructAreaVOS); |
| | | } |
| | | |
| | | /** |