张天森
2022-11-10 d99a56e37cf9109b46ee68d34a06594ef5615ed3
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComPropertyPublicityServiceImpl.java
@@ -9,6 +9,8 @@
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;
@@ -62,7 +64,7 @@
        } else {
            //非物业用户查看是否拥有菜单权限
            List<String> menuList = this.baseMapper.retrieveUserMenuList(userId);
            if (menuList.isEmpty() || !menuList.contains("物业宣传")) {
            if (menuList.isEmpty() || !menuList.contains("物业宣传栏")) {
                return R.fail("暂无权限");
            }
        }
@@ -107,11 +109,6 @@
        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());
@@ -160,35 +157,6 @@
            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);
    }
    /**