——————————DescriptionStart——————————
运行环境 Java≥8、MySQL≥5.7
开发工具 eclipse/idea/myeclipse/sts等均可配置运行
适用 课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
基于javaweb的SpringBoot家政服务系统(java+springboot+html+thymeleaf+echarts+maven+mysql)
项目介绍
本项目为后管系统,主要功能包括: 1. 用户的注册、登录、退出系统 2. 用户的搜索功能 3. 家政人员上传资料、身份认证和资格认证 4. 消费者发布预约、查看预约、确认预约、评价订单、删除订单、修改个人资料 5. 家政人员修改个人资料、申请预约、接受订单、取消订单、完成订单 6. 管理员对用户管理、认证管理和系统的量化查看
环境需要
1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。 2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA; 3.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS; 4.数据库:MySql 8.0版本;
技术栈
前端 1. UI界面:Bootstrap 2. 弹窗:Sweetalert 3. Js事件:jQuery/ajax 4. 可视化报表:ECharts 5. 下拉框:Bootstrap-Select 后端 1. 服务层:SpringBoot 2. 持久层:Mybatis 3. 分页:Pagehelper 4. 连接池:c3p0
实体类:Lombok
使用说明 运行项目,在浏览器中输入http://localhost:8081/ 消费者登录账号/密码:18796283605/123456 家政人员登录账号/密码:18860425033/123456 管理员账号/密码:18796283601/123456
——————————CodeStart——————————
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 * Description:验证码生成工具类 */ public class RandomValidateCode { public static final String RANDOMCODEKEY= "RANDOMVALIDATECODEKEY" ; private String randString = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ" ; private int width = 110 ; private int height = 34 ; private int lineSize = 40 ; private int stringNum = 4 ; private Random random = new Random(); private Font getFont () { return new Font("Fixedsys" , Font.CENTER_BASELINE, 18 ); } private Color getRandColor (int fc, int bc) { if (fc > 255 ) fc = 255 ; if (bc > 255 ) bc = 255 ; int r = fc + random.nextInt(bc - fc - 16 ); int g = fc + random.nextInt(bc - fc - 14 ); int b = fc + random.nextInt(bc - fc - 18 ); return new Color(r, g, b); }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 @Service public class HKPersonServiceImpl implements HKPersonService { @Autowired private HKPersonMapper hkPersonMapper; @Autowired private IndexMapper indexMapper; @Override public HouseKeeper selectHKByPhone (HttpSession session) { String phone = (String)session.getAttribute("username" ); if (StringUtils.isEmpty(phone)) { throw new UserNoLoginException("用户未登录" ); } else { return hkPersonMapper.selectHKByPhone(phone); } } @Override public Integer updateHKPerson (HouseKeeper houseKeeper) { return hkPersonMapper.updateHK(houseKeeper); } @Override public Integer certifyHK (HouseKeeper houseKeeper) { return hkPersonMapper.certifyHK(houseKeeper); } @Override public Integer getCertifyStatus (String phone) {
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 orderService.deleteOrderByID(id); return new ResponseResult<>(); } @PostMapping("/getOrderListByHKID") @ResponseBody public ResponseResult<List<Order>> getOrderListByHKID ( HttpSession session ) { ResponseResult<List<Order>> result = new ResponseResult<>(); List<Order> list = orderService.getOrderListByHKID(session); result.setData(list); return result; } @PostMapping("/acceptOrder") @ResponseBody public ResponseResult<Void> acceptOrder ( @RequestParam("id") int id ) { orderService.updateOrderStatusByID(id, 1 ); return new ResponseResult<>(); } @PostMapping("/finishOrder") @ResponseBody public ResponseResult<Void> finishOrder ( @RequestParam("id") int id ) { orderService.updateOrderStatusByID(id, 0 ); return new ResponseResult<>(); } @PostMapping("/cancelOrder") @ResponseBody public ResponseResult<Void> cancelOrder ( @RequestParam("id") int id ) { orderService.cancelOrder(id); return new ResponseResult<>();
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 ) { 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
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 currentPage = 1 ; } PageHelper.startPage(currentPage, PAGESIZE); List<Appointment> list = appMapper.selectAppListByCmID(cmID); PageInfo<Appointment> pageInfo = new PageInfo<>(list); for (Appointment app : list) { List<Integer> applyList = JsonUtil.json2List(app.getApplyJson(), Integer.class); app.setApplyList(applyList); } return pageInfo; } } @Override public PageInfo<Appointment> getAllApp (HttpSession session, int currentPage) { int hkID = 0 ; String username = (String)session.getAttribute("username" ); if (StringUtils.isEmpty(username)) { throw new UserNoLoginException("用户未登录" ); } else { hkID = userMapper.selectHKIDByPhone(username); if (currentPage <= 0 ) { currentPage = 1 ; } PageHelper.startPage(currentPage, PAGESIZE); List<Appointment> list = appMapper.getAllApp(); PageInfo<Appointment> pageInfo = new PageInfo<>(list); for (Appointment app : list) { List<Integer> applyList = JsonUtil.json2List(app.getApplyJson(), Integer.class); app.setApplyList(applyList); app.setHkID(hkID); } return pageInfo; } } @Override public List<Appointment> getAllApp (HttpSession session) { int hkID = 0 ; String username = (String)session.getAttribute("username" ); if (StringUtils.isEmpty(username)) { throw new UserNoLoginException("用户未登录" );
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 @Service public class PersonServiceImpl implements PersonService { @Resource private PersonMapper personMapper; @Resource private UserMapper userMapper; @Override public Customer selectCustomer (HttpSession session) throws UserNoLoginException { String phone = (String)session.getAttribute("username" ); if (StringUtils.isEmpty(phone)) { throw new UserNoLoginException("用户未登录!" ); } else { return personMapper.selectCustomer(phone); } } @Override public Integer updateCustomer (HttpSession session, Customer cm) { Integer result = 0 ; if (session == null ) { throw new UserNoLoginException("用户未登录..." ); } else { String username = session.getAttribute("username" ).toString(); result = personMapper.updateCustomer(cm.getCmNickname(), cm.getCmPhone(), cm.getCmEmail(), cm.getCmHeadPhoto(), username); } return result; } @Override public Integer updatePassword (HttpSession session, String oldPassword, String newPassword) throws UserNoLoginException, PasswordIsErrorException { Integer result = 0 ; String username = new String(); if (session == null ) { throw new UserNoLoginException("用户未登录" ); } else { username = session.getAttribute("username" ).toString(); String tempPwd = userMapper.getPasswordByUsername(username); if (!tempPwd.equals(oldPassword)) { throw new PasswordIsErrorException("原始密码填写错误!" ); } else { userMapper.updatePassword(username, newPassword); result = personMapper.updatePassword(username, newPassword);
——————————PayStart——————————
项目链接: https://javayms.github.io?id=361422312105200io https://javayms.pages.dev?id=361422312105200io