Java项目:JSP家政服务管理系统

133 篇文章 9 订阅

作者主页:源码空间站2022

 简介:Java领域优质创作者、Java项目、学习资料、技术互助

文末获取源码

作者主页:夜未央5788

 简介:Java领域优质创作者、Java项目、学习资料、技术互助

文末获取源码

项目介绍

雇主用户角色包含以下功能:
首页,注册账号,雇主登录,查询家政阿姨,查看供求信息,查看家政公司,阿姨预约,查看我的预约,发布需求信息等功能。

管理员角色包含以下功能:
登录,添加新闻,家政合同管理,家政阿姨管理,审核供应信息,企业用户管理,雇主管理等功能。

家政阿姨角色包含以下功能:
登陆页面,发布供应信息,管理我的预约等功能。

家政公司角色包含以下功能:
登录,发布家政名片等功能。

由于本程序规模不大,可供课程设计,毕业设计学习演示之用

环境需要

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版本;

技术栈

HTML+CSS+JavaScript+jsp+mysql

使用说明

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

4. 运行项目,输入localhost:8080/login.jsp 登录

运行截图

前台页面

 

管理端页面

相关代码 

管理员控制器

@Controller
@RequestMapping("/admin")
public class AdminController extends BaseController{

    @Autowired
    private AdminService adminService;

    /**
     * 跳转管理员页面
     * @return
     */
    @GetMapping("/toAdminIndex")
    public String toAdminIndex() {
        return "admin-index";
    }

    @PostMapping("/getCurrentUsername")
    @ResponseBody
    public ResponseResult<String> getCurrentUsername (
            HttpSession session
    ) {
        ResponseResult<String> result = new ResponseResult<>();
        String username = (String)session.getAttribute("username");
        if (StringUtils.isEmpty(username)) {
            throw new UserNoLoginException();
        } else {
            result.setData(username);
        }
        return result;
    }

    @PostMapping("/selectAllLogin")
    @ResponseBody
    public ResponseResult<List<User>> selectAllLogin () {
        ResponseResult<List<User>> response = new ResponseResult<>();
        List<User> list = adminService.selectAllLogin();
        response.setData(list);
        return response;
    }

    @PostMapping("/selectAllCustomer")
    @ResponseBody
    public ResponseResult<List<Customer>> selectAllCustomer () {
        ResponseResult<List<Customer>> response = new ResponseResult<>();
        List<Customer> list = adminService.selectAllCustomer();
        response.setData(list);
        return response;
    }

    @PostMapping("/insertCustomer")
    @ResponseBody
    public ResponseResult<Void> insertCustomer (
            @RequestParam("nickname") String nickname,
            @RequestParam("name") String name,
            @RequestParam("gender") String gender,
            @RequestParam("phone") String phone,
            @RequestParam("email") String email,
            @RequestParam("password") String password,
            @RequestParam("address") String address
    ) {
        ResponseResult<Void> response = new ResponseResult<>();
        Customer customer = new Customer();
        customer.setCmNickname(nickname);
        customer.setCmName(name);
        customer.setCmSex(gender);
        customer.setCmPhone(phone);
        customer.setCmEmail(email);
        customer.setCmPassword(password);
        customer.setCmAddress(address);
        adminService.insertCustomer(customer);
        return response;
    }

    @PostMapping("/insertAdmin")
    @ResponseBody
    public ResponseResult<Void> insertAdmin (
            @RequestParam("name") String name,
            @RequestParam("gender") String gender,
            @RequestParam("phone") String phone,
            @RequestParam("password") String password
    ) {
        ResponseResult<Void> response = new ResponseResult<>();
        Admin admin = new Admin();
        admin.setAdName(name);
        admin.setAdPassword(password);
        admin.setAdPhone(phone);
        admin.setAdSex(gender);
        adminService.insertAdmin(admin);
        return response;
    }

    @PostMapping("/updateLoginStatus")
    @ResponseBody
    public ResponseResult<Void> updateLoginStatus (
            @RequestParam("") String username
    ) {
        ResponseResult<Void> response = new ResponseResult<>();
        adminService.updateLoginStatus(username);
        return  response;
    }

    @PostMapping("/getOrderData")
    @ResponseBody
    public ResponseResult<List<EchartsData>> getOrderData(){
        ResponseResult<List<EchartsData>> response = new ResponseResult<>();
        List<EchartsData> echartsData = adminService.getOrderData();
        response.setData(echartsData);
        return response;
    }

    @PostMapping("/getAppoimentData")
    @ResponseBody
    public ResponseResult<List<EchartsData>> getAppoimentData(){
        ResponseResult<List<EchartsData>> response = new ResponseResult<>();
        List<EchartsData> echartsData = adminService.getAppoimentData();
        response.setData(echartsData);
        return response;
    }

