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)
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
SSM项目-书籍借阅系统的Java毕业设计(源码+说明+演示视频).zip 【项目技术】 java+mysql+ssm+b/s 【实现功能】 从角色角度方面来看其主要角色主要有管理员和读者两大角色。 其中管理员的主要功能模块包括管理员系统用户管理、读者管理、图书类别管理、公告管理、书架管理、图书管理、续借图书管理、归还图书管理、借阅图书管理、图书统计;读者的主要功能模块包括个人资料管理、公告管理、续借图书管理、归还图书管理、借阅图书管理等。
资源推荐
资源详情
资源评论
收起资源包目录
SSM项目-书籍借阅系统的Java毕业设计(源码+说明+演示视频).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
资源评论
岛上程序猿
- 粉丝: 5576
- 资源: 4237
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- (源码)基于Spring Boot框架的报表管理系统.zip
- (源码)基于树莓派和TensorFlow Lite的智能厨具环境监测系统.zip
- (源码)基于OpenCV和Arduino的面部追踪系统.zip
- (源码)基于C++和ZeroMQ的分布式系统中间件.zip
- (源码)基于SSM框架的学生信息管理系统.zip
- (源码)基于PyTorch框架的智能视频分析系统.zip
- (源码)基于STM32F1的Sybertooth电机驱动系统.zip
- (源码)基于PxMATRIX库的嵌入式系统显示与配置管理.zip
- (源码)基于虚幻引擎的舞蹈艺术节目包装系统.zip
- (源码)基于Dubbo和Redis的用户中台系统.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功