all
huanghongfa
2021-02-20 80b3e624bfdf32fa8c45ea157739b1f63aada76d
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/CommunityApi.java
@@ -332,12 +332,20 @@
    @PostMapping("putdynamic")
    public R putDynamic(@RequestBody ComActDynVO comActDynVO) {
        ComActDynDO comActDynDO = new ComActDynDO();
        Long id = comActDynVO.getId();
        BeanUtils.copyProperties(comActDynVO, comActDynDO);
        Integer isTopping = comActDynVO.getIsTopping();
        boolean b = isTopping.intValue() == 1;
        if(b){
            ComActDynDO comActDynDO1 = comActDynService.getById(id);
            Integer status = comActDynDO1.getStatus();
            if (status.intValue()==0) {
                return R.fail("该动态还未发布");
            }
        }
        boolean update = comActDynService.updateById(comActDynDO);
        if (update) {
//            最多只能设置三条置顶状态,后边设置会取消先前设置的置顶
            Integer isTopping = comActDynVO.getIsTopping();
            boolean b = isTopping.intValue() == 1;
            if (b) {
                List<ComActDynDO> list = comActDynService.list(new QueryWrapper<ComActDynDO>().lambda().eq(ComActDynDO::getIsTopping, 1).eq(ComActDynDO::getCommunityId, comActDynVO.getCommunityId()));
                if (!ObjectUtils.isEmpty(list)) {
@@ -565,7 +573,7 @@
     * @param comActVO 编辑内容
     * @return 编辑结果
     */
    @PutMapping("putCommunity")
    @PostMapping("putCommunity")
    public R putCommunity(@RequestBody ComActVO comActVO) {
        return comActService.putCommunity(comActVO);
    }
@@ -1018,15 +1026,19 @@
        List<TodoEventsVO> todoEventsVOS1=comActEasyPhotoService.selectNeedToDo(communityId,userId);
        List<TodoEventsVO> todoEventsVOS2=comActMicroWishService.selectNeedToDo(communityId,userId);
        List<TodoEventsVO> todoEventsVOS3=comMngVolunteerMngService.selectNeedToDo(communityId,userId);
        if (!ObjectUtils.isEmpty(todoEventsVOS1)) {
            todoEventsVOS.addAll(todoEventsVOS1);
        }
        if (!ObjectUtils.isEmpty(todoEventsVOS2)) {
            todoEventsVOS.addAll(todoEventsVOS2);
        }
        if (!ObjectUtils.isEmpty(todoEventsVOS3)) {
            todoEventsVOS.addAll(todoEventsVOS3);
        }
        TodoEventsVO todoEventsVO=new TodoEventsVO();
        todoEventsVO.setType(1);
        todoEventsVO.setNum(todoEventsVOS1.size());
        TodoEventsVO todoEventsVO1=new TodoEventsVO();
        todoEventsVO1.setType(2);
        todoEventsVO1.setNum(todoEventsVOS2.size());
        TodoEventsVO todoEventsVO2=new TodoEventsVO();
        todoEventsVO2.setType(4);
        todoEventsVO2.setNum(todoEventsVOS3.size());
        todoEventsVOS.add(todoEventsVO);
        todoEventsVOS.add(todoEventsVO1);
        todoEventsVOS.add(todoEventsVO2);
        return R.ok(todoEventsVOS);
    }
@@ -1165,5 +1177,25 @@
        return comActActivityService.indexDataCommunityBackstageEchart(communityId);
    }
    /**
     * 选择导入的小区
     * @param param 小区名字 模糊查询
     * @param communityId 社区id
     * @return 小区集合 ComMngStructAreaVO
     */
    @PostMapping("listareas")
    public R listAreas(@RequestParam("param")String param, @RequestParam("communityId")Long communityId){
        return comMngStructAreaService.listAreas(param,communityId);
    }
    /**
     * 检查小区是否已经批量设置过房屋并且返回小区房屋门号规则
     * @param id 小区id
     * @return ComMngStructAreaVO
     */
    @PostMapping("checkAreaHouse")
    public R checkAreaHouse(@RequestParam("id")Long id){
        return comMngStructAreaService.checkAreaHouse(id);
    }
}