基于Spring+SpringMvc+Hibernate的咔咔发廊管理系统

基于Spring+SpringMvc+Hibernate的咔咔发廊管理系统

基于Spring+SpringMvc+Hibernate的家政服务网-java家政服务网
1.包含源程序,数据库脚本。代码和数据库脚本都有详细注释。
2.课题设计仅供参考学习使用,可以在此基础上进行扩展完善

代码已经上传github,下载地址 https://github.com/21503882/hair-mag
开发环境:
Eclipse ,MYSQL,JDK1.7,Tomcat 7
涉及技术点:
MVC模式、springMvc、Hibernate、Spring、HTML、JavaScript、CSS、JQUERY、poi、jpa、Ajax等
系统采用Hibernate框架实现ORM对象关系映射,前台JSP实现,后台springMvc映射,使用Spring框架进行整合。适合学习J2EE的一段时间的熟手,代码思路清晰,注解详细,数据库用的是mysql5.1,服务器用的tomcat7,JDK版本1.7. 编程软件Eclispe J2EE版本。是典型MVC架构,并且前后台分离;
主要功能:

 

 

系统在两个模块的基础上每一个模块又分为几个模块。
1.前台系统功能模块分为
(1)产品展台模块:通过新品上架,分页显示特价产品,产品销售排行展示网站的所有产品;
(2)产品查询模块:按产品的类别查询产品的相关信息;
(3)购物车模块:用户添加产品至购物车,查看购物车中的产品,从购物车中移除不满意的产品,清空购物车中的产品,修改所要购买的产品的数量;
(4)收银台模块:用户满意购物车中的产品后进行结账并填写订单信息;
(5)用户维护模块:为用户提供了用户注册、用户登录、用户资料修改以及找回密码的功能;
(6)订单查询模块:用户通过查看订单能够了解到自己的当前订单信息及历史订单记录;
(7)公告浏览模块:用户通过浏览公告信息,能够及时了解到网站最新的各种信息。
(8)留言模块:客户可以进行留言给我们提意见,我们在不断地改进中前进。
 

2.后台管理员子系统功能模块分为
(1)产品管理模块:按类别查看产品,对产品的信息进行维护;
(2)用户管理模块:为了保护用户的信息,此模块与前台用户维护的区别是管理员只能查看用户信息和删除操作;
(3)管理员维护模块:这是对管理员的信息进行维护,可以修改管理员的信息。
(4)业务员维护模块:这是对业务员的信息进行维护,管理员可以添加或删除业务员的信息。
(5)订单管理模块:管理员查询订单,查看订单详细信息,删除订单信息,进行订单受理;
(6)公告管理模块:管理员公告浏览,公告信息维护;
(7)留言模块:管理员可以查看客户的留言,对留言进行维护。

package com.yeyunlin.dao;
 
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
 
import com.yeyunlin.info.FoodInfo;
import com.yeyunlin.info.OrderInfo;
import com.yeyunlin.info.ReviewInfo;
import com.yeyunlin.info.UserInfo;
import com.yeyunlin.util.DBUtil;
import com.yeyunlin.util.Tools;
 
public class Dao {
    public static boolean checkPassword(String name, String password) {
        String sql = " select * from managers where name = ? and password = ?";
        DBUtil dbUtil = new DBUtil();
        Connection connection = dbUtil.openConn();
        try {
            PreparedStatement preparedStatement = connection
                    .prepareStatement(sql);
            preparedStatement.setString(1, name);
            preparedStatement.setString(2, password);
            ResultSet resultSet = preparedStatement.executeQuery();
            return resultSet.next();
        } catch (SQLException e) {
            e.printStackTrace();
        } finally {
            dbUtil.closeConn(connection);
        }
        return false;
    }
 
    public static List<UserInfo> getAllUsers() {
        List<UserInfo> userInfos = new ArrayList<UserInfo>();
        String sql;
        sql = " select * from users";
        DBUtil dbUtil = new DBUtil();
        Connection connection = dbUtil.openConn();
        try {
            PreparedStatement preparedStatement = connection
                    .prepareStatement(sql);
            ResultSet resultSet = preparedStatement.executeQuery();
            while (resultSet.next()) {
                UserInfo userInfo = new UserInfo();
                userInfo.setName(resultSet.getString(1));
                userInfo.setAccount(resultSet.getString(2));
                userInfo.setPassword(resultSet.getString(3));
                userInfo.setIntegral(resultSet.getInt(4));
                userInfo.setIcon(resultSet.getString(5));
                userInfos.add(userInfo);
            }
        } catch (SQLException e) {
            e.printStackTrace();
        } finally {
            dbUtil.closeConn(connection);
        }
        return userInfos;
    }
 
