📄 manager_submit.jsp
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@ page language="java" contentType="text/html; charset=GBK" %>
<%@ page import="com.doone.util.*"%>
<%@ page import="com.doone.data.*"%>
<%@ page import="com.doone.fj1w.bbs.*"%>
<%@ page import="com.doone.uurm.*"%>
<%@ page import="com.doone.fj1w.fjmgr.sysmgr.*"%>
<%@ page import="java.util.*"%>
<%@ page import="java.io.*"%>
<%
// 以下是必须的内容
String sContent_Id = request.getParameter("CONTENT_ID");
String sAction = request.getParameter("ACTION");
String sPageType = request.getParameter("PAGETYPE");
if ( sContent_Id == null || sAction == null ) {
out.write("<script language=javascript src=\"../../common/script/RightForbidden.js\"></script>");
return;
}
DacClient db = new DacClient();
try {
db.beginTransaction(-1);
TF_Content content = TF_Content.getSimpleContent(db, Long.parseLong(sContent_Id));
// 权限检查。同时读取栏目编号。
WebAuth auth = WebAuth.getInstance(request);
String sPurvICode = "BBS";
Sys_Purview purv = Sys_Purview.getPurviewByID(db, content.getBoard_ID());
sPurvICode = purv.getPurviewCode();
if ( ! auth.IsAuthed() ) {
out.write("<script language=\"javascript\">self.parent.location.replace(\"" + request.getContextPath() + "/view/login/login.jsp" + "\");</script>");
return;
}
else if ( ! auth.CheckPurv(sPurvICode) ) {
out.write("<script language=javascript src=\"../../common/script/RightForbidden.js\"></script>");
return;
}
BBSAuth bbsAuth = BBSAuth.getInstance(auth, sPurvICode);
if ( ! bbsAuth.hasManagerPurview() ) {
// 当前用户没有管理权限。
out.write("<script language=javascript src=\"../../common/script/RightForbidden.js\"></script>");
return;
}
StringBuffer clientStr = new StringBuffer("<script language='javascript'>");
if ( sAction.equalsIgnoreCase("SETTOP") ) {
// content.setTip_Order(content.getTip_Order() + 1);
content.setTip_Order(1);
content.save();
clientStr.append("if(self.opener!=undefined){self.opener.location.replace(self.opener.location.href);}");
clientStr.append("window.location.href='ViewContent.jsp?id=");
clientStr.append(content.getContent_ID()).append("';");
}
else if ( sAction.equalsIgnoreCase("CANCELTOP") ) {
// content.setTip_Order(content.getTip_Order() - 1);
content.setTip_Order(0);
content.save();
clientStr.append("if(self.opener!=undefined){self.opener.location.replace(self.opener.location.href);}");
clientStr.append("window.location.href='ViewContent.jsp?id=");
clientStr.append(content.getContent_ID()).append("';");
}
else if ( sAction.equalsIgnoreCase("SETHOT") ) {
if ( content.getContent_ID() != content.getFirst_Content_ID() ) {
throw new RuntimeException("不能将回复内容设置为热点内容。");
}
// 以下只有在业务介绍中有使用。
if ( sPurvICode.startsWith("BBS001") ) {
TF_Attchment[] attchment = TF_Attchment.getAttchList(db, content.getContent_ID(), "2");
if ( attchment.length == 0 ) {
throw new RuntimeException("您没有上传热点图片,不能认为热点内容。");
}
else if ( attchment.length > 1 ) {
throw new RuntimeException("您上传的附件个数大于1,我们不能确认哪个是热点图片。请删除多余的附件后再继续!");
}
}
content.setExtract_Sign("1");
TF_Mark mark = new TF_Mark(db, content.getMark_ID());
mark.setUseable_Mark(mark.getUseable_Mark() + 100);
mark.setExpert_Grade(mark.getExpert_Grade() + 50);
mark.setIntegral(mark.getIntegral() + 1);
mark.save();
// 给当前管理员加5分。
/* 暂不启用,因为要增加记录操作管理员信息的字段。
mark = TF_Mark.getInstance(db, auth.getUserID());
mark.setExpert_Grade(mark.getExpert_Grade() + 5);
mark.save();
*/
content.save();
clientStr.append("if(self.opener!=undefined){self.opener.location.replace(self.opener.location.href);}");
clientStr.append("window.location.href='ViewContent.jsp?id=");
clientStr.append(content.getContent_ID()).append("';");
}
else if ( sAction.equalsIgnoreCase("CANCELHOT") ) {
content.setExtract_Sign("0");
TF_Mark mark = new TF_Mark(db, content.getMark_ID());
mark.setUseable_Mark(mark.getUseable_Mark() - 100);
mark.setExpert_Grade(mark.getExpert_Grade() - 50);
mark.setIntegral(mark.getIntegral() - 1);
mark.save();
// 给操作管理员减10分。
/* 暂不启用,因为要增加记录操作管理员信息的字段。
mark = TF_Mark.getInstance(db, auth.getUserID());
mark.setExpert_Grade(mark.getExpert_Grade() - 10);
mark.save();
*/
content.save();
clientStr.append("if(self.opener!=undefined){self.opener.location.replace(self.opener.location.href);}");
clientStr.append("window.location.href='ViewContent.jsp?id=");
clientStr.append(content.getContent_ID()).append("';");
}
else if ( sAction.equalsIgnoreCase("CANCELMAINHOT") ) {
content.setExtract_Sign("0");
content.save();
if (sPageType!=null&&sPageType.length()!=0&&sPageType.equals("1")){
clientStr.append("history.go(-1);");}
else {
clientStr.append("if(self.opener!=undefined){self.opener.location.replace(self.opener.location.href);}");
clientStr.append("window.location.href='ViewContent.jsp?id=");
clientStr.append(content.getContent_ID()).append("';");}
}
else if ( sAction.equalsIgnoreCase("SETMAINTIP") ) {
content.setMainTip();
content.save();
clientStr.append("if(self.opener!=undefined){self.opener.location.replace(self.opener.location.href);}");
clientStr.append("self.close();");
}
else if ( sAction.equalsIgnoreCase("MOVEBOARD") ) {
String[] aContent_ID = request.getParameterValues("CONTENT_ID");
String sBoardId = request.getParameter("BOARD_ID");
if ((sBoardId!=null)&&(sBoardId.trim().length()!=0)){
long lBoardId = Long.parseLong(sBoardId);
for (int i=0; i< aContent_ID.length; i++ ) {
BBSFactory.getMoveBoard(aContent_ID[i],lBoardId);
}
}
out.write("<script language=javascript>window.location.href='"+request.getContextPath() + "/view/sysmgr/OperSuccess.jsp';</script>");
}
else if ( sAction.equalsIgnoreCase("SETACCEPT") ) {//审核通过
//content.setContentType("02");
content.setDelete_Sign("E");
content.save();
if (sPageType!=null&&sPageType.length()!=0&&sPageType.equals("1")){
clientStr.append("history.go(-1);");}
else {
clientStr.append("if(self.opener!=undefined){self.opener.location.replace(self.opener.location.href);}");
clientStr.append("window.location.href='ViewContent.jsp?id=");
clientStr.append(content.getContent_ID()).append("';");}
}
else if ( sAction.equalsIgnoreCase("SETMAINHOT") ) {//首页热点产品
content.setCreate_Time(new Date());
content.setExtract_Sign("2");
content.save();
if (sPageType!=null&&sPageType.length()!=0&&sPageType.equals("1")){
clientStr.append("history.go(-1);");}
else {
clientStr.append("if(self.opener!=undefined){self.opener.location.replace(self.opener.location.href);}");
clientStr.append("window.location.href='ViewContent.jsp?id=");
clientStr.append(content.getContent_ID()).append("';");}
}
else if ( sAction.equalsIgnoreCase("SETMAINNEWPRO") ) {//首页最新产品
content.setCreate_Time(new Date());
content.setExtract_Sign("3");
content.save();
if (sPageType!=null&&sPageType.length()!=0&&sPageType.equals("1")){
clientStr.append("history.go(-1);");}
else {
clientStr.append("if(self.opener!=undefined){self.opener.location.replace(self.opener.location.href);}");
clientStr.append("window.location.href='ViewContent.jsp?id=");
clientStr.append(content.getContent_ID()).append("';");}
}
else if ( sAction.equalsIgnoreCase("SETREJECT") ) {//回退为普通记录
//content.setContentType("01");
content.setDelete_Sign("N");
content.save();
if (sPageType!=null&&sPageType.length()!=0&&sPageType.equals("1")){
clientStr.append("history.go(-1);");}
else {
clientStr.append("if(self.opener!=undefined){self.opener.location.replace(self.opener.location.href);}");
clientStr.append("window.location.href='ViewContent.jsp?id=");
clientStr.append(content.getContent_ID()).append("';");}
}
clientStr.append("</script>");
db.endTransaction(true);
out.write(clientStr.toString());
}
catch(Exception ex) {
try {
if ( db != null ) db.endTransaction(false);
}
catch(Exception e){}
out.write("<script language=javascript>window.location.href='"+request.getContextPath() + "/view/sysmgr/OperFailure.jsp?error="
+ Util.Replace(ex.getMessage()) + "';</script>");
FileLogger.getLogger().warn(ex.getMessage(),ex);
}
db = null;
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -