项目介绍
使用房产销售系统分为管理员和用户、销售经理三个角色的权限子模块。
管理员所能使用的功能主要有:首页、个人中心、用户管理、销售经理管理、房源信息管理、房源类型管理、房子户型管理、交易订单管理、预约看房管理、评价管理、我的收藏管理、系统管理等。
用户可以实现首页、个人中心、房源信息管理、交易订单管理、预约看房管理、评价管理、我的收藏管理等。
销售经理可以实现首页、个人中心、房源信息管理、交易订单管理、预约看房管理、评价管理等。
环境要求
1.运行环境:最好是java jdk1.8,我们在这个平台上运行的。其他版本理论上也可以。
2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA;
3.tomcat环境:Tomcat7.x,8.X,9.x版本均可
4.硬件环境:windows7/8/10 4G内存以上;或者Mac OS;
5.是否Maven项目:是;查看源码目录中是否包含pom.xml;若包含,则为maven项目,否则为非maven.项目
6.数据库:MySql5.7/8.0等版本均可;
技术栈
运行环境:jdk8 + tomcat9 + mysql5.7 + windows10
服务端技术:SpringBoot + MyBatis + Vue + Bootstrap + jQuery
使用说明
1.使用Navicati或者其它工具,在mysql中创建对应sq文件名称的数据库,并导入项目的sql文件;
2.使用IDEA/Eclipse/MyEclipse导入项目,修改配置,运行项目;
3.将项目中config-propertiesi配置文件中的数据库配置改为自己的配置,然后运行;
运行指导
idea导入源码空间站顶目教程说明(Vindows版)-ssm篇:
http://mtw.so/5MHvZq
源码地址:http://codegym.top
运行截图
文档截图

项目截图
前台




后台




代码
package com.lyyzoo.gpss.web;
import com.lyyzoo.gpss.entity.system.User;
import com.lyyzoo.gpss.service.system.UserService;
import com.lyyzoo.gpss.util.VCodeGenerator;
import com.lyyzoo.util.Cryptos;
import com.lyyzoo.util.Strings;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import javax.imageio.ImageIO;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.awt.image.BufferedImage;
import java.io.IOException;
/**
 * <p>
 *
 * @author bojiangzhou
 * @date 2017-03-29
 */
@Controller
@RequestMapping("")
public class HomeController extends BaseController {
    @Autowired
    private UserService userService;
    /**
     * 到首页/登录页面
     */
    @RequestMapping(value = {"", "/", "/index", "/login"})
    public String index(){
        return "/index";
    }
    /**
     * 管理员主页
     */
    @RequestMapping("/admin/home")
    public String toHome(){
        return "/home/home";
    }
    /**
     * 登录
     */
        @RequestMapping(value = "/login", method = RequestMethod.POST)
        public String login(String account, String password, String vcode, HttpSession session){
            String redirect = REDIRECT("/login");
            //基本验证
            if(Strings.isNullOrEmpty(account)){
                session.setAttribute("errorMsg", "账号必须填写!");
                return redirect;
            }
            if(Strings.isNullOrEmpty(password)){
                session.setAttribute("errorMsg", "密码必须填写!");
                return redirect;
            }
            if(Strings.isNullOrEmpty(vcode)){
                session.setAttribute("errorMsg", "验证码必须填写!");
                return redirect;
            }
            //验证码
            String sessionVcode = (String) session.getAttribute("vcode");
            if(!vcode.equalsIgnoreCase(sessionVcode)){
                session.setAttribute("errorMsg", "验证码错误!");
                return redirect;
            }
            //验证用户名和密码
            password = Cryptos.encryptMd5(password);
            User loginUser = userService.login(account, password);
            if(loginUser == null){
                session.setAttribute("errorMsg", "账号或密码错误!");
                return redirect;
            }
            if(loginUser.getIsLocked() == User.IsLocked.YES){
                session.setAttribute("errorMsg", "账号已锁定,不能登录!");
                return redirect;
            }
            //保存到session的时候清除密码
            User currentUser = new User();
            BeanUtils.copyProperties(loginUser, currentUser);
            currentUser.setPassword(null);
            //登录成功
            session.setAttribute("currentUser", currentUser);
            return REDIRECT("/admin/home");
        }
    /**
     * 获取验证码
     */
    @RequestMapping("/vcode")
    public void getVCode(HttpSession session, HttpServletResponse response) throws IOException {
        //创建验证码生成器对象
        VCodeGenerator vcGenerator = new VCodeGenerator();
        //生成验证码
        String vcode = vcGenerator.generatorVCode();
        //将验证码保存在session域中,以便判断验证码是否正确
        session.setAttribute("vcode", vcode);
        //生成验证码图片
        BufferedImage vImg = vcGenerator.generatorRotateVCodeImage(vcode, true);
        //输出图像
        ImageIO.write(vImg, "gif", response.getOutputStream());
    }
    /**
     * 退出系统
     */
    @RequestMapping("/logoff")
    public String logoff(HttpSession session){
        session.invalidate();
        return REDIRECT("/");
    }
    @RequestMapping("/function")
    public String function(){
        return "/home/function";
    }
    @RequestMapping("/welcome")
    public String welcome(){
        return "/home/welcome";
    }
    /**
     * 错误页面
     * @param code
     * @return
     */
    @RequestMapping("/error/{code}")
    public String error(@PathVariable String code) {
        return "/error/" + code;
    }
}









