⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 postdo.java

📁 反ajax原代码
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
                SendMail.sendMail(SysInfo.getInstance().getWebmasteremail(), title, content);
                ActionForward forward = new ActionForward(SysUtil.getResultUrl("jubao.return", "read" + Constant.FILEPREFIX + "?bid=" + form.getBid() + "&id=" + form.getMainid() + "&page=" + form.getPage() + "&inpages=" + form.getInpages()), true);
                return forward;
            }
        }
        if(form.getAction().equals("lock"))
        {
            Forum forum = getForumService().getForum(form.getId(), form.getBid());
            if(forum == null)
            {
                errors.add("getpost", new ActionError("error.post.getpost"));
                saveErrors(httpServletRequest, errors);
                return actionMapping.findForward("error");
            }
            if(!uc.isCanPostNotNeedExp())
            {
                errors.add("error.purviewerror", new ActionError("error.purviewerror"));
                saveErrors(httpServletRequest, errors);
                return actionMapping.findForward("error");
            }
            if(forum.getIsLock() != 1)
            {
                forum.setIsLock((short)1);
                if(getForumService().saveForum(forum) == null)
                {
                    errors.add("error.handlerror", new ActionError("error.handlerror"));
                    saveErrors(httpServletRequest, errors);
                    return actionMapping.findForward("error");
                }
            }
            ActionForward f = new ActionForward("/read" + Constant.FILEPREFIX + "?bid=" + form.getBid() + "&id=" + form.getMainid() + "&page=" + form.getPage() + "&inpages=" + form.getInpages(), true);
            return f;
        }
        if(form.getAction().equals("unlock"))
        {
            Forum forum = getForumService().getForum(form.getId(), form.getBid());
            if(forum == null)
            {
                errors.add("getpost", new ActionError("error.post.getpost"));
                saveErrors(httpServletRequest, errors);
                return actionMapping.findForward("error");
            }
            if(!uc.isCanPostNotNeedExp())
            {
                errors.add("error.purviewerror", new ActionError("error.purviewerror"));
                saveErrors(httpServletRequest, errors);
                return actionMapping.findForward("error");
            }
            if(forum.getIsLock() != 0)
            {
                forum.setIsLock((short)0);
                if(getForumService().saveForum(forum) == null)
                {
                    errors.add("error.handlerror", new ActionError("error.handlerror"));
                    saveErrors(httpServletRequest, errors);
                    return actionMapping.findForward("error");
                }
            }
            ActionForward f = new ActionForward("/read" + Constant.FILEPREFIX + "?bid=" + form.getBid() + "&id=" + form.getMainid() + "&page=" + form.getPage() + "&inpages=" + form.getInpages(), true);
            return f;
        }
        if(form.getAction().equals("top"))
        {
            Forum forum = getForumService().getForum(form.getId(), form.getBid());
            if(forum == null)
            {
                errors.add("getpost", new ActionError("error.post.getpost"));
                saveErrors(httpServletRequest, errors);
                return actionMapping.findForward("error");
            }
            if(!uc.isCanPostNotNeedExp())
            {
                errors.add("error.purviewerror", new ActionError("error.purviewerror"));
                saveErrors(httpServletRequest, errors);
                return actionMapping.findForward("error");
            }
            if(forum.getIsTop() != 1)
            {
                forum.setIsTop((short)1);
                if(getForumService().saveForum(forum) == null)
                {
                    errors.add("error.handlerror", new ActionError("error.handlerror"));
                    saveErrors(httpServletRequest, errors);
                    return actionMapping.findForward("error");
                }
            }
            ActionForward f = new ActionForward("/read" + Constant.FILEPREFIX + "?bid=" + form.getBid() + "&id=" + form.getMainid() + "&page=" + form.getPage() + "&inpages=" + form.getInpages(), true);
            return f;
        }
        if(form.getAction().equals("untop"))
        {
            Forum forum = getForumService().getForum(form.getId(), form.getBid());
            if(forum == null)
            {
                errors.add("getpost", new ActionError("error.post.getpost"));
                saveErrors(httpServletRequest, errors);
                return actionMapping.findForward("error");
            }
            if(!uc.isCanPostNotNeedExp())
            {
                errors.add("error.purviewerror", new ActionError("error.purviewerror"));
                saveErrors(httpServletRequest, errors);
                return actionMapping.findForward("error");
            }
            if(forum.getIsTop() != 0)
            {
                forum.setIsTop((short)0);
                if(getForumService().saveForum(forum) == null)
                {
                    errors.add("error.handlerror", new ActionError("error.handlerror"));
                    saveErrors(httpServletRequest, errors);
                    return actionMapping.findForward("error");
                }
            }
            ActionForward f = new ActionForward("/read" + Constant.FILEPREFIX + "?bid=" + form.getBid() + "&id=" + form.getMainid() + "&page=" + form.getPage() + "&inpages=" + form.getInpages(), true);
            return f;
        }
        if(form.getAction().equals("cannotdel"))
        {
            Forum forum = getForumService().getForum(form.getId(), form.getBid());
            if(forum == null)
            {
                errors.add("getpost", new ActionError("error.post.getpost"));
                saveErrors(httpServletRequest, errors);
                return actionMapping.findForward("error");
            }
            if(!uc.isCanPostNotNeedExp())
            {
                errors.add("error.purviewerror", new ActionError("error.purviewerror"));
                saveErrors(httpServletRequest, errors);
                return actionMapping.findForward("error");
            }
            if(forum.getCanNotDel() == 0)
            {
                forum.setCanNotDel((short)1);
                if(getForumService().saveForum(forum) == null)
                {
                    errors.add("error.handlerror", new ActionError("error.handlerror"));
                    saveErrors(httpServletRequest, errors);
                    return actionMapping.findForward("error");
                }
            }
            ActionForward f = new ActionForward("/read" + Constant.FILEPREFIX + "?bid=" + form.getBid() + "&id=" + form.getMainid() + "&page=" + form.getPage() + "&inpages=" + form.getInpages(), true);
            return f;
        }
        if(form.getAction().equals("votyes"))
        {
            Forum forum = getForumService().getForum(form.getId(), form.getBid());
            if(forum == null)
            {
                errors.add("getpost", new ActionError("error.post.getpost"));
                saveErrors(httpServletRequest, errors);
                return actionMapping.findForward("error");
            }
            forum.setAgree(forum.getAgree() + 1);
            if(getForumService().saveForum(forum) == null)
            {
                errors.add("error.handlerror", new ActionError("error.handlerror"));
                saveErrors(httpServletRequest, errors);
                return actionMapping.findForward("error");
            } else
            {
                ActionForward f = new ActionForward("/read" + Constant.FILEPREFIX + "?bid=" + form.getBid() + "&id=" + form.getMainid() + "&page=" + form.getPage() + "&inpages=" + form.getInpages(), true);
                return f;
            }
        }
        if(form.getAction().equals("votno"))
        {
            Forum forum = getForumService().getForum(form.getId(), form.getBid());
            if(forum == null)
            {
                errors.add("getpost", new ActionError("error.post.getpost"));
                saveErrors(httpServletRequest, errors);
                return actionMapping.findForward("error");
            }
            forum.setAgree(forum.getAgree() - 1);
            if(getForumService().saveForum(forum) == null)
            {
                errors.add("error.handlerror", new ActionError("error.handlerror"));
                saveErrors(httpServletRequest, errors);
                return actionMapping.findForward("error");
            } else
            {
                ActionForward f = new ActionForward("/read" + Constant.FILEPREFIX + "?bid=" + form.getBid() + "&id=" + form.getMainid() + "&page=" + form.getPage() + "&inpages=" + form.getInpages(), true);
                return f;
            }
        }
        if(form.getAction().equals("commend"))
        {
            Forum forum = getForumService().getForum(form.getId(), form.getBid());
            if(forum == null)
            {
                errors.add("getpost", new ActionError("error.post.getpost"));
                saveErrors(httpServletRequest, errors);
                return actionMapping.findForward("error");
            }
            if(!uc.isSuperAdmin() && !uc.isBmaster() && !uc.isBulletin() && !uc.isMainMaster())
            {
                errors.add("error.purviewerror", new ActionError("error.purviewerror"));
                saveErrors(httpServletRequest, errors);
                return actionMapping.findForward("error");
            }
            if(getCommendService().findCommendByPostID(form.getId(), (short)1) != null)
            {
                errors.add("error.commend.exist", new ActionError("error.commend.exist"));
                saveErrors(httpServletRequest, errors);
                return actionMapping.findForward("error");
            }
            forum.setIsB((short)1);
            if(getForumService().saveForum(forum) == null)
            {
                errors.add("error.handlerror", new ActionError("error.handlerror"));
                saveErrors(httpServletRequest, errors);
                return actionMapping.findForward("error");
            } else
            {
                Commend commend = new Commend();
                commend.setAddTime(SysUtil.getLongTime());
                commend.setBid(form.getBid());
                commend.setBoardName(forum.getBoardName());
                commend.setIsBull((short)1);
                commend.setPostID(forum.getId().longValue());
                commend.setPostID2(forum.getId2());
                commend.setTitle(forum.getTitle());
                getCommendService().createCommend(commend);
                String url = "read" + Constant.FILEPREFIX + "?bid=" + form.getBid() + "&id=" + form.getMainid() + "&page=" + form.getPage() + "&inpages=" + form.getInpages();
                ActionForward f = new ActionForward(SysUtil.getResultUrl("commend.topic.ok", url));
                return f;
            }
        } else
        {
            return actionMapping.findForward("error");
        }
    }

    private void jbInit()
        throws Exception
    {
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -