package com.yxq.action;
import java.util.List;
import com.yxq.actionSuper.AdminSuperAction;
import com.yxq.dao.OpDB;
import com.yxq.model.CreatePage;
public class AdminAction extends AdminSuperAction {
/** 功能:管理员操作-进行列表显示信息 */
public String ListShow(){
request.setAttribute("mainPage","../info/listshow.jsp");
session.remove("adminOP");
int infoType=showType.getInfoType();
String stateType=showType.getStateType();
String payforType=showType.getPayforType();
session.put("infoType",Integer.valueOf(infoType)); //保存已选择的“信息类别”的选项
session.put("payforType",payforType); //保存已选择的“付费状态”的选项
session.put("stateType",stateType); //保存已选择的“审核状态”的选项
String sqlall="";
String sqlsub="";
Object[] params=null;
String mark="";
int perR=8;
if(!stateType.equals("all")&&!payforType.equals("all")){ //没有同时选择“付费状态”与“审核状态”中的“全部”选项
mark="1";
sqlall="SELECT * FROM tb_info WHERE (info_type=?) AND (info_state=?) AND (info_payfor=?) ORDER BY info_date DESC";
sqlsub="SELECT TOP "+perR+" * FROM tb_info WHERE (info_type=?) AND (info_state=?) AND (info_payfor=?) ORDER BY info_date DESC";
params=new Object[3];
params[0]=Integer.valueOf(infoType);
params[1]=stateType;
params[2]=payforType;
}else if(stateType.equals("all")&&payforType.equals("all")){ //同时选择了“付费状态”与“审核状态”中的“全部”选项
mark="2";
sqlall="SELECT * FROM tb_info WHERE (info_type=?) ORDER BY info_date DESC";
sqlsub="SELECT TOP "+perR+" * FROM tb_info WHERE (info_type=?) ORDER BY info_date DESC";
params=new Object[1];
params[0]=Integer.valueOf(infoType);
}else if(payforType.equals("all")){ //选择了“付费状态”中的“全部”选项,“审核状态”选项任意
mark="3";
sqlall="SELECT * FROM tb_info WHERE (info_type=?) AND (info_state=?) ORDER BY info_date DESC";
sqlsub="SELECT TOP "+perR+" * FROM tb_info WHERE (info_type=?) AND (info_state=?) ORDER BY info_date DESC";
params=new Object[2];
params[0]=Integer.valueOf(infoType);
params[1]=stateType;
}
else if(stateType.equals("all")){ //选择了“审核状态”中的“全部”选项,“付费状态”选项任意
mark="4";
sqlall="SELECT * FROM tb_info WHERE (info_type=?) AND (info_payfor=?) ORDER BY info_date DESC";
sqlsub="SELECT TOP "+perR+" * FROM tb_info WHERE (info_type=?) AND (info_payfor=?) ORDER BY info_date DESC";
params=new Object[2];
params[0]=Integer.valueOf(infoType);
params[1]=payforType;
}
String strCurrentP=request.getParameter("showpage");
String gowhich="admin_ListShow.action";
OpDB myOp=new OpDB();
CreatePage createPage=myOp.OpCreatePage(sqlall, params,perR,strCurrentP,gowhich); //调用OpDB类中的OpCreatePage()方法计算出总记录数、总页数,并且设置当前页码,这些信息都封装到了createPage对象中
int currentP=createPage.getCurrentP();
if(currentP>1){
int top=(currentP-1)*perR;
if(mark.equals("1")){
sqlsub="SELECT TOP "+perR+" * FROM tb_info i WHERE (info_type = ?) AND (info_payfor = ?) AND (info_state = ?) AND (info_date < (SELECT MIN(info_date) FROM (SELECT TOP "+top+" (info_date) FROM tb_info WHERE (info_type = i.info_type) AND (info_payfor = i.info_payfor) AND (info_state = i.info_state) ORDER BY info_date DESC) AS mindate)) ORDER BY info_date DESC";
}
else if(mark.equals("2")){
sqlsub="SELECT TOP "+perR+" * FROM tb_info i WHERE (info_type = ?) AND (info_date < (SELECT MIN(info_date) FROM (SELECT TOP "+top+" (info_date) FROM tb_info WHERE (info_type = i.info_type) ORDER BY info_date DESC) AS mindate)) ORDER BY info_date DESC";
}
else if(mark.equals("3")){
sqlsub="SELECT TOP "+perR+" * FROM tb_info i WHERE (info_type = ?) AND (info_state = ?) AND (info_date < (SELECT MIN(info_date) FROM (SELECT TOP "+top+" (info_date) FROM tb_info WHERE (info_type = i.info_type) AND (info_state = i.info_state) ORDER BY info_date DESC) AS mindate)) ORDER BY info_date DESC";
}
else if(mark.equals("4")){
sqlsub="SELECT TOP "+perR+" * FROM tb_info i WHERE (info_type = ?) AND (info_payfor = ?) AND (info_date < (SELECT MIN(info_date) FROM (SELECT TOP "+top+" (info_date) FROM tb_info WHERE (info_type = i.info_type) AND (info_payfor = i.info_payfor) ORDER BY info_date DESC) AS mindate)) ORDER BY info_date DESC";
}
}
List adminlistshow=myOp.OpListShow(sqlsub, params);
request.setAttribute("adminlistshow",adminlistshow);
request.setAttribute("createpage",createPage);
return SUCCESS;
}
/** 功能:管理员操作-显示要审核的信息 */
public String CheckShow(){
request.setAttribute("mainPage","../info/checkshow.jsp");
comebackState();
String sql="SELECT * FROM tb_info WHERE (id = ?)";
String checkID=request.getParameter("checkID");
if(checkID==null||checkID.equals(""))
checkID="-1";
Object[] params={checkID};
OpDB myOp=new OpDB();
infoSingle=myOp.OpSingleShow(sql, params);
if(infoSingle==null){ //信息不存在
request.setAttribute("mainPage","/pages/error.jsp");
addFieldError("AdminShowNoExist",getText("city.singleshow.no.exist"));
}
return SUCCESS;
}
/** 功能:管理员操作-审核信息(更新数据库) */
public String Check(){
session.put("adminOP","Check"); //记录当前操作为“审核信息”
String checkID=request.getParameter("checkID");
String sql="UPDATE tb_info SET info_state = 1 WHERE (id = ?)";
Object[] params={checkID};
OpDB myOp=new OpDB();
int i=myOp.OpUpdate(sql, params);
if(i>0){ //审核信息成功
return "checkSuccess";
}
else{ //审核信息失败
comebackState();
addFieldError("AdminCheckUnSuccess",getText("city.admin.check.no.success"));
request.setAttribute("mainPage","/pages/error.jsp");
return "UnSuccess";
}
}
/** 功能:管理员操作-删除信息(更新数据库) */
public String Delete(){
session.put("adminOP","Delete"); //记录当前操作为“删除信息”
String deleteID=request.getParameter("deleteID");
String sql="DELETE tb_info WHERE (id = ?)";
Object[] params={deleteID};
OpDB myOp=new OpDB();
int i=myOp.OpUpdate(sql, params);
if(i>0){ //删除信息成功
return "deleteSuccess";
}
else{ //删除信息失败
comebackState();
addFieldError("AdminDeleteUnSuccess",getText("city.admin.delete.no.success"));
request.setAttribute("mainPage","/pages/error.jsp");
return "UnSuccess";
}
}
/** 功能:管理员操作-显示要进行付费设置的信息 */
public String SetMoneyShow(){
request.setAttribute("mainPage","../info/moneyshow.jsp");
String moneyID=request.getParameter("moneyID");
if(moneyID==null||moneyID.equals(""))
moneyID="-1";
String sql="SELECT * FROM tb_info WHERE (id = ?)";
Object[] params={moneyID};
OpDB myOp=new OpDB();
infoSingle=myOp.OpSingleShow(sql, params);
if(infoSingle==null){ //信息不存在
request.setAttribute("mainPage","/pages/error.jsp");
addFieldError("AdminShowNoExist",getText("city.singleshow.no.exist"));
}
return SUCCESS;
}
/** 功能:管理员操作-设置已付费信息(更新数据库) */
public String SetMoney(){
String moneyID=request.getParameter("moneyID");
if(moneyID==null||moneyID.equals(""))
moneyID="-1";
String sql="UPDATE tb_info SET info_payfor=1 WHERE (id = ?)";
Object[] params={Integer.valueOf(moneyID)};
OpDB myOp=new OpDB();
int i=myOp.OpUpdate(sql, params);
if(i>0){ //信息付费设置成功
addFieldError("AdminSetMoneySuccess",getText("city.admin.setmoney.success"));
request.setAttribute("mainPage","/pages/error.jsp");
return "setMoneySuccess";
}
else{ //信息付费设置失败
addFieldError("AdminSetMoneyUnSuccess",getText("city.admin.setmoney.no.success"));
request.setAttribute("mainPage","/pages/error.jsp");
return "UnS
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
JAVA项目 毕业设计参考 Web源码 都市供求信息网 (内附使用说明+源码) JAVA项目 毕业设计参考 Web源码 都市供求信息网 (内附使用说明+源码)JAVA项目 毕业设计参考 Web源码 都市供求信息网 (内附使用说明+源码)JAVA项目 毕业设计参考 Web源码 都市供求信息网 (内附使用说明+源码)JAVA项目 毕业设计参考 Web源码 都市供求信息网 (内附使用说明+源码)JAVA项目 毕业设计参考 Web源码 都市供求信息网 (内附使用说明+源码)JAVA项目 毕业设计参考 Web源码 都市供求信息网 (内附使用说明+源码)JAVA项目 毕业设计参考 Web源码 都市供求信息网 (内附使用说明+源码)JAVA项目 毕业设计参考 Web源码 都市供求信息网 (内附使用说明+源码)JAVA项目 毕业设计参考 Web源码 都市供求信息网 (内附使用说明+源码)JAVA项目 毕业设计参考 Web源码 都市供求信息网 (内附使用说明+源码)JAVA项目 毕业设计参考 Web源码 都市供求信息网 (内附使用说明+源码)JAVA项目 毕业设计参考 Web源码 都市供求信息网 (内附
资源推荐
资源详情
资源评论
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![py](https://img-home.csdnimg.cn/images/20210720083646.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
收起资源包目录
![package](https://csdnimg.cn/release/downloadcmsfe/public/img/package.f3fc750b.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/DOC.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/GIF.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/JAR.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/JAR.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/JAR.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/JAR.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/JAR.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/JAR.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/JAR.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/JAR.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/JPG.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/JPG.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/JPG.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/JPG.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/JPG.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/JPG.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/JPG.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/JPG.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/JPG.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/JPG.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
共 107 条
- 1
- 2
资源评论
![avatar-default](https://csdnimg.cn/release/downloadcmsfe/public/img/lazyLogo2.1882d7f4.png)
![avatar](https://profile-avatar.csdnimg.cn/d3c140fc3f6e45a9a59d78b810b471f5_nekosann.jpg!1)
金克斯在coding
- 粉丝: 1805
- 资源: 151
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助
![voice](https://csdnimg.cn/release/downloadcmsfe/public/img/voice.245cc511.png)
![center-task](https://csdnimg.cn/release/downloadcmsfe/public/img/center-task.c2eda91a.png)
安全验证
文档复制为VIP权益,开通VIP直接复制
![dialog-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/green-success.6a4acb44.png)