package com.controller;
import java.io.File;
import java.io.IOException;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.io.PrintWriter;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;
import com.entity.Guihuantushu;
import com.server.GuihuantushuServer;
import com.util.PageBean;
import net.sf.json.JSONObject;
import com.util.db;
import java.sql.SQLException;
import java.sql.*;
@Controller
public class GuihuantushuController {
@Resource
private GuihuantushuServer guihuantushuService;
@RequestMapping("addGuihuantushu.do")
public String addGuihuantushu(HttpServletRequest request,Guihuantushu guihuantushu,HttpSession session) throws SQLException{
Timestamp time=new Timestamp(System.currentTimeMillis());
guihuantushu.setAddtime(time.toString().substring(0, 19));
guihuantushuService.add(guihuantushu);
db dbo = new db();
dbo.hsgexecute("update jieyuetushu set kucun=kucun+"+guihuantushu.getGuihuanshuliang()+" where tushubianhao='"+guihuantushu.getTushubianhao()+"'");
db dbo1 = new db();
dbo1.hsgexecute("update jieyuetushu set issh='是'where tushubianhao='"+guihuantushu.getTushubianhao()+"'");
//kuabiaogaizhi
session.setAttribute("backxx", "添加成功");
session.setAttribute("backurl", request.getHeader("Referer"));
//session.setAttribute("backurl", "guihuantushuList.do");
return "redirect:postback.jsp";
//return "redirect:guihuantushuList.do";
}
// 处理编辑
@RequestMapping("doUpdateGuihuantushu.do")
public String doUpdateGuihuantushu(int id,ModelMap map,Guihuantushu guihuantushu){
guihuantushu=guihuantushuService.getById(id);
map.put("guihuantushu", guihuantushu);
return "guihuantushu_updt";
}
@RequestMapping("doUpdateGuihuantushulb.do")
public String doUpdateGuihuantushulb(int id,ModelMap map,Guihuantushu guihuantushu){
guihuantushu=guihuantushuService.getById(id);
map.put("guihuantushu", guihuantushu);
return "guihuantushu_updtlb";
}
@RequestMapping("updateGuihuantushulb.do")
public String updateGuihuantushulb(int id,ModelMap map,Guihuantushu guihuantushu){
guihuantushuService.updatelb(guihuantushu);
return "redirect:guihuantushuList.do";
}
// 后台详细
@RequestMapping("guihuantushuDetail.do")
public String guihuantushuDetail(int id,ModelMap map,Guihuantushu guihuantushu){
guihuantushu=guihuantushuService.getById(id);
map.put("guihuantushu", guihuantushu);
return "guihuantushu_detail";
}
// 前台详细
@RequestMapping("ghtsDetail.do")
public String ghtsDetail(int id,ModelMap map,Guihuantushu guihuantushu){
guihuantushu=guihuantushuService.getById(id);
map.put("guihuantushu", guihuantushu);
return "guihuantushudetail";
}
//
@RequestMapping("updateGuihuantushu.do")
public String updateGuihuantushu(int id,ModelMap map,Guihuantushu guihuantushu,HttpServletRequest request,HttpSession session){
guihuantushuService.update(guihuantushu);
session.setAttribute("backxx", "修改成功");
session.setAttribute("backurl", request.getHeader("Referer"));
return "redirect:postback.jsp";
//String url = request.getHeader("Referer");
//return "redirect:"+url;
//return "redirect:guihuantushuList.do";
}
// 分页查询
@RequestMapping("guihuantushuList.do")
public String guihuantushuList(@RequestParam(value="page",required=false)String page,
ModelMap map,HttpSession session,Guihuantushu guihuantushu, String tushubianhao, String tushumingcheng, String tushuleibie, String kucun, String jieyueshuliang, String jieyueriqi, String guihuanshuliang1,String guihuanshuliang2, String duzhe, String shifouguihuan, String issh){
if(page==null||page.equals("")){
page="1";
}
PageBean pageBean=new PageBean(Integer.parseInt(page), 15);
Map<String, Object> pmap=new HashMap<String,Object>();
pmap.put("pageno", pageBean.getStart());
pmap.put("pageSize", 15);
if(tushubianhao==null||tushubianhao.equals("")){pmap.put("tushubianhao", null);}else{pmap.put("tushubianhao", tushubianhao);}
if(tushumingcheng==null||tushumingcheng.equals("")){pmap.put("tushumingcheng", null);}else{pmap.put("tushumingcheng", tushumingcheng);}
if(tushuleibie==null||tushuleibie.equals("")){pmap.put("tushuleibie", null);}else{pmap.put("tushuleibie", tushuleibie);}
if(kucun==null||kucun.equals("")){pmap.put("kucun", null);}else{pmap.put("kucun", kucun);}
if(jieyueshuliang==null||jieyueshuliang.equals("")){pmap.put("jieyueshuliang", null);}else{pmap.put("jieyueshuliang", jieyueshuliang);}
if(jieyueriqi==null||jieyueriqi.equals("")){pmap.put("jieyueriqi", null);}else{pmap.put("jieyueriqi", jieyueriqi);}
if(guihuanshuliang1==null||guihuanshuliang1.equals("")){pmap.put("guihuanshuliang1", null);}else{pmap.put("guihuanshuliang1", guihuanshuliang1);}
if(guihuanshuliang2==null||guihuanshuliang2.equals("")){pmap.put("guihuanshuliang2", null);}else{pmap.put("guihuanshuliang2", guihuanshuliang2);}
if(duzhe==null||duzhe.equals("")){pmap.put("duzhe", null);}else{pmap.put("duzhe", duzhe);}
if(shifouguihuan==null||shifouguihuan.equals("")){pmap.put("shifouguihuan", null);}else{pmap.put("shifouguihuan", shifouguihuan);}
int total=guihuantushuService.getCount(pmap);
pageBean.setTotal(total);
List<Guihuantushu> list=guihuantushuService.getByPage(pmap);
map.put("page", pageBean);
map.put("list", list);
session.setAttribute("p", 1);
return "guihuantushu_list";
}
@RequestMapping("guihuantushu_yanben1.do")
public String guihuantushu_yanben1(@RequestParam(value="page",required=false)String page,
ModelMap map,HttpSession session,Guihuantushu guihuantushu, String tushubianhao, String tushumingcheng, String tushuleibie, String kucun, String jieyueshuliang, String jieyueriqi, String guihuanshuliang1,String guihuanshuliang2, String duzhe, String shifouguihuan, String issh){
if(page==null||page.equals("")){
page="1";
}
PageBean pageBean=new PageBean(Integer.parseInt(page), 15);
Map<String, Object> pmap=new HashMap<String,Object>();
pmap.put("pageno", pageBean.getStart());
pmap.put("pageSize", 15);
if(tushubianhao==null||tushubianhao.equals("")){pmap.put("tushubianhao", null);}else{pmap.put("tushubianhao", tushubianhao);}
if(tushumingcheng==null||tushumingcheng.equals("")){pmap.put("tushumingcheng", null);}else{pmap.put("tushumingcheng", tushumingcheng);}
if(tushuleibie==null||tushuleibie.equals("")){pmap.put("tushuleibie", null);}else{pmap.put("tushuleibie", tushuleibie);}
if(kucun==null||kucun.equals("")){pmap.put("kucun", null);}else{pmap.put("kucun", kucun);}
if(jieyueshuliang==null||jieyueshuliang.equals("")){pmap.put("jieyueshuliang", null);}else{pmap.put("jieyueshuliang", jieyueshuliang);}
if(jieyueriqi==null||jieyueriqi.equals("")){pmap.put("jieyueriqi", null);}else{pmap.put("jieyueriqi", jieyueriqi);}
if(guihuanshuliang1==null||guihuanshuliang1.equals("")){pmap.put("guihuanshuliang1", null);}else{pmap.put("guihuanshuliang1", guihuanshuliang1);}
if(guihuanshuliang2==null||guihuanshuliang2.equals("")){pmap.put("guihuanshuliang2", null);}else{pmap.put("guihuanshuliang2", guihuanshuliang2);}
if(duzhe==null||duzhe.equals("")){pmap.put("duzhe", null);}else{pmap.put("duzhe", duzhe);}
if(shifouguihuan==null||shifouguihuan.equals("")){pmap.put("shifouguihuan", null);}else{pmap.put("shifouguihuan", shifouguihuan);}
int total=guihuantushuService.getCount(pmap);
pageBean.setTotal(total)
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
基于Java+SSM的书籍借阅系统毕业设计(源码+说明+演示视频).zip 【项目技术】 java+mysql+ssm+b/s 【实现功能】 从角色角度方面来看其主要角色主要有管理员和读者两大角色。 其中管理员的主要功能模块包括管理员系统用户管理、读者管理、图书类别管理、公告管理、书架管理、图书管理、续借图书管理、归还图书管理、借阅图书管理、图书统计;读者的主要功能模块包括个人资料管理、公告管理、续借图书管理、归还图书管理、借阅图书管理等。
资源推荐
资源详情
资源评论
收起资源包目录
基于Java+SSM的书籍借阅系统毕业设计(源码+说明+演示视频).zip (555个子文件)
VeDate.class 9KB
GuihuantushuController.class 6KB
JieyuetushuController.class 5KB
XujietushuController.class 5KB
DuzheController.class 5KB
TushuxinxiController.class 5KB
GonggaoController.class 4KB
ShujiaController.class 4KB
TushuleibieController.class 4KB
YonghuzhuceController.class 4KB
Info.class 4KB
Yonghuzhuce.class 4KB
ShoucangjiluController.class 4KB
StrUtil.class 4KB
LiuyanbanController.class 3KB
AllusersController.class 3KB
YouqinglianjieController.class 3KB
Guihuantushu.class 3KB
db.class 3KB
XinwentongzhiController.class 3KB
Tushuxinxi.class 3KB
PinglunController.class 3KB
GuihuantushuServerImpi.class 3KB
LiuyanbanServerImpi.class 3KB
YouqinglianjieServerImpi.class 3KB
Jieyuetushu.class 3KB
TushuleibieServerImpi.class 3KB
JieyuetushuServerImpi.class 3KB
YonghuzhuceServerImpi.class 3KB
XujietushuServerImpi.class 3KB
TushuxinxiServerImpi.class 3KB
Duzhe.class 3KB
GonggaoServerImpi.class 3KB
XinwentongzhiServerImpi.class 3KB
ShujiaServerImpi.class 3KB
DuzheServerImpi.class 3KB
AllusersServerImpi.class 3KB
SetChar.class 3KB
Xinwentongzhi.class 2KB
Liuyanban.class 2KB
ShoucangjiluServerImpi.class 2KB
Xujietushu.class 2KB
PinglunServerImpi.class 2KB
Shujia.class 2KB
Pinglun.class 2KB
Shoucangjilu.class 2KB
testFilter.class 2KB
Md5.class 2KB
Youqinglianjie.class 2KB
Allusers.class 2KB
Gonggao.class 1KB
PageBean.class 1KB
PageInfo.class 1KB
hsgloginController.class 1KB
Tushuleibie.class 1KB
GuihuantushuMapper.class 1KB
YouqinglianjieMapper.class 1KB
IndexController.class 1KB
XinwentongzhiMapper.class 1020B
LiuyanbanMapper.class 1016B
TushuleibieMapper.class 998B
JieyuetushuMapper.class 998B
YonghuzhuceMapper.class 998B
TushuxinxiMapper.class 987B
XujietushuMapper.class 987B
GonggaoMapper.class 954B
ShujiaMapper.class 943B
DuzheMapper.class 932B
CheckCode.class 922B
ShoucangjiluMapper.class 898B
AllusersMapper.class 898B
YouqinglianjieServer.class 896B
GuihuantushuServer.class 893B
YonghuzhuceServer.class 863B
TushuleibieServer.class 863B
JieyuetushuServer.class 863B
LiuyanbanServer.class 860B
PinglunMapper.class 858B
XujietushuServer.class 852B
TushuxinxiServer.class 852B
GonggaoServer.class 819B
ShujiaServer.class 808B
DuzheServer.class 797B
XinwentongzhiServer.class 796B
ShoucangjiluServer.class 763B
AllusersServer.class 763B
PinglunServer.class 723B
Constant.class 674B
.classpath 1KB
org.eclipse.wst.common.component 592B
org.eclipse.wst.jsdt.ui.superType.container 49B
common.css 136KB
common.css 136KB
bootstrap.min.css 119KB
common.css 118KB
style.css 19KB
datepicker.css 4KB
div.css 4KB
div.css 4KB
div.css 4KB
共 555 条
- 1
- 2
- 3
- 4
- 5
- 6
资源评论
职场程序猿
- 粉丝: 6394
- 资源: 3706
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- (177506440)PHP与Mysql学生成绩管理系统.zip
- 放大电路毕业设计完整版.pdf
- (177506442)php学生管理系统.zip
- 储能系统下垂控制,蓄电池通过双向dc dc变器并联负载,变器输出电流按电阻比例分配,并补偿有下垂系数带来的母线压降 附文献
- (178068804)SpringBoot的拍卖系统.zip
- 二手车数据集文件.zip
- TSSOP的 AD封装库
- (178584614)熵值法stata代码+数据
- 海洋生态监控:毛虾入侵预警系统项目总结报告-含报告
- (180341832)空气悬架建模 软件使用:Matlab Simulink 适用场景:采用模块化建模方法,搭建非线性空气悬架模型 模型包含:路面不
- (1852624)C#记事本完整的源代码供大家学习
- 咖啡评分数据集.zip
- 登录样式优化,后端为node.js
- ECharts仪表盘-得分环.rar
- ECharts仪表盘-带标签数字动画的基础仪表盘.zip
- ECharts仪表盘-GaugeCar.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功