    public static List<OrderInfo> getAllOrder(String name) {
        List<OrderInfo> orderInfos = new ArrayList<OrderInfo>();
        String sql;
        if (name.equals("")) {
            sql = " select * from foodorder";
        } else {
            sql = " select * from foodorder where user_name = '" + name + "' ";
        }
        DBUtil dbUtil = new DBUtil();
        Connection connection = dbUtil.openConn();
        try {
            PreparedStatement preparedStatement = connection
                    .prepareStatement(sql);
            ResultSet resultSet = preparedStatement.executeQuery();
            while (resultSet.next()) {
                OrderInfo orderInfo = new OrderInfo();
                orderInfo.setOrderId(resultSet.getString(1));
                orderInfo.setUsername(resultSet.getString(2));
                orderInfo.setFoodid(resultSet.getInt(3));
                orderInfo.setDeskid(resultSet.getInt(4));
                orderInfo.setTime(resultSet.getString(5));
                orderInfo.setPaytype(resultSet.getString(6));
                orderInfos.add(orderInfo);
            }
        } catch (SQLException e) {
            e.printStackTrace();
        } finally {
            dbUtil.closeConn(connection);
        }
        return orderInfos;
    }
 
    public static List<OrderInfo> getUnpayOrder() {
        List<OrderInfo> orderInfos = new ArrayList<OrderInfo>();
        String sql;
        sql = " select * from foodorder where paytype = ? ";
        DBUtil dbUtil = new DBUtil();
        Connection connection = dbUtil.openConn();
        try {
            PreparedStatement preparedStatement = connection
                    .prepareStatement(sql);
            preparedStatement.setString(1, "0");
            ResultSet resultSet = preparedStatement.executeQuery();
            while (resultSet.next()) {
                OrderInfo orderInfo = new OrderInfo();
                orderInfo.setOrderId(resultSet.getString(1));
                orderInfo.setUsername(resultSet.getString(2));
                orderInfo.setFoodid(resultSet.getInt(3));
                orderInfo.setDeskid(resultSet.getInt(4));
                orderInfo.setTime(resultSet.getString(5));
                orderInfo.setPaytype(resultSet.getString(6));
                orderInfos.add(orderInfo);
            }
        } catch (SQLException e) {
            e.printStackTrace();
        } finally {
            dbUtil.closeConn(connection);
        }
        return orderInfos;
    }
 
    public static String getFoodName(int number) {
        String sql;
        sql = " select name from food where number = ?";
        DBUtil dbUtil = new DBUtil();
        Connection connection = dbUtil.openConn();
        try {
            PreparedStatement preparedStatement = connection
                    .prepareStatement(sql);
            preparedStatement.setInt(1, number);
            ResultSet resultSet = preparedStatement.executeQuery();
            if (resultSet.next()) {
                return resultSet.getString(1);
            }
        } catch (SQLException e) {
            e.printStackTrace();
        } finally {
            dbUtil.closeConn(connection);
        }
        return null;
    }
 
    public static List<FoodInfo> getFoods(String type) {
        List<FoodInfo> foodInfos = new ArrayList<FoodInfo>();
        String sql;
        sql = " select * from food where type = ?";
        DBUtil dbUtil = new DBUtil();
        Connection connection = dbUtil.openConn();
        try {
            PreparedStatement preparedStatement = connection
                    .prepareStatement(sql);
            preparedStatement.setString(1, type);
            ResultSet resultSet = preparedStatement.executeQuery();
            while (resultSet.next()) {
                FoodInfo foodInfo = new FoodInfo();
                foodInfo.setNumber(resultSet.getInt(1));
                foodInfo.setName(resultSet.getString(2));
                foodInfo.setPrice(resultSet.getInt(3));
                foodInfo.setType(resultSet.getString(4));
                foodInfo.setIcon(resultSet.getString(5));
                foodInfo.setDescription(resultSet.getString(6));
                foodInfos.add(foodInfo);
            }
        } catch (SQLException e) {
            e.printStackTrace();
        }
        return foodInfos;
    }
 
    public static boolean isFoodHave(int number) {
        String sql;
        sql = " select name from food where number = ?";
        DBUtil dbUtil = new DBUtil();
        Connection connection = dbUtil.openConn();
        try {
            PreparedStatement preparedStatement = connection
                    .prepareStatement(sql);
            preparedStatement.setInt(1, number);
            ResultSet resultSet = preparedStatement.executeQuery();
            return resultSet.next();
        } catch (SQLException e) {
            e.printStackTrace();
        } finally {
            dbUtil.closeConn(connection);
        }
        return false;
    }
 
    public static void insertFood(int number, String name, int price,
            String type, String icon, String description) {
        String sql = " insert into food(number , name , price , type , icon , description )values(?,?,?,?,?,?) ";
        DBUtil util = new DBUtil();
        Connection conn = util.openConn();
        try {
            PreparedStatement preparedStatement = conn.prepareStatement(sql);
 
            preparedStatement.setInt(1, number);
            preparedStatement.setString(2, name);
            preparedStatement.setInt(3, price);
            preparedStatement.setString(4, type);
            preparedStatement.setString(5, icon);
            preparedStatement.setString(6, description);
 
            preparedStatement.executeUpdate();
        } catch (SQLException e) {
            e.printStackTrace();
        } finally {
            util.closeConn(conn);
        }
    }
 
    public static List<ReviewInfo> getReviews() {
        List<ReviewInfo> reviewInfos = new ArrayList<ReviewInfo>();
        String sql;
        sql = " select * from reviews";
        DBUtil dbUtil = new DBUtil();
        Connection connection = dbUtil.openConn();
        try {
            PreparedStatement preparedStatement = connection
                    .prepareStatement(sql);
            ResultSet resultSet = preparedStatement.executeQuery();
            while (resultSet.next()) {
                ReviewInfo reviewInfo = new ReviewInfo();
                reviewInfo.setName(resultSet.getString(1));
                reviewInfo.setContent(resultSet.getString(2));
                reviewInfo.setTime(resultSet.getString(3));
                reviewInfos.add(reviewInfo);
            }
        } catch (SQLException e) {
            e.printStackTrace();
        } finally {
            dbUtil.closeConn(connection);
        }
        return reviewInfos;
    }
 
    public static void addReview(String name, String content, String time) {
        String sql = " insert into reviews(name, content, time)values(?,?,?) ";
        DBUtil dbUtil = new DBUtil();
        Connection connection = dbUtil.openConn();
        try {
            PreparedStatement preparedStatement = connection
                    .prepareStatement(sql);
            preparedStatement.setString(1, name);
            preparedStatement.setString(2, content);
            preparedStatement.setString(3, time);
            preparedStatement.executeUpdate();
        } catch (SQLException e) {
            e.printStackTrace();
        } finally {
            dbUtil.closeConn(connection);
        }
    }
 
    public static Map getAllFoodId() {
        String sql;
        sql = " select food_id from foodorder";
        DBUtil dbUtil = new DBUtil();
        Connection connection = dbUtil.openConn();
        try {
            PreparedStatement preparedStatement = connection
                    .prepareStatement(sql);
            ResultSet resultSet = preparedStatement.executeQuery();
            Map foodIdMap = new HashMap();
            while (resultSet.next()) {
                int foodId = resultSet.getInt(1);
                if (foodIdMap.containsKey(foodId)) {
                    int value = (int) foodIdMap.get(foodId);
                    foodIdMap.put(foodId, value + 1);
                } else {
                    foodIdMap.put(foodId, 1);
                }
            }
            return foodIdMap;
        } catch (SQLException e) {
            e.printStackTrace();
        } finally {
            dbUtil.closeConn(connection);
        }
        return null;
    }
 
    public static Map getOrderesFoodId(String name) {
        String sql;
        sql = " select food_id from foodorder where user_name = ?";
        DBUtil dbUtil = new DBUtil();
        Connection connection = dbUtil.openConn();
        try {
            PreparedStatement preparedStatement = connection
                    .prepareStatement(sql);
            preparedStatement.setString(1, name);
            ResultSet resultSet = preparedStatement.executeQuery();
            Map foodIdMap = new HashMap();
            while (resultSet.next()) {
                int foodId = resultSet.getInt(1);
                if (foodIdMap.containsKey(foodId)) {
                    int value = (int) foodIdMap.get(foodId);
                    foodIdMap.put(foodId, value + 1);
                } else {
                    foodIdMap.put(foodId, 1);
                }
            }
            return foodIdMap;
        } catch (SQLException e) {
            e.printStackTrace();
        } finally {
            dbUtil.closeConn(connection);
        }
        return null;
    }
 
    public static void deleteAllInteresting() {
        String sql = " delete from allinteresting ";
        DBUtil dbUtil = new DBUtil();
        Connection connection = dbUtil.openConn();
        try {
            PreparedStatement preparedStatement = connection
                    .prepareStatement(sql);
            preparedStatement.executeUpdate();
        } catch (SQLException e) {
            e.printStackTrace();
        } finally {
            dbUtil.closeConn(connection);
        }
    }
    
    public static void insertInteresting(int[] array){
        String sql = " insert into allinteresting(food_id)values(?) ";
        DBUtil dbUtil = new DBUtil();
        Connection connection = dbUtil.openConn();
        try {
            connection.setAutoCommit(false);
            PreparedStatement preparedStatement = connection
                    .prepareStatement(sql);
            int i = 0;
            while (i < Tools.ALL_INTERESTING_NUMBER) {
                preparedStatement.setInt(1, array[i]);
                preparedStatement.addBatch();
                i++;
            }
            preparedStatement.executeBatch();
            connection.commit();
            preparedStatement.clearBatch();
        } catch (SQLException e) {
            e.printStackTrace();
        } finally {
            dbUtil.closeConn(connection);
        }
    }
    
    public static void insertUserInteresting(String name , int[] array){
        String sql = " insert into userinteresting(user_name, food_id)values(?, ?) ";
        DBUtil dbUtil = new DBUtil();
        Connection connection = dbUtil.openConn();
        try {
            connection.setAutoCommit(false);
            PreparedStatement preparedStatement = connection
                    .prepareStatement(sql);
            int i = 0;
            while (i < Tools.USER_INTERESTING_NUMBER) {
                preparedStatement.setString(1, name);
                preparedStatement.setInt(2, array[i]);
                preparedStatement.addBatch();
                i++;
            }
            preparedStatement.executeBatch();
            connection.commit();
            preparedStatement.clearBatch();
        } catch (SQLException e) {
            e.printStackTrace();
        } finally {
            dbUtil.closeConn(connection);
        }
    }
    
    public static List<String> getSimilarName(int foodId){
        List<String> userNames = new ArrayList<String>();
        String sql = " select user_name from userinteresting where food_id = ? ";
        DBUtil dbUtil = new DBUtil();
        Connection connection = dbUtil.openConn();
        try {
            PreparedStatement preparedStatement = connection
                    .prepareStatement(sql);
            preparedStatement.setInt(1, foodId);
            ResultSet resultSet = preparedStatement.executeQuery();
            while (resultSet.next()) {
                String name = resultSet.getString(1);
                userNames.add(name);
            }
        } catch (SQLException e) {
            e.printStackTrace();
        } finally {
            dbUtil.closeConn(connection);
        }
        return userNames;
    }
    
    public static void addRecommemdFood(int id) {
        String sql = " insert into recommemd(food_id)values(?) ";
        DBUtil dbUtil = new DBUtil();
        Connection connection = dbUtil.openConn();
        try {
            PreparedStatement preparedStatement = connection
                    .prepareStatement(sql);
            preparedStatement.setInt(1, id);
            preparedStatement.executeUpdate();
        } catch (SQLException e) {
            e.printStackTrace();
        } finally {
            dbUtil.closeConn(connection);
        }
    }
}
代码已经上传github,下载地址 https://github.com/21503882/hair-mag
 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
