yanghui
2022-11-29 3da01b2a6cf247f90aed86fc37d8cb0ab51a4b4c
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ComSanShuoEventApi.java
@@ -8,6 +8,7 @@
import com.panzhihua.common.model.dtos.community.sanshuo.ComSanshuoEventDTO;
import com.panzhihua.common.model.dtos.community.sanshuo.IndexDateDTO;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.service.user.UserService;
import com.panzhihua.service_community.entity.ComEvent;
import com.panzhihua.service_community.entity.ComMediateType;
import com.panzhihua.service_community.entity.ComSanshuoEvent;
@@ -38,11 +39,15 @@
    @Resource
    private IComEventService comEventService;
    @Resource
    private UserService userService;
    @GetMapping ("/list")
    public R list(@RequestParam(value = "keyWord",required = false)String keyWord,
                  @RequestParam(value = "page",required = false)Integer page,
                  @RequestParam(value = "size",required = false)Integer size){
        return commediateTypeService.listEvent(keyWord,page,size);
        String appId=userService.detailUser(this.getUserId()).getData().getAppId();
        return commediateTypeService.listEvent(keyWord,page,size,appId);
    }
    @GetMapping("/detail")
@@ -54,6 +59,8 @@
    public R appletList(){
        return R.ok(commediateTypeService.list(new QueryWrapper<ComMediateType>().eq("enabled",1).eq("delete_flag", 0)));
    }
    /**
     * 新增事件类型
@@ -73,6 +80,7 @@
        return commediateTypeService.addOrUpdate(comMediateTypeDTO);
    }
    /**
     * 删除事件
     * */
@@ -84,10 +92,12 @@
        comMediateType.setModifyUser(this.getLoginUserInfo().getUserId());
        //该分类是否有未调解完成事件
        List<ComEvent> list = comEventService.list(new QueryWrapper<ComEvent>().lambda().eq(ComEvent::getEventCategory, id).in(ComEvent::getEventProcessStatus, (1), (2), (5)));
        if (list.size()>0){
        if (list.size() != 0){
            return R.fail("有未处理完成事件,无法删除");
        }
        return R.ok(commediateTypeService.updateById(comMediateType));
    }
}