栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

基于javaweb+mysql的台球室计费管理系统(java+SSM+JSP+HTML+JavaScript+mysql)

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

基于javaweb+mysql的台球室计费管理系统(java+SSM+JSP+HTML+JavaScript+mysql)

项目介绍
主要功能包括:
登录,管理员首页,点击球台开台,增加会员,查看-删除会员,充值会员,酒水外卖,营业额查看,打烊设置等功能。

环境需要
1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。
2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA;
3.tomcat环境:Tomcat 7.x,8.x,9.x版本均可
4.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS;
5.数据库:MySql 5.7版本;

技术栈

  1. 后端:Spring+SpringMVC+Mybatis
  2. 前端:HTML+CSS+JavaScript+jsp

使用说明

  1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件;
  2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven;若为maven项目,导入成功后请执行maven clean;maven install命令,然后运行;
  3. 将项目中application.yml配置文件中的数据库配置改为自己的配置;
  4. 运行项目,输入localhost:8080/ 登录




适用

课程设计,大作业,毕业设计,项目练习,学习演示等

        String fileName = "exportUserExcel";
        //执行导出
        ExportExcel.exportExcel(request,response,fileName, rowsName, dataList, "yyyy-MM-dd HH:mm:ss");
    }
    //删除用户
    @RequestMapping(value = "/admin_user_delete",produces = "text/html;charset=UTF-8")
    @ResponseBody
    public ModelAndView admin_user_delete(Integer id, HttpServletRequest request){
        try{
            userService.deleteByPrimaryKey(id);
        }catch (Exception e){
            e.getMessage();
        }
        List users = userService.listAll();
        mav.addObject("us",users);
        mav.setViewName("/admin/listUser");
        return mav;
    }
    //编辑用户信息页面
    @RequestMapping(value = "/admin_user_edit",produces = "text/html;charset=UTF-8")
    @ResponseBody
    public ModelAndView admin_user_edit(Integer id, HttpServletRequest request){
        User user = userService.getUser(id);
        mav.addObject("u",user);
        mav.setViewName("/admin/editUser");
        }
        List users = userService.listAll();
        mav.addObject("us",users);
        mav.setViewName("/admin/listUser");
        return mav;
    }
    //编辑用户信息页面
    @RequestMapping(value = "/admin_user_edit",produces = "text/html;charset=UTF-8")
    @ResponseBody
    public ModelAndView admin_user_edit(Integer id, HttpServletRequest request){
        User user = userService.getUser(id);
        mav.addObject("u",user);
        mav.setViewName("/admin/editUser");
        return mav;
    }
    //提交更新用户信息
    @RequestMapping(value = "/admin_user_update",produces = "text/html;charset=UTF-8")
    @ResponseBody
    public ModelAndView admin_user_update(User user){
        //user = userService.getUser(user.getName());
        userService.update(user);
        List users = userService.listAll();
    @ResponseBody
    public ModelAndView admin_property_delete(Integer id,HttpServletRequest request){
        try{
            productService.deleteProperty(id);
        }catch (Exception e){
            e.printStackTrace();
        }
        List properties = productService.listProproty((Integer)request.getSession().getAttribute("cid"));
        mav.addObject("ps",properties);
        mav.setViewName("/admin/listProperty");
        return mav;
    }
    //房间管理
    @RequestMapping(value = "/admin_product_list",produces = "text/html;charset=UTF-8")
    @ResponseBody
    public ModelAndView admin_product_list(Integer cid){
        return listProduct(cid);
    }
    //添加房间
    @RequestMapping(value = "/admin_product_add",produces = "text/html;charset=UTF-8")
    @ResponseBody
        List orders = orderService.listAll();
        for(Order order:orders){
            order.setOrderItems(orderItemService.getOrderItem(order.getId()));
        }
        mav.addObject("os",orders);
        mav.setViewName("/admin/listOrder");
        return mav;
    }
    @RequestMapping(value = "/admin_print_order_list",produces = "text/html;charset=UTF-8")
    @ResponseBody
    public ModelAndView printListOrder(){
        mav = listOrder();
        mav.setViewName("/admin/printListOrder");
        return mav;
    }
    //导出订单列表
    @RequestMapping(value = "/admin_export_order_list",produces = "text/html;charset=UTF-8")
    @ResponseBody
    public void exportListOrder(HttpServletRequest request, HttpServletResponse response) throws Exception{
        List orders = orderService.listAll();
        mav.addObject("c",category);
        mav.setViewName("/admin/editCategory");
        return mav;
    }
    //查询所有用户
    @RequestMapping(value = "/admin_user_list",produces = "text/html;charset=UTF-8")
    @ResponseBody
    public ModelAndView listUser(){
        List users = userService.listAll();
        mav.addObject("us",users);
        mav.setViewName("/admin/listUser");
        return mav;
    }
    //打印用户信息
    @RequestMapping(value = "/admin_print_user_list",produces = "text/html;charset=UTF-8")
    @ResponseBody
    public ModelAndView printLlistUser(){
        List users = userService.listAll();
        mav.addObject("us",users);
        mav.setViewName("/admin/printListUser");
public class AdminController {
    @Autowired
    private UserService userService;
    @Autowired
    private CategoryService categoryService;
    @Autowired
    private OrderItemService orderItemService;
    @Autowired
    private OrderService orderService;
    @Autowired
    private ProductService productService;
    private static Logger logger = Logger.getLogger(AdminController.class);
    private ModelAndView mav = new ModelAndView();
    // windows系统参考路径 注:此处必须为项目路径
    private static String imgPath = "C:\Users\70953\Gotrip\";
    // Mac系统参考路径
//    private static String imgPath = "/Users/hanmeng/Desktop/java源码/SSM/012ssm民宿管理系统/源码/Gotrip/";
    private ModelAndView listProduct(Integer cid) {
        List products = productService.listProducts(cid);
        mav.addObject("ps",products);
        mav.addObject("c",categoryService.getCategory(cid));
        mav.setViewName("/admin/listProduct");
        return mav;
    }
    //查询所有房间分类
    @RequestMapping(value = "/admin_category_list",produces = "text/html;charset=UTF-8")
    }
    //添加用户
    @RequestMapping(value = "/admin_user_add",produces = "text/html;charset=UTF-8")
    @ResponseBody
    public ModelAndView admin_user_add(User user,HttpServletRequest request){
        userService.insert(user);
        List users = userService.listAll();
        mav.addObject("us",users);
        mav.setViewName("/admin/listUser");
        return mav;
    }
    //修改订单信息页面
    @RequestMapping(value = "/admin_order_edit",produces = "text/html;charset=UTF-8")
    @ResponseBody
    public ModelAndView admin_order_edit(Integer id, HttpServletRequest request){
        Order order = orderService.getOrder(id);
        request.getSession().setAttribute("oid",id);
        mav.addObject("c",order);
        mav.setViewName("/admin/editOrder");
        return mav;
        return mav;
    }
    //查询所有订单
    @RequestMapping(value = "/admin_order_list",produces = "text/html;charset=UTF-8")
    @ResponseBody
    public ModelAndView listOrder(){
        List orders = orderService.listAll();
        for(Order order:orders){
            order.setOrderItems(orderItemService.getOrderItem(order.getId()));
        }
        mav.addObject("os",orders);
        mav.setViewName("/admin/listOrder");
        return mav;
    }
    @RequestMapping(value = "/admin_print_order_list",produces = "text/html;charset=UTF-8")
    @ResponseBody
    public ModelAndView printListOrder(){
        if (type.equals("type_detail")){
            // windows系统参考路径 注:此处必须为本地src及target下productDetail的路径
            path1 = imgPath+"src\main\webapp\img\productDetail\"+imageId.toString()+".jpg";
            path2 = imgPath+"target\Gotrip-1.0-SNAPSHOT\img\productDetail\"+imageId.toString()+".jpg";
            // Mac系统参考路径
//            path1 = imgPath+"src/main/webapp/img/productDetail/"+imageId.toString()+".jpg";
//            path2 = imgPath+"target/Gotrip-1.0-SNAPSHOT/img/productDetail/"+imageId.toString()+".jpg";
            filepath.transferTo(new File(path1));
            FileUtils.copyFile(new File(path1),new File(path2));
        }
        if (type.equals("type_single")){
            // windows系统参考路径
            path1 = imgPath+"src\main\webapp\img\productSingle\"+imageId.toString()+".jpg";
            path2 = imgPath+"target\Gotrip-1.0-SNAPSHOT\img\productSingle\"+imageId.toString()+".jpg";
            String path3 = imgPath+"src\main\/webapp\img\productSingle_middle\"+imageId.toString()+".jpg";;
            String path4 = imgPath+"target\Gotrip-1.0-SNAPSHOT\img\productSingle_middle\"+imageId.toString()+".jpg";
            String path5 = imgPath+"src\main\webapp\img\productSingle_small\"+imageId.toString()+".jpg";;
            String path6 = imgPath+"target\Gotrip-1.0-SNAPSHOT\img\productSingle_small\"+imageId.toString()+".jpg";
            // Mac系统参考路径
//            path1 = imgPath+"src/main/webapp/img/productSingle/"+imageId.toString()+".jpg";
//            path2 = imgPath+"target/Gotrip-1.0-SNAPSHOT/img/productSingle/"+imageId.toString()+".jpg";
            productService.deleteProductImage(id);
        } catch (Exception e) {
            e.getMessage();
        }
        return admin_productImage_list(pid,request);
    }
    //添加房间图片
    @RequestMapping(value = "/admin_productImage_add",produces = "text/html;charset=UTF-8")
    @ResponseBody
    public ModelAndView admin_productImage_add(@RequestParam("filepath") MultipartFile filepath,@RequestParam("type") String type,@RequestParam("pid") int pid,HttpServletRequest request) throws IOException {
        Productimage productimage = new Productimage();
        productimage.setPid(pid);
        productimage.setType(type);
        Integer imageId = productService.insertImage(productimage);
        // Mac系统参考路径 注:此处必须为本地src及target下category的路径
        String path1 = "";
        String path2 = "";
        if (type.equals("type_detail")){
            // windows系统参考路径 注:此处必须为本地src及target下productDetail的路径
            path1 = imgPath+"src\main\webapp\img\productDetail\"+imageId.toString()+".jpg";
            path2 = imgPath+"target\Gotrip-1.0-SNAPSHOT\img\productDetail\"+imageId.toString()+".jpg";
            // Mac系统参考路径

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/933254.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号