📄 bull.java
字号:
// Decompiled by Jad v1.5.7g. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi
// Source File Name: Bull.java
package com.laoer.bbscs.web.action;
import com.laoer.bbscs.bean.Bulletin;
import com.laoer.bbscs.business.IBulletinService;
import com.laoer.bbscs.sys.*;
import com.laoer.bbscs.web.form.BullForm;
import com.laoer.bbscs.web.servlet.UserCheck;
import com.laoer.comm.util.Util;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.*;
import org.apache.struts.util.MessageResources;
// Referenced classes of package com.laoer.bbscs.web.action:
// BaseAction
public class Bull extends BaseAction
{
public Bull()
{
}
public ActionForward execute(ActionMapping actionMapping, ActionForm actionForm, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse)
{
ActionErrors errors = new ActionErrors();
BullForm form = (BullForm)actionForm;
UserCheck uc = getUserCheck(httpServletRequest, httpServletResponse, Constant.MESSAGE.getMessage(httpServletRequest.getLocale(), "place.bull"));
if(form.getAction().equals("list"))
{
Pages pages = new Pages(httpServletRequest);
pages.setPage(form.getPage());
pages.setPerPageNum(10);
pages.setFileName("bulllist" + Constant.FILEPREFIX);
pages.setStyle(1);
com.laoer.bbscs.sys.PageList pl = getBulletinService().getBulletinList(pages);
httpServletRequest.setAttribute("pl", pl);
return actionMapping.findForward("bulllist");
}
if(uc.isGuest())
{
errors.add("error.pleaselogin", new ActionError("error.pleaselogin"));
saveErrors(httpServletRequest, errors);
return SysUtil.getPassLogin(actionMapping);
}
if(form.getAction().equals("new"))
if(!uc.isSuperAdmin() && !uc.isBulletin())
{
errors.add("error.purviewerror", new ActionError("error.purviewerror"));
saveErrors(httpServletRequest, errors);
return actionMapping.findForward("error");
} else
{
form.setAction("add");
form.setNoend((short)1);
httpServletRequest.setAttribute("bullForm", form);
return actionMapping.findForward("bull");
}
if(form.getAction().equals("add"))
{
if(!uc.isSuperAdmin() && !uc.isBulletin())
{
errors.add("error.purviewerror", new ActionError("error.purviewerror"));
saveErrors(httpServletRequest, errors);
return actionMapping.findForward("error");
}
Bulletin bull = new Bulletin();
bull.setAddUserName(uc.getUsername());
bull.setContent(form.getContent());
if(form.getNoend() == 1)
bull.setEndTime(0L);
else
bull.setEndTime(Util.Date2Long(form.getYear(), form.getMonth(), form.getDay()));
bull.setStartTime(Util.getLongTime());
bull.setTitle(form.getTitle());
if(getBulletinService().saveBulletin(bull) == null)
{
errors.add("error.bull.add", new ActionError("error.bull.add"));
saveErrors(httpServletRequest, errors);
httpServletRequest.setAttribute("bullForm", form);
return actionMapping.findForward("bull");
} else
{
ActionForward f = new ActionForward("/bulllist" + Constant.FILEPREFIX, true);
return f;
}
}
if(form.getAction().equals("edit"))
{
if(!uc.isSuperAdmin() && !uc.isBulletin())
{
errors.add("error.purviewerror", new ActionError("error.purviewerror"));
saveErrors(httpServletRequest, errors);
return actionMapping.findForward("error");
}
Bulletin bull = getBulletinService().getBulletin(form.getId());
if(bull == null)
{
errors.add("error.vote.get", new ActionError("error.vote.get"));
saveErrors(httpServletRequest, errors);
return actionMapping.findForward("error");
}
form.setAction("editdo");
form.setContent(bull.getContent());
if(bull.getEndTime() == 0L)
{
form.setNoend((short)1);
} else
{
form.setDay(Util.getDay(bull.getEndTime()));
form.setMonth(Util.getMonth(bull.getEndTime()));
form.setYear(Util.getYear(bull.getEndTime()));
}
form.setTitle(bull.getTitle());
httpServletRequest.setAttribute("bullForm", form);
return actionMapping.findForward("bull");
}
if(form.getAction().equals("editdo"))
{
if(!uc.isSuperAdmin() && !uc.isBulletin())
{
errors.add("error.purviewerror", new ActionError("error.purviewerror"));
saveErrors(httpServletRequest, errors);
return actionMapping.findForward("error");
}
Bulletin bull = getBulletinService().getBulletin(form.getId());
if(bull == null)
{
errors.add("error.vote.get", new ActionError("error.vote.get"));
saveErrors(httpServletRequest, errors);
return actionMapping.findForward("error");
}
bull.setAddUserName(uc.getUsername());
bull.setContent(form.getContent());
if(form.getNoend() == 1)
bull.setEndTime(0L);
else
bull.setEndTime(Util.Date2Long(form.getYear(), form.getMonth(), form.getDay()));
bull.setTitle(form.getTitle());
if(getBulletinService().saveBulletin(bull) == null)
{
errors.add("error.bull.add", new ActionError("error.bull.add"));
saveErrors(httpServletRequest, errors);
httpServletRequest.setAttribute("bullForm", form);
return actionMapping.findForward("bull");
} else
{
ActionForward f = new ActionForward("/bulllist" + Constant.FILEPREFIX, true);
return f;
}
}
if(form.getAction().equals("del"))
{
if(!uc.isSuperAdmin() && !uc.isBulletin())
{
errors.add("error.purviewerror", new ActionError("error.purviewerror"));
saveErrors(httpServletRequest, errors);
return actionMapping.findForward("error");
} else
{
getBulletinService().removeBulletin(form.getId());
ActionForward f = new ActionForward("/bulllist" + Constant.FILEPREFIX, true);
return f;
}
} else
{
return actionMapping.findForward("error");
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -