基于javaweb+mysql的ssm+maven超市进销存管理系统(java+ssm+jsp+bootstrap+jquery+mysql)
运行环境
Java≥8、MySQL≥5.7、Tomcat≥8
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
基于javaweb+mysql的SSM+Maven超市进销存管理系统(java+ssm+jsp+bootstrap+jquery+mysql)
ssm超市进销存管理系统
项目介绍
超市进销存管理系统,主要分为管理员与员工两种角色:管理员主要功能模块有: 进货管理:进货信息、退货信息; 商品信息管理:商品信息、商品类别; 库存管理:库存信息、库存预警、临期产品; 销售管理:销售信息、销售统计、顾客退货办理; 客户信息管理:客户信息; 供应商信息管理:供应商信息; 员工信息管理:员工信息;员工主要功能有: 进货管理:进货信息、退货信息; 商品信息管理:商品信息、商品类别; 库存管理:库存信息、库存预警、临期产品; 销售管理:销售信息、顾客退货办理; 客户信息管理:客户信息; 供应商信息管理:供应商信息;
环境需要
1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。
2.IDE环境:IDEA。注:该项目暂不支持Eclipse或者MyEclipse; 3.tomcat环境:Tomcat 7.x,8.x,9.x版本均可 4.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS; 5.是否Maven项目: 是;查看源码目录中是否包含pom.xml;若包含,则为maven项目,否则为非maven项目
6.数据库:MySql 5.7版本;
技术栈
-
后端:Spring SpringMVC MyBatis
-
前端:JSP+bootstrap+jQuery
使用说明
-
使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件;
-
将项目中db.properties与spring-mybatis.xml配置文件中的数据库配置改为自己的配置
-
使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven;
若为maven项目,导入成功后请执行maven clean;maven install命令,配置tomcat,然后运行;
- 运行项目,在浏览器中输入localhost:8080/chaoshi 登录
注意事项
项目路径必须为localhost:8080/chaoshi,前端代码中已写死,否则会报错;
@RequestMapping("/toupdate")
public String editmanager(Manager manager,HttpServletRequest request,Model model){
model.addAttribute("manager", managerServiceImp.getmanager(manager.getManagerid()));
return "manager/editmanager";
}
// 跳转到增加页面
@RequestMapping("/toadd")
public String toadd(){
return "manager/addstaff";
}
//跳转到修改员工信息页面
@RequestMapping("/toupdatestaff")
public String editstaff(Staff staff,HttpServletRequest request,Model model){
model.addAttribute("staff", staffServiceImp.getbyid(staff.getStaffid()));
return "manager/editstaff";
}
//修改员工信息
@RequestMapping("/updatestaff")
public String updatestaff(Staff staff,HttpServletRequest request,Model model){
if(staffServiceImp.update(staff)) {
staff=staffServiceImp.getbyid(staff.getStaffid());
model.addAttribute("staff", staff);
return "redirect:getall";
}
return null;
}
// 先判断数据库有没有,有就更新,没有就新增
@RequestMapping("/insert")
public String insert(Staff staff,HttpServletRequest request,Model model){
if(null==staffServiceImp.getbyid(staff.getStaffid())) {
staffServiceImp.insert(staff);
}else {
staffServiceImp.update(staff);
}
return "redirect:getall";
/**
* @Date 2019年4月19日下午2:08:21
* @Des
*/
@Controller
@RequestMapping("/manager/flatform/custom")
public class MCustomController {
@Autowired
CustomServiceImp customServiceImp;
// 跳转到增加页面
@RequestMapping("/toadd")
public String toaddCustom(){
return "manager/addcus";
}
// 跳转到修改页面
@RequestMapping("/toupdate")
public String editProduct(Custom custom,HttpServletRequest request,Model model){
model.addAttribute("custom", customServiceImp.getByid(custom.getCusid()));
return "manager/editcus";
}
// 先判断数据库有没有,有就更新,没有就新增
@RequestMapping("/insert")
public String insert(Custom custom,HttpServletRequest request,Model model){
if(null==customServiceImp.getByid(custom.getCusid())) {
customServiceImp.insert(custom);
}else {
customServiceImp.update(custom);
}
return "redirect:getall";
}
// 删除
@RequestMapping("/delete")
public String delete(String cusid) {
customServiceImp.delete(cusid);
return "redirect:getall";
}
@InitBinder
protected void init(HttpServletRequest request, ServletRequestDataBinder binder) {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
dateFormat.setLenient(false);
binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, false));
}
// 按条件获取所有进货信息
@RequestMapping("getbyparams")
public String getbyparams(HttpServletRequest request,Model model,@RequestParam(value="proid",required=false)String proid,
@RequestParam(value="inid",required=false)String inid,@RequestParam(value="pname",required=false)String pname,
@RequestParam(value="retdate",required=false)String retdate,@RequestParam(defaultValue="1",required=true,value="pn") Integer pn
) {
PageHelper.startPage(pn, 100);
List<Ckretire> ckin= ckretireServiceImp.getbyparams(proid, inid, pname, retdate);
PageInfo<Ckretire> pageInfo=new PageInfo<Ckretire>(ckin);
model.addAttribute("pageInfo", pageInfo);
return "getckretirebyparams";
}
// 根据id查询单个信息
@RequestMapping("/getckret")
@ResponseBody
public Ckin ckretire(String inid,HttpServletRequest request,Model model){
Ckin ckretire=new Ckin();
ckretire= ckinServiceImp.getbyid(inid);
return ckretire;
}
}
package com.hbh.controller;
public String toaddpro(){
return "addpro";
}
@RequestMapping("/insertpro")
// 先判断数据库有没有,有就更新,没有就新增
public String insertpro(Product product,HttpServletRequest request,Model model){
if(null==productServiceImp.selectByPrimaryKey(product.getProid())) {
productServiceImp.insert(product);
return "redirect:getlist";
}else {
request.setAttribute("msg", "新增失败,系统中存在该id的商品,请重新输入!");
return "addpro";
}
}
@InitBinder
protected void init(HttpServletRequest request, ServletRequestDataBinder binder) {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
dateFormat.setLenient(false);
binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, false));
}
@RequestMapping("/getproduct")
@ResponseBody
public Product getproduct(String proid,HttpServletRequest request,Model model){
Product product= new Product();
product=productServiceImp.selectByPrimaryKey(proid);
return product;
}
}
package com.hbh.controller;
model.addAttribute("kcxx",kcxxServiceImp.getbyid(proid));
return "manager/getall";
}
@RequestMapping("/kcxxWithPro")
public String kcxxWithPro(String proid,HttpServletRequest request,Model model) {
Kcxx kcxx=kcxxServiceImp.kcxxWithPro(proid);
request.setAttribute("kcxx", kcxx);
model.addAttribute("kcxx",kcxx);
return "manager/getkcxx";
}
// 库存预警
@RequestMapping("/kcxxWithPronum")
public String kcxxWithPronum(ModelMap model,
@RequestParam(defaultValue="1",required=true,value="pn") Integer pn
) {
PageHelper.startPage(pn, 4);
List<Kcxx> kcxxs= kcxxServiceImp.kcxxWithPronum();
PageInfo<Kcxx> pageInfo=new PageInfo<Kcxx>(kcxxs);
model.addAttribute("pageInfo", pageInfo);
return "manager/getkcxx_num";
}
// 临期产品
@RequestMapping("/kcxxWithProdata")
public String kcxxWithProdata(ModelMap model,
@RequestParam(defaultValue="1",required=true,value="pn") Integer pn
) {
PageHelper.startPage(pn, 4);
List<Kcxx> kcxxs= kcxxServiceImp.kcxxWithProdata();
PageInfo<Kcxx> pageInfo=new PageInfo<Kcxx>(kcxxs);
model.addAttribute("pageInfo", pageInfo);
return "manager/getkcxx_data";
}
@InitBinder
protected void init(HttpServletRequest request, ServletRequestDataBinder binder) {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
dateFormat.setLenient(false);
binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, false));
}
// 按条件获取所有进货信息
@RequestMapping("getbyparams")
public String getbyparams(HttpServletRequest request,Model model,@RequestParam(value="proid",required=false)String proid,
/**
* @Date 2019年4月16日下午1:56:55
* @Des 管理员控制层
*/
@Controller
@RequestMapping("/manager")
public class ManagerController {
private Logger logger=Logger.getLogger(ManagerController.class);
@Autowired
ManagerServiceImp managerServiceImp;
@Autowired
StaffServiceImp staffServiceImp;
@Autowired
KcxxServiceImp kcxxServiceImp;
@RequestMapping("/login")
public String login() {
logger.debug("LoginController welcome AppInfoSystem develpor==================");
return "manager/managerlogin";
}
@RequestMapping(value="/dologin")
public String dologin(@RequestParam String managerid,@RequestParam String pwd,
HttpSession session,HttpServletRequest request) {
Manager manager=managerServiceImp.getbyid(managerid, pwd);
if(manager!=null) {
session.setAttribute(Constants.Manager_SESSION, manager);
return "redirect:/manager/flatform/main";
}else {
request.setAttribute("error", "账号密码不匹配");
return "manager/managerlogin";
}
}
@RequestMapping(value="/flatform/main")
public String main(HttpSession session,HttpServletRequest request) {
// 验证是否有session信息,防止非法登录,没有就跳转到登录页面
if(session.getAttribute(Constants.Manager_SESSION)==null)
/**
* @Date 2019年3月27日下午3:28:51
* @Des 进货管理
*/
@Controller
@RequestMapping("/staff/flatform/ckin")
public class CkinController {
@Autowired
CkinServiceImp ckinServiceImp;
// 获取所有进货信息
@RequestMapping("getall")
public String getlist(ModelMap model,
@RequestParam(defaultValue="1",required=true,value="pn") Integer pn
) {
PageHelper.startPage(pn, 4);
List<Ckin> ckin= ckinServiceImp.getall();
PageInfo<Ckin> pageInfo=new PageInfo<Ckin>(ckin);
model.addAttribute("pageInfo", pageInfo);
return "getall_ckin";
}
// 根据id查询单个信息
@RequestMapping("/getckin")
public String getbyid(String inid,HttpServletRequest request,Model model){
request.setAttribute("ckin", ckinServiceImp.getbyid(inid));
model.addAttribute("ckin",ckinServiceImp.getbyid(inid));
return "getckin";
}
// 根据条件查询
/* @RequestMapping("/getwhere")
public String getwhere(String id,String pname,String type ,HttpServletRequest request,Model model){
request.setAttribute(" duct", ckinServiceImp.getbywhere( id, pname, type));
model.addAttribute(" duct",ckinServiceImp.getbywhere( id, pname, type));
return "getlist";
}*/
@RequestMapping("edit")
public String edit(Ckin ckin,HttpServletRequest request,Model model){
model.addAttribute("ckin", ckinServiceImp.getbyid(ckin.getInid()));
return "editckin";
}
@RequestMapping("update")
public String update(Ckin ckin,HttpServletRequest request,Model model){
if(ckinServiceImp.update(ckin)) {
ckin=ckinServiceImp.getbyid(ckin.getInid());
model.addAttribute("ckin", ckin);
return "redirect:getall";
}
return null;
}
// 根据id查询单个信息
@RequestMapping("/getckin")
public String getbyid(String inid,HttpServletRequest request,Model model){
request.setAttribute("ckin", ckinServiceImp.getbyid(inid));
model.addAttribute("ckin",ckinServiceImp.getbyid(inid));
return "manager/getckin";
}
// 根据条件查询
/* @RequestMapping("/getwhere")
public String getwhere(String id,String pname,String type ,HttpServletRequest request,Model model){
request.setAttribute(" duct", ckinServiceImp.getbywhere( id, pname, type));
model.addAttribute(" duct",ckinServiceImp.getbywhere( id, pname, type));
return "getlist";
}*/
@RequestMapping("edit")
public String edit(Ckin ckin,HttpServletRequest request,Model model){
model.addAttribute("ckin", ckinServiceImp.getbyid(ckin.getInid()));
return "manager/editckin";
}
@RequestMapping("update")
public String update(Ckin ckin,HttpServletRequest request,Model model){
if(ckinServiceImp.update(ckin)) {
ckin=ckinServiceImp.getbyid(ckin.getInid());
model.addAttribute("ckin", ckin);
return "redirect:getall";
}
return null;
}
@RequestMapping("/delete")
public String deletete(String inid,HttpServletRequest request,Model model){
ckinServiceImp.delete(inid);
return "redirect:getall";
}
// 跳转到增加页面
@RequestMapping("/toadd")
public String toadd (){
return "manager/addckin";
}
@RequestMapping("/insert")
// 先判断数据库有没有,有就更新,没有就新增
public String insert (Ckin ckin,HttpServletRequest request,Model model){
if(null==ckinServiceImp.getbyid(ckin.getInid())) {
) {
PageHelper.startPage(pn, 4);
List<Kcxx> kcxxs= kcxxServiceImp.getall();
PageInfo<Kcxx> pageInfo=new PageInfo<Kcxx>(kcxxs);
model.addAttribute("pageInfo", pageInfo);
return "manager/getall_kcxx";
}
// 查询单个
@RequestMapping("/getbyid")
public String getbyid(String proid,HttpServletRequest request,Model model) {
request.setAttribute("kcxx", kcxxServiceImp.getbyid(proid));
model.addAttribute("kcxx",kcxxServiceImp.getbyid(proid));
return "manager/getall";
}
@RequestMapping("/kcxxWithPro")
public String kcxxWithPro(String proid,HttpServletRequest request,Model model) {
Kcxx kcxx=kcxxServiceImp.kcxxWithPro(proid);
request.setAttribute("kcxx", kcxx);
model.addAttribute("kcxx",kcxx);
return "manager/getkcxx";
}
// 库存预警
@RequestMapping("/kcxxWithPronum")
public String kcxxWithPronum(ModelMap model,
@RequestParam(defaultValue="1",required=true,value="pn") Integer pn
) {
PageHelper.startPage(pn, 4);
List<Kcxx> kcxxs= kcxxServiceImp.kcxxWithPronum();
PageInfo<Kcxx> pageInfo=new PageInfo<Kcxx>(kcxxs);
model.addAttribute("pageInfo", pageInfo);
return "manager/getkcxx_num";
}
// 临期产品
@RequestMapping("/kcxxWithProdata")
public String kcxxWithProdata(ModelMap model,
@RequestParam(defaultValue="1",required=true,value="pn") Integer pn
) {
// 先判断数据库有没有,有就更新,没有就新增
@RequestMapping("/insert")
public String insert(Staff staff,HttpServletRequest request,Model model){
if(null==staffServiceImp.getbyid(staff.getStaffid())) {
staffServiceImp.insert(staff);
}else {
staffServiceImp.update(staff);
}
return "redirect:getall";
}
// 删除
@RequestMapping("/delete")
public String delete(String staffid) {
staffServiceImp.delete(staffid);
return "redirect:getall";
}
// 查询所有
@RequestMapping("/getall")
public String getall_cus(ModelMap model,
@RequestParam(defaultValue="1",required=true,value="pn") Integer pn
) {
PageHelper.startPage(pn, 4);
List<Staff> staffs= staffServiceImp.getall();
PageInfo<Staff> pageInfo=new PageInfo<Staff>(staffs);
model.addAttribute("pageInfo", pageInfo);
return "getall_staff";
}
//根据条件查询
@RequestMapping("getbyparams")
public String getbyparams(@RequestParam(value="staffname",required=false)String staffname,@RequestParam(value="staffid",required=false)String staffid,
@RequestParam(defaultValue="1",required=true,value="pn") Integer pn,HttpServletRequest request,Model model
) {
PageHelper.startPage(pn, 100);
List<Staff> staffs= staffServiceImp.getbyparams(staffid, staffname);
PageInfo<Staff> pageInfo=new PageInfo<Staff>(staffs);
model.addAttribute("pageInfo", pageInfo);
return "getstaffbyparams";
model.addAttribute("pageInfo", pageInfo);
return "manager/getkcxx_data";
}
@InitBinder
protected void init(HttpServletRequest request, ServletRequestDataBinder binder) {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
dateFormat.setLenient(false);
binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, false));
}
// 按条件获取所有进货信息
@RequestMapping("getbyparams")
public String getbyparams(HttpServletRequest request,Model model,@RequestParam(value="proid",required=false)String proid,
@RequestParam(value="pname",required=false)String pname,@RequestParam(defaultValue="1",required=true,value="pn") Integer pn
) {
PageHelper.startPage(pn, 100);
List<Kcxx> ckin= kcxxServiceImp.getbyparams(proid,pname);
PageInfo<Kcxx> pageInfo=new PageInfo<Kcxx>(ckin);
model.addAttribute("pageInfo", pageInfo);
return "manager/getkcxxbyparams";
}
@RequestMapping("getkcxx")
@ResponseBody
public Kcxx getkcxx(String proid,HttpServletRequest request,Model model) {
Kcxx kcxx=new Kcxx();
kcxx=kcxxServiceImp.getbyid(proid);
return kcxx;
}
}
package com.hbh.controller;
* @Des
*/
@Controller
@RequestMapping("/manager/flatform/sale")
public class MSaleController {
@Autowired
SaleServiceImp saleServiceImp;
// 跳转到增加页面
@RequestMapping("/toadd")
public String toadd(){
return "manager/addsale";
}
// 跳转到修改页面
@RequestMapping("/toupdate")
public String editSale(Sale sale,HttpServletRequest request,Model model){
model.addAttribute("sale", saleServiceImp.getbyid(sale.getSaleid()));
return "manager/editSale";
}
// 先判断数据库有没有,有就更新,没有就新增
@RequestMapping("/insert")
public String insert(Sale sale,HttpServletRequest request,Model model){
if(null==saleServiceImp.getbyid(sale.getSaleid())) {
saleServiceImp.insert(sale);
}else {
saleServiceImp.update(sale);
}
return "redirect:getall";
}
// 删除
@RequestMapping("/delete")
public String delete(String saleid) {
saleServiceImp.delete(saleid);
return "redirect:getall";
}
// 修改
List<Staff> staffs= staffServiceImp.getbyparams(staffid, staffname);
PageInfo<Staff> pageInfo=new PageInfo<Staff>(staffs);
model.addAttribute("pageInfo", pageInfo);
return "getstaffbyparams";
}
}
package com.hbh.controller;
/**
* @Date 2019年4月19日下午12:37:59
* @Des
*/
@Controller
@RequestMapping("/manager/flatform/ckin")
public class MCkinController {
@Autowired
CkinServiceImp ckinServiceImp;
// 获取所有进货信息
@RequestMapping("getall")
public String getlist(ModelMap model,
@RequestParam(defaultValue="1",required=true,value="pn") Integer pn
) {
PageHelper.startPage(pn, 4);
List<Ckin> ckin= ckinServiceImp.getall();
PageInfo<Ckin> pageInfo=new PageInfo<Ckin>(ckin);
model.addAttribute("pageInfo", pageInfo);
PageHelper.startPage(pn, 4);
List<Kcxx> kcxxs= kcxxServiceImp.kcxxWithProdata();
PageInfo<Kcxx> pageInfo=new PageInfo<Kcxx>(kcxxs);
model.addAttribute("pageInfo", pageInfo);
return "manager/getkcxx_data";
}
@InitBinder
protected void init(HttpServletRequest request, ServletRequestDataBinder binder) {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
dateFormat.setLenient(false);
binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, false));
}
// 按条件获取所有进货信息
@RequestMapping("getbyparams")
public String getbyparams(HttpServletRequest request,Model model,@RequestParam(value="proid",required=false)String proid,
@RequestParam(value="pname",required=false)String pname,@RequestParam(defaultValue="1",required=true,value="pn") Integer pn
) {
PageHelper.startPage(pn, 100);
List<Kcxx> ckin= kcxxServiceImp.getbyparams(proid,pname);
PageInfo<Kcxx> pageInfo=new PageInfo<Kcxx>(ckin);
model.addAttribute("pageInfo", pageInfo);
return "manager/getkcxxbyparams";
}
@RequestMapping("getkcxx")
@ResponseBody
public Kcxx getkcxx(String proid,HttpServletRequest request,Model model) {
Kcxx kcxx=new Kcxx();
kcxx=kcxxServiceImp.getbyid(proid);
return kcxx;
}
}
package com.hbh.controller;
/**
* @Date 2019年4月19日下午2:11:52
* @Des
*/
@Controller
@RequestMapping("/manager/flatform/supply")
public class MSupplyController {
@Autowired
SupplyMapperServiceImp supplyMapperServiceImp;
// 跳转到增加页面
@RequestMapping("/toadd")
public String toaddsupply(){
return "manager/addsup";
}
// 跳转到修改页面
@RequestMapping("/toupdate")
public String editProduct(Supply supply,HttpServletRequest request,Model model){
model.addAttribute("supply", supplyMapperServiceImp.getbyid(supply.getSupid()));
return "manager/editsup";
}
// 先判断数据库有没有,有就更新,没有就新增
@RequestMapping("/insert")
public String insert(Supply supply,HttpServletRequest request,Model model){
if(null==supplyMapperServiceImp.getbyid(supply.getSupid())) {
supplyMapperServiceImp.insert(supply);
}else {
supplyMapperServiceImp.update(supply);
}
return "redirect:getall";
}
// 删除
@RequestMapping("/delete")
public String delete(String supid) {
supplyMapperServiceImp.delete(supid);
return "redirect:getall";
@RequestMapping("/insert")
public String insert(Kcxx kcxx,HttpServletRequest request,Model model){
if(null==kcxxServiceImp.getbyid(kcxx.getProid())) {
kcxxServiceImp.insert(kcxx);
}else {
kcxxServiceImp.update(kcxx);
}
return "redirect:getall";
}
// 删除
@RequestMapping("/delete")
public String delete(String proid) {
kcxxServiceImp.delete(proid);
return "redirect:getall";
}
// 修改
@RequestMapping("/update")
public String update(Kcxx kcxx,HttpServletRequest request,Model model){
if(kcxxServiceImp.update(kcxx)) {
kcxx=kcxxServiceImp.getbyid(kcxx.getProid());
model.addAttribute("kcxx", kcxx);
return "redirect:getall";
}
return null;
}
// 查询所有
@RequestMapping("/getall")
public String getall_kcxx(ModelMap model,
@RequestParam(defaultValue="1",required=true,value="pn") Integer pn
) {
PageHelper.startPage(pn, 4);
List<Kcxx> kcxxs= kcxxServiceImp.getall();
PageInfo<Kcxx> pageInfo=new PageInfo<Kcxx>(kcxxs);
model.addAttribute("pageInfo", pageInfo);
return "getall_kcxx";
}
// 查询单个
public String update(Custom custom,HttpServletRequest request,Model model){
if(customServiceImp.update(custom)) {
custom=customServiceImp.getByid(custom.getCusid());
model.addAttribute("custom", custom);
return "redirect:getall";
}
return null;
}
// 查询所有
@RequestMapping("/getall")
public String getall_cus(ModelMap model,
@RequestParam(defaultValue="1",required=true,value="pn") Integer pn
) {
PageHelper.startPage(pn, 4);
List<Custom> Customs= customServiceImp.getlist();
PageInfo<Custom> pageInfo=new PageInfo<Custom>(Customs);
model.addAttribute("pageInfo", pageInfo);
return "manager/getall_cus";
}
// 查询单个
@RequestMapping("/getbyid")
public String getbyid(String cusid,HttpServletRequest request,Model model) {
request.setAttribute("custom", customServiceImp.getByid(cusid));
model.addAttribute("custom",customServiceImp.getByid(cusid));
return "manager/getall";
}
//根据条件查询
@RequestMapping("getbyparams")
public String getbyparams(@RequestParam(value="cusid",required=false)String cusid,@RequestParam(value="cusname",required=false)String cusname,
@RequestParam(defaultValue="1",required=true,value="pn") Integer pn,HttpServletRequest request,Model model
) {
PageHelper.startPage(pn, 100);
List<Custom> customs= customServiceImp.getbyparams(cusid, cusname);
PageInfo<Custom> pageInfo=new PageInfo<Custom>(customs);
model.addAttribute("pageInfo", pageInfo);
return "manager/getcustombyparams";
}
}
package com.hbh.controller;
}
}
package com.hbh.controller;
/**
* @Date 2019年3月25日下午2:30:11
* @Des 客户类别控制器
*/
@Controller
@RequestMapping("/staff/flatform/custom")
public class CustomController {
@Autowired
CustomServiceImp customServiceImp;
// 跳转到增加页面
@RequestMapping("/toadd")
@RequestMapping("/kcxxWithProdata")
public String kcxxWithProdata(ModelMap model,
@RequestParam(defaultValue="1",required=true,value="pn") Integer pn
) {
PageHelper.startPage(pn, 4);
List<Kcxx> kcxxs= kcxxServiceImp.kcxxWithProdata();
PageInfo<Kcxx> pageInfo=new PageInfo<Kcxx>(kcxxs);
model.addAttribute("pageInfo", pageInfo);
return "manager/getkcxx_data";
}
@InitBinder
protected void init(HttpServletRequest request, ServletRequestDataBinder binder) {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
dateFormat.setLenient(false);
binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, false));
}
// 按条件获取所有进货信息
@RequestMapping("getbyparams")
public String getbyparams(HttpServletRequest request,Model model,@RequestParam(value="proid",required=false)String proid,
@RequestParam(value="pname",required=false)String pname,@RequestParam(defaultValue="1",required=true,value="pn") Integer pn
) {
PageHelper.startPage(pn, 100);
List<Kcxx> ckin= kcxxServiceImp.getbyparams(proid,pname);
PageInfo<Kcxx> pageInfo=new PageInfo<Kcxx>(ckin);
model.addAttribute("pageInfo", pageInfo);
return "manager/getkcxxbyparams";
}
@RequestMapping("getkcxx")
@ResponseBody
public Kcxx getkcxx(String proid,HttpServletRequest request,Model model) {
Kcxx kcxx=new Kcxx();
kcxx=kcxxServiceImp.getbyid(proid);
return kcxx;
}
}
package com.hbh.controller;
/**
* @Date 2019年4月19日下午12:53:41
* @Des 顾客退货
*/
@Controller
@RequestMapping("/manager/flatform/ckretire")
public class MCkretireController {
@Autowired
CkretireServiceImp ckretireServiceImp;
@Autowired
CkinServiceImp ckinServiceImp;
// 获取所有退货信息
@RequestMapping("getall")
public String getlist(ModelMap model,
}
// 查询单个
@RequestMapping("/getbyid")
public String getbyid(String supid,HttpServletRequest request,Model model) {
request.setAttribute("supply", supplyMapperServiceImp.getbyid(supid));
model.addAttribute("supply",supplyMapperServiceImp.getbyid(supid));
return "getall";
}
// 按条件查询
@RequestMapping("/getbyparams")
public String getbyparams(@RequestParam(value="supid",required=false)String supid,@RequestParam(value="suppname",required=false)String suppname,
@RequestParam(defaultValue="1",required=true,value="pn") Integer pn,HttpServletRequest request,Model model) {
PageHelper.startPage(pn, 100);
List<Supply> supplys= supplyMapperServiceImp.getbyparams(supid, suppname);
PageInfo<Supply> pageInfo=new PageInfo<Supply>(supplys);
model.addAttribute("pageInfo", pageInfo);
return "getsupplybyparams";
}
}
package com.hbh.controller;
/**
* @Date 2019年4月19日下午2:08:21
* @Des
*/
@Controller
@RequestMapping("/manager/flatform/custom")
public class MCustomController {
@Autowired
CustomServiceImp customServiceImp;
// 跳转到增加页面
@RequestMapping("/toadd")
public String toaddCustom(){
return "manager/addcus";
}
// 跳转到修改页面
@RequestMapping("/toupdate")
public String editProduct(Custom custom,HttpServletRequest request,Model model){
model.addAttribute("custom", customServiceImp.getByid(custom.getCusid()));
return "manager/editcus";
}
// 先判断数据库有没有,有就更新,没有就新增
@RequestMapping("/insert")
/**
* @Date 2019年3月28日上午9:42:09
* @Des
*/
@Controller
@RequestMapping("/staff/flatform/ckretire")
public class CkretireController {
@Autowired
CkretireServiceImp ckretireServiceImp;
@Autowired
CkinServiceImp ckinServiceImp;
// 获取所有退货信息
@RequestMapping("getall")
public String getlist(ModelMap model,
@RequestParam(defaultValue="1",required=true,value="pn") Integer pn
) {
PageHelper.startPage(pn, 4);
List<Ckretire> ckretire= ckretireServiceImp.getall();
PageInfo<Ckretire> pageInfo=new PageInfo<Ckretire>(ckretire);
model.addAttribute("pageInfo", pageInfo);
return "getall_ckretire";
}
// 根据id查询单个信息
@RequestMapping("/getckretire")
public String getbyid(String inid,HttpServletRequest request,Model model){
request.setAttribute("ckretire", ckretireServiceImp.getbyid(inid));
model.addAttribute("ckretire",ckretireServiceImp.getbyid(inid));
return "getckretire";
}
public String getwhere(String id,String pname,String type ,HttpServletRequest request,Model model){
request.setAttribute(" duct", ckretireServiceImp.getbywhere( id, pname, type));
model.addAttribute(" duct",ckretireServiceImp.getbywhere( id, pname, type));
return "getlist";
}*/
@RequestMapping("edit")
public String edit(Ckretire ckretire,HttpServletRequest request,Model model){
model.addAttribute("ckretire", ckretireServiceImp.getbyid(ckretire.getInid()));
return "manager/editckretire";
}
@RequestMapping("update")
public String update(Ckretire ckretire,HttpServletRequest request,Model model){
if(ckretireServiceImp.update(ckretire)) {
ckretire=ckretireServiceImp.getbyid(ckretire.getInid());
model.addAttribute("ckretire", ckretire);
return "redirect:getall";
}
return null;
}
@RequestMapping("/delete")
public String deletete(String inid,HttpServletRequest request,Model model){
ckretireServiceImp.delete(inid);
return "redirect:getall";
}
// 跳转到增加页面
@RequestMapping("/toadd")
public String toadd (){
return "manager/addckretire";
}
@RequestMapping("/insert")
// 先判断数据库有没有,有就更新,没有就新增
public String insert (Ckretire ckretire,HttpServletRequest request,Model model){
if(null==ckretireServiceImp.getbyid(ckretire.getInid())) {
ckretireServiceImp.insert(ckretire);
}else {
ckretireServiceImp.update(ckretire);
}
return "redirect:getall";
}
/**
* @Date 2019年3月18日下午3:04:04
* @Des
*/
@Controller
@RequestMapping("/staff/flatform/product")
public class ProductController {
@Autowired
ProductServiceImp productServiceImp;
// 获取所有商品信息
@RequestMapping("getlist")
public String getlist(ModelMap model,
@RequestParam(defaultValue="1",required=true,value="pn") Integer pn
) {
PageHelper.startPage(pn, 4);
List<Product> products= productServiceImp.getlist();
PageInfo<Product> pageInfo=new PageInfo<Product>(products);
model.addAttribute("pageInfo", pageInfo);
return "getlist";
}
// 根据id查询单个商品信息
@RequestMapping("/getpro")
public String getpro(String proid,HttpServletRequest request,Model model){
request.setAttribute("product", productServiceImp.selectByPrimaryKey(proid));
}
@InitBinder
protected void init(HttpServletRequest request, ServletRequestDataBinder binder) {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
dateFormat.setLenient(false);
binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, false));
}
// 按条件获取所有进货信息
@RequestMapping("getbyparams")
public String getbyparams(HttpServletRequest request,Model model,@RequestParam(value="proid",required=false)String proid,
@RequestParam(value="saleid",required=false)String saleid,@RequestParam(value="pname",required=false)String pname,
@RequestParam(value="retdate",required=false)String retdate,@RequestParam(defaultValue="1",required=true,value="pn") Integer pn
) {
PageHelper.startPage(pn, 100);
List<CusRetire> ckin= cusRetireServiceImp.getbyparams(proid, saleid, pname, retdate);
PageInfo<CusRetire> pageInfo=new PageInfo<CusRetire>(ckin);
model.addAttribute("pageInfo", pageInfo);
return "getCusRetirebyparams";
}
@RequestMapping("/getCus")
@ResponseBody
public Sale getCus(String saleid,HttpServletRequest request,Model model){
Sale sale=new Sale();
sale=saleServiceImp.getbyid(saleid);
return sale;
}
}
package com.hbh.controller;
/**
* @Date 2019年4月19日下午12:37:59
* @Des
*/
@Controller
@RequestMapping("/manager/flatform/ckin")
public class MCkinController {
@Autowired
CkinServiceImp ckinServiceImp;
// 获取所有进货信息
@RequestMapping("getall")
public String getlist(ModelMap model,
@RequestParam(defaultValue="1",required=true,value="pn") Integer pn
) {
PageHelper.startPage(pn, 4);
List<Ckin> ckin= ckinServiceImp.getall();
PageInfo<Ckin> pageInfo=new PageInfo<Ckin>(ckin);
model.addAttribute("pageInfo", pageInfo);
return "manager/getall_ckin";
}
// 根据id查询单个信息
@RequestMapping("/getckin")
public String getbyid(String inid,HttpServletRequest request,Model model){
request.setAttribute("ckin", ckinServiceImp.getbyid(inid));