智络美容会员管理系统是一款专门为美容行业设计的专业美容管理软件,它有强大的会员管理,员工管理等功能,方便的票据打印,简洁实用的产品管理,带有客户预约功能,能计算员工每月提成金额,详细完备的统计报表,让美容机构经营者轻松管理。软件界面设计简洁、美观、大方,其人性化的操作流程,使普通用户不需培训也能很快掌握软件操作使用方法,容易上手。 强大报表与集成查询功能是本软件的最大特色,所有功能在用户需要的使用地方自然体现,不用打开多个窗口重复查询。智络美容会员管理系统广泛适用于美容会所,美容院等场合,是美容机构经营者管理的理想选择。 主要功能: 1.会员管理 会员卡售出可提成,会员预约,为每位客户设置会员档案,基本信息、财务信息、联系信息一目了然,同时各类基本操作如:充值、充次、消息提醒、换卡、锁定、挂失等功能也简单明了,功能强大。 2.消费管理 包括分为储值卡消费、记次消费和二为一,均可选择美容师、员工,界面清晰,操作简单,内设储值卡支付、现金支付、银行卡支付、代金卷、联合支付等五种支付方式,方便灵活! 3.员工管理 通过设置员工管理,实现员工提成功能,可以为每一个消费项目设置员工提成额度,自动统计员工工资,大大节省简化您的日常管理操作。 4.产品管理 主要对产品基本信息进行管理,可针对单个商品设置折扣率,积分数额等,同时也可像会员信息一样设置自定义的产品属性,例如您可以为您的产品设置一个“商品产地”属性,当然您也可以设置一个“顾客青睐度”,一切都是那么随心所欲! 5.短信群发 本系统短信功能包括系统短信和自定义短信两种,系统短信可以发送包括余额提醒、账户变动、积分兑换等短信通知,亦可对其他手机号码发送包括生日祝福、节日问候、促销信息等各类信息内容。 6.统计报表 对会员数据、商品数据、消费、充值、兑换、日志等各类数据进行统计,可以导出Excel、PDF等不同格式的文档,亦可实现打印等功能! 7.系统设置 系统参数设置、产品分类设置、会员等级设置、系统日志、IC卡相关设置、短信接口设置等。 注:更多功能请下载本软件试用进行亲身体验。或查看以下的“操作界面”展示。 系统优点: 1.可使用加密锁进行客户端硬件加密; 2.支持各种卡,包括:磁条卡,条码卡,ID卡,非接触式IC卡; 3.能上网就能使用,电脑无需安装软件,刷卡设备即插即用; 4.所有店数据自动实时同步更新,可在线备份,并可下载备份; 5.客户可定制自己的版面,包含LOGO,版权信息,标题等; 6.支持移动刷卡,手持刷卡,支持手机端操作刷卡,支持网站集成平台,支持在线充值; 7.六年的会员连锁系统运用经验,客户遍布全国,有强劲的技术保障. 系统安全: 一.关于数据存放于服务器上的安全认识: 数据库存放于服务器上的安全性往往大于放置于本地电脑内.电脑一旦由于失火,毁坏,被盗等原因,数据就是完全消失了.而服务器是放置于安全级别很高的机房,不会有以上的不利因素.而且服务器提供自动备份和手工备份,可以将备份文件下载到本地另行保存.在这种多重安全措施下能确保数据安全. 二.系统本身的安全: (1).系统稳定:7x24不间断运行五年多,为百家以上客户提供连锁会员和商家联盟管理服务; (2).系统构架:系统采用ASP+MSSQL构架,系统和数据库分离,数据库容易备份,系统升级不影响数据. (3).系统加密:所有ASP代码经过加密,即使获得网页源码也无法破解.防注入攻击. (4).传输安全:采用美国GeoTrust认证的SSL网络加密传输机制,使系统的数据传输与支付宝,银行网银系统达到同一个安全级别. (5).不断更新:定期修补漏洞补丁,防范于未然。 (6).系统服务器安全: A.服务器构架:分布式集群架构,避免单点故障,在线率99.99% 。CDN镜像节点智能容错功能,分钟内自动切换到备用节点,即使原节点死机或机房被封,也毫不影响! B.数据备份:如果使用我司服务器,网站数据我们提供跨省数据中心每2小时自动备份数据+原机房每天备份。双重备份措施,让您高枕无忧!即使原机房彻底中断,我们也可以在1小时之内全面恢复您的网站!   三.使用者的安全: (1).使用者操作安全:消费、储值扣费、积分兑换时需会员输入密码,从而保障会员积分账户不被盗用。 (2).使用电脑安全注意事项:使用系统的电脑不可轻易下载不明文件,接收不明文件,以防中木马,用户账号和密码被盗,这样盗密者很容易登录系统进行不法操作.如果因此原因造成的数据丢失可即时联

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值