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.Xiaoshoujilu;
import com.server.XiaoshoujiluServer;
import com.util.PageBean;
import net.sf.json.JSONObject;
import com.util.db;
import java.sql.SQLException;
import java.sql.*;
@Controller
public class XiaoshoujiluController {
@Resource
private XiaoshoujiluServer xiaoshoujiluService;
@RequestMapping("addXiaoshoujilu.do")
public String addXiaoshoujilu(HttpServletRequest request,Xiaoshoujilu xiaoshoujilu,HttpSession session) throws SQLException{
Timestamp time=new Timestamp(System.currentTimeMillis());
xiaoshoujilu.setAddtime(time.toString().substring(0, 19));
xiaoshoujiluService.add(xiaoshoujilu);
db dbo = new db();
dbo.hsgexecute("update shangpinxinxi set kucun=kucun-"+xiaoshoujilu.getXiaoshoushuliang()+" where shangpinbianhao='"+xiaoshoujilu.getShangpinbianhao()+"'");
//kuabiaogaizhi
session.setAttribute("backxx", "添加成功");
session.setAttribute("backurl", request.getHeader("Referer"));
//session.setAttribute("backurl", "xiaoshoujiluList.do");
return "redirect:postback.jsp";
//return "redirect:xiaoshoujiluList.do";
}
// 处理编辑
@RequestMapping("doUpdateXiaoshoujilu.do")
public String doUpdateXiaoshoujilu(int id,ModelMap map,Xiaoshoujilu xiaoshoujilu){
xiaoshoujilu=xiaoshoujiluService.getById(id);
map.put("xiaoshoujilu", xiaoshoujilu);
return "xiaoshoujilu_updt";
}
// 后台详细
@RequestMapping("xiaoshoujiluDetail.do")
public String xiaoshoujiluDetail(int id,ModelMap map,Xiaoshoujilu xiaoshoujilu){
xiaoshoujilu=xiaoshoujiluService.getById(id);
map.put("xiaoshoujilu", xiaoshoujilu);
return "xiaoshoujilu_detail";
}
// 前台详细
@RequestMapping("xsjlDetail.do")
public String xsjlDetail(int id,ModelMap map,Xiaoshoujilu xiaoshoujilu){
xiaoshoujilu=xiaoshoujiluService.getById(id);
map.put("xiaoshoujilu", xiaoshoujilu);
return "xiaoshoujiludetail";
}
//
@RequestMapping("updateXiaoshoujilu.do")
public String updateXiaoshoujilu(int id,ModelMap map,Xiaoshoujilu xiaoshoujilu,HttpServletRequest request,HttpSession session){
xiaoshoujiluService.update(xiaoshoujilu);
session.setAttribute("backxx", "修改成功");
session.setAttribute("backurl", request.getHeader("Referer"));
return "redirect:postback.jsp";
//String url = request.getHeader("Referer");
//return "redirect:"+url;
//return "redirect:xiaoshoujiluList.do";
}
// 分页查询
@RequestMapping("xiaoshoujiluList.do")
public String xiaoshoujiluList(@RequestParam(value="page",required=false)String page,
ModelMap map,HttpSession session,Xiaoshoujilu xiaoshoujilu, String shangpinbianhao, String shangpinmingcheng, String shangpinleibie, String shangpinjiage, String kucun, String xiaoshoushuliang1,String xiaoshoushuliang2, String zongjine, String yonghuming, String xingming, String lianxidianhua, String caozuoyuan){
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(shangpinbianhao==null||shangpinbianhao.equals("")){pmap.put("shangpinbianhao", null);}else{pmap.put("shangpinbianhao", shangpinbianhao);}
if(shangpinmingcheng==null||shangpinmingcheng.equals("")){pmap.put("shangpinmingcheng", null);}else{pmap.put("shangpinmingcheng", shangpinmingcheng);}
if(shangpinleibie==null||shangpinleibie.equals("")){pmap.put("shangpinleibie", null);}else{pmap.put("shangpinleibie", shangpinleibie);}
if(shangpinjiage==null||shangpinjiage.equals("")){pmap.put("shangpinjiage", null);}else{pmap.put("shangpinjiage", shangpinjiage);}
if(kucun==null||kucun.equals("")){pmap.put("kucun", null);}else{pmap.put("kucun", kucun);}
if(xiaoshoushuliang1==null||xiaoshoushuliang1.equals("")){pmap.put("xiaoshoushuliang1", null);}else{pmap.put("xiaoshoushuliang1", xiaoshoushuliang1);}
if(xiaoshoushuliang2==null||xiaoshoushuliang2.equals("")){pmap.put("xiaoshoushuliang2", null);}else{pmap.put("xiaoshoushuliang2", xiaoshoushuliang2);}
if(zongjine==null||zongjine.equals("")){pmap.put("zongjine", null);}else{pmap.put("zongjine", zongjine);}
if(yonghuming==null||yonghuming.equals("")){pmap.put("yonghuming", null);}else{pmap.put("yonghuming", yonghuming);}
if(xingming==null||xingming.equals("")){pmap.put("xingming", null);}else{pmap.put("xingming", xingming);}
if(lianxidianhua==null||lianxidianhua.equals("")){pmap.put("lianxidianhua", null);}else{pmap.put("lianxidianhua", lianxidianhua);}
if(caozuoyuan==null||caozuoyuan.equals("")){pmap.put("caozuoyuan", null);}else{pmap.put("caozuoyuan", caozuoyuan);}
int total=xiaoshoujiluService.getCount(pmap);
pageBean.setTotal(total);
List<Xiaoshoujilu> list=xiaoshoujiluService.getByPage(pmap);
map.put("page", pageBean);
map.put("list", list);
session.setAttribute("p", 1);
return "xiaoshoujilu_list";
}
@RequestMapping("xiaoshoujilu_yanben1.do")
public String xiaoshoujilu_yanben1(@RequestParam(value="page",required=false)String page,
ModelMap map,HttpSession session,Xiaoshoujilu xiaoshoujilu, String shangpinbianhao, String shangpinmingcheng, String shangpinleibie, String shangpinjiage, String kucun, String xiaoshoushuliang1,String xiaoshoushuliang2, String zongjine, String yonghuming, String xingming, String lianxidianhua, String caozuoyuan){
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(shangpinbianhao==null||shangpinbianhao.equals("")){pmap.put("shangpinbianhao", null);}else{pmap.put("shangpinbianhao", shangpinbianhao);}
if(shangpinmingcheng==null||shangpinmingcheng.equals("")){pmap.put("shangpinmingcheng", null);}else{pmap.put("shangpinmingcheng", shangpinmingcheng);}
if(shangpinleibie==null||shangpinleibie.equals("")){pmap.put("shangpinleibie", null);}else{pmap.put("shangpinleibie", shangpinleibie);}
if(shangpinjiage==null||shangpinjiage.equals("")){pmap.put("shangpinjiage", null);}else{pmap.put("shangpinjiage", shangpinjiage);}
if(kucun==null||kucun.equals("")){pmap.put("kucun", null);}else{pmap.put("kucun", kucun);}
if(xiaoshoushuliang1==null||xiaoshoushuliang1.equals("")){pmap.put("xiaoshoushuliang1", null);}else{pmap.put("xiaoshoushuliang1", xiaoshoushuliang1);}
if(xiaoshoushuliang2==null||xiaoshoushuliang2.equals("")){pmap.put("xiaoshoushuliang2", null);}else{pmap.put("xiaoshoushuliang2", xiaoshoushuliang2);}
if(zongjine==null||zongjine.equals("")){pmap.put("zongjine", null);}else{pmap.put("zongjine", zongjine);}
if(yonghuming==null||yonghuming.equals("")){pmap.put("yonghuming", null);}else{pmap.put("yonghuming", yonghuming);}
if(xingming==null||xingming.equals("")){pmap.put("xingming", null);}else{pmap.put("xingming", xingming);}
if(lianxidianhua==null||lianxidianhua.equals("")){pmap.put("lianxidianhua", null);}else{pmap.put("lianxidianhua", lianxidianhua);}
if(caozuoyuan==null||caozuoyuan.equals("")){pmap.put("caozuoyuan", null);}else{pmap.put("caozuoyuan", caozuoyuan);}
int total=xiaoshoujiluService
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
源码是经过本地编译可运行的,下载完成之后配置相应环境即可使用。源码功能都是经过老师肯定的,都能满足要求,有需要放心下载即可。源码是经过本地编译可运行的,下载完成之后配置相应环境即可使用。源码功能都是经过老师肯定的,都能满足要求,有需要放心下载即可。源码是经过本地编译可运行的,下载完成之后配置相应环境即可使用。源码功能都是经过老师肯定的,都能满足要求,有需要放心下载即可。源码是经过本地编译可运行的,下载完成之后配置相应环境即可使用。源码功能都是经过老师肯定的,都能满足要求,有需要放心下载即可。源码是经过本地编译可运行的,下载完成之后配置相应环境即可使用。源码功能都是经过老师肯定的,都能满足要求,有需要放心下载即可。源码是经过本地编译可运行的,下载完成之后配置相应环境即可使用。源码功能都是经过老师肯定的,都能满足要求,有需要放心下载即可。源码是经过本地编译可运行的,下载完成之后配置相应环境即可使用。源码功能都是经过老师肯定的,都能满足要求,有需要放心下载即可。源码是经过本地编译可运行的,下载完成之后配置相应环境即可使用。源码功能都是经过老师肯定的,都能满足要求,有需要放心下载即可。源码是经
资源推荐
资源详情
资源评论
收起资源包目录
基于ssm+mysql的在线收银系统源码数据库文档.zip (489个子文件)
alipay_md5.asp 11KB
alipay_function.asp 6KB
alipay_notify.asp 5KB
alipay_service.asp 2KB
Info.class 18KB
XiaoshoujiluController.class 17KB
RukujiluController.class 15KB
db.class 14KB
YuangongController.class 14KB
YonghuController.class 13KB
ShangpinxinxiController.class 12KB
YonghuzhuceController.class 9KB
VeDate.class 9KB
ShangpinleibieController.class 9KB
AllusersController.class 7KB
ShoucangjiluController.class 7KB
LiuyanbanController.class 7KB
XinwentongzhiController.class 6KB
YouqinglianjieController.class 6KB
PinglunController.class 6KB
Yonghuzhuce.class 4KB
Xiaoshoujilu.class 4KB
StrUtil.class 4KB
LiuyanbanServerImpi.class 3KB
Rukujilu.class 3KB
ShangpinleibieServerImpi.class 3KB
YouqinglianjieServerImpi.class 3KB
ShangpinxinxiServerImpi.class 3KB
XiaoshoujiluServerImpi.class 3KB
YonghuzhuceServerImpi.class 3KB
YuangongServerImpi.class 3KB
RukujiluServerImpi.class 3KB
XinwentongzhiServerImpi.class 3KB
YonghuServerImpi.class 3KB
AllusersServerImpi.class 3KB
Xinwentongzhi.class 2KB
Yonghu.class 2KB
Yuangong.class 2KB
Liuyanban.class 2KB
ShoucangjiluServerImpi.class 2KB
Shangpinxinxi.class 2KB
PinglunServerImpi.class 2KB
hsgloginController.class 2KB
Pinglun.class 2KB
Shoucangjilu.class 2KB
Md5.class 2KB
SetChar.class 2KB
IndexController.class 2KB
Youqinglianjie.class 2KB
Allusers.class 2KB
PageBean.class 1KB
PageInfo.class 1KB
testFilter.class 1KB
Shangpinleibie.class 1KB
ShangpinleibieMapper.class 1KB
YouqinglianjieMapper.class 1KB
XinwentongzhiMapper.class 1020B
ShangpinxinxiMapper.class 1020B
LiuyanbanMapper.class 1016B
XiaoshoujiluMapper.class 1009B
YonghuzhuceMapper.class 998B
RukujiluMapper.class 965B
YuangongMapper.class 965B
YonghuMapper.class 943B
CheckCode.class 922B
ShoucangjiluMapper.class 898B
AllusersMapper.class 898B
ShangpinleibieServer.class 896B
YouqinglianjieServer.class 896B
ShangpinxinxiServer.class 885B
XiaoshoujiluServer.class 874B
YonghuzhuceServer.class 863B
LiuyanbanServer.class 860B
PinglunMapper.class 858B
RukujiluServer.class 830B
YuangongServer.class 830B
YonghuServer.class 808B
XinwentongzhiServer.class 796B
AllusersServer.class 763B
ShoucangjiluServer.class 763B
PinglunServer.class 723B
Constant.class 674B
.classpath 1KB
org.eclipse.wst.common.component 586B
org.eclipse.wst.jsdt.ui.superType.container 49B
common.css 136KB
common.css 136KB
bootstrap.min.css 119KB
common.css 118KB
style.css 27KB
layout.css 15KB
layout.css 12KB
login.css 5KB
identify.css 4KB
datepicker.css 4KB
div.css 4KB
div.css 4KB
div.css 4KB
datepicker.css 4KB
divqt.css 4KB
共 489 条
- 1
- 2
- 3
- 4
- 5
资源评论
老歪不歪
- 粉丝: 58
- 资源: 4367
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功