保存评论

TaskService 保存评论

public R saveComment(@PathVariable("id") String id,
                         @PathVariable("processid") String processid,
                         String comment){

    if(comment==null||"".equals(comment)){
        return R.error("请填写评论!");
    }
    try{
        //保存评论
        UserEntity userEntity = getUser();
        // 由于流程用户上下文对象是线程独立的,所以要在需要的位置设置,要保证设置和获取操作在同一个线程中
        Authentication.setAuthenticatedUserId( userEntity.getUsername());//批注人的名称  一定要写,不然查看的时候不知道人物信息
        // 添加批注信息
        taskService.addComment(id, processid, comment);//comment为批注内容
    }catch(Exception e){
        return R.ok("该流程已经被办理!请刷新列表!");
    }

    return R.ok("评论保存成功!");
}
  • 参数:taskService.addComment(String taskId, String processInstance, String message)

猜你喜欢

转载自blog.csdn.net/HuanFengZhiQiu/article/details/81130293
今日推荐