    @PostMapping("/updateUserInfo")
    @ResponseBody
    public ResponseResult<Void> updateUserInfo (
            @RequestParam("id") String id,
            @RequestParam("password") String password,
            @RequestParam("role") String role,
            @RequestParam("status") String status
    ) {
        adminService.updateUserInfo(Integer.parseInt(id), password, Integer.parseInt(role), Integer.parseInt(status));
        return new ResponseResult<>();
    }

    @PostMapping("/getAllCustomerCertify")
    @ResponseBody
    public ResponseResult<List<Customer>> getAllCustomerCertify () {
        ResponseResult<List<Customer>> result = new ResponseResult<>();
        List<Customer> list = adminService.getAllCustomerCertify();
        result.setData(list);
        return result;
    }

    @PostMapping("/getAllHousekeeperCertify")
    @ResponseBody
    public ResponseResult<List<HouseKeeper>> getAllHousekeeperCertify () {
        ResponseResult<List<HouseKeeper>> result = new ResponseResult<>();
        List<HouseKeeper> list = adminService.getAllHousekeeperCertify();
        result.setData(list);
        return result;
    }

    @PostMapping("/getAllCompanyCertify")
    @ResponseBody
    public ResponseResult<List<Company>> getAllCompanyCertify () {
        ResponseResult<List<Company>> result = new ResponseResult<>();
        List<Company> list = adminService.getAllCompanyCertify();
        result.setData(list);
        return result;
    }

    @PostMapping("/getCustomerByID")
    @ResponseBody
    public ResponseResult<Customer> getCustomerByID (
            @RequestParam("id") String id
    ) {
        ResponseResult<Customer> result = new ResponseResult<>();
        Customer customer = adminService.getCustomerByID(Integer.parseInt(id));
        result.setData(customer);
        return result;
    }

    @PostMapping("/getHousekeeperByID")
    @ResponseBody
    public ResponseResult<HouseKeeper> getHousekeeperByID (
            @RequestParam("id") String id
    ) {
        ResponseResult<HouseKeeper> result = new ResponseResult<>();
        HouseKeeper houseKeeper = adminService.getHousekeeperByID(Integer.parseInt(id));
        result.setData(houseKeeper);
        return result;
    }

    @PostMapping("/getCompanyByID")
    @ResponseBody
    public ResponseResult<Company> getCompanyByID (
            @RequestParam("id") String id
    ) {
        ResponseResult<Company> result = new ResponseResult<>();
        Company company = adminService.getCompanyByID(Integer.parseInt(id));
        result.setData(company);
        return result;
    }

    @PostMapping("/cancelCustomerByID")
    @ResponseBody
    public ResponseResult<Void> cancelCustomerByID (
            @RequestParam("id") String id
    ) {
        adminService.updateCustomerStatusByID(Integer.parseInt(id), 2);
        return new ResponseResult<>();
    }

    @PostMapping("/certifyCustomerByID")
    @ResponseBody
    public ResponseResult<Void> certifyCustomerByID (
            @RequestParam("id") String id
    ) {
        adminService.updateCustomerStatusByID(Integer.parseInt(id), 1);
        return new ResponseResult<>();
    }

    @PostMapping("/cancelHousekeeperByID")
    @ResponseBody
    public ResponseResult<Void> cancelHousekeeperByID (
            @RequestParam("id") String id
    ) {
        adminService.updateHousekeeperStatusByID(Integer.parseInt(id), 2);
        return new ResponseResult<>();
    }

    @PostMapping("/certifyHousekeeperByID")
    @ResponseBody
    public ResponseResult<Void> certifyHousekeeperByID (
            @RequestParam("id") String id
    ) {
        adminService.updateHousekeeperStatusByID(Integer.parseInt(id), 1);
        return new ResponseResult<>();
    }

    @PostMapping("/cancelCompanyByID")
    @ResponseBody
    public ResponseResult<Void> cancelCompanyByID (
            @RequestParam("id") String id
    ) {
        adminService.updateCompanyStatusByID(Integer.parseInt(id), 2);
        return new ResponseResult<>();
    }

    @PostMapping("/certifyCompanyByID")
    @ResponseBody
    public ResponseResult<Void> certifyCompanyByID (
            @RequestParam("id") String id
    ) {
        adminService.updateCompanyStatusByID(Integer.parseInt(id), 1);
        return new ResponseResult<>();
    }

    @PostMapping("/getUserByPhone")
    @ResponseBody
    public ResponseResult<List<User>> getUserByPhone (
            @RequestParam("phone") String phone
    ) {
        ResponseResult<List<User>> result = new ResponseResult<>();
        List<User> list = adminService.getUserByPhone(phone);
        result.setData(list);
        return result;
    }

    @PostMapping("/updatePassword")
    @ResponseBody
    public ResponseResult<Void> updatePassword (
            HttpSession session,
            @RequestParam("oldPassword") String oldPassword,
            @RequestParam("newPassword") String newPassword
    ) {
        adminService.updatePassword(session, oldPassword, newPassword);
        return new ResponseResult<Void>();
    }

}

 如果也想学习本系统,下面领取。关注并回复:057jsp

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值